/* The XStadium app, in the family's look (ADR-099; the xattestation.com and
   xlaboratory.in system): Inter, self-hosted; ink, paper and one red. The red
   (#D5122B) is the X, the focus ring, underlines and the one decisive button
   (confirm and sign); on ink it is never text. The header is an ink band in
   both schemes. Hairline rules, square corners (3px controls, 2px focus), flat
   fills only. Colours meet WCAG 2.2 AA in light and dark; every
   control is at least 48 px. */
:root {
  --bg: #ffffff;
  --fg: #0a0a0c;
  --muted: #45454b;
  --line: #d9d9dd;
  --card: #f4f4f4;
  --mark: #d5122b; /* the one red: 5.3:1 on white */
  --accent: #d5122b; /* red as text on light: links' underline, errors, the current tab */
  --on-red: #ffffff; /* text on the red sign button */
  --ink: #0a0a0c; /* the header band and the preview strip, in both schemes */
  --on-ink: #f4f4f4;
  --ink-label: #a9a9af;
  --warn-bg: #f4f4f4;
  --warn-fg: #0a0a0c;
  --focus: #d5122b;
  --pic-bg: #ffffff; /* the step pictures' own card, the same in both schemes: their dark lines need a light ground */
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0c;
    --fg: #f4f4f4;
    --muted: #a9a9af;
    --line: #26262b;
    --card: #16161a;
    --accent: #f4f4f4; /* on ink red is never text: errors and the current tab are paper, marked by a red rule */
    --warn-bg: #16161a;
    --warn-fg: #f4f4f4;
    --focus: #d5122b;
    --pic-bg: #ffffff; /* stays light, so the card itself is seen */
  }
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/InterVariable-latin.woff2) format("woff2");
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", "Noto Sans Devanagari", "Nirmala UI", "Kohinoor Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
#app { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding: 1rem; max-width: 40rem; width: 100%; margin: 0 auto; padding-bottom: 6rem; }
h1 { font-size: 28px; font-weight: 620; letter-spacing: -0.02em; line-height: 1.2; display: flex; gap: .5rem; align-items: center; justify-content: space-between; text-wrap: balance; }
h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; margin-top: 1.75rem; text-wrap: balance; }
:lang(hi) h1, :lang(hi) h2 { letter-spacing: 0; line-height: 1.3; font-weight: 600; }
h1:focus { outline: none; }
a { color: var(--fg); text-decoration-color: var(--mark); text-decoration-thickness: 2px; text-underline-offset: 6px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

/* the preview's strip, in the page before any script: one ink line, not a warning colour */
.preview { margin: 0; background: var(--ink); color: var(--ink-label); font-size: 14px; line-height: 1.4; padding: .5rem 1rem; border-left: 2px solid var(--mark); }

/* the header: an ink band with the wordmark, in both schemes */
.bar { background: var(--ink); color: var(--on-ink); }
/* the header's row sits in the content's own column: the wordmark lines up with the text below it */
.bar .in { display: flex; align-items: center; gap: .75rem; padding: .5rem 1rem; min-height: 56px; max-width: 40rem; margin: 0 auto; flex-wrap: wrap; }
.bar .wm { display: block; height: 28px; width: auto; margin-right: auto; }
.bar .role { color: var(--ink-label); font-size: 15px; }
.bar select { width: auto; background: var(--ink); color: var(--on-ink); border-color: var(--ink-label); }
.bar button { background: var(--ink); color: var(--on-ink); border-color: var(--ink-label); }
.bar button.reset { border: 0; padding: .5rem 0; background: transparent; color: var(--ink-label); font-size: 15px; font-weight: 450; text-decoration: underline 2px var(--mark); text-underline-offset: 6px; }
.bar button.reset:hover { color: var(--on-ink); }
.skip { position: absolute; left: -999px; }
.skip:focus { position: static; }
main:focus { outline: none; }

nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-around; }
nav a { display: flex; flex-direction: column; align-items: center; min-width: 48px; min-height: 56px; padding: .35rem .25rem; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 450; border-top: 2px solid transparent; }
nav a[aria-current="page"] { color: var(--accent); font-weight: 600; border-top-color: var(--mark); }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

button, .button, select, input, textarea { font: inherit; }
button, .button {
  min-height: 48px; min-width: 48px; padding: .6rem 1rem; border-radius: 3px; font-weight: 600;
  border: 1px solid var(--fg); background: var(--bg); color: var(--fg); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
button.primary, .button { background: var(--fg); border-color: var(--fg); color: var(--bg); }
/* the one red fill: confirm and sign, the one decisive act */
button.sign { background: var(--mark); border-color: var(--mark); color: var(--on-red); }
button.chosen { text-decoration: underline 2px var(--mark); text-underline-offset: .25em; }
button.speak { border: none; padding: .5rem; min-width: 48px; background: transparent; }
.door { display: block; width: 100%; min-height: 72px; font-size: 1.15rem; margin: .5rem 0; background: var(--card); border-color: var(--line); color: var(--fg); text-align: left; justify-content: flex-start; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1rem 0; }
.stack { display: flex; flex-direction: column; gap: .5rem; margin: 1rem 0; }
input, select, textarea { min-height: 48px; padding: .5rem .75rem; border: 1px solid var(--muted); border-radius: 3px; background: var(--bg); color: var(--fg); width: 100%; }
.check { display: flex; align-items: center; gap: .5rem; }
.check input { width: 28px; min-height: 28px; }
.hint { color: var(--muted); }
.warn, .offline, .vault { background: var(--warn-bg); color: var(--warn-fg); padding: .5rem .75rem; border-left: 2px solid var(--fg); }
.mock { margin: 0 0 1rem; padding: .25rem 0 .25rem .75rem; border-left: 2px solid var(--mark); color: var(--muted); font-size: 15px; }
.off { color: var(--fg); padding-left: .75rem; border-left: 2px solid var(--mark); }
.error { color: var(--accent); font-weight: 600; padding-left: .75rem; border-left: 2px solid var(--mark); }

/* lists hang from an ink rule, rows divided by pale rules */
.list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--fg); }
.card, .money { padding: .75rem 0; margin: 0; border-bottom: 1px solid var(--line); }
.end { color: var(--muted); text-align: left; font-size: 14px; padding: .75rem 0 0; }
.state { font-weight: 600; }
.summary dt { font-weight: 600; margin-top: .75rem; }
.summary dd { margin: 0; }
.glyph { margin: .75rem 0; text-align: center; }
.mark { width: 180px; height: 180px; }
.glyph[data-size="big"] .mark { width: min(80vw, 320px); height: min(80vw, 320px); }
.printed { font-family: ui-monospace, "Cascadia Mono", "Roboto Mono", monospace; letter-spacing: .08em; display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.glyph[data-plain] { text-align: left; display: flex; align-items: center; gap: 1rem; }
.glyph[data-plain] .mark, .glyph[data-plain][data-size="big"] .mark { width: 80px; height: 80px; padding: 10px; background: var(--ink); border-radius: 3px; flex: none; }
.glyph[data-plain] .printed { font-family: inherit; font-size: 15px; letter-spacing: 0; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
code { font-family: ui-monospace, "Cascadia Mono", "Roboto Mono", monospace; overflow-wrap: anywhere; font-size: .9rem; }
.camera { width: 100%; max-height: 50vh; background: #000; border-radius: 3px; }
table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-variant-numeric: tabular-nums; }
th, td { border-bottom: 1px solid var(--line); padding: .4rem .6rem; text-align: left; }
thead th { border-bottom-color: var(--fg); }
.money .holder { font-weight: 600; }
.money-note { border-left: 2px solid var(--mark); padding-left: .75rem; margin-top: 1.5rem; }
.readback { padding-left: 1.25rem; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.picture { margin: .5rem 0 0; }
.step { width: 112px; height: 112px; display: block; padding: 8px; background: var(--pic-bg); border-radius: 3px; }
.recovery code { font-size: 1.35rem; letter-spacing: .12em; display: block; padding: .75rem; background: var(--card); border-radius: 3px; }
.signed { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; }
.signed dd { margin: 0; }
.vault { margin: 1rem 0; }

/* the preview's role picker: the family's index list, whole-row links */
.pick .lead { color: var(--muted); font-size: 18px; margin-top: 0; }
.index-list { list-style: none; padding: 0; margin: 1.5rem 0; border-top: 1px solid var(--fg); }
.index-list a { display: flex; flex-direction: column; gap: .15rem; min-height: 48px; padding: .9rem 0 1rem; border-bottom: 1px solid var(--line); color: var(--fg); text-decoration: none; }
.index-list .t { font-size: 22px; font-weight: 620; letter-spacing: -0.02em; line-height: 1.2; }
.index-list .d { color: var(--muted); font-size: 15px; }
.index-list a:hover .t, .index-list a:focus-visible .t { text-decoration: underline 2px var(--mark); text-underline-offset: .16em; }
:lang(hi) .index-list .t { letter-spacing: 0; }
.all summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; cursor: pointer; text-decoration: underline; text-decoration-color: var(--mark); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.all h2 { font-size: 17px; margin-top: 1.5rem; }

/* wide screens: the tab bar is capped to the content's column, not spread across the window */
@media (min-width: 900px) {
  nav ul { max-width: 40rem; margin: 0 auto; justify-content: space-between; padding: 0 1rem; }
}
