/*
 * The participant's page, from the locked canvas's row 6 (TakeInvite,
 * TakeTalk, TakeApprove): one calm column, a slim header with the promise that
 * nothing is saved yet, the question as the hero, a dot waveform while it
 * listens, and plain cards for everything else.
 *
 * ⚠ LOADED LAST, OVER interview.css AND paper.css. Those keep the drafting
 * machinery (striking and rewording lines, the per-point choices, the sticky
 * approve bar, the confirm dialog, the working loader), which this restyles by
 * redefining the shared tokens rather than rewriting the rules. What this file
 * replaced (the painted two-column room) was deleted from interview.css.
 *
 * ⚠ NO MARKUP WAS RENAMED. Every id app.js reads is where it was; the two
 * columns become one with `display: contents` and `order`.
 */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --line: #e3e0d9;
  --line-soft: #ece9e3;
  --muted: #5e6068;
  --accent: #3341e6;
  --accent-soft: #eceefd;
  --btn: #17181c;
  --btn-ink: #f6f5f1;
  --track: #e9e6e0;
  --good: #1d5e34;
  --good-bg: #e4f1e8;
  --dot: 23, 24, 28;
  --card-shadow: 0 1px 2px rgba(23, 24, 28, 0.04), 0 10px 28px rgba(23, 24, 28, 0.07);

  /* The shared tokens the drafting rules read, retuned to this palette. */
  --ink: #17181c;
  --ink-soft: #5e6068;
  --ink-on-light: #17181c;
  --paper: #f6f5f1;
  --paper-deep: #faf9f6;
  --sunk: #faf9f6;
  --rule: #e3e0d9;
  --teal: #3341e6;
  --green: #17181c;
  --foam: #f6f5f1;
  --coral: #b3261e;
  --lift: 0 1px 2px rgba(23, 24, 28, 0.04), 0 10px 28px rgba(23, 24, 28, 0.07);
  --sans: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: Newsreader, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* The one screen an employee may open at night on their own phone. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e10;
    --surface: #16171a;
    --line: #25272c;
    --line-soft: #1d1f23;
    --muted: #9a9ca3;
    --accent: #8089ff;
    --accent-soft: rgba(128, 137, 255, 0.14);
    --btn: #eceae5;
    --btn-ink: #0d0e10;
    --track: #26282d;
    --good: #86d6a2;
    --good-bg: rgba(90, 190, 125, 0.14);
    --dot: 236, 234, 229;
    --card-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 14px 36px rgba(0, 0, 0, 0.45);

    --ink: #eceae5;
    --ink-soft: #9a9ca3;
    --ink-on-light: #eceae5;
    --paper: #0d0e10;
    --paper-deep: #1a1b1f;
    --sunk: #1a1b1f;
    --rule: #25272c;
    --teal: #8089ff;
    --green: #eceae5;
    --foam: #0d0e10;
    --coral: #f08b7e;
    --lift: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 14px 36px rgba(0, 0, 0, 0.45);
  }
}

/* ---- One column ---- */

html, body { height: auto; }

body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 640px;
  min-height: 100dvh;
  height: auto;
  margin: 0 auto;
  padding: 0 20px 48px;
  overflow: visible;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
}

html { background: var(--bg); }

/* The two old columns dissolve; their sections line up in reading order. */
.sea, .paper { display: contents; }
.sea__ink { order: 1; }
#admit-step { order: 2; }
#promise-step { order: 3; }
#interview-step { order: 4; }
#draft-step { order: 5; }
#done-step { order: 6; }

/* ---- The header and the question ---- */

.sea__ink { display: flex; flex-direction: column; gap: 10px; color: var(--ink); }

.taker-bar { display: flex; align-items: center; gap: 8px; padding: 16px 0 6px; font-size: 13px; }

.wordmark {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  opacity: 1;
}

.wordmark::before {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background:
    radial-gradient(circle at center, var(--btn-ink) 0 2px, transparent 2.5px),
    radial-gradient(circle at center, transparent 0 4px, var(--btn-ink) 4.5px 6px, transparent 6.5px),
    var(--btn);
}

/* Literally true until approval: nothing durable exists before it. Gone once
   the answer is sent. */
.saved-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
body:has(#done-step:not([hidden])) .saved-pill { display: none; }

.asking {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 1;
}

.sea__line {
  margin: 0;
  padding: 0;
  max-width: none;
  background: none;
  text-shadow: none;
  font-family: var(--serif);
  font-size: clamp(26px, 5vw, 32px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.024em;
  color: var(--ink);
}

.sea__note { margin: 0; max-width: none; font-size: 15px; color: var(--muted); }

/* ---- Cards ---- */

.card,
.pane {
  align-self: stretch;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: none;
  color: var(--ink);
  animation: none;
}

.card__title,
.pane__title {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.muted { color: var(--muted); font-size: 14px; }
.notice { color: var(--ink); background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.error, .sea .error { color: var(--coral); background: none; padding: 0; font-size: 14px; font-weight: 600; }

/* Forms: the key, the typed answer, the box for what is missing. */
label { display: block; margin: 12px 0 6px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
input, textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  padding: 10px 14px;
}
input { height: 44px; }
input:focus-visible, textarea:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#manual-key summary { cursor: pointer; margin-top: 10px; font-size: 14px; color: var(--accent); }

/* ---- Buttons ---- */

.btn {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
.btn--go { margin-top: 14px; background: var(--btn); border-color: var(--btn); color: var(--btn-ink); width: 100%; }
.btn--quiet { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--small { min-height: 36px; font-size: 13.5px; padding: 0 12px; border-radius: 10px; }
.btn--leave { background: transparent; color: var(--coral); border-color: var(--line); }
.btn:disabled { opacity: 0.55; cursor: default; }
.actions__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.actions__row .btn { white-space: nowrap; flex: 0 0 auto; width: auto; min-width: 0; margin-top: 0; }
.actions__row #approve { flex: 1 1 auto; }

/* ---- Before you start ---- */

.assurance { font-size: 15px; line-height: 1.6; color: var(--ink); }
.folds { display: flex; flex-direction: column; border-top: 1px solid var(--line-soft); margin-top: 14px; }
.fold { border-bottom: 1px solid var(--line-soft); background: none; border-radius: 0; padding: 0; }
.fold summary { display: flex; align-items: center; gap: 8px; min-height: 48px; cursor: pointer; font-size: 14.5px; font-weight: 500; color: var(--ink); }
.fold__label { flex: 1; }
.fold__tag { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.fold__body, .fold > p, .fold > ul { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.promises { padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: var(--ink); }
.fingerprint code { font-family: var(--mono); font-size: 12px; color: var(--ink); }

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

.talk {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
  background: none;
  border: 0;
}

.mic { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mic__button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 999px;
  border: 0;
  background: var(--btn);
  color: var(--btn-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  box-shadow: none;
  cursor: pointer;
}
.mic__button[aria-pressed="true"] { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.mic__glyph { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }
.mic__label { color: inherit; }
.pause {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.state, .sea .state { background: none; border: 0; padding: 0; color: var(--muted); font-family: var(--sans); font-size: 13.5px; letter-spacing: 0; text-transform: none; }

/* The waveform: dots, the voice's shape (voice.js draws it). */
.wave { height: 170px; margin: 4px 0; background: none; border: 0; }
/* Only while listening, as on the board: at rest it is empty space. */
.talk:not(:has(#mic-button[aria-pressed="true"])) .wave { display: none; }
.wave canvas { width: 100%; height: 100%; display: block; -webkit-mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%); mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%); }

/* Its own height, not the column's leftovers: with the waveform showing, the
   leftovers were about three lines, less than one interviewer turn. This page
   scrolls, so the list can keep a readable size. */
.exchange { flex: none; height: clamp(13rem, 36dvh, 22rem); max-height: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink); }
.exchange .who, .sea .exchange .who { font-family: var(--mono); font-size: 11px; color: var(--muted); opacity: 1; }
/* ⚠ The old room fixed the interviewer's bubble cream, and this theme's dark
   --ink-on-light is light: cream on cream. Background and text both follow the
   theme here, so neither can flip without the other. */
.exchange li.them { background: var(--track); color: var(--ink); }
.exchange li.you .who, .sea .exchange li.you .who { color: inherit; opacity: 0.75; }
.exchange li.dropped { border-color: var(--muted); color: var(--muted); }
.exchange li.dropped .who { opacity: 1; }
.typed { display: flex; flex-direction: column; gap: 8px; }
/* The old room fixed this box cream over the painting; here it follows the theme. */
.typed textarea, #typed { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; }
.typed .btn { align-self: flex-start; }

.progress { background: var(--track); border-radius: 999px; height: 4px; }
.progress__fill { background: var(--accent); border-radius: 999px; }

.pointer { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.pointer__go { margin-left: auto; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }

/* ---- After ---- */

.done-banner { background: var(--good-bg); color: var(--ink); border-radius: 10px; padding: 10px 12px; }
.pane--done .pane__title { font-size: 26px; }
.what-next { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.draft { background: var(--sunk); border-radius: 12px; border: 1px solid var(--line-soft); }

@media (max-width: 600px) {
  body { padding: 0 16px 40px; }
  /* Approve takes its own line on a phone, the loudest thing on the screen. */
  .actions__row #approve { flex: 1 1 100%; }
  .sea__line { font-size: 26px; }
}
