:root {
    color-scheme: light;
    --bg: #f3f5f7;
    --surface: #fff;
    --surface-subtle: #f8fafb;
    --line: #dce2e7;
    --line-strong: #ccd5dc;
    --text: #102843;
    --muted: #657384;
    --navy: #102843;
    --navy-soft: #e9eff5;
    --gold: #e4a53a;
    --ok: #1f8a5b;
    --warn: #a8630d;
    --bad: #b42318;
    --shadow: 0 8px 24px rgba(16, 40, 67, 0.06);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, select { font: inherit; }
a { color: inherit; }

.samurai-app {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 22px 14px 18px;
    border-right: 1px solid var(--line);
    background: var(--surface);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 8px 22px;
}

.sidebar-brand > span:last-child { display: grid; gap: 2px; }
.sidebar-brand strong { font-size: 16px; letter-spacing: -0.01em; }
.sidebar-brand small { color: var(--muted); font-size: 11px; }

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: var(--navy);
    box-shadow: inset 0 -2px 0 rgba(228, 165, 58, 0.75);
    font-family: Georgia, serif;
    font-size: 13px;
    font-weight: 700;
}

.sidebar-nav { display: grid; gap: 3px; overflow-y: auto; }

.nav-label {
    margin: 18px 10px 6px;
    color: #8b96a2;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.nav-label:first-child { margin-top: 0; }

.nav-item {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 7px;
    color: #3d4b59;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.nav-item.active {
    color: var(--navy);
    background: var(--navy-soft);
    box-shadow: inset 3px 0 0 var(--gold);
}

.nav-item.planned { color: #6e7b88; cursor: default; }
.nav-icon { color: #65778a; font-size: 16px; line-height: 1; }
.nav-item.active .nav-icon { color: var(--navy); }

.nav-item small {
    padding: 2px 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #8b96a2;
    background: var(--surface-subtle);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sidebar-footer {
    display: grid;
    gap: 7px;
    margin-top: auto;
    padding: 18px 10px 0;
    border-top: 1px solid var(--line);
}

.sidebar-footer a { color: var(--navy); font-size: 12px; font-weight: 700; text-decoration: none; }
.sidebar-footer span { color: var(--muted); font-size: 10px; }

.workspace {
    width: 100%;
    max-width: 1540px;
    margin: 0 auto;
    padding: 28px 32px 48px;
}

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

.eyebrow {
    margin: 0 0 7px;
    color: var(--warn);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
    margin-bottom: 6px;
    font-size: clamp(27px, 3vw, 38px);
    line-height: 1.1;
    letter-spacing: -.035em;
}

.workspace-header p:last-child,
.panel-heading p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.status-pill {
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    background: var(--surface);
    font-size: 11px;
    font-weight: 700;
}

.status-pill.ok { color: var(--ok); border-color: #bce0ce; background: #f1faf6; }
.status-pill.warn { color: var(--warn); border-color: #ead5b6; background: #fff9ee; }
.status-pill.bad { color: var(--bad); border-color: #edc4c0; background: #fff4f3; }

.panel, .metric {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel { padding: 20px; }

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 17px;
}

.panel-heading h2 { margin-bottom: 3px; font-size: 16px; letter-spacing: -.015em; }

.controls-band {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
    align-items: end;
    gap: 12px;
}

.controls-band label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

select, button { min-height: 40px; border-radius: 7px; }

select {
    width: 100%;
    padding: 0 34px 0 11px;
    border: 1px solid var(--line-strong);
    color: var(--text);
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
}

button {
    padding: 0 17px;
    border: 1px solid var(--navy);
    color: #fff;
    background: var(--navy);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

button:hover { background: #1a3b5e; }
button:disabled { cursor: wait; opacity: .7; }

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

.metric { min-width: 0; padding: 17px 18px; }

.metric span,
.status-band span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.metric strong {
    display: block;
    overflow: hidden;
    font-size: clamp(17px, 2vw, 23px);
    line-height: 1.15;
    letter-spacing: -.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.metric small.positive { color: var(--ok); }
.metric small.negative { color: var(--bad); }

.chart-panel { padding-bottom: 12px; }

.chart {
    width: 100%;
    height: 500px;
    overflow: hidden;
    border: 1px solid #e7ebee;
    border-radius: 7px;
}

.message {
    display: grid;
    min-height: 50px;
    margin-top: 10px;
    place-items: center;
    padding: 14px;
    border: 1px dashed var(--line);
    border-radius: 7px;
    color: var(--muted);
    background: var(--surface-subtle);
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.message[hidden] { display: none; }
.health-panel { margin-top: 12px; }

.market-pulse {
    position: relative;
    overflow: hidden;
    border-left: 3px solid var(--gold);
}

.pulse-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.pulse-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.pulse-copy h2 { margin-bottom: 5px; font-size: 22px; }
.pulse-copy p { margin-bottom: 0; color: var(--muted); font-size: 12px; }

.pulse-badge {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--muted);
    background: var(--surface-subtle);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.pulse-badge.constructive { color: var(--ok); background: #eef9f3; }
.pulse-badge.defensive, .pulse-badge.stressed { color: var(--bad); background: #fff0ef; }
.pulse-badge.mixed { color: var(--warn); background: #fff7e8; }
.overview-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.overview-section { margin-top: 23px; }

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

.condition-card {
    position: relative;
    min-height: 145px;
    padding: 17px 40px 17px 17px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: inherit;
    background: var(--surface);
    box-shadow: var(--shadow);
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}

.condition-card:hover { border-color: #b8c4ce; transform: translateY(-1px); }
.condition-card > span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.condition-card strong { display: block; margin-top: 14px; font-size: 16px; }
.condition-card p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.condition-card i { position: absolute; top: 15px; right: 16px; font-style: normal; }
.chart-shortcut { border-style: dashed; background: var(--surface-subtle); }
.overview-health { margin-top: 12px; }

.source-label {
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    background: var(--surface-subtle);
    font-size: 10px;
    font-weight: 700;
}

.structure-insights { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.structure-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(290px, .75fr);
    gap: 12px;
}

.structure-chart { height: 430px; }

.series-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: -3px 0 13px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.series-legend span { display: inline-flex; align-items: center; gap: 6px; }
.series-legend i { width: 17px; height: 3px; border-radius: 999px; }
.series-total { background: var(--navy); }
.series-total2 { background: #d99528; }
.series-total3 { background: #8292a2; }
.series-composition-btc { background: var(--gold); }
.series-composition-eth { background: var(--navy); }
.series-composition-other { background: #aab6c1; }
.series-breadth24 { background: var(--navy); }
.series-breadth7 { background: #d99528; }
.series-spread { background: var(--navy); }
.series-liquid { background: #d99528; }
.series-volatility { background: var(--navy); }
.series-dispersion { background: #d99528; }
.series-open-interest { background: var(--navy); }
.series-funding { background: #d99528; }

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

.dominance-bar {
    display: flex;
    width: 100%;
    height: 13px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8edf1;
}

.dominance-bar span { min-width: 0; transition: width .25s ease; }
.dominance-btc { background: var(--gold); }
.dominance-eth { background: var(--navy); }
.dominance-other { background: #aab6c1; }

.dominance-legend {
    display: grid;
    gap: 13px;
    margin-top: 22px;
}

.dominance-legend > div {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
}

.dominance-legend strong { color: var(--text); font-size: 13px; }

.market-snapshot {
    margin-top: 21px;
    padding-top: 17px;
    border-top: 1px solid var(--line);
}

.snapshot-title {
    display: block;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.snapshot-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.snapshot-values span,
.snapshot-turnover span {
    display: block;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
}

.snapshot-values strong {
    display: block;
    margin-top: 3px;
    font-size: 13px;
}

.snapshot-turnover {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 13px;
    padding-top: 11px;
    border-top: 1px solid var(--line);
}

.snapshot-turnover strong { font-size: 12px; }

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.btc { background: var(--gold); }
.legend-dot.eth { background: var(--navy); }
.legend-dot.other { background: #aab6c1; }

.rotation-readout {
    margin-top: 17px;
    padding: 17px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--gold);
    border-radius: 8px;
    background: var(--surface-subtle);
}

.rotation-readout > span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.rotation-readout strong { display: block; font-size: 15px; }
.rotation-readout p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.structure-health { margin-top: 12px; }

.capital-flow-panel { margin-top: 12px; }

.flow-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(250px, .55fr);
    gap: 22px;
    align-items: stretch;
}

.flow-map {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    min-height: 360px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.flow-quadrant {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 35px;
}

.flow-quadrant:nth-child(even) { align-items: flex-end; text-align: right; }
.flow-quadrant strong { font-size: 14px; }
.flow-quadrant span { margin-top: 5px; color: var(--muted); font-size: 10px; }
.flow-quadrant.alt-rotation { background: #f1faf6; }
.flow-quadrant.btc-expansion { background: #fff8eb; }
.flow-quadrant.deleveraging { background: #f6f7f8; }
.flow-quadrant.defensive { background: #fff2f1; }

.flow-axis {
    position: absolute;
    z-index: 2;
    background: rgba(82, 98, 113, .28);
}

.flow-axis.horizontal { top: 50%; right: 0; left: 0; height: 1px; }
.flow-axis.vertical { top: 0; bottom: 0; left: 50%; width: 1px; }

.flow-axis-label {
    position: absolute;
    z-index: 3;
    padding: 3px 6px;
    border-radius: 4px;
    color: #778492;
    background: rgba(255, 255, 255, .8);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.flow-axis-label.market-up { top: 7px; left: 50%; transform: translateX(-50%); }
.flow-axis-label.market-down { bottom: 7px; left: 50%; transform: translateX(-50%); }
.flow-axis-label.dominance-down { top: 50%; left: 7px; transform: translateY(-50%); }
.flow-axis-label.dominance-up { top: 50%; right: 7px; transform: translateY(-50%); }

.flow-dot {
    position: absolute;
    z-index: 5;
    width: 28px;
    height: 28px;
    border: 6px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    background: var(--navy);
    box-shadow: 0 4px 15px rgba(16, 40, 67, .3);
    transform: translate(-50%, -50%);
    transition: left .35s ease, top .35s ease;
}

.flow-dot i {
    position: absolute;
    inset: -12px;
    border: 1px solid rgba(16, 40, 67, .2);
    border-radius: 50%;
}

.flow-dot.alt-rotation { background: var(--ok); }
.flow-dot.btc-led-expansion { background: var(--gold); }
.flow-dot.defensive, .flow-dot.broad-deleveraging { background: var(--bad); }

.flow-readout {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6px 4px;
}

.flow-readout > span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.flow-readout > strong { margin-top: 7px; font-size: 22px; line-height: 1.2; }
.flow-readout > p { margin: 17px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.flow-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 22px;
}

.flow-values > div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-subtle);
}

.flow-values span { display: block; color: var(--muted); font-size: 9px; }
.flow-values strong { display: block; margin-top: 5px; font-size: 13px; }

.breadth-chart { height: 390px; }

.breadth-visual-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.breadth-gauge-wrap {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    align-items: center;
    gap: 28px;
}

.breadth-gauge {
    display: grid;
    width: 180px;
    height: 180px;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--breadth-color, var(--navy)) var(--breadth-value), #e7ecf0 0);
    transition: background .3s ease;
}

.breadth-gauge::before {
    grid-area: 1 / 1;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
    content: "";
}

.breadth-gauge > div {
    z-index: 1;
    grid-area: 1 / 1;
    text-align: center;
}

.breadth-gauge strong { display: block; font-size: 27px; letter-spacing: -.04em; }
.breadth-gauge span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.breadth-gauge-readout > span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.breadth-gauge-readout > strong { display: block; margin-top: 6px; font-size: 18px; }
.breadth-gauge-readout p { margin: 8px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.breadth-gauge-readout small { font-size: 10px; font-weight: 700; }
.breadth-broad { color: var(--ok); border-color: #bce0ce; background: #f1faf6; }
.breadth-narrow { color: var(--bad); border-color: #edc4c0; background: #fff4f3; }
.breadth-mixed { color: var(--warn); border-color: #ead5b6; background: #fff9ee; }

.participation-bar {
    display: flex;
    width: 100%;
    height: 25px;
    overflow: hidden;
    border-radius: 7px;
    background: #edf0f2;
}

.participation-bar span { min-width: 0; transition: width .3s ease; }
.participation-bar .advancing, .participation-legend i.advancing { background: var(--ok); }
.participation-bar .unchanged, .participation-legend i.unchanged { background: #aab6c1; }
.participation-bar .declining, .participation-legend i.declining { background: var(--bad); }

.participation-legend {
    display: grid;
    gap: 13px;
    margin-top: 22px;
}

.participation-legend > div {
    display: grid;
    grid-template-columns: 9px 1fr auto;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 11px;
}

.participation-legend i { width: 8px; height: 8px; border-radius: 50%; }
.participation-legend strong { color: var(--text); font-size: 13px; }

.participation-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 22px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-subtle);
}

.participation-balance span { color: var(--muted); font-size: 10px; }
.participation-balance strong { font-size: 16px; }

.movers-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

th {
    padding: 0 10px 9px;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: .07em;
    text-align: right;
    text-transform: uppercase;
}

th:first-child { text-align: left; }

td {
    padding: 11px 10px;
    border-top: 1px solid var(--line);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

td:first-child { text-align: left; }
td strong { display: block; font-size: 12px; }
td span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.positive { color: var(--ok) !important; }
.negative { color: var(--bad) !important; }

.liquidity-chart { height: 390px; }

.liquidity-scope-bar {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 12px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
}

.liquidity-scope-bar > span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.liquidity-scope-bar > div { display: flex; flex-wrap: wrap; gap: 5px; }

button.scope-tab {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    font-size: 10px;
}

button.scope-tab:hover { color: var(--text); background: var(--surface-subtle); }
button.scope-tab.active { color: var(--navy); border-color: #ccd7e1; background: var(--navy-soft); }
button.scope-tab:disabled { cursor: not-allowed; opacity: .4; }
.liquidity-scope-bar small { margin-left: auto; color: var(--muted); font-size: 9px; }
.liquidity-scope-bar > p {
    margin: 0 0 0 auto;
    color: var(--muted);
    font-size: 10px;
}

.execution-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .6fr);
    gap: 12px;
    margin-bottom: 12px;
}

.execution-map {
    position: relative;
    min-height: 390px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background:
        repeating-linear-gradient(to right, transparent 0 calc(25% - 1px), #edf1f3 25%),
        repeating-linear-gradient(to bottom, transparent 0 calc(25% - 1px), #edf1f3 25%);
}

.execution-ready-zone {
    position: absolute;
    top: 0;
    z-index: 1;
    background: rgba(31, 138, 91, .09);
    pointer-events: none;
}

.execution-zone-label {
    position: absolute;
    top: 14px;
    right: 16px;
    color: var(--ok);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.execution-threshold {
    position: absolute;
    z-index: 2;
    background: rgba(16, 40, 67, .35);
    pointer-events: none;
}

.execution-threshold.vertical { top: 0; bottom: 0; width: 1px; border-left: 1px dashed rgba(16, 40, 67, .35); background: transparent; }
.execution-threshold.horizontal { right: 0; left: 0; height: 1px; border-top: 1px dashed rgba(16, 40, 67, .35); background: transparent; }

.execution-axis-label {
    position: absolute;
    z-index: 3;
    color: #7d8995;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.execution-axis-label.volume-low { bottom: 8px; left: 10px; }
.execution-axis-label.volume-high { right: 10px; bottom: 8px; }
.execution-axis-label.spread-tight { top: 10px; left: 10px; }
.execution-axis-label.spread-wide { bottom: 27px; left: 10px; }

.execution-point {
    position: absolute;
    z-index: 4;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--bad);
    box-shadow: 0 2px 7px rgba(16, 40, 67, .22);
    transform: translate(-50%, -50%);
}

.execution-point.ready { background: var(--ok); }

.execution-point i {
    position: absolute;
    top: 12px;
    left: 50%;
    color: var(--text);
    font-size: 8px;
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
    transform: translateX(-50%);
}

.execution-readiness-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.execution-readiness-panel .panel-heading { align-self: stretch; text-align: left; }

.liquidity-gauge {
    display: grid;
    width: 170px;
    height: 170px;
    margin: 3px auto 18px;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--liquidity-color, var(--navy)) var(--liquidity-value), #e7ecf0 0);
}

.liquidity-gauge::before {
    grid-area: 1 / 1;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
    content: "";
}

.liquidity-gauge > div { z-index: 1; grid-area: 1 / 1; }
.liquidity-gauge strong { display: block; font-size: 26px; letter-spacing: -.04em; }
.liquidity-gauge span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.execution-readiness-panel > strong { font-size: 18px; }
.execution-readiness-panel > p { max-width: 270px; color: var(--muted); font-size: 11px; line-height: 1.55; }

.readiness-thresholds {
    align-self: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: auto;
}

.readiness-thresholds > div { padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-subtle); }
.readiness-thresholds span { display: block; color: var(--muted); font-size: 8px; }
.readiness-thresholds strong { display: block; margin-top: 4px; font-size: 11px; }

.liquidity-grid {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 12px;
    margin-top: 12px;
}

.volatility-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr);
    gap: 12px;
}

.volatility-chart { height: 390px; }

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

.regime-badge {
    align-self: flex-start;
    margin: 4px 0 14px;
    padding: 6px 9px;
    border-radius: 6px;
    color: var(--muted);
    background: var(--surface-subtle);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.regime-badge.compressed { color: #296b88; background: #edf8fc; }
.regime-badge.normal { color: var(--ok); background: #eef9f3; }
.regime-badge.elevated { color: var(--warn); background: #fff7e8; }
.regime-badge.extreme { color: var(--bad); background: #fff0ef; }
.regime-panel > strong { font-size: 18px; line-height: 1.3; }
.regime-panel > p { color: var(--muted); font-size: 12px; line-height: 1.6; }

.regime-scale {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    height: 9px;
    margin-top: auto;
}

.regime-scale span { border-radius: 3px; background: #b9ddea; }
.regime-scale span:nth-child(2) { background: #9ed5b8; }
.regime-scale span:nth-child(3) { background: #efc46f; }
.regime-scale span:nth-child(4) { background: #e79690; }

.regime-scale i {
    position: absolute;
    top: -5px;
    width: 2px;
    height: 19px;
    background: var(--text);
    transform: translateX(-1px);
}

.regime-labels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 8px;
    text-align: center;
}

.volatility-table-panel { margin-top: 12px; }

.volatility-map-panel { margin-top: 12px; }

.volatility-map {
    position: relative;
    min-height: 400px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background:
        linear-gradient(to right, rgba(41, 107, 136, .04), rgba(228, 165, 58, .06)),
        repeating-linear-gradient(to right, transparent 0 calc(25% - 1px), #edf1f3 25%),
        repeating-linear-gradient(to bottom, transparent 0 calc(25% - 1px), #edf1f3 25%);
}

.volatility-map-axis {
    position: absolute;
    z-index: 2;
    background: rgba(16, 40, 67, .25);
}

.volatility-map-axis.vertical { top: 0; bottom: 0; left: 50%; width: 1px; }
.volatility-map-axis.horizontal { right: 0; bottom: 8%; left: 0; height: 1px; }

.volatility-map-label {
    position: absolute;
    z-index: 3;
    color: #7d8995;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.volatility-map-label.high-vol { top: 9px; left: 10px; }
.volatility-map-label.low-vol { bottom: 9px; left: 10px; }
.volatility-map-label.negative-correlation { bottom: 9px; left: 50%; transform: translateX(-115%); }
.volatility-map-label.positive-correlation { right: 10px; bottom: 9px; }

.volatility-map-point {
    position: absolute;
    z-index: 4;
    width: 9px;
    height: 9px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--navy);
    box-shadow: 0 2px 6px rgba(16, 40, 67, .2);
    transform: translate(-50%, -50%);
}

.volatility-map-point.compressed { background: #4f9fbc; }
.volatility-map-point.normal { background: var(--ok); }
.volatility-map-point.elevated { background: var(--gold); }
.volatility-map-point.extreme { background: var(--bad); }

.volatility-map-point i {
    position: absolute;
    top: 9px;
    left: 50%;
    color: var(--text);
    font-size: 7px;
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
    transform: translateX(-50%);
}

.derivatives-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr);
    gap: 12px;
}

.derivatives-chart { height: 390px; }

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

.regime-badge.balanced { color: var(--ok); background: #eef9f3; }
.regime-badge.high { color: var(--bad); background: #fff0ef; }
.leverage-panel > strong { font-size: 18px; }
.leverage-panel > p { color: var(--muted); font-size: 12px; line-height: 1.6; }

.risk-details {
    display: grid;
    gap: 0;
    margin: auto 0 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-subtle);
}

.risk-details > div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 13px;
}

.risk-details > div + div { border-top: 1px solid var(--line); }
.risk-details dt { color: var(--muted); font-size: 10px; }
.risk-details dd { margin: 0; font-size: 11px; font-weight: 700; text-align: right; }
.derivatives-map-panel { margin-top: 12px; }

.derivatives-map {
    position: relative;
    min-height: 380px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background:
        linear-gradient(90deg, rgba(25, 59, 96, .045) 0 50%, rgba(217, 149, 40, .055) 50% 100%),
        repeating-linear-gradient(0deg, transparent 0 74px, rgba(205, 215, 223, .48) 75px),
        var(--surface-subtle);
}

.derivatives-map-zero,
.derivatives-map-midline {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.derivatives-map-zero {
    top: 40px;
    bottom: 34px;
    left: 50%;
    border-left: 1px dashed #8f9dab;
}

.derivatives-map-midline {
    top: 50%;
    right: 7%;
    left: 7%;
    border-top: 1px dashed rgba(143, 157, 171, .65);
}

.derivatives-map-label {
    position: absolute;
    z-index: 3;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.map-label-left { bottom: 12px; left: 14px; color: #4778a6; }
.map-label-right { right: 14px; bottom: 12px; color: #b67818; }
.map-label-top { top: 12px; left: 14px; }
.map-label-bottom { bottom: 12px; left: 50%; transform: translateX(-50%); }

.derivatives-map-point {
    position: absolute;
    z-index: 2;
    width: 11px;
    height: 11px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 7px rgba(14, 39, 66, .2);
    transform: translate(-50%, -50%);
}

.derivatives-map-point.long { background: var(--gold); }
.derivatives-map-point.short { background: #487ba9; }
.derivatives-map-point.neutral { background: #97a5b2; }

.derivatives-map-point span {
    position: absolute;
    top: 10px;
    left: 50%;
    color: var(--text);
    font-size: 8px;
    font-weight: 800;
    white-space: nowrap;
    transform: translateX(-50%);
}

.derivatives-table-panel { margin-top: 12px; }

.narrative-pulse {
    margin-bottom: 12px;
    border-top: 3px solid var(--gold);
}

.narrative-pulse-copy {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.narrative-pulse-copy span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.narrative-pulse-copy h2 { margin: 7px 0 5px; font-size: 23px; }
.narrative-pulse-copy p { max-width: 760px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.regime-badge.risk-on { color: var(--ok); background: #eef9f3; }
.regime-badge.risk-off { color: var(--bad); background: #fff0ef; }
.regime-badge.selective { color: var(--warn); background: #fff7e8; }

.narrative-pulse-track {
    position: relative;
    display: flex;
    justify-content: space-between;
    height: 31px;
    margin-top: 18px;
    padding-top: 13px;
    overflow: hidden;
    color: var(--muted);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.narrative-pulse-track::before,
.narrative-pulse-track i {
    position: absolute;
    top: 0;
    left: 0;
    height: 7px;
    border-radius: 999px;
    content: "";
}

.narrative-pulse-track::before { width: 100%; background: #e8edf1; }
.narrative-pulse-track i { width: 0; background: linear-gradient(90deg, #bb4b44, var(--gold), var(--ok)); transition: width .35s ease; }

.sectors-research-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(285px, .55fr);
    gap: 12px;
}

.narrative-map {
    position: relative;
    min-height: 440px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background:
        linear-gradient(90deg, rgba(180, 35, 24, .035), transparent 45%, transparent 55%, rgba(31, 138, 91, .04)),
        var(--surface-subtle);
}

.narrative-zero,
.narrative-midline {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.narrative-zero { top: 38px; bottom: 35px; left: 50%; border-left: 1px dashed #95a2ae; }
.narrative-midline { top: 50%; right: 6%; left: 6%; border-top: 1px dashed #c6d0d8; }

.narrative-axis {
    position: absolute;
    z-index: 3;
    color: var(--muted);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.narrative-axis.label-left { bottom: 12px; left: 13px; color: var(--bad); }
.narrative-axis.label-right { right: 13px; bottom: 12px; color: var(--ok); }
.narrative-axis.label-top { top: 11px; left: 13px; }
.narrative-axis.label-bottom { bottom: 12px; left: 50%; transform: translateX(-50%); }

.narrative-map-point {
    position: absolute;
    z-index: 2;
    min-width: 11px;
    min-height: 11px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(16, 40, 67, .18);
    transform: translate(-50%, -50%);
}

.narrative-map-point.positive-point { background: #2e9870; }
.narrative-map-point.negative-point { background: #c6635c; }
.narrative-map-point span {
    position: absolute;
    top: calc(100% + 3px);
    left: 50%;
    color: var(--text);
    font-size: 7px;
    font-weight: 750;
    white-space: nowrap;
    transform: translateX(-50%);
}

.narrative-leadership-panel { display: flex; flex-direction: column; }
.narrative-list-block + .narrative-list-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.narrative-list-block > span { color: var(--ok); font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.narrative-list-block.lagging > span { color: var(--bad); }
.narrative-list-block ol { display: grid; gap: 0; margin: 8px 0 0; padding: 0; list-style: none; }
.narrative-list-block li { border-top: 1px solid #edf0f2; font-size: 11px; }
.narrative-list-block li button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border: 0; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.narrative-list-block li button:hover span { color: var(--warn); }
.narrative-list-block li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.narrative-list-block li strong { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.narrative-table-panel { margin-top: 12px; }
.narrative-clickable-row { cursor: pointer; }
.narrative-clickable-row:hover td { background: #fbf8f1; }
.narrative-clickable-row:focus { outline: 2px solid var(--gold); outline-offset: -2px; }

.compact-search { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.compact-search input {
    width: 210px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    outline: none;
    color: var(--text);
    background: var(--surface);
    font-size: 11px;
}
.compact-search input:focus { border-color: #93a9bc; box-shadow: 0 0 0 3px var(--navy-soft); }

.sector-detail-drawer {
    width: min(760px, calc(100vw - 28px));
    max-width: none;
    height: 100vh;
    max-height: none;
    margin: 0 0 0 auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    color: var(--text);
    background: var(--surface);
    box-shadow: -18px 0 55px rgba(16, 40, 67, .18);
}

.sector-detail-drawer::backdrop { background: rgba(16, 40, 67, .28); backdrop-filter: blur(2px); }
.sector-detail-shell { height: 100%; overflow-y: auto; padding: 28px; }
.sector-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.sector-detail-header h2 { margin: 4px 0 5px; font-size: 28px; letter-spacing: -.025em; }
.sector-detail-header > div > p:last-child { margin: 0; color: var(--muted); font-size: 11px; }
.sector-detail-close { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--surface-subtle); font-size: 24px; line-height: 1; cursor: pointer; }
.sector-detail-close:hover { color: var(--text); border-color: var(--line-strong); }
.sector-detail-loading { display: grid; min-height: 280px; place-items: center; color: var(--muted); font-size: 12px; }

.sector-detail-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 20px 0 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-subtle);
}

.sector-detail-metrics > div { min-width: 0; padding: 14px; }
.sector-detail-metrics > div + div { border-left: 1px solid var(--line); }
.sector-detail-metrics span { display: block; min-height: 25px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.sector-detail-metrics strong { display: block; margin-top: 5px; font-size: 18px; }
.sector-breadth-visual { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 10px 15px; margin-bottom: 23px; padding: 16px; border: 1px solid var(--line); border-radius: 9px; }
.sector-breadth-visual > div:nth-child(odd) { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; }
.sector-breadth-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e8edf1; }
.sector-breadth-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--gold); transition: width .3s ease; }
.sector-breadth-track.seven-day i { background: var(--navy); }
.sector-detail-section-title h3 { margin: 0; font-size: 16px; }
.sector-detail-section-title p { margin: 4px 0 12px; color: var(--muted); font-size: 10px; }
.sector-detail-table th:first-child, .sector-detail-table td:first-child { text-align: left; }
.sector-asset { display: flex; align-items: center; gap: 9px; }
.sector-asset img, .sector-asset > i { width: 25px; height: 25px; flex: 0 0 auto; border-radius: 50%; background: var(--navy-soft); }
.sector-asset span { min-width: 0; margin: 0; }
.sector-asset strong { overflow: hidden; max-width: 160px; text-overflow: ellipsis; white-space: nowrap; }
.sector-asset small { display: block; margin-top: 1px; color: var(--muted); font-size: 8px; }

.status-band {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-subtle);
}

.status-band > div { min-width: 0; padding: 14px 16px; }
.status-band > div + div { border-left: 1px solid var(--line); }

.status-band strong {
    display: block;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1000px) {
    .samurai-app { grid-template-columns: 210px minmax(0, 1fr); }
    .workspace { padding: 24px 20px 40px; }
    .controls-band, .metrics-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .controls-band button { width: 100%; }
    .structure-grid { grid-template-columns: 1fr; }
    .structure-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .movers-grid { grid-template-columns: 1fr; }
    .breadth-visual-grid { grid-template-columns: 1fr; }
    .liquidity-grid { grid-template-columns: 1fr; }
    .execution-layout { grid-template-columns: 1fr; }
    .volatility-layout { grid-template-columns: 1fr; }
    .derivatives-layout { grid-template-columns: 1fr; }
    .sectors-research-grid { grid-template-columns: 1fr; }
    .condition-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .flow-layout { grid-template-columns: 1fr; }
    .regime-scale { margin-top: 25px; }
    .rotation-readout { margin-top: 24px; }
}

@media (max-width: 720px) {
    .samurai-app { display: block; }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding: 13px 14px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .sidebar-brand { padding: 0 3px 12px; }
    .sidebar-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
    .nav-label, .nav-item.planned, .sidebar-footer { display: none; }
    .nav-item { flex: 0 0 auto; }
    .workspace { padding: 20px 14px 34px; }
    .workspace-header { align-items: flex-end; }
    .panel { padding: 16px; }
    .metrics-strip { gap: 8px; }
    .metric { padding: 14px; }
    .chart { height: 410px; }
    .liquidity-scope-bar { align-items: flex-start; flex-direction: column; }
    .liquidity-scope-bar small { margin-left: 0; }
    .liquidity-scope-bar > p { margin-left: 0; }
    .derivatives-map { min-height: 330px; }
    .narrative-map { min-height: 370px; }
    .narrative-pulse-copy { flex-direction: column; gap: 12px; }
    .compact-search { align-items: flex-start; flex-direction: column; }
    .sector-detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sector-detail-metrics > div:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
    .sector-detail-metrics > div:nth-child(4) { border-top: 1px solid var(--line); }
    .sector-breadth-visual { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
    .workspace-header { display: block; }
    .status-pill { display: inline-block; margin-top: 12px; }
    .controls-band { grid-template-columns: 1fr; }
    .metrics-strip, .status-band { grid-template-columns: 1fr; }
    .overview-metrics, .condition-grid { grid-template-columns: 1fr; }
    .pulse-copy { align-items: flex-start; flex-direction: column; gap: 15px; }
    .flow-map { min-height: 310px; }
    .flow-quadrant { padding: 24px 14px; }
    .flow-quadrant strong { font-size: 11px; }
    .flow-quadrant span { display: none; }
    .breadth-gauge-wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .status-band > div + div { border-top: 1px solid var(--line); border-left: 0; }
    .chart { height: 340px; }
}
