/* ============================================================
   RESORSA — Visual System v1.1
   A black workspace illuminated by information. The environment is
   black; charcoal/graphite carries surfaces; white carries the R_
   brandmark and type; blue/teal/green are action; lavender/pink/peach
   are restrained supporting state; the full palette only lights the
   edges. Colour illuminates the black — it never replaces it.
   ============================================================ */

:root {
  /* environment ------------------------------------------------ */
  --bg:            #000000;   /* the application environment: black */
  --bg-deep:       #000000;

  /* surfaces: neutral charcoal / graphite, no blue tint ------- */
  --surface:       #101012;   /* cards, panels */
  --surface-2:     #16161a;   /* nested / banners */
  --surface-3:     #1e1e23;   /* raised / pills */
  --graphite:      #121215;
  --border:        #2b2b31;
  --border-soft:   #202024;

  /* type ----------------------------------------------------- */
  --text:          #f3f3f5;
  --text-muted:    #9c9ca6;
  --text-faint:    #6c6c76;
  --on-accent:     #04121a;

  /* functional accents (action + state) ------------------- */
  --accent:        #3f88f7;   /* blue  */
  --accent-teal:   #26d3c0;   /* teal  */
  --accent-green:  #37d391;   /* green */
  --accent-weak:   rgba(63, 136, 247, .12);

  /* supporting accents (restrained) ----------------------- */
  --lavender:      #b5a9ef;
  --peach:         #f2c8a2;
  --pink:          #eea9c9;

  /* state -------------------------------------------------- */
  --danger:        #f77b6d;
  --danger-bg:     rgba(247, 123, 109, .12);
  --danger-border: rgba(247, 123, 109, .34);
  --ok-bg:         rgba(55, 211, 145, .09);
  --ok-border:     rgba(55, 211, 145, .28);
  --think-bg:      rgba(181, 169, 239, .09);
  --think-border:  rgba(181, 169, 239, .26);
  --warn-bg:       rgba(242, 200, 162, .09);
  --warn-border:   rgba(242, 200, 162, .30);

  /* geometry --------------------------------------------- */
  --radius:        14px;
  --radius-sm:     9px;
  --radius-pill:   999px;
  --shadow:        0 1px 2px rgba(0, 0, 0, .5), 0 20px 50px -24px rgba(0, 0, 0, .8);
  --shadow-sm:     0 1px 2px rgba(0, 0, 0, .5);

  /* rhythm ---------------------------------------------- */
  --sp-1: .35rem;
  --sp-2: .6rem;
  --sp-3: 1rem;
  --sp-4: 1.5rem;
  --sp-5: 2.25rem;
  --maxw: 1120px;

  /* motion: the one R_ blink cadence. The brandmark underscore uses it, and
     any future element that wants to blink in sync (e.g. a custom caret)
     should reuse this token + the `rblink` keyframes rather than restate the
     duration. step-end (hard on/off) is applied at the use site. */
  --resorsa-blink-duration: 1.15s;

  /* fonts: system stack for the app UI; the R_ brandmark uses Space Grotesk,
     loaded via Google Fonts in the page head (display=swap, non-blocking).
     If the network is down the fallback geometric-sans stack below stands. */
  --font:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, monospace;
  --brand: "Space Grotesk", "Futura", "Century Gothic", "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* ---------------------------------------------------------- aurora edge light
   Dim, diffuse, full-spectrum light leaking in from the far LEFT and far
   RIGHT of the viewport. Large, soft, blurred, low-opacity, peripheral.
   The centre of the page stays black. Static CSS only — no animation,
   no canvas, no assets. */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora::before,
.aurora::after {
  content: "";
  position: absolute;
  top: -20%;
  width: 55vw;
  height: 140%;
  filter: blur(88px) saturate(125%);
  opacity: .85;
}
.aurora::before {                 /* left: blue / teal / green */
  left: -20vw;
  background:
    radial-gradient(40% 30% at 16% 14%, rgba(63, 136, 247, .55), transparent 72%),
    radial-gradient(46% 40% at 2%  48%, rgba(38, 211, 192, .46), transparent 74%),
    radial-gradient(44% 40% at 16% 82%, rgba(55, 211, 145, .40), transparent 74%);
}
.aurora::after {                  /* right: lavender / pink / peach */
  right: -20vw;
  background:
    radial-gradient(40% 32% at 84% 14%, rgba(181, 169, 239, .55), transparent 74%),
    radial-gradient(46% 40% at 98% 48%, rgba(238, 169, 201, .46), transparent 74%),
    radial-gradient(44% 40% at 84% 84%, rgba(242, 200, 162, .40), transparent 74%);
}
/* keep the centre black so nothing competes with the content */
.aurora__mask {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(46% 62% at 50% 44%, #000 42%, rgba(0,0,0,.82) 68%, transparent 100%),
    linear-gradient(90deg, transparent 0 6%, #000 26% 74%, transparent 94% 100%);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono { font-family: var(--mono); font-size: .85em; }

/* ---------------------------------------------------------- app shell */

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: 1.4rem 1.15rem;
  background: linear-gradient(180deg, rgba(20, 20, 23, .92), rgba(6, 6, 8, .92));
  border-right: 1px solid var(--border-soft);
  backdrop-filter: blur(6px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  text-decoration: none;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

/* the brandmark: white, Space Grotesk (if present), unboxed */
.rmark,
.brand-hero {
  font-family: var(--brand);
  font-weight: 500;
  color: #ffffff;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  line-height: 1;
  letter-spacing: .01em;
}
.rmark { font-size: 1.2rem; }
.rmark-lg { font-size: 1.5rem; }

.wordmark {
  font-weight: 600;
  letter-spacing: .2em;
  font-size: .9rem;
  color: var(--text);
}

/* the blinking cursor: only the underscore, on auth screens.
   It means "R_ is ready", not "R_ is thinking". Cadence lives in
   --resorsa-blink-duration so it is defined once. */
@keyframes rblink { 0%, 45% { opacity: 1; } 55%, 100% { opacity: 0; } }
.uscore { animation: rblink var(--resorsa-blink-duration) step-end infinite; }
@media (prefers-reduced-motion: reduce) {
  .uscore { animation: none; opacity: 1; }
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .7rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: .92rem;
}
.sidebar nav a:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}
.sidebar nav a.is-active {
  color: var(--text);
  background: var(--accent-weak);
  box-shadow: inset 2px 0 0 var(--accent);
}

.sidebar-foot {
  margin: auto 0 0;
  font-size: .74rem;
  line-height: 1.5;
  color: var(--text-faint);
  border-top: 1px solid var(--border-soft);
  padding-top: var(--sp-3);
}

main {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 2rem clamp(1rem, 4vw, 2.75rem) 4rem;
}
.main-inner { max-width: var(--maxw); margin: 0 auto; }

/* ---------------------------------------------------------- headings */

h1 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 var(--sp-2);
  letter-spacing: -.01em;
}
h2 { font-size: 1.1rem; margin: 0 0 var(--sp-2); }
.page-head { margin-bottom: var(--sp-4); }
.page-head p { margin: .35rem 0 0; color: var(--text-muted); max-width: 62ch; }
.crumb { margin: 0 0 var(--sp-3); font-size: .88rem; }
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--text); }
.progress { color: var(--text-muted); font-size: .85rem; margin: 0 0 var(--sp-4); }

/* ---------------------------------------------------------- flashes */

.flashes { list-style: none; margin: 0 0 var(--sp-4); padding: 0; display: grid; gap: .5rem; }
.flashes li {                        /* graphite banner, small teal cue */
  padding: .65rem .9rem .65rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-teal);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
}

.error {
  color: #ffd7d1;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  padding: .65rem .9rem;
  border-radius: var(--radius-sm);
}
.empty { color: var(--text-muted); }
.meta { color: var(--text-muted); font-size: .85rem; }

/* ---------------------------------------------------------- cards / panels */

.card,
form,
dl,
.assessment,
.exchange,
.done,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel { padding: 1.3rem; }
.panel + .panel { margin-top: var(--sp-3); }
.panel-title {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-faint);
  margin: 0 0 var(--sp-3);
}

/* ---------------------------------------------------------- builds index */

.build-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.build-card {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 1.15rem 1.2rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .14s ease, transform .14s ease;
}
.build-card:hover { border-color: #3a3a42; transform: translateY(-2px); }

.build-card h3 { margin: 0; font-size: 1.06rem; }
.build-card h3 a { color: var(--text); }
.build-card h3 a:hover { color: var(--accent-teal); text-decoration: none; }

.build-card .line {
  font-size: .88rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.build-card .card-foot {
  margin-top: auto;
  padding-top: .7rem;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--text-faint);
}

/* stage + generic pill ----------------------------------- */
.stage,
.pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .16rem .6rem;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------------------------------------------------------- build workspace */

.workspace-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--sp-3) var(--sp-4);
  padding: 1.4rem 1.5rem;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.workspace-head::after {
  content: "";
  position: absolute;
  inset: -50% -12% auto auto;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(38, 211, 192, .08), transparent 70%);
  pointer-events: none;
}
.workspace-head .id-row { flex-basis: 100%; margin: .4rem 0 0; }
.workspace-head h1 { margin: 0; }
.workspace-head .headline-meta {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .55rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  align-items: start;
}

dl.field-list { display: grid; gap: 1rem; padding: 0; background: none; border: 0; box-shadow: none; }
.field-list .field-row dt {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  margin-bottom: .15rem;
}
.field-list .field-row dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.field-list .field-row dd.is-empty { color: var(--text-faint); }

/* primary vs secondary emphasis on the workspace --------- */
.field-primary dd { font-size: 1rem; color: var(--text); }
.field-secondary dd { color: var(--text-muted); font-size: .92rem; }

/* validation status chip on the workspace ---------------- */
.val-summary { display: grid; gap: .7rem; }
.val-summary .conf-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.val-summary .conf-row span:first-child { color: var(--text-muted); font-size: .86rem; }

/* ---------------------------------------------------------- buttons */

button,
.button,
.button-secondary,
.button-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  font-size: .92rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-teal));
  color: var(--on-accent);
  box-shadow: 0 8px 22px -12px var(--accent);
  transition: filter .14s ease, transform .05s ease;
}
button:hover,
.button:hover { filter: brightness(1.08); text-decoration: none; }
button:active,
.button:active { transform: translateY(1px); }

.button-secondary,
button.secondary {
  background: var(--surface-3);
  color: var(--text);
  border-color: #37405a;
  box-shadow: none;
}
.button-secondary:hover,
button.secondary:hover { background: #232a39; border-color: var(--accent); filter: none; }

.button-ghost {
  background: none;
  color: var(--text-muted);
  border-color: transparent;
  box-shadow: none;
  padding-left: .3rem;
  padding-right: .3rem;
}
.button-ghost:hover { color: var(--text); background: none; }

button.link,
.link-danger {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  color: var(--text-faint);
  font-weight: 500;
  font-size: .84rem;
  text-decoration: underline;
}
button.link:hover { color: var(--text-muted); filter: none; }
.link-danger { color: var(--danger); }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem;
  margin-top: var(--sp-3);
}

/* ---------------------------------------------------------- forms */

form { padding: 1.4rem; }
form.bare { background: none; border: 0; box-shadow: none; padding: 0; }
form.quiet { background: none; border: 0; box-shadow: none; padding: 0; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.form-section { display: grid; gap: 1.05rem; }
.form-section + .form-section {
  margin-top: 1.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border-soft);
}
.form-section > legend,
.form-section > .legend {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-faint);
  margin-bottom: .3rem;
  padding: 0;
}

label {
  display: block;
  font-weight: 600;
  font-size: .88rem;
  color: var(--text);
}
label .hint {
  display: block;
  font-weight: 400;
  font-size: .8rem;
  color: var(--text-faint);
  margin-top: .1rem;
}
.required {
  font-weight: 400;
  color: var(--accent-teal);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

input,
textarea,
select {
  display: block;
  width: 100%;
  margin-top: .4rem;
  padding: .6rem .7rem;
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
input::placeholder,
textarea::placeholder { color: var(--text-faint); }
textarea { resize: vertical; min-height: 3.2rem; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-faint) 50%), linear-gradient(135deg, var(--text-faint) 50%, transparent 50%); background-position: calc(100% - 18px) 1.15rem, calc(100% - 13px) 1.15rem; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

/* ---------------------------------------------------------- conversation */

.conversation { list-style: none; margin: 0 0 var(--sp-3); padding: 0; display: grid; gap: .8rem; }

.exchange {
  padding: 0;
  overflow: hidden;
  border-color: var(--border-soft);
}
.exchange .asked,
.exchange .said {
  margin: 0;
  padding: .85rem 1.05rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.exchange .asked {
  display: flex;
  gap: .6rem;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: .9rem;
  border-bottom: 1px solid var(--border-soft);
}
.exchange .asked::before {
  content: "R_";
  font-family: var(--brand);
  font-weight: 500;
  color: #ffffff;
  flex: none;
}
.exchange .said {
  color: var(--text);
}
.exchange .said::before {
  content: "You";
  display: block;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: .2rem;
}
.exchange.accepted { box-shadow: inset 3px 0 0 var(--accent-green); }
.exchange.rejected { box-shadow: inset 3px 0 0 var(--peach); }
.pushback {
  margin: 0;
  padding: .6rem 1.05rem .85rem;
  font-size: .84rem;
  color: var(--peach);
  background: var(--warn-bg);
}

/* the live question --------------------------------------- */
form.ask { padding: 1.3rem; border-color: var(--border); }
.ask-from {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: .5rem;
}
.ask-from .rmark { font-size: .8rem; padding: .12rem .3rem; }
form.ask label {
  display: block;
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: .7rem;
  color: var(--text);
}
form.ask textarea { min-height: 5rem; }
form.ask .actions { justify-content: space-between; margin-top: 1rem; }
.field-tag {
  font-size: .72rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-family: var(--mono);
}

.done {
  padding: 1.3rem;
  margin: 0;
  color: var(--text-muted);
}

/* ---------------------------------------------------------- evidence validation */

.validation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--sp-3);
  align-items: start;
}
.validation-main { min-width: 0; }
.validation-aside { position: sticky; top: 1.25rem; display: grid; gap: var(--sp-3); }

.assessment { padding: 1.35rem; }
.assessment > h2 {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-faint);
  margin: 1.4rem 0 .5rem;
}
.assessment > h2:first-of-type {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-soft);
}

/* confidence — qualitative, never numeric ---------------- */
.confidences {
  display: grid;
  gap: .9rem;
  margin-bottom: .2rem;
}
.conf-item { display: grid; gap: .3rem; }
.conf-item .conf-label {
  font-size: .82rem;
  color: var(--text-muted);
}
.conf-item .conf-value {
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .05em;
}
.conf-track {
  display: flex;
  gap: 3px;
}
.conf-track i {
  height: 5px;
  flex: 1;
  border-radius: 2px;
  background: var(--surface-3);
}
.conf-item[data-level="INSUFFICIENT"] .conf-value { color: var(--text-faint); }
.conf-item[data-level="INSUFFICIENT"] .conf-track i:nth-child(-n+1) { background: var(--text-faint); }
.conf-item[data-level="EMERGING"] .conf-value { color: var(--peach); }
.conf-item[data-level="EMERGING"] .conf-track i:nth-child(-n+2) { background: var(--peach); }
.conf-item[data-level="MODERATE"] .conf-value { color: var(--accent); }
.conf-item[data-level="MODERATE"] .conf-track i:nth-child(-n+3) { background: var(--accent); }
.conf-item[data-level="STRONG"] .conf-value { color: var(--accent-green); }
.conf-item[data-level="STRONG"] .conf-track i { background: var(--accent-green); }

/* know / think / don't know ------------------------------ */
ul.epistemic {
  margin: .1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .4rem;
}
ul.epistemic li {
  font-size: .88rem;
  line-height: 1.5;
  padding: .5rem .7rem .5rem 1.6rem;
  border-radius: var(--radius-sm);
  position: relative;
  overflow-wrap: anywhere;
  list-style: none;
}
ul.epistemic li::before {
  position: absolute;
  left: .6rem;
  top: .5rem;
  font-size: .8rem;
  font-weight: 700;
}
/* dark neutral cards with a restrained state cue, never colour alone */
ul.epistemic li { background: var(--surface-2); border: 1px solid var(--border); }
ul.epistemic.know li    { border-left: 2px solid var(--accent-green); background: var(--ok-bg); }
ul.epistemic.know li::before    { content: "\2713"; color: var(--accent-green); }
ul.epistemic.think li   { border-left: 2px solid var(--lavender); background: var(--think-bg); }
ul.epistemic.think li::before   { content: "\007E"; color: var(--lavender); }
ul.epistemic.unknown li { border-left: 2px solid var(--peach); background: var(--warn-bg); }
ul.epistemic.unknown li::before { content: "?"; color: var(--peach); }
.assessment .empty { font-size: .88rem; padding: .3rem 0; }

/* stop / external-evidence state ------------------------- */
.blocking {
  margin-top: 1.4rem;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.blocking h2 {
  font-size: .95rem;
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 .35rem;
  color: var(--text);
}
.blocking p { margin: .3rem 0 0; font-size: .9rem; color: var(--text-muted); }
.blocking .gap {
  margin-top: .7rem;
  padding: .7rem .85rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  border-left: 3px solid var(--accent-teal);
}
/* not a failure state — graphite with a forward peach cue */
.blocking.external {
  background: var(--surface-2);
  border-color: var(--border);
  border-left: 3px solid var(--peach);
}
.blocking.external h2::before { content: "\2192  "; color: var(--peach); }
.blocking.ready {
  background: var(--surface-2);
  border-color: var(--border);
  border-left: 3px solid var(--accent-green);
}

/* ---------------------------------------------------------- legacy interview panels on the workspace */

.tracks { display: grid; gap: var(--sp-3); margin-top: var(--sp-4); }
.track {
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.track.is-primary { border-color: var(--border); border-left: 3px solid var(--accent); }
.track h2 { font-size: 1rem; margin: 0 0 .3rem; }
.track p { margin: 0 0 .85rem; color: var(--text-muted); font-size: .9rem; }
.track.is-secondary { opacity: .82; }
.track.is-secondary h2 { font-size: .9rem; color: var(--text-muted); }

.past { list-style: none; margin: 1rem 0 0; padding: 0; font-size: .84rem; color: var(--text-muted); display: grid; gap: .1rem; }
.past li { padding: .4rem 0; border-top: 1px solid var(--border-soft); display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.past a { color: var(--text-muted); }
.past a:hover { color: var(--text); }

/* keep old hooks alive ---------------------------------- */
.interviews { margin-top: var(--sp-4); }
.validation-cta { margin-top: var(--sp-4); }
dl { padding: 1.3rem; }
dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }
dd { margin: .2rem 0 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
dd:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: .7rem 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
  }
  .sidebar nav { flex-direction: row; gap: .2rem; margin-left: auto; }
  .sidebar nav a { padding: .45rem .6rem; font-size: .86rem; }
  .sidebar nav a.is-active { box-shadow: inset 0 -2px 0 var(--accent); }
  .sidebar-foot { display: none; }
  main { padding: 1.25rem 1rem 3rem; }
  .workspace-grid { grid-template-columns: 1fr; }
  .validation-layout { grid-template-columns: 1fr; }
  .validation-aside { position: static; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  h1 { font-size: 1.35rem; }
  .build-grid { grid-template-columns: 1fr; }
  .workspace-head { padding: 1.1rem 1.1rem; }
  form { padding: 1.1rem; }
  .actions { gap: .6rem; }
  .actions .button,
  .actions button { width: 100%; }
  form.ask .actions { flex-direction: column-reverse; align-items: stretch; }
  form.ask .actions .field-tag { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------------------------------------------------------- auth */

.sidebar-user {
  margin: auto 0 0;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-soft);
  display: grid;
  gap: .4rem;
  font-size: .8rem;
}
.sidebar-user .user-email,
.sidebar-user .user-name {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user .user-name { color: var(--text); font-weight: 600; }
.sidebar-user .user-tester {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--accent-teal);
  letter-spacing: .04em;
}
.login-alt { margin: 1.1rem 0 0; font-size: .84rem; color: var(--text-faint); position: relative; }
.login-alt a { color: var(--accent); }
.sidebar-user form.quiet { margin: 0; }
.sidebar-user button.link { text-align: left; }

.shell-plain .sidebar nav,
.shell-plain .sidebar-user { display: none; }

/* ---------------------------------------------------------- auth screens
   Black canvas, aurora at the edges, one dominant white R_ in the upper
   half, a charcoal credentials card anchored beneath it. Not one centred
   block — the R_ leads, the card follows. */
.auth-main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(2.5rem, 14vh, 9rem) 1.25rem 3rem;
}
.auth-main .flashes { max-width: 430px; width: 100%; }
.auth-hero {
  margin-bottom: clamp(2rem, 7vh, 4rem);
  line-height: 1;
}
.brand-hero {
  display: inline-block;
  font-family: var(--brand);
  font-size: clamp(4.5rem, 15vw, 8rem);
  font-weight: 500;
  color: #fff;
  letter-spacing: .01em;
}
.brand-hero .uscore { margin-left: .015em; }

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.7rem 1.6rem 1.5rem;
}
.auth-card.wide { max-width: 430px; }
.auth-card h1 {
  font-size: 1.15rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1.1rem;
}
.auth-card form { background: none; border: 0; box-shadow: none; padding: 0; }
.auth-card label { margin-bottom: 1rem; }
.auth-card .actions { margin-top: 1.3rem; }
.auth-card .actions button { width: 100%; }
.auth-card .error { margin-bottom: 1rem; }
.auth-alt { margin: 1.2rem 0 0; font-size: .84rem; color: var(--text-faint); }
.auth-alt a { color: var(--accent); }
.auth-note { margin: 0 0 1.1rem; font-size: .84rem; color: var(--text-muted); }

@media (max-width: 900px) {
  .shell-plain .sidebar { justify-content: flex-start; }
}
@media (max-width: 480px) {
  .auth-main { grid-template-rows: minmax(10vh, .7fr) auto minmax(4vh, 1fr); }
  .auth-hero { margin-bottom: 1.5rem; }
}
