/* Vervly: the Your voice page.

   Loaded after styles.css (tokens, buttons, the switch, .rows, .num),
   footer.css and site.css (the top row, .doc-head, .steps, the rise-in
   animations). This file adds the sample form, the sample and liked lists,
   the trait rows and the How it works list. Rules: web/DESIGN.md. */

.voice-main { padding-top: 0; }
.voice-page .doc-head { padding-bottom: var(--s-2); }
.voice-privacy { margin: 0; font-size: var(--t-1); line-height: 1.5; color: var(--fg-3); max-width: 60ch; }
/* the one honest sentence about what the feature does today */
.voice-early { margin: 0; padding-left: var(--s-3); border-left: 2px solid var(--gold-line); font-size: var(--t-1); line-height: 1.5; color: var(--fg-2); max-width: 60ch; }

/* the top row's balance pill and name, as on the pricing page */
.home-balance { font-size: var(--t-1); color: var(--fg-2); white-space: nowrap; margin-right: var(--s-2); }
.home-balance .num { color: var(--fg); }
.home-who { font-size: var(--t-1); color: var(--fg-2); margin-right: var(--s-2); max-width: 20ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the one line above the sections: sign in, not available, or unreachable */
.voice-notice { margin-top: var(--s-8); max-width: 66ch; line-height: 1.5; }
.voice-notice a, .voice-notice .link-btn { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }
.voice-notice a:hover, .voice-notice .link-btn:hover { color: var(--accent); }
.voice-notice a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* ── use my voice ──────────────────────────────────────────────────────── */
.voice-controls { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-4) var(--s-8); }
.voice-controls .switch-row { min-height: 36px; }
.voice-hint { margin-top: var(--s-3); }
.voice-hint:empty { display: none; }

/* the status lines: one per section, what happened or what to do next */
.voice-status { margin-top: var(--s-3); font-size: var(--t-1); line-height: 1.5; color: var(--fg-2); max-width: 72ch; }
.voice-status:empty { display: none; }
.voice-status[data-state="wait"]  { color: var(--accent); }
.voice-status[data-state="ok"]    { color: var(--human); }
.voice-status[data-state="error"] { color: var(--ai); }
.voice-status[data-state="note"]  { color: var(--fg-3); }

/* ── the sample form ───────────────────────────────────────────────────── */
.sample-form { display: grid; gap: var(--s-3); max-width: 72ch; }
.sample-form .text-input { max-width: 36ch; }
/* the writing surface: the Facts fold's input, taller, in the reading face */
.voice-input {
  width: 100%;
  max-width: 72ch;
  min-height: calc(8 * 1.6 * var(--t-3) + 2 * var(--s-3));
  resize: vertical;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--g1);
  color: var(--fg);
  font-family: var(--serif);
  font-size: var(--t-3);
  line-height: 1.6;
  transition: border-color var(--fast) var(--ease);
}
.voice-input:hover { border-color: var(--accent-line); }
.voice-input:focus { outline: none; border-color: var(--accent); }
.voice-input::placeholder { color: var(--fg-3); font-family: var(--sans); }
.voice-input[disabled] { color: var(--fg-3); border-color: var(--line); cursor: not-allowed; }
.sample-act { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-4); }
.sample-count { margin: 0; font-size: var(--t-1); color: var(--fg-3); }
.sample-count .num { color: var(--fg-2); }
.sample-count[data-short="1"], .sample-count[data-short="1"] .num { color: var(--mixed); }
.voice-limits { margin-top: var(--s-4); font-size: var(--t-1); line-height: 1.5; color: var(--fg-3); }
.voice-empty { margin-top: var(--s-4); font-size: var(--t-2); line-height: 1.5; color: var(--fg-3); max-width: 60ch; }

/* ── the lists: one row per sample or liked rewrite, on hairlines ──────── */
.sample-list { display: grid; margin-top: var(--s-4); }
.sample-list:empty { display: none; }
.sample {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--s-5); row-gap: var(--s-2);
  padding: var(--s-4) 0;
  border-top: 1px solid var(--line);
}
.sample:last-child { border-bottom: 1px solid var(--line); }
.sample-main { min-width: 0; display: grid; gap: var(--s-2); }
.sample-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s-1) var(--s-3); }
.sample-title { font-weight: 500; font-size: var(--t-3); color: var(--fg); line-height: 1.3; overflow-wrap: anywhere; }
.sample-words { font-size: var(--t-1); color: var(--fg-3); white-space: nowrap; }
.sample-state { font-size: var(--t-1); color: var(--fg-2); white-space: nowrap; }
.sample-state[data-status="preparing"] { color: var(--accent); }
.sample-state[data-status="failed"] { color: var(--ai); }
.sample-excerpt { margin: 0; font-family: var(--serif); font-size: var(--t-3); line-height: 1.6; color: var(--fg-2); max-width: 66ch; overflow-wrap: anywhere; }
.sample-detail { margin: 0; font-size: var(--t-1); line-height: 1.5; color: var(--fg-3); max-width: 66ch; }
.sample-acts { display: flex; align-items: flex-start; gap: var(--s-2); }
.sample-acts .btn-quiet[data-confirm="1"] { color: var(--ai); border-color: var(--line-2); }

/* ── what it learned: label left, value right, the note under it ───────── */
.voice-rows { margin-top: var(--s-2); }
.voice-rows:empty { display: none; }
.voice-page .row { grid-template-columns: 14em minmax(0, 1fr); padding: var(--s-3) 0; font-size: var(--t-2); }
.voice-page .row:last-child { border-bottom: 1px solid var(--line); }
.voice-page .row-k { line-height: 1.5; }
.voice-page .row-v { line-height: 1.5; }
.row-note { display: block; margin-top: var(--s-1); font-size: var(--t-1); line-height: 1.5; color: var(--fg-3); max-width: 60ch; }

/* ── what you liked ────────────────────────────────────────────────────── */
.voice-count { margin: 0; font-size: var(--t-2); line-height: 1.5; color: var(--fg-2); max-width: 60ch; }
.voice-note { margin-top: var(--s-4); font-size: var(--t-1); line-height: 1.5; color: var(--fg-3); max-width: 66ch; }

/* ── how it works: a plain list ────────────────────────────────────────── */
.voice-page .how-list { padding-left: var(--s-5); max-width: 66ch; color: var(--fg-2); font-size: var(--t-3); line-height: 1.6; }
.voice-page .how-list li { margin: var(--s-2) 0; }
.voice-page .how-list li::marker { color: var(--fg-3); }

/* ── motion: the sections rise in turn, after the two site.css already times ─ */
.page-doc .steps:nth-of-type(3) { animation-delay: 280ms; }
.page-doc .steps:nth-of-type(4) { animation-delay: 340ms; }
.page-doc .steps:nth-of-type(5) { animation-delay: 400ms; }
.voice-notice { animation: rise-in 280ms var(--ease) 120ms both; }

/* ── narrow screens ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .voice-main { padding-top: var(--s-8); }
  .home-balance { display: none; }
  .voice-controls { gap: var(--s-4); }
  .voice-controls .switch-row { min-height: 44px; }
  .sample-form .text-input { max-width: none; min-height: 44px; font-size: var(--t-3); }
  .voice-page select { min-height: 44px; font-size: var(--t-3); }
  .voice-page .btn { min-height: 44px; }
  .voice-input { font-size: var(--t-3); }
  .sample-act .btn-primary { flex: 1 1 auto; }
  .sample { grid-template-columns: minmax(0, 1fr); }
  .sample-acts { justify-content: flex-start; }
  .voice-page .row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .voice-notice { animation: none; }
}

/* the file chip sits after the count, at the end of the action row */
.sample-upload { margin-left: auto; }
.sample-upload[data-busy="1"] { color: var(--fg-3); border-color: var(--line); }
@media (max-width: 600px) { .sample-upload { margin-left: 0; } }
