/* The server pages in the new shell (V-12, docs/plans/screens-overhaul.md 7.9): Account,
   two-step, Getting started, Report card, People, Usage, People & feedback, System check, push
   keys, and the pages with no navigation (sign-in, sign-in code, closed, the 21+ step).
   Loaded only by page.html and gate.html, after tokens/shell/components/screens.
   Part 1 is the page styles carried over from the first look (removed in V-15), so every page
   keeps its layout and behavior; part 2 fits them to the shell and its tokens. */
:root { --warn: var(--close); }

/* ---- carried over: inputs, links, brand, banner, empty, checks ---- */
.icon-btn {
  width: 44px; height: 44px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface);
  color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.link, .link-btn { background: none; border: 0; color: var(--text-2); text-decoration: underline; cursor: pointer; padding: 10px 6px; min-height: 44px; }
select, input[type=number], textarea {
  background: var(--surface-3); border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--text);
  min-height: 44px; padding: 8px 12px; width: 100%;
}
select { width: auto; }
textarea { min-height: 120px; font-family: ui-monospace, Menlo, monospace; font-size: var(--fs-sm); line-height: 1.5; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { color: var(--accent); }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: .06em; line-height: 1; }
.wordmark b { color: var(--accent); font-weight: 800; }
.brand-lg .wordmark { font-size: 34px; }
/* ---------- banner ---------- */
.banner { max-width: 1480px; margin: 12px auto 0; padding: 0 16px; }
.banner > div { padding: 10px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line-2); font-size: var(--fs-sm); color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.banner.warn > div { border-color: #5A4614; background: #17130A; color: #F3E7C9; }
.banner.err > div { border-color: #5A2328; background: #1A0C0E; color: #FFD7D7; }
.banner p { margin: 0; }
.empty { padding: 28px 20px; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--muted); text-align: center; }
.g-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; }
.g-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.warn-line { font-size: var(--fs-xs); color: var(--warn); }
.sheet-link { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; min-height: 56px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: var(--fs); text-decoration: none; text-align: left; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 38px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface-3); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.status { min-height: 1.2em; margin: 0; font-size: var(--fs-sm); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- sign-in and system check ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.login-card { width: min(380px, 100%); padding: 28px 24px; display: flex; flex-direction: column; gap: 12px; }
.login-card input { min-height: 48px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text); }
.login-card .brand { margin-bottom: 8px; }
.health-card { width: min(540px, 100%); padding: 24px; display: flex; flex-direction: column; gap: 6px; }
.health-card .wordmark { font-size: 36px; margin: 4px 0 6px; }
.health-h { font-family: var(--display); font-size: var(--fs-lg); margin: 14px 0 0; letter-spacing: .03em; }
.health-card p { margin: 0; }
.health-keys { list-style: none; padding: 0; margin: 4px 0 14px; display: grid; gap: 4px; }

/* ---------- report card (/report) ---------- */
.report { max-width: 1240px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.rep-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; }
.rep-sub { max-width: 620px; }
.rep-banner { margin: 0; padding: 0; max-width: none; }
.h3 { font-family: var(--display); font-weight: 700; font-size: var(--fs-lg); letter-spacing: .03em; margin: 8px 0 0; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tile { padding: 16px 18px; border-radius: var(--r); background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.tile-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tile-num { font-family: var(--display); font-weight: 800; font-size: 44px; line-height: 1; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.rep-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; box-shadow: none; }
.rep-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.progress { height: 10px; border-radius: var(--r-pill); background: var(--surface-3); border: 1px solid var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); }
.tests { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; }
.test { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; padding: 10px 12px; border-radius: var(--r); background: var(--surface-3); border: 1px solid var(--line); }
.test .muted { grid-column: 2; }
.test-chip { grid-row: span 2; min-width: 116px; padding: 6px 10px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 700; text-align: center; border: 1px solid var(--line-2); color: var(--text-2); }
.test.pass .test-chip { color: var(--good); border-color: rgba(123, 224, 168, .45); }
.test.fail .test-chip { color: var(--bad); border-color: rgba(255, 140, 140, .45); }
.test.unsure .test-chip { color: var(--warn); border-color: rgba(255, 181, 71, .45); }
.table-wrap { position: relative; overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.rep-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.rep-table th, .rep-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rep-table th:first-child { text-align: left; }
.rep-table thead th { font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rep-table tbody th { font-weight: 600; }
.rep-table tr.total th, .rep-table tr.total td { border-top: 1px solid var(--line-2); }
.rep-table .muted { font-size: var(--fs-xs); }
.rep-table.flex td { min-width: 44px; }
.bar-cell { width: 34%; min-width: 120px; }
.rbar { position: relative; display: block; height: 14px; border-radius: var(--r-pill); background: var(--surface-3); border: 1px solid var(--line); }
.rbar-band { position: absolute; top: 2px; bottom: 2px; border-radius: var(--r-pill); background: var(--accent-soft); border: 1px solid rgba(198, 244, 50, .35); }
.rbar-dot { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.rbar-be { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text-2); }
.chart { margin: 0; }
.chart svg { width: 100%; max-width: 520px; height: auto; display: block; margin: 0 auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 600 var(--fs-xs) var(--body); }
.chart .axis.faint { fill: var(--muted); font-weight: 500; }
.chart .hit { fill: transparent; }
.chart .mark:hover .hit { fill: rgba(255, 255, 255, .03); }
.chart .said { stroke: var(--text); stroke-width: 2; stroke-dasharray: 5 4; }
.chart .range { fill: var(--accent-soft); stroke: rgba(198, 244, 50, .55); stroke-width: 1; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--fs-sm); color: var(--text-2); padding-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.lg-said { width: 22px; height: 0; border-top: 2px dashed var(--text); }
.split { border-top: 1px solid var(--line); }
.split summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--text-2); }
.split[open] summary { color: var(--text); }
/* SP-4 (R1): the two short answers first; each section's takeaway on top, its tables folded */
.rep-answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.rep-answer { padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.rep-answer .h3 { margin: 0 0 6px; }
.rep-answer .h3::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px;
  border-radius: 50%; vertical-align: 1px; background: var(--flip); }
.rep-answer.tone-good .h3::before { background: var(--good); }
.rep-answer.tone-off .h3::before { background: var(--bad); }
.rep-answer p { margin: 0; color: var(--text); font-size: var(--fs-input); line-height: 1.45; }
.rep-take { margin: 0; color: var(--text); font-weight: 600; line-height: 1.45; }
.rep-fold > summary { list-style: none; }
.rep-fold > summary::-webkit-details-marker { display: none; }
.rep-fold > summary::after { content: "Show"; margin-left: auto; padding-left: 12px; font-size: var(--fs-sm); font-weight: 600; color: var(--accent); }
.rep-fold[open] > summary::after { content: "Hide"; }
.rep-fold[open] { display: flex; flex-direction: column; gap: 10px; padding-bottom: 4px; }
/* EN-5: the latest recommended entries, pick by pick */
.rec-night { padding: 10px 0; border-top: 1px solid var(--line); }
.rec-night .h4 { font-family: var(--display); font-weight: 700; font-size: var(--fs-lg); letter-spacing: .03em; margin: 0 0 4px; }
.rec-night p { margin: 6px 0 4px; }
.rec-picks { list-style: none; margin: 0 0 6px; padding: 0 0 0 4px; display: grid; gap: 2px; }
.rep-foot { text-align: center; padding-top: 8px; }
a.btn { text-decoration: none; }
@media (max-width: 640px) {
  .rep-table th, .rep-table td { padding: 8px 6px; }
  .rep-table td .nowrap { display: block; }
  .rep-table tbody th { white-space: normal; min-width: 76px; }
  .rep-table thead th { font-size: var(--fs-2xs); letter-spacing: .06em; white-space: normal; vertical-align: bottom; }
  .bar-cell { min-width: 72px; width: 22%; }
  .tile-num { font-size: 38px; }
  .test-chip { min-width: 0; }
}
@media (min-width: 1024px) {
  .report { padding: 24px 24px 48px; gap: 20px; }
  .rep-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
}

/* ---------- Own logins (P2-1): account page, first sign-in ---------- */
.ok-line { color: var(--good); margin: 0; font-size: var(--fs-sm); }
.rep-card .ok { color: var(--good); }
.welcome-card p { margin: 0; line-height: 1.5; }
.age-check { display: flex; align-items: center; gap: 10px; font-weight: 600; min-height: 44px; }
.age-check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }
.account-page { width: min(560px, 100%); margin: 24px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 16px; }
.account-page .card { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.account-page .h2 { margin: 0; overflow-wrap: anywhere; }
.account-page .stack { display: flex; flex-direction: column; gap: 8px; }
.account-page input { min-height: 48px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text); }
.account-page form .btn { align-self: flex-start; }
.credits-today { margin: 0; font-size: var(--fs); color: var(--text-2); }
.credits-today b { font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: .02em; color: var(--text); font-variant-numeric: tabular-nums; margin-right: 4px; }
/* Usage page (owner only, P2-2): reuses the report card's tiles, cards and tables. */
.use-who { display: block; font-size: var(--fs-xs); color: var(--muted); white-space: normal; text-align: left; font-weight: 400; }
.use-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: var(--r-pill); border: 1px solid var(--line-2); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.use-tag.off { color: var(--bad); border-color: rgba(255, 140, 140, .45); }
.use-bar { display: block; height: 10px; border-radius: var(--r-pill); background: var(--surface-3); border: 1px solid var(--line); overflow: hidden; min-width: 80px; }
.use-bar span { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); }
.rep-table tr.quiet td, .rep-table tr.quiet th { color: var(--muted); }
.rep-table td.left, .rep-table th.left { text-align: left; }
.progress.warn span { background: var(--warn); }
.progress.over span { background: var(--bad); }
@media (max-width: 639px) {
  .usage .bar-cell { display: none; }
  .usage .rep-table th, .usage .rep-table td { padding: 8px 6px; }
  .usage .rep-table thead th { letter-spacing: .04em; }
}

/* "I entered this" sheet and My record (P2-5). Results carry words, not color alone. */
.radio-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; }
.radio-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-chip:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
#enter-sheet .fields { grid-template-columns: 1fr 140px; }
#enter-sheet .fields input { min-height: 44px; }
.btn.ghost { background: transparent; color: var(--muted); }
.tile-of { font-size: .55em; color: var(--muted); margin-left: 2px; }
.tile-num.pos { color: var(--good); }
.tile-num.neg { color: var(--bad); }
.rec-list { display: flex; flex-direction: column; gap: 12px; }
.rec-list > .h2 .muted { font-family: var(--body); font-size: var(--fs); font-weight: 600; }
.rec-slip { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r); background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); }
.rec-slip.rec-won { border-color: rgba(123, 224, 168, .45); }
.rec-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.rec-k { font-family: var(--display); font-weight: 800; font-size: var(--fs-lg); letter-spacing: .04em; }
.rec-when { font-size: var(--fs-sm); }
.rec-res { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.rec-money { font-variant-numeric: tabular-nums; }
.res { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--muted); }
.res-won { color: var(--good); border-color: rgba(123, 224, 168, .45); }
.res-lost { color: var(--bad); border-color: rgba(255, 140, 140, .4); }
.res-partial, .res-refund { color: var(--warn); border-color: rgba(255, 181, 71, .4); }
.rec-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.rec-game { border-radius: var(--r); background: var(--surface-3); border: 1px solid var(--line); overflow: hidden; }
.rec-game-h { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--line); font-family: var(--display); font-weight: 800; font-size: var(--fs); letter-spacing: .05em; }
.rec-game-h .muted { font-family: var(--body); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0; }
.rec-leg { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.rec-leg:last-child { border-bottom: 0; }
.rec-who { font-weight: 600; min-width: 0; }
.rec-who .team { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
.oc { flex: none; min-width: 64px; text-align: center; padding: 3px 8px; border-radius: var(--r-sm); font-size: var(--fs-xs); font-weight: 700; border: 1px solid var(--line-2); color: var(--muted); }
.oc-hit { color: var(--good); background: rgba(123, 224, 168, .1); border-color: rgba(123, 224, 168, .4); }
.oc-hit::before { content: "✓ "; }
.oc-miss { color: var(--bad); background: rgba(255, 140, 140, .08); border-color: rgba(255, 140, 140, .35); }
.oc-miss::before { content: "✕ "; }
.oc-push, .oc-void { color: var(--warn); border-style: dashed; }
.rec-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.rec-actions [data-delete] { margin-left: auto; }
.paid-form { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.paid-form label { width: 100%; font-size: var(--fs-xs); color: var(--muted); }
.money-in { display: inline-flex; align-items: center; gap: 4px; }
.money-in input, .enter-form input[type=number] { width: 120px; min-height: var(--tap); padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text); }
.enter-later summary { list-style: none; display: inline-flex; align-items: center; }
.enter-later summary::-webkit-details-marker { display: none; }
.enter-form { display: grid; grid-template-columns: auto 120px; align-items: center; gap: 8px 12px; margin-top: 10px; }
.enter-form .seg-radio { grid-column: 1 / -1; display: flex; gap: 12px; border: 0; padding: 0; margin: 0; }
.enter-form .seg-radio label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.enter-form .btn { grid-column: 1 / -1; justify-self: start; }
.rec-status:empty { display: none; }
.fix-paid summary { list-style: none; min-height: var(--tap); padding: 8px 0; font-size: var(--fs-sm); }
.fix-paid summary::-webkit-details-marker { display: none; }
@media (max-width: 639px) {
  .record .hide-sm { display: none; }
  .rec-res { text-align: left; align-items: flex-start; }
  .rec-games { grid-template-columns: minmax(0, 1fr); }
}
/* Phone alerts (Account page), owner key setup, the slip an alert opened (P2-6) */
.alert-state { margin: 0; font-weight: 600; }
.alert-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.alert-actions .btn[hidden] { display: none; }
.quiet-form, .kinds-form { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.quiet-form .h3, .kinds-form .h3 { margin: 0; }
.kinds-form .check { flex-wrap: wrap; column-gap: 10px; row-gap: 0; }
.kinds-form .check .muted { flex-basis: 100%; padding-left: 30px; font-size: .875rem; }
.account-page .check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; }
.account-page .check input { min-height: 0; width: 20px; height: 20px; padding: 0; accent-color: var(--accent); }
.quiet-hours { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.quiet-hours select { min-height: 44px; padding: 0 10px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text); font: inherit; }
.quiet-hours select:disabled { opacity: .5; }
.quiet-status:empty { display: none; }
.steps { margin: 4px 0 8px; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.health-card input.mono { min-height: 48px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: var(--fs-sm); width: 100%; }
.rec-leg.rec-flash { border-radius: var(--r-sm); outline: 2px solid var(--warn); outline-offset: 2px; background: color-mix(in srgb, var(--warn) 12%, transparent); }
.rec-slip.rec-target { outline: 1px solid var(--line-2); }
.alerts-hint { margin: 0; }
/* Beta readiness (P2-7): getting-started guide, the check-in, the owner's Beta page */
.radio-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
textarea.plain { font-family: var(--body); font-size: var(--fs); min-height: 90px; }
.checkin-card > div { border-color: rgba(198, 244, 50, .4); }
.checkin-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.guide .card p { margin: 0; line-height: 1.5; }
.guide .h1 { margin: 4px 0; }
.guide .h3 { margin: 4px 0 0; }
.g-num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-right: 10px; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font-size: var(--fs-lg); vertical-align: 2px; }
.guide-care { border-color: var(--line-2); }
.guide-care .btn { align-self: flex-start; }
.ck-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ck-list li { padding: 10px 12px; border-radius: var(--r); background: var(--surface-3); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.ck-list q { color: var(--text-2); overflow-wrap: anywhere; }
.ck-list .ck-broken { color: var(--warn); }
@media (max-width: 639px) {
  .beta .bar-cell, .beta .hide-sm { display: none; }
  .beta .rep-table th, .beta .rep-table td { padding: 8px 6px; }
}

/* Two-step sign-in (S-3) */
.code-input { font-family: var(--display); font-size: 26px; letter-spacing: .3em; text-align: center; max-width: 220px; }
.ts-state { margin: 6px 0; font-size: var(--fs); }
.ts-state.ts-on b { color: var(--good); }
.ts-steps li { line-height: 1.5; }
.ts-qr { display: block; margin: 10px 0; width: 200px; height: 200px; max-width: 100%; padding: 10px; border-radius: var(--r); background: #fff; }
.ts-secret { display: block; margin-top: 6px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-sm); letter-spacing: .08em; word-break: break-all; user-select: all; }
.ts-off { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ts-restart { margin-top: 4px; }
.login-stack { display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(380px, 100%); }
.login-stack .login-card { width: 100%; }

/* People page (S-4) */
.people-page .pp-list { display: flex; flex-direction: column; gap: 12px; }
.pp-person { display: flex; flex-direction: column; gap: 10px; }
.pp-person.pp-off { opacity: .75; }
.pp-email { margin: 0; word-break: break-all; }
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pp-chips .chip { min-height: 26px; padding: 0 10px; font-size: var(--fs-xs); cursor: default; color: var(--text-2); display: inline-flex; align-items: center; }
.pp-chips .chip.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.pp-chips .chip.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.pp-chips .chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.pp-facts { margin: 0; }
.pp-actions { display: flex; flex-direction: column; gap: 10px; }
.pp-cap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pp-cap label { font-size: var(--fs-sm); color: var(--muted); }
.pp-cap input { width: 110px; min-height: var(--tap); padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text); }
.pp-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.pp-add input { min-height: 44px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text); }
.pp-password { font-size: var(--fs-h3); text-align: center; }
.pp-log { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); }
.btn[disabled]:not(.busy) { cursor: not-allowed; }

/* Account → Your data (S-6) */
.danger-zone { margin-top: 12px; border-top: 1px solid var(--line, rgba(255, 255, 255, .08)); padding-top: 4px; }
.danger-zone summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--bad); }
.danger-zone[open] summary { margin-bottom: 4px; }
.danger-zone form { margin-top: 12px; }


/* ======================================================================================
   Part 2: the new shell around them
   ====================================================================================== */

/* The screen keeps the shell's spacing (bottom bar, rail); the first look's own page width and
   margins move to their children. */
body.nx-pages main.nx-screen { width: auto; max-width: none; margin: 0; min-height: 0;
  padding: 10px var(--pad) calc(var(--nav-h) + env(safe-area-inset-bottom) + 28px); }
body.nx-pages main.nx-screen > * { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }
body.nx-pages main.nx-screen.report > * { max-width: 1240px; }
body.nx-pages main.nx-screen.account-page,
body.nx-pages main.nx-screen.report { display: flex; flex-direction: column; gap: var(--gap); }
@media (min-width: 1024px) {
  body.nx-pages main.nx-screen { margin-left: var(--rail-w); padding: 18px 32px 56px; }
}
@media (min-width: 1280px) {
  /* No slip panel beside these pages: they use the width. */
  body.nx-pages .nx-top { padding-right: var(--pad); }
}
@media (min-width: 1600px) {
  body.nx-pages main.nx-screen { padding-left: 48px; padding-right: 48px; }
}

/* Back to where the page belongs (Me, or Account for two-step). */
.nx-crumb { display: flex; margin-bottom: -4px; }
.nx-crumb a { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding-right: 10px;
  color: var(--muted); font: 600 var(--fs-sm)/1 var(--body); letter-spacing: .02em; text-decoration: none; }
.nx-crumb a:hover { color: var(--text); }
.nx-crumb a span { font-size: var(--fs-h3); line-height: 1; margin-top: -2px; }

/* Cards and type in the new look. */
.nx-page .card, .nx-gate .card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.nx-page .rep-card { box-shadow: none; }
.nx-page.account-page .card { padding: 20px 20px 22px; gap: 12px; }
.nx-page .h1 { font-size: var(--fs-h1); }
.nx-page .h2 { font-size: var(--fs-h2); letter-spacing: .02em; }
.nx-page .h3 { font-size: var(--fs-h3); }
.nx-page .muted, .nx-gate .muted { color: var(--muted); }
.nx-page .eyebrow, .nx-gate .eyebrow { font: 700 var(--fs-xs)/1.2 var(--body); letter-spacing: .14em; }
.nx-page .warn-line { font-size: var(--fs-sm); color: var(--close); margin: 0; }
.nx-page .tile { border-radius: var(--r); }
.nx-page .tile-num { font-size: var(--fs-score); }
/* Links inside a card are rows with a divider and a chevron, like Me's (POL-1 pass 7): no box in a box. */
.nx-page .sheet-link { position: relative; min-height: 52px; padding: 10px 30px 10px 2px; border: 0; border-top: 1px solid var(--line);
  border-radius: 0; background: none; transition: color var(--t-fast) var(--ease); }
.nx-page .card > .h2 + .sheet-link, .nx-page .card > .h3 + .sheet-link, .nx-page .card > .sheet-link:first-child { border-top: 0; }
.nx-page .sheet-link::after { content: "›"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: var(--fs-xl); line-height: 1; color: var(--muted); }
.nx-page .sheet-link:hover { color: var(--accent); }
.nx-page .sheet-link:active { color: var(--text); }
.nx-page .sheet-link .muted { font-weight: 500; }
.nx-page input:not([type=checkbox]):not([type=radio]), .nx-gate input:not([type=checkbox]):not([type=radio]) {
  font-size: var(--fs-input);  /* no zoom on focus on iPhones */
}
.nx-page input:focus-visible, .nx-page select:focus-visible, .nx-page textarea:focus-visible,
.nx-gate input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.nx-page .rep-head .h1 { margin-top: 2px; }
.nx-page .banner { padding: 0; margin: 0; }
.nx-page .banner.warn > div { border-color: rgba(255, 193, 77, .35); background: var(--close-soft); color: var(--text); }
.nx-page .btn.sm { min-height: var(--tap); }
.nx-page .progress span { box-shadow: 0 0 10px var(--accent-glow); }
.nx-page .progress.warn span, .nx-page .progress.over span { box-shadow: none; }
.nx-page.login { min-height: 0; display: block; padding-top: 10px; }
.nx-page.login > .card { margin: 0 auto; }

/* ======================================================================================
   The gate: sign-in, sign-in code, closed, the 21+ step. A stadium at night in CSS only
   (no 3D script before sign-in): floodlight banks, their beams, the bowl, the lit field.
   ====================================================================================== */
body.nx-gate { background: #04060A; min-height: 100vh; min-height: 100dvh; }
.gate-night { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(140% 70% at 50% 108%, #0E2A1C 0%, #071019 46%, #04060A 78%); }
.gate-night span { position: absolute; display: block; }
/* Sky: a faint haze where the lights hit the air, a few stars high up. */
.gate-sky { inset: 0;
  background:
    radial-gradient(1.2px 1.2px at 12% 14%, rgba(255, 255, 255, .55), transparent 60%),
    radial-gradient(1px 1px at 28% 8%, rgba(255, 255, 255, .4), transparent 60%),
    radial-gradient(1.4px 1.4px at 46% 18%, rgba(255, 255, 255, .45), transparent 60%),
    radial-gradient(1px 1px at 64% 6%, rgba(255, 255, 255, .5), transparent 60%),
    radial-gradient(1.2px 1.2px at 81% 15%, rgba(255, 255, 255, .4), transparent 60%),
    radial-gradient(1px 1px at 93% 9%, rgba(255, 255, 255, .35), transparent 60%),
    radial-gradient(90% 46% at 50% 62%, rgba(150, 190, 255, .10), transparent 70%); }
/* Floodlight banks: a lit panel on a mast, a bloom around it, a soft beam down to the field. */
.gate-tower { top: 9%; width: 86px; height: 30px; border-radius: var(--r-xs);
  background:
    radial-gradient(circle, #FFFFFF 0 2.2px, rgba(255, 255, 255, 0) 3px) 1px 1px / 12px 10px,
    linear-gradient(180deg, #E9F1FF, #B8CCEA);
  box-shadow: 0 0 16px 4px rgba(235, 243, 255, .8), 0 0 70px 26px rgba(170, 200, 255, .30), 0 0 180px 80px rgba(120, 160, 230, .12); }
.gate-tower::before { content: ""; position: absolute; left: 50%; top: 100%; width: 4px; height: 34vh; margin-left: -2px;
  background: linear-gradient(180deg, #1C2534, rgba(28, 37, 52, 0)); }
.gate-tower::after { content: ""; position: absolute; left: 50%; top: 60%; width: 70vw; height: 86vh; margin-left: -35vw;
  background: linear-gradient(180deg, rgba(215, 228, 255, .2), rgba(215, 228, 255, .07) 50%, rgba(215, 228, 255, 0) 92%);
  -webkit-mask-image: conic-gradient(from 162deg at 50% 0%, transparent 0deg, #000 12deg, #000 24deg, transparent 36deg);
  mask-image: conic-gradient(from 162deg at 50% 0%, transparent 0deg, #000 12deg, #000 24deg, transparent 36deg);
  transform-origin: 50% 0; }
.gate-tower-l { left: 7%; transform: rotate(-6deg); }
.gate-tower-l::after { transform: rotate(-30deg); }
.gate-tower-r { right: 7%; transform: rotate(6deg); }
.gate-tower-r::after { transform: rotate(30deg); }
/* The bowl: dark stands, a scatter of phone lights fading toward the top. */
.gate-bowl { left: -12%; right: -12%; bottom: 17%; height: 36%; border-radius: 50% 50% 0 0 / 80% 80% 0 0;
  background:
    radial-gradient(circle, rgba(255, 236, 190, .42) 0 1px, transparent 1.6px) 0 0 / 29px 19px,
    radial-gradient(circle, rgba(200, 220, 255, .3) 0 1px, transparent 1.6px) 13px 7px / 37px 23px,
    radial-gradient(circle, rgba(255, 255, 255, .22) 0 .8px, transparent 1.4px) 5px 12px / 17px 13px,
    linear-gradient(180deg, #0C1320, #070B12 80%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .55), #000 40%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .55), #000 40%);
  box-shadow: inset 0 18px 34px -12px rgba(170, 200, 255, .25); }
/* The field: lit grass with mowing bands and a sideline, brightest where the beams land. */
.gate-field { left: -25%; right: -25%; bottom: -4%; height: 24%; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background:
    radial-gradient(60% 90% at 50% 0%, rgba(190, 255, 200, .22), rgba(190, 255, 200, 0) 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .5) 0 2px, transparent 2px),
    repeating-linear-gradient(180deg, #1F6E3C 0 16px, #1A6135 16px 32px);
  box-shadow: 0 -24px 80px 6px rgba(90, 210, 130, .25); }
.gate-night::after { content: ""; position: absolute; inset: 0;  /* vignette, keeps the card's edges calm */
  background: radial-gradient(70% 60% at 50% 45%, rgba(4, 6, 10, 0), rgba(4, 6, 10, .7)); }

.nx-gate-main { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); }
.nx-gate .login-card, .nx-gate .health-card {
  background: rgba(10, 14, 21, .82); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  border-color: var(--line-2); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .05) inset; }
.nx-gate .login-card { width: min(400px, 100%); padding: 30px 26px 26px; gap: 12px; }
.nx-gate .login-card label { font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); margin-top: 4px; }
.nx-gate .login-card input:not([type=checkbox]) { min-height: 50px; background: rgba(5, 7, 11, .7); }
.nx-gate .login-card .btn.primary { min-height: 50px; margin-top: 6px; font-size: var(--fs); }
.nx-gate .brand-lg .wordmark { font-size: 36px; }
.nx-gate .brand-lg .brand-mark { filter: drop-shadow(0 0 10px var(--accent-glow)); }
.nx-gate .login-stack { width: min(400px, 100%); }
.nx-gate .link-btn { color: var(--muted); }
.nx-gate .welcome-card p { color: var(--text-2); }
.nx-gate .welcome-card p.muted { color: var(--muted); }
@media (max-width: 420px) {
  .gate-tower { width: 58px; height: 22px; }
  .gate-tower-l { left: 3%; }
  .gate-tower-r { right: 3%; }
}
@media (min-width: 1024px) {
  .gate-tower { top: 11%; width: 120px; height: 42px; }
  .gate-tower-l { left: 12%; }
  .gate-tower-r { right: 12%; }
}

/* No sport filter on these pages: the Me button keeps its place at the right. */
body.nx-pages .nx-me-btn { margin-left: auto; }
@media (max-width: 599px) {
  body.nx-pages .nx-top { justify-content: space-between; }
}
@media (max-width: 420px) {
  .nx-page p .nowrap { white-space: normal; }
}

/* Getting started in the new look: the words, as every screen says them. */
.g-words { margin: 2px 0; display: grid; gap: 2px; border-radius: var(--r); background: var(--surface-3);
  border: 1px solid var(--line); padding: 4px 14px; }
.g-words > div { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 8px 0; }
.g-words > div + div { border-top: 1px solid var(--line); }
.g-words dt { font: 800 var(--fs)/1.2 var(--display); letter-spacing: .07em; text-transform: uppercase; }
.g-words dd { margin: 0; color: var(--text-2); font-size: var(--fs-sm); }
.gw-edge { color: var(--accent); }
.gw-close { color: var(--close); }
.gw-flip { color: var(--flip); }
.guide .card a:not(.btn) { color: var(--text); }

/* Plain-print paragraphs carry no margins of their own (cards space them). */
.nx-page p.muted, .nx-gate p.muted { margin: 0; }
.nx-gate .code-input { max-width: none; width: 100%; }

/* ---------- terms, privacy, responsible play (L-4): readable without signing in ---------- */
.nx-gate-main.legal { place-items: start center; }
.nx-gate .legal-card { width: min(720px, 100%); padding: 26px 24px 22px; display: flex; flex-direction: column; gap: 10px;
  background: rgba(10, 14, 21, .9); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  border-color: var(--line-2); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); line-height: 1.55; }
.legal-card .brand .wordmark { font-size: 22px; }
.legal-card .h3 { margin-top: 14px; }
.legal-card p, .legal-card ul { margin: 0; color: var(--text-2); }
.legal-card ul { padding-left: 20px; display: grid; gap: 6px; }
.legal-card a:not(.brand) { color: var(--text); }
.legal-draft { padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid #5A4614; background: #17130A; color: #F3E7C9 !important;
  font-size: var(--fs-sm); }
.legal-nav { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.legal-nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 2px; }
.legal-nav a[aria-current] { color: var(--muted) !important; text-decoration: none; }
.legal-back { align-self: flex-start; padding-left: 0; }
/* the public record page (L-3): the report card's tables on the legal card */
.record-card .ok { color: var(--good); }
