:root {
    --color-bg-base: #080b12;
    --bg: var(--color-bg-base);
    --color-bg-surface: #0f1117;
    --surface: var(--color-bg-surface);
    --color-bg-elevated: #1a1f2e;
    --surface2: var(--color-bg-elevated);
    --color-border: #1e2335;
    --color-border-active: #2a2f3d;
    --border: var(--color-border);
    --color-text-primary: #e2e8f0;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #6b7280;
    --color-text-faint: #4b5563;
    --text: var(--color-text-primary);
    --muted: var(--color-text-muted);
    --color-gold: #f0a500;
    --color-gold-dim: rgba(240,165,0,0.15);
    --color-gold-border: rgba(240,165,0,0.3);
    --accent: var(--color-gold);
    --color-neutral: #3b82f6;
    --accent2: var(--color-neutral);
    --color-positive: #22c55e;
    --green: var(--color-positive);
    --color-negative: #ef4444;
    --red: var(--color-negative);
    --yellow: #eab308;
    --green-bg: rgba(34,197,94,0.15);
    --red-bg: rgba(239,68,68,0.15);
    --yellow-bg: rgba(234,179,8,0.12);
    /* Bracket preview tile colors — overridden in @media print */
    --pk-winner-bg: rgba(59,130,246,0.12);
    --pk-winner-border: rgba(59,130,246,0.52);
    --pk-winner-text: #c6dbff;
    --pk-champ-bg: rgba(240,165,0,0.12);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { background: var(--bg); color: var(--text); font-family: 'DM Sans', sans-serif; min-height: 100vh; }

  /* HEADER */
  .header { 
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 32px; border-bottom: 1px solid var(--border);
    background: var(--surface);
  }
  .logo { font-family: 'Bebas Neue', sans-serif; font-size: 28px; color: var(--accent); letter-spacing: 2px; }
  .logo span { color: var(--text); }
  .progress-bar { display: flex; gap: 0; align-items: center; }
  .step-dot {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    cursor: pointer; padding: 4px 6px; border-radius: 8px;
    transition: background 0.2s; touch-action: manipulation;
  }
  .step-dot:hover .step-pip { border-color: var(--accent); color: var(--accent); }
  .step-pip {
    width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600; color: var(--muted); transition: all 0.3s;
    font-family: 'DM Mono', monospace;
  }
  .step-label {
    font-size: 10px; font-family: 'DM Mono', monospace; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--muted); white-space: nowrap; transition: color 0.3s;
  }
  .step-dot.active .step-pip { border-color: var(--accent); color: var(--accent); background: rgba(240,165,0,0.1); }
  .step-dot.active .step-label { color: var(--accent); }
  .step-dot.done .step-pip { border-color: var(--green); color: var(--green); background: rgba(34,197,94,0.1); }
  .step-dot.done .step-label { color: var(--green); }
  .step-connector { width: 16px; height: 2px; background: var(--border); margin-bottom: 14px; flex-shrink: 0; }
  .step-connector.done { background: var(--green); }
  @media (max-width: 640px) {
    .header { padding: 10px 16px; gap: 8px; flex-wrap: wrap; justify-content: center; }
    .logo { width: 100%; text-align: center; font-size: 24px; }
    .progress-bar { width: 100%; justify-content: center; }
    .header > button, .header > a { display: none; } /* hide dev autofill and guide link on mobile */
    .step-label { display: none; }
    .step-connector { width: 10px; }
    .step-dot { min-width: 44px; min-height: 44px; justify-content: center; padding: 8px 6px; }
    .step-pip { width: 28px; height: 28px; font-size: 11px; }
  }

  /* SCREEN WRAPPER */
  .screen { display: none; padding: 32px; max-width: 1400px; margin: 0 auto; animation: fadeIn 0.4s ease; }
  .screen.active { display: block; }
  @media (max-width: 640px) { .screen { padding: 16px; } }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

  /* SCREEN HEADERS */
  .screen-title { font-family: 'Oswald', sans-serif; font-size: 42px; letter-spacing: 1px; color: var(--text); }
  .screen-title span { color: var(--accent); }
  .screen-subtitle { color: var(--muted); font-size: 15px; margin-top: 6px; margin-bottom: 28px; }

  /* TABLES */
  .table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
  .table-scroll-hint {
    display: none;
    margin-top: 8px;
    font-size: 11px;
    color: var(--muted);
    font-family: 'DM Mono', monospace;
    letter-spacing: 0.3px;
  }
  table { width: 100%; border-collapse: collapse; font-size: 14px; }
  thead th { 
    background: var(--surface2); padding: 12px 16px; text-align: left;
    font-family: 'DM Mono', monospace; font-size: 11px; text-transform: uppercase;
    letter-spacing: 1px; color: var(--muted); border-bottom: 1px solid var(--border);
    cursor: pointer; user-select: none; white-space: nowrap;
  }
  thead th:hover { color: var(--text); }
  tbody tr { border-bottom: 1px solid var(--border); }
  tbody tr:last-child { border-bottom: none; }
  tbody tr.selected { background: rgba(240,165,0,0.08); }
  tbody tr.clickable { cursor: pointer; transition: background 0.15s; }
  tbody tr.clickable:hover { background: var(--surface2); }
  tbody td { padding: 11px 16px; }
  .seed-badge { 
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 6px; background: var(--surface2);
    font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; color: var(--muted);
  }
  .team-name { font-weight: 600; }
  .fire { font-size: 14px; margin-left: 6px; }
  .region-tag { 
    font-size: 11px; padding: 2px 8px; border-radius: 4px; 
    background: var(--surface2); color: var(--muted); font-family: 'DM Mono', monospace;
  }

  /* LEVERAGE CELLS */
  .lev { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 500; padding: 5px 7px; border-radius: 6px; text-align: right; display: inline-block; min-width: 48px; }
  .lev.pos-strong { background: rgba(34,197,94,0.2); color: #4ade80; }
  .lev.pos-mid   { background: rgba(34,197,94,0.1); color: #86efac; }
  .lev.neg-strong { background: rgba(239,68,68,0.2); color: #f87171; }
  .lev.neg-mid   { background: rgba(239,68,68,0.1); color: #fca5a5; }
  .lev.neutral   { background: transparent; color: var(--muted); }
  .lev-arrow { font-size: 9px; margin-right: 3px; vertical-align: middle; }
  .lev-arrow.up { color: #4ade80; }
  .lev-arrow.dn { color: #f87171; }
  .pct { font-family: 'DM Mono', monospace; font-size: 13px; color: var(--text); }

  /* BUTTONS */
  .btn { 
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; border-radius: 8px; border: none; cursor: pointer;
    font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 600;
    transition: all 0.2s;
  }
  .btn-primary { background: var(--accent); color: #000; }
  .btn-primary:hover { background: #f5b82e; transform: translateY(-1px); }
  .btn-primary:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; transform: none; }
  .btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
  .btn-ghost:hover { border-color: var(--muted); background: var(--surface2); }
  .btn-row { display: flex; gap: 12px; margin-top: 24px; align-items: center; }
  .mobile-next-bar { display: none; }
  .mobile-region-next { display: none; }

  /* CHAMPION BANNER */
  .champ-banner {
    display: none; background: linear-gradient(135deg, rgba(240,165,0,0.15), rgba(240,165,0,0.05));
    border: 1px solid rgba(240,165,0,0.3); border-radius: 12px;
    padding: 16px 24px; margin-bottom: 24px; align-items: center; gap: 16px;
  }
  .champ-banner.show { display: flex; }
  .champ-banner .trophy { font-size: 24px; }
  .champ-banner .champ-text { font-size: 13px; color: var(--muted); }
  .champ-banner .champ-name { font-size: 20px; font-weight: 700; color: var(--text); }

  /* REGION SCREEN LAYOUT */
  .region-layout { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; max-width: 1400px; }
  .panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; min-width: 0; }
  .panel-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    background: var(--surface2); display: flex; align-items: center; justify-content: space-between;
  }
  .panel-title { font-family: 'Oswald', sans-serif; font-size: 20px; letter-spacing: 0.5px; color: var(--accent); }
  .panel-subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }
  #regionLevTable thead th { padding: 7px 8px; font-size: 10px; letter-spacing: 0.5px; }
  #regionLevTable tbody td { padding: 6px 8px; font-size: 12px; }
  #regionLevTable { width: max-content; }
  #leveragePanel {
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    width: fit-content;
  }
  .region-layout .panel:not(#leveragePanel) { width: 100%; overflow: visible; }
  /* De-emphasize F4/Finals columns — useful context but secondary on region screen */
  .lev-late { opacity: 0.4; }
  /* Mobile tab toggle */
  .mobile-tab-row { display: none; gap: 8px; margin-bottom: 12px; }
  .mobile-tab-row .btn { flex: 1; justify-content: center; }
  .mobile-tab-row .btn.tab-active { border-color: var(--accent); color: var(--accent); background: rgba(240,165,0,0.08); }
  @media (max-width: 1000px) {
    .region-layout { grid-template-columns: 1fr; }
    #leveragePanel {
      position: static;
      max-height: none;
      overflow: visible;
      width: 100%;
    }
    #leveragePanel.mobile-hidden { display: none; }
    .mobile-panel-hidden { display: none; }
    .mobile-tab-row { display: flex; }
    #leveragePanel .table-wrap { position: relative; overflow-x: auto; }

    /* Region leverage table: keep Seed + Team visible while horizontally scrolling */
    #regionLevTable {
      width: max-content;
      min-width: 100%;
      border-collapse: separate;
      border-spacing: 0;
    }
    #regionLevTable tr > th:first-child,
    #regionLevTable tr > td:first-child {
      position: -webkit-sticky;
      position: sticky;
      left: 0;
      z-index: 4;
      background: var(--surface);
      min-width: 44px;
    }
    #regionLevTable tr > th:nth-child(2),
    #regionLevTable tr > td:nth-child(2) {
      position: -webkit-sticky;
      position: sticky;
      left: 44px;
      z-index: 4;
      background: var(--surface);
      min-width: 118px;
      box-shadow: 8px 0 10px -8px rgba(0,0,0,0.55);
    }
    #regionLevTable thead tr > th:first-child,
    #regionLevTable thead tr > th:nth-child(2) {
      background: var(--surface2);
      z-index: 6;
    }
  }

  /* CHAMPION PATH CALLOUT (region screen) */
  .champ-path-callout {
    display: none; margin: 10px 16px 0; padding: 10px 14px;
    border-radius: 8px; background: rgba(240,165,0,0.07);
    border: 1px solid rgba(240,165,0,0.22);
    align-items: center; gap: 12px;
  }
  .champ-path-callout.show { display: flex; }
  .champ-path-callout .cpc-icon { font-size: 18px; flex-shrink: 0; }
  .champ-path-callout .cpc-title { font-size: 13px; font-weight: 700; color: var(--accent); }
  .champ-path-callout .cpc-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

  /* REGION SELECTOR */
  .region-card {
    background: var(--surface); border: 2px solid var(--border);
    border-radius: 12px; padding: 18px 20px; cursor: pointer;
    transition: all 0.2s; position: relative; overflow: hidden;
  }
  .region-card:hover { border-color: var(--accent); background: rgba(240,165,0,0.05); }
  .region-card.done { border-color: var(--green); background: rgba(34,197,94,0.05); }
  .region-card.active { border-color: var(--accent); background: rgba(240,165,0,0.08); }
  .region-card.champ-region { border-color: var(--accent); }
  .rc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
  .rc-name { font-size: 18px; font-weight: 700; color: var(--text); }
  .rc-status { font-family: 'DM Mono', monospace; font-size: 11px; padding: 3px 8px; border-radius: 4px; }
  .rc-status.done { background: rgba(34,197,94,0.15); color: var(--green); }
  .rc-status.partial { background: rgba(240,165,0,0.15); color: var(--accent); }
  .rc-status.empty { background: var(--surface2); color: var(--muted); }
  .rc-progress { height: 4px; background: var(--surface2); border-radius: 2px; margin-bottom: 10px; }
  .rc-progress-bar { height: 100%; border-radius: 2px; transition: width 0.3s; background: var(--green); }
  .rc-seeds { font-size: 12px; color: var(--muted); font-family: 'DM Mono', monospace; }
  .rc-winner { font-size: 13px; font-weight: 600; color: var(--green); margin-top: 6px; }
  .rc-champ-badge { font-size: 11px; color: var(--accent); margin-top: 4px; }

  /* MINI BRACKET MAP */
  .mini-map { display: grid; grid-template-columns: 1fr 60px 1fr; grid-template-rows: 1fr 1fr; gap: 0; width: 320px; }
  .mm-region {
    padding: 12px 14px; border: 1px solid var(--border); background: var(--surface);
    cursor: pointer; transition: all 0.2s; position: relative;
  }
  .mm-region:hover { border-color: var(--accent); z-index: 1; }
  .mm-region.done { border-color: var(--green); background: rgba(34,197,94,0.05); }
  .mm-region.current { border-color: var(--accent); background: rgba(240,165,0,0.08); box-shadow: 0 0 0 2px var(--accent); z-index: 2; }
  .mm-region.tl { border-radius: 10px 0 0 0; }
  .mm-region.tr { border-radius: 0 10px 0 0; }
  .mm-region.bl { border-radius: 0 0 0 10px; }
  .mm-region.br { border-radius: 0 0 10px 0; }
  .mm-region.tl, .mm-region.bl { text-align: right; }
  .mm-name { font-size: 13px; font-weight: 700; color: var(--text); }
  .mm-status { font-size: 10px; color: var(--muted); font-family: 'DM Mono', monospace; margin-top: 2px; }
  .mm-region.done .mm-name { color: var(--green); }
  .mm-region.current .mm-name { color: var(--accent); }
  .mm-center { grid-row: 1 / 3; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: var(--surface2);
    font-family: 'DM Mono', monospace; font-size: 9px; color: var(--accent);
    text-transform: uppercase; letter-spacing: 1px; text-align: center; writing-mode: vertical-rl; }

  /* VALIDATION TOAST */
  .toast {
    position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
    background: #2d1f1f; border: 1px solid var(--red); border-radius: 10px;
    padding: 14px 24px; color: #f87171; font-size: 14px; font-weight: 500;
    z-index: 9998; box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s;
    text-align: center; max-width: 420px; width: 90%;
  }
  @media (max-width: 640px) {
    .toast { bottom: 96px; }
  }
  .toast.show { opacity: 1; visibility: visible; }
  .matchup-tooltip {
    position: fixed; z-index: 9999;
    background: #13161f;
    border: 1px solid var(--border);
    border-radius: 10px; padding: 14px 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.95);
    pointer-events: none;
    opacity: 0; visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    width: 200px; font-size: 12px;
  }
  .matchup-tooltip.visible { opacity: 1; visibility: visible; }  .tt-team-name { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 2px; }
  .tt-region { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
  .tt-seed-badge {
    display: inline-block; padding: 2px 8px; border-radius: 5px;
    background: var(--surface2); border: 1px solid var(--border);
    font-family: 'DM Mono', monospace; font-size: 10px; color: var(--muted);
    float: right; margin-top: 2px;
  }
  .tt-stats-row { display: flex; gap: 20px; margin-bottom: 10px; }
  .tt-stat-block {}
  .tt-stat-label { font-family: 'DM Mono', monospace; font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 3px; }
  .tt-stat-val { font-family: 'DM Mono', monospace; font-size: 15px; font-weight: 600; color: var(--text); }
  .tt-divider { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
  .tt-lev-row { display: flex; justify-content: space-between; align-items: center; }
  .tt-lev-label { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
  .tt-lev-val { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 700; }
  .tt-lev-val.pos { color: #4ade80; }
  .tt-lev-val.neg { color: #f87171; }
  .tt-lev-val.neu { color: var(--muted); }

  /* BRACKET */
  .bracket-container { padding: 8px 4px 8px; overflow-x: auto; }
  .bracket-svg-wrap { position: relative; }
  .bracket-rounds { display: flex; align-items: flex-start; gap: 0; }
  .bracket-round { display: flex; flex-direction: column; }
  .bracket-round-label {
    font-family: 'DM Mono', monospace; font-size: 10px; text-transform: uppercase;
    letter-spacing: 1px; color: var(--muted); text-align: center;
    padding-bottom: 8px; width: 148px;
  }
  .bracket-slots { display: flex; flex-direction: column; }
  .bracket-slot { height: 32px; display: flex; align-items: center; }
  .bracket-team {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 8px; background: var(--surface2); border: 1px solid var(--border);
    border-radius: 5px; cursor: pointer; transition: all 0.15s;
    font-size: 12px; font-weight: 500; width: 140px; height: 28px;
    user-select: none;
  }
  .bracket-team:hover { border-color: var(--accent); background: rgba(240,165,0,0.1); }
  .bracket-team.winner { background: rgba(59,130,246,0.12); border-color: var(--accent2); color: #93c5fd; }
  .bracket-team.eliminated { opacity: 0.3; }
  .bracket-team.empty { background: transparent; border: 1px dashed var(--border); cursor: default; opacity: 0.4; }
  .bracket-team.empty:hover { border-color: var(--border); background: transparent; }
  .bracket-team .bt-seed {
    font-family: 'DM Mono', monospace; font-size: 10px; color: var(--muted);
    min-width: 14px; text-align: center;
  }
  .bracket-team.winner .bt-seed { color: #bfdbfe; }
  .bracket-team .bt-name { flex: 1; white-space: nowrap; overflow: visible; text-overflow: clip; }
  .bt-mobile-meta { display: none; }
  .bracket-connector { width: 20px; position: relative; }
  .region-winner-display {
    display: flex; align-items: center; justify-content: center;
    width: 140px; padding: 8px; border: 2px dashed var(--border);
    border-radius: 8px; font-size: 12px; color: var(--muted); text-align: center; min-height: 50px;
  }
  .region-winner-display.filled {
    border: 2px solid var(--accent); color: var(--accent); font-weight: 700;
    background: rgba(240,165,0,0.08); box-shadow: 0 0 16px rgba(240,165,0,0.2);
    animation: glow 2s infinite alternate;
  }

  /* REGION WINNER SLOT */
  .region-winner-slot {
    display: flex; align-items: center; justify-content: center;
    padding: 12px 16px; min-width: 130px;
    border: 2px dashed var(--border); border-radius: 8px; 
    font-size: 12px; color: var(--muted); text-align: center; min-height: 50px;
  }
  .region-winner-slot.filled {
    border: 2px solid var(--accent); color: var(--accent); font-weight: 700;
    background: rgba(240,165,0,0.08);
    box-shadow: 0 0 16px rgba(240,165,0,0.2);
    animation: glow 2s infinite alternate;
  }
  @keyframes glow { from { box-shadow: 0 0 8px rgba(240,165,0,0.2); } to { box-shadow: 0 0 20px rgba(240,165,0,0.4); } }

  /* FINAL FOUR SCREEN */
  .final-four-wrap { display: flex; gap: 32px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
  .semifinal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; min-width: 280px; }
  .semifinal-label { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
  .sf-team {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px;
    cursor: pointer; transition: all 0.2s; margin-bottom: 4px; font-weight: 600;
  }
  .sf-team:hover { border-color: var(--accent); background: rgba(240,165,0,0.08); }
  .sf-team.winner { background: rgba(59,130,246,0.12); border-color: var(--accent2); color: #93c5fd; }
  .sf-team.locked { background: rgba(240,165,0,0.1); border-color: var(--accent); cursor: default; }
  .semifinal.champ-locked .sf-team { cursor: default; pointer-events: none; }
  .vs-divider { text-align: center; color: var(--muted); font-size: 11px; font-family: 'DM Mono', monospace; padding: 6px 0; }
  .ncg-wrap { background: var(--surface); border: 2px solid var(--accent); border-radius: 12px; padding: 24px; min-width: 280px; }
  .ncg-label { font-family: 'Oswald', sans-serif; font-size: 22px; color: var(--accent); letter-spacing: 1px; margin-bottom: 16px; text-align: center; }
  .ncg-team {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px; border: 1px solid var(--border); border-radius: 8px;
    cursor: pointer; transition: all 0.2s; margin-bottom: 4px; font-weight: 600; font-size: 15px;
  }
  .ncg-team:hover { border-color: var(--accent); background: rgba(240,165,0,0.08); }
  .ncg-team.winner { background: rgba(240,165,0,0.2); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 20px rgba(240,165,0,0.3); }
  .ncg-team.eliminated { opacity: 0.35; }

  /* PREVIEW SCREEN */
  .preview-layout { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
  .bracket-preview {
    background:
      linear-gradient(180deg, rgba(240,165,0,0.04), rgba(240,165,0,0) 120px),
      linear-gradient(135deg, rgba(26,31,46,0.94), rgba(15,17,23,0.98));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    overflow: hidden;
  }
  .preview-bracket-viewport { width: 100%; overflow: hidden; }
  .preview-bracket-scale { transform-origin: top left; }
  .preview-export-shell {
    display: inline-flex;
    flex-direction: column;
    gap: 12px;
    width: max-content;
    padding: 8px 0;
  }
  .preview-export-header,
  .preview-export-footer {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: end;
  }
  .preview-export-brand-kicker,
  .preview-export-attribution {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.6px;
  }
  .preview-export-brand-kicker { color: var(--color-text-faint); }
  .preview-export-brand-name {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    line-height: 0.95;
    color: var(--color-text-primary);
  }
  .preview-export-title-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
  }
  .preview-export-title {
    font-family: 'Oswald', sans-serif;
    font-size: 24px;
    line-height: 0.95;
    color: var(--color-text-primary);
  }
  .preview-export-subtitle {
    max-width: 420px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    line-height: 1.3;
    color: var(--color-text-muted);
  }
  .preview-export-body {
    display: block;
  }
  .preview-bracket-inner { display: flex; align-items: center; gap: 0; width: max-content; }
  .preview-export-footer {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .preview-export-footer-line {
    height: 1px;
    background: linear-gradient(90deg, rgba(240,165,0,0.42), rgba(75,85,99,0.18));
  }
  .preview-export-attribution { color: var(--color-text-muted); }
  .preview-side { display: flex; flex-direction: column; gap: 20px; }
  .preview-side--mirror .preview-region-meta { text-align: right; }
  .preview-region { display: flex; flex-direction: column; gap: 8px; }
  .preview-region-kicker,
  .preview-round-label,
  .preview-center-kicker,
  .preview-finals-kicker,
  .preview-champion-kicker,
  .preview-semifinal-label,
  .preview-semifinal-winner {
    font-family: 'DM Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 1.6px;
  }
  .preview-region-kicker { font-size: 10px; color: var(--color-text-faint); }
  .preview-region-title { font-family: 'Oswald', sans-serif; font-size: 22px; line-height: 1; color: var(--color-text-primary); }
  .preview-region-bracket { position: relative; flex-shrink: 0; }
  .preview-region-svg { position: absolute; left: 0; pointer-events: none; overflow: visible; }
  .preview-round-label { position: absolute; top: 0; text-align: center; font-size: 10px; color: var(--color-text-faint); }
  .preview-round-label--r3, .preview-round-label--r4 { color: var(--color-text-secondary); }
  .preview-positioned-tile { position: absolute; }
  .preview-tile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    background: rgba(26,31,46,0.88);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text-primary);
    overflow: hidden;
  }
  .preview-tile--r1 { background: rgba(15,17,23,0.9); }
  .preview-tile--r2 { background: rgba(20,24,36,0.94); }
  .preview-tile--r3, .preview-tile--r4 { background: rgba(26,31,46,0.96); }
  .preview-tile--winner {
    border-color: var(--pk-winner-border);
    background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(26,31,46,0.96));
    color: var(--pk-winner-text);
  }
  .preview-tile--path {
    border-color: var(--color-gold-border);
    background: linear-gradient(135deg, rgba(240,165,0,0.12), rgba(26,31,46,0.96));
    color: var(--color-text-primary);
  }
  .preview-tile--champ, .preview-tile--region-winner { border-width: 1.5px; }
  .preview-tile--loser-hidden { opacity: 0.34; }
  .preview-tile--empty { background: transparent; border-style: dashed; opacity: 0.28; }
  .preview-tile-seed {
    min-width: 14px;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--color-text-muted);
    text-align: center;
  }
  .preview-tile-name {
    flex: 1;
    min-width: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .preview-tile--winner .preview-tile-seed,
  .preview-tile--path .preview-tile-seed { color: inherit; }
  .preview-connector { stroke: rgba(75,85,99,0.72); stroke-width: 1; shape-rendering: crispEdges; }
  .preview-connector--winner { stroke: rgba(59,130,246,0.45); }
  .preview-connector--path { stroke: rgba(240,165,0,0.62); stroke-width: 1.3; }
  .preview-center { width: 372px; padding: 0 18px; flex-shrink: 0; }
  .preview-center--print { width: 408px; padding: 0 20px; }
  .preview-center-kicker { margin-bottom: 8px; font-size: 10px; color: var(--color-gold); text-align: center; }
  .preview-center-card {
    position: relative;
    padding: 20px;
    border: 1px solid var(--color-border-active);
    border-radius: 12px;
    background:
      linear-gradient(180deg, rgba(240,165,0,0.06), rgba(240,165,0,0) 88px),
      linear-gradient(180deg, rgba(26,31,46,0.98), rgba(15,17,23,0.98));
  }
  .preview-center-header { margin-bottom: 16px; text-align: center; }
  .preview-center-title { font-family: 'Oswald', sans-serif; font-size: 30px; line-height: 0.96; color: var(--color-text-primary); }
  .preview-center-subtitle { margin-top: 6px; font-size: 12px; line-height: 1.35; color: var(--color-text-muted); }
  .preview-semifinals { display: flex; flex-direction: column; gap: 12px; }
  .preview-semifinal-block {
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(8,11,18,0.45);
  }
  .preview-semifinal-label { margin-bottom: 8px; font-size: 10px; color: var(--color-text-secondary); text-align: center; }
  .preview-semifinal-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
  .preview-semifinal-team {
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: rgba(26,31,46,0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .preview-semifinal-team.is-winner { border-color: var(--pk-winner-border); background: rgba(59,130,246,0.12); }
  .preview-semifinal-team.is-path { border-color: var(--color-gold-border); background: var(--color-gold-dim); }
  .preview-semifinal-name { font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600; color: var(--color-text-primary); line-height: 1.1; }
  .preview-semifinal-vs { font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 1.6px; color: var(--color-text-faint); }
  .preview-semifinal-winner { margin-top: 8px; font-size: 10px; color: var(--color-text-muted); text-align: center; }
  .preview-semifinal-winner span { color: var(--color-text-secondary); }
  .preview-finals-rail { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--color-border); }
  .preview-finals-kicker { margin-bottom: 10px; font-size: 10px; color: var(--color-text-secondary); text-align: center; }
  .preview-finals-matchup {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1.2fr) 16px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
  }
  .preview-finals-slot {
    min-height: 44px;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: rgba(15,17,23,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    line-height: 1.1;
  }
  .preview-finals-slot.is-path { border-color: var(--color-gold-border); background: rgba(240,165,0,0.1); color: var(--color-text-primary); }
  .preview-finals-divider { height: 1px; background: linear-gradient(90deg, rgba(240,165,0,0), rgba(240,165,0,0.45), rgba(240,165,0,0)); }
  .preview-champion-card {
    min-height: 108px;
    padding: 16px 12px;
    border: 1px solid var(--color-gold-border);
    border-radius: 10px;
    background:
      linear-gradient(180deg, rgba(240,165,0,0.16), rgba(240,165,0,0.06)),
      rgba(15,17,23,0.96);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .preview-champion-kicker { font-size: 10px; color: var(--color-text-secondary); }
  .preview-champion-name {
    margin-top: 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 30px;
    line-height: 0.96;
    color: var(--color-gold);
    text-transform: uppercase;
  }
  html.pdf-export .preview-export-shell { padding: 0; }
  html.pdf-export .preview-center-card,
  html.pdf-export .preview-semifinal-block,
  html.pdf-export .preview-champion-card,
  html.pdf-export .preview-finals-slot,
  html.pdf-export .preview-tile { box-shadow: none; }
  html.pdf-export .preview-export-footer-line {
    background: linear-gradient(90deg, rgba(240,165,0,0.55), rgba(75,85,99,0.22));
  }
  .bracket-swipe-hint { display: none; text-align: center; font-size: 12px; color: var(--muted); font-family: 'DM Mono', monospace; padding: 8px 0 4px; }
  @media (max-width: 768px) { .bracket-swipe-hint { display: block; } }
  .summary-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
  .summary-panel-inner { display: grid; grid-template-columns: auto 1fr 1fr; gap: 24px; align-items: start; }
  @media (max-width: 900px) { .summary-panel-inner { grid-template-columns: 1fr; } }
  .summary-section { margin-bottom: 16px; }
  .summary-section h3 { font-family: 'DM Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 8px; }
  .pick-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 10px; border-radius: 6px; margin-bottom: 3px; background: var(--surface2);
  }
  .pick-round { font-size: 10px; color: var(--muted); font-family: 'DM Mono', monospace; }
  .pick-team { font-weight: 600; font-size: 13px; }
  .contrarian-badge {
    font-size: 11px; padding: 2px 8px; border-radius: 4px; font-family: 'DM Mono', monospace; font-weight: 500;
  }
  .con-fade { background: var(--red-bg); color: #f87171; }
  .con-value { background: var(--green-bg); color: #4ade80; }
  .con-neutral { background: var(--surface2); color: var(--muted); }
  .con-fire { background: rgba(240,165,0,0.15); color: var(--accent); }
  .contrarian-score-box {
    background: linear-gradient(135deg, rgba(240,165,0,0.12), rgba(59,130,246,0.08));
    border: 1px solid rgba(240,165,0,0.3); border-radius: 12px;
    padding: 20px; text-align: center; margin-bottom: 20px;
  }
  .cs-label { font-size: 12px; color: var(--muted); font-family: 'DM Mono', monospace; text-transform: uppercase; letter-spacing: 1px; }
  .cs-profile { font-family: 'Bebas Neue', sans-serif; font-size: 48px; line-height: 0.95; margin-top: 6px; }
  .cs-profile.contrarian { color: var(--accent); }
  .cs-profile.neutral { color: rgba(232,234,240,0.9); }
  .cs-profile.public { color: var(--muted); }
  .cs-score { font-family: 'DM Mono', monospace; font-size: 18px; color: var(--text); line-height: 1.2; margin-top: 10px; }
  .cs-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
  .summary-desc { color: var(--muted); font-size: 12px; line-height: 1.45; margin: -2px 0 8px; }
  .cs-benchmark {
    margin-top: 8px; font-size: 10px; color: var(--muted);
    font-family: 'DM Mono', monospace; line-height: 1.4;
  }

  /* MINI BRACKET (PREVIEW) */
  .mini-bracket { display: flex; flex-direction: column; gap: 8px; }
  .mini-region { margin-bottom: 16px; }
  .mini-region-title { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
  .mini-row { display: flex; gap: 6px; flex-wrap: wrap; }
  .mini-team {
    font-size: 12px; padding: 4px 10px; border-radius: 6px;
    background: var(--surface2); border: 1px solid var(--border); font-weight: 500;
  }
  .mini-team.champ { background: rgba(240,165,0,0.15); border-color: var(--accent); color: var(--accent); }
  .mini-round-label { font-size: 10px; color: var(--muted); font-family: 'DM Mono', monospace; min-width: 30px; }
  .mini-round-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

  @media (max-width: 640px) {
    .preview-export-header,
    .preview-export-footer {
      grid-template-columns: 1fr;
      gap: 8px;
    }
    .preview-export-title-block {
      align-items: flex-start;
      text-align: left;
    }
    .preview-export-brand-name {
      font-size: 24px;
    }
    .preview-export-title {
      font-size: 20px;
    }
    .preview-export-subtitle {
      max-width: none;
    }
    .sf-team { flex-direction: column; align-items: stretch; }
    #champBtnRow #champConfirmBtn { display: none; }
    #screen-champ { padding-bottom: 120px; }
    #screen-region { padding-bottom: 120px; }
    .mobile-next-bar {
      display: none;
      position: fixed;
      left: 10px;
      right: 10px;
      bottom: 10px;
      z-index: 9997;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: rgba(22,25,34,0.96);
      box-shadow: 0 10px 24px rgba(0,0,0,0.5);
    }
    .mobile-next-bar.show { display: block; }
    .mobile-next-label {
      margin-bottom: 8px;
      color: var(--muted);
      font-family: 'DM Mono', monospace;
      font-size: 10px;
      letter-spacing: 0.5px;
      text-transform: uppercase;
    }
    .mobile-next-bar .btn {
      width: 100%;
      justify-content: center;
      min-height: 44px;
      padding: 10px 16px;
      font-size: 14px;
    }

    .mobile-region-next {
      display: block;
      position: fixed;
      left: 10px;
      right: 10px;
      bottom: 10px;
      z-index: 9997;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: rgba(22,25,34,0.96);
      box-shadow: 0 10px 24px rgba(0,0,0,0.5);
      transform: translateY(calc(100% + 20px));
      transition: transform 300ms cubic-bezier(0.34, 1.3, 0.64, 1),
                  visibility 0s linear 300ms;
      visibility: hidden;
      pointer-events: none;
    }
    .mobile-region-next.show {
      transform: translateY(0);
      visibility: visible;
      pointer-events: auto;
      transition: transform 300ms cubic-bezier(0.34, 1.3, 0.64, 1),
                  visibility 0s linear 0s;
    }
    .mobile-region-next .btn {
      width: 100%;
      justify-content: center;
      min-height: 44px;
      padding: 10px 16px;
      font-size: 14px;
    }

    #champTableWrap { position: relative; }
    #champTableWrap.show-scroll-cue::after {
      content: 'Swipe →';
      position: absolute;
      right: 10px;
      bottom: 8px;
      z-index: 2;
      padding: 3px 7px;
      border-radius: 999px;
      font-family: 'DM Mono', monospace;
      font-size: 10px;
      color: var(--text);
      background: rgba(13,15,20,0.88);
      border: 1px solid var(--border);
      pointer-events: none;
    }
    #champTableWrap.show-scroll-cue::before {
      content: '';
      position: absolute;
      top: 34px;
      right: 0;
      width: 44px;
      height: calc(100% - 34px);
      background: linear-gradient(to left, rgba(13,15,20,0.9), rgba(13,15,20,0));
      pointer-events: none;
      z-index: 1;
    }
    #champTableHint.show { display: block; }

    #champTable {
      width: max-content;
      min-width: 100%;
    }
    /* Mobile compact mode: keep Seed + Team sticky, show Public% + Leverage,
       hide lower-priority Region + Model% columns. */
    #champTable thead th,
    #champTable tbody td {
      padding: 6px 5px;
    }
    #champTable thead th {
      font-size: 10px;
      letter-spacing: 0.6px;
    }
    #champTable tbody td {
      font-size: 12px;
    }
    #champTable .pct { font-size: 12px; }
    #champTable .lev {
      font-size: 12px;
      min-width: 42px;
      padding: 4px 6px;
    }
    #champTable .seed-badge {
      width: 20px;
      height: 20px;
      font-size: 10px;
    }
    #champTable .team-name {
      display: inline-block;
      max-width: 104px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      vertical-align: bottom;
    }
    #champTable th:nth-child(3),
    #champTable td:nth-child(3) {
      display: none;
    }
    #champTable th:nth-child(1),
    #champTable td:nth-child(1) {
      position: sticky;
      left: 0;
      z-index: 4;
      background: var(--surface);
    }
    #champTable th:nth-child(2),
    #champTable td:nth-child(2) {
      position: sticky;
      left: 36px;
      z-index: 4;
      background: var(--surface);
      box-shadow: 8px 0 10px -8px rgba(0,0,0,0.55);
    }
    #champTable thead th:nth-child(1),
    #champTable thead th:nth-child(2) {
      background: var(--surface2);
      z-index: 6;
    }
    #champTable tbody tr.selected td:nth-child(1),
    #champTable tbody tr.selected td:nth-child(2) {
      background: #1b212d;
    }
    #champTable td:nth-child(1) { min-width: 36px; }
    #champTable th:nth-child(1) { min-width: 36px; }
    #champTable td:nth-child(2),
    #champTable th:nth-child(2) { min-width: 116px; }
    #champTable thead th:last-child span {
      opacity: 0.9 !important;
      display: inline-block;
      padding: 8px;
      margin: -8px;
      font-size: 12px;
    }

    .bracket-team {
      min-height: 44px;
      align-items: flex-start;
      flex-wrap: wrap;
      row-gap: 2px;
      padding: 6px 8px;
    }
    .bracket-team .bt-seed { margin-top: 2px; }
    .bracket-team .bt-name { line-height: 1.2; }
    /* Force leverage value to always appear on its own second line,
       regardless of team name length. ⓘ button stays on line 1 via order. */
    .bracket-team .bt-info-btn { order: 3; margin-left: auto; }
    .bt-mobile-meta {
      display: inline-flex;
      order: 4;
      flex-basis: 100%;
      margin-left: 20px;
      font-family: 'DM Mono', monospace;
      font-size: 10px;
      line-height: 1.2;
      border-radius: 4px;
      padding: 1px 6px;
      background: rgba(255,255,255,0.04);
    }
    .bt-mobile-meta.pos-strong, .bt-mobile-meta.pos-mid { color: #4ade80; }
    .bt-mobile-meta.neg-strong, .bt-mobile-meta.neg-mid { color: #f87171; }
    .bt-mobile-meta.neutral { color: var(--muted); }

    .summary-panel { padding: 12px; }
    .summary-panel-inner { gap: 12px; }
    .summary-section h3 { font-size: 12px; margin-bottom: 6px; }
    .pick-row { padding: 8px 10px; margin-bottom: 6px; }
    .pick-round { font-size: 12px; }
    .pick-team { font-size: 14px; }
    .contrarian-badge { font-size: 12px; padding: 3px 8px; }
    .cs-benchmark { font-size: 11px; }
  }

  @media print {
    @page {
      size: letter landscape;
      margin: 0.3in;
    }

    body {
      background: #ffffff !important;
      color: #1b1f28 !important;
    }

    .header,
    .btn-row,
    .bracket-swipe-hint,
    .summary-panel,
    #toast,
    #statsSheet {
      display: none !important;
    }

    .screen {
      display: none !important;
      padding: 0 !important;
      max-width: none !important;
      margin: 0 !important;
      animation: none !important;
    }

    #screen-preview {
      display: block !important;
    }

    #screen-preview .screen-title,
    #screen-preview .screen-subtitle {
      display: none !important;
    }

    .preview-layout,
    .bracket-preview,
    .preview-bracket-viewport,
    .preview-export-body {
      overflow: visible !important;
    }

    .bracket-preview {
      background: #ffffff !important;
      border: none !important;
      padding: 0 !important;
      border-radius: 0 !important;
    }

    .preview-export-shell {
      gap: 10px !important;
      padding: 0 !important;
    }

    .preview-export-brand-kicker,
    .preview-export-attribution,
    .preview-region-kicker,
    .preview-round-label,
    .preview-center-kicker,
    .preview-finals-kicker,
    .preview-champion-kicker,
    .preview-semifinal-label,
    .preview-semifinal-winner {
      color: #3f4654 !important;
    }

    .preview-export-brand-name,
    .preview-export-title,
    .preview-region-title,
    .preview-center-title,
    .preview-champion-name {
      color: #111318 !important;
    }

    .preview-export-subtitle,
    .preview-center-subtitle,
    .preview-semifinal-winner span,
    .preview-tile-name,
    .preview-semifinal-name,
    .preview-finals-slot {
      color: #1f2430 !important;
    }

    .preview-export-footer-line,
    .preview-finals-divider {
      background: #767d8a !important;
    }

    .preview-tile,
    .preview-semifinal-team,
    .preview-finals-slot,
    .preview-semifinal-block,
    .preview-center-card,
    .preview-champion-card {
      background: #ffffff !important;
      border-color: #7b8390 !important;
      box-shadow: none !important;
    }

    .preview-center-card {
      border-width: 1.2px !important;
    }

    .preview-tile--r1,
    .preview-tile--r2,
    .preview-tile--r3,
    .preview-tile--r4 {
      background: #ffffff !important;
    }

    .preview-tile-seed {
      color: #545c69 !important;
    }

    .preview-tile--winner,
    .preview-semifinal-team.is-winner,
    .preview-finals-slot {
      border-width: 1.5px !important;
      font-weight: 700 !important;
      box-shadow: inset 4px 0 0 #555d69 !important;
    }

    .preview-tile--path,
    .preview-semifinal-team.is-path,
    .preview-finals-slot.is-path,
    .preview-champion-card {
      border-width: 2px !important;
      border-color: #2d3138 !important;
      box-shadow: inset 6px 0 0 #2d3138 !important;
    }

    .preview-champion-card {
      background: #f3f4f6 !important;
    }

    .preview-champion-name {
      letter-spacing: 0.2px !important;
    }

    .preview-connector {
      stroke: #7d8591 !important;
      stroke-width: 1.1 !important;
    }

    .preview-connector--winner {
      stroke: #525964 !important;
      stroke-width: 1.2 !important;
    }

    .preview-connector--path {
      stroke: #23272f !important;
      stroke-width: 1.7 !important;
      stroke-dasharray: 0 !important;
    }

    #previewBracketScale {
      zoom: 1 !important;
    }
  }

  /* ── PDF light-mode export ─────────────────────────────────────────────────
     Applied to <html> by exportPDF() before html2canvas capture.
     Mirrors @media print color overrides so the PDF matches the print layout. */

  /* .winner tiles use hardcoded RGBA — override explicitly for light mode */

  /* ── Phase 2 Mobile UX ──────────────────────────────────────────── */

  /* Pick confirmation flash */
  @keyframes pickPop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.055); }
    100% { transform: scale(1); }
  }
  .bracket-team.pick-flash { animation: pickPop 160ms ease-out; }

  /* Winner slot completion pulse */
  @keyframes winnerPulse {
    0%   { box-shadow: 0 0 0 0 rgba(240,165,0,0.65); }
    60%  { box-shadow: 0 0 0 14px rgba(240,165,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(240,165,0,0); }
  }
  .region-winner-display.winner-pulse { animation: winnerPulse 450ms ease-out; }

  /* ⓘ info button inside bracket tiles */
  .bt-info-btn {
    display: none;
    align-items: center; justify-content: center;
    width: 22px; height: 22px; flex-shrink: 0;
    margin-left: auto;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-family: 'DM Mono', monospace;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .bt-info-btn:active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(240,165,0,0.1);
  }
  @media (max-width: 640px) {
    .bt-info-btn { display: inline-flex; }
  }

  /* Hide old tab row — replaced by header links */
  .mobile-tab-row { display: none !important; }

  /* Leverage link in bracket panel header (mobile only) */
  .bracket-lev-link {
    display: none;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    background: rgba(240,165,0,0.06);
    border: 1px solid rgba(240,165,0,0.22);
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px;
    align-items: center;
  }
  .bracket-lev-link:active { background: rgba(240,165,0,0.14); }
  @media (max-width: 1000px) { .bracket-lev-link { display: inline-flex; } }

  /* Back-to-bracket button in leverage panel header (mobile only) */
  .lev-back-btn {
    display: none;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px;
    align-items: center;
  }
  .lev-back-btn:active { border-color: var(--muted); background: var(--surface2); }
  @media (max-width: 1000px) { .lev-back-btn { display: inline-flex; } }

  /* Stats bottom sheet */
  .stats-sheet {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
  }
  .stats-sheet.open { display: block; }
  .stats-sheet-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
  }
  .stats-sheet-panel {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    padding: 0 20px 40px;
    max-height: 78vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 280ms cubic-bezier(0.34, 1.2, 0.64, 1);
  }
  .stats-sheet.open .stats-sheet-panel { transform: translateY(0); }
  .stats-sheet-handle {
    width: 36px; height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin: 12px auto 0;
  }
  .stats-sheet-close {
    position: absolute;
    top: 12px; right: 16px;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--surface2);
    border: none;
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }
  .stats-sheet-team {
    font-size: 19px; font-weight: 700;
    margin-top: 20px; margin-bottom: 3px;
  }
  .stats-sheet-meta {
    font-size: 12px; color: var(--muted);
    font-family: 'DM Mono', monospace;
    margin-bottom: 20px;
  }
  .stats-sheet-section {
    font-family: 'DM Mono', monospace;
    font-size: 9px; text-transform: uppercase;
    letter-spacing: 1px; color: var(--muted);
    margin-bottom: 8px;
  }
  .stats-sheet-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px; margin-bottom: 20px;
  }
  .stats-sheet-stat {
    background: var(--surface2);
    border-radius: 8px; padding: 12px 14px;
  }
  .stats-sheet-stat-label {
    font-size: 10px; font-family: 'DM Mono', monospace;
    color: var(--muted); text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 5px;
  }
  .stats-sheet-stat-value {
    font-size: 22px; font-weight: 700;
    font-family: 'DM Mono', monospace; color: var(--text);
  }
  .stats-sheet-lev {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px;
    background: var(--surface2);
    border-radius: 8px; margin-bottom: 16px;
  }
  .stats-sheet-lev-label {
    font-family: 'DM Mono', monospace; font-size: 11px;
    color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px;
  }
  .stats-sheet-lev-value {
    font-family: 'DM Mono', monospace;
    font-size: 20px; font-weight: 700;
  }
  .stats-sheet-link {
    display: flex; align-items: center; gap: 8px;
    padding: 13px 16px;
    background: rgba(240,165,0,0.06);
    border: 1px solid rgba(240,165,0,0.22);
    border-radius: 8px;
    color: var(--accent); font-size: 13px; font-weight: 500;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px;
  }
  .stats-sheet-link:active { background: rgba(240,165,0,0.14); }


/* ============================================================
   LANDING PAGE
   ============================================================ */

/* Prevent app screens from showing on landing page */
.landing-body .screen,
.landing-body .header,
.landing-body .toast {
  display: none !important;
}

/* ---- Layout ---- */
.lp-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Nav ---- */
.lp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}
.lp-nav-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  color: var(--accent);
  letter-spacing: 2px;
  text-decoration: none;
}
.lp-nav-logo span { color: var(--text); }
.lp-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.lp-nav-link {
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s, color 0.2s;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.lp-nav-link:hover { border-color: var(--text); color: var(--text); }
.lp-nav-cta {
  background: var(--accent);
  color: #0a0a0a;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  transition: opacity 0.2s;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.lp-nav-cta:hover { opacity: 0.88; }
.lp-nav-cta-mobile { display: none; }
@media (max-width: 640px) {
  .lp-nav { padding: 12px 16px; }
  .lp-nav-right { display: none; }
  .lp-nav-cta-mobile { display: flex; }
}

/* ---- Section base ---- */
.lp-section {
  padding: 80px 0;
}
.lp-section-headline {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px;
  color: var(--text);
  letter-spacing: 1px;
  margin-bottom: 20px;
  text-transform: uppercase;
}
.lp-headline-sm { font-size: 30px; }
.lp-body-copy {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 680px;
  margin-bottom: 32px;
}

/* ---- Hero ---- */
.lp-hero {
  padding: 100px 0 80px;
  border-bottom: 1px solid var(--border);
}
.lp-hero-headline {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 64px;
  line-height: 1.0;
  color: var(--text);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.lp-hero-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  line-height: 1.65;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin-bottom: 36px;
}
.lp-btn-primary {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: #0a0a0a;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  padding: 14px 32px;
  border-radius: 10px;
  min-height: 48px;
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: 0.2px;
}
.lp-btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.lp-trust-line {
  margin-top: 16px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.3px;
}
@media (max-width: 640px) {
  .lp-hero { padding: 60px 0 56px; }
  .lp-hero-headline { font-size: 40px; }
  .lp-hero-sub { font-size: 16px; }
  .lp-btn-primary { width: 100%; justify-content: center; }
}

/* ---- Problem section ---- */
.lp-problem { background: var(--surface); border-bottom: 1px solid var(--border); }
.lp-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.lp-stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 20px;
  text-align: center;
}
.lp-stat-value {
  font-family: 'DM Mono', monospace;
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.lp-stat-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.lp-stat-disclaimer {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
@media (max-width: 640px) {
  .lp-stat-grid { grid-template-columns: 1fr; }
  .lp-stat-value { font-size: 24px; }
}

/* ---- How It Works ---- */
.lp-how { border-bottom: 1px solid var(--border); }
.lp-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.lp-step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 24px;
}
.lp-step-num {
  font-family: 'DM Mono', monospace;
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}
.lp-step-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.3;
}
.lp-step-copy {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
@media (max-width: 640px) {
  .lp-steps-grid { grid-template-columns: 1fr; }
}

/* ---- Leverage ---- */
.lp-leverage { background: var(--surface); border-bottom: 1px solid var(--border); }
.lp-data-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 28px;
  max-width: 480px;
  margin-bottom: 20px;
  font-family: 'DM Mono', monospace;
}
.lp-data-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.8px;
  margin-bottom: 16px;
  text-transform: uppercase;
}
.lp-data-rows { display: flex; flex-direction: column; gap: 8px; }
.lp-data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.lp-data-key {
  font-size: 13px;
  color: var(--muted);
}
.lp-data-val {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
.lp-data-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.lp-data-row-leverage { margin-top: 4px; }
.lp-data-key-leverage {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.lp-data-gold {
  color: var(--accent);
  font-size: 22px;
  font-weight: 600;
}
.lp-data-caption {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 560px;
}

/* ---- Who It's For ---- */
.lp-who { border-bottom: 1px solid var(--border); }
.lp-who-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.lp-who-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 24px;
}
.lp-who-card-honest { border-color: var(--color-border-active); }
.lp-who-card-title {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.lp-who-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lp-who-list li {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  padding-left: 18px;
  position: relative;
}
.lp-who-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--muted);
}
@media (max-width: 640px) {
  .lp-who-grid { grid-template-columns: 1fr; }
}

/* ---- Final CTA ---- */
.lp-final-cta { background: var(--surface); }
.lp-final-cta-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.lp-final-secondary {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.lp-final-secondary:hover { color: var(--text); }

/* ---- Mobile section padding ---- */
@media (max-width: 640px) {
  .lp-section { padding: 56px 0; }
  .lp-section-headline { font-size: 28px; }
  .lp-data-card { max-width: 100%; }
}
