:root {
    --bg-main: #05101f;
    --bg-grad-a: #0b2243;
    --bg-grad-b: #07172d;
    --panel: linear-gradient(180deg, rgba(10, 30, 61, 0.96) 0%, rgba(7, 23, 45, 0.96) 100%);
    --panel-soft: rgba(255, 255, 255, 0.04);
    --border: rgba(124, 156, 209, 0.16);
    --text-main: #f5f8ff;
    --text-soft: #9cb2d6;
    --cyan: #69d9ff;
    --cyan-2: #2fd6c4;
    --green: #2ee6b8;
    --orange: #ff7b5a;
    --breadth-gainer: #3aad4d;
    --breadth-loser: #d91d85;
    --breadth-unchanged: #32b6ed;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top right, rgba(55, 120, 255, 0.18), transparent 26%),
        linear-gradient(90deg, var(--bg-main) 0%, var(--bg-grad-a) 48%, var(--bg-grad-b) 100%);
}

a { color: inherit; text-decoration: none; }

.app-shell {
    display: grid;
    grid-template-columns: 210px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: rgba(2, 10, 24, 0.92);
    border-right: 1px solid var(--border);
    padding: 24px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.brand-sub {
    margin-top: 10px;
    color: var(--text-soft);
    line-height: 1.55;
    font-size: 0.98rem;
}

.nav-links {
    display: grid;
    gap: 12px;
    margin-top: 28px;
}

.nav-links a {
    background: linear-gradient(135deg, #5bd4ff, #6ea7ff);
    color: #081423;
    padding: 14px 16px;
    border-radius: 18px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(59, 130, 246, 0.18);
}

.main-content {
    padding: 16px 20px 28px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    margin-bottom: 22px;
}

.page-header h1 {
    margin: 0 0 10px;
    font-size: 3.1rem;
    line-height: 1.06;
}

.page-header p,
.muted {
    margin: 0;
    color: var(--text-soft);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.status-pill.warn { color: #ffe1a8; }
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}
.status-dot.ready { background: var(--green); box-shadow: 0 0 12px rgba(46, 230, 184, 0.75); }
.status-dot.warn { background: #fbbf24; box-shadow: 0 0 12px rgba(251, 191, 36, 0.75); }

.panel,
.metric-card,
.empty-state {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.panel { padding: 24px; }

.search-wrap {
    margin-bottom: 20px;
}

.search-form {
    max-width: 760px;
}

.search-label {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.search-row {
    display: flex;
    gap: 12px;
}

.search-row input {
    flex: 1;
    height: 52px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.05);
    color: #fff;
    padding: 0 16px;
    font-size: 1rem;
}

.search-row input::placeholder {
    color: rgba(255,255,255,0.4);
}

.search-row button {
    height: 52px;
    padding: 0 22px;
    border-radius: 18px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #3b82f6, #08c4d8);
    color: #fff;
    font-weight: 700;
}

.top-grid {
    display: grid;
    grid-template-columns: 1.65fr 0.9fr;
    gap: 20px;
    margin-bottom: 20px;
}

.hero-panel {
    background: linear-gradient(145deg, rgba(83, 145, 255, 0.14), rgba(7, 23, 45, 0.95));
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 12px;
}

.hero-panel h2 {
    margin: 0;
    font-size: 3.6rem;
    line-height: 1;
}

.hero-copy,
.signal-copy {
    margin-top: 18px;
    color: #edf3ff;
    font-size: 1.08rem;
    line-height: 1.75;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
}

.chip-blue {
    color: #dff2ff;
    background: rgba(83, 145, 255, 0.15);
    border: 1px solid rgba(83, 145, 255, 0.26);
}

.chip-green {
    color: #d7fff1;
    background: rgba(46, 230, 184, 0.14);
    border: 1px solid rgba(46, 230, 184, 0.26);
}

.metric-row {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.metric-row.four-up {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
    padding: 16px 18px;
    background: rgba(255,255,255,0.03);
}

.metric-card span {
    display: block;
    color: var(--text-soft);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.metric-card strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
}

.metric-card.emphasis strong {
    color: #fff0c2;
}

.signal-panel {
    display: flex;
    flex-direction: column;
}

.signal-label {
    color: var(--text-soft);
    font-size: 1rem;
}

.signal-value {
    font-size: 2.35rem;
    font-weight: 800;
    margin-top: 6px;
}

.probability-card {
    margin-top: 24px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
}

.probability-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    color: #d4e3fb;
    font-size: 0.95rem;
}

.probability-head strong {
    color: #fff;
    font-size: 1.12rem;
}

.probability-bar {
    width: 100%;
    height: 14px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
}

.probability-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2fd6c4 0%, #6ed6ff 100%);
}

.two-col-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.reading-panel h3,
.chart-panel h3,
.empty-state h2 {
    margin-top: 0;
    font-size: 1.15rem;
}

.reading-list {
    display: grid;
    gap: 12px;
    margin-top: 10px;
}

.reading-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.reading-item span { color: var(--text-soft); }

.insight-box {
    margin-top: 18px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(83, 145, 255, 0.11);
    border: 1px solid rgba(83, 145, 255, 0.24);
}

.insight-box h4 {
    margin: 0 0 10px;
}

.insight-box p {
    margin: 0;
    line-height: 1.75;
}

.subtle-box {
    background: rgba(46, 230, 184, 0.08);
    border-color: rgba(46, 230, 184, 0.18);
}

.smart-list {
    margin: 0;
    padding-left: 20px;
    line-height: 1.8;
    color: #dbe8ff;
}

.model-summary-line {
    margin-bottom: 12px;
    font-size: 1.05rem;
}

.model-summary-line.muted {
    color: var(--text-soft);
}

.trend-panel,
.chart-panel {
    margin-bottom: 20px;
    overflow: hidden;
}

.path-box {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    border: 1px dashed var(--border);
    word-break: break-all;
}

.empty-state {
    padding: 28px;
    text-align: center;
}

.empty-block {
    color: var(--text-soft);
    padding: 30px;
    text-align: center;
}

.js-plotly-plot .plotly .modebar { display: none !important; }

@media (max-width: 1200px) {
    .top-grid,
    .two-col-block {
        grid-template-columns: 1fr;
    }

    .metric-row.four-up {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .page-header {
        flex-direction: column;
        align-items: start;
    }

    .page-header h1 {
        font-size: 2.4rem;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 14px;
    }

    .search-row {
        flex-direction: column;
    }

    .metric-row.four-up {
        grid-template-columns: 1fr;
    }

    .hero-panel h2 {
        font-size: 2.5rem;
    }
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.section-head-chips {
    justify-content: flex-end;
    margin-top: 0;
}

.movers-panel {
    background: linear-gradient(145deg, rgba(63, 133, 255, 0.18), rgba(7, 23, 45, 0.96));
}

.sub-panel {
    padding: 18px;
    border-radius: 24px;
    background: rgba(255,255,255,0.03);
}

.table-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.table-title-row h4 {
    margin: 0;
}

.market-table-wrap {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
}

.market-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.market-table th,
.market-table td {
    padding: 13px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(124, 156, 209, 0.12);
    font-size: 0.95rem;
}

.market-table th {
    color: var(--text-soft);
    font-size: 0.83rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.04);
    position: sticky;
    top: 0;
}

.market-table tbody tr:hover {
    background: rgba(105, 217, 255, 0.05);
}

.trend-badge {
    display: inline-flex;
    min-width: 80px;
    justify-content: center;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
}

.trend-badge.positive {
    color: #d7fff1;
    background: rgba(46, 230, 184, 0.14);
    border: 1px solid rgba(46, 230, 184, 0.26);
}

.trend-badge.negative {
    color: #ffe0d7;
    background: rgba(255, 123, 90, 0.14);
    border: 1px solid rgba(255, 123, 90, 0.26);
}

@media (max-width: 960px) {
    .section-head {
        flex-direction: column;
    }

    .section-head-chips {
        justify-content: flex-start;
    }
}


.breadth-panel {
    background: linear-gradient(145deg, rgba(63, 133, 255, 0.16), rgba(7, 23, 45, 0.96));
}

.breadth-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 24px;
    align-items: stretch;
    margin-top: 18px;
}

.breadth-visual-card {
    padding: 24px 18px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.breadth-donut {
    width: 290px;
    height: 290px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.25);
}

.breadth-donut-inner {
    width: 156px;
    height: 156px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(7, 23, 45, 0.98) 0%, rgba(8, 20, 42, 0.98) 100%);
    border: 1px solid rgba(124, 156, 209, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.24);
}

.breadth-donut-inner strong {
    font-size: 2rem;
    line-height: 1.05;
}

.breadth-donut-inner span {
    margin-top: 6px;
    color: var(--text-soft);
    font-size: 1rem;
}

.breadth-legend {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    color: #d4e3fb;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 8px;
}

.legend-dot.gainer,
.legend-dot.positive {
    background: var(--breadth-gainer);
}

.legend-dot.loser,
.legend-dot.negative {
    background: var(--breadth-loser);
}

.legend-dot.unchanged,
.legend-dot.neutral {
    background: var(--breadth-unchanged);
}

.bucket-label {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
}

.breadth-data {
    min-width: 0;
}

.breadth-metrics .metric-card strong {
    font-size: 1.55rem;
}

.trend-badge.neutral {
    color: #dff5ff;
    background: rgba(50, 182, 237, 0.14);
    border: 1px solid rgba(50, 182, 237, 0.26);
}

@media (max-width: 1200px) {
    .breadth-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .breadth-donut {
        width: 240px;
        height: 240px;
    }

    .breadth-donut-inner {
        width: 132px;
        height: 132px;
    }

    .breadth-donut-inner strong {
        font-size: 1.7rem;
    }
}



html, body {
    overflow-x: hidden;
}

.main-content {
    min-width: 0;
}

.sidebar-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    width: 46px;
    height: 46px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.05);
    border-radius: 14px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.nav-toggle span {
    width: 18px;
    height: 2px;
    background: #dce9ff;
    border-radius: 999px;
    display: block;
}

.nav-links a {
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.nav-links a:hover {
    transform: translateY(-1px);
}

.metric-card strong,
.status-pill,
.chip,
.path-box,
.market-table td,
.market-table th {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.market-table-wrap {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.market-table-wrap::-webkit-scrollbar {
    height: 8px;
}

.market-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(156, 178, 214, 0.35);
    border-radius: 999px;
}

.breadth-visual-card,
.sub-panel {
    min-width: 0;
}

@media (max-width: 1200px) {
    .page-header h1 {
        font-size: 2.7rem;
    }

    .breadth-donut {
        width: 260px;
        height: 260px;
    }
}

@media (max-width: 960px) {
    .sidebar {
        padding: 16px;
        height: auto;
        z-index: 20;
        background: rgba(2, 10, 24, 0.98);
        backdrop-filter: blur(10px);
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 18px;
    }

    body.nav-open .nav-links {
        display: grid;
    }

    .nav-links a {
        text-align: center;
        padding: 12px 14px;
        border-radius: 14px;
        font-size: 0.92rem;
    }

    .main-content {
        padding: 16px;
    }

    .panel {
        padding: 18px;
        border-radius: 22px;
    }

    .page-header {
        margin-bottom: 18px;
    }

    .page-header h1 {
        font-size: 2rem;
        line-height: 1.12;
    }

    .status-pill {
        width: 100%;
        justify-content: flex-start;
    }

    .chip-row {
        gap: 10px;
    }

    .chip {
        max-width: 100%;
        text-align: center;
    }

    .metric-row {
        gap: 12px;
    }

    .market-table {
        min-width: 560px;
    }

    .breadth-layout {
        gap: 18px;
    }

    .breadth-visual-card {
        padding: 20px 14px;
    }

    .breadth-donut {
        width: min(250px, 100%);
        height: min(250px, 100vw - 96px);
    }

    .breadth-donut-inner {
        width: 132px;
        height: 132px;
    }

    .breadth-donut-inner strong {
        font-size: 1.6rem;
    }
}

@media (max-width: 640px) {
    .sidebar {
        padding: 14px;
    }

    .brand {
        font-size: 1.6rem;
    }

    .brand-sub {
        margin-top: 6px;
        font-size: 0.88rem;
        line-height: 1.45;
        max-width: 220px;
    }

    .nav-links {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 12px;
    }

    .panel,
    .metric-card,
    .empty-state {
        border-radius: 18px;
    }

    .panel {
        padding: 16px;
    }

    .page-header h1 {
        font-size: 1.72rem;
        margin-bottom: 8px;
    }

    .page-header p,
    .muted,
    .metric-card span {
        font-size: 0.9rem;
    }

    .section-head,
    .table-title-row {
        gap: 10px;
    }

    .section-head h3,
    .table-title-row h4,
    .panel h3 {
        line-height: 1.25;
    }

    .chip {
        width: 100%;
        justify-content: center;
        padding: 9px 12px;
        font-size: 0.85rem;
    }

    .metric-card {
        padding: 14px;
    }

    .metric-card strong {
        font-size: 1.12rem;
    }

    .breadth-metrics .metric-card strong {
        font-size: 1.2rem;
    }

    .breadth-visual-card {
        padding: 18px 10px;
    }

    .breadth-donut {
        width: 210px;
        height: 210px;
    }

    .breadth-donut-inner {
        width: 116px;
        height: 116px;
        padding: 10px;
    }

    .breadth-donut-inner strong {
        font-size: 1.35rem;
    }

    .breadth-donut-inner span {
        font-size: 0.86rem;
    }

    .breadth-legend {
        gap: 12px;
        font-size: 0.88rem;
    }

    .market-table {
        min-width: 520px;
    }

    .market-table th,
    .market-table td {
        padding: 11px 10px;
        font-size: 0.86rem;
    }

    .trend-badge {
        min-width: 68px;
        padding: 5px 8px;
        font-size: 0.82rem;
    }

    .probability-head {
        align-items: flex-start;
        gap: 10px;
        flex-direction: column;
    }

    .reading-item {
        flex-direction: column;
        gap: 8px;
    }

    .path-box {
        font-size: 0.88rem;
    }
}

@media (max-width: 400px) {
    .brand-sub {
        max-width: 180px;
    }

    .page-header h1 {
        font-size: 1.55rem;
    }

    .breadth-donut {
        width: 190px;
        height: 190px;
    }

    .breadth-donut-inner {
        width: 106px;
        height: 106px;
    }

    .breadth-legend {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .market-table {
        min-width: 480px;
    }
}

