/* ==========================================================================
   Design system — quiet dark surfaces, soft radii, three type sizes.

   Surfaces stack by lightness, never by borders:
     canvas (page) → surface-1 (panel) → surface-2 (card) → surface-3 (control)
   Type: 13 small · 15 body · 28 display. Weights 400 / 500 only.
   Space: 4-pt scale. Radius: 8 · 12 · 16 · 24 · pill.
   Color is reserved for meaning (accent, good, bad, buckets).
   ========================================================================== */

:root {
  /* surfaces */
  --canvas: #000000;
  --surface-1: #070707;
  --surface-2: #0f0f0f;
  --surface-3: #1a1a1a;
  --line: rgba(232, 232, 226, 0.16);
  --line-strong: rgba(232, 232, 226, 0.45);

  /* text */
  --ink: #e8e8e2;
  --muted: #9a9a92;
  --faint: #85857e; /* 5.7:1 on the canvas, 4.7:1 on surface-3: readable as small text */
  --on-ink: #000000;

  /* meaning */
  --accent: #ffb000;          /* amber phosphor — the only hue besides LEDs */
  --accent-ink: #000000;
  --good: #3ddc6a;
  --bad: #ff4d3a;
  --b1: #ffb000;
  --b2: #ff4d3a;
  --b3: #e8e8e2;

  /* type */
  --font: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-display: "VT323", "IBM Plex Mono", ui-monospace, monospace;
  --font-art: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --t-small: 13px;
  --t-body: 15px;
  --t-display: 28px;

  /* space */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  /* radius */
  --r-xs: 0; --r-sm: 0; --r-md: 0; --r-lg: 0; --r-pill: 0;

  /* motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow: 0 0 0 1px var(--line-strong);

  --measure: 680px;
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--canvas); color: var(--ink);
  font: 400 var(--t-body)/1.55 var(--font);
  font-feature-settings: normal;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
strong { font-weight: 500; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--faint); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }

/* shared field look (Email input in the reference) */
.input-row textarea, .widget .comment, .custom-row input, .link-row input,
.widget input[type="url"], .row input {
  border: 1px solid var(--line-strong); background: transparent; border-radius: var(--r-md);
  padding: var(--s3) var(--s4); outline: none; transition: border-color 0.15s;
}
.input-row textarea:focus, .widget .comment:focus, .custom-row input:focus, .link-row input:focus,
.widget input[type="url"]:focus, .row input:focus { border-color: var(--muted); }
::placeholder { color: var(--faint); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 40px; padding: 0 var(--s4); border: 0; border-radius: var(--r-pill);
  background: var(--ink); color: var(--on-ink); font-weight: 500; cursor: pointer;
  transition: opacity 0.15s, transform 0.15s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.3; cursor: default; transform: none; }
.btn.ghost { background: var(--surface-3); color: var(--ink); font-weight: 400; }
.btn.ghost:hover { background: #373739; }
.btn.big { min-height: 48px; padding: 0 var(--s5); }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--s3) var(--s4);
  padding: var(--s4) var(--s4) 0;
  background: color-mix(in srgb, var(--canvas) 85%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: var(--s2); font-weight: 500; white-space: nowrap; }
.brand-mark {
  width: 24px; height: 24px; border-radius: var(--r-xs); background: var(--surface-3);
  background-image: radial-gradient(circle at 50% 50%, var(--ink) 0 3px, transparent 3.5px);
}
.stage {
  justify-self: end; max-width: 100%; font-size: var(--t-small); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stage strong { color: var(--ink); }
.stage .step { margin-right: var(--s2); }
.progress { grid-column: 1 / -1; display: flex; gap: var(--s1); list-style: none; margin: 0; padding: 0 0 var(--s4); }
.progress li {
  position: relative; flex: 1; height: 4px; border-radius: var(--r-pill);
  background: var(--surface-3); transition: background 0.3s; outline: none;
}
/* taller invisible hit area so the 4px lines are easy to hover */
.progress li::before { content: ""; position: absolute; inset: -10px -2px; }
.progress li:hover, .progress li:focus-visible { filter: brightness(1.4); }
/* step name: hidden for sight, read by screen readers, shown as a tooltip on hover/focus */
.progress li span {
  position: absolute; top: 14px; left: 50%; z-index: 1;
  padding: var(--s1) var(--s2); border-radius: var(--r-xs);
  background: var(--surface-3); color: var(--ink); box-shadow: var(--shadow);
  font-size: var(--t-small); white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translate(-50%, -4px); transition: opacity 0.15s, transform 0.15s var(--ease);
}
.progress li:first-child span { left: 0; transform: translate(0, -4px); }
.progress li:last-child span { left: auto; right: 0; transform: translate(0, -4px); }
.progress li:hover span, .progress li:focus-visible span { opacity: 1; transform: translate(-50%, 0); }
.progress li:first-child:hover span, .progress li:first-child:focus-visible span,
.progress li:last-child:hover span, .progress li:last-child:focus-visible span { transform: none; }
.progress li.done { background: var(--muted); }
.progress li.current { background: var(--accent); }

/* ---------- conversation ---------- */
.chat {
  flex: 1; width: 100%; max-width: var(--measure); margin: 0 auto;
  padding: var(--s6) var(--s4) var(--s4);
  display: flex; flex-direction: column; gap: var(--s5);
}
.msg { max-width: 88%; overflow-wrap: anywhere; animation: rise 0.35s var(--ease) both; }
.msg p { margin: 0 0 var(--s3); }
.msg ul { margin: 0 0 var(--s3); padding-left: 1.2em; }
.msg li { margin-bottom: var(--s1); }
.msg p:last-child, .msg ul:last-child { margin-bottom: 0; }
/* the interviewer speaks as plain text; the person answers in a bubble */
.msg.agent { align-self: flex-start; }
.msg.me {
  align-self: flex-end; white-space: pre-wrap;
  background: var(--surface-2); padding: var(--s3) var(--s4); border-radius: var(--r-lg);
}
.msg .thumbs { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
.msg .thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--r-sm); }

/* "Thinking" with a soft shimmer sweeping across the word */
.typing {
  align-self: flex-start; font-size: var(--t-small); color: transparent;
  background: linear-gradient(90deg, var(--faint) 30%, var(--ink) 50%, var(--faint) 70%) 0 0 / 300% 100%;
  -webkit-background-clip: text; background-clip: text; animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.done-note { text-align: center; color: var(--muted); padding: var(--s6) 0; margin: 0; }

/* ---------- composer ---------- */
.composer {
  position: sticky; bottom: 0; width: 100%; max-width: var(--measure); margin: 0 auto;
  padding: var(--s3) var(--s4) var(--s4);
  background: linear-gradient(transparent, var(--canvas) var(--s5));
}
.input-row {
  display: flex; gap: var(--s2); align-items: flex-end;
  background: var(--surface-2); border-radius: var(--r-lg); padding: var(--s2);
  transition: box-shadow 0.15s;
}
.input-row:focus-within { box-shadow: 0 0 0 1px var(--line-strong); }
.input-row textarea {
  flex: 1; resize: none; max-height: 180px; border: 0; border-radius: var(--r-md);
  padding: var(--s2) var(--s3); line-height: 24px;
}
.input-row button {
  flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--ink); color: var(--on-ink); transition: opacity 0.15s, transform 0.15s var(--ease);
}
.input-row button:active { transform: scale(0.94); }
.input-row button:disabled { opacity: 0.3; cursor: default; }
.hint { margin: var(--s2) 0 0; text-align: center; font-size: var(--t-small); color: var(--faint); }

/* quick replies — reaction-style pills */
.suggest { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s3); }
.suggest:empty { display: none; }
.suggest .label { width: 100%; font-size: var(--t-small); color: var(--muted); }
.chip-reply {
  max-width: 100%; text-align: left; cursor: pointer;
  border: 0; border-radius: var(--r-md); background: var(--surface-2);
  padding: var(--s2) var(--s3); font-size: var(--t-small); line-height: 1.45;
  transition: background 0.15s;
}
.chip-reply:hover { background: var(--surface-3); }

/* ---------- widgets (panel → cards → controls) ---------- */
.widget {
  background: var(--surface-1); border-radius: var(--r-lg); padding: var(--s5);
  margin-bottom: var(--s3); max-height: 64vh; overflow: auto;
  box-shadow: 0 0 0 1px var(--line);
  animation: rise 0.35s var(--ease) both;
}
.widget .actions {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s2); flex-wrap: wrap;
  margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line);
}
.widget .comment { width: 100%; margin-top: var(--s4); resize: none; }
.widget .meta, .meta { margin: 0; color: var(--muted); font-size: var(--t-small); }

/* sliders */
.slider + .slider { margin-top: var(--s5); }
.slider .poles { display: flex; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); }
.slider .poles span:last-child { text-align: right; }
.slider input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 32px; margin: 0; background: transparent; cursor: pointer;
}
.slider input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: var(--r-pill);
  background: linear-gradient(var(--line-strong), var(--line-strong)) center / 2px 100% no-repeat, var(--surface-3);
}
.slider input[type="range"]::-moz-range-track { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); }
.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%;
  background: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.slider input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--ink); }

/* pick cards — pills like reactions */
.cards { display: flex; flex-wrap: wrap; gap: var(--s2); }
.card-btn {
  min-height: 40px; padding: 0 var(--s4); border: 0; border-radius: var(--r-pill);
  background: var(--surface-3); cursor: pointer; transition: background 0.15s, color 0.15s;
}
.card-btn:hover { background: #373739; }
.card-btn[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.card-btn[data-bucket="0"] { background: var(--b1); color: var(--on-ink); }
.card-btn[data-bucket="1"] { background: var(--b2); color: var(--on-ink); }
.card-btn[data-bucket="2"] { background: var(--b3); color: var(--on-ink); }
.legend { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: var(--t-small); color: var(--muted); margin-bottom: var(--s4); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: var(--s2); vertical-align: 1px; }
.custom-row { display: flex; gap: var(--s2); margin-top: var(--s4); }
.custom-row input { flex: 1; min-width: 0; border-radius: var(--r-pill); }

/* ranking — stepper-style controls */
.rank { list-style: none; margin: 0; padding: 0; counter-reset: r; display: grid; gap: var(--s2); }
.rank li {
  display: flex; align-items: center; gap: var(--s2);
  padding: var(--s1) var(--s1) var(--s1) var(--s4); border-radius: var(--r-md); background: var(--surface-2);
}
.rank li::before { counter-increment: r; content: counter(r); width: 20px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank li span { flex: 1; }
.rank button {
  width: 40px; height: 40px; border: 0; border-radius: var(--r-sm);
  background: var(--surface-3); cursor: pointer; transition: background 0.15s;
}
.rank button:hover { background: #373739; }
.rank button:disabled { opacity: 0.3; cursor: default; }

/* 2x2 matrix */
.matrix-wrap { display: grid; grid-template-columns: auto 1fr; gap: var(--s2); }
.matrix-wrap .ylab {
  writing-mode: vertical-rl; transform: rotate(180deg);
  display: flex; justify-content: space-between; font-size: var(--t-small); color: var(--muted);
}
.matrix {
  position: relative; aspect-ratio: 1; width: 100%; max-width: 440px; border-radius: var(--r-md);
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) center / 1px 100% no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) center / 100% 1px no-repeat,
    var(--surface-2);
  touch-action: none;
}
.xlab { grid-column: 2; display: flex; justify-content: space-between; max-width: 440px; font-size: var(--t-small); color: var(--muted); }
.chip {
  display: inline-block; padding: var(--s1) var(--s3); border-radius: var(--r-pill);
  font-size: var(--t-small); white-space: nowrap; cursor: grab; user-select: none; touch-action: none;
  background: var(--surface-3); color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.chip.geo { background: var(--accent); color: var(--accent-ink); }
.chip.selected { outline: 2px solid var(--ink); outline-offset: 2px; }
.matrix .chip { position: absolute; transform: translate(-50%, -50%); }
.tray { display: flex; flex-wrap: wrap; gap: var(--s2); min-height: 32px; margin-top: var(--s4); }

/* swipe deck */
.swipe { display: flex; flex-direction: column; align-items: center; gap: var(--s4); }
.swipe-card {
  width: 100%; max-width: 420px; aspect-ratio: 4 / 3; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: var(--s5); border-radius: var(--r-lg); background: #fff; color: #111;
  text-align: center; touch-action: pan-y; user-select: none;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}
.swipe-card .big { font-size: var(--t-display); line-height: 1.15; }
.swipe-card .small { margin-top: var(--s2); opacity: 0.7; }
.swipe-card.is-palette { padding: 0; background: transparent; }
.pal { display: grid; width: 100%; height: 100%; grid-auto-columns: 1fr; grid-auto-rows: 1fr; }
.pal-tile { display: flex; align-items: flex-end; padding: var(--s3); min-width: 0; }
.pal-tile span { font: var(--t-small)/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.04em; opacity: 0.9; }
.swipe-card img { max-width: 80%; max-height: 80%; object-fit: contain; }
.swipe-card .credit { margin-top: var(--s2); font-size: var(--t-small); opacity: 0.6; }
.swipe-buttons { display: flex; gap: var(--s3); }
.swipe-buttons button {
  width: 56px; height: 56px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--surface-3); font-size: 20px; line-height: 1;
  transition: transform 0.15s var(--ease), background 0.15s;
}
.swipe-buttons button:hover { background: #373739; }
.swipe-buttons button:active { transform: scale(0.92); }
.swipe-buttons .nope { color: var(--bad); }
.swipe-buttons .like { color: var(--good); }
.swipe-buttons .love { color: var(--b3); }

/* font specimen — the one place type breaks scale, because it is the content */
.swipe-card.is-font { padding: 0; background: transparent; }
.font-card {
  width: 100%; height: 100%; padding: var(--s5); border-radius: var(--r-lg);
  display: grid; grid-template-rows: auto 1fr auto; background: #f3eee6; color: #141414;
}
.font-card.dark { background: #0a0a0a; color: #f3eee6; box-shadow: inset 0 0 0 1px var(--line); }
.fc-top { display: flex; justify-content: space-between; font: var(--t-small)/1 ui-monospace, "SF Mono", monospace; opacity: 0.5; }
.fc-mark { align-self: center; justify-self: center; font-size: clamp(46px, 12vw, 78px); line-height: 1; white-space: nowrap; }
.fc-caption { justify-self: center; text-transform: uppercase; letter-spacing: 0.2em; font-size: 11px; opacity: 0.6; }

/* logo rounds */
.round-title { margin: 0 0 var(--s4); }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--s2); }
.logo-tile {
  position: relative; aspect-ratio: 1; padding: 0; border: 0; overflow: hidden; cursor: pointer;
  border-radius: var(--r-md); background: #fff; transition: transform 0.15s var(--ease), box-shadow 0.15s;
}
.logo-tile:active { transform: scale(0.97); }
.logo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-tile[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px var(--accent); }
.logo-tile[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: var(--s2); right: var(--s2);
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: var(--t-small); font-weight: 500;
}

/* website gallery */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: var(--s3); margin-top: var(--s3); }
.site-card { border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); transition: opacity 0.2s, box-shadow 0.2s; }
.site-card[data-v="like"] { box-shadow: 0 0 0 2px var(--good); }
.site-card[data-v="nope"] { opacity: 0.45; }
.site-card .thumb { display: block; position: relative; width: 100%; padding: 0; border: 0; cursor: zoom-in; background: #fff; }
.site-card .thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; display: block; }
.site-card .thumb span {
  position: absolute; right: var(--s2); bottom: var(--s2); padding: 2px var(--s2); border-radius: var(--r-pill);
  font-size: var(--t-small); background: rgba(17, 17, 18, 0.72); color: #fff; backdrop-filter: blur(8px);
}
.site-name { font-weight: 500; padding: var(--s3) var(--s3) 0; }
.marks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); padding: var(--s2) var(--s3) var(--s3); }
.mark {
  min-height: 36px; padding: 0 var(--s2); border: 0; border-radius: var(--r-pill); cursor: pointer;
  background: var(--surface-3); font-size: var(--t-small); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mark.yes[aria-pressed="true"] { background: var(--good); color: var(--on-ink); }
.mark.no[aria-pressed="true"] { background: var(--bad); color: var(--on-ink); }

dialog.preview {
  width: min(1100px, calc(100vw - var(--s6))); height: calc(100vh - var(--s7)); padding: 0; border: 0;
  border-radius: var(--r-lg); overflow: hidden; display: none; flex-direction: column;
  background: var(--surface-1); color: var(--ink); box-shadow: var(--shadow);
}
dialog.preview[open] { display: flex; }
dialog.preview::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); }
.browser-bar { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); font-size: var(--t-small); }
.browser-bar .dots i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); margin-right: var(--s1); }
.browser-bar .url {
  flex: 1; min-width: 0; padding: var(--s1) var(--s3); border-radius: var(--r-pill); background: var(--surface-2);
  color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.browser-bar a { color: var(--accent); white-space: nowrap; }
.browser-bar .close { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--surface-3); cursor: pointer; }
.browser-body { flex: 1; overflow-y: auto; background: #fff; }
.browser-body img { width: 100%; display: block; }

/* links */
.link-rows { display: grid; gap: var(--s2); margin: var(--s3) 0; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s2); }
.link-row input, .widget input[type="url"] { width: 100%; }

/* ---------- intro ---------- */
.intro { padding: var(--s5) 0 var(--s7); animation: rise 0.4s var(--ease) both; }
.intro .eyebrow { margin: 0 0 var(--s3); color: var(--muted); }
.intro h1 {
  margin: 0 0 var(--s4); font-size: var(--t-display); font-weight: 500;
  line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance;
}
.intro > p { margin: 0 0 var(--s6); color: var(--muted); max-width: 58ch; }
.intro .how { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: var(--s2); margin-bottom: var(--s6); }
.intro .how div {
  display: flex; flex-direction: column; gap: var(--s1);
  padding: var(--s4); border-radius: var(--r-md); background: var(--surface-2);
}
.intro .how span { color: var(--muted); font-size: var(--t-small); }
.intro .steps {
  list-style: none; counter-reset: s; margin: 0 0 var(--s5); padding: var(--s2) var(--s4);
  border-radius: var(--r-lg); background: var(--surface-1);
}
.intro .steps li {
  counter-increment: s; display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3);
  padding: var(--s3) 0; border-bottom: 1px solid var(--line);
}
.intro .steps li:last-child { border-bottom: 0; }
.intro .steps li span::before {
  content: counter(s, decimal-leading-zero); margin-right: var(--s3);
  color: var(--faint); font-size: var(--t-small); font-variant-numeric: tabular-nums;
}
.intro .steps em { font-style: normal; color: var(--muted); font-size: var(--t-small); white-space: nowrap; font-variant-numeric: tabular-nums; }
.intro h1 .cursor { font-size: 0.75em; vertical-align: 0.04em; }
.intro .fine { margin: 0 0 var(--s5); font-size: var(--t-small); color: var(--faint); }

/* ---------- toast (the "Payment declined" card) ---------- */
.toast {
  position: fixed; left: 50%; bottom: var(--s5); z-index: 30; transform: translateX(-50%);
  max-width: calc(100% - var(--s6)); padding: var(--s3) var(--s4) var(--s3) var(--s7);
  border-radius: var(--r-md); background: var(--surface-2); color: var(--ink); box-shadow: var(--shadow);
  animation: rise 0.3s var(--ease) both;
}
.toast::before {
  content: "!"; position: absolute; left: var(--s4); top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--bad); color: var(--bad);
  display: grid; place-items: center; font-size: 11px; font-weight: 500;
}

/* ---------- small screens ---------- */
@media (max-width: 520px) {
  .top { grid-template-columns: 1fr; }
  .brand { display: none; }
  .stage { justify-self: start; }
  .msg { max-width: 94%; }
  .widget { padding: var(--s4); }
  .link-row { grid-template-columns: 1fr; }
}

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

/* ==========================================================================
   RETRO TERMINAL LAYER — old mission-control console.
   Black ground, phosphor white text, one amber accent, LEDs for status.
   Square corners, 1px rules instead of stacked surfaces, blinking indicators.
   ========================================================================== */

/* CRT scanlines + vignette, never blocks input */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.55) 100%);
}
::selection { background: var(--accent); color: var(--accent-ink); text-shadow: none; }

/* ---------- blinking primitives ---------- */
@keyframes blink { 50% { opacity: 0; } }
@keyframes blink-soft { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.cursor { display: inline-block; margin-left: 0.1em; animation: blink 1s steps(1) infinite; color: var(--accent); }

/* status indicators are plain ASCII asterisks */
.led { display: inline-block; flex: none; margin-right: var(--s2); font-style: normal; font-weight: 500; color: var(--faint); }
.led.on { color: var(--good); }
.led.link { color: var(--accent); animation: blink-soft 2.4s ease-in-out infinite; }
body.busy .led.link { animation: blink 0.18s steps(1) infinite; }

/* ---------- header: console status bar ---------- */
.top {
  grid-template-columns: auto 1fr auto; gap: var(--s2) var(--s5);
  padding: var(--s3) var(--s4) 0;
  background: var(--canvas); backdrop-filter: none; -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--line-strong);
  text-transform: uppercase; letter-spacing: 0.06em; font-size: var(--t-small);
}
.brand { font-weight: 500; letter-spacing: 0.14em; }
.brand .dim, .dim { color: var(--faint); }
.sys { display: flex; gap: var(--s4); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sys span { display: inline-flex; align-items: center; }
.stage { color: var(--muted); }
.stage .step { color: var(--accent); }
/* progress as a segmented block meter */
.progress { gap: 2px; padding: var(--s3) 0 var(--s3); }
.progress li { height: 10px; background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.progress li.done { background: var(--ink); box-shadow: none; }
.progress li.current { background: var(--accent); box-shadow: none; animation: blink-soft 1.6s ease-in-out infinite; }
.progress li span { top: 18px; text-transform: uppercase; background: var(--canvas); }

/* ---------- conversation as a transcript ---------- */
.msg { max-width: 100%; }
.msg.agent, .msg.me { position: relative; padding-left: 0; }
.msg.agent::before, .msg.me::before {
  display: block; margin-bottom: var(--s1);
  font-size: var(--t-small); letter-spacing: 0.08em; text-transform: uppercase;
}
/* questions sit in an outlined block, label cut into the top rule */
.msg.agent {
  align-self: stretch; margin-top: var(--s2); padding: var(--s4);
  border: 1px solid var(--line-strong);
}
.msg.agent::before {
  content: "[ INTERVIEWER ]"; color: var(--accent);
  position: absolute; top: -0.8em; left: var(--s3); margin: 0; padding: 0 var(--s2); background: var(--canvas);
}
.msg.me {
  align-self: stretch; background: transparent; border-left: 2px solid var(--line-strong);
  padding: 0 0 0 var(--s4); color: var(--muted);
}
.msg.me::before { content: "> YOU"; color: var(--faint); }
.msg .thumbs img { border: 1px solid var(--line-strong); }
.typing {
  background: none; color: var(--accent); -webkit-background-clip: border-box; background-clip: border-box;
  animation: none; letter-spacing: 0.1em;
}
.typing .cursor { animation-duration: 0.5s; }
.done-note { text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- composer: command line ---------- */
.composer { background: var(--canvas); border-top: 1px solid var(--line); }
.input-row { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); padding: var(--s1); align-items: center; }
.input-row:focus-within { box-shadow: inset 0 0 0 1px var(--accent); }
.input-row .prompt { padding-left: var(--s2); color: var(--accent); }
.input-row textarea { caret-color: var(--accent); padding: var(--s2); }
.input-row button {
  width: auto; height: 36px; padding: 0 var(--s3); border-radius: 0;
  font-size: var(--t-small); letter-spacing: 0.08em; background: var(--ink); color: var(--on-ink);
}
.input-row button:hover { background: var(--accent); }
.suggest .label { text-transform: uppercase; letter-spacing: 0.08em; }
.chip-reply { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.chip-reply:hover { background: transparent; box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.chip-reply::before { content: "> "; color: var(--faint); }

/* ---------- buttons & controls ---------- */
.btn { text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--t-small); }
.btn:hover:not(:disabled) { background: var(--accent); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.ghost:hover:not(:disabled) { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.widget { background: var(--canvas); box-shadow: 0 0 0 1px var(--line-strong); position: relative; }
.widget::before {
  content: "[ EXERCISE ]"; display: block; width: max-content;
  margin: calc(-1 * var(--s5)) 0 var(--s4) calc(-1 * var(--s2)); padding: var(--s1) var(--s2);
  background: var(--canvas); color: var(--accent); font-size: var(--t-small); letter-spacing: 0.1em;
}
.card-btn, .rank li, .rank button, .mark, .chip, .tray .chip { box-shadow: inset 0 0 0 1px var(--line-strong); }
.card-btn { background: transparent; }
.card-btn:hover { background: var(--surface-3); }
.card-btn[aria-pressed="true"] { box-shadow: none; }
.rank li { background: transparent; }
.rank button { background: transparent; }
.rank button:hover { background: var(--surface-3); }
.slider input[type="range"]::-webkit-slider-thumb { border-radius: 0; width: 12px; height: 22px; margin-top: -8px; background: var(--accent); }
.slider input[type="range"]::-moz-range-thumb { border-radius: 0; width: 12px; height: 22px; background: var(--accent); }
.slider input[type="range"]::-webkit-slider-runnable-track { border-radius: 0; height: 8px; }
.legend i { border-radius: 0; }
.matrix { background:
    linear-gradient(var(--line-strong), var(--line-strong)) center / 1px 100% no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) center / 100% 1px no-repeat,
    repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 10%),
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 10%),
    var(--canvas);
  box-shadow: inset 0 0 0 1px var(--line-strong); }
.chip { box-shadow: inset 0 0 0 1px var(--line-strong); }
.swipe-buttons button { border-radius: 0; background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.logo-tile[aria-pressed="true"]::after { border-radius: 0; }
.site-card { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.browser-bar .dots i, .browser-bar .close { border-radius: 0; }
.toast { box-shadow: 0 0 0 1px var(--bad); text-transform: uppercase; letter-spacing: 0.06em; font-size: var(--t-small); }
.toast::before { border-radius: 0; animation: blink 0.8s steps(1) infinite; }

/* ---------- intro: pre-flight console ---------- */
.intro .eyebrow { display: flex; align-items: center; font-size: var(--t-small); letter-spacing: 0.1em; color: var(--muted); }
.intro h1 {
  font: 400 clamp(40px, 8vw, 64px)/0.95 var(--font-display); letter-spacing: 0.01em; text-transform: uppercase;
}
.intro .how { gap: 0; margin-bottom: var(--s5); box-shadow: inset 0 0 0 1px var(--line-strong); }
.intro .how div { gap: 2px; padding: var(--s2) var(--s3); background: transparent; border-radius: 0; box-shadow: inset 0 0 0 0.5px var(--line-strong); }
.intro .how em { font-style: normal; color: var(--accent); font-size: 10px; letter-spacing: 0.1em; }
.intro .how strong { font: 400 20px/1.1 var(--font-display); letter-spacing: 0.02em; }
.intro .how span { font-size: 11px; line-height: 1.4; }
.steps-head {
  display: flex; justify-content: space-between; padding: var(--s2) var(--s3);
  background: var(--ink); color: var(--on-ink); text-shadow: none;
  font-size: var(--t-small); letter-spacing: 0.1em; font-weight: 500;
}
.intro .steps { background: transparent; padding: 0 var(--s3); box-shadow: inset 0 0 0 1px var(--line-strong); }
.intro .steps li { display: grid; grid-template-columns: 1fr auto auto; gap: var(--s4); border-bottom: 1px dashed var(--line); padding: var(--s2) 0; }
.intro .steps li span::before { content: none; }
.intro .steps li span i { font-style: normal; color: var(--faint); margin-right: var(--s3); }
.intro .status { font-weight: 400; font-size: 11px; letter-spacing: 0.1em; color: var(--faint); align-self: center; }
.intro .status.ready { color: var(--good); animation: blink 1.2s steps(1) infinite; }
.intro h1 .cursor { font-size: 0.75em; vertical-align: 0.04em; }
.intro .fine { text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; }
.intro .launch { width: 100%; min-height: 56px; font-size: var(--t-body); letter-spacing: 0.2em; margin-bottom: var(--s3); }

/* ---------- boot overlay ---------- */
html.booting body { overflow: hidden; }
.boot {
  position: fixed; inset: 0; z-index: 100; background: #000; color: var(--ink);
  font-size: var(--t-small); text-transform: uppercase; letter-spacing: 0.04em;
}
.boot-screen { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: var(--s4); }
.boot .ghost { visibility: hidden; }
.boot .cursor[hidden] { display: inline-block !important; visibility: hidden; }
.boot p { margin: 0; }
.boot-log { margin: 0; font: inherit; color: var(--muted); white-space: pre-wrap; min-height: 7.5em; }
.boot-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s6); }
.boot-logo {
  margin: 0; font: 400 min(2.45vw, 20px)/1 var(--font-art); letter-spacing: 0; text-transform: none;
  color: var(--ink); white-space: pre;
}
.boot-sub { text-align: center; font-size: var(--t-body); line-height: 1.4; }
.boot-foot { text-align: center; display: grid; gap: var(--s2); }
.boot-press { color: var(--accent); }
/* exit: CRT power-off — picture squeezes to a line, the line to a dot, the dot fades,
   then the black backdrop lifts off the page */
.boot::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 100vw; height: 2px;
  background: var(--ink); transform: translate(-50%, -50%) scaleX(0); opacity: 0; pointer-events: none;
}
.boot.off .boot-screen { animation: crt-squeeze 0.35s cubic-bezier(0.6, 0, 0.9, 0.4) forwards; }
.boot.off::after { animation: crt-line 0.75s 0.3s linear forwards; }
.boot.off { animation: crt-lift 0.25s 0.9s ease-out forwards; }
@keyframes crt-squeeze {
  70% { transform: scaleY(0.02); opacity: 1; filter: brightness(2); }
  100% { transform: scaleY(0.002); opacity: 0; }
}
@keyframes crt-line {
  0% { opacity: 1; transform: translate(-50%, -50%) scaleX(1); }
  55% { opacity: 1; transform: translate(-50%, -50%) scaleX(0.006) scaleY(2); }
  80% { opacity: 1; transform: translate(-50%, -50%) scaleX(0.006) scaleY(2); }
  100% { opacity: 0; transform: translate(-50%, -50%) scaleX(0.006) scaleY(2); }
}
@keyframes crt-lift { to { opacity: 0; } }

@media (max-width: 720px) {
  .sys span:nth-child(n + 2) { display: none; }
}
@media (max-width: 520px) {
  .top { grid-template-columns: 1fr auto; }
  .brand { display: flex; }
  .stage { grid-column: 1 / -1; }
  .intro .steps li { grid-template-columns: 1fr auto; }
  .intro .steps li em { display: none; }
  .progress li span { display: none; } /* hover tooltips: no hover on touch, and they overflow */
}

/* ---------- debug panel (?debug) ---------- */
.dbg {
  position: fixed; left: var(--s3); bottom: var(--s3); z-index: 80; max-width: min(360px, calc(100vw - var(--s5)));
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; background: var(--canvas);
  box-shadow: inset 0 0 0 1px var(--bad);
}
.dbg button, .dbg select {
  min-height: 28px; padding: 0 var(--s2); border: 0; border-radius: 0; font: inherit; letter-spacing: inherit;
  background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); cursor: pointer;
}
.dbg select { flex: 1; min-width: 0; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); text-transform: none; }
.dbg .dbg-toggle { width: 100%; box-shadow: none; text-align: left; }
.dbg-body { display: grid; gap: var(--s2); padding: 0 var(--s2) var(--s2); }
.dbg-row { display: flex; gap: var(--s2); }
.dbg pre {
  margin: 0; max-height: 40vh; overflow: auto; padding: var(--s2); white-space: pre-wrap;
  color: var(--muted); text-transform: none; box-shadow: inset 0 0 0 1px var(--line);
}

/* ---------- exercises as modals: ~90% of the viewport, chat dimmed behind ---------- */
#widget:has(.widget) {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  padding: 5vh 4vw; background: rgba(0, 0, 0, 0.88);
}
html:has(#widget:not(.peek) .widget) body { overflow: hidden; }
#widget .widget {
  width: min(1200px, 100%); height: 100%; max-height: none; margin: 0;
  display: flex; flex-direction: column; padding: var(--s5) var(--s6) 0; outline: none;
  overflow: auto; overscroll-behavior: contain;
}
#widget .widget::before { flex: none; margin: 0 0 var(--s4); padding: 0; }
.widget-q {
  margin: 0 0 var(--s5); padding-bottom: var(--s4); border-bottom: 1px dashed var(--line-strong);
  font-size: var(--t-body); max-width: 80ch;
}
.widget-q p { margin: 0 0 var(--s2); }
.widget-q p:last-child { margin-bottom: 0; }
/* comment + actions stay pinned to the bottom edge of the modal */
.composer:has(#widget .widget) { z-index: 60; } /* sticky = own stacking context; lift it over the header */
/* layout inside the modal: question, then the exercise right under it;
   comment + actions pinned to the bottom edge */
#widget .widget > * { flex: none; }
#widget .widget .comment { margin-top: auto; }
#widget .widget > :not(.comment):not(.comment-row):not(.actions):has(+ .actions) { margin-bottom: auto; }
#widget .widget .comment + .actions, #widget .widget .comment-row + .actions { margin-top: var(--s4); }
#widget .widget .actions {
  position: sticky; bottom: 0; margin-top: var(--s4); padding: var(--s4) 0 var(--s5);
  background: var(--canvas); border-top: 1px solid var(--line-strong);
}
/* give the visual decks room to breathe now that there is space */
/* card shrinks on short screens so the verdict buttons stay above the action bar */
#widget .swipe-card { max-width: min(560px, calc((90dvh - 400px) * 4 / 3)); min-width: 240px; }
#widget .matrix, #widget .xlab { max-width: 560px; }

@media (max-width: 520px) {
  #widget:has(.widget) { padding: 0; }
  #widget .widget { padding: var(--s4) var(--s4) 0; box-shadow: none; }
}

/* ---------- exercise instructions ---------- */
.task { margin-bottom: var(--s5); }
.task-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); }
.task-row strong {
  font: 400 26px/1.1 var(--font-display); letter-spacing: 0.02em; text-transform: uppercase; color: var(--accent);
}
.task-row strong::before { content: "> "; color: var(--faint); }
.task-status { flex: none; font-size: var(--t-small); letter-spacing: 0.08em; color: var(--muted); font-variant-numeric: tabular-nums; }
.task-hint { margin: var(--s1) 0 0; font-size: var(--t-small); color: var(--muted); }
.task-hint .legend { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin: 0; }
.task-hint .legend b { font-weight: 500; }

/* ---------- word cards as big square tiles ---------- */
#widget .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s2); }
#widget .card-btn {
  position: relative; aspect-ratio: 1; min-height: 0; padding: var(--s3);
  display: grid; place-items: center; text-align: center;
  font: 400 clamp(22px, 2.4vw, 30px)/1.05 var(--font-display); letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}
#widget .card-btn::before {
  content: "[ ]"; position: absolute; top: var(--s2); left: var(--s3);
  font: 400 var(--t-small)/1 var(--font); color: var(--faint);
}
#widget .card-btn[aria-pressed="true"]::before { content: "[X]"; color: var(--on-ink); }
#widget .card-btn em {
  position: absolute; left: var(--s3); right: var(--s3); bottom: var(--s2);
  font: 400 11px/1.2 var(--font); font-style: normal; letter-spacing: 0.08em; text-transform: uppercase;
}
#widget .card-btn[data-bucket]::before { content: "[*]"; color: var(--on-ink); }
#widget .custom-row { max-width: 560px; }

@media (max-width: 520px) {
  #widget .cards { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  #widget .card-btn { font-size: 20px; }
  .task-row strong { font-size: 22px; }
}

/* sort tiles: the word on top, one button per bucket underneath */
#widget .card-tile {
  position: relative; aspect-ratio: 1; display: grid; grid-template-rows: 1fr auto;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
#widget .card-tile > span {
  display: grid; place-items: center; padding: var(--s3) var(--s2) 0; text-align: center; overflow-wrap: anywhere;
  font: 400 clamp(22px, 2.4vw, 30px)/1.05 var(--font-display); letter-spacing: 0.02em;
}
.tile-opts { display: grid; }
.tile-opts button {
  min-height: 32px; padding: var(--s1) var(--s2); border: 0; border-radius: 0; cursor: pointer;
  background: transparent; color: var(--muted); box-shadow: inset 0 1px 0 var(--line-strong);
  font: 400 11px/1.2 var(--font); letter-spacing: 0.06em; text-transform: uppercase; text-align: left;
}
.tile-opts button::before { content: "( ) "; }
.tile-opts button[aria-pressed="true"]::before { content: "(*) "; }
.tile-opts button:hover { color: var(--ink); background: var(--surface-3); }
#widget .card-tile[data-bucket="0"] { background: var(--b1); color: var(--on-ink); box-shadow: none; }
#widget .card-tile[data-bucket="1"] { background: var(--b2); color: var(--on-ink); box-shadow: none; }
#widget .card-tile[data-bucket="2"] { background: var(--b3); color: var(--on-ink); box-shadow: none; }
#widget .card-tile[data-bucket] .tile-opts button { color: var(--on-ink); box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.35); }
#widget .card-tile[data-bucket] .tile-opts button:hover { background: rgba(0, 0, 0, 0.12); }
#widget .card-tile[data-bucket] .tile-opts button[aria-pressed="true"] { font-weight: 500; }

/* interactions are instant: no easing on hover / press / select (swipe fly-out keeps its motion) */
button, .btn, .card-btn, .chip-reply, .mark, .logo-tile, .site-card, .rank button,
.input-row, .input-row button, .progress li, .progress li span,
input, textarea, select { transition: none !important; }
.btn:active, .input-row button:active, .logo-tile:active, .swipe-buttons button:active { transform: none; }
@media (max-width: 520px) {
  #widget .card-tile > span { font-size: 20px; }
}
#widget .widget, .msg, .intro { animation: none; } /* appear at once, like a terminal */

/* ---------- bigger matrix + logos inside the modal ---------- */
/* matrix takes the height left after question, task, labels, comment and actions;
   the names wait in a column beside it so they don't steal that height */
#widget .matrix-stage { display: flex; gap: var(--s6, 32px); align-items: flex-start; }
#widget .matrix-wrap { flex: none; grid-template-columns: auto min(calc(100vw - 440px), max(420px, calc(90dvh - 310px))); }
#widget .widget > :has(+ .comment) { margin-bottom: var(--s4); }
#widget .matrix, #widget .xlab { max-width: none; }
#widget .tray { flex-direction: column; align-items: flex-start; margin-top: 0; }
#widget .round-title { margin: 0; }
#widget .logo-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s3); }
@media (max-width: 900px) { #widget .logo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  #widget .matrix-stage { display: block; }
  #widget .matrix-wrap { grid-template-columns: auto 1fr; }
  #widget .tray { flex-direction: row; margin-top: var(--s4); }
  #widget .logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#widget .widget .comment { min-height: 46px; }
.task-status { white-space: nowrap; }

/* ---------- imagery board: masonry of Cosmos images, numbered picks ---------- */
.image-grid { columns: 4 160px; column-gap: var(--s3); margin-top: var(--s3); }
.image-cell { position: relative; break-inside: avoid; margin-bottom: var(--s3); }
.image-tile { display: block; width: 100%; padding: 0; border: 0; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); cursor: pointer; transition: opacity 0.2s, box-shadow 0.2s; }
.image-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-tile[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px var(--accent); }
.image-tile.full { opacity: 0.45; }
.image-tile[data-n]:not([data-n=""])::after {
  content: attr(data-n); position: absolute; top: var(--s2); left: var(--s2);
  min-width: 24px; height: 24px; padding: 0 6px;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  font: 500 13px/1 var(--font);
}
.image-cell .zoom {
  position: absolute; right: var(--s2); bottom: var(--s2); width: 32px; height: 32px; border: 0;
  background: rgb(0 0 0 / 0.55); color: #fff; font-size: 15px; cursor: zoom-in; opacity: 0; transition: opacity 0.15s;
}
.image-cell:hover .zoom, .image-cell .zoom:focus-visible { opacity: 1; }
@media (hover: none) { .image-cell .zoom { opacity: 1; } }
.image-preview .image-body { display: grid; place-items: center; overflow: auto; flex: 1; min-height: 0; background: var(--canvas); }
.image-preview .image-body img { max-width: 100%; max-height: 78vh; object-fit: contain; display: block; }
.image-preview .image-actions { display: flex; justify-content: flex-end; padding: var(--s3); }
@media (max-width: 560px) { .image-grid { columns: 2; } }

/* ---------- additions: voice, retry, phase meter, sliders with no view, set-aside exercise ---------- */
/* dictation button: same quiet outline as the other controls, lit while listening */
.mic {
  flex: none; min-width: 48px; height: 40px; padding: 0 var(--s2); border: 0; cursor: pointer;
  background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: var(--t-small); letter-spacing: 0.08em;
}
.input-row .mic { width: auto; border-radius: 0; background: transparent; color: var(--muted); }
.mic:hover, .input-row .mic:hover { color: var(--accent); background: transparent; box-shadow: inset 0 0 0 1px var(--accent); }
.mic[aria-pressed="true"], .input-row .mic[aria-pressed="true"] { color: var(--on-ink); background: var(--bad); box-shadow: none; animation: blink-soft 1.2s ease-in-out infinite; }
.comment-row { display: flex; gap: var(--s2); align-items: stretch; margin-top: var(--s4); }
.comment-row .comment, #widget .widget .comment-row .comment { flex: 1; min-width: 0; margin-top: 0; }
#widget .widget .comment-row { margin-top: auto; }

/* a typed answer that didn't go through */
.retry {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap;
  padding: var(--s3) var(--s4); font-size: var(--t-small); box-shadow: inset 0 0 0 1px var(--bad);
}

/* how far along the current phase is, and the time left overall */
.stage .phase-meter { margin-left: var(--s2); letter-spacing: 2px; color: var(--accent); }
.stage .left { margin-left: var(--s2); color: var(--muted); }

/* a slider nobody touched has no thumb position to read: dim it until it is set */
.slider.unset input[type="range"] { opacity: 0.4; }
.slider.unset input[type="range"]::-webkit-slider-thumb { background: var(--muted); }
.slider.unset input[type="range"]::-moz-range-thumb { background: var(--muted); }
.slider-foot { display: flex; justify-content: space-between; align-items: center; min-height: 24px; margin-top: var(--s1); font-size: var(--t-small); color: var(--muted); letter-spacing: 0.06em; }
.slider:not(.unset) .slider-state { color: var(--accent); }
.slider-clear { border: 0; padding: 0 var(--s1); background: transparent; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.slider-clear:hover { color: var(--ink); }

/* exercise set aside with Escape: the conversation is readable again */
#widget.peek { display: none; }
.back-to { width: 100%; }
.peek-btn {
  align-self: flex-end; margin: 0 0 var(--s3); padding: var(--s1) var(--s2); border: 0; cursor: pointer;
  background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 11px; letter-spacing: 0.08em;
}
.peek-btn:hover { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.matrix .chip:focus-visible, .tray .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the visual part starts here: a gap in the progress bar and a rule in the phase list */
.progress li.part-start { margin-left: var(--s3); }
.intro .steps li.part-start { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px dashed var(--line-strong); }
