:root {
    --bg: #0b0f16;
    --panel: #0f1624;
    --panel2: #0d1320;
    --text: #e7edf7;
    --muted: #93a4bc;
    --accent: #7c5cff;
    --accent2: #2dd4bf;
    --danger: #ff5c7a;
    --warn: #ffcc66;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
    --radius: 16px;
    --bg-layer-1: radial-gradient(
        1500px 900px at 10% -4%,
        rgba(124, 92, 255, 0.2),
        transparent 62%
    );
    --bg-layer-2: radial-gradient(
        1250px 800px at 92% 8%,
        rgba(45, 212, 191, 0.16),
        transparent 62%
    );
    --bg-layer-3: linear-gradient(
        180deg,
        rgba(8, 12, 19, 0.92) 0%,
        rgba(11, 15, 22, 1) 72%
    );
    --surface-a: rgba(0, 0, 0, 0.18);
    --surface-b: rgba(255, 255, 255, 0.03);
    --field-bg: rgba(0, 0, 0, 0.25);
    --line-soft: rgba(255, 255, 255, 0.06);
    --btn-bg: rgba(255, 255, 255, 0.04);
    --btn-ghost-bg: rgba(255, 255, 255, 0.02);
    --mono:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    --sans:
        ui-sans-serif, -apple-system, system-ui, Segoe UI, Roboto, Arial,
        "Noto Sans", "Liberation Sans", sans-serif;
}
body[data-theme="light"] {
    --bg: #ebf2ff;
    --panel: #ffffff;
    --panel2: #f5f8ff;
    --text: #1f2a3a;
    --muted: #5d6f87;
    --accent: #2455d6;
    --accent2: #0ea5a2;
    --danger: #cf2f57;
    --warn: #b7791f;
    --border: rgba(21, 37, 63, 0.16);
    --shadow: 0 16px 46px rgba(21, 39, 67, 0.13);
    --bg-layer-1: radial-gradient(
        1600px 980px at 8% -4%,
        rgba(36, 85, 214, 0.22),
        transparent 62%
    );
    --bg-layer-2: radial-gradient(
        1350px 860px at 92% 8%,
        rgba(14, 165, 162, 0.18),
        transparent 62%
    );
    --bg-layer-3: linear-gradient(
        180deg,
        #f8fbff 0%,
        #eef4ff 42%,
        #e8f0ff 100%
    );
    --surface-a: rgba(255, 255, 255, 0.82);
    --surface-b: rgba(255, 255, 255, 0.9);
    --field-bg: rgba(255, 255, 255, 0.95);
    --line-soft: rgba(21, 37, 63, 0.12);
    --btn-bg: rgba(255, 255, 255, 0.88);
    --btn-ghost-bg: rgba(255, 255, 255, 0.78);
}
* {
    box-sizing: border-box;
}
html,
body {
    height: 100%;
}
body {
    margin: 0;
    font-family: var(--sans);
    color: var(--text);
    background-color: var(--bg);
    background-image: var(--bg-layer-1), var(--bg-layer-2), var(--bg-layer-3);
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-position: 0 0, 100% 0, 0 0;
    background-size: 1700px 1200px, 1500px 1000px, 100% 100%;
    background-attachment: fixed, fixed, fixed;
    transition: background-color 0.25s ease, color 0.25s ease;
}
.dash-bg {
    min-height: 100%;
}
@media (max-width: 900px) {
    body {
        background-attachment: scroll, scroll, scroll;
        background-size: 1350px 950px, 1180px 820px, 100% 100%;
    }
}

.wrap {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 22px;
}
.container.container-pro {
    max-width: 1800px;
    max-width: min(1800px, 96vw);
}

.card {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.04),
        rgba(255, 255, 255, 0.02)
    );
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}
.card-lg {
    width: 420px;
    max-width: 95vw;
    padding: 22px;
}
.card-wide {
    width: 100%;
}

.brand {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.2px;
}
.h1 {
    font-weight: 800;
    font-size: 26px;
}
.h2 {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 10px;
}
.muted {
    color: var(--muted);
}
.inst-warning-note {
    color: rgba(255, 228, 178, 0.95);
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.userbox {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.user {
    font-family: var(--mono);
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-b);
}

.form {
    display: block;
}
.label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}
.inp {
    width: 100%;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--field-bg);
    color: var(--text);
    outline: none;
}
.inp:focus {
    border-color: rgba(124, 92, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--btn-bg);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}
.btn:hover {
    border-color: rgba(255, 255, 255, 0.16);
}
.btn-primary {
    background: linear-gradient(
        90deg,
        rgba(124, 92, 255, 0.95),
        rgba(45, 212, 191, 0.85)
    );
    border-color: transparent;
    font-weight: 700;
}
.btn-primary:hover {
    filter: brightness(1.03);
}
.btn-ghost {
    background: var(--btn-ghost-bg);
}
.btn-icon {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    font-size: 16px;
    line-height: 1;
}
.tab-shortcut.active {
    border-color: rgba(124, 92, 255, 0.65);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.16);
}
body[data-theme="light"] .tab-shortcut.active {
    border-color: rgba(36, 85, 214, 0.55);
    box-shadow: 0 0 0 3px rgba(36, 85, 214, 0.14);
}
.btn.btn-mini {
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 12px;
}
.trade-journal-btn {
    position: relative;
    overflow: hidden;
    border-color: rgba(147, 164, 188, 0.45);
    background: linear-gradient(
        110deg,
        rgba(147, 164, 188, 0.12),
        rgba(124, 92, 255, 0.08)
    );
    box-shadow: 0 0 0 0 rgba(124, 92, 255, 0.22);
    animation: trade-btn-pulse 2.5s ease-in-out infinite;
}
.trade-journal-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.22) 44%,
        rgba(255, 255, 255, 0) 72%
    );
    transform: translateX(-140%);
    animation: trade-btn-shimmer 3.2s ease-in-out infinite;
    pointer-events: none;
}
.trade-journal-btn > * {
    position: relative;
    z-index: 1;
}
.trade-journal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(147, 164, 188, 0.9);
}
.trade-journal-btn.is-long {
    border-color: rgba(46, 204, 113, 0.55);
    background: linear-gradient(
        110deg,
        rgba(46, 204, 113, 0.22),
        rgba(17, 130, 83, 0.2)
    );
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.25);
}
.trade-journal-btn.is-long .trade-journal-dot {
    background: rgba(189, 243, 208, 0.98);
}
.trade-journal-btn.is-short {
    border-color: rgba(255, 92, 122, 0.58);
    background: linear-gradient(
        110deg,
        rgba(255, 92, 122, 0.2),
        rgba(176, 39, 72, 0.2)
    );
    box-shadow: 0 0 0 0 rgba(255, 92, 122, 0.24);
}
.trade-journal-btn.is-short .trade-journal-dot {
    background: rgba(255, 186, 198, 0.98);
}
@keyframes trade-btn-shimmer {
    0% {
        transform: translateX(-140%);
    }
    62%,
    100% {
        transform: translateX(180%);
    }
}
@keyframes trade-btn-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(124, 92, 255, 0.14);
    }
    50% {
        box-shadow: 0 0 0 7px rgba(124, 92, 255, 0);
    }
}
body[data-theme="light"] .trade-journal-btn {
    border-color: rgba(36, 85, 214, 0.36);
    background: linear-gradient(
        120deg,
        rgba(36, 85, 214, 0.12),
        rgba(14, 165, 162, 0.08)
    );
}
body[data-theme="light"] .trade-journal-btn::after {
    background: linear-gradient(
        120deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.48) 44%,
        rgba(255, 255, 255, 0) 72%
    );
}
body[data-theme="light"] .trade-journal-btn.is-long {
    border-color: rgba(15, 122, 69, 0.5);
    background: linear-gradient(
        110deg,
        rgba(15, 122, 69, 0.2),
        rgba(44, 182, 125, 0.2)
    );
}
body[data-theme="light"] .trade-journal-btn.is-short {
    border-color: rgba(180, 37, 66, 0.48);
    background: linear-gradient(
        110deg,
        rgba(180, 37, 66, 0.18),
        rgba(209, 59, 91, 0.2)
    );
}
@media (max-width: 980px) {
    .topbar {
        align-items: stretch;
        flex-direction: column;
    }
    .userbox {
        width: 100%;
        justify-content: space-between;
    }
    .user-actions {
        width: 100%;
        justify-content: flex-start;
    }
}
@media (max-width: 560px) {
    .trade-journal-btn {
        flex: 1 1 auto;
        min-width: 132px;
    }
}

.alert {
    border-radius: 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}
.alert-err {
    border-color: rgba(255, 92, 122, 0.35);
    background: rgba(255, 92, 122, 0.08);
}
.alert-warn {
    border-color: rgba(255, 204, 102, 0.35);
    background: rgba(255, 204, 102, 0.08);
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
@media (max-width: 900px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.kpi-title {
    font-size: 12px;
    color: var(--muted);
}
.kpi-val {
    margin-top: 6px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.row {
    margin-top: 12px;
}
.placeholder {
    border: 1px dashed var(--border);
    border-radius: 14px;
    padding: 14px;
    color: var(--muted);
    background: var(--surface-a);
}

.chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.mlc-chart-head {
    align-items: flex-start;
}
.mlc-head-left {
    min-width: 0;
    max-width: 420px;
    flex: 0 1 auto;
}
.mlc-head-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.mlc-head-status {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.controls.mlc-controls {
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    overflow: visible;
    padding-bottom: 2px;
}
.controls.mlc-controls > * {
    flex: 0 0 auto;
}
.mlc-fs-btn {
    min-width: 42px;
    width: 42px;
    padding-left: 0;
    padding-right: 0;
    font-size: 18px;
    line-height: 1;
}
.sel {
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--field-bg);
    color: var(--text);
    outline: none;
}
.sel:focus {
    border-color: rgba(124, 92, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}
.chart-wrap {
    position: relative;
}
.help-anchor {
    position: relative;
    padding-right: 30px;
}
.drift-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.dash-help-btn,
.drift-help-btn {
    width: 24px;
    min-width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}
.help-anchor > .dash-help-btn-inline {
    position: absolute;
    top: 0;
    right: 0;
}
.dash-help-btn-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
}
.dash-help-btn-flow {
    margin-left: 6px;
    vertical-align: middle;
}
.chart-canvas {
    width: 100%;
    height: 320px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-a);
}
@media (max-width: 520px) {
    .chart-canvas {
        height: 260px;
    }
}

.table-wrap {
    overflow: auto;
}
.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.tbl th,
.tbl td {
    padding: 10px 10px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    white-space: nowrap;
}
.tbl th {
    color: var(--muted);
    font-weight: 600;
}

/* ================= ML Trust v2 (Shadow) ================= */
.trust2-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 12px;
}
@media (max-width: 900px) {
    .trust2-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .trust2-grid {
        grid-template-columns: 1fr;
    }
}
.trust2-item {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--line-soft);
    background: var(--surface-a);
}
.trust2-label {
    font-size: 12px;
    color: var(--muted);
}
.trust2-val {
    margin-top: 6px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
}
.trust2-mono {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.trust2-span-all {
    grid-column: 1 / -1;
}

.trust2-badge {
    font-family: var(--mono);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
}
.trust2-badge.good {
    border-color: rgba(46, 204, 113, 0.35);
    background: rgba(46, 204, 113, 0.1);
    color: rgba(189, 243, 208, 0.95);
}
.trust2-badge.warn {
    border-color: rgba(255, 204, 102, 0.4);
    background: rgba(255, 204, 102, 0.1);
    color: rgba(255, 228, 178, 0.95);
}
.trust2-badge.bad {
    border-color: rgba(255, 92, 122, 0.4);
    background: rgba(255, 92, 122, 0.1);
    color: rgba(255, 186, 198, 0.95);
}

.trust2-val.good {
    color: rgba(189, 243, 208, 0.95);
}
.trust2-val.warn {
    color: rgba(255, 228, 178, 0.95);
}
.trust2-val.bad {
    color: rgba(255, 186, 198, 0.95);
}

/* ================= Monitoring blocks (read-only) ================= */
.grid.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
    .grid.grid-2 {
        grid-template-columns: 1fr;
    }
    .grid.grid-3 {
        grid-template-columns: 1fr;
    }
}

.mono {
    font-family: var(--mono);
}

.mon-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 12px;
}
@media (max-width: 900px) {
    .mon-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .mon-grid {
        grid-template-columns: 1fr;
    }
}
.mon-item {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--line-soft);
    background: var(--surface-a);
}
.mon-label {
    font-size: 12px;
    color: var(--muted);
}
.mon-val {
    margin-top: 6px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
}
.mon-val.good {
    color: rgba(189, 243, 208, 0.95);
}
.mon-val.warn {
    color: rgba(255, 228, 178, 0.95);
}
.mon-val.bad {
    color: rgba(255, 186, 198, 0.95);
}
.mon-mono {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mon-span-all {
    grid-column: 1 / -1;
}

/* ================= Trap Monitor (read-only) ================= */
.market-pulse-head {
    margin: 12px 0 8px;
}
.market-pulse-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.market-pulse-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 18px;
}
.pulse-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    max-width: 100%;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid var(--line-soft);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
    background: var(--surface-a);
    color: var(--text);
    transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}
.pulse-phase-range {
    border-color: rgba(255, 204, 102, 0.42);
    background: rgba(255, 204, 102, 0.14);
    color: rgba(255, 228, 178, 0.98);
}
.pulse-phase-trend {
    border-color: rgba(88, 166, 255, 0.42);
    background: rgba(88, 166, 255, 0.14);
    color: rgba(201, 226, 255, 0.98);
}
.pulse-phase-accum {
    border-color: rgba(45, 212, 191, 0.4);
    background: rgba(45, 212, 191, 0.14);
    color: rgba(188, 244, 236, 0.98);
}
.pulse-phase-distrib {
    border-color: rgba(220, 96, 255, 0.38);
    background: rgba(220, 96, 255, 0.14);
    color: rgba(244, 210, 255, 0.98);
}
.pulse-trap-buy {
    border-color: rgba(46, 204, 113, 0.42);
    background: rgba(46, 204, 113, 0.13);
    color: rgba(189, 243, 208, 0.98);
}
.pulse-trap-sell {
    border-color: rgba(255, 92, 122, 0.45);
    background: rgba(255, 92, 122, 0.13);
    color: rgba(255, 188, 200, 0.98);
}
.pulse-trap-none {
    border-color: rgba(147, 164, 188, 0.35);
    background: rgba(147, 164, 188, 0.12);
    color: rgba(210, 220, 235, 0.94);
}
.pulse-ofi-buy {
    border-color: rgba(46, 204, 113, 0.42);
    background: rgba(46, 204, 113, 0.13);
    color: rgba(189, 243, 208, 0.98);
}
.pulse-ofi-sell {
    border-color: rgba(255, 92, 122, 0.45);
    background: rgba(255, 92, 122, 0.13);
    color: rgba(255, 188, 200, 0.98);
}
.pulse-ofi-balanced {
    border-color: rgba(147, 164, 188, 0.35);
    background: rgba(147, 164, 188, 0.12);
    color: rgba(210, 220, 235, 0.94);
}
.pulse-vol-expanding {
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.16);
    color: rgba(255, 233, 176, 0.98);
}
.pulse-vol-normal {
    border-color: rgba(88, 166, 255, 0.4);
    background: rgba(88, 166, 255, 0.12);
    color: rgba(201, 226, 255, 0.95);
}
.pulse-vol-quiet {
    border-color: rgba(147, 164, 188, 0.35);
    background: rgba(147, 164, 188, 0.1);
    color: rgba(210, 220, 235, 0.9);
}
.pulse-na {
    border-color: rgba(147, 164, 188, 0.35);
    background: rgba(147, 164, 188, 0.1);
    color: rgba(210, 220, 235, 0.9);
}
@media (max-width: 900px) {
    .market-pulse-bar {
        gap: 8px;
    }
    .pulse-pill {
        font-size: 12px;
        padding: 8px 12px;
        flex: 1 1 calc(50% - 8px);
    }
}
@media (max-width: 560px) {
    .pulse-pill {
        flex-basis: 100%;
    }
}
.trap-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin-top: 12px;
}
.trap-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}
.trap-row.single {
    grid-template-columns: minmax(0, 1fr);
}
.trap-row.stats-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.trap-dashboard .section {
    margin-top: 20px;
}
.trap-dashboard .chart-box {
    border-radius: 12px;
    padding: 16px;
    min-height: 260px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.trap-dashboard .chart-box .chart-wrapper {
    position: relative;
    height: 260px;
    overflow: hidden;
}
.trap-dashboard .chart-box .chart-wrapper.large {
    height: 320px;
}
.trap-dashboard .chart-box .chart-wrapper + .chart-wrapper {
    margin-top: 12px;
}
.trap-dashboard .chart-box .chart-wrapper > canvas.chart-canvas,
.trap-dashboard .chart-box .chart-wrapper > canvas.tm-canvas {
    height: 100%;
    max-height: 100%;
}
.trap-dashboard .chart-box canvas {
    max-height: 240px;
}
.trap-dashboard .chart-box .chart-wrapper.large > canvas.chart-canvas,
.trap-dashboard .chart-box .chart-wrapper.large > canvas.tm-canvas {
    max-height: 320px;
}
.trap-dashboard .stats-card {
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.trap-dashboard .stats-row .mon-item {
    height: 100%;
}
.trap-expansion-panel {
    grid-column: 1 / -1;
}
.tmx-head {
    align-items: center;
    margin-bottom: 6px;
}
.tmx-head .controls {
    gap: 8px;
}
.empty-state {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a8a8a;
    text-align: center;
}
@media (max-width: 1100px) {
    .trap-row {
        grid-template-columns: minmax(0, 1fr);
    }
    .trap-row.stats-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .trap-row.stats-row {
        grid-template-columns: minmax(0, 1fr);
    }
}
.tm-grid {
    align-items: stretch;
}
.tm-phase-ribbon {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 30px;
}
.tm-phase {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-a);
    color: var(--text);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.tm-phase-trend {
    border-color: rgba(45, 212, 191, 0.35);
    background: rgba(45, 212, 191, 0.14);
    color: rgba(188, 244, 236, 0.96);
}
.tm-phase-accum {
    border-color: rgba(46, 204, 113, 0.35);
    background: rgba(46, 204, 113, 0.14);
    color: rgba(189, 243, 208, 0.96);
}
.tm-phase-distribution {
    border-color: rgba(255, 92, 122, 0.38);
    background: rgba(255, 92, 122, 0.14);
    color: rgba(255, 188, 200, 0.96);
}
.tm-phase-range {
    border-color: rgba(255, 204, 102, 0.4);
    background: rgba(255, 204, 102, 0.14);
    color: rgba(255, 228, 178, 0.96);
}
.tm-phase-na {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
}
.tm-explain {
    margin: 10px 0 0;
    white-space: pre-wrap;
    line-height: 1.45;
    font-size: 12px;
}
.tm-help-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1;
    cursor: help;
    user-select: none;
}
.tmx-stats {
    align-items: stretch;
}
.tmx-stats .mon-item {
    min-height: 90px;
}
.tmx-explain {
    margin-top: 8px;
    min-height: 44px;
}
.tmc-stats {
    align-items: stretch;
}
.tmc-stats .mon-item {
    min-height: 90px;
}
.tmc-explain {
    margin-top: 8px;
    min-height: 40px;
}

.mon-badge {
    font-family: var(--mono);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
}
.mon-badge.good {
    border-color: rgba(46, 204, 113, 0.35);
    background: rgba(46, 204, 113, 0.1);
    color: rgba(189, 243, 208, 0.95);
}
.mon-badge.warn {
    border-color: rgba(255, 204, 102, 0.4);
    background: rgba(255, 204, 102, 0.1);
    color: rgba(255, 228, 178, 0.95);
}
.mon-badge.bad {
    border-color: rgba(255, 92, 122, 0.4);
    background: rgba(255, 92, 122, 0.1);
    color: rgba(255, 186, 198, 0.95);
}

.tbl.tbl-mini {
    font-size: 12px;
}
.tbl.tbl-mini th,
.tbl.tbl-mini td {
    padding: 7px 8px;
}
.sd-row-summary {
    cursor: pointer;
}
.sd-row-summary:hover td {
    background: rgba(124, 92, 255, 0.06);
}
.sd-row-summary.is-open td {
    background: rgba(124, 92, 255, 0.08);
}
.sd-row-detail {
    background: rgba(124, 92, 255, 0.04);
}
.sd-row-detail[hidden] {
    display: none;
}
.sd-detail-box {
    display: grid;
    gap: 6px;
    font-size: 12px;
}
.sd-detail-kv {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}
.sd-detail-roots {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.sd-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-b);
    font-family: var(--mono);
    font-size: 11px;
}
.sd-trend {
    white-space: nowrap;
    font-weight: 700;
}
.sd-trend-good {
    color: rgba(189, 243, 208, 0.95);
}
.sd-trend-warn {
    color: rgba(255, 228, 178, 0.95);
}
.sd-trend-bad {
    color: rgba(255, 186, 198, 0.95);
}
.sd-rate-good {
    color: rgba(189, 243, 208, 0.95);
}
.sd-rate-warn {
    color: rgba(255, 228, 178, 0.95);
}
.sd-rate-bad {
    color: rgba(255, 186, 198, 0.95);
}
.mlm-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}
.mlm-grid > .pro-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.mlm-grid > .pro-card > .table-wrap,
.mlm-grid > .pro-card > .mlm-live-stack,
.mlm-grid > .pro-card > .muted,
.mlm-grid > .pro-card > .spark {
    width: 100%;
}
.mlm-live-stack {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    align-content: start;
}
.mlm-model-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px;
    background: var(--surface-b);
}
.mlm-model-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.mlm-model-title {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.mlm-model-pred {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
}
.mlm-pred-up {
    color: rgba(189, 243, 208, 0.95);
}
.mlm-pred-down {
    color: rgba(255, 186, 198, 0.95);
}
.mlm-pred-flat {
    color: rgba(255, 228, 178, 0.95);
}
.mlm-pred-na {
    color: var(--muted);
}
.mlm-model-sub {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}
.mlm-prob-list {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}
.mlm-prob-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 52px;
    gap: 8px;
    align-items: center;
    font-size: 11px;
}
.mlm-prob-label {
    color: var(--muted);
    font-family: var(--mono);
    text-align: left;
}
.mlm-prob-bar {
    position: relative;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.mlm-prob-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.8), rgba(45, 212, 191, 0.8));
}
.mlm-badge-good {
    border-color: rgba(46, 204, 113, 0.35);
    background: rgba(46, 204, 113, 0.1);
    color: rgba(189, 243, 208, 0.95);
}
.mlm-badge-warn {
    border-color: rgba(255, 204, 102, 0.4);
    background: rgba(255, 204, 102, 0.1);
    color: rgba(255, 228, 178, 0.95);
}
.mlm-badge-bad {
    border-color: rgba(255, 92, 122, 0.4);
    background: rgba(255, 92, 122, 0.1);
    color: rgba(255, 186, 198, 0.95);
}
.mlm-badge-na {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
}
.mlm-spark {
    margin-top: 12px;
}
.mlm-review-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.mlm-review-kpi.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.mlm-mini-stat {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    background: var(--surface-b);
    min-width: 0;
}
.mlm-mini-value {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.mlm-verdict {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--border);
}
.mlm-verdict-confirm {
    color: rgba(189, 243, 208, 0.95);
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.35);
}
.mlm-verdict-skip,
.mlm-verdict-early {
    color: rgba(255, 228, 178, 0.95);
    background: rgba(255, 204, 102, 0.1);
    border-color: rgba(255, 204, 102, 0.35);
}
.mlm-verdict-error {
    color: rgba(255, 186, 198, 0.95);
    background: rgba(255, 92, 122, 0.1);
    border-color: rgba(255, 92, 122, 0.35);
}
.mlm-verdict-na {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
}
.mlm-calib-grid {
    display: grid;
    gap: 8px;
}
.mlm-calib-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 110px;
    gap: 8px;
    align-items: center;
    font-size: 11px;
}
.mlm-calib-bin {
    color: var(--muted);
}
.mlm-calib-bar {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.mlm-calib-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(255, 204, 102, 0.8), rgba(96, 165, 250, 0.8));
}
.mlm-calib-meta {
    text-align: right;
}
.mlm-deep-grid {
    align-items: start;
}
.mlm-review-row {
    cursor: pointer;
}
.mlm-review-row:hover td {
    background: rgba(96, 165, 250, 0.06);
}
.mlm-review-row.is-active td {
    background: rgba(96, 165, 250, 0.12);
}
.mlm-deep-panel {
    display: block;
}
.mlm-deep-panel summary {
    cursor: pointer;
    list-style: none;
}
.mlm-deep-panel summary::-webkit-details-marker {
    display: none;
}
.mlm-deep-view {
    display: grid;
    gap: 12px;
}
.mlm-deep-header {
    display: grid;
    gap: 6px;
}
.mlm-deep-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.mlm-side-pill,
.mlm-result-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 700;
}
.mlm-side-long {
    color: rgba(189, 243, 208, 0.95);
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.35);
}
.mlm-side-short {
    color: rgba(255, 186, 198, 0.95);
    background: rgba(255, 92, 122, 0.1);
    border-color: rgba(255, 92, 122, 0.35);
}
.mlm-side-na,
.mlm-result-na {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
}
.mlm-result-win {
    color: rgba(189, 243, 208, 0.95);
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.35);
}
.mlm-result-loss {
    color: rgba(255, 186, 198, 0.95);
    background: rgba(255, 92, 122, 0.1);
    border-color: rgba(255, 92, 122, 0.35);
}
.mlm-deep-models {
    gap: 10px;
}
.mlm-deep-meta {
    display: grid;
    gap: 8px;
}
.mlm-deep-meta-row {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.mlm-deep-empty {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 14px;
    color: var(--muted);
}
.mlm-clusters-bars,
.mlm-clusters-examples {
    display: grid;
    gap: 10px;
}
.mlm-clusters-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.mlm-clusters-select {
    min-width: 64px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-b);
    color: inherit;
}
.mlm-clusters-partial {
    color: var(--muted);
}
.mlm-clusters-partial.is-partial {
    color: #fbbf24;
}
.mlh-breakdown {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}
.mlh-row {
    display: grid;
    gap: 4px;
}
.mlh-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
}
.mlh-bar {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.mlh-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
}
.mlh-fill.good {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.9), rgba(52, 211, 153, 0.9));
}
.mlh-fill.warn {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.9), rgba(251, 191, 36, 0.9));
}
.mlh-fill.bad {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.9), rgba(248, 113, 113, 0.9));
}
.mlh-fill.na {
    background: rgba(148, 163, 184, 0.5);
}
.tcfg-table .tcfg-input,
.tcfg-table .tcfg-textarea {
    width: 100%;
    min-width: 160px;
}
.tcfg-table .tcfg-textarea {
    min-height: 56px;
    resize: vertical;
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}
.tcfg-table tr.tcfg-row-changed td {
    background: rgba(250, 204, 21, 0.08);
}
.tcfg-table tr.tcfg-row-invalid td {
    background: rgba(239, 68, 68, 0.10);
}
.tcfg-table tr.tcfg-row-readonly td {
    opacity: 0.82;
}
.tcfg-error {
    margin-top: 6px;
    color: #fca5a5;
    font-size: 12px;
}
.tcfg-meta-row {
    margin-top: 6px;
    font-size: 12px;
}
.mlm-history-grid {
    align-items: stretch;
}
.mlm-history-box {
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-b);
}
.mlm-cluster-row {
    display: grid;
    gap: 6px;
}
.mlm-cluster-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
}
.mlm-cluster-bar {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.mlm-cluster-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(255, 92, 122, 0.82), rgba(255, 204, 102, 0.82));
}
.mlm-example-block {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-b);
}
.mlm-example-title {
    font-size: 12px;
    font-weight: 700;
}
.mlm-example-list {
    display: grid;
    gap: 6px;
}
.mlm-example-row {
    display: grid;
    grid-template-columns: 138px minmax(0, 1fr) 90px 80px;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.mlm-example-row:hover {
    border-color: rgba(96, 165, 250, 0.35);
    background: rgba(96, 165, 250, 0.08);
}
@media (max-width: 900px) {
    .mlm-grid {
        grid-template-columns: 1fr;
    }
    .mlm-deep-grid {
        grid-template-columns: 1fr;
    }
    .mlm-review-kpi {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .mlm-calib-row {
        grid-template-columns: 68px minmax(0, 1fr);
    }
    .mlm-calib-meta {
        grid-column: 1 / -1;
        text-align: left;
    }
    .mlm-deep-meta-row {
        grid-template-columns: 1fr;
    }
    .mlm-example-row {
        grid-template-columns: 1fr;
    }
}
.bucket-cell {
    max-width: 520px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.meta-cell {
    max-width: 620px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#tcfg_overrides_tbl .inp {
    min-width: 78px;
    padding: 6px 8px;
    border-radius: 8px;
}
#tcfg_overrides_tbl input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.st-ok {
    color: rgba(189, 243, 208, 0.95);
}
.st-fail {
    color: rgba(255, 186, 198, 0.95);
}
.st-skip {
    color: rgba(255, 228, 178, 0.95);
}
.st-info {
    color: rgba(168, 215, 255, 0.96);
}
.st-attempt {
    color: var(--muted);
}

/* ================= Market Overview ================= */
.grid.pro-grid.mo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
    .grid.pro-grid.mo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .grid.pro-grid.mo-grid {
        grid-template-columns: 1fr;
    }
}

#mo_tbl td.mo-v-good {
    color: rgba(189, 243, 208, 0.95);
}
#mo_tbl td.mo-v-warn {
    color: rgba(255, 228, 178, 0.95);
}
#mo_tbl td.mo-v-bad {
    color: rgba(255, 186, 198, 0.95);
}
#mo_tbl td.mo-v-na {
    color: var(--muted);
}

#mo_tbl td.mo-status-ok {
    color: rgba(189, 243, 208, 0.95);
}
#mo_tbl td.mo-status-warn {
    color: rgba(255, 228, 178, 0.95);
}
#mo_tbl td.mo-status-bad {
    color: rgba(255, 186, 198, 0.95);
}

/* ================= Tooltip hints ================= */
.kpi-title[title],
.trust2-label[title],
.mon-label[title],
.label[title],
.tbl th[title],
.h2[title],
.trust2-badge[title],
.mon-badge[title],
.muted[title],
.value-tip[title] {
    cursor: help;
}
.kpi-title[title],
.trust2-label[title],
.mon-label[title],
.label[title],
.tbl th[title],
.h2[title] {
    text-decoration: underline dotted rgba(147, 164, 188, 0.55);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.pro-sub.value-tip[title],
.meta-cell.value-tip[title],
.bucket-cell.value-tip[title] {
    text-decoration: underline dotted rgba(147, 164, 188, 0.45);
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

/* ================= Dashboard PRO ================= */
.op-shell-strip {
    margin-top: 12px;
    padding: 14px 16px;
}
.op-shell-grid {
    display: grid;
    grid-template-columns:
        minmax(240px, 0.95fr)
        minmax(320px, 1.3fr)
        minmax(260px, 1fr)
        minmax(280px, 1.1fr);
    gap: 12px;
}
.op-shell-card {
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
        rgba(0, 0, 0, 0.12);
}
.op-shell-kicker {
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}
.op-shell-main {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}
.op-shell-main-inline {
    font-size: 17px;
}
.op-shell-sub {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted);
}
.op-shell-priority-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.op-shell-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}
.op-shell-pill.good {
    border-color: rgba(45, 212, 191, 0.32);
    background: rgba(45, 212, 191, 0.14);
    color: #91fff0;
}
.op-shell-pill.warn {
    border-color: rgba(255, 204, 102, 0.36);
    background: rgba(255, 204, 102, 0.14);
    color: #ffe2a0;
}
.op-shell-pill.bad {
    border-color: rgba(255, 92, 122, 0.36);
    background: rgba(255, 92, 122, 0.14);
    color: #ffb2c0;
}
.op-shell-pill.neutral {
    border-color: var(--line-soft);
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
}
.op-shell-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}
.op-shell-item {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding-top: 8px;
    border-top: 1px solid var(--line-soft);
}
.op-shell-item:first-child {
    border-top: 0;
    padding-top: 0;
}
.op-shell-item-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.op-shell-item-value {
    min-width: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text);
}
.op-shell-item-value .mono {
    white-space: nowrap;
}
.op-shell-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.op-shell-actions-priority {
    margin-top: 10px;
}
.op-shell-item-btn {
    width: 100%;
    padding: 0;
    border: 0;
    text-align: left;
    cursor: pointer;
    background: transparent;
    color: inherit;
}
.op-shell-item-btn:hover .op-shell-item,
.op-shell-item-btn:focus-visible .op-shell-item {
    border-color: rgba(124, 92, 255, 0.42);
    background: rgba(124, 92, 255, 0.08);
}
.op-shell-item-btn:focus-visible {
    outline: none;
}
.op-shell-item-btn .op-shell-item {
    border: 1px solid transparent;
    border-top-color: var(--line-soft);
    border-radius: 12px;
    padding: 8px 10px 0;
    transition: border-color 0.18s ease, background 0.18s ease;
}
.op-shell-item-btn:first-child .op-shell-item {
    border-top-color: transparent;
}
.op-shell-item-value strong {
    color: var(--text);
}
.op-shell-divider {
    margin: 12px 0;
    height: 1px;
    background: var(--line-soft);
}
.operator-filter-bar {
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    gap: 8px 10px;
    align-items: center;
    flex-wrap: wrap;
}
.operator-filter-note {
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.45;
}
.operator-focus-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.operator-focus-link,
.operator-focus-mini {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font: inherit;
}
.operator-focus-link {
    font-weight: 700;
}
.operator-focus-link:hover,
.operator-focus-link:focus-visible {
    color: #9fc8ff;
    text-decoration: underline;
}
.operator-focus-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 22px;
    padding: 0 6px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
}
.operator-focus-mini:hover,
.operator-focus-mini:focus-visible {
    border-color: rgba(90, 164, 255, 0.32);
    color: #cfe4ff;
    background: rgba(64, 137, 255, 0.12);
}
.operator-focus-row td:first-child {
    background: rgba(64, 137, 255, 0.08);
    box-shadow: inset 3px 0 0 rgba(90, 164, 255, 0.72);
}
body[data-theme="light"] .operator-filter-bar {
    background: rgba(255, 255, 255, 0.82);
}
body[data-theme="light"] .operator-focus-mini {
    background: rgba(255, 255, 255, 0.86);
}
body[data-theme="light"] .operator-focus-row td:first-child {
    background: rgba(53, 113, 189, 0.08);
    box-shadow: inset 3px 0 0 rgba(53, 113, 189, 0.56);
}
@media (max-width: 1320px) {
    .op-shell-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 860px) {
    .op-shell-grid {
        grid-template-columns: 1fr;
    }
    .op-shell-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

.pro-shell {
    --pro-nav-full-width: 330px;
    --pro-nav-icons-width: 88px;
    margin-top: 12px;
    position: relative;
    display: block;
}
body.pro-nav-open {
    overflow: hidden;
}

.pro-side-nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 120;
    width: min(var(--pro-nav-full-width), calc(100vw - 24px));
    height: 100vh;
    max-height: 100vh;
    overflow: auto;
    border: 1px solid var(--border);
    border-left: 0;
    border-radius: 0 16px 16px 0;
    padding: 12px 10px;
    background:
        linear-gradient(
            180deg,
            rgba(12, 18, 28, 0.96),
            rgba(9, 14, 24, 0.92)
        );
    backdrop-filter: blur(18px) saturate(115%);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.42),
        0 10px 24px rgba(0, 0, 0, 0.24);
    transform: translateX(-110%);
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.22s ease,
        opacity 0.22s ease,
        border-color 0.2s ease;
}
body.pro-nav-hidden .pro-side-nav {
    transform: translateX(-110%);
}
body:not(.pro-nav-hidden) .pro-side-nav {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.pro-nav-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 4px 2px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.pro-nav-control-btn {
    min-width: 38px;
}

.pro-side-nav-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pro-nav-section {
    display: grid;
    gap: 8px;
}
.pro-nav-section.is-active .pro-nav-section-head {
    border-color: rgba(124, 92, 255, 0.38);
    background: rgba(124, 92, 255, 0.12);
}
.pro-nav-section + .pro-nav-section {
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
}
.pro-nav-section-head {
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    transition: border-color 0.18s ease, background 0.18s ease;
}
.pro-nav-section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.pro-nav-section-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
}
.pro-nav-zone-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
}
.pro-nav-zone-badge.good {
    border-color: rgba(45, 212, 191, 0.32);
    background: rgba(45, 212, 191, 0.14);
    color: #91fff0;
}
.pro-nav-zone-badge.warn {
    border-color: rgba(255, 204, 102, 0.36);
    background: rgba(255, 204, 102, 0.14);
    color: #ffe2a0;
}
.pro-nav-zone-badge.bad {
    border-color: rgba(255, 92, 122, 0.36);
    background: rgba(255, 92, 122, 0.14);
    color: #ffb2c0;
}
.pro-nav-zone-badge.neutral {
    border-color: var(--line-soft);
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
}
.pro-nav-section-desc {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--muted);
}
.pro-nav-section-note {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text);
    opacity: 0.88;
}

.pro-nav-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    position: relative;
    text-align: left;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.08);
}
.pro-nav-item .cp-tab-badge {
    margin-left: auto;
}
.pro-nav-icon {
    width: 24px;
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(124, 92, 255, 0.14);
    line-height: 1;
    font-size: 14px;
}
.pro-nav-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pro-nav-title {
    font-weight: 700;
    line-height: 1.2;
}
.pro-nav-desc {
    font-size: 11px;
    line-height: 1.3;
    color: var(--muted);
}
.pro-side-nav .pro-nav-item:not(.active):hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}
.pro-main {
    min-width: 0;
}

body.pro-nav-icons .pro-nav-item {
    justify-content: center;
    align-items: center;
    padding: 10px 8px;
}
body.pro-nav-icons .pro-side-nav-list {
    gap: 10px;
}
body.pro-nav-icons .pro-nav-section {
    gap: 10px;
}
body.pro-nav-icons .pro-nav-section + .pro-nav-section {
    padding-top: 10px;
}
body.pro-nav-icons .pro-nav-section-head {
    display: none;
}
body[data-theme="light"] .pro-nav-section.is-active .pro-nav-section-head {
    border-color: rgba(36, 85, 214, 0.28);
    background: rgba(36, 85, 214, 0.08);
}
body.pro-nav-icons .pro-nav-text {
    display: none;
}
body.pro-nav-icons .pro-nav-controls {
    justify-content: center;
}
body.pro-nav-icons .pro-nav-item .cp-tab-badge {
    position: absolute;
    top: 4px;
    right: 4px;
}
.pro-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: block;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(8, 12, 19, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}
body[data-theme="light"] .pro-nav-backdrop {
    background: rgba(31, 49, 79, 0.24);
}
body:not(.pro-nav-hidden) .pro-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.pro-nav-fab {
    position: fixed;
    left: 2px;
    top: 50%;
    bottom: auto;
    z-index: 130;
    width: 48px;
    height: 58px;
    display: none;
    padding: 0;
    border-left: 0;
    border-radius: 0 14px 14px 0;
    transform: translateY(-50%);
}
body.pro-nav-hidden .pro-nav-fab {
    display: inline-flex;
}

@media (max-width: 1200px) {
    .pro-side-nav {
        width: min(360px, calc(100vw - 24px));
    }
    body.pro-nav-icons .pro-side-nav {
        width: 92px;
    }
}

.tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    margin-bottom: 12px;
}
.tab-btn {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface-b);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
}
.tab-btn:hover {
    border-color: rgba(255, 255, 255, 0.16);
}
.tab-btn.active {
    border-color: rgba(124, 92, 255, 0.65);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.16);
}
.pro-side-nav .pro-nav-item.active {
    border-color: rgba(124, 92, 255, 0.78);
    background: linear-gradient(
        90deg,
        rgba(124, 92, 255, 0.24),
        rgba(45, 212, 191, 0.12)
    );
    box-shadow:
        inset 0 0 0 1px rgba(124, 92, 255, 0.3),
        0 0 0 3px rgba(124, 92, 255, 0.14);
}
.pro-side-nav .pro-nav-item.active::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(
        180deg,
        rgba(124, 92, 255, 0.98),
        rgba(45, 212, 191, 0.92)
    );
}
.pro-side-nav .pro-nav-item.active .pro-nav-icon {
    background: rgba(124, 92, 255, 0.3);
}
.pro-side-nav .pro-nav-item[aria-current="page"] {
    outline: 0;
}
body[data-theme="light"] .pro-side-nav .pro-nav-item.active {
    border-color: rgba(36, 85, 214, 0.62);
    background: linear-gradient(
        90deg,
        rgba(36, 85, 214, 0.18),
        rgba(14, 165, 162, 0.1)
    );
    box-shadow:
        inset 0 0 0 1px rgba(36, 85, 214, 0.26),
        0 0 0 3px rgba(36, 85, 214, 0.12);
}
body[data-theme="light"] .pro-side-nav .pro-nav-item.active::before {
    background: linear-gradient(
        180deg,
        rgba(36, 85, 214, 0.96),
        rgba(14, 165, 162, 0.86)
    );
}
body[data-theme="light"] .pro-side-nav .pro-nav-item.active .pro-nav-icon {
    background: rgba(36, 85, 214, 0.18);
}
body[data-theme="light"] .pro-side-nav {
    background:
        linear-gradient(
            180deg,
            rgba(247, 250, 255, 0.97),
            rgba(238, 244, 252, 0.95)
        );
    box-shadow:
        0 24px 60px rgba(31, 49, 79, 0.16),
        0 10px 24px rgba(31, 49, 79, 0.08);
}
body[data-theme="light"] .pro-nav-controls {
    border-bottom-color: rgba(31, 49, 79, 0.08);
}
body[data-theme="light"] .pro-nav-section-head {
    border-color: rgba(31, 49, 79, 0.08);
    background: rgba(255, 255, 255, 0.82);
}
body[data-theme="light"] .pro-nav-item {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(31, 49, 79, 0.08);
}
body[data-theme="light"] .pro-side-nav .pro-nav-item:not(.active):hover {
    background: rgba(244, 248, 255, 0.98);
    border-color: rgba(36, 85, 214, 0.16);
}
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
}

/* ================= Instruments Admin ================= */
.inst-layout {
    margin-top: 12px;
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}
@media (max-width: 1080px) {
    .inst-layout {
        grid-template-columns: 1fr;
    }
}

.inst-list,
.inst-editor {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-a);
    padding: 10px;
}

.inst-list .tbl tbody tr {
    cursor: pointer;
}
.inst-list .tbl tbody tr:hover {
    background: rgba(124, 92, 255, 0.08);
}
.inst-list .tbl tbody tr.inst-active {
    background: rgba(124, 92, 255, 0.16);
}

.inst-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 700;
}
.inst-badge.on {
    border-color: rgba(46, 204, 113, 0.35);
    color: rgba(189, 243, 208, 0.95);
    background: rgba(46, 204, 113, 0.1);
}
.inst-badge.off {
    border-color: rgba(255, 92, 122, 0.4);
    color: rgba(255, 186, 198, 0.95);
    background: rgba(255, 92, 122, 0.1);
}

.inst-groups {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.inst-group {
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 10px;
    background: var(--surface-b);
}

.inst-group-title {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
}

.inst-table {
    width: 100%;
    border-collapse: collapse;
}
.inst-table th,
.inst-table td {
    border-bottom: 1px solid var(--line-soft);
    padding: 7px 6px;
    vertical-align: middle;
}
.inst-table th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.inst-table td {
    font-size: 12px;
}
.inst-table tr:last-child td {
    border-bottom: 0;
}

.inst-key {
    font-family: var(--mono);
    font-size: 11px;
    color: rgba(210, 220, 235, 0.92);
    white-space: nowrap;
}
.inst-key-desc {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--muted);
}

.inst-base {
    color: rgba(147, 164, 188, 0.9);
}

.inst-override {
    font-weight: 800;
    color: rgba(255, 255, 255, 0.97);
}

.inst-effective {
    color: rgba(235, 244, 255, 0.95);
}

.inst-input-wrap {
    display: flex;
    gap: 6px;
    align-items: center;
}
.inst-input-wrap .inp,
.inst-input-wrap .sel {
    min-width: 120px;
    width: 100%;
}

.inst-killbox {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 92, 122, 0.06);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: center;
}
@media (max-width: 900px) {
    .inst-killbox {
        grid-template-columns: 1fr;
    }
}

.inst-secid-status {
    margin-top: 6px;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    background: var(--surface-a);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
}
.inst-expiry-banner {
    margin-top: 8px;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--line-soft);
    background: var(--surface-a);
    color: var(--muted);
    max-width: 520px;
}
.inst-expiry-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    background: var(--surface-a);
}
.inst-expiry-tag.good,
.inst-secid-status.good,
.inst-expiry-banner.good {
    border-color: rgba(46, 204, 113, 0.35);
    color: rgba(189, 243, 208, 0.95);
    background: rgba(46, 204, 113, 0.1);
}
.inst-expiry-tag.warn,
.inst-secid-status.warn,
.inst-expiry-banner.warn {
    border-color: rgba(255, 204, 102, 0.4);
    color: rgba(255, 228, 178, 0.95);
    background: rgba(255, 204, 102, 0.1);
}
.inst-expiry-tag.bad,
.inst-secid-status.bad,
.inst-expiry-banner.bad {
    border-color: rgba(255, 92, 122, 0.4);
    color: rgba(255, 186, 198, 0.95);
    background: rgba(255, 92, 122, 0.1);
}

.inst-subtabs {
    margin-top: 10px;
    margin-bottom: 10px;
}

.inst-subpane {
    display: none;
}
.inst-subpane.active {
    display: block;
}
.inst-cron-card {
    margin-top: 12px;
}
.cron-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 66px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    background: var(--surface-a);
}
.cron-chip.good {
    border-color: rgba(46, 204, 113, 0.35);
    color: rgba(189, 243, 208, 0.95);
    background: rgba(46, 204, 113, 0.1);
}
.cron-chip.warn {
    border-color: rgba(255, 204, 102, 0.4);
    color: rgba(255, 228, 178, 0.95);
    background: rgba(255, 204, 102, 0.1);
}
.cron-chip.bad {
    border-color: rgba(255, 92, 122, 0.4);
    color: rgba(255, 186, 198, 0.95);
    background: rgba(255, 92, 122, 0.1);
}
.cron-chip.na {
    border-color: rgba(147, 164, 188, 0.35);
    color: rgba(210, 220, 235, 0.85);
    background: rgba(147, 164, 188, 0.1);
}
.cron-cmd {
    max-width: 520px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cron-note {
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid.pro-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
    .grid.pro-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .grid.pro-grid {
        grid-template-columns: 1fr;
    }
}

.summary-workspace-grid {
    display: grid;
    grid-template-columns: minmax(340px, 1.25fr) minmax(320px, 1fr) minmax(300px, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}
.summary-workspace-card {
    min-width: 0;
}
.summary-workspace-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}
.summary-workspace-item {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 8px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface-a);
}
.summary-workspace-item-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.summary-workspace-item-value {
    min-width: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.summary-workspace-item-btn {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.summary-workspace-item-btn:hover .summary-workspace-item,
.summary-workspace-item-btn:focus-visible .summary-workspace-item {
    border-color: rgba(124, 92, 255, 0.42);
    background: rgba(124, 92, 255, 0.08);
}
.summary-workspace-item-btn:focus-visible {
    outline: none;
}
.summary-workspace-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.review-focus-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.act-workspace-grid {
    display: grid;
    grid-template-columns: minmax(340px, 1.15fr) minmax(320px, 1fr) minmax(300px, 0.95fr);
    gap: 12px;
    margin-bottom: 12px;
}
.tts-workspace-grid {
    margin-top: 12px;
}
.act-workspace-card {
    min-width: 0;
}
.act-workspace-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}
.act-workspace-item {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 8px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface-a);
}
.act-workspace-item-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.act-workspace-item-value {
    min-width: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.act-workspace-item-btn {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.act-workspace-item-btn:hover .act-workspace-item,
.act-workspace-item-btn:focus-visible .act-workspace-item {
    border-color: rgba(124, 92, 255, 0.42);
    background: rgba(124, 92, 255, 0.08);
}
.act-workspace-item-btn:focus-visible {
    outline: none;
}
.act-workspace-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.market-workspace-grid {
    display: grid;
    grid-template-columns: minmax(360px, 1.25fr) minmax(340px, 1.1fr) minmax(280px, 0.9fr);
    gap: 12px;
    margin-bottom: 12px;
}
.market-workspace-card {
    min-width: 0;
}
.market-workspace-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}
.market-workspace-item {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 8px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface-a);
}
.market-workspace-item-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.market-workspace-item-value {
    min-width: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.market-workspace-item-btn {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.market-workspace-item-btn:hover .market-workspace-item,
.market-workspace-item-btn:focus-visible .market-workspace-item {
    border-color: rgba(124, 92, 255, 0.42);
    background: rgba(124, 92, 255, 0.08);
}
.market-workspace-item-btn:focus-visible {
    outline: none;
}
.market-workspace-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.decision-desk-grid {
    display: grid;
    grid-template-columns: minmax(360px, 1.2fr) minmax(280px, 0.95fr) minmax(300px, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}
.decision-desk-card {
    min-width: 0;
}
.decision-desk-hero {
    position: relative;
    overflow: hidden;
}
.decision-desk-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.14), rgba(16, 185, 129, 0.07) 55%, transparent 100%);
    pointer-events: none;
}
.decision-desk-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}
.decision-desk-item {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 8px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface-a);
}
.decision-desk-item-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.decision-desk-item-value {
    min-width: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.decision-desk-note {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted);
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
@media (max-width: 1480px) {
    .decision-desk-grid,
    .act-workspace-grid,
    .summary-workspace-grid,
    .market-workspace-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 1220px) {
    .decision-desk-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .act-workspace-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .summary-workspace-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .market-workspace-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 760px) {
    .decision-desk-grid {
        grid-template-columns: 1fr;
    }
    .decision-desk-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .act-workspace-grid {
        grid-template-columns: 1fr;
    }
    .summary-workspace-grid {
        grid-template-columns: 1fr;
    }
    .market-workspace-grid {
        grid-template-columns: 1fr;
    }
    .act-workspace-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .summary-workspace-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .market-workspace-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

.pro-card {
    padding: 14px;
}
.surface-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.surface-head-compact {
    margin-bottom: 6px;
}
.surface-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text);
}
.surface-sub {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted);
}
.pro-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.pro-card-head > div:first-child {
    min-width: 0;
}
.pro-title {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
    line-height: 1.35;
}
.pro-metric {
    margin-top: 8px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0.2px;
    line-height: 1.15;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.pro-sub {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
    min-width: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.spark {
    width: 100%;
    height: 44px;
    margin-top: 10px;
    border-radius: 12px;
    border: 1px solid var(--line-soft);
    background: var(--surface-a);
}

.pro-badge {
    font-family: var(--mono);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-b);
    color: var(--muted);
}
.pro-badge.good {
    border-color: rgba(46, 204, 113, 0.35);
    background: rgba(46, 204, 113, 0.1);
    color: rgba(189, 243, 208, 0.95);
}
.pro-badge.warn {
    border-color: rgba(255, 204, 102, 0.4);
    background: rgba(255, 204, 102, 0.1);
    color: rgba(255, 228, 178, 0.95);
}
.pro-badge.bad {
    border-color: rgba(255, 92, 122, 0.4);
    background: rgba(255, 92, 122, 0.1);
    color: rgba(255, 186, 198, 0.95);
}
.pro-badge.na {
    border-color: rgba(147, 164, 188, 0.35);
    background: rgba(147, 164, 188, 0.1);
    color: rgba(210, 220, 235, 0.85);
}
.pro-badge.blue {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(96, 165, 250, 0.12);
    color: rgba(191, 219, 254, 0.95);
}
.tbl.tbl-mini tr.oc-gap-warn td {
    background: rgba(255, 204, 102, 0.08);
}
.tbl.tbl-mini tr.oc-gap-bad td {
    background: rgba(255, 92, 122, 0.08);
}

/* ================= Trade Review ================= */
.review-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.9fr);
    gap: 12px;
    align-items: start;
}
.review-left,
.review-right {
    min-width: 0;
}
.review-right {
    position: sticky;
    top: 12px;
}
@media (max-width: 1150px) {
    .review-layout {
        grid-template-columns: 1fr;
    }
    .review-right {
        position: static;
        top: auto;
    }
}
.review-filters {
    margin-bottom: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
}
.review-smart-filters {
    display: flex;
    align-items: center;
    gap: 8px 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}
.rv-compact-check {
    margin-left: auto;
}
.rv-smart-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}
.rv-smart-check > input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
}
.review-reason-q {
    min-width: 260px;
}
@media (max-width: 760px) {
    .review-reason-q {
        min-width: 0;
        width: 100%;
        flex: 1 1 100%;
    }
}
.review-table-wrap {
    max-height: 68vh;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.015);
}
#rv_tbl tbody tr {
    cursor: pointer;
}
#rv_tbl tbody tr:hover {
    background: rgba(124, 92, 255, 0.08);
}
#rv_tbl tbody tr.rv-row-entry-long td {
    background: rgba(46, 204, 113, 0.045);
}
#rv_tbl tbody tr.rv-row-entry-short td {
    background: rgba(255, 92, 122, 0.045);
}
#rv_tbl tbody tr.rv-row-neutral td {
    background: rgba(147, 164, 188, 0.07);
}
#rv_tbl tbody tr.rv-row-entry-long td:first-child {
    box-shadow: inset 3px 0 0 rgba(46, 204, 113, 0.72);
}
#rv_tbl tbody tr.rv-row-entry-short td:first-child {
    box-shadow: inset 3px 0 0 rgba(255, 92, 122, 0.72);
}
#rv_tbl tbody tr.rv-row-neutral td:first-child {
    box-shadow: inset 3px 0 0 rgba(147, 164, 188, 0.72);
}
#rv_tbl tbody tr.rv-row-verdict-early td:first-child {
    box-shadow: inset 5px 0 0 rgba(255, 204, 102, 0.85);
}
#rv_tbl tbody tr.rv-row-verdict-error td {
    box-shadow: inset 0 0 0 1px rgba(255, 92, 122, 0.35);
}
#rv_tbl tbody tr.rv-active td {
    background: rgba(124, 92, 255, 0.16) !important;
}
#rv_tbl td.rv-side-long {
    color: rgba(189, 243, 208, 0.95);
}
#rv_tbl td.rv-side-short {
    color: rgba(255, 186, 198, 0.95);
}
#rv_tbl td.rv-side-none {
    color: var(--muted);
}
.rv-status-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.rv-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-family: var(--mono);
    border: 1px solid var(--line-soft);
    color: var(--muted);
    background: var(--surface-a);
}
.rv-badge.rv-tg {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(96, 165, 250, 0.12);
    color: rgba(191, 219, 254, 0.95);
}
.rv-badge.rv-ack {
    border-color: rgba(46, 204, 113, 0.4);
    background: rgba(46, 204, 113, 0.1);
    color: rgba(189, 243, 208, 0.95);
    padding: 1px 8px;
}
.rv-badge.rv-final {
    border-color: rgba(147, 164, 188, 0.45);
    background: rgba(147, 164, 188, 0.12);
    color: rgba(210, 220, 235, 0.9);
}
.rv-badge.rv-good {
    border-color: rgba(46, 204, 113, 0.4);
    background: rgba(46, 204, 113, 0.1);
    color: rgba(189, 243, 208, 0.95);
}
.rv-badge.rv-warn {
    border-color: rgba(255, 204, 102, 0.45);
    background: rgba(255, 204, 102, 0.12);
    color: rgba(255, 228, 178, 0.95);
}
.rv-badge.rv-bad {
    border-color: rgba(255, 92, 122, 0.45);
    background: rgba(255, 92, 122, 0.12);
    color: rgba(255, 186, 198, 0.95);
}
.rv-badge.rv-na {
    border-color: rgba(147, 164, 188, 0.35);
    background: rgba(147, 164, 188, 0.1);
    color: rgba(210, 220, 235, 0.85);
}
.rv-badge.rv-pending {
    border-color: rgba(147, 164, 188, 0.45);
    background: rgba(147, 164, 188, 0.14);
    color: rgba(222, 230, 242, 0.95);
}
.rv-badge.rv-issue-err {
    border-color: rgba(255, 92, 122, 0.5);
    background: rgba(255, 92, 122, 0.16);
    color: rgba(255, 186, 198, 0.98);
}
.rv-badge.rv-issue-nosee {
    border-color: rgba(255, 176, 86, 0.48);
    background: rgba(255, 176, 86, 0.14);
    color: rgba(255, 225, 178, 0.98);
}
.rv-badge.rv-verdict-error {
    border-color: rgba(255, 92, 122, 0.5);
    background: rgba(255, 92, 122, 0.16);
    color: rgba(255, 186, 198, 0.98);
}
.rv-badge.rv-verdict-early {
    border-color: rgba(255, 204, 102, 0.5);
    background: rgba(255, 204, 102, 0.16);
    color: rgba(255, 228, 178, 0.98);
}
.rv-badge.rv-prov-runtime {
    border-color: rgba(46, 204, 113, 0.4);
    background: rgba(46, 204, 113, 0.1);
    color: rgba(189, 243, 208, 0.95);
}
.rv-badge.rv-prov-fallback {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(96, 165, 250, 0.12);
    color: rgba(191, 219, 254, 0.95);
}
.rv-badge.rv-prov-derived {
    border-color: rgba(255, 204, 102, 0.45);
    background: rgba(255, 204, 102, 0.12);
    color: rgba(255, 228, 178, 0.95);
}
.rv-badge.rv-prov-empty {
    border-color: rgba(147, 164, 188, 0.35);
    background: rgba(147, 164, 188, 0.1);
    color: rgba(210, 220, 235, 0.85);
}
.review-card {
    padding: 12px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}
.review-expl-meta {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12px;
}
.review-expl-meta .review-expl-note {
    opacity: 0.95;
}
.review-text {
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--line-soft);
    background: var(--surface-a);
    white-space: pre-wrap;
    line-height: 1.4;
    font-size: 12px;
}
.review-quick-summary {
    margin-top: 10px;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid var(--line-soft);
    background: var(--surface-a);
}
.review-qs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}
@media (max-width: 860px) {
    .review-qs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .review-qs-grid {
        grid-template-columns: 1fr;
    }
}
.rv-qs-pill {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 5px 7px;
    background: rgba(255, 255, 255, 0.02);
}
.rv-qs-k {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}
.rv-qs-v {
    font-size: 12px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.review-readiness {
    margin-top: 8px;
    border: 1px dashed var(--line-soft);
    border-radius: 10px;
    padding: 7px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255, 255, 255, 0.02);
}
.review-ready-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.rv-ready-badge {
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
}
.review-ready-missing {
    font-size: 12px;
    line-height: 1.35;
    word-break: break-word;
}
.review-readiness.rv-ready-ready {
    border-color: rgba(96, 200, 140, 0.4);
    background: rgba(96, 200, 140, 0.08);
}
.review-readiness.rv-ready-pending {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(96, 165, 250, 0.08);
}
.review-readiness.rv-ready-partial {
    border-color: rgba(224, 175, 86, 0.45);
    background: rgba(224, 175, 86, 0.08);
}
.review-quick-summary.rv-qs-phase-pass {
    border-color: rgba(96, 200, 140, 0.35);
}
.review-quick-summary.rv-qs-phase-warn {
    border-color: rgba(224, 175, 86, 0.42);
    background: rgba(224, 175, 86, 0.08);
}
.review-quick-summary.rv-qs-phase-bad {
    border-color: rgba(225, 112, 112, 0.45);
    background: rgba(225, 112, 112, 0.09);
}
.review-qs-more {
    margin-top: 8px;
}
.review-qs-more > summary {
    cursor: pointer;
    font-size: 12px;
    color: var(--muted);
    user-select: none;
}
.review-qs-more-body {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.review-qs-json {
    margin: 0;
    max-height: 220px;
    overflow: auto;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.20);
    font-size: 11px;
    line-height: 1.3;
    white-space: pre;
}
.review-qs-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
@media (max-width: 720px) {
    .review-qs-cols {
        grid-template-columns: 1fr;
    }
}
.review-qs-list {
    max-height: 140px;
}
.review-autohint {
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--line-soft);
    background: var(--surface-a);
}
#rv_hint_summary {
    line-height: 1.35;
    white-space: normal;
}
.review-autohint .review-hint-tech > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.03);
}
.review-err-box {
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 92, 122, 0.30);
    background: rgba(255, 92, 122, 0.08);
}
.review-err-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.review-err-main {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
    word-break: break-word;
}
.review-err-meta {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--muted);
    word-break: break-word;
}
.review-err-list {
    margin-top: 8px;
    max-height: 160px;
}
.review-err-list li {
    background: rgba(255, 255, 255, 0.04);
}
.review-group-box {
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--line-soft);
    background: var(--surface-a);
}
.review-group-grid {
    margin-top: 6px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
@media (max-width: 920px) {
    .review-group-grid {
        grid-template-columns: 1fr;
    }
}
.review-group-col {
    min-width: 0;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 7px 8px;
    background: rgba(255, 255, 255, 0.02);
}
.review-group-note {
    margin-top: 6px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 7px 8px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 11px;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}
.review-group-list {
    max-height: 140px;
}
.review-reason-problem {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.review-focus-block,
.review-problems-block {
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 9px 10px;
    background: rgba(255, 255, 255, 0.02);
}
.review-focus-main {
    margin-top: 5px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
    word-break: break-word;
}
.review-problems-list {
    margin-top: 6px;
    max-height: 120px;
}
.review-problems-list li {
    background: rgba(255, 176, 86, 0.1);
}
.review-hint-list {
    margin-top: 6px;
    max-height: 120px;
}
.review-hint-list li {
    background: rgba(113, 174, 235, 0.08);
}
.review-hint-tech > summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 12px;
    user-select: none;
}
#rv_hint_codes {
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 7px 8px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 11px;
    line-height: 1.35;
    word-break: break-word;
    white-space: pre-wrap;
}
.review-context {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}
@media (max-width: 720px) {
    .review-context {
        grid-template-columns: 1fr;
    }
}
.review-context-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}
.review-context-col > .muted {
    margin-bottom: 6px;
}
.review-context .review-list {
    margin-top: 0;
    flex: 1 1 auto;
    max-height: 210px;
}
.review-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow: auto;
}
.review-list li {
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 7px 8px;
    background: var(--surface-a);
    font-size: 12px;
    line-height: 1.35;
    word-break: break-word;
}
.review-actions {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.review-actions .rv-act {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 150px;
    min-height: 36px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.review-actions .rv-act.rv-act-saving,
.rv-context-menu-actions .rv-ctx-act.rv-act-saving {
    border-color: rgba(96, 165, 250, 0.5);
    background: rgba(96, 165, 250, 0.14);
    color: var(--text);
}
.review-progress {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--line-soft);
    background: rgba(96, 165, 250, 0.10);
    color: var(--text);
}
.review-progress-spinner {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(96, 165, 250, 0.22);
    border-top-color: rgba(96, 165, 250, 0.95);
    animation: reviewSpin 0.7s linear infinite;
}
@keyframes reviewSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@media (max-width: 720px) {
    .review-actions .rv-act {
        flex-basis: calc(50% - 6px);
    }
}
.rv-ctx-toggle {
    margin-top: 8px;
    margin-bottom: 2px;
    display: none;
}
.review-card.rv-context-collapsed .review-context {
    display: none;
}
.tab-pane[data-tab="review"].rv-compact #rv_tbl th,
.tab-pane[data-tab="review"].rv-compact #rv_tbl td {
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 11px;
}
.tab-pane[data-tab="review"].rv-compact #rv_tbl th:nth-child(4),
.tab-pane[data-tab="review"].rv-compact #rv_tbl td:nth-child(4),
.tab-pane[data-tab="review"].rv-compact #rv_tbl th:nth-child(5),
.tab-pane[data-tab="review"].rv-compact #rv_tbl td:nth-child(5) {
    display: none;
}
.rv-type-compact {
    display: none;
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.25;
    color: var(--muted);
}
.tab-pane[data-tab="review"].rv-compact .rv-type-compact {
    display: block;
}
.tab-pane[data-tab="review"].rv-compact .review-list li {
    padding: 6px 7px;
    font-size: 11px;
}
.review-batch-nav {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 7px 8px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}
.review-batch-pos {
    min-width: 56px;
    text-align: center;
    font-size: 12px;
}
.review-batch-hotkeys {
    font-size: 11px;
    line-height: 1.2;
}
.rv-context-menu {
    position: fixed;
    z-index: 1200;
    width: min(340px, calc(100vw - 20px));
    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--line-soft);
    background: var(--surface-b);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(14px);
}
.rv-context-menu-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}
.rv-context-menu-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.rv-context-menu-meta {
    font-size: 11px;
    color: var(--muted);
}
.rv-context-menu-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}
.rv-context-menu-actions .rv-ctx-act {
    min-height: 36px;
    justify-content: center;
}
@media (max-width: 520px) {
    .rv-context-menu-actions {
        grid-template-columns: 1fr;
    }
}
.toast-host {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    align-items: center;
    width: min(680px, calc(100vw - 20px));
}
.toast-item {
    width: min(560px, 100%);
    position: relative;
    border-radius: 16px;
    border: 1px solid rgba(147, 164, 188, 0.28);
    background: rgba(8, 14, 24, 0.92);
    color: var(--text);
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    backdrop-filter: blur(14px);
    overflow: hidden;
}
.toast-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: rgba(147, 164, 188, 0.55);
}
.toast-mark {
    flex: 0 0 auto;
    min-width: 38px;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
}
.toast-text {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}
.toast-item.toast-hide {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
}
.toast-item.error {
    border-color: rgba(255, 92, 122, 0.40);
    background: rgba(44, 10, 18, 0.94);
}
.toast-item.error::before {
    background: rgba(255, 92, 122, 0.92);
}
.toast-item.warn {
    border-color: rgba(255, 204, 102, 0.36);
    background: rgba(44, 28, 6, 0.94);
}
.toast-item.warn::before {
    background: rgba(255, 204, 102, 0.95);
}
.toast-item.ok {
    border-color: rgba(46, 204, 113, 0.34);
    background: rgba(7, 39, 24, 0.94);
}
.toast-item.ok::before {
    background: rgba(46, 204, 113, 0.95);
}

/* ================= Cockpit ================= */
.cp-tab-badge {
    margin-left: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    border: 1px solid rgba(255, 204, 102, 0.45);
    background: rgba(255, 204, 102, 0.14);
    color: rgba(255, 228, 178, 0.98);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}
.cp-tab-badge.zero {
    border-color: rgba(147, 164, 188, 0.38);
    background: rgba(147, 164, 188, 0.1);
    color: rgba(210, 220, 235, 0.88);
}
.cockpit-layout {
    margin-top: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}
.cockpit-col {
    min-width: 0;
    width: 100%;
}
.cockpit-col-left,
.cockpit-col-center,
.cockpit-col-right {
    grid-column: 1 / -1;
}
.cockpit-card {
    padding: 12px;
}
.cockpit-queue-wrap {
    max-height: 68vh;
}
#cp_queue_tbl tbody tr {
    cursor: pointer;
}
#cp_queue_tbl tbody tr:hover {
    background: rgba(96, 165, 250, 0.08);
}
#cp_queue_tbl tbody tr.cp-row-active td {
    background: rgba(96, 165, 250, 0.16) !important;
}
#cp_queue_tbl tbody tr.cp-row-long td:first-child {
    box-shadow: inset 3px 0 0 rgba(46, 204, 113, 0.78);
}
#cp_queue_tbl tbody tr.cp-row-short td:first-child {
    box-shadow: inset 3px 0 0 rgba(255, 92, 122, 0.78);
}
#cp_queue_tbl tbody tr.cp-row-block td:first-child {
    box-shadow: inset 3px 0 0 rgba(147, 164, 188, 0.78);
}
.cp-side-long {
    color: rgba(189, 243, 208, 0.95);
    font-weight: 700;
}
.cp-side-short {
    color: rgba(255, 186, 198, 0.95);
    font-weight: 700;
}
.cp-side-block {
    color: rgba(220, 226, 236, 0.92);
    font-weight: 700;
}
.cp-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    padding: 2px 8px;
    font-size: 11px;
    font-family: var(--mono);
    background: var(--surface-a);
    color: var(--muted);
}
.cp-status-badge.cp-pending {
    border-color: rgba(255, 204, 102, 0.45);
    background: rgba(255, 204, 102, 0.12);
    color: rgba(255, 228, 178, 0.95);
}
.cp-status-badge.cp-acked {
    border-color: rgba(46, 204, 113, 0.4);
    background: rgba(46, 204, 113, 0.1);
    color: rgba(189, 243, 208, 0.95);
}
.cp-compact-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}
.cp-compact-check > input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
}
.cp-signal-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.cp-mini-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    background: var(--surface-a);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
    padding: 2px 8px;
    line-height: 1.2;
}
.cp-mini-good {
    border-color: rgba(46, 204, 113, 0.4);
    background: rgba(46, 204, 113, 0.1);
    color: rgba(189, 243, 208, 0.95);
}
.cp-mini-warn {
    border-color: rgba(255, 204, 102, 0.45);
    background: rgba(255, 204, 102, 0.12);
    color: rgba(255, 228, 178, 0.95);
}
.cp-mini-bad {
    border-color: rgba(255, 92, 122, 0.45);
    background: rgba(255, 92, 122, 0.12);
    color: rgba(255, 186, 198, 0.95);
}
.cp-mini-na {
    border-color: rgba(147, 164, 188, 0.35);
    background: rgba(147, 164, 188, 0.1);
    color: rgba(210, 220, 235, 0.85);
}
.cockpit-kv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
@media (max-width: 680px) {
    .cockpit-kv-grid {
        grid-template-columns: 1fr;
    }
}
.cockpit-kv {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--surface-a);
    padding: 7px 8px;
    font-size: 12px;
    line-height: 1.35;
}
.cockpit-kv > .mono {
    text-align: right;
    flex: 1 1 auto;
}
.cockpit-kv-span {
    grid-column: span 2;
}
@media (max-width: 680px) {
    .cockpit-kv-span {
        grid-column: auto;
    }
}
.cockpit-autohint {
    margin-top: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface-a);
    padding: 9px 10px;
}
.cockpit-autohint-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.cp-hint-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    padding: 2px 9px;
    min-width: 84px;
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.2;
    color: var(--muted);
    background: rgba(147, 164, 188, 0.1);
}
.cp-hint-entered {
    border-color: rgba(46, 204, 113, 0.45);
    background: rgba(46, 204, 113, 0.12);
    color: rgba(189, 243, 208, 0.95);
}
.cp-hint-delay {
    border-color: rgba(255, 204, 102, 0.45);
    background: rgba(255, 204, 102, 0.12);
    color: rgba(255, 228, 178, 0.95);
}
.cp-hint-skip,
.cp-hint-error {
    border-color: rgba(255, 92, 122, 0.45);
    background: rgba(255, 92, 122, 0.12);
    color: rgba(255, 186, 198, 0.95);
}
.cp-hint-notseen,
.cp-hint-na {
    border-color: rgba(147, 164, 188, 0.35);
    background: rgba(147, 164, 188, 0.1);
    color: rgba(210, 220, 235, 0.88);
}
.cockpit-hint-list {
    margin-top: 6px;
    max-height: 132px;
}
.cockpit-hint-list li {
    font-size: 12px;
}
.cockpit-actions {
    margin-top: 6px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.cockpit-actions .cp-act.cp-act-reco {
    border-color: rgba(96, 165, 250, 0.6);
    background: rgba(96, 165, 250, 0.16);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.45);
}
.cockpit-actions .cp-act {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 132px;
}
@media (max-width: 820px) {
    .cockpit-actions .cp-act {
        flex-basis: calc(50% - 6px);
    }
}
@media (max-width: 460px) {
    .cockpit-actions .cp-act {
        flex-basis: 100%;
    }
}
.cockpit-context {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.cockpit-context-col {
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface-a);
    padding: 8px;
}
.cockpit-list {
    max-height: 32vh;
}
.cockpit-list li {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.cockpit-event-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.cockpit-event-summary {
    color: var(--muted);
}
.cockpit-metric-good {
    color: rgba(189, 243, 208, 0.95);
}
.cockpit-metric-bad {
    color: rgba(255, 186, 198, 0.95);
}
.tab-pane[data-tab="cockpit"].cp-compact .cp-json {
    display: none !important;
}

/* ================= Trade Command Center ================= */
.tc-row td {
    vertical-align: top;
}
.tc-row.tc-status-expired td {
    opacity: 0.72;
}
.tc-row.tc-status-error td {
    background: rgba(255, 92, 122, 0.06);
}
.tc-row.tc-strong td {
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.35);
}
.tc-status-badge,
.tc-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    padding: 2px 8px;
    font-size: 11px;
    font-family: var(--mono);
    background: var(--surface-a);
    color: var(--muted);
}
.tc-status-badge.tc-status-new {
    border-color: rgba(46, 204, 113, 0.38);
    background: rgba(46, 204, 113, 0.11);
    color: rgba(189, 243, 208, 0.95);
}
.tc-status-badge.tc-status-decided {
    border-color: rgba(96, 165, 250, 0.4);
    background: rgba(96, 165, 250, 0.12);
    color: rgba(191, 219, 254, 0.95);
}
.tc-status-badge.tc-status-expired {
    border-color: rgba(147, 164, 188, 0.38);
    background: rgba(147, 164, 188, 0.1);
    color: rgba(210, 220, 235, 0.85);
}
.tc-status-badge.tc-status-error {
    border-color: rgba(255, 92, 122, 0.45);
    background: rgba(255, 92, 122, 0.12);
    color: rgba(255, 186, 198, 0.95);
}
.tc-type-badge.tc-type-long {
    border-color: rgba(46, 204, 113, 0.38);
    background: rgba(46, 204, 113, 0.11);
    color: rgba(189, 243, 208, 0.95);
}
.tc-type-badge.tc-type-short {
    border-color: rgba(255, 92, 122, 0.45);
    background: rgba(255, 92, 122, 0.12);
    color: rgba(255, 186, 198, 0.95);
}
.tc-type-badge.tc-type-block {
    border-color: rgba(255, 204, 102, 0.45);
    background: rgba(255, 204, 102, 0.12);
    color: rgba(255, 228, 178, 0.95);
}
.tc-actions {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex-wrap: wrap;
}
.tc-delay-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.tc-delay {
    min-width: 74px;
    padding: 6px 8px;
}
.tc-blocked-hint {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255, 204, 102, 0.45);
    background: rgba(255, 204, 102, 0.12);
    color: rgba(255, 228, 178, 0.95);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
}

body[data-theme="light"] .tc-row.tc-status-error td {
    background: rgba(180, 37, 66, 0.08);
}
body[data-theme="light"] .tc-row.tc-strong td {
    box-shadow: inset 0 0 0 1px rgba(36, 85, 214, 0.35);
}
body[data-theme="light"] .tc-status-badge.tc-status-new {
    border-color: rgba(15, 122, 69, 0.4);
    background: rgba(15, 122, 69, 0.1);
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .tc-status-badge.tc-status-decided {
    border-color: rgba(32, 94, 211, 0.38);
    background: rgba(32, 94, 211, 0.1);
    color: rgba(29, 68, 156, 0.98);
}
body[data-theme="light"] .tc-status-badge.tc-status-expired {
    border-color: rgba(95, 111, 135, 0.36);
    background: rgba(95, 111, 135, 0.09);
    color: rgba(67, 82, 104, 0.95);
}
body[data-theme="light"] .tc-status-badge.tc-status-error {
    border-color: rgba(180, 37, 66, 0.45);
    background: rgba(180, 37, 66, 0.1);
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .tc-type-badge.tc-type-long {
    border-color: rgba(15, 122, 69, 0.4);
    background: rgba(15, 122, 69, 0.1);
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .tc-type-badge.tc-type-short {
    border-color: rgba(180, 37, 66, 0.45);
    background: rgba(180, 37, 66, 0.1);
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .tc-type-badge.tc-type-block,
body[data-theme="light"] .tc-blocked-hint {
    border-color: rgba(151, 97, 22, 0.45);
    background: rgba(151, 97, 22, 0.1);
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] #rv_tbl tbody tr:hover {
    background: rgba(36, 85, 214, 0.09);
}
body[data-theme="light"] #rv_tbl tbody tr.rv-row-entry-long td {
    background: rgba(15, 122, 69, 0.07);
}
body[data-theme="light"] #rv_tbl tbody tr.rv-row-entry-short td {
    background: rgba(180, 37, 66, 0.07);
}
body[data-theme="light"] #rv_tbl tbody tr.rv-row-neutral td {
    background: rgba(95, 111, 135, 0.08);
}
body[data-theme="light"] #rv_tbl tbody tr.rv-row-entry-long td:first-child {
    box-shadow: inset 3px 0 0 rgba(15, 122, 69, 0.75);
}
body[data-theme="light"] #rv_tbl tbody tr.rv-row-entry-short td:first-child {
    box-shadow: inset 3px 0 0 rgba(180, 37, 66, 0.75);
}
body[data-theme="light"] #rv_tbl tbody tr.rv-row-neutral td:first-child {
    box-shadow: inset 3px 0 0 rgba(95, 111, 135, 0.72);
}
body[data-theme="light"] #rv_tbl tbody tr.rv-row-verdict-early td:first-child {
    box-shadow: inset 5px 0 0 rgba(151, 97, 22, 0.85);
}
body[data-theme="light"] #rv_tbl tbody tr.rv-row-verdict-error td {
    box-shadow: inset 0 0 0 1px rgba(180, 37, 66, 0.34);
}
body[data-theme="light"] #rv_tbl tbody tr.rv-active td {
    background: rgba(36, 85, 214, 0.16) !important;
}
body[data-theme="light"] #rv_tbl td.rv-side-long {
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] #rv_tbl td.rv-side-short {
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .rv-badge.rv-tg {
    border-color: rgba(32, 94, 211, 0.42);
    background: rgba(32, 94, 211, 0.1);
    color: rgba(29, 68, 156, 0.98);
}
body[data-theme="light"] .rv-badge.rv-ack {
    border-color: rgba(15, 122, 69, 0.42);
    background: rgba(15, 122, 69, 0.1);
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .rv-badge.rv-final,
body[data-theme="light"] .rv-badge.rv-na {
    border-color: rgba(95, 111, 135, 0.35);
    background: rgba(95, 111, 135, 0.09);
    color: rgba(67, 82, 104, 0.95);
}
body[data-theme="light"] .rv-badge.rv-good {
    border-color: rgba(15, 122, 69, 0.4);
    background: rgba(15, 122, 69, 0.1);
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .rv-badge.rv-warn {
    border-color: rgba(151, 97, 22, 0.45);
    background: rgba(151, 97, 22, 0.1);
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .rv-badge.rv-bad {
    border-color: rgba(180, 37, 66, 0.45);
    background: rgba(180, 37, 66, 0.1);
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .rv-badge.rv-pending {
    border-color: rgba(95, 111, 135, 0.4);
    background: rgba(95, 111, 135, 0.12);
    color: rgba(67, 82, 104, 0.95);
}
body[data-theme="light"] .rv-badge.rv-issue-err {
    border-color: rgba(180, 37, 66, 0.5);
    background: rgba(180, 37, 66, 0.14);
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .rv-badge.rv-issue-nosee {
    border-color: rgba(151, 97, 22, 0.48);
    background: rgba(151, 97, 22, 0.12);
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .rv-badge.rv-verdict-error {
    border-color: rgba(180, 37, 66, 0.5);
    background: rgba(180, 37, 66, 0.14);
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .rv-badge.rv-verdict-early {
    border-color: rgba(151, 97, 22, 0.48);
    background: rgba(151, 97, 22, 0.12);
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .rv-badge.rv-prov-runtime {
    border-color: rgba(15, 122, 69, 0.4);
    background: rgba(15, 122, 69, 0.1);
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .rv-badge.rv-prov-fallback {
    border-color: rgba(32, 94, 211, 0.42);
    background: rgba(32, 94, 211, 0.1);
    color: rgba(29, 68, 156, 0.98);
}
body[data-theme="light"] .rv-badge.rv-prov-derived {
    border-color: rgba(151, 97, 22, 0.45);
    background: rgba(151, 97, 22, 0.1);
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .rv-badge.rv-prov-empty {
    border-color: rgba(95, 111, 135, 0.35);
    background: rgba(95, 111, 135, 0.09);
    color: rgba(67, 82, 104, 0.95);
}
body[data-theme="light"] .review-readiness.rv-ready-ready {
    border-color: rgba(15, 122, 69, 0.35);
    background: rgba(15, 122, 69, 0.08);
}
body[data-theme="light"] .review-readiness.rv-ready-pending {
    border-color: rgba(32, 94, 211, 0.36);
    background: rgba(32, 94, 211, 0.08);
}
body[data-theme="light"] .review-readiness.rv-ready-partial {
    border-color: rgba(151, 97, 22, 0.36);
    background: rgba(151, 97, 22, 0.08);
}
body[data-theme="light"] .toast-item {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 14px 36px rgba(21, 39, 67, 0.18);
    border-color: rgba(95, 111, 135, 0.20);
    color: rgba(23, 37, 56, 0.98);
}
body[data-theme="light"] .toast-mark {
    border-color: rgba(95, 111, 135, 0.18);
    background: rgba(95, 111, 135, 0.08);
    color: inherit;
}
body[data-theme="light"] .toast-item.error {
    background: rgba(255, 244, 246, 0.98);
    border-color: rgba(201, 66, 93, 0.26);
}
body[data-theme="light"] .toast-item.warn {
    background: rgba(255, 248, 235, 0.99);
    border-color: rgba(187, 134, 33, 0.28);
}
body[data-theme="light"] .toast-item.ok {
    background: rgba(240, 255, 247, 0.99);
    border-color: rgba(36, 146, 89, 0.24);
}
body[data-theme="light"] .cp-tab-badge {
    border-color: rgba(151, 97, 22, 0.46);
    background: rgba(151, 97, 22, 0.12);
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .cp-tab-badge.zero {
    border-color: rgba(95, 111, 135, 0.36);
    background: rgba(95, 111, 135, 0.1);
    color: rgba(67, 82, 104, 0.96);
}
body[data-theme="light"] #cp_queue_tbl tbody tr:hover {
    background: rgba(36, 85, 214, 0.09);
}
body[data-theme="light"] #cp_queue_tbl tbody tr.cp-row-active td {
    background: rgba(36, 85, 214, 0.16) !important;
}
body[data-theme="light"] #cp_queue_tbl tbody tr.cp-row-long td:first-child {
    box-shadow: inset 3px 0 0 rgba(15, 122, 69, 0.75);
}
body[data-theme="light"] #cp_queue_tbl tbody tr.cp-row-short td:first-child {
    box-shadow: inset 3px 0 0 rgba(180, 37, 66, 0.75);
}
body[data-theme="light"] #cp_queue_tbl tbody tr.cp-row-block td:first-child {
    box-shadow: inset 3px 0 0 rgba(95, 111, 135, 0.74);
}
body[data-theme="light"] .cp-side-long {
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .cp-side-short {
    color: rgba(139, 29, 51, 0.98);
}

.tjm-badge {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tjm-badge.tjm-queued {
    border-color: rgba(147, 164, 188, 0.38);
    background: rgba(147, 164, 188, 0.1);
    color: rgba(210, 220, 235, 0.9);
}
.tjm-badge.tjm-running {
    border-color: rgba(96, 165, 250, 0.4);
    background: rgba(96, 165, 250, 0.12);
    color: rgba(191, 219, 254, 0.95);
}
.tjm-badge.tjm-done {
    border-color: rgba(46, 204, 113, 0.38);
    background: rgba(46, 204, 113, 0.11);
    color: rgba(189, 243, 208, 0.95);
}
.tjm-badge.tjm-failed {
    border-color: rgba(255, 92, 122, 0.45);
    background: rgba(255, 92, 122, 0.12);
    color: rgba(255, 186, 198, 0.95);
}

body[data-theme="light"] .tjm-badge.tjm-queued {
    border-color: rgba(95, 111, 135, 0.36);
    background: rgba(95, 111, 135, 0.1);
    color: rgba(67, 82, 104, 0.96);
}
body[data-theme="light"] .tjm-badge.tjm-running {
    border-color: rgba(32, 94, 211, 0.38);
    background: rgba(32, 94, 211, 0.1);
    color: rgba(29, 68, 156, 0.98);
}
body[data-theme="light"] .tjm-badge.tjm-done {
    border-color: rgba(15, 122, 69, 0.4);
    background: rgba(15, 122, 69, 0.1);
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .tjm-badge.tjm-failed {
    border-color: rgba(180, 37, 66, 0.45);
    background: rgba(180, 37, 66, 0.1);
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .cp-side-block {
    color: rgba(67, 82, 104, 0.96);
}
body[data-theme="light"] .cp-status-badge.cp-pending {
    border-color: rgba(151, 97, 22, 0.45);
    background: rgba(151, 97, 22, 0.1);
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .cp-status-badge.cp-acked {
    border-color: rgba(15, 122, 69, 0.4);
    background: rgba(15, 122, 69, 0.1);
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .cp-mini-good {
    border-color: rgba(15, 122, 69, 0.4);
    background: rgba(15, 122, 69, 0.1);
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .cp-mini-warn {
    border-color: rgba(151, 97, 22, 0.45);
    background: rgba(151, 97, 22, 0.1);
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .cp-mini-bad {
    border-color: rgba(180, 37, 66, 0.45);
    background: rgba(180, 37, 66, 0.1);
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .cp-mini-na {
    border-color: rgba(95, 111, 135, 0.35);
    background: rgba(95, 111, 135, 0.09);
    color: rgba(67, 82, 104, 0.95);
}
body[data-theme="light"] .cp-hint-entered {
    border-color: rgba(15, 122, 69, 0.42);
    background: rgba(15, 122, 69, 0.1);
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .cp-hint-delay {
    border-color: rgba(151, 97, 22, 0.45);
    background: rgba(151, 97, 22, 0.1);
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .cp-hint-skip,
body[data-theme="light"] .cp-hint-error {
    border-color: rgba(180, 37, 66, 0.45);
    background: rgba(180, 37, 66, 0.1);
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .cp-hint-notseen,
body[data-theme="light"] .cp-hint-na {
    border-color: rgba(95, 111, 135, 0.36);
    background: rgba(95, 111, 135, 0.1);
    color: rgba(67, 82, 104, 0.96);
}
body[data-theme="light"] .cockpit-actions .cp-act.cp-act-reco {
    border-color: rgba(32, 94, 211, 0.6);
    background: rgba(32, 94, 211, 0.14);
    box-shadow: inset 0 0 0 1px rgba(32, 94, 211, 0.42);
}
body[data-theme="light"] .cockpit-metric-good {
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .cockpit-metric-bad {
    color: rgba(139, 29, 51, 0.98);
}

.heatmap {
    display: grid;
    gap: 8px;
    align-items: stretch;
}
.heat-h {
    padding: 6px 8px;
    color: var(--muted);
    font-size: 12px;
}
.heat-cell {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 8px;
    min-height: 44px;
    display: flex;
    align-items: center;
}
.heat-txt {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.t2b-card {
    background:
        radial-gradient(1200px 420px at 0% -30%, rgba(40, 191, 140, 0.12), transparent 55%),
        radial-gradient(980px 360px at 100% 0%, rgba(248, 166, 69, 0.12), transparent 52%),
        var(--surface-a);
}
.t2b-meta-row {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.t2b-meta-card {
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface-b);
    padding: 10px 12px;
}
.t2b-meta-value {
    margin-top: 6px;
    font-size: 15px;
    font-weight: 800;
}
.t2b-regime-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.t2b-regime-card {
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface-b);
    padding: 10px 12px;
}
.t2b-reg-main {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 700;
}
.t2b-reg-status {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}
.t2b-legend {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.t2b-legend-chip {
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
}
.t2b-legend-red {
    border-color: rgba(230, 85, 85, 0.45);
    color: rgba(255, 196, 196, 0.95);
    background: rgba(230, 85, 85, 0.14);
}
.t2b-legend-yellow {
    border-color: rgba(233, 187, 73, 0.45);
    color: rgba(255, 235, 180, 0.95);
    background: rgba(233, 187, 73, 0.14);
}
.t2b-legend-green {
    border-color: rgba(58, 188, 122, 0.45);
    color: rgba(196, 255, 220, 0.95);
    background: rgba(58, 188, 122, 0.14);
}
.t2b-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
}
.t2b-pill.t2b-good,
.t2b-reg-status.t2b-good {
    border-color: rgba(46, 204, 113, 0.35);
    color: rgba(189, 243, 208, 0.95);
    background: rgba(46, 204, 113, 0.1);
}
.t2b-pill.t2b-warn,
.t2b-reg-status.t2b-warn {
    border-color: rgba(255, 204, 102, 0.4);
    color: rgba(255, 228, 178, 0.95);
    background: rgba(255, 204, 102, 0.1);
}
.t2b-pill.t2b-bad,
.t2b-reg-status.t2b-bad {
    border-color: rgba(255, 92, 122, 0.4);
    color: rgba(255, 186, 198, 0.95);
    background: rgba(255, 92, 122, 0.1);
}
.t2b-pill.t2b-na,
.t2b-reg-status.t2b-na {
    border-color: rgba(147, 164, 188, 0.35);
    color: rgba(210, 220, 235, 0.85);
    background: rgba(147, 164, 188, 0.1);
}
@media (max-width: 980px) {
    .t2b-meta-row,
    .t2b-regime-grid {
        grid-template-columns: 1fr;
    }
}
body[data-theme="light"] .t2b-card {
    background:
        radial-gradient(1200px 420px at 0% -30%, rgba(15, 122, 69, 0.12), transparent 55%),
        radial-gradient(980px 360px at 100% 0%, rgba(180, 90, 15, 0.11), transparent 52%),
        var(--surface-a);
}
body[data-theme="light"] .t2b-legend-red {
    border-color: rgba(180, 37, 66, 0.45);
    color: rgba(139, 29, 51, 0.98);
    background: rgba(180, 37, 66, 0.1);
}
body[data-theme="light"] .t2b-legend-yellow {
    border-color: rgba(151, 97, 22, 0.45);
    color: rgba(120, 76, 15, 0.98);
    background: rgba(151, 97, 22, 0.1);
}
body[data-theme="light"] .t2b-legend-green {
    border-color: rgba(15, 122, 69, 0.38);
    color: rgba(13, 96, 56, 0.98);
    background: rgba(15, 122, 69, 0.1);
}
body[data-theme="light"] .t2b-reg-status {
    color: rgba(49, 64, 88, 0.95);
}
body[data-theme="light"] .t2b-pill.t2b-good,
body[data-theme="light"] .t2b-reg-status.t2b-good {
    border-color: rgba(15, 122, 69, 0.4);
    color: rgba(13, 96, 56, 0.98);
    background: rgba(15, 122, 69, 0.1);
}
body[data-theme="light"] .t2b-pill.t2b-warn,
body[data-theme="light"] .t2b-reg-status.t2b-warn {
    border-color: rgba(151, 97, 22, 0.45);
    color: rgba(120, 76, 15, 0.98);
    background: rgba(151, 97, 22, 0.1);
}
body[data-theme="light"] .t2b-pill.t2b-bad,
body[data-theme="light"] .t2b-reg-status.t2b-bad {
    border-color: rgba(180, 37, 66, 0.45);
    color: rgba(139, 29, 51, 0.98);
    background: rgba(180, 37, 66, 0.1);
}
body[data-theme="light"] .t2b-pill.t2b-na,
body[data-theme="light"] .t2b-reg-status.t2b-na {
    border-color: rgba(95, 111, 135, 0.35);
    color: rgba(67, 82, 104, 0.95);
    background: rgba(95, 111, 135, 0.09);
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.55);
    z-index: 50;
}
.modal.open {
    display: flex;
}
.modal-card {
    width: 720px;
    max-width: 95vw;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.05),
        rgba(255, 255, 255, 0.03)
    );
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.modal-body {
    margin-top: 12px;
}
.cmd-palette-card {
    width: min(880px, 96vw);
    max-width: 96vw;
}
.cmd-palette-head {
    align-items: flex-start;
}
.cmd-palette-kicker {
    margin-bottom: 4px;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}
.cmd-palette-input {
    font-size: 15px;
    padding: 14px 16px;
}
.cmd-palette-results {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    max-height: min(62vh, 620px);
    overflow: auto;
}
.cmd-palette-item {
    display: grid;
    gap: 8px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    cursor: pointer;
    transition:
        border-color 120ms ease,
        background 120ms ease,
        transform 120ms ease,
        box-shadow 120ms ease;
}
.cmd-palette-item:hover,
.cmd-palette-item.is-active {
    border-color: rgba(90, 164, 255, 0.4);
    background: rgba(64, 137, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}
.cmd-palette-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.cmd-palette-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.cmd-palette-desc {
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
}
.cmd-palette-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cmd-palette-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}
.cmd-palette-tag.action {
    color: rgba(150, 208, 255, 0.98);
    border-color: rgba(79, 156, 237, 0.28);
    background: rgba(40, 98, 176, 0.16);
}
.cmd-palette-tag.tab {
    color: rgba(200, 230, 255, 0.98);
}
.cmd-palette-tag.zone {
    color: rgba(255, 219, 145, 0.98);
    border-color: rgba(183, 133, 29, 0.28);
    background: rgba(110, 81, 25, 0.18);
}
.cmd-palette-tag.current {
    color: rgba(165, 241, 193, 0.98);
    border-color: rgba(51, 173, 101, 0.3);
    background: rgba(26, 96, 58, 0.18);
}
.cmd-palette-empty {
    padding: 16px;
    border: 1px dashed var(--line-soft);
    border-radius: 14px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.02);
}
.cmd-palette-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.cmd-palette-footer span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}
.tmx-zoom-modal-card {
    width: min(1520px, 96vw);
    max-width: 96vw;
}
.tmx-zoom-controls {
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.tmx-zoom-scroll {
    width: 100%;
    max-width: 100%;
    max-height: 74vh;
    overflow: auto;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface-a);
}
.tmx-zoom-canvas {
    display: block;
    width: 100%;
    min-width: 100%;
    height: min(68vh, 760px);
    max-height: none !important;
}
body[data-theme="light"] .tmx-zoom-scroll {
    background: rgba(255, 255, 255, 0.68);
}
.drift-help-body {
    white-space: pre-line;
    line-height: 1.5;
    font-size: 13px;
    color: var(--text);
}
.checks {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface-a);
}
.fresh-detail {
    display: grid;
    gap: 4px;
    min-width: 260px;
}
.fresh-detail-title {
    font-weight: 700;
    color: var(--text);
}
.fresh-detail-list {
    display: grid;
    gap: 2px;
    font-size: 12px;
    color: var(--muted);
}
.fresh-detail-list .mono {
    color: inherit;
}
.fresh-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
}
.fresh-links a {
    text-decoration: none;
}
body[data-theme="light"] .modal {
    background: rgba(22, 40, 70, 0.26);
}
body[data-theme="light"] .modal-card {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.96),
        rgba(248, 251, 255, 0.96)
    );
}
body[data-theme="light"] .cmd-palette-item {
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 20px rgba(34, 52, 84, 0.06);
}
body[data-theme="light"] .cmd-palette-item:hover,
body[data-theme="light"] .cmd-palette-item.is-active {
    background: rgba(232, 242, 255, 0.96);
    box-shadow: 0 14px 28px rgba(34, 52, 84, 0.12);
}
body[data-theme="light"] .cmd-palette-tag {
    border-color: rgba(88, 105, 132, 0.2);
    background: rgba(95, 111, 135, 0.08);
    color: rgba(69, 85, 108, 0.94);
}
body[data-theme="light"] .cmd-palette-tag.action {
    color: rgba(27, 86, 163, 0.96);
    border-color: rgba(54, 113, 189, 0.28);
    background: rgba(53, 113, 189, 0.1);
}
body[data-theme="light"] .cmd-palette-tag.zone {
    color: rgba(121, 81, 19, 0.96);
    border-color: rgba(172, 123, 25, 0.28);
    background: rgba(187, 141, 44, 0.1);
}
body[data-theme="light"] .cmd-palette-tag.current {
    color: rgba(17, 109, 64, 0.96);
    border-color: rgba(42, 150, 89, 0.24);
    background: rgba(40, 152, 89, 0.1);
}
body[data-theme="light"] .cmd-palette-empty,
body[data-theme="light"] .cmd-palette-footer span {
    background: rgba(255, 255, 255, 0.84);
}
body[data-theme="light"] .mlc-tip {
    border-color: var(--line-soft);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 30px rgba(21, 39, 67, 0.18);
    color: var(--text);
}
body[data-theme="light"] .inst-warning-note {
    color: rgba(95, 62, 7, 0.96);
}
body[data-theme="light"] .dash-help-btn,
body[data-theme="light"] .drift-help-btn {
    background: rgba(255, 255, 255, 0.92);
}
body[data-theme="light"] .inst-base {
    color: rgba(95, 111, 135, 0.95);
}
body[data-theme="light"] .inst-override {
    color: rgba(31, 42, 58, 0.96);
}
body[data-theme="light"] .inst-effective {
    color: rgba(39, 53, 73, 0.96);
}
body[data-theme="light"] .inst-key {
    color: rgba(49, 64, 88, 0.96);
}
body[data-theme="light"] .inst-list .tbl tbody tr:hover {
    background: rgba(36, 85, 214, 0.09);
}
body[data-theme="light"] .inst-list .tbl tbody tr.inst-active {
    background: rgba(36, 85, 214, 0.16);
}
body[data-theme="light"] .cron-chip.good {
    border-color: rgba(15, 122, 69, 0.4);
    color: rgba(13, 96, 56, 0.98);
    background: rgba(15, 122, 69, 0.1);
}
body[data-theme="light"] .cron-chip.warn {
    border-color: rgba(151, 97, 22, 0.45);
    color: rgba(120, 76, 15, 0.98);
    background: rgba(151, 97, 22, 0.1);
}
body[data-theme="light"] .cron-chip.bad {
    border-color: rgba(180, 37, 66, 0.45);
    color: rgba(139, 29, 51, 0.98);
    background: rgba(180, 37, 66, 0.1);
}
body[data-theme="light"] .cron-chip.na {
    border-color: rgba(95, 111, 135, 0.35);
    color: rgba(67, 82, 104, 0.95);
    background: rgba(95, 111, 135, 0.09);
}
body[data-theme="light"] .pro-badge.good,
body[data-theme="light"] .trust2-badge.good,
body[data-theme="light"] .mon-badge.good {
    border-color: rgba(15, 122, 69, 0.4);
    background: rgba(15, 122, 69, 0.1);
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .pro-badge.warn,
body[data-theme="light"] .trust2-badge.warn,
body[data-theme="light"] .mon-badge.warn {
    border-color: rgba(151, 97, 22, 0.45);
    background: rgba(151, 97, 22, 0.1);
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .pro-badge.bad,
body[data-theme="light"] .trust2-badge.bad,
body[data-theme="light"] .mon-badge.bad {
    border-color: rgba(180, 37, 66, 0.45);
    background: rgba(180, 37, 66, 0.1);
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .pro-badge.blue {
    border-color: rgba(31, 94, 208, 0.42);
    background: rgba(31, 94, 208, 0.1);
    color: rgba(24, 67, 149, 0.98);
}
body[data-theme="light"] .tm-phase-trend {
    border-color: rgba(10, 125, 122, 0.42);
    background: rgba(10, 125, 122, 0.11);
    color: rgba(10, 92, 89, 0.98);
}
body[data-theme="light"] .tm-phase-accum {
    border-color: rgba(15, 122, 69, 0.42);
    background: rgba(15, 122, 69, 0.11);
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .tm-phase-distribution {
    border-color: rgba(180, 37, 66, 0.44);
    background: rgba(180, 37, 66, 0.1);
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .tm-phase-range {
    border-color: rgba(151, 97, 22, 0.45);
    background: rgba(151, 97, 22, 0.1);
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .tm-phase-na {
    border-color: rgba(95, 111, 135, 0.3);
    background: rgba(95, 111, 135, 0.08);
    color: rgba(67, 82, 104, 0.94);
}
body[data-theme="light"] .market-pulse-title {
    color: rgba(72, 88, 112, 0.94);
}
body[data-theme="light"] .pulse-pill {
    border-color: rgba(95, 111, 135, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
body[data-theme="light"] .pulse-phase-range {
    border-color: rgba(151, 97, 22, 0.45);
    background: rgba(151, 97, 22, 0.1);
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .pulse-phase-trend {
    border-color: rgba(31, 94, 208, 0.42);
    background: rgba(31, 94, 208, 0.1);
    color: rgba(24, 67, 149, 0.98);
}
body[data-theme="light"] .pulse-phase-accum {
    border-color: rgba(10, 125, 122, 0.42);
    background: rgba(10, 125, 122, 0.11);
    color: rgba(10, 92, 89, 0.98);
}
body[data-theme="light"] .pulse-phase-distrib {
    border-color: rgba(180, 37, 66, 0.44);
    background: rgba(180, 37, 66, 0.1);
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .pulse-trap-buy,
body[data-theme="light"] .pulse-ofi-buy {
    border-color: rgba(15, 122, 69, 0.42);
    background: rgba(15, 122, 69, 0.11);
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .pulse-trap-sell,
body[data-theme="light"] .pulse-ofi-sell {
    border-color: rgba(180, 37, 66, 0.44);
    background: rgba(180, 37, 66, 0.1);
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .pulse-trap-none,
body[data-theme="light"] .pulse-ofi-balanced,
body[data-theme="light"] .pulse-vol-quiet,
body[data-theme="light"] .pulse-na {
    border-color: rgba(95, 111, 135, 0.3);
    background: rgba(95, 111, 135, 0.08);
    color: rgba(67, 82, 104, 0.94);
}
body[data-theme="light"] .pulse-vol-expanding {
    border-color: rgba(151, 97, 22, 0.45);
    background: rgba(151, 97, 22, 0.1);
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .pulse-vol-normal {
    border-color: rgba(31, 94, 208, 0.42);
    background: rgba(31, 94, 208, 0.1);
    color: rgba(24, 67, 149, 0.98);
}
body[data-theme="light"] .mlm-badge-good {
    border-color: rgba(15, 122, 69, 0.38);
    background: rgba(15, 122, 69, 0.08);
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .mlm-badge-warn {
    border-color: rgba(151, 97, 22, 0.4);
    background: rgba(151, 97, 22, 0.08);
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .mlm-badge-bad {
    border-color: rgba(180, 37, 66, 0.42);
    background: rgba(180, 37, 66, 0.08);
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .mlm-badge-na {
    border-color: rgba(95, 111, 135, 0.28);
    background: rgba(95, 111, 135, 0.07);
    color: rgba(67, 82, 104, 0.94);
}
body[data-theme="light"] .mlm-pred-up,
body[data-theme="light"] .mlm-verdict-confirm,
body[data-theme="light"] .sd-rate-good,
body[data-theme="light"] .sd-trend-good {
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .mlm-pred-down,
body[data-theme="light"] .mlm-verdict-error,
body[data-theme="light"] .sd-rate-bad,
body[data-theme="light"] .sd-trend-bad {
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .mlm-pred-flat,
body[data-theme="light"] .mlm-verdict-skip,
body[data-theme="light"] .mlm-verdict-early,
body[data-theme="light"] .sd-rate-warn,
body[data-theme="light"] .sd-trend-warn {
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .mlm-verdict-confirm {
    background: rgba(15, 122, 69, 0.08);
    border-color: rgba(15, 122, 69, 0.32);
}
body[data-theme="light"] .mlm-verdict-skip,
body[data-theme="light"] .mlm-verdict-early {
    background: rgba(151, 97, 22, 0.08);
    border-color: rgba(151, 97, 22, 0.34);
}
body[data-theme="light"] .mlm-verdict-error {
    background: rgba(180, 37, 66, 0.08);
    border-color: rgba(180, 37, 66, 0.34);
}
body[data-theme="light"] .mlm-verdict-na {
    background: rgba(95, 111, 135, 0.07);
    color: rgba(67, 82, 104, 0.94);
}
body[data-theme="light"] .mlm-prob-bar {
    border-color: rgba(95, 111, 135, 0.18);
    background: rgba(95, 111, 135, 0.08);
}
body[data-theme="light"] .mlm-prob-fill {
    background: linear-gradient(90deg, rgba(36, 85, 214, 0.58), rgba(14, 165, 162, 0.58));
}
body[data-theme="light"] .pro-nav-fab {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 28px rgba(21, 39, 67, 0.18);
}
body[data-theme="light"] .trust2-val.good,
body[data-theme="light"] .mon-val.good,
body[data-theme="light"] #mo_tbl td.mo-v-good,
body[data-theme="light"] #mo_tbl td.mo-status-ok {
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .trust2-val.warn,
body[data-theme="light"] .mon-val.warn,
body[data-theme="light"] #mo_tbl td.mo-v-warn,
body[data-theme="light"] #mo_tbl td.mo-status-warn {
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .trust2-val.bad,
body[data-theme="light"] .mon-val.bad,
body[data-theme="light"] #mo_tbl td.mo-v-bad,
body[data-theme="light"] #mo_tbl td.mo-status-bad {
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .st-ok {
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .st-fail {
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .st-skip {
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .st-info {
    color: rgba(23, 95, 163, 0.98);
}
body[data-theme="light"] .inst-expiry-tag.good,
body[data-theme="light"] .inst-secid-status.good,
body[data-theme="light"] .inst-expiry-banner.good {
    border-color: rgba(15, 122, 69, 0.4);
    color: rgba(13, 96, 56, 0.98);
    background: rgba(15, 122, 69, 0.1);
}
body[data-theme="light"] .inst-expiry-tag.warn,
body[data-theme="light"] .inst-secid-status.warn,
body[data-theme="light"] .inst-expiry-banner.warn {
    border-color: rgba(151, 97, 22, 0.45);
    color: rgba(120, 76, 15, 0.98);
    background: rgba(151, 97, 22, 0.1);
}
body[data-theme="light"] .inst-expiry-tag.bad,
body[data-theme="light"] .inst-secid-status.bad,
body[data-theme="light"] .inst-expiry-banner.bad {
    border-color: rgba(180, 37, 66, 0.45);
    color: rgba(139, 29, 51, 0.98);
    background: rgba(180, 37, 66, 0.1);
}

/* ================= Storage Manager ================= */
.storage-toolbar {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.storage-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.storage-toolbar-main {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(50, 115, 220, 0.12), rgba(31, 41, 55, 0.03)),
        var(--panel);
}
.storage-toggle-btn {
    gap: 10px;
}
.storage-action-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.storage-action-group {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.storage-action-head {
    margin-bottom: 10px;
}
.storage-action-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.storage-action-sub {
    margin-top: 3px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
}
.storage-action-hint {
    margin-top: 8px;
    padding: 8px 10px;
    border-left: 3px solid rgba(255, 196, 87, 0.65);
    border-radius: 10px;
    background: rgba(255, 196, 87, 0.08);
    font-size: 12px;
    line-height: 1.45;
    color: var(--text);
}
.storage-action-hint code {
    font-size: 11px;
}
.storage-action-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.storage-action-grid .btn {
    min-height: 38px;
}
.storage-btn-clean {
    border-color: rgba(95, 184, 138, 0.3);
    background: linear-gradient(180deg, rgba(95, 184, 138, 0.14), rgba(95, 184, 138, 0.06));
}
.storage-btn-clean:hover {
    border-color: rgba(95, 184, 138, 0.48);
    background: linear-gradient(180deg, rgba(95, 184, 138, 0.2), rgba(95, 184, 138, 0.1));
}
.storage-btn-rotate {
    border-color: rgba(224, 179, 91, 0.34);
    background: linear-gradient(180deg, rgba(224, 179, 91, 0.16), rgba(224, 179, 91, 0.06));
}
.storage-btn-rotate:hover {
    border-color: rgba(224, 179, 91, 0.5);
    background: linear-gradient(180deg, rgba(224, 179, 91, 0.22), rgba(224, 179, 91, 0.1));
}
.storage-result-card {
    margin-top: 12px;
    padding: 12px;
}
.storage-metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.storage-result-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}
.storage-result-summary {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}
.storage-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.9fr);
    gap: 14px;
    align-items: start;
}
.storage-side-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.storage-panel {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015)),
        var(--panel);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.storage-panel-head {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 12px;
}
.storage-panel-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.storage-panel-sub {
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
}
.storage-table-wrap {
    max-height: 640px;
    overflow: auto;
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.08);
}
#stg_tbl {
    width: 100%;
    table-layout: fixed;
}
#stg_tbl th:first-child,
#stg_tbl td:first-child {
    width: 58%;
}
.storage-module-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.storage-module-card {
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
}
.storage-module-card-head {
    margin-bottom: 10px;
}
.storage-module-title {
    font-size: 13px;
    font-weight: 700;
}
.storage-module-meta {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: var(--muted);
}
.storage-surface-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.storage-surface-item {
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(0, 0, 0, 0.14);
}
.storage-surface-top,
.storage-surface-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}
.storage-surface-title {
    font-size: 12px;
    font-weight: 600;
}
.storage-surface-size {
    font-size: 11px;
    color: var(--muted);
}
.storage-surface-meta {
    margin-top: 4px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--muted);
}
.storage-surface-method {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
}
.storage-surface-policy {
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.45;
    color: var(--muted);
}
.storage-path-cell {
    max-width: 0;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.storage-path-cell[title] {
    cursor: help;
}
.storage-guards {
    line-height: 1.45;
    flex-shrink: 0;
    text-align: right;
}
.storage-policy-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.storage-policy-item {
    font-size: 12px;
    line-height: 1.4;
}
.storage-policy-item.guard-active {
    color: rgba(255, 228, 178, 0.95);
}
.storage-surface-guard {
    display: inline-block;
    margin-top: 2px;
    font-size: 11px;
    color: rgba(255, 228, 178, 0.92);
}
.storage-note {
    margin-top: 10px;
    font-size: 12px;
}

#stg_tbl td.stg-ok {
    color: rgba(189, 243, 208, 0.95);
}
#stg_tbl td.stg-dry {
    color: rgba(191, 219, 254, 0.95);
}
#stg_tbl td.stg-skip {
    color: rgba(255, 228, 178, 0.95);
}
#stg_tbl td.stg-fail {
    color: rgba(255, 186, 198, 0.95);
}
body[data-theme="light"] #stg_tbl td.stg-ok {
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] #stg_tbl td.stg-skip {
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] #stg_tbl td.stg-fail {
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .storage-policy-item.guard-active,
body[data-theme="light"] .storage-surface-guard {
    color: rgba(120, 76, 15, 0.98);
}
body[data-theme="light"] .storage-toolbar-main {
    background:
        linear-gradient(135deg, rgba(65, 122, 229, 0.12), rgba(255, 255, 255, 0.7)),
        var(--panel);
}
body[data-theme="light"] .storage-action-group {
    background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(241,245,249,0.88));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}
body[data-theme="light"] .storage-panel {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(241,245,249,0.92)),
        var(--panel);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.88);
}
body[data-theme="light"] .storage-table-wrap {
    background: rgba(248, 250, 252, 0.88);
    border-color: rgba(148, 163, 184, 0.22);
}
body[data-theme="light"] .storage-module-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,250,252,0.92));
    border-color: rgba(148, 163, 184, 0.2);
}
body[data-theme="light"] .storage-surface-item {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(148, 163, 184, 0.18);
}
body[data-theme="light"] .storage-surface-method {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(226, 232, 240, 0.75);
}
body[data-theme="light"] .storage-btn-clean {
    border-color: rgba(36, 126, 79, 0.24);
    background: linear-gradient(180deg, rgba(52, 168, 107, 0.14), rgba(52, 168, 107, 0.06));
}
body[data-theme="light"] .storage-btn-clean:hover {
    border-color: rgba(36, 126, 79, 0.38);
    background: linear-gradient(180deg, rgba(52, 168, 107, 0.2), rgba(52, 168, 107, 0.1));
}
body[data-theme="light"] .storage-btn-rotate {
    border-color: rgba(176, 125, 29, 0.28);
    background: linear-gradient(180deg, rgba(214, 161, 65, 0.18), rgba(214, 161, 65, 0.08));
}
body[data-theme="light"] .storage-btn-rotate:hover {
    border-color: rgba(176, 125, 29, 0.42);
    background: linear-gradient(180deg, rgba(214, 161, 65, 0.24), rgba(214, 161, 65, 0.12));
}

@media (max-width: 1180px) {
    .storage-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .storage-action-groups {
        grid-template-columns: 1fr;
    }
    .storage-layout {
        grid-template-columns: 1fr;
    }
    .storage-module-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .storage-toolbar-main {
        align-items: stretch;
    }
    .storage-action-grid .btn,
    .storage-toolbar-main .btn,
    .storage-toolbar-main .sel {
        width: 100%;
        justify-content: center;
    }
    .storage-toggle-btn {
        justify-content: center;
    }
    .storage-metrics-grid {
        grid-template-columns: 1fr;
    }
    .storage-result-head,
    .storage-surface-top,
    .storage-surface-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    .storage-guards {
        text-align: left;
    }
    .storage-table-wrap {
        max-height: 420px;
    }
}

/* ================= Go Live Checklist ================= */
.go-live-summary-card {
    margin-top: 12px;
    padding: 12px;
}
.go-live-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.go-live-list li {
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.18);
    font-size: 12px;
}
.go-live-list li.gl-item-bad {
    border-color: rgba(255, 92, 122, 0.30);
    background: rgba(255, 92, 122, 0.08);
}
.go-live-list li.gl-item-warn {
    border-color: rgba(255, 204, 102, 0.30);
    background: rgba(255, 204, 102, 0.08);
}
#gl_main.gl-ok {
    color: rgba(189, 243, 208, 0.95);
}
#gl_main.gl-warn {
    color: rgba(255, 228, 178, 0.95);
}
#gl_main.gl-bad {
    color: rgba(255, 186, 198, 0.95);
}

/* ================= Weekly Quant TL Report ================= */
.wr-head {
    align-items: flex-end;
}
.wr-controls {
    gap: 10px 12px;
    justify-content: flex-end;
    align-items: flex-end;
}
.wr-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 170px;
}
.wr-field .label {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.wr-field .sel {
    width: 100%;
}
.wr-field-tickers {
    min-width: 170px;
    max-width: 210px;
}
.wr-tickers-select {
    min-width: 170px;
    min-height: 104px;
    max-height: 132px;
    padding: 6px 8px;
    line-height: 1.35;
    overflow: auto;
}
.wr-actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-left: 2px;
}
.grid.pro-grid.wr-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
    .grid.pro-grid.wr-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .grid.pro-grid.wr-grid {
        grid-template-columns: 1fr;
    }
}

.weekly-summary-card {
    margin-top: 12px;
    padding: 12px;
}
.wr-overview-card .tbl td {
    font-size: 12px;
}
.wr-overview-grid {
    align-items: start;
}
.wr-overview-card .wr-overview-table {
    table-layout: fixed;
}
.wr-overview-card .wr-overview-table td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
    line-height: 1.35;
}
.wr-overview-card .wr-overview-table td:first-child {
    width: 190px;
    color: var(--muted);
    white-space: nowrap;
}
.wr-top-grid {
    margin-top: 10px;
    margin-bottom: 0;
}
.weekly-chart-card {
    margin-top: 12px;
    padding: 12px;
}
.wr-canvas {
    height: 300px;
}
.wr-bottom-grid {
    margin-top: 12px;
}
.wr-ticker-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.wr-ticker-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.16);
    overflow: hidden;
}
.wr-ticker-card > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.wr-ticker-card > summary::-webkit-details-marker {
    display: none;
}
.wr-ticker-name {
    font-weight: 700;
    font-family: var(--mono);
}
.wr-ticker-score {
    display: inline-block;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 11px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.wr-ticker-sub {
    color: var(--muted);
    font-size: 12px;
}
.wr-ticker-body {
    padding: 10px 12px 12px;
}
.wr-ticker-score.wr-ok {
    border-color: rgba(46, 204, 113, 0.45);
    color: rgba(189, 243, 208, 0.95);
}
.wr-ticker-score.wr-warn {
    border-color: rgba(255, 204, 102, 0.45);
    color: rgba(255, 228, 178, 0.95);
}
.wr-ticker-score.wr-bad {
    border-color: rgba(255, 92, 122, 0.45);
    color: rgba(255, 186, 198, 0.95);
}

.wr-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wr-list li {
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.18);
    font-size: 12px;
}
.wr-list li.wr-bad {
    border-color: rgba(255, 92, 122, 0.30);
    background: rgba(255, 92, 122, 0.08);
}
.wr-list li.wr-warn {
    border-color: rgba(255, 204, 102, 0.30);
    background: rgba(255, 204, 102, 0.08);
}
.wr-list li.wr-good {
    border-color: rgba(46, 204, 113, 0.30);
    background: rgba(46, 204, 113, 0.08);
}
#wr_risks {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}
#wr_risks li {
    width: auto;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
}

.wr-rec-list li .wr-prio {
    display: inline-block;
    min-width: 30px;
    text-align: center;
    font-family: var(--mono);
    font-size: 11px;
    margin-right: 8px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
}
.wr-rec-list li .wr-prio.p0 {
    border-color: rgba(255, 92, 122, 0.45);
    background: rgba(255, 92, 122, 0.12);
    color: rgba(255, 186, 198, 0.95);
}
.wr-rec-list li .wr-prio.p1 {
    border-color: rgba(255, 204, 102, 0.45);
    background: rgba(255, 204, 102, 0.12);
    color: rgba(255, 228, 178, 0.95);
}
.wr-rec-list li .wr-prio.p2 {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(96, 165, 250, 0.12);
    color: rgba(191, 219, 254, 0.95);
}

#wr_main.wr-ok {
    color: rgba(189, 243, 208, 0.95);
}
#wr_main.wr-warn {
    color: rgba(255, 228, 178, 0.95);
}
#wr_main.wr-bad {
    color: rgba(255, 186, 198, 0.95);
}
@media (max-width: 1220px) {
    .wr-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .wr-controls {
        width: 100%;
        justify-content: flex-start;
    }
}
@media (max-width: 760px) {
    .wr-field {
        min-width: 140px;
    }
    .wr-field-tickers {
        max-width: 100%;
        min-width: 180px;
    }
    .wr-actions {
        width: 100%;
        margin-left: 0;
    }
}
@media (max-width: 560px) {
    .wr-controls {
        gap: 8px;
    }
    .wr-field {
        width: 100%;
        min-width: 0;
    }
    .wr-field-tickers,
    .wr-tickers-select {
        width: 100%;
        max-width: 100%;
    }
    .wr-actions .btn {
        flex: 1 1 auto;
    }
}

/* ================= Model Doctor ================= */
.md-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.md-list li {
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.18);
    font-size: 12px;
}
.md-list li.md-warn {
    border-color: rgba(255, 204, 102, 0.30);
    background: rgba(255, 204, 102, 0.08);
}
.md-list li.md-bad {
    border-color: rgba(255, 92, 122, 0.30);
    background: rgba(255, 92, 122, 0.08);
}

/* ================= ML Chart PRO ================= */
.mlc-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 12px;
    align-items: start;
}
@media (max-width: 980px) {
    .mlc-grid {
        grid-template-columns: 1fr;
    }
}
.mlc-wrap {
    position: relative;
}
.mlc-canvas {
    height: 460px;
}
.mlc-tip {
    position: absolute;
    z-index: 10;
    pointer-events: none;
    display: none;
    min-width: 220px;
    max-width: 360px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.72);
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.55);
    font-size: 12px;
    color: rgba(231, 237, 247, 0.95);
}
.mlc-tip.open {
    display: block;
}
.mlc-tip .mono {
    font-family: var(--mono);
}
.mlc-side .card {
    box-shadow: none;
}
.mlc-checks {
    align-items: center;
}
.mlc-filter-wrap {
    position: relative;
}
.mlc-filter-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 25;
    min-width: min(620px, 88vw);
    max-width: min(760px, 92vw);
    max-height: min(440px, 62vh);
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-b);
    box-shadow: var(--shadow);
}
.mlc-filter-menu[hidden] {
    display: none;
}
.mlc-filter-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}
.mlc-filter-actions {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 8px;
}
.mlc-filter-actions .btn {
    white-space: nowrap;
}
.mlc-filter-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.mlc-filter-list .check {
    min-height: 40px;
    padding: 7px 10px;
}
@media (max-width: 1180px) {
    .mlc-filter-list {
        grid-template-columns: 1fr;
    }
}
.mlc-rewind {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.mlc-mini-check {
    padding: 6px 8px;
    gap: 6px;
}
.mlc-quick {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.mlc-range {
    flex: 1 1 280px;
    min-width: 180px;
    accent-color: var(--accent2);
}
.mlc-events-card {
    margin-top: 10px;
    padding: 10px;
}
.mlc-events-list {
    margin-top: 8px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
}
.mlc-event-item {
    width: 100%;
    text-align: left;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--surface-a);
    color: var(--text);
    padding: 8px 10px;
    cursor: pointer;
}
.mlc-event-item:hover {
    border-color: rgba(124, 92, 255, 0.45);
}
.mlc-event-item:focus-visible {
    outline: 2px solid rgba(98, 142, 255, 0.65);
    outline-offset: 1px;
}
.mlc-event-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.mlc-event-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 11px;
    font-family: var(--mono);
}
.mlc-event-tag.ok {
    border-color: rgba(46, 204, 113, 0.35);
    color: rgba(189, 243, 208, 0.95);
    background: rgba(46, 204, 113, 0.1);
}
.mlc-event-tag.warn {
    border-color: rgba(255, 204, 102, 0.4);
    color: rgba(255, 228, 178, 0.95);
    background: rgba(255, 204, 102, 0.1);
}
.mlc-event-tag.bad {
    border-color: rgba(255, 92, 122, 0.4);
    color: rgba(255, 186, 198, 0.95);
    background: rgba(255, 92, 122, 0.1);
}
.mlc-event-tag.na {
    border-color: rgba(147, 164, 188, 0.35);
    color: rgba(210, 220, 235, 0.85);
    background: rgba(147, 164, 188, 0.1);
}
.mlc-event-detail {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
}
.mlc-unc-bar {
    margin-top: 8px;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    background: var(--surface-a);
    overflow: hidden;
}
.mlc-unc-bar > span {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(46, 204, 113, 0.9), rgba(255, 204, 102, 0.9), rgba(255, 92, 122, 0.9));
}
.mlc-bar-pre {
    margin: 8px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 62vh;
    overflow: auto;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 10px;
}

/* fullscreen: делаем canvas высокой и убираем лишние рамки */
.mlc-wrap:fullscreen {
    background: var(--bg);
    padding: 10px;
    border-radius: 0;
}
.mlc-wrap:fullscreen .mlc-canvas {
    height: calc(100vh - 24px);
    border-radius: 12px;
}
.mlc-wrap:fullscreen .mlc-tip {
    max-width: min(520px, 92vw);
}
.mlc-wrap:-webkit-full-screen {
    background: var(--bg);
    padding: 10px;
    border-radius: 0;
}
.mlc-wrap:-webkit-full-screen .mlc-canvas {
    height: calc(100vh - 24px);
    border-radius: 12px;
}
.mlc-wrap:-webkit-full-screen .mlc-tip {
    max-width: min(520px, 92vw);
}
.mlc-trade-head {
    align-items: center;
    margin-bottom: 6px;
}
.mlc-trade-card-wide {
    width: 100%;
}
.mlc-trade-controls {
    gap: 8px;
}
.mlc-trade-controls .sel {
    min-width: 140px;
}
.mlc-trade-table th,
.mlc-trade-table td {
    white-space: nowrap;
}
.mlc-trade-table td:last-child {
    max-width: 180px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.trade-modal-card {
    width: 760px;
    max-width: 96vw;
}
.trade-price-box {
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface-a);
    padding: 8px 10px;
}
.trade-price-main {
    font-size: 20px;
    font-weight: 800;
}
.trade-price-sub {
    margin-top: 4px;
    font-size: 11px;
}
.trade-pos-status {
    padding: 8px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface-a);
}
.trade-pos-status.long {
    border-color: rgba(46, 204, 113, 0.42);
    color: rgba(189, 243, 208, 0.98);
}
.trade-pos-status.short {
    border-color: rgba(255, 92, 122, 0.45);
    color: rgba(255, 186, 198, 0.98);
}
.trade-actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.trade-btn-long {
    border-color: rgba(46, 204, 113, 0.45);
    background: rgba(46, 204, 113, 0.16);
    color: rgba(189, 243, 208, 0.98);
}
.trade-btn-short {
    border-color: rgba(255, 92, 122, 0.5);
    background: rgba(255, 92, 122, 0.16);
    color: rgba(255, 186, 198, 0.98);
}
.trade-actions-row .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: saturate(0.75);
}
.trade-manual-check {
    margin-bottom: 6px;
}
body[data-theme="light"] .trade-pos-status.long {
    border-color: rgba(15, 122, 69, 0.42);
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .trade-pos-status.short {
    border-color: rgba(180, 37, 66, 0.4);
    color: rgba(139, 29, 51, 0.98);
}
body[data-theme="light"] .trade-btn-long {
    border-color: rgba(15, 122, 69, 0.35);
    background: rgba(15, 122, 69, 0.1);
    color: rgba(13, 96, 56, 0.98);
}
body[data-theme="light"] .trade-btn-short {
    border-color: rgba(180, 37, 66, 0.36);
    background: rgba(180, 37, 66, 0.1);
    color: rgba(139, 29, 51, 0.98);
}
@media (max-width: 780px) {
    .trade-modal-grid {
        grid-template-columns: 1fr;
    }
    .trade-actions-row .btn {
        flex: 1 1 100%;
    }
    .tmx-zoom-canvas {
        height: 56vh;
    }
}

/* ================= Architecture ================= */
.arch-block {
    margin-top: 12px;
    padding: 12px;
}
.arch-node-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
@media (max-width: 980px) {
    .arch-node-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 620px) {
    .arch-node-grid {
        grid-template-columns: 1fr;
    }
}
.arch-node-card {
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface-a);
    padding: 10px;
}
.arch-detail-clickable {
    cursor: pointer;
}
.arch-detail-clickable:focus-visible {
    outline: 2px solid rgba(98, 142, 255, 0.65);
    outline-offset: 1px;
}
.arch-node-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.arch-node-title {
    font-size: 12px;
    color: var(--text);
    font-weight: 700;
}
.arch-node-meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}
.arch-node-reason {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
    min-height: 52px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.arch-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    background: var(--surface-b);
    font-size: 11px;
    font-family: var(--mono);
    font-weight: 700;
    color: var(--muted);
}
.arch-pill.ok {
    border-color: rgba(46, 204, 113, 0.35);
    background: rgba(46, 204, 113, 0.1);
    color: rgba(189, 243, 208, 0.95);
}
.arch-pill.warn {
    border-color: rgba(255, 204, 102, 0.4);
    background: rgba(255, 204, 102, 0.1);
    color: rgba(255, 228, 178, 0.95);
}
.arch-pill.bad {
    border-color: rgba(255, 92, 122, 0.4);
    background: rgba(255, 92, 122, 0.1);
    color: rgba(255, 186, 198, 0.95);
}
.arch-pill.na {
    border-color: rgba(147, 164, 188, 0.35);
    background: rgba(147, 164, 188, 0.1);
    color: rgba(210, 220, 235, 0.85);
}

.arch-map-wrap {
    overflow: auto;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface-a);
    padding: 12px;
}
.arch-map-svg {
    width: 100%;
    min-width: 1680px;
    height: auto;
    display: block;
}
.arch-map-node rect {
    fill: rgba(255, 255, 255, 0.03);
    stroke: rgba(255, 255, 255, 0.18);
    stroke-width: 1.2;
}
.arch-map-node text {
    fill: var(--text);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--sans);
}
.arch-map-node text.arch-map-sub {
    fill: var(--muted);
    font-size: 12px;
    font-weight: 500;
}
.arch-map-node.ok rect {
    stroke: rgba(46, 204, 113, 0.6);
}
.arch-map-node.warn rect {
    stroke: rgba(255, 204, 102, 0.7);
}
.arch-map-node.bad rect {
    stroke: rgba(255, 92, 122, 0.75);
}
.arch-map-node.na rect {
    stroke: rgba(147, 164, 188, 0.45);
}
.arch-link {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}
.arch-link.ok {
    stroke: rgba(46, 204, 113, 0.9);
}
.arch-link.warn {
    stroke: rgba(255, 204, 102, 0.92);
}
.arch-link.bad {
    stroke: rgba(255, 92, 122, 0.95);
}
.arch-link.na {
    stroke: rgba(147, 164, 188, 0.8);
}
.arch-link-note {
    fill: var(--muted);
    font-size: 10px;
    font-family: var(--mono);
}
.arch-map-issues {
    margin-top: 10px;
    border-top: 1px solid var(--line-soft);
    padding-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}
@media (max-width: 980px) {
    .arch-map-issues {
        grid-template-columns: 1fr;
    }
}
.arch-map-issue {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 10px;
    border: 1px solid var(--line-soft);
    background: var(--surface-b);
    font-size: 12px;
}
.arch-map-issue-main {
    min-width: 0;
    flex: 1 1 auto;
}
.arch-map-issue-link {
    line-height: 1.25;
}
.arch-map-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex: 0 0 auto;
    margin-top: 5px;
}
.arch-map-dot.ok {
    background: rgba(46, 204, 113, 0.95);
}
.arch-map-dot.warn {
    background: rgba(255, 204, 102, 0.95);
}
.arch-map-dot.bad {
    background: rgba(255, 92, 122, 0.98);
}
.arch-map-dot.na {
    background: rgba(147, 164, 188, 0.9);
}
.arch-map-issue-reason {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
}
.arch-detail-meta {
    margin-bottom: 8px;
}
.arch-detail-pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 62vh;
    overflow: auto;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 10px;
}
.arch-step-status {
    font-family: var(--mono);
    font-size: 12px;
}
.arch-step-status.ok {
    color: rgba(189, 243, 208, 0.95);
}
.arch-step-status.warn {
    color: rgba(255, 228, 178, 0.95);
}
.arch-step-status.bad {
    color: rgba(255, 186, 198, 0.95);
}
.arch-step-status.na {
    color: var(--muted);
}
.arch-trace-clickable {
    cursor: pointer;
}
.arch-trace-clickable:hover {
    background: rgba(124, 92, 255, 0.08);
}

body[data-theme="light"] .arch-pill.ok {
    border-color: rgba(15, 122, 69, 0.4);
    color: rgba(13, 96, 56, 0.98);
    background: rgba(15, 122, 69, 0.1);
}
body[data-theme="light"] .arch-pill.warn {
    border-color: rgba(151, 97, 22, 0.45);
    color: rgba(120, 76, 15, 0.98);
    background: rgba(151, 97, 22, 0.1);
}
body[data-theme="light"] .arch-pill.bad {
    border-color: rgba(180, 37, 66, 0.45);
    color: rgba(139, 29, 51, 0.98);
    background: rgba(180, 37, 66, 0.1);
}
body[data-theme="light"] .arch-pill.na {
    border-color: rgba(95, 111, 135, 0.35);
    color: rgba(67, 82, 104, 0.95);
    background: rgba(95, 111, 135, 0.09);
}
body[data-theme="light"] .arch-detail-pre {
    background: rgba(79, 106, 155, 0.08);
    border-color: rgba(79, 106, 155, 0.18);
}
body[data-theme="light"] .mlc-event-tag.ok {
    border-color: rgba(15, 122, 69, 0.4);
    color: rgba(13, 96, 56, 0.98);
    background: rgba(15, 122, 69, 0.1);
}
body[data-theme="light"] .mlc-event-tag.warn {
    border-color: rgba(151, 97, 22, 0.45);
    color: rgba(120, 76, 15, 0.98);
    background: rgba(151, 97, 22, 0.1);
}
body[data-theme="light"] .mlc-event-tag.bad {
    border-color: rgba(180, 37, 66, 0.45);
    color: rgba(139, 29, 51, 0.98);
    background: rgba(180, 37, 66, 0.1);
}
body[data-theme="light"] .mlc-event-tag.na {
    border-color: rgba(95, 111, 135, 0.35);
    color: rgba(67, 82, 104, 0.95);
    background: rgba(95, 111, 135, 0.09);
}
body[data-theme="light"] .mlc-bar-pre {
    background: rgba(79, 106, 155, 0.08);
    border-color: rgba(79, 106, 155, 0.18);
}

.trade-terminal-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.trade-terminal-settings-card {
    padding: 14px;
}

.trade-terminal-settings-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trade-terminal-settings-kv {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.trade-terminal-settings-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.trade-terminal-settings-overview-card {
    display: grid;
    gap: 6px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--line-soft);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
        var(--surface-a);
    min-width: 0;
}

.trade-terminal-settings-overview-label {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.trade-terminal-settings-overview-value {
    font-size: 18px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.trade-terminal-settings-overview-meta {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.trade-terminal-settings-routing-list {
    display: grid;
    gap: 10px;
}

.trade-terminal-settings-routing-row {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.03);
}

.trade-terminal-settings-routing-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.trade-terminal-settings-routing-key {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text);
}

.trade-terminal-settings-routing-target {
    font-size: 12px;
    font-family: var(--mono);
    color: rgba(191, 219, 254, 0.95);
}

.trade-terminal-settings-routing-meta {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.trade-terminal-settings-kv > div,
.trade-terminal-settings-form-grid > label,
.trade-terminal-settings-form-grid > .check {
    display: grid;
    gap: 6px;
}

.trade-terminal-settings-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.trade-terminal-settings-note {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 980px) {
    .trade-terminal-settings-grid,
    .trade-terminal-settings-overview,
    .trade-terminal-settings-kv,
    .trade-terminal-settings-form-grid {
        grid-template-columns: 1fr;
    }
}
