/* Aspected Receipt, in the design language of the Aspected demos (triage, validation): white page, ink and one
   brand blue, thin lines and 6px corners, uppercase labels, and the same colour per aspect everywhere.
   The printer and the paper keep their own look: they are the object the demo is about. */
:root {
  --ink: #0b1430; --ink2: #434c65; --muted: #717892; --faint: #9aa1b4;
  --line: #e2e5ec; --line2: #eef0f4; --soft: #f5f6f9; --tint: #f2f4f9;
  --brand: #1f56f0; --brand2: #1745cf; --bad: #c8323f; --live: #ff5a64;
  --bg: #ffffff; --card: #ffffff; --accent: var(--brand); --muted2: var(--faint);
  /* aspects: the demos' colours, mapped onto this index (content = meaning, lifecycle = status,
     source = severity's rose, client (shown as partner) = customer, date = recency); --t-* is the darker text tone */
  --c-content: #2563eb; --c-lifecycle: #7c3aed; --c-source: #e11d48; --c-client: #0d9488; --c-date: #f59e0b;
  --t-content: #1d4ed8; --t-lifecycle: #6d28d9; --t-source: #be123c; --t-client: #0f766e; --t-date: #b45309;
  --paper: #fdfcf8; --paper-ink: #262624; --paper-faint: #7d7a72;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sans: Inter, "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  /* surfaces and states that change with the theme */
  --scrim: rgba(11,20,48,.3); --brand-text: var(--brand); --sel: #eef3fe; --sel2: #e3e9fb; --on-ink: #ffffff; --t-serious: #a2471f;
  --good-bg: #e9f6e9; --bad-bg: #fbe7e7; --warn-bg: #fff8e8;
  color-scheme: light;
}
/* A sheet of paper inside a dark page (the board report) keeps the light tokens. */
.light {
  --ink: #0b1430; --ink2: #434c65; --muted: #717892; --faint: #9aa1b4;
  --line: #e2e5ec; --line2: #eef0f4; --soft: #f5f6f9; --tint: #f2f4f9;
  --brand: #1f56f0; --brand2: #1745cf; --bad: #c8323f; --bg: #ffffff; --card: #ffffff;
  --t-content: #1d4ed8; --t-lifecycle: #6d28d9; --t-source: #be123c; --t-client: #0f766e; --t-date: #b45309;
  --brand-text: var(--brand); --sel: #eef3fe; --sel2: #e3e9fb; --on-ink: #ffffff; --t-serious: #a2471f;
  --good-bg: #e9f6e9; --bad-bg: #fbe7e7; --warn-bg: #fff8e8; --grid: #eef0f4; --axis: #c9cdd8;
  color-scheme: light; color: var(--ink);
}
/* Dark: the system's choice unless the toggle (theme.js) chose; the receipt paper stays paper. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ink: #e9ecf4; --ink2: #b3b9ca; --muted: #8a91a7; --faint: #646c84;
  --line: #262d40; --line2: #1c2232; --soft: #151b28; --tint: #182036;
  --brand: #3d6dff; --brand2: #5a84ff; --bad: #f2606c; --live: #ff6b74;
  --bg: #0b0f19; --card: #10151f;
  --t-content: #7ea4ff; --t-lifecycle: #b391ff; --t-source: #fb7f98; --t-client: #3fd0bd; --t-date: #f5b544;
  --paper: #f2f0e9; --paper-ink: #262624; --paper-faint: #77746c;
  --scrim: rgba(0,0,0,.6); --brand-text: #7ea4ff; --sel: #16234a; --sel2: #1d2d5c; --on-ink: #0b0f19; --t-serious: #f39a73;
  --good-bg: #0f2a18; --bad-bg: #331519; --warn-bg: #2b2310;
  --grid: #1c2232; --axis: #394157;
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --ink: #e9ecf4; --ink2: #b3b9ca; --muted: #8a91a7; --faint: #646c84;
  --line: #262d40; --line2: #1c2232; --soft: #151b28; --tint: #182036;
  --brand: #3d6dff; --brand2: #5a84ff; --bad: #f2606c; --live: #ff6b74;
  --bg: #0b0f19; --card: #10151f;
  --t-content: #7ea4ff; --t-lifecycle: #b391ff; --t-source: #fb7f98; --t-client: #3fd0bd; --t-date: #f5b544;
  --paper: #f2f0e9; --paper-ink: #262624; --paper-faint: #77746c;
  --scrim: rgba(0,0,0,.6); --brand-text: #7ea4ff; --sel: #16234a; --sel2: #1d2d5c; --on-ink: #0b0f19; --t-serious: #f39a73;
  --good-bg: #0f2a18; --bad-bg: #331519; --warn-bg: #2b2310;
  --grid: #1c2232; --axis: #394157;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* shared pieces, as in the demos */
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-text); }
.lbl { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); line-height: 1.3; }
.lead { font-size: 17px; color: var(--ink2); max-width: 640px; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 18px; border-radius: 4px; font-size: 15px; font-weight: 600;
  border: 1px solid var(--ink); background: var(--card); color: var(--ink); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand2); border-color: var(--brand2); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; border-color: var(--line); color: var(--ink2); }
.btn.sm:hover { border-color: var(--ink); color: var(--ink); background: var(--card); }
.link { border: 0; background: none; color: var(--brand-text); font-weight: 600; font-size: 14px; cursor: pointer; padding: 0; text-decoration: none; }
.link:hover { color: var(--brand2); }
.adot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* top bar */
.top { display: flex; justify-content: space-between; align-items: center; padding: 18px 32px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 28px; width: auto; display: block; }
/* Two logos, one per theme: the wordmark is ink on light, white on dark. */
.logo-dk { display: none !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-lt { display: none !important; } :root:not([data-theme="light"]) .logo-dk { display: block !important; } }
:root[data-theme="dark"] .logo-lt { display: none !important; }
:root[data-theme="dark"] .logo-dk { display: block !important; }
.theme { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0;
  display: grid; place-items: center; transition: color .15s, background .15s; }
.theme:hover { color: var(--ink); background: var(--tint); }
.theme svg { width: 17px; height: 17px; display: block; }
.top nav { display: flex; gap: 24px; align-items: center; font-size: 14px; color: var(--ink2); }
.top nav a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.top nav a:hover, .who:hover { color: var(--ink); }
.top nav a.here { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }
.who.avatar { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--tint); color: var(--brand); cursor: pointer; padding: 0;
  display: grid; place-items: center; margin-left: 4px; transition: background .15s; }
.who.avatar b { font-weight: 700; font-size: 14px; color: var(--brand-text); }
.who.avatar:hover { background: var(--sel2); }

main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 32px 72px; }

/* hero: superclean, one question */
.hero { text-align: center; padding-top: 20vh; transition: padding .4s ease; }
main:not(.empty) .hero { padding-top: 24px; text-align: left; }
.hero h1 { font-size: 44px; line-height: 1.1; letter-spacing: -.028em; font-weight: 700; margin: 0 0 10px; }
.hero .lead { margin: 0 auto 32px; }
main:not(.empty) .hero h1, main:not(.empty) .hero .lead, main:not(.empty) .examples { display: none; }
.ask { display: flex; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 10px 10px 18px; background: var(--card); max-width: 680px; margin: 0 auto; text-align: left; transition: border-color .15s; }
main:not(.empty) .ask { margin: 0; max-width: 860px; }
.ask:focus-within { border-color: var(--ink2); }
.ask input { flex: 1; min-width: 0; border: 0; outline: none; font: 500 19px/1.3 var(--sans); letter-spacing: -.01em; color: var(--ink); background: transparent; padding: 6px 0; }
.ask input::placeholder { color: var(--faint); font-weight: 500; }
.ask button { flex: none; width: 40px; height: 40px; border-radius: 4px; border: 0; background: var(--brand); color: #fff; cursor: pointer; display: grid; place-items: center; }
.ask button:hover { background: var(--brand2); }
.ask button:disabled { background: var(--line2); color: var(--faint); cursor: default; }
.examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 760px; margin: 18px auto 0; }
.examples button { min-height: 30px; padding: 5px 12px; text-align: left; line-height: 1.35; border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--ink2); font-size: 13px; cursor: pointer; }
.examples button:hover { border-color: var(--ink); color: var(--ink); }

/* result: the question's shape and the answer left, the receipt right */
.result { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 56px; margin-top: 32px; align-items: start; }
.asked { margin-bottom: 10px; }
.shape { border: 1px solid var(--line); border-radius: 6px; margin: 18px 0 0; }
.shape .sh-h { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.shape .sh-r { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--line2); font-size: 14px;
  opacity: 0; animation: rise .4s forwards; animation-delay: calc(var(--d) * 90ms); }
.shape .sh-r:last-child { border-bottom: 0; }
.shape .sh-a { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.shape .sh-v { color: var(--ink2); }
.shape .sh-v b { font-weight: 600; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.who-ai { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.who-ai i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.bubble { border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; background: var(--card); }
.answer { font-size: 19px; line-height: 1.5; letter-spacing: -.01em; min-height: 56px; white-space: pre-wrap; }
.answer.waiting { color: var(--faint); }
.answer .cite { display: inline-block; font: 600 12px/1 var(--mono); background: var(--ink); color: var(--on-ink); border-radius: 3px; padding: 3px 5px; margin: 0 2px; vertical-align: 3px; cursor: pointer; }
.answer .cite:hover { background: var(--brand); color: #fff; }
.cursor { display: inline-block; width: 9px; height: 1.1em; background: var(--ink); vertical-align: -3px; animation: blink 1s steps(2) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.answer-meta { margin-top: 12px; font-size: 14px; color: var(--ink2); }
.answer-meta b { color: var(--ink); }
.actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.actions a, .actions button { display: inline-flex; align-items: center; height: 32px; padding: 0 13px; border-radius: 4px; border: 1px solid var(--line); background: var(--card); color: var(--ink2);
  font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer; }
.actions a:hover, .actions button:hover { border-color: var(--ink); color: var(--ink); }
.actions .on, .actions .on:hover { border-color: var(--brand); color: var(--brand-text); background: var(--sel); }

/* what is important: the weights */
.wpanel { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 22px 24px; }
.wpanel h3 { margin: 0 0 4px; font-size: 18px; letter-spacing: -.01em; }
.wpanel .lead { font-size: 14px; margin: 0 0 14px; }
.wpanel .lead b { color: var(--ink); font-weight: 600; }
.wrow { display: grid; grid-template-columns: 120px minmax(0, 1fr) 70px; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.wrow .nm { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.wrow .ds { color: var(--muted); font-size: 12px; line-height: 1.35; }
.wrow input { width: 100%; }
.wrow .v { font: 600 14px var(--sans); text-align: right; font-variant-numeric: tabular-nums; color: var(--ink2); }
.wrow .v.diff { color: var(--bad); }
.wrow .v .idx { display: block; font: 11px var(--sans); color: var(--muted); margin-top: 2px; }
.wprev { margin-top: 16px; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; font-size: 14px; }
.wprev .h { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.wprev .r { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.wprev .r .st { color: var(--muted); font-size: 13px; white-space: nowrap; }
.wprev .r.sent .t { font-weight: 600; }
.wprev .r.sent .t::before { content: "→ "; color: var(--brand-text); }
.wprev .r .bad { color: var(--bad); }
.wprev .flag { margin-top: 8px; color: var(--bad); font-weight: 600; }
.wprev .same { margin-top: 8px; color: var(--muted); }
.wbtns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
/* Oversight on one answer: report an incident, override it. */
.act-sep { width: 1px; background: var(--line); margin: 4px 4px; }
.ofield { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: start; padding: 8px 0; font-size: 14px; }
.ofield > span { color: var(--ink2); font-weight: 500; padding-top: 7px; }
.ofield input, .ofield select, .ofield textarea { width: 100%; font: 14px var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 7px 10px; }
.ofield textarea { min-height: 70px; resize: vertical; }
.ofield input:focus, .ofield select:focus, .ofield textarea:focus { outline: none; border-color: var(--ink2); }
.ofield .ds { font-size: 12px; color: var(--muted); margin-top: 4px; }
.oerr { color: var(--bad); font-size: 13px; }
.events { margin-top: 14px; display: grid; gap: 10px; }
.ev { border: 1px solid var(--line); border-left: 4px solid var(--bad); border-radius: 6px; padding: 12px 16px; background: var(--card); font-size: 14px; }
.ev.override { border-left-color: var(--brand); }
.ev.sev-warning { border-left-color: #d9a400; }
.ev .ev-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.ev .ev-h b { color: var(--ink); font-weight: 600; font-size: 13px; }
.ev .ev-t { font-weight: 600; }
.ev .ev-n { color: var(--ink2); margin-top: 4px; }
.ev a { font-size: 12.5px; color: var(--brand-text); }
.stamp { position: absolute; bottom: 150px; right: 44px; z-index: 4; pointer-events: none; transform: rotate(-11deg); font: 700 19px/1 var(--mono); letter-spacing: .16em;
  color: rgba(200, 50, 63, .82); border: 3px double rgba(200, 50, 63, .7); border-radius: 6px; padding: 8px 12px 7px; mix-blend-mode: multiply;
  animation: stampin .25s ease-out; }
.stamp.override { color: rgba(31, 86, 240, .85); border-color: rgba(31, 86, 240, .7); }
.stamp small { display: block; font-size: 10px; letter-spacing: .08em; font-weight: 600; margin-top: 4px; }
@keyframes stampin { from { transform: rotate(-11deg) scale(1.6); opacity: 0; } to { transform: rotate(-11deg) scale(1); opacity: 1; } }
.notice { margin: 14px auto 0; max-width: 640px; text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--bad); border-radius: 6px; padding: 10px 14px; font-size: 14px; color: var(--ink2); background: var(--card); }
.notice b { color: var(--ink); }
.ingest { font-size: 12.5px; color: var(--muted); margin: -4px 0 16px; }
.guide-link { display: block; text-align: center; margin: 26px 26px 0; font-size: 13px; color: var(--muted); }
.guide-link:hover { color: var(--brand-text); }
.wbtns .go { height: 36px; padding: 0 16px; border-radius: 4px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.wbtns .alt { height: 36px; padding: 0 16px; border-radius: 4px; border: 1px solid var(--ink); background: var(--card); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.wbtns .link { font-size: 14px; }
.wnote { color: var(--muted); font-size: 12.5px; margin-top: 12px; line-height: 1.5; }
.wchip { max-width: 860px; margin: 10px 0 0; font-size: 13px; color: var(--ink2); }
.wchip b { font-weight: 600; color: var(--ink); }
.wchip button { margin-left: 8px; }

/* the printer */
.receipt-col { position: relative; }
.pen-layer { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 3; }
.pen-layer .pen-hit { pointer-events: all; }
.pen-layer .pen-hit:hover { cursor: default; }
.pen-note { position: absolute; right: calc(100% + 28px); width: 300px; font: 16px/1.45 var(--sans); letter-spacing: -.005em; color: var(--ink); text-align: right;
  opacity: 0; transform: translateX(8px); transition: opacity .45s ease, transform .45s ease; pointer-events: none; z-index: 4; }
.pen-note.on { opacity: 1; transform: none; }
.pen-note.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; text-align: left; box-shadow: 0 8px 24px rgba(11,20,48,.10); }
.weights-open .pen-note:not(.inside) { opacity: 0 !important; }
.pen-note.inside { right: auto; left: 12px; width: auto; max-width: calc(100% - 24px); text-align: left; background: var(--card);
  padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(11,20,48,.12); }
.printer { position: relative; z-index: 2; }
.printer-body { height: 46px; border-radius: 12px 12px 6px 6px; background: linear-gradient(#2a3150, #141a33); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; box-shadow: 0 6px 18px rgba(11,20,48,.22); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .printer-body { box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 0 0 1px #262d40, 0 6px 18px rgba(0,0,0,.5); } }
:root[data-theme="dark"] .printer-body { box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 0 0 1px #262d40, 0 6px 18px rgba(0,0,0,.5); }
.printer-name { font: 500 10px var(--mono); letter-spacing: .2em; color: #8a91ab; }
.mute { position: fixed; left: 18px; bottom: 16px; z-index: 6; width: 32px; height: 32px; border-radius: 4px; border: 1px solid transparent; background: transparent;
  color: var(--faint); cursor: pointer; display: grid; place-items: center; transition: color .15s, border-color .15s; }
.mute:hover { color: var(--ink); border-color: var(--line); background: var(--card); }
.mute svg { width: 16px; height: 16px; display: block; }
.led { width: 7px; height: 7px; border-radius: 50%; background: #4b5270; }
.led.on { background: #6be08a; box-shadow: 0 0 8px #6be08a; animation: pulse .5s ease-in-out infinite alternate; }
.led.ready { background: #6be08a; }
@keyframes pulse { to { opacity: .45; } }
.slot { height: 10px; margin: 0 14px; background: #070a17; border-radius: 0 0 4px 4px; box-shadow: inset 0 3px 4px rgba(0,0,0,.6); }
.feed { position: relative; height: 0; overflow: hidden; margin: -4px 26px 0; z-index: 1; }
.feed::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 14px; background: linear-gradient(rgba(0,0,0,.18), transparent); z-index: 2; pointer-events: none; }
.feed.printing::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26px; background: linear-gradient(transparent, rgba(253,252,248,.9)); z-index: 2; }

/* the paper */
.paper { position: relative; background: var(--paper); color: var(--paper-ink); font: 12.5px/1.55 var(--mono); padding: 22px 20px 30px;
  box-shadow: 0 1px 1px rgba(0,0,0,.05), 0 14px 34px rgba(11,20,48,.13);
  background-image: radial-gradient(rgba(0,0,0,.018) 1px, transparent 1px); background-size: 3px 3px; }
.feed.torn .paper::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7px;
  background: linear-gradient(-45deg, var(--bg) 5px, transparent 0) 0 100% / 10px 10px repeat-x,
              linear-gradient(45deg, var(--bg) 5px, transparent 0) 0 100% / 10px 10px repeat-x; }
.feed.torn { animation: settle .35s ease-out; overflow: visible; }
/* Once torn off, the slip lies like paper: a soft shadow, and the end curling up a little at its corners. */
.feed.torn .paper { box-shadow: 0 1px 2px rgba(11,20,48,.06), 0 10px 24px -8px rgba(11,20,48,.16), 0 30px 50px -30px rgba(11,20,48,.20); }
.feed.torn .paper::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 44px; pointer-events: none; z-index: 1;
  background: linear-gradient(to bottom, rgba(11,20,48,0), rgba(11,20,48,.022) 55%, rgba(255,255,255,.6) 82%, rgba(11,20,48,.035)),
              radial-gradient(60% 120% at 0 100%, rgba(11,20,48,.06), rgba(11,20,48,0) 70%),
              radial-gradient(60% 120% at 100% 100%, rgba(11,20,48,.06), rgba(11,20,48,0) 70%); }
.feed.torn::after { content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 26px; z-index: -1; pointer-events: none; filter: blur(4px);
  background: radial-gradient(closest-side, rgba(11,20,48,.30), rgba(11,20,48,0)) 0 0 / 46% 100% no-repeat,
              radial-gradient(closest-side, rgba(11,20,48,.30), rgba(11,20,48,0)) 100% 0 / 46% 100% no-repeat; }
@keyframes settle { 0% { transform: translateY(0); } 50% { transform: translateY(5px); } 100% { transform: translateY(2px); } }
.paper .c { text-align: center; }
.paper .logo { display: block; margin: 6px auto 10px; height: 34px; width: auto; }
.paper .key { font-size: 11px; margin: 0 0 6px; }
.paper .name { font-weight: 600; font-size: 15px; letter-spacing: .42em; text-align: center; margin-right: -.42em; }
.paper .kind { text-align: center; letter-spacing: .14em; font-size: 11px; color: var(--paper-faint); margin-bottom: 8px; }
.paper hr { border: 0; border-top: 1px dashed #b9b5aa; margin: 10px 0; }
.paper hr.double { border-top: 3px double #8f8b80; }
.paper .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.paper .row > :last-child { text-align: right; white-space: nowrap; }
.paper .h { font-weight: 600; letter-spacing: .06em; margin-bottom: 4px; }
.paper .faint { color: var(--paper-faint); }
.paper .nw { white-space: nowrap; }
.paper .q { margin: 6px 0 2px; }
.paper .item { margin: 7px 0 9px; border-radius: 3px; transition: background .2s; }
.paper .item.flash { background: #efe9d8; }
.paper .item .t { font-weight: 600; }
.paper .item .t a { text-decoration: none; cursor: pointer; }
.paper .item .t a:hover { text-decoration: underline; }
.paper .meta { color: var(--paper-faint); font-size: 11.5px; padding-left: 2ch; }
.paper .sub { padding-left: 2ch; }
.paper .sub.adj { color: var(--paper-faint); }
.paper .ok { font-size: 11px; }
.paper .void .t, .paper .void .total { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.paper .inv { background: var(--paper-ink); color: var(--paper); padding: 0 4px; font-weight: 600; letter-spacing: .08em; text-decoration: none; display: inline-block; }
.paper .why { padding-left: 4ch; font-size: 11.5px; }
.paper .also { padding-left: 4ch; color: var(--paper-faint); font-size: 11.5px; }
.paper .big { font-size: 16px; font-weight: 600; }
.paper .fine { font-size: 11px; text-align: center; color: var(--paper-faint); margin: 8px 6px; }
.paper .barcode { display: block; margin: 14px auto 4px; height: 52px; width: 100%; }
.paper .id { text-align: center; letter-spacing: .3em; font-weight: 500; margin-right: -.3em; }
.paper .thanks { text-align: center; margin-top: 10px; letter-spacing: .12em; font-size: 11px; }

/* document sheet */
.modal { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; z-index: 10; padding: 24px; }
.modal[hidden] { display: none; }
.sheet { background: var(--card); max-width: 680px; width: 100%; max-height: 86vh; overflow: auto; border-radius: 6px; padding: 30px 34px; box-shadow: 0 30px 80px rgba(11,20,48,.25); }
.sheet h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.015em; }
.sheet .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 18px; }
.sheet .tag { font-size: 12px; font-weight: 600; border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; color: var(--ink2); }
.sheet .tag.bad { border-color: var(--bad); color: var(--bad); }
.sheet p { margin: 0 0 12px; line-height: 1.6; color: var(--ink2); }
.sheet .close { float: right; background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }

.foot { text-align: center; font-size: 12.5px; color: var(--muted); padding: 20px; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .result { grid-template-columns: 1fr; gap: 32px; }
  .receipt-col { max-width: 400px; width: 100%; margin: 0 auto; }
}
@media (max-width: 600px) {
  main { padding: 0 16px 48px; }
  .top { padding: 12px 16px; flex-wrap: wrap; row-gap: 8px; }
  .brand img { height: 24px; }
  .top nav { width: 100%; justify-content: space-between; gap: 10px; font-size: 13px; }
  .top nav a { white-space: nowrap; }
  .who.avatar { margin-left: 0; }

  .hero { padding-top: 12vh; }
  .hero h1 { font-size: 30px; }
  .lead { font-size: 16px; }
  .ask input { font-size: 17px; }
  .answer { font-size: 17px; }
  .shape .sh-r { grid-template-columns: 1fr; gap: 2px; }
  .feed { margin: -4px 12px 0; }
  .wrow { grid-template-columns: 1fr auto; }
  .wrow > div:nth-child(2) { grid-column: 1 / -1; order: 3; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } .shape .sh-r { opacity: 1; } }

/* ---- One spacing scale and one type scale, used by the stage navigation and the phone layout ---- */
:root { --sp1: 4px; --sp2: 8px; --sp3: 12px; --sp4: 16px; --sp5: 24px; --sp6: 32px;
  --fs-xs: 12px; --fs-s: 13.5px; --fs-m: 15px; --fs-l: 18px; --fs-xl: 24px; --fs-xxl: 30px; --tap: 44px; }

/* ---- The four stages: 1 Receipt, 2 Journal, 3 Control room, 4 Board ---- */
.top nav .steps { display: flex; align-items: center; gap: var(--sp5); }
.top nav .step { display: inline-flex; align-items: center; gap: var(--sp2); text-decoration: none; padding: var(--sp1) 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.top nav .step i { font: 600 11px/1 var(--mono); font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--muted); }
.top nav .step.here { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }
.top nav .step.here i { background: var(--brand); border-color: var(--brand); color: #fff; }
.top nav .set-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; padding: var(--sp1) 0; border-bottom: 2px solid transparent; color: var(--muted); }
.top nav .set-link svg { width: 16px; height: 16px; }
.top nav .set-link.here { color: var(--ink); border-bottom-color: var(--brand); }
.stagebar { display: none; }

@media (max-width: 760px) {
  /* The header keeps the brand and the tools; the stages move to the bottom bar, one stage per screen. */
  .top { padding: var(--sp3) var(--sp4); flex-wrap: nowrap; }
  .top nav { width: auto; gap: var(--sp2); }
  .top nav .steps { display: none; }
  .top nav .set-link span { display: none; }
  .top nav .set-link, .top nav .theme, .who.avatar { min-width: var(--tap); min-height: var(--tap); justify-content: center; display: inline-flex; align-items: center; }
  .who.avatar { width: 36px; height: 36px; min-width: 36px; min-height: 36px; margin: 4px; }
  .stagebar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .stagebar .sb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px;
    text-decoration: none; color: var(--muted); font-size: var(--fs-xs); font-weight: 500; position: relative; }
  .stagebar .sb i { font: 600 11px/1 var(--mono); font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); }
  .stagebar .sb + .sb::before { content: ""; position: absolute; left: 0; top: 50%; width: 10px; height: 1px; background: var(--line); transform: translate(-50%, -12px); }
  .stagebar .sb.here { color: var(--ink); font-weight: 600; }
  .stagebar .sb.here i { background: var(--brand); border-color: var(--brand); color: #fff; }
  body.has-stagebar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body.has-stagebar .mute { bottom: calc(72px + env(safe-area-inset-bottom)); }

  /* Touch targets: 44px for everything a thumb presses. */
  .btn, .actions a, .actions button, .wbtns .go, .wbtns .alt, .ofield input, .ofield select, .ask button { min-height: var(--tap); }
  .link, button.link { min-height: var(--tap); display: inline-flex; align-items: center; }
  .examples button { min-height: var(--tap); }
  .act-sep { display: none; }
  .foot { padding-bottom: var(--sp5); }
}
@media print { .stagebar, .top nav .steps, .top nav .set-link { display: none !important; } body.has-stagebar { padding-bottom: 0; } }
@media (max-width: 760px) {
  /* The sound button sits at the end of the page instead of floating over the printer. */
  body.has-stagebar .mute { position: static; display: block; margin: 0 auto var(--sp4); width: var(--tap); height: var(--tap); }
  .brand { min-height: var(--tap); display: inline-flex; align-items: center; }
}
/* Tablet: the stage links also move to the bottom bar; the rest of the phone layout starts at 760px. */
@media (max-width: 860px) {
  .top nav .steps { display: none; }
  .top nav .set-link span { display: none; }
  .stagebar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .stagebar .sb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px;
    text-decoration: none; color: var(--muted); font-size: var(--fs-xs); font-weight: 500; position: relative; }
  .stagebar .sb i { font: 600 11px/1 var(--mono); font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); }
  .stagebar .sb.here { color: var(--ink); font-weight: 600; }
  .stagebar .sb.here i { background: var(--brand); border-color: var(--brand); color: #fff; }
  body.has-stagebar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media print { .stagebar { display: none !important; } }
