/* FM Dashboard
   Two theme controls only:
   - Mode (light / dark / system): backgrounds, surfaces, text. Per device.
   - Accent (per save): buttons, highlights, active tab, selected chips. */

:root {
  --accent: #2447a8;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --sunk: #eceee9;
  --line: #e1e4de;
  --line-strong: #cdd2ca;
  --ink: #17201a;
  --muted: #657067;
  --faint: #9aa39b;
  --accent-text: color-mix(in oklab, var(--accent) 88%, black);
  --accent-soft: color-mix(in oklab, var(--accent) 11%, transparent);
  --accent-ink: #fff;
  --pos: #1d7a46; --neg: #b3362c; --warn: #a76400; --info: #2c62b8; --violet: #6b45a6;
  --shadow: 0 1px 2px rgba(20, 30, 22, .05), 0 8px 24px rgba(20, 30, 22, .07);
  --radius: 10px;
  --radius-sm: 7px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121513; --surface: #191d1a; --sunk: #202521; --line: #2a302b; --line-strong: #3a423c;
    --ink: #e6ebe6; --muted: #98a299; --faint: #687169;
    --accent-text: color-mix(in oklab, var(--accent) 55%, white);
    --accent-soft: color-mix(in oklab, var(--accent) 24%, transparent);
    --pos: #5cc48a; --neg: #ef7b70; --warn: #e2a64a; --info: #79a8f0; --violet: #b49ae6;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121513; --surface: #191d1a; --sunk: #202521; --line: #2a302b; --line-strong: #3a423c;
  --ink: #e6ebe6; --muted: #98a299; --faint: #687169;
  --accent-text: color-mix(in oklab, var(--accent) 55%, white);
  --accent-soft: color-mix(in oklab, var(--accent) 24%, transparent);
  --pos: #5cc48a; --neg: #ef7b70; --warn: #e2a64a; --info: #79a8f0; --violet: #b49ae6;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.45 Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "ss01"; -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.boot { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }

/* ── Top bar ─────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-in { max-width: 1440px; margin: 0 auto; padding: 0 20px; height: 58px; display: flex; align-items: center; gap: 16px; }
.switcher { display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; border-radius: 9px; min-width: 0; }
.switcher:hover { background: var(--sunk); }
.switcher .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.switcher svg { color: var(--muted); flex: none; }
.crest { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px; }
.crest img { width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.crest.lg { width: 64px; height: 64px; border-radius: 14px; font-size: 24px; }
.crest.xl { width: 84px; height: 84px; border-radius: 16px; font-size: 30px; }
.crest.md { width: 40px; height: 40px; border-radius: 10px; font-size: 15px; }
.tabs { display: flex; gap: 2px; margin-left: 8px; }
.tab { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--ink); background: var(--sunk); }
.tab[aria-current="page"] { color: var(--accent-text); background: var(--accent-soft); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.sync { font-size: 12.5px; color: var(--faint); margin-right: 6px; white-space: nowrap; }
.sync.err { color: var(--neg); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: var(--muted); }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }

.popover { position: absolute; z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 260px; }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 8px; text-align: left; }
.pop-item:hover { background: var(--sunk); }
.pop-item .t { font-weight: 550; } .pop-item .s { font-size: 12.5px; color: var(--muted); }
.pop-item .tick { margin-left: auto; color: var(--accent-text); }
.pop-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ── Page ────────────────────────────────────────────── */
main { max-width: 1440px; margin: 0 auto; padding: 20px 24px 96px; }
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
h2.sec { font-size: 15px; font-weight: 600; margin-bottom: 10px; }

/* ── Controls ────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 9px; font-weight: 550; white-space: nowrap; border: 1px solid var(--line-strong); background: var(--surface); }
.btn:hover { background: var(--sunk); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--sunk); }
.btn.danger { color: var(--neg); border-color: color-mix(in oklab, var(--neg) 40%, transparent); background: none; }
.btn.danger:hover { background: color-mix(in oklab, var(--neg) 10%, transparent); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13.5px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 550; color: var(--muted); }
.field .hint { font-size: 12.5px; color: var(--faint); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 11px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--line-strong); outline: none;
}
.textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.select { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23889188' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--muted); font-weight: 550; font-size: 13.5px; background: var(--surface); white-space: nowrap; }
.chip:hover { color: var(--ink); border-color: var(--faint); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip .ct { opacity: .7; margin-left: 4px; font-variant-numeric: tabular-nums; }

.seg { display: inline-flex; background: var(--sunk); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { height: 30px; padding: 0 12px; border-radius: 7px; color: var(--muted); font-weight: 550; font-size: 13.5px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.toggle { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 11px 0 9px; border-radius: 8px; border: 1px solid var(--line-strong); font-size: 13.5px; font-weight: 550; color: var(--muted); background: var(--surface); }
.toggle::before { content: ""; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--faint); }
.toggle[aria-pressed="true"] { color: var(--ink); border-color: var(--accent-text); background: var(--accent-soft); }
.toggle[aria-pressed="true"]::before { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center/10px no-repeat; border-color: var(--accent); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ── Squad ───────────────────────────────────────────── */
.club-h1 { display: flex; align-items: center; gap: 16px; }
.quickadd { display: grid; grid-template-columns: minmax(180px, 280px) 1fr auto; gap: 10px; align-items: center; padding: 12px; margin-bottom: 8px; }
.quickadd .input { height: 40px; font-size: 15.5px; }
.qa-hint { font-size: 12.5px; color: var(--faint); margin: 0 4px 22px; }
.qa-bulk { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: -2px 0 10px; border-radius: 9px; background: var(--accent-soft); font-size: 14px; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; flex-wrap: wrap; }
.search { position: relative; }
.search .input { padding-left: 32px; width: 220px; height: 34px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); }

.group { margin-bottom: 10px; }
.group-h {
  position: sticky; top: 58px; z-index: 6;
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 8px; margin-bottom: 0;
  background: color-mix(in oklab, var(--accent) 9%, var(--bg)); border-left: 4px solid var(--accent);
  border-radius: 0 9px 9px 0;
  box-shadow: 0 6px 10px -10px rgba(0,0,0,.3);
}
.group-h .chev { color: var(--accent-text); display: grid; transition: transform .15s; }
.group.closed .group-h .chev { transform: rotate(-90deg); }
.group.closed .group-h { opacity: .85; }
.group-h .code { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; color: var(--accent-text); min-width: 2ch; }
.group-h .full { font-weight: 600; font-size: 14.5px; }
.group-h .count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; background: var(--surface); border-radius: 99px; padding: 1px 8px; }
.group-h .add { margin-left: auto; }
.group-h .tag { margin-left: 0; }
.group.drop-target .group-h { background: color-mix(in oklab, var(--accent) 22%, var(--bg)); }

.prow { display: grid; grid-template-columns: 18px minmax(0, 1fr) 132px 84px 140px; align-items: center; gap: 14px; padding: 6px 8px 6px 4px; border-bottom: 1px solid var(--line); position: relative; cursor: pointer; border-left: 4px solid transparent; }
.prow:hover { background: color-mix(in oklab, var(--sunk) 60%, transparent); }
.prow.loan-in { background: color-mix(in oklab, var(--info) 9%, transparent); border-left-color: color-mix(in oklab, var(--info) 60%, transparent); }
.prow.loan-out { background: color-mix(in oklab, var(--warn) 10%, transparent); border-left-color: color-mix(in oklab, var(--warn) 60%, transparent); }
.prow.loan-in:hover { background: color-mix(in oklab, var(--info) 14%, transparent); }
.prow.loan-out:hover { background: color-mix(in oklab, var(--warn) 15%, transparent); }
.prow.open { background: var(--surface); border-bottom-color: transparent; box-shadow: inset 0 1px 0 var(--line); }
.prow.dragging { opacity: .3; }
.prow.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.prow.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.grip { color: var(--faint); cursor: grab; display: grid; place-items: center; height: 22px; opacity: 0; }
.prow:hover .grip { opacity: 1; }
.pmain { min-width: 0; text-align: left; display: block; width: 100%; }
.pname { font-weight: 600; font-size: 15px; }
.pnote { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.tag { display: inline-block; vertical-align: 2px; margin-left: 7px; padding: 1px 7px; border-radius: 99px; font-size: 11.5px; font-weight: 600; }
.tag.in { color: var(--info); background: color-mix(in oklab, var(--info) 13%, transparent); }
.tag.out { color: var(--warn); background: color-mix(in oklab, var(--warn) 14%, transparent); }
.tag.plain { color: var(--muted); background: var(--sunk); }
.footpill { justify-self: start; font-size: 12.5px; font-weight: 650; padding: 3px 9px; border-radius: 7px; white-space: nowrap; }
.footpill:empty { display: none; }
.footpill.right { color: var(--ink); background: var(--sunk); }
.footpill.left { color: #fff; background: color-mix(in oklab, var(--violet) 85%, black); }
.footpill.two { color: var(--pos); background: color-mix(in oklab, var(--pos) 15%, transparent); }
.clause { justify-self: end; font-size: 13px; color: var(--warn); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clause::before { content: "Clause "; color: var(--faint); font-weight: 500; }
.elig { display: flex; gap: 4px; justify-content: flex-end; }
.elig button { height: 24px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 650; letter-spacing: .02em; color: var(--faint); border: 1px dashed var(--line-strong); }
.elig button:hover { color: var(--muted); border-color: var(--faint); }
.elig button[aria-pressed="true"] { color: var(--accent-text); background: var(--accent-soft); border: 1px solid transparent; }

.pedit { background: var(--surface); border-bottom: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 4px 16px 14px 18px; box-shadow: 0 10px 20px -18px rgba(0,0,0,.4); animation: fade .12s; }
.pedit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.pedit-grid .wide { grid-column: 1 / -1; }
.pedit-f { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.pedit-f { flex-wrap: wrap; }
.pedit-saved { margin-left: auto; font-size: 12.5px; }
.seg.wrap { flex-wrap: wrap; }

.crest-btn { position: relative; border-radius: 14px; }
.crest-edit-hint { position: absolute; inset: auto 0 0 0; font-size: 11px; font-weight: 600; color: #fff; background: rgba(0,0,0,.55); border-radius: 0 0 14px 14px; padding: 2px 0; opacity: 0; transition: opacity .12s; }
.crest-btn:hover .crest-edit-hint, .crest-btn:focus-visible .crest-edit-hint { opacity: 1; }

.chip.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 6px 10px; margin: 0 0 10px; }
.fgroup { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.flabel { font-size: 12px; color: var(--faint); font-weight: 600; margin-right: 2px; }
.fgroup + .fgroup { padding-left: 18px; border-left: 1px solid var(--line); }
.chip.xs { height: 24px; padding: 0 9px; font-size: 12.5px; border-color: var(--line); }
.nowrap { white-space: nowrap; }
.count-pill { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; padding: 0 5px; }
.pos-name { width: auto; min-width: 2ch; border: 0; background: transparent; font-weight: 650; font-size: 13.5px; padding: 0; outline: none; border-bottom: 1px dashed transparent; }
.pos-name:hover { border-bottom-color: var(--faint); }
.pos-name:focus { border-bottom-color: var(--accent-text); }
.group-empty { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 9px 8px 9px 4px; color: var(--faint); font-size: 13.5px; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; }
.group-empty svg { width: 18px; }
.group-empty:hover { color: var(--accent-text); background: color-mix(in oklab, var(--sunk) 50%, transparent); }

/* ── Targets ─────────────────────────────────────────── */
.split { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; align-items: start; }
.needs { position: sticky; top: 78px; }
.need { display: grid; grid-template-columns: 10px 1fr auto; align-items: start; gap: 4px 10px; width: 100%; text-align: left; padding: 10px 10px; border-radius: 9px; }
.need:hover { background: var(--sunk); }
.need[aria-current="true"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.need .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; }
.need .t { font-weight: 600; }
.need .n { grid-column: 2 / 4; color: var(--muted); font-size: 13px; line-height: 1.35; }
.need .c { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.need-add { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.need-add .input { grid-column: 1 / 3; }
.need-add .btn { grid-column: 1 / 3; }
.p-Critical { background: var(--neg); color: var(--neg); } .p-High { background: var(--warn); color: var(--warn); } .p-Medium { background: var(--info); color: var(--info); } .p-Low { background: var(--faint); color: var(--faint); } .p-Luxury { background: var(--violet); color: var(--violet); }
.pri-label { font-size: 12.5px; font-weight: 600; background: none !important; }

.pipeline { display: flex; gap: 0; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.pipeline button { flex: 1; padding: 9px 10px; text-align: left; border-right: 1px solid var(--line); min-width: 0; }
.pipeline button:last-child { border-right: 0; }
.pipeline button:hover { background: var(--sunk); }
.pipeline button[aria-pressed="true"] { background: var(--accent-soft); }
.pipeline .k { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipeline .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }

.addrow { display: grid; gap: 8px; align-items: center; padding: 10px; margin-bottom: 14px; }
.addrow.targets { grid-template-columns: 1.3fr 1fr 120px auto; }
.trow { display: grid; grid-template-columns: minmax(0, 1fr) 140px 100px 128px; gap: 14px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.trow:hover { background: color-mix(in oklab, var(--sunk) 60%, transparent); }
.trow .club { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .price { font-variant-numeric: tabular-nums; font-size: 14px; text-align: right; }
.trow.failed .pname { text-decoration: line-through; text-decoration-color: var(--faint); color: var(--muted); }
.status-sel { height: 30px; font-size: 13px; font-weight: 600; border-radius: 99px; padding: 0 26px 0 11px; border: 1px solid transparent; background-position: right 8px center; }
.s-Watching { background-color: var(--sunk); color: var(--muted); }
.s-Approached { background-color: color-mix(in oklab, var(--info) 13%, transparent); color: var(--info); }
.s-Bid { background-color: color-mix(in oklab, var(--warn) 14%, transparent); color: var(--warn); }
.s-Agreed { background-color: color-mix(in oklab, var(--pos) 14%, transparent); color: var(--pos); }
.s-Signed { background-color: var(--pos); color: #fff; }
.s-Failed { background-color: color-mix(in oklab, var(--neg) 11%, transparent); color: var(--neg); }
.subhead { display: flex; align-items: baseline; gap: 10px; margin: 18px 4px 4px; }
.subhead:first-of-type { margin-top: 0; }
.subhead .t { font-weight: 700; }
.subhead .n { color: var(--muted); font-size: 13.5px; }

/* ── Transfers ───────────────────────────────────────── */
.ledger-sum { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.ledger-sum > div { padding: 12px 4px 14px; }
.ledger-sum .k { font-size: 13px; color: var(--muted); }
.ledger-sum .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.v.spent { color: var(--neg); } .v.recv { color: var(--pos); }
.addrow.transfers { grid-template-columns: auto 1.2fr 1fr 120px 100px auto; }
.addrow .flags { grid-column: 2 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.xrow { display: grid; grid-template-columns: 28px minmax(0, 1fr) 140px 84px 112px; gap: 14px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.xrow:hover { background: color-mix(in oklab, var(--sunk) 60%, transparent); }
.dir { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.dir.in { color: var(--neg); background: color-mix(in oklab, var(--neg) 11%, transparent); }
.dir.out { color: var(--pos); background: color-mix(in oklab, var(--pos) 13%, transparent); }
.xrow .club { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xrow .xseason { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.xrow .fee { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.fee.free { color: var(--faint); font-weight: 500; }

/* ── Seasons ─────────────────────────────────────────── */
.season { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; padding: 22px 4px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.season:first-child { border-top: 2px solid var(--ink); }
.season:hover { background: color-mix(in oklab, var(--sunk) 50%, transparent); }
.season .yr { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.season .yr small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.season .lg { font-size: 18px; font-weight: 650; }
.season .lg .fin { color: var(--accent-text); }
.comps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.comp { font-size: 13.5px; padding: 4px 10px; border-radius: 8px; background: var(--sunk); }
.comp b { font-weight: 600; }
.comp.won { background: var(--accent); color: var(--accent-ink); }
.honours { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 20px; margin-top: 14px; }
.honours .k { font-size: 12.5px; color: var(--muted); }
.honours .v { font-weight: 550; }
.season-squad { margin-top: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 12px 14px; border-radius: 10px; background: var(--sunk); }
.diff .k { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.diff .v { font-size: 14px; }
.snap-h { font-weight: 800; color: var(--accent-text); padding: 6px 0 4px; border-bottom: 2px solid var(--accent); }
.snap-h .muted { font-weight: 500; font-size: 13px; }
.snap-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.season { cursor: pointer; }
.season .note { margin-top: 12px; color: var(--muted); font-size: 14px; max-width: 70ch; white-space: pre-wrap; }

/* ── Saves ───────────────────────────────────────────── */
.saves-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.save-row { display: flex; align-items: center; gap: 14px; padding: 14px 14px; border-bottom: 1px solid var(--line); }
.save-row:last-child { border-bottom: 0; }
.save-row .t { font-weight: 600; }
.save-row .s { font-size: 13px; color: var(--muted); }
.save-row .acts { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.save-row.active { background: var(--accent-soft); }
.stack { display: grid; gap: 12px; }
.card-pad { padding: 16px; }
.welcome { max-width: 440px; margin: 10vh auto 0; }
.welcome h1 { font-size: 32px; font-weight: 750; letter-spacing: -0.025em; margin-bottom: 6px; }
.welcome p { color: var(--muted); margin-bottom: 22px; }

/* ── Drawer ──────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(10, 14, 11, .32); animation: fade .15s ease-out; }
.drawer { position: fixed; z-index: 51; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slide .2s cubic-bezier(.2, .8, .2, 1); }
.drawer-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.drawer-h h2 { font-size: 17px; font-weight: 650; }
.drawer-h .saved { font-size: 12.5px; color: var(--faint); margin-left: auto; }
.drawer-b { padding: 20px; overflow-y: auto; flex: 1; display: grid; gap: 18px; align-content: start; }
.drawer-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.comp-edit { display: grid; grid-template-columns: 1fr 150px 32px; gap: 6px; margin-bottom: 6px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.swatch.custom { position: relative; overflow: hidden; background: conic-gradient(#e44, #ea4, #4c4, #4ae, #84e, #e44); }
.swatch.custom input { position: absolute; inset: -8px; opacity: 0; cursor: pointer; }
.pos-edit { display: flex; flex-wrap: wrap; gap: 6px; }
.pos-pill { display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 4px 0 10px; border-radius: 8px; background: var(--sunk); font-weight: 600; font-size: 13.5px; }
.pos-pill button { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; color: var(--faint); }
.pos-pill button:hover { color: var(--ink); background: var(--line); }
.crest-edit { display: flex; align-items: center; gap: 12px; }

@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ── Toasts ──────────────────────────────────────────── */
#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; }
.toast { display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 16px; border-radius: 11px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-size: 14px; animation: fade .15s; max-width: calc(100vw - 32px); }
.toast.err { background: var(--neg); color: #fff; }
.toast button { font-weight: 650; color: inherit; padding: 4px 8px; border-radius: 6px; background: color-mix(in oklab, var(--bg) 16%, transparent); }
.toast:not(:has(button)) { padding-right: 16px; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 860px) {
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .tabs { position: fixed; bottom: 0; left: 0; right: 0; margin: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); justify-content: space-around; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tab { flex: 1; text-align: center; }
  .split, .saves-grid { grid-template-columns: 1fr; }
  .needs { position: static; }
  .switcher .nm { max-width: 46vw; }
  #toasts { bottom: 76px; }
}
@media (max-width: 640px) {
  main { padding: 20px 14px 110px; }
  .top-in { padding: 0 10px; gap: 6px; }
  .page-head h1 { font-size: 24px; }
  .crest.lg { width: 48px; height: 48px; font-size: 18px; }
  .quickadd { grid-template-columns: 1fr auto; }
  .quickadd .chips { grid-column: 1 / -1; grid-row: 2; }
  .prow { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .prow .grip { display: none; }
  .prow .foot-cell { grid-column: 2; grid-row: 1; justify-self: end; }
  .prow .elig { grid-column: 1; grid-row: 2; }
  .prow .clause { grid-column: 2; grid-row: 2; justify-self: end; }
  .prow .elig { justify-content: flex-start; }
  .pedit-grid { grid-template-columns: 1fr; }
  .group-h { top: 58px; }
  .group-h .full { display: none; }
  .squad-head { flex-wrap: wrap; row-gap: 10px; }
  .squad-title { flex: 1 1 0; flex-direction: column; gap: 0; }
  .squad-title h1 { font-size: 20px; }
  .squad-tools { margin-left: 0; width: 100%; }
  .squad-tools .search { flex: 1; }
  .squad-tools .search .input { width: 100%; }
  .addline-hint { display: none; }
  .fgroup + .fgroup { padding-left: 0; border-left: 0; }
  .toolbar > span[style] { margin-left: 0 !important; }
  .addrow.targets, .addrow.transfers { grid-template-columns: 1fr 1fr; }
  .addrow.targets .input:first-child, .addrow.transfers > .seg { grid-column: 1 / -1; }
  .addrow .flags { grid-column: 1 / -1; }
  .trow { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .trow .club, .trow .price { grid-row: 2; font-size: 13px; }
  .trow .price { text-align: right; }
  .trow .status-sel { grid-column: 2; grid-row: 1; }
  .xrow { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 12px; }
  .xrow .club { grid-column: 2; grid-row: 2; }
  .xrow .xseason { grid-column: 3; grid-row: 2; text-align: right; }
  .ledger-sum { grid-template-columns: 1fr 1fr; }
  .ledger-sum .v { font-size: 21px; }
  .season { grid-template-columns: 1fr; gap: 8px; }
  .search .input { width: 100%; }
  .search { flex: 1 1 100%; }
  .pipeline { display: grid; grid-template-columns: repeat(3, 1fr); }
  .pipeline button:nth-child(3n) { border-right: 0; }
  .pipeline button:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .sync { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── Squad header & add lines (compact) ───────────────── */
.squad-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.squad-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex-wrap: wrap; flex: 1 1 auto; }
.squad-title { flex-direction: column; gap: 2px !important; }
.squad-title h1 { font-size: 28px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.squad-title .sub { color: var(--muted); font-size: 13.5px; }
.squad-tools { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.squad-tools .search .input { width: 190px; height: 32px; }
.crest-btn .crest.xl + .crest-edit-hint { border-radius: 0 0 16px 16px; }
.crest-btn:has(.crest.xl) { border-radius: 16px; }

.addline { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 3px 8px 3px 4px; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; }
.addline-plus { color: var(--faint); display: grid; place-items: center; }
.addline-input { height: 32px; border: 0; background: transparent; outline: none; font-size: 15px; font-weight: 500; width: 100%; padding: 0; }
.addline-input::placeholder { color: var(--faint); font-weight: 400; }
.addline-hint { font-size: 12px; color: var(--faint); opacity: 0; }
.addline:focus-within { background: var(--surface); border-left-color: var(--accent); }
.addline:focus-within .addline-plus { color: var(--accent-text); }
.addline:focus-within .addline-hint { opacity: 1; }
.addline:hover:not(:focus-within) { background: color-mix(in oklab, var(--sunk) 50%, transparent); }
.qa-bulk { margin: 4px 0 6px; }
.first-hint { color: var(--muted); font-size: 13.5px; margin: 0 4px 10px; }

.addline-opts { display: flex; align-items: center; gap: 10px; opacity: .45; transition: opacity .12s; }
.addline:hover .addline-opts, .addline:focus-within .addline-opts { opacity: 1; }
.mini-seg { display: inline-flex; background: var(--sunk); border-radius: 7px; padding: 2px; gap: 1px; }
.mini-seg button { height: 24px; padding: 0 8px; border-radius: 5px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.mini-seg button:hover { color: var(--ink); }
.mini-seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.addline-go { height: 26px; width: 30px; padding: 0; }
.addline-hint { display: none; }
@media (max-width: 860px) {
  .addline { grid-template-columns: 18px minmax(0, 1fr); padding-bottom: 8px; }
  .addline-opts { grid-column: 1 / -1; flex-wrap: wrap; opacity: 1; gap: 6px; padding-left: 32px; }
  .addline:not(.active) .addline-opts { display: none; }
  .addline:not(.active) { padding-bottom: 3px; }
  .crest.xl { width: 60px; height: 60px; font-size: 22px; border-radius: 14px; }
  .squad-title h1 { font-size: 22px !important; }
}

/* ── Squad counts, sell box, replacement, first season ── */
.counts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.count-btn { font-size: 13px; color: var(--muted); padding: 2px 9px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }
.count-btn b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
button.count-btn:hover { border-color: var(--faint); }
button.count-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-text); color: var(--accent-text); }
button.count-btn[aria-pressed="true"] b { color: var(--accent-text); }
.tag.repl { color: var(--violet); background: color-mix(in oklab, var(--violet) 13%, transparent); }
.btn[aria-pressed="true"] { border-color: var(--accent-text); color: var(--accent-text); background: var(--accent-soft); }
.sellbox { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--sunk); }
.sellbox .input { height: 32px; width: 180px; }
.sellbox .hint { flex-basis: 100%; font-size: 12.5px; color: var(--muted); }
.first-season { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.first-season label { font-size: 13.5px; }
.first-season .input { width: 110px; height: 32px; }

/* ── Progress ───────────────────────────────────────────
   Attribute values use one blue ramp (magnitude); change uses
   blue up / red down with a ▲▼ glyph so it never relies on colour. */
:root { --up: #1c5cab; --down: #c2362b; --t1: #cde2fb; --t2: #9ec5f4; --t3: #3987e5; --t4: #184f95; --t1-ink: #17201a; --t2-ink: #17201a; --t3-ink: #fff; --t4-ink: #fff; --chart: #2a78d6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --up: #86b6ef; --down: #ef7b70; --t1: #1e2a3a; --t2: #1c4a85; --t3: #3987e5; --t4: #9ec5f4; --t1-ink: #c8d2de; --t2-ink: #e6edf6; --t3-ink: #fff; --t4-ink: #0d2a4f; --chart: #6da7ec; } }
:root[data-theme="dark"] { --up: #86b6ef; --down: #ef7b70; --t1: #1e2a3a; --t2: #1c4a85; --t3: #3987e5; --t4: #9ec5f4; --t1-ink: #c8d2de; --t2-ink: #e6edf6; --t3-ink: #fff; --t4-ink: #0d2a4f; --chart: #6da7ec; }

.split.prog { grid-template-columns: 250px minmax(0, 1fr); gap: 24px; }
.pl { position: sticky; top: 74px; max-height: calc(100vh - 90px); overflow-y: auto; padding-right: 4px; }
.pl-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto auto; align-items: center; gap: 6px; width: 100%; text-align: left; padding: 6px 8px; border-radius: 8px; font-size: 14px; }
.pl-item:hover { background: var(--sunk); }
.pl-item[aria-current="true"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.pl-item.overview { display: block; font-weight: 650; margin-bottom: 6px; }
.pl-pos { font-size: 11.5px; font-weight: 700; color: var(--accent-text); }
.pl-name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-n { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 1ch; text-align: right; }
.pl-d { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.pl-d.up { color: var(--up); } .pl-d.down { color: var(--down); }
.pl-miss { color: var(--warn); font-size: 9px; }
.pl-h { font-size: 12px; color: var(--faint); font-weight: 600; margin: 14px 8px 4px; }
.sec-sub { color: var(--muted); font-size: 13px; margin: -6px 0 10px; }
.pad { padding: 8px 0; }
.prog-empty { text-align: left; line-height: 1.55; max-width: 62ch; }

.prog-todo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: color-mix(in oklab, var(--warn) 10%, var(--bg)); margin-bottom: 18px; font-size: 14px; }
.todo-names { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.imp { border-top: 2px solid var(--ink); }
.imp-row { display: grid; grid-template-columns: 34px minmax(140px, 220px) minmax(0, 1fr) 56px; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.imp-row:hover { background: color-mix(in oklab, var(--sunk) 60%, transparent); }
.imp-name { font-weight: 600; }
.imp-name small { display: block; font-weight: 400; color: var(--faint); font-size: 12px; }
.imp-gains { color: var(--muted); font-size: 13.5px; }
.imp-total { text-align: right; font-weight: 750; font-size: 17px; font-variant-numeric: tabular-nums; }
.imp-total.up { color: var(--up); } .imp-total.down { color: var(--down); }

.pp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pp-head > :last-child { margin-left: auto; }
.pp-name { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; }
.pp-stats { display: flex; gap: 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.pp-stat { padding: 10px 18px 12px 4px; min-width: 130px; }
.pp-stat .k { font-size: 12.5px; color: var(--muted); }
.pp-stat .v { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pp-d { font-size: 13px; font-weight: 700; margin-left: 6px; letter-spacing: 0; }
.pp-d.up { color: var(--up); } .pp-d.down { color: var(--down); }

.pchart { position: relative; margin: 4px 0 16px; max-width: 760px; }
.pchart figcaption { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.pchart svg { width: 100%; height: auto; display: block; overflow: visible; }
.pchart .g { stroke: var(--line); stroke-width: 1; }
.pchart .yl { fill: var(--faint); font-size: 11px; text-anchor: end; font-variant-numeric: tabular-nums; }
.pchart .xl { fill: var(--muted); font-size: 11px; text-anchor: middle; }
.pchart .ln { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pchart .dot { fill: var(--chart); stroke: var(--bg); stroke-width: 2; }
.pchart .hit { fill: transparent; cursor: default; }
.pchart .pt:hover .dot, .pchart .pt:focus .dot { r: 6.5; }
.pchart .pt:focus { outline: none; }
.ptip { position: absolute; transform: translate(-50%, -100%); background: var(--ink); color: var(--bg); font-size: 12.5px; font-weight: 600; padding: 4px 8px; border-radius: 6px; pointer-events: none; white-space: nowrap; }

.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px 26px; align-items: start; }
.att-wrap { overflow-x: auto; }
.att { width: 100%; }
.grp-t { display: block; text-align: left; font-size: 13px; color: var(--accent-text); font-weight: 800; }
.foot-note { margin-top: 12px; }
.split.prog > section { min-width: 0; }
.att { border-collapse: collapse; font-size: 13.5px; min-width: 320px; }
.att th, .att td { padding: 3px 6px; }
.att thead th { position: sticky; top: 0; background: var(--bg); border-bottom: 2px solid var(--ink); }
.att .sc { text-align: left; font-size: 12px; font-weight: 650; white-space: nowrap; }
.col-btn { font-weight: 700; padding: 3px 6px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.col-btn:hover { background: var(--accent-soft); color: var(--accent-text); }
.att .grp th { text-align: left; font-size: 12px; color: var(--accent-text); font-weight: 750; padding-top: 12px; border-bottom: 1px solid var(--line); }
.att .an { text-align: left; font-weight: 500; white-space: nowrap; padding-right: 14px; color: var(--ink); }
.att tbody tr:not(.grp):hover { background: color-mix(in oklab, var(--sunk) 70%, transparent); }
.att .av { text-align: left; white-space: nowrap; min-width: 58px; }
.att .av.empty { color: var(--faint); text-align: center; }
.att .sv { text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }
.cell { display: inline-grid; place-items: center; width: 28px; height: 22px; border-radius: 5px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.cell.t1 { background: var(--t1); color: var(--t1-ink); } .cell.t2 { background: var(--t2); color: var(--t2-ink); }
.cell.t3 { background: var(--t3); color: var(--t3-ink); } .cell.t4 { background: var(--t4); color: var(--t4-ink); }
.dl { font-size: 11px; font-weight: 700; margin-left: 4px; font-variant-numeric: tabular-nums; }
.dl.up { color: var(--up); } .dl.down { color: var(--down); }
.att .tot { text-align: center; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--faint); }
.att .tot.up { color: var(--up); } .att .tot.down { color: var(--down); }

/* Snapshot editor */
.drawer.wide { width: min(860px, 100vw); }
.shot { border: 2px dashed var(--line-strong); border-radius: 12px; padding: 16px; display: grid; gap: 10px; place-items: center; text-align: center; color: var(--muted); outline: none; }
.shot:focus, .shot.over { border-color: var(--accent-text); background: var(--accent-soft); }
.shot.has { padding: 8px; }
.shot img { max-width: 100%; max-height: 340px; border-radius: 6px; }
.shot-msg { font-size: 14px; }
.linkish { color: var(--accent-text); font-weight: 600; cursor: pointer; text-decoration: underline; }
.read-note { font-size: 13.5px; padding: 8px 12px; border-radius: 8px; background: color-mix(in oklab, var(--up) 12%, var(--bg)); }
.read-note.err { background: color-mix(in oklab, var(--neg) 12%, var(--bg)); color: var(--neg); }
.snap-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px 10px; }
.snap-meta .input { height: 34px; }
.snap-count { font-size: 12.5px; }
.snap-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.sg-h { font-size: 12px; font-weight: 750; color: var(--accent-text); padding: 4px 0; border-bottom: 2px solid var(--accent); margin-bottom: 2px; }
.sg-row { display: grid; grid-template-columns: minmax(0, 1fr) 40px 30px; align-items: center; gap: 6px; padding: 2px 0; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.sg-row > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-in { width: 40px; height: 26px; text-align: center; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); font-weight: 700; font-variant-numeric: tabular-nums; outline: none; }
.sg-in:focus { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.sg-in::placeholder { color: var(--faint); font-weight: 500; }
.sg-in.bad { border-color: var(--neg); color: var(--neg); }
.sg-row.ai .sg-in { background: color-mix(in oklab, var(--up) 14%, var(--surface)); }
.sg-d .dl { margin-left: 0; }

@media (max-width: 860px) {
  .split.prog { grid-template-columns: 1fr; }
  .squad-title { min-width: 0; flex: 1 1 0 !important; }
  .squad-head { flex-wrap: nowrap; }
  .squad-head:has(.squad-tools) { flex-wrap: wrap; }
  .tab { padding: 7px 6px; font-size: 13.5px; }
  .pp-stat { min-width: 0; flex: 1 1 45%; }
  .pl { position: static; max-height: none; display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; }
  .pl-item { display: flex; white-space: nowrap; width: auto; flex: none; }
  .pl-item .pl-n, .pl-h { display: none; }
  .snap-grid { grid-template-columns: 1fr; }
  .imp-row { grid-template-columns: 30px minmax(0, 1fr) 48px; }
  .imp-gains { grid-column: 2 / 3; grid-row: 2; }
}
