/* CSOL Tech · Document Reader demo
   Site chassis (white / parchment, one blue, pill buttons, tight display
   type, 17px body). The paper documents keep their own fixed colors and
   pixel sizes: they are paper, so they stay paper in dark mode too. */

@font-face {
  font-family: "Inter";
  src: url("../../fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --card: #ffffff;
  --field: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --hair: rgba(0, 0, 0, 0.1);
  --hair-strong: rgba(0, 0, 0, 0.18);
  --accent: #0066cc;
  --accent-hover: #0071e3;
  --hl: #0071e3;
  --btn: #0066cc;
  --btn-hover: #0071e3;
  --ok: #1a7f37;
  --ok-bg: rgba(52, 199, 89, 0.13);
  --warn: #b25000;
  --warn-bg: rgba(255, 149, 0, 0.13);
  --warn-ring: rgba(214, 120, 0, 0.55);
  --you-bg: rgba(0, 113, 227, 0.09);
  --sk: rgba(0, 0, 0, 0.055);
  --sk-hi: rgba(0, 0, 0, 0.1);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 30px rgba(0, 0, 0, 0.06);
  --shadow-paper: 0 1px 1px rgba(0, 0, 0, 0.08), 0 12px 28px rgba(0, 0, 0, 0.12), 0 36px 70px -24px rgba(0, 0, 0, 0.22);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, "Segoe UI", sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #101011;
    --card: #1c1c1e;
    --field: #262628;
    --ink: #f5f5f7;
    --muted: #a1a1a6;
    --hair: rgba(255, 255, 255, 0.12);
    --hair-strong: rgba(255, 255, 255, 0.22);
    --accent: #2997ff;
    --accent-hover: #47a6ff;
    --hl: #2997ff;
    --btn: #0071e3;
    --btn-hover: #0077ed;
    --ok: #30d158;
    --ok-bg: rgba(48, 209, 88, 0.15);
    --warn: #ffb340;
    --warn-bg: rgba(255, 159, 10, 0.14);
    --warn-ring: rgba(255, 179, 64, 0.6);
    --you-bg: rgba(41, 151, 255, 0.15);
    --sk: rgba(255, 255, 255, 0.06);
    --sk-hi: rgba(255, 255, 255, 0.12);
    --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-paper: 0 1px 1px rgba(0, 0, 0, 0.5), 0 14px 34px rgba(0, 0, 0, 0.55), 0 40px 80px -24px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button, input { font: inherit; letter-spacing: inherit; color: inherit; }
a, button, input { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap { width: 100%; max-width: calc(1200px + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.ic {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.skip {
  position: fixed; top: -100px; left: 8px; z-index: 100;
  padding: 10px 16px; border-radius: 999px; background: var(--btn); color: #fff; text-decoration: none;
}
.skip:focus { top: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px;
  border: 0; border-radius: 999px;
  font-size: 17px; font-weight: 400; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.15s var(--ease), opacity 0.3s var(--ease);
}
.btn:active:not([disabled]) { transform: scale(0.97); }
.btn-primary { background: var(--btn); color: #ffffff; }
.btn-primary:hover:not([disabled]) { background: var(--btn-hover); }
.btn-primary[disabled] { opacity: 0.38; cursor: not-allowed; }
.btn-lg { min-height: 50px; padding: 0 28px; }
.btn-quiet { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair-strong); }
.btn-quiet:hover { background: var(--field); }
.btn .ic { width: 18px; height: 18px; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 40; height: 52px;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 var(--hair);
}
@media (prefers-color-scheme: dark) { .bar { background: rgba(22, 22, 23, 0.78); } }
.bar-in {
  height: 100%; max-width: calc(1200px + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 14px;
}
.brand {
  font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand span { margin-left: 4px; font-weight: 400; color: var(--muted); }
.demo-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 11px; border-radius: 999px;
  background: var(--field); color: var(--muted);
  font-size: 13px; font-weight: 500; letter-spacing: -0.005em; white-space: nowrap;
}
.demo-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.pill-less { display: none; }
.back {
  margin-left: auto; display: inline-flex; align-items: center; gap: 2px;
  color: var(--accent); text-decoration: none; font-size: 15px; white-space: nowrap;
  min-height: 44px;
}
.back:hover { text-decoration: underline; text-underline-offset: 3px; }
.back .ic { width: 18px; height: 18px; margin-left: -4px; }

/* ---------- intro ---------- */
.intro { text-align: center; padding-top: clamp(48px, 6vw, 84px); padding-bottom: clamp(36px, 5vw, 60px); }
.eyebrow { font-size: 17px; font-weight: 600; color: var(--accent); margin-bottom: 12px; }
.intro h1 {
  font-size: clamp(44px, 5vw + 12px, 80px); line-height: 1.04; letter-spacing: -0.032em;
}
.intro h1 span { display: block; color: var(--muted); }
.lede {
  max-width: 620px; margin: 22px auto 0;
  font-size: clamp(17px, 0.6vw + 14px, 21px); line-height: 1.42; color: var(--muted);
}

/* ---------- stage ---------- */
.stage {
  position: relative;
  background: var(--bg-alt);
  border-radius: 30px;
  padding: clamp(14px, 3vw, 44px);
  scroll-margin-top: 64px;
}
.steps {
  list-style: none; margin: 0 auto clamp(22px, 3vw, 36px); padding: 0;
  display: flex; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--muted);
}
.steps li { display: inline-flex; align-items: center; gap: 6px; transition: color 0.4s var(--ease); }
.steps li + li::before { order: -2;
  content: ""; width: clamp(10px, 2.4vw, 28px); height: 1px; background: var(--hair-strong); margin-right: 2px;
}
.steps li::after {
  content: ""; order: -1; width: 7px; height: 7px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--hair-strong);
  transition: background-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.steps li.done { color: var(--ink); }
.steps li.done::after { background: var(--ink); box-shadow: none; opacity: 0.55; }
.steps li.now { color: var(--ink); font-weight: 600; }
.steps li.now::after { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

/* ---------- inbox ---------- */
.inbox-head { text-align: center; margin-bottom: clamp(26px, 3.4vw, 44px); }
.inbox-title { font-size: clamp(24px, 1.2vw + 16px, 32px); letter-spacing: -0.022em; line-height: 1.15; }
.inbox-sub { margin-top: 6px; color: var(--muted); font-size: 15px; }
.tiles {
  display: grid; grid-template-columns: repeat(3, minmax(0, 280px));
  justify-content: center; gap: clamp(12px, 4vw, 56px);
}
.tile { position: relative; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.tile[draggable="true"] { cursor: grab; }
.thumb {
  position: relative; display: block; width: 100%;
  aspect-ratio: 612 / 792;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.5s var(--ease), filter 0.5s var(--ease);
  pointer-events: none;
}
.thumb .paper { position: absolute; top: 0; left: 0; width: 612px; transform-origin: 0 0; }
.thumb .sheet { transform: none; }
.tile:hover .thumb, .tile:has(:focus-visible) .thumb { transform: translateY(-8px) rotate(0deg); }
.tile:hover .thumb .sheet { box-shadow: 0 2px 2px rgba(0, 0, 0, 0.06), 0 22px 44px rgba(0, 0, 0, 0.16), 0 50px 90px -30px rgba(0, 0, 0, 0.3); }
.tile:has(:focus-visible) .thumb { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 2px; }
.tile.lifting .thumb { opacity: 0.35; }
.tile-btn {
  margin-top: 20px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1px;
}
.tile-btn::after { content: ""; position: absolute; inset: -10px; }
.tile-btn:focus-visible { outline: none; }
.tile-t { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.tile-f { font-size: 15px; color: var(--muted); }
.tile-done {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 10px 0 7px; border-radius: 999px;
  background: var(--ok); color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0; transform: scale(0.8); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
@media (prefers-color-scheme: dark) { .tile-done { color: #00230b; } }
.tile-done .ic { width: 16px; height: 16px; stroke-width: 2; }
.tile.read .tile-done { opacity: 1; transform: none; }

.drop {
  margin: clamp(32px, 4vw, 52px) auto 0; max-width: 920px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 96px; padding: 20px;
  border-radius: 18px; border: 1.5px dashed var(--hair-strong);
  color: var(--muted); font-size: 15px;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease), transform 0.3s var(--ease), color 0.3s var(--ease);
}
.drop-ic { width: 26px; height: 26px; }
.drop-coarse { display: none; }
.drop.armed { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 4%, transparent); }
.drop.over { background: color-mix(in srgb, var(--accent) 11%, transparent); transform: scale(1.015); }
.drop.nope { border-color: var(--warn); color: var(--warn); }
@media (hover: none) {
  .drop { border: 0; min-height: 0; padding: 0; }
  .drop-ic { display: none; }
  .drop-fine { display: none; }
  .drop-coarse { display: inline; }
  .tile[draggable="true"] { cursor: pointer; }
}

/* ---------- workspace ---------- */
.work {
  display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  gap: clamp(24px, 3.4vw, 52px); align-items: start;
}
.doc-pane { position: sticky; top: 72px; min-width: 0; }
.doc-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 auto 16px;
  max-width: min(100%, calc((100svh - 160px) * 0.7727));
}
.doc-name { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 15px; }
.doc-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-name .ic { width: 18px; height: 18px; }
.status {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--hair);
  font-size: 13px; font-weight: 600; color: var(--accent);
  transition: color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.spin {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid currentColor; border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}
.status[data-s="check"] { color: var(--warn); }
.status[data-s="ready"], .status[data-s="filed"] { color: var(--ok); }
.status[data-s="check"] .spin, .status[data-s="ready"] .spin, .status[data-s="filed"] .spin {
  animation: none; border: 0; width: 7px; height: 7px; background: currentColor;
}
.fit {
  position: relative; margin: 0 auto;
  max-width: min(100%, calc((100svh - 160px) * 0.7727));
}
.fit .paper { position: absolute; top: 0; left: 0; width: 612px; transform-origin: 0 0; }
.ticker { display: none; }

.side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.card {
  background: var(--card); border-radius: 18px;
  padding: clamp(18px, 2.2vw, 28px);
  box-shadow: var(--shadow-card);
  scroll-margin-top: 72px;
}

/* ---------- reading form ---------- */
.fc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.fc-eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.fc-title { font-size: 24px; letter-spacing: -0.022em; line-height: 1.15; }
.fc-count { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fc-count b { color: var(--ink); font-weight: 600; }
.track { height: 3px; margin: 14px 0 20px; border-radius: 3px; background: var(--hair); overflow: hidden; }
.track i { display: block; height: 100%; width: 0; background: var(--hl); border-radius: 3px; transition: width 0.4s var(--ease), background-color 0.4s; }
.track.full i { background: var(--ok); }

.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fcell, .lrow, .trow {
  position: relative; border-radius: 12px;
  transition: background-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.fcell { padding: 10px 12px 11px; background: var(--field); min-width: 0; }
.fcell.wide { grid-column: 1 / -1; }
.fl { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.flabel { font-size: 13px; color: var(--muted); }
.fv { min-height: 25px; display: flex; flex-direction: column; justify-content: center; }
.val { font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
.note { font-size: 13px; color: var(--muted); }
.note:empty { display: none; }

.sk {
  display: block; height: 11px; width: 58%; border-radius: 6px;
  background: linear-gradient(90deg, var(--sk) 0%, var(--sk-hi) 50%, var(--sk) 100%);
  background-size: 220% 100%;
  animation: shimmer 1.8s linear infinite;
}
.filled .sk { display: none; }
[data-state="reading"] { box-shadow: inset 0 0 0 1.5px var(--hl); background: var(--you-bg); }
[data-state="warn"] { box-shadow: inset 0 0 0 1.5px var(--warn-ring); background: var(--warn-bg); }
[data-state="warn"].pulse { animation: ring 1.6s ease-in-out infinite; }
[data-state="you"] { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--hl) 55%, transparent); background: var(--you-bg); }
.flash { animation: flash 0.9s var(--ease); }

.conf {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap;
  color: var(--ok); opacity: 0; transform: translateY(2px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.conf::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.conf.on { opacity: 1; transform: none; }
.conf.warn { color: var(--warn); }
.conf.you { color: var(--accent); }
.conf.you::before { display: none; }
.conf .ic { width: 15px; height: 15px; stroke-width: 1.8; }

.sec { font-size: 13px; font-weight: 600; color: var(--muted); margin: 22px 0 8px; letter-spacing: 0; }
.lrows { display: flex; flex-direction: column; gap: 6px; }
.lrow {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--field);
}
.lq { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: left; }
.lq .sk { width: 22px; }
.lmain { display: flex; flex-direction: column; min-width: 0; }
.lp { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
.ld { font-size: 15px; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.lm { font-size: 13px; color: var(--muted); font-style: italic; }
.lm:empty, .lp:empty, .ld:empty { display: none; }
.lend { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.la { font-size: 17px; font-variant-numeric: tabular-nums; }
.la:empty { display: none; }

.trows { display: flex; flex-direction: column; }
.trow {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  padding: 9px 12px; margin: 0 -12px;
}
.trow + .trow::before { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 1px; background: var(--hair); }
.tl { font-size: 15px; color: var(--muted); }
.tv { font-size: 17px; font-variant-numeric: tabular-nums; text-align: right; min-width: 70px; display: flex; justify-content: flex-end; }
.tv .sk { width: 64px; }
.trow.grand .tl { color: var(--ink); font-weight: 600; font-size: 17px; }
.trow.grand .tv { font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.trow.wide { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
.trow.wide .tl { grid-column: 1; grid-row: 1; }
.trow.wide .conf { grid-column: 2; grid-row: 1; }
.trow.wide .tv { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; text-align: left; }

/* the human-in-the-loop moment */
.confirm {
  margin-top: 20px; padding: 18px; border-radius: 16px;
  background: var(--warn-bg);
  scroll-margin-top: 90px; scroll-margin-bottom: 24px;
  transition: background-color 0.5s var(--ease);
  animation: rise 0.55s var(--ease) both;
}
.cf-head { display: flex; align-items: center; gap: 8px; color: var(--warn); }
.cf-head .ic { width: 22px; height: 22px; }
.cf-title { font-size: 17px; letter-spacing: -0.015em; color: var(--ink); }
.cf-body { margin: 6px 0 14px; font-size: 15px; color: var(--ink); line-height: 1.45; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opt {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  min-height: 64px; padding: 11px 40px 11px 14px; border-radius: 12px; border: 0;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--hair-strong);
  text-align: left; cursor: pointer;
  transition: box-shadow 0.25s var(--ease), transform 0.15s var(--ease), background-color 0.25s var(--ease);
}
.opt:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.opt:active { transform: scale(0.97); }
.opt-v { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.opt-d { font-size: 13px; color: var(--muted); }
.opt-ck {
  position: absolute; top: 50%; right: 12px; width: 22px; height: 22px; margin-top: -11px;
  border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--hair-strong);
  display: grid; place-items: center; color: #fff;
  transition: background-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.opt-ck .ic { width: 14px; height: 14px; stroke-width: 2.4; opacity: 0; transform: scale(0.5); transition: opacity 0.25s, transform 0.3s var(--ease); }
.opt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.opt[aria-pressed="true"] .opt-ck { background: var(--accent); box-shadow: none; }
.opt[aria-pressed="true"] .opt-ck .ic { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) { .opt-ck { color: #00182e; } }
.confirm.answered { background: var(--you-bg); }
.confirm.answered .cf-head { color: var(--accent); }

.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 22px; }
.hint { font-size: 15px; color: var(--muted); }
.btn .spin { width: 14px; height: 14px; border-width: 1.75px; }
.ready-pop { animation: pop 0.6s var(--ease); }

/* ---------- system record ---------- */
.record { padding: 0; overflow: hidden; }
.rec-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px clamp(18px, 2.2vw, 28px);
  background: var(--field);
  border-bottom: 1px solid var(--hair);
}
.rec-app { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.rec-app i { width: 18px; height: 18px; border-radius: 5px; background: var(--ink); position: relative; }
.rec-app i::after { content: ""; position: absolute; inset: 5px 4px; border-top: 2px solid var(--accent); border-bottom: 2px solid var(--bg-alt); }
.rec-status {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  background: var(--ok-bg); color: var(--ok); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.rec-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rec-status.warn { background: var(--warn-bg); color: var(--warn); }
.rec-body { padding: clamp(18px, 2.2vw, 28px); }
.rec-title { font-size: 28px; letter-spacing: -0.026em; line-height: 1.12; }
.rec-title:focus { outline: none; }
.rec-sub { margin-top: 4px; font-size: 15px; color: var(--muted); }
.rec-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px;
  margin: 22px 0 0; padding: 18px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
}
.rec-grid div { min-width: 0; }
.rec-grid dt { font-size: 13px; color: var(--muted); }
.rec-grid dd { margin: 1px 0 0; font-size: 15px; overflow-wrap: anywhere; }
.rec-lines { width: 100%; border-collapse: collapse; margin-top: 14px; }
.rec-lines td:first-child, .rec-lines .r { font-variant-numeric: tabular-nums; }
.rec-lines tfoot td { text-align: right; font-variant-numeric: tabular-nums; }
.rec-lines tfoot td .fl2 { display: inline-block; margin-right: 18px; }
.rec-lines th { font-size: 13px; font-weight: 500; color: var(--muted); text-align: left; padding: 6px 8px 6px 0; }
.rec-lines td { font-size: 15px; padding: 9px 8px 9px 0; border-top: 1px solid var(--hair); vertical-align: top; }
.rec-lines .r { text-align: right; padding-right: 0; }
.rec-lines td.q { width: 44px; font-size: 17px; }
.rec-lines td.it .p { display: block; font-weight: 600; }
.rec-lines td.it .d { display: block; color: var(--muted); font-size: 15px; }
.rec-lines td.r { font-size: 17px; white-space: nowrap; }
.rec-lines tfoot td { border-top: 0; padding: 3px 0; color: var(--muted); }
.rec-lines tfoot tr:first-child td { border-top: 1px solid var(--hair); padding-top: 10px; }
.rec-lines tfoot tr.g td { color: var(--ink); font-weight: 600; font-size: 17px; padding-top: 4px; }
.rec-lines tr.youp .p, .rec-lines tr.youq td.q { color: var(--accent); }
.checks { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checks li {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 12px 14px; border-radius: 12px; background: var(--ok-bg);
}
.checks li .ic { width: 24px; height: 24px; color: var(--ok); }
.checks li.bad { background: var(--warn-bg); }
.checks li.bad .ic { color: var(--warn); }
.checks li.info { background: var(--field); }
.checks li.info .ic { color: var(--muted); }
.ck-t { font-size: 15px; font-weight: 600; }
.ck-d { font-size: 13px; color: var(--muted); margin-top: 1px; }
.checks li.in { animation: rise 0.5s var(--ease) both; }
.checks li.in .ic path { stroke-dasharray: 20; stroke-dashoffset: 20; animation: draw 0.5s 0.15s var(--ease) forwards; }
.checks li.wait { opacity: 0; }
.log {
  margin-top: 18px; display: flex; align-items: flex-start; gap: 8px;
  font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: 0;
}
.log .ic { width: 16px; height: 16px; margin-top: 1px; }

/* ---------- ask ---------- */
.ask-title { font-size: 21px; letter-spacing: -0.02em; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  min-height: 38px; padding: 0 15px; border: 0; border-radius: 999px;
  background: var(--field); color: var(--ink); font-size: 15px; cursor: pointer;
  box-shadow: inset 0 0 0 1px transparent;
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.15s var(--ease), opacity 0.3s;
}
.chip:hover:not([disabled]) { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.chip:active:not([disabled]) { transform: scale(0.97); }
.chip[disabled] { opacity: 0.45; cursor: default; }
.chip.used { opacity: 0.45; }
.thread { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.thread:empty { display: none; }
.msg { max-width: 92%; animation: rise 0.4s var(--ease) both; }
.msg.q {
  align-self: flex-end; padding: 8px 14px; border-radius: 18px 18px 6px 18px;
  background: var(--btn); color: #fff; font-size: 15px;
}
.msg.a {
  align-self: flex-start; padding: 12px 15px; border-radius: 18px 18px 18px 6px;
  background: var(--field); font-size: 17px; line-height: 1.45;
}
.msg.a .w { animation: wordin 0.35s var(--ease) both; }
.cites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cites:empty { display: none; }
.cite {
  display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 10px 0 7px;
  border: 0; border-radius: 999px; background: var(--card); color: var(--accent);
  font-size: 13px; font-weight: 500; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--hair);
  animation: rise 0.4s var(--ease) both;
}
.cite:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.cite .ic { width: 15px; height: 15px; }
.dots { display: inline-flex; gap: 4px; padding: 6px 0; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: 0.4; animation: blink 1.1s infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
.ask-form { position: relative; margin-top: 16px; }
.ask-form input {
  width: 100%; height: 48px; padding: 0 54px 0 18px;
  border: 0; border-radius: 999px; background: var(--bg); font-size: 17px;
  box-shadow: inset 0 0 0 1px var(--hair-strong);
  transition: box-shadow 0.2s var(--ease);
}
.ask-form input::placeholder { color: var(--muted); }
.ask-form input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.send {
  position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: var(--btn); color: #fff; cursor: pointer;
  transition: background-color 0.2s var(--ease), transform 0.15s var(--ease), opacity 0.2s;
}
.send:hover { background: var(--btn-hover); }
.send:active { transform: scale(0.94); }
.send .ic { width: 18px; height: 18px; stroke-width: 1.9; }
.again { display: flex; justify-content: center; padding-top: 4px; animation: rise 0.5s var(--ease) both; }
.enter { animation: enter 0.6s var(--ease) both; }

/* ---------- paper overlay: scan line, highlight boxes ---------- */
.ov { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.scan {
  position: absolute; left: 0; right: 0; top: 0; height: 140px;
  transform: translateY(-140px);
  background: linear-gradient(to bottom, rgba(41, 151, 255, 0), rgba(41, 151, 255, 0.14));
  border-bottom: 2px solid #2f8cff;
  box-shadow: 0 10px 26px -6px rgba(41, 151, 255, 0.6);
}
.hb {
  --c: 0, 113, 227;
  position: absolute; border-radius: 5px;
  background: rgba(var(--c), 0.08);
  box-shadow: 0 0 0 1.5px rgba(var(--c), 0.95), 0 0 0 5px rgba(var(--c), 0.14);
  transition: background-color 0.7s var(--ease), box-shadow 0.7s var(--ease);
  animation: lock 0.45s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}
.hb::before {
  content: ""; position: absolute; inset: -7px; pointer-events: none;
  background:
    linear-gradient(rgb(var(--c)) 0 0) left top / 12px 2px,
    linear-gradient(rgb(var(--c)) 0 0) left top / 2px 12px,
    linear-gradient(rgb(var(--c)) 0 0) right top / 12px 2px,
    linear-gradient(rgb(var(--c)) 0 0) right top / 2px 12px,
    linear-gradient(rgb(var(--c)) 0 0) left bottom / 12px 2px,
    linear-gradient(rgb(var(--c)) 0 0) left bottom / 2px 12px,
    linear-gradient(rgb(var(--c)) 0 0) right bottom / 12px 2px,
    linear-gradient(rgb(var(--c)) 0 0) right bottom / 2px 12px;
  background-repeat: no-repeat;
  animation: brackets 0.6s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}
.hb.done { background: rgba(var(--c), 0.05); box-shadow: 0 0 0 1px rgba(var(--c), 0.38); }
.hb.warn { --c: 214, 120, 0; background: rgba(var(--c), 0.12); box-shadow: 0 0 0 2px rgba(var(--c), 0.95), 0 0 0 6px rgba(var(--c), 0.16); }
.hb.warn.pulse { animation: hbpulse 1.6s ease-in-out infinite; }
.hb.you { --c: 0, 113, 227; background: rgba(var(--c), 0.08); box-shadow: 0 0 0 1.5px rgba(var(--c), 0.7); }
.hb.cite { background: rgba(var(--c), 0.16); box-shadow: 0 0 0 2px rgba(var(--c), 1), 0 0 0 8px rgba(var(--c), 0.18); }
.hb.cite::before { animation: brackets 0.6s cubic-bezier(0.2, 0.9, 0.2, 1) both; }
.hb.re::before { animation-name: brackets2; }

.fly {
  position: fixed; left: 0; top: 0; z-index: 60;
  padding: 5px 12px; border-radius: 999px;
  background: var(--card); color: var(--ink);
  font: 500 13px/1.35 var(--font); letter-spacing: -0.005em; white-space: nowrap;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--hl) 55%, transparent), 0 10px 28px rgba(0, 0, 0, 0.18);
  pointer-events: none; will-change: transform, opacity;
}

/* ---------- CTA ---------- */
.cta { text-align: center; padding-top: clamp(64px, 8vw, 112px); padding-bottom: clamp(72px, 9vw, 128px); }
.cta-line { font-size: clamp(17px, 0.6vw + 14px, 21px); color: var(--muted); margin-bottom: 22px; }
/* the closing button is a whole question: on a narrow phone it wraps instead of pushing the page wide */
.cta .btn { max-width: 100%; white-space: normal; text-align: center; }
.more-demos { display: block; width: fit-content; margin: 18px auto 0; padding: 10px 4px; font-size: 15px; color: var(--accent); text-decoration: none; }
.more-demos:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes lock { from { opacity: 0; transform: scale(1.22); } to { opacity: 1; transform: none; } }
@keyframes brackets { 0% { opacity: 0; inset: -18px; } 45% { opacity: 1; } 100% { opacity: 0; inset: -6px; } }
@keyframes brackets2 { 0% { opacity: 0; inset: -18px; } 45% { opacity: 1; } 100% { opacity: 0; inset: -6px; } }
@keyframes hbpulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(var(--c), 0.95), 0 0 0 4px rgba(var(--c), 0.14); }
  50% { box-shadow: 0 0 0 2px rgba(var(--c), 0.95), 0 0 0 11px rgba(var(--c), 0.06); }
}
@keyframes ring {
  0%, 100% { box-shadow: inset 0 0 0 1.5px var(--warn-ring); }
  50% { box-shadow: inset 0 0 0 2.5px var(--warn); }
}
@keyframes flash { from { background-color: color-mix(in srgb, var(--hl) 22%, var(--field)); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes enter { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes wordin { from { opacity: 0; filter: blur(3px); } to { opacity: 1; filter: none; } }
@keyframes blink { 0%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 0.8; transform: translateY(-2px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .sk { animation: none; }
  .scan { display: none; }
  .tile:hover .thumb { transform: rotate(var(--tilt, 0deg)); }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .work { grid-template-columns: minmax(0, 1fr); }
  .doc-pane { position: static; }
  .doc-bar, .fit { max-width: 520px; }
  .ticker {
    display: flex; align-items: center; gap: 10px;
    max-width: 520px; margin: 18px auto 0; height: 44px; padding: 0 14px;
    border-radius: 12px; background: var(--card); box-shadow: var(--shadow-card);
    font-size: 15px; opacity: 0; transition: opacity 0.4s var(--ease);
  }
  .work.reading .ticker { opacity: 1; }
  .tk-label { color: var(--muted); white-space: nowrap; }
  .tk-val { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .tk-label:empty + .tk-val:empty::before { content: "Reading the page"; font-weight: 400; color: var(--muted); }
}
@media (max-width: 640px) {
  .pill-more, .back-more { display: none; }
  .pill-less { display: inline; }
  .bar-in { gap: 10px; }
  .stage { border-radius: 22px; margin: 0 calc(var(--gutter) * -0.5); }
  .tiles { gap: 12px; }
  .tile-btn { margin-top: 12px; }
  .tile-t { font-size: 13px; }
  .tile-f { font-size: 13px; }
  .tile-done { top: 6px; right: 6px; height: 22px; padding: 0 6px; }
  .tile-done span { display: none; }
  .rec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rec-title { font-size: 24px; }
  .opts { grid-template-columns: minmax(0, 1fr); }
  .steps { gap: 4px; }
  .lrow { grid-template-columns: 30px minmax(0, 1fr) auto; }
}

/* =====================================================================
   The paper. Fixed 612px page; JS scales it to fit. Real-world colors,
   identical in light and dark mode.
   ===================================================================== */
.sheet {
  position: relative; width: 612px; min-height: 792px;
  background-color: #fdfcf9; color: #232323;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 10.5px; line-height: 1.4; letter-spacing: 0;
  box-shadow: var(--shadow-paper);
  -webkit-font-smoothing: antialiased;
  text-wrap: wrap;
}
.sheet table { border-collapse: collapse; }
.sheet .r { text-align: right; }
.h {
  font-family: "Ink Free", "Segoe Print", "Bradley Hand", "Noteworthy", "Comic Sans MS", cursive;
  color: #1d3a8f; font-size: 17px; line-height: 1.05; font-weight: 400;
  display: inline-block; transform: rotate(-1.5deg);
}
.p-sign { fill: none; stroke: #1d3a8f; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; display: block; }
.noise, .sheet.po, .sheet.tkt {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* customer PO: laser-printed, faxed, scanned a little crooked */
.sheet.po {
  padding: 26px 40px 34px;
  transform: rotate(-0.75deg);
  background-color: #f7f5ef;
  color: #262626;
}
.sheet.po::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.05), transparent 5%, transparent 95%, rgba(0, 0, 0, 0.07)),
    radial-gradient(120% 80% at 35% 25%, rgba(255, 255, 255, 0.45), transparent 70%);
}
.sheet.po > :not(.ov) { text-shadow: 0 0 0.6px rgba(0, 0, 0, 0.35); }
.p-fax { font-family: "Courier New", Courier, monospace; font-size: 8.5px; color: #666; margin-bottom: 16px; white-space: nowrap; }
.p-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.p-brand { display: flex; align-items: center; gap: 10px; }
.p-logo { width: 44px; height: 44px; flex: none; }
.p-co { font-size: 14.5px; font-weight: 700; letter-spacing: 0.06em; color: #5e2216; display: inline-block; }
.p-addr { font-size: 8.5px; color: #555; margin-top: 2px; }
.p-titlebox { text-align: right; }
.p-title { font-size: 18px; font-weight: 700; letter-spacing: 0.1em; }
.p-kv { margin: 6px 0 0 auto; }
.p-kv th { font-size: 8px; font-weight: 700; color: #666; text-align: right; padding: 2px 8px 2px 0; letter-spacing: 0.06em; }
.p-kv td { font-size: 11px; font-weight: 700; border-bottom: 1px solid #888; min-width: 92px; padding: 2px 2px; text-align: left; }
.p-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0 14px; }
.p-box { border: 1px solid #555; padding: 0 10px 8px; min-height: 80px; font-size: 10.5px; line-height: 1.45; }
.p-lbl { font-size: 8px; font-weight: 700; letter-spacing: 0.12em; background: #e6e2d8; margin: 0 -10px 6px; padding: 3px 10px; border-bottom: 1px solid #555; }
.p-box [data-f] { display: inline-block; }
.p-strip { width: 100%; }
.p-strip th { font-size: 8px; font-weight: 700; letter-spacing: 0.1em; background: #e6e2d8; border: 1px solid #555; padding: 3px 6px; text-align: left; }
.p-strip td { border: 1px solid #555; padding: 5px 6px; font-size: 11px; }
.p-lines { width: 100%; margin-top: 16px; }
.p-lines th { font-size: 8px; font-weight: 700; letter-spacing: 0.08em; background: #2e2e2e; color: #f7f5ef; padding: 5px 6px; text-align: left; text-shadow: none; }
.p-lines td { padding: 8px 6px; border-bottom: 1px solid #bdb9b0; font-size: 10.5px; vertical-align: middle; }
.p-lines td:first-child { width: 22px; color: #666; }
.p-lines td:nth-child(2) { width: 32px; font-weight: 700; }
.p-part { font-family: "Courier New", Courier, monospace; font-weight: 700; white-space: nowrap; }
.p-struck { position: relative; color: #555; }
.p-struck::after {
  content: ""; position: absolute; left: -3px; right: -3px; top: 52%; height: 1.6px;
  background: #1d3a8f; transform: rotate(-6deg); border-radius: 2px;
}
.p-pen {
  font-family: "Ink Free", "Segoe Print", "Bradley Hand", "Noteworthy", "Comic Sans MS", cursive;
  color: #1d3a8f; font-size: 15px; font-weight: 400; display: inline-block;
  transform: rotate(-5deg) translateY(-5px); margin-left: 5px; text-shadow: none;
}
.p-totals { width: 230px; margin: 12px 0 0 auto; font-size: 10.5px; }
.p-totals div { display: flex; justify-content: space-between; padding: 3px 6px; }
.p-grand { border-top: 2px solid #333; margin-top: 3px; padding-top: 6px !important; font-weight: 700; font-size: 12.5px; }
.p-foot { margin-top: 34px; display: flex; align-items: flex-end; gap: 28px; }
.p-signline { width: 210px; flex: none; border-bottom: 1px solid #555; display: flex; align-items: flex-end; gap: 8px; font-size: 8px; font-weight: 700; letter-spacing: 0.08em; color: #555; padding-bottom: 2px; }
.p-foot p { font-size: 8.5px; color: #555; line-height: 1.5; }

/* supplier invoice: clean, born-digital PDF */
.sheet.inv {
  background: #ffffff; color: #1d2a2f; padding-bottom: 30px;
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  border-top: 7px solid #0f4c5c;
}
.i-head { display: flex; justify-content: space-between; align-items: center; padding: 30px 40px 22px; }
.i-brand { display: flex; align-items: center; gap: 10px; }
.i-logo { width: 38px; height: 38px; flex: none; }
.i-co { font-size: 17px; font-weight: 700; color: #0f4c5c; letter-spacing: -0.01em; display: inline-block; }
.i-tag { font-size: 8px; color: #6b7b80; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 1px; }
.i-title { font-size: 30px; font-weight: 300; color: #0f4c5c; letter-spacing: 0.01em; }
.i-meta { margin: 0 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: #eef4f5; border-radius: 4px; padding: 10px 12px; }
.i-meta span { display: block; font-size: 7.5px; text-transform: uppercase; letter-spacing: 0.1em; color: #6b7b80; margin-bottom: 2px; }
.i-meta b { font-size: 11px; font-weight: 600; display: inline-block; }
.i-parties { margin: 20px 40px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; font-size: 10.5px; line-height: 1.5; }
.i-parties > div > span:first-child { display: block; font-size: 7.5px; text-transform: uppercase; letter-spacing: 0.1em; color: #6b7b80; margin-bottom: 3px; }
.i-parties [data-f] { display: inline-block; }
.i-lines { margin: 0 40px; width: calc(100% - 80px); }
.i-lines th { font-size: 7.5px; text-transform: uppercase; letter-spacing: 0.1em; color: #6b7b80; font-weight: 600; text-align: left; padding: 6px 4px; border-bottom: 1.5px solid #0f4c5c; }
.i-lines th.r { text-align: right; }
.i-lines td { font-size: 10.5px; padding: 9px 4px; border-bottom: 1px solid #e3e9ea; }
.i-part { font-weight: 600; color: #0f4c5c; white-space: nowrap; }
.i-totals { width: 250px; margin: 14px 40px 0 auto; font-size: 10.5px; }
.i-totals div { display: flex; justify-content: space-between; padding: 4px 6px; }
.i-due { background: #0f4c5c; color: #ffffff; border-radius: 3px; margin-top: 6px; padding: 8px 10px !important; font-weight: 600; font-size: 13px; }
.i-foot { margin: 40px 40px 0; padding-top: 12px; border-top: 1px solid #e3e9ea; font-size: 8.5px; color: #6b7b80; }

/* delivery ticket: canary carbon copy, filled in by hand, folded once */
.sheet.tkt {
  padding: 26px 34px 30px;
  background-color: #f9eebf;
  color: #8f2a20;
  font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  transform: rotate(0.55deg);
}
.sheet.tkt::after {
  content: ""; position: absolute; left: 0; right: 0; top: 49%; height: 3px; pointer-events: none;
  background: linear-gradient(rgba(120, 90, 20, 0.12), rgba(255, 255, 255, 0.45));
}
.t-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #8f2a20; padding-bottom: 10px; }
.t-co { font-size: 18px; font-weight: 700; letter-spacing: 0.04em; display: inline-block; }
.t-sub { font-size: 8.5px; letter-spacing: 0.04em; }
.t-right { text-align: right; }
.t-title { font-size: 12.5px; font-weight: 700; letter-spacing: 0.14em; }
.t-no { font-family: "Courier New", Courier, monospace; font-size: 15px; font-weight: 700; color: #c0281b; }
.t-row { display: flex; align-items: flex-end; gap: 8px; margin-top: 16px; }
.t-l { font-size: 8px; font-weight: 700; letter-spacing: 0.1em; white-space: nowrap; padding-bottom: 3px; }
.t-v { flex: 1; border-bottom: 1px solid #8f2a20; min-height: 24px; padding: 0 8px 2px; }
.t-sig .t-v { min-height: 38px; }
.t-sigwrap { display: inline-block; }
.t-lines { width: 100%; margin-top: 18px; }
.t-lines th { font-size: 8px; font-weight: 700; letter-spacing: 0.1em; border: 1px solid #8f2a20; padding: 4px 10px; text-align: left; }
.t-lines td { border-left: 1px solid #8f2a20; border-right: 1px solid #8f2a20; border-bottom: 1px solid rgba(143, 42, 32, 0.45); height: 32px; padding: 2px 10px; }
.t-lines tr:last-child td { border-bottom: 1px solid #8f2a20; }
.t-q { width: 64px; text-align: center; position: relative; }
.t-smudge {
  position: absolute; left: 50%; top: 50%; width: 34px; height: 24px;
  transform: translate(-22%, -55%) rotate(-14deg);
  background: radial-gradient(ellipse, rgba(52, 62, 110, 0.42), rgba(52, 62, 110, 0.16) 48%, transparent 70%);
  filter: blur(1.6px); border-radius: 50%;
}
.t-notes { margin-top: 16px; border: 1px solid #8f2a20; padding: 6px 10px 12px; min-height: 58px; }
.t-notes .t-l { display: block; margin-bottom: 6px; }
.t-notes .h { font-size: 16px; }
.t-fine { font-size: 8px; text-align: center; margin-top: 22px; letter-spacing: 0.03em; }

/* doc bar tools */
.doc-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.restart {
  width: 36px; height: 36px; border: 0; border-radius: 50%; padding: 0;
  display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease);
}
.restart:hover { background: var(--card); color: var(--ink); }
.restart:active { transform: scale(0.94); }
.actions { scroll-margin-bottom: 28px; }

.nw, .msg.a .w { white-space: nowrap; }
.rec-lines tfoot td span:last-child { display: inline-block; min-width: 92px; }
.back { padding: 0 8px; margin-right: -8px; }
.back:focus-visible { outline-offset: -4px; border-radius: 12px; }

/* ---------- call to action in the top bar ---------- */
.btn.top-cta { min-height: 34px; padding: 6px 16px; font-size: 14px; flex: none; }
.cta-narrow { display: none; }
@media (max-width: 640px) {
  .cta-wide { display: none; }
  .cta-narrow { display: inline; }
  .btn.top-cta { padding: 6px 13px; }
}
/* on a phone the way back stays and the "Demo" pill gives up its place: the page itself says it is sample data */
@media (max-width: 400px) { .demo-pill { display: none; } }
.again { flex-wrap: wrap; gap: 12px; }
@media (max-width: 400px) { .pill-less { display: none !important; } }
