/* NG Playbook stylesheet.
 *
 * House chrome is NationsGuard: green #169446 / #0F6E34 on a WHITE ground
 * (the stacked shield only reads on white), Montserrat, hairlines instead of
 * shadows, sentence-case headings. Each client page sets --accent /
 * --accent-text / --tint / --on-accent from its own design system, so the
 * client's color carries the page and the chrome stays NationsGuard.
 *
 * Spacing: containers own it. Every stack is a grid with a gap from the
 * six-step scale below; no section carries a vertical margin. tools/gap_audit.js
 * reads the scale from :root and flags any gap that is not on it. */

@font-face { font-family: 'Montserrat'; font-weight: 400; font-display: swap; src: url('/static/fonts/Montserrat-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap; src: url('/static/fonts/Montserrat-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap; src: url('/static/fonts/Montserrat-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 800; font-display: swap; src: url('/static/fonts/Montserrat-ExtraBold.woff2') format('woff2'); }

:root {
  /* the six steps; the gap audit reads exactly these */
  --gap-page: 28px;
  --gap-block: 22px;
  --gap-row: 18px;
  --gap-bind: 12px;
  --gap-label: 6px;
  --gap-tight: 4px;

  --green: #169446;
  --green-dark: #0F6E34;
  --green-soft: #E4F3EA;
  --ink: #221E1F;
  --mute: #6C7373;
  --line: #E3E5E4;
  --chip: #EEF0EF;
  --soft: #F7F8F7;
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --ok: #0F6E34;
  --ok-bg: #E4F3EA;
  --bad: #B3261E;
  --bad-bg: #FBEAE8;
  --warn: #9A6700;
  --warn-bg: #FFF4D6;

  --accent: var(--green);
  --accent-text: var(--green-dark);
  --tint: var(--green-soft);
  --on-accent: #FFFFFF;

  --radius: 8px;
  --radius-s: 6px;
  --focus: 0 0 0 3px rgba(22, 148, 70, .30);
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
h1 { font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
h2 { font-size: 19px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
h3 { font-size: 17px; font-weight: 700; line-height: 1.3; }
a { color: var(--accent-text); }
img { max-width: 100%; }
.mute { color: var(--mute); }
.small { font-size: 13px; }
.lede { font-size: 17px; color: var(--mute); max-width: 64ch; }
.err { color: var(--bad); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ chrome */
body > header.top {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: var(--gap-row);
  padding: 10px 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.top .brand { grid-column: 1; display: inline-flex; align-items: center; gap: var(--gap-bind); text-decoration: none; color: var(--ink); }
.top .brand img { height: 52px; width: auto; display: block; }
.top .brand .site { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.top nav { grid-column: 2; display: flex; gap: var(--gap-tight); justify-content: center; overflow-x: auto; }
.top .pill { grid-column: 3; }
.top nav a {
  text-decoration: none; color: var(--mute); font-weight: 600; font-size: 14px;
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: var(--radius-s); white-space: nowrap;
}
.top nav a:hover { color: var(--ink); background: var(--soft); }
.top nav a.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--green); border-radius: 0; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px;
  border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap;
}
.pill:empty { display: none; }

main.page {
  overflow-wrap: anywhere;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--gap-page) 24px;
  display: grid;
  gap: var(--gap-page);
  align-content: start;
}
body > footer.foot {
  border-top: 1px solid var(--line); padding: var(--gap-block) 24px; color: var(--mute); font-size: 13px;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--gap-row);
}
.foot a { color: var(--accent-text); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }

/* ------------------------------------------------------------ blocks */
.hero { display: grid; gap: var(--gap-bind); justify-items: start; }
.hero.small h1 { font-size: 26px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: grid;
  gap: var(--gap-row);
  align-content: start;
  color: var(--ink);
  text-decoration: none;
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap-block); }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cards.align-start { align-items: start; }
.stack { display: grid; gap: var(--gap-block); align-content: start; }
.list { display: grid; gap: var(--gap-bind); }
.row { display: flex; flex-wrap: wrap; gap: var(--gap-bind); align-items: center; }
.group { display: grid; gap: var(--gap-row); }
.gh { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.tag {
  display: inline-flex; align-items: center; min-height: 20px;
  color: var(--accent-text); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  justify-self: start;
}
.checks, .plain { list-style: none; padding: 0; display: grid; gap: var(--gap-label); }
.checks li { padding-left: 26px; position: relative; }
.checks li::before { content: ''; position: absolute; left: 0; top: 6px; width: 14px; height: 14px; border-radius: 4px; background: var(--accent); }
.checks li::after { content: ''; position: absolute; left: 5px; top: 8px; width: 4px; height: 7px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.plain.rows { gap: 0; }
.plain.rows li { display: grid; gap: var(--gap-tight); padding: 12px 0; border-bottom: 1px solid var(--line); }
.plain.rows li:last-child { border-bottom: 0; padding-bottom: 0; }
.plain.rows li:first-child { padding-top: 0; }
.plain.rows a { font-weight: 700; text-decoration: none; }
.notice { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: var(--gap-label); font-size: 15px; }
.notice.ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.notice.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); font-weight: 600; }

/* client cards on the home page */
.card.client, .card.topic, .card.game {
  grid-template-rows: auto 1fr auto;
  border-top: 3px solid var(--accent);
  transition: border-color .12s ease;
}
.card.client:hover, .card.topic:hover, .card.game:hover, .linkrow:hover { border-color: var(--mute); border-top-color: var(--accent); }
.card.client .logo { height: 60px; display: flex; align-items: center; }
.card.client .logo img { max-height: 56px; width: auto; max-width: 100%; object-fit: contain; }
.wordmark { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; color: #fff; font-weight: 800; letter-spacing: .06em; border-radius: var(--radius-s); font-size: 18px; }
.ctext { display: grid; gap: var(--gap-label); }
.cfoot { display: flex; justify-content: space-between; align-items: center; gap: var(--gap-bind); flex-wrap: wrap; }
.prog { font-size: 13px; color: var(--mute); display: inline-flex; align-items: center; gap: var(--gap-label); }
.prog i { display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--line); position: relative; overflow: hidden; }
.prog i::after { content: ''; position: absolute; inset: 0; width: var(--pct, 0%); background: var(--accent); }
.card.game .best { color: var(--mute); font-size: 13px; }
.card.game .best:empty::before { content: 'Not played yet'; }
.card.strip { grid-template-columns: 1fr auto; align-items: center; }
.stext { display: grid; gap: var(--gap-bind); }
.dl { display: grid; gap: var(--gap-label); }
.dr { display: grid; grid-template-columns: 96px 1fr; gap: var(--gap-bind); align-items: baseline; }
.dk { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.dv { font-weight: 600; }

/* quiet link rows: the Ask and Play doors */
.links { display: grid; gap: var(--gap-bind); }
.linkrow {
  display: grid; grid-template-columns: 1fr auto; gap: var(--gap-row); align-items: center;
  padding: 16px 22px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink);
  transition: border-color .12s ease;
}
.linkrow .lt { display: grid; gap: var(--gap-tight); }
.linkrow .lt strong { font-size: 16px; }
.linkrow .lt .mute { font-size: 14px; }
.linkrow .go { color: var(--accent-text); font-weight: 700; font-size: 14px; }
.linkrow.topic { border-left: 3px solid var(--accent); }
.linkrow .lt .tag { min-height: 0; }

/* buttons + forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  border-radius: var(--radius-s); border: 1.5px solid var(--accent-text); background: var(--card); color: var(--accent-text);
  font: inherit; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; justify-self: start;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(.95); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--mute); }
.btn.red { border-color: var(--bad); color: var(--bad); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.done { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.btn.wide { justify-self: stretch; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); font-weight: 600; text-decoration: underline; cursor: pointer; min-height: 0; }
.form { display: grid; gap: var(--gap-row); }
.form label, .inline { display: grid; gap: var(--gap-label); font-weight: 600; font-size: 14px; }
.inline { grid-template-columns: auto 1fr; align-items: center; gap: var(--gap-bind); }
.inline.vis { grid-template-columns: 1fr 200px; }
input, select, textarea {
  font: inherit; font-size: 16px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: #fff; color: var(--ink); width: 100%; font-weight: 400;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .opt:focus, .btn:focus, .linkbtn:focus { outline: 0; box-shadow: var(--focus); }
fieldset.chips { border: 0; padding: 0; margin: 0; display: grid; gap: var(--gap-label); }
.chips legend { font-weight: 600; font-size: 14px; padding: 0; }
.chips .opts { display: flex; flex-wrap: wrap; gap: var(--gap-label); }
.chips label { position: relative; display: inline-flex; font-weight: 600; font-size: 14px; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.chips span { min-height: 44px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; display: inline-flex; align-items: center; background: #fff; }
.chips input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chips input:focus + span { box-shadow: var(--focus); }
label.check { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--gap-bind); font-weight: 500; font-size: 15px; }
label.check input { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--green); }

/* join */
.card.join h2 { font-size: 22px; }

/* ------------------------------------------------------------ sign-in */
.login-page main.page { max-width: 480px; }
.login { display: grid; gap: var(--gap-block); }
.login .lg { height: 120px; width: auto; justify-self: center; }
.lhead { display: grid; gap: var(--gap-label); justify-items: center; text-align: center; }
.lhead h1 { font-size: 28px; }
input.code { font-size: 28px; font-weight: 700; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.foot .fwho { font-weight: 600; }

/* ------------------------------------------------------------ client page */
.band {
  background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: var(--radius);
  padding: 22px; display: grid; grid-template-columns: 160px 1fr; gap: var(--gap-row); align-items: center;
}
.band .logo { display: flex; align-items: center; justify-content: center; min-height: 96px; }
.band .logo img { max-height: 96px; max-width: 150px; object-fit: contain; }
.btext { display: grid; gap: var(--gap-label); justify-items: start; }
.phones { font-size: 15px; }
.roles .rolegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--gap-bind); }
.role { display: grid; gap: var(--gap-tight); padding: 12px 14px; border-radius: var(--radius-s); border: 1px solid var(--line); border-left-width: 4px; background: var(--soft); }
.role .rk { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); font-weight: 700; }
.role .rv { font-weight: 700; font-size: 15px; line-height: 1.3; }
.role .rn { font-size: 13px; color: var(--mute); }
.role.us { border-left-color: var(--green); background: var(--green-soft); }
.role.client { border-left-color: var(--accent); background: var(--tint); }
.role.partner { border-left-color: #9AA0A0; }

nav.toc { position: sticky; top: 73px; z-index: 10; gap: var(--gap-bind); padding: 14px 22px; }
.progbar { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progbar i { display: block; height: 100%; width: var(--pct, 0%); background: var(--accent); transition: width .2s ease; }
.toclinks { display: flex; flex-wrap: wrap; gap: var(--gap-label); }
.toclinks a { text-decoration: none; font-size: 13px; font-weight: 600; color: var(--mute); border: 1px solid var(--line); border-radius: 999px; min-height: 32px; padding: 0 12px; display: inline-flex; align-items: center; }
.toclinks a.done { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.sec h2 { justify-self: start; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 6px; text-decoration-skip-ink: none; }
.secfoot { display: flex; align-items: center; gap: var(--gap-bind); flex-wrap: wrap; }

/* rendered markdown */
.prose { display: grid; gap: var(--gap-row); }
.prose > * { margin: 0; }
.prose h3 { font-size: 17px; }
.prose h4 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); }
.prose ul, .prose ol { display: grid; gap: var(--gap-label); padding-left: 1.25em; }
.prose li > ul, .prose li > ol { margin-top: var(--gap-label); }
.prose strong { font-weight: 700; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; background: var(--chip); padding: 1px 5px; border-radius: 4px; }
.prose blockquote { border-left: 4px solid var(--accent); padding-left: 14px; color: var(--mute); }
.tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
th { background: var(--soft); color: var(--ink); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
tr.total td { font-weight: 700; background: var(--soft); }
td.num, th.num { text-align: right; }

.unv { display: none; }
.show-unv li.unv { display: list-item; }
.show-unv p.unv, .show-unv td.unv { display: block; }
.show-unv .unv { background: var(--warn-bg); border-left: 3px solid var(--warn); padding-left: 8px; }
.card.presenter { border-color: var(--warn); }
.card.presenter h2 { color: var(--warn); }

/* ------------------------------------------------------------ ask + feed */
.feed { display: grid; gap: var(--gap-bind); }
.item { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: var(--gap-label); background: #fff; }
.item.mine { border-left: 4px solid var(--accent); }
.item .meta { display: flex; flex-wrap: wrap; gap: var(--gap-label); align-items: center; font-size: 13px; color: var(--mute); }
.item .body { font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.item .detail { font-size: 14px; color: var(--mute); white-space: pre-wrap; overflow-wrap: anywhere; }
.item .answer { background: var(--tint); border-radius: var(--radius-s); padding: 10px 12px; font-size: 14px; display: grid; gap: var(--gap-tight); overflow-wrap: anywhere; }
.item .answer strong { color: var(--accent-text); }
.item .foot { display: flex; justify-content: space-between; align-items: center; gap: var(--gap-bind); flex-wrap: wrap; }
.metoo { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: 14px; font-weight: 600; color: var(--mute); cursor: pointer; }
.metoo.on { border-color: var(--accent); color: var(--accent-text); background: var(--tint); }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--chip); color: var(--mute); }
.badge.kind { background: var(--tint); color: var(--accent-text); text-transform: capitalize; }
.badge.in-session { background: var(--warn-bg); color: var(--warn); }
.badge.answered { background: var(--ok-bg); color: var(--ok); }
.badge.parked { background: var(--chip); }
.badge.star { background: #FFF1C2; color: #7A5A00; }
.badge.blocked { background: var(--bad-bg); color: var(--bad); }
.badge.sent, .badge.ok { background: var(--ok-bg); color: var(--ok); }

/* pager bar (public/pager.js) */
.pager { display: flex; flex-wrap: wrap; gap: var(--gap-label); align-items: center; justify-content: space-between; font-size: 14px; color: var(--mute); }
.pager button, .pager select { min-height: 44px; font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; padding: 0 12px; cursor: pointer; width: auto; }
.pager button[disabled] { opacity: .45; cursor: default; }
.pager .pnums { display: flex; flex-wrap: wrap; gap: var(--gap-tight); }
.pager .pgap { padding: 0 4px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pager .pnums button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pager-wrap { display: grid; gap: var(--gap-bind); }

/* ------------------------------------------------------------ games */
.qbar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--gap-label); font-size: 14px; color: var(--mute); font-weight: 600; }
.q { font-size: 20px; font-weight: 700; line-height: 1.35; }
.opts { display: grid; gap: var(--gap-bind); }
.opt {
  min-height: 52px; text-align: left; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--radius); background: #fff;
  font: inherit; font-size: 16px; cursor: pointer; display: grid; grid-template-columns: 28px 1fr; gap: var(--gap-bind); align-items: center; color: var(--ink);
}
.opt b { width: 28px; height: 28px; border-radius: 50%; background: var(--tint); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.opt.right { border-color: var(--ok); background: var(--ok-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.dim { opacity: .55; }
.opt:disabled { cursor: default; }
.why { background: var(--tint); border-left: 4px solid var(--accent); padding: 12px 14px; border-radius: var(--radius-s); font-size: 15px; display: grid; gap: var(--gap-tight); }
.why.wrong { background: var(--bad-bg); border-left-color: var(--bad); }
.why.right { background: var(--ok-bg); border-left-color: var(--ok); }
.score { font-size: 44px; font-weight: 800; line-height: 1; color: var(--accent-text); }
.guardopts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--gap-bind); }
.guardopts .opt { grid-template-columns: 1fr; text-align: center; justify-items: center; border-left: 6px solid var(--c, var(--line)); font-weight: 700; min-height: 60px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--accent-text); }

/* live round */
.live .big { font-size: 22px; font-weight: 700; line-height: 1.3; }
.live .opts .opt { min-height: 60px; font-size: 17px; }
.live .count { font-size: 40px; font-weight: 800; color: var(--accent-text); line-height: 1; }
.lb { display: grid; gap: 0; }
.lb .lbrow { display: grid; grid-template-columns: 32px 1fr auto; gap: var(--gap-bind); align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lb .lbrow b { color: var(--accent-text); }
.bars { display: grid; gap: var(--gap-bind); }
.bar { display: grid; grid-template-columns: 28px 1fr auto; gap: var(--gap-bind); align-items: center; }
.bar i { display: block; height: 22px; border-radius: var(--radius-s); background: var(--line); position: relative; overflow: hidden; }
.bar i::after { content: ''; position: absolute; inset: 0; width: var(--pct, 0%); background: var(--accent); }
.bar.right i::after { background: var(--ok); }
.bar span.n { font-weight: 700; min-width: 3ch; text-align: right; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--radius); font-weight: 600; font-size: 15px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100vw - 32px); text-align: center; }

/* ------------------------------------------------------------ console + screen */
.console { display: grid; gap: var(--gap-block); }
.tabs { display: flex; flex-wrap: wrap; gap: var(--gap-label); }
.tabs button, .tabs a { min-height: 44px; padding: 0 16px; border-radius: var(--radius-s); border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 700; font-size: 14px; color: var(--mute); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.tabs button.on { background: var(--green); border-color: var(--green); color: #fff; }
.panel { display: none; }
.panel.on { display: grid; gap: var(--gap-block); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--gap-bind); }
.kv .k { display: grid; gap: var(--gap-tight); padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--soft); }
.kv .k span { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); font-weight: 700; }
.kv .k b { font-size: 22px; }
.qr { display: grid; grid-template-columns: auto 1fr; gap: var(--gap-row); align-items: center; }
.qr img { width: 180px; height: 180px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: var(--radius-s); }
.qr code { font-size: 15px; overflow-wrap: anywhere; }
.subrow { display: grid; gap: var(--gap-bind); padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.subrow.starred { border-color: #E0B500; }
.subrow .ctl { display: flex; flex-wrap: wrap; gap: var(--gap-label); align-items: center; }
.subrow .ctl select, .subrow .ctl button { width: auto; min-height: 44px; font-size: 14px; }
.subrow textarea { min-height: 64px; font-size: 15px; }
.bankq { display: grid; grid-template-columns: 1fr auto; gap: var(--gap-bind); align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.bankq.asked { opacity: .5; }
.bankq .qt { font-size: 15px; }
.bankq .qt small { display: block; color: var(--mute); font-size: 13px; }
.livectl { display: flex; flex-wrap: wrap; gap: var(--gap-label); }
.card.danger { border-color: var(--bad); }
.card.danger h2 { color: var(--bad); }
.acc { display: grid; grid-template-columns: 1fr auto; gap: var(--gap-bind); align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.acc .who { display: grid; gap: 0; }
.acc .who small { color: var(--mute); font-size: 13px; }
.acc button { min-height: 44px; }

.screen-page main.page { max-width: none; padding: 40px; }
.screen { display: grid; gap: var(--gap-block); min-height: calc(100vh - 160px); align-content: start; }
.scr-idle { display: grid; gap: var(--gap-block); justify-items: center; text-align: center; padding-top: 40px; }
.scr-idle img { height: 150px; width: auto; }
.scr-idle h1 { font-size: 44px; }
.scr-idle p { font-size: 26px; color: var(--mute); }
.scr-idle .qr { grid-template-columns: 1fr; justify-items: center; }
.scr-idle .qr img { width: 320px; height: 320px; }
.scr-idle code { font-size: 28px; font-weight: 700; color: var(--green-dark); }
.scr-q { display: grid; gap: var(--gap-block); }
.scr-q .qtext { font-size: 40px; font-weight: 800; line-height: 1.2; }
.scr-q .opts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-row); }
.scr-q .opt { font-size: 26px; min-height: 90px; cursor: default; }
.scr-q .qbar { font-size: 22px; color: var(--mute); font-weight: 700; display: flex; justify-content: space-between; }
.scr-q .count { font-size: 64px; }
.scr-q .why { font-size: 22px; }
.scr-q .bars { font-size: 22px; }
.scr-q .bar i { height: 40px; }
.scr-lb .lbrow { font-size: 26px; padding: 10px 0; }
.scr-lb .lbrow b { font-size: 22px; }
.scr-draw { display: grid; gap: var(--gap-block); justify-items: center; text-align: center; padding-top: 30px; }
.scr-draw .prize { font-size: 28px; color: var(--mute); }
.scr-draw .win { font-size: 56px; font-weight: 800; color: var(--green-dark); line-height: 1.1; }
.scr-draw .team { font-size: 26px; color: var(--mute); }

/* ------------------------------------------------------------ phones */
@media (max-width: 760px) {
  body > header.top { grid-template-columns: 1fr auto; row-gap: var(--gap-label); padding: 8px 12px; }
  .top .brand .site { display: none; }
  .top .brand img { height: 42px; }
  .top .brand { grid-row: 1; }
  .top .pill { grid-column: 2; grid-row: 1; justify-self: end; }
  .top nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .toclinks a { min-height: 44px; }
  main.page { padding: var(--gap-block) 12px; gap: var(--gap-block); }
  h1 { font-size: 24px; }
  .hero.small h1 { font-size: 22px; }
  .lede { font-size: 16px; }
  .card { padding: 16px; }
  .cards, .cards.two { grid-template-columns: 1fr; }
  .band { grid-template-columns: 1fr; }
  .band .logo { justify-content: flex-start; min-height: 0; }
  .band .logo img { max-height: 64px; }
  nav.toc { top: 108px; }
  .card.strip { grid-template-columns: 1fr; }
  .roles .rolegrid { grid-template-columns: 1fr 1fr; }
  .qr { grid-template-columns: 1fr; }
  .scr-q .opts { grid-template-columns: 1fr; }
  .screen-page main.page { padding: 16px; }
  .scr-q .qtext { font-size: 24px; }
  .scr-idle h1 { font-size: 26px; }
  .login .lg { height: 96px; }
  .inline.vis { grid-template-columns: 1fr; }
  .dr { grid-template-columns: 1fr; gap: var(--gap-tight); }
  .linkrow { grid-template-columns: 1fr; }
  .linkrow .go { display: none; }
  .foot { text-align: center; }

  /* wide tables become one card per row; the header lives in data-h */
  .tbl table, .tbl thead, .tbl tbody, .tbl tr, .tbl td { display: block; }
  .tbl thead { display: none; }
  .tbl tbody { display: grid; gap: var(--gap-bind); }
  .tbl tr { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: var(--gap-bind); }
  .tbl td { border: 0; padding: 0; }
  .tbl td::before { content: attr(data-h); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); font-weight: 700; }
  .tbl td[data-h='']::before { display: none; }
  .tbl tr.total { background: var(--soft); }
  td.num, th.num { text-align: left; }
}
@media (max-width: 400px) {
  .roles .rolegrid { grid-template-columns: 1fr; }
  .guardopts { grid-template-columns: 1fr 1fr; }
}
