/* ═══════════════════════════════════════════════════════════════
   RizeAI SPA — Streamlit版ピクセルパーフェクト移植
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Nunito:wght@600;700;800&display=swap');

/* テーマ変数 */
:root {
  --bg: #0f1318;
  --bg-card: rgba(15,30,28,.45);
  --bg-card2: linear-gradient(135deg, #0c1f18, #111420);
  --bg-card3: linear-gradient(135deg, #0a1c14, #0e1420);
  --text: #e2f5f0;
  --text2: #c8e8e0;
  --text-dim: #94c5b9;
  --text-faint: #b8d8d0;
  --text-soft: #a8d4c8;
  --accent: #2dd4bf;
  --accent2: #5fe0c4;
  --accent-soft: rgba(45,212,191,.10);
  --accent-strong: rgba(45,212,191,.30);
  --border: #2a3540;
  --border-row: #1a2530;
  --gold: #fbbf24;
  --gold2: #f59e0b;
  --warn: #f87171;
  --warn2: #fca5a5;
}
[data-theme="light"] {
  --bg: #f7faf9;
  --bg-card: #ffffff;
  --bg-card2: linear-gradient(135deg, #ecfdf5, #f0fdfa);
  --bg-card3: linear-gradient(135deg, #f0fdfa, #ecfdf5);
  --text: #0a2e26;
  --text2: #134e4a;
  --text-dim: #4a6e62;
  --text-faint: #2d5a4a;
  --text-soft: #1a5a46;
  --accent: #0d9488;
  --accent2: #0f766e;
  --accent-soft: rgba(13,148,136,.12);
  --accent-strong: rgba(13,148,136,.35);
  --border: #cce5dd;
  --border-row: #e0eee9;
  --gold: #d97706;
  --gold2: #b45309;
  --warn: #dc2626;
  --warn2: #b91c1c;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Noto Sans JP', 'Nunito', sans-serif; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; max-width: 100vw; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; max-width: 100vw; transition: background .2s, color .2s; }
.app, .tab-content, #race-list { max-width: 100%; overflow-x: hidden; }

/* ─── Light テーマ override (hardcoded色を一括差し替え) ─── */
[data-theme="light"] {
    color-scheme: light;
}
[data-theme="light"] .race-link { background: rgba(13,148,136,.04); border-color: rgba(13,148,136,.18); color: var(--text2); }
[data-theme="light"] .race-link:hover { background: rgba(13,148,136,.10); }
[data-theme="light"] .race-link .rl-rn { color: var(--accent); }
[data-theme="light"] .race-link .rl-name { color: var(--text); }
[data-theme="light"] .race-link .rl-row2 { color: var(--text-dim); }
[data-theme="light"] .race-link .rl-time { color: var(--accent); }
[data-theme="light"] .race-link .rl-honmei { color: var(--accent2); }

[data-theme="light"] .venue-tab { background: rgba(13,148,136,.05); border-color: rgba(13,148,136,.18); color: var(--text-dim); }
[data-theme="light"] .venue-tab.active { background: rgba(13,148,136,.18); color: var(--accent); border-color: rgba(13,148,136,.4); }
[data-theme="light"] .venue-tab:hover { background: rgba(13,148,136,.10); color: var(--text2); }

[data-theme="light"] .tabs { border-bottom-color: var(--border); }
[data-theme="light"] .tab { color: var(--text-dim); }
[data-theme="light"] .tab:hover { color: var(--text2); }
[data-theme="light"] .tab.active { color: var(--accent); border-bottom-color: var(--accent); }

[data-theme="light"] .race-hdr { background: linear-gradient(90deg, rgba(13,148,136,.10) 0%, transparent 100%); border-left-color: var(--accent); }
[data-theme="light"] .race-hdr-num { color: var(--accent); }
[data-theme="light"] .race-hdr-name { color: var(--text); }
[data-theme="light"] .race-hdr-info { color: var(--text-soft); }
[data-theme="light"] .track-bar { background: rgba(13,148,136,.06); border-color: rgba(13,148,136,.15); }
[data-theme="light"] .tc-good { color: #047857; }
[data-theme="light"] .pace-mid { background: rgba(13,148,136,.10); color: #0f766e; border-color: rgba(13,148,136,.20); }

[data-theme="light"] .conf-pill, [data-theme="light"] .upset-pill { color: #fff; }
[data-theme="light"] .warn-box { background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.20); color: #b91c1c; }

[data-theme="light"] .rize-comment { background: linear-gradient(135deg, #ecfdf5, #f0fdfa); border-color: rgba(13,148,136,.18); color: var(--text2); }
[data-theme="light"] .rize-avatar { color: var(--accent); }
[data-theme="light"] .rc-line { color: var(--text2); }
[data-theme="light"] .rc-line:not(:last-child) { border-bottom-color: rgba(13,148,136,.10); }

[data-theme="light"] .picks-box { background: linear-gradient(135deg, #ecfdf5, #f7fefb); border-color: rgba(13,148,136,.18); }
[data-theme="light"] .picks-title { color: var(--accent); }
[data-theme="light"] .bet-type-label { color: var(--accent); }
[data-theme="light"] .bet-type-pts { color: var(--gold); background: rgba(217,119,6,.10); }
[data-theme="light"] .bet-type-note { color: var(--text-dim); background: rgba(13,148,136,.05); }
[data-theme="light"] .num-pill { background: rgba(13,148,136,.10); border-color: rgba(13,148,136,.28); color: var(--text); }
[data-theme="light"] .bet-sep { color: var(--accent2); }

[data-theme="light"] .htable th { background: rgba(13,148,136,.10); color: var(--text-dim); border-bottom-color: var(--border); }
[data-theme="light"] .htable td { color: var(--text2); border-bottom-color: var(--border-row); }
[data-theme="light"] .htable tr.row-honmei td { background: rgba(13,148,136,.08); }
[data-theme="light"] .htable tr.row-dark td { background: rgba(217,119,6,.06); }

[data-theme="light"] .horse-card { background: #ffffff; border-color: rgba(13,148,136,.15); }
[data-theme="light"] .horse-card.hc-honmei { background: linear-gradient(90deg, rgba(13,148,136,.12), #ffffff); border-color: rgba(13,148,136,.40); }
[data-theme="light"] .horse-card.hc-dark { background: linear-gradient(90deg, rgba(217,119,6,.08), #ffffff); border-color: rgba(217,119,6,.30); }
[data-theme="light"] .horse-card .hc-num { color: var(--text); }
[data-theme="light"] .horse-card .hc-name { color: var(--text); }
[data-theme="light"] .horse-card .hc-ai { color: var(--accent); }
[data-theme="light"] .horse-card .hc-mid { color: var(--text-dim); }
[data-theme="light"] .horse-card .hc-jockey { color: var(--text2); }
[data-theme="light"] .horse-card .hc-style { color: var(--text-dim); }
[data-theme="light"] .horse-card .hc-frame { color: var(--text-dim); }
[data-theme="light"] .horse-card .hc-odds { color: var(--gold); }
[data-theme="light"] .horse-card .hc-pop { color: var(--text-dim); }
[data-theme="light"] .horse-card .hc-ml-pill { background: rgba(13,148,136,.15); color: var(--accent); }
[data-theme="light"] .horse-card .hc-p3-pill { background: rgba(16,185,129,.15); color: #047857; }
[data-theme="light"] .horse-card .hc-db-bit { color: var(--text-dim); }

[data-theme="light"] .mark-honmei { color: var(--accent); }
[data-theme="light"] .mark-taikou { color: #047857; }
[data-theme="light"] .mark-tanpuku { color: #0d9488; }
[data-theme="light"] .mark-dark { color: var(--gold2); }
[data-theme="light"] .mark-sub { color: #059669; }

[data-theme="light"] .c-mint { color: var(--accent); }
[data-theme="light"] .c-grn { color: #059669; }
[data-theme="light"] .c-pink { color: #be123c; }
[data-theme="light"] .c-dim { color: var(--text-dim); }
[data-theme="light"] .c-std { color: var(--text-soft); }
[data-theme="light"] .db-stat { color: var(--text-dim); }

[data-theme="light"] .roi-wrap { background: linear-gradient(135deg, #ecfdf5, #f0fdfa); border-color: rgba(13,148,136,.25); }
[data-theme="light"] .roi-label { color: var(--text-soft); }
[data-theme="light"] .roi-pos { color: #059669; }
[data-theme="light"] .roi-neg { color: #b91c1c; }
[data-theme="light"] .bk-card { background: linear-gradient(135deg, #ecfdf5, #f0fdfa); border-color: rgba(13,148,136,.20); }
[data-theme="light"] .bk-label { color: var(--text-soft); }
[data-theme="light"] .bk-val { color: var(--text); }
[data-theme="light"] .bk-pos { color: #059669; }
[data-theme="light"] .bk-neg { color: #b91c1c; }
[data-theme="light"] .mk-table th { background: rgba(13,148,136,.10); color: var(--text-dim); border-bottom-color: var(--border); }
[data-theme="light"] .mk-table td { color: var(--text2); border-bottom-color: var(--border-row); }
[data-theme="light"] .mk-table td:first-child { color: var(--text2); }
[data-theme="light"] .mk-table td.pos { color: #059669; }
[data-theme="light"] .mk-table td.neg { color: #b91c1c; }
[data-theme="light"] .mk-table tr:hover td { background: rgba(13,148,136,.05); }

[data-theme="light"] .wait-box { background: rgba(13,148,136,.08); border-color: rgba(13,148,136,.20); color: var(--text-soft); }
[data-theme="light"] .nodata-box { background: #f0fdfa; border-color: rgba(13,148,136,.15); color: var(--text-soft); }
[data-theme="light"] .sec-title { background: linear-gradient(90deg, rgba(13,148,136,.16), transparent); color: var(--text-soft); border-left-color: var(--accent); }
[data-theme="light"] .sec-sub { color: var(--text-dim); }
[data-theme="light"] .nav-btn { background: rgba(13,148,136,.08); border-color: rgba(13,148,136,.25); color: var(--accent); }
[data-theme="light"] .nav-btn:hover { background: rgba(13,148,136,.18); }
[data-theme="light"] .nav-current { color: var(--accent); }
[data-theme="light"] .filter-toggle { background: linear-gradient(90deg, rgba(13,148,136,.10), rgba(13,148,136,.04)); border-color: rgba(13,148,136,.30); color: var(--accent2); }
[data-theme="light"] .search-input { background: #ffffff; border-color: rgba(13,148,136,.25); color: var(--text); }
[data-theme="light"] .search-input::placeholder { color: var(--text-dim); }

[data-theme="light"] .similar-box { background: #f0fdfa; border-color: rgba(13,148,136,.20); color: var(--text2); }
[data-theme="light"] .bd-expander { background: linear-gradient(135deg, #f0fdfa, #ecfdf5); border-color: rgba(13,148,136,.18); }
[data-theme="light"] .bd-expander summary { color: var(--text-soft); }
[data-theme="light"] .bd-body { color: var(--text2); }
[data-theme="light"] .stat-pill { background: rgba(13,148,136,.10); color: var(--accent); }

[data-theme="light"] hr { border-top-color: var(--border); }
[data-theme="light"] .ftag.ft-up { background: rgba(5,150,105,.18); color: #047857; }
[data-theme="light"] .ftag.ft-dn { background: rgba(220,38,38,.18); color: #b91c1c; }
[data-theme="light"] .ftag.ft-long { background: rgba(217,119,6,.18); color: var(--gold2); }
[data-theme="light"] .ftag.ft-short { background: rgba(37,99,235,.18); color: #1d4ed8; }

[data-theme="light"] .honmei-card { background: linear-gradient(135deg, rgba(13,148,136,.12), rgba(13,148,136,.02)); border-color: rgba(13,148,136,.35); }
[data-theme="light"] .honmei-info .hi-name { color: var(--text); }
[data-theme="light"] .honmei-info .hi-mark { color: var(--accent); }
[data-theme="light"] .honmei-info .hi-meta { color: var(--text-dim); }
[data-theme="light"] .honmei-info .hi-odds { color: var(--gold2); }
[data-theme="light"] .honmei-info .hi-ml-pill { background: rgba(13,148,136,.18); color: var(--accent); }
[data-theme="light"] .honmei-info .hi-ml-p3 { background: rgba(5,150,105,.18); color: #047857; }
[data-theme="light"] .honmei-gauge .hg-text { fill: var(--accent); }
[data-theme="light"] .honmei-gauge .hg-label { color: var(--text-dim); }

[data-theme="light"] .chart-wrap { background: linear-gradient(135deg, #f0fdfa, #ecfdf5); border-color: rgba(13,148,136,.18); }

[data-theme="light"] .race-nav-row .nav-btn { background: rgba(13,148,136,.06); border-color: rgba(13,148,136,.22); color: var(--text-dim); }
[data-theme="light"] .race-nav-row .nav-btn:hover { background: rgba(13,148,136,.16); color: var(--text); }
[data-theme="light"] .back-bar .nav-btn { background: rgba(13,148,136,.10); border-color: rgba(13,148,136,.30); color: var(--accent); }
[data-theme="light"] .share-btn { background: linear-gradient(90deg, rgba(13,148,136,.20), rgba(13,148,136,.08)) !important; color: var(--accent) !important; border-color: rgba(13,148,136,.4) !important; }

[data-theme="light"] .horse-detail-row td { background: #f0fdfa !important; border-bottom-color: var(--border) !important; }
[data-theme="light"] .mini-past th { color: var(--text-dim); }
[data-theme="light"] .mini-past td { color: var(--text2); }
[data-theme="light"] .hm-section b { color: var(--text-soft); }
[data-theme="light"] .horse-card .horse-detail-inline { border-top-color: rgba(13,148,136,.15); }
[data-theme="light"] .fav-item { background: #ffffff; border-color: rgba(13,148,136,.20); }
[data-theme="light"] .fav-item .fi-name { color: var(--text); }
[data-theme="light"] .fav-item .fi-id { color: var(--text-dim); }
a { color: inherit; text-decoration: none; }

/* ── フィルタトグル ── */
.filter-toggle {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 10px; margin: 4px 0 6px;
    background: linear-gradient(90deg, rgba(45,212,191,.10), rgba(45,212,191,.04));
    border: 1px solid rgba(45,212,191,.30);
    border-radius: 8px; font-size: .76rem; color: #5eead4; cursor: pointer; user-select: none;
    font-weight: 700;
}
.filter-toggle:hover { background: linear-gradient(90deg, rgba(45,212,191,.16), rgba(45,212,191,.08)); }
.filter-toggle input { accent-color: #2dd4bf; cursor: pointer; width: 14px; height: 14px; }
.filter-toggle input:checked + span { color: #2dd4bf; }

/* ── レイアウト ── */
.app { max-width: 720px; margin: 0 auto; padding: 8px 10px 60px; }

/* ── 脚質分布バー ── */
.style-bar {
    display: flex;
    width: 100%;
    height: 14px;
    border-radius: 4px;
    overflow: hidden;
    margin: 4px 0 6px;
    font-size: .58rem;
    font-weight: 800;
}
.sb-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a1c14;
    letter-spacing: -.02em;
}

/* ── 横断 ◎本命テーブル ── */
.cross-honmei td { cursor: pointer; }
.cross-honmei tr:hover td { background: rgba(45,212,191,.06); }

/* ── 馬個別モーダル ── */
.horse-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.horse-modal-body {
    background: linear-gradient(135deg, #0c1f18, #111420);
    border: 1px solid rgba(45,212,191,.30);
    border-radius: 12px;
    padding: 14px 16px;
    width: 100%;
    max-width: 440px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}
.hm-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: rgba(45,212,191,.10);
    border: 1px solid rgba(45,212,191,.30);
    color: #2dd4bf;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
}
.hm-hdr { margin-bottom: 8px; }
.hm-name { color: #f0fffa; font-weight: 800; font-size: 1.1rem; }
.hm-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: .72rem; color: #94c5b9; margin-top: 4px; font-weight: 600; }
.hm-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin: 8px 0;
}
.hm-stat {
    background: rgba(45,212,191,.06);
    border: 1px solid rgba(45,212,191,.15);
    border-radius: 6px;
    padding: 4px;
    text-align: center;
}
.hms-label { font-size: .55rem; color: #94c5b9; font-weight: 700; }
.hms-val { font-family: 'Nunito',sans-serif; font-weight: 800; font-size: 1rem; color: #e2f5f0; }
.hm-extlink { margin-top: 10px; text-align: center; }
.hm-extlink a { color: #2dd4bf; font-size: .78rem; font-weight: 700; text-decoration: underline; }

[data-theme="light"] .horse-modal-body { background: linear-gradient(135deg, #ecfdf5, #f0fdfa); border-color: rgba(13,148,136,.30); }
[data-theme="light"] .hm-close { background: rgba(13,148,136,.10); border-color: rgba(13,148,136,.30); color: var(--accent); }
[data-theme="light"] .hm-name { color: var(--text); }
[data-theme="light"] .hm-meta { color: var(--text-dim); }
[data-theme="light"] .hm-stat { background: rgba(13,148,136,.06); border-color: rgba(13,148,136,.15); }
[data-theme="light"] .hms-label { color: var(--text-dim); }
[data-theme="light"] .hms-val { color: var(--text); }
[data-theme="light"] .hm-extlink a { color: var(--accent); }
[data-theme="light"] .cross-honmei tr:hover td { background: rgba(13,148,136,.06); }

/* ── スクロールトップ ── */
.scrolltop-btn {
    position: fixed;
    right: 14px;
    bottom: 140px;
    background: rgba(45,212,191,.18);
    border: 1px solid rgba(45,212,191,.4);
    color: #2dd4bf;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    z-index: 49;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .15s;
    backdrop-filter: blur(8px);
}
.scrolltop-btn.show { opacity: 1; pointer-events: auto; }
.scrolltop-btn:active { transform: scale(.9); }

/* ── 馬連 p3 合算サマリ ── */
.p3-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 11px;
    margin: 6px 0 8px;
    background: linear-gradient(90deg, rgba(110,231,183,.16), rgba(45,212,191,.08));
    border: 1px solid rgba(110,231,183,.32);
    border-radius: 8px;
    font-size: .78rem;
    color: #d4eeea;
    flex-wrap: wrap;
}
.p3s-title { white-space: nowrap; }
.p3s-title { color: #6ee7b7; font-weight: 700; }
.p3s-row { background: rgba(110,231,183,.10); padding: 1px 8px; border-radius: 8px; font-family: 'Nunito',sans-serif; font-weight: 700; color: #b8d8d0; }
.p3s-row b { color: #2dd4bf; font-weight: 800; }

/* ── 代替候補ヒント ── */
.alt-hint {
    padding: 5px 10px;
    margin: 4px 0 6px;
    background: rgba(251,191,36,.08);
    border-left: 3px solid #fbbf24;
    border-radius: 0 6px 6px 0;
    font-size: .72rem;
    color: #fbbf24;
    line-height: 1.4;
}

/* ── 過去走 sparkline ── */
.sparkline {
    width: 120px;
    height: 28px;
    margin-left: 8px;
    vertical-align: middle;
}

[data-theme="light"] .floating-bets { background: linear-gradient(135deg, #0d9488, #047857); color: #f0fdfa; }
[data-theme="light"] .scrolltop-btn { background: rgba(13,148,136,.18); border-color: rgba(13,148,136,.4); color: var(--accent); }
[data-theme="light"] .p3-summary { background: linear-gradient(90deg, rgba(5,150,105,.10), rgba(13,148,136,.04)); border-color: rgba(5,150,105,.20); color: var(--text2); }
[data-theme="light"] .p3s-title { color: #047857; }
[data-theme="light"] .p3s-row { background: rgba(5,150,105,.10); color: var(--text2); }
[data-theme="light"] .p3s-row b { color: var(--accent); }
[data-theme="light"] .alt-hint { background: rgba(217,119,6,.10); border-left-color: var(--gold2); color: var(--gold2); }

/* ── 引っ張って更新インジケータ ── */
#ptr-indicator { position: fixed; top: 0; left: 0; right: 0; text-align: center; font-size: .85rem; color: #2dd4bf; padding: 8px 0 0; pointer-events: none; z-index: 100; min-height: 24px; }

/* ── ブランドヘッダー ── */
.rz-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.rz-header-l { line-height: 1.15; }
.rz-logo { font-size: 1.5rem !important; }
.rz-catch { display: none; }
#rz-header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.rz-header-l { display: flex; flex-direction: column; }
.rz-logo {
    font-family: 'Nunito', sans-serif;
    font-size: 2rem; font-weight: 800; letter-spacing: .02em;
    background: linear-gradient(120deg, #2dd4bf 0%, #34d399 60%, #6ee7b7 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    line-height: 1.1;
}
.rz-catch { font-size: .72rem; color: #94c5b9; letter-spacing: .08em; margin-top: 1px; font-weight: 700; }
.rz-meta  { font-size: .7rem; color: #a8d4c8; margin-top: 4px; font-weight: 600; }
.mini-refresh {
    display: inline-block; font-size: .85rem; padding: 2px 7px; margin-left: 6px;
    background: rgba(45,212,191,.08); border: 1px solid rgba(45,212,191,.25);
    border-radius: 50%; color: #2dd4bf; cursor: pointer; vertical-align: middle;
}
.mini-refresh:hover { background: rgba(45,212,191,.18); }

/* ── ROIバッジ ── */
.roi-wrap {
    background: linear-gradient(135deg, #0c1f18, #111827);
    border: 1px solid #2dd4bf22; border-radius: 10px;
    padding: 5px 12px; text-align: center; min-width: 70px;
    display: inline-block;
}
.roi-label { font-size: .62rem; color: #b8d8d0; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.roi-val   { font-size: 1.1rem; font-weight: 800; line-height: 1.1; font-family: 'Nunito', monospace; }
.roi-pos   { color: #34d399; }
.roi-neg   { color: #f87171; }
.roi-neu   { color: #1e3a30; }

/* ── 予想スケジュール注意書き (ロゴ下) ── */
.rz-notice {
    display: flex; flex-wrap: wrap; gap: 4px 12px;
    margin: 2px 0 8px; padding: 7px 11px;
    background: rgba(45,212,191,.05); border: 1px solid rgba(45,212,191,.14);
    border-radius: 9px; font-size: .68rem; line-height: 1.4; color: #9fc4bb;
}
.rz-notice-item { white-space: nowrap; }
.rz-notice-item b { color: #5eead4; font-weight: 700; }
[data-theme="light"] .rz-notice { background: rgba(13,148,136,.05); border-color: rgba(13,148,136,.18); color: #4b6b63; }
[data-theme="light"] .rz-notice-item b { color: #0d9488; }

/* ── DBバッジ ── */
.db-badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .67rem; font-weight: 600; background: rgba(45,212,191,.08); color: #2dd4bf; border: 1px solid rgba(45,212,191,.15); }

/* ── タブ ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #2a3540; margin: 8px 0 8px; }
.tab { flex: 1; background: transparent; border: none; padding: 8px 6px; font-size: .85rem; font-weight: 700; color: #94c5b9; cursor: pointer; border-bottom: 2px solid transparent; }
.tab:hover { color: #c0ddd8; }
.tab.active { color: #2dd4bf; border-bottom-color: #2dd4bf; font-weight: 800; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── 馬場バー ── */
.track-bar { display: inline-flex; gap: 10px; align-items: center; background: rgba(45,212,191,.06); border: 1px solid rgba(45,212,191,.15); border-radius: 16px; padding: 3px 10px; margin-bottom: 6px; font-size: .72rem; font-weight: 700; flex-wrap: wrap; }
.tc-good  { color: #34d399; font-weight: 700; }
.tc-soft  { color: #86efac; font-weight: 700; }
.tc-heavy { color: #fbbf24; font-weight: 700; }
.tc-bad   { color: #f87171; font-weight: 700; }

/* ── レースヘッダー ── */
.race-hdr { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; background: linear-gradient(90deg, rgba(45,212,191,.10) 0%, transparent 100%); border-left: 3px solid #2dd4bf; border-radius: 0 8px 8px 0; padding: 6px 10px; margin: 6px 0 4px; }
.race-hdr-num  { color: #2dd4bf; font-weight: 800; font-size: .95rem; min-width: 28px; font-family: 'Nunito', sans-serif; }
.race-hdr-name { color: #e2f5f0; font-weight: 800; font-size: .95rem; }
.race-hdr-info { color: #a8d4c8; font-size: .72rem; font-weight: 600; }
.rh-odds-upd { background: rgba(45,212,191,.12); color: #2dd4bf; padding: 1px 6px; border-radius: 8px; font-size: .65rem; font-weight: 700; font-family: 'Nunito',sans-serif; margin-left: 4px; }

/* ── ペースバッジ ── */
.pace-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .74rem; font-weight: 700; }
.pace-hi    { background: rgba(248,113,113,.12); color: #fca5a5; border: 1px solid rgba(248,113,113,.2); }
.pace-mid   { background: rgba(45,212,191,.10); color: #5eead4; border: 1px solid rgba(45,212,191,.2); }
.pace-slow  { background: rgba(52,211,153,.12); color: #6ee7b7; border: 1px solid rgba(52,211,153,.2); }

/* ── Rize コメントボックス ── */
.rize-comment { background: linear-gradient(135deg, #0c1f18, #111420); border: 1px solid rgba(45,212,191,.20); border-radius: 8px; padding: 8px 12px; margin: 4px 0 8px; font-size: .8rem; color: #cfe9e0; line-height: 1.55; }
.rize-avatar { font-size: .68rem; color: #2dd4bf; font-weight: 800; margin-bottom: 5px; display: block; letter-spacing: .05em; }
.rc-line { color: #c0ddd8; padding: 2px 0; }
.rc-line:not(:last-child) { border-bottom: 1px dashed rgba(45,212,191,.08); padding-bottom: 4px; margin-bottom: 4px; }

/* ── PICKS ── */
.picks-box { background: linear-gradient(135deg, #0a1c14, #0e1420); border: 1px solid rgba(45,212,191,.12); border-radius: 8px; padding: 6px 10px; margin: 4px 0 6px; }
.picks-title { color: #2dd4bf; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 3px; }
.pick-row    { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid rgba(45,212,191,.06); font-size: .88rem; }
.pick-row:last-child { border-bottom: none; }
.pick-idx    { color: #2dd4bf; font-weight: 800; min-width: 18px; font-family: 'Nunito', sans-serif; }
.pick-type   { color: #2dd4bf; font-size: .7rem; font-weight: 700; background: rgba(45,212,191,.10); padding: 1px 7px; border-radius: 20px; }
.pick-type-an{ color: #fb7185; font-size: .7rem; font-weight: 700; background: rgba(251,113,133,.10); padding: 1px 7px; border-radius: 20px; }
.pick-anchor { color: #e2f5f0; font-weight: 600; }
.pick-bomb   { color: #6ee7b7; font-weight: 600; }

/* ── 馬テーブル ── */
.htable-wrap { width: 100%; max-width: 100%; overflow-x: hidden; margin: 4px 0; }
@media (min-width: 768px) {
    .htable-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
.htable { width: 100%; max-width: 100%; border-collapse: collapse; font-size: .84rem; margin-top: 4px; }
@media (max-width: 767px) {
    .htable { table-layout: fixed; }
}
.htable th  { background: rgba(45,212,191,.08); color: #94c5b9; font-size: .73rem; padding: 6px 8px; text-align: center; border-bottom: 1px solid #2a3540; white-space: nowrap; font-weight: 700; }
.htable td  { padding: 6px 8px; text-align: center; border-bottom: 1px solid #1a2530; color: #b8d8d0; white-space: nowrap; }
.htable tr.row-honmei td { background: rgba(45,212,191,.06); }
.htable tr.row-dark   td { background: rgba(251,113,133,.05); }
.htable tr.row-top    td { background: rgba(52,211,153,.04); }
.htable th:nth-child(4), .htable td:nth-child(4),
.htable th:nth-child(5), .htable td:nth-child(5) {
    width: 40px; min-width: 40px; padding-left: 2px; padding-right: 2px;
}

/* ── AI指数バー ── */
.idx-wrap     { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.idx-num      { font-weight: 700; min-width: 22px; font-family: 'Nunito', sans-serif; }
.idx-bar-bg   { width: 64px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.05); display: inline-block; vertical-align: middle; overflow: hidden; }
.idx-bar-fill { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #0d9488, #2dd4bf, #6ee7b7); }
.rize-max-badge { font-size: .68rem; font-weight: 800; color: #0d0f14; background: linear-gradient(90deg, #f59e0b, #fbbf24, #fde68a); padding: 1px 6px; border-radius: 8px; white-space: nowrap; letter-spacing: .02em; }
.idx-num.idx-max { font-weight: 900; background: linear-gradient(90deg, #f59e0b, #fbbf24, #fde68a); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0 0 6px rgba(251,191,36,.4); padding: 1px 5px; border-radius: 6px; border: 1px solid rgba(251,191,36,.5); }
.spark-tag { color: #fbbf24; font-weight: 700; }
.combo-tag { color: #a78bfa; font-weight: 700; }

/* ── 重賞特集 ── */
.graded-section { margin: 6px 0 10px; padding: 8px 10px; background: linear-gradient(135deg, rgba(251,191,36,.08), rgba(45,212,191,.04)); border: 1px solid rgba(251,191,36,.20); border-radius: 10px; }
.graded-title { color: #fbbf24; font-weight: 800; font-size: .85rem; margin-bottom: 6px; letter-spacing: .03em; }
.graded-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; }
.graded-list::-webkit-scrollbar { height: 3px; }
.graded-list::-webkit-scrollbar-thumb { background: rgba(251,191,36,.30); border-radius: 2px; }
.graded-card { flex: 0 0 220px; scroll-snap-align: start; background: rgba(15,30,28,.6); border: 1px solid rgba(251,191,36,.25); border-radius: 8px; padding: 8px 10px; cursor: pointer; transition: border-color .15s; }
.graded-card:hover { border-color: rgba(251,191,36,.5); }
.graded-card .g-time { color: #fbbf24; font-family: 'Nunito',sans-serif; font-weight: 800; font-size: .82rem; }
.graded-card .g-name { color: #e2f5f0; font-weight: 800; font-size: .88rem; line-height: 1.2; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.graded-card .g-badge { font-size: .9rem; margin-left: 4px; }
.graded-card .g-info { font-size: .7rem; color: #94c5b9; margin-top: 2px; }
.graded-card .g-venue { color: #2dd4bf; font-weight: 700; font-family: 'Nunito',sans-serif; }
.graded-card .g-honmei { color: #5eead4; font-weight: 700; font-size: .75rem; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

[data-theme="light"] .graded-section { background: linear-gradient(135deg, rgba(217,119,6,.08), rgba(13,148,136,.04)); border-color: rgba(217,119,6,.25); }
[data-theme="light"] .graded-title { color: var(--gold2); }
[data-theme="light"] .graded-card { background: #ffffff; border-color: rgba(217,119,6,.25); }
[data-theme="light"] .graded-card .g-time { color: var(--gold2); }
[data-theme="light"] .graded-card .g-name { color: var(--text); }
[data-theme="light"] .graded-card .g-info { color: var(--text-dim); }
[data-theme="light"] .graded-card .g-venue { color: var(--accent); }
[data-theme="light"] .graded-card .g-honmei { color: var(--accent2); }

/* ── テーマトグル ── */
.theme-toggle { background: var(--accent-soft); border: 1px solid var(--border); border-radius: 50%; width: 30px; height: 30px; font-size: .85rem; cursor: pointer; color: var(--accent); padding: 0; line-height: 1; }
.theme-toggle:hover { background: var(--accent-strong); }

/* ── 会場タブ ── */
.venue-tabs { display: flex; gap: 3px; margin: 4px 0 6px; flex-wrap: wrap; }
.venue-tab { padding: 4px 10px; background: rgba(45,212,191,.05); border: 1px solid rgba(45,212,191,.18); border-radius: 16px; color: #94c5b9; font-size: .76rem; font-weight: 700; cursor: pointer; }
.venue-tab:hover { background: rgba(45,212,191,.12); color: #c8e8e0; }
.venue-tab.active { background: rgba(45,212,191,.18); color: #2dd4bf; border-color: rgba(45,212,191,.5); }

/* ── レースリンクボタン（コンパクト＋構造化） ── */
.race-link { display: flex; flex-direction: column; padding: 4px 8px; margin: 1px 0; background: rgba(45,212,191,.04); border: 1px solid rgba(45,212,191,.18); border-radius: 6px; color: #c8e8e0; font-size: .82rem; font-weight: 500; text-align: left; white-space: normal; cursor: pointer; transition: background .15s; line-height: 1.25; gap: 0; }
.race-link:hover { background: rgba(45,212,191,.10); border-color: rgba(45,212,191,.35); }
.race-link .rl-row1 { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.race-link .rl-rn { color: #2dd4bf; font-weight: 900; font-family: 'Nunito',sans-serif; min-width: 28px; font-size: .85rem; }
.race-link .rl-name { color: #f0fffa; font-weight: 700; font-size: .85rem; flex: 1 1 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-link .rl-badge { font-size: .95rem; margin-left: auto; }
.race-link .rl-conf { font-size: 1.0rem; padding: 0 4px; line-height: 1; }
.rl-conf-hot  { filter: drop-shadow(0 0 4px rgba(248,113,113,.6)); }
.rl-conf-warm { filter: drop-shadow(0 0 3px rgba(251,191,36,.4)); }
.rl-conf-mid  { filter: drop-shadow(0 0 2px rgba(45,212,191,.4)); }
.race-link .rl-row2 { display: flex; align-items: center; gap: 6px; font-size: .68rem; color: #b8d8d0; font-weight: 600; }
.race-link .rl-time { color: #2dd4bf; font-family: 'Nunito',sans-serif; font-weight: 800; }
.race-link .rl-honmei { color: #6ee7b7; font-weight: 800; }

/* ── 自信度+荒れ度バー ── */
.conf-bar { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 6px; align-items: center; }
.conf-pill, .upset-pill { color: #fff; font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 14px; white-space: nowrap; }

/* ── 警告ボックス ── */
.warn-box { background: rgba(248,113,113,.10); border: 1px solid rgba(248,113,113,.25); border-radius: 8px; padding: 4px 10px; color: #fca5a5; font-size: .72rem; margin: 4px 0 6px; }

/* ── 内訳 expander ── */
.bd-expander { background: linear-gradient(135deg, rgba(15,30,28,.5), rgba(15,20,30,.3)); border: 1px solid rgba(45,212,191,.15); border-radius: 8px; margin: 4px 0 8px; padding: 0 10px; }
.bd-expander summary { cursor: pointer; padding: 5px 0; font-size: .76rem; color: #5fc9b3; font-weight: 700; list-style: none; }
.bd-expander summary::before { content: "▶ "; font-size: .65rem; color: #2dd4bf; transition: transform .2s; }
.bd-expander[open] summary::before { content: "▼ "; }
.bd-body { padding: 4px 0 8px; font-size: .7rem; line-height: 1.7; color: #c0ddd8; }

/* ── form/rotation tag ── */
.ftag { display: inline-block; font-size: .62rem; font-weight: 700; padding: 1px 5px; border-radius: 10px; margin-left: 3px; vertical-align: middle; }
.ftag.ft-up    { background: rgba(52,211,153,.18); color: #6ee7b7; }
.ftag.ft-dn    { background: rgba(248,113,113,.18); color: #fca5a5; }
.ftag.ft-long  { background: rgba(251,191,36,.18); color: #fbbf24; }
.ftag.ft-short { background: rgba(96,165,250,.18); color: #93c5fd; }

/* ── 券種別買い目 (コンパクト) ── */
.bet-type-row { padding: 4px 0; border-bottom: 1px dashed rgba(45,212,191,.08); }
.bet-type-row:last-child { border-bottom: none; }
.bet-type-head { display: flex; gap: 6px; align-items: center; margin-bottom: 2px; flex-wrap: wrap; }
.bet-type-label { color: #2dd4bf; font-weight: 800; font-size: .8rem; }
/* 券種別カラー差別化 (scannability向上): mint→green→teal→gold→red */
.bet-type-row[data-bt="単勝"]   .bet-type-label { color: #5eead4; }  /* mint */
.bet-type-row[data-bt="馬連"]   .bet-type-label { color: #34d399; }  /* green */
.bet-type-row[data-bt="ワイド"] .bet-type-label { color: #6ee7b7; }  /* teal-soft */
.bet-type-row[data-bt="三連複"] .bet-type-label { color: #fbbf24; }  /* gold */
.bet-type-row[data-bt="三連単"] .bet-type-label { color: #f87171; }  /* red */
.bet-type-pts { color: #fbbf24; font-weight: 800; font-size: .68rem; font-family: 'Nunito',sans-serif; background: rgba(251,191,36,.10); padding: 1px 6px; border-radius: 8px; }
.bet-type-note { color: #94c5b9; font-size: .65rem; font-weight: 700; background: rgba(45,212,191,.05); padding: 1px 6px; border-radius: 8px; }
.bet-formation { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 2px 0; line-height: 1.5; }
.num-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 4px; background: rgba(45,212,191,.12); border: 1px solid rgba(45,212,191,.28); border-radius: 5px; color: #e2f5f0; font-weight: 800; font-size: .76rem; font-family: 'Nunito','Noto Sans JP',sans-serif; }
.bet-sep { color: #5fc9b3; font-weight: 800; font-size: .8rem; padding: 0 2px; font-family: 'Nunito',sans-serif; }
.bet-combo-pill { display: inline-block; background: rgba(45,212,191,.06); border: 1px solid rgba(45,212,191,.18); color: #e2f5f0; font-weight: 800; font-size: .72rem; padding: 2px 6px; border-radius: 6px; font-family: 'Nunito','Noto Sans JP',sans-serif; }
.picks-box { padding: 8px 12px; }
.picks-title { font-size: .68rem; margin-bottom: 4px; }

/* ── 分析ヒートマップ ── */
.heat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 4px 0 14px; }
.heat-cell { background: rgba(15,30,28,.5); border-radius: 10px; padding: 10px 8px; text-align: center; transition: transform .15s; cursor: pointer; }
.heat-cell:hover { transform: translateY(-1px); }
.heat-cell.h-hot  { background: linear-gradient(135deg, rgba(45,212,191,.35), rgba(45,212,191,.12)); border: 1px solid rgba(45,212,191,.5); }
.heat-cell.h-warm { background: linear-gradient(135deg, rgba(45,212,191,.20), rgba(45,212,191,.06)); border: 1px solid rgba(45,212,191,.3); }
.heat-cell.h-mid  { background: rgba(96,165,250,.06); border: 1px solid rgba(96,165,250,.18); }
.heat-cell.h-cool { background: rgba(248,113,113,.06); border: 1px solid rgba(248,113,113,.18); }
.hc-label { color: #e2f5f0; font-weight: 700; font-size: .82rem; }
.hc-roi   { color: #2dd4bf; font-weight: 800; font-family: 'Nunito',sans-serif; font-size: 1.2rem; margin: 2px 0; }
.heat-cell.h-cool .hc-roi { color: #fca5a5; }
.hc-bar   { width: 100%; height: 3px; background: rgba(255,255,255,.05); border-radius: 2px; overflow: hidden; margin: 2px 0; }
.hc-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #0d9488, #2dd4bf, #6ee7b7); }
.hc-n     { font-size: .65rem; color: #94c5b9; }

/* ── 分布バー ── */
.dist-bar { padding: 8px 0; }
.dist-row { display: grid; grid-template-columns: 40px 1fr 60px; gap: 10px; align-items: center; margin: 4px 0; }
.dist-label { color: #2dd4bf; font-weight: 700; }
.dist-bar-bg { background: rgba(45,212,191,.05); border-radius: 4px; overflow: hidden; height: 14px; }
.dist-fill { display: block; height: 100%; background: linear-gradient(90deg, #0d9488, #2dd4bf); }
.dist-val { color: #94c5b9; font-size: .78rem; text-align: right; font-family: 'Nunito',sans-serif; }

/* ── 本命カード (円形ゲージ + 馬情報) ── */
.honmei-card { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, rgba(45,212,191,.10), rgba(45,212,191,.02)); border: 1px solid rgba(45,212,191,.30); border-radius: 10px; padding: 6px 10px; margin: 4px 0 8px; }
.honmei-gauge { position: relative; flex: 0 0 auto; text-align: center; }
.honmei-gauge svg { display: block; width: 60px; height: 60px; }
.honmei-gauge .hg-text { fill: #2dd4bf; font-family: 'Nunito',sans-serif; font-weight: 800; font-size: 28px; }
.honmei-gauge .ag-std  { stroke: #5fc9b3; }
.honmei-gauge .ag-grn  { stroke: #34d399; }
.honmei-gauge .ag-mint { stroke: #2dd4bf; }
.honmei-gauge .ag-gold { stroke: url(#goldGrad); }
.honmei-gauge .hg-label { font-size: .55rem; color: #94c5b9; font-weight: 700; margin-top: -4px; letter-spacing: .08em; }
.honmei-info { flex: 1 1 0; min-width: 0; }
.honmei-info .hi-mark { color: #2dd4bf; font-weight: 800; font-size: .65rem; letter-spacing: .15em; }
.honmei-info .hi-name { color: #e2f5f0; font-weight: 800; font-size: .9rem; margin: 0 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.honmei-info .hi-name b { color: #ffffff; }
.honmei-info .hi-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: .68rem; color: #94c5b9; }
.honmei-info .hi-odds { color: #fbbf24; font-weight: 700; font-family: 'Nunito',sans-serif; }
.honmei-info .hi-ml { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.honmei-info .hi-ml-pill { background: rgba(45,212,191,.18); color: #2dd4bf; font-size: .62rem; font-weight: 700; padding: 1px 6px; border-radius: 10px; }
.honmei-info .hi-ml-p3 { background: rgba(110,231,183,.18); color: #6ee7b7; }
@media (max-width: 480px) {
    .honmei-card { gap: 12px; padding: 10px 10px; }
    .honmei-gauge svg { width: 78px; height: 78px; }
    .honmei-info .hi-name { font-size: .95rem; }
}

/* ── おすすめ横スクロールカード ── */
.rec-section { margin: 6px 0 12px; }
.rec-title { font-size: .82rem; font-weight: 800; color: #2dd4bf; padding: 0 4px 6px; letter-spacing: .04em; }
.rec-scroll { display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; padding: 4px 4px 10px; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; }
.rec-scroll::-webkit-scrollbar { height: 4px; }
.rec-scroll::-webkit-scrollbar-track { background: rgba(45,212,191,.04); border-radius: 4px; }
.rec-scroll::-webkit-scrollbar-thumb { background: rgba(45,212,191,.3); border-radius: 4px; }
.rec-card { flex: 0 0 200px; scroll-snap-align: start; background: linear-gradient(135deg, #0c1f18, #0e1420); border: 1px solid rgba(45,212,191,.25); border-radius: 12px; padding: 10px 12px; cursor: pointer; transition: transform .15s, border-color .15s; position: relative; min-height: 122px; display: flex; flex-direction: column; gap: 3px; }
.rec-card:hover { transform: translateY(-2px); border-color: rgba(45,212,191,.5); }
.rec-card .rec-badge { position: absolute; top: 8px; right: 10px; font-size: 1.1rem; }
.rec-card .rec-vr { color: #2dd4bf; font-weight: 800; font-family: 'Nunito',sans-serif; font-size: .85rem; letter-spacing: .03em; }
.rec-card .rec-name { color: #e2f5f0; font-weight: 700; font-size: .82rem; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2em; }
.rec-card .rec-honmei { color: #5eead4; font-weight: 700; font-size: .76rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-card .rec-bottom { display: flex; justify-content: space-between; margin-top: auto; padding-top: 6px; border-top: 1px solid rgba(45,212,191,.10); }
.rec-card .rec-ai { color: #fbbf24; font-weight: 800; font-family: 'Nunito',sans-serif; font-size: .82rem; }
.rec-card .rec-conf { color: #94c5b9; font-weight: 700; font-size: .72rem; background: rgba(45,212,191,.10); padding: 1px 7px; border-radius: 12px; }

/* ── ROIチャート ── */
.chart-wrap { background: linear-gradient(135deg, rgba(15,30,28,.5), rgba(15,20,30,.3)); border: 1px solid rgba(45,212,191,.18); border-radius: 12px; padding: 8px; margin: 6px 0 12px; overflow-x: auto; }
.chart-wrap svg { width: 100%; height: auto; max-width: 700px; display: block; }

/* ── 戻るバー / 共有ボタン / 前後ナビ ── */
.back-bar { display: flex; gap: 6px; margin: 4px 0 2px; }
.back-bar .nav-btn { background: rgba(45,212,191,.10); border: 1px solid rgba(45,212,191,.30); color: #5eead4; font-weight: 700; padding: 4px 8px; font-size: .72rem; }
.share-btn { background: linear-gradient(90deg, rgba(45,212,191,.20), rgba(45,212,191,.08)) !important; color: #2dd4bf !important; border-color: rgba(45,212,191,.4) !important; font-weight: 800 !important; }
.share-btn:hover { background: linear-gradient(90deg, rgba(45,212,191,.32), rgba(45,212,191,.16)) !important; }

.race-nav-row { display: flex; gap: 4px; margin: 0 0 6px; }
.race-nav-row .nav-btn { flex: 1; padding: 4px 8px; background: rgba(45,212,191,.06); border: 1px solid rgba(45,212,191,.22); color: #b8d8d0; font-size: .68rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-nav-row .nav-btn:hover { background: rgba(45,212,191,.16); color: #e2f5f0; }
.race-nav-prev { text-align: left; }
.race-nav-next { text-align: right; }

/* ── 馬カード (モバイル) — コンパクト ── */
.horse-cards { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 8px; }
.horse-card { background: rgba(15,30,28,.45); border: 1px solid rgba(45,212,191,.12); border-radius: 6px; padding: 4px 8px; cursor: pointer; transition: background .15s; }
.horse-card:active { background: rgba(15,30,28,.7); }
.horse-card.hc-honmei  { background: linear-gradient(90deg, rgba(45,212,191,.16), rgba(15,30,28,.45)); border-color: rgba(45,212,191,.45); }
.horse-card.hc-dark    { background: linear-gradient(90deg, rgba(251,191,36,.10), rgba(15,30,28,.45)); border-color: rgba(251,191,36,.30); }
.horse-card.hc-taikou  { border-color: rgba(110,231,183,.30); }
.horse-card.hc-tanpuku { border-color: rgba(167,243,208,.22); }

/* 1段目: 印18 / 馬番22 / 馬名 / オッズ / AI */
.horse-card .hc-top { display: grid; grid-template-columns: 18px 22px 1fr auto auto; gap: 4px; align-items: center; }
.horse-card .hc-odds-inline { color: #fbbf24; font-weight: 800; font-family: 'Nunito',sans-serif; font-size: .76rem; }

/* ── 検索 + フィルタ行 ── */
.filter-row { display: flex; gap: 6px; margin: 4px 0 6px; align-items: center; flex-wrap: wrap; }
.search-input { flex: 1 1 200px; min-width: 0; padding: 6px 12px; background: rgba(15,30,28,.5); border: 1px solid rgba(45,212,191,.25); border-radius: 8px; color: #e2f5f0; font-size: .82rem; font-family: 'Noto Sans JP',sans-serif; }
.search-input::placeholder { color: #5a7a70; }
.search-input:focus { outline: none; border-color: rgba(45,212,191,.5); background: rgba(15,30,28,.7); }
.filter-row .filter-toggle { flex: 0 0 auto; margin: 0; }

/* ── お気に入りタブ ── */
.fav-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.fav-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(15,30,28,.5); border: 1px solid rgba(45,212,191,.20); border-radius: 8px; }
.fav-item .fi-star { color: #fbbf24; font-size: 1.1rem; }
.fav-item .fi-name { flex: 1 1 0; color: #e2f5f0; font-weight: 700; font-size: .92rem; }
.fav-item .fi-id { color: #94c5b9; font-size: .68rem; font-family: monospace; }
.fav-item .fi-rm { color: #f87171; font-size: .8rem; cursor: pointer; padding: 4px 8px; border-radius: 6px; background: rgba(248,113,113,.10); border: 1px solid rgba(248,113,113,.20); }
.horse-card .hc-mark { font-weight: 800; text-align: center; font-size: .82rem; }
.horse-card .hc-num { font-family: 'Nunito',sans-serif; font-weight: 900; font-size: .88rem; color: #e2f5f0; text-align: center; }
.horse-card .hc-name { color: #f0fffa; font-weight: 800; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.horse-card .hc-ai { font-family: 'Nunito',sans-serif; font-weight: 800; font-size: .92rem; color: #2dd4bf; min-width: 24px; text-align: right; }
.horse-card .hc-ai-max { font-weight: 900; background: linear-gradient(90deg, #f59e0b, #fbbf24, #fde68a); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0 0 4px rgba(251,191,36,.4); padding: 0 3px; }

/* 2段目: 騎手 / 脚質枠 / 人気 / pill — 一行詰め込み */
.horse-card .hc-mid { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px; font-size: .74rem; color: #c0ddd8; margin-top: 3px; padding-left: 28px; line-height: 1.35; }
.horse-card .hc-jockey { color: #d2ece6; font-weight: 700; }
.horse-card .hc-style, .horse-card .hc-frame, .horse-card .hc-pop { color: #9fc4bb; font-weight: 600; }
.horse-card .hc-ml-pill { background: rgba(45,212,191,.18); color: #5eead4; font-size: .68rem; font-weight: 700; padding: 1px 8px; border-radius: 8px; flex: 0 0 auto; }
.horse-card .hc-p3-pill { background: rgba(110,231,183,.18); color: #8ef0c4; font-size: .68rem; font-weight: 700; padding: 1px 8px; border-radius: 8px; flex: 0 0 auto; }
.horse-card .hc-db-bit { font-size: .55rem; color: #94c5b9; font-weight: 600; flex: 0 0 auto; }
.horse-card .horse-detail-inline { margin-top: 4px; padding-top: 4px; border-top: 1px dashed rgba(45,212,191,.15); }
.horse-card .hc-wt { font-size: .53rem; font-weight: 700; padding: 0 4px; border-radius: 5px; flex: 0 0 auto; }
.horse-card .hc-wt-up   { background: rgba(248,113,113,.15); color: #fca5a5; }
.horse-card .hc-wt-down { background: rgba(96,165,250,.15); color: #93c5fd; }
.horse-card .hc-wt-flat { background: rgba(148,197,185,.12); color: #94c5b9; }

/* ── 馬の詳細展開 ── */
.horse-detail-row td { padding: 10px 14px !important; background: rgba(15,30,28,.7) !important; border-bottom: 2px solid #1a2530 !important; }
.htable tr.horse-detail-row:hover td { background: rgba(15,30,28,.85) !important; }
.htable tbody tr:not(.horse-detail-row):hover td { background: rgba(45,212,191,.04); }
.horse-mini { font-size: .76rem; color: #c0ddd8; }
.hm-section { margin-bottom: 8px; }
.hm-section b { color: #5fc9b3; }
.mini-past { width: 100%; margin: 4px 0; font-size: .72rem; }
.mini-past th { font-size: .65rem; color: #94c5b9; padding: 3px 6px; text-align: left; }
.mini-past td { padding: 3px 6px; color: #b8d8d0; }
.hm-bd { padding: 4px 0; font-size: .72rem; line-height: 1.7; }

/* ── 類似レース統計ボックス ── */
.similar-box { margin: 12px 0; padding: 10px 14px; background: rgba(15,30,28,.6); border: 1px solid rgba(45,212,191,.18); border-radius: 10px; font-size: .78rem; color: #cfe9e0; line-height: 1.5; }
.similar-tops { margin-top: 6px; font-size: .74rem; color: #94c5b9; }

/* ── 印 ── */
.mark-honmei { color: #2dd4bf; font-weight: 800; font-size: .95rem; }
.mark-taikou { color: #6ee7b7; font-weight: 700; }
.mark-tanpuku{ color: #a7f3d0; font-weight: 700; }
.mark-dark   { color: #fbbf24; font-weight: 800; font-size: .9rem; }
.mark-sub    { color: #4ade80; font-weight: 600; }

/* ── カラー ── */
.c-mint  { color: #2dd4bf; font-weight: 700; }
.c-grn   { color: #34d399; font-weight: 700; }
.c-pink  { color: #fb7185; font-weight: 700; }
.c-dim   { color: #7fa89c; }
.c-std   { color: #a8d4c8; }

/* ── DB統計ラベル ── */
.db-stat { font-size: .72rem; color: #94c5b9; white-space: nowrap; font-weight: 600; }
.db-text { display: inline; }

/* ── 枠バッジ ── */
.fb     { font-size: .7rem; padding: 1px 6px; border-radius: 20px; }
.fb-in  { background: rgba(45,212,191,.12); color: #2dd4bf; }
.fb-ok  { background: rgba(96,165,250,.09); color: #93c5fd; }
.fb-ng  { background: rgba(248,113,113,.09); color: #fca5a5; }

/* ── インフォボックス ── */
.wait-box   { background: rgba(45,212,191,.08); border: 1px solid rgba(45,212,191,.20); border-radius: 12px; padding: 12px 16px; color: #94c5b9; font-size: .9rem; margin: 8px 0; font-weight: 600; }
.nodata-box { background: rgba(15,20,30,.6); border: 1px solid rgba(45,212,191,.12); border-radius: 12px; padding: 12px 16px; color: #a8d4c8; font-size: .85rem; margin: 8px 0; font-weight: 600; }

/* ── 収支カード ── */
.bk-card  { background: linear-gradient(135deg, #0c1f18, #0f1520); border: 1px solid #1a2a22; border-top: 2px solid rgba(45,212,191,.4); border-radius: 12px; padding: 14px 18px; text-align: center; }
.bk-label { font-size: .65rem; color: #b8d8d0; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; font-weight: 700; }
.bk-val   { font-size: 1.45rem; font-weight: 700; line-height: 1.1; font-family: 'Nunito', sans-serif; color: #e2f5f0; }
.bk-pos   { color: #34d399; }
.bk-neg   { color: #f87171; }
.bk-neu   { color: #1e3a30; }

/* ── 一般テーブル ── */
.mk-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.mk-table th { background: rgba(45,212,191,.08); color: #94c5b9; padding: 7px 10px; border-bottom: 1px solid #2a3540; text-align: right; white-space: nowrap; font-weight: 700; font-size: .76rem; }
.mk-table th:first-child { text-align: left; }
.mk-table td { padding: 7px 10px; border-bottom: 1px solid #1a2530; color: #c0ddd8; text-align: right; white-space: nowrap; }
.mk-table td:first-child { text-align: left; color: #a8d4c8; font-weight: 600; }
.mk-table td.pos { color: #34d399; }
.mk-table td.neg { color: #f87171; }
.mk-table tr:hover td { background: rgba(45,212,191,.025); }

/* ── 4列メトリクスgrid ── */
.metric-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 12px; width: 100%; }
.metric-grid-4 .bk-card { padding: 12px 6px; }

/* ── ナビゲーションバー ── */
.nav-bar { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 4px; align-items: center; justify-content: space-between; margin: 2px 0 6px; }
.nav-btn { flex: 0 0 auto; padding: 4px 8px; border-radius: 6px; background: rgba(45,212,191,.08); border: 1px solid rgba(45,212,191,.25); color: #2dd4bf; font-size: .74rem; font-weight: 700; white-space: nowrap; cursor: pointer; text-align: center; }
.nav-btn:hover { background: rgba(45,212,191,.18); }
.nav-btn-disabled { opacity: .25; pointer-events: none; }
.nav-current { flex: 1 1 0; text-align: center; font-weight: 800; font-size: .85rem; color: #2dd4bf; padding: 4px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── セクションタイトル ── */
.sec-title { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 800; color: #5fe0c4; margin: 8px 0 4px; padding: 4px 10px; background: linear-gradient(90deg, rgba(45,212,191,.16), transparent); border-left: 3px solid #2dd4bf; border-radius: 0 6px 6px 0; }
.sec-sub { color: #b8d8d0; font-size: .68rem; font-weight: 700; margin-left: auto; }

/* ── ランキングリスト ── */
.rank-list { list-style: none; padding: 0; margin: 4px 0 10px; }
.rank-row { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; padding: 5px 8px; margin: 3px 0; background: rgba(15,30,25,.4); border-radius: 6px; border-left: 2px solid #2dd4bf; }
.rank-row:hover { background: rgba(45,212,191,.06); }
.rank-num { font-weight: 800; font-size: .95rem; color: #2dd4bf; text-align: center; line-height: 1; }
.rank-num.gold { color: #fbbf24; } .rank-num.silver { color: #d6d3d1; } .rank-num.bronze { color: #f97316; }
.rank-info { font-size: .72rem; color: #c0ddd8; line-height: 1.25; }
.rank-info b { color: #e2f5f0; font-weight: 700; }
.rank-payout { color: #fbbf24; font-weight: 800; font-size: .82rem; white-space: nowrap; }

/* ── ミニ統計バッジ ── */
.stat-pill { display: inline-block; padding: 4px 10px; margin: 2px 4px 2px 0; background: rgba(45,212,191,.08); border-radius: 16px; color: #2dd4bf; font-size: .75rem; font-weight: 700; }
.stat-pill.warn { background: rgba(248,113,113,.08); color: #f87171; }

hr { border: 0; border-top: 1px solid #1a2530; margin: 12px 0; }

/* ── レース品質バナー ── */
.race-qual-banner { padding: 8px 14px; border-radius: 8px; margin: 8px 0; font-size: .82rem; }
.rqb-high { background: linear-gradient(90deg, rgba(45,212,191,.18), rgba(45,212,191,.05)); border-left: 3px solid #2dd4bf; color: #2dd4bf; }
.rqb-mid  { background: linear-gradient(90deg, rgba(96,165,250,.12), transparent); border-left: 3px solid #60a5fa; color: #60a5fa; }
.rqb-low  { background: linear-gradient(90deg, rgba(248,113,113,.10), transparent); border-left: 3px solid #f87171; color: #fca5a5; }

/* ══ Mobile (767px以下) ══════════════════════════════════ */
@media screen and (max-width: 767px) {
    body { font-size: 14px; }
    .app { padding: 8px 6px 80px; }
    .rz-logo  { font-size: 1.35rem; }
    .rz-catch { font-size: .58rem; }
    .rz-meta  { font-size: .58rem; margin-top: 2px; }
    .roi-wrap { padding: 5px 8px; min-width: 56px; border-radius: 8px; }
    .roi-val  { font-size: 1.05rem; }
    .roi-label{ font-size: .5rem; }
    .tabs .tab { font-size: .82rem; padding: 10px 4px; }
    .metric-grid-4 { gap: 3px; }
    .metric-grid-4 .bk-card { padding: 8px 3px; border-radius: 8px; }
    .metric-grid-4 .bk-val  { font-size: .85rem; font-weight: 800; }
    .metric-grid-4 .bk-label{ font-size: .5rem; letter-spacing: .03em; font-weight: 700; }

    /* 馬テーブル: スマホは 印 馬番 馬名 AI 単勝 人気 だけ表示 (横スクなし) */
    .htable th:nth-child(5),  .htable td:nth-child(5),  /* ML */
    .htable th:nth-child(8),  .htable td:nth-child(8),  /* 脚質 */
    .htable th:nth-child(9),  .htable td:nth-child(9),  /* 枠 */
    .htable th:nth-child(10), .htable td:nth-child(10), /* 騎手 */
    .htable th:nth-child(11), .htable td:nth-child(11)  /* 過去DB */ { display: none; }
    .htable th:nth-child(4), .htable td:nth-child(4) { width: 38px; min-width: 38px; padding: 4px 1px; }
    /* AI指数バーは非表示、数字のみ */
    .htable .idx-bar-bg { display: none; }
    .htable .idx-wrap { gap: 0; }
    .htable .idx-num { min-width: 28px; }
    .htable          { font-size: .76rem; table-layout: fixed; width: 100%; }
    .htable th       { padding: 3px 2px; font-size: .64rem; }
    .htable td       { padding: 4px 2px; }
    .htable th:nth-child(1), .htable td:nth-child(1) { width: 22px; padding: 4px 0; }     /* 印 */
    .htable th:nth-child(2), .htable td:nth-child(2) { width: 24px; font-weight: 800; padding: 4px 0; }  /* 馬番 */
    .htable th:nth-child(3), .htable td:nth-child(3) { width: auto; white-space: normal !important; word-break: break-all; overflow-wrap: anywhere; font-size: .76rem; padding: 4px 4px; text-align: left !important; line-height: 1.2; font-weight: 700; overflow: hidden; max-width: 100%; }  /* 馬名 */
    .htable th:nth-child(6), .htable td:nth-child(6) { width: 38px; font-weight: 700; padding: 4px 1px; }  /* 単勝 */
    .htable th:nth-child(7), .htable td:nth-child(7) { width: 38px; padding: 4px 1px; font-size: .68rem; }  /* 人気 */
    .ftag { font-size: .52rem; padding: 0 3px; margin-left: 1px; }
    .popsuf { display: none; }
    .race-hdr      { padding: 8px 10px; gap: 3px; margin: 14px 0 4px; }
    .race-hdr-num  { font-size: .95rem; }
    .race-hdr-name { font-size: .9rem; }
    .race-hdr-info { font-size: .7rem; }
    .pace-badge { font-size: .68rem; padding: 2px 7px; }
    .race-qual-banner { padding: 8px 10px; border-radius: 8px; }
    .rize-comment  { font-size: .76rem; padding: 8px 10px; border-radius: 8px; }
    .rize-avatar   { font-size: .65rem; }
    .picks-box  { padding: 8px 10px; border-radius: 10px; }
    .picks-title{ font-size: .65rem; margin-bottom: 5px; }
    .pick-row   { font-size: .78rem; gap: 6px; padding: 4px 0; }
    .pick-type, .pick-type-an { font-size: .62rem; padding: 1px 5px; }
    .track-bar { padding: 4px 10px; font-size: .76rem; gap: 10px; border-radius: 14px; }
    .db-badge { font-size: .6rem; }
    .db-stat  { font-size: .62rem; }
    .mk-table          { font-size: .72rem; }
    .mk-table th,
    .mk-table td       { padding: 4px 5px; }
    .sec-title { font-size: .95rem; padding: 6px 10px; margin: 12px 0 8px; }
    .sec-sub   { display: none; }
    .rank-row { grid-template-columns: 22px 1fr auto; padding: 4px 7px; gap: 6px; }
    .rank-num { font-size: .9rem; }
    .rank-info { font-size: .75rem; }
    .rank-payout { font-size: .82rem; }
    .nav-btn { font-size: .72rem; padding: 6px 8px; }
    .nav-current { font-size: .85rem; }
    .fb { font-size: .62rem; padding: 1px 4px; }
}

.rz-logo { display: inline-flex; align-items: center; gap: 8px; }
.hdr-btn { background: var(--accent-soft); border: 1px solid var(--border); border-radius: 50%; width: 34px; height: 34px; font-size: .95rem; cursor: pointer; color: var(--accent); padding: 0; line-height: 1; margin-left: 4px; -webkit-tap-highlight-color: transparent; touch-action: manipulation; position: relative; z-index: 10; }
.hdr-btn:hover { background: var(--accent-strong); }
.hdr-btn:disabled { opacity: .6; cursor: wait; }
.hdr-btn.spin { animation: hdr-spin .9s linear infinite; }
@keyframes hdr-spin { from {transform: rotate(0)} to {transform: rotate(360deg)} }

/* 直近◎本命ピル */
.rh-wrap { margin: 4px 0 10px; }
.rh-head { font-size: .75rem; color: var(--muted); margin-bottom: 4px; padding-left: 2px; }
.rh-scroll { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.rh-pill { flex: 0 0 auto; display: flex; flex-direction: column; gap: 2px; padding: 6px 9px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); font-size: .72rem; line-height: 1.15; cursor: pointer; min-width: 92px; }
.rh-pill:hover { border-color: var(--accent); }
.rh-pill.rh-hit { border-color: var(--accent); background: var(--accent-soft); }
.rh-pill.rh-miss { opacity: .7; }
.rh-pill .rh-v { font-weight: 700; color: var(--fg); }
.rh-pill .rh-h { color: var(--muted); font-size: .68rem; }
.rh-pill .rh-r { font-weight: 700; color: var(--accent); font-size: .72rem; }
.rh-pill.rh-miss .rh-r { color: var(--muted); }

/* ⭐穴推奨バナー (2026-05-16) */
.dark-banner {
    background: linear-gradient(90deg, rgba(251,191,36,.18), rgba(251,191,36,.04));
    border: 1px solid rgba(251,191,36,.4);
    border-radius: 8px;
    padding: 8px 12px;
    margin: 6px 0 10px;
    font-size: .82rem;
    color: #fbbf24;
}
.dark-banner b { color: #fff9c4; }
[data-theme="light"] .dark-banner { background: linear-gradient(90deg, rgba(180,83,9,.10), rgba(180,83,9,.03)); border-color: rgba(180,83,9,.3); color: #92400e; }
[data-theme="light"] .dark-banner b { color: #78350f; }

/* ══════════════════════════════════════════════════════════════
   会員認証 / ゲート / 着順 / やるべきTOP5  (2026-06-02)
   ══════════════════════════════════════════════════════════════ */

/* ── ヘッダーのログインボタン ── */
#rz-auth { display: flex; }
.auth-btn {
    background: rgba(45,212,191,.10); border: 1px solid rgba(45,212,191,.35);
    color: #5eead4; font-weight: 700; font-size: .72rem; padding: 4px 10px;
    border-radius: 16px; cursor: pointer; white-space: nowrap;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.auth-btn:hover { background: rgba(45,212,191,.2); color: #e2f5f0; }

/* ── ログインモーダル ── */
.login-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.62);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 16px; backdrop-filter: blur(2px);
}
.login-modal-body {
    position: relative; width: 100%; max-width: 360px;
    background: linear-gradient(135deg, #0f2620, #111827);
    border: 1px solid rgba(45,212,191,.3); border-radius: 16px;
    padding: 22px 20px 18px;
    box-shadow: 0 16px 50px rgba(0,0,0,.5);
}
.lm-close {
    position: absolute; top: 8px; right: 10px; background: none; border: none;
    color: #94c5b9; font-size: 1.5rem; cursor: pointer; line-height: 1;
}
.lm-title { font-size: 1.1rem; font-weight: 800; color: #2dd4bf; margin-bottom: 14px; text-align: center; }
.lm-input {
    width: 100%; box-sizing: border-box; margin-bottom: 10px; padding: 11px 13px;
    background: rgba(15,30,28,.6); border: 1px solid rgba(45,212,191,.25);
    border-radius: 9px; color: #e2f5f0; font-size: .92rem;
    font-family: 'Noto Sans JP', sans-serif;
}
.lm-input:focus { outline: none; border-color: rgba(45,212,191,.55); background: rgba(15,30,28,.85); }
.lm-input::placeholder { color: #5a7a70; }
.lm-submit {
    width: 100%; padding: 12px; margin-top: 2px;
    background: linear-gradient(120deg, #2dd4bf, #34d399); color: #06211a;
    border: none; border-radius: 9px; font-size: .95rem; font-weight: 800;
    cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.lm-submit:hover { filter: brightness(1.06); }
.lm-submit:disabled { opacity: .65; cursor: wait; }
.lm-err {
    background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.35);
    color: #fca5a5; border-radius: 8px; padding: 8px 11px; font-size: .8rem; margin-bottom: 10px;
}
.lm-sub { text-align: center; margin-top: 12px; font-size: .76rem; color: #94c5b9; }
.lm-sub a, .pg-sub a { color: #2dd4bf; font-weight: 700; }

/* ── 🔒 プレミアム限定 CTA ── */
.premium-gate {
    background: linear-gradient(135deg, rgba(45,212,191,.10), rgba(251,191,36,.05));
    border: 1px solid rgba(45,212,191,.3); border-radius: 14px;
    padding: 22px 18px; margin: 10px 0 12px; text-align: center;
}
.premium-gate .pg-icon { font-size: 2rem; line-height: 1; }
.premium-gate .pg-title { font-size: 1rem; font-weight: 800; color: #2dd4bf; margin: 8px 0 4px; }
.premium-gate .pg-desc { font-size: .82rem; color: #b8d8d0; margin-bottom: 14px; line-height: 1.5; }
.premium-gate .pg-btn {
    display: inline-block; padding: 11px 24px;
    background: linear-gradient(120deg, #fbbf24, #f59e0b); color: #3a2400;
    border: none; border-radius: 24px; font-size: .92rem; font-weight: 800;
    cursor: pointer; text-decoration: none;
    box-shadow: 0 6px 18px rgba(251,191,36,.25);
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.premium-gate .pg-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.premium-gate .pg-sub { margin-top: 12px; font-size: .76rem; color: #94c5b9; }
.login-gate { background: linear-gradient(135deg, rgba(45,212,191,.10), rgba(15,30,28,.4)); }

/* ── ロックされたセル / ゲージ ── */
.lock-cell { color: #fbbf24; font-size: .9rem; opacity: .85; }
.hc-ai-lock { color: #fbbf24 !important; font-size: .82rem; }
.locked-gauge {
    width: 100px; height: 100px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 4px;
}
.locked-gauge .lg-lock { font-size: 2rem; opacity: .8; }
.honmei-locked { opacity: .96; }

/* ── 着順バッジ + 行ハイライト (確定レース) ── */
.fin-badge {
    display: inline-block; font-size: .6rem; font-weight: 800; line-height: 1;
    padding: 2px 5px; border-radius: 5px; margin-right: 4px; vertical-align: middle;
}
.fin-badge.fin-1 { background: #fbbf24; color: #3a2400; }
.fin-badge.fin-2 { background: #cbd5e1; color: #1f2937; }
.fin-badge.fin-3 { background: #d6a06a; color: #2a1700; }
.htable tr.row-fin1 td { background: rgba(52,211,153,.20) !important; }
.htable tr.row-fin2 td { background: rgba(52,211,153,.12) !important; }
.htable tr.row-fin3 td { background: rgba(52,211,153,.07) !important; }
.horse-card.hc-fin1 { background: linear-gradient(90deg, rgba(52,211,153,.26), rgba(15,30,28,.45)) !important; border-color: rgba(52,211,153,.55) !important; }
.horse-card.hc-fin2 { background: linear-gradient(90deg, rgba(52,211,153,.16), rgba(15,30,28,.45)) !important; border-color: rgba(52,211,153,.4) !important; }
.horse-card.hc-fin3 { background: linear-gradient(90deg, rgba(52,211,153,.10), rgba(15,30,28,.45)) !important; border-color: rgba(52,211,153,.3) !important; }

/* ── やるべき TOP5 ── */
.top5-box {
    background: linear-gradient(135deg, rgba(45,212,191,.08), rgba(15,20,30,.3));
    border: 1px solid rgba(45,212,191,.22); border-radius: 10px;
    padding: 6px 8px; margin: 5px 0 8px;
}
.top5-head { font-size: .78rem; font-weight: 800; color: #2dd4bf; margin-bottom: 3px; padding-left: 2px; }
.top5-head .c-dim { font-size: .66rem; font-weight: 600; }
.top5-list { display: flex; flex-direction: column; gap: 1px; }
.top5-row {
    display: flex; align-items: center; gap: 7px;
    padding: 2px 8px; background: rgba(15,30,28,.4); border: 1px solid rgba(45,212,191,.10);
    border-radius: 6px; cursor: pointer; font-size: .74rem; line-height: 1.25;
}
.top5-row:hover { background: rgba(45,212,191,.1); border-color: rgba(45,212,191,.3); }
.top5-rank { flex: 0 0 16px; font-size: .86rem; font-weight: 800; font-family: 'Nunito', sans-serif; text-align: center; color: #94c5b9; }
.top5-rank-1 { color: #fbbf24; } .top5-rank-2 { color: #cbd5e1; } .top5-rank-3 { color: #d6a06a; }
.top5-vr { flex: 0 0 auto; font-weight: 800; color: #2dd4bf; font-family: 'Nunito', sans-serif; }
.top5-name { flex: 1 1 auto; min-width: 0; color: #9fc4bb; font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top5-honmei { flex: 0 1 auto; min-width: 0; color: #5eead4; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top5-locked { color: #fbbf24; flex: 0 0 auto; }
.top5-conf { flex: 0 0 auto; font-weight: 800; color: #34d399; font-family: 'Nunito', sans-serif; background: rgba(52,211,153,.12); padding: 0 7px; border-radius: 8px; font-size: .76rem; }
.rl-pending { font-size: .72rem; color: #94c5b9 !important; }
.rl-locked { font-size: .74rem; color: #fbbf24 !important; font-weight: 700; }

/* ── WIN5 予想セクション ── */
.win5-box { background: linear-gradient(135deg, rgba(96,165,250,.08), rgba(15,20,30,.3)); border: 1px solid rgba(96,165,250,.25); border-radius: 10px; padding: 5px 8px; margin: 4px 0 7px; }
.win5-head { font-size: .78rem; font-weight: 800; color: #60a5fa; margin-bottom: 3px; padding-left: 2px; }
.win5-head .c-dim { font-size: .68rem; font-weight: 600; }
.win5-note, .top5-note { font-size: .76rem; color: #b8d8d0; line-height: 1.5; padding: 2px; }
.win5-note b { color: #60a5fa; }
.win5-list { display: flex; flex-direction: column; gap: 2px; }
.win5-row { display: flex; align-items: center; gap: 7px; padding: 3px 8px; background: rgba(15,30,28,.4); border: 1px solid rgba(96,165,250,.12); border-radius: 7px; cursor: pointer; }
.win5-row:hover { background: rgba(96,165,250,.1); }
.win5-leg { flex: 0 0 20px; text-align: center; font-weight: 800; color: #60a5fa; font-family: 'Nunito',sans-serif; }
.win5-vr { flex: 0 0 auto; font-weight: 800; color: #93c5fd; font-family: 'Nunito',sans-serif; font-size: .8rem; }
.win5-rname { flex: 1 1 auto; min-width: 0; color: #c8e8e0; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win5-picks { flex: 0 0 auto; display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; max-width: 46%; }
.win5-lock { color: #fbbf24; font-size: .72rem; font-weight: 700; }
[data-theme="light"] .win5-row { background: rgba(37,99,235,.05); }

/* ── ⑥ ROIバッジ: 0%でも視認可能に (旧 roi-neu は背景同化で不可視だった) ── */
.roi-neu { color: #94c5b9; }
#rz-roi { display: block; }

/* ── モバイル: ROIバッジ・TOP5 を確実に表示 ── */
@media screen and (max-width: 767px) {
    #rz-header-right { flex-direction: row; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
    #rz-roi { display: block !important; }
    .roi-wrap { display: inline-block !important; }
    .auth-btn { font-size: .66rem; padding: 4px 8px; }
    .top5-box, .win5-box { display: block !important; }
    .top5-row { gap: 6px; padding: 4px 7px; }
    .top5-rank { flex-basis: 14px; }
    .top5-name { display: none; }   /* 狭い画面は 会場R + ◎ + 自信度 のみでコンパクトに */
    .win5-rname { font-size: .74rem; }
    .login-modal-body { max-width: 100%; }
    .premium-gate { padding: 18px 14px; }
}

/* ── ライトテーマ調整 ── */
[data-theme="light"] .login-modal-body { background: linear-gradient(135deg, #ffffff, #f0fbf8); border-color: rgba(13,148,136,.3); }
[data-theme="light"] .lm-input { background: #f7faf9; color: #0f2620; border-color: rgba(13,148,136,.25); }
[data-theme="light"] .premium-gate { background: linear-gradient(135deg, rgba(13,148,136,.08), rgba(217,119,6,.05)); border-color: rgba(13,148,136,.3); }
[data-theme="light"] .top5-row { background: rgba(13,148,136,.04); }
[data-theme="light"] .roi-neu { color: #475569; }

/* ── JRA / NAR 切替トグル ── */
.mode-toggle { display: flex; gap: 5px; margin: 4px 0 8px; background: rgba(15,30,28,.45); border: 1px solid rgba(45,212,191,.15); border-radius: 10px; padding: 3px; }
.mode-btn { flex: 1; background: transparent; border: none; color: #94c5b9; font-weight: 800; font-size: .85rem; padding: 9px 6px; border-radius: 8px; cursor: pointer; transition: background .15s, color .15s; -webkit-tap-highlight-color: transparent; }
.mode-btn.active { background: linear-gradient(120deg, rgba(45,212,191,.24), rgba(45,212,191,.10)); color: #2dd4bf; }
.mode-btn:not(.active):hover { color: #c0ddd8; }
[data-theme="light"] .mode-toggle { background: rgba(13,148,136,.04); border-color: rgba(13,148,136,.18); }
[data-theme="light"] .mode-btn.active { color: #0d9488; background: linear-gradient(120deg, rgba(13,148,136,.16), rgba(13,148,136,.06)); }

/* ── 通算ROIのモード表示 / NAR実績キャプション (2026-06-03) ── */
.roi-mode{font-size:.6rem;font-weight:700;margin-left:4px;padding:1px 5px;border-radius:6px;
  background:rgba(45,212,191,.16);color:#5fc9b3;vertical-align:middle;}
.nar-cap{font-size:.92rem;font-weight:700;margin:4px 2px 10px;color:#c8e8e0;}
#tab-stats .mode-toggle,#tab-bank .mode-toggle{margin-bottom:12px;}

/* ── 💥 勝負したい方へ (NAR 三連系 参考買い目) ── */
.shoubu-box{margin-top:10px;border:1px dashed rgba(251,191,36,.45);
  background:linear-gradient(180deg,rgba(251,191,36,.05),rgba(0,0,0,0));}
.shoubu-box .picks-title{color:#fbbf24;}
.shoubu-tag{font-size:.6rem;font-weight:700;margin-left:6px;padding:1px 6px;border-radius:6px;
  background:rgba(251,191,36,.18);color:#fbbf24;vertical-align:middle;}
.shoubu-note{font-size:.72rem;line-height:1.5;color:#b9c8c2;margin:2px 2px 10px;}
.shoubu-note b{color:#e7c66a;}

/* ── 推奨レースのみ 明示バナー (2026-06-03) ── */
.rec-only-note{font-size:.74rem;line-height:1.5;color:#e7c66a;
  background:rgba(251,191,36,.08);border:1px solid rgba(251,191,36,.25);
  border-radius:8px;padding:7px 10px;margin:2px 2px 10px;}
.rec-only-note b{color:#fbbf24;}

/* ── 過去予想: 選択中の日付ボタン ── */
.nav-btn-active{background:rgba(45,212,191,.22)!important;color:#5fc9b3!important;border-color:rgba(45,212,191,.5)!important;}
.tabs{overflow-x:auto;}

/* ── Rize解析コメント (本命とおすすめ買い目の間・コンパクト) ── */
.rize-comment{margin:8px 0;padding:8px 11px;border-radius:9px;font-size:.78rem;line-height:1.55;
  background:linear-gradient(180deg,rgba(45,212,191,.07),rgba(0,0,0,0));border:1px solid rgba(45,212,191,.22);}
.rize-comment .rc-head{display:block;font-size:.7rem;font-weight:700;color:#5fc9b3;margin-bottom:3px;}
.rize-comment .rc-body{color:#c8e8e0;}

/* ── 管理者アクセスログ モーダル ── */
.access-modal-body{max-width:560px;width:92%;max-height:82vh;overflow-y:auto;text-align:left;}
.access-summary{font-size:.78rem;color:#b9c8c2;margin:8px 2px 4px;}
.access-ips{margin:2px 0 10px;padding-left:18px;font-size:.82rem;color:#c8e8e0;}
.access-table th,.access-table td{font-size:.72rem;padding:4px 6px;}

/* ── 過去タブ テーブル (払戻見切れ対策・コンパクト) ── */
.past-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;}
.past-table{width:100%;}
.past-table th,.past-table td{padding:6px 8px;font-size:.78rem;vertical-align:middle;}
.past-table .ta-r{text-align:right;}
.pt-race b{font-size:.8rem;}
.pt-race .pt-name{display:block;font-size:.65rem;color:#94c5b9;}
.pt-honmei{font-size:.75rem;color:#c8e8e0;white-space:nowrap;}
.pt-top3{font-size:.78rem;white-space:nowrap;letter-spacing:.5px;}
.pt-pay{white-space:nowrap;font-weight:700;}
.pt-pay .pt-bt{display:block;font-size:.62rem;font-weight:400;color:#94c5b9;}

/* ── Rize 印の根拠 (印ごとの箇条書き) ── */
.rize-comment .rc-row{display:flex;flex-wrap:wrap;align-items:baseline;gap:5px;padding:4px 0;border-top:1px solid rgba(255,255,255,.05);}
.rize-comment .rc-row:first-of-type{border-top:none;}
.rize-comment .rc-mark{font-weight:700;font-size:.82rem;white-space:nowrap;}
.rize-comment .rc-name{font-weight:600;color:#c8e8e0;font-size:.77rem;white-space:nowrap;}
.rize-comment .rc-odds{font-size:.66rem;color:#94c5b9;}
.rize-comment .rc-reasons{font-size:.71rem;color:#a4bab2;line-height:1.45;flex:1;min-width:170px;}

/* ── アクセスログ追記 ── */
.access-big{font-size:.86rem;color:#c8e8e0;margin:8px 2px 2px;}
.access-big b{color:#5fc9b3;font-size:1rem;}
.access-note{font-size:.7rem;line-height:1.55;color:#9fb5ad;margin-top:8px;padding:7px 9px;border-radius:7px;background:rgba(251,191,36,.07);border:1px solid rgba(251,191,36,.2);}
.access-note b{color:#e7c66a;}

/* ── 過去 払戻内訳 ── */
.pt-pay .pt-bt{display:block;font-size:.62rem;font-weight:400;color:#94c5b9;line-height:1.3;}

/* ── 過去テーブル: モバイルで横スクロールせず画面内に収める ── */
.past-table{table-layout:fixed;width:100%;}
.past-table th,.past-table td{padding:5px 5px;font-size:.72rem;vertical-align:top;word-break:break-word;}
.past-table .pt-race b{font-size:.73rem;}
.past-table .pt-race .pt-name{font-size:.6rem;}
.past-table .pt-honmei{font-size:.7rem;white-space:normal;line-height:1.25;}
.past-table .pt-top3{font-size:.72rem;white-space:nowrap;letter-spacing:0;}
.past-table .pt-pay{font-size:.74rem;white-space:nowrap;font-weight:700;}
.past-table .pt-pay .pt-bt{font-size:.58rem;font-weight:400;white-space:normal;line-height:1.25;color:#94c5b9;}
/* ◎の根拠を少し強調 */
.rize-comment .rc-row:first-of-type .rc-mark{font-size:.9rem;}
.rize-comment .rc-row:first-of-type .rc-name{font-size:.82rem;}

/* ── 過去 払戻: 券種ごと(合計しない) ── */
.past-table .pt-pay .pt-line{display:block;font-size:.7rem;font-weight:400;white-space:nowrap;line-height:1.35;}
.past-table .pt-pay .pt-line b{font-weight:700;}

/* ── ヘッダーロゴを1行に固定 (2行になる不具合修正) ── */
.rz-logo{white-space:nowrap;display:inline-flex;align-items:center;gap:6px;}

/* ── 過去テーブル: R↔本命を詰める / 本命を左寄せ / 払戻の行間を詰める ── */
.past-table .ta-l{text-align:left;}
.past-table td.pt-race{padding-right:2px;}
.past-table td.pt-honmei{text-align:left;padding-left:2px;font-size:.69rem;line-height:1.2;}
.past-table .pt-pay .pt-line{line-height:1.12;}

/* ── ◎本命の成績 (複勝率/勝率) ── */
.honmei-stats{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0;}
.hs-card{background:linear-gradient(180deg,rgba(45,212,191,.10),rgba(0,0,0,0));border:1px solid rgba(45,212,191,.28);border-radius:11px;padding:10px 8px;text-align:center;}
.hs-label{font-size:.72rem;color:#5fc9b3;font-weight:700;}
.hs-val{font-size:1.5rem;font-weight:800;color:#6ee7b7;line-height:1.2;margin:1px 0;}
.hs-sub{font-size:.6rem;color:#94c5b9;}

/* ── 会員ゲートの実績フック (#1 コンバージョン) ── */
.pg-proof{font-size:.82rem;color:#c8e8e0;line-height:1.65;margin:4px auto 8px;padding:8px 14px;border-radius:10px;background:rgba(45,212,191,.10);border:1px solid rgba(45,212,191,.3);display:inline-block;}
.pg-proof b{color:#6ee7b7;font-size:1.05rem;}
.pg-proof b.pg-pos{color:#fbbf24;}
/* ── ◎信頼度 人気帯テーブル (#3) ── */
.tier-table td{font-size:.78rem;}
.tier-table .tt-tier{text-align:left;font-weight:600;color:#c8e8e0;}
.tier-note{font-size:.68rem;color:#94c5b9;line-height:1.5;margin:5px 2px 4px;}
/* ── 本日の的中速報 (#5) ── */
.today-hits-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:6px 0 8px;}
.today-hits-row .th-label{font-size:.74rem;font-weight:700;color:#fbbf24;}

/* ── #4 直近の調子 ── */
.recent-form{font-size:.82rem;color:#c8e8e0;margin:6px 2px 10px;padding:7px 11px;border-radius:9px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);}
.recent-form b{color:#c8e8e0;font-size:.95rem;}
.recent-form.rf-hot{background:rgba(251,191,36,.1);border-color:rgba(251,191,36,.3);color:#e7c66a;}
.recent-form.rf-hot b{color:#fbbf24;}

/* ── #5 スケルトン ── */
@keyframes sk-shimmer{0%{background-position:-400px 0}100%{background-position:400px 0}}
.sk-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:2px 0 10px;}
.sk-card,.sk-line,.sk-rrow{background:linear-gradient(90deg,rgba(255,255,255,.04) 25%,rgba(255,255,255,.09) 37%,rgba(255,255,255,.04) 63%);background-size:800px 100%;animation:sk-shimmer 1.4s infinite linear;border-radius:9px;}
.sk-card{height:64px;}
.sk-line{height:14px;margin:8px 2px;}
.sk-line.sk-w60{width:60%;}
.sk-list{margin-top:4px;}
.sk-rrow{height:46px;margin:8px 0;border-radius:10px;}

/* ── #2 PWA 追加バナー ── */
.install-bar{display:flex;align-items:center;gap:8px;margin:8px 0;padding:9px 12px;border-radius:11px;
  background:linear-gradient(180deg,rgba(45,212,191,.12),rgba(0,0,0,0));border:1px solid rgba(45,212,191,.3);}
.install-bar .ib-text{font-size:.76rem;color:#c8e8e0;flex:1;line-height:1.4;}
.install-bar .ib-text b{color:#6ee7b7;}
.install-bar .ib-howto{font-size:.7rem;color:#94c5b9;white-space:nowrap;}
.install-bar .ib-btn{background:#0d9488;color:#fff;border:none;border-radius:8px;padding:6px 12px;font-size:.78rem;font-weight:700;cursor:pointer;white-space:nowrap;}
.install-bar .ib-close{background:none;border:none;color:#94c5b9;font-size:1.2rem;cursor:pointer;line-height:1;padding:0 2px;}

/* ── #3 凡例モーダル ── */
.rz-notice-link{cursor:pointer;color:#5fc9b3 !important;text-decoration:underline;text-underline-offset:2px;}
.legend-body{max-width:440px;width:92%;text-align:left;}
.legend-list{list-style:none;padding:0;margin:8px 0;}
.legend-list li{font-size:.84rem;color:#c8e8e0;padding:6px 2px;border-bottom:1px solid rgba(255,255,255,.05);line-height:1.5;}
.legend-list li b{display:inline-block;min-width:1.6em;font-size:1rem;}
.legend-note{font-size:.72rem;color:#94c5b9;line-height:1.6;margin-top:10px;}
.legend-note b{color:#e7c66a;}
/* 今月の参考・最高配当ハイライト (ROI集計外の参考表示) */
.ref-hl{margin:12px 0;padding:14px 16px;border-radius:14px;background:linear-gradient(135deg,#2a1e3a,#1a1420);border:1px solid rgba(109,74,255,.35);box-shadow:0 2px 12px rgba(109,74,255,.13);}
.ref-hl-cap{font-size:.78rem;color:#c9a8ff;letter-spacing:.04em;margin-bottom:4px;}
.ref-hl-pay{font-size:1.5rem;font-weight:800;color:#ffd24a;line-height:1.1;}
.ref-hl-race{font-size:.86rem;color:#e6e6ee;margin-top:6px;}
.ref-hl-note{font-size:.72rem;color:#9a93ad;margin-top:8px;line-height:1.5;}
.ref-hl-note b{color:#ffb38a;}

/* ── ROI文脈強化 (2026-06-10) ── */
.roi-sub { font-size: .62rem; color: var(--text-dim); font-weight: 700; text-align: right; margin-top: 1px; }
.roi-context-note { font-size: .72rem; color: var(--text-dim); margin: -4px 2px 10px; line-height: 1.5; }
.rank-note { font-size: .7rem; color: var(--text-dim); margin-top: 3px; line-height: 1.45; }
.rank-note a { color: var(--accent); text-decoration: none; font-weight: 700; }

/* ── SEO SSRブロック (サーバー注入・SPA起動後に除去) ── */
#ssr-seo:empty { display: none; }
.ssr-seo-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
.ssr-seo-box h2 { font-size: .92rem; color: var(--accent); margin: 0 0 6px; }
.ssr-seo-box ul { margin: 4px 0 8px 18px; padding: 0; font-size: .82rem; line-height: 1.7; color: var(--text2, #c8e8e0); }
.ssr-seo-box p { font-size: .8rem; color: var(--text-dim); margin: 4px 0; line-height: 1.6; }

/* ── 非開催日: 次回開催バナー (#6) ── */
.next-race-banner { background: linear-gradient(135deg, rgba(45,212,191,.10), rgba(15,30,28,.35)); border: 1px solid rgba(45,212,191,.3); border-radius: 11px; padding: 10px 13px; margin: 6px 0 10px; font-size: .82rem; color: var(--text2, #c8e8e0); line-height: 1.6; }
.next-race-banner a { color: var(--accent); text-decoration: none; }
