    :root {
      /* One accent: emerald. Dark shades carry text for AA contrast. */
      --accent:        #059669;   /* primary surfaces */
      --accent-strong: #047857;   /* hover / pressed */
      --accent-ink:    #065f46;   /* accent text on light (≥7:1) */
      --accent-tint:   #ecfdf5;   /* faint accent background */
      --accent-tint-2: #d1fae5;
      /* Button/FAB fills carry WHITE text, so they must stay dark enough for AA
         (≥4.5:1) in BOTH themes — kept separate from the decorative --accent so
         dark mode can use a brighter accent for dots/bars without failing here.
         #047857 white = 5.5:1, #036648 white = 7.3:1. Not overridden in dark. */
      --btn-fill:        #047857;
      --btn-fill-strong: #036648;

      --ink:      #0f172a;        /* primary text */
      --ink-2:    #475569;        /* secondary text */
      --ink-3:    #5b677a;        /* muted text (≥4.5:1 on white & tinted surfaces) */
      --line:     #e2e8f0;
      --line-2:   #eef2f6;
      --surface:  #ffffff;
      --surface-2: #eef2f7;   /* inset surfaces (segmented tab rows, etc.) */
      --bg:       #f6f8fa;

      --danger:   #dc2626;
      --danger-bg:#fef2f2;
      --warn:     #92400e;
      --warn-bg:  #fffbeb;
      --info:     #1d4ed8;
      --info-bg:  #eff6ff;

      --r-lg: 16px;
      --r:    12px;
      --r-sm: 9px;
      --shadow:    0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
      --shadow-md: 0 4px 12px -2px rgba(15,23,42,.10), 0 2px 6px -2px rgba(15,23,42,.06);
      --shadow-lg: 0 12px 32px -8px rgba(15,23,42,.18);
      --nav-h: 64px;
      --ring: 0 0 0 3px rgba(5,150,105,.30);
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    html { -webkit-text-size-adjust: 100%; }
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
      background: var(--bg);
      color: var(--ink);
      min-height: 100dvh;
      display: flex;
      flex-direction: column;
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
      text-rendering: optimizeLegibility;
    }

    /* Visible, consistent keyboard focus everywhere. */
    :focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; border-radius: 4px; }
    .sr-only {
      position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
      overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
    }
    .skip-link:focus { width: auto; height: auto; clip: auto; overflow: visible; padding: 8px 16px; background: var(--surface); color: var(--accent-ink); font-weight: 700; z-index: 100; border-radius: var(--r-sm); box-shadow: var(--shadow-lg); white-space: nowrap; text-decoration: none; }

    /* ── Header ── */
    .app-header {
      background: rgba(255,255,255,.85);
      backdrop-filter: saturate(180%) blur(12px);
      -webkit-backdrop-filter: saturate(180%) blur(12px);
      border-bottom: 1px solid var(--line);
      padding: 0 16px;
      height: 56px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: sticky;
      top: 0;
      z-index: 30;
    }
    .brand { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
    .brand .dot { display: inline-flex; align-items: center; color: var(--accent); }
    .brand .dot svg { width: 22px; height: 22px; }
    .user-badge {
      font-size: .8rem;
      font-weight: 600;
      color: var(--accent-ink);
      background: var(--accent-tint);
      padding: 6px 12px;
      border-radius: 999px;
      max-width: 150px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* ── Content area ── */
    .app-content {
      flex: 1;
      width: 100%;
      max-width: 680px;
      margin: 0 auto;
      /* Bottom space clears BOTH the fixed nav and the record FAB (58px + label
         + gap, ~92px above the nav) so the last card is never covered. */
      padding: 20px 16px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 96px);
    }

    /* ── Bottom nav ── */
    .bottom-nav {
      position: fixed;
      bottom: 0; left: 0; right: 0;
      height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
      padding-bottom: env(safe-area-inset-bottom, 0px);
      background: rgba(255,255,255,.92);
      backdrop-filter: saturate(180%) blur(12px);
      -webkit-backdrop-filter: saturate(180%) blur(12px);
      border-top: 1px solid var(--line);
      display: flex;
      z-index: 30;
    }
    .bottom-nav[hidden] { display: none; }
    .nav-btn {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      background: none;
      border: none;
      cursor: pointer;
      color: var(--ink-3);
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: .01em;
      transition: color .15s;
      padding: 8px 4px;
      min-height: 48px;
    }
    .nav-btn svg { width: 23px; height: 23px; }
    .nav-btn.active { color: var(--accent-ink); }
    .nav-btn.active svg { stroke: var(--accent); }

    /* ── Views ── */
    .view { display: none; }
    .view.active { display: block; animation: fade .25s ease; }
    @keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

    /* ── Auth ── */
    .auth-wrap {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: calc(100dvh - 56px);
      padding: 24px 16px;
    }
    .auth-card {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: var(--r-lg);
      padding: 32px 24px;
      width: 100%;
      max-width: 400px;
      box-shadow: var(--shadow-lg);
    }
    .auth-logo { display: flex; justify-content: center; margin-bottom: 10px; color: var(--accent); }
    .auth-logo svg { width: 42px; height: 42px; }
    .auth-card h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; text-align: center; }
    .auth-card .sub { font-size: .9rem; color: var(--ink-3); margin-bottom: 24px; text-align: center; }
    .tab-row {
      display: flex;
      background: var(--bg);
      border: 1px solid var(--line);
      border-radius: var(--r-sm);
      padding: 4px;
      margin-bottom: 24px;
      gap: 4px;
    }
    .tab-btn {
      flex: 1;
      padding: 9px;
      border: none;
      background: none;
      border-radius: 6px;
      cursor: pointer;
      font-size: .9rem;
      font-weight: 600;
      color: var(--ink-3);
      transition: all .15s;
    }
    .tab-btn.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

    /* ── Forms ── */
    .fg { margin-bottom: 16px; }
    label { display: block; font-size: .84rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
    label .opt { color: var(--ink-3); font-weight: 400; }
    input:not([type=range]), select {
      width: 100%;
      padding: 12px 14px;
      border: 1.5px solid var(--line);
      border-radius: var(--r-sm);
      font-size: 1rem;
      color: var(--ink);
      background: var(--surface);
      transition: border-color .15s, box-shadow .15s;
      -webkit-appearance: none;
      appearance: none;
    }
    input::placeholder { color: var(--ink-3); opacity: .8; }
    input:not([type=range]):focus, select:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: var(--ring);
    }
    select {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 12px center;
      background-size: 18px;
      padding-right: 40px;
    }
    input[type=range] {
      width: 100%; height: 24px; accent-color: var(--accent); cursor: pointer; background: transparent;
    }

    /* ── Buttons ── */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 12px 18px;
      border: 1.5px solid transparent;
      border-radius: var(--r-sm);
      font-size: .92rem;
      font-weight: 700;
      cursor: pointer;
      transition: transform .08s, background .15s, border-color .15s, color .15s;
      white-space: nowrap;
      min-height: 44px;
      font-family: inherit;
    }
    .btn:active:not(:disabled) { transform: scale(.985); }
    .btn:disabled { opacity: .55; cursor: not-allowed; }
    .btn svg { width: 18px; height: 18px; flex-shrink: 0; }
    .btn-primary { background: var(--btn-fill); color: #fff; width: 100%; box-shadow: var(--shadow); }
    /* Inline "Ask" button sizes to its content so the text field fills the row
       (btn-primary's width:100% was squashing the input to a tiny square). */
    .copilot-panel form .btn { width: auto; }
    /* Icons that sit inside text/titles default to ~1em so an UNSIZED icon can never balloon —
       this was the giant location pin in the Passport "Home location" card. Context rules
       (.btn svg, .nav-btn svg, chart svgs) keep their explicit sizes. */
    .sec-sub svg, .card-title svg, .meta-row svg, .meta-row .k svg, p svg {
      width: 1em; height: 1em; vertical-align: -.15em; flex-shrink: 0;
    }
    .btn-primary:hover:not(:disabled) { background: var(--btn-fill-strong); }
    .btn-outline { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
    .btn-outline:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-ink); }
    .btn-sm { padding: 8px 13px; font-size: .82rem; min-height: 36px; gap: 5px; }
    .btn-ghost-green {
      background: var(--accent-tint);
      color: var(--accent-ink);
      border-color: var(--accent-tint-2);
    }
    .btn-ghost-green:hover:not(:disabled) { background: var(--accent-tint-2); }

    /* ── Alerts ── */
    .alert {
      padding: 12px 14px;
      border-radius: var(--r-sm);
      font-size: .88rem;
      margin-bottom: 16px;
      display: flex;
      gap: 9px;
      align-items: flex-start;
      line-height: 1.45;
    }
    .alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
    .alert-error { background: var(--danger-bg); color: #991b1b; }
    .alert-success { background: var(--accent-tint); color: var(--accent-ink); }
    .alert-info { background: var(--info-bg); color: var(--info); }

    /* ── Section header ── */
    .sec-hdr {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 16px;
    }
    .sec-title { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
    .sec-sub { font-size: .85rem; color: var(--ink-3); margin-top: 2px; }

    /* ── Cards ── */
    .card {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: var(--r);
      padding: 16px;
      margin-bottom: 12px;
      box-shadow: var(--shadow);
    }
    .panel {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: var(--r-lg);
      padding: 18px 16px;
      margin-bottom: 20px;
      box-shadow: var(--shadow);
    }
    .card-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
    .card-meta {
      font-size: .8rem;
      color: var(--ink-3);
      display: flex;
      align-items: center;
      gap: 7px;
      flex-wrap: wrap;
      margin-top: 6px;
    }

    /* ── Badges ── */
    .badge {
      display: inline-flex;
      align-items: center;
      padding: 3px 9px;
      border-radius: 999px;
      font-size: .72rem;
      font-weight: 700;
      letter-spacing: .01em;
    }
    .badge-green { background: var(--accent-tint); color: var(--accent-ink); }
    /* Theme-aware, readable badges. badge-gray was a hardcoded light pill (invisible in dark);
       tints use the semantic color over the current surface so they're clean + high-contrast in
       both themes (no muddy dark-brown amber). */
    .badge-gray { background: var(--line); color: var(--ink); }
    .badge-blue { background: color-mix(in srgb, var(--info) 16%, transparent); color: var(--info); }
    .badge-yellow { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }

    /* ── Spinner ── */
    .spinner {
      display: inline-block;
      width: 18px; height: 18px;
      border: 2.5px solid rgba(255,255,255,.4);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin .7s linear infinite;
    }
    .spinner-dark { border-color: rgba(5,150,105,.2); border-top-color: var(--accent); }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ── Skeleton loaders ── */
    .skel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
    .skel { background: linear-gradient(100deg, #eef2f6 30%, #f8fafc 50%, #eef2f6 70%); background-size: 200% 100%; border-radius: 6px; animation: shimmer 1.3s infinite; }
    @keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
    .skel-line { height: 12px; margin-bottom: 10px; }

    /* ── Empty state ── */
    .empty {
      text-align: center;
      padding: 48px 20px;
      color: var(--ink-3);
    }
    .empty .ico {
      width: 72px; height: 72px; margin: 0 auto 14px;
      display: flex; align-items: center; justify-content: center;
      border-radius: 20px; background: var(--accent-tint); color: var(--accent-ink);
    }
    .empty .ico svg { width: 34px; height: 34px; }
    .empty h3 { font-size: 1rem; color: var(--ink-2); font-weight: 700; margin-bottom: 4px; }
    .empty p { font-size: .88rem; max-width: 280px; margin: 0 auto; }

    .result-count { font-size: .82rem; color: var(--ink-3); margin-bottom: 12px; font-weight: 600; }

    /* ── Location controls ── */
    .loc-or { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--ink-3); font-size: .78rem; font-weight: 600; }
    .loc-or::before, .loc-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
    .search-row { display: flex; gap: 8px; }
    .search-row .fg { flex: 1; margin: 0; }
    .range-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
    .range-val { font-weight: 800; color: var(--accent-ink); font-size: .92rem; }
    .loc-banner {
      display: flex; align-items: center; gap: 8px;
      background: var(--accent-tint); color: var(--accent-ink);
      border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 14px;
      font-size: .85rem; font-weight: 600;
    }
    .loc-banner svg { width: 16px; height: 16px; flex-shrink: 0; }

    /* ── Venues ── */
    .court-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 0;
      border-top: 1px solid var(--line-2);
    }
    .court-row .cn { font-size: .9rem; font-weight: 600; }
    .dist-pill { font-size: .82rem; font-weight: 700; color: var(--accent-ink); margin-top: 3px; }
    .claim-cta {
      display: flex; align-items: center; gap: 8px;
      margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2);
      color: var(--accent-ink); font-size: .84rem; font-weight: 700; text-decoration: none;
    }
    .claim-cta span { flex: 1; }
    .claim-cta svg { width: 16px; height: 16px; flex-shrink: 0; }
    .claim-cta:hover { color: var(--accent-strong); }
    .add-venue-cta {
      display: flex; align-items: center; gap: 10px; justify-content: center;
      margin-top: 16px; padding: 14px; border: 1px dashed var(--line); border-radius: var(--r);
      color: var(--ink-2); font-size: .86rem; font-weight: 700; text-decoration: none; background: var(--surface);
    }
    .add-venue-cta:hover { border-color: var(--accent); color: var(--accent-ink); }
    .add-venue-cta svg { width: 16px; height: 16px; flex-shrink: 0; }

    /* ── Leagues ── */
    .league-hdr { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
    .league-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
    .expand-btn {
      background: none; border: none; cursor: pointer;
      color: var(--accent-ink); font-size: .82rem; font-weight: 700;
      display: flex; align-items: center; gap: 4px; padding: 4px 2px; min-height: 28px;
    }
    .expand-icon { display: inline-block; transition: transform .2s; }
    .expand-icon.open { transform: rotate(180deg); }
    .standings-wrap { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
    .standings-tbl { width: 100%; border-collapse: collapse; font-size: .84rem; }
    .standings-tbl th {
      text-align: left; padding: 6px 8px;
      background: var(--bg); color: var(--ink-3);
      font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    }
    .standings-tbl th:first-child { border-radius: 6px 0 0 6px; }
    .standings-tbl th:last-child { border-radius: 0 6px 6px 0; }
    .standings-tbl td { padding: 9px 8px; border-top: 1px solid var(--line-2); }
    .standings-tbl tr:first-child td { border-top: none; }
    .standings-tbl .rk { color: var(--ink-3); font-weight: 800; text-align: center; width: 24px; }
    .standings-tbl .nm { font-weight: 600; }
    .standings-tbl .n { text-align: center; color: var(--ink-2); }
    .standings-tbl .pt { text-align: center; font-weight: 800; color: var(--accent-ink); }

    /* ── Matchmaking ── */
    .match-score-big { font-size: 1.5rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
    .score-bars { margin-top: 13px; border-top: 1px solid var(--line-2); padding-top: 11px; }
    .bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
    .bar-lbl { font-size: .74rem; color: var(--ink-3); width: 92px; flex-shrink: 0; font-weight: 600; }
    .bar-track { flex: 1; background: #eef2f6; border-radius: 999px; height: 7px; overflow: hidden; }
    .bar-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width .6s ease; }
    .bar-val { font-size: .74rem; color: var(--ink-3); width: 34px; text-align: right; font-weight: 700; }
    .sugg-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

    /* ── Competitive partner cards ── */
    .card.podium { border-color: var(--accent-tint-2); box-shadow: var(--shadow-md); }
    .rank-chip {
      display: inline-flex; align-items: center; justify-content: center;
      min-width: 40px; height: 40px; padding: 0 9px;
      border-radius: 12px; flex-shrink: 0;
      font-size: .98rem; font-weight: 800; letter-spacing: -.02em;
      background: #f1f5f9; color: var(--ink-2);
    }
    .rank-chip .medal { width: 25px; height: 25px; }
    .rank-chip.gold   { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #7c2d12; box-shadow: 0 3px 10px -3px rgba(245,158,11,.6); }
    .rank-chip.silver { background: linear-gradient(135deg, #f1f5f9, #cbd5e1); color: #334155; }
    .rank-chip.bronze { background: linear-gradient(135deg, #fed7aa, #d97706); color: #fff; }
    .stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 13px; }
    .stat-cell { background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 8px; text-align: center; }
    .stat-cell .sv { font-size: 1.05rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
    .stat-cell .sl { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin-top: 5px; }
    .rel-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
    .why { margin-top: 13px; border-top: 1px solid var(--line-2); padding-top: 11px; }
    .why summary {
      font-size: .78rem; font-weight: 700; color: var(--accent-ink); cursor: pointer;
      list-style: none; display: flex; align-items: center; gap: 6px; min-height: 24px;
    }
    .why summary::-webkit-details-marker { display: none; }
    .why summary::after { content: '▾'; font-size: .72rem; transition: transform .2s; margin-left: auto; }
    .why[open] summary::after { transform: rotate(180deg); }
    .why .score-bars { margin-top: 11px; }

    /* ── Profile ── */
    .profile-hero {
      background: linear-gradient(135deg, var(--accent-strong) 0%, var(--accent-ink) 100%);
      color: #fff;
      border-radius: var(--r-lg);
      padding: 26px 22px;
      margin-bottom: 14px;
      box-shadow: var(--shadow-md);
    }
    .profile-hero .pname { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 3px; }
    .profile-hero .pemail { font-size: .88rem; opacity: .9; }
    .profile-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
    .pstat { background: rgba(255,255,255,.16); border-radius: var(--r); padding: 14px; }
    .pstat .v { font-size: 1.5rem; font-weight: 800; line-height: 1; }
    .pstat .l { font-size: .74rem; opacity: .9; margin-top: 6px; font-weight: 600; }
    .meta-row { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; }
    .meta-row .k { color: var(--ink-3); }
    .meta-row .vl { font-weight: 600; }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
      html { scroll-behavior: auto !important; }
    }

    /* ── Venue detail view ───────────────────────────────────────────── */
    textarea {
      width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
      font-size: 1rem; color: var(--ink); background: var(--surface);
      transition: border-color .15s, box-shadow .15s; font-family: inherit;
      line-height: 1.45; resize: vertical; min-height: 80px;
      -webkit-appearance: none; appearance: none;
    }
    textarea::placeholder { color: var(--ink-3); opacity: .8; }
    textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

    .back-btn-vd {
      display: inline-flex; align-items: center; gap: 5px;
      color: var(--accent-ink); font-size: .84rem; font-weight: 700;
      background: none; border: none; cursor: pointer; font-family: inherit;
      padding: 0; margin-bottom: 14px; min-height: 28px;
    }
    .back-btn-vd svg { width: 16px; height: 16px; }
    .back-btn-vd:hover { color: var(--accent-strong); }

    .vd-hero {
      background: linear-gradient(135deg, var(--accent-strong) 0%, var(--accent-ink) 100%);
      color: #fff; border-radius: var(--r-lg); padding: 22px 20px 20px;
      margin-bottom: 16px; box-shadow: var(--shadow-md);
    }
    .vd-name { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 6px; }
    .vd-addr { font-size: .88rem; opacity: .9; display: flex; align-items: flex-start; gap: 6px; line-height: 1.4; }
    .vd-addr svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }
    .vd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
    .vd-stat { background: rgba(255,255,255,.15); border-radius: var(--r); padding: 10px 8px; text-align: center; }
    .vd-stat .sv { font-size: 1.2rem; font-weight: 800; line-height: 1.1; }
    .vd-stat .sl { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; opacity: .88; margin-top: 4px; }

    .vd-section-hdr {
      display: flex; align-items: center; gap: 7px;
      font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
      color: var(--ink-3); margin-bottom: 12px;
    }
    .vd-section-hdr svg { width: 14px; height: 14px; }

    /* Leaderboard (mirrors venue.html) */
    .board-head {
      display: flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--ink-2); font-weight: 600;
      background: var(--accent-tint); border-radius: var(--r-sm); padding: 9px 11px; margin-bottom: 14px;
    }
    .board-head svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--accent-ink); }
    .board-section-title { font-size: .8rem; font-weight: 800; color: var(--ink-2); letter-spacing: -.01em; margin-bottom: 10px; }
    .board-section-title svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; color: var(--accent-ink); }
    .spotlight { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
    @media (max-width: 360px) { .spotlight { grid-template-columns: 1fr; } }
    .spot { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 13px; box-shadow: var(--shadow); min-width: 0; }
    .spot.hero { grid-column: 1 / -1; background: linear-gradient(135deg, #fffbeb 0%, #fefce8 100%); border-color: #fde68a; }
    .spot-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .spot-pct { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
    .spot-pct .pu { font-size: .85rem; font-weight: 700; }
    .spot.hero .spot-pct { font-size: 1.9rem; }
    .spot-name { font-size: 1rem; font-weight: 800; letter-spacing: -.01em; margin-top: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .spot.hero .spot-name { font-size: 1.2rem; }
    .spot-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
    .spot-sub { font-size: .82rem; color: var(--ink-2); font-weight: 600; margin-top: 9px; }
    .lb-list { display: flex; flex-direction: column; }
    .lb-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid var(--line-2); }
    .lb-row:first-child { border-top: none; }
    .lb-main { flex: 1; min-width: 0; }
    .lb-name { font-size: .92rem; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .lb-stats { font-size: .78rem; color: var(--ink-3); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; }
    .lb-dot { color: var(--line); }
    .lb-score { width: 64px; flex-shrink: 0; text-align: right; }
    .lb-pct { font-size: 1rem; font-weight: 800; letter-spacing: -.02em; }
    .lb-bar { background: var(--line-2); border-radius: 999px; height: 5px; overflow: hidden; margin-top: 5px; }
    .lb-bar-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width .6s ease; }

    /* Games */
    .game-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
    .game-card:last-child { margin-bottom: 0; }
    .game-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
    .game-score-wrap { display: flex; align-items: center; gap: 10px; }
    .game-score { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
    .game-vs { font-size: .75rem; color: var(--ink-3); font-weight: 700; }
    .game-meta-row { font-size: .75rem; color: var(--ink-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    .team-row-vd { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 6px; }
    .team-row-vd:last-child { margin-bottom: 0; }
    .team-label-vd { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); width: 24px; flex-shrink: 0; }
    .player-slot-vd { display: inline-flex; align-items: center; gap: 5px; }
    .player-name-vd { font-size: .88rem; font-weight: 600; }
    .ctx-badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .03em; }
    .ctx-home { background: var(--accent-tint); color: var(--accent-ink); }
    .ctx-away { background: #f1f5f9; color: var(--ink-2); }

    /* Home venue CTA */
    .hv-already { display: flex; align-items: center; gap: 8px; color: var(--accent-ink); font-size: .9rem; font-weight: 700; padding: 4px 0; }
    .hv-already svg { width: 18px; height: 18px; }

    /* View-venue button on search result cards */
    .view-venue-btn {
      display: flex; align-items: center; gap: 8px;
      padding: 10px 0; background: none; border: none;
      border-top: 1px solid var(--line-2);
      color: var(--accent-ink); font-size: .84rem; font-weight: 700;
      cursor: pointer; font-family: inherit; width: 100%; text-align: left;
    }
    .view-venue-btn span { flex: 1; }
    .view-venue-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
    .view-venue-btn:hover { color: var(--accent-strong); }

    /* ════════════════════════════════════════════════════════════════════
       Marketing landing (logged-out front page). Lives inside #view-auth so
       it disappears the moment a player signs in and the app views take over.
       ════════════════════════════════════════════════════════════════════ */
    html { scroll-behavior: smooth; }
    [id] { scroll-margin-top: 72px; }

    .mk { display: block; }
    .mk-inner { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
    .mk-section { padding: 76px 0; }
    .mk-eyebrow {
      display: inline-flex; align-items: center; gap: 7px;
      font-size: .73rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
    }
    .mk-eyebrow .eyebrow-mark { display: inline-flex; }
    .mk-eyebrow svg { width: 15px; height: 15px; }
    .sec-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
    .sec-head .mk-eyebrow { color: var(--accent-ink); justify-content: center; margin-bottom: 12px; }
    .sec-head h2 { font-size: clamp(1.55rem, 4vw, 2.15rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; }
    .sec-head p { margin-top: 12px; color: var(--ink-2); font-size: 1.04rem; line-height: 1.55; }

    /* ── Hero ── */
    .hero {
      position: relative;
      overflow: hidden;
      color: #fff;
      background:
        radial-gradient(1100px 460px at 82% -8%, rgba(52,211,153,.40), transparent 62%),
        radial-gradient(700px 400px at 0% 110%, rgba(6,95,70,.55), transparent 60%),
        linear-gradient(155deg, #064e3b 0%, #065f46 48%, #047857 100%);
    }
    /* faint court-line motif, purely decorative */
    .hero::after {
      content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .14;
      background-image:
        linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
      background-size: 56px 56px; mask-image: radial-gradient(80% 70% at 70% 20%, #000, transparent 75%);
      -webkit-mask-image: radial-gradient(80% 70% at 70% 20%, #000, transparent 75%);
    }
    .hero-grid {
      position: relative; z-index: 1;
      display: grid; grid-template-columns: 1.05fr .95fr; gap: 52px; align-items: center;
      padding: 64px 0 76px;
    }
    .hero-copy { max-width: 580px; }
    .hero .mk-eyebrow { color: #a7f3d0; background: rgba(255,255,255,.13); padding: 6px 13px; border-radius: 999px; }
    .hero-title { font-size: clamp(2.1rem, 5.4vw, 3.35rem); font-weight: 800; line-height: 1.04; letter-spacing: -.035em; margin: 20px 0 16px; }
    .hero-title .hl { color: #6ee7b7; }
    .hero-sub { font-size: clamp(1.02rem, 2.2vw, 1.2rem); color: rgba(236,253,245,.94); line-height: 1.5; max-width: 520px; }
    .hero-bullets { list-style: none; margin: 24px 0 0; display: grid; gap: 12px; }
    .hero-bullets li { display: flex; gap: 11px; align-items: flex-start; font-weight: 600; font-size: .98rem; color: #ecfdf5; }
    .hero-bullets svg { width: 21px; height: 21px; flex-shrink: 0; color: #6ee7b7; margin-top: 1px; }
    .hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
    .hero-cta .btn { width: auto; }
    .btn-light { background: #fff; color: var(--accent-ink); box-shadow: var(--shadow-md); }
    .btn-light:hover:not(:disabled) { background: #ecfdf5; color: var(--accent-ink); }
    .btn-on-dark { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.45); color: #fff; }
    .btn-on-dark:hover:not(:disabled) { background: rgba(255,255,255,.16); border-color: #fff; color: #fff; }
    .hero-trust { display: flex; align-items: center; gap: 13px; margin-top: 30px; flex-wrap: wrap; }
    .avatar-stack { display: flex; }
    .avatar-stack .av {
      width: 36px; height: 36px; border-radius: 50%; border: 2px solid #065f46;
      margin-left: -10px; display: flex; align-items: center; justify-content: center;
      font-size: .82rem; font-weight: 800; color: #064e3b;
    }
    .avatar-stack .av:first-child { margin-left: 0; }
    .hero-trust .tcap { font-size: .86rem; color: rgba(236,253,245,.92); font-weight: 600; line-height: 1.35; }

    /* Auth card slot inside hero */
    .hero-auth { display: flex; justify-content: center; }
    .hero-auth .auth-card { margin: 0; max-width: 420px; width: 100%; }
    .auth-switch { text-align: center; font-size: .85rem; color: var(--ink-3); margin-top: 18px; }
    /* min 24px touch target (WCAG 2.2 AA target-size) for these inline link-buttons. */
    .auth-switch button { background: none; border: none; padding: 3px 6px; font: inherit; color: var(--accent-ink); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; min-height: 24px; }
    .auth-switch button:hover { text-decoration: underline; }
    .trust-line { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 16px; font-size: .76rem; color: var(--ink-3); font-weight: 600; }
    .trust-line svg { width: 15px; height: 15px; color: var(--accent); }

    /* ── Benefits / advantages ── */
    .sec-tint { background: var(--bg); }
    .adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
    .adv-card {
      background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
      padding: 24px; box-shadow: var(--shadow);
      transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
    }
    .adv-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent-tint-2); }
    .adv-ico {
      width: 48px; height: 48px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
      background: var(--accent-tint); color: var(--accent-ink); margin-bottom: 15px;
    }
    .adv-ico svg { width: 25px; height: 25px; }
    .adv-card h3 { font-size: 1.07rem; font-weight: 800; letter-spacing: -.01em; }
    .adv-card p { margin-top: 8px; color: var(--ink-2); font-size: .93rem; line-height: 1.55; }
    .adv-card .adv-tag { display: inline-block; margin-top: 12px; font-size: .76rem; font-weight: 800; color: var(--accent-ink); }
    a.adv-tag { text-decoration: none; }
    a.adv-tag:hover, a.adv-tag:focus-visible { text-decoration: underline; }

    /* ── How it works ── */
    .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
    .step { position: relative; padding-top: 8px; }
    .step .step-n {
      width: 42px; height: 42px; border-radius: 12px; background: var(--accent-strong); color: #fff;
      display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem;
      box-shadow: var(--shadow); margin-bottom: 14px;
    }
    .step h3 { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
    .step p { margin-top: 7px; color: var(--ink-2); font-size: .93rem; line-height: 1.55; }

    /* ── Feature spotlight ── */
    .spot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
    .spot-copy .mk-eyebrow { color: var(--accent-ink); margin-bottom: 12px; }
    .spot-copy h2 { font-size: clamp(1.5rem, 3.8vw, 2.05rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.14; }
    .spot-copy p { margin-top: 13px; color: var(--ink-2); font-size: 1rem; line-height: 1.6; }
    .spot-list { list-style: none; margin: 20px 0 0; display: grid; gap: 13px; }
    .spot-list li { display: flex; gap: 11px; align-items: flex-start; font-size: .95rem; color: var(--ink); font-weight: 600; }
    .spot-list svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent); margin-top: 1px; }
    .spot-mock { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-lg); }
    .spot-mock .mock-cap { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: 2px 4px 12px; display: flex; align-items: center; gap: 6px; }
    .spot-mock .mock-cap .rel-dot { width: 8px; height: 8px; }
    .spot-mock .card { margin-bottom: 0; }

    /* Progress / home-venue spotlight mock */
    .prog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
    .prog-head .pl { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
    .prog-head .pv { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--ink); margin-top: 5px; }
    .trend-up { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 800; color: var(--accent-ink); background: var(--accent-tint); border: 1px solid var(--accent-tint-2); padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
    .trend-up svg { width: 14px; height: 14px; }
    .prog-spark { width: 100%; height: 78px; margin: 14px 0 4px; display: block; }
    .home-rank { display: flex; align-items: center; gap: 11px; margin-top: 13px; border-top: 1px solid var(--line-2); padding-top: 13px; }
    .home-rank .hr-txt { min-width: 0; }
    .home-rank .hr-venue { font-weight: 800; font-size: .92rem; color: var(--ink); }
    .home-rank .hr-move { font-size: .76rem; color: var(--accent-ink); font-weight: 700; display: flex; align-items: center; gap: 4px; margin-top: 2px; }
    .home-rank .hr-move svg { width: 13px; height: 13px; }
    .spot-cta { width: auto !important; margin-top: 24px; }

    /* ── Social proof ── */
    .stat-band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 48px; }
    .stat-band .sb {
      text-align: center; background: var(--surface); border: 1px solid var(--line);
      border-radius: var(--r-lg); padding: 24px 16px; box-shadow: var(--shadow);
    }
    .stat-band .sb .n { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 800; letter-spacing: -.03em; color: var(--accent-ink); line-height: 1; }
    .stat-band .sb .l { margin-top: 9px; font-size: .86rem; color: var(--ink-2); font-weight: 600; }
    .quote-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
    .quote {
      background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
      padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column;
    }
    .quote .stars { color: #d97706; display: flex; gap: 2px; }
    .quote .stars svg { width: 16px; height: 16px; }
    .quote blockquote { margin: 12px 0 0; font-size: .97rem; line-height: 1.6; color: var(--ink); flex: 1; }
    .quote .who { display: flex; align-items: center; gap: 11px; margin-top: 18px; }
    .quote .who .av {
      width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem;
      background: var(--accent-tint); color: var(--accent-ink);
    }
    .quote .who .nm { font-weight: 800; font-size: .9rem; }
    .quote .who .role { font-size: .78rem; color: var(--ink-3); margin-top: 1px; }

    /* ── Get the app (QR placeholders) ── */
    .getapp { background: linear-gradient(160deg, #065f46 0%, #047857 100%); color: #fff; }
    .getapp .sec-head h2 { color: #fff; }
    .getapp .sec-head p { color: rgba(236,253,245,.92); }
    .getapp .sec-head .mk-eyebrow { color: #a7f3d0; }
    .store-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(244px, 1fr)); gap: 20px; max-width: 720px; margin: 0 auto; }
    .store-card {
      background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
      padding: 24px; text-align: center; box-shadow: var(--shadow-lg);
      display: flex; flex-direction: column; align-items: center; gap: 16px;
    }
    .qr-ph {
      position: relative; width: 156px; height: 156px; border-radius: 16px; overflow: hidden;
      border: 1px solid var(--line); background: #fff;
    }
    /* decorative QR-like pattern — swapped for a real generated QR <img> at launch */
    .qr-ph .qr-art {
      position: absolute; inset: 12px;
      background-image:
        linear-gradient(var(--ink) 0 0), linear-gradient(var(--ink) 0 0),
        linear-gradient(var(--ink) 0 0), linear-gradient(var(--ink) 0 0);
      background-repeat: no-repeat;
      background-size: 38px 38px, 38px 38px, 38px 38px, 16px 16px;
      background-position: left top, right top, left bottom, center;
      opacity: .12;
    }
    .qr-ph .qr-art::before {
      content: ""; position: absolute; inset: 0;
      background-image: radial-gradient(var(--ink) 1.4px, transparent 1.6px);
      background-size: 11px 11px; opacity: .5;
    }
    .qr-ph .qr-veil {
      position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
      gap: 7px; background: rgba(255,255,255,.74); backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px);
      color: var(--ink-2); font-weight: 800; font-size: .8rem;
    }
    .qr-ph .qr-veil svg { width: 26px; height: 26px; color: var(--accent-ink); }
    .store-badge {
      display: inline-flex; align-items: center; gap: 11px; background: #0f172a; color: #fff;
      border-radius: 12px; padding: 11px 18px; min-width: 196px; justify-content: center;
    }
    .store-badge svg { width: 26px; height: 26px; flex-shrink: 0; }
    .store-badge .sb-txt { text-align: left; }
    .store-badge .sb-sm { font-size: .62rem; font-weight: 600; opacity: .9; display: block; line-height: 1.1; }
    .store-badge .sb-lg { font-size: 1.02rem; font-weight: 700; line-height: 1.15; }
    /* Inert pre-launch badge — softened so it reads with the "Coming soon" pill, not as an active button. */
    .store-card .store-badge { opacity: .9; }
    .store-soon {
      display: inline-flex; align-items: center; gap: 6px;
      font-size: .73rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
      color: var(--warn); background: var(--warn-bg); padding: 5px 11px; border-radius: 999px;
    }
    .store-soon svg { width: 13px; height: 13px; }
    .getapp-note { text-align: center; color: rgba(236,253,245,.9); font-size: .9rem; margin-top: 28px; font-weight: 600; }

    /* ── Footer ── */
    /* Footer is ALWAYS dark (its text is light) — must not use var(--ink), which
       flips to a light color in dark mode and makes the light text invisible. */
    .mk-footer { background: #0f172a; color: #cbd5e1; }
    .mk-footer .mk-inner { padding-top: 44px; padding-bottom: 44px; }
    .mk-footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
    .mk-footer .brand { color: #fff; }
    .mk-footer .brand .dot { color: #6ee7b7; }
    .mk-footer .f-tag { color: #94a3b8; font-size: .9rem; margin-top: 8px; max-width: 320px; line-height: 1.5; }
    .mk-footer nav { display: flex; gap: 26px; flex-wrap: wrap; }
    .mk-footer nav a { color: #cbd5e1; text-decoration: none; font-size: .9rem; font-weight: 600; }
    .mk-footer nav a:hover { color: #fff; text-decoration: underline; }
    .mk-footer .f-bottom { margin-top: 30px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; color: #94a3b8; }
    .mk-footer .u-muted-link { opacity: 1; }

    /* ── Marketing responsive ── */
    @media (max-width: 900px) {
      .hero-grid { grid-template-columns: 1fr; gap: 36px; padding: 44px 0 52px; }
      .spot-grid { grid-template-columns: 1fr; gap: 32px; }
      .spot-mock { order: -1; }
      .steps { grid-template-columns: 1fr; gap: 26px; }
      .stat-band { grid-template-columns: 1fr; gap: 14px; }
      .mk-section { padding: 56px 0; }
    }

    /* ════════════════════════════════════════════════════════════════
       Player experience: Start-a-match flow + Passport
       ════════════════════════════════════════════════════════════════ */

    /* Center elevated "Start a match" action in the bottom nav */
    .nav-fab {
      flex: 0 0 auto;
      align-self: center;
      width: 56px; height: 56px;
      margin: 0 2px;
      border: none;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
      color: #fff;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 6px 16px -3px rgba(5,150,105,.5), var(--shadow);
      cursor: pointer;
      transform: translateY(-14px);
      transition: transform .12s, box-shadow .15s;
    }
    .nav-fab:hover { box-shadow: 0 8px 20px -3px rgba(5,150,105,.6), var(--shadow); }
    .nav-fab:active { transform: translateY(-14px) scale(.94); }
    .nav-fab.active { background: linear-gradient(135deg, var(--accent-strong) 0%, var(--accent-ink) 100%); }
    .nav-fab svg { width: 27px; height: 27px; }
    .nav-fab .ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 5px var(--surface); pointer-events: none; }

    /* Segmented control (Singles / Doubles) */
    .seg {
      display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
      gap: 4px; padding: 4px; background: var(--line-2);
      border-radius: var(--r-sm); margin-bottom: 4px;
    }
    .seg button {
      border: none; background: none; cursor: pointer; font-family: inherit;
      font-size: .9rem; font-weight: 700; color: var(--ink-3);
      padding: 9px 10px; border-radius: 7px; min-height: 40px;
      display: flex; align-items: center; justify-content: center; gap: 7px;
      transition: background .15s, color .15s, box-shadow .15s;
    }
    .seg button svg { width: 17px; height: 17px; }
    .seg button[aria-pressed="true"] { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow); }

    /* Player picker slots */
    .team-block { margin-bottom: 14px; }
    .team-head {
      display: flex; align-items: center; gap: 8px;
      font-size: .72rem; font-weight: 800; letter-spacing: .07em;
      text-transform: uppercase; color: var(--ink-3); margin-bottom: 9px;
    }
    .team-head .vs-tag { color: var(--accent-ink); }
    .pick {
      position: relative; margin-bottom: 9px;
    }
    .pick-chip {
      display: flex; align-items: center; gap: 11px;
      padding: 11px 12px; border: 1.5px solid var(--accent-tint-2);
      background: var(--accent-tint); border-radius: var(--r-sm);
    }
    .pick-chip.me { border-color: var(--accent); }
    .pick-avatar {
      width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
      background: linear-gradient(135deg, var(--accent) 0%, var(--accent-ink) 100%);
      color: #fff; display: flex; align-items: center; justify-content: center;
      font-weight: 800; font-size: .9rem;
    }
    .pick-chip .pc-name { font-weight: 700; font-size: .95rem; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .pick-chip .pc-sub { font-size: .76rem; color: var(--ink-3); font-weight: 600; }
    .pick-clear {
      border: none; background: none; cursor: pointer; color: var(--ink-3);
      padding: 6px; border-radius: 6px; display: flex; flex-shrink: 0;
    }
    .pick-clear:hover { color: var(--danger); background: var(--danger-bg); }
    .pick-clear svg { width: 17px; height: 17px; }
    .pick-search input { padding-right: 38px; }
    .pick-search .si {
      position: absolute; right: 12px; top: 13px; width: 18px; height: 18px;
      color: var(--ink-3); pointer-events: none;
    }
    .pick-results {
      position: absolute; left: 0; right: 0; top: calc(100% + 4px);
      background: var(--surface); border: 1px solid var(--line);
      border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
      z-index: 20; overflow: hidden; max-height: 260px; overflow-y: auto;
    }
    .pick-results button {
      display: flex; align-items: center; gap: 10px; width: 100%;
      border: none; background: none; cursor: pointer; text-align: left;
      padding: 10px 12px; font-family: inherit; border-bottom: 1px solid var(--line-2);
    }
    .pick-results button:last-child { border-bottom: none; }
    .pick-results button:hover, .pick-results button.kbd-active { background: var(--accent-tint); }
    .pick-results .pr-name { font-weight: 700; font-size: .9rem; color: var(--ink); }
    .pick-results .pr-sub { font-size: .76rem; color: var(--ink-3); }
    .pick-results .pr-empty { padding: 12px; font-size: .85rem; color: var(--ink-3); text-align: center; }

    /* Score stepper */
    .score-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 4px; }
    .score-col { text-align: center; }
    .score-col .sc-lbl {
      font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
      color: var(--ink-3); margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .score-col.win .sc-lbl { color: var(--accent-ink); }
    .stepper { display: flex; align-items: center; justify-content: center; gap: 8px; }
    .step-btn {
      width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
      border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
      color: var(--ink-2); display: flex; align-items: center; justify-content: center;
      transition: border-color .12s, color .12s, background .12s;
    }
    .step-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-ink); }
    .step-btn:disabled { opacity: .4; cursor: not-allowed; }
    .step-btn svg { width: 18px; height: 18px; }
    .score-val {
      width: 56px; text-align: center; font-size: 1.9rem; font-weight: 800;
      letter-spacing: -.02em; color: var(--ink); -webkit-appearance: none; appearance: none;
      border: none; background: none; padding: 0; -moz-appearance: textfield;
    }
    .score-val::-webkit-outer-spin-button, .score-val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    .score-val:focus:not(:focus-visible) { outline: none; }
    .score-sep { font-size: 1.4rem; font-weight: 800; color: var(--ink-3); }

    .record-hint { font-size: .82rem; color: var(--ink-3); margin-top: 10px; display: flex; gap: 7px; align-items: flex-start; }
    .record-hint svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; color: var(--accent); }

    /* ── Passport ── */
    .passport-hero { position: relative; overflow: hidden; }
    .passport-hero .ph-mark {
      position: absolute; right: -22px; top: -22px; width: 150px; height: 150px;
      color: rgba(255,255,255,.10); pointer-events: none;
    }
    .passport-hero .ph-mark svg { width: 100%; height: 100%; }
    .ph-eyebrow {
      font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
      color: var(--mint-200, #a7f3d0); margin-bottom: 6px; display: flex; align-items: center; gap: 7px;
    }
    .ph-eyebrow svg { width: 15px; height: 15px; }
    .pstat .v.rank-mini { display: inline-flex; align-items: baseline; gap: 3px; }
    .pstat .v small { font-size: .8rem; font-weight: 700; opacity: .8; }

    .panel-title {
      display: flex; align-items: center; gap: 9px; font-size: 1.02rem;
      font-weight: 800; letter-spacing: -.01em; margin-bottom: 3px;
    }
    .panel-title svg { width: 19px; height: 19px; color: var(--accent); flex-shrink: 0; }
    .panel-sub { font-size: .82rem; color: var(--ink-3); margin-bottom: 14px; }

    .chart-wrap { width: 100%; }
    .chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
    .chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: .78rem; color: var(--ink-2); font-weight: 600; }
    .chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
    .lg-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

    /* Win/loss donut + summary */
    .wl-grid { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
    .wl-donut { width: 116px; height: 116px; flex-shrink: 0; }
    .wl-legend { display: flex; flex-direction: column; gap: 12px; }
    .wl-row { display: flex; align-items: center; gap: 10px; }
    .wl-key { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; }
    .wl-val { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
    .wl-sub { font-size: .78rem; color: var(--ink-3); font-weight: 600; }

    /* Form pills (recent results) */
    .form-pills { display: flex; gap: 6px; flex-wrap: wrap; }
    .fp {
      width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      font-weight: 800; font-size: .82rem; color: #fff;
    }
    .fp.w { background: var(--accent-strong); }
    .fp.l { background: var(--danger); }
    .fp.empty { background: var(--line); color: var(--ink-3); }

    /* Home vs Away */
    .ha-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .ha-card {
      border: 1px solid var(--line); border-radius: var(--r); padding: 14px;
      background: var(--surface);
    }
    .ha-card.home { background: var(--accent-tint); border-color: var(--accent-tint-2); }
    .ha-head { display: flex; align-items: center; gap: 7px; font-size: .76rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
    .ha-card.home .ha-head { color: var(--accent-ink); }
    .ha-head svg { width: 15px; height: 15px; }
    .ha-big { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
    .ha-rec { font-size: .82rem; color: var(--ink-2); font-weight: 600; margin-top: 2px; }
    .ha-bar { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 10px; }
    .ha-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

    /* Home venue card */
    .hv-card {
      display: flex; align-items: center; gap: 13px;
      padding: 4px 2px;
    }
    .hv-emblem {
      width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
      background: var(--accent-tint); color: var(--accent-ink);
      display: flex; align-items: center; justify-content: center;
    }
    .hv-emblem svg { width: 24px; height: 24px; }
    .hv-name { font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em; }
    .hv-meta { font-size: .82rem; color: var(--ink-3); margin-top: 2px; }
    .hv-link { margin-left: auto; flex-shrink: 0; color: var(--ink-3); display: flex; }
    .hv-link svg { width: 20px; height: 20px; }

    /* Match history rows */
    .mh-row {
      display: flex; align-items: center; gap: 12px; padding: 13px 2px;
      border-bottom: 1px solid var(--line-2);
    }
    .mh-row:last-child { border-bottom: none; }
    .mh-outcome {
      width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      font-weight: 800; font-size: .9rem; color: #fff;
    }
    .mh-outcome.w { background: var(--accent); }
    .mh-outcome.l { background: var(--danger); }
    .mh-main { min-width: 0; flex: 1; }
    .mh-opp { font-weight: 700; font-size: .93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mh-meta { font-size: .76rem; color: var(--ink-3); margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    .mh-ctx {
      font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
      padding: 2px 6px; border-radius: 5px; background: var(--line-2); color: var(--ink-3);
    }
    .mh-ctx.home { background: var(--accent-tint); color: var(--accent-ink); }
    .mh-ctx.away { background: var(--info-bg); color: var(--info); }
    .mh-score { flex-shrink: 0; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.02rem; letter-spacing: -.01em; }
    .mh-score .ls { color: var(--ink-3); }

    .toast {
      position: fixed; left: 50%; bottom: calc(var(--nav-h) + 22px);
      transform: translateX(-50%) translateY(8px);
      /* Theme-independent dark pill: --ink flips to a LIGHT colour in dark mode, which made the
         white toast text invisible (white-on-white). Use a fixed dark slate so #fff text always
         reads, with a faint border so it still separates from a dark page background. */
      background: #1f2937; color: #fff; border: 1px solid rgba(255,255,255,.10);
      padding: 12px 18px; border-radius: 999px;
      font-size: .9rem; font-weight: 700; box-shadow: var(--shadow-lg);
      display: flex; align-items: center; gap: 9px; z-index: 60;
      opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 90vw;
    }
    .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
    .toast svg { width: 18px; height: 18px; color: var(--mint-300, #6ee7b7); flex-shrink: 0; }

    @media (prefers-color-scheme: dark) {
      :root {
        --accent:        #10b981;
        --accent-strong: #059669;
        --accent-ink:    #6ee7b7;
        --accent-tint:   #064e3b;
        --accent-tint-2: #065f46;

        --ink:      #f1f5f9;
        --ink-2:    #cbd5e1;
        --ink-3:    #94a3b8;
        --line:     #334155;
        --line-2:   #1e293b;
        --surface:  #1e293b;
        --surface-2: #0b1220;   /* dark inset (segmented rows): darker than surface so the active tab + light text pop */
        --bg:       #0f172a;

        --danger:   #f87171;
        --danger-bg:#450a0a;
        --warn:     #fbbf24;
        --warn-bg:  #451a03;
        --info:     #60a5fa;
        --info-bg:  #172554;

        --shadow:    0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.4);
        --shadow-md: 0 4px 12px -2px rgba(0,0,0,.5), 0 2px 6px -2px rgba(0,0,0,.35);
        --shadow-lg: 0 12px 32px -8px rgba(0,0,0,.6);
        --ring: 0 0 0 3px rgba(16,185,129,.40);
      }
      /* --accent-ink is light green in dark mode — not suitable as a button bg */
      .btn-primary:hover:not(:disabled) { background: #047857; }
      .app-header { background: rgba(15,23,42,.88); }
      .bottom-nav { background: rgba(15,23,42,.92); }
    }

    /* ── Inline-style utilities — replace all HTML/JS-injected style="" attrs ── */
    .u-inherit-link { color: inherit; text-decoration: none; display: block; }
    .u-av-1 { background: #a7f3d0; }
    .u-av-2 { background: #6ee7b7; }
    .u-av-3 { background: #fbcfe8; }
    .u-av-count { background: #fde68a; font-size: .66rem; letter-spacing: -.02em; }
    .u-rel-dot-accent { background: var(--accent); }
    .u-shadow-none { box-shadow: none; }
    .u-card-flat { box-shadow: none; margin-bottom: 0; }
    .u-sugg-row { display: flex; gap: 11px; align-items: center; min-width: 0; }
    .u-min-w-0 { min-width: 0; }
    .u-score-right { text-align: right; flex-shrink: 0; }
    .u-accent-ink { color: var(--accent-ink); }
    .u-meta-txt { font-size: .7rem; color: var(--ink-3); font-weight: 600; }
    .u-bar-92 { width: 92%; }
    .u-bar-96 { width: 96%; }
    .u-bar-80 { width: 80%; }
    .u-link-mint { color: #a7f3d0; font-weight: 700; }
    .u-muted-link { color: inherit; opacity: .7; }
    .u-f-note { margin-top: 2px; font-size: .72rem; color: #8fa3b5; }
    .u-osm-link { color: inherit; }
    .u-f-legal { margin-top: 4px; font-size: .70rem; color: #7a95a8; }
    .u-btn-auto { width: auto; }
    .u-fg-gap { margin: 18px 0 0; }
    .u-lbl-reset { margin: 0; }
    .u-flex-8 { display: flex; gap: 8px; }
    .u-flex-1 { flex: 1; }
    .u-flex-1-min0 { flex: 1; min-width: 0; }
    .u-nowrap { white-space: nowrap; }
    .u-flex-wrap-row { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
    .u-mt-6 { margin-top: 6px; }
    .u-mt-8 { margin-top: 8px; }
    .u-mt-12 { margin-top: 12px; }
    .u-mt-18 { margin-top: 18px; }
    .u-mb-4 { margin-bottom: 4px; }
    .u-mb-9 { margin-bottom: 9px; }
    .u-mb-10 { margin-bottom: 10px; }
    .u-mb-12 { margin-bottom: 12px; }
    .u-mb-16 { margin-bottom: 16px; }
    .u-mb-18 { margin-bottom: 18px; }
    .u-btn-w100 { width: 100%; text-decoration: none; margin-top: 4px; }
    .u-btn-w100-mt { width: 100%; margin-top: 8px; }
    .u-flex-jsb { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
    .u-flex-end-wrap { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
    .u-flex-home-form { display: flex; gap: 8px; }
    .u-flex-home-btns { display: flex; gap: 8px; margin-top: 8px; }
    .u-loading-wrap { display: flex; justify-content: center; padding: 32px; }
    .u-loading-wrap-sm { display: flex; justify-content: center; padding: 24px; }
    .u-empty-msg { padding: 24px 8px; text-align: center; color: var(--ink-3); font-size: .85rem; }
    .u-err-text { color: var(--danger); font-size: .85rem; }
    .u-hint-text { font-size: .85rem; color: var(--ink-3); text-align: center; padding: 8px 0; }
    .u-dist-no-loc { color: var(--ink-3); }
    .u-match-section { min-width: 0; flex: 1; }
    .u-no-home-msg { font-size: .85rem; color: var(--ink-2); margin-bottom: 12px; }
    .u-no-home-btn { width: 100%; }
    .u-match-city-form { display: flex; gap: 8px; }
    .u-match-city-input { flex: 1; }
    .u-match-city-btn { white-space: nowrap; }
    .u-wl-total { color: var(--ink-3); }
    .u-ha-progress { min-width: 0; flex: 1; }
    .u-skel-55 { width: 55%; height: 16px; }
    .u-skel-35 { width: 35%; }
    .u-skel-80 { width: 80%; margin-bottom: 0; }
    .u-home-form-loc { font-size: .84rem; font-weight: 700; margin-bottom: 10px; }
    .u-no-loc-err { color: var(--danger); }
    .u-inline-row-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .u-league-standings-wrap { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
    .u-rel-dot-warn { background: var(--warn); }
    .u-rel-dot-ink3 { background: var(--ink-3); }
    .u-lg-dot-danger { background: var(--danger); }
    .u-score-good { color: var(--accent-ink); }
    .u-score-ok { color: var(--warn); }
    .u-score-poor { color: var(--danger); }
    .u-bar-good { background: var(--accent); }
    .u-bar-ok { background: var(--warn); }
    .u-bar-poor { background: var(--danger); }
    .u-danger-text { color: var(--danger); }
    .u-mt-14 { margin-top: 14px; }
    .rating-pending { margin-top: 12px; padding: 8px 12px; border-radius: 8px; background: rgba(255,255,255,.12); font-size: 13px; display: flex; align-items: center; gap: 6px; }

    /* Email verification notice */
    .email-verify-banner { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; background: color-mix(in srgb, #3b82f6 14%, var(--surface)); border-bottom: 1px solid color-mix(in srgb, #3b82f6 32%, var(--surface)); font-size: .84rem; color: var(--ink); }
    .email-verify-banner svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: color-mix(in srgb, #3b82f6 60%, var(--ink)); }
    .email-verify-banner a { color: color-mix(in srgb, #3b82f6 55%, var(--ink)); font-weight: 600; text-decoration: underline; }

    /* Growth banner — Constitution rule 11 */
    .growth-banner { text-align: center; padding: 6px 16px; background: #f0fdf4; border-top: 1px solid #bbf7d0; font-size: .75rem; color: #166534; }
    .growth-banner a { color: #166534; text-decoration: none; font-weight: 500; }

/* ── Competition tabs (tournaments & ladders) ───────────────────────── */
.seg-row {
  display: flex;
  gap: 6px;
  background: var(--surface-2, #f1f5f9);
  border-radius: 12px;
  padding: 4px;
  margin: 0 0 16px;
}
.seg-btn {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 9px 10px;
  border-radius: 9px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg-btn.active {
  background: var(--surface, #fff);
  color: var(--ink);   /* was var(--ink-1) which is undefined → fell back to dark text on the dark active tab */
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.comp-pane { display: block; }
.badge-amber { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }

.mini-hdr {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3, #64748b);
  margin: 12px 0 6px;
  font-weight: 700;
}
.mini-empty { font-size: .85rem; color: var(--ink-3, #64748b); padding: 4px 0; }

.seed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.seed-list li { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.seed-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--info-bg, #e0f2fe);
  color: var(--info, #0369a1);
  font-weight: 700;
  font-size: .78rem;
}

.bracket-list { display: grid; gap: 4px; }
.br-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--surface-2, #f8fafc);
}
.br-tag {
  text-transform: uppercase;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--warn-bg, #fef3c7);
  color: var(--warn, #b45309);
}
.br-rnd { color: var(--ink-3, #64748b); font-variant-numeric: tabular-nums; min-width: 38px; }
.br-vs { flex: 1; }
.br-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.br-bye { color: var(--ink-3, #64748b); font-style: italic; }

.btn-xs { padding: 3px 9px; font-size: .78rem; border-radius: 7px; }
.br-rec { flex-shrink: 0; }

/* ── Tournament rules (shown before entering) + organiser score entry ─── */
.t-rules-peek {
  margin-top: 5px; font-size: .8rem; color: var(--ink-2, #475569);
  line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.t-rules-box {
  margin: 4px 0 12px; padding: 11px 13px; border-radius: 10px;
  background: var(--info-bg, #eff6ff); border: 1px solid var(--line, #e2e8f0);
}
.t-rules-body { margin: 4px 0 0; font-size: .86rem; line-height: 1.5; color: var(--ink, #0f172a); }
.score-form {
  margin: 2px 0 8px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface, #fff); border: 1px solid var(--line, #e2e8f0);
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
}
.score-inputs { display: flex; align-items: flex-end; gap: 8px; }
.score-inputs label {
  display: flex; flex-direction: column; gap: 3px; font-size: .72rem;
  font-weight: 600; color: var(--ink-2, #475569); max-width: 110px;
}
.score-inputs input { width: 64px; text-align: center; font-weight: 700; }
.score-dash { font-weight: 700; padding-bottom: 8px; color: var(--ink-3, #64748b); }

/* ── Find-a-game copilot ─────────────────────────────────────────────── */
.copilot-panel { border: 1px solid var(--accent); }
.copilot-head { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.copilot-title { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.copilot-badge {
  font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent-ink); background: var(--accent-tint);
  border: 1px solid var(--accent); border-radius: 999px; padding: 3px 9px;
}
.copilot-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  font-size: .8rem; font-weight: 600; color: var(--ink-2, var(--ink-3));
  background: transparent; border: 1px solid var(--line, var(--ink-3));
  border-radius: 999px; padding: 6px 12px; cursor: pointer; transition: all .15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.copilot-reply {
  display: flex; gap: 9px; align-items: flex-start; margin: 14px 0 8px;
  font-size: .95rem; font-weight: 600; line-height: 1.45; color: var(--ink-1, var(--ink-2));
}
.copilot-reply svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent-ink); margin-top: 1px; }

/* ════════════════════════════════════════════════════════════════════════
   REHAUL — Home · Find>Players · Play sub-tabs · Leaderboard ·
   Notifications · Player profile · Share cards · Profile setup
   ════════════════════════════════════════════════════════════════════════ */

/* pane/hidden correctness: class selectors must not beat the [hidden] attr */
.comp-pane[hidden] { display: none; }
.record-fab[hidden] { display: none; }

/* ── Header right cluster + notification bell ── */
.app-header-right { display: flex; align-items: center; gap: 10px; }
.bell-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.bell-btn:hover { color: var(--accent-ink); border-color: var(--accent); }
.bell-btn svg { width: 21px; height: 21px; }
.bell-badge {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px;
  /* Fixed saturated red (not var(--danger), which lightens to #f87171 in dark mode and
     leaves the white count nearly unreadable). #dc2626 keeps ≥4.5:1 with #fff in both themes. */
  border-radius: 999px; background: #dc2626; color: #fff; font-size: .68rem;
  font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 8px; color: var(--ink-3); cursor: pointer; display: inline-flex; }
.icon-btn:hover { background: var(--surface-2, #f1f5f9); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

/* ── Notifications drawer ── */
.notif-scrim { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 39; }
/* honor the [hidden] attribute — the display rule below otherwise overrides it so the drawer
   can never close (it was stuck open). */
.notif-drawer[hidden], .notif-scrim[hidden] { display: none !important; }
.notif-drawer {
  position: fixed; top: 56px; right: 12px; width: min(360px, calc(100vw - 24px)); max-height: 70vh;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg, 16px);
  box-shadow: var(--shadow-md, 0 18px 40px -12px rgba(15,23,42,.35)); z-index: 40; overflow: hidden;
  display: flex; flex-direction: column; animation: fade .18s ease;
}
.notif-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif-drawer-actions { display: flex; align-items: center; gap: 8px; }
.notif-list { overflow-y: auto; padding: 6px; }
.notif-item { display: flex; gap: 11px; padding: 12px; border-radius: 12px; align-items: flex-start; }
.notif-item.unread { background: var(--accent-tint, #ecfdf5); cursor: pointer; }
.notif-ico { flex-shrink: 0; color: var(--accent-ink); display: inline-flex; }
.notif-ico svg { width: 20px; height: 20px; }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.notif-title { font-weight: 700; font-size: .9rem; color: var(--ink); }
.notif-text { font-size: .82rem; color: var(--ink-2); line-height: 1.4; }
.notif-time { font-size: .72rem; color: var(--ink-3); margin-top: 2px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 6px; }

/* ── Floating record FAB ── */
.record-fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
  display: inline-flex; align-items: center; justify-content: center; gap: 0;
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer; z-index: 29;
  background: linear-gradient(135deg, var(--btn-fill) 0%, var(--btn-fill-strong) 100%); color: #fff;
  box-shadow: 0 8px 20px -4px rgba(5,150,105,.55), var(--shadow);
  transition: transform .12s, box-shadow .15s;
}
.record-fab:hover { box-shadow: 0 10px 26px -4px rgba(5,150,105,.65), var(--shadow); transform: translateY(-2px); }
.record-fab:active { transform: scale(.94); }
.record-fab svg { width: 27px; height: 27px; }
.record-fab .ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 4px var(--bg, #f8fafc); pointer-events: none; }
.record-fab-label {
  position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
  font-size: .64rem; font-weight: 800; color: var(--accent-ink); white-space: nowrap;
}

/* ── Home dashboard ── */
.home-hero {
  background: linear-gradient(135deg, var(--accent-ink, #047857) 0%, var(--accent-strong, #059669) 100%);
  color: #fff; border-radius: var(--r-lg, 16px); padding: 22px 20px; margin-bottom: 18px; position: relative; overflow: hidden;
}
.hh-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 700; opacity: .92; text-transform: uppercase; letter-spacing: .04em; }
.hh-eyebrow svg { width: 16px; height: 16px; }
.hh-name { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; }
.hh-sub { font-size: .9rem; opacity: .9; margin-bottom: 16px; }
.hh-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hh-stat { background: rgba(255,255,255,.14); border-radius: 12px; padding: 10px 6px; text-align: center; }
.hh-stat .v { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.hh-stat .v small { font-size: .7rem; font-weight: 700; }
.hh-stat .l { font-size: .64rem; opacity: .88; margin-top: 2px; font-weight: 600; }

.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
.quick-action {
  display: flex; align-items: center; gap: 11px; text-align: left; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.quick-action:hover { border-color: var(--accent); box-shadow: var(--shadow-md, 0 8px 20px -8px rgba(15,23,42,.2)); }
.quick-action:active { transform: scale(.98); }
.qa-ico { flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-tint, #ecfdf5); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; }
.qa-ico svg { width: 20px; height: 20px; }
.qa-txt { display: flex; flex-direction: column; min-width: 0; }
.qa-title { font-weight: 700; font-size: .9rem; color: var(--ink); }
.qa-sub { font-size: .74rem; color: var(--ink-3); }
.home-venue-card .hv-link { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 4px 0 0; cursor: pointer; text-align: left; }
.home-venue-card .hv-link > div { flex: 1; min-width: 0; }
.home-venue-card .hv-link svg { width: 20px; height: 20px; color: var(--ink-3); flex-shrink: 0; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.badge-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: var(--accent-tint, #ecfdf5); color: var(--accent-ink); font-size: .78rem; font-weight: 700; }
.badge-chip svg { width: 16px; height: 16px; }

/* ── Filter row & segmented scroll ── */
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg-row.seg-scroll { overflow-x: auto; scrollbar-width: none; }
.seg-row.seg-scroll::-webkit-scrollbar { display: none; }
.seg-row.seg-scroll .seg-btn { flex: 0 0 auto; min-width: max-content; padding-left: 14px; padding-right: 14px; }

/* ── Nearby players ── */
.np-avatar {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%); color: #fff; font-weight: 800; font-size: .9rem;
}
.np-avatar.sm { width: 34px; height: 34px; font-size: .78rem; }
.np-avatar.lg { width: 54px; height: 54px; font-size: 1.1rem; }
.np-card .np-main { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; padding: 0 0 12px; cursor: pointer; text-align: left; }
.np-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.np-main svg { width: 20px; height: 20px; color: var(--ink-3); flex-shrink: 0; }

/* ── Player profile + share modals ── */
body.modal-open { overflow: hidden; }
.pp-scrim { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 49; animation: fade .15s ease; }
.pp-modal {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(480px, 100%); max-height: 88vh; overflow-y: auto; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px 20px 0 0;
  padding: 20px 18px calc(24px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow-md, 0 -10px 40px -12px rgba(15,23,42,.35));
  animation: sheetUp .22s ease;
}
@media (min-width: 560px) { .pp-modal { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 20px; } }
@keyframes sheetUp { from { transform: translate(-50%, 30px); opacity: .6; } to { transform: translateX(-50%); opacity: 1; } }
.pp-head { display: flex; align-items: center; gap: 12px; }
.pp-id { flex: 1; min-width: 0; }
.pp-record { display: flex; gap: 14px; align-items: center; margin-top: 12px; font-size: .84rem; font-weight: 700; }
.pp-rec-w { color: var(--accent-ink); }
.pp-rec-l { color: var(--ink-3); }
.pp-rec-v { color: var(--ink-3); font-weight: 600; margin-left: auto; }
.pp-actions { display: flex; gap: 10px; margin-top: 16px; }
.pp-actions .btn { flex: 1; }
.pp-msg:not(:empty) { margin-top: 12px; }

/* ── Leaderboard ── */
.lb-scope-banner { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; color: var(--accent-ink); margin-bottom: 14px; }
.lb-scope-banner svg { width: 18px; height: 18px; }
.lb-you-callout { display: flex; align-items: center; gap: 8px; background: var(--accent-tint, #ecfdf5); color: var(--accent-ink); border-radius: 12px; padding: 10px 14px; font-size: .86rem; font-weight: 600; margin-bottom: 14px; }
.lb-you-callout svg { width: 17px; height: 17px; }
.lb-podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: end; margin-bottom: 18px; }
.podium-col {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px 8px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 14px 14px 0 0; background: var(--surface); position: relative;
}
.podium-col.p1 { padding-top: 18px; border-color: #f59e0b; background: linear-gradient(180deg, #fffbeb, var(--surface)); }
.podium-col.p2 { background: linear-gradient(180deg, #f8fafc, var(--surface)); }
.podium-col.p3 { background: linear-gradient(180deg, #fff7ed, var(--surface)); }
.podium-col.me { outline: 2px solid var(--accent); outline-offset: -2px; }
.podium-medal { position: absolute; top: -10px; }
.podium-medal svg, .podium-medal .medal { width: 26px; height: 26px; }
.podium-col.p1 .podium-medal { color: #f59e0b; }
.podium-col.p2 .podium-medal { color: #94a3b8; }
.podium-col.p3 .podium-medal { color: #d97706; }
.podium-name { font-size: .78rem; font-weight: 700; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-rating { font-size: .92rem; font-weight: 800; color: var(--accent-ink); letter-spacing: -.02em; }
.podium-base { font-size: 1.4rem; font-weight: 800; color: var(--ink-3); opacity: .5; }
.lb-row.me { background: var(--accent-tint, #ecfdf5); border-radius: 12px; }
.lb-rank { flex-shrink: 0; width: 34px; display: flex; align-items: center; justify-content: center; }
.lb-rank .rank-chip { width: 30px; height: 30px; }
.rank-num { font-weight: 800; color: var(--ink-3); font-size: .95rem; }
.lb-player { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.lb-pmeta { display: flex; flex-direction: column; min-width: 0; }
.lb-pname { font-weight: 700; font-size: .9rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-you-tag { font-size: .64rem; background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 999px; font-weight: 800; vertical-align: middle; }
.lb-psub { font-size: .76rem; color: var(--ink-3); }
.lb-row .lb-score { font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.lb-method { font-size: .76rem; color: var(--ink-3); text-align: center; margin-top: 14px; }

/* ── Profile setup, achievements, share ── */
.passport-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.setup-panel summary { cursor: pointer; list-style: none; }
.setup-panel summary::-webkit-details-marker { display: none; }
.setup-panel summary::after { content: '▾'; float: right; color: var(--ink-3); transition: transform .2s; }
.setup-panel[open] summary::after { transform: rotate(180deg); }
.setup-sub { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: 6px 0 8px; }
.switch-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: .86rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ach-card { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2, #f8fafc); }
.ach-ico { color: #f59e0b; display: inline-flex; }
.ach-ico svg, .ach-ico .medal { width: 24px; height: 24px; }
.ach-title { font-weight: 700; font-size: .82rem; color: var(--ink); }
.ach-desc { font-size: .72rem; color: var(--ink-3); line-height: 1.35; }
.share-card-art {
  border-radius: 16px; padding: 26px 20px; text-align: center; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent-ink, #047857) 0%, var(--accent-strong, #059669) 100%);
}
.sca-mark { position: absolute; right: -10px; bottom: -10px; opacity: .18; }
.sca-mark svg { width: 96px; height: 96px; }
.sca-title { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.sca-sub { font-size: .9rem; opacity: .92; margin-top: 4px; }
.sca-brand { font-size: .72rem; opacity: .82; margin-top: 14px; font-weight: 600; }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); resize: vertical; }
textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

/* ════ Groups, live banner, chat, share sheet (frontend for groups/events) ════
   NOTE: this block was originally ported from a dark-only design and referenced ~10
   CSS vars this app never defines (--border/--text/--text2/--muted/--bg2/--card), so it
   silently used hardcoded DARK fallbacks in BOTH themes — broken/unreadable in light mode.
   Rewritten against the real token set (--surface/--surface-2/--ink/--ink-2/--ink-3/--line). */
.muted{color:var(--ink-3)}
.inp{width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:10px;
  background:var(--surface);color:var(--ink);font:inherit;font-size:14px}
.inp:focus{outline:2px solid var(--accent);outline-offset:1px;border-color:var(--accent)}
.btn-sm{padding:6px 11px;font-size:13px}
.g-form{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.g-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.g-row .inp{flex:1;min-width:120px}
.g-card{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px 0;border-top:1px solid var(--line)}
.g-card:first-child{border-top:0}
.g-name{font-weight:700}
.g-h{margin:16px 0 6px;font-size:13px;text-transform:uppercase;letter-spacing:.06em;color:var(--ink-3)}
.g-sess{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 0;border-top:1px solid var(--line)}
.chip{appearance:none;border:1px solid var(--line);background:transparent;color:var(--ink-2);
  border-radius:999px;padding:5px 12px;font:600 13px/1 inherit;cursor:pointer}
.chip-on{background:linear-gradient(135deg,#6c5cf0,#1bc5e0);color:#fff;border-color:transparent}
.g-chat{max-height:240px;overflow-y:auto;border:1px solid var(--line);border-radius:12px;padding:10px;background:var(--surface-2);margin-bottom:8px}
.g-msg{padding:5px 0}
.g-msg>div{font-size:14px}
.g-invite{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-top:10px}
.g-qr{width:120px;height:120px;background:#fff;border-radius:10px;padding:6px}
.g-table{width:100%;border-collapse:collapse;font-size:14px}
.g-table th,.g-table td{text-align:left;padding:6px 8px;border-bottom:1px solid var(--line)}
.g-table th{color:var(--ink-3);font-size:12px;text-transform:uppercase;letter-spacing:.04em}
.badge-live{background:color-mix(in srgb,var(--danger) 16%,transparent);color:var(--danger)}
.badge-up{background:var(--accent-tint);color:var(--accent-ink)}
/* live banner — sticky, glanceable, red=live */
.live-banner{position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:12px;
  padding:10px 16px;background:var(--accent-tint);
  border-bottom:1px solid var(--line);backdrop-filter:blur(8px)}
.live-banner .lb-dot{width:10px;height:10px;border-radius:50%;background:#ef4444;flex:none;
  box-shadow:0 0 0 4px rgba(239,68,68,.22);animation:lbpulse 1.6s infinite}
@keyframes lbpulse{0%,100%{opacity:1}50%{opacity:.4}}
@media(prefers-reduced-motion:reduce){.live-banner .lb-dot{animation:none}}
.lb-body{flex:1;min-width:0}
.lb-head{font-weight:800;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ink)}
.lb-sub{font-size:12.5px;color:var(--ink-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* share sheet */
.share-sheet{position:fixed;inset:0;z-index:60;display:flex;align-items:flex-end;justify-content:center;
  background:rgba(0,0,0,.5)}
.share-card{width:100%;max-width:460px;background:var(--surface);border:1px solid var(--line);
  border-radius:18px 18px 0 0;padding:18px;margin:0 8px}
.share-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:8px}

/* Frontend QA fixes (screenshot review): card button overlap + chat readability */
.g-card>div:first-child{flex:1 1 auto;min-width:0}
.g-card .btn,.g-card button,.g-card>span{flex:0 0 auto;white-space:nowrap}
.g-name{white-space:normal;word-break:break-word}
.g-chat .muted{color:var(--ink-3)}
.g-msg,.g-msg>div{color:var(--ink)}
.g-msg b{color:var(--ink)}
/* btn-primary is width:100% globally — must be auto inside the row cards or it squashes the name */
.g-card .btn{width:auto}
.g-sess .btn{width:auto}
.terms-check{display:flex;gap:9px;align-items:flex-start;margin:4px 0 12px;font-size:.82rem;line-height:1.45;color:var(--ink-3)}
.terms-check input{margin-top:3px;flex:0 0 auto;width:16px;height:16px}
.terms-check a{color:var(--accent);font-weight:600}
.board-card{margin-top:12px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}
.board-card .lb-row{padding:9px 0}
.lb-name{flex:1 1 auto;min-width:0}
.lb-stat{flex:0 0 auto;text-align:right;white-space:nowrap}
