/* pp.tools/midterms. Builds on base.css; see THEME.md for the rules.
   Party colors are the one addition: blue and red for D and R, kept apart
   from the profit green and loss red. */

:root {
    --mt-dem: #3e7bfa;
    --mt-dem-dim: rgba(62, 123, 250, 0.16);
    --mt-rep: #e5484d;
    --mt-rep-dim: rgba(229, 72, 77, 0.16);
    --mt-ind: #b4b4c8;
    --mt-ind-dim: rgba(180, 180, 200, 0.14);
    --mt-none: #191929;
    --mt-flat: #2c2c48;
}

/* base.css leaves native button chrome alone; :where keeps this reset at
   zero specificity so every component class below still wins. */
:where(.mt-app button:not(.btn), .mt-drawer button:not(.btn)) {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.mt-app {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 1.75rem) 24px 3rem;
    font-family: var(--font);
    color: var(--text-primary);
    flex: 1;
}

.pos { color: var(--green); }
.neg { color: var(--red); }
.flat { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }

.mt-hint {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}
.mt-hint.err { color: var(--red); }

.mt-section-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.mt-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
}
.mt-empty.small { padding: 1.25rem; font-size: 0.8rem; }
.mt-empty code { font-family: var(--font-mono); font-size: 0.82rem; color: var(--brand-bright); }

/* ─── Header ─────────────────────────────────────────────────────────── */

.mt-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.mt-title {
    margin: 0 0 0.35rem;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.mt-head-link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* ─── Sources: the same cards as the PnL chart ─────────────────────── */

.mt-sources { display: flex; flex-direction: column; align-items: center; }
.mt-sources[hidden] { display: none; }
.mt-source-grid {
    width: 100%;
    max-width: 1160px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 8px;
}
.mt-source {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 24px 22px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
/* colored stripe across the top of each card */
.mt-source::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--border);
}
.mt-source:hover { transform: translateY(-1px); }
.mt-source--kalshi {
    border-color: rgba(0, 212, 170, 0.35);
    background: radial-gradient(120% 80% at 0% 0%, rgba(0, 212, 170, 0.07), transparent 55%), var(--bg-surface);
}
.mt-source--kalshi::before { background: linear-gradient(90deg, rgba(0, 212, 170, 0.2), var(--green) 50%, rgba(0, 212, 170, 0.2)); }
.mt-source--kalshi:hover { border-color: rgba(0, 212, 170, 0.65); box-shadow: 0 0 0 1px rgba(0, 212, 170, 0.25), 0 8px 32px rgba(0, 212, 170, 0.12); }
.mt-source--poly {
    border-color: rgba(82, 152, 255, 0.35);
    background: radial-gradient(120% 80% at 100% 0%, rgba(82, 152, 255, 0.07), transparent 55%), var(--bg-surface);
}
.mt-source--poly::before { background: linear-gradient(90deg, rgba(82, 152, 255, 0.2), var(--polymarket) 50%, rgba(82, 152, 255, 0.2)); }
.mt-source--poly:hover { border-color: rgba(82, 152, 255, 0.65); box-shadow: 0 0 0 1px rgba(82, 152, 255, 0.25), 0 8px 32px rgba(82, 152, 255, 0.12); }
.mt-source--pascal {
    border-color: rgba(255, 127, 63, 0.35);
    background: radial-gradient(120% 80% at 100% 0%, rgba(255, 127, 63, 0.07), transparent 55%), var(--bg-surface);
}
.mt-source--pascal::before { background: linear-gradient(90deg, rgba(255, 127, 63, 0.2), var(--pascal) 50%, rgba(255, 127, 63, 0.2)); }
.mt-source--pascal:hover { border-color: rgba(255, 127, 63, 0.65); box-shadow: 0 0 0 1px rgba(255, 127, 63, 0.25), 0 8px 32px rgba(255, 127, 63, 0.12); }
.mt-source-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mt-source-head h3 { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.mt-source-head .mt-badge { padding: 3px 10px; font-size: 0.7rem; }
.mt-source-link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition), background var(--transition);
}
.mt-source-link:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.06); }

.mt-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.mt-badge--kalshi { color: var(--kalshi); background: rgba(0, 212, 170, 0.16); border: 1px solid rgba(0, 212, 170, 0.25); }
.mt-badge--poly { color: var(--polymarket); background: rgba(82, 152, 255, 0.16); border: 1px solid rgba(82, 152, 255, 0.28); }
.mt-badge--pascal { color: var(--pascal); background: rgba(255, 127, 63, 0.16); border: 1px solid rgba(255, 127, 63, 0.28); }

.mt-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px 18px;
    border: 2px dashed rgba(0, 212, 170, 0.28);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.88rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.mt-drop svg { color: var(--green); opacity: 0.85; }
.mt-drop:hover { border-color: rgba(0, 212, 170, 0.55); background: var(--bg-card-hover); }
.mt-drop.drag { border-color: var(--green); background: rgba(0, 212, 170, 0.06); box-shadow: 0 0 24px rgba(0, 212, 170, 0.18); }
.mt-drop:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.mt-poly-form { display: flex; gap: 8px; }
.mt-poly-form .input { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 0.84rem; }
.mt-source--poly .input { border-color: rgba(82, 152, 255, 0.3); }
.mt-source--poly .input:hover { border-color: rgba(82, 152, 255, 0.5); }
.mt-source--poly .input:focus { border-color: var(--polymarket); box-shadow: 0 0 0 3px rgba(82, 152, 255, 0.15); outline: none; }
.mt-source--pascal .input { border-color: rgba(255, 127, 63, 0.3); }
.mt-source--pascal .input:hover { border-color: rgba(255, 127, 63, 0.5); }
.mt-source--pascal .input:focus { border-color: var(--pascal); box-shadow: 0 0 0 3px rgba(255, 127, 63, 0.15); outline: none; }

.mt-saved-title { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-secondary); }

.mt-sources-foot {
    width: 100%;
    max-width: 1160px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
}
.mt-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-md);
    background: var(--brand-gradient);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 24px rgba(187, 134, 252, 0.35);
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.mt-cta:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 30px rgba(187, 134, 252, 0.5); }
.mt-cta:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* ─── Results bar + controls ─────────────────────────────────────────── */

.mt-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 14px;
}
.mt-loaded { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.mt-loaded-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 5px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
.mt-chip-pfp { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); flex: none; }
.mt-chip-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.mt-chip-x {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    color: var(--text-muted);
    transition: color var(--transition), background var(--transition);
}
.mt-chip-x:hover { color: var(--red); background: var(--red-dim); }
.mt-bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mt-bar .btn { display: inline-flex; align-items: center; gap: 6px; }
.mt-poly-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: -4px 0 14px;
    padding: 12px 16px;
    border: 1px solid var(--border-brand);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
}
.mt-poly-inline[hidden] { display: none; }
.mt-poly-inline .input { flex: 1 1 260px; min-width: 200px; font-family: var(--font-mono); font-size: 0.84rem; }

.mt-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.mt-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.mt-tab {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    transition: color var(--transition), background var(--transition);
}
.mt-tab:hover { color: var(--text-primary); }
.mt-tab.active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-sm); }

.mt-chips { display: inline-flex; gap: 6px; }
.mt-chip {
    padding: 6px 13px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    transition: all var(--transition);
}
.mt-chip:hover { border-color: var(--brand-dim); color: var(--brand); }
.mt-chip.on { background: var(--brand-glow); border-color: var(--border-brand-strong); color: var(--brand-bright); }

.mt-seg {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.mt-seg-btn {
    padding: 5px 10px;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    transition: color var(--transition), background var(--transition);
}
.mt-seg-btn:hover { color: var(--text-primary); }
.mt-seg-btn.active { background: var(--bg-elevated); color: var(--text-primary); }

/* ─── Office cards (Kalshi's control cards, as PnL) ──────────────────── */

.mt-office-cards {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.mt-office {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 14px 12px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.mt-office:hover { border-color: var(--border-brand-strong); background: var(--bg-card); transform: translateY(-1px); }
.mt-office.active { border-color: var(--border-brand-strong); background: var(--brand-glow); }
.mt-office.empty { opacity: 0.55; }
.mt-office-label { font-size: 0.84rem; font-weight: 600; color: var(--text-primary); }
.mt-office-gauge { position: relative; width: 132px; height: 72px; }
.mt-gauge { width: 100%; height: 100%; overflow: visible; }
.mt-gauge-track { fill: none; stroke: var(--bg-elevated); stroke-width: 6; stroke-linecap: round; }
.mt-gauge-fill { fill: none; stroke: var(--green); stroke-width: 6; stroke-linecap: round; }
.mt-office-pnl {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.mt-office-sub { font-size: 0.74rem; color: var(--text-secondary); }

/* ─── Stats ──────────────────────────────────────────────────────────── */

.mt-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.mt-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-width: 0;
}
.mt-stat--accent { border-color: var(--border-brand); box-shadow: var(--shadow-glow); }
.mt-stat-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-secondary); }
.mt-stat-value { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-stat-sub { font-size: 0.75rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* ─── Race record bar (Kalshi's seat bar, as races won and lost) ─────── */

.mt-record {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
    margin-bottom: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.84rem;
    color: var(--text-secondary);
}
.mt-record:empty { display: none; }
.mt-record-side { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.mt-record-side--r { justify-content: flex-end; }
.mt-record-n { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mt-record-labels { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.mt-record-bar { display: flex; height: 8px; border-radius: var(--radius-pill); overflow: hidden; background: var(--bg-elevated); gap: 2px; }
.mt-record-fill.pos { background: var(--green); }
.mt-record-fill.neg { background: var(--red); }

/* ─── Panels ─────────────────────────────────────────────────────────── */

.mt-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    margin-bottom: 16px;
}
.mt-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.mt-panel-head h2 { margin: 0 0 4px; font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; }

/* ─── Map ────────────────────────────────────────────────────────────── */

.mt-map-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 16px;
    align-items: center;
}
.mt-svg { width: 100%; height: auto; display: block; }
.mt-st {
    stroke: var(--bg-base);
    stroke-width: 1.1;
    stroke-linejoin: round;
    transition: fill var(--transition), opacity var(--transition);
}
.mt-st.has { cursor: pointer; }
.mt-st.has:hover,
.mt-st.has:focus-visible { filter: brightness(1.22); outline: none; }
/* Outlines live in their own paths on top of the map, so neighbouring
   states can't paint over half the border. */
.mt-st-hl, .mt-st-sel { fill: none; pointer-events: none; stroke-linejoin: round; }
.mt-st-hl { stroke: #fff; stroke-width: 2; filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.6)); }
.mt-st-sel { stroke: var(--brand); stroke-width: 2.5; filter: drop-shadow(0 0 6px rgba(187, 134, 252, 0.55)); }
.mt-st-label {
    fill: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    text-anchor: middle;
    pointer-events: none;
    letter-spacing: 0.02em;
}
.mt-st-label.has { fill: #fff; }
.mt-st-value {
    fill: #fff;
    font-size: 10px;
    font-weight: 600;
    text-anchor: middle;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
    paint-order: stroke;
    stroke: rgba(7, 7, 14, 0.45);
    stroke-width: 2px;
}

.mt-tiles { display: flex; flex-direction: column; gap: 3px; }
.mt-tile {
    display: grid;
    grid-template-columns: 10px 26px 1fr;
    align-items: center;
    gap: 6px;
    padding: 4px 7px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--bg-card);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    cursor: default;
    transition: border-color var(--transition), background var(--transition);
}
.mt-tile.has { color: var(--text-primary); cursor: pointer; }
.mt-tile.has:hover { border-color: var(--border-brand-strong); background: var(--bg-card-hover); }
.mt-tile.selected { border-color: var(--brand); }
.mt-tile-swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--mt-none); }
.mt-tile-v { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.7rem; }

.mt-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 20px;
    margin-top: 14px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.mt-legend-scale { display: flex; align-items: center; gap: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mt-legend-bar {
    width: 160px;
    height: 8px;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.95), rgba(255, 107, 107, 0.28) 46%, var(--mt-flat) 50%, rgba(0, 212, 170, 0.28) 54%, rgba(0, 212, 170, 0.95));
}
.mt-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.mt-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.mt-swatch.none { background: var(--mt-none); border: 1px solid var(--border-strong); }
.mt-swatch.dem { background: var(--mt-dem); }
.mt-swatch.rep { background: var(--mt-rep); }
.mt-swatch.ind { background: var(--mt-ind); }
.mt-swatch.hatch { background: repeating-linear-gradient(45deg, rgba(180, 180, 200, 0.75) 0 2px, rgba(180, 180, 200, 0.15) 2px 5px); }
.mt-legend-nat {
    margin-left: auto;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    transition: border-color var(--transition), background var(--transition);
}
.mt-legend-nat:hover { border-color: var(--border-brand-strong); background: var(--bg-card-hover); }
.mt-legend-nat span { font-weight: 700; margin-left: 6px; font-variant-numeric: tabular-nums; }

/* ─── Side pills ─────────────────────────────────────────────────────── */

.mt-side {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    border: 1px solid transparent;
}
.mt-side.dem { color: #8db3ff; background: var(--mt-dem-dim); border-color: rgba(62, 123, 250, 0.3); }
.mt-side.rep { color: #ff8f93; background: var(--mt-rep-dim); border-color: rgba(229, 72, 77, 0.3); }
.mt-side.ind { color: #d6d6e4; background: var(--mt-ind-dim); border-color: rgba(180, 180, 200, 0.28); }
.mt-side.neu { color: var(--text-secondary); background: var(--bg-elevated); }
.mt-side.soft { border-style: dashed; background: transparent; }

.mt-yn {
    display: inline-block;
    padding: 1px 7px;
    border-radius: var(--radius-xs);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: var(--bg-elevated);
    color: var(--text-primary);
}
.mt-yn.no { color: var(--text-secondary); }

.mt-pf {
    display: inline-grid;
    place-items: center;
    width: 17px;
    height: 17px;
    flex: none;
    border-radius: 5px;
    font-size: 0.6rem;
    font-weight: 700;
}
.mt-pf.k { color: var(--kalshi); background: rgba(0, 212, 170, 0.14); }
.mt-pf.p { color: var(--polymarket); background: rgba(82, 152, 255, 0.14); }
.mt-pf.x { width: auto; padding: 0 3px; color: var(--pascal); background: rgba(255, 127, 63, 0.14); }

.mt-tag {
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gold);
    background: rgba(242, 184, 75, 0.14);
}

/* ─── Tooltip ────────────────────────────────────────────────────────── */

.mt-tip {
    position: fixed;
    z-index: 130;
    min-width: 220px;
    max-width: 400px;
    padding: 12px 14px;
    background: rgba(22, 22, 37, 0.97);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.8rem;
    pointer-events: none;
    backdrop-filter: blur(8px);
}
.mt-tip[hidden] { display: none; }
.mt-tip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 0.92rem; margin-bottom: 2px; }
.mt-tip-head span { font-weight: 700; font-variant-numeric: tabular-nums; }
.mt-tip-sub { color: var(--text-secondary); font-size: 0.74rem; margin-bottom: 8px; overflow-wrap: anywhere; }
.mt-tip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-top: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}
.mt-tip-row > :last-child { margin-left: auto; font-weight: 600; white-space: nowrap; }
.mt-tip-race { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-tip-more, .mt-tip-empty { color: var(--text-secondary); font-size: 0.74rem; padding-top: 4px; }
.mt-tip-foot { color: var(--brand); font-size: 0.72rem; margin-top: 8px; }
.mt-tip-news { margin-top: 6px; padding-left: 8px; border-left: 2px solid var(--text-muted); color: var(--text-secondary); font-size: 0.75rem; }
.mt-tip-news.call { border-left-color: var(--brand); color: var(--text-primary); }
.mt-tip-news.note { border-left-color: var(--gold); color: var(--text-primary); }

/* ─── Election night chart ───────────────────────────────────────────── */

.mt-night-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-night-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.mt-nstat {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    min-width: 0;
}
.mt-nstat-v { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.mt-chart { width: 100%; min-height: 320px; }
.mt-chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.mt-grid { stroke: var(--border); stroke-width: 1; }
.mt-grid.zero { stroke: var(--border-strong); }
.mt-axis { fill: var(--text-secondary); font-size: 11px; font-variant-numeric: tabular-nums; }
.mt-xtick { stroke: var(--border-strong); }
.mt-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mt-line.brand { stroke: var(--brand); }
.mt-line.pos { stroke: var(--green); }
.mt-line.neg { stroke: var(--red); }
.mt-area.pos { fill: rgba(0, 212, 170, 0.12); }
.mt-area.neg { fill: rgba(255, 107, 107, 0.12); }
.mt-vline { stroke-width: 1; stroke-dasharray: 2 5; }
.mt-vline.polls { stroke: rgba(255, 255, 255, 0.09); }
.mt-vline.call.neu { stroke: rgba(180, 180, 200, 0.35); }

/* Moments: a marker on the line, a flag in the rows above, a stem between */
.mt-m { stroke: var(--bg-surface); stroke-width: 1.5; fill: var(--mt-ind); transition: transform var(--transition); transform-box: fill-box; transform-origin: center; }
.mt-m.dem { fill: var(--mt-dem); }
.mt-m.rep { fill: var(--mt-rep); }
.mt-m.ind, .mt-m.neu { fill: var(--mt-ind); }
.mt-m.ring { fill: var(--bg-surface); stroke-width: 3; }
.mt-m.ring.dem { stroke: var(--mt-dem); }
.mt-m.ring.rep { stroke: var(--mt-rep); }
.mt-m.you.pos { fill: var(--green); }
.mt-m.you.neg { fill: var(--red); }
.mt-m.note { fill: var(--gold); }
.mt-m.polls { fill: var(--text-secondary); stroke: none; }
.mt-hit { fill: transparent; }
.mt-ev { cursor: pointer; outline: none; }
.mt-ev.hot .mt-m, .mt-ev:focus-visible .mt-m { transform: scale(1.35); }
.mt-stem { stroke-width: 1; stroke-dasharray: 2 3; stroke: rgba(180, 180, 200, 0.35); }
.mt-stem.dem { stroke: rgba(62, 123, 250, 0.55); }
.mt-stem.rep { stroke: rgba(229, 72, 77, 0.55); }
.mt-stem.you.pos { stroke: rgba(0, 212, 170, 0.55); }
.mt-stem.you.neg { stroke: rgba(255, 107, 107, 0.55); }
.mt-stem.note { stroke: rgba(242, 184, 75, 0.55); }
.mt-flag { fill: var(--bg-card); stroke: var(--border-strong); stroke-width: 1; transition: fill var(--transition), stroke var(--transition); }
.mt-flag.dem { stroke: rgba(62, 123, 250, 0.6); }
.mt-flag.rep { stroke: rgba(229, 72, 77, 0.6); }
.mt-flag.you.pos { stroke: rgba(0, 212, 170, 0.6); }
.mt-flag.you.neg { stroke: rgba(255, 107, 107, 0.6); }
.mt-flag.note { stroke: rgba(242, 184, 75, 0.6); }
.mt-ev.hot .mt-flag, .mt-ev:focus-visible .mt-flag { fill: var(--bg-card-hover); stroke: var(--brand-bright); }
.mt-flag-text { fill: var(--text-primary); font-size: 10.5px; font-weight: 600; pointer-events: none; }

.mt-shape-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-left: auto; font-size: 0.74rem; color: var(--text-secondary); }
.mt-shape-key span { display: inline-flex; align-items: center; gap: 6px; }
.mt-k { display: inline-block; width: 9px; height: 9px; background: var(--mt-ind); }
.mt-k.call { border-radius: 50%; background: var(--mt-dem); }
.mt-k.flip { transform: rotate(45deg); width: 8px; height: 8px; background: var(--mt-rep); }
.mt-k.swing { width: 10px; height: 9px; background: var(--mt-ind); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.mt-k.you { border-radius: 2px; background: var(--green); }
.mt-k.polls { width: 8px; height: 7px; background: var(--text-secondary); clip-path: polygon(50% 0, 100% 100%, 0 100%); }

.mt-tip-time { font-size: 0.74rem; font-weight: 500 !important; color: var(--text-secondary); }
.mt-tip-title { font-weight: 600; margin: 2px 0 6px; line-height: 1.35; }
.mt-tip-line { color: var(--text-secondary); font-size: 0.76rem; line-height: 1.4; margin-bottom: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mt-tip-help { color: var(--text-primary); font-size: 0.8rem; line-height: 1.45; max-width: 280px; }
.mt-cross-line { stroke: var(--border-strong); }
.mt-cross-dot { fill: var(--bg-base); stroke: var(--brand-bright); stroke-width: 2; }
.mt-hover { cursor: crosshair; }

.mt-news-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    margin: 0 0 6px;
}
.mt-check { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-primary); cursor: pointer; }
.mt-check input { accent-color: var(--brand); margin: 0; }

.mt-log {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.mt-log:empty { display: none; }
.mt-log-item {
    display: grid;
    grid-template-columns: 62px 12px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
}
.mt-log-item:first-child { border-top: 0; }
.mt-log-item.link { cursor: pointer; }
.mt-log-item.link:hover { background: rgba(255, 255, 255, 0.02); }
.mt-log-item.more { display: block; color: var(--text-secondary); text-align: center; }
.mt-log-time { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.mt-log-icon { width: 9px; height: 9px; border-radius: 50%; background: var(--mt-ind); }
.mt-log-icon.dem { background: var(--mt-dem); }
.mt-log-icon.rep { background: var(--mt-rep); }
.mt-log-icon.flip, .mt-log-icon.note { transform: rotate(45deg); border-radius: 1px; width: 8px; height: 8px; }
.mt-log-icon.note { background: var(--gold); }
.mt-log-icon.swing { border-radius: 1px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.mt-log-icon.you { border-radius: 2px; }
.mt-log-icon.you.pos { background: var(--green); }
.mt-log-icon.you.neg { background: var(--red); }
.mt-log-icon.polls { background: var(--text-secondary); clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.mt-log-kind { display: inline-block; margin-right: 8px; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); }
.mt-log-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-log-race { font-weight: 600; font-size: 0.76rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mt-log-val { display: flex; gap: 8px; font-variant-numeric: tabular-nums; color: var(--text-secondary); white-space: nowrap; }
.mt-log-val span { min-width: 74px; text-align: right; font-weight: 600; }

/* ─── Tables ─────────────────────────────────────────────────────────── */

.mt-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.mt-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.mt-table th {
    padding: 9px 10px;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.mt-table td { padding: 9px 10px; border-top: 1px solid var(--border); vertical-align: middle; }
.mt-table tr:first-child td { border-top: 0; }
.mt-table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.mt-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mt-table .rank { width: 32px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.mt-board-row { cursor: pointer; }
.mt-board-note { margin-top: 8px; }
.mt-td-market { display: flex; align-items: flex-start; gap: 8px; min-width: 200px; }
.mt-td-market > span:last-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mt-td-market a { color: var(--text-primary); }
.mt-td-market a:hover { color: var(--brand-bright); }
.mt-td-dir, .mt-td-group { font-size: 0.72rem; color: var(--text-secondary); }

.mt-footnote { margin: 4px 2px 0; font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5; }

/* ─── Drawer ─────────────────────────────────────────────────────────── */

.mt-scrim {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(3, 3, 8, 0.5);
}
.mt-scrim[hidden] { display: none; }
.mt-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    width: min(760px, 100vw);
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    transform: translateX(102%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}
.mt-drawer.open { transform: none; }
.mt-drawer-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}
.mt-drawer-titles { flex: 1; min-width: 0; }
.mt-drawer-titles h2 { margin: 0; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.mt-icon-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all var(--transition);
}
.mt-icon-btn:hover { border-color: var(--brand-dim); color: var(--brand); background: var(--bg-card-hover); }
.mt-drawer-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }

.mt-dstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mt-dstats > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
}
.mt-dstat-v { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.mt-dchart { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); }
.mt-dchart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.mt-mini { width: 100%; height: 110px; display: block; }
.mt-mini-area { fill: rgba(187, 134, 252, 0.14); }
.mt-mini-axis { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; margin-top: 2px; }

/* A race in the drawer: a one-line summary that opens to its trades */
.mt-race {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    scroll-margin-top: 12px;
}
.mt-race > summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    transition: background var(--transition);
}
.mt-race > summary::-webkit-details-marker { display: none; }
.mt-race > summary:hover { background: var(--bg-card-hover); }
.mt-race > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.mt-race[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.mt-race[open] > summary .mt-race-side { display: none; }
.mt-race-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.mt-chev { flex: none; align-self: center; color: var(--text-secondary); transition: transform var(--transition); }
.mt-race[open] .mt-chev { transform: rotate(180deg); }
.mt-dhint { margin: 0; }
.mt-race-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.mt-race-head > div:first-child { flex: 1; min-width: 0; }
.mt-race-head h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 600; }
.mt-race-result { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.mt-race-pnl { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.mt-race-pnl > span:first-child { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.mt-winner { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; font-weight: 600; }
.mt-winner.dem { color: #8db3ff; }
.mt-winner.rep { color: #ff8f93; }
.mt-winner.ind, .mt-winner.neu { color: var(--text-primary); }

.mt-net {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
}
.mt-net-text { flex: 1; min-width: 240px; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.45; }
.mt-pays { display: flex; flex-wrap: wrap; gap: 6px 14px; width: 100%; }
.mt-pay { font-size: 0.76rem; color: var(--text-secondary); }
.mt-pay strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.mt-pay.dem strong { color: #8db3ff; }
.mt-pay.rep strong { color: #ff8f93; }

/* ─── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 980px) {
    .mt-source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mt-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mt-night-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mt-office-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .mt-app { padding-left: 16px; padding-right: 16px; }
    .mt-head { flex-direction: column; align-items: flex-start; }
    .mt-title { font-size: 1.6rem; }
    .mt-source-grid { grid-template-columns: 1fr; }
    .mt-sources-foot { flex-direction: column; align-items: stretch; }
    .mt-cta { justify-content: center; }
    .mt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mt-night-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mt-map-wrap { grid-template-columns: 1fr; }
    .mt-tiles { flex-direction: row; flex-wrap: wrap; }
    .mt-tile { flex: 1 1 30%; }
    .mt-record { grid-template-columns: 1fr; text-align: center; }
    .mt-record-side, .mt-record-side--r { justify-content: center; }
    .mt-panel { padding: 16px; }
    .mt-log-item { grid-template-columns: 56px 10px minmax(0, 1fr); }
    .mt-log-race, .mt-log-val { grid-column: 3; }
    .mt-tabs { width: 100%; overflow-x: auto; }
    .mt-seg { max-width: 100%; overflow-x: auto; }
    .mt-office-gauge { width: 112px; height: 62px; }
    .mt-office-pnl { font-size: 1.1rem; }
    .mt-drawer-body { padding: 12px; }
    .mt-dstats { gap: 6px; }
}

.mt-arrow { margin: 0 4px; color: var(--text-muted); }
.mt-drawer .mt-table td, .mt-drawer .mt-table th { padding: 8px 8px; }
.mt-drawer .mt-td-market { min-width: 170px; }

/* Cashed-out pot under the value line */
.mt-area.cashed { fill: rgba(237, 237, 240, 0.07); }
.mt-line.cashed { stroke: var(--text-secondary); stroke-width: 1; stroke-dasharray: 3 3; }
.mt-chart-legend { display: flex; gap: 16px; margin: 0 0 6px; font-size: 0.76rem; color: var(--text-secondary); }
.mt-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mt-sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.mt-sw.open { background: rgba(187, 134, 252, 0.5); border: 1px solid var(--brand); }
.mt-sw.cashed { background: rgba(237, 237, 240, 0.12); border: 1px dashed var(--text-secondary); }
.mt-slash { margin: 0 6px; color: var(--text-muted); font-weight: 400; }
.mt-tip-minor { font-size: 0.74rem; color: var(--text-secondary); border-top: 0; padding: 1px 0 1px 10px; }
.mt-tip-minor > :last-child { font-weight: 500; }

.mt-swatch.pos { background: rgba(0, 212, 170, 0.75); }
.mt-swatch.neg { background: rgba(255, 107, 107, 0.75); }
.mt-news-bar .mt-seg { flex: none; }

@media (max-width: 720px) {
    .mt-office-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─── Combos ─────────────────────────────────────────────────────────── */
.mt-combo-stats { margin-bottom: 12px; }
.mt-combo-stats:empty { display: none; }
.mt-combo-list { display: flex; flex-direction: column; gap: 8px; }
/* One combo: result, when, PnL on top; small legs and cost below */
.mt-combo {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
}
.mt-combo-meta { min-width: 0; font-size: 0.8rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-combo-pnl { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mt-combo .mt-legs { grid-column: 1 / 3; gap: 4px; }
.mt-combo .mt-leg { padding: 1px 7px; gap: 4px; font-size: 0.7rem; }
.mt-combo-cost { align-self: start; font-size: 0.74rem; color: var(--text-secondary); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mt-combos-more { align-self: flex-start; }
.mt-combo-status {
    min-width: 48px;
    text-align: center;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: var(--bg-elevated);
    color: var(--text-secondary);
}
.mt-combo-status.pos { color: var(--green); background: var(--green-dim); }
.mt-combo-status.neg { color: var(--red); background: var(--red-dim); }
.mt-legs { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-leg {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    font-size: 0.76rem;
    color: var(--text-primary);
    white-space: nowrap;
}
.mt-leg.won { border-color: rgba(0, 212, 170, 0.35); }
.mt-leg.won::first-letter { color: var(--green); }
.mt-leg.lost { border-color: rgba(255, 107, 107, 0.35); color: var(--text-secondary); text-decoration: line-through; text-decoration-color: rgba(255, 107, 107, 0.6); }
.mt-leg.open { border-style: dashed; }
.mt-leg.here { box-shadow: 0 0 0 1px var(--brand-dim) inset; }
.mt-combos-note { margin-top: 12px; }
.mt-tip-line .mt-leg { font-size: 0.7rem; padding: 2px 8px; }
.mt-m.combo.pos { fill: var(--green); }
.mt-m.combo.neg { fill: var(--red); }
.mt-stem.combo.pos { stroke: rgba(0, 212, 170, 0.55); }
.mt-stem.combo.neg { stroke: rgba(255, 107, 107, 0.55); }
.mt-flag.combo.pos { stroke: rgba(0, 212, 170, 0.6); }
.mt-flag.combo.neg { stroke: rgba(255, 107, 107, 0.6); }
.mt-log-icon.combo { transform: rotate(45deg); border-radius: 2px; width: 8px; height: 8px; }
.mt-log-icon.combo.pos { background: var(--green); }
.mt-log-icon.combo.neg { background: var(--red); }

/* ─── Accounts list (same rows as the PnL chart's saved accounts) ───── */
.mt-poly-save { font-size: 0.8rem; color: var(--text-secondary); align-self: flex-start; }
.mt-acct-section { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.mt-acct-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mt-acct-actions { display: flex; gap: 2px; }
.mt-link {
    padding: 3px 7px;
    border-radius: var(--radius-xs);
    font-size: 0.74rem;
    color: var(--text-secondary);
    transition: color var(--transition), background var(--transition);
}
.mt-link:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.06); }
.mt-acct-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; padding-right: 2px; }
.mt-acct {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.015);
    cursor: pointer;
    user-select: none;
    transition: border-color var(--transition), background var(--transition);
}
.mt-acct:hover { border-color: var(--border-brand-strong); background: var(--brand-glow); }
.mt-acct.on { border-color: var(--border-brand-strong); background: rgba(187, 134, 252, 0.1); }
.mt-acct:focus-within { outline: 2px solid var(--brand); outline-offset: 1px; }
.mt-acct:has(input:disabled) { cursor: default; }
.mt-vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.mt-acct-check {
    width: 15px;
    height: 15px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 4px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    transition: background var(--transition), border-color var(--transition);
}
.mt-acct-check svg { opacity: 0; transition: opacity var(--transition); }
.mt-acct.on .mt-acct-check { background: var(--brand-dim); border-color: var(--brand-dim); }
.mt-acct.on .mt-acct-check svg { opacity: 1; }
.mt-acct-pfp {
    width: 28px;
    height: 28px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}
.mt-acct-pfp img { width: 100%; height: 100%; object-fit: cover; }
.mt-acct-pfp.file { border-radius: 7px; background: rgba(0, 212, 170, 0.1); color: var(--kalshi); }
.mt-acct-pfp.person { background: rgba(82, 152, 255, 0.1); color: var(--polymarket); }
.mt-acct-pfp.step { border-radius: 7px; background: var(--brand-glow); color: var(--brand); }
.mt-acct-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
.mt-acct-name { font-size: 0.86rem; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-acct-meta { font-size: 0.74rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-acct-meta .mono { font-family: var(--font-mono); font-size: 0.72rem; }
.mt-acct-btn {
    flex: none;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    transition: color var(--transition), background var(--transition);
}
.mt-acct .mt-acct-btn { opacity: 0.45; }
.mt-acct:hover .mt-acct-btn, .mt-acct-btn:focus-visible { opacity: 1; }
.mt-acct-btn:hover { color: var(--red); background: var(--red-dim); }
.mt-acct-btn.save:hover { color: var(--brand-bright); background: var(--brand-glow); }

/* ─── Loading progress ───────────────────────────────────────────────── */
.mt-progress {
    width: 100%;
    max-width: 880px;
    margin: 16px auto;
    padding: 14px 16px;
    border: 1px solid var(--border-brand);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mt-progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mt-progress-head strong { font-size: 0.95rem; font-weight: 600; }
.mt-progress-head .mt-hint { font-variant-numeric: tabular-nums; }
.mt-progress-list { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; }
.mt-prog { display: flex; align-items: center; gap: 12px; }
.mt-prog-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.mt-prog-top { display: flex; justify-content: space-between; gap: 10px; font-size: 0.86rem; }
.mt-prog-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-prog-state { flex: none; color: var(--text-secondary); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.mt-prog-bar { height: 6px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.mt-prog-bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--brand); transform: scaleX(0); transform-origin: left center; transition: transform 0.3s ease; }
.mt-prog-text { font-size: 0.76rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mt-prog.wait { opacity: 0.55; }
.mt-prog.run .mt-prog-bar i { background: linear-gradient(90deg, var(--brand-dim), var(--brand-bright), var(--brand-dim)); background-size: 200% 100%; animation: mt-prog-shine 1.4s linear infinite; }
.mt-prog.done .mt-prog-bar i { background: var(--green); }
.mt-prog.done .mt-prog-state { color: var(--green); }
.mt-prog.err .mt-prog-bar i { background: var(--red); }
.mt-prog.err .mt-prog-state, .mt-prog.err .mt-prog-text { color: var(--red); white-space: normal; }
@keyframes mt-prog-shine { from { background-position: 200% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
    .mt-prog.run .mt-prog-bar i { animation: none; }
    .mt-prog-bar i { transition: none; }
}
.mt-cta.busy { opacity: 0.6; cursor: progress; }
.mt-loaded-chip.err { color: var(--red); border-color: rgba(255, 107, 107, 0.35); padding-left: 10px; }

/* ─── Combo split ────────────────────────────────────────────────────── */
.mt-map-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.mt-leg-odds, .mt-leg-pnl { display: inline-block; text-decoration: none; font-variant-numeric: tabular-nums; }
.mt-leg-odds { color: var(--text-secondary); font-size: 0.7rem; }
.mt-leg-pnl { font-weight: 600; padding-left: 6px; border-left: 1px solid var(--border-strong); }
.mt-leg-pnl.flat { color: var(--text-muted); font-weight: 500; }
.mt-race-combos { margin: 0; font-size: 0.84rem; color: var(--text-secondary); }
.mt-combo-jump { padding: 0; font-size: 0.84rem; font-weight: 500; color: var(--brand-bright); }
.mt-combo-jump:hover { background: none; color: var(--brand); text-decoration: underline; }
.mt-progress[hidden], .mt-acct-section[hidden], .mt-link[hidden], .mt-check[hidden] { display: none; }
@media (max-width: 560px) {
    .mt-combo-stats { grid-template-columns: 1fr; }
    .mt-combo .mt-legs, .mt-combo-cost { grid-column: 1 / -1; }
    .mt-combo-cost { text-align: left; }
}

/* ─── Combo lookup question ──────────────────────────────────────────── */
.mt-dialog {
    width: min(420px, calc(100% - 32px));
    padding: 20px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
}
.mt-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.mt-dialog h2 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 600; }
.mt-dialog p { margin: 0 0 18px; font-size: 0.88rem; line-height: 1.5; color: var(--text-secondary); }
.mt-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ─── Saved lists: chart-style headers and badges ────────────────────── */
.mt-acct-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mt-acct-sub { display: inline-flex; align-items: center; gap: 4px; font-size: 0.66rem; font-weight: 500; color: rgba(110, 231, 183, 0.85); }
.mt-acct-name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mt-acct-name-row .mt-acct-name { flex: 0 1 auto; min-width: 0; }
.mt-saved-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex: none;
    padding: 1px 6px 1px 5px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(16, 185, 129, 0.32);
    background: rgba(16, 185, 129, 0.14);
    color: rgba(110, 231, 183, 0.95);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
}
@media (max-width: 720px) {
    .mt-source-grid { grid-template-columns: 1fr; gap: 16px; }
}
/* Save an uploaded CSV to this browser (same as the PnL chart's button) */
.mt-csv-save {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 7px;
    border: 1px solid rgba(187, 134, 252, 0.32);
    background: rgba(187, 134, 252, 0.08);
    color: var(--brand-bright);
    font-size: 0.7rem;
    font-weight: 600;
    transition: border-color var(--transition), background var(--transition);
}
.mt-csv-save:hover { border-color: rgba(187, 134, 252, 0.6); background: rgba(187, 134, 252, 0.16); }
.mt-csv-save:disabled { opacity: 0.6; cursor: progress; }

/* Watermark for screenshots, like the PnL chart's */
.mt-map-wrap { position: relative; }
/* bottom right of the map, above "National markets" */
.mt-watermark {
    position: absolute;
    right: 0;
    bottom: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(187, 134, 252, 0.18);
    pointer-events: none;
    user-select: none;
}
.mt-watermark-svg { fill: rgba(187, 134, 252, 0.18); font-size: 13px; font-weight: 600; pointer-events: none; user-select: none; }
