/* Preia workspace. One stylesheet, no framework, no remote font or script, so the
   interface works on an isolated machine and cannot leak a record to a third
   party. Colours are tokens defined once and remapped for a dark environment. */

:root {
  color-scheme: light;
  --ground: #f6f6f4;
  --surface: #ffffff;
  --surface-sunken: #f0f0ed;
  --line: #d9d8d2;
  --line-strong: #bab9b1;
  --ink: #1d1d1b;
  --ink-soft: #55554f;
  --ink-faint: #7c7b73;
  --accent: #1f4f7a;
  --accent-ink: #ffffff;
  --accent-soft: #e7eef5;
  --pending: #8a5a00;
  --pending-soft: #fbf0dc;
  --danger: #9a2a20;
  --danger-soft: #fbe9e7;
  --good: #1f6135;
  --good-soft: #e6f1e9;
  --focus: #1f4f7a;
  --radius: 5px;
  --nav-width: 232px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #17181a;
    --surface: #1f2123;
    --surface-sunken: #191b1d;
    --line: #34373a;
    --line-strong: #4b4f53;
    --ink: #e8e8e6;
    --ink-soft: #b4b6b5;
    --ink-faint: #8b8e8e;
    --accent: #7fb3de;
    --accent-ink: #10222f;
    --accent-soft: #23323f;
    --pending: #e0a94a;
    --pending-soft: #33291a;
    --danger: #ef9c92;
    --danger-soft: #3a2320;
    --good: #85c79b;
    --good-soft: #1d2f24;
    --focus: #7fb3de;
  }
}

* { box-sizing: border-box; }

/* A display rule anywhere below would otherwise defeat the hidden attribute,
   which is how visibility is toggled throughout the workspace. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 14px/1.5 system-ui, -apple-system, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 600; }
h1 { font-size: 1.15rem; }
h2 { font-size: 1rem; }
h3 { font-size: 0.875rem; }
p { margin: 0 0 0.75rem; }
p:last-child { margin-bottom: 0; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.8125rem; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---- layout ---------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100vh;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.625rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar .brand { font-weight: 600; letter-spacing: 0.01em; }
.topbar .spacer { flex: 1 1 auto; }
.topbar dl { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: 0; font-size: 0.8125rem; }
.topbar dt { color: var(--ink-faint); }
.topbar dd { margin: 0 0 0 0.375rem; }
.topbar div.pair { display: flex; }

nav.side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 0.75rem 0.5rem;
}

nav.side ul { list-style: none; margin: 0; padding: 0; }
nav.side li + li { margin-top: 2px; }

nav.side button {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none;
  color: var(--ink-soft);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

nav.side button:hover { background: var(--surface-sunken); color: var(--ink); }
nav.side button[aria-current="page"] {
  background: var(--accent-soft);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 600;
}
nav.side .group {
  padding: 0.75rem 0.625rem 0.25rem;
  font-size: 0.6875rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

main { padding: 1rem 1.25rem 3rem; min-width: 0; }
.viewhead { margin-bottom: 1rem; max-width: 62ch; }
.viewhead p { color: var(--ink-soft); }

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

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
}
.panel + .panel { margin-top: 0.75rem; }
.panel > h2, .panel > h3 { margin-bottom: 0.625rem; }

.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 6fr); gap: 0.75rem; align-items: start; }

.notice {
  display: flex;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.notice strong { color: var(--ink); }
.notice.pending { border-left-color: var(--pending); background: var(--pending-soft); }
.notice.bad { border-left-color: var(--danger); background: var(--danger-soft); }
.notice.good { border-left-color: var(--good); background: var(--good-soft); }
.notice + .notice, .notice + .panel, .panel + .notice { margin-top: 0.75rem; }

/* ---- tables ---------------------------------------------------------- */

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
caption { text-align: left; color: var(--ink-faint); padding-bottom: 0.5rem; }
th, td { text-align: left; padding: 0.5rem 0.625rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-faint); font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: var(--surface-sunken); }
tbody tr[aria-selected="true"] { background: var(--accent-soft); }
td button.rowpick {
  border: 0; background: none; padding: 0; font: inherit; color: var(--accent);
  cursor: pointer; text-align: left; text-decoration: underline;
}
td button.rowpick.idcell {
  display: block;
  max-width: 17ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  display: inline-block;
  padding: 0.0625rem 0.375rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.6875rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.tag.pending { border-color: var(--pending); color: var(--pending); }
.tag.bad { border-color: var(--danger); color: var(--danger); }
.tag.good { border-color: var(--good); color: var(--good); }

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

.field { margin-bottom: 0.75rem; }
.field > label, fieldset > legend { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.field .hint { display: block; color: var(--ink-faint); font-size: 0.75rem; margin-top: 0.25rem; }

input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="tel"], input[type="date"], input[type="datetime-local"], select, textarea {
  width: 100%;
  padding: 0.5rem 0.625rem;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
textarea { min-height: 96px; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-sunken); color: var(--ink-faint); }

fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem; margin: 0 0 0.75rem; }
.choice { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.375rem; }
.choice input { margin: 0.25rem 0 0; flex: none; }
.choice label { font-weight: 400; }
.document-rejection-reasons { min-width: 0; }
.document-rejection-reasons fieldset { min-width: 0; }
.document-rejection-preview { white-space: pre-wrap; overflow-wrap: anywhere; }

.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.875rem; }

button.primary, button.secondary, button.destructive {
  min-height: 38px;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.destructive { color: var(--danger); border-color: var(--danger); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.counter { font-variant-numeric: tabular-nums; color: var(--ink-faint); font-size: 0.75rem; }
.counter.over { color: var(--danger); font-weight: 600; }

/* ---- small parts ----------------------------------------------------- */

dl.record { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.25rem 0.875rem; font-size: 0.8125rem; }
dl.record dt { color: var(--ink-faint); }
dl.record dd { margin: 0; overflow-wrap: anywhere; }

ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 0.25rem 0; border-bottom: 1px solid var(--line); font-size: 0.8125rem; }
ul.plain li:last-child { border-bottom: 0; }

ul.bullets { margin: 0 0 0 1.1rem; padding: 0; font-size: 0.8125rem; color: var(--ink-soft); }

details.private { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 0.5rem 0.75rem; }
details.private > summary { cursor: pointer; font-weight: 600; font-size: 0.8125rem; }
details.private[open] > summary { margin-bottom: 0.625rem; }

.empty { color: var(--ink-faint); padding: 1.25rem 0; text-align: center; font-size: 0.8125rem; }
.loading { color: var(--ink-faint); font-size: 0.8125rem; }
.pager { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.75rem; font-size: 0.8125rem; color: var(--ink-faint); }

.cap { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.5rem 0.875rem; align-items: baseline; }
.cap.cap-plain { grid-template-columns: minmax(0, 1fr); }
.cap > .tag { margin-top: 0.125rem; }
.cap p { margin: 0; }
.cap .contract { color: var(--ink-faint); font-size: 0.75rem; }
.caplist > li { padding: 0.625rem 0; }

/* ---- sign in --------------------------------------------------------- */

.centered {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem 1rem;
}
.card { width: 100%; max-width: 27rem; }

/* ---- narrow ---------------------------------------------------------- */

@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .cap { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
}

@media (max-width: 720px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  nav.side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.5rem;
  }
  nav.side ul { display: flex; flex-wrap: wrap; gap: 2px; }
  nav.side li + li { margin-top: 0; }
  nav.side button { width: auto; }
  nav.side .group { display: none; }
  main { padding: 0.875rem 0.875rem 3rem; }
  .topbar dl { font-size: 0.75rem; }
}

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

/* Utility classes exist because the content policy forbids inline style
   attributes; every rule has to live in this file. */
.muted { color: var(--ink-soft); }
#announce { overflow-wrap: anywhere; }
.faint { color: var(--ink-faint); }
.gap-top { margin-top: 0.75rem; }

.test-guide { margin-bottom: 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.test-guide > p { margin-top: 0.75rem; }
.test-guide > summary { cursor: pointer; }
.test-guide > summary h2 { display: inline; margin: 0; }
.test-guide-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 2rem; padding-left: 1.5rem; margin: 1.25rem 0; }
.test-guide-steps h3 { font-size: 0.9375rem; margin-bottom: 0.5rem; }
.test-guide-steps p { margin-bottom: 0.75rem; }
.test-guide-steps button { max-width: 100%; white-space: normal; }
@media (max-width: 720px) { .test-guide-steps { grid-template-columns: minmax(0, 1fr); } }
.nowrap { white-space: nowrap; }
.rowgap { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: flex-end; }
.rowgap > .field { margin-bottom: 0; flex: 1 1 12rem; }
#view-delivery fieldset, #view-delivery .field { min-width: 0; }
#delivery-file { width: 100%; max-width: 100%; }

/* An in-page confirmation instead of a modal dialog: it can be styled, read by a
   screen reader in place, and driven by a test the same way a person drives it. */
.confirm {
  margin-top: 0.875rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface-sunken);
}
.confirm h4 { margin: 0 0 0.375rem; font-size: 0.875rem; }
.confirm p { margin: 0 0 0.5rem; font-size: 0.8125rem; color: var(--ink-soft); }
.confirm .actions { margin-top: 0.75rem; }

.recent { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: baseline; }
.recent .grow { flex: 1 1 14rem; }
.recent button {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  border-radius: var(--radius); padding: 0.25rem 0.625rem; min-height: 32px;
  font: inherit; font-size: 0.8125rem; cursor: pointer;
}

/* A status chooser should not stretch to fill the row the way a text field does. */
.rowgap > .field.narrow { flex: 0 1 12rem; }

/* Nested panels inside the case panel: the two terms columns. */
.panel .panel { padding: 0.625rem 0.75rem; background: var(--surface-sunken); }
.panel .panel h4 { margin: 0 0 0.5rem; font-size: 0.8125rem; }

/* Language picker in the top bar. */
/* The global select rule stretches to the container; the picker must stay a
   control-sized item in a wrapping bar. */
.langpick { width: auto; flex: 0 0 auto; min-height: 34px; padding: 0.25rem 0.5rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; font-size: 0.8125rem; }
.centered .langpick { margin-bottom: 0.75rem; }

/* Landing page. The ask bar is the one prominent thing on the page; the rest is
   the same restrained density as everywhere else. */
.ask-label { display: block; font-weight: 600; font-size: 1rem; margin-bottom: 0.5rem; }
.ask-row { display: flex; gap: 0.5rem; }
.ask-row input { flex: 1 1 auto; font-size: 1rem; min-height: 44px; }
.ask-row button { flex: 0 0 auto; min-height: 44px; }
.stat { display: flex; align-items: baseline; gap: 0.75rem; margin: 0.5rem 0 0.25rem; }
.stat-number { font-size: 2.25rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--ink-soft); }
.legend { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0.75rem 0 0; }
.result { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: baseline; }
.result .grow { flex: 1 1 14rem; }


/* Public product page. Restrained: measured text, rows that stack on a phone,
   the same tokens as the workspace. The one picture is a still of the workspace
   made from the workspace's own parts, so it cannot drift from the product. */
body.public { background: var(--surface); }
.public-top, .public-foot { display: flex; align-items: center; gap: 1rem; padding: 0.875rem 1.25rem; max-width: 68rem; margin: 0 auto; }
.public-top .brand { font-weight: 600; font-size: 1.125rem; color: var(--ink); text-decoration: none; }
.public-top .spacer, .public-foot .spacer { flex: 1 1 auto; }
.public-nav { display: flex; gap: 1rem; font-size: 0.875rem; }
.public-nav a { color: var(--ink-soft); text-decoration: none; }
.public-nav a:hover { color: var(--ink); text-decoration: underline; }
.public-main { max-width: 68rem; margin: 0 auto; padding: 1rem 1.25rem 3rem; }
a.button, span.button {
  display: inline-block; min-height: 38px; padding: 0.5rem 0.875rem; border-radius: var(--radius);
  border: 1px solid var(--line-strong); font-weight: 600; text-decoration: none; background: var(--surface); color: var(--ink);
  line-height: 1.4; box-sizing: border-box;
}
a.button.primary, span.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.public-main .hero { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 7fr); gap: 2.5rem; align-items: center; padding: 2.5rem 0; max-width: none; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.75rem; margin: 0 0 0.75rem; }
.hero h1 { font-size: 2.25rem; line-height: 1.15; margin: 0 0 1rem; }
html[lang^="zh"] .hero h1 { font-size: 2rem; }
.lede { font-size: 1.125rem; line-height: 1.6; color: var(--ink-soft); margin: 0; }
.cta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0 0; }
.demo { margin: 0; min-width: 0; }
.demo-screen {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0.75rem;
  padding: 0.75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ground);
  font-size: 0.8125rem; user-select: none;
}
.demo-queue, .demo-case { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.625rem 0.75rem; min-width: 0; }
.demo-title { margin: 0 0 0.5rem; font-weight: 600; }
.demo-label { margin: 0.5rem 0 0.25rem; color: var(--ink-faint); font-size: 0.75rem; font-weight: 600; }
.demo-screen table { font-size: 0.75rem; }
.demo-screen th, .demo-screen td { padding: 0.375rem 0.375rem; white-space: normal; }
.demo-screen .rowlink { color: var(--accent); text-decoration: underline; }
.demo-screen ul.plain li { display: flex; gap: 0.375rem; align-items: baseline; padding: 0.2rem 0; border-bottom: 1px solid var(--line); }
.demo-screen .notice { margin-top: 0.625rem; }
.demo-screen .turn { margin-top: 0.625rem; }
.demo-screen .turn-body { font-size: 0.8125rem; }
.demo-screen .confirm { margin-top: 0.625rem; }
.demo-screen .confirm .actions { margin-top: 0.5rem; }
.demo-screen span.button { min-height: 30px; padding: 0.25rem 0.625rem; font-size: 0.75rem; }
.demo figcaption { margin-top: 0.5rem; color: var(--ink-faint); font-size: 0.75rem; }
.principles, .how, .today { padding: 2rem 0; border-top: 1px solid var(--line); }
.principles h2, .how h2, .today h2 { font-size: 1.25rem; margin: 0 0 1.25rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 1.25rem; }
.principle h3, .role h3 { font-size: 1rem; margin: 0 0 0.5rem; }
.principle p, .role p, .today p { margin: 0; color: var(--ink-soft); line-height: 1.6; }
.today p { max-width: 46rem; }
.today ul.bullets { font-size: 0.9375rem; line-height: 1.6; }
.today ul.bullets li + li { margin-top: 0.25rem; }
.today p.faint { margin-top: 1.25rem; font-size: 0.8125rem; }
.public-foot { border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 0.8125rem; }
.public-foot a { color: var(--ink-faint); }
@media (max-width: 900px) {
  .public-main .hero { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
}
@media (max-width: 720px) {
  .public-top { flex-wrap: wrap; gap: 0.5rem 0.75rem; }
  .public-nav { display: none; }
  .public-main .hero { padding: 1.5rem 0; }
  .hero h1, html[lang^="zh"] .hero h1 { font-size: 1.625rem; }
  .demo-screen { grid-template-columns: minmax(0, 1fr); }
  .grid3, .grid2 { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
}

/* Outreach history: one row per source event, time in its own column. */
ol.timeline { list-style: none; margin: 0; padding: 0; }
/* Six columns cannot share a phone; the reference list scrolls sideways
   inside its wrapper instead of breaking names one character per line. */
#view-opportunities table { min-width: 42rem; }
ol.timeline li { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 0.125rem 0.75rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); font-size: 0.8125rem; }
ol.timeline time { color: var(--ink-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
ol.timeline .block { display: block; }
.block { display: block; }
.small { font-size: 0.75rem; }
@media (max-width: 720px) { ol.timeline li { grid-template-columns: minmax(0, 1fr); } }

/* A conversation placeholder: the shape of a replyable exchange with nothing
   in it. Same spine as an agent turn, sunken so it reads as reserved space. */
.conversation { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--surface-sunken); padding: 0.625rem 0.875rem; margin-top: 0.75rem; }
.conversation dl.record { margin-top: 0.5rem; }
.conversation textarea:disabled { min-height: 3rem; }
.conversation .actions { margin-top: 0.5rem; }
.conversation .thread { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.5rem 0; }
.conversation .thread:empty { display: none; }

/* One agent turn: who said it, what kind of thing it is, then the words. */
.turn { border-left: 3px solid var(--accent); padding: 0.25rem 0 0.25rem 0.875rem; }
.turn-head { margin: 0 0 0.375rem; font-size: 0.8125rem; }
.turn-body { margin: 0; white-space: pre-wrap; }

/* Chinese typography. Latin defaults are too small and too tight for CJK: a
   CJK-first stack, a larger base, looser leading, lighter emphasis, and tags
   that are legible rather than decorative. Scoped by the document language. */
html[lang^="zh"] body { font-family: "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", system-ui, sans-serif; font-size: 15px; line-height: 1.75; }
html[lang^="zh"] h1, html[lang^="zh"] h2, html[lang^="zh"] h3, html[lang^="zh"] h4 { line-height: 1.4; letter-spacing: 0.01em; font-weight: 600; }
html[lang^="zh"] h1 { font-size: 1.25rem; }
html[lang^="zh"] .tag { font-size: 0.75rem; padding: 0.0625rem 0.5rem; }
html[lang^="zh"] th, html[lang^="zh"] td { padding: 0.5625rem 0.625rem; }
html[lang^="zh"] table, html[lang^="zh"] .notice, html[lang^="zh"] dl.record, html[lang^="zh"] ul.plain li, html[lang^="zh"] ul.bullets { font-size: 0.9rem; }
html[lang^="zh"] .hint, html[lang^="zh"] .contract, html[lang^="zh"] .faint { font-size: 0.8125rem; }
html[lang^="zh"] strong { font-weight: 600; }
html[lang^="zh"] .hero h1 { font-size: 2rem; line-height: 1.35; letter-spacing: 0.02em; }
html[lang^="zh"] .lede { font-size: 1.125rem; line-height: 1.8; }
html[lang^="zh"] .principle p, html[lang^="zh"] .role p, html[lang^="zh"] .today p { line-height: 1.8; }

/* Dense tables: the id column yields first, names and labels never break. */
td.nowrap { white-space: nowrap; }
td button.rowpick.idcell { max-width: 15ch; }
html[lang^="zh"] td button.rowpick.idcell { max-width: 13ch; }

/* A Chinese lede needs a shorter measure than a Latin one to avoid a stranded tail line. */
html[lang^="zh"] .hero-copy { max-width: 44rem; }

/* The name cell leads a queue row: no wrap, clamped with an ellipsis, full name
   and id in the tooltip. */
td button.rowpick.namecell { display: block; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Long ids are clamped wherever they sit beside a name. */
td.idtext, span.idtext { display: inline-block; max-width: 17ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* ---------------- find an application ---------------- */
.rowgap > .field.grow { flex: 1 1 20rem; }
#queue-search { margin-bottom: 1rem; }
#queue-search .hint { display: block; font-size: 0.75rem; color: var(--ink-faint); margin-top: 0.25rem; }
#search-rows button.small { margin-top: 0.35rem; white-space: nowrap; font-size: 0.75rem; padding: 0.25rem 0.5rem; }
#search-rows td { vertical-align: top; }
#search-rows .idtext.block { display: block; max-width: 22ch; }

/* A file alternative of a derived requirement sits under it. */
li.result.indent { padding-left: 1.25rem; }
#team-test-held-generation { font-size: 0.75rem; }

/* Upload links: the issued secret sits in a read-only field beside its copy button. */
#upload-link-result input[readonly] { width: 100%; }
#upload-link-list li.result { flex-wrap: wrap; }
#upload-file { display: block; max-width: 100%; }

/* Contact picker: one radio per listed contact, label beside it. */
#lcontact-form li.result { gap: 0.5rem; align-items: center; }
#lcontact-form input[type="radio"] { margin: 0; }

/* Menu panel: one block per track, facts then the one action that matters. */
.menu-track { padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: 6px; }
.menu-track > p { margin: 0 0 0.25rem; }
.menu-track dl.record { margin: 0.25rem 0; }
.menu-track .notice { margin-top: 0.5rem; }

.photo-state { margin: 0.5rem 0; }
#progress-photography .record { grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr); }
#progress-photography .photography-consent { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; }
#progress-photography .photography-consent input { flex: 0 0 auto; margin-top: 5px; }
@media (max-width: 540px) {
  #progress-photography .record { display: block; }
  #progress-photography .record dt { margin-top: 10px; }
  #progress-photography .record dd { margin: 2px 0 8px; }
}

/* System checks beside the staff decision: one line per observation. */
td.assess { font-size: 0.8125rem; min-width: 11rem; }
td.assess .block { display: block; margin-bottom: 0.15rem; }
.assess-feedback { align-items: center; gap: 0.25rem 0.5rem; margin-top: 0.35rem; }
.assess-feedback input[type="radio"] { margin: 0 0 0 0.5rem; }

/* Association requests: one block per request, review panel inside it. */
li.assoc-row { flex-direction: column; align-items: stretch; }
.assoc-review { padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: 6px; }

/* Stored files on a phone: one card per file instead of a sideways table. */
@media (max-width: 720px) {
  .evidence-table thead { display: none; }
  .evidence-table, .evidence-table tbody, .evidence-table tr, .evidence-table td { display: block; }
  .evidence-table tr { padding: 0.5rem 0.6rem; margin-bottom: 0.6rem; border: 1px solid var(--line); border-radius: 6px; }
  .evidence-table td { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.25rem 0.5rem; padding: 0.2rem 0; border: 0; white-space: normal; min-width: 0; }
  .evidence-table td::before { content: attr(data-label); color: var(--ink-faint); font-size: 0.75rem; grid-column: 1; }
  .evidence-table td > * { grid-column: 2; }
  .evidence-table td .block { display: block; }
  .evidence-table td:first-child { font-weight: 600; }
  .evidence-table td.assess { font-size: 0.8125rem; }
  .evidence-table td:last-child { grid-template-columns: minmax(0, 1fr); }
  .evidence-table td:last-child::before { display: none; }
  .evidence-table td:last-child button { margin: 0.25rem 0.25rem 0 0; }
}

/* Phone verification: a plain link styled as the secondary button, and the applicant form's pointer to it. */
a.button.secondary { display: inline-block; text-decoration: none; }
#phone-verification { margin-top: 0.75rem; }

/* One 說明 disclosure per section instead of caveat paragraphs everywhere. */
.explain { margin: 0.5rem 0 0.25rem; font-size: 0.8125rem; color: var(--ink-soft); }
.explain > summary { cursor: pointer; color: var(--ink-faint); font-size: 0.75rem; }
.explain p { margin: 0.25rem 0 0; }
details.conversation > summary { cursor: pointer; list-style: revert; }

/* Long status tags wrap on phones instead of widening the page. */
.menu-review-check { display: flex; flex-wrap: wrap; gap: 1rem; border: 0; padding: 0; margin: 0.75rem 0; min-width: 0; }
.menu-review-check legend { font-weight: 600; margin-bottom: 0.25rem; }
.photo-approval { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.photo-provider-terms { white-space: pre-wrap; overflow-wrap: anywhere; }
.menu-review-check .choice { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.5rem; margin: 0; }
@media (max-width: 480px) { .tag { white-space: normal; } }
