/* QC Robots shared styles, in the MWATHS look (mwaths.com):
   light theme is a whiteboard with red marking pen, dark theme a chalkboard with yellow chalk.
   Same tokens, font (Lexend, self-hosted) and button style as the quizzer. */
@font-face {
  font-family: "Lexend"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/vendor/lexend/lexend-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Lexend"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/vendor/lexend/lexend-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #f4f6f8;
  --board: #ffffff;
  --ink: #13233f;
  --muted: #5a6883;
  --line: #d5dbe6;
  --accent: #1f4fbf;
  --accent-ink: #ffffff;
  --answer: #d0211c;
  --answer-wash: rgba(208, 33, 28, 0.08);
  --good: #1a7a45;
  --good-wash: rgba(26, 122, 69, 0.10);
  --hover: rgba(19, 35, 63, 0.06);
  --shadow: 0 18px 50px rgba(19, 35, 63, 0.22);
  --bag: #0B321F;
  --bag-edge: #0B321F;
  --gold: #DDAE43;
  --font: "Lexend", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --w-text: 375;
  --w-semi: 500;
  --w-bold: 600;
  --red: #d63b2f;
  --blue: #2563c9;
  --green: #23935a;
  --yellow: #f2bf26;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10231f; --board: #173029; --ink: #f2f0e4; --muted: #a9bbb2; --line: #2f4d44;
    --accent: #f2f0e4; --accent-ink: #14302a; --answer: #ffd75e; --answer-wash: rgba(255, 215, 94, 0.10);
    --good: #7fdca5; --good-wash: rgba(127, 220, 165, 0.12);
    --hover: rgba(242, 240, 228, 0.08); --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    --bag-edge: #5f8a7a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10231f; --board: #173029; --ink: #f2f0e4; --muted: #a9bbb2; --line: #2f4d44;
  --accent: #f2f0e4; --accent-ink: #14302a; --answer: #ffd75e; --answer-wash: rgba(255, 215, 94, 0.10);
  --good: #7fdca5; --good-wash: rgba(127, 220, 165, 0.12);
  --hover: rgba(242, 240, 228, 0.08); --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --bag-edge: #5f8a7a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: var(--w-text);
  font-size: 16px;
  line-height: 1.4;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: var(--w-bold); text-wrap: balance; }
b, strong { font-weight: var(--w-bold); }
p { margin: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

button, select, input { font: inherit; color: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px;
  border: 1.5px solid var(--ink);
  background: none;
  padding: 9px 18px;
  font-weight: var(--w-bold);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, filter .15s, transform .08s;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.1); background: var(--accent); }
.btn.quiet { border-color: var(--line); }
.btn.danger { border-color: var(--answer); color: var(--answer); }
.btn.icon { padding: 9px 11px; border-color: var(--line); }
.btn[aria-pressed="true"] { background: var(--answer); border-color: var(--answer); color: var(--board); }
.themeBtn .sun { display: none; }
:root[data-theme="dark"] .themeBtn .sun { display: block; }
:root[data-theme="dark"] .themeBtn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .themeBtn .sun { display: block; }
  :root:not([data-theme="light"]) .themeBtn .moon { display: none; }
}

input[type="text"], input[type="number"], select {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--board);
  padding: 9px 12px;
}
input:focus, select:focus { border-color: var(--accent); outline: none; }

.card {
  background: var(--board);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.label {
  font-size: 0.8rem; font-weight: var(--w-bold); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.8rem; font-weight: var(--w-bold); letter-spacing: 0.04em; text-transform: uppercase;
  border: 1.5px solid currentColor; border-radius: 999px; padding: 1px 9px;
  color: var(--muted); white-space: nowrap;
}
.brand { height: 40px; width: auto; aspect-ratio: 1236 / 804; border-radius: 9px; display: block; flex: none; }

/* The factory. Method colours are the validated categorical set; every use also carries a label
   or a letter, so colour is never the only cue. */
:root {
  --cookie: #d9a764; --cookie-edge: #b27c3c; --chip: #4b2c18; --burnt: #2d2522; --burnt-edge: #120e0c;
  --lid: #dfe5ee; --lid-edge: #b8c3d4; --lid-ink: #34435f; --tray: #eef1f6;
  --m-random: #2a78d6; --m-systematic: #eb6834; --m-stratified: #1baf7a; --m-cluster: #eda100; --m-convenience: #6250d6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --burnt: #0d0a09; --burnt-edge: #6d625c; --lid: #254238; --lid-edge: #3d6053; --lid-ink: #d7e3dc; --tray: #1d3a32;
    --m-random: #3987e5; --m-systematic: #d95926; --m-stratified: #199e70; --m-cluster: #c98500; --m-convenience: #9085e9;
  }
}
:root[data-theme="dark"] {
  --burnt: #0d0a09; --burnt-edge: #6d625c; --lid: #254238; --lid-edge: #3d6053; --lid-ink: #d7e3dc; --tray: #1d3a32;
  --m-random: #3987e5; --m-systematic: #d95926; --m-stratified: #199e70; --m-cluster: #c98500; --m-convenience: #9085e9;
}
.m-random { --m: var(--m-random); } .m-systematic { --m: var(--m-systematic); } .m-stratified { --m: var(--m-stratified); }
.m-cluster { --m: var(--m-cluster); } .m-convenience { --m: var(--m-convenience); }
.mchip { display: inline-grid; place-items: center; width: 1.55em; height: 1.55em; border-radius: 6px; background: var(--m); color: #fff; font-weight: 700; font-size: .85em; text-shadow: 0 1px 1px rgba(0,0,0,.45); flex: none; }
.error { color: var(--answer); font-weight: var(--w-semi); }
.okText { color: var(--good); font-weight: var(--w-semi); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
th { font-size: .8rem; color: var(--muted); font-weight: var(--w-semi); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; font-weight: var(--w-semi); }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--hover); }
.choice input { margin: 3px 0 0; accent-color: var(--accent); flex: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
