/* ============================================================
   COLOUR PALETTE — Deep Ocean / Teal (Distinguishable from 5101's Purple)
   bg:      #0b1215   surface: #101c22   card: #16262e
   accent:  #0ea5e9   bright:  #38bdf8   hover: #0284c7
   text:    #bae6fd   muted:   #7dd3fc   border: #1e3a45
   home:    #67e8f9   away:    #f9a8d4
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', sans-serif; background: #0b1215; color: #e0f2fe; font-size: 14px; }

/* Header */
.header { background: #0f181c; padding: 12px 20px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid #1e3a45; position: sticky; top: 0; z-index: 100; }
.header h1 { font-size: 18px; font-weight: 600; color: #fff; }
.status-bar { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 12px; color: #7dd3fc; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #4caf50; animation: pulse 2s infinite; }
.pulse.inactive { background: #666; animation: none; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.btn-refresh { background: #0284c7; color: #fff; border: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.btn-refresh:hover { background: #0369a1; }
.btn-refresh:disabled { background: #333; cursor: default; }

/* Filter bar */
.filter-bar { padding: 10px 20px; background: #0c161a; border-bottom: 1px solid #1e3a45; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-btn { padding: 5px 14px; border-radius: 20px; border: 1px solid #1e3a45; background: #16262e; color: #bae6fd; cursor: pointer; font-size: 12px; transition: all 0.2s; }
.filter-btn.active { background: #0ea5e9; border-color: #0ea5e9; color: #fff; }
.search-box { padding: 5px 12px; border-radius: 6px; border: 1px solid #1e3a45; background: #16262e; color: #e0f2fe; font-size: 12px; width: 180px; }
.count-badge { background: #16262e; border: 1px solid #1e3a45; padding: 4px 10px; border-radius: 12px; font-size: 11px; color: #7dd3fc; }
.global-filter-bar { padding: 8px 20px; background: #0a1418; border-bottom: 1px solid #1e3a45; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.global-filter-title { font-size: 12px; color: #7dd3fc; font-weight: 600; }
.global-filter-wrap { position: relative; }
.global-filter-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: min(360px, 92vw);
    max-height: 420px;
    overflow: hidden;
    background: #0f1521;
    border: 1px solid #1e3a45;
    border-radius: 10px;
    box-shadow: 0 14px 40px rgba(0,0,0,.42);
    z-index: 300;
}
.global-filter-menu-head {
    padding: 10px 12px;
    border-bottom: 1px solid #1e3a45;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.global-filter-menu-summary { font-size: 11px; color: #7dd3fc; max-width: 230px; }
.global-filter-menu-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.global-filter-options {
    max-height: 340px;
    overflow: auto;
    padding: 8px;
    display: grid;
    gap: 6px;
}
.global-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border: 1px solid #1e3a45;
    border-radius: 8px;
    background: #131b29;
    cursor: pointer;
}
.global-filter-option:hover { background: #182830; }
.global-filter-option input { accent-color: #38bdf8; cursor: pointer; }
.global-filter-option-name {
    flex: 1;
    min-width: 0;
    color: #e0f2fe;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.global-filter-option-count {
    background: #16262e;
    border: 1px solid #1e3a45;
    border-radius: 999px;
    color: #7dd3fc;
    font-size: 10px;
    padding: 2px 7px;
}
.global-filter-empty {
    padding: 18px 10px;
    text-align: center;
    color: #7dd3fc;
    font-size: 12px;
    opacity: 0.8;
}

/* Competition sections */
.comp-section { margin: 8px 16px; border-radius: 8px; overflow: hidden; }
.comp-header { background: #16262e; padding: 8px 14px; font-size: 13px; font-weight: 600; color: #bae6fd; cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; }
.comp-header:hover { background: #1e323c; }
.comp-count { background: #1e3a45; padding: 2px 8px; border-radius: 10px; font-size: 11px; color: #7dd3fc; }
.comp-live-dot { width: 6px; height: 6px; border-radius: 50%; background: #4caf50; animation: pulse 2s infinite; }

/* Match rows */
.match-row { display: grid !important; grid-template-columns: 52px 1fr 80px 1fr 354px !important; align-items: center; padding: 7px 14px; border-bottom: 1px solid #16262e; background: #101c22; gap: 8px; transition: background 0.15s; box-shadow: inset 0 0 0 transparent; }
.match-row:hover { background: #182830; }
.match-row:last-child { border-bottom: none; }

/* Status styles */
.match-row.live    { background: #0a1f18; box-shadow: inset 3px 0 0 #4caf50; }
.match-row.halftime { background: #1f1a0a; box-shadow: inset 3px 0 0 #ffc107; }
.match-row.finished { background: #0f181c; box-shadow: inset 3px 0 0 #0ea5e9; }

.time-col { font-size: 12px; color: #bae6fd; text-align: center; }
.time-col .minutes { color: #4caf50; font-weight: 700; font-size: 11px; }
.time-col .status-tag { font-size: 10px; padding: 1px 5px; border-radius: 3px; margin-top: 2px; }
.status-tag.live    { background: #113322; color: #4caf50; }
.status-tag.halftime { background: #332b11; color: #ffc107; }
.status-tag.finished { background: #12222b; color: #7dd3fc; }
.status-tag.upcoming { display: none; }

.team-col { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-col.home { text-align: right; }
.team-col.away { text-align: left; }

.score-col { text-align: center; font-size: 15px; font-weight: 700; min-width: 70px; }
.score-col .vs { color: #5b7c8a; font-size: 11px; }
.score-col .live-score { color: #4caf50; }
.score-col .final-score { color: #e0f2fe; }

/* Full odds block */
.odds-block { display: flex; gap: 6px; align-items: stretch; }
.odds-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; background: #16262e; border-radius: 5px; padding: 3px 6px; }
.odds-cell.ah-cell { width: 92px; }
.odds-cell.hda-cell { width: 118px; }
.odds-cell.ou-cell { width: 130px; }
.odds-cell .lbl { font-size: 9px; color: #5b7c8a; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 1px; }
.odds-cell .line { font-size: 12px; color: #38bdf8; font-weight: 600; }
.odds-cell .waters { font-size: 11px; color: #7dd3fc; }
.odds-cell .hda { font-size: 11px; color: #7dd3fc; display: flex; gap: 3px; }
.odds-cell .hda span { padding: 1px 3px; border-radius: 3px; }
.odds-cell .hda .h { color: #67e8f9; }
.odds-cell .hda .d { color: #94a3b8; }
.odds-cell .hda .a { color: #f9a8d4; }
.odds-no { font-size: 10px; color: #334e58; padding: 6px; }

/* Multi-source sub-tab nav */
.ms-subtab-nav { display: flex; gap: 0; border-bottom: 1px solid #1e3a45; background: #0c161a; flex-wrap: wrap; }

/* MS action bar (below filter bar) */
.ms-action-bar { padding: 6px 16px; background: #0b1215; border-bottom: 1px solid #1e3a45; display: flex; gap: 8px; align-items: center; }

/* Multi-source tab */
.ms-filter-bar { padding: 10px 16px; background: #0c161a; border-bottom: 1px solid #1e3a45; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ms-filter-sep { color: #333; padding: 0 2px; font-size: 18px; line-height: 1; align-self: center; }
.ms-cnt { display: inline-block; min-width: 14px; background: #1e3a45; border-radius: 8px; font-size: 10px; padding: 1px 5px; color: #aaa; margin-left: 3px; vertical-align: middle; }
.ms-board-toolbar { padding: 12px 16px; background: #0c161a; border-bottom: 1px solid #1e3a45; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ms-board-toolbar-copy { display: flex; flex-direction: column; gap: 3px; min-width: 220px; }
.ms-board-title { font-size: 13px; font-weight: 700; color: #e0f2fe; }
.ms-board-subtitle { font-size: 11px; color: #7dd3fc; }
.ms-board-toolbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ms-board-filterbar { padding: 8px 16px; background: #0b1215; border-bottom: 1px solid #1e3a45; display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.ms-board-filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ms-board-filter-date { display: flex; gap: 8px; align-items: center; font-size: 11px; color: #7dd3fc; }
.ms-board-filter-date select { min-width: 140px; }
.ms-board-coverage { padding: 10px 16px; background: #091217; border-bottom: 1px solid #1e3a45; display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.ms-board-coverage-empty { font-size: 11px; color: #7dd3fc; opacity: 0.85; }
.ms-board-coverage-card { min-width: 170px; background: #101c22; border: 1px solid #1e3a45; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ms-board-coverage-title { font-size: 11px; font-weight: 700; color: #e0f2fe; text-transform: uppercase; letter-spacing: 0.6px; }
.ms-board-coverage-main { font-size: 12px; color: #d7ebf6; display: flex; gap: 8px; flex-wrap: wrap; }
.ms-board-coverage-main b { color: #fff; }
.ms-board-coverage-gap { font-size: 11px; color: #7dd3fc; }
.ms-board-coverage-gap.warn { color: #f0a060; }
.ms-board-group { margin: 10px 16px 0; }
.ms-board-group-head { background: #16262e; color: #e0f2fe; padding: 8px 12px; border: 1px solid #1e3a45; border-bottom: none; border-radius: 10px 10px 0 0; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ms-board-shell { margin: 0 0 18px; border: 1px solid #1e3a45; border-radius: 0 0 10px 10px; overflow: hidden; background: #0f181c; }
.ms-board-header { display: grid; grid-template-columns: minmax(260px, 1.2fr) repeat(3, minmax(220px, 1fr)); gap: 10px; padding: 10px 14px; background: #101820; border-bottom: 1px solid #1e3a45; }
.ms-board-header-cell { font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; color: #7dd3fc; font-weight: 700; }
.ms-board-row { border-top: 1px solid #15232a; }
.ms-board-row:first-child { border-top: none; }
.ms-board-summary { display: grid; grid-template-columns: minmax(260px, 1.2fr) repeat(3, minmax(220px, 1fr)); gap: 10px; padding: 12px 14px; align-items: stretch; cursor: pointer; }
.ms-board-summary:hover { background: #122028; }
.ms-board-match { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.ms-board-checkbox { width: 15px; height: 15px; accent-color: #38bdf8; cursor: pointer; flex-shrink: 0; margin-top: 3px; }
.ms-board-match-main { min-width: 0; flex: 1; }
.ms-board-teams { font-size: 14px; font-weight: 600; color: #e0f2fe; line-height: 1.4; }
.ms-board-teams .ms-home { color: #67e8f9; }
.ms-board-teams .ms-away { color: #f9a8d4; }
.ms-board-meta { margin-top: 3px; font-size: 11px; color: #7dd3fc; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ms-board-source-chips { margin-top: 7px; display: flex; gap: 5px; flex-wrap: wrap; }
.ms-board-chip { font-size: 10px; padding: 2px 7px; border-radius: 999px; border: 1px solid #24414d; background: #13242b; color: #9bdaf4; }
.ms-board-chip.off { color: #4c6976; border-color: #20323a; background: #10171a; }
.ms-board-panel { min-width: 0; background: #101c22; border: 1px solid #1e3a45; border-radius: 8px; padding: 10px 11px; display: flex; flex-direction: column; gap: 6px; }
.ms-board-panel.hkjc { border-color: #2f4b66; box-shadow: inset 0 0 0 1px rgba(138,180,248,.08); }
.ms-board-panel.macau { border-color: #4f4330; box-shadow: inset 0 0 0 1px rgba(240,160,96,.08); }
.ms-board-panel.titan { border-color: #294d40; box-shadow: inset 0 0 0 1px rgba(109,217,154,.08); }
.ms-board-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ms-board-panel-title { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: #e0f2fe; }
.ms-board-panel-tag { font-size: 10px; padding: 2px 6px; border-radius: 999px; background: #152a33; color: #7dd3fc; border: 1px solid #24414d; }
.ms-board-panel-tag.ok { color: #6dd99a; border-color: #2d6a4a; background: #13281d; }
.ms-board-panel-tag.warn { color: #f0a060; border-color: #6b4b27; background: #231b12; }
.ms-board-panel-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ms-board-line { font-size: 11px; line-height: 1.4; color: #d7ebf6; }
.ms-board-line strong { color: #9fd8ff; font-weight: 700; margin-right: 5px; }
.ms-board-line.titan strong { color: #6dd99a; }
.ms-board-empty { font-size: 11px; color: #5f7a85; padding: 8px 0; }
.ms-board-expanded { padding: 0 14px 14px; }
.ms-board-expanded .ms-odds-row { padding: 0; gap: 10px; }
.ms-board-expanded .ms-source-block { min-width: 220px; }
.ms-board-toggle { margin-left: auto; color: #7788aa; font-size: 14px; align-self: center; }
.ms-board-empty-state { padding: 36px 20px; text-align: center; color: #7dd3fc; font-size: 13px; }
.tier-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; letter-spacing: 0.4px; }
.tier-3way  { background: #163242; color: #67e8f9; border: 1px solid #204c60; }
.tier-2way  { background: #16262e; color: #bae6fd; border: 1px solid #263c48; }
.tier-hkjc-titan { background: #203845; color: #7dd3fc; border: 1px solid #2e4c5e; }
.tier-macau-titan { background: #284252; color: #e879f9; border: 1px solid #3c5e70; }
.tier-single { background: #1a2a33; color: #a5f3fc; border: 1px solid #2a3e48; }
.ms-card { background: #101c22; border: 1px solid #1e3a45; border-radius: 8px; margin: 8px 16px; overflow: hidden; }
.ms-card-header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; user-select: none; }
.ms-card-header:hover { background: #182830; }
.ms-teams { flex: 1; }
.ms-teams .ms-home { color: #67e8f9; font-weight: 600; font-size: 14px; }
.ms-teams .ms-away { color: #f9a8d4; font-weight: 600; font-size: 14px; }
.ms-teams .ms-comp { font-size: 11px; color: #7dd3fc; margin-top: 1px; }
.ms-odds-row { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px; }
.ms-source-block { background: #16262e; border-radius: 6px; padding: 6px 10px; min-width: 160px; flex: 1; }
.ms-source-lbl { font-size: 10px; color: #7dd3fc; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; font-weight: 700; }
.ms-market { font-size: 11px; color: #38bdf8; line-height: 1.7; padding: 1px 0; border-bottom: 1px solid #1e3a45; }
.ms-market:last-of-type { border-bottom: none; }
.ms-mkt-name { color: #bae6fd; font-weight: 600; margin-right: 5px; }
.ms-mkt-odds { color: #e0f2fe; }
.ms-market strong { color: #e0f2fe; }
.ms-expert-section { border-top: 1px solid #1e3a45; padding: 12px 14px; display: none; }
.ms-expert-section.visible { display: block; }
.ms-subtab { background: none; border: none; border-bottom: 2px solid transparent; color: #5b7c8a; padding: 7px 18px; cursor: pointer; font-size: 13px; font-weight: 600; }
.ms-subtab.active { color: #bae6fd; border-bottom-color: #38bdf8; }
.ms-subtab:hover { color: #e0f2fe; }
.ms-single-row { padding: 6px 10px; cursor: pointer; font-size: 12px; color: #bae6fd; border-bottom: 1px solid #1e3a45; }
.ms-single-row:hover { background: #182830; }
.ms-single-row.selected { background: #1e3a45; color: #bae6fd; }
.expert-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.expert-tab-btn { background: #16262e; border: 1px solid #1e3a45; color: #7dd3fc; padding: 4px 12px; border-radius: 4px; cursor: pointer; font-size: 11px; }
.expert-tab-btn.active { background: #1e3a45; color: #bae6fd; border-color: #0ea5e9; }
.expert-panel { display: none; }
.btn-run-experts { background: #16262e; color: #67e8f9; border: 1px solid #1e3a45; padding: 5px 14px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.btn-run-experts:hover { background: #1e323c; }
.btn-run-experts:disabled { background: #111; color: #334e58; border-color: #222; cursor: default; }

/* Scrollable body */
.content { max-height: calc(100vh - 140px); overflow-y: auto; padding-bottom: 20px; }

/* Tab navigation */
.tab-nav { display: flex; gap: 0; border-bottom: 1px solid #1e3a45; background: #0c161a; }
.tab-btn { padding: 9px 22px; border: none; background: none; color: #7dd3fc; cursor: pointer; font-size: 13px; border-bottom: 2px solid transparent; transition: all 0.2s; }
.tab-btn.active { color: #fff; border-bottom-color: #38bdf8; background: #101c22; }
.tab-btn:hover:not(.active) { color: #e0f2fe; background: #16262e; }

/* Production list tab (preview-style replacement) */
#ms-pane-list {
    --ms-preview-bg: #121212;
    --ms-preview-panel: #1e1e1e;
    --ms-preview-panel-alt: #181c22;
    --ms-preview-border: #31353d;
    --ms-preview-text: #f3f4f6;
    --ms-preview-muted: #a1a1aa;
    --ms-preview-accent: #00bcd4;
    --ms-preview-accent-2: #3949ab;
    --ms-preview-hkjc: #ff4081;
    --ms-preview-macau: #00e676;
    --ms-preview-titan: #7dd3fc;
    --ms-preview-fotmob: #fbbf24;
    padding: 0 0 28px;
}

#ms-pane-list .ms-preview-shell {
    max-width: 1500px;
    margin: 0 auto;
    padding: 18px 18px 30px;
}

#ms-pane-list .hero-card,
#ms-pane-list .toolbar-card,
#ms-pane-list .table-card,
#ms-pane-list .stat-card {
    background: linear-gradient(180deg, rgba(30, 30, 30, 0.95), rgba(24, 28, 34, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

#ms-pane-list .hero-card {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 18px;
}

#ms-pane-list .eyebrow {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 11px;
    color: var(--ms-preview-accent);
    font-weight: 700;
}

#ms-pane-list .hero-card h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.06;
    max-width: 760px;
    color: var(--ms-preview-text);
}

#ms-pane-list .hero-text {
    margin: 14px 0 0;
    font-size: 14px;
    color: var(--ms-preview-muted);
    max-width: 700px;
    line-height: 1.6;
}

#ms-pane-list .hero-meta {
    display: grid;
    gap: 12px;
    min-width: 280px;
}

#ms-pane-list .meta-pill {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#ms-pane-list .meta-label {
    display: block;
    color: var(--ms-preview-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

#ms-pane-list .meta-value {
    font-size: 13px;
    color: var(--ms-preview-text);
    word-break: break-word;
}

#ms-pane-list .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

#ms-pane-list .stat-card {
    border-radius: 18px;
    padding: 18px 20px;
}

#ms-pane-list .stat-label {
    font-size: 12px;
    color: var(--ms-preview-muted);
    margin-bottom: 10px;
}

#ms-pane-list .stat-value {
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
    color: var(--ms-preview-accent);
}

#ms-pane-list .toolbar-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px 18px;
    border-radius: 18px;
    margin-bottom: 18px;
}

#ms-pane-list .source-tabs,
#ms-pane-list .badge-row,
#ms-pane-list .match-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#ms-pane-list .source-tab,
#ms-pane-list .preview-refresh {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: var(--ms-preview-muted);
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.18s ease;
}

#ms-pane-list .preview-refresh {
    color: var(--ms-preview-text);
}

#ms-pane-list .source-tab:hover,
#ms-pane-list .preview-refresh:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--ms-preview-text);
}

#ms-pane-list .source-tab.active {
    color: #041015;
    background: var(--ms-preview-accent);
    border-color: var(--ms-preview-accent);
}

#ms-pane-list .toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#ms-pane-list .ms-preview-legend {
    align-items: flex-start;
}

#ms-pane-list .ms-preview-bulkbar {
    justify-content: space-between;
}

#ms-pane-list .ms-preview-bulk-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#ms-pane-list .ms-legend-copy {
    display: grid;
    gap: 6px;
    min-width: 260px;
}

#ms-pane-list .ms-legend-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ms-preview-accent);
}

#ms-pane-list .ms-legend-text,
#ms-pane-list .ms-legend-note {
    font-size: 12px;
    line-height: 1.5;
    color: var(--ms-preview-muted);
}

#ms-pane-list .ms-legend-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

#ms-pane-list .search-input {
    width: 280px;
    max-width: 100%;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ms-preview-text);
    font-size: 13px;
}

#ms-pane-list .toolbar-note {
    font-size: 12px;
    color: var(--ms-preview-muted);
}

#ms-pane-list .table-card {
    border-radius: 20px;
    overflow: hidden;
}

#ms-pane-list .table-scroll {
    overflow: auto;
}

#ms-pane-list .preview-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1120px;
}

#ms-pane-list .preview-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 16px 14px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ms-preview-muted);
    background: #171b22;
    border-bottom: 1px solid var(--ms-preview-border);
}

#ms-pane-list .preview-table tbody td {
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    vertical-align: top;
    color: var(--ms-preview-text);
}

#ms-pane-list .preview-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

#ms-pane-list .preview-table tbody tr.row-selected {
    background: rgba(0, 188, 212, 0.08);
}

#ms-pane-list .ms-list-select-cell {
    width: 54px;
}

#ms-pane-list .ms-list-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--ms-preview-accent);
    cursor: pointer;
}

#ms-pane-list .time-stack,
#ms-pane-list .match-cell,
#ms-pane-list .coverage-cell {
    display: grid;
    gap: 8px;
}

#ms-pane-list .time-main,
#ms-pane-list .comp-name,
#ms-pane-list .teams-line {
    font-weight: 700;
    color: var(--ms-preview-text);
}

#ms-pane-list .time-sub,
#ms-pane-list .comp-type,
#ms-pane-list .coverage-note {
    font-size: 12px;
    color: var(--ms-preview-muted);
}

#ms-pane-list .comp-type {
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

#ms-pane-list .teams-line {
    font-size: 15px;
}

#ms-pane-list .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

#ms-pane-list .badge.source-hkjc { color: var(--ms-preview-hkjc); border-color: rgba(255, 64, 129, 0.35); background: rgba(255, 64, 129, 0.12); }
#ms-pane-list .badge.source-macauslot { color: var(--ms-preview-macau); border-color: rgba(0, 230, 118, 0.35); background: rgba(0, 230, 118, 0.1); }
#ms-pane-list .badge.source-titan { color: var(--ms-preview-titan); border-color: rgba(125, 211, 252, 0.35); background: rgba(125, 211, 252, 0.12); }
#ms-pane-list .badge.source-fotmob { color: var(--ms-preview-fotmob); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.12); }
#ms-pane-list .badge.source-generic { color: #d4d4d8; border-color: rgba(212, 212, 216, 0.28); background: rgba(212, 212, 216, 0.08); }
#ms-pane-list .badge.tier { color: #dbeafe; border-color: rgba(59, 130, 246, 0.35); background: rgba(37, 99, 235, 0.15); }
#ms-pane-list .badge.stat { color: #c4b5fd; border-color: rgba(196, 181, 253, 0.32); background: rgba(124, 58, 237, 0.14); }

#ms-pane-list .coverage-bar {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

#ms-pane-list .coverage-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--ms-preview-accent-2), var(--ms-preview-accent));
}

#ms-pane-list .loading-cell,
#ms-pane-list .empty-cell {
    padding: 24px 14px !important;
    text-align: center;
    color: var(--ms-preview-muted);
    font-size: 14px;
}

@media (max-width: 1100px) {
    #ms-pane-list .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #ms-pane-list .hero-card {
        flex-direction: column;
    }
    #ms-pane-list .hero-meta {
        min-width: 0;
    }
}

@media (max-width: 680px) {
    #ms-pane-list .ms-preview-shell {
        padding: 14px 12px 24px;
    }
    #ms-pane-list .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Analysis tab */
.analysis-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.analysis-card { background: #101c22; border-radius: 8px; border: 1px solid #1e3a45; overflow: hidden; }
.analysis-card-header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.analysis-teams { flex: 1; font-size: 13px; }
.analysis-teams .home-name { color: #67e8f9; }
.analysis-teams .away-name { color: #f9a8d4; }
.analysis-teams .league-name { font-size: 11px; color: #7dd3fc; margin-top: 2px; }
.analysis-odds-mini { font-size: 11px; color: #bae6fd; display: flex; gap: 8px; }
.analysis-odds-mini span { background: #16262e; padding: 2px 6px; border-radius: 4px; }
.btn-analyze { background: #1e3a45; color: #bae6fd; border: 1px solid #0ea5e9; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; white-space: nowrap; }
.btn-analyze:hover { background: #264654; }
.btn-analyze:disabled { background: #16262e; color: #5b7c8a; cursor: default; }

/* Analysis result panel */
.analysis-result { border-top: 1px solid #1e3a45; padding: 14px 16px; display: none; }
.analysis-result.visible { display: block; }
.result-loading { text-align: center; padding: 20px; color: #7dd3fc; }
.result-loading .spinner { display: inline-block; border: 2px solid #1e3a45; border-top-color: #38bdf8; border-radius: 50%; width: 20px; height: 20px; animation: spin 0.8s linear infinite; margin-bottom: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-section { margin-bottom: 12px; }
.result-section h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #bae6fd; margin-bottom: 6px; }
.bet-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.bet-card { background: #16262e; border: 1px solid #1e3a45; border-radius: 6px; padding: 8px 12px; min-width: 200px; flex: 1; }
.bet-card .bet-market { font-size: 10px; color: #bae6fd; text-transform: uppercase; }
.bet-card .bet-selection { font-size: 14px; font-weight: 600; color: #67e8f9; margin: 2px 0; }
.bet-card .bet-price { font-size: 13px; color: #4caf50; }
.bet-card .bet-conf { font-size: 11px; color: #bae6fd; }
.bet-card .bet-reason { font-size: 11px; color: #bae6fd; margin-top: 4px; line-height: 1.4; }
.bet-card.value  { border-color: #264654; }
.bet-card.pass   { opacity: 0.6; }
.score-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.score-chip { background: #16262e; border: 1px solid #1e3a45; border-radius: 4px; padding: 4px 10px; font-size: 12px; color: #e0f2fe; }
.score-chip .conf { color: #ffc107; font-size: 11px; }
.patterns-box { background: #16262e; border-radius: 6px; padding: 10px 12px; font-size: 12px; color: #bae6fd; line-height: 1.6; }
.summary-box { background: #12222b; border-radius: 6px; padding: 10px 12px; font-size: 12px; color: #e0f2fe; line-height: 1.6; }
.stats-badge { font-size: 10px; padding: 2px 7px; border-radius: 3px; }
.stats-badge.has { background: #1b3d1b; color: #4caf50; }
.stats-badge.none { background: #2a2020; color: #cc7777; }
.result-error { color: #f87171; padding: 10px; font-size: 12px; }
.raw-result { font-size: 11px; color: #bae6fd; background: #0b1215; padding: 10px; border-radius: 6px; white-space: pre-wrap; max-height: 200px; overflow-y: auto; }

/* Analysis checkboxes & comp grouping */
.analysis-comp-header { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #16262e; font-size: 14px; font-weight: 700; color: #fbbf24; border-radius: 6px 6px 0 0; margin-top: 8px; cursor: pointer; user-select: none; letter-spacing: 0.3px; }
.analysis-comp-header:first-child { margin-top: 0; }
.analysis-comp-header .comp-count { background: #1e3a45; padding: 1px 7px; border-radius: 10px; font-size: 11px; color: #7dd3fc; margin-left: 4px; font-weight: 400; }
.analysis-comp-group { border: 1px solid #1e3a45; border-radius: 6px; overflow: hidden; }
.match-chk, .league-chk { width: 15px; height: 15px; cursor: pointer; accent-color: #38bdf8; flex-shrink: 0; }
.analysis-card-header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.analysis-teams { flex: 1; font-size: 15px; }
.analysis-teams .home-name { color: #67e8f9; font-weight: 600; }
.analysis-teams .away-name { color: #f9a8d4; font-weight: 600; }
.btn-select {
  background: linear-gradient(180deg, #213745 0%, #16262e 100%);
  color: #d2f1ff;
  border: 1px solid #2c4a59;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  box-shadow:
    0 3px 0 #0a1318,
    0 8px 18px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    transform 0.08s ease,
    box-shadow 0.12s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}
.btn-select:hover:not(:disabled) {
  background: linear-gradient(180deg, #294353 0%, #1b2f39 100%);
  border-color: #3b6477;
  color: #f0fbff;
}
.btn-select:focus-visible {
  outline: none;
  box-shadow:
    0 3px 0 #0a1318,
    0 0 0 2px rgba(56, 189, 248, 0.32),
    0 8px 18px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn-select:active:not(:disabled),
.btn-select.active,
.btn-select[aria-pressed="true"] {
  transform: translateY(2px);
  background: linear-gradient(180deg, #12202a 0%, #0f1a22 100%);
  border-color: #5fbef0;
  color: #f5fdff;
  box-shadow:
    0 1px 0 #071015,
    inset 0 2px 7px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.btn-select:disabled {
  cursor: not-allowed;
  color: #7ea0af;
  border-color: #223743;
  background: linear-gradient(180deg, #17252d 0%, #111b22 100%);
  box-shadow:
    0 2px 0 #0b1216,
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.btn-analyze-all { background: #1e3a45; color: #bae6fd; border: 1px solid #2e4c5e; padding: 5px 14px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.btn-analyze-all:hover { background: #264654; }
.btn-analyze-all:disabled { background: #16262e; color: #5b7c8a; cursor: default; border-color: #1e3a45; }
.progress-bar-wrap { height: 3px; background: #16262e; margin-top: 4px; border-radius: 2px; overflow: hidden; }
.progress-bar { height: 100%; background: #0ea5e9; transition: width 0.3s; }
.batch-bar { display:none; position:sticky; bottom:0; background:#0b1215; border-top:1px solid #0ea5e9; padding:8px 16px; z-index:100; align-items:center; gap:10px; flex-wrap:wrap; }
.batch-bar.visible { display:flex; }
.batch-btn { background:#0ea5e9; color:#fff; border:none; border-radius:5px; padding:5px 14px; cursor:pointer; font-size:12px; }
.batch-btn:hover { background:#0284c7; }
.batch-btn.kimi { background:#0891b2; }
.batch-btn.kimi:hover { background:#0e7490; }
.card-checkbox { width:16px; height:16px; cursor:pointer; accent-color:#38bdf8; flex-shrink:0; }
.date-input { background: #16262e; border: 1px solid #1e3a45; color: #bae6fd; padding: 3px 6px; border-radius: 4px; font-size: 11px; }

/* Loading state */
.loading { text-align: center; padding: 40px; color: #5b7c8a; font-size: 13px; }
.loading::before { content: '⏳ '; }

@media (max-width: 1240px) {
    .ms-board-header,
    .ms-board-summary {
        grid-template-columns: minmax(240px, 1fr);
    }
    .ms-board-toggle {
        display: none;
    }
}
