/* Layout: phone-first app shell. Sticky header with yard-line hash marks,
   a single scrolling column (max 720px), fixed bottom tab bar, bottom sheets. */
:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --line: #dae1ea;
  --ink: #121d2b;
  --ink-2: #4a586b;
  --ink-3: #6f7d8f;
  --accent: #d9581a;
  --accent-text: #b4460c;
  --btn-bg: #bf4b0f;
  --on-accent: #ffffff;
  --good: #187f45;
  --bad: #c0352f;
  --warn: #9a6200;
  --g-great: #0f7a43;
  --g-good: #3f9561;
  --g-neutral: #6c7889;
  --g-tough: #c4683a;
  --g-avoid: #c0352f;
  --hash: #b9c3d0;
  --shadow: 0 1px 2px rgba(18, 29, 43, .06), 0 6px 20px rgba(18, 29, 43, .06);

  --font-display: 'Barlow Condensed', 'Roboto Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 12px;
  --tabbar-h: 62px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1420; --surface: #131f2e; --surface-2: #1a2839; --line: #25374c;
    --ink: #e6edf5; --ink-2: #a8b5c5; --ink-3: #8191a6;
    --accent: #ff7a32; --accent-text: #ff9a5c; --btn-bg: #ff7a32; --on-accent: #1a0d04;
    --good: #45c27f; --bad: #ff6b63; --warn: #e3a93a;
    --g-great: #3fcf84; --g-good: #8fd3a5; --g-neutral: #9aa7b8; --g-tough: #f0a07a; --g-avoid: #ff6b63;
    --hash: #2c4058; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1420; --surface: #131f2e; --surface-2: #1a2839; --line: #25374c;
  --ink: #e6edf5; --ink-2: #a8b5c5; --ink-3: #8191a6;
  --accent: #ff7a32; --accent-text: #ff9a5c; --btn-bg: #ff7a32; --on-accent: #1a0d04;
  --good: #45c27f; --bad: #ff6b63; --warn: #e3a93a;
  --g-great: #3fcf84; --g-good: #8fd3a5; --g-neutral: #9aa7b8; --g-tough: #f0a07a; --g-avoid: #ff6b63;
  --hash: #2c4058; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.45 var(--font-body);
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}
body.sheet-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; }
p { margin: 0; }
code { font-size: .9em; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
small { font-size: .78em; color: var(--ink-3); font-weight: 500; }
.muted { color: var(--ink-2); }
.shell { max-width: 720px; margin: 0 auto; }

/* ---------------------------------------------------------------- header */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 12px;
}
.topbar::after {
  content: ''; position: absolute; left: 16px; right: 16px; bottom: 0; height: 5px;
  background: repeating-linear-gradient(90deg, var(--hash) 0 2px, transparent 2px 22px);
}
.topbar-row { display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 7px; }
.brand-mark { width: 15px; height: 21px; }
.brand-word {
  font: 700 25px/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase;
}
.week-chip {
  font: 600 13px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 8px 4px; border-radius: 6px; background: var(--ink); color: var(--bg);
  font-variant-numeric: tabular-nums;
}
.chip-flag { color: var(--accent); margin-left: 3px; }
.spacer { flex: 1; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 0; background: transparent; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 18px; height: 18px; }
.icon-btn.spinning svg { animation: spin 1s linear infinite; color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.league-switch {
  margin-top: 8px; width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
  padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
}
.ls-label { font: 600 12px/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.ls-name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.league-switch svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --------------------------------------------------------------- tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab {
  height: var(--tabbar-h); border: 0; background: transparent; color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font: 600 12.5px/1 var(--font-display); letter-spacing: .04em; text-transform: uppercase;
  position: relative;
}
.tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"]::before {
  content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent);
}
@media (min-width: 760px) { .tabbar { max-width: 720px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }

/* -------------------------------------------------------------- controls */
.view { outline: none; }
.pad { padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.controls { padding: 14px 16px 6px; display: flex; flex-direction: column; gap: 10px; }
.chips-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); max-width: 100%; }
.seg button {
  border: 0; background: transparent; border-radius: 8px; padding: 8px 12px; color: var(--ink-2);
  font: 600 15px/1 var(--font-display); letter-spacing: .04em; white-space: nowrap;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg-pos button { min-width: 46px; text-transform: uppercase; }
.seg-pos button.on { background: var(--ink); color: var(--bg); box-shadow: none; }
.seg-mode, .seg-mini { display: flex; width: 100%; }
.seg-mode button, .seg-mini button { flex: 1; }
.seg-mini button { font-size: 14px; padding: 7px 8px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
.search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 0; outline: none; font-size: 16px; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.check.sm { font-size: 13px; }
.legend { font-size: 13px; color: var(--ink-3); line-height: 1.4; max-width: 62ch; }
.legend b { color: var(--ink-2); font-weight: 600; }
.plist-head {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 8px 16px 6px; border-bottom: 1px solid var(--line);
  font: 600 12px/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}
.plist-head span:first-child { text-align: center; }
.rank-guide { display: flex; flex-direction: column; }
.rank-guide[open] { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.rank-guide > p { margin-top: 10px; }
.sample-row {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; margin-top: 10px;
  padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--bg);
}
.keys { margin: 10px 0 0; display: flex; flex-direction: column; gap: 9px; }
.keys div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.keys dt { font: 700 15px/1.2 var(--font-display); letter-spacing: .02em; color: var(--ink); }
.keys dd { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.45; }

/* ----------------------------------------------------------- player rows */
.plist, .dvp-list, .lineup, .pick-list, .assets, .leagues, .found { list-style: none; margin: 0; padding: 0; }
.plist { padding: 4px 0 20px; }
.prow, .power-row {
  width: 100%; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px;
  padding: 10px 16px; border: 0; background: transparent; text-align: left;
  border-bottom: 1px solid var(--line);
}
.prow:hover { background: var(--surface-2); }
.prow:disabled { opacity: .5; cursor: default; }
.prow.is-mine, .power-row.is-mine { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.pick-list .prow { grid-template-columns: 1fr auto; padding: 10px 2px; }
.prank {
  font: 600 20px/1 var(--font-display); color: var(--ink-3); text-align: center; font-variant-numeric: tabular-nums;
}
.pmain { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pname { font-weight: 600; font-size: 15.5px; line-height: 1.2; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pmeta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; color: var(--ink-2); }
.pmeta b { font: 700 13px/1 var(--font-display); letter-spacing: .05em; color: var(--ink); }
.pnum { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums; }
.pnum b { font: 600 24px/1 var(--font-display); letter-spacing: .01em; }
.pnum small { white-space: nowrap; }
.live { color: var(--good); font-weight: 600; }
.live::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 4px; vertical-align: 1px; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.empty-row { padding: 24px 16px; color: var(--ink-2); }

.mu {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 5px;
  font: 600 12.5px/1.35 var(--font-display); letter-spacing: .04em; text-transform: uppercase;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.mu em { font-style: normal; opacity: .8; text-transform: none; }
.mu.g-great, .grade-word.g-great { color: var(--g-great); background: color-mix(in srgb, var(--g-great) 13%, transparent); border-color: color-mix(in srgb, var(--g-great) 30%, transparent); }
.mu.g-good, .grade-word.g-good { color: var(--g-good); background: color-mix(in srgb, var(--g-good) 12%, transparent); border-color: color-mix(in srgb, var(--g-good) 28%, transparent); }
.mu.g-neutral, .grade-word.g-neutral { color: var(--g-neutral); }
.mu.g-tough, .grade-word.g-tough { color: var(--g-tough); background: color-mix(in srgb, var(--g-tough) 12%, transparent); border-color: color-mix(in srgb, var(--g-tough) 28%, transparent); }
.mu.g-avoid, .grade-word.g-avoid { color: var(--g-avoid); background: color-mix(in srgb, var(--g-avoid) 13%, transparent); border-color: color-mix(in srgb, var(--g-avoid) 30%, transparent); }
.mu-bye { color: var(--ink-3); }
.grade-word {
  display: inline-block; padding: 3px 8px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface-2);
  font: 700 12.5px/1.2 var(--font-display); letter-spacing: .08em; text-transform: uppercase;
}
.tag {
  font: 600 11.5px/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 6px; border-radius: 4px; background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line);
  max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tag-fa { color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.tag-mine { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.tag-low { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); max-width: none; }
.inj {
  font: 700 11px/1 var(--font-display); letter-spacing: .06em; padding: 3px 5px 2px; border-radius: 4px; color: #fff;
}
.inj-q { background: var(--warn); }
.inj-d { background: var(--g-tough); }
.inj-o { background: var(--bad); }

/* --------------------------------------------------------------- loading */
.load-msg { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 500; }
.dot-pulse { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); animation: pulse 1s ease-in-out infinite; flex: none; }
@keyframes pulse { 50% { transform: scale(.55); opacity: .5; } }
.skel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.skel-row { display: grid; grid-template-columns: 26px 1fr 50px; gap: 12px; align-items: center; }
.skel-row span { height: 14px; border-radius: 6px; background: var(--line); animation: shimmer 1.4s ease-in-out infinite; }
.skel-row span:nth-child(2) { height: 30px; }
.skel-row span:nth-child(3) { height: 22px; }
@keyframes shimmer { 50% { opacity: .45; } }

/* ----------------------------------------------------------- cards, btns */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card h2 { font: 700 24px/1.1 var(--font-display); letter-spacing: .01em; }
.card h3 { font: 700 18px/1.15 var(--font-display); letter-spacing: .02em; }
.card.empty { box-shadow: var(--shadow); }
.card.callout { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card.warn { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.card ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.err { color: var(--bad); font-weight: 500; }
.note { font-size: 13.5px; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 700 16px/1 var(--font-display); letter-spacing: .05em; text-transform: uppercase;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.btn.primary { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--on-accent); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.add { border-style: dashed; width: 100%; color: var(--ink-2); }
.sm-btn { min-height: 36px; padding: 7px 12px; font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row .btn { flex: 1 1 140px; }

/* ----------------------------------------------------------------- sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(6, 12, 20, .5); }
.sheet-backdrop.enter { animation: fade .18s ease-out; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 720px; margin: 0 auto;
  max-height: calc(100dvh - 40px - env(safe-area-inset-top, 0px));
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25);
}
.sheet.enter { animation: rise .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-backdrop, .dot-pulse, .live::before, .skel-row span { animation: none; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 16px; }
.sheet-head h2 { flex: 1; min-width: 0; font: 700 26px/1.1 var(--font-display); letter-spacing: .01em; }
.sheet-body {
  overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 12px;
}
.sheet-body > * { flex-shrink: 0; }
.sheet-meta { color: var(--ink-2); font-weight: 500; }
.inj-note { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.own-line { font-size: 14px; color: var(--ink-2); }
.h-sub {
  font: 700 14px/1.2 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
  margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
}
.h-sub small { letter-spacing: 0; text-transform: none; font-family: var(--font-body); }
.proj-grid { display: grid; grid-template-columns: auto auto auto 1fr; gap: 12px; align-items: end; }
.proj-grid .arrow { color: var(--ink-3); font-size: 20px; padding-bottom: 4px; }
.mu-col { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.lbl { display: block; font: 600 12px/1.2 var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.big { display: block; font: 600 38px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.big.accent { color: var(--accent-text); }
.explain { font-size: 14px; color: var(--ink-2); max-width: 62ch; }
.explain b { color: var(--ink); }
.statline, .kv { margin: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.statline { display: flex; flex-wrap: wrap; }
.statline div { background: var(--surface); padding: 8px 10px; flex: 1 1 28%; }
.statline dt, .kv dt { font-size: 12px; color: var(--ink-3); }
.statline dd { margin: 0; font: 600 20px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.kv div { background: var(--surface); padding: 10px 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.kv dt { font-size: 14px; color: var(--ink-2); }
.kv dd { margin: 0; font: 600 19px/1 var(--font-display); font-variant-numeric: tabular-nums; text-align: right; }
.live-line { font-size: 14px; }
.gamelog { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.gamelog div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; display: flex; flex-direction: column; gap: 1px; font-size: 12px; color: var(--ink-3); }
.gamelog b { font: 600 20px/1.1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- matchups */
.dvp-list { padding: 6px 0 20px; }
.dvp-row {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 58px 58px; gap: 10px; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
}
.dvp-team { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dvp-team b { font: 700 19px/1 var(--font-display); letter-spacing: .04em; }
.dvp-num { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.dvp-num b { font: 600 19px/1.1 var(--font-display); }
.up { color: var(--good); }
.down { color: var(--bad); }

/* -------------------------------------------------------------- my team */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font: 600 12.5px/1.2 var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.field > span small { text-transform: none; letter-spacing: 0; font-family: var(--font-body); }
.field input, .field select, select, textarea {
  width: 100%; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  padding: 9px 12px; font-size: 16px;
}
.field.grow { flex: 1; }
.score-pair { display: flex; gap: 24px; flex-wrap: wrap; }
.swaps { list-style: none; padding: 0 !important; }
.swaps li { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.swaps .in { font-weight: 600; color: var(--good); }
.swaps .out { color: var(--ink-2); }
.ok-line { color: var(--good); font-weight: 500; }
.alerts { list-style: none; padding: 0 !important; }
.alerts li { display: flex; gap: 8px; align-items: center; }
.list-head {
  font: 700 14px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
  padding: 18px 16px 8px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
}
.list-head small { letter-spacing: 0; text-transform: none; font-family: var(--font-body); }
.lineup-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.lineup-row.bench { background: var(--surface-2); }
.slot {
  font: 700 13px/1 var(--font-display); letter-spacing: .06em; text-align: center; padding: 6px 0; border-radius: 6px;
  background: var(--ink); color: var(--bg);
}
.bench .slot { background: var(--line); color: var(--ink-2); }
.lineup-row.reserve { background: var(--surface-2); }
.slot.slot-ir { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.slot.slot-taxi { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); }
.inj-ir { background: var(--bad); }
.pcell { display: flex; flex-direction: column; gap: 4px; border: 0; background: transparent; text-align: left; padding: 2px 0; min-width: 0; }
.swap-in { color: var(--accent-text); font-weight: 700; }
.power-row { grid-template-columns: 34px 1fr auto; }

/* ---------------------------------------------------------------- trade */
.trade-grid { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 8px 16px; }
@media (min-width: 560px) { .trade-grid { grid-template-columns: 1fr 1fr; } }
.trade-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.side-head { display: flex; align-items: center; gap: 10px; }
.side-tag { font: 700 16px/1 var(--font-display); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: var(--ink); color: var(--bg); flex: none; }
.side-title { font: 700 19px/1.1 var(--font-display); letter-spacing: .02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assets li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.asset-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.asset-val { font: 600 18px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.asset-empty { display: block !important; color: var(--ink-3); }
.side-total { text-align: right; color: var(--ink-2); font-size: 14px; }
.side-total b { font: 600 22px/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.result { margin: 4px 16px 0; box-shadow: var(--shadow); }
.verdict { font: 700 28px/1.05 var(--font-display) !important; }
.v-fair { color: var(--good); }
.v-leanA, .v-leanB { color: var(--warn); }
.v-favA, .v-favB { color: var(--bad); }
.v-empty { color: var(--ink-3); }
.balance { height: 14px; border-radius: 7px; background: var(--ink-3); overflow: hidden; position: relative; }
.balance::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--surface); }
.bal-a { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.bal-legend { display: flex; justify-content: space-between; font: 600 14px/1 var(--font-display); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.impact { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.impact h4 { font: 700 13px/1.2 var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.impact-row { display: flex; justify-content: space-between; gap: 12px; }
.impact-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.impact-row b { font: 600 20px/1 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.how summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.how p { margin-top: 8px; font-size: 14px; color: var(--ink-2); max-width: 64ch; }
.pick-builder { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

/* ------------------------------------------------------------------- AI */
.reads { display: grid; gap: 10px; }
@media (min-width: 560px) { .reads { grid-template-columns: 1fr 1fr; } }
.read h3 { font-size: 16px !important; letter-spacing: .06em !important; text-transform: uppercase; color: var(--ink-3); }
.read ul { font-size: 14.5px; }
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 10px 13px; border-radius: 14px; font-size: 15px; line-height: 1.5; display: flex; flex-direction: column; gap: 6px; }
.msg ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.msg.user { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.error { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); color: var(--bad); }
.msg.thinking { flex-direction: row; align-items: center; gap: 10px; color: var(--ink-2); }
.msg-by { font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .02em; }
.ai-status { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--ink-2); }
.ai-status li { display: block; line-height: 1.45; }
.ai-status b { color: var(--ink); margin-right: 4px; }
.ai-status .tag { margin-right: 6px; vertical-align: 1px; }
.quick { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 13px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.chip:disabled { opacity: .5; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.composer textarea { resize: none; min-height: 48px; }

/* ------------------------------------------------------------- settings */
.set-block { display: flex; flex-direction: column; gap: 10px; }
.set-block:first-child .h-sub { border-top: 0; padding-top: 0; margin-top: 0; }
.league-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.league-item:first-child { grid-template-columns: 1fr; }
.league-item:last-child { border-bottom: 0; }
.radio { display: flex; gap: 10px; align-items: center; min-width: 0; cursor: pointer; }
.radio input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; flex: none; }
.radio span { display: flex; flex-direction: column; min-width: 0; }
.radio b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 180px; }
.stack-form { display: flex; flex-direction: column; gap: 10px; }
.two, .grid-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.found li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.found li > span { display: flex; flex-direction: column; min-width: 0; }
.small-line { font-size: 13.5px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent-text); font-weight: 600; text-decoration: underline; }
.private-card { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); gap: 14px; scroll-margin-top: 12px; }
.opt { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.opt h4 { display: flex; align-items: center; gap: 8px; font: 700 18px/1.15 var(--font-display); letter-spacing: .02em; }
.opt p { font-size: 14px; color: var(--ink-2); }
.opt p b, .steps b { color: var(--ink); }
.opt .btn { align-self: flex-start; }
.opt-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--ink); color: var(--bg); font-size: 15px; flex: none; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--ink-2); }
.shortcut-code { font: 12px/1.4 ui-monospace, Menlo, Consolas, monospace; min-height: 0; }

/* ------------------------------------------------------------- waivers */
.faab-row { display: flex; gap: 22px; align-items: flex-end; flex-wrap: wrap; }
.mid { display: block; font: 600 26px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.wlist { list-style: none; margin: 0; padding: 0 16px 8px; display: flex; flex-direction: column; gap: 10px; }
.wcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.wtop { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.wbid { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.wbid .lbl { margin-bottom: 2px; }
.wbid b { font: 600 34px/1 var(--font-display); color: var(--accent-text); font-variant-numeric: tabular-nums; }
.wbid b.claim { color: var(--good); font-size: 26px; }
.wbid b.wait { color: var(--ink-3); font-size: 26px; }
.wbid small { white-space: nowrap; }
.why { font-size: 14px; color: var(--ink-2); }
.why b { color: var(--ink); }
.wstats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.wstats div { background: var(--surface-2); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.wstats dt { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wstats dd { margin: 0; font: 600 19px/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.wfoot { display: flex; justify-content: space-between; align-items: center; gap: 6px 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 8px; }
.drop { font-size: 13.5px; color: var(--ink-2); min-width: 0; }
.drop b { color: var(--ink); }
.tier {
  font: 700 12px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 7px; border-radius: 5px; border: 1px solid var(--line); color: var(--ink-3);
}
.t-big { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.t-strong { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.t-modest { color: var(--ink-2); }
.hist { list-style: none; margin: 0; padding: 0 0 8px; }
.hist-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.hist-wk { font: 600 13px/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.hist-name { font-weight: 600; min-width: 0; }
.hist-team { display: block; font-weight: 400; }
.hist-row b { font: 600 21px/1 var(--font-display); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- usage */
.utiles { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 560px) { .utiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.utile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.utile dt { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.utile dd { margin: 0; font: 600 20px/1.1 var(--font-display); font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.utile dd small { font: 600 12px/1 var(--font-body); }
.utile > small { font-size: 11.5px; }
.pbar { display: block; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pbar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.xfp { font-size: 14px; color: var(--ink-2); }
.xfp b { color: var(--ink); font-variant-numeric: tabular-nums; }
.usage-card { margin: 12px 16px 0; }
.ucard { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.ucard h4 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 700 18px/1.15 var(--font-display); }
.ucard h4 small { font-family: var(--font-body); font-weight: 500; }
.side-tag.sm { width: 22px; height: 22px; font-size: 13px; border-radius: 5px; }
.asset-usage { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
.ucard .utile { background: var(--surface-2); }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px); z-index: 60;
  max-width: 520px; margin: 0 auto; padding: 12px 14px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font-weight: 500; box-shadow: var(--shadow);
}
