/* Trading desk. Look borrowed from Tally Prime (teal title band, yellow focus bar, key hints)
   because Game 1 is an accounts reconciliation task that Indian accounts clerks do in Tally. */
:root {
  color-scheme: light dark;
  --band: #0e5a63;
  --band-ink: #f4fbfb;
  --bar: #ffd84d;
  --bar-ink: #1b1b1b;
  --bg: #f6f3e9;
  --panel: #fffdf6;
  --ink: #1d2327;
  --muted: #5a6670;
  --line: #d9d2bd;
  --accent: #0e7c86;
  --good: #1d7a3a;
  --bad: #b3261e;
  --shadow: 0 1px 0 rgb(0 0 0 / 6%), 0 8px 24px rgb(14 90 99 / 8%);
  --body: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
:root[data-theme="dark"] {
  --band: #08353a;
  --band-ink: #e6f6f6;
  --bar: #e3b92b;
  --bg: #11171a;
  --panel: #182126;
  --ink: #e7ecee;
  --muted: #9fb0b8;
  --line: #2c3a41;
  --accent: #4fc3cc;
  --good: #59c27a;
  --bad: #ff8a80;
  --shadow: 0 1px 0 rgb(0 0 0 / 40%);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--body); }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--bar); outline-offset: 2px; }
.band { background: var(--band); color: var(--band-ink); padding: 0.6rem clamp(1rem, 3vw, 2rem); display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.band h1 { font-size: 1.15rem; margin: 0; letter-spacing: 0.02em; }
.band .who { margin-inline-start: auto; font-family: var(--mono); font-size: 0.85rem; display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.band button { background: transparent; color: inherit; border: 1px solid color-mix(in oklch, var(--band-ink) 40%, transparent); border-radius: 4px; padding: 0.25rem 0.6rem; font: inherit; cursor: pointer; }
.status { background: color-mix(in oklch, var(--band) 85%, var(--bg)); color: var(--band-ink); padding: 0.35rem clamp(1rem, 3vw, 2rem); font-size: 0.9rem; display: flex; gap: 1.25rem; flex-wrap: wrap; }
.status strong { font-family: var(--mono); font-weight: 600; }
main { max-width: 1100px; margin: 0 auto; padding: 1rem clamp(1rem, 3vw, 2rem) 4rem; }
nav.tabs { display: flex; gap: 0.25rem; border-bottom: 2px solid var(--band); margin-bottom: 1rem; overflow-x: auto; }
nav.tabs a { padding: 0.5rem 0.9rem; text-decoration: none; color: var(--ink); border-radius: 6px 6px 0 0; white-space: nowrap; }
nav.tabs a[aria-current="page"] { background: var(--bar); color: var(--bar-ink); font-weight: 700; }
nav.tabs kbd, .key { font-family: var(--mono); font-size: 0.75rem; border: 1px solid currentColor; border-radius: 3px; padding: 0 0.25rem; margin-inline-end: 0.35rem; opacity: 0.75; }
section.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow); animation: rise 0.35s ease both; }
section.panel:nth-of-type(2) { animation-delay: 60ms; } section.panel:nth-of-type(3) { animation-delay: 120ms; } section.panel:nth-of-type(4) { animation-delay: 180ms; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { section.panel { animation: none; } }
h2 { font-size: 1.2rem; margin: 0 0 0.5rem; }
h3 { font-size: 1rem; margin: 1rem 0 0.4rem; }
.muted { color: var(--muted); }
.lede { font-size: 1.05rem; max-width: 62ch; }
table.ledger { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.ledger th { text-align: start; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); border-bottom: 2px solid var(--line); padding: 0.35rem 0.5rem; }
table.ledger td { border-bottom: 1px solid var(--line); padding: 0.45rem 0.5rem; vertical-align: top; }
table.ledger tr:focus-within, table.ledger tr:hover { background: color-mix(in oklch, var(--bar) 35%, transparent); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: 0.75rem; padding: 0.05rem 0.45rem; border-radius: 999px; border: 1px solid var(--line); font-family: var(--mono); }
.tag.good { color: var(--good); border-color: var(--good); } .tag.bad { color: var(--bad); border-color: var(--bad); }
button.act, .act { font: inherit; font-weight: 700; border: 2px solid var(--band); background: var(--band); color: var(--band-ink); border-radius: 6px; padding: 0.4rem 0.9rem; cursor: pointer; display: inline-flex; gap: 0.4rem; align-items: center; }
button.act.secondary { background: transparent; color: var(--ink); }
button.act.warn { border-color: var(--bad); background: transparent; color: var(--bad); }
button.act:disabled { opacity: 0.5; cursor: not-allowed; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.doc { border: 1px solid var(--line); border-radius: 6px; padding: 0.6rem; background: var(--bg); display: grid; gap: 0.4rem; }
.doc button.thumb { border: 0; padding: 0; background: none; cursor: zoom-in; }
.doc img { width: 100%; aspect-ratio: 800 / 1060; object-fit: contain; object-position: top; border-radius: 4px; background: #fff; }
label { display: block; font-weight: 700; margin: 0.5rem 0 0.25rem; }
input[type="text"], input[type="number"], select, textarea { font: inherit; padding: 0.4rem 0.55rem; border: 2px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); width: min(100%, 28rem); }
input:user-invalid { border-color: var(--bad); }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0.15rem 0 0.4rem; max-width: 62ch; }
.notice { border-inline-start: 5px solid var(--bar); background: color-mix(in oklch, var(--bar) 18%, var(--panel)); padding: 0.6rem 0.9rem; border-radius: 4px; margin: 0.5rem 0; }
.notice.bad { border-color: var(--bad); background: color-mix(in oklch, var(--bad) 10%, var(--panel)); }
.message { white-space: pre-wrap; background: var(--bg); border: 1px dashed var(--line); padding: 0.5rem 0.7rem; border-radius: 4px; font-size: 0.95rem; }
dialog { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); max-width: min(96vw, 900px); padding: 0; }
dialog::backdrop { background: rgb(0 0 0 / 55%); }
dialog header { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.9rem; background: var(--band); color: var(--band-ink); }
dialog img { display: block; max-width: 100%; height: auto; background: #fff; }
canvas.sketch { width: min(100%, 480px); aspect-ratio: 1; background: #fff; border: 2px solid var(--band); border-radius: 6px; touch-action: none; cursor: crosshair; display: block; }
.timer { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; }
.timer.low { color: var(--bad); }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; margin-top: 0.75rem; }
.options button { font: inherit; padding: 0.55rem; border: 2px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 6px; cursor: pointer; text-align: start; }
.options button:hover, .options button:focus-visible { background: var(--bar); color: var(--bar-ink); border-color: var(--bar); }
.drawing { width: min(100%, 420px); aspect-ratio: 1; background: #fff; border-radius: 6px; border: 2px solid var(--band); }
.slots { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.slot { border: 1px solid var(--line); border-radius: 8px; padding: 0.75rem; background: var(--bg); }
.slot img { width: 100%; aspect-ratio: 1; background: #fff; border-radius: 4px; }
.toast { position: fixed; inset-inline: 0; bottom: 1rem; margin: auto; width: fit-content; max-width: 92vw; background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; border-radius: 6px; box-shadow: var(--shadow); }
.bi { line-height: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
