/* =========================================================================
   Sports Card Tracker — main.css
   "Vibrant / approachable" polish pass. Chunky cards, pill tabs, saturated
   signal colors, soft blue glow on hover, Inter for the typography, and
   a very subtle radial background wash.

   All class names and element IDs match the original markup so the JS
   still binds without changes.
   ========================================================================= */

/* ---------- Fonts ----------
   Inter + Permanent Marker are loaded together via <link rel="stylesheet">
   in index.html (alongside fonts.googleapis preconnects). Putting them in
   index.html keeps the request parallel with main.css instead of waiting
   on a chained @import. */

/* ---------- Design tokens (light mode) ---------- */
:root {
  /* Signal palette (saturated, modern) */
  --color-buy:        #059669;  /* emerald-600 */
  --color-buy-strong: #10B981;  /* emerald-500 */
  --color-buy-bg:     #ECFDF5;  /* emerald-50 */
  --color-buy-ring:   rgba(16, 185, 129, 0.18);

  --color-sell:        #E11D48;  /* rose-600 */
  --color-sell-strong: #F43F5E;  /* rose-500 */
  --color-sell-bg:     #FFF1F2;  /* rose-50 */
  --color-sell-ring:   rgba(244, 63, 94, 0.18);

  --color-hold:        #D97706;  /* amber-600 */
  --color-hold-strong: #F59E0B;  /* amber-500 */
  --color-hold-bg:     #FFFBEB;  /* amber-50 */
  --color-hold-ring:   rgba(245, 158, 11, 0.18);

  --color-accent:        #2D68C4;  /* royal blue, gemmint primary */
  --color-accent-strong: #1F4FA0;  /* deeper royal blue */
  --color-accent-bg:     #EBF2FB;  /* light blue tint */
  --color-accent-ring:   rgba(45, 104, 196, 0.22);
  --color-navy:          #003D62;  /* deepest brand tone, used for VIP + tagline */

  --color-purple:     #0891B2;  /* cyan-600 — secondary accent (compare/marketplace) */
  --color-purple-bg:  #ECFEFF;  /* cyan-50 */
  --color-purple-ring: rgba(8, 145, 178, 0.18);

  /* Surfaces */
  --bg:            #F8FAFC;
  --bg-wash-1:     rgba(45, 104, 196, 0.06);  /* royal blue tint for the page wash */
  --bg-wash-2:     rgba(0, 61, 98, 0.04);  /* navy tint */
  --surface:       #FFFFFF;
  --surface-raised:#FFFFFF;
  --surface-sunken:#F1F5F9;

  /* Text */
  --text:       #0F172A;  /* slate-900 */
  --text-muted: #475569;  /* slate-600 */
  --text-dim:   #94A3B8;  /* slate-400 */

  /* Lines */
  --border-color: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --border:  1px solid var(--border-color);

  /* Shadows — soft, layered */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06),
               0 1px 1px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06),
               0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.10),
               0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-accent-glow: 0 12px 32px rgba(45, 104, 196, 0.18),
                        0 2px 6px rgba(45, 104, 196, 0.10);

  /* Radii (chunkier) */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 9999px;

  /* Spacing (unchanged, was already good) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* Motion */
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 140ms;
  --dur-med:  220ms;
  --dur-slow: 360ms;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
               Consolas, monospace;

  /* Gradients used in a few branded spots */
  --grad-brand: linear-gradient(135deg, #2D68C4 0%, #003D62 100%);
  --grad-buy:   linear-gradient(135deg, #10B981 0%, #059669 100%);
  --grad-sell:  linear-gradient(135deg, #F43F5E 0%, #E11D48 100%);
  --grad-hold:  linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  --grad-strength: linear-gradient(90deg, #F43F5E 0%, #F59E0B 50%, #10B981 100%);
}

/* ---------- Dark mode ---------- */
/* Driven by the data-theme attribute (set in index.html before paint),
   NOT the OS preference — the app defaults to dark for everyone. */
:root[data-theme="dark"] {
    --color-buy:        #34D399;
    --color-buy-strong: #10B981;
    --color-buy-bg:     rgba(16, 185, 129, 0.14);
    --color-buy-ring:   rgba(52, 211, 153, 0.28);

    --color-sell:        #FB7185;
    --color-sell-strong: #F43F5E;
    --color-sell-bg:     rgba(244, 63, 94, 0.14);
    --color-sell-ring:   rgba(251, 113, 133, 0.28);

    --color-hold:        #FBBF24;
    --color-hold-strong: #F59E0B;
    --color-hold-bg:     rgba(245, 158, 11, 0.14);
    --color-hold-ring:   rgba(251, 191, 36, 0.28);

    --color-accent:        #6B97E0;
    --color-accent-strong: #4F84D6;
    --color-accent-bg:     rgba(45, 104, 196, 0.18);
    --color-accent-ring:   rgba(167, 139, 250, 0.32);
    --color-navy:          #6B97E0;  /* softer in dark mode for VIP/tagline contrast */

    --color-purple:     #22D3EE;
    --color-purple-bg:  rgba(0, 61, 98, 0.15);
    --color-purple-ring: rgba(34, 211, 238, 0.28);

    --bg:             #0B1120;
    --bg-wash-1:      rgba(45, 104, 196, 0.14);
    --bg-wash-2:      rgba(0, 61, 98, 0.08);
    --surface:        #111827;
    --surface-raised: #1F2937;
    --surface-sunken: #0B1120;

    --text:       #F1F5F9;
    --text-muted: #94A3B8;
    --text-dim:   #64748B;

    --border-color:  rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.40),
                 0 1px 1px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45),
                 0 2px 4px rgba(0, 0, 0, 0.30);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55),
                 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-accent-glow: 0 16px 36px rgba(167, 139, 250, 0.22),
                          0 2px 8px rgba(167, 139, 250, 0.18);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  /* Soft radial wash — subtle brand tint in the corners, NOT a solid color. */
  background-image:
    radial-gradient(1000px 600px at 0% -10%,  var(--bg-wash-1), transparent 65%),
    radial-gradient(800px 500px at 100% 0%,   var(--bg-wash-2), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-accent-ring);
  border-radius: var(--radius-md);
}

input, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}
a:hover { text-decoration: underline; }

::selection {
  background: var(--color-accent-bg);
  color: var(--color-accent-strong);
}

/* ---------- Layout ---------- */
.app-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-7);
}

/* ---------- Header ---------- */
.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.app-title {
  font-size: 30px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: var(--grad-brand);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.app-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 6px 0 0;
  max-width: 52ch;
}

/* Screen-reader-only utility — kept for the visually hidden h1 that still
   provides a single accessible page heading even though the visible brand
   is the SVG logo. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Hobby VIP logo ------------------------------------------------
   The same inline SVG is embedded in two places (page header + auth overlay)
   so its styling lives in one rule block. Card stack uses the brand accent
   ramp; the wordmark inherits the page text color so it stays readable in
   both light and dark mode. VIP and the tagline use the deepest brand tone
   so they read as a single accent system. */
.hv-logo {
  display: block;
  width: 200px;
  height: auto;
  flex-shrink: 0;
}
/* Card is always white-filled with a navy stroke, both light and dark
   modes. White card + G icon makes the mark read as a single emblem
   on any background. */
.hv-logo .hv-card-front {
  fill: #FFFFFF;
  stroke: var(--color-accent);
  stroke-width: 1.5;
}
/* Front-card mark: Gem Mint Club's official G icon, bundled locally at
   assets/gmc-g.png and embedded via <image href="assets/gmc-g.png">.
   Same asset is used by the header, auth overlay, full-lockup SVG, and
   favicon — pixel-perfect sister-brand tie-in so anyone bouncing between
   hobbyvip.com and gemmintclub.com sees the same emblem. */
/* "Hobby VIP" wordmark — Permanent Marker face for a hand-drawn / signed-
   memorabilia feel. Font is loaded via the <link> in index.html so the
   logo renders fresh on first paint (no FOIT). Letter-spacing is loosened
   slightly on VIP since marker faces already have casual letter widths;
   any more spacing makes "VIP" look detached. The INVEST SMARTER tagline
   stays in clean sans for legibility — marker on a 12px line gets muddy.

   Color note: Permanent Marker's natural strokes are thinner than a real
   sans-serif at the same size, so `var(--text)` (slate-900 in light mode)
   reads softer than expected. We override to brand navy in light mode for
   solid contrast, and bright slate in dark mode. */
.hv-logo .hv-wm {
  font-family: 'Permanent Marker', 'Marker Felt', cursive;
  font-weight: 400;
  font-size: 42px;
  fill: var(--color-navy, #003D62);
  letter-spacing: 0;
}
:root[data-theme="dark"] .hv-logo .hv-wm { fill: #F1F5F9; }
.hv-logo .hv-vip {
  letter-spacing: 1.5px;
  fill: var(--color-accent);
}
.hv-logo .hv-tag {
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
  font-weight: 500;
  font-size: 12px;
  fill: var(--color-accent);
  letter-spacing: 3px;
}

/* Auth overlay variant — slightly larger and centered. */
.auth-card .hv-logo.auth-logo {
  width: 240px;
  margin: 0 auto 12px;
}

/* ---------- Top-level group nav ----------
   Visually distinct from the sub-tab pills below: text-only, larger,
   with an underline on the active item. Reads more like a section
   heading than a button — exactly what we want for "what part of the
   app am I in" hierarchy.

   The contrast with .nav-tabs (which keep the pill look) is the whole
   point: groups = heavyweight section, sub-tabs = secondary navigation. */
.nav-groups {
  display: flex;
  gap: var(--space-5);
  margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}
.nav-group {
  position: relative;
  padding: 12px 4px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  margin-bottom: -1px; /* lets the active underline overlap the row's bottom border */
  transition: color var(--dur-fast) var(--ease-smooth);
}
.nav-group:hover:not(.active) {
  color: var(--text);
}
.nav-group.active {
  color: var(--color-accent);
}
.nav-group.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--grad-brand);
  border-radius: 3px 3px 0 0;
}

/* ---------- Nav tabs (pill style) ----------
   Secondary navigation under the bold group nav above. Keeps the
   familiar pill look so the hierarchy reads "groups → tabs". */
.nav-tabs {
  display: inline-flex;
  gap: var(--space-1);
  padding: 4px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  margin-top: var(--space-3);
  margin-bottom: var(--space-5);
  overflow-x: auto;
  max-width: 100%;
}

/* Hide sub-tabs that don't belong to the active group. Visibility is
   set per-button by app.js via the `in-active-group` class — we keep
   the DOM in place so a deep-link tab switch doesn't have to re-render
   the whole nav. */
.nav-tab[data-group]:not(.in-active-group) {
  display: none;
}

.nav-tab {
  position: relative;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-smooth),
              background var(--dur-fast) var(--ease-smooth),
              transform var(--dur-fast) var(--ease-spring);
}

.nav-tab:hover:not(.active) {
  color: var(--text);
  background: var(--surface-sunken);
}

.nav-tab:active:not(.active) {
  transform: scale(0.97);
}

.nav-tab.active {
  color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 4px 12px rgba(45, 104, 196, 0.28),
              0 1px 2px rgba(45, 104, 196, 0.20);
}

.nav-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: inherit;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.nav-tab:not(.active) .nav-tab-count {
  background: var(--color-accent-bg);
  color: var(--color-accent);
}

/* Sport-filter context bar — left-aligned chip row that sits between the
   sub-tab nav and the active tab panel. Visually distinct from the
   blue-pill primary nav above: square corners, outlined, uppercase
   tracked-out caps, charcoal active state. Reads as a "category filter"
   rather than another row of navigation pills.

   Only the row matching the active tab is rendered (via the
   `in-active-tab` class set by app.js); everything else is display:none.
   The bar collapses entirely on tabs with no row (Top picks, Trends,
   Sell Calendar, Budget, WC 2026).

   Visibility selectors use the two-class form so they outweigh the
   later `.sport-pills { display: inline-flex }` rule. */
.tab-context-bar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: var(--space-4);
  min-height: 0;
}
.tab-context-bar:empty,
.tab-context-bar:not(:has(.in-active-tab)) {
  margin-bottom: 0;
}
.tab-context-bar .tab-context-row { display: none; }
.tab-context-bar .tab-context-row.in-active-tab { display: inline-flex; }

/* Filter-chip restyle: lose the pill shape, the brand-gradient on
   active, the rounded container — those all read as "navigation."
   Replace with square chips, hold-amber accent on hover, and a dark
   charcoal active state for unambiguous contrast. */
.tab-context-bar .sport-pills {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  gap: 8px;
  margin-bottom: 0;
}
.tab-context-bar .sport-pills button {
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-smooth),
              border-color var(--dur-fast) var(--ease-smooth),
              background var(--dur-fast) var(--ease-smooth),
              transform var(--dur-fast) var(--ease-spring);
}
.tab-context-bar .sport-pills button:hover:not(.active) {
  color: var(--color-hold);
  border-color: var(--color-hold);
  background: var(--color-hold-bg);
}
.tab-context-bar .sport-pills button:active:not(.active) {
  transform: scale(0.97);
}
.tab-context-bar .sport-pills button.active {
  color: #fff;
  background: #1F2937;       /* slate-800 — fixed so dark mode doesn't invert to white-on-white */
  border-color: #1F2937;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.20);
}

/* In-tab sport sub-menu — pill-row replacement for the old .sport-toggle
   that lived in the header. Each tab panel renders its own row of these
   so the user filters per-tab instead of via a single global toggle. */
.sport-pills {
  display: inline-flex;
  align-items: center;
  border: var(--border);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 2px;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.sport-pills button {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-smooth),
              color var(--dur-fast) var(--ease-smooth),
              transform var(--dur-fast) var(--ease-spring);
}
.sport-pills button:hover:not(.active) {
  color: var(--text);
  background: var(--surface-sunken);
}
.sport-pills button:active:not(.active) {
  transform: scale(0.96);
}
.sport-pills button.active {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 4px 10px rgba(45, 104, 196, 0.24);
}

@media (max-width: 720px) {
  .sport-pills {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sport-pills::-webkit-scrollbar { display: none; }
  .sport-pills button { flex: 0 0 auto; padding: 7px 14px; }
}

/* ---------- Tab panel ---------- */
.tab-panel { display: none; }
.tab-panel.active {
  display: block;
  animation: panel-in var(--dur-med) var(--ease-smooth);
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Toolbar (filters row) ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.toolbar label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.toolbar select,
.toolbar input[type="range"] {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text);
  font-weight: 500;
  transition: border-color var(--dur-fast) var(--ease-smooth),
              box-shadow var(--dur-fast) var(--ease-smooth);
  box-shadow: var(--shadow-xs);
}

.toolbar select:hover {
  border-color: var(--border-strong);
}

.toolbar select:focus-visible {
  border-color: var(--color-accent);
}

/* ---------- Player search ---------- */
.player-search {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 1 1 280px;
  min-width: 220px;
  max-width: 420px;
}

.player-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
  opacity: 0.7;
}

.player-search input[type="search"] {
  flex: 1;
  width: 100%;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 9px 34px 9px 34px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-fast) var(--ease-smooth),
              box-shadow var(--dur-fast) var(--ease-smooth);
  -webkit-appearance: none;
  appearance: none;
}

.player-search input[type="search"]::-webkit-search-decoration,
.player-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.player-search input[type="search"]::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.player-search input[type="search"]:hover {
  border-color: var(--border-strong);
}

.player-search input[type="search"]:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 25%, transparent);
}

.player-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background var(--dur-fast) var(--ease-smooth),
              color var(--dur-fast) var(--ease-smooth);
}

.player-search-clear:hover {
  background: color-mix(in srgb, var(--text) 10%, transparent);
  color: var(--text);
}

.player-search-clear:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

/* ---------- Cross-sport search hint ---------- */
.search-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: 10px 14px;
  background: color-mix(in srgb, var(--color-accent) 7%, var(--surface));
  border: 1px dashed color-mix(in srgb, var(--color-accent) 40%, transparent);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.search-hint[hidden] {
  display: none;
}

.search-hint-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.search-hint-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--color-accent) 45%, transparent);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-smooth),
              border-color var(--dur-fast) var(--ease-smooth),
              transform var(--dur-fast) var(--ease-spring);
}

.search-hint-btn:hover {
  background: color-mix(in srgb, var(--color-accent) 12%, var(--surface));
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

.search-hint-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.search-hint-btn .search-hint-count {
  color: var(--text-muted);
  font-weight: 500;
}

/* ---------- Metric cards ---------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

/* Phase 4 (#55) — Personalized "Today for you" dashboard at the top
   of the Sports tab. Four-tile glance row + a recent-news strip.
   Hidden entirely until the user has watchlist or inventory data. */
.today-dashboard {
  margin: 0 0 var(--space-5);
  padding: var(--space-4) var(--space-5);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--color-buy-bg) 60%, var(--surface)) 0%,
    var(--surface) 100%);
  border: var(--border);
  border-radius: var(--radius-xl);
}

/* =========================================================================
 * Phase 12 — Today tab "What this app does" pillar banner. Three cards
 * mapping to the user's three principles; clicking any pillar jumps to
 * the relevant tab. Dismissible — collapsed users see a small "Show
 * app overview" restore link instead.
 * ========================================================================= */
.today-pillars {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
}
.today-pillars-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.today-pillars-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.today-pillars-dismiss {
  background: transparent;
  border: none;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.today-pillars-dismiss:hover {
  color: var(--text);
  background: var(--surface-sunken);
}
.today-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}
.today-pillar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3);
  background: var(--surface-sunken);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font: inherit;
  transition: transform var(--dur-fast) var(--ease-spring),
              border-color var(--dur-fast) var(--ease-smooth),
              background var(--dur-fast) var(--ease-smooth);
}
.today-pillar:hover {
  transform: translateY(-1px);
  border-color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 4%, var(--surface-sunken));
}
.today-pillar:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.today-pillar-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.today-pillar-research .today-pillar-step { background: var(--color-buy, #16a34a); }
.today-pillar-sell .today-pillar-step     { background: var(--color-sell, #dc2626); }
.today-pillar-track .today-pillar-step    { background: var(--color-accent); }

.today-pillar-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.today-pillar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.today-pillar-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.today-pillar-cta {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-accent);
}

.today-pillars-collapsed {
  margin-bottom: var(--space-3);
  text-align: center;
}
.today-pillars-restore {
  background: transparent;
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.today-pillars-restore:hover {
  color: var(--text);
  border-color: var(--color-accent);
}

/* Phase 12 — Backtest KPI tooltip info mark. A subtle "ⓘ" next to the
   metric label hints that the card is hoverable for a translation of
   the data-engineering term into hobbyist language. */
.metric-label-info {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
  opacity: 0.6;
  cursor: help;
  vertical-align: 2px;
}
.metric-card:hover .metric-label-info {
  opacity: 1;
  color: var(--color-accent);
}

/* Phase 12 — "Why" driver chips above the expand fold on player cards.
   Compact row of the top-2 factors so a scanner can read why a card
   is a BUY without clicking. The full 7-factor breakdown still lives
   inside the expanded detail panel. */
.player-why-row {
  margin: var(--space-2) 0 0 0;
  padding: 6px 0 0 0;
  border-top: 1px dashed var(--border-color);
}
.player-why-row .factor-drivers {
  margin: 0;
  gap: 6px;
}
.player-why-row .factor-driver {
  font-size: 11px;
}
.player-card.is-collapsed .player-why-row {
  display: flex;
}
.player-card.is-expanded .player-why-row {
  /* When expanded the full driver block is visible inside the detail
     panel — suppress the preview row to avoid duplicate chips. */
  display: none;
}
.today-dashboard-header {
  margin-bottom: var(--space-3);
}
.today-dashboard-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.today-dashboard-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
.today-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
}
.today-tile {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, box-shadow 0.12s;
}
.today-tile.clickable {
  cursor: pointer;
}
.today-tile.clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.today-tile-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.today-tile-value {
  font-size: 22px;
  font-weight: 700;
  margin: 4px 0 2px;
  color: var(--text);
  line-height: 1.1;
}
.today-tile.positive .today-tile-value { color: var(--color-buy); }
.today-tile.negative .today-tile-value { color: var(--color-sell); }
.today-tile-sub {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* News strip under the tiles. */
.today-dashboard-news {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-color);
}
.today-dashboard-news-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.today-dashboard-news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.today-news-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 6px 8px;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  font-size: 12px;
  transition: background 0.12s;
}
.today-news-link:hover {
  background: var(--surface-sunken);
}
.today-news-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.today-news-text {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.today-news-when {
  color: var(--text-dim);
  font-size: 10px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .today-dashboard {
    padding: var(--space-3);
  }
  .today-dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Inline signal badge inside the sub-line — tighter than the page badges. */
.today-tile-sub .signal-badge {
  display: inline-block;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  vertical-align: middle;
}

/* Phase 4 (#62) — Buy/Sell action lists below the tiles.
   Two-column grid (stacks on mobile). Each column has a colored
   header (buy = green, sell = red) and a list of up-to-5 rows. */
.today-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.today-action-col {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4) var(--space-4);
  box-shadow: var(--shadow-sm);
}
.today-action-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 var(--space-2);
}
.today-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
}
.today-action-header-buy .today-action-icon {
  background: var(--color-buy-bg);
  color: var(--color-buy);
}
.today-action-header-sell .today-action-icon {
  background: var(--color-sell-bg);
  color: var(--color-sell);
}
.today-action-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex: 1;
}
.today-action-count {
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.today-action-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.today-action-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}
.today-action-row:hover {
  background: var(--surface-sunken);
}
.today-action-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}
.today-action-name-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.today-action-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.today-action-signal .signal-badge-xs {
  font-size: 10px;
  padding: 2px 7px;
  white-space: nowrap;
}
.today-action-empty {
  list-style: none;
  padding: var(--space-3);
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  text-align: center;
}

/* Phase 4 (#59) — Deals tab. Table of recent low prints across
   watched + owned cards. Each row is clickable (jumps to player)
   except the eBay-sold link which opens externally. */
.deals-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.deals-summary {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}
.deals-table-wrap {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-xl);
  overflow: visible;
  margin-bottom: var(--space-5);
}
.deals-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.deals-table .th,
.deals-table .td {
  padding: 10px 12px;
  vertical-align: middle;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.deals-table tr:last-child .td { border-bottom: 0; }
.deals-table .th {
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.deals-table .th-num, .deals-table .td-num { text-align: right; }
.deals-table .th-actions, .deals-table .td-actions { text-align: right; }

.deals-row {
  cursor: pointer;
  transition: background 0.12s;
}
.deals-row:hover { background: var(--surface-sunken); }

.deals-player-cell {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
}
.deals-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}
.deals-player-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.deals-player-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.deals-discount-pct {
  display: block;
  font-weight: 700;
  color: var(--color-buy);
  font-size: 14px;
  line-height: 1.1;
}
.deals-discount-abs {
  font-size: 11px;
}
.deals-when {
  display: block;
  font-size: 12px;
}
.deals-when-iso {
  display: block;
  font-size: 10px;
}

.deals-source-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  margin-right: 4px;
}
.deals-source-watchlist {
  background: var(--color-buy-bg);
  color: var(--color-buy);
}
.deals-source-inventory {
  background: var(--surface-sunken);
  color: var(--text-muted);
}

.btn-sm {
  font-size: 11px;
  padding: 4px 10px;
}

/* Phase 4 (#57 + #64) — Ask AI entry point + hint banner.
   The Ask AI button replaces the prior tiny ✨ icon — it's now a
   labeled pill button so the feature is discoverable at a glance. */
.inv-ask-ai {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--color-buy) 18%, var(--surface)) 0%,
    color-mix(in srgb, var(--color-buy) 6%, var(--surface)) 100%);
  border: 1px solid var(--color-buy-ring);
  color: var(--color-buy);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
  white-space: nowrap;
}
.inv-ask-ai:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px var(--color-buy-ring);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--color-buy) 28%, var(--surface)) 0%,
    color-mix(in srgb, var(--color-buy) 12%, var(--surface)) 100%);
}
.ai-spark {
  font-size: 13px;
  line-height: 1;
}
.ai-label {
  letter-spacing: 0.02em;
}

/* Inline 90-day price-trend chart inside each expanded player card
   / list row. Replaces the legacy single chart at the bottom of the
   Players tab — now the chart lives with the data, no scrolling to
   find it. Canvas is initialised in the expand handler in
   signals.js so off-screen cards don't pay for Chart.js. */
.player-trend {
  margin: var(--space-3) 0 var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-sunken);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}
.player-trend-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.player-trend-canvas-wrap {
  position: relative;
  height: 160px;
  width: 100%;
}
.player-trend-canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Hide the legacy bottom-of-tab trend section. The container is
   still in index.html (in case any deep link tries to scroll to it),
   it just doesn't render. */
#signals-trend-wrap {
  display: none !important;
}

/* Phase 5 (#61) — Performance stats panel inside the expanded player
   detail. Shows the underlying numbers that drive the perf factor —
   xwOBA for MLB, PER/USG% for NBA, EPA/play for NFL, form rating for
   SOC. Same visual language as the player-trend block: sunken surface
   inside the detail, tiny uppercase title, grid of compact stat cells.

   Each cell wears a native `title` tooltip explaining what the stat
   means (e.g. "League avg ~.320, elite ≥.400") so the reader doesn't
   need to know what xwOBA is to interpret the value.
*/
.perf-stats {
  margin: var(--space-3) 0 var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-sunken);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}
.perf-stats-title {
  margin: 0 0 var(--space-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.perf-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 6px;
}
.perf-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: help;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.perf-stat:hover {
  border-color: var(--color-accent);
  background: var(--surface-raised);
}
.perf-stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.perf-stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Phase 5e (#61) — 30-day forecast summary block. Sits between the
   perfStats grid and the inline trend chart. Mirrors the sunken-
   surface visual language so the expanded card's lower sections all
   feel like one consistent panel. */
.forecast-summary {
  margin: var(--space-3) 0 var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-sunken);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}
.forecast-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
}
.forecast-summary-title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.forecast-confidence {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-pill, 999px);
  cursor: help;
}
.forecast-confidence-high {
  background: var(--color-buy-bg, rgba(59, 109, 17, 0.15));
  color: var(--color-buy, #3B6D11);
}
.forecast-confidence-medium {
  background: var(--color-hold-bg, rgba(133, 79, 11, 0.15));
  color: var(--color-hold, #854F0B);
}
.forecast-confidence-low {
  background: var(--color-accent-bg, #EBF2FB);
  color: var(--text-muted);
}
.forecast-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.forecast-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.forecast-stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.forecast-stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Watchlist CTA on Players cards. Replaces the tiny ★/☆ icon with a
   labeled pill button so the action surfaces clearly. Inactive state
   uses the brand blue; active ("is-watching") flips to filled green
   so the user sees confirmation that the player is on the list. */
.btn-watch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-accent);
  background: var(--surface);
  color: var(--color-accent);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, transform 0.12s, box-shadow 0.12s;
  white-space: nowrap;
}
.btn-watch:hover {
  background: var(--color-accent);
  color: var(--surface);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.btn-watch.is-watching {
  background: var(--color-buy-bg);
  border-color: var(--color-buy);
  color: var(--color-buy);
}
.btn-watch.is-watching:hover {
  background: var(--color-buy);
  color: var(--surface);
}

/* Hint banner above the inventory table — calls out the new
   AI feature without taking too much vertical space. */
.ai-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--color-buy) 8%, var(--surface));
  border: 1px solid var(--color-buy-ring);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  margin: 0;
}
.ai-hint strong {
  color: var(--color-buy);
  font-weight: 700;
}

/* Modal tab nav (Phase 4 #64). Three large clickable tabs across the
   top of the body — each tab shows a label + a one-line description so
   the user knows what they'll get before clicking. */
.ai-tab-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: var(--space-3) var(--space-4) 0;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border-color);
}
.ai-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px 12px;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}
.ai-tab:hover {
  background: color-mix(in srgb, var(--color-buy-bg) 30%, transparent);
}
.ai-tab.active {
  background: var(--surface);
  border-bottom-color: var(--color-buy);
}
.ai-tab-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.ai-tab-sub {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}
.ai-tab.active .ai-tab-label {
  color: var(--color-buy);
}

/* Catalysts list — used in the long-term tab. */
.listing-catalysts {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.listing-catalysts li {
  margin-bottom: 4px;
}

/* Phase 4 (#57) — AI listing modal. Spinner + 4-section result body
   styled for an at-a-glance review. Uses the existing .modal-card
   .modal-wide overlay container so we don't add a second mount point. */
.listing-modal {
  max-width: 720px;
}
.listing-modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5) var(--space-4);
}
.listing-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
  color: var(--text-muted);
}
.listing-loading p {
  margin: 0;
  font-size: 13px;
}
.listing-loading-sub {
  font-size: 11px;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--surface-sunken);
  border-top-color: var(--color-buy);
  border-radius: 50%;
  animation: listing-spin 0.8s linear infinite;
}
@keyframes listing-spin { to { transform: rotate(360deg); } }

.listing-error {
  padding: var(--space-4);
  text-align: center;
}
.listing-error h4 {
  margin: 0 0 var(--space-2);
  color: var(--color-sell);
}

.listing-section {
  background: var(--surface-sunken);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
}
.listing-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
}
.listing-section-header h4 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.listing-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.listing-description, .listing-strategy {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.listing-price-band {
  display: flex;
  gap: var(--space-3);
}
.listing-price-tier {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-color);
  flex: 1;
  text-align: center;
}
.listing-price-tier .muted {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.listing-price-tier .mono {
  font-size: 16px;
  font-weight: 700;
}
.listing-price-mid {
  background: var(--color-buy-bg);
  border-color: var(--color-buy-ring);
}
.listing-price-mid .mono { color: var(--color-buy); }

.listing-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}
.listing-disclaimer {
  font-size: 11px;
  margin: 0;
}
.listing-modal-actions {
  display: flex;
  gap: var(--space-2);
}

/* Empty-state when the user has no watchlist + no inventory yet.
   First-time landing on the Today tab. */
.today-empty {
  margin: 0 0 var(--space-5);
}
.today-empty-card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-5) var(--space-4);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.today-empty-card h2 {
  margin: 0 0 var(--space-3);
  font-size: 22px;
  font-weight: 700;
}
.today-empty-card p {
  margin: 0 0 var(--space-3);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}
.today-empty-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-3);
}
.today-empty-actions .btn {
  font-size: 13px;
  padding: 8px 16px;
}


/* Phase 4 (#56) — Collection movers section on Inventory tab. Two
   columns (30d / 5d), each with Top 3 + Worst 3 sub-blocks. Rows
   are clickable and route to the Players tab. */
/* ----- Phase 8 — Sell-priority recommendations panel ------------------
 *
 * Sits above the existing Collection movers section on the My
 * Collection tab. Top-N owned cards ranked by sell-urgency score
 * (signal × seasonal × realized gain). Wired in renderSellPriorities()
 * in inventory.js; scoring in sell-priorities.js.
 * --------------------------------------------------------------------- */
.sell-priorities-section {
  margin: 16px 0 8px;
}
.sell-rec-header {
  margin-bottom: 8px;
}
.sell-rec-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.sell-rec-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}
.sell-rec-portfolio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 10px 12px;
  margin: 10px 0;
  background: var(--surface-sunken);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 12px;
}
.sell-rec-portfolio-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sell-rec-portfolio-cell strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.sell-rec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sell-rec-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  align-items: center;
  cursor: pointer;
  transition: background 120ms ease;
}
.sell-rec-row:hover {
  background: rgba(255, 255, 255, 0.04);
}
.sell-rec-rank {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  align-self: start;
  padding-top: 2px;
}
.sell-rec-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.sell-rec-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sell-rec-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.sell-rec-card-meta {
  font-size: 11px;
}
.sell-rec-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.sell-rec-reason {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid transparent;
}
.sell-rec-reason-positive {
  background: rgba(14, 164, 122, 0.12);
  color: #6ee7b7;
  border-color: rgba(14, 164, 122, 0.25);
}
.sell-rec-reason-negative {
  background: rgba(148, 163, 184, 0.10);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.25);
}
.sell-rec-tenure {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 3px;
}
.sell-rec-tenure.long {
  background: rgba(14, 164, 122, 0.18);
  color: #6ee7b7;
}
.sell-rec-tenure.short {
  background: rgba(217, 119, 6, 0.18);
  color: #fbbf24;
}
.sell-rec-money {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-variant-numeric: tabular-nums;
  min-width: 110px;
}
.sell-rec-value {
  font-weight: 700;
  font-size: 14px;
}
.sell-rec-cost {
  font-size: 11px;
}
.sell-rec-net {
  font-size: 12px;
  font-weight: 600;
}

.movers-section {
  margin: 0 0 var(--space-6);
}
.movers-section-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}

/* Phase 12 — Movers section header is now a clickable toggle that
   collapses the panel by default. The "Top to sell next 30 days"
   panel above is the primary action surface; Movers is "interesting
   reading" — defer until the user opts in. The single 30-day column
   replaces the dual 30d/5d split (5d was mostly noise for cards held
   weeks-to-months). */
.movers-header {
  margin-bottom: var(--space-3);
}
.movers-toggle {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-2);
  align-items: center;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-sunken);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font: inherit;
  transition: background var(--dur-fast) var(--ease-smooth);
}
.movers-toggle:hover {
  background: color-mix(in srgb, var(--color-accent) 6%, var(--surface-sunken));
}
.movers-chev {
  display: inline-block;
  font-size: 14px;
  color: var(--text-muted);
  transition: transform var(--dur-fast) var(--ease-spring);
}
.movers-toggle.is-collapsed .movers-chev {
  transform: rotate(-90deg);
}
.movers-hint {
  font-size: 11px;
  text-align: right;
}
.movers-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr);
  gap: var(--space-4);
}
.movers-grid.is-collapsed {
  display: none;
}

/* =========================================================================
 * Phase 12 — Inventory "Sell now" CTA pill.
 *
 * Sits at the top of the filter bar above the table. Lives next to the
 * grading filter but is visually elevated (accent color, count badge,
 * larger touch target) because for any user with cards currently in
 * window it's the single most actionable filter on this tab.
 * ========================================================================= */
.inventory-filter-bar {
  align-items: center;
  gap: var(--space-3);
}
.inventory-sellnow-slot {
  display: inline-flex;
}
.sellnow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-sell, #dc2626);
  color: #fff;
  border: 2px solid var(--color-sell, #dc2626);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.25);
  transition: transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-fast) var(--ease-smooth),
              background var(--dur-fast) var(--ease-smooth);
}
.sellnow-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}
.sellnow-pill:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.sellnow-pill-icon {
  font-size: 14px;
}
.sellnow-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.sellnow-pill.is-active {
  background: #fff;
  color: var(--color-sell, #dc2626);
  border-color: var(--color-sell, #dc2626);
}
.sellnow-pill.is-active .sellnow-pill-count {
  background: var(--color-sell, #dc2626);
  color: #fff;
}
.sellnow-pill-clear {
  margin-left: 4px;
  font-size: 16px;
  font-weight: 700;
  opacity: 0.7;
}
.sellnow-pill:hover .sellnow-pill-clear {
  opacity: 1;
}

/* Phase 12 — Dashboard sell-column "Hide stagnant / Show again" toggle.
   Small ghost button that sits to the right of the count badge. */
.today-stagnant-toggle {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-smooth),
              border-color var(--dur-fast) var(--ease-smooth);
}
.today-stagnant-toggle:hover {
  color: var(--text);
  border-color: var(--color-accent);
}
.today-stagnant-toggle.is-hiding {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* Phase 12 — "Stagnant cards" tray below the Sell Calendar grid.
   Visually distinct from the calendar itself (muted background, no
   accent color) since these cards are NOT on the calendar grid —
   they're a parking lot for opportunity-cost candidates. */
.cal-stagnant-tray {
  margin: var(--space-5) 0 0;
  padding: var(--space-4) var(--space-5);
  background: var(--surface-sunken);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
}
.cal-stagnant-header {
  margin-bottom: var(--space-3);
}
.cal-stagnant-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}
.cal-stagnant-sub {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.5;
  max-width: 720px;
}
.cal-stagnant-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}
.cal-stagnant-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-smooth),
              transform var(--dur-fast) var(--ease-spring);
}
.cal-stagnant-row:hover {
  border-color: var(--color-accent);
  transform: translateY(-1px);
}
.cal-stagnant-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}
.cal-stagnant-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cal-stagnant-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-stagnant-sub {
  font-size: 11px;
}
.cal-stagnant-more {
  grid-column: 1 / -1;
  text-align: center;
  padding: 6px 0;
}
.cal-stagnant-more a {
  font-size: 12px;
  color: var(--color-accent);
  text-decoration: none;
}
.cal-stagnant-more a:hover {
  text-decoration: underline;
}

/* Phase 13 — Per-gate diagnostic shown inside the empty-state tray.
   Tells the user how close the collection is to producing stagnant
   entries without waiting for time to drift cards across the line. */
.cal-stagnant-diag {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border-color);
}
.cal-stagnant-diag-sub {
  margin: 0 0 var(--space-2);
  font-size: 12px;
  line-height: 1.5;
}
.cal-stagnant-diag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 4px 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.cal-stagnant-diag-list li {
  padding: 2px 0;
}
.cal-stagnant-diag-count {
  display: inline-block;
  min-width: 26px;
  text-align: right;
  margin-right: 4px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.movers-col {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4) var(--space-4);
  box-shadow: var(--shadow-sm);
}
.movers-col-title {
  margin: 0 0 var(--space-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.movers-block + .movers-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}
.movers-block-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.movers-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.movers-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
.movers-row:hover {
  background: var(--surface-sunken);
}
.movers-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}
.movers-name-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.movers-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}
.movers-delta {
  font-size: 12px;
  font-weight: 600;
  min-width: 60px;
  text-align: right;
}
.movers-pnl {
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}
.movers-pnl .muted {
  font-size: 10px;
  margin-left: 2px;
}

.metric-card {
  position: relative;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-fast) var(--ease-smooth);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad-brand);
  opacity: 0.9;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin: 0 0 var(--space-2);
}

.metric-value {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.metric-value.small { font-size: 20px; font-weight: 700; }

.metric-delta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-1);
  font-weight: 500;
}

/* ---------- Player grid ---------- */
.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

/* =========================================================================
 * Signals-tab BUY / HOLD / SELL collapsible sections (Phase 11)
 *
 * Three stacked sections, each with a clickable header (badge + title +
 * count + chevron). Body holds the existing player-grid render. BUY is
 * open by default on first visit; HOLD + SELL collapse until clicked.
 * ========================================================================= */
.signals-sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.signals-section {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-smooth);
}
.signals-section.is-open {
  border-color: var(--color-accent-ring);
}
.signals-section-header {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: var(--space-3);
  align-items: center;
  width: 100%;
  padding: var(--space-3) var(--space-5);
  background: var(--surface-sunken);
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font: inherit;
  transition: background var(--dur-fast) var(--ease-smooth);
}
.signals-section-header:hover {
  background: color-mix(in srgb, var(--color-accent) 6%, var(--surface-sunken));
}
.signals-section-header:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}
.signals-section-badge {
  font-size: 12px;
  padding: 4px 12px;
}
.signals-section-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.signals-section-count {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.signals-section-chev {
  display: inline-block;
  font-size: 14px;
  color: var(--text-muted);
  transition: transform var(--dur-fast) var(--ease-spring);
}
.signals-section.is-closed .signals-section-chev {
  transform: rotate(-90deg);
}
.signals-section-body {
  padding: var(--space-4) var(--space-5);
}
.signals-section-empty {
  margin: var(--space-2) 0;
  font-size: 13px;
}
.signals-section-grid {
  /* Inherit .player-grid layout from the original rule (auto-fill 300px).
     The dedicated class lets us tweak section-specific spacing without
     touching the .player-grid rule that other tabs reuse. */
  margin-bottom: 0;
}

/* ---- List-view BUY/HOLD/SELL sections (Phase 11 follow-up) ----
 * The list view renders ONE table with three <tbody> groups. The
 * section-header row spans every column; the data rows below it
 * disappear when the tbody carries the .is-closed class so the
 * collapse animation stays smooth and only affects the rows the
 * user came to scan. */
.signals-list-section-header > td {
  padding: 0;
  background: var(--surface-sunken);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
.signals-list-section-toggle {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: var(--space-3);
  align-items: center;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font: inherit;
  transition: background var(--dur-fast) var(--ease-smooth);
}
.signals-list-section-toggle:hover {
  background: color-mix(in srgb, var(--color-accent) 6%, transparent);
}
.signals-list-section-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}
/* Reuse the .signals-section-badge / .signals-section-title /
   .signals-section-count / .signals-section-chev styles from above
   so list view and grid view look identical at the header level. */

/* Hide all rows in a closed tbody EXCEPT the header row that carries
   the toggle button. tr's display: none works reliably in tables. */
.signals-list-section.is-closed > tr:not(.signals-list-section-header) {
  display: none;
}

/* The chevron rotates 90 degrees when the section is closed, same as
   the grid view. The base .signals-section-chev rule already declares
   the transition + open-state position — we only need the closed
   transform here, scoped to the list-section variant so the grid
   selector keeps working. */
.signals-list-section.is-closed .signals-section-chev {
  transform: rotate(-90deg);
}

/* Phase 1D — Players-tab section header (h2 + view toggle pills).
   Reuses the .section-title h2 styles below but lays out a pill row
   on the right edge of the same flex row. */
.players-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}
.players-section-header .section-title {
  margin: 0;
}

/* Grid/List view toggle pill row (Phase 1D) */
.signals-view-toggle {
  display: inline-flex;
  background: var(--surface-sunken);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.signals-view-pill {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.signals-view-pill:hover {
  color: var(--text);
}
.signals-view-pill.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Hide the Sort dropdown when in list mode (column headers replace it). */
body.signals-view-list label:has(#filter-sort) {
  display: none;
}

/* Players table (list view) ================================================ */
.players-list {
  display: block;          /* override .player-grid's display:grid */
  margin-bottom: var(--space-6);
}
.players-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  /* overflow:visible — was 'hidden' to clip rounded corners, but that
     also clipped chip tooltips (the ::after popovers) inside rows.
     We achieve rounded corners via clipping the corner cells below
     instead, which doesn't trap descendant absolutely-positioned
     elements. */
  overflow: visible;
}
/* Clip the corner cells so the table's rounded border isn't broken
   by sharp cell backgrounds bleeding out. */
.players-table thead tr:first-child .th:first-child {
  border-top-left-radius: var(--radius-xl);
}
.players-table thead tr:first-child .th:last-child {
  border-top-right-radius: var(--radius-xl);
}
.players-table tbody tr:last-child .td:first-child {
  border-bottom-left-radius: var(--radius-xl);
}
.players-table tbody tr:last-child .td:last-child {
  border-bottom-right-radius: var(--radius-xl);
}
.players-table .th,
.players-table .td {
  padding: 10px 12px;
  vertical-align: middle;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.players-table .th {
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  user-select: none;
  white-space: nowrap;
}
.players-table .th-num,
.players-table .td-num {
  text-align: right;
}
.players-table .th-sortable {
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.players-table .th-sortable:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-sunken) 60%, var(--surface));
}
.players-table .th[aria-sort] {
  color: var(--text);
}
.players-table .sort-indicator {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
}

/* Column widths — keep Player + Drivers flexible, lock numeric/icon
   columns to natural sizes so prices and changes line up. */
.players-table .th-signal,    .players-table .td-signal    { width: 110px; white-space: nowrap; }
.players-table .th-name,      .players-table .td-name      { min-width: 180px; }
.players-table .th-price,     .players-table .td-price     { width: 78px; }
.players-table .th-change,    .players-table .td-change    { width: 78px; }
.players-table .th-spark,     .players-table .td-spark     { width: 120px; }
.players-table .th-factors,   .players-table .td-factors   { min-width: 240px; }
.players-table .th-news,      .players-table .td-news      { width: 38px; text-align: center; }
.players-table .th-actions,   .players-table .td-actions   { width: 70px; text-align: right; white-space: nowrap; }

.players-row {
  background: var(--surface);
  transition: background 0.12s;
  cursor: pointer;
}
.players-row:hover {
  background: var(--surface-sunken);
}
.players-row.is-expanded {
  background: var(--surface-sunken);
}
.players-row:last-of-type .td {
  border-bottom: 0;
}

.players-row-name {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.players-row-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.signal-strength-mini {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: var(--text-muted);
}
.players-row-news-link {
  display: inline-block;
  text-decoration: none;
  font-size: 16px;
  line-height: 1;
  color: var(--color-buy);
  transition: transform 0.12s;
}
.players-row-news-link:hover {
  transform: scale(1.2);
}
.players-row-expand .chev {
  display: inline-block;
  transition: transform 0.15s;
}
.players-row.is-expanded .players-row-expand .chev {
  transform: rotate(180deg);
}

/* Detail row appears below an expanded data row. Spans every column
   via colspan="8"; we render a content wrapper inside so the inner
   padding can breathe regardless of the table cell paddings. */
.players-row-detail-row {
  background: var(--surface-sunken);
}
.players-row-detail-row > td {
  padding: 0 !important;
  border-bottom: 1px solid var(--border-color);
}
.players-row-detail {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.players-row-detail-section h4 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}

/* Tighten the factor-driver chips inside list rows so the
   top-3 fits the .td-factors column without overflowing. */
.players-table .td-factors .factor-drivers {
  gap: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.players-table .td-factors .factor-driver {
  font-size: 10px;
}
.players-table .td-factors .factor-driver-label {
  padding: 2px 6px 2px 8px;
}
.players-table .td-factors .factor-driver-value {
  padding: 2px 8px 2px 4px;
}

/* Mobile: collapse the table to a stacked card layout — keeps the
   list view usable on narrow screens without horizontal scroll. */
@media (max-width: 760px) {
  .players-table .th-spark,
  .players-table .td-spark,
  .players-table .th-factors,
  .players-table .td-factors,
  .players-table .th-news,
  .players-table .td-news {
    display: none;
  }
  .players-table .th-name,
  .players-table .td-name {
    min-width: 0;
  }
}

.player-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-med) var(--ease-spring),
              box-shadow var(--dur-med) var(--ease-smooth),
              border-color var(--dur-fast) var(--ease-smooth);
  overflow: hidden;
}

.player-card::after {
  /* top-edge hint that strengthens on hover */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease-smooth);
}

.player-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-accent-glow);
  border-color: var(--color-accent-ring);
}

.player-card:hover::after { opacity: 1; }

.player-card.in-watchlist {
  border-color: var(--color-buy-ring);
  background:
    linear-gradient(180deg, var(--color-buy-bg) 0%, var(--surface) 36%);
}

.player-card.in-watchlist::after {
  background: var(--grad-buy);
  opacity: 1;
}

.player-card.in-compare {
  border-color: var(--color-purple-ring);
  background:
    linear-gradient(180deg, var(--color-purple-bg) 0%, var(--surface) 36%);
}

.player-card.in-compare::after {
  background: linear-gradient(135deg, #003D62 0%, #2D68C4 100%);
  opacity: 1;
}

.player-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.player-name {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.player-org {
  font-size: 12px;
  color: var(--text-muted);
  margin: 3px 0 0;
  font-weight: 500;
}

.player-price-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.player-card.is-collapsible .player-price {
  font-size: 22px;
}

.player-price {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

/* Phase 7 — "INDEX" pill placed before the $ value so the user reads it
 * as "INDEX $45.20" rather than just "$45.20". Same visual treatment as
 * other small uppercase chips elsewhere in the app. */
.player-index-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  align-self: center;
  text-transform: uppercase;
}
/* Rebased level ("Lvl 124.3") rendered next to the $ value. Subtler than
 * the index pill so the dollar value stays the primary read. */
.player-index-level {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted, #9ca3af);
  font-variant-numeric: tabular-nums;
}

.player-change {
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums;
}

.player-change.positive {
  color: var(--color-buy);
  background: var(--color-buy-bg);
}

.player-change.negative {
  color: var(--color-sell);
  background: var(--color-sell-bg);
}

.price-source-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-muted, #9ca3af);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: help;
  margin-left: auto;
}

.price-source-badge.stale {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
}

.new-today-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, #2D68C4, #003D62);
  color: white;
  vertical-align: middle;
}

/* --- Player change neutral state (no baseline yet) ----------------------- */
.player-change.neutral {
  color: var(--color-text-muted, #9ca3af);
  background: rgba(255, 255, 255, 0.04);
}

/* --- Inline SVG sparkline ------------------------------------------------ */
.player-spark {
  display: block;
  width: 100%;
  height: 36px;
  margin: 4px 0 8px;
  overflow: visible;
}
.player-spark polyline {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.player-spark.positive polyline { stroke: var(--color-buy); }
.player-spark.negative polyline { stroke: var(--color-sell); }

.player-spark-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  margin: 4px 0 8px;
  font-size: 11px;
  color: var(--color-text-muted, #9ca3af);
  font-style: italic;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.06);
}

/* --- Card actions promoted to header ------------------------------------ */
.player-card-title { flex: 1; min-width: 0; }
.player-card-actions-top {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

/* --- Collapsible cards (Signals tab) ------------------------------------
   The default view is a tight, name/price/spark-only summary. Clicking
   the header or the chevron reveals .player-card-detail with actions,
   factors, signal strength, news, and marketplace links. */
.player-card.is-collapsible { gap: var(--space-2); padding: var(--space-4); }
.player-card.is-collapsible .player-card-header { cursor: pointer; }
.player-card.is-collapsible .player-card-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-1);
}
.player-card.is-collapsed .player-card-detail { display: none; }

.player-card-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.icon-btn.icon-btn-sm {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

/* Inline sparkline inside the always-visible price row, smaller than the
   stand-alone sparkline below it. SVG fills the leftover horizontal space. */
.player-spark-inline { flex: 1; min-width: 60px; }
.player-spark-inline .player-spark { width: 100%; max-width: 100%; height: 26px; display: block; }
.player-spark-inline .player-spark-placeholder {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: right;
}

/* The chevron on the right of the price row. Rotates 180° when expanded. */
.card-expand-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.card-expand-toggle:hover {
  background: rgba(45, 104, 196, 0.08);
  color: var(--color-accent);
  border-color: var(--color-accent-ring);
}
.card-expand-toggle .chev {
  display: inline-block;
  transition: transform 0.18s var(--ease-smooth, ease);
  line-height: 1;
  font-size: 12px;
}
.player-card.is-expanded .card-expand-toggle .chev { transform: rotate(180deg); }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text, #e5e7eb);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}
.icon-btn:active { transform: scale(0.95); }
.icon-btn.active {
  background: rgba(45, 104, 196, 0.18);
  border-color: rgba(45, 104, 196, 0.4);
  color: #c4b5fd;
}

/* --- Marketplace popover (details/summary) ------------------------------- */
.marketplace-popover {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}
.marketplace-popover > summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted, #9ca3af);
  user-select: none;
}
.marketplace-popover > summary::-webkit-details-marker { display: none; }
.marketplace-popover[open] > summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--color-text, #e5e7eb);
}
.marketplace-popover .marketplace-links {
  padding: 8px 12px 12px;
}
.marketplace-popover .marketplace-links-label {
  display: none; /* the summary already labels the section */
}

/* --- Card variants disclosure (card-level signals, Phase 6) ------------- */
/*
 * Inside the expanded player card detail: a "View N variants ▾" disclosure
 * that lists each tracked card with its own price, 30d change, signal
 * pill, and a mini sparkline. Only renders when the player has 2+ cards
 * (rendered as '' for single-card players to keep the card tight).
 */
.card-variants {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}
.card-variants > summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted, #9ca3af);
  user-select: none;
}
.card-variants > summary::-webkit-details-marker { display: none; }
.card-variants[open] > summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--color-text, #e5e7eb);
}
.card-variants-list {
  list-style: none;
  margin: 0;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-variant-row {
  display: grid;
  /* Label column gets a guaranteed min-width so it doesn't collapse to
   * a 2-character truncation when the spark column carries a wide
   * "Building baseline" placeholder. Sparkline column is capped via
   * .card-variant-spark { overflow: hidden } so its placeholder text
   * can't push the label down further. */
  grid-template-columns: minmax(140px, 1fr) auto auto auto 100px auto;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
}

/* Per-card mini-star inside the variants disclosure. Slightly smaller
 * than the .icon-btn-sm used in the player-card header so the variant
 * row stays compact. */
.icon-btn.icon-btn-xs {
  width: 24px;
  height: 24px;
  font-size: 14px;
  padding: 0;
  line-height: 1;
}

/* "Variant: Bowman Chrome 1st" pill shown in the alerts dropdown for
 * non-primary card alerts so the user can tell which variant fired. */
.alerts-row-variant {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  vertical-align: middle;
}
.card-variant-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text, #e5e7eb);
}
.card-variant-primary {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  font-weight: 600;
}

/* Phase 7 — tiered variants. The disclosure becomes a 2-level list:
 * outer = tier sections (Base / Mid / Elite), inner = raw + graded
 * variants. Tier header shows label, weight in the index, and the
 * blended tier price. */
.card-variant-tiers {
  list-style: none;
  margin: 0;
  padding: 4px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card-variant-tier {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-variant-tier-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding: 4px 12px 0;
  font-size: 12px;
}
.card-variant-tier-label {
  font-weight: 700;
  color: var(--color-text, #e5e7eb);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}
.card-variant-tier-meta {
  font-size: 11px;
  font-weight: 500;
}

/* Tiny "RAW" / "PSA 10" chip prefixed to each variant row's label so the
 * user can scan condition without parsing the long card label. */
.card-variant-cond {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}
.card-variant-cond-raw {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}
.card-variant-cond-graded {
  background: rgba(250, 204, 21, 0.18);
  color: #fde68a;
}
.card-variant-price {
  font-variant-numeric: tabular-nums;
  color: var(--color-text, #e5e7eb);
}
.card-variant-change {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  text-align: right;
  min-width: 56px;
}
.card-variant-change .positive { color: var(--color-positive, #10b981); }
.card-variant-change .negative { color: var(--color-negative, #ef4444); }
.card-variant-spark {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  /* Keep wide placeholder text ("Building baseline (1/2)") from
   * pushing the label column to a 2-character truncation. */
  overflow: hidden;
  min-width: 0;
  font-size: 11px;
  color: var(--color-text-muted, #9ca3af);
}
.card-variant-spark svg { width: 100px; height: 22px; }
/* When the variant has < 2 history snapshots, sparklineHTML returns
 * a "Building baseline (N/2)" placeholder div. Compact it so it fits
 * the 100px column and doesn't squeeze the label. */
.card-variant-spark .player-spark-placeholder {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: right;
  color: var(--color-text-muted, #9ca3af);
}

/* Compact signal-badge variant for the per-card row. Same colors as the
 * main .signal-badge, smaller padding + font so it fits in a 12px row. */
.signal-badge.signal-badge-xs {
  padding: 1px 6px;
  font-size: 10px;
  letter-spacing: 0.04em;
  height: auto;
  line-height: 1.3;
  border-radius: 4px;
}

/* --- Top-signal metric tile is clickable -------------------------------- */
.metric-card.clickable {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.metric-card.clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Player-card flash highlight when the user jumps to it from the top tile */
@keyframes flash-highlight {
  0%   { box-shadow: 0 0 0 2px rgba(45, 104, 196, 0.7), 0 0 24px rgba(45, 104, 196, 0.4); }
  100% { box-shadow: 0 0 0 2px rgba(45, 104, 196, 0), 0 0 24px rgba(45, 104, 196, 0); }
}
.player-card.flash { animation: flash-highlight 1.6s ease-out; }

/* --- Mobile pass --------------------------------------------------------- */
@media (max-width: 720px) {
  .app-header { flex-direction: column; align-items: stretch; gap: 12px; }
  /* (the old .sport-toggle mobile rules lived here — that toggle moved
     into per-tab .sport-pills, which has its own mobile handling.) */
  .nav-groups {
    /* Three groups on a phone: shrink the gap, smaller font, but keep
       the underlined-section-heading visual language. */
    gap: var(--space-3);
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-groups::-webkit-scrollbar { display: none; }
  .nav-group {
    padding: 11px 4px;
    font-size: 15px;
    flex: 0 0 auto;
  }
  /* On mobile, the right-aligned sport context bar is too cramped to
     stay right-aligned with everything else stacking vertically. Pull
     it left for breathing room. */
  .tab-context-bar { justify-content: flex-start; }
  .nav-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-tab { white-space: nowrap; flex: 0 0 auto; }
  .player-grid { grid-template-columns: 1fr !important; }
  .player-card { padding: 12px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { padding: 12px; }
  .toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .toolbar > label,
  .toolbar > .player-search { flex: 1 1 100%; }
  .filter-checkbox { font-size: 13px; }
}

.filter-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  cursor: pointer;
}
.filter-checkbox input { margin: 0; }

/* Rank pill */
.rank-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--color-accent-bg);
  color: var(--color-accent);
}

.rank-pill.top {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 2px 6px rgba(45, 104, 196, 0.22);
}

.rank-pill.mid {
  background: var(--color-hold-bg);
  color: var(--color-hold);
}

/* Young-star tier — MLB players who already debuted, distinct from the
   pre-debut prospect tiers (top / mid / default-low). Uses the secondary
   cyan accent so they read as "different category" rather than "ranked
   somewhere in prospect-land." */
.rank-pill.young-star {
  background: var(--color-purple-bg);
  color: var(--color-purple);
  border: 1px solid var(--color-purple-ring);
}

/* Factor tags */
.factor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.factor-tag {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-sunken);
  border: 1px solid var(--border-color);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-weight: 500;
}

/* Factor drivers (Phase 1C) — small two-part pills showing the
   top-3 factors driving a card's signal under the user's current
   risk tier. Polarity = green for positive contribution (pushes
   BUY) and red for negative (pushes SELL). The label half is a
   muted background, the value half is tinted by polarity so the
   reader's eye lands on the number. */
.factor-drivers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.factor-driver {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: var(--radius-pill);
  overflow: visible;       /* allow ::after tooltip to escape the chip's rounded clip */
  border: 1px solid var(--border-color);
  background: var(--surface-sunken);
  cursor: help;
  position: relative;      /* anchor for ::after tooltip */
}

/* CSS-only tooltip — fires on hover or keyboard focus. Avoids the
   native browser title attribute, which has a 500ms delay and gets
   suppressed in some Chrome configurations. The tooltip text comes
   from the chip's data-tooltip attribute (set in signals.js). */
.factor-driver::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 400;
  width: max-content;
  max-width: 280px;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  z-index: 50;
}
.factor-driver:hover::after,
.factor-driver:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Tooltip arrow — small triangle below the bubble pointing at the chip. */
.factor-driver::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--surface-raised);
  filter: drop-shadow(0 1px 0 var(--border-strong));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 50;
}
.factor-driver:hover::before,
.factor-driver:focus-visible::before {
  opacity: 1;
}
.factor-driver-label {
  padding: 3px 8px 3px 10px;
  color: var(--text-muted);
  /* Inner halves are pointer-transparent so hover lands on the
     outer .factor-driver — that's where the title attribute lives
     for the native browser tooltip. Without this, Chrome and
     Safari can fail to find the parent's title and the tooltip
     never shows. */
  pointer-events: none;
}
.factor-driver-value {
  padding: 3px 10px 3px 6px;
  font-weight: 600;
  pointer-events: none;
}
.factor-driver-positive {
  border-color: var(--color-buy-ring);
  background: var(--color-buy-bg);
}
.factor-driver-positive .factor-driver-label { color: var(--color-buy); }
.factor-driver-positive .factor-driver-value { color: var(--color-buy); }
.factor-driver-negative {
  border-color: var(--color-sell-ring);
  background: var(--color-sell-bg);
}
.factor-driver-negative .factor-driver-label { color: var(--color-sell); }
.factor-driver-negative .factor-driver-value { color: var(--color-sell); }
.factor-driver-neutral {
  /* zero contribution — shouldn't show up in top-3 in practice but
     keep the style defined for completeness. */
  color: var(--text-muted);
}

/* Phase 2 — hold-window chip. Renders alongside the signal badge in
   both grid and list views. kind drives the color: pre-debut +
   until-peak are buy-side (green), sell-now + sell-by are sell-side
   (orange). Neutral kinds aren't rendered (filtered upstream). */
.hold-window-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px 3px 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background: var(--surface-sunken);
  white-space: nowrap;
  cursor: help;
  position: relative;
}
.hold-window-chip-icon {
  font-size: 11px;
  opacity: 0.7;
}
.hold-window-chip-pre-debut,
.hold-window-chip-until-peak {
  background: var(--color-buy-bg);
  border-color: var(--color-buy-ring);
  color: var(--color-buy);
}
.hold-window-chip-sell-now,
.hold-window-chip-sell-by {
  background: var(--color-sell-bg);
  border-color: var(--color-sell-ring);
  color: var(--color-sell);
}
.hold-window-chip-sm {
  font-size: 10px;
  padding: 2px 7px 2px 5px;
}

/* Hold-window detail block — shown inside the expanded panel of
   both the grid card and the list row. Chip on the left, prose on
   the right; collapses to stacked on mobile. */
.hold-window-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.hold-window-detail-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  flex: 1 1 240px;
}

/* Tooltip on hover/focus — same CSS-only pattern as factor-driver
   chips so the UX is consistent. Bubble appears above the chip with
   a small arrow. */
.hold-window-chip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 400;
  width: max-content;
  max-width: 280px;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  z-index: 50;
}
.hold-window-chip:hover::after,
.hold-window-chip:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.hold-window-chip::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--surface-raised);
  filter: drop-shadow(0 1px 0 var(--border-strong));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 50;
}
.hold-window-chip:hover::before,
.hold-window-chip:focus-visible::before {
  opacity: 1;
}

/* Grid view: stack the signal pill + hold chip vertically in the
   player-card header so the chip sits right under the pill. */
.signal-badge-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* List view: stack the signal badge + strength line and put the
   hold chip on its own line below. */
.td-signal-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.td-signal-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Compact variant: small inline chips in the per-variant rows
   inside the cards disclosure. The variant rows are tight on
   space so we drop a tier in size/padding. */
.factor-drivers.factor-driver-sm .factor-driver {
  font-size: 10px;
}
.factor-drivers.factor-driver-sm .factor-driver-label {
  padding: 2px 6px 2px 8px;
}
.factor-drivers.factor-driver-sm .factor-driver-value {
  padding: 2px 8px 2px 4px;
}

/* Variant row driver slot — drop onto a new line below the row's
   primary grid since the variant row uses a strict grid layout. */
.card-variant-drivers {
  grid-column: 1 / -1;
  margin-top: 4px;
}

/* Strength bar */
.strength-bar {
  height: 8px;
  background: var(--surface-sunken);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.strength-bar-fill {
  height: 100%;
  background: var(--grad-strength);
  border-radius: var(--radius-pill);
  transition: width var(--dur-slow) var(--ease-spring);
}

.strength-bar-fill.buy  { background: var(--grad-buy); }
.strength-bar-fill.sell { background: var(--grad-sell); }
.strength-bar-fill.hold { background: var(--grad-hold); }

.strength-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 500;
}

.strength-row strong {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Card action buttons */
.card-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-1);
}

.btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-sunken);
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-smooth),
              color var(--dur-fast) var(--ease-smooth),
              border-color var(--dur-fast) var(--ease-smooth),
              transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-fast) var(--ease-smooth);
  white-space: nowrap;
}

.btn:hover {
  background: var(--color-accent-bg);
  color: var(--color-accent-strong);
}

.btn:active { transform: scale(0.97); }

.btn.primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(45, 104, 196, 0.22);
}

.btn.primary:hover {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 8px 20px rgba(45, 104, 196, 0.32);
  transform: translateY(-1px);
}

.btn.primary:active { transform: translateY(0) scale(0.98); }

.btn.danger {
  color: var(--color-sell);
  background: transparent;
  border-color: var(--color-sell-ring);
}

.btn.danger:hover {
  background: var(--color-sell-bg);
  color: var(--color-sell);
}

/* ---------- Signal badge ---------- */
.signal-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  position: relative;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.signal-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.9;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.signal-badge.buy  { background: var(--grad-buy); }
.signal-badge.sell { background: var(--grad-sell); }
.signal-badge.hold { background: var(--grad-hold); }

/* ---------- Section headings ---------- */
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.02em;
}

.section-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin: -8px 0 var(--space-4);
}

/* ---------- Seasonal grid / heatmap ---------- */
.seasonal-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.seasonal-cell {
  position: relative;
  aspect-ratio: 1 / 1.05;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 72px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-fast) var(--ease-smooth);
}

.seasonal-cell:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.seasonal-cell.buy {
  background: linear-gradient(160deg, var(--color-buy-bg), var(--surface));
  border-color: var(--color-buy-ring);
}

.seasonal-cell.sell {
  background: linear-gradient(160deg, var(--color-sell-bg), var(--surface));
  border-color: var(--color-sell-ring);
}

.seasonal-cell.neutral {
  background: var(--surface-sunken);
}

.seasonal-month {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.seasonal-cell.buy .seasonal-month,
.seasonal-cell.buy .seasonal-index { color: var(--color-buy); }

.seasonal-cell.sell .seasonal-month,
.seasonal-cell.sell .seasonal-index { color: var(--color-sell); }

.seasonal-index {
  font-size: 18px;
  font-weight: 800;
  align-self: flex-end;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ---------- Alerts feed ---------- */
.alert-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-fast) var(--ease-smooth),
              border-color var(--dur-fast) var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.alert-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--color-accent);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-smooth);
}

.alert-row:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--color-accent-ring);
}

.alert-row:hover::before { opacity: 1; }

.alert-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(45, 104, 196, 0);
  transition: box-shadow var(--dur-med) var(--ease-smooth);
}

.alert-dot.buy  { background: var(--color-buy);  box-shadow: 0 0 0 3px var(--color-buy-ring); }
.alert-dot.sell { background: var(--color-sell); box-shadow: 0 0 0 3px var(--color-sell-ring); }
.alert-dot.hold { background: var(--color-hold); box-shadow: 0 0 0 3px var(--color-hold-ring); }

.alert-text { flex: 1; font-size: 14px; }
.alert-text strong { font-weight: 700; }

.alert-time {
  color: var(--text-dim);
  font-size: 12px;
  margin-left: auto;
  white-space: nowrap;
  font-weight: 500;
}

/* ---------- Trend chart container ---------- */
.trend-container {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.trend-container .chart-wrap { height: 300px; position: relative; }

.trend-empty {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: var(--space-6);
}

/* ---------- Trends tab ---------- */
.trends-window-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: var(--space-4);
}

.trends-window-toggle {
  display: inline-flex;
  border: var(--border);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 2px;
  box-shadow: var(--shadow-sm);
}

.trends-window-toggle button {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background var(--dur-fast) var(--ease-smooth),
              color var(--dur-fast) var(--ease-smooth),
              transform var(--dur-fast) var(--ease-spring);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.trends-window-toggle button .hint {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.8;
}

.trends-window-toggle button:hover:not(.active):not(:disabled) {
  color: var(--text);
  background: var(--surface-sunken);
}

.trends-window-toggle button:active:not(.active):not(:disabled) {
  transform: scale(0.96);
}

.trends-window-toggle button.active {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 4px 10px rgba(45, 104, 196, 0.24);
}

.trends-window-toggle button.is-disabled,
.trends-window-toggle button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.trends-note {
  margin: var(--space-4) 0 0;
  padding-top: var(--space-3);
  border-top: var(--border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.trends-note-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.trends-note-badge.synthetic {
  background: var(--color-hold-bg);
  color: var(--color-hold);
  border-color: var(--color-hold-ring);
}
.trends-note-badge.live {
  background: var(--color-buy-bg);
  color: var(--color-buy);
  border-color: var(--color-buy-ring);
}

.trends-note-text { flex: 1; min-width: 220px; }

#tab-trends .metric-grid { margin-bottom: var(--space-3); }
#tab-trends .metric-delta.buy  { color: var(--color-buy); }
#tab-trends .metric-delta.sell { color: var(--color-sell); }

/* ---------- Trends sport sections ----------------------------------------
   Group the 4 metric cards per sport under a small header with a jump-
   to-Signals CTA, so the 12-card wall stops reading as one undifferenti-
   ated grid. */
.trends-sport-section {
  margin-bottom: var(--space-5);
}
.trends-sport-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}
.trends-sport-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: 0.01em;
}
.trends-sport-jump {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.trends-sport-jump:hover,
.trends-sport-jump:focus-visible {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-accent-bg);
  outline: none;
}

/* Empty-state CTA button used in the Trends empty state copy. */
.empty-state-cta {
  background: transparent;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-left: 4px;
  transition: background 120ms ease, color 120ms ease;
}
.empty-state-cta:hover {
  background: var(--color-accent);
  color: #fff;
}

/* ---------- Budget planner ---------- */
.budget-card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-fast) var(--ease-smooth);
}

.budget-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.budget-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
}

.budget-card-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.budget-card-sub {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.budget-qty {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.budget-bar {
  height: 12px;
  background: var(--surface-sunken);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: var(--space-1);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.budget-bar-fill {
  height: 100%;
  background: var(--grad-brand);
  border-radius: var(--radius-pill);
  transition: width var(--dur-slow) var(--ease-spring);
}

.budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

.budget-slider-row {
  display: grid;
  /* Auto-fit so the row of two top-level sliders renders 2-up and the
     row of three category-cap sliders renders 3-up at desktop, with
     graceful collapse to 1-up on narrow screens. */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

@media (max-width: 640px) {
  .budget-slider-row { grid-template-columns: 1fr; }
}

.slider-block {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-sm);
}

.slider-block label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.slider-block .value {
  font-size: 22px;
  font-weight: 800;
  margin-right: var(--space-2);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  margin-bottom: var(--space-2);
}

.slider-block input[type="range"] {
  width: 100%;
  accent-color: var(--color-accent);
  cursor: grab;
}
.slider-block input[type="range"]:active { cursor: grabbing; }

/* ---------- Watchlist ---------- */
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  padding: var(--space-7);
  text-align: center;
  color: var(--text-muted);
}

.empty-state h3 {
  margin: 0 0 var(--space-2);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* =========================================================================
 * Watchlist — Phase 10 player-card layout
 *
 * One card per watched player. Card layout, top to bottom:
 *   1. Header bar: identity (avatar + name + signal + hold chip) on the
 *      left, INDEX price block in the middle, Stop-watching button right.
 *   2. Ask AI bar: three mode buttons + budget input + output area.
 *      Always-visible; no expand required.
 *   3. Variants table: one row per tracked variant, each with an
 *      alert-toggle switch + (when alerted) buy/sell threshold inputs.
 *
 * The old `.watchlist-item` / `.wl-row-summary` / `.wl-row-actions` rules
 * (and the `.is-collapsible` expand mechanism) have been removed; the
 * remaining `.wl-*` rules below all belong to the new structure.
 * ========================================================================= */

.wl-player-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-fast) var(--ease-smooth),
              border-color var(--dur-fast) var(--ease-smooth);
}
.wl-player-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--color-accent-ring);
}

.wl-player-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--space-4);
  align-items: center;
}

.wl-player-identity {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.wl-player-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wl-player-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wl-player-name {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.wl-player-sub {
  font-size: 12px;
}

.wl-player-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  line-height: 1.2;
}
.wl-player-price-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.wl-player-price-value {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.wl-player-price-change {
  font-size: 12px;
  font-weight: 600;
}

.wl-player-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.wl-player-remove {
  font-size: 12px;
  padding: 6px 12px;
}

@media (max-width: 860px) {
  .wl-player-header {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .wl-player-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

/* ---------- Ask AI bar (always-visible) ------------------------------- */

.wl-ai-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  border: 1px solid var(--border-color);
}
.wl-ai-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wl-ai-bar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 4px;
}
.wl-ai-btn {
  font-size: 12px;
  padding: 6px 10px;
  white-space: nowrap;
}
.wl-ai-budget {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border-color);
}
.wl-ai-budget-prefix {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.wl-ai-budget-input {
  width: 70px;
  padding: 4px 6px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  outline: none;
}
.wl-ai-budget-hint {
  font-size: 11px;
}
.wl-ai-output {
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.ai-advice-empty { margin: 0; }

/* ---------- Variants table ------------------------------------------- */

.wl-variants {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wl-variants-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}
.wl-variants-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.wl-variants-sub {
  font-size: 12px;
  flex: 1;
}
.wl-variants-save {
  font-size: 12px;
  padding: 6px 14px;
}
.wl-variants-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wl-variant-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wl-variant-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-smooth),
              border-color var(--dur-fast) var(--ease-smooth);
}
.wl-variant-row.is-alerted {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.25);
}
.wl-variant-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.wl-variant-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wl-variant-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.wl-variant-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.wl-variant-toggle-track {
  display: inline-block;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
  position: relative;
  transition: background var(--dur-fast) var(--ease-smooth);
}
.wl-variant-toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f8fafc;
  transition: transform var(--dur-fast) var(--ease-spring);
}
.wl-variant-toggle input:checked + .wl-variant-toggle-track {
  background: #38bdf8;
}
.wl-variant-toggle input:checked + .wl-variant-toggle-track::after {
  transform: translateX(14px);
}
.wl-variant-toggle input:focus-visible + .wl-variant-toggle-track {
  box-shadow: 0 0 0 3px var(--color-accent-ring);
}

.wl-variant-chips {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wl-variant-tier {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}
.wl-variant-tier-1 { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }
.wl-variant-tier-2 { background: rgba(168, 162, 158, 0.15); color: #d6d3d1; }
.wl-variant-tier-3 { background: rgba(251, 191, 36, 0.15); color: #fde68a; }

.wl-variant-cond {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wl-variant-cond-raw {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}
.wl-variant-cond-graded {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

.wl-variant-label {
  font-size: 13px;
  font-weight: 600;
  flex: 0 1 auto;
}
.wl-variant-spacer {
  flex: 1;
}
.wl-variant-price {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.wl-variant-change {
  font-size: 12px;
  font-weight: 600;
  min-width: 56px;
  text-align: right;
}

/* Phase 13 — "no SCP data yet" chip. Muted slate background, italic
   font hint to read as a state-not-price. Rows that show this chip
   also dim the variant label slightly so they read as lower-priority
   than fully-priced rows. */
.wl-variant-nodata {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-muted);
  font-size: 11px;
  font-style: italic;
  font-weight: 500;
  white-space: nowrap;
  cursor: help;
}
.wl-variant-row:has(.wl-variant-nodata) .wl-variant-label {
  opacity: 0.7;
}

/* Phase 13 — Hide-no-data toggle in the Variants section header.
   Slim ghost pill that sits next to the alerted-count subtitle. */
.wl-variants-hide-nodata {
  margin-left: auto;
  margin-right: var(--space-2);
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-smooth),
              border-color var(--dur-fast) var(--ease-smooth);
}
.wl-variants-hide-nodata:hover {
  color: var(--text);
  border-color: var(--color-accent);
}
.wl-variants-hide-nodata.is-hiding {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* Phase 13 — Inventory "Data gaps" diagnostic. Sits below the Top-to-
   Sell panel; collapsed by default. Visual treatment is muted (no
   accent color) because this is a "fix-it-when-you-have-time" surface,
   not an action panel. */
.datagap-section {
  margin: var(--space-3) 0;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.datagap-header {
  margin: 0;
}
.datagap-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-sunken);
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font: inherit;
  transition: background var(--dur-fast) var(--ease-smooth);
}
.datagap-toggle:hover {
  background: color-mix(in srgb, var(--color-accent) 6%, var(--surface-sunken));
}
.datagap-chev {
  display: inline-block;
  font-size: 14px;
  color: var(--text-muted);
  transition: transform var(--dur-fast) var(--ease-spring);
}
.datagap-toggle.is-collapsed .datagap-chev {
  transform: rotate(-90deg);
}
.datagap-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.datagap-body {
  padding: var(--space-4);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}
.datagap-body.is-collapsed {
  display: none;
}
.datagap-bucket {
  padding: var(--space-3);
  background: var(--surface-sunken);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.datagap-bucket-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: var(--space-2);
}
.datagap-bucket-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.18);
  color: #fca5a5;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.datagap-bucket-title {
  font-size: 13px;
  font-weight: 700;
}
.datagap-bucket-fix {
  font-size: 11px;
  flex-basis: 100%;
  font-style: italic;
}
.datagap-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
}
.datagap-row {
  padding: 3px 0;
  color: var(--text-muted);
}
.datagap-row-more {
  font-style: italic;
}

/* Phase 13 — Single "Get full analysis" button takes the place of the
   three-mode picker. Larger + accented to read as the primary action
   in the AI bar; sparkle prefix hints at the AI vibe. */
.wl-ai-btn-main {
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  letter-spacing: 0.01em;
}

/* Section dividers inside the combined 'all' response. Each sub-section
   (Recommended buys / Buy-sell zones / Find listings) gets its own
   pale-background block so the three asks read as distinct units. */
.ai-advice-section + .ai-advice-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}
.ai-advice-section-title {
  margin: 0 0 8px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.wl-variant-thresholds {
  display: flex;
  gap: 12px;
  padding: 6px 10px 4px 50px;
  flex-wrap: wrap;
}
.wl-variant-threshold {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.wl-variant-threshold input[type="number"] {
  width: 80px;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--surface);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.wl-variant-threshold input:focus-visible {
  border-color: var(--color-accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-accent-ring);
}

@media (max-width: 720px) {
  .wl-variant-head { gap: 6px; }
  .wl-variant-spacer { flex-basis: 100%; height: 0; }
  .wl-variant-thresholds { padding-left: 0; }
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-brand);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 10px rgba(45, 104, 196, 0.22);
  letter-spacing: -0.02em;
}

.wl-info .name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.wl-info .meta {
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-top: 2px;
  font-weight: 500;
}

/* Legacy .wl-targets fieldset removed in Phase 10. Variant-level
   threshold inputs now live inside .wl-variant-thresholds above. */

/* ----- Ask AI advice panel inside watchlist row detail -------------------
 *
 * Sits below the price-alerts fieldset; three mode buttons that load
 * structured Claude responses into an inline output area. Cached
 * server-side per (user, player, mode, budget) for 24h.
 * ------------------------------------------------------------------------ */
.ai-advice {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-advice-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ai-advice-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ai-advice-sub {
  font-size: 11px;
}
.ai-advice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ai-advice-btn {
  font-size: 12px;
  padding: 6px 10px;
}
.ai-advice-budget {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}
.ai-advice-budget-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.ai-advice-budget-input {
  width: 110px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--surface);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ai-advice-submit {
  padding: 6px 12px;
  font-size: 12px;
}
.ai-advice-output {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.ai-advice-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}
.ai-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(125, 211, 252, 0.25);
  border-top-color: #7dd3fc;
  animation: ai-spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-advice-error {
  color: #f87171;
  margin: 0;
}
.ai-advice-hint { margin: 0; }
.ai-advice-headline {
  margin: 0 0 8px 0;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-advice-cached-chip {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  text-transform: uppercase;
}
.ai-advice-rec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-advice-rec-row,
.ai-advice-zone-row,
.ai-advice-listing-row {
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.ai-advice-rec-head,
.ai-advice-zone-head,
.ai-advice-listing-head {
  font-size: 13px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ai-advice-rec-text,
.ai-advice-zone-text {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}
.ai-advice-tier-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
}
.ai-advice-zone-band {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.ai-buy-zone {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(14, 164, 122, 0.18);
  color: #6ee7b7;
}
.ai-sell-zone {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(220, 38, 38, 0.18);
  color: #fca5a5;
}
.ai-advice-listing-query {
  font-size: 11px;
  margin-bottom: 6px;
}
.ai-advice-listing-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ai-advice-link {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  text-decoration: none;
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.ai-advice-link:hover {
  background: rgba(56, 189, 248, 0.22);
  text-decoration: none;
}
.ai-advice-notes {
  margin: 8px 0 0 0;
  font-size: 12px;
}
/* Legacy .wl-targets-* rules dropped in Phase 10 — see .wl-variant-* above. */

.target-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.target-badge.buy  { background: var(--color-buy-bg);  color: var(--color-buy); }
.target-badge.sell { background: var(--color-sell-bg); color: var(--color-sell); }

.wl-badges {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-left: auto;
}

.wl-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

/* ---------- Compare ---------- */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.compare-card {
  background: var(--surface);
  border: 1px solid var(--color-purple-ring);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-fast) var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.compare-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(8, 145, 178, 0.16),
              0 2px 8px rgba(8, 145, 178, 0.10);
}

.compare-card .cc-color-stripe {
  height: 6px;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-3);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.10);
}

.compare-chart-block {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.compare-bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 72px;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: 13px;
}

.compare-bar-label { color: var(--text); font-weight: 600; }

.compare-bar {
  height: 18px;
  background: var(--surface-sunken);
  border-radius: var(--radius-pill);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.compare-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width var(--dur-slow) var(--ease-spring);
}

.compare-bar-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
  color: var(--text);
  font-size: 13px;
}

/* ---------- Utility ---------- */
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.mt-3 { margin-top: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }

.chart-wrap { position: relative; height: 260px; }
.chart-wrap.tall { height: 340px; }

/* Small news line on card */
.player-news {
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-3);
  margin-top: 2px;
  line-height: 1.45;
}
.player-news-link {
  color: var(--text-strong, var(--text-primary));
  text-decoration: none;
  border-bottom: 1px dotted var(--color-accent);
  font-style: italic;
}
.player-news-link:hover {
  color: var(--color-accent);
  border-bottom-style: solid;
}
.player-news-meta {
  display: inline-block;
  margin-left: 6px;
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-muted);
  opacity: 0.8;
}

/* ---------- Marketplace link chip row ---------- */
/* Shown on every player card + budget pick. One row of small pill links
   to eBay / 130point / COMC / alt.xyz with the player's cardQuery
   pre-populated. Chips wrap gracefully on narrow cards.                  */
.marketplace-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-3);
}

.marketplace-links-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-right: 2px;
}

.marketplace-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--surface-sunken);
  background: var(--surface);
  color: var(--text-muted);
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease;
  white-space: nowrap;
}

.marketplace-chip:hover,
.marketplace-chip:focus-visible {
  transform: translateY(-1px);
  color: var(--color-accent);
  border-color: var(--color-accent-ring);
  background: var(--color-accent-bg);
  outline: none;
}

/* Per-marketplace accent hints — subtle, just enough to differentiate. */
.marketplace-chip.hue-buy:hover     { color: var(--color-buy);    border-color: var(--color-buy-ring);    background: var(--color-buy-bg); }
.marketplace-chip.hue-sell:hover    { color: var(--color-sell);   border-color: var(--color-sell-ring);   background: var(--color-sell-bg); }
.marketplace-chip.hue-hold:hover    { color: var(--color-hold);   border-color: var(--color-hold-ring);   background: var(--color-hold-bg); }
.marketplace-chip.hue-accent:hover  { color: var(--color-accent); border-color: var(--color-accent-ring); background: var(--color-accent-bg); }
.marketplace-chip.hue-purple:hover  { color: var(--color-purple); border-color: var(--color-purple-ring); background: var(--color-purple-bg); }

/* =================================================================
   Inventory tab
   ================================================================= */

.inv-heading-row {
  margin-bottom: var(--space-4);
  gap: var(--space-4);
  align-items: flex-start;
}

.inv-toolbar-actions {
  display: inline-flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background var(--dur-fast) var(--ease-smooth),
              transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-fast) var(--ease-smooth);
}
.btn-primary:hover {
  background: var(--color-accent-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-smooth),
              background var(--dur-fast) var(--ease-smooth);
}
.btn-ghost:hover {
  border-color: var(--border-strong);
  background: color-mix(in srgb, var(--color-accent) 4%, var(--surface));
}
.btn-ghost:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---- Inventory table ---- */
.inv-table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.inv-table thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: var(--border);
  background: color-mix(in srgb, var(--color-accent) 4%, var(--surface));
}
.inv-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
  vertical-align: middle;
  color: var(--text);
}
.inv-table tbody tr:last-child td {
  border-bottom: none;
}
.inv-table tbody tr:hover {
  background: color-mix(in srgb, var(--color-accent) 3%, transparent);
}
.inv-table tbody tr.is-selected {
  background: color-mix(in srgb, var(--color-accent) 8%, transparent);
}
.inv-table tbody tr.is-selected:hover {
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
}
.inv-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.inv-table .muted { color: var(--text-muted); }
.inv-table .positive { color: var(--color-buy); font-weight: 600; }
.inv-table .negative { color: var(--color-sell); font-weight: 600; }
.inv-table .neutral  { color: var(--text-muted); }

/* Checkbox column — narrow and aligned with the column header. The row
   checkbox is the sole click target; the surrounding TD is small enough
   that misclicks land on the row's main content instead. */
.inv-table .inv-check-cell {
  width: 36px;
  padding-left: 12px;
  padding-right: 4px;
}
.inv-row-check {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--color-accent, #2D68C4);
}

/* =========================================================================
   Bulk action bar — sticky toolbar that appears above the table when any
   inventory rows are selected. Holds the count, sport reassignment select,
   calendar show/hide, and delete buttons.
   ========================================================================= */
.inv-bulk-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px 14px;
  margin-bottom: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--color-accent-ring, rgba(45,104,196,0.45));
  border-radius: var(--radius-lg, 10px);
  box-shadow: 0 6px 18px rgba(0, 61, 98, 0.18);
  flex-wrap: wrap;
}
.inv-bulk-bar[hidden] { display: none; }
.inv-bulk-count {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
}
.inv-bulk-count strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-accent, #2D68C4);
  font-variant-numeric: tabular-nums;
}
.inv-bulk-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.inv-bulk-sport {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
}
.inv-bulk-sport select {
  font: inherit;
  font-size: 13px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.02);
  color: var(--text);
}

@media (max-width: 640px) {
  .inv-bulk-bar { flex-direction: column; align-items: stretch; }
  .inv-bulk-actions { width: 100%; justify-content: stretch; }
  .inv-bulk-sport { flex: 1; }
}

.inv-player-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.inv-player-name {
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.inv-player-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 11px;
}
.inv-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-accent) 14%, var(--surface));
  color: var(--color-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.inv-card-cell { max-width: 320px; }

.inv-sport-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.inv-sport-mlb { color: var(--color-buy);    background: var(--color-buy-bg);    border-color: var(--color-buy-ring); }
.inv-sport-nfl { color: var(--color-sell);   background: var(--color-sell-bg);   border-color: var(--color-sell-ring); }
.inv-sport-nba { color: var(--color-hold);   background: var(--color-hold-bg);   border-color: var(--color-hold-ring); }
.inv-sport-soc { color: var(--color-accent); background: var(--color-accent-bg); border-color: var(--color-accent-ring); }
.inv-sport-oth {
  /* Neutral slate for the catch-all bucket — visually distinct from both
     the four primary sports and the Unlinked muted gray, so users can
     tell at a glance that a card is intentionally categorised but isn't
     in a sport we run signals on. */
  color: var(--text);
  background: color-mix(in srgb, var(--text-muted) 14%, transparent);
  border-color: color-mix(in srgb, var(--text-muted) 30%, transparent);
}
.inv-sport-unlinked {
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-color: color-mix(in srgb, var(--text) 12%, transparent);
}

/* ---- Grading pill ---- */
.grade-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.grade-pill.grade-raw   { color: var(--text-muted); background: color-mix(in srgb, var(--text) 5%, transparent); border-color: color-mix(in srgb, var(--text) 12%, transparent); }
.grade-pill.grade-psa   { color: #C2410C; background: #FFF7ED; border-color: rgba(234, 88, 12, 0.25); }  /* PSA red-orange */
.grade-pill.grade-bgs   { color: #1D4ED8; background: #EFF6FF; border-color: rgba(37, 99, 235, 0.25); }  /* BGS blue */
.grade-pill.grade-sgc   { color: #047857; background: #ECFDF5; border-color: rgba(4, 120, 87, 0.25); }   /* SGC green */
.grade-pill.grade-cgc   { color: #6D28D9; background: #F5F3FF; border-color: rgba(109, 40, 217, 0.25); } /* CGC violet */
.grade-pill.grade-other { color: var(--text); background: var(--surface); border-color: var(--border-strong); }

/* ---- Row actions ---- */
.inv-actions { white-space: nowrap; text-align: right; }
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  margin-left: 2px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-smooth),
              color var(--dur-fast) var(--ease-smooth),
              border-color var(--dur-fast) var(--ease-smooth);
}
.btn-icon:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-icon.danger:hover {
  background: var(--color-sell-bg);
  color: var(--color-sell);
  border-color: var(--color-sell-ring);
}
.btn-icon:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* =================================================================
   Modal (add/edit inventory item)
   ================================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 16px;
  overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }

body.modal-open { overflow: hidden; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--text) 55%, transparent);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalIn 160ms var(--ease-spring);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: var(--border);
  background: color-mix(in srgb, var(--color-accent) 4%, var(--surface));
}
.modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px 8px;
  border-radius: 6px;
}
.modal-close:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }

.modal-form { padding: 20px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  grid-column: span 2;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.form-field-wide  { grid-column: span 4; }
.form-field-small { grid-column: span 1; }
.form-field span em { color: var(--color-sell); font-style: normal; margin-left: 2px; }

.form-field input[type="text"],
.form-field input[type="search"],
.form-field input[type="number"],
.form-field input[type="date"],
.form-field select {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  width: 100%;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-fast) var(--ease-smooth),
              box-shadow var(--dur-fast) var(--ease-smooth);
}
.form-field input:focus-visible,
.form-field select:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-ring);
}

.form-fieldset {
  grid-column: span 4;
  border: 1px dashed color-mix(in srgb, var(--color-accent) 35%, transparent);
  border-radius: var(--radius-md);
  padding: 10px 14px 14px;
  margin: 0;
  background: color-mix(in srgb, var(--color-accent) 3%, var(--surface));
}
.form-fieldset legend {
  padding: 0 6px;
  font-size: 11px;
  color: var(--color-accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.grading-row {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 12px;
}
.grading-row .form-field { grid-column: span 1; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: var(--border);
}

/* ---- Typeahead dropdown ---- */
.typeahead { position: relative; }
.typeahead-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 4px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 260px;
  overflow-y: auto;
  z-index: 2;
}
.typeahead-list[hidden] { display: none; }
.typeahead-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.typeahead-list li:hover {
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
}
.typeahead-name { font-weight: 600; }
.typeahead-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

/* ---- Responsive tweaks ---- */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-field,
  .form-field-wide,
  .form-field-small { grid-column: span 2; }
  .grading-row { grid-template-columns: 1fr 1fr; }
}

/* ---------- Boot error banner (styled via inline HTML but polished here) ---------- */
#boot-error {
  background: var(--color-sell-bg) !important;
  color: var(--color-sell) !important;
  border: 1px solid var(--color-sell-ring) !important;
  border-radius: var(--radius-lg) !important;
  padding: var(--space-3) var(--space-4) !important;
  font-weight: 500;
}

/* ---------- Scrollbar (subtle, optional polish) ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
::-webkit-scrollbar-track { background: transparent; }

/* =========================================================================
   WC 2026 sell-calendar tab
   ======================================================================= */

/* Hero row — title + tournament tag */
.wc-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.wc-hero-tag {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  padding: var(--space-3) var(--space-4);
  background: var(--grad-brand);
  color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-accent-glow);
  min-width: 180px;
}
.wc-hero-tag-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}
.wc-hero-tag-value {
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
}
.wc-hero-tag-sub {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

/* Nav-tab decoration: WC tab gets a soccer-ball icon */
.nav-tab-flag {
  margin-left: 6px;
  font-size: 13px;
}

/* ---- Countdown banner -------------------------------------------- */
.wc-countdown-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--surface-raised);
  border: var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-6);
}
.wc-countdown-block {
  text-align: center;
  padding: var(--space-3) var(--space-2);
  border-right: var(--border);
}
.wc-countdown-block:last-child { border-right: none; }
.wc-countdown-num {
  font-size: 36px;
  font-weight: 800;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.wc-countdown-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
  font-weight: 600;
}
.wc-countdown-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}
.wc-phase-pill {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}
.wc-phase-buy   { background: var(--color-buy-bg);    color: var(--color-buy);  }
.wc-phase-sell  { background: var(--color-sell-bg);   color: var(--color-sell); }
.wc-phase-hold  { background: var(--color-hold-bg);   color: var(--color-hold); }
.wc-phase-avoid { background: var(--color-sell-bg);   color: var(--color-sell); }

@media (max-width: 720px) {
  .wc-countdown-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wc-countdown-block:nth-child(2) { border-right: none; }
  .wc-countdown-num { font-size: 28px; }
}

/* ---- Cycle context grid ----------------------------------------- */
.wc-cycle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
@media (max-width: 880px) {
  .wc-cycle-grid { grid-template-columns: 1fr; }
}
.wc-cycle-card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
}
.wc-cycle-eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}
.wc-cycle-headline {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-top: var(--space-2);
  font-variant-numeric: tabular-nums;
}
.wc-cycle-arrow { color: var(--text-dim); margin: 0 6px; font-weight: 400; }
.wc-cycle-up    { color: var(--color-buy); font-size: 18px; margin-left: 4px; }
.wc-cycle-body {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: var(--space-3);
  line-height: 1.55;
}
.wc-cycle-body strong { color: var(--text); }

/* ---- 4-phase ladder --------------------------------------------- */
.wc-ladder {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
@media (max-width: 980px) {
  .wc-ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .wc-ladder { grid-template-columns: 1fr; }
}
.wc-ladder-step {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
}
.wc-ladder-step::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--grad-brand);
}
.wc-ladder-1::before { background: var(--grad-buy);  }
.wc-ladder-2::before { background: var(--grad-brand); }
.wc-ladder-3::before { background: var(--grad-hold); }
.wc-ladder-4::before { background: var(--grad-sell); }

.wc-ladder-num {
  width: 36px; height: 36px;
  border-radius: var(--radius-pill);
  background: var(--color-accent-bg);
  color: var(--color-accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  margin-bottom: var(--space-3);
}
.wc-ladder-1 .wc-ladder-num { background: var(--color-buy-bg);  color: var(--color-buy);  }
.wc-ladder-3 .wc-ladder-num { background: var(--color-hold-bg); color: var(--color-hold); }
.wc-ladder-4 .wc-ladder-num { background: var(--color-sell-bg); color: var(--color-sell); }

.wc-ladder-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.wc-ladder-window {
  font-size: 13px;
  color: var(--color-accent-strong);
  font-weight: 600;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.wc-ladder-portion {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-2);
}
.wc-ladder-portion strong { color: var(--text); }
.wc-ladder-thesis {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: var(--space-3) 0 0;
  line-height: 1.5;
}

/* ---- Per-player grid -------------------------------------------- */
.wc-players-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
@media (max-width: 820px) {
  .wc-players-grid { grid-template-columns: 1fr; }
}

.wc-player-card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-med) var(--ease-spring),
              box-shadow var(--dur-med) var(--ease-smooth);
}
.wc-player-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.wc-player-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}
.wc-player-buy::before  { background: var(--grad-buy);  }
.wc-player-sell::before { background: var(--grad-sell); }
.wc-player-hold::before { background: var(--grad-hold); }
.wc-player-unlinked::before { background: linear-gradient(135deg, #94A3B8, #64748B); }

.wc-player-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.wc-player-avatar {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--grad-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.wc-player-id { flex: 1; min-width: 0; }
.wc-player-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.wc-player-flag { font-size: 18px; }
.wc-player-role {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.wc-conviction {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.wc-conviction-buy   { background: var(--color-buy-bg);   color: var(--color-buy);  }
.wc-conviction-sell  { background: var(--color-sell-bg);  color: var(--color-sell); }
.wc-conviction-hold  { background: var(--color-hold-bg);  color: var(--color-hold); }
.wc-conviction-unlinked {
  background: var(--surface-sunken);
  color: var(--text-muted);
}

.wc-player-headline {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.4;
}

.wc-player-pricerow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3);
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
}
.wc-player-price-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.wc-player-price-delta {
  margin-left: var(--space-2);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.wc-player-price-delta.pos { color: var(--color-buy);  }
.wc-player-price-delta.neg { color: var(--color-sell); }
.wc-player-signal-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.wc-player-strength {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.wc-player-factors {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wc-player-factors li {
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--surface-sunken);
  padding: 4px 8px;
  border-radius: var(--radius-pill);
}

.wc-player-unlinked {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-muted);
}
.wc-player-unlinked-pill {
  background: var(--color-hold-bg);
  color: var(--color-hold);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
}

.wc-player-section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
}
.wc-player-thesis p,
.wc-player-window p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}
.wc-player-window-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-accent-strong);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.wc-trigger-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}
@media (max-width: 480px) {
  .wc-trigger-row { grid-template-columns: 1fr; }
}
.wc-trigger {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid transparent;
}
.wc-trigger-sell  { background: var(--color-sell-bg); border-color: var(--color-sell-ring); }
.wc-trigger-hold  { background: var(--color-hold-bg); border-color: var(--color-hold-ring); }
.wc-trigger-avoid { background: var(--surface-sunken); border-color: var(--border-color); }
.wc-trigger-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.wc-trigger-sell  .wc-trigger-label { color: var(--color-sell); }
.wc-trigger-hold  .wc-trigger-label { color: var(--color-hold); }
.wc-trigger-avoid .wc-trigger-label { color: var(--text-muted); }
.wc-trigger-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.wc-player-risks ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wc-player-risks li {
  font-size: 12.5px;
  color: var(--text-muted);
  padding-left: var(--space-4);
  position: relative;
  line-height: 1.45;
}
.wc-player-risks li::before {
  content: '⚠';
  position: absolute;
  left: 0;
  color: var(--color-hold);
  font-size: 11px;
}

.wc-disclaimer {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  margin: var(--space-6) 0 0;
  padding: var(--space-4);
  border-top: var(--border);
  line-height: 1.5;
}

/* =========================================================================
   Sell Calendar tab
   ========================================================================= */

/* Tone tokens — re-cast the existing buy/sell/hold palette into a
   conviction-severity scale for the calendar. */
:root {
  --tone-stop-loss:        var(--color-sell-strong);
  --tone-stop-loss-bg:     var(--color-sell-bg);
  --tone-stop-loss-border: rgba(244, 63, 94, 0.55);

  --tone-high:             #DC2626; /* red-600 */
  --tone-high-bg:          #FEF2F2;
  --tone-high-border:      rgba(220, 38, 38, 0.45);

  --tone-sell:             var(--color-sell);
  --tone-sell-bg:          var(--color-sell-bg);
  --tone-sell-border:      rgba(225, 29, 72, 0.35);

  --tone-hold:             var(--color-hold);
  --tone-hold-bg:          var(--color-hold-bg);
  --tone-hold-border:      rgba(217, 119, 6, 0.40);

  --tone-review:           var(--text-dim);
  --tone-review-bg:        var(--surface-sunken);
  --tone-review-border:    var(--border-color);
}

.cal-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-5);
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(140% 200% at 0% 0%, var(--color-accent-bg) 0%, transparent 60%),
    var(--surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-5);
}

.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-3);
}

.cal-toolbar-month {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
}

.cal-month-title {
  margin: 0 var(--space-2);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  min-width: 180px;
  text-align: center;
}

.cal-nav-btn,
.cal-today-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 32px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-smooth),
              border-color var(--dur-fast) var(--ease-smooth);
}
.cal-nav-btn:hover,
.cal-today-btn:hover {
  background: var(--color-accent-bg);
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.cal-today-btn {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  margin-left: var(--space-2);
}
.cal-today-btn:hover {
  background: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
  color: #fff;
}

.cal-toolbar-filters {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1 1 auto;
}
.cal-filter-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cal-filter-label select {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.cal-toolbar-stats {
  display: flex;
  gap: var(--space-4);
  margin-left: auto;
}
.cal-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.cal-stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
}
.cal-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 2px;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-3);
  font-size: 12px;
  color: var(--text-muted);
}
.cal-legend-key {
  position: relative;
  padding: 4px 12px 4px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cal-legend-key::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.cal-legend-source {
  margin-left: auto;
  font-style: italic;
  color: var(--text-dim);
  font-size: 11px;
}

/* Tone color tokens applied to legend pills + event bars */
.cal-tone-stop-loss { color: var(--tone-stop-loss); }
.cal-tone-high      { color: var(--tone-high); }
.cal-tone-sell      { color: var(--tone-sell); }
.cal-tone-hold      { color: var(--tone-hold); }
.cal-tone-review    { color: var(--tone-review); }

.cal-shell {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 1100px) {
  .cal-shell { grid-template-columns: 1fr; }
}

.cal-main {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* ---- Month grid ---- */
.cal-grid {
  display: flex;
  flex-direction: column;
}

.cal-weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border-color);
}
.cal-weekday {
  padding: 10px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: left;
}

.cal-week {
  position: relative;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}
.cal-week:last-child {
  border-bottom: 0;
}
.cal-week-mixed {
  /* In mixed mode the lane overlay floats inside the day-row, so we keep
     the legacy fixed height for stable layout. */
  min-height: 168px;
}

.cal-week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  position: relative;
  z-index: 0;
  flex: 0 0 auto;
}

.cal-day {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 6px 8px 4px 8px;
  background: var(--surface);
  border-right: 1px solid var(--border-color);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: background var(--dur-fast) var(--ease-smooth);
}
.cal-week-sport-lanes .cal-day { min-height: 32px; }
.cal-week-mixed .cal-day { min-height: 132px; }
.cal-day:last-child { border-right: 0; }
.cal-day:hover { background: var(--surface-sunken); }
.cal-day-other { background: transparent; }
.cal-day-other .cal-daynum { color: var(--text-dim); }

.cal-day-today {
  background: var(--color-accent-bg);
}
.cal-day-today .cal-daynum {
  background: var(--color-accent);
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cal-day-selected {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
  background: var(--color-accent-bg);
}

.cal-daynum {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.cal-daymore {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-accent);
  text-align: right;
  align-self: stretch;
  padding: 0 4px;
}

/* ---- Mixed-lane mode (overlay over days) ---- */
.cal-lanes-mixed {
  position: absolute;
  top: 28px;
  left: 0;
  right: 0;
  bottom: 6px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 22px;
  row-gap: 2px;
  padding: 0 4px;
  pointer-events: none;
}
.cal-mixed-overflow-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-top: auto;
  padding: 0 4px;
  pointer-events: none;
}
.cal-mixed-overflow-row .cal-daymore {
  pointer-events: auto;
}

/* ---- Sport-swimlane mode (rows below the day-number row) ---- */
.cal-sport-rows {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-top: 1px dashed var(--border-color);
}

.cal-sport-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  align-items: stretch;
  border-bottom: 1px dashed var(--border-color);
  background: var(--surface);
}
.cal-sport-row:last-child { border-bottom: 0; }
.cal-sport-row-expanded {
  background: var(--surface-sunken);
}

.cal-sport-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-right: 1px solid var(--border-color);
  background: var(--surface-sunken);
  gap: 2px;
}
.cal-sport-icon { font-size: 16px; line-height: 1; }
.cal-sport-name { font-size: 10px; line-height: 1; }
.cal-sport-more {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  min-width: 28px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-accent);
  background: var(--color-accent-bg);
  color: var(--color-accent);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0;
  text-transform: none;
}
.cal-sport-more:hover {
  background: var(--color-accent);
  color: #fff;
}
.cal-sport-collapse {
  background: var(--color-accent);
  color: #fff;
}
.cal-sport-collapse:hover {
  background: var(--color-accent-strong);
  color: #fff;
}

.cal-sport-lanes {
  --lane-count: 2;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 22px;
  row-gap: 3px;
  padding: 4px;
  min-height: calc(var(--lane-count) * 25px + 8px);
}

.cal-sport-empty {
  padding: 12px 16px;
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  background: var(--surface);
  border-top: 1px dashed var(--border-color);
}

/* ---- View-mode toggle in toolbar ---- */
.cal-view-toggle {
  display: inline-flex;
  background: var(--surface-sunken);
  border-radius: var(--radius-pill);
  padding: 2px;
  border: 1px solid var(--border-color);
}
.cal-view-opt {
  height: 26px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-pill);
  font-family: inherit;
  transition: background var(--dur-fast) var(--ease-smooth),
              color var(--dur-fast) var(--ease-smooth);
}
.cal-view-opt:hover { color: var(--text); }
.cal-view-opt.active {
  background: var(--color-accent);
  color: #fff;
}

.cal-event {
  --lane: 0;
  grid-row: calc(var(--lane) + 1);
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  margin: 1px 2px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 4px;
  pointer-events: auto;
  cursor: pointer;
  border: 1px solid;
  transition: filter var(--dur-fast) var(--ease-smooth),
              transform var(--dur-fast) var(--ease-smooth);
}

.cal-event:hover { filter: brightness(0.92); transform: translateY(-1px); }
.cal-event-selected {
  box-shadow: 0 0 0 2px var(--color-accent);
}

.cal-event-noleft  { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-event-noright { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.cal-event.cal-tone-stop-loss {
  background: var(--tone-stop-loss);
  border-color: var(--tone-stop-loss-border);
  color: #fff;
}
.cal-event.cal-tone-high {
  background: var(--tone-high);
  border-color: var(--tone-high-border);
  color: #fff;
}
.cal-event.cal-tone-sell {
  background: var(--tone-sell);
  border-color: var(--tone-sell-border);
  color: #fff;
}
.cal-event.cal-tone-hold {
  background: var(--tone-hold);
  border-color: var(--tone-hold-border);
  color: #fff;
}
.cal-event.cal-tone-review {
  background: var(--tone-review);
  border-color: var(--tone-review-border);
  color: #fff;
}

.cal-event-name { display: inline; }

/* ---- Side panel ---- */
.cal-side {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  position: sticky;
  top: var(--space-4);
}
.cal-side-head {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(180deg,
    var(--color-accent-bg) 0%,
    var(--surface) 100%);
}
.cal-side-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.cal-side-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
.cal-side-empty {
  padding: var(--space-5) var(--space-4);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}
.cal-side-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cal-side-item {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-smooth);
  position: relative;
}
.cal-side-item:hover { background: var(--surface-sunken); }
.cal-side-item-selected {
  background: var(--color-accent-bg);
}
.cal-side-item-selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-accent);
}
.cal-side-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 4px;
}
.cal-side-tone {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: currentColor;
  color: #fff !important;
}
.cal-side-tone.cal-tone-stop-loss { background: var(--tone-stop-loss); }
.cal-side-tone.cal-tone-high      { background: var(--tone-high); }
.cal-side-tone.cal-tone-sell      { background: var(--tone-sell); }
.cal-side-tone.cal-tone-hold      { background: var(--tone-hold); }
.cal-side-tone.cal-tone-review    { background: var(--tone-review); }

.cal-side-cost {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.cal-side-player {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.cal-side-card-title {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cal-side-window {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 4px;
  font-feature-settings: "tnum";
}
.cal-side-rationale {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ---- Mobile responsive ---- */
@media (max-width: 640px) {
  .cal-toolbar { gap: var(--space-2); }
  .cal-toolbar-stats { width: 100%; justify-content: space-between; margin-left: 0; }
  .cal-month-title { font-size: 16px; min-width: 120px; }
  .cal-week, .cal-day { min-height: 96px; }
  .cal-event-name { font-size: 10px; }
  .cal-event { padding: 0 4px; }
}

/* ---- Dark mode support ---- */
:root[data-theme="dark"] .cal-event.cal-tone-stop-loss,
:root[data-theme="dark"] .cal-event.cal-tone-high,
:root[data-theme="dark"] .cal-event.cal-tone-sell,
:root[data-theme="dark"] .cal-event.cal-tone-hold,
:root[data-theme="dark"] .cal-event.cal-tone-review {
  color: #fff;
}

/* =========================================================================
   Auth overlay (login + set-password)
   The overlay is built imperatively in auth.js and appended to <body>.
   It's hidden by default; auth.js toggles `.open` once we know there's no
   session, and adds `auth-locked` to <body> to prevent background scroll.
   ========================================================================= */
body.auth-locked {
  overflow: hidden;
}

/* Hide the app shell until auth has resolved. app.js adds `app-ready` to
   the body once we either confirm a session or hand off to the overlay,
   so the user never sees a flash of the unauthenticated app behind the
   login card. The overlay lives outside .app-shell, so it stays visible. */
body:not(.app-ready) .app-shell {
  visibility: hidden;
}

#auth-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--color-accent) 14%, var(--bg)),
    color-mix(in srgb, var(--bg) 100%, transparent));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
}
#auth-overlay.open {
  display: flex;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--surface-raised);
  border: var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6, 28px);
  text-align: center;
}

.auth-title {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  background: linear-gradient(135deg, var(--color-accent), color-mix(in srgb, var(--color-accent) 60%, #003D62));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-sub {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 20px;
}

/* :not([hidden]) so the [hidden] HTML attribute properly hides the form
   when JS toggles it. The plain `.auth-form { display: flex }` form of
   this rule would tie [hidden]'s specificity but win the cascade-order
   tiebreaker (UA stylesheet declared earlier), leaving both the login
   AND set-password forms visible at once during standard sign-in. */
.auth-form:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-ring);
}

.auth-submit {
  margin-top: 4px;
  width: 100%;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-strong));
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
.auth-submit:hover:not(:disabled) {
  box-shadow: var(--shadow-accent-glow);
}
.auth-submit:active:not(:disabled) {
  transform: translateY(1px);
}
.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-sell-bg);
  color: var(--color-sell);
  font-size: 13px;
  line-height: 1.4;
}

.auth-meta {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Tiny "for tim@example.com" line under the subtitle in set-password
   mode, so the invitee has visual confirmation of which account they
   are activating. */
.auth-account-line {
  margin: -10px 0 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}
.auth-meta a {
  color: var(--color-accent);
  text-decoration: none;
}
.auth-meta a:hover {
  text-decoration: underline;
}

/* Header — sign-out button */
.app-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  /* position:relative so the absolutely-positioned alerts dropdown
     (`.alerts-panel`, appended as a sibling of the bell by alerts.js)
     anchors here instead of falling through to <body> and landing
     far below the page fold. */
  position: relative;
}
.signout-btn {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.signout-btn:hover {
  color: var(--color-sell);
  border-color: color-mix(in srgb, var(--color-sell) 60%, transparent);
  background: var(--color-sell-bg);
}
@media (max-width: 720px) {
  .app-header-controls {
    width: 100%;
    justify-content: space-between;
  }
  .signout-btn {
    align-self: flex-end;
  }
}

/* Header — risk-tolerance picker (Phase 7).
   3-pill segmented control; the active pill reverses to a filled style
   so the current selection reads as the dominant choice. Persisted to
   profiles.risk_tolerance via sync.saveRiskTolerance(). */
.risk-tolerance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
}
.risk-tolerance-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 6px 0 8px;
}
.risk-tolerance-pill {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.risk-tolerance-pill:hover {
  color: var(--text);
}
.risk-tolerance-pill.active {
  background: var(--text);
  color: var(--surface);
  font-weight: 600;
}
@media (max-width: 720px) {
  .risk-tolerance { order: 3; }
  .risk-tolerance-label { display: none; }
  .risk-tolerance-pill { padding: 4px 8px; font-size: 11px; }
}

/* Sell-Calendar loading skeleton — shown for 200-500ms on first
   activation while data/recommendations.json fetches. Pure CSS, no
   JS animation needed. */
.cal-skeleton {
  padding: 8px 0 0;
}
.cal-skeleton-toolbar {
  height: 36px;
  width: 100%;
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.cal-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-skeleton-cell {
  height: 60px;
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 0.85; }
}

/* =========================================================================
   My sell plans (per-user, lives above the sell-calendar grid)
   ========================================================================= */
.my-plans-pane {
  background: var(--surface-raised);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin: 0 0 20px;
  box-shadow: var(--shadow-xs);
}
.my-plans-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.my-plans-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.my-plans-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.my-plans-row.closed {
  opacity: 0.55;
}
.my-plans-row-main { flex: 1; min-width: 0; }
.my-plans-row-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}
.my-plans-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  align-items: center;
}
.my-plans-row-thesis {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.my-plans-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.conviction {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.conviction-STOP_LOSS       { background: var(--color-sell-bg); color: var(--color-sell); }
.conviction-HIGH_CONVICTION { background: var(--color-buy-bg);  color: var(--color-buy); }
.conviction-SELL            { background: var(--color-hold-bg); color: var(--color-hold); }
.conviction-HOLD_THEN_SELL  { background: var(--color-accent-bg); color: var(--color-accent); }

.status-pill {
  background: var(--surface);
  border: 1px solid var(--border-color);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  text-transform: capitalize;
}

.my-plans-form {
  background: var(--surface-sunken);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.my-plans-form .form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.my-plans-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.my-plans-form .form-field-wide  { grid-column: span 4; }
.my-plans-form .form-field-small { grid-column: span 1; }
.my-plans-form .form-field span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.my-plans-form input,
.my-plans-form select,
.my-plans-form textarea {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.my-plans-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 720px) {
  .my-plans-form .form-grid { grid-template-columns: repeat(2, 1fr); }
  .my-plans-form .form-field-wide { grid-column: span 2; }
}

/* =========================================================================
   Top Picks (highlights) tab
   ========================================================================= */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.highlight-tile {
  background: var(--surface-raised);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
/* Sport-tilt accent stripe at the top — quick-glance signal of where the
   sport is leaning today. */
.highlight-tile::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--text-dim);
}
.highlight-tile[data-tilt="buy-leaning"]::before  { background: var(--color-buy);  }
.highlight-tile[data-tilt="sell-leaning"]::before { background: var(--color-sell); }
.highlight-tile[data-tilt="mixed"]::before        { background: var(--color-hold); }

.highlight-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.highlight-emoji {
  font-size: 26px;
  line-height: 1;
  flex: 0 0 auto;
}
.highlight-header > div { flex: 1; min-width: 0; }
.highlight-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.highlight-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
.highlight-strength {
  flex: 0 0 auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.highlight-strength-num {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.highlight-strength-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.highlight-section { display: flex; flex-direction: column; gap: 6px; }
.highlight-section-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.highlight-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.highlight-pip.buy  { background: var(--color-buy);  }
.highlight-pip.sell { background: var(--color-sell); }

.highlight-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.highlight-empty { margin: 0; font-size: 13px; color: var(--text-muted); }

.highlight-row { padding: 0; }
.highlight-row-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: background var(--dur-fast) var(--ease-smooth),
              border-color var(--dur-fast) var(--ease-smooth),
              transform var(--dur-fast) var(--ease-spring);
}
.highlight-row-btn:hover {
  background: var(--surface-sunken);
  border-color: var(--border-strong);
}
.highlight-row-btn:active { transform: scale(0.98); }

.highlight-avatar {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--text-dim);
}
.highlight-avatar.buy  { background: var(--color-buy);  }
.highlight-avatar.sell { background: var(--color-sell); }

.highlight-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.highlight-row-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.highlight-row-meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.highlight-row-stats {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-size: 12px;
}

@media (max-width: 720px) {
  .highlights-grid { grid-template-columns: 1fr; }
}

/* ---------- Backtest tab ----------------------------------------------
   "How well do these signals predict?" — tables of win-rate + average
   forward return, plus calibration buckets, plus best/worst BUY calls.
   Layout uses the existing .metric-grid for the hero, then a sequence
   of .bt-section blocks with .bt-table or .bt-grid + .bt-list inside. */
.bt-section {
  margin-top: var(--space-5);
}
.bt-section-title {
  margin: 0 0 var(--space-2);
  font-size: 15px;
  font-weight: 600;
}

.bt-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.bt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bt-table thead th {
  background: color-mix(in srgb, var(--color-accent) 5%, var(--surface));
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.bt-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  font-variant-numeric: tabular-nums;
}
.bt-table tbody tr:last-child td { border-bottom: none; }
.bt-table .bt-h { color: var(--text-muted); font-weight: 500; }
.bt-table th.bt-buy  { color: var(--color-buy); }
.bt-table th.bt-sell { color: var(--color-sell); }

.bt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}
.bt-col {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}
.bt-col-title {
  margin: 0 0 var(--space-2);
  font-size: 13px;
  font-weight: 600;
}
.bt-col-title.bt-buy  { color: var(--color-buy); }
.bt-col-title.bt-sell { color: var(--color-sell); }

.bt-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-color);
}
.bt-row:last-child { border-bottom: none; }
.bt-row-main { flex: 1; min-width: 0; }
.bt-row-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bt-row-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.bt-row-ret {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 14px;
}
.bt-row-ret.positive { color: var(--color-buy); }
.bt-row-ret.negative { color: var(--color-sell); }

.bt-caveats {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.bt-caveats li { margin-bottom: 4px; }

@media (max-width: 720px) {
  .bt-grid { grid-template-columns: 1fr; }
}

/* ---------- Tightening for narrow phones (≤480px) ----------
   Final consolidated mobile rules so the app stays usable on a
   ~380px viewport. Earlier @media blocks already handle the
   nav + header + signals stack at 720/640px; this layer cleans
   up the remaining tight spots without disturbing desktop. */
@media (max-width: 480px) {
  /* App-shell padding: 24px sides was eating 13% of a 380px screen.
     Drop to 12px so player cards and inputs get the breathing room. */
  .app-shell {
    padding: var(--space-3) var(--space-3) var(--space-5);
  }

  /* Filter-row inputs: clear the min-width floors that push neighbours
     into a second wrap-line or off-screen. */
  .player-search   { min-width: 0; max-width: 100%; flex: 1 1 100%; }
  .trends-note-text { min-width: 0; }

  /* Compare bars stack so the player label gets full width above the bar. */
  .compare-bar-row {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }

  /* The 12-column seasonal grid renders <25px-wide cells at 380px —
     unreadable and untappable. Collapse to 4-up so cells stay roughly
     square and tappable. */
  .seasonal-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Sport filter pills: tighten padding + font so all four pills (MLB/
     NFL/NBA/SOC) fit comfortably on one line at 380px while preserving
     a ≥32px tap target. */
  .tab-context-bar .sport-pills {
    gap: 6px;
    flex-wrap: wrap;
  }
  .tab-context-bar .sport-pills button {
    padding: 7px 10px;
    font-size: 10.5px;
    letter-spacing: 0.06em;
  }
}

/* ---------- Sell Calendar — Manage Cards modal ----------------------------
   Wider modal variant for the inventory checklist + a scrollable list of
   rows with checkboxes. */
.modal-card.modal-wide {
  width: min(720px, 100%);
}
.modal-toolbar {
  display: flex;
  gap: 16px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--text) 2%, var(--surface));
}
.cal-manage-list {
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px 0;
}
.cal-manage-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background 120ms ease;
}
.cal-manage-row:last-child { border-bottom: none; }
.cal-manage-row:hover {
  background: color-mix(in srgb, var(--color-accent) 5%, var(--surface));
}
.cal-manage-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: var(--color-accent);
  cursor: pointer;
}
.cal-manage-row-main { flex: 1; min-width: 0; }
.cal-manage-row-main > div:first-child {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-manage-row-meta {
  margin-top: 2px;
  display: flex;
  gap: 10px;
  font-size: 11px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================================
   Feedback widget — floating FAB + modal form.
   Mounted from web/js/feedback.js on every page once auth resolves.
   ========================================================================= */
#feedback-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 950;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-accent-ring, rgba(45, 104, 196, 0.45));
  background: linear-gradient(135deg, #2D68C4 0%, #003D62 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 61, 98, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
#feedback-fab:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 61, 98, 0.38);
}
#feedback-fab:active { transform: translateY(0); }
.feedback-fab-icon { font-size: 15px; line-height: 1; }
.feedback-fab-label { line-height: 1; }

#feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(7, 12, 24, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
#feedback-overlay[hidden] { display: none; }

.feedback-modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--surface, #11141C);
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.48);
  padding: 18px 20px 16px;
}
.feedback-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.feedback-modal-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.feedback-close {
  background: transparent;
  border: 0;
  color: var(--text-muted, #94A3B8);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.feedback-close:hover { background: rgba(255,255,255,0.06); color: var(--text, #F1F5F9); }

.feedback-form { display: flex; flex-direction: column; gap: 12px; }
.feedback-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-muted, #94A3B8); }
.feedback-field > span { font-weight: 600; color: var(--text, #E2E8F0); }
.feedback-field select,
.feedback-field textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-color, rgba(255,255,255,0.12));
  background: rgba(255,255,255,0.02);
  color: var(--text, #F1F5F9);
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  resize: vertical;
}
.feedback-field textarea { min-height: 110px; }
.feedback-field select:focus,
.feedback-field textarea:focus {
  border-color: var(--color-accent, #2D68C4);
  box-shadow: 0 0 0 3px rgba(45, 104, 196, 0.18);
}

.feedback-meta { margin: 0; font-size: 12px; color: var(--text-muted, #94A3B8); }
.feedback-meta #feedback-from-email { color: var(--text, #E2E8F0); font-weight: 600; }

.feedback-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.feedback-actions button {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color, rgba(255,255,255,0.12));
  background: rgba(255,255,255,0.03);
  color: var(--text, #E2E8F0);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}
.feedback-actions button:hover { background: rgba(255,255,255,0.07); }
.feedback-actions button:active { transform: scale(0.98); }
.feedback-actions .feedback-submit {
  background: linear-gradient(135deg, #2D68C4 0%, #003D62 100%);
  color: #fff;
  border-color: var(--color-accent-ring, rgba(45, 104, 196, 0.55));
}
.feedback-actions .feedback-submit:hover { filter: brightness(1.05); }
.feedback-actions .feedback-submit:disabled { opacity: 0.6; cursor: progress; }

.feedback-error  { margin: 0; font-size: 12px; color: #FCA5A5; }
.feedback-success { margin: 0; font-size: 12px; color: #86EFAC; }

/* Push the FAB up on small screens so it doesn't collide with the
   sticky bottom nav / iOS home indicator. */
@media (max-width: 640px) {
  #feedback-fab { right: 12px; bottom: 14px; padding: 8px 12px; }
  .feedback-fab-label { display: none; }
  .feedback-modal { padding: 14px 16px; }
}

/* =========================================================================
   Collapsible Watchlist rows.
   Default view shows avatar + name + sport + price/change + alert badges
   + an "Edit alerts" toggle. Expanding reveals the Buy below / Sell above
   inputs and a Save button. Same pattern as the Signals card collapse —
   keep the list scannable, hide the configuration form until needed.
   ========================================================================= */
/* Phase 10: the legacy .watchlist-item.is-collapsible expand mechanism
   and its companion .wl-toggle button were removed. The new layout
   always shows the full player card without an expand step — Ask AI
   lives in the always-visible AI bar, alerts live in the variants
   table below. See .wl-player-card / .wl-variants further up. */

/* =========================================================================
   Collapsible Compare cards.
   Collapsed: stripe + name + sport line + signal badge + price + change.
   Expanded adds: strength bar, rank pill, debut window, Remove button.
   Bar charts below the grid carry the headline cross-card comparison
   already, so the per-card detail isn't needed at-a-glance.
   ========================================================================= */
.compare-card.is-collapsible { padding: var(--space-4); gap: var(--space-2); }
.compare-card.is-collapsible .player-card-header { cursor: pointer; }
.compare-card.is-collapsible .compare-card-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-1);
}
.compare-card.is-collapsed .compare-card-detail { display: none; }
.compare-card.is-collapsible .player-price-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.compare-card.is-collapsible .card-expand-toggle {
  margin-left: auto;
}
.compare-card.is-expanded .card-expand-toggle .chev { transform: rotate(180deg); }

/* =========================================================================
   Header alerts bell — small button at top right with a red count badge
   when ≥1 watchlist threshold has been crossed. Click opens a dropdown
   panel listing every firing alert with a jump-to-Signals button.
   ========================================================================= */
.alerts-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  margin-right: 6px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}
.alerts-bell:hover {
  background: rgba(45, 104, 196, 0.08);
  border-color: var(--color-accent-ring, rgba(45,104,196,0.45));
}
.alerts-bell:active { transform: scale(0.96); }
.alerts-bell.has-firing {
  border-color: var(--color-sell-ring, rgba(220,38,38,0.45));
  background: var(--color-sell-bg, rgba(220,38,38,0.08));
}
.alerts-bell-icon { font-size: 16px; line-height: 1; }
.alerts-bell-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--color-sell, #DC2626);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.alerts-bell-count[hidden] { display: none; }

.alerts-panel {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: min(380px, calc(100vw - 24px));
  max-height: 70vh;
  overflow: auto;
  z-index: 900;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
  padding: 12px;
}
.alerts-panel[hidden] { display: none; }
.alerts-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.alerts-panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.alerts-panel-count { font-size: 12px; color: var(--text-muted); }
.alerts-panel-count strong { color: var(--color-sell, #DC2626); font-weight: 700; }
.alerts-panel-empty {
  padding: 16px 4px 6px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.alerts-panel-empty p { margin: 0 0 12px; line-height: 1.5; }
.alerts-panel-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  text-align: right;
}
.alerts-panel-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.alerts-row { padding: 0; }
.alerts-row-btn {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.alerts-row-btn:hover {
  background: rgba(45,104,196,0.06);
  border-color: var(--color-accent-ring);
}
.alerts-side {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  color: #fff;
}
.alerts-side.buy  { background: var(--color-buy,  #0EA47A); }
.alerts-side.sell { background: var(--color-sell, #DC2626); }
.alerts-row-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.alerts-row-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alerts-row-meta { font-size: 11px; color: var(--text-muted); }
.alerts-row-prices { text-align: right; display: flex; flex-direction: column; gap: 1px; }
.alerts-row-current {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.alerts-row-threshold { font-size: 11px; }

@media (max-width: 640px) {
  .alerts-panel { right: -8px; width: calc(100vw - 16px); }
}

/* =========================================================================
   Tracked-card chip — small label that clarifies *which card variant* the
   player.price reflects. Lives on Signals/Plays/Watchlist/Compare under
   the player name. Hover/title gives the full disclaimer.
   ========================================================================= */
.tracked-card-chip {
  display: inline-block;
  margin: 4px 0 0;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text-muted) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--text-muted) 18%, transparent);
  border-radius: 999px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
}

/* =========================================================================
   Plays tab — sport-scoped dashboard. Stacked sections, no card wrapper
   at the outer level — the section panels are the cards. Reuses the
   .highlight-list / .highlight-row-btn rules already defined for picks.
   ========================================================================= */
#plays-dashboard { display: flex; flex-direction: column; gap: var(--space-5); }

.plays-section-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.plays-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

/* Hero KPI strip ---------------------------------------------------------- */
.plays-hero {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  flex-wrap: wrap;
}
.plays-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--color-hold);
}
.plays-hero[data-tilt="buy-leaning"]::before  { background: var(--color-buy);  }
.plays-hero[data-tilt="sell-leaning"]::before { background: var(--color-sell); }

.plays-hero-tilt { display: flex; flex-direction: column; gap: 2px; min-width: 180px; }
.plays-hero-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.plays-hero-value { font-size: 22px; line-height: 1.1; }
.plays-hero-sub { font-size: 12px; color: var(--text-muted); }

.plays-hero-kpis {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-left: auto;
}
.plays-kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 70px;
}
.plays-kpi-num {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.plays-kpi-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* Top BUYs + Top SELLs side-by-side -------------------------------------- */
.plays-picks-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.plays-picks-col {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
@media (max-width: 720px) {
  .plays-picks-row { grid-template-columns: 1fr; }
}
.strength-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  color: #fff;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}
.strength-pill.buy  { background: var(--color-buy); }
.strength-pill.sell { background: var(--color-sell); }
.strength-pill.hold { background: var(--color-hold); }

/* Trend chart ------------------------------------------------------------ */
.plays-trend {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-xs);
}
.plays-trend-svg {
  width: 100%;
  height: 120px;
  display: block;
  margin-top: var(--space-2);
}
.plays-trend-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  padding: 0 4px;
}

/* Seasonal heatmap ------------------------------------------------------- */
.plays-seasonal {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-xs);
}
.plays-heat {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  margin-top: var(--space-3);
}
.plays-heat-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  /* --heat-tint comes from JS (var(--color-buy|sell|hold) depending on
     that month's typical signal) and --heat is the 0..1 intensity. We
     fall back to var(--color-accent) when the cell didn't set a tint. */
  background: color-mix(in oklab, var(--heat-tint, var(--color-accent)) calc(var(--heat) * 75%), var(--surface-2, rgba(127,127,127,0.08)));
  border: 1px solid var(--border-color);
  color: var(--text);
  transition: transform 0.12s ease;
  cursor: default;
}
.plays-heat-cell:hover { transform: translateY(-1px); }

/* Score is the headline element of each cell — large, bold, tabular so
   columns line up. Month abbreviation drops to a tiny caption underneath. */
.plays-heat-score {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.plays-heat-mo {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.78;
}

/* Score-text contrast: at high heat the cell background gets dark/saturated
   and our default `var(--text)` (dark text in light mode) becomes unreadable
   on the buy/sell tints. Bump to high-contrast white once we're past ~50%
   intensity, where the background tint dominates. */
.plays-heat-cell[style*="--heat:0.5"],
.plays-heat-cell[style*="--heat:0.6"],
.plays-heat-cell[style*="--heat:0.7"],
.plays-heat-cell[style*="--heat:0.8"],
.plays-heat-cell[style*="--heat:0.9"],
.plays-heat-cell[style*="--heat:1.0"] {
  color: #fff;
  border-color: transparent;
}
.plays-seasonal-hint {
  margin: var(--space-2) 0 0;
  font-size: 11px;
  color: var(--text-muted);
}
@media (max-width: 540px) {
  .plays-heat { grid-template-columns: repeat(6, 1fr); }
}

/* Full sortable signal grid --------------------------------------------- */
.plays-grid-section {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
}
.plays-sort { display: inline-flex; align-items: center; gap: 8px; }
.plays-sort select {
  font: inherit;
  font-size: 13px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.02);
  color: var(--text);
}
.plays-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: var(--space-2);
}
.plays-row {
  display: grid;
  grid-template-columns: 56px 1fr 64px 90px 70px 100px 18px;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.plays-row:hover {
  background: rgba(45, 104, 196, 0.06);
  border-color: var(--color-accent-ring);
}
.plays-row-rank {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.plays-row-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plays-row-name-line {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plays-row-meta {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plays-row-signal { justify-self: center; font-size: 10px; padding: 3px 7px; }
.plays-row-price { text-align: right; font-size: 13px; }
.plays-row-spark { display: flex; align-items: center; }
.plays-row-arrow {
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 300;
  text-align: center;
  line-height: 1;
}
@media (max-width: 640px) {
  .plays-row { grid-template-columns: 1fr auto; grid-template-rows: auto auto; }
  .plays-row-rank, .plays-row-spark, .plays-row-arrow { display: none; }
  .plays-row-signal { grid-row: 1; justify-self: end; }
  .plays-row-price { grid-row: 2; text-align: left; }
  .plays-row .player-change { grid-row: 2; }
}

/* =========================================================================
   Admin page (admin.html / admin.js)

   Standalone page reusing the app-shell + app-header chrome from the main
   index.html. Hidden until the signed-in user's profile carries
   is_admin=true (admin.js toggles #admin-workspace vs. #admin-forbidden).
   The styling intentionally stays close to the main app so the admin page
   doesn't feel like a different product — same surface tokens, same
   spacing scale.
   ========================================================================= */

.admin-shell {
  max-width: 880px;
}

.admin-page-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 12px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--color-accent-strong);
  border-radius: 999px;
  vertical-align: middle;
}

.admin-page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 var(--space-4);
}

/* :not([hidden]) so the HTML `hidden` attribute on #admin-workspace
   actually hides the element before admin.js's auth check flips it. */
.admin-workspace:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: var(--space-5, 32px);
  padding: 0 var(--space-4) var(--space-6);
}

.admin-forbidden {
  padding: var(--space-5, 32px) var(--space-4);
}

.admin-panel {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.admin-panel-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.admin-panel-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.admin-field input {
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
}

.admin-field input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-ring);
}

.admin-form .btn,
.admin-etl-controls .btn {
  flex: 0 0 auto;
  align-self: flex-start;
}

.admin-etl-controls {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.admin-section-sub {
  margin: var(--space-3) 0 var(--space-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.admin-result {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid transparent;
}

.admin-result-success {
  background: var(--color-buy-bg);
  color: var(--color-buy);
  border-color: var(--color-buy);
}

.admin-result-warn {
  background: var(--color-hold-bg);
  color: var(--color-hold);
  border-color: var(--color-hold);
}

.admin-result-error {
  background: var(--color-sell-bg);
  color: var(--color-sell);
  border-color: var(--color-sell);
}

.admin-result pre {
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm, 4px);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
}

.admin-runs-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-runs-empty {
  padding: 10px 12px;
  font-size: 13px;
}

.admin-run-row {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  transition: background var(--dur-fast) var(--ease-smooth);
}

.admin-run-row:hover {
  background: var(--color-accent-bg);
}

.admin-run-link {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 12px;
  color: var(--text);
  text-decoration: none;
}

.admin-run-status {
  font-size: 12px;
  font-weight: 600;
}

.admin-run-success .admin-run-status { color: var(--color-buy); }
.admin-run-error   .admin-run-status { color: var(--color-sell); }
.admin-run-warn    .admin-run-status { color: var(--color-hold); }
.admin-run-pending .admin-run-status { color: var(--color-accent); }

.admin-run-title {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-run-meta {
  font-size: 11px;
  white-space: nowrap;
}

/* Admin nav link in the main app's user menu — see app.js boot path. */
.admin-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent-strong);
  background: var(--color-accent-bg);
  border-radius: var(--radius-md);
  text-decoration: none;
  margin-right: 6px;
}

.admin-nav-link:hover {
  background: var(--color-accent);
  color: #fff;
}

/* =========================================================================
   Calendar Phase 8 — sub-tabs, view-type toggle, week view, buy tones
   ========================================================================= */

/* Buy-side tone tokens. Greens (BUY signal) + a slightly brighter
   "target hit" green + a neutral-blue pre-debut. Tokens follow the
   same naming pattern as sell-side --tone-* tokens. */
:root {
  --tone-buy-now:        #047857;  /* emerald-700 */
  --tone-buy-now-bg:     #D1FAE5;  /* emerald-100 */
  --tone-buy-now-border: rgba(4, 120, 87, 0.45);

  --tone-buy:            #059669;  /* emerald-600 */
  --tone-buy-bg:         #ECFDF5;  /* emerald-50 */
  --tone-buy-border:     rgba(5, 150, 105, 0.45);

  --tone-pre-debut:        #1D4ED8;  /* blue-700 */
  --tone-pre-debut-bg:     #DBEAFE;  /* blue-100 */
  --tone-pre-debut-border: rgba(29, 78, 216, 0.40);
}

/* Tone color helpers — extend the existing .cal-tone-* surface. */
.cal-tone-buy-now   { color: var(--tone-buy-now); }
.cal-tone-buy       { color: var(--tone-buy); }
.cal-tone-pre-debut { color: var(--tone-pre-debut); }

.cal-event.cal-tone-buy-now {
  background: var(--tone-buy-now);
  border-color: var(--tone-buy-now-border);
  color: #fff;
}
.cal-event.cal-tone-buy {
  background: var(--tone-buy);
  border-color: var(--tone-buy-border);
  color: #fff;
}
.cal-event.cal-tone-pre-debut {
  background: var(--tone-pre-debut);
  border-color: var(--tone-pre-debut-border);
  color: #fff;
}

.cal-side-tone.cal-tone-buy-now   { background: var(--tone-buy-now); }
.cal-side-tone.cal-tone-buy       { background: var(--tone-buy); }
.cal-side-tone.cal-tone-pre-debut { background: var(--tone-pre-debut); }

.cal-legend-key.cal-tone-buy-now::before   { background: var(--tone-buy-now); }
.cal-legend-key.cal-tone-buy::before       { background: var(--tone-buy); }
.cal-legend-key.cal-tone-pre-debut::before { background: var(--tone-pre-debut); }

/* ---- Sub-tab strip (Sell / Buy) ---- */
.cal-subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-3, 12px);
  border-bottom: 1px solid var(--border-color);
}
.cal-subtab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
  margin-bottom: -1px;
}
.cal-subtab:hover {
  color: var(--text);
}
.cal-subtab.active {
  color: var(--color-accent-strong);
  border-bottom-color: var(--color-accent);
}
.cal-subtab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-accent-ring);
  border-radius: var(--radius-sm, 4px);
}

/* ---- Week view ---- */
.cal-grid-week {
  display: flex;
  flex-direction: column;
}
.cal-week-only {
  /* Inside week view the .cal-week stretches to fill the remaining
     vertical room so event lanes have more breathing space than the
     month grid's fixed-height rows. */
  flex: 1 1 auto;
  min-height: 520px;
}
.cal-grid-week .cal-week-days {
  /* Day cells get a fixed minimum height so each day shows date +
     full month abbreviation cleanly. */
  min-height: 56px;
}
.cal-day-week {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  padding: 6px 10px;
}
.cal-daynum-month {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cal-grid-week .cal-sport-rows {
  /* In week view the lane area is generous; let each sport row breathe. */
  gap: 8px;
}
.cal-grid-week .cal-event {
  /* Taller events in week mode so titles + cost fit on two lines. */
  min-height: 36px;
  font-size: 13px;
  padding: 4px 8px;
}

/* Make the view-type toggle visually distinct from the lane-mode toggle
   by spacing them with a thin divider on the right. Both use the same
   .cal-view-toggle widget so they get consistent button styling. */
.cal-toolbar-filters {
  flex-wrap: wrap;
}
.cal-toolbar-filters .cal-view-toggle + .cal-view-toggle {
  border-left: 1px solid var(--border-color);
  padding-left: var(--space-2, 8px);
  margin-left: var(--space-1, 4px);
}

/* Buy-mode dashboard tile / source-line styling reuses the
   .cal-legend-source class — no extra rules needed. */

/* Dashboard overflow link — appears at the bottom of a truncated
   buy/sell action list and jumps to the matching Calendar sub-tab. */
.today-action-overflow {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}
.today-action-overflow-link {
  display: block;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent-strong);
  background: var(--color-accent-bg);
  border-radius: var(--radius-md);
  text-decoration: none;
  text-align: center;
  transition: background 120ms ease;
}
.today-action-overflow-link:hover {
  background: var(--color-accent);
  color: #fff;
}

/* =========================================================================
   Toast — transient confirmation notifications (see web/js/toast.js)
   ========================================================================= */
.toast-host {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1100;
  pointer-events: none;       /* container ignores clicks; .toast re-enables */
  max-width: calc(100% - 48px);
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(15, 23, 42, 0.12));
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  min-width: 240px;
  max-width: 380px;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms var(--ease-smooth, ease-out),
              transform 220ms var(--ease-smooth, ease-out);
}

.toast-show {
  opacity: 1;
  transform: translateY(0);
}

.toast-leave {
  opacity: 0;
  transform: translateY(8px);
}

.toast-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--color-accent);
}

.toast-success .toast-icon { background: var(--color-buy); }
.toast-error   .toast-icon { background: var(--color-sell); }
.toast-info    .toast-icon { background: var(--color-accent); }

.toast-message {
  flex: 1 1 auto;
  /* Wrap long names instead of truncating — the toast can grow vertically. */
  word-break: break-word;
}

.toast-action {
  flex: 0 0 auto;
  margin-left: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent-strong);
  background: var(--color-accent-bg);
  border: none;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: background 120ms ease;
}
.toast-action:hover {
  background: var(--color-accent);
  color: #FFFFFF;
}

/* On narrow screens, anchor toasts to the bottom-center for thumb reach. */
@media (max-width: 600px) {
  .toast-host {
    right: 12px;
    left: 12px;
    bottom: 12px;
    align-items: stretch;
  }
  .toast {
    max-width: none;
    min-width: 0;
  }
}

/* =========================================================================
   Admin Users panel + delete-user modal (admin.html / admin.js)
   ========================================================================= */

.admin-panel-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  background: var(--color-sell);
  border: 1px solid var(--color-sell);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease,
              transform 80ms ease;
}
.btn-danger:hover:not([disabled]) {
  background: var(--color-sell-strong, #B91C1C);
  border-color: var(--color-sell-strong, #B91C1C);
}
.btn-danger:active:not([disabled]) {
  transform: scale(0.97);
}
.btn-danger[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.admin-users-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-users-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-sunken);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
}

.admin-users-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background 120ms ease;
}
.admin-users-table tbody tr:last-child {
  border-bottom: none;
}
.admin-users-table tbody tr:hover {
  background: var(--color-accent-bg);
}

.admin-users-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.admin-col-actions {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}

.admin-users-empty {
  padding: 24px;
  text-align: center;
}

/* Status badges */
.user-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
}
.user-badge-admin {
  background: var(--color-accent-bg);
  color: var(--color-accent-strong);
}
.user-badge-pending {
  background: var(--color-hold-bg);
  color: var(--color-hold);
}
.user-badge-member {
  background: var(--color-buy-bg);
  color: var(--color-buy);
}

/* Modal */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.admin-modal[hidden] {
  display: none;
}
.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.admin-modal-card {
  position: relative;
  width: min(440px, 100%);
  background: var(--surface-raised);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.30);
  padding: var(--space-5, 28px);
  z-index: 1;
}
.admin-modal-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.admin-modal-sub {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}
.admin-modal-target {
  margin: 0 0 14px;
  padding: 10px 12px;
  font-size: 13px;
  background: var(--color-sell-bg);
  color: var(--color-sell);
  border: 1px solid var(--color-sell);
  border-radius: var(--radius-md);
}
.admin-modal-confirm-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.admin-modal-confirm-label input {
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.admin-modal-confirm-label input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-ring);
}
.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}
.admin-modal-actions .btn {
  flex: 0 0 auto;
}

/* Lock body scroll while the modal is open */
body.admin-modal-open {
  overflow: hidden;
}

/* =========================================================================
   Empty-state upgrades (onboarding pass 1)
   ========================================================================= */

/* Onboarding variant — used on the most-visible empty surfaces
   (Inventory, Watchlist, Compare). Adds the leading icon, the
   bullet-listed value props, and a CTA action row. Builds on the
   existing .empty-state base. */
.empty-state-onboarding {
  text-align: left;
  max-width: 560px;
  margin: 0 auto;
}

.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: var(--color-accent-bg);
  font-size: 28px;
  line-height: 1;
}

.empty-state-bullets {
  margin: 6px 0 16px;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

.empty-state-bullets li {
  margin: 4px 0;
}

.empty-state-bullets strong {
  font-weight: 600;
  color: var(--text);
}

.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.empty-state-actions .btn {
  flex: 0 0 auto;
  /* Override the default 100% flex behavior on .btn used by signal cards. */
  flex-basis: auto;
}

/* Dashboard welcome — numbered steps (3 quick wins for first-run users). */
.today-empty-steps {
  margin: 14px 0 18px;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
}

.today-empty-steps li {
  margin: 10px 0;
}

.today-empty-steps strong {
  font-weight: 600;
}

/* Inline mini-button used inside the dashboard welcome prose — looks
   like a link but reads as a button (and is one, so it's keyboard-
   accessible without href contortions). */
.today-empty-inline-link {
  display: inline;
  padding: 0 4px;
  font: inherit;
  color: var(--color-accent-strong);
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--color-accent);
  cursor: pointer;
}

.today-empty-inline-link:hover {
  color: var(--color-accent);
  border-bottom-style: solid;
}

.today-empty-inline-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* =========================================================================
   Header Settings button (Phase 9) — opens the email-alerts modal
   ========================================================================= */
.settings-btn {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.settings-btn:hover {
  background: var(--color-accent-bg);
  color: var(--color-accent-strong);
  border-color: var(--color-accent);
}
.settings-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-accent-ring);
}

/* =========================================================================
   Settings modal (Phase 9) — reuses .admin-modal shell from admin-page CSS
   ========================================================================= */
.settings-modal-card {
  width: min(520px, 100%);
  max-height: 80vh;
  overflow-y: auto;
}

.settings-section {
  margin: 12px 0 8px;
}
.settings-section-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.settings-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
}
.settings-row:last-of-type { border-bottom: none; }

.settings-row > span {
  display: block;
  flex: 1 1 auto;
}
.settings-row strong {
  display: block;
  font-weight: 600;
  color: var(--text);
}
.settings-row-help {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Toggle (checkbox) variant: checkbox sits flush-right with extra padding
   so it reads as a control rather than a form-row checkbox. */
.settings-row-toggle input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--color-accent);
}

/* Radio rows put the input at the start with text after — different
   visual rhythm because radios pick one-of-many. */
.settings-row-radio {
  align-items: flex-start;
}
.settings-row-radio input[type="radio"] {
  flex: 0 0 auto;
  margin-top: 3px;
  cursor: pointer;
  accent-color: var(--color-accent);
}

.settings-fieldset {
  margin: 14px 0;
  padding: 8px 12px 6px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}
.settings-fieldset[disabled] {
  opacity: 0.5;
  pointer-events: none;
}
.settings-fieldset-legend {
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.settings-status {
  margin: 10px 2px 0;
  font-size: 12px;
  min-height: 16px;        /* reserve space so the layout doesn't jiggle */
}
.settings-status.success { color: var(--color-buy); }
.settings-status.error   { color: var(--color-sell); }

/* =========================================================================
   Watchlist redesign — buy-decision engine (collapsed row + expand panel)
   Uses theme variables so it adapts to light/dark automatically.
   ========================================================================= */

/* Summary + sort bar */
.wl-summary{display:flex;align-items:center;justify-content:space-between;gap:16px;
  flex-wrap:wrap;margin:4px 0 14px}
.wl-summary-text{margin:0;font-size:15px;color:var(--text-muted)}
.wl-summary-text strong{color:var(--color-buy);font-weight:700}
.wl-sort{display:flex;align-items:center;gap:10px}
.wl-sort-label{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--text-dim);font-weight:700}
.wl-sort-seg{display:flex;border:1px solid var(--border-strong);border-radius:var(--radius-sm);overflow:hidden}
.wl-sort-btn{background:transparent;border:0;border-left:1px solid var(--border-color);
  color:var(--text-muted);font:inherit;font-size:13px;padding:7px 13px;cursor:pointer}
.wl-sort-btn:first-child{border-left:0}
.wl-sort-btn.active{background:var(--surface-sunken);color:var(--text);font-weight:600}

.wl-cards{display:flex;flex-direction:column;gap:12px}

/* Card shell with verdict-colored left accent */
.wl-card{background:var(--surface);border:1px solid var(--border-color);
  border-left:3px solid var(--border-strong);border-radius:var(--radius-md);
  box-shadow:var(--shadow-sm);overflow:hidden;transition:box-shadow .15s}
.wl-card:hover{box-shadow:var(--shadow-md)}
.wl-card.v-buy{border-left-color:var(--color-buy-strong)}
.wl-card.v-hold{border-left-color:var(--color-hold-strong)}
.wl-card.v-sell{border-left-color:var(--color-sell-strong)}

.wl-row{display:grid;grid-template-columns:minmax(190px,230px) minmax(0,1fr) auto;
  gap:18px;align-items:center;padding:14px 18px;cursor:pointer}
.wl-row:hover{background:var(--surface-sunken)}

/* Identity */
.wl-id{display:flex;align-items:center;gap:12px;min-width:0}
.wl-id .avatar{width:40px;height:40px;flex:none}
.wl-id-meta{min-width:0}
.wl-id-name{font-weight:700;font-size:16px;line-height:1.2;display:flex;align-items:center;gap:8px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wl-id-sub{font-size:12.5px;margin-top:2px;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.wl-alert-chip{font-size:11px;font-weight:600;color:var(--color-accent);
  background:var(--color-accent-bg);padding:1px 7px;border-radius:6px;white-space:nowrap}

/* Decision column */
.wl-decision{min-width:0}
.wl-decision-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:6px}
.wl-verdict{font-size:11.5px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;
  padding:4px 10px;border-radius:7px;white-space:nowrap}
.wl-verdict.buy{background:var(--color-buy-bg);color:var(--color-buy)}
.wl-verdict.hold{background:var(--color-hold-bg);color:var(--color-hold)}
.wl-verdict.sell{background:var(--color-sell-bg);color:var(--color-sell)}
.wl-best-label{font-size:14.5px;font-weight:600;color:var(--text);white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}

/* Buy-zone (90-day range) */
.wl-zone-head{display:flex;align-items:baseline;gap:10px}
.wl-zone-price{font-size:19px;font-weight:800;color:var(--text)}
.wl-zone-chg{font-size:13px;font-weight:600}
.wl-zone-chg.positive{color:var(--color-buy)}
.wl-zone-chg.negative{color:var(--color-sell)}
.wl-zone-pos{font-size:11.5px;font-weight:600}
.wl-zone-pos.low{color:var(--color-buy)}
.wl-zone-pos.high{color:var(--color-hold)}
.wl-zone-pos.mid{color:var(--text-dim)}
.wl-zone-track{position:relative;height:6px;border-radius:4px;background:var(--surface-sunken);
  border:1px solid var(--border-color);margin:8px 0 5px;max-width:320px}
.wl-zone-now{position:absolute;top:50%;width:12px;height:12px;border-radius:50%;
  background:var(--color-accent);border:2px solid var(--surface);transform:translate(-50%,-50%)}
.wl-zone-scale{display:flex;justify-content:space-between;max-width:320px;
  font-size:11px;color:var(--text-dim)}
.wl-nodata-line{font-size:13px;color:var(--text-dim);font-style:italic}

/* Row actions */
.wl-actions{display:flex;align-items:center;gap:8px}
.wl-find{white-space:nowrap}
.wl-find-disabled,.wl-find:disabled{opacity:.45;cursor:not-allowed}
.wl-chev{width:34px;height:34px;border-radius:var(--radius-sm);border:1px solid var(--border-strong);
  background:transparent;color:var(--text-muted);cursor:pointer;font-size:14px;line-height:1;
  transition:transform .18s}
.wl-chev:hover{color:var(--text);border-color:var(--color-accent)}
.wl-card.is-open .wl-chev{transform:rotate(180deg)}

/* Expanded panel */
.wl-panel{padding:2px 18px 18px;border-top:1px solid var(--border-color)}
.wl-section-label{font-size:11px;letter-spacing:.07em;text-transform:uppercase;
  color:var(--text-dim);font-weight:700;margin:16px 0 8px}

/* Best entry / where to buy */
.wl-buybox{background:var(--surface-sunken);border:1px solid var(--border-color);
  border-radius:var(--radius-md);padding:14px 16px;margin-top:14px}
.wl-buybox-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.wl-buybox-head .wl-section-label{margin:0 0 3px}
.wl-buybox-card{font-size:15px;font-weight:600;color:var(--text);display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.wl-buybox-price{font-size:16px;font-weight:800}
.wl-buy-range{font-size:12px;color:var(--text-muted);font-weight:400}
.wl-buy-links{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.wl-buy-link{display:inline-flex;align-items:center;gap:7px;background:var(--surface);
  border:1px solid var(--border-strong);color:var(--text);text-decoration:none;
  font-size:13px;font-weight:600;padding:8px 13px;border-radius:var(--radius-sm)}
.wl-buy-link:hover{border-color:var(--color-accent);color:var(--color-accent)}
.wl-buy-tag{font-size:10.5px;color:var(--text-dim);font-weight:500}

/* Variant table additions */
.wl-variant-best{font-size:10px;font-weight:800;letter-spacing:.03em;color:var(--color-buy);margin-left:8px}
.wl-variant-row.is-best{background:var(--color-buy-bg)}
.wl-variant-find{background:transparent;border:1px solid var(--border-strong);color:var(--text-muted);
  border-radius:6px;font:inherit;font-size:12px;font-weight:600;padding:3px 9px;margin-left:10px;cursor:pointer}
.wl-variant-find:hover{border-color:var(--color-accent);color:var(--color-accent)}

/* Ask AI section */
.wl-ai{background:var(--color-accent-bg);border:1px solid var(--color-accent-ring);
  border-radius:var(--radius-md);padding:14px 16px;margin-top:18px}
.wl-ai-head .wl-section-label{margin:0 0 4px;color:var(--color-accent-strong)}
.wl-ai-blurb{font-size:13px;margin:0 0 12px;max-width:62ch}
.wl-ai-controls{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.wl-ai-btn{white-space:nowrap}

/* Panel footer (alerts + remove) */
.wl-panel-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;
  flex-wrap:wrap;margin-top:18px;padding-top:14px;border-top:1px solid var(--border-color)}
.wl-footer-left{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.wl-footer-right{display:flex;align-items:center;gap:10px}

@media (max-width:760px){
  .wl-row{grid-template-columns:1fr;gap:12px}
  .wl-actions{justify-content:flex-start}
}

/* Expand/collapse visibility for the redesigned watchlist card */
.wl-card .wl-panel{display:none}
.wl-card.is-open .wl-panel{display:block}

/* =========================================================================
   Phase A — Buy Score, Why chips, theme toggle, sticky headers,
   sell-window banner, listing tone toggle.
   ========================================================================= */

/* ---- HobbyVIP Buy Score badge (card anchor) ---- */
.buy-score{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  flex:none;border-radius:var(--radius-md);border:1px solid var(--border-color);
  line-height:1;text-align:center;gap:2px;
}
.buy-score-lg{width:72px;padding:8px 6px}
.buy-score-sm{width:54px;padding:5px 4px}
.buy-score-cap{font-size:8.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-dim)}
.buy-score-num{font-weight:800}
.buy-score-lg .buy-score-num{font-size:26px}
.buy-score-sm .buy-score-num{font-size:18px}
.buy-score-grade{font-weight:700}
.buy-score-lg .buy-score-grade{font-size:13px}
.buy-score-sm .buy-score-grade{font-size:11px}
.buy-score.score-buy{background:var(--color-buy-bg);border-color:var(--color-buy-ring)}
.buy-score.score-buy .buy-score-num,.buy-score.score-buy .buy-score-grade{color:var(--color-buy)}
.buy-score.score-hold{background:var(--color-hold-bg);border-color:var(--color-hold-ring)}
.buy-score.score-hold .buy-score-num,.buy-score.score-hold .buy-score-grade{color:var(--color-hold)}
.buy-score.score-sell{background:var(--color-sell-bg);border-color:var(--color-sell-ring)}
.buy-score.score-sell .buy-score-num,.buy-score.score-sell .buy-score-grade{color:var(--color-sell)}

/* list-view compact score + grade */
.td-buy-score{display:inline-flex;align-items:baseline;gap:4px;font-weight:700;
  padding:1px 7px;border-radius:6px;font-size:13px}
.td-buy-score .td-buy-grade{font-size:11px;font-weight:700;opacity:.85}
.td-buy-score.score-buy{background:var(--color-buy-bg);color:var(--color-buy)}
.td-buy-score.score-hold{background:var(--color-hold-bg);color:var(--color-hold)}
.td-buy-score.score-sell{background:var(--color-sell-bg);color:var(--color-sell)}

/* highlights strength-pill recolor by score band */
.strength-pill.score-buy{background:var(--color-buy-bg);color:var(--color-buy)}
.strength-pill.score-hold{background:var(--color-hold-bg);color:var(--color-hold)}
.strength-pill.score-sell{background:var(--color-sell-bg);color:var(--color-sell)}

/* ---- Plain-English "why" chips ---- */
.why-chip{display:inline-flex;align-items:center;font-size:11.5px;font-weight:600;
  padding:3px 9px;border-radius:7px;margin:0 6px 6px 0;white-space:nowrap;
  background:var(--surface-sunken);border:1px solid var(--border-color)}
.why-chip.why-positive{background:var(--color-buy-bg);color:var(--color-buy);border-color:var(--color-buy-ring)}
.why-chip.why-negative{background:var(--color-sell-bg);color:var(--color-sell);border-color:var(--color-sell-ring)}
.player-why-row{margin:8px 0 0;display:flex;flex-wrap:wrap}
.player-why-detail{margin:6px 0 10px}
.why-detail-label{display:block;font-size:11px;font-weight:700;letter-spacing:.05em;
  text-transform:uppercase;color:var(--text-dim);margin-bottom:6px}
.why-detail-chips{display:flex;flex-wrap:wrap}
.td-factors .why-chip{margin:0 4px 4px 0;font-size:11px;padding:2px 7px}

/* ---- Theme toggle button ---- */
.theme-toggle{background:transparent;border:1px solid var(--border-strong);color:var(--text-muted);
  border-radius:var(--radius-sm);width:38px;height:38px;cursor:pointer;font-size:16px;
  display:inline-flex;align-items:center;justify-content:center}
.theme-toggle:hover{color:var(--text);border-color:var(--color-accent)}

/* ---- Sticky table headers ---- */
.players-table-head .th{position:sticky;top:0;z-index:6}
.inv-table-scroll{max-height:calc(100vh - 230px);overflow:auto}
.inv-table thead th{position:sticky;top:0;z-index:6}
.bt-table thead th{position:sticky;top:0;z-index:6;background:var(--surface)}

/* ---- Sell-window banner (dashboard) ---- */
.sell-window-banner{display:flex;align-items:center;gap:12px;width:100%;text-align:left;
  background:var(--color-buy-bg);border:1px solid var(--color-buy-ring);
  border-left:4px solid var(--color-buy-strong);border-radius:var(--radius-md);
  padding:12px 16px;margin-bottom:16px;cursor:pointer;font:inherit;color:var(--text)}
.sell-window-banner:hover{border-color:var(--color-buy)}
.sell-window-banner-dot{width:10px;height:10px;border-radius:50%;flex:none;
  background:var(--color-buy-strong);box-shadow:0 0 0 4px var(--color-buy-bg)}
.sell-window-banner-text{flex:1;font-size:14px}
.sell-window-banner-text strong{color:var(--color-buy)}
.sell-window-banner-cta{font-size:13px;font-weight:700;color:var(--color-buy);white-space:nowrap}
@media (max-width:640px){
  .sell-window-banner{flex-wrap:wrap}
  .sell-window-banner-cta{width:100%}
}

/* ---- Listing tone toggle ---- */
.listing-tone-row{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.listing-tone-label{font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--text-dim)}
.listing-tone-seg{display:flex;border:1px solid var(--border-strong);border-radius:var(--radius-sm);overflow:hidden}
.listing-tone-btn{background:transparent;border:0;border-left:1px solid var(--border-color);
  color:var(--text-muted);font:inherit;font-size:13px;padding:6px 12px;cursor:pointer}
.listing-tone-btn:first-child{border-left:0}
.listing-tone-btn.active{background:var(--color-accent-bg);color:var(--color-accent);font-weight:600}

/* Phase A fix — grid card header fit: stop the player name overflowing
   onto the watch button, slim the Buy Score badge, and make the grid
   watch button a compact icon so the name has room. */
.player-card-title { min-width: 0; }
.player-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-card-header .buy-score-lg { width: 60px; padding: 7px 5px; }
.player-card-header .buy-score-lg .buy-score-num { font-size: 23px; }
.player-card-header-right .btn-watch {
  flex: none;
  width: 34px; height: 30px;
  padding: 0;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}

/* =========================================================================
   Phase B — screener presets, split-screen listing, mobile stacked tables
   ========================================================================= */

/* ---- Screener presets ---- */
.screener-presets{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:4px 0 14px}
.screener-presets-label{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-dim);margin-right:2px}
.screener-preset{background:var(--surface-sunken);border:1px solid var(--border-strong);color:var(--text-muted);
  font:inherit;font-size:13px;font-weight:600;padding:7px 14px;border-radius:var(--radius-pill);cursor:pointer;
  transition:background .12s,color .12s,border-color .12s}
.screener-preset:hover{color:var(--text);border-color:var(--color-accent)}
.screener-preset.is-active{background:var(--color-accent);border-color:var(--color-accent);color:#fff}
.screener-preset-clear{background:transparent;border-color:var(--border-color);color:var(--text-dim);font-weight:500}
.screener-preset-clear:hover{color:var(--color-sell);border-color:var(--color-sell)}

/* ---- Split-screen listing draft ---- */
.listing-split{display:grid;grid-template-columns:1fr 220px;gap:18px;align-items:start}
.listing-split-main{min-width:0;display:flex;flex-direction:column;gap:14px}
.listing-field{display:flex;flex-direction:column;gap:6px}
.listing-field-label{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-dim)}
.listing-split .listing-title{font-size:15px;font-weight:600;color:var(--text);background:var(--surface-sunken);
  border:1px solid var(--border-color);border-radius:var(--radius-md);padding:10px 12px}
.listing-split .listing-description{font-size:14px;line-height:1.6;color:var(--text);background:var(--surface-sunken);
  border:1px solid var(--border-color);border-radius:var(--radius-md);padding:12px}
.listing-split-rail{display:flex;flex-direction:column;gap:14px;position:sticky;top:8px}
.listing-rail-block{display:flex;flex-direction:column;gap:7px}
.listing-rail-label{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-dim)}
.btn-block{display:block;width:100%;text-align:center}
a.listing-ebay-link{text-decoration:none}
.listing-disclaimer{font-size:11.5px;margin:2px 0 0}
@media (max-width:640px){
  .listing-split{grid-template-columns:1fr}
  .listing-split-rail{position:static}
}

/* ---- Mobile: stack inventory table into labelled cards ---- */
@media (max-width:640px){
  .inv-table-scroll{max-height:none;overflow:visible}
  .inv-table thead{display:none}
  .inv-table,.inv-table tbody,.inv-table tr,.inv-table td{display:block;width:auto}
  .inv-table tr[data-inv-row]{border:1px solid var(--border-color);border-radius:var(--radius-md);
    background:var(--surface);margin:0 0 10px;padding:6px 12px 10px}
  .inv-table td{border:0;padding:5px 0;display:flex;justify-content:space-between;align-items:center;gap:12px;text-align:right}
  .inv-table td::before{content:attr(data-label);color:var(--text-dim);font-size:11px;font-weight:600;
    letter-spacing:.04em;text-transform:uppercase;text-align:left;flex:none}
  .inv-table td.inv-check-cell{display:none}
  .inv-table td.inv-actions{justify-content:flex-start;flex-wrap:wrap}
  .inv-table td.inv-actions::before{display:none}
}

/* ---- Mobile: stack signals list rows into cards ---- */
@media (max-width:600px){
  .signals-view-list .players-table thead{display:none}
  .signals-view-list .players-table,
  .signals-view-list .players-table tbody,
  .signals-view-list .players-table tr,
  .signals-view-list .players-table td{display:block;width:auto}
  .signals-view-list .players-row{border:1px solid var(--border-color);border-radius:var(--radius-md);
    background:var(--surface);margin:8px 0;padding:10px 12px;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
  .signals-view-list .players-row .td{border:0;padding:0}
  .signals-view-list .players-row .td-signal{order:1}
  .signals-view-list .players-row .td-name{order:2;flex:1 1 auto;min-width:0}
  .signals-view-list .players-row .td-price{order:3}
  .signals-view-list .players-row .td-change{order:4}
  .signals-view-list .players-row .td-actions{order:5;flex-basis:100%;display:flex;gap:8px;justify-content:flex-start}
  .signals-view-list .players-row .td-spark,
  .signals-view-list .players-row .td-factors,
  .signals-view-list .players-row .td-news{display:none}
}

/* Phase B QA fix — in the split-screen rail, stack the tone options as
   full-width buttons so "Enthusiastic"/"Straight" don't clip. */
.listing-split-rail .listing-tone-seg{flex-direction:column;border:0;gap:6px;width:100%}
.listing-split-rail .listing-tone-btn{width:100%;border:1px solid var(--border-strong);
  border-radius:var(--radius-md);padding:8px 10px;text-align:center}
.listing-split-rail .listing-tone-btn.active{border-color:var(--color-accent)}

/* =========================================================================
   Phase C — mark-as-sold (sold tag, sold rows, mark-sold modal)
   ========================================================================= */
.inv-sold-tag{display:inline-block;font-size:10px;font-weight:800;letter-spacing:.05em;
  padding:1px 7px;border-radius:6px;background:var(--surface-sunken);color:var(--text-muted);
  border:1px solid var(--border-color);margin-left:6px}
.inv-table tr.is-sold{opacity:.82}
.inv-table tr.is-sold td[data-label="Player"]{position:relative}

.mark-sold-modal{max-width:520px}
.mark-sold-body{padding:4px 0}
.mark-sold-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.mark-sold-field{display:flex;flex-direction:column;gap:5px;font-size:13px;color:var(--text-muted)}
.mark-sold-field .req{color:var(--color-sell)}
.mark-sold-field input{background:var(--bg);border:1px solid var(--border-strong);color:var(--text);
  border-radius:var(--radius-sm);padding:9px 11px;font:inherit}
.mark-sold-field input:focus{outline:none;border-color:var(--color-accent);box-shadow:0 0 0 3px var(--color-accent-ring)}
.mark-sold-net{margin-top:14px;padding:10px 12px;background:var(--surface-sunken);
  border:1px solid var(--border-color);border-radius:var(--radius-md);font-size:13px}
.mark-sold-net .positive{color:var(--color-buy)}
.mark-sold-net .negative{color:var(--color-sell)}
.mark-sold-error{color:var(--color-sell);font-size:13px;margin:10px 0 0}
@media (max-width:560px){ .mark-sold-grid{grid-template-columns:1fr} }

/* =========================================================================
   Phase C — portfolio value vs market chart (dashboard)
   ========================================================================= */
.portfolio-chart{background:var(--surface);border:1px solid var(--border-color);
  border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:16px 18px;margin-top:16px}
.portfolio-chart-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap}
.portfolio-chart-title{font-size:15px;font-weight:700;margin:0}
.portfolio-chart-sub{font-size:12px}
.portfolio-chart-canvas-wrap{position:relative;height:240px;margin-top:12px}
.portfolio-chart-note{font-size:11.5px;margin:10px 0 0}
@media (max-width:640px){ .portfolio-chart-canvas-wrap{height:200px} }

/* =========================================================================
   Phase D — probabilistic framing: data-confidence + price range
   ========================================================================= */
/* Confidence chip inside the Buy Score badge */
.buy-score-conf{font-size:8px;font-weight:700;letter-spacing:.02em;margin-top:3px;
  padding:1px 5px;border-radius:5px;white-space:nowrap;line-height:1.3;max-width:100%}
.buy-score-sm .buy-score-conf{display:none}      /* too tight in the list cell */
.conf-high{background:var(--color-buy-bg);color:var(--color-buy)}
.conf-med{background:var(--color-hold-bg);color:var(--color-hold)}
.conf-low{background:var(--color-sell-bg);color:var(--color-sell)}
.conf-none{background:var(--surface-sunken);color:var(--text-dim)}

/* Estimated range next to the headline price */
.price-range{font-size:12px;font-weight:500;margin-left:8px}

/* Data-confidence line in the expanded detail */
.data-confidence{display:inline-block;font-size:11px;font-weight:600;padding:2px 8px;
  border-radius:6px;margin-left:6px}
.data-confidence.conf-high{background:var(--color-buy-bg);color:var(--color-buy)}
.data-confidence.conf-med{background:var(--color-hold-bg);color:var(--color-hold)}
.data-confidence.conf-low{background:var(--color-sell-bg);color:var(--color-sell)}
.data-confidence.conf-none{background:var(--surface-sunken);color:var(--text-dim)}

/* #25 — Liquidity & Volatility chips. Two independent axes: liquidity =
   how often the card trades (green = liquid), volatility = how much the
   price swings (green = stable, red = choppy). Sit next to the
   data-confidence chip on the expanded card. */
.metric-chip{display:inline-block;font-size:11px;font-weight:600;padding:2px 8px;
  border-radius:6px;margin-left:6px}
.metric-chip.liq-high{background:var(--color-buy-bg);color:var(--color-buy)}
.metric-chip.liq-med{background:var(--color-hold-bg);color:var(--color-hold)}
.metric-chip.liq-low{background:var(--color-sell-bg);color:var(--color-sell)}
.metric-chip.liq-thin{background:var(--color-sell-bg);color:var(--color-sell)}
.metric-chip.vol-low{background:var(--color-buy-bg);color:var(--color-buy)}
.metric-chip.vol-med{background:var(--color-hold-bg);color:var(--color-hold)}
.metric-chip.vol-high{background:var(--color-sell-bg);color:var(--color-sell)}
.wl-buy-metrics{margin-top:6px}
.wl-buy-metrics .metric-chip:first-child{margin-left:0}

/* #33 — data-quality anomaly flag chip. Severity-colored; details in the
   title tooltip. High = error-likely (red), med = caveat (amber). */
.dq-flag{display:inline-block;font-size:11px;font-weight:700;padding:2px 8px;
  border-radius:6px;margin-left:6px;cursor:help}
.dq-flag.dq-high{background:var(--color-sell-bg);color:var(--color-sell)}
.dq-flag.dq-med{background:var(--color-hold-bg);color:var(--color-hold)}
.dq-flag.dq-low{background:var(--surface-sunken);color:var(--text-dim)}

/* #19 — chart time-horizon toggle (30/60/90d) above the trend chart. */
.player-trend-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.trend-horizon{display:inline-flex;gap:2px;background:var(--surface-sunken);border-radius:7px;padding:2px}
.trend-horizon-btn{font-size:11px;font-weight:600;padding:3px 9px;border:none;border-radius:5px;
  background:transparent;color:var(--text-dim);cursor:pointer;line-height:1.2}
.trend-horizon-btn:hover{color:var(--text)}
.trend-horizon-btn.active{background:var(--surface);color:var(--text);box-shadow:0 1px 2px rgba(0,0,0,.18)}

/* #31 — first-run buyer/seller onboarding modal. */
.onboard-overlay{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;
  background:rgba(8,12,24,.66);backdrop-filter:blur(3px);padding:20px}
.onboard-card{background:var(--surface);border:1px solid var(--border);border-radius:16px;
  max-width:560px;width:100%;padding:28px;box-shadow:0 24px 60px rgba(0,0,0,.4)}
.onboard-title{margin:0 0 6px;font-size:22px;font-weight:800}
.onboard-sub{margin:0 0 20px;color:var(--text-dim);font-size:14px}
.onboard-options{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media (max-width:520px){.onboard-options{grid-template-columns:1fr}}
.onboard-opt{display:flex;flex-direction:column;gap:6px;text-align:left;padding:18px;cursor:pointer;
  background:var(--surface-sunken);border:1px solid var(--border);border-radius:12px;transition:border-color .12s,transform .12s}
.onboard-opt:hover{border-color:var(--color-buy);transform:translateY(-2px)}
.onboard-opt-icon{font-size:26px}
.onboard-opt-title{font-size:16px;font-weight:700;color:var(--text)}
.onboard-opt-desc{font-size:13px;color:var(--text-dim);line-height:1.4}
.onboard-skip{display:block;margin:18px auto 0;background:none;border:none;color:var(--text-dim);
  font-size:13px;cursor:pointer;padding:6px}
.onboard-skip:hover{color:var(--text)}

/* #30 — price-flag correction-loop affordance on the expanded card. */
.price-flag{display:inline-block;margin-left:6px;vertical-align:middle}
.price-flag-summary{display:inline-block;font-size:11px;font-weight:600;padding:2px 8px;border-radius:6px;
  background:var(--surface-sunken);color:var(--text-dim);cursor:pointer;list-style:none}
.price-flag-summary::-webkit-details-marker{display:none}
.price-flag-summary:hover{color:var(--text)}
.price-flag-body{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px;
  padding:10px;background:var(--surface-sunken);border:1px solid var(--border);border-radius:8px}
.price-flag-reason{font-size:12px;padding:4px 6px;border-radius:6px;border:1px solid var(--border);
  background:var(--surface);color:var(--text)}
.price-flag-label{font-size:12px;color:var(--text-dim);display:flex;gap:6px;align-items:center}
.price-flag-note{flex:1;min-width:160px;font-size:12px;padding:5px 8px;border-radius:6px;
  border:1px solid var(--border);background:var(--surface);color:var(--text)}
.price-flag-submit{font-size:12px;font-weight:600;padding:5px 12px;border:none;border-radius:6px;
  background:var(--color-buy);color:#fff;cursor:pointer}
.price-flag-submit:disabled{opacity:.6;cursor:default}
.price-flag-status{font-size:11px;color:var(--text-dim)}

/* #39 — admin data-quality summary pills. */
.admin-dq-summary{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:12px}
.admin-dq-pill{font-size:13px;padding:4px 10px;border-radius:8px;background:var(--surface-sunken);color:var(--text-dim)}
.admin-dq-pill strong{color:var(--text);font-size:15px}
.admin-dq-pill.admin-dq-high{background:var(--color-sell-bg);color:var(--color-sell)}
.admin-dq-pill.admin-dq-high strong{color:var(--color-sell)}
.admin-dq-pill.admin-dq-med{background:var(--color-hold-bg);color:var(--color-hold)}
.admin-dq-pill.admin-dq-med strong{color:var(--color-hold)}
.admin-dq-when{font-size:12px}

/* =========================================================================
   Phase D — Playbooks tab
   ========================================================================= */
.pb-intro{margin-bottom:16px}
.pb-list{display:flex;flex-direction:column;gap:14px}
.pb-card{background:var(--surface);border:1px solid var(--border-color);border-left:4px solid var(--color-accent-strong);
  border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:16px 18px}
.pb-card.pb-sell{border-left-color:var(--color-sell-strong)}
.pb-head{display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:start}
.pb-icon{font-size:22px;line-height:1}
.pb-title{font-size:16px;font-weight:700;margin:0;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.pb-side{font-size:10px;font-weight:800;letter-spacing:.05em;padding:2px 8px;border-radius:6px}
.pb-side-buy{background:var(--color-buy-bg);color:var(--color-buy)}
.pb-side-sell{background:var(--color-sell-bg);color:var(--color-sell)}
.pb-thesis{font-size:13.5px;color:var(--text-muted);margin:6px 0 0;line-height:1.55;max-width:80ch}
.pb-count{font-size:12px;color:var(--text-dim);white-space:nowrap;font-weight:600}
.pb-matches{margin-top:14px;display:flex;flex-direction:column;gap:2px}
.pb-match{display:grid;grid-template-columns:54px minmax(0,1.4fr) auto minmax(0,1fr) 34px;gap:12px;align-items:center;
  padding:9px 10px;border-radius:var(--radius-md);cursor:pointer}
.pb-match:hover{background:var(--surface-sunken)}
.pb-score{display:inline-flex;align-items:baseline;gap:3px;font-weight:700;font-size:13px;padding:2px 7px;border-radius:6px;justify-self:start}
.pb-score .pb-grade{font-size:11px;opacity:.85}
.pb-score.score-buy{background:var(--color-buy-bg);color:var(--color-buy)}
.pb-score.score-hold{background:var(--color-hold-bg);color:var(--color-hold)}
.pb-score.score-sell{background:var(--color-sell-bg);color:var(--color-sell)}
.pb-id{min-width:0;display:flex;flex-direction:column;line-height:1.25}
.pb-name{font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pb-meta{font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pb-price{font-size:13px;white-space:nowrap}
.pb-chg{font-size:12px;margin-left:4px}
.pb-why{min-width:0;display:flex;flex-wrap:wrap}
.pb-why .why-chip{margin:0 4px 0 0;font-size:11px;padding:2px 7px}
.pb-watch{background:transparent;border:0;cursor:pointer;font-size:16px;color:var(--text-dim);justify-self:end}
.pb-watch.is-watching{color:var(--color-accent)}
.pb-watch:hover{color:var(--color-accent)}
.pb-empty{font-size:13px;margin:6px 2px}
@media (max-width:680px){
  .pb-match{grid-template-columns:48px 1fr auto;gap:8px}
  .pb-why{display:none}
  .pb-watch{grid-column:3}
}

/* =========================================================================
   Phase D — tiered alert bell (Red / Amber / Blue)
   ========================================================================= */
/* Badge color by highest active tier */
.alerts-bell.tier-red   .alerts-bell-count{background:var(--color-sell);color:#fff}
.alerts-bell.tier-amber .alerts-bell-count{background:var(--color-hold);color:#1a1206}
.alerts-bell.tier-blue  .alerts-bell-count{background:var(--color-accent);color:#fff}

/* Tier toggle chips in the panel header */
.alerts-tier-toggles{display:flex;gap:6px;padding:8px 14px 4px}
.alerts-tier-toggle{display:inline-flex;align-items:center;gap:5px;font:inherit;font-size:11.5px;font-weight:600;
  padding:3px 9px;border-radius:999px;border:1px solid var(--border-strong);background:transparent;color:var(--text-muted);cursor:pointer}
.alerts-tier-toggle.off{opacity:.45}
.alerts-tier-toggle .alerts-tier-dot{width:8px;height:8px;border-radius:50%}
.alerts-tier-toggle.tier-red .alerts-tier-dot{background:var(--color-sell)}
.alerts-tier-toggle.tier-amber .alerts-tier-dot{background:var(--color-hold)}
.alerts-tier-toggle.tier-blue .alerts-tier-dot{background:var(--color-accent)}
.alerts-tier-toggle.on{border-color:var(--border-color);color:var(--text)}

/* Tier groups + headers */
.alerts-tier-group{padding-top:4px}
.alerts-tier-head{display:flex;align-items:center;gap:7px;font-size:11px;font-weight:700;letter-spacing:.05em;
  text-transform:uppercase;color:var(--text-dim);padding:8px 14px 4px}
.alerts-tier-head .alerts-tier-dot{width:8px;height:8px;border-radius:50%}
.alerts-tier-group.tier-red .alerts-tier-head .alerts-tier-dot{background:var(--color-sell)}
.alerts-tier-group.tier-amber .alerts-tier-head .alerts-tier-dot{background:var(--color-hold)}
.alerts-tier-group.tier-blue .alerts-tier-head .alerts-tier-dot{background:var(--color-accent)}
.alerts-tier-group.tier-red{border-left:3px solid var(--color-sell)}
.alerts-tier-group.tier-amber{border-left:3px solid var(--color-hold)}
.alerts-tier-group.tier-blue{border-left:3px solid var(--color-accent)}

/* Kind chip on each row */
.alerts-kind{font-size:9.5px;font-weight:800;letter-spacing:.03em;padding:2px 6px;border-radius:5px;flex:none;align-self:center;
  background:var(--surface-sunken);color:var(--text-muted)}
.alerts-kind-target{background:var(--color-sell-bg);color:var(--color-sell)}
.alerts-kind-sellwindow{background:var(--color-sell-bg);color:var(--color-sell)}
.alerts-kind-bigmover{background:var(--color-hold-bg);color:var(--color-hold)}
.alerts-kind-news{background:var(--color-accent-bg);color:var(--color-accent)}

/* =========================================================================
   Phase D — Auto-pilot (guided "do-it-for-me") moves
   ========================================================================= */
.ap-intro{margin-bottom:16px}
.ap-list{display:flex;flex-direction:column;gap:12px}
.ap-move{display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center;
  background:var(--surface);border:1px solid var(--border-color);border-left:4px solid var(--color-accent-strong);
  border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:14px 18px;cursor:pointer}
.ap-move:hover{box-shadow:var(--shadow-md)}
.ap-move.ap-sell{border-left-color:var(--color-sell-strong)}
.ap-move.ap-buy{border-left-color:var(--color-buy-strong)}
.ap-rank{font-size:20px;font-weight:800;color:var(--text-dim);width:24px;text-align:center;flex:none}
.ap-body{min-width:0}
.ap-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.ap-verb{font-size:11px;font-weight:800;letter-spacing:.05em;padding:3px 9px;border-radius:6px}
.ap-verb.buy{background:var(--color-buy-bg);color:var(--color-buy)}
.ap-verb.sell{background:var(--color-sell-bg);color:var(--color-sell)}
.ap-name{font-size:16px;font-weight:700}
.ap-score{font-size:12px;font-weight:700;padding:1px 7px;border-radius:6px}
.ap-score.score-buy{background:var(--color-buy-bg);color:var(--color-buy)}
.ap-score.score-hold{background:var(--color-hold-bg);color:var(--color-hold)}
.ap-score.score-sell{background:var(--color-sell-bg);color:var(--color-sell)}
.ap-meta{font-size:12px}
.ap-reason{font-size:13.5px;color:var(--text-muted);margin:6px 0 0}
.ap-reason .positive{color:var(--color-buy)} .ap-reason .negative{color:var(--color-sell)}
.ap-conf{font-size:10px;font-weight:700;padding:1px 6px;border-radius:5px;margin-left:4px}
.ap-conf.conf-high{background:var(--color-buy-bg);color:var(--color-buy)}
.ap-conf.conf-med{background:var(--color-hold-bg);color:var(--color-hold)}
.ap-conf.conf-low{background:var(--color-sell-bg);color:var(--color-sell)}
.ap-actions{display:flex;flex-direction:column;gap:6px;align-items:stretch;flex:none}
.ap-cta{white-space:nowrap}
.ap-quiet{background:var(--surface);border:1px solid var(--border-color);border-radius:var(--radius-lg);padding:18px;font-size:14px;color:var(--text-muted)}
@media (max-width:640px){
  .ap-move{grid-template-columns:auto 1fr;gap:10px}
  .ap-actions{grid-column:1 / -1;flex-direction:row}
}

/* =========================================================================
   Phase D — Catalysts timeline
   ========================================================================= */
.cat-intro{margin-bottom:16px}
.cat-timeline{display:flex;flex-direction:column;gap:2px;position:relative}
.cat-event{display:grid;grid-template-columns:130px 1fr auto;gap:14px;align-items:center;
  padding:13px 14px;border-radius:var(--radius-md);cursor:pointer;border-left:3px solid var(--border-strong)}
.cat-event:hover{background:var(--surface-sunken)}
.cat-event.is-soon{border-left-color:var(--color-hold-strong)}
.cat-when{display:flex;flex-direction:column;line-height:1.25}
.cat-countdown{font-weight:700;font-size:14px}
.cat-event.is-soon .cat-countdown{color:var(--color-hold)}
.cat-date{font-size:11.5px}
.cat-body{min-width:0}
.cat-label{font-size:15px;font-weight:600}
.cat-icon{margin-right:4px}
.cat-sport{font-weight:400;font-size:13px}
.cat-implied{font-size:12.5px;margin-top:3px}
.cat-touch{display:inline-block;margin-left:6px;font-size:11px;font-weight:600;color:var(--color-accent);
  background:var(--color-accent-bg);padding:1px 7px;border-radius:6px}
.cat-cta .cat-arrow{color:var(--text-dim);font-size:18px}
.cat-event:hover .cat-arrow{color:var(--color-accent)}
@media (max-width:640px){ .cat-event{grid-template-columns:96px 1fr auto;gap:10px} }

/* Phase D — flip kind chip in the alert bell (amber tier) */
.alerts-kind-flip{background:var(--color-hold-bg);color:var(--color-hold)}
