/* Greenlight v3 — premium night/day. Night (dark green-black) is the
 * default; day is the clean v2 light look. One green accent for go/safe.
 * Big type, big cards, thumb-friendly. Phone-first. */
:root,
html[data-theme="night"] {
  --bg: #06110a;
  --surface: #0c1e13;
  --surface-2: #12291b;
  --border: #1e3d2b;
  --text: #e9f6ee;
  --muted: #8fb39e;
  --green: #22c55e;
  --green-bright: #4ade80;
  --green-dark: #4ade80;
  --green-soft: #0f2c1a;
  --on-green: #04150a;
  --amber: #fbbf24;
  --amber-soft: #2b2108;
  --on-amber: #231a04;
  --red: #f87171;
  --red-soft: #2b1214;
  --on-red: #ffffff;
  --glow: rgba(34, 197, 94, .45);
  --shadow: rgba(0, 0, 0, .5);
  --radius: 16px;
  color-scheme: dark;
}
html[data-theme="day"] {
  --bg: #f6f7f6;
  --surface: #ffffff;
  --surface-2: #eef2ee;
  --border: #dde5dd;
  --text: #15211a;
  --muted: #5b6b60;
  --green: #16a34a;
  --green-bright: #22c55e;
  --green-dark: #15803d;
  --green-soft: #e7f6ec;
  --on-green: #ffffff;
  --amber: #b45309;
  --amber-soft: #fdf3e3;
  --on-amber: #ffffff;
  --red: #dc2626;
  --red-soft: #fdecec;
  --on-red: #ffffff;
  --glow: rgba(22, 163, 74, .35);
  --shadow: rgba(21, 33, 26, .12);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px; line-height: 1.5;
}
a { color: var(--green-dark); }
h1, h2, h3, .tab, .btn, .chip, .wordmark {
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.35rem; margin: 0 0 .3rem; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Digital / scoreboard numerals. Falls back to any monospace if the
 * web font can't load (offline). */
.digital {
  font-family: "Share Tech Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

/* ---------- loading splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .45s ease;
}
.splash-hide { opacity: 0; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; padding: 1rem; text-align: center; }
.splash-logo { width: 84px; height: 107px; }
.splash-logo-img { width: min(86vw, 340px); height: auto; border-radius: 14px; box-shadow: 0 0 42px rgba(34, 255, 119, 0.35); }
.splash-word {
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 900; font-size: 2rem; letter-spacing: .05em; color: var(--green); margin-top: .9rem;
}
.splash-word span { color: var(--text); }
.splash-tag { color: var(--text); font-weight: 800; font-size: .95rem; letter-spacing: .18em; margin: .35rem 0 .3rem; }
/* Brand lockup lights line (KD, Nov 29): each pair in its own
   traffic-light color, from the theme vars. */
.splash-lights { font-weight: 800; font-size: .92rem; letter-spacing: .04em; margin: 0 0 1.4rem; }
.splash-lights .lg { color: var(--green); }
.splash-lights .ly { color: var(--amber); }
.splash-lights .lr { color: var(--red); }
.splash-bar {
  width: 180px; height: 6px; border-radius: 999px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border);
}
.splash-bar span {
  display: block; height: 100%; width: 40%; border-radius: 999px;
  background: var(--green); box-shadow: 0 0 12px var(--glow);
  animation: splash-slide 1.1s ease-in-out infinite alternate;
}
@keyframes splash-slide { from { margin-left: 0; } to { margin-left: 60%; } }
.splash-status { color: var(--muted); font-size: .92rem; margin-top: .8rem; }

/* ---------- logo ---------- */
.logo-mark { width: 34px; height: 43px; flex: none; }
.brand-mark { height: 38px; width: auto; flex: none; border-radius: 10px; box-shadow: 0 0 14px rgba(34, 255, 119, 0.35); }
.logo-housing { fill: var(--surface-2); stroke: var(--border); stroke-width: 2; }
.lamp-red { fill: #dc2626; opacity: .16; }
.lamp-amber { fill: #d97706; opacity: .16; }
.lamp-green { fill: var(--green); filter: drop-shadow(0 0 6px var(--glow)); }
.logo-glow { fill: none; stroke: var(--green); stroke-width: 2; opacity: .35; }
.wordmark {
  font-weight: 900; font-size: 1.45rem; letter-spacing: .05em; color: var(--green); line-height: 1;
}
.wordmark-light { color: var(--text); }
.theme-toggle {
  margin-left: auto; width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none;
}
.theme-toggle:active { transform: scale(.92); }
.theme-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
html[data-theme="night"] .theme-toggle .icon-moon { display: none; }
html[data-theme="day"] .theme-toggle .icon-sun { display: none; }

/* ---------- header ---------- */
.app-header {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .9rem 1rem .6rem; max-width: 640px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: .6rem; }
.tagline { margin: 0; color: var(--muted); font-size: .92rem; flex-basis: 100%; }

/* ---------- sign in ---------- */
.auth-btn { flex: none; }
.auth-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1rem;
  box-shadow: 0 2px 14px var(--shadow);
}
.auth-title { font-size: 1.15rem; margin: 0 0 .4rem; }
.auth-panel .form-row { margin-bottom: .4rem; }
.auth-panel .muted { margin: .2rem 0; }

/* ---------- account panel, stacked (v59) ----------
 * One field per row, label above its input. Scoped to .auth-panel
 * only — the global .form-row flow everywhere else is untouched. */
.auth-panel .acct-section { padding-bottom: .9rem; margin-bottom: .9rem; border-bottom: 1px solid var(--border); }
.auth-panel .acct-section:last-of-type { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
.auth-panel .auth-greeting { font-size: 1.25rem; font-weight: 800; margin: .1rem 0 .3rem; }
.auth-panel .acct-actions { display: flex; flex-direction: column; gap: .5rem; margin: .6rem 0; }
.auth-panel .acct-actions .btn { width: 100%; }
.auth-panel .acct-plan { font-weight: 700; margin: .5rem 0 0; }
.auth-panel .acct-field { margin-bottom: .6rem; }
.auth-panel .acct-field .field-label { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 .25rem; }
.auth-panel .acct-field input, .auth-panel .acct-field select, .auth-panel .acct-field textarea { width: 100%; }
.auth-panel .acct-field textarea { min-height: 5rem; }
.auth-panel form .btn.primary, .auth-panel #cancel-wrap .btn { width: 100%; }
.auth-panel #cancel-wrap { margin-top: .9rem; }

/* ---------- header menu (v68) ----------
 * Same panel look as Account, but slim: the list is one clean row
 * per item with a hairline divider (no chunky stacked buttons),
 * and every sheet inside it follows the same one-row-per-thing
 * spacing, so it stays tidy on a ~390px phone. */
.menu-panel .menu-list { display: flex; flex-direction: column; }
.menu-panel .menu-list .btn {
  width: 100%; text-align: left; font-weight: 600;
  background: transparent; border: none; border-bottom: 1px solid var(--border);
  border-radius: 0; padding: .7rem .2rem; box-shadow: none;
}
.menu-panel .menu-list .btn:last-child { border-bottom: none; }
.menu-panel #menu-back-btn { margin-bottom: .4rem; }
/* Tip sheet: same slim rows — label left, handle or status right. */
.menu-panel .menu-tip-row {
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  width: 100%; text-align: left; font-weight: 600;
  background: transparent; border: none; border-bottom: 1px solid var(--border);
  border-radius: 0; padding: .7rem .2rem; box-shadow: none;
}
.menu-panel .menu-tip-row:last-of-type { border-bottom: none; }
/* Referral Admin: the queue's panels are dense by nature — inside
 * the menu they get tighter padding, smaller headings, a little air
 * between rows, and the add-a-referrer inputs stack instead of
 * squeezing side by side on a phone. */
#menu-referrals-view .perf-panel { margin-bottom: .6rem; padding: .7rem .8rem; }
#menu-referrals-view .perf-overall { font-size: 1.1rem; }
#menu-referrals-view .perf-list { gap: .35rem; }
#menu-referrals-view .ref-row input { width: 100%; margin-bottom: .4rem; }
#menu-referrals-view .ref-row input:last-child { margin-bottom: 0; }
#menu-referrals-view .ref-row button { width: 100%; }
#menu-referrals-view #add-ref-result input { width: 100%; margin-top: .4rem; }

/* ---------- login page (the gate) ---------- */
/* The whole screen when signed out. The shell hides with it (see the
   [hidden] rules below) — nothing of the app is visible or reachable
   until there is a user. */
.login-page { min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem 3rem; }
.login-page[hidden] { display: none; }
.login-inner { width: min(100%, 380px); text-align: center; }
.login-logo { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; margin-bottom: .6rem; }
.login-word { font-family: Archivo, sans-serif; font-weight: 900; font-size: 1.9rem; letter-spacing: .02em; }
.login-word span { color: var(--green-bright); }
.login-title { font-size: 1.3rem; margin: .9rem 0 .2rem; }
.login-inner .muted { margin: .2rem 0 .8rem; }
.login-inner .form-row { flex-direction: column; align-items: stretch; margin-bottom: .5rem; }
.login-inner .form-row input, .login-inner .form-row select, .login-inner .form-row .btn { width: 100%; }
.login-inner .field-label { display: block; text-align: left; font-size: .8rem; color: var(--muted); margin: .45rem 0 .2rem; }
/* Sign-up success popup: a modal overlay on the login page (KD, Nov
   26) — the sign-up page closes and this says to check email. One
   button dismisses it back to the normal sign-in form. */
.popup-backdrop {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(0, 0, 0, .6);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.popup-backdrop[hidden] { display: none; }
.popup-card {
  width: min(100%, 340px); text-align: center;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 30px var(--shadow);
  padding: 1.2rem 1.1rem;
}
.popup-card .popup-line { font-size: 1.05rem; font-weight: 700; margin: .2rem 0 .9rem; }
.popup-card .form-row { margin-bottom: 0; }
.popup-card .form-row .btn { width: 100%; }
/* The shell is display:flex/block in author CSS, so the hidden
   attribute alone would lose — these rules make the gate airtight. */
.app-header[hidden], .tabs[hidden] { display: none; }

/* ---------- layout ---------- */
main { max-width: 640px; margin: 0 auto; padding: .4rem 1rem 7.5rem; }
.panel { display: none; }
.panel.active { display: block; }
.panel-head { margin-bottom: .8rem; }
.panel-head p { margin: .15rem 0 0; }

/* ---------- home top ---------- */
.home-top { padding: .4rem 0 1rem; }
.home-title { font-size: 2.1rem; line-height: 1.1; margin: 0; }
.home-date { color: var(--muted); margin: .2rem 0 .9rem; font-size: 1rem; }
.home-bankroll {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.1rem;
  box-shadow: 0 2px 14px var(--shadow);
}
.bankroll-label { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.bankroll-big {
  font-family: "Share Tech Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 3.1rem; font-weight: 400; line-height: 1.1; color: var(--text);
  text-shadow: 0 0 18px var(--glow);
}

.section-title { font-size: 1.35rem; margin: 1.5rem 0 .7rem; }
/* Small brand mark next to section headings — the same symbol as the
 * header, sized to the heading text. */
.section-mark { height: 1.05em; width: auto; border-radius: 6px; vertical-align: -.12em; margin-right: .35rem; }
/* "What the lights mean" — a small traffic light (three dots) plus one
 * plain line per light, right under the picks heading. */
.legend {
  display: flex; gap: .85rem; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .85rem 1rem; margin: 0 0 .9rem;
}
.traffic-light {
  flex: none; width: 34px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.tl-dot { width: 14px; height: 14px; border-radius: 50%; }
.tl-dot.green { background: var(--green); box-shadow: 0 0 8px var(--glow); }
.tl-dot.amber { background: var(--amber); }
.tl-dot.red { background: var(--red); }
.legend-title { margin: 0 0 .3rem; font-size: 1rem; }
.legend-list { list-style: none; margin: 0; padding: 0; font-size: 1rem; }
.legend-list li { margin: .35rem 0; }
.legend-note { margin: .5rem 0 0; font-size: .92rem; color: var(--muted); }
.money-line { font-size: 1.15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; margin: 0; }

/* ---------- buttons ---------- */
.btn {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; padding: .7rem 1rem; font-size: 1rem; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { border-color: var(--green); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn.primary {
  background: linear-gradient(180deg, var(--green-bright), var(--green));
  color: var(--on-green); border-color: transparent; font-weight: 800;
  box-shadow: 0 4px 16px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn.primary:active { box-shadow: 0 1px 6px var(--glow); }
.btn.danger { border-color: #f3c1c1; color: var(--red); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; }
.btn.small { font-size: .92rem; padding: .45rem .8rem; }
.file-btn { display: inline-block; }
.cta {
  display: block; width: 100%; min-height: 62px; margin: 1.3rem 0 .6rem;
  background: linear-gradient(180deg, var(--green-bright), var(--green));
  color: var(--on-green); border: none; border-radius: 16px;
  font-size: 1.25rem; font-weight: 900; letter-spacing: .01em; cursor: pointer;
  box-shadow: 0 6px 24px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform .08s ease, box-shadow .15s ease;
}
.cta:active { transform: translateY(2px) scale(.99); box-shadow: 0 2px 10px var(--glow); background: var(--green); }
.build-msg { margin: .2rem 0 0; font-size: 1.05rem; }
.build-msg.good { color: var(--green-dark); font-weight: 700; }
.build-msg.warn { color: var(--amber); }
/* Recommend explanation — a stacked list, not an essay: head line + one
 * line per picked leg + a combination note. Same shape as the boost
 * summary list. */
.recommend-lines { display: grid; gap: .15rem; }
.recommend-head { font-weight: 700; }
.recommend-note { color: var(--muted); }

/* ---------- notices ---------- */
.notice {
  border: 1px solid #f0d9a8; background: var(--amber-soft);
  border-radius: var(--radius); padding: .8rem 1rem; margin: .6rem 0; font-size: 1rem;
}
.notice.warn { border-color: #f0d9a8; }
.notice.bad { border-color: #f3c1c1; background: var(--red-soft); }
.notice.good { border-color: #bfe8cc; background: var(--green-soft); }

/* ---------- pick cards (home) ---------- */
/* The card text is never selectable: dragging the list with the mouse
 * used to highlight the card text (blue selection) instead of scrolling
 * cleanly — the same user-select issue the sheet handle had. Inputs
 * keep their own selection (see below), so a price can still be
 * selected and edited. */
.pick-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.05rem 1.1rem; margin-bottom: .9rem;
  user-select: none; -webkit-user-select: none;
}
.pick-card input { user-select: text; -webkit-user-select: text; }
/* A finished game greys the whole card out — the pick stays visible
 * with the reason, but nothing about it is tappable. */
.pick-card.game-final { opacity: .55; }
.pick-card.game-final .add-parlay-btn:disabled,
.pick-card.game-final .strike-price:disabled { opacity: .6; cursor: not-allowed; }
.pick-head { display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start; }
.pick-name { font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.pick-team { color: var(--muted); font-size: 1rem; margin-top: .1rem; }
.pick-check {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--green); color: var(--on-green); font-size: 1.05rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
/* The ✓ circle follows the pick's light — it used to stay green even on a
 * yellow or red card. A finished game gets a grey circle, not a light. */
.pick-check.light-yellow { background: var(--amber); color: var(--on-amber); }
.pick-check.light-red { background: var(--red); color: var(--on-red); }
.pick-check.light-final { background: var(--muted); color: var(--surface); }
.pick-bet { font-size: 1.2rem; font-weight: 700; margin: .55rem 0 .15rem; }
.pick-trust { color: var(--muted); font-size: 1rem; }
.pick-status { margin-top: .45rem; font-size: 1rem; font-weight: 700; }
.pick-status.ready { color: var(--green-dark); }
.pick-status.missing { color: var(--muted); font-weight: 400; }
.pick-status.need-price { color: var(--muted); font-weight: 400; }
.pick-status.need-add { color: var(--amber); }
.pick-status.covered { color: var(--muted); font-weight: 400; }
.pick-status.held { color: var(--amber); }
/* Teammate check: amber flag when a key teammate is out, quiet note when
 * one might be missing, plain note when the feed is down and the check
 * couldn't run at all. */
.pick-cast { margin-top: .45rem; font-size: .98rem; }
.pick-cast.flag { color: var(--amber); background: var(--amber-soft); border: 1px solid var(--amber); border-radius: 8px; padding: .45rem .6rem; font-weight: 600; }
.pick-cast.note { color: var(--muted); }
/* A finished game reads as a plain muted note, not an amber warning —
 * the game being over isn't a risk to weigh, it's a fact. */
.pick-cast.final { color: var(--muted); font-weight: 600; }
.pick-cast.unknown { color: var(--muted); font-style: italic; }
.flagged-head { margin-top: 1.4rem; }
/* Ready legs the last build left out, named on the ticket. */
.left-out { color: var(--muted); font-size: .95rem; margin-top: .5rem; }
/* The one-tap fix for a blocked build: clear the tickets holding the
 * stuck legs and rebuild with all of them. Amber, so it reads as the
 * fix for a yellow-light situation, not a destructive action. */
.rebuild-btn { margin-top: .6rem; border-color: var(--amber); color: var(--amber); }
.pick-check-row {
  border-top: 1px solid var(--border); margin-top: .8rem; padding-top: .8rem;
}
.pick-check-row .q { font-size: 1rem; margin: 0 0 .5rem; }
.pick-check-row .inputs { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.pick-check-row label { font-size: 1rem; display: flex; gap: .45rem; align-items: center; }
.pick-check-row input[type="number"] { width: 96px; }
/* "Add to parlay" replaces the old "Yes, it's there" checkbox: tapping
 * it is the confirm action. Added state reads as done, tap again to
 * remove it. */
.add-parlay-btn {
  background: linear-gradient(180deg, var(--green-bright), var(--green));
  color: var(--on-green); border: none; border-radius: 12px;
  padding: .7rem 1.1rem; font-size: 1rem; font-weight: 800; cursor: pointer;
  box-shadow: 0 3px 12px var(--glow);
}
.add-parlay-btn:active { transform: translateY(1px) scale(.98); }
.add-parlay-btn.added {
  background: var(--green-soft); color: var(--green-dark);
  border: 1px solid var(--green); box-shadow: none;
}
/* Player headshot (ESPN) — round, next to the name. A photo that fails
 * to load hides itself, so a missing face never shows a broken image. */
.player-face { flex: none; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
/* Thin market: hardly any money traded on this one yet, so the price
 * might move when KD buys. */
.pick-volume { margin-top: .35rem; font-size: .95rem; color: var(--amber); font-weight: 600; }

/* ---------- Pay more boost ---------- */
/* The toggle sits in the builder-top with the size picker + Recommend
 * (moved Nov 28 — at the bottom of the view it was pointless), so the
 * margins stay tight: a breath under the Recommend message, none below. */
.boost-row { margin: .7rem 0 0; }
.boost-row .muted { margin: .45rem 0 0; }
.toggle-switch {
  display: inline-flex; align-items: center; gap: .6rem;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: .5rem .9rem .5rem .55rem;
  font-size: 1rem; font-weight: 800; cursor: pointer;
}
.toggle-track {
  flex: none; width: 46px; height: 26px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  position: relative; transition: background .15s ease;
}
.toggle-knob {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--muted);
  transition: left .15s ease, background .15s ease;
}
.toggle-switch[aria-checked="true"] .toggle-track { background: var(--green-soft); border-color: var(--green); }
.toggle-switch[aria-checked="true"] .toggle-knob { left: 22px; background: var(--green); }
/* The boosted line on a pick card: a highlighted panel, not a footnote
 * — the higher threshold, its own light and its real Kalshi price on
 * one big line, its record underneath, then its own price + add row.
 * The base line stays above it, so safe vs boosted is visible at a
 * glance. */
.boost-line {
  border: 1px solid var(--border); border-radius: 12px; margin-top: .8rem;
  padding: .7rem .8rem; background: var(--surface-2);
}
.boost-summary { margin: .5rem 0 0; font-weight: 700; }
.boost-summary-list { display: grid; gap: .15rem; }
/* Performance dashboard — top of the Records tab. Settled picks only;
 * the practice-runs section is split off with a dashed rule so test
 * numbers never read as real results. Short lines, no paragraphs. */
.perf-panel { border: 1px solid var(--border); border-radius: 12px; padding: .8rem .9rem; background: var(--surface-2); margin-bottom: 1rem; }
.perf-overall { font-size: 1.25rem; font-weight: 800; }
.perf-section { margin-top: .7rem; }
.perf-section h4 { margin: 0 0 .15rem; font-size: 1rem; }
.perf-list { display: grid; gap: .15rem; }
.perf-note { margin-top: .5rem; }
.perf-sim { border-top: 1px dashed var(--border); margin-top: .8rem; padding-top: .6rem; }
/* NEEDS PRICE tag — an outline tag in muted tones, deliberately NOT a
 * traffic-light color: a missing price is not a yellow light. */
.needs-price-row { display: flex; align-items: center; gap: .45rem; margin-top: .4rem; }
.needs-price-row[hidden] { display: none; }
.needs-price-chip { border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: .1rem .5rem; font-size: .8rem; font-weight: 800; letter-spacing: .06em; }
.needs-price-note { color: var(--muted); font-size: .95rem; }
/* "Not playing tonight" — players who are out but have no card. */
.out-tonight { margin-top: 1.2rem; }
.out-list { list-style: none; padding: 0; margin: .5rem 0 0; }
.out-list li {
  display: flex; gap: .5rem; align-items: center;
  padding: .45rem 0; border-top: 1px solid var(--border);
}
.boost-head { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.boost-label { font-size: 1.1rem; font-weight: 800; }
.boost-light { font-size: .95rem; font-weight: 800; white-space: nowrap; }
.boost-light.light-green { color: var(--green-dark); }
.boost-light.light-yellow { color: var(--amber); }
.boost-light.light-red { color: var(--red); }
.boost-light::before {
  content: ""; display: inline-block; width: .6em; height: .6em;
  border-radius: 50%; background: currentColor; margin-right: .35em;
}
.boost-record { color: var(--muted); font-size: 1rem; margin-top: .15rem; }
.boost-record b { color: var(--text); }
.boost-check-row { margin-top: .6rem; }
.boost-check-row .q { font-size: 1rem; margin: 0 0 .5rem; }
.boost-check-row .inputs { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.boost-check-row input[type="number"] { width: 96px; }
.boost-note { margin-top: .5rem; font-size: .98rem; color: var(--muted); }
.boost-note.red { color: var(--red); font-weight: 600; }
/* Yellow boosted legs on the built ticket, flagged with their record. */
.boost-check { color: var(--amber); font-size: .95rem; margin-top: .5rem; font-weight: 600; }
.no-picks { color: var(--muted); font-size: 1.05rem; }

/* ---------- game / live cards ---------- */
.game-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: .9rem;
}
.game-head { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.game-head h3 { margin: 0; font-size: 1.1rem; }
.game-status { color: var(--muted); font-size: .92rem; white-space: nowrap; }
.injuries { margin: .6rem 0 0; padding-left: 1.1rem; font-size: .95rem; color: var(--muted); }
.injuries li b { color: var(--text); }

.live-line { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: 1rem; }
.live-line:last-child { border-bottom: 0; }
.live-line .prog { font-weight: 800; }
.live-line .prog.hit { color: var(--green-dark); }
.live-line .meta { color: var(--muted); font-size: .9rem; }
.foul-flag { color: var(--red); font-weight: 700; }
.bench-flag { color: var(--amber); font-weight: 700; }
.not-in-flag { color: var(--muted); }
.feed-stale { color: var(--amber); font-weight: 700; }

/* ---------- inputs ---------- */
input, select, textarea {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: .65rem .7rem; font-size: 1rem; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 0; }
textarea { width: 100%; resize: vertical; }

/* ---------- records ---------- */
.filters { display: flex; gap: .45rem; flex-wrap: wrap; margin: .5rem 0 .9rem; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: .5rem .95rem; font-size: .95rem; cursor: pointer;
}
.chip.active { background: var(--green-soft); color: var(--green-dark); border-color: var(--green); font-weight: 700; }
/* Big ticket sizes: a chip stays greyed out until the ready pool can fill
 * that many picks — never offered when it can't be built. */
.chip:disabled { opacity: .45; cursor: not-allowed; }
/* Recommend pool scope (KD, Nov 29): "All sports" / "This sport" chips
 * under the Recommend button. Same .chip styling as the size row. */
.scope-row { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; margin: .6rem 0 0; }
/* Yes/No toggle on Tonight (v61) — neutral chips, same as the scope
 * chips. Never a traffic-light color, so the toggle can't be mistaken
 * for a pick light. */
.side-row { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; margin: .6rem 0 0; }
.side-note { margin: .4rem 0 0; }
/* A No pick card — same layout, same light dot. The NO pill is a
 * muted outline, same treatment as the NEEDS PRICE chip: never a
 * traffic-light color. */
.pick-card.side-no { border-style: dashed; }
.side-chip-no { border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: .05rem .45rem; font-size: .8rem; font-weight: 800; letter-spacing: .06em; vertical-align: .1em; }

.book-row {
  border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem;
  margin-bottom: .6rem; background: var(--surface);
}
.book-row .book-top { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.book-row .book-name { font-weight: 800; font-size: 1.1rem; }
.book-row .book-bet { font-weight: 700; margin-top: .15rem; }
.book-row .book-rates { font-size: .95rem; color: var(--muted); margin-top: .2rem; }
.book-row .book-rates b { color: var(--text); }
.book-note { font-size: .95rem; color: var(--muted); margin-top: .3rem; }
.book-cast { font-size: .95rem; color: var(--muted); margin-top: .2rem; }
.book-cast b { color: var(--amber); font-weight: 600; }
.bans { padding-left: 1.2rem; }
.bans li { margin-bottom: .35rem; }
.bans b { color: var(--red); }

/* Traffic lights: every pick status speaks green / yellow / red, with a
 * CSS dot so the light reads at a glance in night and day themes.
 * A finished game is not a light at all — grey text, grey dot. */
.pick-status.light-green { color: var(--green-dark); }
.pick-status.light-yellow { color: var(--amber); }
.pick-status.light-red { color: var(--red); }
.pick-status.light-final { color: var(--muted); font-weight: 400; }
.pick-status.light-green::before,
.pick-status.light-yellow::before,
.pick-status.light-red::before,
.pick-status.light-final::before {
  content: ""; display: inline-block; width: .6em; height: .6em;
  border-radius: 50%; background: currentColor; margin-right: .4em;
}
/* ---------- pills ---------- */
.pill {
  font-size: .78rem; font-weight: 700; border-radius: 999px; padding: .2rem .6rem; white-space: nowrap;
  display: inline-flex; align-items: center;
}
.pill::before {
  content: ""; width: .55em; height: .55em; border-radius: 50%;
  background: currentColor; margin-right: .35em;
}
.pill.certified { background: var(--green-soft); color: var(--green-dark); }
.pill.cooling { background: var(--amber-soft); color: var(--amber); }
.pill.removed { background: var(--red-soft); color: var(--red); }
.pill.hit { background: var(--green); color: var(--on-green); }

/* ---------- ticket ---------- */
.ticket {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 1rem 1.1rem; margin-bottom: .9rem;
}
.ticket-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.ticket-head h3 { margin: 0; }
.ticket-legs { list-style: none; margin: .7rem 0; padding: 0; }
.ticket-legs li {
  display: flex; justify-content: space-between; gap: .5rem; align-items: center;
  padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: 1rem;
}
.ticket-legs .leg-text { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.ticket-legs li:last-child { border-bottom: 0; }
.ticket-legs .rm { background: none; border: none; color: var(--red); cursor: pointer; font-size: 1.15rem; padding: 0 .3rem; }
.ticket-math { font-size: 1.08rem; }
.ticket-math .thin { color: var(--amber); font-weight: 800; }
.ticket-math .good { color: var(--green-dark); font-weight: 800; }
.ticket-math .est { color: var(--muted); font-size: .9rem; }
.stake-row { display: flex; gap: .5rem; align-items: center; margin-top: .6rem; flex-wrap: wrap; }
.stake-row input { width: 100px; }

/* ---------- ledger ---------- */
.ledger-stats { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .9rem; }
.stat-box {
  flex: 1; min-width: 130px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .7rem .8rem;
}
.stat-box .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat-box .value { font-size: 1.3rem; font-weight: 800; }
.stat-box .value.pos { color: var(--green-dark); }
.stat-box .value.neg { color: var(--red); }
.trend { width: 13px; height: 13px; vertical-align: 1px; margin-right: .2rem; }
.trend.up { fill: var(--green-dark); }
.trend.down { fill: var(--red); }
.head-icon {
  width: 26px; height: 26px; vertical-align: -5px; margin-right: .35rem;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.ledger-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: .9rem; }
.ledger-form h3 { margin-top: 0; }
/* ---------- learn lessons ---------- */
/* One lesson = one card, short lines only. Same surface/border as the
 * ledger form so the Learn tab reads as one page, not a new design. */
.lesson { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .7rem; }
.lesson h3 { margin: 0 0 .35rem; }
.lesson p { margin: .15rem 0; }
.form-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.form-row input, .form-row select { flex: 1; min-width: 130px; }
.ledger-item {
  border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem;
  margin-bottom: .6rem; background: var(--surface); font-size: 1rem;
}
.ledger-item .top { display: flex; justify-content: space-between; gap: .5rem; }
.ledger-item .legs { color: var(--muted); font-size: .92rem; margin-top: .25rem; }
.ledger-item .del { background: none; border: none; color: var(--red); cursor: pointer; }

/* ---------- sport row (Tonight page + Live page) ----------
 * KD, Nov 25: the sport switch lives ON the Tonight page — a row of
 * two labeled tabs under the header, Kalshi's sports-row pattern.
 * One row, two words, no icons. The active one reads green.
 * KD, Nov 29: the Live page got the same row (NBA / NFL / CBB / CFB)
 * so the live lines are broken up by sport instead of one long list —
 * tabs only change what is drawn, never what the feed fetches, so the
 * 60s tick gets cheaper, not slower. The Live tabs use their own
 * .live-sport-tab class on purpose: switchSport() toggles every
 * .sport-tab in the document, and the two rows must never move each
 * other. */
.sport-tabs, .live-sport-tabs {
  display: flex; gap: .5rem; margin: .2rem 0 1rem;
}
.sport-tab, .live-sport-tab {
  flex: 1; padding: .55rem .5rem; border-radius: .6rem;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; font-size: 1rem; font-weight: 700;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
}
.sport-tab .sport-icon, .live-sport-tab .sport-icon { width: 19px; height: 19px; flex: none; }
.sport-tab.active, .live-sport-tab.active { background: var(--green-soft); color: var(--green-dark); border-color: var(--green); }
.sport-view { display: none; }
.sport-view.active { display: block; }

/* ---------- bottom tabs ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; gap: .15rem; padding: .45rem .4rem calc(.45rem + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border);
}
.tab {
  flex: 1; min-width: 0; padding: .55rem .1rem .65rem; border-radius: 12px;
  border: none; background: transparent; color: var(--muted);
  font-size: .98rem; font-weight: 600; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
}
/* Six tabs now (Tonight, Live, Records, Ticket, My Money, Ask) — the
 * labels run a touch smaller so "Records" and "My Money" still fit on
 * a phone-width bar. "My Money" may wrap to two lines on the
 * narrowest screens; the bar stretches evenly, so it stays tidy. */
.tab-label { font-size: .8rem; line-height: 1.15; }
.tab.active { background: var(--green-soft); color: var(--green-dark); }
.tab-icon {
  width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.tab-icon .pulse-ring {
  transform-box: fill-box; transform-origin: center;
  animation: tab-pulse 1.8s ease-out infinite;
}
@keyframes tab-pulse {
  0% { transform: scale(.55); opacity: .9; }
  70% { transform: scale(1.2); opacity: 0; }
  100% { transform: scale(1.2); opacity: 0; }
}
.badge {
  background: var(--green); color: var(--on-green); border-radius: 999px;
  padding: 0 .45rem; font-size: .8rem; font-weight: 800; margin-left: .15rem;
}

footer { max-width: 640px; margin: 0 auto; padding: 0 1rem 1rem; color: var(--muted); font-size: .9rem; text-align: center; }

.toast {
  position: fixed; left: 50%; bottom: 5.5rem; transform: translateX(-50%);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px; padding: .7rem 1.2rem; z-index: 50; box-shadow: 0 4px 24px var(--shadow);
  max-width: 92vw; text-align: center;
}
@media (max-width: 380px) {
  .tab { font-size: .9rem; }
  .bankroll-big { font-size: 2.4rem; }
}

/* ---------- live score strips (Google-style scoreboard) ---------- */
.score-strips { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .4rem; }
.score-strip {
  display: flex; align-items: center; gap: .7rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .7rem .95rem;
  box-shadow: 0 2px 10px var(--shadow);
  user-select: none; -webkit-user-select: none; /* same as the pick cards: a drag scrolls, it never selects text */
}
.score-strip.live { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 2px 14px var(--glow); }
.live-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 800; font-size: .9rem; color: var(--green-dark); margin-bottom: .5rem;
}
.live-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--green);
  animation: live-pulse 1.6s ease-out infinite;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 var(--glow); }
  70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.strip-teams { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.strip-row { display: flex; align-items: center; gap: .55rem; font-size: 1.05rem; }
.team-logo { flex: none; object-fit: contain; }
.pick-head .team-logo { margin-top: .1rem; }
.book-top .team-logo { margin-top: .1rem; }
.strip-row .strip-team { font-weight: 800; min-width: 2.6rem; }
.strip-row.winner .strip-team { color: var(--green-dark); }
.strip-score {
  margin-left: auto; font-size: 1.35rem; line-height: 1.1; color: var(--text);
}
.strip-row.winner .strip-score { color: var(--green-dark); font-weight: 700; }
.strip-clock {
  flex: none; text-align: right; font-size: .85rem; font-weight: 700;
  color: var(--muted); max-width: 5.2rem;
}
.score-strip.live .strip-clock { color: var(--green-dark); }
.score-strip.final .strip-clock { color: var(--muted); }

/* ---------- starting cash editor ---------- */
.cash-edit {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; margin-bottom: .9rem;
}
.cash-edit h3 { margin-top: 0; }
.cash-edit input {
  font-family: "Share Tech Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.25rem;
}

/* ---------- Kalshi price auto-fill + ticket size picker ---------- */
.pick-price-src { margin-top: .35rem; font-size: .95rem; color: var(--green-dark); font-weight: 600; }
/* Price check (Nov 28): one short line, only when the Kalshi price
 * asks for more than the book says. A caution (amber), not a ban —
 * the pick stays addable by hand. */
.pick-price-check { margin-top: .35rem; font-size: .95rem; color: var(--amber); font-weight: 600; }
.size-picker { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; margin: 1.1rem 0 .2rem; }
.size-label { font-weight: 700; margin-right: .15rem; }
.warn-line { color: var(--amber); }

/* ---------- builder top (size picker + recommend) ---------- */
.builder-top { margin: .7rem 0 .2rem; }
.builder-top-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-start; }
.builder-top-row .size-picker { flex: 1 1 16rem; margin: 0; }
.builder-top-row #recommend-btn { flex: none; margin-top: .1rem; }
#recommend-msg { margin-top: .35rem; }

/* ---------- compact build bar + floating pill + "Your picks" sheet ----
 * Kalshi-style: the bar is two short lines (count + payout) and a round
 * arrow; the pill is a small Combo capsule floating over the list
 * mid-screen. Tap either and "Your picks" slides up. The bar and pill
 * live on Tonight only and hide until 1 pick is added. */
.build-bar {
  position: fixed; left: 0; right: 0; z-index: 30;
  bottom: calc(5.1rem + env(safe-area-inset-bottom));
  max-width: 640px; margin: 0 auto; padding: .55rem .9rem;
  display: flex; gap: .7rem; align-items: center;
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 18px var(--shadow);
}
.build-bar[hidden] { display: none; }
.bar-main {
  flex: 1; min-width: 0; border: none; background: none; padding: 0;
  text-align: left; cursor: pointer; color: var(--text);
  display: flex; flex-direction: column; gap: .05rem;
}
.bar-count {
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: .78rem; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
}
.bar-payout {
  font-family: "Share Tech Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.25rem; font-weight: 400; line-height: 1.15;
}
.bar-payout.good { color: var(--green-bright); }
/* The bar's action is a GREEN pill button with a word on it — "See my
 * picks" — not a mystery icon. Same green as the Build button, white
 * text, big enough to tap. It opens the "Your picks" sheet; the sheet's
 * "Build my ticket" button stays the build action. The old round white
 * arrow read as nothing at all. */
.bar-see {
  flex: none; border: none; cursor: pointer; white-space: nowrap;
  background: linear-gradient(180deg, var(--green-bright), var(--green));
  color: var(--on-green); font-weight: 800; font-size: .98rem;
  border-radius: 999px; padding: .7rem 1.05rem;
  box-shadow: 0 4px 16px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.bar-see:active { box-shadow: 0 1px 6px var(--glow); }
/* Floating Combo pill — LOW, just above the bottom build bar, never
 * mid-screen. Stack from the viewport bottom: tab bar (5.1rem) +
 * build bar (~3.5rem) + 12px gap + safe-area. It used to sit at
 * bottom: 38% — the middle of the screen, over the legend text.
 * Hidden whenever the bar is hidden (0 picks), so it never needs a
 * mid-screen fallback position. */
.combo-pill {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(5.1rem + 3.5rem + 12px + env(safe-area-inset-bottom)); z-index: 40;
  display: flex; align-items: center; gap: .45rem;
  padding: .6rem 1.05rem; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); box-shadow: 0 4px 20px var(--shadow);
  font-size: 1rem; font-weight: 700; white-space: nowrap;
  transition: opacity .2s ease;
}
/* While the list scrolls the pill fades out so it never floats over
 * the cards and legend text passing underneath it; it comes back
 * ~300ms after the scrolling stops (see the scroll listener in
 * app.js). A class, not `hidden`, so it never fights updateBuildHint. */
.combo-pill.pill-scrolling { opacity: 0; pointer-events: none; }
.combo-pill[hidden] { display: none; }
.combo-pill-icon { color: var(--green-bright); font-size: 1.05rem; }
.combo-pill-count {
  font-family: "Share Tech Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--green); color: var(--on-green);
  border-radius: 999px; min-width: 1.35rem; height: 1.35rem;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 800; padding: 0 .3rem;
}
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(0, 0, 0, .55);
}
.sheet-backdrop[hidden] { display: none; }
.picks-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-width: 640px; margin: 0 auto; max-height: 82vh;
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--text);
  border-radius: 18px 18px 0 0; border-top: 1px solid var(--border);
  box-shadow: 0 -8px 30px var(--shadow);
  padding: .9rem 1rem calc(.9rem + env(safe-area-inset-bottom));
}
.picks-sheet[hidden] { display: none; }
.sheet-head {
  display: flex; align-items: center; gap: .8rem;
  padding-bottom: .6rem; border-bottom: 1px solid var(--border);
  touch-action: none; /* a drag starting here dismisses, never scrolls */
  user-select: none; -webkit-user-select: none; /* a drag here never selects text */
}
.sheet-head h3 { margin: 0; flex: 1; font-size: 1.25rem; }
.sheet-clear {
  border: none; background: none; color: var(--muted);
  font-size: .98rem; font-weight: 600; cursor: pointer;
  text-decoration: underline; padding: .3rem;
}
.sheet-close {
  border: none; background: var(--surface-2); color: var(--text);
  width: 2rem; height: 2rem; border-radius: 50%;
  font-size: 1rem; cursor: pointer;
}
.sheet-body { overflow-y: auto; padding: .4rem 0; }
.sheet-game {
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: .7rem 0 .3rem; font-size: .85rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.sheet-legs { list-style: none; margin: 0; padding: 0; }
.sheet-leg {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem 0; border-bottom: 1px solid var(--border);
}
/* A finished game's sheet row greys out with the rest of the row —
 * it stays listed (so the refusal names something real) but reads dead. */
.sheet-leg.game-final { opacity: .55; }
/* One line per leg, always: name + leg + multiplier + ×. Long leg text
 * ellipsizes instead of wrapping into a second line. */
.sheet-leg-text {
  flex: 1; min-width: 0; font-size: 1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet-mult {
  font-family: "Share Tech Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 400; color: var(--green-bright); white-space: nowrap;
}
.sheet-tag {
  font-size: .75rem; font-weight: 700; padding: .1rem .4rem;
  border-radius: 999px; background: var(--green-soft); color: var(--green-dark);
  white-space: nowrap;
}
.sheet-tag.warn { background: #3d2f10; color: #fbbf24; }
/* Drag handle: a short grab bar at the top of the sheet. Drag it (or
 * the sheet head) down past the threshold — or flick it down — to
 * dismiss the sheet; drag back up cancels. The head never scrolls,
 * so a drag starting there is always a dismiss, never a scroll. */
.sheet-handle {
  display: flex; justify-content: center; padding: .1rem 0 .5rem;
  touch-action: none; cursor: grab;
  user-select: none; -webkit-user-select: none; /* a drag here never selects text */
}
.sheet-handle span {
  display: block; width: 2.6rem; height: .32rem; border-radius: 999px;
  background: var(--border);
}
.picks-sheet.dragging { transition: none; }
.picks-sheet {
  transition: transform .25s ease;
}
.sheet-rm {
  flex: none; border: none; background: none; color: var(--muted);
  font-size: 1.05rem; cursor: pointer; padding: .3rem .45rem;
}
.sheet-price { display: flex; align-items: center; gap: .25rem; color: var(--muted); font-size: .92rem; white-space: nowrap; }
.sheet-price-input {
  width: 3.4rem; padding: .3rem .4rem; text-align: center;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--text); font-size: 1rem;
}
.sheet-foot {
  border-top: 1px solid var(--border); padding-top: .7rem;
  display: flex; flex-direction: column; gap: .6rem;
}
.sheet-foot-count {
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: .8rem; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
}
.sheet-foot-payout { font-size: 1.4rem; font-weight: 800; }
.sheet-foot-payout b {
  font-family: "Share Tech Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 400; color: var(--green-bright);
}
.sheet-warn { color: var(--text); font-weight: 600; }
.sheet-build { width: 100%; font-size: 1.1rem; padding: .9rem; }
/* The one-tap smaller-build offer in a refusal footer: full width, a
 * little breathing room under the refusal line. */
.sheet-smaller { width: 100%; margin-top: .6rem; }
/* Per-ticket remove: small, quiet, in the ticket head — removing one
 * ticket never touches the others. */
.ticket-rm {
  border: none; background: none; color: var(--muted);
  font-size: .92rem; font-weight: 600; cursor: pointer;
  text-decoration: underline; padding: .3rem; margin-left: auto;
}
.sheet-build:disabled { opacity: .45; }
/* Tonight's bottom padding clears the whole fixed stack so the last
 * card can scroll fully above it: tab bar 5.1rem + build bar ~3.5rem +
 * pill ~2.6rem + 12px gap ≈ 11.4rem, rounded up to 12rem. */
#tab-slate { padding-bottom: 12rem; }
#tab-nfl { padding-bottom: 12rem; }

/* ---------- ledger (simplified: 3 numbers) ---------- */
.stat-box .value.big { font-size: 2.2rem; }
.stat-box .sub { font-size: .92rem; color: var(--muted); margin-top: .15rem; }
.ledger-item .net { font-weight: 800; }
.ledger-item .net.pos { color: var(--green-dark); }

/* ---------- The Scoop (chat) ---------- */
#scoop-receipts { margin-bottom: .8rem; }
#scoop-receipts .perf-panel { margin-bottom: 0; }
.chat-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .8rem; }
.chat-messages {
  display: flex; flex-direction: column; gap: .5rem;
  margin-bottom: .7rem; min-height: 9rem; max-height: 55vh; overflow-y: auto;
}
.chat-msg {
  max-width: 88%; padding: .65rem .85rem; border-radius: var(--radius);
  font-size: 1rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
}
.chat-msg.user { align-self: flex-end; background: var(--green-soft); }
.chat-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }
.chat-msg.typing { color: var(--muted); }
.chat-input-row { display: flex; gap: .5rem; }
.chat-input-row input { flex: 1; min-width: 0; }
.chat-input-row .btn:disabled { opacity: .55; }
/* The Scoop "Why" panel — short lines only, no paragraphs, inside
 * the card it explains. Hidden until its Why button is tapped. */
.why-panel { margin-top: .6rem; border-top: 1px solid var(--border); padding-top: .55rem; display: grid; gap: .2rem; }
.why-panel[hidden] { display: none; }
.why-line { font-size: .98rem; }
.why-btn { white-space: nowrap; }
.ledger-item .net.neg { color: var(--red); }
.quiet-row { margin-top: 1.2rem; opacity: .75; }


/* ---------- new-user tour (v60, fixed v62, floater removed v66) ----------
 * Guided walkthrough (v66: the floating "Take the tour" button is
 * gone — KD Nov 30: "It dont need to be a floater option." The
 * Account panel re-open button is the only manual entry point).
 * STACKING (v62 — this is the fix for the v60 glitch, KD Nov 30:
 * "The tour look like a glitch"): the dim, the spotlight and the
 * card are SIBLINGS in the root stacking context, strictly ordered
 * dim (70) < spotlight (80) < card (90). v60 nested the card inside
 * the #tour-overlay wrapper, which carried NO z-index — so the
 * spotlighted whole tab panel (z-80) painted above the overlay's
 * contents and the bottom nav (z-20): the card was invisible until
 * the user scrolled to the very bottom of the page and the nav looked
 * unfixed. Never nest the card inside the overlay again. The
 * spotlight is the nav tab button — small, always in the viewport —
 * never a whole tab panel. */
/* Dim only — the card is a sibling, not a child (see the header). */
#tour-overlay { position: fixed; inset: 0; z-index: 70; }
#tour-overlay[hidden] { display: none; }
.tour-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .65); }
#tour-card {
  position: fixed; left: .75rem; right: .75rem;
  bottom: calc(5.1rem + .75rem + env(safe-area-inset-bottom));
  z-index: 90; max-width: 640px; margin: 0 auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 30px var(--shadow);
  padding: .9rem 1rem;
}
#tour-card[hidden] { display: none; }
/* The card lifts above the build bar while the bar is up, so it
 * never sits on the bar or the pill. The build bar is full-width,
 * bottom-anchored just above the nav (~3.5rem tall), with the Combo
 * pill floating just above it — and updateBuildHint shows the bar on
 * EVERY tab while picks are added, not just Tonight. */
body:has(#build-bar:not([hidden])) #tour-card {
  bottom: calc(5.1rem + 3.5rem + 12px + 2.8rem + .75rem + env(safe-area-inset-bottom));
}
#tour-title { margin: 0 0 .15rem; font-size: 1.15rem; font-weight: 800; line-height: 1.3; }
#tour-line { margin: 0 0 .15rem; font-size: 1.05rem; font-weight: 700; line-height: 1.4; }
#tour-step-label { margin: 0 0 .6rem; font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tour-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.tour-actions button {
  flex: 1 1 auto; min-width: 0; white-space: nowrap;
  padding: .6rem .8rem; border-radius: 999px; cursor: pointer;
  font-size: 1rem; font-weight: 700;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
}
.tour-actions button:active { transform: translateY(1px); }
.tour-actions button:disabled { opacity: .45; cursor: not-allowed; }
#tour-next, #tour-done {
  background: linear-gradient(180deg, var(--green-bright), var(--green));
  color: var(--on-green); border: none;
  box-shadow: 0 4px 16px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .35);
}
#tour-skip, #tour-dont-show { background: transparent; color: var(--muted); }
#tour-done[hidden] { display: none; }
/* Spotlight: the nav tab button the step is about, lifted above the
 * dim with a green ring. Small by construction — the target is a tab
 * button, never a panel (v60 spotlighted whole panels, which is how
 * step 1 covered the entire Tonight page). */
.tour-spotlight {
  position: relative; z-index: 80;
  outline: 3px solid var(--green-bright); outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--glow), 0 0 24px var(--glow);
}
/* Fixed elements keep their own positioning when spotlighted — the
 * generic relative above must not un-fix them. */
.combo-pill.tour-spotlight { position: fixed; }
/* A spotlighted child cannot escape a low stacking context on its
 * own: lift the whole bar / nav above the dim when the spotlight is
 * inside one of them. */
.build-bar:has(.tour-spotlight) { z-index: 80; }
#app-nav:has(.tour-spotlight) { z-index: 80; }

/* Referrals v1 — readonly referral-link input. */
.ref-link {
  width: 100%;
  box-sizing: border-box;
}
