    /* ═══ Theme variables ═══ */
    :root {
      --font: 'Inter', -apple-system, sans-serif;
      --mono: 'JetBrains Mono', monospace;
      --radius: 12px;
      --transition: 0.2s ease;
    }
    [data-theme="dark"] {
      --bg: #0a0b10; --bg2: #12131a; --surface: #1a1c26; --surface2: #222430;
      --border: #2a2d3a; --text: #e8eaf0; --text2: #9ca3af; --text3: #6b7280;
      --accent: #6366f1; --accent2: #818cf8; --green: #22c55e; --red: #ef4444;
      --yellow: #eab308; --shadow: rgba(0,0,0,0.3);
    }
    [data-theme="light"] {
      --bg: #f5f6fa; --bg2: #eef0f5; --surface: #ffffff; --surface2: #f0f1f5;
      --border: #e2e4ea; --text: #111827; --text2: #4b5563; --text3: #9ca3af;
      --accent: #4f46e5; --accent2: #6366f1; --green: #16a34a; --red: #dc2626;
      --yellow: #ca8a04; --shadow: rgba(0,0,0,0.08);
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }
    body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; font-variant-numeric: tabular-nums; transition: background var(--transition), color var(--transition); }

    /* ═══ Header (sticky, persistent nav) ═══ */
    .header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 12px 32px; border-bottom: 1px solid var(--border);
      background: color-mix(in srgb, var(--surface) 85%, transparent);
      position: sticky; top: 0; z-index: 50;
      backdrop-filter: saturate(160%) blur(12px);
      -webkit-backdrop-filter: saturate(160%) blur(12px);
    }
    .header-left { display: flex; align-items: center; gap: 24px; }
    .header .logo-link { display: flex; align-items: center; text-decoration: none; }
    /* Sibling page links: [Logo] Models | Agents — full opacity on the active page, 60% otherwise */
    .header .nav-link {
      color: var(--text); opacity: 0.6; text-decoration: none;
      padding: 6px 4px; font-weight: 500; font-size: 14px;
      transition: opacity 0.15s, color 0.15s;
      border-bottom: 2px solid transparent;
    }
    .header .nav-link:hover { opacity: 1; }
    .header .nav-link.active { opacity: 1; border-bottom-color: var(--accent); color: var(--text); font-weight: 600; }
    .logo { font-size: 18px; font-weight: 700; letter-spacing: -0.5px; }
    .logo-img { height: 28px; }
    .logo-light { display: none; }
    [data-theme="dark"] .logo-dark { display: none; }
    [data-theme="dark"] .logo-light { display: inline; }
    [data-theme="light"] .logo-dark { display: inline; }
    [data-theme="light"] .logo-light { display: none; }
    .logo span { color: var(--accent); }
    .header-right { display: flex; align-items: center; gap: 16px; }
    .theme-toggle { background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; padding: 6px 12px; cursor: pointer; font-size: 13px; color: var(--text2); transition: all var(--transition); }
    .theme-toggle:hover { border-color: var(--accent); color: var(--text); }
    .stat-badge { background: var(--surface2); border-radius: 8px; padding: 6px 12px; font-size: 12px; color: var(--text2); }
    .stat-badge strong { color: var(--text); font-weight: 600; }

    /* ═══ Tab navigation ═══ */
    .nav-tabs { display: flex; background: var(--bg2); border-bottom: 1px solid var(--border); padding: 0 32px; }
    .nav-tab { padding: 14px 24px; font-size: 14px; font-weight: 500; color: var(--text3); cursor: pointer; border-bottom: 2px solid transparent; transition: all var(--transition); background: none; border-top: none; border-left: none; border-right: none; }
    .nav-tab:hover { color: var(--text); }
    .nav-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
    .tab-content { display: none; }
    .tab-content.active { display: block; }

    /* ═══ Content area ═══ */
    .page { max-width: 1400px; margin: 0 auto; padding: 40px 32px; }
    .page > * + * { margin-top: 18px; }
    .page h2 { margin-top: 0; }

    /* ═══ Leaderboard (Tab 1) ═══ */
    .lb-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
    .lb-header h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
    .lb-filters { display: flex; gap: 8px; }
    .lb-filter { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 6px 14px; font-size: 12px; cursor: pointer; color: var(--text2); transition: all var(--transition); }
    .lb-filter:hover, .lb-filter.active { border-color: var(--accent); color: var(--accent); background: var(--surface2); }

    .lb-table { width: 100%; border-collapse: separate; border-spacing: 0; }
    .lb-table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text3); padding: 10px 14px; border-bottom: 1px solid var(--border); }
    .lb-table td { padding: 14px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; transition: background var(--transition); font-variant-numeric: tabular-nums; }
    .lb-table tr:hover td { background: var(--surface2); }
    .lb-rank { font-family: var(--mono); font-weight: 600; color: var(--text3); width: 40px; font-size: 13px; }
    .lb-model { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
    .lb-provider { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
    .lb-score { font-family: var(--mono); font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
    .lb-change { font-family: var(--mono); font-size: 12px; }
    .lb-bar { height: 3px; border-radius: 2px; background: var(--border); position: relative; min-width: 80px; overflow: visible; }
    .lb-bar-fill { height: 100%; border-radius: 2px; transition: width 0.5s; opacity: 0.55; }
    /* Agent leaderboard bar: 2px solid purple fill from 0 to score, with two
       5px-tall yellow vertical tick marks at score-σ and score+σ for the CI.
       Ticks straddle the bar (extend above and below). Used in place of the
       model fill-bar so the score and uncertainty both read at a glance. */
    /* Triangle marker at the score position on a faint reference track, with
       two yellow horizontal CI lines extending from each side of the triangle
       to score±σ. Triangle is small (8px × 5px) so it doesn't visually
       dominate the row. */
    .lb-bar-tri { position: relative; min-width: 80px; height: 10px; overflow: visible; }
    .lb-bar-tri .lb-bar-track { position: absolute; top: 50%; left: 0; right: 0; height: 1px;
                                background: var(--border); transform: translateY(-50%); opacity: 0.7; }
    .lb-bar-tri .lb-bar-marker { position: absolute; top: 50%; width: 0; height: 0;
                                 border-left: 4px solid transparent; border-right: 4px solid transparent;
                                 border-top: 5px solid var(--accent);
                                 transform: translate(-50%, -50%); pointer-events: none; }
    .lb-bar-tri .lb-bar-ci-left,
    .lb-bar-tri .lb-bar-ci-right { position: absolute; top: 50%; height: 2px;
                                   background: var(--yellow); transform: translateY(-50%);
                                   pointer-events: none; border-radius: 1px; }
    .lb-nerf { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
    .pos { color: var(--green); } .neg { color: var(--red); } .neu { color: var(--text3); }

    /* ═══ Arena / Model Detail (Tab 2) ═══ */
    .arena-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

    /* Agent category custom dropdown */
    .agent-cat-dropdown { position: relative; min-width: 280px; }
    .agent-cat-btn {
      display: flex; align-items: center; justify-content: space-between;
      background: var(--surface); color: var(--text); border: 1px solid var(--border);
      border-radius: 12px; padding: 10px 16px; font-size: 13px; font-weight: 500;
      cursor: pointer; width: 100%; text-align: left; transition: all 0.2s;
    }
    .agent-cat-btn:hover { border-color: #6366f1; }
    .agent-cat-dropdown.open .agent-cat-btn { border-color: #6366f1; border-radius: 12px 12px 0 0; }
    .agent-cat-dropdown.open .agent-cat-btn svg { transform: rotate(180deg); }
    .agent-cat-menu {
      display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
      background: var(--surface); border: 1px solid var(--border); border-top: none;
      border-radius: 0 0 12px 12px; max-height: 420px; overflow-y: auto;
      box-shadow: 0 12px 32px rgba(0,0,0,0.4);
    }
    .agent-cat-dropdown.open .agent-cat-menu { display: block; }
    .agent-cat-menu::-webkit-scrollbar { width: 4px; }
    .agent-cat-menu::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }
    .agent-cat-group {
      padding: 10px 16px 4px; font-size: 10px; font-weight: 700; text-transform: uppercase;
      letter-spacing: 1px; color: #6366f1; border-top: 1px solid var(--border);
    }
    .agent-cat-group:first-child { border-top: none; }
    .agent-cat-item {
      display: flex; align-items: center; gap: 10px; padding: 8px 16px;
      cursor: pointer; transition: background 0.15s; border-radius: 0;
    }
    .agent-cat-item:hover { background: rgba(99,102,241,0.1); }
    .agent-cat-item.active { background: rgba(99,102,241,0.18); }
    .agent-cat-item:last-child { border-radius: 0 0 12px 12px; }
    .agent-cat-icon { display: none; }
    .agent-cat-name { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.3; }
    .agent-cat-desc { font-size: 10px; color: var(--text3); line-height: 1.3; }
    .model-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; cursor: pointer; transition: all var(--transition); }
    .model-card:hover { border-color: var(--accent); box-shadow: 0 4px 20px var(--shadow); transform: translateY(-2px); }
    .mc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
    .mc-name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
    .mc-provider { font-size: 11px; color: var(--text3); margin-top: 2px; }
    .mc-score-big { font-family: var(--mono); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
    /* Spinning loader: prepended automatically to any .loading element */
    @keyframes ia-spin { to { transform: rotate(360deg); } }
    .loading::before {
      content: ""; display: inline-block;
      width: 14px; height: 14px;
      border: 2px solid var(--border); border-top-color: var(--accent);
      border-radius: 50%; vertical-align: middle; margin-right: 10px;
      animation: ia-spin 0.7s linear infinite;
    }
    /* Skeleton bars for table/card placeholders */
    @keyframes ia-shimmer { 0% { background-position: -200px 0 } 100% { background-position: 200px 0 } }
    .skel-bar {
      display: inline-block; height: 12px; border-radius: 4px;
      background: linear-gradient(90deg, var(--surface2) 0%, var(--bg2) 50%, var(--surface2) 100%);
      background-size: 400px 100%; animation: ia-shimmer 1.4s linear infinite;
      vertical-align: middle;
    }
    .skel-row td { padding: 14px 12px !important; }
    .skel-block { height: 220px; border-radius: 12px;
      background: linear-gradient(90deg, var(--surface2) 0%, var(--bg2) 50%, var(--surface2) 100%);
      background-size: 800px 100%; animation: ia-shimmer 1.6s linear infinite;
    }
    .mc-chart { height: 60px; margin: 12px 0; position: relative; }
    .mc-chart.skeleton::before {
      content: ""; position: absolute; inset: 0; opacity: 0.18; pointer-events: none;
      background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 30' preserveAspectRatio='none'><polyline fill='none' stroke='%23888' stroke-width='1.2' stroke-linejoin='round' stroke-linecap='round' points='0,22 8,19 16,21 24,15 32,17 40,12 48,14 56,10 64,13 72,8 80,11 88,7 100,9'/></svg>");
      background-repeat: no-repeat; background-size: 100% 100%;
    }
    .mc-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
    .mc-stat { text-align: center; }
    .mc-stat-val { font-family: var(--mono); font-weight: 600; font-size: 13px; }
    .mc-stat-lbl { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.3px; }

    /* Model detail modal */
    .modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100; justify-content: center; align-items: flex-start; padding: 40px; overflow-y: auto; }
    .modal-overlay.open { display: flex; }
    .modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; max-width: 900px; width: 100%; padding: 32px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); max-height: calc(100vh - 80px); overflow-y: auto; }
    .modal-close { float: right; background: none; border: none; font-size: 24px; color: var(--text3); cursor: pointer; }
    .modal-close:hover { color: var(--text); }
    .modal h2 { font-size: 24px; margin-bottom: 4px; }
    .modal-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
    .modal-score-card { background: var(--surface2); border-radius: 10px; padding: 14px; text-align: center; }
    .modal-score-card .val { font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
    .modal-score-card .lbl { font-size: 11px; color: var(--text3); margin-top: 4px; }
    .comment-section { margin-top: 16px; }
    .comment-section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
    .comment-section-header h3 { font-size: 14px; margin: 0; }
    .comment-section-tag { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
    .comment-list { max-height: 280px; overflow-y: auto; }
    .comment { padding: 12px; border-bottom: 1px solid var(--border); position: relative; }
    .comment:last-child { border-bottom: none; }
    .comment-author { font-weight: 600; font-size: 12px; color: var(--accent); }
    .comment-text { font-size: 13px; margin-top: 4px; line-height: 1.5; }
    .comment-meta { font-size: 11px; color: var(--text3); margin-top: 4px; display: flex; align-items: center; gap: 12px; }
    .comment-actions { display: flex; gap: 12px; margin-top: 6px; }
    .comment-action { background: none; border: none; color: var(--text3); font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 4px; padding: 2px 0; transition: color 0.15s; }
    .comment-action:hover { color: var(--accent); }
    .comment-action.liked { color: #e91e8a; }
    .user-comment-box { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
    .user-comment-input { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; color: var(--text); font-size: 13px; font-family: var(--font); outline: none; resize: none; }
    .user-comment-input:focus { border-color: var(--accent); }
    .user-comment-submit { background: var(--accent); color: white; border: none; border-radius: 8px; padding: 10px 16px; font-weight: 600; cursor: pointer; font-size: 13px; white-space: nowrap; }
    .user-comment-submit:hover { opacity: 0.9; }
    .signin-prompt { text-align: center; padding: 16px; color: var(--text3); font-size: 13px; }
    .signin-prompt a { color: var(--accent); cursor: pointer; font-weight: 600; text-decoration: none; }
    .signin-prompt a:hover { text-decoration: underline; }

    /* ═══ Chat (Tab 3) ═══ */
    .chat-container { display: grid; grid-template-columns: 250px 1fr; gap: 20px; height: calc(100vh - 160px); }
    .chat-sidebar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
    .chat-sidebar h3 { font-size: 13px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
    .chat-model-btn { width: 100%; text-align: left; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 8px; cursor: pointer; transition: all var(--transition); }
    .chat-model-btn:hover, .chat-model-btn.active { border-color: var(--accent); background: rgba(99,102,241,0.1); }
    .chat-model-btn .cmb-name { font-weight: 600; font-size: 13px; }
    .chat-model-btn .cmb-score { font-family: var(--mono); font-size: 11px; color: var(--accent); }
    .chat-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; }
    .chat-messages { flex: 1; overflow-y: auto; padding: 20px; }
    .chat-msg { margin-bottom: 16px; max-width: 80%; }
    .chat-msg.user { margin-left: auto; }
    .chat-msg-bubble { padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.5; }
    .chat-msg.user .chat-msg-bubble { background: var(--accent); color: white; border-bottom-right-radius: 4px; }
    .chat-msg.assistant .chat-msg-bubble { background: var(--surface2); border-bottom-left-radius: 4px; }
    .chat-msg-label { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
    .chat-input-area { display: flex; gap: 8px; padding: 16px; border-top: 1px solid var(--border); }
    .chat-input { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; color: var(--text); font-size: 14px; font-family: var(--font); outline: none; }
    .chat-input:focus { border-color: var(--accent); }
    .chat-send { background: var(--accent); color: white; border: none; border-radius: 10px; padding: 12px 20px; font-weight: 600; cursor: pointer; font-size: 14px; }
    .chat-send:hover { opacity: 0.9; }

    /* Chat/API mode tabs */
    .chat-mode-tabs { display: flex; border-bottom: 1px solid var(--border); }
    .chat-mode-tab { flex: 1; padding: 10px; text-align: center; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text3); border-bottom: 2px solid transparent; transition: all 0.2s; }
    .chat-mode-tab:hover { color: var(--text2); }
    .chat-mode-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
    .api-panel { padding: 20px; overflow-y: auto; flex: 1; }
    .api-section { margin-bottom: 20px; }
    .api-section h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text3); margin-bottom: 8px; }
    .api-endpoint { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; font-family: var(--mono); font-size: 13px; }
    .api-endpoint .method { background: #22c55e; color: white; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
    .api-endpoint .url { color: var(--text); flex: 1; word-break: break-all; }
    .api-copy-btn { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 11px; color: var(--text2); cursor: pointer; white-space: nowrap; transition: all 0.2s; }
    .api-copy-btn:hover { border-color: var(--accent); color: var(--accent); }
    .api-code { background: #0d1117; border: 1px solid #30363d; border-radius: 10px; padding: 16px; font-family: var(--mono); font-size: 12px; color: #e6edf3; line-height: 1.6; overflow-x: auto; white-space: pre; position: relative; }
    .api-code .lang-tab { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
    .api-code .lang-tab button { background: #21262d; border: 1px solid #30363d; border-radius: 6px; padding: 2px 10px; font-size: 10px; color: #8b949e; cursor: pointer; font-family: var(--mono); }
    .api-code .lang-tab button.active { color: #58a6ff; border-color: #58a6ff; }
    .api-key-box { display: flex; align-items: center; gap: 8px; }
    .api-key-input { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-family: var(--mono); font-size: 12px; color: var(--text); }
    .api-key-input:focus { border-color: var(--accent); outline: none; }
    .api-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: 11px; font-weight: 600; }
    .api-badge.free { background: #22c55e15; color: #22c55e; border: 1px solid #22c55e30; }
    .api-badge.pro { background: #6366f115; color: #6366f1; border: 1px solid #6366f130; }
    .api-pricing-row { display: flex; gap: 16px; margin-top: 8px; }
    .api-price-card { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
    .api-price-card .price { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--text); }
    .api-price-card .unit { font-size: 11px; color: var(--text3); }

    /* ═══ Methodology (Tab 4) ═══ */
    .methodology { max-width: 800px; }
    .methodology h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
    .methodology h3 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; color: var(--accent); }
    .methodology p { font-size: 14px; line-height: 1.7; color: var(--text2); margin-bottom: 12px; }
    .methodology ul { margin: 8px 0 16px 20px; color: var(--text2); }
    .methodology li { margin-bottom: 6px; line-height: 1.5; }
    .methodology code { background: var(--surface2); padding: 2px 6px; border-radius: 4px; font-family: var(--mono); font-size: 13px; }
    .meth-formula { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin: 12px 0; font-family: var(--mono); font-size: 13px; color: var(--text2); overflow-x: auto; }

    /* ═══ Responsive (mobile / tablet) ═══ */

    /* Global guards: prevent any single element from blowing out the viewport */
    body { overflow-x: hidden; }
    img, svg, canvas, video, iframe { max-width: 100%; height: auto; }
    canvas { height: auto; max-height: 100%; }   /* Chart.js handles its own height via the wrapper */
    table { max-width: 100%; }
    pre, code { word-break: break-word; overflow-wrap: anywhere; }

    /* Always-on horizontal-scroll wrappers for content that can't shrink */
    .tab-content { overflow-x: hidden; }
    .lb-table-wrap, .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
    .lb-table-wrap .lb-table { min-width: 560px; }   /* keep columns readable, scroll if needed */

    /* TABLET: <= 900px */
    @media (max-width: 900px) {
      .header { padding: 10px 14px; flex-wrap: wrap; gap: 8px; row-gap: 6px; }
      .header-left { flex-wrap: wrap; gap: 8px; min-width: 0; }
      .header-right { gap: 6px; flex-wrap: wrap; }
      .stat-badge { font-size: 11px; padding: 4px 8px; }
      .nav-tabs { padding: 0 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; scrollbar-width: thin; }
      .nav-tab { padding: 12px 14px; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
      .page { padding: 16px !important; max-width: 100% !important; }
      .lb-table { font-size: 12px; }
      .lb-table th, .lb-table td { padding: 8px 10px; }
      .lb-bar { display: none; }                      /* free up the rel-bar column on tablet */
      .modal { padding: 22px 18px; max-width: 96vw; max-height: calc(100vh - 32px); border-radius: 14px; }
      .arena-grid { grid-template-columns: 1fr !important; }
      .agent-cat-dropdown { min-width: 0 !important; width: 100%; }
      .methodology h2 { font-size: 20px; }
      .methodology h3 { font-size: 15px; }
      .methodology p { font-size: 13px; }
      .meth-formula { font-size: 12px; padding: 12px 14px; overflow-x: auto; }
      footer { padding: 24px 16px 32px !important; }
      footer > div { flex-direction: column !important; align-items: flex-start !important; }
    }

    /* PHONE: <= 600px */
    @media (max-width: 600px) {
      .header { padding: 8px 12px; }
      .header-left { gap: 6px; width: 100%; justify-content: space-between; }
      .header-left .logo-img { height: 28px !important; }
      .header-left .stat-badge { display: none; }    /* hide all 3 stat badges on phone, freshness lives on the leaderboard */
      .header-right { width: 100%; justify-content: flex-end; }
      .header-right .theme-toggle { padding: 6px 10px; font-size: 11px; }
      h1 { font-size: 20px !important; line-height: 1.25; }
      h2 { font-size: 18px !important; line-height: 1.3; }
      h3 { font-size: 15px !important; }
      .page { padding: 12px !important; }
      .lb-table { font-size: 12px; }
      .lb-table th, .lb-table td { padding: 6px 8px; }
      /* Agent leaderboard (#agent-leaderboard) on phone:
         hide Score-rel, Mentions, and the optional 1h Δ. Always keep 24h Δ. */
      #agent-leaderboard .lb-table th:nth-last-child(1),
      #agent-leaderboard .lb-table td:nth-last-child(1) { display: none; }   /* Score (rel.) */
      #agent-leaderboard .lb-table th:nth-last-child(2),
      #agent-leaderboard .lb-table td:nth-last-child(2) { display: none; }   /* Mentions */
      #agent-leaderboard .lb-table th:nth-last-child(5),
      #agent-leaderboard .lb-table td:nth-last-child(5) { display: none; }   /* 1h Δ */
      /* Model leaderboard (#tab-leaderboard) on phone: hide Price (col 6)
         and Sentiment (col 7) — same as the original behavior. */
      #tab-leaderboard .lb-table th:nth-child(6),
      #tab-leaderboard .lb-table td:nth-child(6) { display: none; }
      #tab-leaderboard .lb-table th:nth-child(7),
      #tab-leaderboard .lb-table td:nth-child(7) { display: none; }
      .lb-table .lb-rank { width: 28px; }
      /* Tap targets: hit area at least ~40px */
      .nav-tab { padding: 12px 12px; min-height: 44px; display: inline-flex; align-items: center; }
      button, .lb-filter, .agent-cat-btn { min-height: 36px; }
      /* Form pairs: collapse two-column grids to one column */
      #contact-sales-form > div[style*="grid"] { display: block !important; }
      #contact-sales-form > div[style*="grid"] > div { margin-bottom: 12px; }
      /* Analytics tab: collapse 2-col stat grids on phone */
      #tab-analytics div[style*="grid-template-columns:1fr 1fr"],
      #tab-analytics div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
      }
      /* Charts shrink for phone viewports */
      [style*="height:340px"], [style*="height:380px"], [style*="height: 340px"], [style*="height: 380px"] {
        height: 240px !important;
      }
      [style*="height:220px"], [style*="height: 220px"] { height: 180px !important; }
      [style*="height:200px"], [style*="height: 200px"] { height: 160px !important; }
      .meth-formula { font-size: 11px; padding: 10px 12px; }
      /* Modals fill nearly the whole screen */
      .modal-overlay { padding: 12px !important; }
      .modal { padding: 18px 14px; max-width: 100vw; width: 100%; max-height: calc(100vh - 24px); border-radius: 12px; }
      .modal h2 { font-size: 18px; }
      /* Footer blocks stack tighter */
      footer { padding: 20px 14px 28px !important; font-size: 11px; }
    }

    /* SMALL PHONE: <= 380px (iPhone SE etc.) */
    @media (max-width: 380px) {
      .header-left .logo-img { height: 24px !important; }
      .nav-tab { padding: 10px 10px; font-size: 12px; }
      .lb-table { font-size: 11px; }
      .lb-table th, .lb-table td { padding: 5px 6px; }
      .page { padding: 10px !important; }
    }

    /* iOS-friendly tap behavior */
    button, [role="button"], .nav-tab, .lb-filter { touch-action: manipulation; }
    /* Disable iOS Safari "tap highlight" gray flash */
    a, button { -webkit-tap-highlight-color: transparent; }

    /* ═══ Accessibility ═══ */
    a, button, input, select, textarea, [tabindex]:not([tabindex="-1"]) { outline-offset: 2px; }
    a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
      outline: 2px solid var(--accent); outline-offset: 2px;
    }
    .skip-link {
      position: absolute; top: -40px; left: 8px; background: var(--accent); color: white; padding: 8px 14px;
      border-radius: 6px; font-weight: 600; font-size: 13px; z-index: 1000; transition: top 0.2s;
    }
    .skip-link:focus { top: 8px; }
    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.35; }
    }
