/* Villa papers checker. One page, four states.
   COPIED FROM work/2026-09-26-jason-mvp/app.css @ 25c4d64: the design tokens, body, focus ring, select and file
   input look, buttons, status chip, scrolling table box and the reduced-motion rule. Changes: only those parts,
   the word "Papers" kept as the product name, no dark mode (the desk has none).
   NEW (built from the same tokens, no new colour): the choice buttons, the paper row, the tick row, the banner,
   the flag block (Stop and Check by hand), the readers table and the sample banner. */

:root {
  /* Ink */
  --ink-900: #0b1220;
  --ink-700: #2c364a;
  --ink-500: #5b6478;
  --ink-300: #98a1b3;

  /* Surfaces */
  --bg: #f2f4f9;
  --bg-subtle: #eaedf6;
  --surface: #ffffff;
  --line: #e2e6f0;
  --line-strong: #cdd3e3;

  /* Brand */
  --brand-900: #241f66;
  --brand-700: #312e81;
  --brand-600: #4338ca;
  --brand-500: #4f46e5;
  --brand-100: #e6e4fb;
  --brand-50: #f2f1fd;

  /* Status */
  --pass: #0f7a41;
  --pass-ink: #0b6636;
  --pass-bg: #e8f8ee;
  --pass-line: #b9e8c9;
  --stop: #c81e3a;
  --stop-ink: #a3162e;
  --stop-bg: #fdecee;
  --stop-line: #f6c3ca;
  --wait: #5b6478;
  --wait-bg: #eef0f6;
  --wait-line: #dbdfeb;

  /* Scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 48px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-2: 0 2px 8px rgba(20, 20, 60, 0.08), 0 1px 2px rgba(20, 20, 60, 0.06);

  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-head: "Inter Tight", "Inter", -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; max-width: 100%; }
body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-900);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
a { color: var(--brand-600); }
[hidden] { display: none !important; }

/* ---------- Top bar and page column ---------- */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.appbar { max-width: 720px; margin: 0 auto; padding: var(--sp-3) var(--sp-4); }
.product {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--brand-700);
}
.brand-mark { display: block; border-radius: 6px; flex: none; }
.product .desk { color: var(--ink-500); font-weight: 500; }
#view { max-width: 720px; margin: 0 auto; padding: var(--sp-4) var(--sp-4) var(--sp-8); min-width: 0; }
#view:focus { outline: none; }
h1 {
  margin: 0 0 var(--sp-2);
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
h1:focus { outline: none; }
h2 {
  font-family: var(--font-head);
  font-size: 11.5px;
  font-weight: 800;
  margin: var(--sp-6) 0 var(--sp-3);
  color: var(--ink-500);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lede { margin: 0 0 var(--sp-4); color: var(--ink-700); }
.note, .muted { color: var(--ink-500); overflow-wrap: anywhere; }
.note { margin: var(--sp-2) 0; }
.muted { font-size: 12px; margin: var(--sp-1) 0 0; }
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }

/* ---------- Controls (from the desk) ---------- */
input[type="password"], input[type="text"] {
  width: 100%;
  min-height: 44px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 0 var(--sp-3);
  font: inherit;
  font-size: 16px;
  background: var(--surface);
  color: var(--ink-900);
}
input[type="password"]:focus, input[type="text"]:focus { border-color: var(--brand-500); outline: none; box-shadow: 0 0 0 3px var(--brand-100); }
label.field { display: block; font-weight: 650; font-size: 13px; margin-bottom: var(--sp-1); }
.btn, button {
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  min-height: 44px;
  padding: 0 var(--sp-4);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-900);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.btn:hover, button:hover { border-color: var(--ink-300); background: var(--bg-subtle); }
.btn:active, button:active { transform: translateY(1px); }
.btn.primary, button.primary {
  background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
  color: #fff;
  border-color: var(--brand-700);
  box-shadow: var(--shadow-1);
}
.btn.primary:hover, button.primary:hover { filter: brightness(1.06); background: linear-gradient(180deg, var(--brand-500), var(--brand-600)); border-color: var(--brand-700); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.link { border: 0; background: none; min-height: 44px; padding: 0 var(--sp-1); color: var(--brand-600); text-decoration: underline; font-weight: 600; }
button.link:hover { background: none; }
.actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-4); }
.actions .primary { flex: 1 1 100%; }

/* ---------- Status chip (from the desk) ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  height: 22px;
  padding: 0 8px 0 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: none; }
.chip.pass { color: var(--pass-ink); background: var(--pass-bg); border-color: var(--pass-line); }
.chip.stop { color: var(--stop-ink); background: var(--stop-bg); border-color: var(--stop-line); }
.chip.check { color: var(--brand-700); background: var(--brand-50); border-color: var(--brand-100); }
.chip.wait { color: var(--wait); background: var(--wait-bg); border-color: var(--wait-line); }
.tag { color: var(--ink-500); font-weight: 700; font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; flex: none; }

/* ---------- New: banners ---------- */
.sample-banner, .local-banner {
  border: 1.5px dashed var(--brand-500);
  background: var(--brand-50);
  color: var(--brand-900);
  border-radius: var(--radius-md);
  padding: var(--sp-2) var(--sp-3);
  font-weight: 650;
  margin: 0 0 var(--sp-3);
}
.local-banner { border-style: solid; border-color: var(--line-strong); background: var(--bg-subtle); color: var(--ink-700); font-weight: 500; }
.banner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin: 0 0 var(--sp-4);
  box-shadow: var(--shadow-2);
  position: relative;
  overflow: hidden;
}
.banner::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--line-strong); }
.banner.stop { background: linear-gradient(180deg, var(--stop-bg) 0%, var(--surface) 130px); border-color: var(--stop-line); }
.banner.stop::before { background: var(--stop); }
.banner.pass { background: linear-gradient(180deg, var(--pass-bg) 0%, var(--surface) 130px); border-color: var(--pass-line); }
.banner.pass::before { background: var(--pass); }
.banner-word { margin: 0 0 var(--sp-1); font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.banner.stop .banner-word, .banner.stop .banner-line { color: var(--stop-ink); }
.banner.pass .banner-word, .banner.pass .banner-line { color: var(--pass-ink); }
.banner-line { margin: 0; font-family: var(--font-head); font-size: 19px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; overflow-wrap: anywhere; }
.banner-sub { margin: var(--sp-3) 0 0; color: var(--ink-700); }

/* ---------- New: start screen ---------- */
.choices { display: grid; gap: var(--sp-2); margin: 0 0 var(--sp-4); padding: 0; list-style: none; }
.choice {
  width: 100%;
  min-height: 64px;
  justify-content: space-between;
  text-align: left;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  white-space: normal;
}
.choice .t { display: block; font-size: 15px; font-weight: 750; }
.choice .s { display: block; color: var(--ink-500); font-size: 12px; font-weight: 500; margin-top: 2px; }
.choice .go { font-size: 18px; color: var(--brand-600); flex: none; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: var(--sp-4);
  margin: 0 0 var(--sp-4);
}
.error-text { color: var(--stop-ink); font-weight: 650; margin: var(--sp-2) 0 0; }
.sample-list { display: grid; gap: var(--sp-2); margin: var(--sp-3) 0 0; padding: 0; list-style: none; }
.sample-list button { width: 100%; justify-content: flex-start; text-align: left; flex-direction: column; align-items: flex-start; padding: var(--sp-3); white-space: normal; }
.sample-list .t { font-weight: 700; }
.sample-list .s { color: var(--ink-500); font-size: 12px; font-weight: 500; }
.saved { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--sp-2); }
.saved button { width: 100%; text-align: left; justify-content: space-between; gap: var(--sp-3); white-space: normal; }
.saved .t { font-weight: 650; }
.saved .s { color: var(--ink-500); font-size: 12px; display: block; font-weight: 500; }

/* ---------- New: paper rows ---------- */
.papers { margin: 0 0 var(--sp-4); padding: 0; list-style: none; display: grid; gap: var(--sp-2); }
.paper {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: var(--sp-3) var(--sp-4);
  min-width: 0;
}
.paper-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-2); }
.paper-name { font-weight: 700; overflow-wrap: anywhere; }
.paper-status { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-2) 0 0; color: var(--ink-700); flex-wrap: wrap; }
.row-error { color: var(--stop-ink); font-weight: 650; margin: var(--sp-2) 0 0; }
.paper-actions { display: flex; gap: var(--sp-2); align-items: center; margin-top: var(--sp-3); flex-wrap: wrap; }
.file-btn { position: relative; }
.file-btn input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.file-btn:focus-within { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.tick { display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; cursor: pointer; font-weight: 600; }
.tick input { width: 22px; height: 22px; flex: none; accent-color: var(--brand-600); }
.empty { color: var(--ink-500); margin: 0 0 var(--sp-3); }

/* ---------- New: checking ---------- */
.checking { text-align: center; padding: var(--sp-7) var(--sp-4); }
.counter { font-family: var(--font-head); font-size: 34px; font-weight: 800; color: var(--brand-700); margin: var(--sp-3) 0 0; }

/* ---------- New: flags ---------- */
.flags { display: grid; gap: var(--sp-3); margin: 0 0 var(--sp-4); padding: 0; list-style: none; }
.flag {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 6px solid var(--stop);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: var(--sp-4);
  min-width: 0;
}
.flag.check { border-left-color: var(--brand-500); }
.flag-top { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin: 0 0 var(--sp-2); }
.flag-paper { font-weight: 700; overflow-wrap: anywhere; }
.flag-id { color: var(--ink-500); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.flag-what { margin: 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.flag-detail { margin: var(--sp-2) 0 0; padding: var(--sp-2) var(--sp-3); background: var(--bg-subtle); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.ask { margin: var(--sp-3) 0 0; font-weight: 800; font-size: 15px; overflow-wrap: anywhere; }
.not-read { margin: 0 0 var(--sp-4); padding: 0; list-style: none; display: grid; gap: var(--sp-2); }
.not-read li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--sp-3) var(--sp-4); }
.not-read .n { font-weight: 700; }

/* ---------- New: what the readers found ---------- */
details.readers { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: 0 var(--sp-4); margin: 0 0 var(--sp-4); }
details.readers summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
details.readers[open] summary { border-bottom: 1px solid var(--line); margin-bottom: var(--sp-3); }
.readers h3 { font-size: 13px; margin: var(--sp-3) 0 var(--sp-2); }
.table-scroll { max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: auto; margin: 0 0 var(--sp-3); }
table.reads { border-collapse: collapse; width: 100%; min-width: 440px; }
table.reads th, table.reads td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; overflow-wrap: anywhere; }
table.reads th { color: var(--ink-500); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
table.reads tr:last-child td { border-bottom: 0; }
.timing { color: var(--ink-500); margin: 0 0 var(--sp-2); overflow-wrap: anywhere; }
.copied { color: var(--pass-ink); font-weight: 650; min-height: 20px; margin: var(--sp-2) 0 0; }

@media (min-width: 900px) {
  body { font-size: 14.5px; }
  #view { padding-top: var(--sp-6); }
  h1 { font-size: 26px; }
  .actions .primary { flex: 0 0 auto; }
  .choices { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; transition: none !important; }
}
