@import url("tokens.css");

/* The components the system sheet specifies, and only those. Anything not on
   DS-01 is not invented here — it is raised as a question instead. */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text-1); }
::selection { background: rgba(232, 163, 60, .25); }

h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 28px; line-height: 34px; letter-spacing: -.015em; }
h2 { font-size: 20px; line-height: 26px; letter-spacing: -.01em; }

.mono { font-family: var(--mono); }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }

/* --------------------------------------------------------------- cursor --
 * The suite's one recurring mark. It always means "waiting on a human": it
 * ends the wordmark, marks the gaps the machine will not fill, and sits in
 * every empty state. It is never used decoratively.
 */
.cursor {
  display: inline-block;
  width: 7px; height: 14px;
  background: var(--accent);
  border-radius: 1.5px;
  margin-left: var(--s2);
  flex: none;
}
.cursor-neutral { background: var(--text-2); }
.cursor-lg { width: 8px; height: 17px; border-radius: 2px; }

/* ------------------------------------------------------------- wordmark -- */
.wordmark { display: inline-flex; align-items: center; font-size: 14px; letter-spacing: -.01em; }
.wordmark b { font-weight: 600; }
.wordmark .slash { color: var(--border-2); margin: 0 7px; }
.wordmark .product { color: var(--text-2); }

/* ------------------------------------------------------------------ nav --
 * 52px · bg/1 · hairline bottom · active tab is text/1 with a 2px accent
 * underline. Those three numbers are from the sheet.
 */
.nav {
  display: flex; align-items: center; gap: var(--s5);
  height: 52px; padding: 0 18px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border-1);
}
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 13px; color: var(--text-2); }
.nav-links a { color: var(--text-2); }
.nav-links a:hover { color: var(--text-1); }
.nav-links a.on {
  color: var(--text-1); font-weight: 500;
  border-bottom: 2px solid var(--accent);
  padding: 15px 0 13px;
}
.spacer { flex: 1; }

/* --------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  font: inherit; font-size: 13px; font-weight: 500;
  border-radius: var(--r-control); padding: 7px 15px;
  border: 1px solid transparent; cursor: pointer;
  transition: background var(--motion), border-color var(--motion), color var(--motion);
}
.btn-primary { background: var(--accent); color: #141415; font-weight: 600; }
.btn-primary:hover { color: #141415; filter: brightness(1.07); }
.btn-secondary { border-color: var(--border-2); color: var(--text-1); background: none; }
.btn-secondary:hover { border-color: var(--text-3); color: var(--text-1); }
.btn-ghost { color: var(--text-2); background: none; padding: 7px 6px; }
.btn-ghost:hover { color: var(--text-1); }
.btn-destructive { border-color: var(--red-line); color: var(--red); background: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* focus — accent border + 3px 18% ring, per the sheet */
:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 163, 60, .18);
}

/* ---------------------------------------------------------------- input -- */
.input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-control);
  color: var(--text-1);
  font: inherit; font-size: 13px;
  padding: 8px 12px;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 163, 60, .18); }
.input::placeholder { color: var(--text-3); }
label.field { display: block; margin-bottom: var(--s4); }
label.field > span {
  display: block; margin-bottom: 6px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .09em; color: var(--text-3); text-transform: uppercase;
}

/* --------------------------------------------------------------- badges --
 * mono 10 caps · tinted 8% bg + 40% border. UNKNOWN stays neutral — the sheet
 * is explicit that it is never dressed up or hidden.
 */
.badge {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase;
  border-radius: var(--r-badge); padding: 2px 8px;
  border: 1px solid var(--border-2); color: var(--text-2);
}
.badge-amber { color: var(--amber); border-color: var(--amber-line); background: var(--amber-bg); }
.badge-red { color: var(--red); border-color: var(--red-line); background: var(--red-bg); }
.badge-green { color: var(--green); border-color: var(--green-line); background: var(--green-bg); }
.badge-violet { color: var(--violet); border-color: var(--violet-line); background: var(--violet-bg); }
.badge-unknown { color: var(--text-2); border-color: var(--border-2); background: none; }

/* ---------------------------------------------------------------- cards -- */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-card);
}
.pad { padding: var(--s5) var(--s6); }

/* ---------------------------------------------------------- empty state --
 * dashed border/2 · neutral cursor block · copy states exactly what to do.
 */
.empty {
  border: 1px dashed var(--border-2);
  border-radius: var(--r-card);
  padding: var(--s6) var(--s5);
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 6px;
}
.empty .cursor { background: var(--border-2); margin: 0 0 var(--s2); width: 9px; height: 19px; }
.empty h3 { font-size: 15px; }
.empty p { font-size: 13px; color: var(--text-2); line-height: 1.55; max-width: 340px; margin: 0; }

/* --------------------------------------------------------------- layout -- */
.wrap { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--s8); }
.stack { display: flex; flex-direction: column; gap: var(--s5); }
.row { display: flex; align-items: center; gap: var(--s3); }

.section-label {
  display: flex; align-items: center; gap: var(--s3);
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .09em; color: var(--text-3); text-transform: uppercase;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--border-1); }

/* ---------------------------------------------------------------- forms -- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: var(--s7) var(--s5); }
.auth-card { width: 100%; max-width: 400px; }
.error {
  border: 1px solid var(--red-line); background: var(--red-bg);
  color: var(--red); border-radius: var(--r-control);
  padding: 10px 12px; font-size: 13px; margin-bottom: var(--s4);
}
.note {
  border: 1px solid var(--border-1); background: var(--bg-1);
  border-radius: var(--r-control); padding: 11px 13px;
  font-size: 12.5px; color: var(--text-2); line-height: 1.6;
}

/* ------------------------------------------------------------- editor --
 * PW-05. The design marks this frame SIGNATURE - THE NEVER-INVENTS-A-CAUSE
 * LAW AS UI, so the amber gap block is not styling here, it is the feature.
 */
.editor { display: flex; height: calc(100vh - 52px); overflow: hidden; }
.rail-left { width: 256px; flex: none; border-right: 1px solid var(--bg-2); padding: 20px 16px; overflow-y: auto; }
.rail-right { width: 320px; flex: none; border-left: 1px solid var(--bg-2); padding: 20px 18px; overflow-y: auto; }
.doc { flex: 1; overflow-y: auto; padding: 40px 60px; }
.doc-in { max-width: 740px; }

.rail-label { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .1em; color: var(--text-3); text-transform: uppercase; margin-bottom: 10px; }
.src { background: var(--bg-1); border: 1px solid var(--border-1); border-radius: 7px; padding: 8px 11px; margin-bottom: 8px; }
.src-name { font-family: var(--mono); font-size: 11.5px; color: var(--text-1); }
.src-meta { font-family: var(--mono); font-size: 10px; color: var(--text-3); margin-top: 2px; }

.outline a { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border-radius: var(--r-control); color: var(--text-2); font-size: 13px; }
.outline a:hover { background: var(--bg-2); color: var(--text-1); }
.outline a.on { background: var(--bg-2); color: var(--text-1); font-weight: 500; }
.outline .st { font-family: var(--mono); font-size: 10.5px; }

.sec { margin-top: 30px; }
.sec-head { display: flex; align-items: center; gap: 12px; }
.sec-key { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .09em; color: var(--text-3); text-transform: uppercase; }
.sec-origin { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.sec-body { font-size: 15px; line-height: 1.85; color: var(--text-1); margin-top: 10px; }

/* the author-added block: visibly NOT evidence */
.authored { border: 1px solid var(--border-1); background: var(--bg-1); border-radius: var(--r-card); padding: 14px 20px; margin-top: 12px; }
.authored-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

.tl { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; }
.tl-row { display: flex; gap: 16px; }
.tl-row .t { color: var(--text-3); width: 58px; flex: none; }
.tl-row .x { color: var(--text-1); flex: 1; }
.tl-row .k { color: var(--text-3); }
.tl-silence { display: flex; align-items: center; gap: 16px; border: 1px dashed var(--amber-line); background: rgba(232,163,60,.04); border-radius: 7px; padding: 7px 12px; }
.tl-silence .t { color: var(--amber); flex: none; width: auto; }

.statusbar { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 20px; border-top: 1px solid var(--border-1); background: var(--bg-0); font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--text-3); }

.ev { background: var(--bg-code); border: 1px solid var(--border-1); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.ev-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--border-1); }
.ev-body { font-family: var(--mono); font-size: 11px; line-height: 1.8; padding: 10px 12px; color: var(--text-3); }
.ev-hit { display: block; background: rgba(232,163,60,.1); color: var(--text-1); margin: 0 -12px; padding: 0 12px; }

/* ------------------------------------------------------- the gap block --
 * The signature component. It was defined inside the landing page's own
 * <style> and therefore did NOT exist on the editor -- the one screen the
 * design calls SIGNATURE. The amber frame is the product's whole claim drawn
 * on the page, so it lives here where every template gets it.
 */
.gap {
  border: 1px dashed var(--amber-line-strong);
  background: var(--amber-wash);
  border-radius: var(--r-card);
  padding: 16px 20px;
}
.gap-head { display: flex; align-items: center; gap: 10px; }
.gap-head .bar { width: 8px; height: 16px; background: var(--accent); border-radius: 2px; flex: none; }
.gap-label { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .09em; color: var(--accent); }

/* A citation, inline in the prose. Clickable evidence, not a footnote. */
.cite {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-2);
  background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: var(--r-badge); padding: 1px 6px; white-space: nowrap;
}
/* violet = machine-authored, suite-wide */
.drafted-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--violet); display: inline-block; }

/* --------------------------------------------------- the blameless diff --
 * DS-01's DIFF component, exactly: a darker pane, mono 12.5/1.75, a 44px
 * gutter, and rows tinted 7% red for what goes and 7% green for what replaces
 * it. The AGENT badge is violet because a machine wrote the replacement.
 */
.diff { background: var(--bg-code); border: 1px solid var(--border-1); border-radius: var(--r-card); overflow: hidden; }
.diff-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 16px; border-bottom: 1px solid var(--border-1); }
.diff-body { font-family: var(--mono); font-size: 12.5px; line-height: 1.75; padding: 12px 0; }
.diff-row { display: flex; }
.diff-row .g { width: 44px; text-align: right; color: var(--text-3); flex: none; padding-right: 12px; }
.diff-row .t { padding-right: 16px; }
.diff-minus { background: rgba(232, 99, 90, .07); }
.diff-minus .t { color: var(--red); }
.diff-plus { background: rgba(79, 190, 139, .07); }
.diff-plus .t { color: var(--green); }
.diff-pair + .diff-pair { margin-top: 8px; }
.diff-actions { display: flex; align-items: center; gap: var(--s2); padding: 10px 16px; border-top: 1px solid var(--border-1); }
