:root {
  --bg: #f6f0e3;
  --panel: #fdf9f0;
  --panel-2: #efe7d6;
  --fg: #2a251e;
  --muted: #7a6f60;
  --line: #e3d9c6;
  --pos: #2f6b3a;
  --neg: #b8432f;
  --accent: #2f6b3a;
  --accent-fg: #fdf9f0;
  --accent-dim: rgba(47, 107, 58, 0.1);
  --accent-border: rgba(47, 107, 58, 0.4);
  --yes: #2f6b3a;
  --no: #b8432f;
  --neg-dim: rgba(184, 67, 47, 0.1);
  --neg-border: rgba(184, 67, 47, 0.45);
  --soft: #2f7d4f;
  --soft-dim: rgba(47, 125, 79, 0.1);
  --soft-border: rgba(47, 125, 79, 0.45);
  --warn: #c77c1a;
  --link: #1f6b66;
  --link-dim: rgba(31, 107, 102, 0.07);
  --link-border: rgba(31, 107, 102, 0.35);
  --line-text: #9a6a00;
  --nav-bg: #efe7d6;
  --track: #e8dfcc;
  --thead: #f3ecdd;
  --row-alt: #f9f4e9;
  --row-hover: #f1e9d8;
  --row-selected: #e6eedb;
  --toggle-off: #d9cfbb;
  --toggle-knob: #fdf9f0;
  --overlay: rgba(42, 37, 30, 0.35);
  --shadow: rgba(42, 37, 30, 0.18);
  --radius: 12px;
  --font: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #070807;
  --panel: #0e100e;
  --panel-2: #121512;
  --fg: #f2f5f0;
  --muted: #8a9388;
  --line: #243024;
  --pos: #2f9957;
  --neg: #ff5c6a;
  --accent: #1f7a3f;
  --accent-fg: #f2f5f0;
  --accent-dim: rgba(47, 153, 87, 0.14);
  --accent-border: rgba(47, 153, 87, 0.45);
  --yes: #2f9957;
  --no: #ff5c6a;
  --neg-dim: rgba(255, 92, 106, 0.1);
  --neg-border: rgba(255, 92, 106, 0.45);
  --soft: #34d399;
  --soft-dim: rgba(52, 211, 153, 0.1);
  --soft-border: rgba(52, 211, 153, 0.45);
  --warn: #ff9f1c;
  --link: #2dd4bf;
  --link-dim: rgba(45, 212, 191, 0.06);
  --link-border: rgba(45, 212, 191, 0.35);
  --line-text: #f5c542;
  --nav-bg: #0a0c0a;
  --track: #1a201a;
  --thead: #101310;
  --row-alt: #0c0e0c;
  --row-hover: #151a15;
  --row-selected: #1a2214;
  --toggle-off: #2a322a;
  --toggle-knob: #c5ccc0;
  --overlay: rgba(0, 0, 0, 0.45);
  --shadow: rgba(0, 0, 0, 0.4);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 14px/1.45 var(--font);
  background: var(--bg);
  color: var(--fg);
}

.app-shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}
.side-nav {
  display: flex;
  flex-direction: column;
  padding: 18px 14px 16px;
  border-right: 1px solid var(--line);
  background: var(--nav-bg);
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
}
.side-brand-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.side-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.side-link.on {
  color: var(--bg);
  background: var(--pos);
  border-color: var(--pos);
}
.side-ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.side-updated {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
}
.side-updated-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--pos);
  flex-shrink: 0;
}
.side-updated-k {
  font-weight: 700;
  color: var(--fg);
}
.side-updated-v {
  margin-top: 2px;
}
.app-main {
  min-width: 0;
  padding-bottom: 28px;
}
.top-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 12px 22px 0;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--muted); }
.theme-ico { width: 14px; height: 14px; }
.theme-ico-sun { display: none; }
:root[data-theme="dark"] .theme-ico-sun { display: inline; }
:root[data-theme="dark"] .theme-ico-moon { display: none; }
.implied-panel {
  max-width: 1080px;
}
.implied-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.implied-week {
  margin: 6px 0 0;
  color: var(--pos);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}
.implied-tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0 14px;
}
.implied-tab {
  background: var(--panel-2);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 16px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}
.implied-tab.on {
  color: var(--bg);
  background: var(--pos);
  border-color: var(--pos);
}
.implied-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 14px;
}
.implied-field {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}
.implied-field select {
  display: block;
  margin-top: 6px;
  min-width: 160px;
}
.implied-legend {
  display: flex;
  gap: 12px;
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.implied-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lg {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.lg-high { background: var(--pos); }
.lg-mid { background: var(--warn); }
.lg-low { background: var(--neg); }
.implied-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.implied-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.imp-row {
  display: grid;
  grid-template-columns: 2.2rem minmax(260px, 1.5fr) minmax(100px, 1fr) 7rem;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}
.imp-row:hover {
  border-color: var(--accent-border);
}
.imp-rank {
  font-weight: 800;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.imp-match {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: visible;
  font-weight: 700;
}
.imp-name {
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: visible;
}
.imp-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--track);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.imp-at {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  flex: 0 1 auto;
  white-space: nowrap;
}
.imp-bar-track {
  height: 12px;
  background: var(--track);
  border-radius: 999px;
  overflow: hidden;
}
.imp-bar-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 6px;
}
.imp-bar-fill.high { background: var(--pos); }
.imp-bar-fill.mid { background: var(--warn); }
.imp-bar-fill.low { background: var(--neg); }
.imp-label {
  text-align: right;
  font-weight: 800;
  color: var(--pos);
  font-variant-numeric: tabular-nums;
}
.imp-empty {
  padding: 36px 12px;
  text-align: center;
  color: var(--muted);
}
.implied-foot {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .side-nav { border-right: 0; border-bottom: 1px solid var(--line); }
  .imp-row {
    grid-template-columns: 2rem 1fr;
  }
  .imp-bar-track, .imp-label { grid-column: 1 / -1; }
  .imp-label { text-align: left; }
}

.shell {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}
.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.tabs {
  display: flex;
  gap: 8px;
  justify-self: center;
}
.tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  font: inherit;
}
.tab.on {
  color: var(--fg);
  border-color: var(--accent-border);
  background: var(--accent-dim);
}
.shell-right {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: end;
}
.btn-ledger {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font: inherit;
}
.btn-ledger[aria-expanded="true"] {
  background: var(--accent-dim);
}
.auth-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-user {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}
.btn-auth[hidden],
.auth-user[hidden],
.btn-logout[hidden],
.auth-gate[hidden] {
  display: none !important;
}
.btn-auth:hover {
  background: var(--accent-dim);
}
.btn-auth-lg {
  padding: 10px 20px;
  font-weight: 600;
}
.auth-gate {
  margin: 48px 22px;
  padding: 32px 24px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.auth-gate-msg {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
}
body.auth-locked .side-nav,
body.auth-locked .side-links,
body.auth-locked .side-updated,
body.auth-locked .filters,
body.auth-locked .hero-stack,
body.auth-locked .top-signal,
body.auth-locked main,
body.auth-locked .detail-drawer,
body.auth-locked .detail-backdrop {
  display: none !important;
}
body.auth-locked .app-shell { grid-template-columns: 1fr; }

.ledger-panel {
  margin: 0 22px;
  margin-top: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.ledger-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 8px;
  font-weight: 600;
}
.ledger-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
}
.ledger-stats dt {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.ledger-stats dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.hero-stack {
  margin: 14px 22px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-card {
  padding: 14px 16px;
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 16px;
  align-items: center;
  cursor: pointer;
}
.hero-card[hidden],
.hero-empty[hidden],
.hero-kicker[hidden] {
  display: none !important;
}
.hero-best {
  border: 2px solid var(--accent-border);
  background: linear-gradient(90deg, var(--accent-dim), transparent 60%);
}
.hero-score {
  border: 1px solid var(--line);
  background: var(--panel);
}
.hero-score.hero-best {
  border: 2px solid var(--accent-border);
  background: linear-gradient(90deg, var(--accent-dim), transparent 60%);
}
.hero-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 7.5rem;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-fg);
  background: var(--accent);
}
.hero-pill.outline {
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent-border);
}
.hero-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.hero-title {
  font-size: 15px;
  font-weight: 600;
}
.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin: 0;
  grid-column: 1 / -1;
}
.hero-best .hero-metrics {
  grid-column: auto;
}
.hero-metrics dt {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.hero-metrics dd {
  margin: 2px 0 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.hero-kicker {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  grid-column: 1 / -1;
}
.hero-memo-link {
  justify-self: start;
  grid-column: 1 / -1;
  background: transparent;
  color: var(--accent);
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
}
.hero-memo-link[hidden] {
  display: none !important;
}
.hero-empty {
  margin: 0;
  padding: 10px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}
.rec-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
}
.top-signal {
  margin: 14px 22px 0;
  padding: 14px 16px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--accent-dim), transparent 55%);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}
.top-signal-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.top-signal-mark {
  width: 10px;
  height: 10px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px transparent;
}
.top-signal-title {
  font-size: 15px;
  font-weight: 600;
}
.top-signal-metrics {
  display: flex;
  gap: 18px;
  margin: 0;
}
.top-signal-metrics div { min-width: 3.5rem; }
.top-signal-metrics dt {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.top-signal-metrics dd {
  margin: 2px 0 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 14px 22px;
  align-items: end;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.filters[hidden],
.hero-stack[hidden],
.panel[hidden],
.banner[hidden] {
  display: none !important;
}
label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
label.toggle {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--fg);
  padding-bottom: 6px;
}
label.toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.toggle-ui {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--toggle-off);
  border: 1px solid var(--line);
  position: relative;
  transition: background 0.15s ease;
}
.toggle-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--toggle-knob);
  transition: transform 0.15s ease, background 0.15s ease;
}
label.toggle input:checked + .toggle-ui {
  background: var(--accent-dim);
  border-color: var(--accent-border);
}
label.toggle input:checked + .toggle-ui::after {
  transform: translateX(16px);
  background: var(--accent);
}
input, select, button {
  background: var(--panel-2);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}
button { cursor: pointer; }
button.primary {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--fg);
}
.banner {
  margin: 12px 22px 0;
  padding: 10px 12px;
  border: 1px solid var(--neg);
  border-radius: 8px;
  color: var(--neg);
}
.panel { padding: 16px 22px 32px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
h2 { font-size: 15px; margin: 0; font-weight: 600; }
.count { margin: 0; color: var(--muted); font-size: 12px; flex: 1; }
.sort-seg {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sort-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.sort-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 12px;
}
.sort-btn.on {
  color: var(--fg);
  border-color: var(--accent-border);
  background: var(--accent-dim);
}
.banner.info {
  border-color: var(--line);
  color: var(--muted);
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--thead);
  position: sticky;
  top: 0;
}
tbody tr:nth-child(even) { background: var(--row-alt); }
tbody tr:hover { background: var(--row-hover); }
tbody tr.clickable { cursor: pointer; }
tbody tr.selected { background: var(--row-selected); }
tbody tr.alertable td:first-child {
  box-shadow: inset 2px 0 0 var(--accent);
}
.pos { color: var(--pos); font-variant-numeric: tabular-nums; }
.neg { color: var(--neg); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.match-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 3.2rem;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  color: var(--muted);
}
.match-chip.ok {
  color: var(--pos);
  border-color: var(--accent-border);
}
.match-chip.fail {
  color: var(--neg);
  border-color: var(--neg-border);
}
.liq-zero { color: var(--neg); font-variant-numeric: tabular-nums; }
.side-pill {
  display: inline-block;
  min-width: 3.2rem;
  text-align: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.side-pill.yes {
  color: var(--accent-fg);
  background: var(--yes);
}
.side-pill.no {
  color: #fff;
  background: var(--no);
}
.pager {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
.muted { color: var(--muted); }
.ledger-opens-wrap {
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.ledger-opens-wrap table { width: 100%; }
.ledger-opens-wrap th,
.ledger-opens-wrap td {
  padding: 6px 10px;
  font-size: 12px;
}

.detail-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 40;
}
.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 100%);
  height: 100%;
  overflow: auto;
  z-index: 50;
  background: var(--panel);
  border-left: 1px solid var(--accent-border);
  padding: 20px 18px 32px;
  box-shadow: -12px 0 40px var(--shadow);
}
.detail-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: 0;
  color: var(--fg);
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
}
.detail-title {
  font-size: 16px;
  margin: 8px 28px 4px 0;
}
.detail-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.detail-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 0 0 16px;
}
.detail-metrics dt {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.detail-metrics dd {
  margin: 2px 0 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.detail-skip {
  margin: 0 0 14px;
  font-size: 13px;
}

.memos-panel {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.memos-head {
  flex-wrap: wrap;
  gap: 10px 16px;
}
.memos-lede {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.memos-slate {
  display: flex;
  align-items: center;
  gap: 6px;
}
.slate-chip {
  min-width: 36px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.slate-chip.on {
  color: var(--fg);
  border-color: var(--accent-border);
  background: var(--accent-dim);
}
.memos-game {
  font-size: 12px;
  color: var(--muted);
}
.memos-game select {
  margin-left: 6px;
}
.memos-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.memo-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.memo-card.focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 1px var(--accent-dim);
}
.memo-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.memo-title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}
.memo-result {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.memo-result.win {
  color: var(--pos);
  border-color: var(--accent-border);
}
.memo-result.loss {
  color: var(--neg);
  border-color: var(--neg-border);
}
.memo-stake {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 0;
  font-variant-numeric: tabular-nums;
}
.memo-why {
  margin-top: 14px;
}
.memo-why-label {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.memo-why-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 8px 12px;
  padding: 4px 0;
  font-size: 13px;
}
.memo-why-k {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.memo-why-v {
  min-width: 0;
}
.memo-more {
  background: none;
  border: none;
  color: var(--accent);
  padding: 0;
  margin-left: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.memo-playable {
  margin: 12px 0 0;
  font-size: 13px;
}
.memo-prose {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  font-size: 13px;
}
.memo-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.memo-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.memo-chip {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}
.memo-board-btn {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.memo-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}
.memo-empty h3 {
  margin: 0 0 8px;
  color: var(--fg);
  font-size: 16px;
}
.memo-skel {
  height: 148px;
  background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%);
  background-size: 200% 100%;
  animation: memo-shimmer 1.2s linear infinite;
}
@keyframes memo-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.sheet-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}
.sheet-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}
.sheet-filters input,
.sheet-filters select {
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}
.linkish {
  background: none;
  border: 0;
  color: var(--fg);
  font: inherit;
  font-weight: 650;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.linkish:hover { color: var(--pos); }
.player-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.players-split {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.players-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}
.players-search {
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.players-list .pill-row { margin-bottom: 0; }
.pill {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.pill.on { color: var(--pos); border-color: var(--accent-border); background: var(--accent-dim); }
.player-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  background: transparent;
  color: var(--fg);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}
.player-item:hover { background: var(--panel); }
.player-item.on { background: var(--panel); border-color: var(--line); }
.player-item-name { font-weight: 650; }
.player-item-sub { color: var(--muted); font-size: 12px; }
.player-item-line { color: var(--line-text); font-size: 12px; }
.player-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.player-title { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 22px; }
.player-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.player-cards .card { margin-bottom: 0; }
.player-cards .hit-bars { margin-top: 12px; min-height: 120px; }
.player-cards .hit-col { flex: 1; }
.player-cards .hit-bar { width: 100%; max-width: 56px; }
.split-notes { margin-top: 12px; color: var(--pos); font-size: 13px; }
.split-notes p { margin: 4px 0; }
.group-row {
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.props-table td { vertical-align: middle; }
.player-chip {
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font: inherit;
}
.player-chip.on {
  border-color: var(--pos);
  color: var(--pos);
}
.player-name { margin: 0 0 8px; font-size: 22px; }
.line-block {
  margin: 12px 0 18px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.line-block h3 { margin: 0 0 10px; font-size: 15px; }
.hit-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 84px;
}
.hit-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}
.hit-bar {
  width: 18px;
  background: var(--muted);
  border-radius: 4px 4px 0 0;
}
.hit-col.over .hit-bar { background: var(--pos); }
.hit-col.under .hit-bar { background: var(--neg); }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.drill-head { flex-wrap: wrap; }
.drill-head .stat-boxes { flex: 1 1 280px; justify-content: flex-end; max-width: 100%; }
.page-title { margin: 0; font-size: 26px; font-weight: 750; letter-spacing: -0.01em; }
.page-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.btn-outline {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}
.btn-outline:hover { border-color: var(--muted); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.card-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.card-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.assist-card {
  border: 1px solid var(--link-border);
  background: var(--link-dim);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.assist-label {
  margin: 0 0 6px;
  color: var(--link);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.assist-text { margin: 0; line-height: 1.5; }
.looks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.look-list { display: flex; flex-direction: column; }
.look {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.look:first-child { border-top: 0; padding-top: 0; }
.look-title { font-weight: 650; }
.look-sub, .sub-muted { color: var(--muted); font-size: 12px; margin-top: 2px; }
.look-side { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 13px; }
.look-side .num { color: var(--muted); }
.look-side .num b { color: var(--fg); font-weight: 650; }
.link-teal {
  background: none;
  border: 0;
  padding: 0;
  color: var(--link);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.link-teal:hover { text-decoration: underline; }
.chip {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.chip-soft { color: var(--soft); border-color: var(--soft-border); background: var(--soft-dim); }
.chip-tough { color: var(--neg); border-color: var(--neg-border); background: var(--neg-dim); }
.chip-hit { color: var(--pos); border-color: var(--accent-border); background: var(--accent-dim); }
.hot { color: var(--pos); font-weight: 650; }
.cold { color: var(--neg); font-weight: 650; }
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.seg-btn {
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.on { background: var(--accent-dim); color: var(--fg); }
.matchup-list { display: flex; flex-direction: column; gap: 18px; }
.kick-group h2 { margin: 0 0 10px; color: var(--muted); font-size: 13px; font-weight: 650; }
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.game-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
}
.game-card:hover { border-color: var(--muted); }
.team-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
}
.team-logo { object-fit: contain; flex: none; }
.team-label { display: inline-flex; align-items: center; gap: 6px; }
.drill-title { display: flex; align-items: center; gap: 10px; }
.team-name { font-weight: 650; }
.team-total { font-size: 22px; font-weight: 750; }
.game-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.game-lines { display: flex; flex-direction: column; gap: 3px; }
.line-pair { display: flex; flex-wrap: nowrap; align-items: baseline; gap: 6px 14px; }
.line-split { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.line-row { display: flex; gap: 8px; white-space: nowrap; }
.line-row b { color: var(--fg); font-weight: 700; }
.sport-switch { margin: 0 12px 12px; display: flex; width: calc(100% - 24px); border-radius: 999px; }
.sport-switch .seg-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; }
.sport-switch .seg-btn + .seg-btn { border-left: 0; }
.sport-switch .seg-btn.on { background: var(--accent); color: #fff; }
.sport-ico { width: 16px; height: 16px; flex: none; }
html[data-sport="nba"] #nav-atd { display: none; }
html:not([data-sport="nba"]) #nav-dd { display: none; }
.nba-dates { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 14px; }
.nba-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--fg);
  cursor: pointer;
}
.nba-date.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.nba-date.on .sub-muted { color: inherit; }
.nba-date-k { font-size: 11px; letter-spacing: 0.04em; }
.nba-card-top, .nba-streak, .nba-streak-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nba-cols { display: grid; grid-template-columns: minmax(0, 1fr) 64px 52px 58px; align-items: center; gap: 6px; }
.nba-cols-head { margin-top: 8px; }
.nba-col { text-align: right; color: var(--muted); font-size: 11px; letter-spacing: 0.04em; }
.nba-side { padding: 6px 0; font-size: 13px; }
.nba-side .nba-col, .nba-side b.nba-col { color: var(--fg); font-size: 13px; font-weight: 650; }
.nba-side-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nba-side-id { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.nba-side-line { display: flex; align-items: center; gap: 6px; }
.nba-side-id .sub-muted { font-size: 11px; }
.nba-pace { margin-top: 8px; }
.nba-chip {
  border: 1px solid var(--warn);
  color: var(--warn);
  border-radius: 999px;
  padding: 0 6px;
  font-size: 11px;
}
.nba-streaks { display: flex; flex-direction: column; gap: 8px; }
.nba-band { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.nba-streak {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.hit-good { color: var(--pos); }
.nba-person { display: flex; align-items: center; gap: 8px; }
.nba-head { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--line); }
.nba-player { max-width: 760px; }
.nba-player-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.nba-photo-lg { width: 72px; height: 72px; }
.nba-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.nba-stat { min-width: 64px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--panel-2); }
.nba-stat span { display: block; color: var(--muted); font-size: 11px; letter-spacing: 0.04em; }
.nba-stat b { font-size: 18px; }
.nba-bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; margin: 8px 0 14px; }
.nba-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; color: var(--muted); font-size: 10px; }
.nba-bar { display: block; width: 100%; max-width: 22px; background: var(--accent); border-radius: 3px 3px 0 0; }
.nba-bar.over { background: var(--pos); }
.nba-log { width: 100%; border-collapse: collapse; font-size: 13px; }
.nba-log th, .nba-log td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.nba-log th { color: var(--muted); font-size: 11px; font-weight: 650; }
.rate-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 16px;
}
.rate-mark { color: var(--pos); font-weight: 750; }
.rate-k { color: var(--muted); font-size: 13px; font-weight: 600; }
.hit-pill, .hit-pill-btn {
  display: inline-flex;
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--accent-dim);
  color: var(--pos);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.hit-pill-btn { cursor: pointer; }
.proj-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-weight: 700;
}
.proj-row { margin: 0 0 8px; }
.chip-gap { color: var(--warn); border-color: var(--warn); }
.ex-badge, .nav-new {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--pos);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.nav-new { margin-left: auto; }
.side-link.on .nav-new { color: inherit; background: transparent; }
.td-rate { color: var(--pos); font-weight: 750; }
.td-bar {
  height: 4px;
  margin-top: 4px;
  border-radius: 99px;
  background: var(--pos);
  max-width: 72px;
}
.crumb { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.stat-boxes { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-box {
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--panel);
}
.stat-box .card-label { margin: 0 0 4px; }
.stat-box b + .card-label { margin-top: 8px; }
.stat-box b { font-size: 16px; }
.drill-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.total-row:first-of-type { border-top: 0; padding-top: 0; }
.total-row .team-total { font-size: 26px; }
.def-cell { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.def-cell .sub-muted { margin: 0; }
.th-sort { cursor: pointer; }
.player-sub { color: var(--muted); font-size: 11px; }
@media (max-width: 1000px) {
  .looks-grid, .drill-grid, .player-cards, .players-split { grid-template-columns: 1fr; }
  .players-list { position: static; max-height: none; }
}
@media print {
  .side-nav, .top-bar, .sheet-filters, #sheet-print, .assist-card { display: none !important; }
  .app-shell { display: block; }
  body { background: #fff; color: #111; }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .tabs, .shell-right { justify-self: start; }
  .hero-card,
  .top-signal {
    grid-template-columns: 1fr;
  }
  .ledger-stats { grid-template-columns: 1fr 1fr; }
  .col-extra { display: none; }
  .memos-panel { max-width: none; }
  .memo-why-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
