﻿html,
body {
    width: 100%;
    min-height: 100%;
}


body {
    margin: 0;
    background: #fff;
    color: #111;
    font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
    overflow-x: hidden;
}

.app-shell.is-locked {
    visibility: hidden;
    height: 100vh;
    overflow: hidden;
}

.authorization-gate {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 77, 90, .15), transparent 34%),
        radial-gradient(circle at 78% 82%, rgba(16, 185, 129, .12), transparent 36%),
        linear-gradient(145deg, #07101b, #111827 52%, #07131a);
    transition: opacity .24s ease, visibility .24s ease;
}

.authorization-gate.is-authorized {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.authorization-card {
    width: min(360px, calc(100vw - 40px));
    padding: 34px 30px 30px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 24px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 28px 70px rgba(0, 0, 0, .36);
    color: #111827;
}

.authorization-mark {
    width: 54px;
    height: 54px;
    margin: 0 auto 18px;
    border: 8px solid #ff4d5a;
    border-top-width: 14px;
    border-radius: 18px 18px 24px 24px;
    box-shadow: 0 10px 24px rgba(255, 77, 90, .25);
}

.authorization-card h1 {
    margin: 0;
    text-align: center;
    font-size: 26px;
    font-weight: 900;
}

.authorization-card > p:not(.authorization-error) {
    margin: 9px 0 24px;
    color: #6b7280;
    text-align: center;
    font-size: 14px;
}

.authorization-card label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-size: 13px;
    font-weight: 800;
}

.authorization-card input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #dbe1e9;
    border-radius: 12px;
    outline: none;
    background: #f8fafc;
    color: #111827;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 7px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.authorization-card input:focus {
    border-color: #ff4d5a;
    box-shadow: 0 0 0 4px rgba(255, 77, 90, .12);
}

.authorization-card input.has-error {
    border-color: #dc2626;
}

.authorization-error {
    min-height: 20px;
    margin: 6px 0 7px;
    color: #dc2626;
    font-size: 12px;
    font-weight: 700;
}

.authorization-card button {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff5a62, #ef334b);
    color: #fff;
    box-shadow: 0 12px 24px rgba(239, 51, 75, .25);
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
}

.authorization-card button:active {
    transform: translateY(1px);
}

button,
input {
    font: inherit;
}

.money-app {
    min-height: 100vh;
    background: #fff;
    color: #111;
}

.money-app[data-theme="light"] {
    background: #fff;
    color: #111;
}

.workspace {
    display: grid;
    grid-template-columns: 680px 310px;
    justify-content: center;
    gap: 32px;
    min-height: 100vh;
    padding: 40px 24px 48px;
}

.chart-stage {
    position: relative;
    width: 680px;
    min-height: 1180px;
}

/* Bubble mode owns the complete canvas, including the area around the panel. */
.money-app:has(#bubblePanel:not(.is-hidden)),
.workspace:has(#bubblePanel:not(.is-hidden)),
.chart-stage:has(#bubblePanel:not(.is-hidden)) {
    background:
        radial-gradient(circle at 48% 20%, rgba(83,28,42,.25), transparent 36%),
        radial-gradient(circle at 54% 84%, rgba(12,92,73,.20), transparent 40%),
        linear-gradient(145deg, #050913 0%, #111722 48%, #07121c 100%);
}

.line-head {
    position: relative;
    z-index: 14;
    display: grid;
    grid-template-columns: 1fr 190px 180px;
    align-items: end;
    gap: 16px;
    min-height: 150px;
    margin-bottom: 22px;
}

.line-head h2 {
    margin: 0;
    color: #080808;
    font-size: 46px;
    line-height: .98;
    font-weight: 900;
    letter-spacing: 0;
    text-shadow: 0 2px 0 rgba(0,0,0,.08);
}

.index-card,
.time-badge {
    min-height: 58px;
    padding: 12px 16px;
    border: 1px solid #ece8e4;
    border-radius: 9px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 12px 30px rgba(20,20,20,.045);
    color: #171717;
    font-size: 18px;
    line-height: 1;
    white-space: nowrap;
}

.index-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    column-gap: 8px;
    row-gap: 4px;
}

.index-card span {
    font-weight: 900;
}

.index-card strong {
    font-size: 22px;
    font-weight: 900;
}

.index-card em {
    grid-column: 1 / -1;
    color: #006c52;
    font-size: 14px;
    font-style: normal;
    font-weight: 1000;
    text-align: center;
}

.line-wrap {
    position: relative;
    width: 680px;
    height: 930px;
    margin-top: 0;
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.line2-wrap {
    position: relative;
    width: 680px;
    height: 930px;
    margin-top: 0;
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.session-control {
    position: absolute;
    z-index: 24;
    left: 10px;
    top: 6px;
    min-width: 210px;
    min-height: 42px;
    display: flex;
    align-items: center;
    pointer-events: auto;
}

.session-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.session-actions button {
    min-width: 74px;
    height: 34px;
    border: 1px solid #d8d8d8;
    border-radius: 999px;
    background: rgba(255,255,255,.94);
    color: #111;
    box-shadow: 0 8px 22px rgba(0,0,0,.08);
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
}

.session-actions button:hover {
    border-color: #c91d2a;
    color: #b30012;
}

.session-title {
    color: #111;
    font-size: 25px;
    font-weight: 1000;
    line-height: 1.05;
    letter-spacing: 0;
    text-shadow: 0 1px 0 rgba(255,255,255,.9);
    white-space: nowrap;
}

.line-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.line-svg,
.line2-svg {
    pointer-events: none;
    overflow: visible;
    font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
    shape-rendering: geometricPrecision;
    text-rendering: geometricPrecision;
}

.line2-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.final-line-label,
.final-label-connector {
    transform-box: fill-box;
    transform-origin: left center;
    animation: labelPush 1800ms cubic-bezier(.16,1,.3,1) both;
}

@keyframes labelPush {
    from {
        opacity: .76;
        transform: translateY(var(--label-shift-y, 0));
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flow-legend {
    position: absolute;
    right: 18px;
    top: 164px;
    z-index: 12;
    display: none;
    gap: 8px;
    font-size: 17px;
    font-weight: 700;
}

.flow-legend span,
.race-keys span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    display: inline-block;
}

.dot.red {
    background: #e04a3d;
}

.dot.blue {
    background: #4f8fd8;
}

.dot.green {
    background: #15c28d;
}

.rank-panel {
    align-self: stretch;
    margin-top: 172px;
    min-height: 600px;
    max-height: calc(100vh - 80px);
    overflow: auto;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
}

.rank-panel h1 {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 700;
}

.rank-panel p {
    margin: 3px 0 10px;
    color: #aaa;
    font-size: 12px;
}

.two-inputs,
.two-buttons,
.mode-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.mode-buttons {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.setting-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #aaa;
    font-size: 12px;
}

.rank-panel input,
.rank-panel button {
    height: 30px;
    border: 1px solid #444;
    background: #222;
    color: #fff;
    text-align: center;
}

.rank-panel > button {
    width: 100%;
    margin-bottom: 10px;
}

.rank-panel button.active {
    color: #fff;
    background: #1e5f97;
    border-color: #4b91d2;
}

.rank-list {
    display: grid;
    gap: 5px;
    padding-top: 4px;
}

.api-test-panel {
    width: min(1022px, calc(100% - 48px));
    margin: 0 auto 42px;
    padding: 18px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 14px 20px;
    align-items: center;
    border: 1px solid #dce5ef;
    border-radius: 14px;
    background: #f8fafc;
    box-shadow: 0 8px 24px rgba(31, 50, 74, .08);
    box-sizing: border-box;
}

.api-test-copy {
    display: grid;
    gap: 5px;
}

.api-test-copy strong {
    color: #172033;
    font-size: 16px;
}

.api-test-copy span {
    color: #718096;
    font-size: 13px;
}

.api-test-actions {
    display: flex;
    gap: 10px;
}

.api-test-actions button {
    min-width: 120px;
    height: 40px;
    border: 0;
    border-radius: 9px;
    background: #2878d0;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.api-test-actions button.recover-button {
    background: #0b8a62;
}

.api-test-actions button:disabled {
    cursor: wait;
    opacity: .65;
}

.api-test-result {
    grid-column: 1 / -1;
    min-height: 20px;
    padding-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    border-top: 1px solid #e5ebf2;
    color: #7b8798;
    font-size: 13px;
}

.api-test-result.is-testing { color: #8b6a19; }
.api-test-result.is-success { color: #087a50; }
.api-test-result.is-error { color: #c73737; }

.api-test-result strong {
    font-size: 14px;
}

.money-app[data-theme="dark"] .api-test-panel {
    border-color: #2f3a49;
    background: #151b24;
    box-shadow: none;
}

.money-app[data-theme="dark"] .api-test-copy strong {
    color: #f4f7fb;
}

.money-app[data-theme="dark"] .api-test-copy span,
.money-app[data-theme="dark"] .api-test-result {
    color: #9daabd;
}

.money-app[data-theme="dark"] .api-test-result {
    border-top-color: #2f3a49;
}

.recording .api-test-panel {
    display: none;
}

.rank-item {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    gap: 8px;
    align-items: center;
    font-size: 14px;
}

.rank-item .value {
    font-weight: 700;
}

.positive {
    color: #d9463e;
}

.negative {
    color: #4f8fd8;
}

.is-hidden {
    display: none !important;
}

.race-panel {
    position: absolute;
    inset: 5px 0 auto 0;
    z-index: 32;
    display: grid;
    grid-template-rows: auto auto auto;
    align-content: start;
    padding: 12px;
    border-radius: 30px;
    background: linear-gradient(160deg, #ffffff 0%, #f8fbfd 52%, #eef3f7 100%);
    box-shadow:
        16px 20px 48px rgba(112, 130, 150, .18),
        -10px -10px 30px rgba(255,255,255,.92),
        inset 0 1px 0 rgba(255,255,255,.92);
    overflow: hidden;
}

.matrix-panel {
    position: absolute;
    inset: 0 auto auto 0;
    z-index: 38;
    box-sizing: border-box;
    width: 100%;
    min-height: 760px;
    padding: 28px 24px 36px;
    background: linear-gradient(155deg, #fff 0%, #fffafa 48%, #f6fffa 100%);
    color: #172033;
    overflow-x: auto;
}

.matrix-header { display:flex; align-items:end; justify-content:space-between; gap:16px; min-width:760px; }
.matrix-header h2 { display:flex; align-items:baseline; flex:1; margin:0; color:#172033; font-size:34px; font-weight:1000; }
.matrix-header h2 b { color:#df1f25; }
.matrix-header h2 b { margin-left:auto; text-align:right; }
.matrix-header h2 em { color:#172033; font-size:1em; font-style:normal; }
.matrix-session-actions { display:flex; align-items:center; gap:6px; margin-left:auto; }
.matrix-session-actions button { min-width:48px; height:27px; border:1px solid #d7e1eb; border-radius:999px; background:#fff; color:#172033; font-size:13px; font-weight:1000; }
.matrix-header > span { color:#68758a; font-size:15px; font-weight:800; }
.matrix-time-pill { margin-left:8px; padding:5px 10px; border:1px solid #e94c56; border-radius:13px; background:rgba(255,255,255,.9); box-shadow:5px 7px 16px rgba(233,76,86,.12); color:#d72f39; white-space:nowrap; font-size:12px; font-weight:900; }.matrix-time-pill b { color:#d72f39; font-size:17px; }
.matrix-subtitle { min-width:760px; margin:8px 0 20px; color:#7a8798; font-size:13px; font-weight:800; }
.matrix-grid { display:grid; grid-template-columns:22px 118px repeat(var(--matrix-slots, 9), minmax(62px,1fr)); gap:3px; min-width:760px; align-items:stretch; }
.matrix-corner { grid-column:1 / span 2; padding:9px 6px; color:#778397; font-size:13px; font-weight:900; }
.matrix-time { padding:9px 2px; color:#172033; text-align:center; font-size:14px; font-weight:1000; }
.matrix-rank { display:grid; place-items:center; align-self:center; width:auto; height:auto; color:#172033; font-size:12px; font-weight:1000; }
.matrix-rank.in { color:#ef252b; }.matrix-rank.out { color:#159b5c; }
.matrix-name { display:flex; align-items:center; min-width:0; padding:0 4px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:15px; font-weight:1000; }
.matrix-cell { display:grid; place-items:center; min-height:42px; border-radius:4px; font-size:14px; font-weight:1000; font-variant-numeric:tabular-nums; }
.matrix-cell.in { color:#b5222a; background:rgba(247,116,122,var(--matrix-strength)); }.matrix-cell.out { color:#176e45; background:rgba(86,187,132,var(--matrix-strength)); }.matrix-cell.empty { color:#aab4c0; background:#f2f4f7; }
.matrix-grid.is-replaying .matrix-rank, .matrix-grid.is-replaying .matrix-name, .matrix-grid.is-replaying .matrix-cell { animation:matrixRowIn var(--matrix-duration, 520ms) ease-out var(--matrix-delay, calc(var(--matrix-row, 0) * 110ms)) both; }
@keyframes matrixRowIn { from { opacity:0; transform:translateY(-14px); } 65% { opacity:1; transform:translateY(2px); } to { opacity:1; transform:translateY(0); } }
.matrix-progress-list { display:grid; gap:7px; min-width:760px; margin-top:18px; }
.matrix-progress-row { display:grid; grid-template-columns:24px 118px minmax(0,1fr); align-items:center; min-height:36px; gap:7px; }
.matrix-progress-rank { font-size:13px; font-weight:1000; text-align:center; }.matrix-progress-row.in .matrix-progress-rank { color:#e53e45; }.matrix-progress-row.out .matrix-progress-rank { color:#188d54; }
.matrix-progress-name { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:16px; font-weight:1000; color:#172033; }
.matrix-progress-track { position:relative; height:18px; margin-right:60px; border-radius:999px; background:#edf1f5; overflow:visible; }
.matrix-progress-fill { position:absolute; inset:0 auto 0 0; border-radius:inherit; transition:width 90ms linear; }.matrix-progress-row.in .matrix-progress-fill { background:linear-gradient(90deg,#f48a90,#e94c56); }.matrix-progress-row.out .matrix-progress-fill { background:linear-gradient(90deg,#72cea0,#27a967); }
.matrix-progress-value { position:absolute; z-index:2; top:50%; left:calc(var(--matrix-progress) + 8px); transform:translateY(-50%); color:#172033 !important; white-space:nowrap; font-size:15px; font-weight:1000; font-variant-numeric:tabular-nums; text-shadow:0 1px 2px rgba(255,255,255,.9); transition:left 90ms linear; }
@media (max-width:900px) { .matrix-panel { min-height:760px; padding:20px 12px 28px; } .matrix-header h2 { font-size:26px; } .matrix-grid,.matrix-header,.matrix-subtitle { min-width:720px; } .matrix-grid { grid-template-columns:28px 96px repeat(9, minmax(58px,1fr)); } .matrix-cell { min-height:36px; font-size:12px; } .matrix-name { font-size:13px; } }

@media (max-width: 900px) {
    .matrix-panel {
        inset: 0 9px auto 9px;
        width: auto;
        min-height: 620px;
        padding: 16px 8px 20px;
    }

    .matrix-header,
    .matrix-grid {
        min-width: 0;
    }

    .matrix-header h2 {
        font-size: 18px;
    }

    .matrix-header > span { font-size: 10px; }
    .matrix-time-pill { margin-left:3px; padding:3px 5px; border-radius:9px; font-size:9px; }.matrix-time-pill b { font-size:12px; }
    .matrix-session-actions { gap:3px; }
    .matrix-session-actions button { min-width:36px; height:22px; padding:0 4px; font-size:10px; }

    .matrix-grid {
        width: calc(100% - 22px);
        grid-template-columns: 12px 56px repeat(var(--matrix-slots, 9), minmax(0, 1fr));
        gap: 2px;
    }

    .matrix-progress-list { min-width:0; margin-top:12px; gap:5px; }
    .matrix-progress-row { grid-template-columns:16px 70px minmax(0,1fr); min-height:29px; gap:4px; }
    .matrix-progress-rank { font-size:10px; }
    .matrix-progress-name { font-size:14px; }
    .matrix-progress-track { height:12px; margin-right:48px; }
    .matrix-progress-value { left:calc(var(--matrix-progress) + 5px); font-size:12px; }

    .matrix-corner,
    .matrix-time {
        padding: 6px 1px;
        font-size: 9px;
    }

    .matrix-rank {
        font-size: 9px;
    }

    .matrix-name {
        padding: 0 2px;
        font-size: 10px;
    }

    .matrix-cell {
        min-height: 28px;
        border-radius: 3px;
        font-size: 9px;
    }
}

.chart-stage:has(#racePanel:not(.is-hidden)) .line-head {
    pointer-events: none;
}

.chart-stage:has(#aggregatePanel:not(.is-hidden)) {
    min-height: 1320px;
}

.race-panel::before,
.race-panel::after {
    content: none;
}

.race-session-actions {
    position: relative;
    z-index: 18;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    margin: 0 0 8px 8px;
}

.race-session-actions button {
    min-width: 74px;
    height: 32px;
    border: 1px solid rgba(220, 227, 235, .95);
    border-radius: 999px;
    background: linear-gradient(145deg, #ffffff, #f2f5f8);
    color: #111827;
    box-shadow:
        6px 7px 16px rgba(116, 135, 156, .16),
        -5px -5px 14px rgba(255,255,255,.92),
        inset 0 1px 0 rgba(255,255,255,.98);
    font-size: 14px;
    font-weight: 1000;
    cursor: pointer;
}

.race-session-actions button:hover {
    color: #c91d2a;
    border-color: rgba(232, 48, 41, .35);
}

.aggregate-panel {
    position: absolute;
    inset: 0;
    z-index: 34;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 1280px;
    padding: max(66px, env(safe-area-inset-top)) 18px max(82px, env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 28px;
    background: #fff;
    box-shadow: 16px 20px 48px rgba(112,130,150,.1), inset 0 1px 0 rgba(255,255,255,.95);
}

.aggregate-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    min-height: 42px;
    margin-bottom: 10px;
}

.aggregate-session-actions { position: relative; z-index: 12; display: flex; gap: 10px; padding-top: 7px; }
.aggregate-session-actions button {
    min-width: 72px;
    height: 34px;
    border: 1px solid #dfe5ed;
    border-radius: 999px;
    background: linear-gradient(145deg, #fff, #f3f6f9);
    color: #111827;
    box-shadow: 5px 6px 14px rgba(91,111,134,.13), inset 0 1px 0 #fff;
    font-size: 14px;
    font-weight: 1000;
    cursor: pointer;
}

.aggregate-timeline {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    color: #102039;
    font-size: 13px;
    font-weight: 900;
}

.aggregate-timeline > span:first-child { color: #f0322e; }

.aggregate-date-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.aggregate-date-row h2 { margin: 0; color: #102039; font-weight: 900; }
.aggregate-date-row h2 span { color: #ff4d4f; margin-right: 5px; }
.aggregate-date-row > span { color: #9aa6b6; white-space: nowrap; }

.aggregate-progress {
    position: relative;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #dfe4ed;
    box-shadow: inset 2px 2px 5px rgba(130,148,169,.18);
}

.aggregate-progress-fill {
    display: block;
    width: var(--aggregate-progress, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff6d21, #e8182e);
    box-shadow: 0 4px 12px rgba(232,24,46,.22);
    transition: width 220ms linear;
}

.aggregate-progress i {
    position: absolute;
    left: var(--aggregate-progress, 0%);
    top: 50%;
    width: 17px;
    height: 17px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: #e8182e;
    box-shadow: 0 5px 14px rgba(232,24,46,.28);
    transform: translate(-50%, -50%);
    transition: left 220ms linear;
}

.aggregate-time {
    position: absolute;
    left: var(--aggregate-thumb-progress, 7%);
    top: 50%;
    z-index: 4;
    min-width: 58px;
    padding: 6px 9px;
    border-radius: 16px;
    background: linear-gradient(145deg, #ff6238, #ec2b1f);
    color: #fff;
    box-shadow: 0 7px 18px rgba(232,48,41,.28);
    font-size: 16px;
    font-weight: 1000;
    line-height: 1;
    text-align: center;
    transform: translate(-50%, -50%);
    transition: left 220ms linear;
}

.aggregate-orbit {
    position: relative;
    flex: 0 0 500px;
    width: 100%;
    height: 500px;
    margin-top: 26px;
    --core-a: #ff5a5f;
    --core-b: #ff2e43;
    color: #ff2e43;
}

.aggregate-outflow { --core-a: #119b71; --core-b: #006f55; margin-top: 38px; color: #006f55; }
.aggregate-orbit h3 { position: relative; z-index: 10; margin: 0; color: currentColor; text-align: center; font-size: 21px; font-weight: 1000; transform: translateY(-14px); }

.aggregate-vortex {
    position: absolute;
    left: var(--track-cx, 50%);
    top: var(--track-cy, 54%);
    width: 136px;
    height: 136px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.aggregate-core {
    position: absolute;
    inset: 0;
    z-index: 4;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 36% 29%, rgba(255,255,255,.58), transparent 11%),
        radial-gradient(circle at 43% 39%, rgba(255,255,255,.28), transparent 29%),
        radial-gradient(circle at 50% 50%, var(--core-a) 0%, var(--core-b) 68%, color-mix(in srgb, var(--core-b) 76%, #071425) 100%);
    box-shadow:
        0 0 24px color-mix(in srgb, var(--core-a) 46%, transparent),
        0 16px 38px color-mix(in srgb, var(--core-b) 30%, transparent),
        inset 0 8px 20px rgba(255,255,255,.24),
        inset 0 -14px 24px rgba(0,0,0,.14);
    animation: aggregateCorePulse 3.2s ease-in-out infinite;
}

.aggregate-core::before {
    content: "";
    position: absolute;
    inset: -17%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--core-a) 24%, transparent), transparent 70%);
    animation: aggregateBloom 3.2s ease-in-out infinite;
}

.aggregate-core span { position: relative; z-index: 4; color: #fff; font-size: 25px; font-weight: 1000; text-shadow: 0 2px 8px rgba(0,0,0,.16); }
.aggregate-rings, .aggregate-ribbons, .aggregate-particles, .aggregate-labels, .aggregate-nodes, .aggregate-orbit-particles { position: absolute; inset: 0; pointer-events: none; }
.aggregate-rings, .aggregate-ribbons, .aggregate-particles { left: 50%; top: 50%; width: 0; height: 0; z-index: 2; overflow: visible; }

.aggregate-rings i {
    position: absolute;
    left: 0;
    top: 0;
    width: calc(180px + var(--i, 0px));
    height: calc(180px + var(--i, 0px));
    border-radius: 46% 54% 48% 52%;
    border: 5px solid color-mix(in srgb, currentColor 6%, transparent);
    border-left-color: color-mix(in srgb, currentColor 16%, transparent);
    border-top-color: color-mix(in srgb, currentColor 11%, transparent);
    transform: translate(-50%, -50%) rotate(0deg);
    animation: aggregateSpin 7s linear infinite;
}

.aggregate-rings i:nth-child(1) { --i: 18px; animation-duration: 6.2s; opacity: .72; }
.aggregate-rings i:nth-child(2) { --i: 47px; animation-duration: 8.5s; animation-direction: reverse; opacity: .58; }
.aggregate-rings i:nth-child(3) { --i: 76px; animation-duration: 10.5s; opacity: .46; }
.aggregate-rings i:nth-child(4) { --i: 104px; animation-duration: 13s; animation-direction: reverse; opacity: .34; }
.aggregate-rings i:nth-child(5) { --i: 132px; animation-duration: 15s; opacity: .24; }

.aggregate-ribbons i {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--size);
    height: calc(var(--size) * .62);
    border: var(--thick) solid transparent;
    border-top-color: color-mix(in srgb, var(--core-a) 76%, transparent);
    border-right-color: color-mix(in srgb, var(--core-b) 48%, transparent);
    border-bottom-color: color-mix(in srgb, var(--core-a) 18%, transparent);
    border-radius: 46% 54% 42% 58%;
    opacity: var(--alpha);
    box-shadow: 0 -1px 7px color-mix(in srgb, var(--core-a) 18%, transparent);
    transform: translate(-50%, -50%) rotate(var(--start)) scaleX(var(--stretch));
    animation: aggregateRibbon var(--speed) linear infinite;
    animation-delay: var(--delay);
    will-change: transform;
}

.aggregate-ribbons i.is-reverse { animation-direction: reverse; }

.aggregate-particle {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--s);
    height: var(--s);
    border-radius: 50%;
    background: currentColor;
    opacity: .72;
    box-shadow: 0 0 9px currentColor;
    transform: rotate(var(--a)) translateX(var(--r));
    animation: aggregateParticle 2600ms ease-in-out infinite;
    animation-delay: var(--d);
}

.aggregate-track {
    position: absolute;
    left: var(--track-cx, 50%);
    top: var(--track-cy, 54%);
    z-index: 1;
    width: var(--track-size, 50%);
    height: var(--track-size, auto);
    aspect-ratio: 1 / 1;
    border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
    border-radius: 4px;
    box-shadow: 0 0 14px color-mix(in srgb, currentColor 8%, transparent);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.aggregate-node {
    position: absolute;
    left: var(--node-x, var(--track-cx, 50%));
    top: var(--node-y, var(--track-cy, 54%));
    z-index: 4;
    width: 11px;
    height: 11px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 10%, transparent), 0 0 11px color-mix(in srgb, currentColor 44%, transparent);
    transform: translate(-50%, -50%);
    animation: aggregateNodePulse 2.4s ease-in-out infinite;
}

.aggregate-node::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    width: 10px;
    height: 1px;
    background: linear-gradient(90deg, currentColor, transparent);
    opacity: .32;
    transform: translateY(-50%) rotate(var(--link-angle, 0deg));
    transform-origin: 0 50%;
}

.aggregate-orbit-particles { z-index: 2; overflow: visible; }
.aggregate-orbit-particles i {
    position: absolute;
    left: var(--track-cx, 50%);
    top: var(--track-cy, 54%);
    width: var(--particle-size);
    height: var(--particle-size);
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 7px currentColor;
    opacity: .26;
    animation: aggregateOrbitParticle var(--particle-speed) linear infinite;
    animation-delay: var(--particle-delay);
}

.aggregate-label {
    position: absolute;
    left: var(--orbit-x);
    top: var(--orbit-y);
    z-index: 5;
    display: grid;
    place-items: center;
    width: 102px;
    min-height: 39px;
    padding: 4px 7px;
    border: 1px solid color-mix(in srgb, currentColor 10%, transparent);
    border-radius: 21px;
    background: rgba(255,255,255,.95);
    box-shadow: 0 8px 20px rgba(75,94,116,.10), inset 0 1px 0 #fff;
    color: inherit;
    text-align: center;
    transform: translate(-50%, -50%);
    transition: opacity .25s ease, transform .35s ease;
    animation: aggregateCardIn .5s cubic-bezier(.2,.75,.2,1) both;
}

.aggregate-label div { min-width: 0; width: 100%; }
.aggregate-label b, .aggregate-label em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aggregate-label b { color: #111827; font-size: 12px; font-weight: 1000; line-height: 1.08; }
.aggregate-label em { color: currentColor; margin-top: 1px; font-size: 12px; font-style: normal; font-weight: 1000; line-height: 1.08; }
.aggregate-index { margin-right: 5px; color: currentColor; font-size: 9px; font-weight: 1000; vertical-align: 1px; }
.aggregate-label.is-empty { opacity: 0; pointer-events: none; animation: none; }

.aggregate-direction { display: grid; justify-items: center; gap: 3px; height: 34px; margin-top: 8px; color: rgba(232,48,41,.34); }
.aggregate-direction i { width: 15px; height: 15px; border-right: 5px solid currentColor; border-bottom: 5px solid currentColor; transform: rotate(45deg); }
.aggregate-direction i:nth-child(2) { opacity: .72; }
.aggregate-direction i:nth-child(3) { opacity: .45; }

.aggregate-footer {
    flex: 0 0 auto;
    margin: auto auto 0;
    padding: 40px 10px 22px;
    color: #9aa6b6;
    font-size: 13px;
    font-weight: 1000;
    line-height: 1.65;
    text-align: center;
}

@keyframes aggregateSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes aggregateRibbon { to { transform: translate(-50%, -50%) rotate(calc(var(--start) + 360deg)) scaleX(var(--stretch)); } }
@keyframes aggregateParticle { 0% { opacity: 0; transform: rotate(var(--a)) translateX(calc(var(--r) + 18px)) scale(.9); } 18% { opacity: .86; } 78% { opacity: .46; } 100% { opacity: 0; transform: rotate(calc(var(--a) + 48deg)) translateX(42px) scale(.25); } }
@keyframes aggregateOrbitParticle { from { transform: translate(-50%, -50%) rotate(var(--particle-angle)) translateX(var(--track-radius)); } to { transform: translate(-50%, -50%) rotate(calc(var(--particle-angle) + 360deg)) translateX(var(--track-radius)); } }
@keyframes aggregateNodePulse { 0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 8%, transparent), 0 0 7px color-mix(in srgb, currentColor 34%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 13%, transparent), 0 0 14px color-mix(in srgb, currentColor 56%, transparent); } }
@keyframes aggregateCorePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes aggregateBloom { 0%, 100% { opacity: .58; transform: scale(.95); } 50% { opacity: .92; transform: scale(1.08); } }
@keyframes aggregateLineIn { to { stroke-dashoffset: 0; } }
@keyframes aggregateCardIn { from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

@media (prefers-reduced-motion: reduce) {
    .aggregate-core, .aggregate-core::before, .aggregate-rings i, .aggregate-ribbons i, .aggregate-particle, .aggregate-connectors path { animation: none !important; }
}

.race-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    margin-bottom: 11px;
    padding: 8px 14px;
    border: 1px solid rgba(232, 238, 245, .92);
    border-radius: 24px;
    background: rgba(255,255,255,.78);
    box-shadow:
        9px 10px 24px rgba(116, 135, 156, .14),
        -7px -7px 18px rgba(255,255,255,.95),
        inset 0 1px 0 rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
}

.race-session {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.race-session strong {
    color: #111827;
    font-size: 27px;
    line-height: 1;
    font-weight: 1000;
    letter-spacing: 0;
}

.race-session span {
    color: #111827;
    font-size: 17px;
    font-weight: 900;
}

.race-session b {
    color: #111827;
    font-size: 18px;
    font-weight: 1000;
}

.race-keys {
    display: flex;
    gap: 10px;
    color: #111827;
    font-size: 12px;
    font-weight: 900;
}

.race-keys span {
    min-height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    background: linear-gradient(145deg, #ffffff, #f3f6fa);
    box-shadow:
        5px 6px 14px rgba(116, 135, 156, .16),
        -4px -4px 10px rgba(255,255,255,.9);
}

.race-time-pill {
    color: #f5b21f;
    font-size: 18px;
    font-weight: 1000;
    text-shadow: 0 2px 8px rgba(245,178,31,.22);
}

.race-time-pill b {
    margin-left: 7px;
    font-size: 21px;
    font-weight: 1000;
}

.race-mode-switch {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 12px 0 6px;
    color: #1d2838;
    font-size: 13px;
    font-weight: 900;
}

.race-mode-switch label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid #dfe6ef;
    border-radius: 999px;
    background: rgba(255,255,255,.9);
    box-shadow: 5px 7px 16px rgba(116,135,156,.12);
}

.race-mode-switch input {
    accent-color: #0f8f68;
}

.race-grid {
    display: grid;
    grid-template-rows: auto 12px auto;
}

.race-section {
    position: relative;
    border: 1px solid rgba(232, 238, 245, .9);
    border-radius: 24px;
    padding: 36px 18px 10px;
    overflow: hidden;
    box-shadow:
        12px 16px 34px rgba(110, 129, 151, .16),
        -9px -9px 24px rgba(255,255,255,.92),
        inset 0 1px 0 rgba(255,255,255,.92);
}

.race-section.inflow {
    grid-row: 1;
    background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(247,250,253,.92));
}

.race-section.outflow {
    grid-row: 3;
    background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(247,250,253,.92));
}

.race-section::before {
    content: "";
    position: absolute;
    right: 58px;
    top: 42%;
    width: 124px;
    height: 124px;
    opacity: .095;
    transform: rotate(-35deg);
    pointer-events: none;
    filter: blur(.1px);
    clip-path: polygon(0 39%, 63% 39%, 63% 13%, 100% 50%, 63% 87%, 63% 61%, 0 61%);
}

.race-section.inflow::before {
    background: linear-gradient(135deg, #ff3b30, transparent 76%);
}

.race-section.outflow::before {
    top: 50%;
    background: linear-gradient(135deg, #13a35e, transparent 76%);
}

.race-section-title {
    position: absolute;
    left: 0;
    top: 0;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    min-height: 34px;
    pointer-events: none;
}

.race-section-title strong {
    position: relative;
    min-width: 130px;
    padding: 8px 17px 9px 17px;
    border-radius: 20px 0 24px 0;
    color: #fff !important;
    font-size: 17px;
    font-weight: 1000;
    line-height: 1;
    text-shadow: 0 1px 3px rgba(0,0,0,.16);
    box-shadow:
        10px 12px 22px rgba(0,0,0,.16),
        inset 0 1px 1px rgba(255,255,255,.42),
        inset 0 -3px 8px rgba(0,0,0,.12);
}

.race-section-title strong::after {
    content: none;
}

.inflow .race-section-title strong {
    background: linear-gradient(135deg, #ff6259 0%, #f02b24 68%, #ff9a92 100%);
}

.outflow .race-section-title strong {
    background: linear-gradient(135deg, #3fd286 0%, #109856 68%, #9eeecb 100%);
}

.race-section-title span {
    color: #7d8792;
    font-size: 11.2px;
    font-weight: 800;
}

.race-list {
    display: grid;
    gap: 5px;
}

.race-row {
    display: grid;
    grid-template-columns: 32px 92px minmax(140px, 1fr) 88px;
    gap: 8px;
    align-items: center;
    height: 22px;
    color: #111827;
}

.race-row.race-top-highlight {
    margin-inline: -4px;
    padding-inline: 4px;
    border-radius: 11px;
    background: linear-gradient(90deg, rgba(255,235,237,.9), rgba(255,255,255,.16));
}

.race-row.race-bottom-highlight {
    margin-inline: -4px;
    padding-inline: 4px;
    border-radius: 11px;
    background: linear-gradient(90deg, rgba(232,255,243,.94), rgba(255,255,255,.14));
}

.race-rank {
    width: 22px;
    height: 22px;
    justify-self: center;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 8px;
    display: grid;
    place-items: center;
    background:
        linear-gradient(145deg, rgba(255,255,255,.32), rgba(255,255,255,0) 35%),
        var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 1000;
    line-height: 1;
    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.55),
        inset 0 -2px 3px rgba(0,0,0,.16),
        0 6px 12px rgba(41, 56, 72, .16);
    clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
}

.race-rank.rank-1 {
    background: linear-gradient(145deg, #fff7c7 0%, #ffbf2f 46%, #f16a24 100%);
}

.race-rank.rank-2 {
    background: linear-gradient(145deg, #ffffff 0%, #cdd7e5 48%, #8795a8 100%);
}

.race-rank.rank-3 {
    background: linear-gradient(145deg, #ffe2b7 0%, #d98533 52%, #a6521e 100%);
}

.race-name {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 15px;
    font-weight: 1000;
    letter-spacing: 0;
}

.race-track {
    position: relative;
    min-width: 0;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f9fbfd 0%, #edf2f6 100%);
    border: 1px solid rgba(221, 228, 236, .95);
    overflow: visible;
    box-shadow:
        inset 2px 2px 5px rgba(130, 148, 169, .18),
        inset -2px -2px 5px rgba(255,255,255,.96);
}

.race-fill {
    height: 100%;
    display: block;
    min-width: 3px;
    position: relative;
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.16) 28%, rgba(0,0,0,.08) 100%),
        linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent));
    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.52),
        inset 0 -2px 3px rgba(0,0,0,.16),
        0 3px 8px color-mix(in srgb, var(--accent) 32%, transparent);
    transition: width 900ms cubic-bezier(.16, 1, .3, 1);
}

.race-value {
    min-width: 0;
    text-align: right;
    white-space: nowrap;
    color: var(--accent);
    font-size: 15.2px;
    font-weight: 1000;
    text-shadow: 0 1px 0 rgba(255,255,255,.9), 0 4px 10px color-mix(in srgb, var(--accent) 16%, transparent);
}

.race-compact {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin-top: 7px;
    max-height: 120px;
    opacity: 1;
    transform: translateY(0);
    overflow: hidden;
    transition:
        max-height 720ms cubic-bezier(.16, 1, .3, 1),
        opacity 480ms ease,
        transform 720ms cubic-bezier(.16, 1, .3, 1);
}

.race-chip {
    min-width: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    min-height: 31px;
    padding: 4px 5px;
    border: 1px solid rgba(229, 235, 242, .96);
    border-radius: 9px;
    background: rgba(255,255,255,.83);
    box-shadow:
        5px 7px 14px rgba(110,129,151,.14),
        -4px -4px 10px rgba(255,255,255,.92);
    font-size: 9.2px;
    font-weight: 900;
}

.race-chip-rank {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    font-size: 9.4px;
    font-weight: 1000;
    box-shadow: inset 0 1px 1px rgba(255,255,255,.45), 0 3px 7px color-mix(in srgb, var(--accent) 25%, transparent);
}

.race-chip-name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #172033;
    padding-left: 4px;
    text-align: center;
    font-size: 9.2px;
    font-weight: 1000;
}

.race-chip-value {
    grid-column: 1 / -1;
    color: var(--accent);
    text-align: center;
    font-weight: 1000;
    font-size: 9.4px;
}

.race-footer {
    display: block;
    margin: 14px auto 0;
    padding-bottom: 2px;
    text-align: center;
    color: #8a95a1;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1.55;
}

.race-section.is-race-animating .race-row {
    opacity: 0;
    transform: translateX(-24px) scale(.96);
    animation: raceRowPush 820ms cubic-bezier(.16, 1, .3, 1) forwards;
    animation-delay: calc(var(--row-index) * 170ms);
}

.race-section.is-race-animating .race-rank,
.race-section.is-race-animating .race-name,
.race-section.is-race-animating .race-track,
.race-section.is-race-animating .race-value {
    filter: saturate(.98);
}

.race-section.is-race-animating .race-compact {
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    margin-top: 0;
}

.race-section.chips-revealed .race-compact {
    max-height: 320px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 7px;
}

@keyframes raceRowPush {
    0% {
        opacity: 0;
        transform: translateX(-24px) scale(.96);
    }
    70% {
        opacity: 1;
        transform: translateX(3px) scale(1.012);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.chart-stage:has(#racePanel:not(.is-hidden)) {
    min-height: 860px;
}

.bubble-panel {
    position: absolute;
    inset: 0 auto auto 0;
    z-index: 9;
    box-sizing: border-box;
    width: min(520px, 100%);
    height: 760px;
    padding: 0;
    border-radius: 0;
    color: #fff;
    background:
        radial-gradient(circle at 48% 20%, rgba(83,28,42,.25), transparent 36%),
        radial-gradient(circle at 54% 84%, rgba(12,92,73,.20), transparent 40%),
        linear-gradient(145deg, #050913 0%, #111722 48%, #07121c 100%);
    overflow: hidden;
    isolation: isolate;
}

.bubble-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: block;
    box-sizing: border-box;
    padding: 22px 16px 0;
    color: #f4f6f8;
    pointer-events: none;
}

.bubble-panel.bubble-presenting .bubble-header {
    opacity: 0;
    animation: bubbleHeaderReveal 720ms ease-out 520ms forwards;
}

.bubble-panel.bubble-presenting:not(.bubble-replaying) .bubble-item > span {
    opacity: 0;
    animation: bubbleLabelReveal 420ms ease-out var(--entry-delay, 440ms) forwards;
}

.bubble-title {
    display: none;
    color: #fff;
    font-size: 27px;
    font-weight: 950;
    line-height: 1.08;
    letter-spacing: -.6px;
    text-shadow: 0 2px 7px rgba(0,0,0,.72);
}

.bubble-legend {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: flex-end;
    width: fit-content;
    margin-left: auto;
    margin-top: 0;
    font-size: 12.5px;
    font-weight: 700;
    color: rgba(255,255,255,.78);
}

.bubble-legend span {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

.bubble-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.bubble-legend-dot.inflow {
    background: #ff3535;
    box-shadow: 0 0 8px rgba(255,53,53,.86);
}

.bubble-legend-dot.outflow {
    background: #20c765;
    box-shadow: 0 0 8px rgba(32,199,101,.82);
}

.bubble-time {
    display: none;
}

.bubble-stage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.bubble-stage::after {
    position: absolute;
    inset: 0;
    z-index: 4;
    content: "";
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,.19) 100%);
}

.bubble-watermark {
    position: absolute;
    z-index: 1;
    top: 47%;
    left: 50%;
    color: rgba(202, 224, 242, .075);
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 8px;
    white-space: nowrap;
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(-10deg);
    text-shadow: 0 0 18px rgba(95, 172, 255, .12);
}

.bubble-intro-date {
    display: none;
}

.bubble-date-matrix {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms ease;
}

.bubble-date-matrix.is-visible {
    opacity: 1;
}

.bubble-date-matrix i {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: dateMatrixPulse 1.8s ease-in-out var(--matrix-delay) infinite alternate;
}

.bubble-date-matrix i.warm {
    background: #ff7168;
    box-shadow: 0 0 7px rgba(255,89,80,.9);
}

.bubble-date-matrix i.cool {
    background: #6be7b2;
    box-shadow: 0 0 7px rgba(56,220,143,.88);
}

.bubble-svg,
.bubble-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.bubble-svg {
    z-index: 1;
    pointer-events: none;
    transform-origin: 50% 50%;
    animation: bubbleCameraPush 16s ease-in-out infinite alternate;
}

.bubble-layer {
    z-index: 2;
    transform-origin: 50% 50%;
    animation: bubbleCameraPush 16s ease-in-out infinite alternate;
}

.bubble-item {
    position: absolute;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 0;
    color: #fff;
    text-align: center;
    overflow: hidden;
    transform: translate(-50%, -50%) scale(.72);
    opacity: 0;
    transition:
        left 170ms cubic-bezier(.22,.7,.28,1),
        top 170ms cubic-bezier(.22,.7,.28,1),
        width 170ms cubic-bezier(.22,.7,.28,1),
        height 170ms cubic-bezier(.22,.7,.28,1),
        opacity 360ms ease,
        transform 260ms cubic-bezier(.2,1.12,.25,1);
}

.bubble-item.is-visible {
    opacity: var(--bubble-opacity, 1);
    transform: translate(-50%, -50%) scale(1);
}

.bubble-session-actions {
    position: absolute;
    top: 18px;
    left: 16px;
    z-index: 8;
    display: flex;
    gap: 8px;
}

.line-head {
    pointer-events: none;
}

.bubble-session-actions.is-hidden {
    display: none;
}

.bubble-session-actions button {
    min-width: 62px;
    height: 30px;
    padding: 0 14px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(225,232,241,.9));
    color: #111827;
    box-shadow: 0 6px 16px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.95);
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.bubble-session-actions button:active {
    transform: translateY(1px);
}

.bubble-layer.is-loading-target {
    opacity: 0;
}

.bubble-panel.bubble-replaying .bubble-item {
    transition:
        left 190ms cubic-bezier(.22,.7,.28,1),
        top 190ms cubic-bezier(.22,.7,.28,1),
        width 260ms cubic-bezier(.22,.7,.28,1),
        height 260ms cubic-bezier(.22,.7,.28,1),
        opacity 360ms ease,
        transform 300ms cubic-bezier(.2,1.08,.25,1);
}

.bubble-panel.bubble-replaying .bubble-item.is-rank-switching {
    transition: none !important;
    opacity: 0 !important;
    transform: translate(-50%, -50%) scale(.68);
}

.bubble-item.is-rank-arriving {
    animation: bubbleRankArrive 440ms cubic-bezier(.16,.9,.24,1.12) both;
}

.bubble-transition-ghost {
    position: absolute;
    z-index: 3;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    text-align: center;
    overflow: hidden;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: bubbleRankFade 400ms ease-out forwards;
}

.bubble-transition-ghost.inflow {
    background: #ff3434;
    box-shadow: 0 0 var(--bubble-glow, 18px) rgba(255,52,52,.76);
}

.bubble-transition-ghost.outflow {
    background: #20c765;
    box-shadow: 0 0 var(--bubble-glow, 18px) rgba(32,199,101,.74);
}

.bubble-item.is-idle {
    animation: bubbleIdle 4.8s ease-in-out var(--idle-delay, 0ms) infinite alternate;
}

.bubble-item.is-physics {
    transition:
        width 170ms cubic-bezier(.22,.7,.28,1),
        height 170ms cubic-bezier(.22,.7,.28,1),
        opacity 360ms ease;
    animation: bubblePhysicsGlow 3.8s ease-in-out var(--idle-delay, 0ms) infinite alternate;
}

.bubble-item.inflow {
    background: #ff3434;
    box-shadow: 0 0 var(--bubble-glow, 18px) rgba(255,52,52,.76), inset 0 -8px 14px rgba(136,0,0,.12);
}

.bubble-item.outflow {
    background: #20c765;
    box-shadow: 0 0 var(--bubble-glow, 18px) rgba(32,199,101,.74), inset 0 -8px 14px rgba(0,92,38,.14);
}

.bubble-item.is-top-target::before,
.bubble-item.is-top-target::after {
    position: absolute;
    z-index: 3;
    content: "";
    border-radius: 50%;
    pointer-events: none;
}

.bubble-item.is-top-target {
    overflow: visible;
}

.bubble-item.is-date-particle {
    filter: saturate(.86) brightness(.9);
    box-shadow: 0 0 8px currentColor;
}

.bubble-item.is-top-target::before {
    inset: -7px;
    border: 2px solid rgba(255,207,81,.35);
    border-top-color: #fff1a5;
    border-right-color: #f6bd37;
    box-shadow: 0 0 9px rgba(255,197,52,.84), inset 0 0 6px rgba(255,219,105,.32);
    animation: targetRingSpin 2.6s linear infinite;
}

.bubble-item.is-top-target::after {
    inset: -12px;
    border: 2px dashed rgba(255,214,93,.82);
    clip-path: polygon(43% 0, 57% 0, 57% 8%, 92% 8%, 92% 43%, 100% 43%, 100% 57%, 92% 57%, 92% 92%, 57% 92%, 57% 100%, 43% 100%, 43% 92%, 8% 92%, 8% 57%, 0 57%, 0 43%, 8% 43%, 8% 8%, 43% 8%);
    filter: drop-shadow(0 0 5px rgba(255,213,82,.92));
    animation: targetReticleSpin 4.2s linear infinite reverse;
}

.bubble-item > span {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    width: calc(100% - 3px);
    padding: 0 1.5px;
    color: #fff;
    opacity: var(--label-opacity, 1);
    transform: scale(var(--label-scale, 1));
    transform-origin: center;
    transition: opacity 220ms ease, transform 360ms ease;
}

.bubble-name,
.bubble-value {
    display: block;
    max-width: 100%;
    overflow: visible;
    text-wrap: balance;
    word-break: keep-all;
    overflow-wrap: normal;
    font-family: "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
    color: #fff !important;
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: 0;
    text-shadow: none;
    -webkit-font-smoothing: antialiased;
}

.bubble-name {
    white-space: nowrap;
    letter-spacing: -.4px;
}

.bubble-item.is-compact-label .bubble-name {
    white-space: normal;
}

.bubble-item.is-compact-label .bubble-value {
    white-space: normal;
}

.bubble-item.bubble-squeeze {
    animation: bubbleSqueeze 360ms cubic-bezier(.18,.82,.22,1);
}

@keyframes bubbleSqueeze {
    0% { transform: translate(-50%, -50%) scale(1); }
    34% { transform: translate(-50%, -50%) scale(1.09, .93); }
    62% { transform: translate(-50%, -50%) scale(.96, 1.05); }
    82% { transform: translate(-50%, -50%) scale(1.025, .985); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes bubbleRankFade {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.82);
    }
}

@keyframes bubbleRankArrive {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.68);
    }
    72% {
        opacity: var(--bubble-opacity, 1);
        transform: translate(-50%, -50%) scale(1.06);
    }
    100% {
        opacity: var(--bubble-opacity, 1);
        transform: translate(-50%, -50%) scale(1);
    }
}

.bubble-value {
    margin-top: 1px;
    max-width: none;
    overflow: visible;
    letter-spacing: 0;
}

@keyframes bubbleHeaderReveal {
    from { opacity: 0; transform: translateY(-9px); filter: blur(3px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes bubbleLabelReveal {
    from { opacity: 0; transform: scale(.76); filter: blur(2px); }
    to { opacity: 1; transform: scale(var(--label-scale, 1)); filter: blur(0); }
}

@keyframes bubbleIdle {
    0% {
        transform: translate(-50%, -50%) translateY(-1px) scale(1);
        filter: brightness(.96) saturate(.96);
    }
    52% {
        transform: translate(-50%, -50%) translateY(-3px) scale(1.018) rotate(.3deg);
        filter: brightness(1.08) saturate(1.05);
    }
    100% {
        transform: translate(-50%, -50%) translateY(2px) scale(.992) rotate(-.2deg);
        filter: brightness(1.02) saturate(1.02);
    }
}

@keyframes bubbleCameraPush {
    from { transform: scale(.975); }
    to { transform: scale(.995); }
}

@keyframes bubblePhysicsGlow {
    from { filter: brightness(.96) saturate(.96); }
    55% { filter: brightness(1.08) saturate(1.06); }
    to { filter: brightness(1.01) saturate(1.01); }
}

@keyframes targetRingSpin {
    to { transform: rotate(360deg); }
}

@keyframes targetReticleSpin {
    to { transform: rotate(360deg); }
}

@keyframes dateMatrixPulse {
    from { opacity: .42; transform: translate(-50%, -50%) scale(.75); }
    to { opacity: .96; transform: translate(-50%, -50%) scale(1.15); }
}

.bubble-pulse {
    position: absolute;
    z-index: 1;
    border-radius: 50%;
    border: 2px solid currentColor;
    transform: translate(-50%, -50%) scale(.62);
    opacity: .78;
    pointer-events: none;
    filter: drop-shadow(0 0 14px currentColor);
    animation: bubblePulse 720ms ease-out forwards;
}

@keyframes bubblePulse {
    to {
        transform: translate(-50%, -50%) scale(1.55);
        opacity: 0;
    }
}

@keyframes bubbleDrift {
    50% {
        transform: translateY(var(--drift-y, 10px));
    }
}

@keyframes bubbleTwinkle {
    50% {
        opacity: .22;
    }
}

.sort-panel {
    position: absolute;
    inset: 30px 0 0;
    z-index: 9;
    display: grid;
    grid-template-rows: auto 1fr;
    padding: 10px;
    border-radius: 4px;
    background: linear-gradient(160deg, #f6f8fb 0%, #ffffff 48%, #eef3f7 100%);
    color: #1d2838;
}

.sort-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: end;
    margin-bottom: 9px;
}

.sort-header strong {
    display: block;
    font-size: 16px;
    font-weight: 800;
}

.sort-header span,
.sort-leader {
    color: #50606f;
    font-size: 12px;
    font-weight: 700;
}

.sort-list {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
    align-content: start;
}

.sort-list::before,
.sort-list::after {
    content: "姣忔棩璧勯噾瑙傚療";
    position: absolute;
    color: rgba(122, 136, 153, 0.1);
    font-size: 15px;
    font-weight: 800;
    transform: rotate(-22deg);
    pointer-events: none;
}

.sort-list::before {
    left: 24%;
    top: 32%;
}

.sort-list::after {
    right: 12%;
    top: 64%;
}

.sort-row {
    display: grid;
    grid-template-columns: 32px 1fr 68px;
    align-items: center;
    min-height: 31px;
    border: 1px solid #ebeff4;
    border-radius: 7px;
    padding-right: 5px;
    overflow: hidden;
}

.sort-row.highlight {
    border-width: 1.3px;
}

.sort-rank {
    justify-self: center;
    width: 20px;
    height: 20px;
    border: 1.3px solid currentColor;
    border-radius: 7px;
    display: grid;
    place-items: center;
    font-size: 10.8px;
    font-weight: 800;
}

.sort-rank.solid {
    width: 23px;
    height: 23px;
    border: 0;
    color: #fff;
}

.sort-name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11.6px;
    font-weight: 800;
}

.sort-value {
    display: grid;
    gap: 2px;
    justify-items: stretch;
}

.sort-track {
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.sort-fill {
    height: 100%;
    min-width: 3px;
    border-radius: 3px;
}

.sort-text {
    text-align: right;
    font-size: 10.6px;
    font-weight: 800;
}

.sort-panel {
    inset: 10px 0 auto 0;
    min-height: 980px;
    grid-template-rows: auto auto auto;
    padding: 16px;
    padding-bottom: 74px;
    border-radius: 28px;
    background: linear-gradient(160deg, #ffffff 0%, #f8fbfd 52%, #eef3f7 100%);
    box-shadow: 16px 20px 48px rgba(112,130,150,.16), -10px -10px 30px rgba(255,255,255,.94);
}

.sort-header {
    display: block;
    margin-bottom: 12px;
}

.sort-time-pill {
    width: fit-content;
    margin-left: auto;
    margin-bottom: 14px;
    padding: 9px 16px;
    border: 1px solid #dfe6ef;
    border-radius: 16px;
    background: rgba(255,255,255,.9);
    box-shadow: 8px 10px 24px rgba(116,135,156,.12);
    color: #667488;
    font-size: 15px;
    font-weight: 900;
}

.sort-time-pill b {
    color: #111827;
    font-size: 22px;
}

.sort-summary-card {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    gap: 16px;
    align-items: center;
    padding: 18px 22px;
    border: 1px solid rgba(226,233,241,.94);
    border-radius: 22px;
    background: rgba(255,255,255,.82);
    box-shadow: 10px 14px 30px rgba(116,135,156,.14), inset 0 1px 0 rgba(255,255,255,.96);
}

.sort-summary-card > i {
    height: 56px;
    background: #d7dee8;
}

.sort-leader-side {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 8px;
    color: #233043;
    font-size: 19px;
    font-weight: 1000;
}

.sort-leader-side small {
    grid-column: 2 / -1;
    color: #667488;
    font-size: 13px;
    font-weight: 800;
}

.sort-trophy {
    grid-row: span 2;
    font-size: 34px;
}

.sort-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
    padding: 18px;
    border: 1px solid rgba(226,233,241,.94);
    border-radius: 24px;
    background: rgba(255,255,255,.84);
    box-shadow: 12px 16px 34px rgba(110,129,151,.14);
}

.sort-list::before,
.sort-list::after {
    display: none;
}

.sort-column {
    display: grid;
    align-content: start;
    gap: 8px;
}

.sort-column + .sort-column {
    border-left: 1px solid #dde4ee;
    padding-left: 16px;
}

.sort-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.sort-column-head strong {
    padding: 10px 18px;
    border-radius: 7px 7px 7px 0;
    color: #fff;
    font-size: 16px;
    font-weight: 1000;
    box-shadow: 8px 10px 20px rgba(0,0,0,.12);
}

.sort-inflow .sort-column-head strong {
    background: linear-gradient(135deg, #ff6259, #e83029);
}

.sort-outflow .sort-column-head strong {
    background: linear-gradient(135deg, #45cf86, #129752);
}

.sort-column-head span {
    color: #68768a;
    font-size: 12px;
    font-weight: 900;
}

.sort-row {
    grid-template-columns: 34px 1fr 112px;
    min-height: 43px;
    border: 0;
    border-radius: 0;
    padding-right: 0;
    background: transparent;
}

.sort-rank {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border-color: currentColor;
    font-size: 12px;
    font-weight: 1000;
}

.sort-rank.solid {
    width: 27px;
    height: 27px;
    color: #fff !important;
    box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 28%, transparent);
}

.sort-name {
    font-size: 15px;
    font-weight: 1000;
}

.sort-value {
    gap: 4px;
}

.sort-track {
    height: 7px;
    border-radius: 999px;
    background: #e9edf3;
}

.sort-fill {
    border-radius: 999px;
    opacity: .78;
}

.sort-text {
    font-size: 13px;
    font-weight: 1000;
}

.sort-total-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #e2e9f1;
    border-radius: 18px;
    background: rgba(255,255,255,.9);
}

.sort-total-card div {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 10px;
    align-items: center;
    justify-content: center;
}

.sort-total-card span {
    grid-row: span 2;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f3f7fb;
    font-size: 24px;
}

.sort-total-card small {
    color: #667488;
    font-size: 12px;
    font-weight: 900;
}

.sort-total-card b {
    color: #1d2838;
    font-size: 18px;
    font-weight: 1000;
}

.sort-panel {
    inset: 6px 0 auto 0;
    min-height: 820px;
    padding: 14px 16px 16px;
    border-radius: 8px;
    background: linear-gradient(160deg, #ffffff 0%, #f8fbfd 55%, #eef3f7 100%);
}

.sort-header {
    margin-bottom: 10px;
}

.sort-topline {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: start;
}

.sort-titleline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #1c2635;
    font-size: 18px;
    font-weight: 1000;
    line-height: 1.3;
}

.sort-titleline i {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: #8895a7;
}

.sort-titleline b {
    font-size: 18px;
}

.sort-time-pill {
    margin: 0;
    padding: 8px 14px;
    border-radius: 16px;
    white-space: nowrap;
}

.sort-time-pill b {
    font-size: 20px;
}

.sort-summary-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin-top: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #667488;
    font-size: 14px;
    font-weight: 900;
}

.sort-summary-card > i,
.sort-leader-side,
.sort-trophy {
    display: none;
}

.sort-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    padding: 8px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.sort-column {
    gap: 8px;
}

.sort-column + .sort-column {
    border-left: 0;
    padding-left: 0;
}

.sort-column-head {
    display: none;
}

.sort-row {
    grid-template-columns: 42px minmax(72px, .9fr) minmax(96px, 1fr);
    min-height: 41px;
    gap: 8px;
    padding: 5px 8px;
    border: 1px solid #e5edf4;
    border-radius: 9px;
    background: rgba(255,255,255,.82);
    box-shadow: 4px 6px 14px rgba(110,129,151,.08);
    overflow: hidden;
}

.sort-row.positive-row {
    border-color: rgba(233,74,78,.42);
    background: linear-gradient(90deg, rgba(255,244,245,.9), rgba(255,255,255,.86));
}

.sort-row.negative-row {
    border-color: rgba(0,122,86,.20);
    background: linear-gradient(90deg, rgba(246,255,250,.94), rgba(255,255,255,.86));
}

.sort-row.highlight {
    border-width: 2px;
}

.sort-row.top-highlight {
    border-color: rgba(190, 0, 18, .38);
    background: linear-gradient(90deg, rgba(255,238,240,.96), rgba(255,250,250,.9));
}

.sort-row.bottom-highlight {
    border-color: rgba(0, 116, 82, .36);
    background: linear-gradient(90deg, rgba(236,255,246,.96), rgba(249,255,252,.9));
}

.sort-rank,
.sort-rank.solid {
    width: 31px;
    height: 31px;
    font-size: 17px;
    background: transparent !important;
    box-shadow: none !important;
}

.sort-name {
    font-size: 16px;
    font-weight: 1000;
    line-height: 1.18;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sort-value {
    display: grid;
    grid-template-columns: minmax(34px, 1fr) minmax(58px, auto);
    gap: 6px;
    min-width: 0;
}

.sort-track {
    height: 8px;
    background: #e8edf3;
}

.sort-fill {
    min-width: 3px;
    transition: width 220ms ease, background-color 220ms ease;
}

.sort-text {
    min-width: 58px;
    font-size: 13.5px;
    white-space: nowrap;
    transition: color 220ms ease;
}

.sector-dialog {
    width: min(760px, calc(100vw - 40px));
    border: 1px solid #45515f;
    border-radius: 8px;
    padding: 0;
    background: #111;
    color: #fff;
}

.sector-dialog::backdrop {
    background: rgba(0, 0, 0, 0.58);
}

.sector-dialog form {
    margin: 0;
}

.sector-dialog header,
.sector-dialog footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
}

.sector-dialog p {
    margin: 0 12px 10px;
    color: #aaa;
    font-size: 13px;
}

@keyframes bubbleParticleFloat {
    from { transform: translate(0, 0); }
    to { transform: translate(7px, -11px); }
}

.sector-search {
    width: calc(100% - 24px);
    height: 34px;
    margin: 0 12px 12px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #1d1d1d;
    color: #fff;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
}

.sector-search:focus {
    border-color: #4b91d2;
    box-shadow: 0 0 0 2px rgba(75,145,210,.18);
}

.sector-dialog button {
    min-width: 76px;
    height: 30px;
    border: 1px solid #444;
    background: #222;
    color: #fff;
}

.sector-rows {
    max-height: 520px;
    overflow: auto;
    padding: 0 12px;
    display: grid;
    gap: 6px;
}

.sector-row {
    display: grid;
    grid-template-columns: 22px minmax(130px, 1fr) minmax(120px, 190px);
    gap: 8px;
    align-items: center;
}

.sector-row input[type="text"] {
    min-width: 0;
    height: 28px;
    border: 1px solid #444;
    background: #222;
    color: #fff;
    padding: 0 8px;
}

.money-app[data-theme="light"] .rank-panel {
    background: #fff;
    border-color: #ddd;
    color: #111;
}

.money-app[data-theme="light"] .rank-panel input,
.money-app[data-theme="light"] .rank-panel button {
    background: #fff;
    color: #111;
    border-color: #d6dbe1;
}

.money-app[data-theme="light"] .rank-panel button.active {
    background: #1e5f97;
    color: #fff;
}

.money-app[data-theme="light"] .race-panel {
    background: linear-gradient(160deg, #ffffff 0%, #f8fbfd 52%, #eef3f7 100%);
    border: 1px solid rgba(245, 248, 252, .92);
    box-shadow:
        16px 20px 48px rgba(112, 130, 150, .18),
        -10px -10px 30px rgba(255,255,255,.92),
        inset 0 1px 0 rgba(255,255,255,.92);
}

.money-app[data-theme="light"] .race-header {
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(232, 238, 245, .92);
    box-shadow:
        9px 10px 24px rgba(116, 135, 156, .14),
        -7px -7px 18px rgba(255,255,255,.95),
        inset 0 1px 0 rgba(255,255,255,.96);
}

.money-app[data-theme="light"] .race-session strong,
.money-app[data-theme="light"] .race-session span,
.money-app[data-theme="light"] .race-session b,
.money-app[data-theme="light"] .race-keys {
    color: #111;
}

.money-app[data-theme="light"] .race-section.inflow {
    background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(247,250,253,.92));
    border-color: rgba(232, 238, 245, .9);
}

.money-app[data-theme="light"] .race-section.outflow {
    background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(247,250,253,.92));
    border-color: rgba(232, 238, 245, .9);
}

.money-app[data-theme="light"] .race-row {
    grid-template-columns: 32px 92px minmax(140px, 1fr) 88px;
    height: 22px;
    color: #141f2c;
}

.money-app[data-theme="light"] .race-track {
    width: 100%;
    height: 10px;
    background: linear-gradient(180deg, #f9fbfd 0%, #edf2f6 100%);
    border-color: rgba(221, 228, 236, .95);
}

.recording .rank-panel {
    display: none;
}

.recording .workspace {
    grid-template-columns: min(100vw, 540px);
    min-height: 100vh;
    padding: 68px 14px 78px;
    align-content: center;
}

.recording .chart-stage {
    width: min(100vw - 28px, 540px);
    min-height: auto;
}

.recording .line-head {
    grid-template-columns: 1fr auto auto;
    align-items: end;
    gap: 10px;
    min-height: 96px;
    margin-bottom: 6px;
}

.recording .line-head h2 {
    font-size: 38px;
}

.recording .index-card {
    display: grid;
    min-height: 44px;
    padding: 9px 12px;
    font-size: 15px;
}

.recording .time-badge {
    display: none;
    justify-self: end;
    min-height: 44px;
    padding: 9px 12px;
    font-size: 15px;
}

.recording .line-wrap,
.recording .line2-wrap {
    width: 100%;
    height: calc((min(100vw - 28px, 540px)) * 1.30);
    min-height: 660px;
    max-height: 760px;
}

.recording .session-control {
    left: 8px;
    top: 4px;
    min-height: 38px;
}

.recording .session-actions button {
    min-width: 68px;
    height: 31px;
    font-size: 14px;
}

.recording .session-title {
    font-size: 23px;
}

.recording .workspace:has(#bubblePanel:not(.is-hidden)) {
    grid-template-columns: min(520px, 100vw);
    justify-content: center;
    align-content: start;
    min-height: 760px;
    padding: 0;
}

.recording .chart-stage:has(#bubblePanel:not(.is-hidden)) {
    width: min(520px, 100vw);
    min-height: 760px;
    height: 760px;
}

@media (max-width: 900px) {
    .workspace {
        grid-template-columns: 1fr;
        padding: 22px 10px 34px;
    }

    .rank-panel {
        margin-top: 0;
        max-height: none;
    }

    .api-test-panel {
        width: calc(100% - 20px);
        grid-template-columns: 1fr;
        margin-bottom: 28px;
    }

    .api-test-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .api-test-result {
        grid-column: 1;
    }

    .chart-stage {
        width: min(100%, 680px);
        min-height: 900px;
        margin-inline: auto;
    }

    .workspace:has(#bubblePanel:not(.is-hidden)) {
        grid-template-columns: min(520px, 100vw);
        justify-content: center;
        align-content: start;
        padding: 0 0 34px;
    }

    .chart-stage:has(#bubblePanel:not(.is-hidden)) {
        width: min(520px, 100vw);
        min-height: 760px;
        height: 760px;
        margin-inline: 0;
    }

    .line-head {
        grid-template-columns: 1fr auto;
        gap: 10px;
        align-items: start;
        min-height: 96px;
        margin-bottom: 8px;
    }

    .line-head h2 {
        font-size: 36px;
        grid-row: 1 / span 2;
    }

    .index-card {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 13px;
    }

    .index-card strong {
        font-size: 16px;
    }

    .index-card em {
        display: none;
    }

    .time-badge {
        display: none;
        min-height: 38px;
        padding: 8px 10px;
        font-size: 13px;
    }

    .line-wrap,
    .line2-wrap {
        width: 100%;
        height: 860px;
        min-height: 520px;
    }

    .session-control {
        left: 8px;
        top: 4px;
    }

    .session-title {
        font-size: 22px;
    }

    .flow-legend {
        top: 226px;
    }

    .chart-stage:has(#racePanel:not(.is-hidden)) {
        min-height: 860px;
    }

    .race-panel {
        inset: 0;
        padding: 10px;
    }

    .race-row {
        grid-template-columns: 30px 86px minmax(120px, 1fr) 82px;
        gap: 7px;
        height: 22px;
    }

    .money-app[data-theme="light"] .race-row {
        grid-template-columns: 30px 86px minmax(120px, 1fr) 82px;
        height: 22px;
    }

    .race-name,
    .race-value {
        font-size: 14px;
    }
}

@media (max-width: 430px) {
    .workspace:has(#aggregatePanel:not(.is-hidden)) {
        padding: 0;
        justify-content: start;
    }

    .line-head {
        grid-template-columns: 1fr 118px;
    }

    .line-head h2 {
        font-size: 31px;
    }

    .index-card,
    .time-badge {
        width: 118px;
        font-size: 12px;
    }

    .index-card strong {
        font-size: 14px;
    }

    .line-wrap {
        height: 820px;
    }

    .session-actions button {
        min-width: 60px;
        height: 29px;
        font-size: 13px;
    }

    .session-title {
        font-size: 20px;
    }

    .chart-stage:has(#racePanel:not(.is-hidden)) {
        min-height: 830px;
    }

    .chart-stage:has(#aggregatePanel:not(.is-hidden)) {
        width: 100vw;
        min-height: 820px;
        margin-inline: 0;
        justify-self: start;
    }

    .aggregate-panel {
        width: 100vw;
        height: 820px;
        min-height: 820px;
        padding: max(105px, calc(env(safe-area-inset-top) + 56px)) 20px 6px;
        overflow-y: hidden;
        border-radius: 0;
    }

    .aggregate-topbar { display: none; }
    .aggregate-session-actions { gap: 6px; padding-top: 3px; }
    .aggregate-session-actions button { min-width: 52px; height: 29px; padding: 0 10px; font-size: 12px; }
    .aggregate-timeline { flex: 0 0 15px; height: 15px; gap: 6px; font-size: 10px; }
    .aggregate-progress { height: 5px; }
    .aggregate-progress i { width: 10px; height: 10px; border-width: 2px; }
    .aggregate-time { box-sizing: border-box; width: 52px; min-width: 52px; height: 28px; padding: 6px 4px; border-radius: 14px; font-size: 15px; }

    .aggregate-date-row {
        flex: 0 0 34px;
        height: 34px;
        margin-top: 18px;
    }

    .aggregate-date-row h2 { font-size: 28px; line-height: 1; }
    .aggregate-date-row > span { font-size: 13px; }

    .aggregate-orbit {
        flex: 0 0 245px;
        width: 100%;
        height: 245px;
        margin-top: 55px;
    }

    .aggregate-orbit h3 { position: absolute; left: 0; right: 0; top: -35px; padding-right: 4px; font-size: 22px; line-height: 26px; text-align: right; transform: none; }

    .aggregate-vortex {
        width: 92px;
        height: 92px;
    }

    .aggregate-ribbons { transform: scale(.5); }

    .aggregate-core span {
        max-width: 86px;
        font-size: 16px;
        white-space: nowrap;
    }

    .aggregate-label {
        box-sizing: border-box;
        width: 72px;
        height: 32px;
        min-height: 32px;
        padding: 2px 4px;
        border-color: rgba(215, 222, 231, .72);
        border-radius: 10px;
        box-shadow: 0 3px 8px rgba(75,94,116,.10), inset 0 1px 0 #fff;
    }

    .aggregate-label b { color: #1f2937; font-size: 11px; font-weight: 800; line-height: 1.08; }
    .aggregate-label em { margin-top: 1px; font-size: 10px; font-weight: 900; line-height: 1.08; }
    .aggregate-index { display: inline; margin-right: 2px; color: currentColor; font-size: 8px; font-weight: 900; vertical-align: 1px; }
    .aggregate-inflow .aggregate-index { color: #ff4d4f; }
    .aggregate-outflow .aggregate-index { color: #10b981; }
    .aggregate-node { width: 5px; height: 5px; border-width: 1px; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 10%, transparent), 0 0 10px color-mix(in srgb, currentColor 42%, transparent); }
    .aggregate-node::after { width: 14px; }
    .aggregate-orbit-particles { display: none; }
    .aggregate-rings i { width: calc(122px + var(--i, 0px)); height: calc(122px + var(--i, 0px)); border-width: 5px; }
    .aggregate-rings i:nth-child(1) { --i: 14px; }
    .aggregate-rings i:nth-child(2) { --i: 34px; }
    .aggregate-rings i:nth-child(3) { --i: 54px; }
    .aggregate-rings i:nth-child(4) { --i: 74px; }
    .aggregate-rings i:nth-child(5) { --i: 94px; }
    .aggregate-outflow { margin-top: 25px; }
    .aggregate-direction { flex: 0 0 25px; height: 25px; margin-top: 10px; gap: 1px; }
    .aggregate-direction i { width: 10px; height: 10px; border-width: 0 3px 3px 0; }
    .aggregate-footer { margin-top: auto; padding: 2px 0 0; font-size: 11px; line-height: 1.45; }

    .race-panel {
        padding: 8px;
        border-radius: 24px;
    }

    .race-session-actions {
        min-height: 38px;
        margin: 0 0 6px 6px;
        gap: 8px;
    }

    .race-session-actions button {
        min-width: 64px;
        height: 29px;
        font-size: 13px;
    }

    .race-header {
        min-height: 50px;
        padding: 8px 10px;
        border-radius: 20px;
    }

    .race-session {
        gap: 5px;
        min-width: 0;
    }

    .race-session strong {
        font-size: 20px;
        white-space: nowrap;
    }

    .race-session span,
    .race-session b {
        font-size: 12.5px;
        white-space: nowrap;
    }

    .race-keys {
        gap: 6px;
        font-size: 10px;
    }

    .race-keys span {
        padding: 0 8px;
    }

    .race-time-pill {
        color: #f5b21f;
        font-size: 17px;
        font-weight: 1000;
    }

    .race-time-pill b {
        font-size: 19px;
        font-weight: 1000;
    }

    .race-section {
        padding: 34px 10px 9px;
        border-radius: 20px;
    }

    .race-section::before {
        right: 36px;
        width: 104px;
        height: 104px;
    }

    .race-section-title strong {
        min-width: 116px;
        padding: 7px 13px 8px 13px;
        font-size: 15px;
    }

    .race-section-title span {
        font-size: 9.5px;
    }

    .race-list {
        gap: 4px;
    }

    .race-row {
        grid-template-columns: 24px 66px minmax(38px, 1fr) 82px;
        gap: 4px;
        height: 21px;
    }

    .money-app[data-theme="light"] .race-row {
        grid-template-columns: 24px 66px minmax(38px, 1fr) 82px;
        height: 21px;
    }

    .race-rank {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }

    .race-name,
    .race-value {
        font-size: 12.8px;
    }

    .race-track {
        height: 9px;
    }

    .race-compact {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 5px;
    }

    .race-chip {
        min-height: 30px;
        padding: 3px 4px;
        font-size: 8.5px;
    }

    .sort-panel {
        min-height: 820px;
        padding: 8px 10px 12px;
    }

    .sort-header {
        margin-bottom: 8px;
    }

    .sort-topline {
        grid-template-columns: 1fr auto;
        gap: 8px;
    }

    .sort-titleline {
        gap: 5px;
        font-size: 12.5px;
        line-height: 1.35;
    }

    .sort-titleline b {
        font-size: 12.5px;
    }

    .sort-time-pill {
        padding: 5px 9px;
        border-radius: 12px;
        font-size: 10px;
    }

    .sort-time-pill b {
        font-size: 14px;
    }

    .sort-summary-card {
        grid-template-columns: 1fr auto;
        gap: 8px;
        margin-top: 6px;
        padding: 0;
        font-size: 11px;
    }

    .sort-summary-card > i {
        display: none;
    }

    .sort-list {
        grid-template-columns: 1fr 1fr;
        gap: 6px 8px;
        padding: 8px 0 0;
    }

    .sort-column {
        gap: 6px;
    }

    .sort-column + .sort-column {
        border-left: 0;
        padding-left: 0;
        padding-top: 0;
    }

    .sort-row {
        grid-template-columns: 27px minmax(62px, 1fr) 48px;
        min-height: 38px;
        gap: 5px;
        padding: 4px 5px;
        border-radius: 8px;
    }

    .sort-rank,
    .sort-rank.solid {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }

    .sort-name {
        font-size: 12.5px;
    }

    .sort-value {
        grid-template-columns: 1fr;
        gap: 2px;
        min-width: 0;
    }

    .sort-track {
        min-width: 34px;
        height: 7px;
    }

    .sort-text {
        min-width: 0;
        text-align: right;
        font-size: 10.5px;
        white-space: nowrap;
    }

    .sort-total-card {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 4px;
        padding: 10px;
    }

    .sort-total-card div {
        justify-content: start;
    }

    .sort-total-card span {
        width: 30px;
        height: 30px;
        font-size: 17px;
    }

    .sort-total-card b {
        font-size: 15px;
    }
}


.sort-header > div:not(.sort-leader) {
    display: none;
}

.chart-stage:has(#sortPanel:not(.is-hidden)) .line-wrap,
.chart-stage:has(#sortPanel:not(.is-hidden)) .line-head,
.chart-stage:has(#sortPanel:not(.is-hidden)) .flow-legend {
    pointer-events: none;
}

.sort-panel:not(.is-hidden) {
    z-index: 80;
    pointer-events: auto;
}

.sort-header {
    margin-bottom: 8px;
}

.sort-topline {
    grid-template-columns: minmax(128px, auto) auto;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    position: relative;
    min-height: 34px;
}

.sort-session-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    position: relative;
    z-index: 80;
}

.sort-session-actions.is-hidden {
    visibility: hidden;
    pointer-events: none;
}

.sort-session-title {
    position: absolute;
    left: 0;
    top: 0;
    min-height: 34px;
    display: flex;
    align-items: center;
    color: #111827;
    font-size: 24px;
    font-weight: 1000;
    line-height: 1;
    white-space: nowrap;
}

.sort-session-title.is-hidden {
    display: none;
}

.sort-session-actions button {
    min-width: 58px;
    height: 30px;
    border: 1px solid #dfe6ef;
    border-radius: 999px;
    background: rgba(255,255,255,.9);
    box-shadow: 5px 7px 16px rgba(116,135,156,.12);
    color: #1c2635;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    pointer-events: auto;
}

.sort-titleline {
    margin-top: 9px;
    justify-content: center;
    text-align: center;
    width: 100%;
    gap: 14px;
    font-size: 20px;
}

.sort-titleline b {
    font-size: 20px;
}

.sort-time-pill {
    position: absolute;
    top: 0;
    right: 0;
    justify-self: end;
    font-size: 20px;
    font-weight: 900;
    text-align: right;
}

.sort-titleline .positive {
    color: #a70f1d;
}

.sort-titleline .negative {
    color: #006b4f;
}

.sort-summary-card {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.sort-main-title {
    margin: 3px 0 0;
    color: #071221;
    font-size: 22px;
    line-height: 1.12;
    font-weight: 1000;
}

.sort-row {
    grid-template-columns: 34px minmax(72px, .95fr) minmax(126px, 1.24fr);
    min-height: 48px;
    transition: transform 420ms cubic-bezier(.2, .8, .2, 1), opacity 420ms ease, border-color 220ms ease, background 220ms ease;
    will-change: transform;
}

.sort-rank,
.sort-rank.solid {
    width: 25px;
    height: 25px;
    font-size: 16px;
    font-weight: 1000;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.sort-name,
.sort-text {
    font-weight: 1100;
}

.sort-name {
    font-size: 17px;
}

.sort-value {
    grid-template-columns: minmax(62px, 1fr) minmax(64px, auto);
    align-items: center;
}

.sort-track {
    height: 10px;
    position: relative;
    overflow: hidden;
}

.sort-fill {
    display: block;
    height: 100%;
    min-width: 6px;
    border-radius: inherit;
    position: relative;
    z-index: 1;
}

.sort-text {
    color: inherit;
    font-size: 13.5px;
    font-weight: 1000;
}

.sort-list {
    position: relative;
    z-index: 2;
    padding-bottom: 0;
}

.sort-footer {
    position: relative;
    z-index: 3;
    margin: 1px 0 6px;
    color: #8d98a8;
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
}

.sort-watermark {
    position: absolute;
    z-index: 1;
    top: 53%;
    left: 50%;
    color: rgba(104, 123, 145, .075);
    font-size: 34px;
    font-weight: 1000;
    letter-spacing: 8px;
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(-12deg);
    white-space: nowrap;
}

@media (max-width: 430px) {
    .sort-panel {
        min-height: 820px;
    }

    .sort-topline {
        grid-template-columns: minmax(106px, auto) auto;
        justify-content: space-between;
        gap: 6px;
        min-height: 28px;
    }

    .sort-session-actions {
        gap: 5px;
    }

    .sort-session-actions button {
        min-width: 48px;
        height: 25px;
        font-size: 11px;
    }

    .sort-session-title {
        min-height: 28px;
        font-size: 18px;
    }

    .sort-time-pill {
        right: 0;
        padding: 5px 9px;
        font-size: 15px;
        font-weight: 900;
    }

    .sort-time-pill b {
        font-size: 15px;
    }

    .sort-titleline {
        margin-top: 7px;
        justify-content: center;
        gap: 8px;
        font-size: 13px;
    }

    .sort-titleline b {
        font-size: 13px;
    }

    .sort-summary-card {
        display: flex;
        justify-content: flex-end;
        margin-top: 5px;
        font-size: 10.5px;
    }

    .sort-main-title {
        margin-top: 3px;
        font-size: 18px;
    }

    .sort-list {
        gap: 7px 8px;
        padding-top: 8px;
        padding-bottom: 84px;
    }

    .sort-row {
        grid-template-columns: 18px minmax(50px, .82fr) minmax(76px, 1.18fr);
        min-height: 45px;
        gap: 3px;
        padding: 4px 4px;
    }

    .sort-rank,
    .sort-rank.solid {
        width: 17px;
        height: 17px;
        font-size: 12.2px;
        font-weight: 1000;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .sort-name {
        font-size: 11.8px;
        font-weight: 1100;
    }

    .sort-value {
        grid-template-columns: minmax(27px, 1fr) minmax(46px, auto);
        gap: 3px;
        align-items: center;
    }

    .sort-track {
        min-width: 34px;
        height: 8px;
    }

    .sort-footer {
        left: 12px;
        right: 12px;
        bottom: 28px;
        margin-top: 0;
        font-size: 14px;
        font-weight: 1000;
    }

    .sort-text {
        min-width: 46px;
        font-size: 9.8px;
        font-weight: 1000;
    }
}

.chart-stage:has(#sortPanel:not(.is-hidden)) .watermark {
    display: none;
}

/* Dark-theme racing board: follows the global “黑色背景” switch. */
.money-app[data-theme="dark"]:has(#racePanel:not(.is-hidden)),
.money-app[data-theme="dark"] .workspace:has(#racePanel:not(.is-hidden)),
.money-app[data-theme="dark"] .chart-stage:has(#racePanel:not(.is-hidden)) {
    background:
        radial-gradient(circle at 18% 14%, rgba(177,38,48,.16), transparent 30%),
        radial-gradient(circle at 86% 78%, rgba(18,151,102,.14), transparent 34%),
        linear-gradient(145deg, #04070d 0%, #0a111b 52%, #07131a 100%);
}

.money-app[data-theme="dark"] .race-panel {
    border: 1px solid rgba(112, 150, 181, .20);
    background:
        radial-gradient(circle at 13% 5%, rgba(214,54,61,.10), transparent 28%),
        radial-gradient(circle at 90% 86%, rgba(21,197,120,.10), transparent 34%),
        linear-gradient(155deg, #09111d 0%, #101925 52%, #071018 100%);
    box-shadow: 0 22px 52px rgba(0,0,0,.52), inset 0 1px 0 rgba(176,211,240,.09);
}

.money-app[data-theme="dark"] .race-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, transparent 0 42px, rgba(122,174,208,.035) 43px 44px);
}

.money-app[data-theme="dark"] .race-session-actions button,
.money-app[data-theme="dark"] .race-mode-switch label,
.money-app[data-theme="dark"] .race-keys span {
    border-color: rgba(126,163,196,.24);
    background: rgba(15,29,43,.86);
    color: #eaf4ff;
    box-shadow: inset 0 1px 0 rgba(200,232,255,.08), 0 8px 18px rgba(0,0,0,.28);
}

.money-app[data-theme="dark"] .race-header {
    border-color: rgba(122,164,201,.20);
    background: rgba(11,23,37,.86);
    box-shadow: inset 0 1px 0 rgba(187,224,255,.08), 0 12px 26px rgba(0,0,0,.30);
}

.money-app[data-theme="dark"] .race-session strong,
.money-app[data-theme="dark"] .race-session span,
.money-app[data-theme="dark"] .race-session b,
.money-app[data-theme="dark"] .race-keys,
.money-app[data-theme="dark"] .race-mode-switch {
    color: #edf7ff;
}

.money-app[data-theme="dark"] .race-section {
    border-color: rgba(112,150,181,.20);
    box-shadow: inset 0 1px 0 rgba(188,225,255,.06), 0 14px 26px rgba(0,0,0,.26);
}

.money-app[data-theme="dark"] .race-section.inflow {
    background: linear-gradient(135deg, rgba(74,17,28,.48), rgba(12,24,37,.88) 58%);
}

.money-app[data-theme="dark"] .race-section.outflow {
    background: linear-gradient(135deg, rgba(9,52,40,.48), rgba(9,24,33,.88) 58%);
}

.money-app[data-theme="dark"] .race-section-title span,
.money-app[data-theme="dark"] .race-footer {
    color: rgba(214,232,246,.58);
}

.money-app[data-theme="dark"] .race-row {
    color: #edf7ff;
}

.money-app[data-theme="dark"] .race-row.race-top-highlight {
    background: linear-gradient(90deg, rgba(191,37,52,.34), rgba(20,31,43,.08));
}

.money-app[data-theme="dark"] .race-row.race-bottom-highlight {
    background: linear-gradient(90deg, rgba(16,153,99,.34), rgba(20,31,43,.08));
}

.money-app[data-theme="dark"] .race-rank {
    border-color: rgba(224,241,255,.22);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.28), inset 0 -2px 3px rgba(0,0,0,.36), 0 4px 11px rgba(0,0,0,.30);
}

.money-app[data-theme="dark"] .race-track {
    border-color: rgba(132,169,199,.22);
    background: linear-gradient(180deg, #07101a, #132536);
    box-shadow: inset 2px 2px 5px rgba(0,0,0,.46), inset -1px -1px 4px rgba(140,195,230,.09);
}

.money-app[data-theme="dark"] .race-fill {
    box-shadow: inset 0 1px 1px rgba(255,255,255,.42), inset 0 -2px 3px rgba(0,0,0,.23), 0 0 10px color-mix(in srgb, var(--accent) 54%, transparent);
}

.money-app[data-theme="dark"] .race-value {
    text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 42%, transparent);
}

.money-app[data-theme="dark"] .race-chip {
    border-color: rgba(124,164,195,.22);
    background: rgba(13,29,42,.82);
    box-shadow: inset 0 1px 0 rgba(196,231,255,.07), 0 6px 13px rgba(0,0,0,.24);
}

.money-app[data-theme="dark"] .race-chip-name {
    color: #eaf5ff;
}

.money-app[data-theme="dark"] .race-time-pill,
.money-app[data-theme="dark"] .race-time-pill b {
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,.24);
}

/* Keep the race board slightly narrower and tighten its value/track spacing. */
.race-panel {
    top: 36px;
    right: 26px;
}

.race-row,
.money-app[data-theme="light"] .race-row {
    grid-template-columns: 28px 80px minmax(90px, 1fr) 76px;
    gap: 4px;
}

@media (max-width: 900px) {
    .race-panel {
        top: 36px;
        right: 18px;
    }

    .race-row,
    .money-app[data-theme="light"] .race-row {
        grid-template-columns: 24px 66px minmax(38px, 1fr) 72px;
        gap: 3px;
    }
}

/* Race view spacing and compact-tag layout. */
.race-session-actions {
    margin-top: 10px;
}

/* The control slot collapses completely once noon/close controls are hidden. */
.race-session-actions.is-hidden {
    display: none !important;
    pointer-events: none;
}

.race-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.race-chip {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
    min-height: 28px;
    padding: 3px 5px;
    column-gap: 4px;
}

.race-chip-name {
    padding-left: 0;
    text-align: left;
}

.race-chip-value {
    grid-column: auto;
    white-space: nowrap;
    text-align: right;
}

@media (max-width: 900px) {
    .race-session-actions {
        margin-top: 0px;
    }

    .race-compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
    }

    .race-chip {
        min-height: 26px;
        padding: 3px 4px;
        column-gap: 3px;
    }

    .race-chip-rank {
        width: 16px;
        height: 16px;
        font-size: 8.5px;
    }

    .race-chip-name,
    .race-chip-value {
        font-size: 8.8px;
    }
}

/* Compact sorting board: reserve more vertical space for sector rows. */
.sort-panel {
    min-height: 720px;
    padding: 10px 14px 12px;
}

.sort-header,
.sort-summary-card {
    margin-bottom: 4px;
}

.sort-list {
    gap: 5px 9px;
    padding-top: 5px;
}

.sort-column {
    gap: 5px;
}

.sort-row {
    min-height: 34px;
    gap: 5px;
    padding: 3px 6px;
}

.sort-rank,
.sort-rank.solid {
    width: 25px;
    height: 25px;
    font-size: 13px;
}

.sort-name {
    font-size: 10px;
}

.selection-mode-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin: 5px 0 10px;
}

.selection-mode-buttons button {
    min-height: 27px;
    padding: 3px 2px;
    font-size: 11px;
}

.sort-track {
    height: 6px;
}

.sort-text {
    font-size: 11.5px;
}

@media (max-width: 900px) {
    .sort-panel {
        min-height: 700px;
        padding: 6px 8px 10px;
    }

    .sort-header {
        margin-bottom: 4px;
    }

    .sort-summary-card {
        margin-top: 3px;
    }

    .sort-list {
        gap: 4px 6px;
        padding-top: 4px;
    }

    .sort-column {
        gap: 4px;
    }

    .sort-row {
        min-height: 32px;
        padding: 2px 4px;
    }

    .sort-track {
        height: 5px;
    }
}

/* Final sort-view overrides. */
.sort-panel .sort-footer {
    display: none;
}

.sort-summary-card {
    justify-content: space-between;
    margin-top: 6px;
    color: #8d98a8;
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.35;
    text-align: right;
}

.sort-summary-card::before {
    content: "\4ec5\505a\516c\5f00\6570\636e\6574\7406\0020\4e0d\6784\6210\6295\8d44\5efa\8bae";
    color: #8d98a8;
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
    font-size: 10px;
    font-weight: 800;
    text-align: left;
}

.sort-summary-card > span {
    margin-left: auto;
}

.sort-watermark {
    display: none;
}

.sort-watermarks {
    position: absolute;
    z-index: 4;
    inset: 92px 18px 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    pointer-events: none;
}

.sort-watermarks span {
    align-self: center;
    justify-self: center;
    color: rgba(104, 123, 145, .10);
    font-size: 21px;
    font-weight: 1000;
    letter-spacing: 6px;
    transform: rotate(-12deg);
    user-select: none;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .sort-summary-card {
        font-size: 10px;
        margin-top: 3px;
    }

    .sort-watermarks {
        inset: 72px 8px 10px;
    }

    .sort-watermarks span {
        font-size: 14px;
        letter-spacing: 4px;
    }
}
