:root {
    --bg: #050608;
    --bg-soft: #0a0d12;
    --bg-elevated: #10141b;
    --panel: rgba(10, 13, 19, 0.88);
    --panel-strong: rgba(14, 18, 26, 0.96);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-border-strong: rgba(255, 255, 255, 0.14);
    --text: #c8d6dc;
    --muted: #8fa0a8;
    --muted-strong: #b1c2c8;
    --accent: #f0a35c;
    --accent-soft: rgba(240, 163, 92, 0.18);
    --positive: #68de99;
    --negative: #fd6058;
    --neutral: #b2b7c4;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
    --radius: 28px;
    --sans:
        -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --display: var(--sans);
    --ui: var(--sans);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: #000305;
}

body {
    position: relative;
    color: var(--text);
    font-family: var(--sans);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::after {
    background:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.018) 0,
            rgba(255, 255, 255, 0.018) 1px,
            transparent 1px,
            transparent 72px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.012) 0,
            rgba(255, 255, 255, 0.012) 1px,
            transparent 1px,
            transparent 72px
        );
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 86%);
}

button,
select {
    font: inherit;
}

button {
    color: inherit;
}

::selection {
    background: rgba(240, 163, 92, 0.26);
    color: var(--text);
}

.page-shell {
    position: relative;
    width: min(1440px, calc(100% - 80px));
    margin: 0 auto;
    padding: 40px 0 120px;
}

.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: end;
    margin-bottom: 28px;
    padding: 40px 0 32px;
}

.hero-copy h1,
.temperature-insight h2,
.score-number {
    font-family: var(--display);
}

.metric-value,
.ticker-code,
.panel-label,
.eyebrow,
.sort-status,
.signal-pill {
    font-family: var(--ui);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 9.5em;
    margin: 0;
    font-size: clamp(40px, 5vw, 56px);
    line-height: 0.92;
    letter-spacing: 0em;
    text-wrap: balance;
    font-weight: 400;
}

.hero-text {
    max-width: 680px;
    margin: 18px 0 0;
    color: var(--muted-strong);
    font-size: 16px;
    line-height: 1.85;
}

.status-text {
    width: fit-content;
    max-width: 100%;
    margin: 18px 0 0;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted-strong);
    font-size: 13px;
    line-height: 1.5;
}

.status-text[data-tone="positive"] {
    border-color: rgba(104, 222, 153, 0.28);
    color: var(--positive);
}

.status-text[data-tone="negative"] {
    border-color: rgba(253, 96, 88, 0.28);
    color: var(--negative);
}

.status-text[data-tone="neutral"] {
    border-color: rgba(240, 163, 92, 0.24);
    color: var(--accent);
}

.dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

.grid {
    display: grid;
    gap: 24px;
}

.dashboard > *,
.grid > *,
.asset-matrix-section {
    min-width: 0;
}

.top-grid {
    grid-template-columns: 1fr;
}

.metrics-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.panel {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    padding: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 16%),
        linear-gradient(180deg, rgba(12, 15, 21, 0.96), rgba(7, 9, 13, 0.96));
    box-shadow: var(--shadow);
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.03);
    pointer-events: none;
}

.panel::after {
    content: "";
    position: absolute;
    top: 0;
    left: 22px;
    right: 22px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    pointer-events: none;
}

.temperature-panel {
}

.panel-header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

.panel-header-tight {
    align-items: flex-end;
}

.asset-matrix-section {
    position: relative;
    margin-top: 40px;
}

.panel-label {
    color: var(--muted-strong);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.panel-meta,
.panel-caption {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.panel-caption {
    margin: 8px 0 0;
}

.panel-subsection {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-subsection-header {
    margin-bottom: 14px;
}

.breadth-subsection {
    margin-top: 24px;
}

.market-clock-line {
    position: relative;
    z-index: 1;
    margin: 0;
    min-width: 0;
    color: var(--muted-strong);
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: 0em;
    overflow-wrap: anywhere;
}

.market-clock-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}


.market-clock-prefix,
.market-clock-separator,
.market-clock-label {
    color: var(--muted);
}

.market-clock-status {
    font-weight: 400;
}

.market-clock-status.is-positive {
    color: var(--positive);
}

.market-clock-status.is-negative {
    color: var(--negative);
}

.market-clock-status.is-neutral {
    color: var(--accent);
}

.market-clock-value {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.temperature-core {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    align-items: center;
}

.temperature-details {
    display: grid;
    min-width: 0;
}

.temperature-ring {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 0;
    border: none;
    background: transparent;
}

.ring-chart {
    width: 200px;
    height: 200px;
    transform: rotate(-90deg);
}

.ring-track,
.ring-progress {
    fill: none;
    stroke-width: 10;
}

.ring-track {
    stroke: rgba(255, 255, 255, 0.04);
}

.ring-progress {
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-dasharray: 289.03;
    stroke-dashoffset: 289.03;
    filter: none;
    transition:
        stroke-dashoffset 400ms ease,
        stroke 400ms ease;
}

.ring-center {
    position: absolute;
    display: grid;
    gap: 5px;
    text-align: center;
}

.score-number {
    font-size: 40px;
    font-weight: 400;
    line-height: 0.92;
    letter-spacing: 0em;
}

.score-level {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 26px;
    padding: 3px 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.exposure-summary {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.1em;
    line-height: 1.8;
    text-transform: uppercase;
}

.temperature-insight h2 {
    max-width: 16ch;
    margin: 0 0 16px;
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1;
    letter-spacing: 0em;
    text-wrap: nowrap;
    font-weight: 400;
}

.drivers-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
}

.drivers-list li {
    position: relative;
    padding-left: 18px;
    color: var(--muted-strong);
    font-size: 14px;
    font-weight: 300;
    line-height: 1.8;
}

.drivers-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(240, 163, 92, 0.09);
}

.action-hint {
    padding: 10px 14px;
    border: 1px solid rgba(240, 163, 92, 0.16);
    background: linear-gradient(
        180deg,
        rgba(240, 163, 92, 0.08),
        rgba(240, 163, 92, 0.03)
    );
    color: var(--accent);
    font-size: 14px;
    line-height: 1.5;
}

.metrics-grid,
.momentum-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.metric-card,
.momentum-card {
    position: relative;
    z-index: 1;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 54%),
        rgba(255, 255, 255, 0.02);
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background-color 180ms ease;
}

.metric-card:hover,
.momentum-card:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.12);
}

.metric-label,
.breadth-label,
.momentum-label {
    color: var(--muted);
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.metric-value,
.breadth-value,
.momentum-value {
    margin-top: 10px;
    font-size: 22px;
    font-weight: 400;
    line-height: 0.95;
    letter-spacing: 0em;
}

.metric-foot,
.breadth-foot,
.momentum-foot {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.breadth-bars {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.breadth-bar {
    display: grid;
    gap: 9px;
}

.breadth-bar-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    color: var(--muted-strong);
    font-size: 13px;
}

.breadth-bar-top strong {
    font-family: var(--ui);
    font-size: 14px;
    font-weight: 400;
}

.bar-track {
    height: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.035);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(240, 163, 92, 0.65),
        rgba(240, 163, 92, 0.9)
    );
    box-shadow: 0 0 24px rgba(240, 163, 92, 0.18);
}

@media (min-width: 1181px) {
    .temperature-core {
        grid-template-columns: 280px minmax(0, 1fr);
        gap: 28px;
        align-items: start;
    }

    .temperature-details {
        grid-template-columns: minmax(0, 1fr) 380px;
        gap: 26px;
        align-items: start;
    }

    .temperature-insight {
        min-width: 0;
    }

    .temperature-insight h2 {
        max-width: none;
    }

    .breadth-subsection {
        margin-top: 0;
        padding-top: 0;
        padding-left: 28px;
        padding-right: 12px;
        border-top: none;
        border-left: 1px solid rgba(255, 255, 255, 0.08);
    }

    .panel-subsection-header {
        margin-bottom: 32px;
    }

    .breadth-bars {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .breadth-bar {
        gap: 8px;
    }

    .breadth-bar-top {
        gap: 10px;
        font-size: 12px;
    }

    .breadth-bar-top strong {
        font-size: 13px;
    }
}

.momentum-summary {
    position: relative;
    z-index: 1;
    margin: 18px 0 0;
    color: var(--muted-strong);
    font-size: 14px;
    line-height: 1.8;
}

.momentum-summary:empty {
    display: none;
}

.signal-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 10px;
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: -4px 0 18px;
}

.category-tab {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--muted);
    cursor: pointer;
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition:
        background-color 160ms ease,
        color 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.category-tab:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--text);
}

.category-tab.is-active {
    border-color: rgba(240, 163, 92, 0.42);
    background: linear-gradient(
        180deg,
        rgba(240, 163, 92, 0.12),
        rgba(240, 163, 92, 0.04)
    );
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sort-status {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.table-wrap {
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.015);
}

.asset-matrix-section .panel-header {
    margin-bottom: 18px;
}

.asset-matrix-section .panel-label {
    font-size: 20px;
}

.asset-matrix-section .sort-status {
    font-size: 13px;
}

.asset-matrix-section .category-tab {
    font-size: 13px;
    padding: 11px 16px;
}

.asset-matrix-section .data-table th {
    font-size: 13px;
}

.asset-matrix-section .data-table td {
    font-size: 14px;
}

.asset-matrix-section .ticker-code {
    font-size: 18px;
}

.asset-matrix-section .ticker-name small,
.asset-matrix-section .distance-value,
.asset-matrix-section .mini-badge,
.asset-matrix-section .sparkline-empty {
    font-size: 13px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(9, 11, 16, 0.94);
    backdrop-filter: blur(14px);
}

.data-table th {
    color: var(--muted);
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sort-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}

.sort-button.is-active {
    color: var(--text);
}

.sort-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 10px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 400;
}

.data-table tbody tr {
    transition:
        background-color 160ms ease,
        transform 160ms ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.ticker-code {
    color: var(--text);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.1em;
}

.ticker-name {
    display: grid;
    gap: 3px;
}

.ticker-name span {
    color: var(--text);
}

.ticker-name small {
    color: var(--muted);
    font-size: 12px;
}

.sparkline-cell {
    display: inline-flex;
    align-items: center;
    width: fit-content;
}

.row-sparkline {
    display: block;
    width: 112px;
    height: 38px;
}

.row-sparkline-line {
    fill: none;
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.row-sparkline-line.positive {
    stroke: var(--positive);
}

.row-sparkline-line.negative {
    stroke: var(--negative);
}

.row-sparkline-line.neutral {
    stroke: #d1d5e1;
    opacity: 0.7;
}

.sparkline-empty {
    color: var(--muted);
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.1em;
}

.distance-cell {
    display: grid;
    gap: 8px;
}

.distance-bar {
    width: 92px;
    height: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.distance-fill {
    height: 100%;
}

.distance-value {
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.1em;
}

.distance-positive {
    color: var(--positive);
}

.distance-warning {
    color: var(--accent);
}

.distance-negative {
    color: var(--negative);
}

.distance-fill.distance-positive {
    background: linear-gradient(
        90deg,
        rgba(143, 215, 173, 0.6),
        rgba(182, 240, 207, 0.95)
    );
}

.distance-fill.distance-warning {
    background: linear-gradient(
        90deg,
        rgba(240, 163, 92, 0.62),
        rgba(255, 208, 159, 0.94)
    );
}

.distance-fill.distance-negative {
    background: linear-gradient(
        90deg,
        rgba(255, 140, 134, 0.62),
        rgba(255, 176, 172, 0.94)
    );
}

.trend-badges {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
}

.trend-popover {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.trend-more-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted-strong);
    font: inherit;
    font-size: 12px;
    line-height: 1;
    cursor: default;
}

.trend-more-dots {
    display: inline-grid;
    gap: 2px;
    justify-items: center;
}

.trend-more-dots span {
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: currentColor;
}

.trend-popover-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 3;
    display: none;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(9, 11, 16, 0.96);
    white-space: nowrap;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.trend-popover:hover .trend-popover-panel,
.trend-popover:focus-within .trend-popover-panel {
    display: inline-flex;
}

.mini-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.1em;
}

.positive {
    color: var(--positive);
}

.negative {
    color: var(--negative);
}

.neutral {
    color: var(--neutral);
}

.bg-positive {
    background: rgba(143, 215, 173, 0.08);
    color: var(--positive);
}

.bg-negative {
    background: rgba(255, 140, 134, 0.08);
    color: var(--negative);
}

.bg-neutral {
    background: rgba(255, 255, 255, 0.045);
    color: var(--neutral);
}

@media (max-width: 1180px) {
    .hero,
    .top-grid,
    .metrics-row,
    .temperature-core,
    .panel-header {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .temperature-core {
        gap: 18px;
        align-items: start;
    }

    .temperature-details {
        gap: 0;
    }

    .temperature-ring {
        justify-self: center;
    }

    .temperature-insight h2 {
        max-width: none;
        font-size: clamp(28px, 4vw, 36px);
        text-wrap: balance;
    }

    .metrics-grid,
    .momentum-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .breadth-bars {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .asset-matrix-section .panel-header {
        align-items: flex-start;
    }

    .sort-status {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 80px, 1440px);
        padding-top: 18px;
        padding-bottom: 40px;
    }

    .hero {
        gap: 20px;
        padding-top: 12px;
    }

    .hero h1 {
        font-size: clamp(34px, 12vw, 52px);
        max-width: none;
    }

    .hero-text {
        font-size: 15px;
        max-width: none;
        line-height: 1.75;
    }

    .panel {
        padding: 18px;
        border-radius: 0;
        max-width: 100%;
        min-width: 0;
    }

    .panel-header {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px;
        max-width: 100%;
    }

    .metrics-grid,
    .momentum-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .breadth-bars {
        grid-template-columns: 1fr;
    }

    .temperature-core {
        grid-template-columns: 1fr;
        gap: 16px;
        align-items: start;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .temperature-ring {
        min-height: 0;
        justify-self: center;
    }

    .ring-chart {
        width: 172px;
        height: 172px;
    }

    .score-number {
        font-size: 40px;
    }

    .temperature-insight h2 {
        max-width: none;
        font-size: 28px;
        text-wrap: balance;
    }

    .temperature-insight,
    .temperature-details,
    .panel-subsection,
    .breadth-subsection,
    .breadth-bars,
    .breadth-bar,
    .bar-track,
    .action-hint {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .drivers-list li,
    .action-hint,
    .momentum-summary {
        font-size: 13px;
        overflow-wrap: anywhere;
    }

    .market-clock-line {
        font-size: 13px;
    }

    .trend-badges {
        flex-wrap: nowrap;
        width: max-content;
    }

    .data-table th,
    .data-table td {
        padding: 14px 12px;
    }
}

@media (max-width: 520px) {
    .page-shell {
        width: min(100% - 40px, 1440px);
    }

    .metrics-row {
        grid-template-columns: 1fr;
    }

    .metrics-grid,
    .momentum-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .asset-matrix-section {
        margin-top: 28px;
    }
}
