/* ── Reset & Variables ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* Core palette — Data-Rich Tool */
  --bg:          #1C1F21;
  --bg-2:        #242729;
  --bg-3:        #2A2E31;
  --bg-4:        #313639;
  --border:      #3A3F44;
  --border-2:    #4A5058;

  /* Typography */
  --text:        #E8ECF0;
  --text-2:      #8C9BAA;
  --text-3:      #5A6B7A;

  /* Accent — teal/mint */
  --accent:      #4ECDC4;
  --accent-bg:   rgba(78,205,196,0.09);

  /* Data colors */
  --green:       #8CFF91;
  --green-bg:    rgba(140,255,145,0.08);
  --green-muted: rgba(140,255,145,0.2);
  --red:         #E01A4F;
  --red-bg:      rgba(224,26,79,0.1);

  /* Edge Gold — high-confidence plays */
  --gold:        #D4AF37;
  --gold-bg:     rgba(212,175,55,0.1);

  /* Fonts */
  --font:        'IBM Plex Sans', 'Inter', sans-serif;
  --mono:        'IBM Plex Mono', 'Roboto Mono', monospace;

  /* Geometry */
  --r:           4px;
  --r-lg:        8px;
  --topbar-h:    52px;
  --filterbar-h: auto;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 13px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
.hidden { display: none !important; }
a { text-decoration: none; color: inherit; }
button { font-family: var(--font); cursor: pointer; }

/* ── Auth ───────────────────────────────────────────────────────────────────── */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(78,205,196,0.08) 0%, transparent 60%), var(--bg); overflow-y: auto; }
.auth-wrap { width: 100%; max-width: 380px; }
.auth-brand { text-align: center; margin-bottom: 28px; }
.brand-logo { font-size: 36px; margin-bottom: 10px; display: flex; justify-content: center; }
.brand-logo svg { filter: drop-shadow(0 0 16px rgba(78,205,196,0.25)); }
.auth-brand h1 { font-size: 26px; font-weight: 700; letter-spacing: 0.14em; color: var(--text); margin-bottom: 4px; text-transform: uppercase; }
.auth-brand p { color: var(--text-2); font-size: 12px; }
.auth-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; }
.auth-card h2 { font-size: 17px; font-weight: 600; margin-bottom: 18px; }
.form-group { margin-bottom: 13px; }
.form-group label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-2); margin-bottom: 5px; }
.form-group input { width: 100%; background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--r); padding: 8px 11px; color: var(--text); font-size: 13px; outline: none; transition: border-color 0.15s; }
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(78,205,196,0.08); }
.form-error { background: var(--red-bg); border: 1px solid var(--red); color: var(--red); border-radius: var(--r); padding: 8px 11px; font-size: 12px; margin-bottom: 10px; }
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: #000; border: none; border-radius: var(--r); padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity 0.15s; white-space: nowrap; }
.btn-primary:hover { opacity: 0.85; }
.btn-primary.full { width: 100%; }
.btn-primary.sm { padding: 6px 12px; font-size: 12px; }
.auth-switch { margin-top: 14px; text-align: center; color: var(--text-2); font-size: 12px; }
.auth-switch a { color: var(--accent); }

/* ── App Shell ──────────────────────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ── Top Bar ────────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  gap: 24px;
  flex-shrink: 0;
  z-index: 200;
  box-sizing: border-box;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-svg { display: block; flex-shrink: 0; }
.logo-text {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text);
  font-family: var(--font);
  text-transform: uppercase;
}
.topbar-section { font-size: 14.5px; color: var(--text-3); padding-left: 12px; border-left: 1px solid var(--border); white-space: nowrap; letter-spacing: 0.02em; flex-shrink: 0; min-width: 0; max-width: 440px; }
.topbar-section .ts-emoji { font-size: 20px; vertical-align: middle; }
.topbar-nav { display: flex; align-items: center; gap: 0; flex: 1; min-width: 0; overflow: hidden; }
.tnav { padding: 6px 9px; border-radius: var(--r); color: var(--text-2); font-size: 15.625px; font-weight: 500; transition: color 0.15s, background 0.15s; white-space: nowrap; }
.tnav:hover { color: var(--text); background: var(--bg-3); }
.tnav.active { color: var(--accent); background: var(--accent-bg); }
.topbar-right { display: flex; align-items: center; gap: 6px; margin-left: 8px; flex-shrink: 0; }
.nav-user { background: transparent; border: 1px solid var(--border-2); color: var(--text-3); border-radius: var(--r); padding: 5px 10px; font-size: 11px; font-weight: 600; font-family: var(--font); cursor: pointer; transition: color 0.15s, border-color 0.15s; white-space: nowrap; height: 28px; display: inline-flex; align-items: center; }
.nav-user:hover { color: var(--accent); border-color: var(--accent); }
.btn-upload-cta { background: transparent; border: 1px solid var(--accent); color: var(--accent); border-radius: var(--r); padding: 5px 10px; font-size: 11px; font-weight: 600; cursor: pointer; transition: background 0.15s; white-space: nowrap; height: 28px; display: inline-flex; align-items: center; }
.btn-upload-cta:hover { background: var(--accent-bg); }
.btn-signout { background: transparent; border: 1px solid var(--border-2); color: var(--text-3); border-radius: var(--r); padding: 5px 10px; font-size: 11px; font-weight: 600; cursor: pointer; transition: color 0.15s; white-space: nowrap; height: 28px; display: inline-flex; align-items: center; }
.btn-signout:hover { color: var(--red); border-color: var(--red); }

/* ── Filter Bar ─────────────────────────────────────────────────────────────── */
.filterbar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 100;
  position: relative;
}
.filterbar-inner {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 20px;
}
.fb-group { display: flex; flex-direction: column; gap: 3px; }
.fb-group label { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.fb-group select,
.fb-group input[type="date"] {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  padding: 6px 10px;
  outline: none;
  cursor: pointer;
  min-width: 110px;
  transition: border-color 0.15s;
}
.fb-group select:focus,
.fb-group input[type="date"]:focus { border-color: var(--accent); }
.fb-dates input { min-width: 120px; }
.btn-clear-filters { align-self: flex-end; background: transparent; border: 1px solid var(--border-2); color: var(--text-3); border-radius: var(--r); padding: 6px 12px; font-size: 12px; transition: color 0.15s; }
.btn-clear-filters:hover { color: var(--text); border-color: var(--text-2); }

/* More Filters popover */
.fb-more-wrap { position: relative; align-self: flex-end; }
.btn-more-filters {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  border-radius: var(--r);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-more-filters:hover,
.btn-more-filters.active { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.mf-chevron { font-size: 10px; transition: transform 0.2s; }
.btn-more-filters.active .mf-chevron { transform: rotate(180deg); }
.mf-badge {
  background: var(--accent);
  color: #000;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
}
.more-filters-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  z-index: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  min-width: 460px;
}
.mfp-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.mfp-grid .fb-group { min-width: 130px; flex: 1; }

/* Active Filter Tags */
.active-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 20px 10px;
}
.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-bg);
  border: 1px solid rgba(28,184,212,0.3);
  color: var(--accent);
  border-radius: 99px;
  padding: 2px 10px 2px 10px;
  font-size: 11px;
  font-weight: 500;
}
.filter-tag button { background: none; border: none; color: var(--accent); font-size: 13px; padding: 0; line-height: 1; opacity: 0.7; }
.filter-tag button:hover { opacity: 1; }
.tags-clear-all { font-size: 11px; color: var(--text-3); background: none; border: none; text-decoration: underline; cursor: pointer; }
.tags-clear-all:hover { color: var(--text); }

/* ── Main Content ───────────────────────────────────────────────────────────── */
.main-content { flex: 1; overflow-y: auto; padding: 16px 20px; background: var(--bg); }
.view { display: none; }
.view.active { display: block; }

/* ── View Header ────────────────────────────────────────────────────────────── */
.view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.view-header h2 { font-size: 21.25px; font-weight: 600; }
.showing-label { font-size: 12px; color: var(--accent); }

/* ── Performance Insights Row ───────────────────────────────────────────────── */
.insights-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 10px;
  margin-bottom: 14px;
}

.insight-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: border-color 0.2s;
}
.insight-card.positive { border-left: 3px solid var(--green); }
.insight-card.warning  { border-left: 3px solid #e67e22; }
.insight-card.danger   { border-left: 3px solid var(--red); background: rgba(224,26,79,0.05); }
.insight-card.neutral  { border-left: 3px solid var(--accent); }

.insight-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  font-family: var(--mono);
  line-height: 1;
}

.insight-body { min-width: 0; }

.insight-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.insight-label.pos  { color: var(--green); }
.insight-label.warn { color: #e67e22; }
.insight-label.info { color: var(--accent); }

.insight-headline {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.insight-sub {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--mono);
  line-height: 1.5;
}

/* ── KPI Bar ────────────────────────────────────────────────────────────────── */
.kpi-bar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 14px;
}
.kpi-cell { padding: 12px 16px; border-right: 1px solid var(--border); position: relative; }
.kpi-cell:last-child { border-right: none; }
.kpi-label { font-size: 11.75px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 5px; }
.kpi-val { font-size: 18.8px; font-weight: 700; font-family: var(--mono); color: var(--text); }
.kpi-val.pos { color: var(--green); }
.kpi-val.neg { color: var(--red); }

/* ── Dashboard Layout — 65/35 ────────────────────────────────────────────────── */
/* ── Dashboard Layout — two explicit 3-column rows ───────────────────────────── */
.dash-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: stretch;   /* all panels same height */
}
/* Panels inside the grid fill their cell height */
.dash-row-3 > .panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}
/* Content that should grow to fill panel — sport list, wins list, mme body, contest type table */
.dash-row-3 .sport-roi-list,
.dash-row-3 .wins-list,
.dash-row-3 #mme-panel-body,
.dash-row-3 .rp-table { flex: 1; }

/* Keep old classes in case referenced elsewhere but point to noop */
.dash-body  { display: contents; }
.dash-left  { display: contents; }
.dash-right { display: contents; }

@media (max-width: 1100px) { .dash-row-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .dash-row-3 { grid-template-columns: 1fr; } }

/* Sport ROI tile — flex layout */
.dash-sport-panel { height: 100%; }

.topbar-platform-logos { display: flex; align-items: center; gap: 10px; margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--border); }
.platform-logo { height: 18px; width: auto; opacity: 0.75; filter: brightness(0) invert(1); transition: opacity 0.15s; }
.platform-logo:hover { opacity: 1; }
.dk-logo { height: 16px; }
.fd-logo { height: 20px; }

.sport-roi-header,
.sport-roi-row {
  display: flex;
  align-items: center;
  padding-left: 12px;
  padding-right: 12px;
  gap: 8px;
}
.sport-roi-header {
  padding-top: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.sport-roi-row {
  padding-top: 9px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.sport-roi-row:last-child { border-bottom: none; }
.sport-roi-row:hover { background: var(--bg-3); }

/* Shared column widths */
.srh-sport,   .sport-roi-name    { width: 80px;  flex-shrink: 0; }
.srh-bar,     .sport-roi-bar-wrap { flex: 1; min-width: 20px; overflow: hidden; }
.srh-bar-label { overflow: visible; white-space: nowrap; }
.srh-roi,     .sport-roi-val     { width: 52px;  flex-shrink: 0; text-align: right; font-family: var(--mono); }
.srh-profit,  .sport-roi-profit  { width: 70px;  flex-shrink: 0; text-align: right; font-family: var(--mono); }
.srh-entries, .sport-roi-entries { width: 56px;  flex-shrink: 0; text-align: right; font-family: var(--mono); }

.srh-sport, .srh-roi, .srh-profit, .srh-entries, .srh-bar {
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em; color: var(--text-2);
}

.sport-roi-list { padding: 4px 0; }
.sport-roi-name {
  font-size: 12px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 5px;
  min-width: 0;
}
.sport-roi-label {
  font-size: 12px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sport-roi-emoji { font-size: 14px; line-height: 1; flex-shrink: 0; }
.sport-roi-bar-wrap { height: 5px; background: var(--bg-4); border-radius: 99px; overflow: hidden; }
.sport-roi-bar { height: 100%; border-radius: 99px; transition: width 0.5s ease; }
.sport-roi-bar.pos { background: var(--green); }
.sport-roi-bar.neg { background: var(--red); }
.sport-roi-val     { font-size: 11px; font-family: var(--mono); font-weight: 600; }
.sport-roi-profit  { font-size: 11px; font-family: var(--mono); }
.sport-roi-entries { font-size: 10px; font-family: var(--mono); color: var(--text-3); }

/* Load more row */
.load-more-row { padding: 10px 14px; border-top: 1px solid var(--border); text-align: center; }
.btn-load-more {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--accent);
  border-radius: var(--r);
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-load-more:hover { background: var(--accent-bg); border-color: var(--accent); }

/* ── Panels ─────────────────────────────────────────────────────────────────── */
.panel { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.panel-header h3 { font-size: 16.25px; font-weight: 600; }
.panel-badge { font-size: 10px; color: var(--text-3); background: var(--bg-3); border: 1px solid var(--border); padding: 2px 8px; border-radius: 99px; }

/* ── Chart ──────────────────────────────────────────────────────────────────── */
.chart-wrap { padding: 12px 16px 8px; position: relative; }
.chart-legend { display: flex; align-items: center; gap: 14px; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-3); }
.legend-bar { display: inline-block; width: 12px; height: 8px; background: rgba(28,184,212,0.35); border-radius: 2px; }
.legend-line { display: inline-block; width: 20px; height: 2px; background: var(--green); border-radius: 1px; }
.legend-green-box { display: inline-block; width: 14px; height: 10px; background: rgba(140,255,145,0.2); border: 1px solid rgba(140,255,145,0.4); border-radius: 2px; }

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
.data-table thead tr { background: var(--bg-3); }
.data-table th { padding: 9px 16px; text-align: left; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text-2); white-space: nowrap; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
/* Zebra striping */
.data-table tbody tr:nth-child(even) td { background: rgba(28,50,76,0.35); }
.data-table tbody tr:hover td { background: var(--bg-3) !important; color: var(--text); }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.clickable:hover td { background: var(--accent-bg) !important; }
.data-table tbody tr.row-active td { background: var(--accent-bg) !important; color: var(--text); border-left: 2px solid var(--accent); }
/* Bold Profit and ROI columns */
.data-table td.col-profit, .data-table td.col-roi { font-weight: 700; font-size: 12.5px; }

/* Right panel table — tighter */
.rp-table th { padding: 7px 10px; font-size: 11px; }
.rp-table td { padding: 8px 10px; font-size: 14px; }

/* ── Day of Week Heatmap ─────────────────────────────────────────────────────── */
.dow-heatmap {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--border);
}
.dow-cell {
  flex: 1;
  padding: 12px 4px 12px;
  text-align: center;
  border-right: 1px solid var(--border);
  position: relative;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.dow-cell:last-child { border-right: none; }
.dow-cell:hover { background: var(--bg-3); }
.dow-day { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; flex-shrink: 0; }
.dow-bar-track {
  width: 32px;
  flex: 1;
  min-height: 80px;
  background: var(--bg-4);
  border-radius: 4px;
  margin: 0 auto 8px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.dow-bar-fill {
  width: 100%;
  border-radius: 4px;
  transition: height 0.5s ease;
  min-height: 3px;
}
.dow-bar-fill.pos { background: linear-gradient(to top, rgba(140,255,145,0.9), rgba(140,255,145,0.4)); }
.dow-bar-fill.neg { background: linear-gradient(to top, rgba(224,26,79,0.9), rgba(224,26,79,0.4)); }
.dow-bar-fill.zero { background: var(--border-2); }
.dow-profit { font-size: 11px; font-family: var(--mono); font-weight: 600; line-height: 1.3; flex-shrink: 0; }
.dow-entries { font-size: 10px; color: var(--text-3); font-family: var(--mono); margin-top: 3px; flex-shrink: 0; }
.dow-cell.best-day { background: rgba(140,255,145,0.04); }
.dow-cell.worst-day { background: rgba(224,26,79,0.04); }
.dow-badge {
  position: absolute;
  top: 4px; right: 4px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
}
.dow-badge.best { background: rgba(140,255,145,0.2); color: var(--green); }
.dow-badge.worst { background: rgba(224,26,79,0.15); color: var(--red); }

/* Clickable insight cards */
.insight-card.clickable { cursor: pointer; }
.insight-card.clickable:hover { border-color: var(--accent); background: rgba(28,184,212,0.04); }
.insight-card .insight-filter-hint {
  font-size: 9px;
  color: var(--accent);
  font-family: var(--mono);
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.insight-card.clickable:hover .insight-filter-hint { opacity: 1; }

.pos { color: var(--green) !important; }
.neg { color: var(--red) !important; }
.empty-cell { text-align: center; padding: 36px 16px !important; color: var(--text-3) !important; font-family: var(--font) !important; font-size: 12px !important; }

/* Platform icons */
.src-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 3px; font-size: 9px; font-weight: 700; margin-right: 8px; vertical-align: middle; flex-shrink: 0; }
.src-dk { background: rgba(255,140,0,0.15); color: #ff8c00; }
.src-fd { background: rgba(28,184,212,0.15); color: var(--accent); }
.td-contest { display: flex; align-items: center; }

/* ── Biggest Wins ───────────────────────────────────────────────────────────── */
.wins-list { }
.win-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid var(--border); gap: 10px; transition: background 0.12s; }
.win-item:last-child { border-bottom: none; }
.win-item:hover { background: var(--bg-3); }
.win-left { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.win-emoji-badge { font-size: 18px; line-height: 1; flex-shrink: 0; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--bg-3); border-radius: 8px; border: 1px solid var(--border); }
.win-info { min-width: 0; flex: 1; }
.win-name { font-size: 11px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.win-meta { font-size: 10px; color: var(--text-3); font-family: var(--mono); display: block; margin-top: 2px; }
.win-site { font-weight: 600; }
.win-dk { color: #ff8c00; }
.win-fd { color: var(--accent); }
.win-amount { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--green); flex-shrink: 0; }

/* ── Pagination ─────────────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.page-info { flex: 1; font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.btn-page { background: var(--bg-3); border: 1px solid var(--border); color: var(--text-2); padding: 5px 12px; border-radius: var(--r); font-size: 12px; }
.btn-page:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-page:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Upload ─────────────────────────────────────────────────────────────────── */
.upload-dropzone { border: 2px dashed var(--border-2); border-radius: var(--r-lg); padding: 40px 20px; text-align: center; transition: all 0.15s; margin-bottom: 14px; }
.upload-dropzone.drag-over { border-color: var(--accent); background: var(--accent-bg); }
.dropzone-icon { font-size: 32px; color: var(--text-3); display: block; margin-bottom: 10px; }
.upload-dropzone p { color: var(--text-2); font-size: 13px; margin-bottom: 16px; }
.upload-status { padding: 11px 14px; border-radius: var(--r); font-size: 12px; font-family: var(--mono); margin-bottom: 14px; }
.upload-status.success { background: var(--green-bg); border: 1px solid var(--green); color: var(--green); }
.upload-status.error { background: var(--red-bg); border: 1px solid var(--red); color: var(--red); }
.export-guides-wrap { margin-top: 20px; padding: 20px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg); }
.export-guides-wrap h3 { font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.export-guides { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 500px; }
.export-guide h4 { font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.export-guide ol { padding-left: 16px; color: var(--text-2); font-size: 12px; line-height: 2.2; }

/* ── Entries Table ──────────────────────────────────────────────────────────── */
.entries-table th, .entries-table td { padding: 9px 10px; }
.col-contest { min-width: 200px; max-width: 280px; }
.col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 260px; }

.type-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.type-gpp      { background: rgba(28,184,212,0.12);  color: var(--accent); }
.type-h2h      { background: rgba(245,158,11,0.12);  color: #f59e0b; }
.type-cash     { background: rgba(140,255,145,0.12);   color: var(--green); }
.type-showdown { background: rgba(168,85,247,0.12);  color: #a855f7; }
.type-qualifier{ background: rgba(239,68,68,0.10);   color: #f87171; }
.type-other    { background: var(--bg-4); color: var(--text-3); }

/* ── Finish Position ────────────────────────────────────────────────────────── */
.finish-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.finish-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.fsc-icon { font-size: 22px; flex-shrink: 0; }
.fsc-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-3); margin-bottom: 4px; }
.fsc-value { font-size: 22px; font-weight: 700; font-family: var(--mono); color: var(--text); line-height: 1; }
.fsc-value.pos { color: var(--green); }
.fsc-value.warn { color: #e67e22; }
.fsc-sub { font-size: 10px; color: var(--text-3); margin-top: 3px; font-family: var(--mono); }

/* Strategy tip */
.strategy-tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  margin-bottom: 12px;
  border-radius: var(--r-lg);
  border: 1px solid;
}
.strategy-tip.good    { background: rgba(140,255,145,0.06);  border-color: rgba(140,255,145,0.25); }
.strategy-tip.warning { background: rgba(230,126,34,0.07); border-color: rgba(230,126,34,0.3); }
.strategy-tip.info    { background: rgba(28,184,212,0.06); border-color: rgba(28,184,212,0.25); }
.tip-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.tip-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: 4px; }
.strategy-tip.good    .tip-label { color: var(--green); }
.strategy-tip.warning .tip-label { color: #e67e22; }
.strategy-tip.info    .tip-label { color: var(--accent); }
.tip-text { font-size: 13px; color: var(--text); line-height: 1.5; }

/* Zone filter buttons */
.finish-zone-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.zone-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--r);
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.zone-btn:hover { color: var(--text); border-color: var(--border-2); }
.zone-btn.active      { background: var(--bg-4); color: var(--text);   border-color: var(--border-2); }
.zone-btn.itm.active  { background: rgba(140,255,145,0.15);  color: var(--green); border-color: rgba(140,255,145,0.4); }
.zone-btn.bubble.active { background: rgba(230,126,34,0.12); color: #e67e22; border-color: rgba(230,126,34,0.4); }
.zone-btn.mid.active  { background: rgba(28,184,212,0.12); color: var(--accent); border-color: rgba(28,184,212,0.4); }
.zone-btn.bottom.active { background: rgba(224,26,79,0.12); color: var(--red); border-color: rgba(224,26,79,0.4); }

/* Detail panel */
.finish-detail-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.finish-detail-col { padding: 14px 16px; }
.finish-detail-col:first-child { border-right: 1px solid var(--border); }
.finish-detail-col h4 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin-bottom: 10px; }

.detail-entry-list { display: flex; flex-direction: column; gap: 6px; }
.detail-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: var(--bg-3);
  border-radius: var(--r);
  font-size: 12px;
  gap: 10px;
}
.detail-entry-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.detail-entry-pct  { font-family: var(--mono); font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.detail-entry-profit { font-family: var(--mono); font-size: 11px; flex-shrink: 0; }

.detail-stat-grid { display: flex; flex-direction: column; gap: 8px; }
.detail-stat-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.detail-stat-row:last-child { border-bottom: none; }
.detail-stat-label { color: var(--text-3); }
.detail-stat-val { font-family: var(--mono); font-weight: 600; color: var(--text); }

@media (max-width: 900px) {
  .finish-stats-row { grid-template-columns: repeat(2,1fr); }
  .finish-detail-body { grid-template-columns: 1fr; }
  .finish-detail-col:first-child { border-right: none; border-bottom: 1px solid var(--border); }
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1200px) { .kpi-bar { grid-template-columns: repeat(4,1fr); } }
@media (max-width: 900px)  { .kpi-bar { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 640px)  { .kpi-bar { grid-template-columns: repeat(2,1fr); } .filterbar-inner { gap: 8px; } }

/* ── Upload Grid ────────────────────────────────────────────────────────────── */
/* ── Upload layout: left=CSV, right=ext+history stacked ─────────────────────── */
.upload-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.upload-left { display: flex; flex-direction: column; }
.upload-left .panel { flex: 1; }
.upload-right { display: grid; grid-template-rows: auto 1fr; gap: 12px; }

/* ── Upload panels condensed to .75x height ──────────────────────────────────── */
.upload-panel .panel-header { padding: 7px 14px; }
.upload-panel-body { padding: 8px 14px; }
.export-steps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 3px; }
.export-step ol { padding-left: 14px; color: var(--text-2); font-size: 11px; line-height: 1.65; }

/* Chrome Extension tile: row layout, 1.25x text */
.upload-panel-ext .upload-panel-body { padding: 10px 14px; }
.ext-webstore-msg { display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 4px 0; min-height: unset; text-align: left; }
.ext-logo-lockup { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.ext-logo-wordmark { font-family: 'IBM Plex Sans', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .12em; color: #fff; text-transform: uppercase; white-space: nowrap; }
.ext-webstore-text { font-size: 14px; color: var(--text-2); line-height: 1.65; max-width: none; flex: 1; }
.ext-webstore-link { color: var(--accent); font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 800px) { .upload-layout { grid-template-columns: 1fr; } }
.upload-desc { font-size: 12px; color: var(--text-2); margin-bottom: 14px; line-height: 1.6; }
.upload-dropzone { border: 2px dashed var(--border-2); border-radius: var(--r-lg); padding: 28px 20px; text-align: center; transition: all 0.15s; margin-bottom: 14px; }
.upload-dropzone.drag-over { border-color: var(--accent); background: var(--accent-bg); }
.dropzone-icon { font-size: 28px; color: var(--text-3); display: block; margin-bottom: 8px; }
.upload-dropzone p { color: var(--text-2); font-size: 12px; margin-bottom: 12px; }

.export-steps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.export-step-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.export-step ol { padding-left: 16px; color: var(--text-2); font-size: 11px; line-height: 2; }

/* ── Auto Import Cards ──────────────────────────────────────────────────────── */
.auto-import-card { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; }
.ai-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ai-card-title { font-size: 13px; font-weight: 600; color: var(--text); }
.ai-card-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.ai-steps { background: var(--bg-4); border-radius: var(--r); padding: 10px 12px; margin-bottom: 4px; }
.ai-step-label { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.ai-step-list { padding-left: 16px; color: var(--text-2); font-size: 11px; line-height: 2.1; }
.ai-step-list strong { color: var(--text); }
.ai-step-list code { background: var(--bg-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 3px; font-family: var(--mono); font-size: 10px; color: var(--accent); }
.form-group textarea { width: 100%; background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--r); padding: 8px 10px; color: var(--text); font-size: 11px; font-family: var(--mono); outline: none; resize: vertical; transition: border-color 0.15s; }
.form-group textarea:focus { border-color: var(--accent); }

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

/* ── Sort Pills (Sport ROI tile) ─────────────────────────────────────────────── */
.sort-pills {
  display: flex;
  gap: 4px;
}
.sort-pill {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-3);
  border-radius: 99px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.03em;
}
.sort-pill:hover { color: var(--text-2); border-color: var(--text-3); }
.sort-pill.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }

/* ── Sortable Table Headers ───────────────────────────────────────────────────── */
.th-sort {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.15s;
}
.th-sort:hover { color: var(--text-2); }
.th-sort.sort-asc,
.th-sort.sort-desc { color: var(--accent); }
.sort-icon {
  display: inline-block;
  font-size: 9px;
  opacity: 0.35;
  margin-left: 3px;
  transition: opacity 0.15s;
}
.th-sort:hover .sort-icon { opacity: 0.7; }
.th-sort.sort-asc  .sort-icon,
.th-sort.sort-desc .sort-icon { opacity: 1; }
.th-sort.sort-asc  .sort-icon::after { content: '↑'; }
.th-sort.sort-desc .sort-icon::after { content: '↓'; }
.th-sort.sort-asc  .sort-icon,
.th-sort.sort-desc .sort-icon { font-size: 0; } /* hide ↕, show after pseudo */

/* Show All button */
.btn-show-all {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--accent);
  border-radius: var(--r);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-show-all:hover { background: var(--accent-bg); }

/* ── Chart Legend (refactored) ───────────────────────────────────────────────── */
.legend-area-fill {
  display: inline-block;
  width: 20px; height: 10px;
  background: linear-gradient(to right, rgba(140,255,145,0.55), rgba(140,255,145,0.15));
  border: 1px solid rgba(140,255,145,0.5);
  border-radius: 2px;
}
.legend-bar-green {
  display: inline-block;
  width: 10px; height: 12px;
  background: rgba(140,255,145,0.8);
  border-radius: 2px;
}
.legend-bar-red {
  display: inline-block;
  width: 10px; height: 12px;
  background: rgba(220,60,50,0.85);
  border-radius: 2px;
}

/* ── Scatter Plot ────────────────────────────────────────────────────────────── */
.scatter-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
}
.scatter-insight {
  display: block;
  padding: 12px 16px 14px;
  font-size: 12px;
  color: var(--text-2);
  border-top: 1px solid var(--border);
  line-height: 1.7;
  background: var(--bg-3);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.scatter-insight strong { color: var(--text); font-weight: 600; }
.scatter-insight .pos   { color: var(--green); }
.scatter-insight .neg   { color: var(--red); }

/* ── MME Panel ───────────────────────────────────────────────────────────────── */
.mme-grid {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.mme-col {
  flex: 1;
  padding: 12px 14px;
}
.mme-col-empty {
  flex: 1;
  padding: 12px 14px;
  opacity: 0.4;
}
.mme-divider {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
}
.mme-col-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 10px;
  letter-spacing: 0.03em;
  text-align: center;
}
.mme-col-na {
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
  padding: 10px 0;
}
.mme-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  gap: 6px;
}
.mme-stat:last-child { border-bottom: none; }
.mme-stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  flex-shrink: 0;
}
.mme-stat-val {
  font-size: 15px;
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
  text-align: right;
}
.mme-tip {
  padding: 10px 14px;
  font-size: 11px;
  line-height: 1.6;
  border-top: 1px solid var(--border);
  color: var(--text-2);
}
.mme-tip.pos-tip { background: rgba(140,255,145,0.05); color: var(--text-2); }
.mme-tip.neg-tip { background: rgba(28,184,212,0.05); color: var(--text-2); }
.mme-tip strong  { color: var(--text); }

/* ── Upload History Delete ───────────────────────────────────────────────────── */
.upload-filename {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11px;
}
.upload-actions { text-align: right; padding-right: 12px !important; }
.btn-delete-upload {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-3);
  border-radius: var(--r);
  padding: 4px 9px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-delete-upload:hover {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
}

/* ── Analytics View ──────────────────────────────────────────────────────────── */
#view-analytics { font-size: 1.2em; }
#view-analytics .panel-header h3 { font-size: 16.8px; }
#view-analytics .panel-badge { font-size: 13.2px; }
#view-analytics .chart-how-to { font-size: 14px; }
#view-analytics .nbh-label { font-size: 11px; }
#view-analytics .nbh-val { font-size: 13px; }
#view-analytics .nbh-cell { font-size: 13px; }
#view-analytics .dow-day { font-size: 15.6px; }
#view-analytics .dow-val { font-size: 15px; }
#view-analytics .dow-label { font-size: 12px; }
#view-analytics .sust-stat-label { font-size: 13.2px; }
#view-analytics .sust-stat-val { font-size: 20.4px; }
#view-analytics .goal-stat-label { font-size: 13.2px; }
#view-analytics .goal-stat-val { font-size: 20.4px; }
#view-analytics .goal-input-group label { font-size: 13px; }
#view-analytics .scatter-insight { font-size: 13px; }
.analytics-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.analytics-panel-wide {
  width: 100%;
}

/* ── Sport ROI — clickable column headers ────────────────────────────────────── */
.th-sort-hdr {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
  white-space: nowrap;
}
.th-sort-hdr:hover { color: var(--accent); }
.th-sort-hdr:hover .sort-icon { opacity: 0.9; }
.sort-hdr-active   { color: var(--accent) !important; }
.sort-hdr-active .sort-icon { opacity: 1 !important; }

/* ── Chart How-To Description ────────────────────────────────────────────────── */
.chart-how-to {
  display: flex;
  gap: 8px;
  padding: 9px 16px 10px;
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.6;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
}
.chart-how-to .cht-icon { flex-shrink: 0; font-size: 13px; margin-top: 1px; }
.chart-how-to strong { color: var(--text-2); }

/* ── Analytics 2-col row ─────────────────────────────────────────────────────── */
.analytics-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 900px) { .analytics-row-2col { grid-template-columns: 1fr; } }

/* ── Buy-in × Sport Heatmap ──────────────────────────────────────────────────── */
.buyin-heatmap-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0 4px;
}
.bhm-section { padding: 0 14px 8px; }
.bhm-section-title {
  font-size: 9px; font-weight: 700; letter-spacing: .08em;
  color: var(--text-3); text-transform: uppercase;
  margin-bottom: 6px; margin-top: 6px;
}
.bhm-divider { height: 1px; background: var(--border); margin: 4px 14px 8px; }
.bhm-header-row, .bhm-row {
  display: flex; align-items: center; gap: 10px;
  padding: 3px 0;
}
.bhm-label {
  width: 62px; flex-shrink: 0;
  font-size: 11px; font-weight: 600; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bhm-cell {
  height: 22px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  min-width: 40px; transition: opacity 0.2s;
}
.bhm-val {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  white-space: nowrap;
}
.bhm-val.pos { color: rgba(140,255,145,1); }
.bhm-val.neg { color: rgba(220,90,80,1); }
.bhm-entries {
  width: 46px; flex-shrink: 0;
  font-size: 10px; font-family: var(--mono); color: var(--text-3); text-align: right;
}

/* ── Finish Position Guide ───────────────────────────────────────────────────── */
.finish-guide {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px 20px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.7;
}
.fg-section {}
.fg-title {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 6px;
}
.finish-guide p { margin: 0 0 6px; }
.fg-list {
  margin: 4px 0 0 16px;
  padding: 0;
  list-style: disc;
}
.fg-list li { margin-bottom: 6px; }
.fg-list strong { color: var(--text); }

/* ── .pos / .neg / .warn utility (global) ───────────────────────────────────── */
.pos  { color: var(--green) !important; }
.neg  { color: var(--red)   !important; }
.warn { color: var(--gold)  !important; }

/* Also bold Profit/ROI in all data tables ──────────────────────────────────── */
.data-table td.col-profit { font-weight: 700; font-size: 12.5px; }
.data-table td.col-roi    { font-weight: 700; font-size: 12.5px; }
/* Bold the text in any td that contains a direct profit/roi value (via JS cls) */
.data-table td:has(.pos),
.data-table td:has(.neg) { font-weight: 700; }

/* ── 9-Box ROI Heatmap ──────────────────────────────────────────────────────── */
.ninebox-wrap   { padding: 12px 16px 10px; overflow-x: auto; }
.nbh-table      { display: flex; flex-direction: column; gap: 4px; min-width: 340px; }
.nbh-row        { display: flex; align-items: stretch; gap: 4px; }
.nbh-label      {
  width: 72px; flex-shrink: 0;
  font-size: 11px; font-weight: 700; color: var(--text-2);
  display: flex; align-items: center;
  padding: 0 6px 0 0;
  white-space: nowrap;
  letter-spacing: 0.03em;
}
.nbh-corner     { font-size: 8px; color: var(--text-3); cursor: pointer; }
.nbh-cell       {
  flex: 1; min-width: 62px; height: 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 5px; font-family: var(--mono); font-size: 13px; font-weight: 800;
  transition: filter 0.15s, transform 0.1s;
  background: var(--bg-4);
  cursor: pointer;
  /* Always use light text for readability on any background color */
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.nbh-cell:hover { filter: brightness(1.3); transform: scale(1.04); }
/* Override pos/neg inside cells — always white on colored backgrounds */
.nbh-cell span.pos, .nbh-cell span.neg { color: #ffffff !important; }
.nbh-count      { font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.75); letter-spacing: 0; text-shadow: none; }
.nbh-header     { background: var(--bg-3) !important; font-size: 10px; font-weight: 700; letter-spacing: .07em; color: var(--text-2); height: 30px; cursor: pointer; text-shadow: none; }
.nbh-header:hover { color: var(--accent); }
.nbh-empty      { color: var(--text-3); font-size: 10px; background: var(--bg-3) !important; cursor: default; text-shadow: none; color: var(--text-3) !important; }
.nbh-legend     { font-size: 11px; color: var(--text-3); padding: 8px 0 2px; text-align: center; }
.nbh-leg-green  { color: var(--green); }
.nbh-leg-red    { color: var(--red); }

/* ── Bankroll Goal Pacing Tool ──────────────────────────────────────────────── */
.goal-tool        { padding: 16px; }
.goal-inputs      { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.goal-input-group { display: flex; flex-direction: column; gap: 4px; }
.goal-input-group label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-3);
}
.goal-input-group input {
  width: 130px; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r); padding: 7px 10px; color: var(--text);
  font-size: 13px; font-family: var(--mono); outline: none;
  transition: border-color .15s;
}
.goal-input-group input:focus { border-color: var(--accent); }
.goal-progress-bar {
  height: 8px; background: var(--bg-4); border-radius: 99px;
  overflow: hidden; margin-bottom: 14px;
}
.goal-progress-fill {
  height: 100%; border-radius: 99px; transition: width .5s ease;
}
.goal-progress-fill.achieved { background: var(--green); }
.goal-progress-fill.on-track { background: var(--accent); }
.goal-progress-fill.behind   { background: var(--gold); }
.goal-stats-row  { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.goal-stat       { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--r); padding: 8px 12px; min-width: 110px; }
.goal-stat-label { font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 3px; }
.goal-stat-val   { font-size: 14px; font-weight: 700; font-family: var(--mono); color: var(--text); }
.goal-result     { margin-bottom: 4px; }

/* ── Sustainability Calculator ──────────────────────────────────────────────── */
.sustainability-wrap { padding: 0; }
.sust-body       { padding: 16px; }
.sust-stats      { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.sust-stat       { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--r); padding: 8px 12px; min-width: 130px; }
.sust-stat-label { font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 3px; }
.sust-stat-val   { font-size: 14px; font-weight: 700; font-family: var(--mono); color: var(--text); }
.sust-stat-sub   { font-size: 10px; color: var(--text-3); font-family: var(--mono); margin-top: 3px; line-height: 1.5; }
.sust-stat-wide  { min-width: 220px; }
.sust-note       { font-size: 11px; color: var(--text-3); line-height: 1.6; border-top: 1px solid var(--border); padding-top: 10px; }

/* ── DoW bar colors updated for new palette ─────────────────────────────────── */
/* DoW bar fill colors defined in base .dow-bar-fill rules above */

/* ── Extension Connect Panel ─────────────────────────────────────────────────── */
.ext-step {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.ext-step:last-of-type { border-bottom: none; }
.ext-step-num {
  width: 26px; height: 26px;
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--accent);
  flex-shrink: 0; margin-top: 2px;
}
.ext-step-body { flex: 1; min-width: 0; }
.ext-step-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.token-display-wrap {
  display: flex; gap: 8px; align-items: center;
}
.token-display {
  flex: 1;
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}
.token-display.has-token { color: var(--accent); border-color: var(--accent-bg); }
.btn-copy-token {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--r);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.btn-copy-token:hover { opacity: 0.85; }
.btn-copy-token:disabled { opacity: 0.35; cursor: default; }
.token-copy-confirm {
  font-size: 11px;
  color: var(--green);
  margin-top: 5px;
  font-weight: 600;
}

/* ── Delete by source buttons ────────────────────────────────────────────────── */
.btn-delete-source {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-3);
  border-radius: var(--r);
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-delete-source:hover { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.btn-delete-all { border-color: var(--red); color: var(--red); }
.btn-delete-all:hover { background: var(--red); color: #fff; }

/* ── Biggest Wins expand ─────────────────────────────────────────────────────── */
.wins-expand-row {
  padding: 8px 14px 10px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.btn-wins-expand {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--accent);
  border-radius: var(--r);
  padding: 5px 16px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-wins-expand:hover { background: var(--accent-bg); border-color: var(--accent); }

/* ── Sport ROI expand row ────────────────────────────────────────────────────── */
.sport-roi-expand-row {
  padding: 8px 12px 10px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.btn-sport-expand {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--accent);
  border-radius: var(--r);
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-sport-expand:hover { background: var(--accent-bg); border-color: var(--accent); }

/* ── Bankroll Management ─────────────────────────────────────────────────────── */
.bm-filters {
  display: flex; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap; align-items: flex-end;
  background: var(--bg-2);
}
.bm-filters .fb-group { display: flex; flex-direction: column; gap: 3px; }
.bm-filters .fb-group label { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.bm-filters .fb-group select {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--r);
  color: var(--text); font-size: 12px; font-family: var(--font);
  padding: 6px 10px; outline: none; cursor: pointer; min-width: 120px;
  transition: border-color 0.15s;
}
.bm-filters .fb-group select:focus, .bm-filters .fb-group select:hover { border-color: var(--accent); }
.bm-expected-pl {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.bm-pl-header {
  font-size: 11px; font-weight: 600; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 10px;
}
.bm-pl-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 10px;
}
.bm-pl-cell {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r); padding: 10px 12px;
}
.bm-path-cell {
  background: rgba(62,207,178,.06); border: 1px solid rgba(62,207,178,.25);
}
.bm-path-label {
  font-size: 10px; font-weight: 700; color: var(--mint);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 2px;
}
.bm-path-sport { font-size: 11px; color: var(--text-2); margin-bottom: 4px; }
.bm-path-action { font-size: 11px; color: var(--text-3); line-height: 1.5; border-top: 1px solid rgba(62,207,178,.15); padding-top: 6px; margin-top: 2px; }
.bm-path-empty-msg { font-size: 12px; color: var(--text-3); line-height: 1.6; margin-top: 6px; }
.bm-pl-label { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.bm-pl-val { font-size: 18px; font-weight: 700; font-family: var(--mono); margin-bottom: 3px; }
.bm-pl-sub { font-size: 10px; color: var(--text-3); font-family: var(--mono); }

/* ── DFS News ─────────────────────────────────────────────────────────────────── */
.news-filters {
  display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.news-filters select {
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--r); padding: 7px 12px;
  font-size: 13px; cursor: pointer;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.news-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px;
  text-decoration: none; color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.news-card:hover { border-color: var(--accent); background: var(--bg-3); }
.news-card-sport { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.news-topic-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 99px;
}
.news-card-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  line-height: 1.4;
}
.news-card-summary {
  font-size: 12px; color: var(--text-2); line-height: 1.6; flex: 1;
}
.news-card-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text-3); font-family: var(--mono);
  border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px;
}
.news-loading, .news-error {
  grid-column: 1/-1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; padding: 60px 20px; color: var(--text-3); font-size: 13px;
}
.news-spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Heatmap sortable headers ────────────────────────────────────────────────── */
.nbh-sortable { cursor: pointer; user-select: none; transition: background 0.12s; }
.nbh-sortable:hover { background: var(--bg-3) !important; }
.nbh-sort-active { background: var(--accent-bg) !important; color: var(--accent) !important; }
.nbh-sort-icon { font-size: 9px; opacity: 0.7; }

/* ── Tile analysis text ──────────────────────────────────────────────────────── */
.tile-analysis {
  padding: 12px 16px 14px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.7;
  border-top: 1px solid var(--border);
  background: var(--bg-3);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.tile-analysis-top {
  padding: 10px 16px 10px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.7;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
  border-radius: 0;
}
.tile-analysis-top:empty { display: none; }
.tile-analysis strong { font-weight: 600; }
.tile-analysis:empty { display: none; }

/* ── Prize pool + buy-in chart label scale 1.25x ────────────────────────────── */
#view-analytics .tile-analysis { font-size: 13.5px; }
#view-analytics .tile-analysis-top { font-size: 13.5px; }

/* DoW panel fills height with no dead space */
#view-analytics .panel:has(#dow-heatmap) {
  display: flex;
  flex-direction: column;
}
#view-analytics .panel:has(#dow-heatmap) .panel-header { flex-shrink: 0; }
#view-analytics #dow-heatmap { flex: 1; min-height: 220px; }
#view-analytics #dow-analysis { flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   GAME PLAN HERO MODULE
═══════════════════════════════════════════════════════════════ */
.gp-hero {
  margin-bottom: 16px;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  box-shadow: 0 0 0 1px rgba(78,205,196,0.08), 0 0 32px rgba(78,205,196,0.06);
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.gp-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(78,205,196,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.gp-hero-signal { flex: 1; min-width: 260px; }
.gp-signal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--mono);
  margin-bottom: 8px;
}
.gp-signal-badge.gold { color: var(--gold); }
.gp-signal-badge.warn    { color: var(--red); }
.gp-signal-badge.caution { color: var(--red); }
.gp-hero-directive {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.gp-hero-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.gp-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 80px;
}
.gp-stat-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  font-family: var(--mono);
}
.gp-stat-val {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text);
}
.gp-stat-val.pos { color: var(--green); }
.gp-stat-val.neg { color: var(--red); }
.gp-stat-val.gold { color: var(--gold); }

/* ══════════════════════════════════════════════════════════════
   CONFIDENCE ENGINE
═══════════════════════════════════════════════════════════════ */
.confidence-engine { display: flex; flex-direction: column; }
.ce-inputs { flex-shrink: 0; }
.ce-result, .ce-placeholder { flex: 1; }
.ce-inputs {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.ce-input-group { display: flex; flex-direction: column; gap: 4px; }
.ce-input-group label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-3);
}
.ce-input-group select {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r); color: var(--text); font-size: 12px;
  font-family: var(--font); padding: 7px 10px; outline: none; cursor: pointer;
  transition: border-color 0.15s;
}
.ce-input-group select:focus { border-color: var(--accent); }

.ce-placeholder {
  padding: 28px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ce-placeholder-icon {
  font-size: 28px;
  color: var(--border-2);
  line-height: 1;
}

.ce-result {
  padding: 10px 14px;
  font-size: 1.33em;
}
.ce-score-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}
.ce-score-dial {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}
.ce-score-dial svg { width: 100%; height: 100%; }
.ce-score-number {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
}
.ce-score-big { font-size: 1.1em; line-height: 1; }
.ce-score-max { font-size: 0.6em; color: var(--text-3); }
.ce-verdict {
  flex: 1;
}
.ce-verdict-label {
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--mono);
  margin-bottom: 4px;
}
.ce-verdict-label.play  { color: var(--green); }
.ce-verdict-label.lean  { color: var(--gold); }
.ce-verdict-label.caution { color: var(--gold); }
.ce-verdict-label.pass  { color: var(--red); }
.ce-verdict-text {
  font-size: 0.79em;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.ce-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ce-metric {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 10px;
}
.ce-metric-label { font-size: 0.51em; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 3px; }
.ce-metric-val { font-size: 0.85em; font-weight: 700; font-family: var(--mono); }
.ce-metric-val.pos { color: var(--green); }
.ce-metric-val.neg { color: var(--red); }
.ce-action {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-3);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}
.ce-action.play   { border-color: var(--green); }
.ce-action.lean   { border-color: var(--gold); }
.ce-action.caution{ border-color: var(--gold); }
.ce-action.pass   { border-color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   COLLAPSIBLE MONTHLY TABLE
═══════════════════════════════════════════════════════════════ */
.collapsible-header { cursor: pointer; user-select: none; }
.collapsible-header:hover { background: var(--bg-3); }
.collapse-chevron { font-size: 11px; color: var(--text-3); transition: transform 0.2s; }
.collapse-chevron.collapsed { transform: rotate(180deg); }
#monthly-collapse-body { overflow: hidden; transition: max-height 0.25s ease; }
#monthly-collapse-body.collapsed { max-height: 0 !important; }

/* ══════════════════════════════════════════════════════════════
   PANEL SPACING FIXES FOR NEW LAYOUT
═══════════════════════════════════════════════════════════════ */
/* dash-row-3 handles spacing via gap */

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 860px) {
  .gp-hero { flex-direction: column; gap: 14px; }
  .gp-hero-stats { width: 100%; }
}
@media (max-width: 640px) {
  .gp-hero { padding: 14px; }
  .gp-hero-directive { font-size: 15px; }
  .kpi-bar { grid-template-columns: repeat(2, 1fr); }
  .insights-row { grid-template-columns: 1fr; }
  .topbar-section { display: none; }
}

/* Equal-height row helpers */
.dash-row-3 .chart-wrap { flex: 1; min-height: 160px; }
.dash-row-3 .panel-header { flex-shrink: 0; }

/* ── Platform logos in topbar ───────────────────────────────────────────────── */
.topbar-platforms {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 14px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  height: 100%;
  flex-shrink: 0;
}

/* Each logo container — 30px tall, width auto from aspect ratio */
.tp-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  opacity: 0.85;
  transition: opacity 0.15s, transform 0.15s;
  text-decoration: none;
}
.tp-logo:hover { opacity: 1; transform: scale(1.08); }

/* Shared image rule — height fixed, width scales to native aspect ratio */
.tp-img {
  height: 30px;
  width: auto;
  display: block;
  border-radius: 4px;
}

@media (max-width: 900px) { .topbar-platforms { display: none; } }

/* ── Free-tier upsell button in filterbar ───────────────────────────────────── */
.btn-upsell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  background: var(--green);
  color: #0a1a0a;
  border: none;
  border-radius: var(--r);
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}
.btn-upsell:hover { opacity: 0.88; transform: translateY(-1px); }

/* upload warn state */
.upload-status.warn {
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.4);
  color: var(--gold);
  border-radius: var(--r);
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.6;
}
.upsell-link { color: var(--green); font-weight: 600; text-decoration: underline; }

/* ── Upsell modal ───────────────────────────────────────────────────────────── */
.upsell-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.upsell-card {
  background: var(--bg-2);
  border: 1px solid var(--green);
  border-radius: 12px;
  padding: 36px 32px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 60px rgba(140,255,145,0.08);
  position: relative;
}
.upsell-icon {
  font-size: 32px;
  color: var(--green);
  font-family: var(--mono);
  margin-bottom: 16px;
  line-height: 1;
}
.upsell-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.upsell-body {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 20px;
}
.upsell-body strong { color: var(--text); }
.upsell-features {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  margin-bottom: 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upsell-feat {
  font-size: 13px;
  color: var(--green);
  font-weight: 500;
}
.btn-upsell-cta {
  display: block;
  width: 100%;
  background: var(--green);
  color: #0a1a0a;
  border: none;
  border-radius: var(--r);
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}
.btn-upsell-cta:hover { opacity: 0.88; }
.upsell-dismiss {
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s;
}
.upsell-dismiss:hover { color: var(--text-2); }

/* ── Upgrade success toast ───────────────────────────────────────────────────── */
.upgrade-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-2);
  border: 1px solid var(--green);
  border-radius: var(--r-lg);
  padding: 14px 24px;
  font-size: 13px;
  color: var(--green);
  z-index: 2000;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease;
  white-space: nowrap;
}
.upgrade-toast strong { color: var(--text); }
@keyframes toastIn { from { opacity:0; transform: translateX(-50%) translateY(12px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }

/* ── Upsell price display ───────────────────────────────────────────────────── */
.upsell-price {
  margin: -4px 0 16px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}
.upsell-price-amount {
  font-size: 42px;
  font-weight: 800;
  color: var(--green);
  font-family: var(--mono);
  line-height: 1;
}
.upsell-price-period {
  font-size: 16px;
  color: var(--text-3);
  font-weight: 400;
}

/* ── KPI tile upgrade button & free remaining label ────────────────────────── */
.btn-kpi-upgrade {
  position: absolute;
  top: 8px;
  right: 10px;
  background: var(--green);
  color: #0a1a0a;
  border: none;
  border-radius: var(--r);
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
  letter-spacing: 0.01em;
}
.btn-kpi-upgrade:hover { opacity: 0.85; }
.kpi-free-remaining {
  display: inline;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
  margin-left: 6px;
  font-family: var(--mono);
  vertical-align: middle;
}

/* ── Chrome Extension webstore message ─────────────────────────────────────── */
.ext-webstore-msg {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 4px 0;
  min-height: unset;
  text-align: left;
}
.ext-chrome-icon { opacity: 0.9; flex-shrink: 0; }
.ext-webstore-text {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  max-width: none;
  flex: 1;
}
.ext-webstore-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.ext-webstore-link:hover { color: var(--text); }

/* ── Extension token section ────────────────────────────────────────────────── */
.ext-token-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.ext-token-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 6px;
}
.ext-token-desc {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: 10px;
}

/* ── DFS News Pro upsell wall ───────────────────────────────────────────────── */
.news-upsell-wall {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: 52px 32px; max-width: 520px; margin: 0 auto;
  gap: 16px;
}
.news-upsell-icon { font-size: 48px; line-height: 1; }
.news-upsell-title {
  font-family: var(--head); font-size: 1.4rem; font-weight: 800;
  color: var(--text); letter-spacing: -.02em;
}
.news-upsell-body {
  font-size: 14px; color: var(--text-2); line-height: 1.7; max-width: 420px;
}
.news-upsell-body strong { color: var(--text); }
.news-upsell-features {
  display: flex; flex-direction: column; gap: 8px;
  align-items: flex-start; margin: 4px 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 24px; width: 100%; max-width: 360px;
}
.news-upsell-feat { font-size: 13px; color: var(--mint); font-weight: 500; }
.btn-news-upgrade {
  background: #3ecfb2 !important;
  color: #071a0e !important;
  border: none;
  border-radius: 10px;
  padding: 16px 48px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .04em;
  cursor: pointer;
  transition: filter .15s, transform .15s;
  box-shadow: 0 4px 24px rgba(62,207,178,0.4);
  width: 100%;
  max-width: 380px;
  display: block;
}
.btn-news-upgrade:hover { filter: brightness(1.1); transform: translateY(-2px); }
.news-upsell-sub { font-size: 14px; color: var(--text-2); margin-top: -4px; font-weight: 500; }


/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — comprehensive breakpoints
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tablet (≤ 768px) ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Topbar — 2-row layout: logo+buttons on row 1, nav on row 2 */
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 0 12px;
    gap: 0;
  }
  .topbar-left { flex: 1; min-width: 0; height: 48px; }
  .topbar-section { display: none; }
  .topbar-platforms { display: none; }
  .topbar-right { height: 48px; gap: 6px; flex-shrink: 0; }
  /* Nav wraps to full-width second row, horizontally scrollable */
  .topbar-nav {
    order: 3;
    flex: 0 0 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overflow: visible;
    border-top: 1px solid var(--border);
    padding: 4px 4px;
    gap: 2px;
    scrollbar-width: none;
  }
  .topbar-nav::-webkit-scrollbar { display: none; }
  .tnav { padding: 6px 10px; font-size: 13px; white-space: nowrap; }

  /* Filter bar — keep horizontal, allow wrap at 2-per-row */
  .filterbar-inner { padding: 8px 12px; gap: 6px; flex-wrap: wrap; }
  .fb-group { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .fb-group select { width: 100%; }
  .fb-group.fb-grow { flex: 1 1 100%; }

  /* KPI bar */
  .kpi-bar { grid-template-columns: repeat(3, 1fr); }
  .kpi-val { font-size: 16px; }
  .kpi-label { font-size: 10px; }

  /* View header */
  .view-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .view-header h2 { font-size: 18px; }

  /* Dashboard rows */
  .dash-row-3 { grid-template-columns: 1fr; }

  /* Game plan hero */
  .gp-hero { flex-direction: column; }
  .gp-hero-signal { min-width: 0; width: 100%; }
  .gp-hero-stats { flex-wrap: wrap; gap: 10px; }

  /* Bankroll management — P&L grid */
  .bm-pl-grid { grid-template-columns: 1fr 1fr; }
  .bm-path-cell { grid-column: 1 / -1; }

  /* Bankroll filters + goal inputs */
  .bm-filters { flex-wrap: wrap; gap: 8px; }
  .bm-filters .fb-group { flex: 1 1 calc(50% - 4px); }
  .goal-inputs { flex-wrap: wrap; gap: 8px; }
  .goal-input-group { flex: 1 1 calc(50% - 4px); }

  /* Analytics */
  .analytics-row-2col { grid-template-columns: 1fr; }

  /* Sustainability stats */
  .sust-stats-row { flex-wrap: wrap; }
  .sust-stat-wide { min-width: 0; flex: 1 1 100%; }
  .sust-stat { min-width: 0; flex: 1 1 calc(50% - 6px); }

  /* Confidence engine */
  .ce-selector { flex-wrap: wrap; }

  /* Finish position */
  .finish-stats-row { grid-template-columns: repeat(2, 1fr); }
  .finish-detail-body { grid-template-columns: 1fr; }

  /* Upload */
  .upload-layout { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: 1fr; }

  /* Entries table — horizontal scroll */
  .rp-table-wrap, .entries-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Heatmap — fit to screen, no horizontal scroll */
  .ninebox-wrap { overflow-x: hidden; padding: 10px; }
  .nbh-table { min-width: 0; width: 100%; }
  .nbh-label { width: 50px; font-size: 9.5px; padding: 0 3px; }
  .nbh-cell { min-width: 0; height: 44px; font-size: 10.5px; padding: 2px; }
  .nbh-header { height: 26px; font-size: 9px; }
  .nbh-count { font-size: 8.5px; }
  #view-analytics .nbh-label { font-size: 9.5px; }
  #view-analytics .nbh-cell { font-size: 10.5px; }
  .nbh-scroll-wrap { overflow-x: hidden; }

  /* More filters popover */
  .more-filters-popover { position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; min-width: 0; border-radius: 12px 12px 0 0; max-height: 80vh; overflow-y: auto; }

  /* Goal pacing stats */
  .goal-stats-row { flex-wrap: wrap; gap: 6px; }
  .goal-stat { flex: 1 1 calc(50% - 3px); min-width: 0; }

  /* News upsell */
  .news-upsell-features { grid-template-columns: 1fr; }
}

/* ── Mobile (≤ 480px) ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Topbar — keep 2-row, tighten padding */
  .topbar { padding: 0 10px; }
  .topbar-left { height: 44px; }
  .topbar-right { height: 44px; }
  .topbar-left .logo-text { font-size: 13px; }
  .topbar-right .btn-primary { padding: 5px 10px; font-size: 11px; }
  .tnav { padding: 5px 8px; font-size: 12px; }

  /* KPI bar — 2 col */
  .kpi-bar { grid-template-columns: repeat(2, 1fr); }
  .kpi-cell { padding: 9px 10px; }
  .kpi-val { font-size: 15px; }
  .kpi-label { font-size: 9.5px; }

  /* Filter bar — keep horizontal, tighter padding */
  .filterbar-inner { padding: 6px 10px; gap: 5px; }
  .fb-group { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .filter-btn-row { justify-content: flex-start; }

  /* Bankroll P&L grid — single column */
  .bm-pl-grid { grid-template-columns: 1fr; }

  /* Path to Profits inner 2-col → 1-col */
  .bm-path-cell .bm-path-inner { grid-template-columns: 1fr !important; }

  /* Sustainability stats */
  .sust-stat { flex: 1 1 100%; }

  /* Goal stats */
  .goal-stat { flex: 1 1 100%; }

  /* View headers */
  .view-header { padding: 14px 14px 10px; }
  .view-header h2 { font-size: 16px; }

  /* Main content padding */
  .main-content { padding: 10px 12px; }

  /* Tile / card padding */
  .tile { padding: 14px; }
  .tile-head { font-size: 10px; }

  /* Game plan hero */
  .gp-hero { padding: 12px; gap: 10px; }
  .gp-hero-directive { font-size: 13px; }

  /* Charts — prevent overflow */
  .chart-wrap { overflow-x: hidden; }

  /* Upsell modal */
  .upsell-card { padding: 28px 18px; margin: 0 12px; }
  .upsell-title { font-size: 20px; }
  .upsell-features { grid-template-columns: 1fr; gap: 6px; }

  /* Heatmap — tighten further on small phones */
  .nbh-label { width: 44px; font-size: 9px; }
  .nbh-cell { height: 40px; font-size: 10px; }
  .nbh-header { height: 24px; font-size: 8.5px; }

  /* Auth modal */
  .auth-wrap { padding: 28px 16px; }
}

/* ── Profile ────────────────────────────────────────────────────────────────── */
.nav-user { text-decoration: none; }

#view-profile { max-width: 980px; margin: 0 auto; }
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.profile-card { display: flex; flex-direction: column; }
.profile-card-wide { grid-column: 1 / -1; }
.profile-card .panel-header h3 { display: flex; align-items: center; gap: 8px; }
.pc-icon { color: var(--accent); font-size: 14px; }

.profile-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.profile-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.profile-field { min-width: 0; }
.pf-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}
.pf-value {
  font-size: 14px;
  color: var(--text);
  font-family: var(--mono);
  word-break: break-all;
}
.profile-divider { height: 1px; background: var(--border); margin: 4px 0; }

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border-2);
  background: var(--bg-3);
  color: var(--text-2);
  font-family: var(--font);
}
.plan-badge.plan-paid {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-bg);
}
.plan-badge.plan-free {
  color: var(--text-2);
}

.btn-link-signout {
  align-self: flex-start;
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.btn-link-signout:hover { color: var(--accent); }

.pf-upgrade-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 2px; }
.pup-amount { font-size: 32px; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
.pup-period { font-size: 13px; color: var(--text-3); }
.pf-upgrade-sub { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.pf-paid-line { font-size: 13px; color: var(--text-2); line-height: 1.55; }

.pf-perks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  padding: 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.pf-perk { font-size: 12px; color: var(--text); }

.pf-fineprint { font-size: 11px; color: var(--text-3); text-align: center; margin-top: -4px; }

.pf-msg {
  font-size: 12px;
  padding: 8px 12px;
  border-radius: var(--r);
  border: 1px solid var(--border);
}
.pf-msg-ok  { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.pf-msg-err { color: #ff8a8a; border-color: rgba(255,138,138,0.4); background: rgba(255,138,138,0.08); }

@media (max-width: 720px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-row-2 { grid-template-columns: 1fr; }
  .pf-perks { grid-template-columns: 1fr; }
}

/* ── Empty-state hero ───────────────────────────────────────────────────────── */
.empty-state-hero {
  max-width: 640px;
  margin: 64px auto 32px;
  padding: 40px 36px;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 4px 32px rgba(0,0,0,0.25);
}
.empty-state-hero.empty-state-mini {
  margin: 32px auto;
  padding: 28px 28px;
  max-width: 520px;
}
.esh-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 26px;
  margin-bottom: 16px;
  border: 1px solid var(--accent);
}
.empty-state-mini .esh-icon {
  width: 44px;
  height: 44px;
  font-size: 20px;
  margin-bottom: 12px;
}
.esh-title {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.empty-state-mini .esh-title { font-size: 18px; }
.esh-body {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0 auto 22px;
  max-width: 460px;
}
.empty-state-mini .esh-body { font-size: 13px; margin-bottom: 18px; }
.esh-ctas {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.empty-state-mini .esh-ctas { margin-bottom: 4px; }
.esh-cta-primary,
.esh-cta-secondary {
  min-width: 220px;
  height: 40px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.esh-cta-secondary {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-2);
}
.esh-cta-secondary:hover {
  background: var(--bg-3);
  color: var(--text);
  border-color: var(--accent);
}
.esh-howto {
  margin-top: 8px;
  padding: 18px 20px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  text-align: left;
}
.esh-howto-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.esh-howto-list {
  margin: 0;
  padding-left: 22px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.7;
}
.esh-howto-list li { margin-bottom: 4px; }
.esh-howto-list li:last-child { margin-bottom: 0; }
.esh-howto-list strong { color: var(--text); }

/* ── Dismissible billing-error message ──────────────────────────────────────── */
.pf-msg-dismissible {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.pf-msg-text { flex: 1; line-height: 1.5; }
.pf-msg-close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  opacity: 0.7;
}
.pf-msg-close:hover { opacity: 1; }

/* ── Extension auto-refresh hint ────────────────────────────────────────────── */
.ext-autorefresh-hint {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  font-size: 12px;
  color: var(--accent);
  line-height: 1.5;
}
.ext-autorefresh-hint strong { color: var(--text); }

/* ── Sync toast (after focus-detected new data) ─────────────────────────────── */
.sync-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 12px 18px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(8px);
  animation: sync-toast-in 0.25s ease-out forwards;
}
.sync-toast-out {
  animation: sync-toast-out 0.4s ease-in forwards;
}
@keyframes sync-toast-in {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes sync-toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

/* ── Secondary button variant (used by empty-state CTAs) ────────────────────── */
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-2);
  font-family: var(--font);
}
.btn-secondary:hover {
  background: var(--bg-3);
  color: var(--text);
}

.site-footer { border-top: 1px solid var(--border); padding: 20px 24px; margin-top: auto; }
.site-footer-inner { max-width: 1400px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 14px 20px; font-size: .75rem; color: var(--text-3); align-items: center; }
.site-footer-inner a { color: var(--text-2); text-decoration: none; }
.site-footer-inner a:hover { color: var(--text); }
