:root {
    --market-breadth: #40c9d0;
    --move-efficiency: #ff9e64;
    --bg: #0f1115;
    --panel: #171a20;
    --panel2: #20242b;
    --line: #343944;
    --text: #f4f7fb;
    --muted: #cbd4de;
    --blue: #79b8ff;
    --green: #70d38d;
    --green-bg: #153522;
    --red: #ff8c8c;
    --red-bg: #3a1719;
    --amber: #ffd56a;
    --amber-bg: #3a2f12;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.page { max-width: 1780px; margin: auto; padding: 22px; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}
.topbar h1 { margin: 3px 0 0; font-size: 25px; }
.eyebrow {
    color: var(--blue);
    font-size: 14px;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.home-link, .quick-nav a {
    color: #c7def5;
    text-decoration: none;
    border: 1px solid #34495e;
    background: #182432;
    border-radius: 8px;
    padding: 7px 10px;
    font-weight: 700;
}
.panel, .zone-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}
.panel h2, .zone-card h3 { margin-top: 0; }
.panel p { color: #e0e5ec; }
.notice {
    border-radius: 9px;
    padding: 11px 14px;
    margin: 0 0 16px;
    border: 1px solid var(--line);
}
.notice.success { background: var(--green-bg); color: var(--green); }
.notice.error { background: var(--red-bg); color: var(--red); }
.notice.warn { background: var(--amber-bg); color: var(--amber); }
.pool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.forecast-form, .selector-bar form, .add-form {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}
label {
    display: grid;
    gap: 5px;
    color: #cbd1d8;
    font-weight: 700;
}
input, select {
    background: #0f1319;
    color: var(--text);
    border: 1px solid #3b424d;
    border-radius: 7px;
    padding: 9px 10px;
    min-width: 175px;
}
button {
    border: 0;
    border-radius: 7px;
    padding: 9px 12px;
    font-weight: 850;
    cursor: pointer;
}
button.primary { background: #2f75b5; color: white; }
button.secondary { background: #35404b; color: white; }
button.danger { background: #5a272a; color: #ffd2d2; }
button.small { padding: 6px 9px; font-size: 14px; }
.hint, .muted { color: var(--muted) !important; font-size: 14px; }
code { color: #c5e2ff; }
.ticker-list { display: grid; gap: 7px; margin-top: 12px; }
.ticker-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid #2e333b;
    border-radius: 8px;
    background: #13171d;
}
.empty-state {
    padding: 16px;
    color: var(--muted);
    border: 1px dashed #4a515c;
    border-radius: 8px;
}
.quick-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    padding: 8px 0 11px;
    background: linear-gradient(var(--bg) 75%, transparent);
}
.hero-report {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(135deg,#20252e,#15181e);
    margin-bottom: 12px;
}
.hero-report h2 { margin: 4px 0; font-size: 25px; }
.hero-report p { margin: 0; color: #d5dde5; }
.decision-badge {
    padding: 10px 15px;
    border-radius: 9px;
    font-weight: 950;
    white-space: nowrap;
}
.status-qualified { background: var(--green-bg); color: var(--green); border: 1px solid #377448; }
.status-monitor-only { background: var(--amber-bg); color: var(--amber); border: 1px solid #755d18; }
.status-no-trade { background: var(--red-bg); color: var(--red); border: 1px solid #743236; }
.selector-bar {
    border: 1px solid #2d3d4c;
    background: #141c25;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 16px;
}
.three-col {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 14px;
}
.forecast-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}

/* Keep the ticker market-history card at its natural content height. */
.ticker-market-history { align-self: start; }
/* Let the PSA Forecast Report retain its natural height beside the chart stack. */
.forecast-top-grid > #baseline { align-self: start; }
.metrics {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(100px, 1fr);
    margin: 0;
}
.metrics dt, .metrics dd {
    margin: 0;
    padding: 7px 8px;
    border-bottom: 1px solid #2a2f36;
}
.metrics dt { color: #d1d9e2; }
.metrics dd { font-weight: 700; }
.emphasis { color: #f0d371; font-weight: 900 !important; }
.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 9px;
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
}
.table-wrap.narrow table { min-width: 600px; }
.table-wrap.historical table { min-width: 2600px; }
th {
    background: #292e37;
    text-align: left;
    padding: 8px 9px;
    white-space: nowrap;
    font-size: 14px;
}
td {
    padding: 7px 9px;
    border-top: 1px solid #292e35;
    white-space: nowrap;
}
tbody tr:nth-child(even) td { background: #191d23; }
tbody tr:hover td { background: #242a32; }
.pass { color: var(--green); font-weight: 900; }
.fail { color: var(--red); font-weight: 900; }
.structure-row td { background: #4a4019 !important; }
.psa-live-calculator {
    margin-bottom: 16px;
}

.psa-live-calculator label {
    margin-bottom: 6px;
}

.psa-live-calculator input {
    margin-right: 6px;
}

.psa-live-calculator button {
    margin-right: 8px;
}

#psa-live-calc-result {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.zone-scale {
    display: grid;
    grid-template-columns: repeat(5, minmax(170px,1fr));
    gap: 8px;
}
.zone-scale > div {
    background: #12171e;
    border: 1px solid #303741;
    border-radius: 8px;
    padding: 10px;
}
.zone-scale-head {
    cursor: pointer;
}
.zone-scale-head:focus {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}
.zone-scale-collapsed > table {
    display: none;
}
.zone-scale span, .zone-scale strong { display: block; }
.zone-scale span { color: #d0d9e3; font-size: 14px; font-weight: 850; }
.zone-scale strong { color: #f0d371; margin-top: 3px; }
.zone-card { padding: 0 14px 14px; overflow: hidden; }
.zone-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 -14px 14px;
    padding: 13px 16px;
    background: #222731;
    border-bottom: 1px solid #39404b;
}
.zone-name { font-size: 17px; font-weight: 950; letter-spacing: .05em; }
.zone-band { color: #e7cb73; font-weight: 850; }
.sample-pill {
    background: #17283a;
    color: #b7d8f6;
    border: 1px solid #355371;
    border-radius: 20px;
    padding: 5px 9px;
    font-size: 14px;
    font-weight: 800;
}
.branch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.branch-panel {
    background: #12171d;
    border: 1px solid #2f353e;
    border-radius: 9px;
    padding: 12px;
}
.branch-panel h3 { font-size: 14px; color: #dce2e9; }

.historical-dataset-heading {
    margin-top: 20px !important;
}
.version-note {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    padding: 15px;
}
@media(max-width: 1050px) {
    .three-col, .pool-grid, .branch-grid { grid-template-columns: 1fr; }
    .zone-scale { grid-template-columns: 1fr 1fr; }
}
@media(max-width: 600px) {
    .page { padding: 10px; }
    .topbar, .hero-report { align-items: flex-start; flex-direction: column; }
    .forecast-top-grid { grid-template-columns: 1fr; }
    .zone-scale { grid-template-columns: 1fr; }

    .historical-dataset-heading {
        margin-top: 24px !important;
    }

    .psa-live-calculator {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }

    .psa-live-calculator label,
    .psa-live-calculator input,
    .psa-live-calculator button {
        margin: 0;
    }

    .psa-live-calculator input {
        width: 100%;
        min-width: 0;
    }

    .psa-live-calculator button {
        justify-self: start;
        padding: 10px 14px;
    }

    #psa-live-calc-result {
        display: grid;
        gap: 3px;
        margin-top: 2px;
        line-height: 1.25;
    }

    #psa-live-calc-result strong,
    .psa-live-calc-value {
        display: block;
    }
}


.top-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
/* ---- Characteristic Library evidence layer ---- */
.characteristics-panel { overflow: hidden; }
.characteristics-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 14px;
}
.characteristics-head h2 { margin: 3px 0 4px; }
.characteristics-head p { margin: 0; max-width: 780px; }
.characteristic-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, 1fr));
    gap: 8px;
    min-width: 390px;
}
.characteristic-summary-grid > div {
    background: #11171e;
    border: 1px solid #303946;
    border-radius: 9px;
    padding: 9px 11px;
}
.characteristic-summary-grid span,
.characteristic-metrics span {
    display: block;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.characteristic-summary-grid strong { display: block; margin-top: 2px; font-size: 17px; }
.characteristic-context {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0 14px;
}
.characteristic-context > span {
    border: 1px solid #34404c;
    background: #121820;
    border-radius: 20px;
    padding: 6px 10px;
    color: #d2d9e1;
    font-size: 14px;
}
.characteristic-context b { color: #8fbde9; margin-right: 4px; }
.characteristic-history-warning { margin-top: 8px; }
.characteristic-block,
.zone-characteristic-map {
    border-top: 1px solid #2c333c;
    padding-top: 14px;
    margin-top: 14px;
}
.characteristic-block-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.characteristic-block-head h3 { margin: 0; font-size: 15px; }
.characteristic-block-head p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.match-count {
    background: #17283a;
    border: 1px solid #355371;
    color: #b7d8f6;
    border-radius: 20px;
    padding: 5px 9px;
    font-size: 14px;
    font-weight: 850;
    white-space: nowrap;
}
.characteristic-family { margin: 12px 0; }
.family-title {
    color: #cdd7e2;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .12em;
    margin: 0 0 6px;
}
.characteristic-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}
.characteristic-card {
    background: #11161c;
    border: 1px solid #303741;
    border-left-width: 4px;
    border-radius: 9px;
    padding: 10px 11px;
    min-width: 0;
}
.characteristic-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.characteristic-card-head > strong { font-size: 14px; color: #eef2f6; }
.condition-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 8px 0;
}
.condition-list code {
    background: #17202a;
    border: 1px solid #2b3b4a;
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 14px;
    white-space: normal;
}
.characteristic-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(92px, 1fr));
    gap: 5px;
    margin-top: 8px;
}
.characteristic-metrics > div {
    background: #171c22;
    border: 1px solid #292f37;
    border-radius: 6px;
    padding: 6px 7px;
    min-width: 0;
}
.forecast-objective-wide {
    grid-column: 1 / -1;
}
.characteristic-metrics strong {
    display: block;
    margin-top: 1px;
    font-size: 14px;
    color: #edf1f5;
}
.effect-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid #414a55;
    border-radius: 20px;
    padding: 3px 7px;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 950;
    letter-spacing: .04em;
    white-space: nowrap;
}
.effect-support,
.effect-magnitude-support,
.effect-magnitude-strong { background: #153522; color: #87dfa0; border-color: #326944; }
.effect-contradiction,
.effect-rejection,
.effect-magnitude-rejection { background: #3a1719; color: #ff9b9b; border-color: #6a3034; }
.effect-weaker,
.effect-watch { background: #3a2f12; color: #f4d36f; border-color: #6f5b1d; }
.effect-baseline,
.effect-mixed { background: #192738; color: #a9d3fb; border-color: #35526f; }
.effect-border-support,
.effect-border-magnitude-support,
.effect-border-magnitude-strong { border-left-color: #4f9b65; }
.effect-border-contradiction,
.effect-border-rejection,
.effect-border-magnitude-rejection { border-left-color: #a5484f; }
.effect-border-weaker,
.effect-border-watch { border-left-color: #a7882e; }
.effect-border-baseline,
.effect-border-mixed { border-left-color: #4e78a4; }
.characteristic-zone {
    border: 1px solid #303741;
    border-radius: 9px;
    background: #12171d;
    margin-bottom: 8px;
    overflow: hidden;
}
.characteristic-zone summary {
    display: grid;
    grid-template-columns: minmax(145px, .7fr) 2fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    list-style-position: inside;
    background: #191f27;
}
.characteristic-zone.has-matches summary:hover { background: #222a34; }
.characteristic-zone.no-matches { opacity: .72; }
.zone-summary-name { font-weight: 950; letter-spacing: .04em; }
.zone-summary-effects { display: flex; flex-wrap: wrap; gap: 5px; }
.zone-characteristic-body { padding: 4px 12px 10px; border-top: 1px solid #2a3038; }
.characteristic-empty { padding: 10px 2px; }

@media(max-width: 1150px) {
    .characteristics-head { flex-direction: column; }
    .characteristic-summary-grid { min-width: 0; width: 100%; }
    .characteristic-card-grid { grid-template-columns: 1fr; }
    .characteristic-metrics { grid-template-columns: repeat(3, minmax(90px, 1fr)); }
}

@media(max-width: 700px) {
    .characteristic-summary-grid { grid-template-columns: 1fr; }
    .characteristic-zone summary { grid-template-columns: 1fr; }
    .characteristic-metrics { grid-template-columns: repeat(2, minmax(90px, 1fr)); }
}



/* ---- Integrated Characteristic Library inside historical open-zone registers ---- */
.characteristics-summary-panel {
    padding-bottom: 12px;
}

.integrated-characteristic-hint {
    margin: 4px 0 0;
}

.integrated-characteristics {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #39404b;
}

.integrated-characteristics-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 10px;
}

.integrated-characteristics-head h3 {
    margin: 3px 0 2px;
    font-size: 16px;
}

.integrated-characteristics-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.integrated-characteristic-summary {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.cross-zone-pill {
    background: #1c2430;
    border-color: #49596d;
    color: #c8d7e8;
}

.integrated-evidence-group {
    border: 1px solid #303741;
    border-radius: 9px;
    background: #12171d;
    margin-top: 8px;
    overflow: hidden;
}

.integrated-evidence-group > summary {
    display: grid;
    grid-template-columns: minmax(250px, .9fr) 2fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    background: #191f27;
}

.integrated-evidence-group > summary:hover {
    background: #222a34;
}

.integrated-evidence-group > summary > span:first-child {
    display: grid;
    gap: 2px;
}

.integrated-evidence-group > summary small {
    color: var(--muted);
    font-size: 14px;
}

.integrated-evidence-body {
    padding: 4px 12px 10px;
    border-top: 1px solid #2a3038;
}

.zone-specific-evidence {
    border-color: #355371;
}

.cross-zone-evidence {
    border-color: #3b4654;
}

@media(max-width: 1150px) {
    .integrated-characteristics-head {
        flex-direction: column;
    }

    .integrated-characteristic-summary {
        justify-content: flex-start;
    }

    .integrated-evidence-group > summary {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   GSS-PHASE HEADER BRANDING
   ========================================================= */

.brand-block {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand-logo {
    width: 250px;
    height: auto;
    display: block;
}

.brand-title {
    display: flex;
    flex-direction: column;
}

.brand-title .eyebrow {
    margin-bottom: 3px;
}

/* =========================================================
   GSS-PHASE MOBILE HEADER LOGO
   ========================================================= */

@media (max-width: 700px) {
    .brand-logo {
        width: 125px;
        height: auto;
    }

    .brand-block {
        gap: 10px;
    }
}

@media (max-width: 420px) {
    .brand-logo {
        width: 160px;
    }
}

/* =========================================================
   FORECAST MESSAGE CENTER
   ========================================================= */

.forecast-message-center .panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.forecast-message-center .panel-head h2 {
    margin-bottom: 4px;
}

.forecast-message-center .panel-head p {
    margin: 0;
}

/* Index: keep analysis-date controls distinct from forecast filters. */
.forecast-message-center #price-band-date-form {
    column-gap: 16px;
    row-gap: 12px;
    padding-bottom: 23px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.forecast-message-center #price-band-date-form > label {
    width: 205px;
    max-width: 100%;
    gap: 10px;
}

.forecast-message-center #price-band-date-form > label > input {
    width: 100%;
    min-width: 0;
}

.forecast-message-center #price-band-date-form > button {
    min-height: 39px;
}

.forecast-message-center .price-band-filter-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 205px));
    gap: 14px 20px;
    align-items: start;
    margin-bottom: 18px;
}

.forecast-message-center .price-band-filter-controls > label {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.forecast-message-center .price-band-filter-controls > label > :is(input, select) {
    width: 100%;
    min-width: 0;
    min-height: 39px;
}

@media (max-width: 760px) {
    .forecast-message-center .price-band-filter-controls {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr));
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .forecast-message-center #price-band-date-form > label {
        width: 100%;
    }
}

.forecast-message-sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.forecast-message-group {
    overflow: hidden;
    background: #12171d;
    border: 1px solid #2f353e;
    border-radius: 9px;
}

.forecast-message-group h3 {
    margin: 0;
    padding: 11px 14px;
    border-bottom: 1px solid #2f353e;
    background: #171d24;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .05em;
}

.forecast-message-group h3.message-qualified {
    color: var(--green);
}

.forecast-message-group h3.message-monitor {
    color: var(--amber);
}

.forecast-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.forecast-message-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 1400px;
}

.forecast-message-table th,
.forecast-message-table td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #252b33;
}

.forecast-message-table th {
    background: #10151b;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.forecast-message-table td {
    color: var(--text);
    font-size: 14px;
}

/* The original QUALIFIED and MONITOR ONLY tables now have eight columns.
   Leave the separate seven-column LIVE QUALIFIED table untouched. */
.forecast-message-table:not(#live-only-table) {
    min-width: 1650px;
}

.forecast-message-table:not(#live-only-table) :is(th, td):nth-child(1) { width: 7%; }  /* Ticker */
.forecast-message-table:not(#live-only-table) :is(th, td):nth-child(2) { width: 7%; }  /* Forecast */
.forecast-message-table:not(#live-only-table) :is(th, td):nth-child(3) { width: 9%; }  /* $1 Objective */
.forecast-message-table:not(#live-only-table) :is(th, td):nth-child(4) { width: 7%; }  /* Live Price */
.forecast-message-table:not(#live-only-table) :is(th, td):nth-child(5) { width: 16%; white-space: normal; } /* Live Open Zone Forecast */
.forecast-message-table:not(#live-only-table) :is(th, td):nth-child(6) { width: 19%; white-space: normal; } /* Live Projection */
.forecast-message-table:not(#live-only-table) :is(th, td):nth-child(7) {
    width: 25%;
    white-space: normal;
    overflow-wrap: break-word;
} /* Decision Explanation */
.forecast-message-table:not(#live-only-table) :is(th, td):nth-child(8) {
    width: 10%;
    white-space: nowrap;
} /* Forecast Date */

.forecast-message-table td.live-feed-pending {
    color: var(--muted);
    font-size: 14px;
}

.forecast-message-table tbody tr:last-child td {
    border-bottom: 0;
}

.forecast-message-table tbody tr:hover {
    background: #1a2028;
}

.forecast-message-ticker,
.forecast-message-ticker:visited {
    color: var(--blue);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .06em;
    text-decoration: none;
}

.forecast-message-ticker:hover {
    color: var(--blue);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.forecast-message-ticker:focus-visible {
    outline: 1px solid var(--blue);
    outline-offset: 3px;
    border-radius: 3px;
}

@media (max-width: 700px) {
    .forecast-message-table th,
    .forecast-message-table td {
        padding: 9px 11px;
    }
}

/* Read-only Schwab live columns on the Forecast Message Center. */
.forecast-message-table td.live-open-zone-forecast,
.forecast-message-table td.live-projection {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
}
.forecast-message-table td.live-open-zone-forecast strong,
.forecast-message-table td.live-projection strong,
.forecast-message-table td.live-open-zone-forecast small,
.forecast-message-table td.live-projection small {
    display: block;
}
.forecast-message-table td.live-open-zone-forecast small,
.forecast-message-table td.live-projection small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 14px;
}
.forecast-message-table td.live-qualified strong { color: var(--green); }
.forecast-message-table td.live-no-trade strong { color: var(--red); }
.forecast-message-table td.live-feed-pending strong { color: var(--amber); }
.forecast-message-table td.live-zone-available strong { color: var(--text); }

/* =========================================================
   COLLAPSING CHARACTERISTIC TREE / RESOLVER
   ========================================================= */

.characteristic-resolution {
    margin: 12px 0 10px;
    padding: 13px;
    border: 1px solid #355371;
    border-radius: 10px;
    background: #10161d;
}

.characteristic-resolution-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.characteristic-resolution-head h4 {
    margin: 3px 0 2px;
    font-size: 15px;
}

.characteristic-resolution-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.resolver-counts {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
    color: #cbd6e1;
    font-size: 14px;
}

.resolver-counts > span {
    border: 1px solid #34495e;
    background: #16212c;
    border-radius: 18px;
    padding: 5px 8px;
    white-space: nowrap;
}

.resolver-counts .resolver-arrow {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--blue);
    font-weight: 900;
}

.resolver-counts .resolver-history-n {
    background: #171b21;
    border-color: #353b44;
    color: var(--muted);
}

.resolver-state-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.resolver-state {
    min-width: 0;
    padding: 9px;
    border: 1px solid #303741;
    border-left-width: 4px;
    border-radius: 8px;
    background: #13181f;
}

.resolver-state-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.resolver-state-head span {
    color: #dce3ea;
    font-size: 14px;
    font-weight: 850;
}

.resolver-state-head strong {
    font-size: 14px;
    letter-spacing: .04em;
}

.resolver-status-supported {
    border-left-color: #4f9b65;
}
.resolver-status-supported .resolver-state-head strong {
    color: var(--green);
}

.resolver-status-suppressed {
    border-left-color: #a5484f;
}
.resolver-status-suppressed .resolver-state-head strong {
    color: var(--red);
}

.resolver-status-conflicting {
    border-left-color: #a7882e;
}
.resolver-status-conflicting .resolver-state-head strong {
    color: var(--amber);
}

.resolver-status-unresolved {
    border-left-color: #4e78a4;
}
.resolver-status-unresolved .resolver-state-head strong {
    color: #a9d3fb;
}

.resolver-baseline {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 7px;
}

.resolver-driver {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #252c34;
}

.resolver-driver > span {
    display: block;
    margin-bottom: 3px;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.resolver-driver-support > span { color: var(--green); }
.resolver-driver-suppression > span { color: var(--red); }

.resolver-driver code {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
    color: #d4e9ff;
    font-size: 14px;
}

.resolver-driver small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 14px;
}

.resolver-intersections {
    margin-top: 10px;
    border: 1px solid #2f3944;
    border-radius: 8px;
    overflow: hidden;
}

.resolver-intersections > summary {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
    background: #171d24;
    font-weight: 800;
    font-size: 14px;
}

.resolver-intersections > summary span {
    color: var(--muted);
    font-weight: 700;
}

.resolver-intersection-list {
    padding: 7px;
    border-top: 1px solid #2a3038;
}

.resolver-intersection {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(170px, .7fr) minmax(190px, .8fr);
    gap: 10px;
    align-items: center;
    padding: 7px 8px;
    border-bottom: 1px solid #242b33;
}

.resolver-intersection:last-child {
    border-bottom: 0;
}

.resolver-intersection-conditions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.resolver-intersection-conditions code {
    background: #17202a;
    border: 1px solid #2b3b4a;
    border-radius: 5px;
    padding: 3px 5px;
    white-space: normal;
    font-size: 14px;
}

.resolver-intersection-result {
    display: grid;
    gap: 1px;
}

.resolver-intersection-result strong {
    color: #e6edf4;
    font-size: 14px;
}

.resolver-intersection-result span,
.resolver-intersection-counts {
    color: var(--muted);
    font-size: 14px;
}

.resolver-note {
    margin-top: 9px;
    color: var(--muted);
    font-size: 14px;
}

@media(max-width: 1250px) {
    .resolver-state-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .resolver-intersection {
        grid-template-columns: 1fr;
    }
}

@media(max-width: 700px) {
    .characteristic-resolution-head {
        flex-direction: column;
    }

    .resolver-counts {
        justify-content: flex-start;
    }

    .resolver-state-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- PSA Open-Zone Scale opening-position pocket list ---- */
.zone-scale > div > table {
    width: 100%;
    min-width: 0;
    margin-top: 8px;
    border-collapse: collapse;
    table-layout: auto;
}

.zone-scale > div > table td {
    padding: 3px 0;
    border-top: 1px solid #292e35;
    background: transparent;
    font-size: 14px;
    white-space: nowrap;
}

.zone-scale > div > table tr:first-child td {
    border-top: 0;
}

.zone-scale > div > table td:first-child {
    padding-right: 8px;
    color: #dce2e9;
}

.zone-scale > div > table td:last-child {
    width: 1%;
    text-align: right;
    color: #c7def5;
    font-weight: 800;
}

.zone-scale > div > table tbody tr:nth-child(even) td,
.zone-scale > div > table tbody tr:hover td {
    background: transparent;
}

.zone-scale > div > table tr.calculated-pocket-row td {
    background: #4a4019 !important;
}

/* The two-column Forecast header only stacks on narrow screens.
   The former 1050px cutoff belonged to the old side-by-side chart layout. */
@media (max-width: 760px) {
    .forecast-top-grid {
        width: 100%;
        min-width: 0;
        grid-template-columns: minmax(0, 1fr);
    }
    .forecast-top-grid > .panel {
        min-width: 0;
        max-width: 100%;
    }
    .forecast-top-grid .table-wrap {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 600px) {
    /* Current PSA_STATE labels must not impose a desktop minimum width. */
    .forecast-top-grid .metrics {
        min-width: 0;
        grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    }
    .forecast-top-grid .metrics dt,
    .forecast-top-grid .metrics dd {
        min-width: 0;
        overflow-wrap: anywhere;
    }
    /* The index table is intentionally wide and scrolls within its card. */
    .forecast-message-center {
        min-width: 0;
        max-width: 100%;
    }
    .forecast-message-center .forecast-table-wrap {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ---- Current Market Characteristics (index and forecast) ---- */
.market-conditions-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    min-width: 0;
}

.market-conditions-heading h2 {
    margin: 0 0 3px;
    font-size: 19px;
}

.market-conditions-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    min-width: 0;
}

.market-lean-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--panel2);
}

.market-lean-icon svg {
    display: block;
    width: 23px;
    height: 23px;
}

.market-lean-buyer { color: var(--green); border-color: #377448; background: var(--green-bg); }
.market-lean-seller { color: var(--red); border-color: #743236; background: var(--red-bg); }
.market-lean-mixed { color: var(--amber); border-color: #755d18; background: var(--amber-bg); }
.market-lean-unavailable { color: var(--muted); }

.market-conditions-lean,
.market-conditions-percentage {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.market-conditions-percentage { text-align: right; }
.market-conditions-percentage .market-conditions-value {
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.market-conditions-label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.market-conditions-value {
    color: var(--text);
    font-size: 21px;
    font-weight: 850;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

@media (max-width: 520px) {
    .market-conditions-summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .market-conditions-percentage {
        grid-column: 1;
        text-align: left;
    }
    .market-conditions-percentage .market-conditions-value {
        justify-content: flex-start;
    }
}


/* Forecast page: combined market conditions and ticker history beside the PSA report. */
.ticker-market-history { min-width: 0; }
.ticker-market-history-content { width: 100%; min-width: 0; }
.ticker-market-history-section h2 { font-size: 20px; margin: 4px 0 9px; }
.ticker-market-history-row {
    display: grid;
    grid-template-columns: minmax(135px, 1.15fr) minmax(90px, .8fr) minmax(105px, .9fr) auto;
    gap: 10px;
    align-items: center;
    border-top: 1px solid var(--line);
    padding: 7px 0;
    font-size: 14px;
}
.ticker-market-history-row strong:last-child { text-align: right; font-size: 15px; }
.ticker-market-history .hint { margin: 8px 0 0; }

/* Separate the $1 and Hybrid market-lean outcome summaries. */
.ticker-market-history-divider {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 18px 0 16px;
}
@media (max-width: 650px) {
    .ticker-market-history-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 3px 10px;
    }
    .ticker-market-history-row strong:first-child { grid-column: 1; grid-row: 1; }
    .ticker-market-history-row strong:last-child { grid-column: 2; grid-row: 1; }
}
/* Keep the seven-column history results table usable on smaller screens. */
.table-wrap table.price-band-history-pivot { min-width: 820px; }
.price-band-history-pivot .pivot-yes { color: #70d38d; font-weight: 850; }
.price-band-history-pivot .pivot-no { color: #ffd56a; font-weight: 850; }

.ticker-market-history .market-condition-date {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 14px;
}
.ticker-market-history-section {
    border-top: 1px solid var(--line);
    margin-top: 17px;
    padding-top: 15px;
}
.forecast-characteristics-full { grid-column: 1 / -1; }


/* =========================================================
   PSA MORNING RULES — decision discipline reference page
   ========================================================= */
.rules-page { min-width: 0; }
.rules-intro {
    background: linear-gradient(135deg, #1e2a35, #141a21);
    border: 1px solid #34506a;
    border-radius: 13px;
    padding: 23px 26px;
    margin-bottom: 16px;
}
.rules-kicker {
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 14px;
    font-weight: 850;
}
.rules-intro h2 {
    margin: 7px 0 8px;
    font-size: clamp(24px, 3.3vw, 34px);
    line-height: 1.18;
}
.rules-intro p {
    margin: 0;
    max-width: 800px;
    color: #c5d2de;
    font-size: 14px;
}
.rules-mantra {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 15px;
    border: 1px solid #855f19;
    border-radius: 9px;
    color: var(--amber);
    background: #302711;
    font-size: 16px;
    font-weight: 900;
}
.rules-content {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr);
    gap: 16px;
    align-items: start;
}
.rules-column, .rules-aside { min-width: 0; }
.rules-section-title {
    font-size: 19px;
    margin: 8px 0 13px;
}
.rules-card {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 13px;
    padding: 17px 18px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--panel);
    margin-bottom: 11px;
}
.rules-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 10px;
    border: 1px solid #365575;
    background: #1c2e40;
    color: #acd5fa;
    font-weight: 900;
}
.rules-card h3 { margin: 1px 0 7px; font-size: 16px; line-height: 1.3; }
.rules-card p { margin: 0 0 8px; color: #e0e5ec; }
.rules-card p:last-child { margin-bottom: 0; }
.rules-card ul { margin: 7px 0 8px; padding-left: 18px; color: #e0e5ec; }
.rules-card li { margin-bottom: 5px; }
.rules-card strong { color: #edf2f8; }
.rules-aside .panel { margin-bottom: 13px; }
.rules-checklist h2, .rules-reflection h2 { font-size: 18px; margin: 0 0 7px; }
.rules-aside-intro { color: var(--muted); margin: 0 0 13px; font-size: 14px; }
.rules-check-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid #2a2f36;
    font-weight: 650;
    color: var(--text);
    cursor: pointer;
}
.rules-check-item input[type='checkbox'] {
    min-width: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin: 1px 0 0;
    accent-color: #70d38d;
}
.rules-check-item span { min-width: 0; }
.rules-gate {
    border-left: 4px solid var(--amber);
    background: #242014;
    padding: 12px 13px;
    border-radius: 0 8px 8px 0;
    font-weight: 850;
    margin-top: 15px;
}
.rules-reflection p { margin: 7px 0; color: #e0e5ec; }
.rules-reflection .rules-question {
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.4;
}
.rules-footnote {
    color: var(--muted);
    font-size: 14px;
    margin: 16px 0 4px;
}
@media (max-width: 980px) {
    .rules-content { grid-template-columns: minmax(0, 1fr); }
    .rules-aside { order: -1; }
}
@media (max-width: 600px) {
    .rules-intro { padding: 17px; }
    .rules-card { padding: 13px; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
    .rules-number { width: 30px; height: 30px; }
    .rules-mantra { font-size: 14px; }
}
@media print {
    .rules-page { color: black; }
    .rules-aside { order: 0; }
    .rules-intro, .rules-card, .rules-aside .panel { break-inside: avoid; }
}

/* Five-Day Price & Pressure: fits beneath the market-history card. */
.forecast-side-stack { display: grid; gap: 16px; min-width: 0; align-content: start; }
.forecast-side-stack .ticker-market-history { margin-bottom: 0; }
.five-day-pressure { min-width: 0; margin-bottom: 0; padding: 15px 18px; }
.five-day-pressure h2 { font-size: 19px; margin: 0 0 4px; }
.five-day-pressure h3 { font-size: 15px; margin: 12px 0 4px; }
/* On-demand study uses the existing PSA panel appearance in a native modal. */
.directional-pressure-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.directional-studies-link { padding: 0; border: 0; background: transparent; color: var(--blue); font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.directional-studies-link:hover { color: #bbdcff; }
.directional-studies-link:focus-visible, .directional-study-close:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.directional-study-modal { width: min(1060px, calc(100vw - 32px)); max-width: 1060px; max-height: calc(100vh - 36px); margin: auto; overflow: auto; color: var(--text); box-shadow: 0 20px 60px #000b; }
.directional-study-modal::backdrop { background: #05070bc9; }
.directional-study-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.directional-study-heading h3 { margin: 0 0 10px; font-size: 18px; }
.directional-study-close { flex-shrink: 0; background: var(--panel2); border: 1px solid var(--line); color: var(--text); padding: 6px 10px; }
.directional-study-modal .hint { margin: 0 0 12px; }
.directional-study-modal .table-wrap { max-width: 100%; }
.directional-study-modal table { min-width: 900px; }
.directional-study-modal th:not(:first-child), .directional-study-modal td:not(:first-child) { text-align: right; }
.directional-study-secondary { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.directional-study-secondary h3 { margin: 0 0 10px; font-size: 18px; }
.five-day-pressure .hint { margin: 0 0 8px; }
/* Chart height comes from the SVG drawing coordinates (356px total, 300px plot).
   Do not clamp it to the old 210px cap, or the SVG and y-axis become compressed. */
.pressure-chart { display: block; width: 100%; height: auto; max-height: none; overflow: visible; }
.pressure-key { display: flex; flex-wrap: wrap; gap: 7px 16px; margin: 8px 0 1px; color: #c8d6e5; font-size: 14px; }
.pressure-key span { display: inline-flex; gap: 6px; align-items: center; }
.pressure-key span::before { content: ''; display: inline-block; width: 16px; border-top: 3px solid; }
.pressure-price-key::before { border-color: #568fff !important; }
.pressure-gap-key::before { border-color: #cbd7e3 !important; border-top-style: dashed !important; }
.pressure-eff-key::before { border-color: var(--move-efficiency) !important; }
.pressure-breadth-key::before { border-color: var(--market-breadth) !important; }
.pressure-data-table { min-width: 0; }
.pressure-data-table h2 { font-size: 18px; }
.pressure-data-table .table-wrap { max-width: 100%; }
.pressure-data-table table { min-width: 1130px; font-size: 14px; }
.pressure-data-table .hint { margin: 9px 0 0; }
@media (max-width: 600px) {
    .five-day-pressure { padding: 12px; }
    .pressure-key { gap: 5px 12px; }
}

/* Five-day activity: actual share volume and trade counts, with separate raw axes. */
.five-day-activity { min-width: 0; margin-bottom: 0; padding: 15px 18px; }
.five-day-activity h2 { font-size: 19px; margin: 0 0 4px; }
.five-day-activity .hint { margin: 0 0 8px; }
.five-day-activity .activity-measure + .activity-measure {
    border-top: 1px solid var(--line);
    margin-top: 12px;
    padding-top: 9px;
}
.activity-volume-key::before { border-color: #70b2fa !important; }
.activity-trades-key::before { border-color: #f7c366 !important; }
.activity-range-key::before { border-color: #c0a0ff !important; }
.activity-push-up-key::before { border-color: #63df7a !important; }
.activity-push-down-key::before { border-color: #ff7373 !important; }
@media (max-width: 600px) {
    .five-day-activity { padding: 12px; }
}



/* Shared time window for characteristics table, charts and historical overlays. */
.chart-view-controls {
    display: flex; align-items: end; flex-wrap: wrap; gap: 12px 20px;
    margin: 5px 0 14px; padding: 4px 0 13px;
    border-bottom: 1px solid var(--line);
}
.chart-view-controls label { gap: 8px; min-width: 0; }
.chart-view-controls select { min-width: 185px; max-width: 100%; }
.chart-view-controls .hint { padding-bottom: 7px; }
.pressure-chart-scroller {
    width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden;
    overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
    scrollbar-color: #50647c #171a20;
}
.pressure-chart-scroller:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 600px) {
    .chart-view-controls { align-items: stretch; flex-direction: column; gap: 8px; }
    .chart-view-controls select { width: 100%; }
    .chart-view-controls .hint { padding-bottom: 0; }
}

/* Top Forecast cards remain side by side; historical table and charts span the content width. */
.forecast-left-stack { display: grid; align-content: start; gap: 16px; min-width: 0; }
.forecast-left-stack > #baseline { margin-bottom: 0; align-self: start; min-width: 0; }
.forecast-left-stack > .volume-trade-history { margin-bottom: 0; }
/* The historical table and each chart panel occupy one full-width row. */
.forecast-analysis-stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-top: 16px;
    margin-bottom: 16px;
    min-width: 0;
}
.forecast-analysis-stack > * { min-width: 0; margin-bottom: 0; }
/* Match the 16px column gutter between every top-level Forecast card.
   Grid gap supplies the spacing; legacy card bottom margins must not add to it. */
.forecast-left-stack > *,
.forecast-side-stack > * { margin-bottom: 0; }

/* Native collapsible panels: keyboard accessible, independent, initially expanded. */
.five-day-collapsible { min-width: 0; }
.five-day-collapsible > .five-day-toggle {
    display: flex; align-items: center; gap: 9px;
    list-style: none; cursor: pointer; margin: 0 0 8px;
    font-size: 19px; font-weight: 750; line-height: 1.3; color: var(--text);
}
.five-day-collapsible > .five-day-toggle::-webkit-details-marker { display: none; }
.five-day-collapsible > .five-day-toggle::before {
    content: '▸'; color: var(--blue); font-size: 17px;
    display: inline-block; transform-origin: center; transition: transform .15s ease;
}
.five-day-collapsible[open] > .five-day-toggle::before { transform: rotate(90deg); }
.five-day-collapsible:not([open]) > .five-day-toggle { margin-bottom: 0; }
.five-day-collapsible > .five-day-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

/* Keep all 12 columns with horizontal scrolling inside the full-width table card. */
.forecast-analysis-stack .pressure-data-table .table-wrap {
    display: block; width: 100%; max-width: 100%; min-width: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.forecast-analysis-stack .pressure-data-table table { min-width: 1130px; }
.forecast-analysis-stack .pressure-data-table :is(th,td):first-child {
    position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line);
}
.forecast-analysis-stack .pressure-data-table th:first-child { background: #292e37; z-index: 2; }
.forecast-analysis-stack .pressure-data-table td:first-child { background: var(--panel); }
.forecast-analysis-stack .pressure-data-table tbody tr:nth-child(even) td:first-child { background: #191d23; }
.forecast-analysis-stack .pressure-data-table tbody tr:hover td:first-child { background: #242a32; }

/* Historical table row selects a five-session dashed overlay on existing charts. */
.price-band-history-pivot tr[data-reference-date] { cursor: pointer; }
.price-band-history-pivot .historical-reference-date {
    background: none; color: var(--blue); padding: 0; font: inherit;
    border: 0; border-radius: 0; text-decoration: underline;
}
.price-band-history-pivot .historical-reference-date:focus-visible { outline: 2px solid var(--blue); }
.price-band-history-pivot tr.is-overlay-selected > td { background: #1b2b3a; }
/* Compare the displayed market lean/breadth to existing next-day history rows. */
.historical-market-match-status {
    margin: 12px 0;
    padding: 9px 12px;
    border: 1px solid rgba(64, 201, 208, .43);
    border-radius: 8px;
    background: rgba(64, 201, 208, .075);
    line-height: 1.5;
}
.price-band-history-pivot tbody tr.is-market-match > td {
    background: rgba(64, 201, 208, .14);
}
.price-band-history-pivot tbody tr.is-market-match > td:first-child {
    box-shadow: inset 4px 0 0 var(--market-breadth);
}
.price-band-history-pivot tbody tr.is-market-match:hover > td {
    background: rgba(64, 201, 208, .22);
}
/* Keep the existing overlay selection visible, including on matching rows. */
.price-band-history-pivot tbody tr.is-overlay-selected > td {
    background: #1b2b3a;
}
.price-band-history-pivot tbody tr.is-overlay-selected:hover > td {
    background: #25405a;
}



/* PSA Help & Research — scoped to the reference page only. */
.psa-guide { max-width: 1460px; margin: 0 auto; }
.guide-hero { display: flex; justify-content: space-between; align-items: center; gap: 24px;
    padding: 30px 34px; margin: 0 0 14px; border-radius: 13px;
    background: radial-gradient(circle at 90% 10%,#20394e 0,transparent 32%),linear-gradient(120deg,#1b2939,#151b24 70%);
    border: 1px solid #375168; }
.guide-hero h1 { margin: 4px 0 8px; font-size: clamp(30px,3.5vw,43px); letter-spacing: -.035em; }
.guide-hero h1 span { color: #78baff; }
.guide-hero p { color: #bfcbd8; font-size: 14px; max-width: 660px; margin: 0; }
.guide-hero-badge { display: grid; text-align: right; gap: 3px; min-width: 168px; }
.guide-hero-badge span { color: #91bde7; font-size: 14px; font-weight: 900; letter-spacing: .2em; }
.guide-hero-badge strong { color: #edf5ff; font-size: 18px; }
.guide-hero-badge small { color: #9daebf; }
.guide-nav { position: sticky; top: 0; z-index: 17; display: flex; flex-wrap: wrap; gap: 8px;
    padding: 12px 0; margin-bottom: 11px; background: linear-gradient(#0f1115 85%,transparent); }
.guide-nav a { color: #c9dcf0; text-decoration: none; padding: 8px 13px;
    font-size: 14px; font-weight: 750; border-radius: 8px; background: #172330; border: 1px solid #354b62; }
.guide-nav a:hover, .guide-nav a:focus-visible { background: #20374c; color: white; }
.guide-section { margin: 18px 0; padding: 22px; background: #171a20; border: 1px solid #343944; border-radius: 12px; scroll-margin-top: 80px; }
.guide-section-heading { display: flex; align-items: start; gap: 14px; margin-bottom: 19px; }
.guide-index { color: #70a9e2; font-size: 14px; font-weight: 900; padding: 7px 10px; background: #192a3a;
    border: 1px solid #34516b; border-radius: 8px; }
.guide-section-heading h2 { margin: 0 0 3px; font-size: 21px; }
.guide-section-heading p { margin: 0; font-size: 14px; color: #ccd8e4; }
.guide-principles { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.guide-principle, .guide-chart-card { background: #111820; border: 1px solid #303c49; border-radius: 9px; padding: 16px; min-width: 0; }
.guide-principle h3, .guide-chart-card h3 { font-size: 15px; margin: 9px 0 8px; }
.guide-principle p, .guide-chart-card p { margin: 0; color: #d9e2ea; line-height: 1.6; font-size: 14px; }
.guide-pill { display: inline-flex; align-items: center; padding: 4px 8px; border: 1px solid; border-radius: 999px;
    font-size: 14px; letter-spacing: .065em; font-weight: 900; white-space: nowrap; }
.guide-established { color: #9cdbba; border-color: #345f49; background: #183027; }
.guide-experimental { color: #f3d68d; border-color: #6a5429; background: #332a18; }
.guide-observation { color: #afcfff; border-color: #45608d; background: #1a2c44; }
.guide-terms { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 9px; }
.guide-term { border: 1px solid #323f4d; border-radius: 9px; background: #121820; min-width: 0; }
.guide-term summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    cursor: pointer; padding: 14px 15px; font-size: 14px; font-weight: 850; color: #e5edf5; }
.guide-term summary::-webkit-details-marker { display: none; }
.guide-term summary::before { content: '▸'; color: #79b8ff; font-weight: 900; }
.guide-term[open] summary::before { content: '▾'; }
.guide-term summary span { margin-left: auto; color: #c6d5e4; font-size: 14px; font-weight: 650; white-space: nowrap; }
.guide-term summary:hover { background: #1b2936; }
.guide-term summary:focus-visible { outline: 2px solid #79b8ff; outline-offset: 3px; }
.guide-term-body { padding: 0 15px 15px; border-top: 1px solid #2f3a46; }
.guide-term-body p { margin: 10px 0 0; color: #d9e2ea; line-height: 1.6; font-size: 14px; }
.guide-term-body strong { color: #e2edf8; }
.guide-formula { color: #a2d7ff; background: #152635; border-left: 3px solid #6aaaf4;
    font-weight: 800; font-size: 14px; margin-top: 12px; padding: 10px 12px; }
.guide-chart-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.guide-chart-card h3 { margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.guide-chart-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--dot); flex: none; }
.guide-fineprint { padding: 10px 13px; border-left: 3px solid #476b8a; color: #adbfce;
    font-size: 14px; margin: 14px 0 0; background: #131b24; }
.guide-status-key { display: flex; flex-wrap: wrap; gap: 7px 10px; align-items: center; color: #9eacbc;
    padding: 11px 13px; background: #111820; border-radius: 8px; font-size: 14px; margin-bottom: 11px; }
.guide-studies { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.guide-study { padding: 18px; border-radius: 9px; border: 1px solid #303c49; background: #131920; }
.guide-study-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.guide-study-label { font-size: 14px; color: #cad5e0; letter-spacing: .035em; }
.guide-study h3 { font-size: 15px; margin: 13px 0 8px; color: #ebf1f7; }
.guide-study p { font-size: 14px; line-height: 1.6; color: #d6e0e8; margin: 0 0 9px; }
.guide-study .guide-study-note { padding-top: 9px; margin: 9px 0 0; border-top: 1px solid #2d3944; color: #a5bed1; }
.guide-study-note strong { color: #cddfed; }
.guide-footer { padding: 12px 10px 28px; color: #c6d1dd; font-size: 14px; text-align: center; }
@media (max-width: 900px) { .guide-principles { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .guide-hero { padding: 20px; align-items: start; flex-direction: column; }
    .guide-hero-badge { text-align: left; }
    .guide-section { padding: 14px; }
    .guide-terms, .guide-chart-grid, .guide-studies { grid-template-columns: 1fr; }
    .guide-term summary span { white-space: normal; }
    .guide-nav { position: static; }
}
.guide-dot-price { background: #568fff; }
.guide-dot-activity { background: #f7c366; }
.guide-dot-range { background: #c0a0ff; }
.guide-dot-overlay { background: #a8b8cb; }

/* PSA authentication: header logout, login form, and compact mobile layout. */
.psa-logout-form { margin: 0; }
.psa-logout-button { cursor: pointer; font: inherit; font-weight: 700; }
.psa-login-wrap { min-height: 85vh; display: grid; place-items: center; padding: 24px; }
.psa-login-card { width: min(100%, 440px); padding: 30px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 20px 60px #0004; }
.psa-login-card h1 { margin: 8px 0 6px; font-size: 28px; }
.psa-login-card p { color: var(--muted); }
.psa-login-card form { display: grid; gap: 16px; margin-top: 20px; }
.psa-login-card input { width: 100%; min-width: 0; }
.psa-login-card button { width: 100%; }
.psa-login-error { color: var(--red) !important; }

/* The full-width Historical Characteristics table scrolls within its own panel
   for long chart windows, independent of the chart panel heights. */
.forecast-analysis-stack > .pressure-data-table .table-wrap {
    max-height: min(70vh, 720px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-color: #50647c #171a20;
}
.forecast-analysis-stack > .pressure-data-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}
.forecast-analysis-stack > .pressure-data-table thead th:first-child {
    z-index: 4;
}


/* Historical Order Geometry: same next-day population as the results library. */
.order-geometry-panel { grid-column: 1 / -1; min-width: 0; }
.order-geometry-summary { display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 9px; list-style: none; cursor: pointer; color: var(--text);
    font-weight: 850; font-size: 19px; }
.order-geometry-summary::-webkit-details-marker { display: none; }
.order-geometry-summary::before { content: '▸'; color: var(--blue); margin-right: 2px; }
.order-geometry-panel[open] .order-geometry-summary::before { content: '▾'; }
.order-geometry-summary > span:first-child { flex: 1; }
.order-geometry-toggle { border: 1px solid #375a78; border-radius: 7px; padding: 6px 11px;
    background: #26394c; color: #c7def5; font-size: 14px; }
.order-geometry-hide { display: none; }
.order-geometry-panel[open] .order-geometry-show { display: none; }
.order-geometry-panel[open] .order-geometry-hide { display: inline; }
.order-geometry-summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.order-geometry-intro { margin: 13px 0 12px; }
.order-geometry-context { display: flex; flex-wrap: wrap; gap: 8px; margin: 11px 0 15px; }
.order-geometry-context span { padding: 6px 9px; border: 1px solid #34495e;
    background: #121f2b; color: #aec6dc; font-size: 14px; border-radius: 7px; }
.order-geometry-context strong { color: var(--text); margin-left: 5px; overflow-wrap: anywhere; }
.order-geometry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.order-geometry-card { background: #1c2129; border: 1px solid #384351;
    padding: 15px; border-radius: 10px; min-width: 0; }
.order-geometry-card-head { display: flex; flex-wrap: wrap; justify-content: space-between;
    align-items: start; gap: 10px; }
.order-geometry-card-head h3 { margin: 0; font-size: 17px; }
.order-geometry-card-head h3 span { color: var(--blue); }
.order-geometry-card-head p { margin: 4px 0 12px; color: var(--muted); font-size: 14px; }
.order-geometry-count { padding: 5px 9px; white-space: nowrap; border-radius: 7px;
    color: #d0eaff; background: #142a3d; border: 1px solid #345b7a; font-size: 14px; font-weight: 850; }
.order-geometry-caution, .order-geometry-info { border: 1px solid #70592f;
    background: #30281b; color: #f1d18b; border-radius: 8px;
    padding: 11px 12px; font-size: 14px; line-height: 1.5; }
.order-geometry-info { background: #152635; color: #b4d8f0; border-color: #345672; }
.order-geometry-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 12px 0; }
.order-geometry-metrics > div { background: #12171e; border: 1px solid #303b48; border-radius: 8px; padding: 11px 12px; }
.order-geometry-metrics span { display: block; color: var(--muted); font-size: 14px; }
.order-geometry-metrics strong { display: block; color: var(--text); font-size: 24px; margin-top: 4px; }
.order-geometry-detail { display: grid; grid-template-columns: minmax(0, 1fr) auto;
    gap: 11px; margin: 14px 0 0; padding-top: 13px; border-top: 1px solid var(--line); font-size: 14px; }
.order-geometry-detail dt { color: #c2cfdd; }
.order-geometry-detail dd { margin: 0; color: var(--text); text-align: right; font-weight: 750; }
.order-geometry-observations { display: grid; gap: 8px; margin: 12px 0; }
.order-geometry-observation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px; border: 1px solid #303b48; background: #12171e; border-radius: 8px; padding: 10px; font-size: 14px; }
.order-geometry-observation-date { grid-column: 1 / -1; color: #afcfff; font-weight: 800; }
.order-geometry-observation strong { color: var(--text); }
.order-geometry-review { width: 100%; padding: 12px 0 1px; background: transparent;
    text-align: left; color: #9ac6ed; border-radius: 0; border-top: 1px solid var(--line);
    margin-top: 15px; font-size: 14px; font-weight: 650; }
.order-geometry-review:hover { color: #d7ecff; }
.order-geometry-review:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.order-geometry-disclaimer { color: var(--muted) !important; margin: 14px 0 0; font-size: 14px; }
.geometry-history-filter { display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: 10px; border: 1px solid #345672;
    border-radius: 8px; background: #142738; color: #cee2f5;
    padding: 8px 11px; margin: 11px 0; font-size: 14px; }
.geometry-history-filter[hidden], .price-band-history-pivot tr[hidden] { display: none !important; }
.geometry-history-filter button { background: #305273; color: white; padding: 7px 10px; }
@media (max-width: 900px) { .order-geometry-grid { grid-template-columns: 1fr; } }
@media (max-width: 420px) {
    .order-geometry-card { padding: 12px; }
    .order-geometry-metrics strong { font-size: 20px; }
    .order-geometry-detail { grid-template-columns: 1fr; gap: 3px; }
    .order-geometry-detail dd { text-align: left; margin-bottom: 8px; }
    .order-geometry-observation { grid-template-columns: 1fr; }
}

/* YTD same-$10-opening-band reference averages: distinct dashed keys and lines. */
.pressure-key .band-average-key {
    color: #c8d6e5;
    font-variant-numeric: tabular-nums;
}
.pressure-key .band-average-key::before {
    width: 20px;
    border-top-width: 2px;
    border-top-style: dashed;
    opacity: .9;
}
.band-average-efficiency::before { border-color: var(--move-efficiency) !important; }
.band-average-volume::before { border-color: #70b2fa !important; }
.band-average-trades::before { border-color: #f7c366 !important; }
.band-average-range::before { border-color: #c0a0ff !important; }
.band-average-push-up::before { border-color: #63df7a !important; }
.band-average-push-down::before { border-color: #ff7373 !important; }
.activity-pull-up-key::before { border-color: #40c9d0 !important; }
.activity-pull-down-key::before { border-color: #f7c366 !important; }
.band-average-pull-up::before { border-color: #40c9d0 !important; }
.band-average-pull-down::before { border-color: #f7c366 !important; }
.band-average-scope { line-height: 1.45; }

/* Keep each Range/Push/Pull label together with its YTD reference value. */
#range-geometry .range-average-legend { gap: 8px 20px; }
#range-geometry .range-average-pair {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 3px 12px; max-width: 100%;
}


/* --- Market-lean evidence: distinguish exact setup, price band, and ticker-wide history. --- */
.market-lean-asof { font-size: 14px; line-height: 1.5; color: #d8e2ec; margin: 5px 0 13px !important; }
.market-lean-tier-list { display: grid; gap: 9px; margin-top: 13px; }
.market-lean-tier { min-width: 0; border: 1px solid #344251; border-radius: 9px; background: #111820; overflow: hidden; }
.market-lean-tier[open] { border-color: #46627c; }
.market-lean-tier-header { cursor: pointer; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 11px 12px; background: #1a2530; }
.market-lean-tier-header:hover { background: #22303d; }
.market-lean-tier-header:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
.market-lean-tier-number { display: inline-grid; place-items: center; border-radius: 6px; width: 22px; height: 22px; background: #264765; color: #c6e4ff; font-weight: 850; }
.market-lean-tier-title { font-size: 14px; font-weight: 850; color: #e3edf6; }
.market-lean-tier-count { color: #bcd2e4; font-size: 14px; font-weight: 800; white-space: nowrap; }
.market-lean-tier-body { padding: 11px 12px 12px; }
.market-lean-population { color: #c5d4e0 !important; font-size: 14px; margin: 0 0 11px !important; overflow-wrap: anywhere; }
.market-lean-table-scroll { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #34404d; border-radius: 7px; }
.market-lean-table-scroll .market-lean-result-table { width: 100%; min-width: 515px; table-layout: auto; border-collapse: collapse; font-size: 14px; }
.market-lean-result-table th, .market-lean-result-table td { padding: 9px 8px; white-space: normal; vertical-align: middle; }
.market-lean-result-table thead th { font-size: 14px; background: #27303a; color: #c5d7e7; }
.market-lean-result-table tbody th { text-align: left; color: #e1eaf2; white-space: nowrap; }
.market-lean-result-table tbody td:nth-child(2) { text-align: center; font-weight: 850; }
.market-lean-result-table tbody td strong { display: block; font-variant-numeric: tabular-nums; font-size: 14px; }
.market-lean-result-table tbody td small { display: block; color: #cbd5e0; white-space: nowrap; font-size: 14px; }
.market-lean-result-table tbody tr.market-lean-highlight > * { background: #203348; }
.market-lean-no-history { color: var(--amber); font-size: 14px; font-weight: 800; white-space: nowrap !important; }
.market-lean-tier-note { color: #cbd8e5 !important; font-size: 14px; line-height: 1.5; margin: 10px 0 0 !important; }
.market-lean-explainer { color: #cbd5e0 !important; margin: 13px 0 0 !important; font-size: 14px; line-height: 1.55; }
@media (max-width: 650px) {
    .market-lean-tier-header { grid-template-columns: 22px minmax(0, 1fr); }
    .market-lean-tier-count { grid-column: 2; white-space: normal; }
    .market-lean-tier-body { padding: 9px; }
}


/* Yahoo Finance RSS headlines for the Forecast page's selected ticker. */
.ticker-news { min-width: 0; }
.ticker-news h2 { margin-bottom: 4px; }
.ticker-news-list { display: grid; gap: 0; max-height: 460px; overflow-y: auto; }
.ticker-news-item { padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.ticker-news-item:first-child { border-top: 0; }
.ticker-news-title { font-size: 16px; line-height: 1.45; margin: 0 0 4px; }
.ticker-news-title a { color: var(--blue); text-decoration: none; }
.ticker-news-title a:hover, .ticker-news-title a:focus-visible { text-decoration: underline; }
.ticker-news-date { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.ticker-news-description { margin: 0 !important; color: #e0e5ec; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.ticker-news-source { display: inline-block; margin-bottom: 5px; padding: 2px 7px; border: 1px solid #39516a; border-radius: 5px; color: #bddcff; background: #1a2b3b; font-size: 14px; font-weight: 850; letter-spacing: .02em; }
.ticker-news-sec { border-color: #5b553b; color: #f0d898; background: #302a1b; }
.ticker-news-filing { border-left: 2px solid #776a46; padding-left: 10px; }

/* The News card occupies the same visual row and height as Ticker Daily Report.
   Its article list scrolls independently so no results are hidden or omitted.
   On narrow screens the header cards stack naturally instead. */
@media (min-width: 761px) {
    .forecast-top-grid:has(> .forecast-left-stack) {
        grid-template-rows: auto auto;
    }
    .forecast-top-grid > .forecast-left-stack {
        grid-column: 1;
        grid-row: 1 / span 2;
        grid-template-rows: subgrid;
    }
    .forecast-top-grid > .forecast-side-stack {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        min-height: 0;
        contain: size; /* News content must not increase the report's row height. */
    }
    .forecast-side-stack > .ticker-news {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }
    .ticker-news .ticker-news-list {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
        align-content: start;
        overscroll-behavior-y: contain;
        scrollbar-color: #50647c #171a20;
    }
}

/* --- PSA high-readability typography (site-wide) ---
   White primary text and high-contrast silver descriptions; retain the PSA blue
   and the existing positive/negative chart and status colors. */
small { font-size: 14px; }
.metrics dt { color: #d2dae4; }
.metrics dd { color: var(--text); }
.pressure-chart text { font-size: 14px !important; }
.pressure-chart .pressure-y-label,
.pressure-chart text[fill="#a8b8cb"] { fill: #cbd7e3; }
/* Links stay distinctly blue and recognizable in the brighter interface. */
a:focus-visible, button:focus-visible, select:focus-visible,
input:focus-visible, summary:focus-visible { outline-color: var(--blue); }
/* Do not compress text as the selected News card scrolls alongside the report. */
.ticker-news-description { color: #e0e5ec; }

/* On narrow Forecast screens, match the visual reading order to the operator's workflow:
   Ticker Daily Report → News → Current Market Characteristics → full-width analysis.
   Keep the desktop two-column layout and its equal-height News alignment unchanged. */
@media (max-width: 760px) {
    .forecast-top-grid:has(> .forecast-left-stack) {
        gap: 16px;
    }
    .forecast-top-grid > .forecast-left-stack,
    .forecast-top-grid > .forecast-side-stack {
        display: contents;
    }
    .forecast-top-grid #baseline { order: 1; }
    .forecast-top-grid #ticker-news { order: 2; }
    .forecast-top-grid .ticker-market-history { order: 3; }
}

/* Consolidated as-of historical studies (all source studies remain intact). */
.historical-study-summary { margin: 16px 0; }
.study-summary-conditions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 12px 0 15px;
}
.study-summary-conditions > span {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 7px 10px;
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    font-size: 14px;
}
.study-summary-conditions strong { color: var(--text); }
.study-summary-table-wrap { max-width: 100%; }
.study-summary-table { min-width: 880px; }
.study-summary-table :is(th, td) { vertical-align: top; white-space: normal; }
.study-summary-table th:first-child { min-width: 210px; }
.study-summary-table small {
    display: block;
    font-weight: 500;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
    margin-top: 3px;
}
.study-summary-rate strong { color: var(--blue); font-size: 16px; }
.historical-study-summary .study-summary-note { margin-bottom: 0; }
@media (max-width: 760px) {
    .study-summary-conditions { gap: 6px; }
    .study-summary-conditions > span { padding: 6px 8px; }
}


/* === Daily Analysis blue visual system ===
   Reuse the Market Lean evidence palette without altering any study logic,
   chart series colors, global page rules, or mobile content ordering. */

/* Cohesive blue outlines on the Forecast page only. */
.forecast-top-grid #baseline,
.forecast-top-grid #ticker-news,
.historical-study-summary,
.forecast-analysis-stack > .panel,
#characteristics,
#order-geometry {
    border-color: #36516a;
}

/* Make the primary text-section headings read like the Market Lean tier header. */
.forecast-top-grid #baseline > h2,
.forecast-top-grid #ticker-news > h2,
#characteristics > h2 {
    margin: -16px -16px 14px;
    padding: 12px 16px;
    background: #1a2530;
    border-bottom: 1px solid #3c5b78;
    border-radius: 11px 11px 0 0;
    box-shadow: inset 3px 0 0 var(--blue);
    color: #edf5ff;
    font-size: 19px;
    line-height: 1.35;
}

/* Align the Market Characteristics card and header with the neighboring panels. */
.ticker-market-history { padding: 16px; }
.ticker-market-history .market-conditions-heading {
    margin: -16px -16px 14px;
    padding: 12px 16px;
    background: #1a2530;
    border-bottom: 1px solid #3c5b78;
    border-radius: 11px 11px 0 0;
    box-shadow: inset 3px 0 0 var(--blue);
}
.ticker-market-history .market-conditions-heading h2 {
    margin: 0;
    color: #edf5ff;
}

/* Full-width table and chart headers; preserve the existing collapse controls. */
.forecast-analysis-stack > .five-day-collapsible > .five-day-toggle {
    margin: -15px -18px 14px;
    padding: 12px 18px;
    background: #1a2530;
    border-bottom: 1px solid #3c5b78;
    border-radius: 11px 11px 0 0;
    box-shadow: inset 3px 0 0 var(--blue);
    color: #edf5ff;
}
.forecast-analysis-stack > .five-day-collapsible:not([open]) > .five-day-toggle {
    margin-bottom: -15px;
    border-radius: 11px;
    border-bottom-color: transparent;
}
@media (max-width: 600px) {
    .forecast-analysis-stack > .five-day-collapsible > .five-day-toggle {
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Highlight the currently selected (last) session in the scrolling daily history. */
.forecast-analysis-stack > .pressure-data-table tbody tr:last-child > :is(td, th) {
    background: #203348;
}
.forecast-analysis-stack > .pressure-data-table tbody tr:last-child > td:first-child {
    background: #203348;
}
.forecast-analysis-stack > .pressure-data-table thead th,
#characteristics .price-band-history-pivot thead th {
    background: #273544;
    color: #dfedfa;
}

/* Same blue header treatment for the collapsible Historical Order Geometry. */
#order-geometry > .order-geometry-summary {
    margin: -16px -16px 14px;
    padding: 12px 16px;
    background: #1a2530;
    border-bottom: 1px solid #3c5b78;
    border-radius: 11px 11px 0 0;
    box-shadow: inset 3px 0 0 var(--blue);
}
#order-geometry:not([open]) > .order-geometry-summary {
    margin-bottom: -16px;
    border-radius: 11px;
    border-bottom-color: transparent;
}

/* Match the Market Lean blue cards, badges and focus-row treatment in the new summary. */
.historical-study-summary .study-summary-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 9px 16px;
    margin: -16px -16px 13px;
    padding: 13px 16px;
    background: #1a2530;
    border-bottom: 1px solid #3c5b78;
    border-radius: 11px 11px 0 0;
    box-shadow: inset 3px 0 0 var(--blue);
}
.historical-study-summary .study-summary-heading .eyebrow {
    font-size: 12px;
    letter-spacing: .08em;
}
.historical-study-summary .study-summary-heading h2 {
    margin: 3px 0 0;
    color: #edf5ff;
    font-size: 20px;
}
.historical-study-summary .study-summary-total {
    padding: 5px 11px;
    border: 1px solid #3e6383;
    border-radius: 20px;
    background: #264765;
    color: #d7edff;
    font-size: 14px;
    font-weight: 850;
    white-space: nowrap;
}
.historical-study-summary > .hint:first-of-type { margin: 0 0 12px; }
.historical-study-summary .study-summary-conditions {
    margin: 12px 0 16px;
}
.historical-study-summary .study-summary-conditions > span {
    background: #142535;
    border-color: #365675;
    color: #d0e1f2;
}
.historical-study-summary .study-summary-conditions strong {
    color: #f3f9ff;
}
.study-summary-tier-list { display: grid; gap: 9px; }
.study-summary-tier .market-lean-tier-body { padding: 12px; }
.study-summary-tier .market-lean-population { margin: 0 0 10px !important; }
.study-summary-result-table { min-width: 590px !important; }
.study-summary-result-table :is(th, td) {
    padding: 11px 12px;
    vertical-align: top;
    white-space: normal;
    overflow-wrap: anywhere;
}
.study-summary-result-table thead th { color: #d7e8f8; }
.study-summary-result-table tbody th {
    width: 27%;
    min-width: 150px;
    font-weight: 850;
}
.study-summary-result-table tbody td:nth-child(2) {
    text-align: left;
    font-weight: 500;
}
.study-summary-result-table .study-summary-rate {
    width: 25%;
    color: #dcecfb;
    white-space: nowrap;
}
.study-summary-result-table .study-summary-rate strong {
    display: inline;
    color: #a6d3ff;
    font-size: 17px;
    font-variant-numeric: tabular-nums;
}
.study-summary-result-table .study-summary-rate small {
    display: inline;
    margin-left: 8px;
    color: #d2deea;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    white-space: nowrap;
}
.historical-study-summary .study-summary-note {
    margin: 14px 0 0;
    line-height: 1.55;
}

/* The on-demand studies share the same presentation when opened. */
.directional-study-modal > .directional-study-heading {
    margin: -16px -16px 14px;
    padding: 12px 16px;
    background: #1a2530;
    border-bottom: 1px solid #3c5b78;
    border-radius: 11px 11px 0 0;
    box-shadow: inset 3px 0 0 var(--blue);
}
.directional-study-modal > .directional-study-heading h3 { color: #edf5ff; }
.directional-study-modal thead th { background: #273544; color: #dfedfa; }

@media (max-width: 650px) {
    .historical-study-summary .study-summary-heading { align-items: flex-start; }
    .study-summary-tier .market-lean-tier-body { padding: 9px; }
    .study-summary-result-table { min-width: 520px !important; }
    .study-summary-result-table :is(th, td) { padding: 9px; }
}
@media (max-width: 600px) {
    .forecast-analysis-stack > .five-day-collapsible > .five-day-toggle {
        margin-top: -12px;
    }
    .forecast-analysis-stack > .five-day-collapsible:not([open]) > .five-day-toggle {
        margin-bottom: -12px;
    }
}

/* === Home page: match the Daily Analysis blue card treatment. ===
   Scope these rules to the index so forecast/study layouts stay unchanged. */
.home-top-grid { margin-bottom: 16px; }
.home-top-grid > .home-panel { margin-bottom: 0; }
.home-panel { border-color: #36516a; min-width: 0; }
.home-panel > .home-panel-heading {
    display: block;
    margin: -16px -16px 14px;
    padding: 12px 16px;
    background: #1a2530;
    border-bottom: 1px solid #3c5b78;
    border-radius: 11px 11px 0 0;
    box-shadow: inset 3px 0 0 var(--blue);
}
.home-panel > .home-panel-heading h2 {
    margin: 0;
    color: #edf5ff;
    font-size: 19px;
    line-height: 1.35;
}
.home-panel > .home-panel-intro { margin: 0 0 16px; }
.home-panel.home-market-card { justify-content: flex-start; gap: 0; }
.home-opportunity-table-wrap {
    border: 1px solid #36516a;
    border-radius: 9px;
}
.home-opportunity-table-wrap table { min-width: 1400px; }
.home-opportunity-table-wrap thead th {
    background: #273544;
    color: #dfedfa;
}

/* Home Market Characteristics: independent per-state counts below stored lean. */
.home-market-resolution {
    margin-top: 16px;
    padding-top: 13px;
    border-top: 1px solid #36516a;
}
.home-resolution-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-bottom: 10px;
}
.home-resolution-heading h3 { margin: 0; color: #d7eaff; font-size: 16px; }
.home-resolution-heading span { color: var(--muted); font-size: 13px; }
.home-resolution-rows { display: grid; gap: 5px; }
.home-resolution-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 10px;
    background: #121c27;
    border: 1px solid #2d4054;
    border-radius: 7px;
    font-size: 14px;
    line-height: 1.4;
}
.home-resolution-row strong { font-variant-numeric: tabular-nums; color: #f4f7fb; }
.home-resolution-strong-seller, .home-resolution-weak-seller { border-left: 3px solid #bf6c70; }
.home-resolution-midzone-chop { border-left: 3px solid #d6ba67; }
.home-resolution-weak-buyer, .home-resolution-strong-buyer { border-left: 3px solid #64bb89; }
.home-resolution-total { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.home-resolution-total strong { color: var(--text); font-variant-numeric: tabular-nums; }
.home-resolution-empty { margin: 0 !important; }

/* Home ticker card only: use its existing empty height for the market observation. */
.home-ticker-card { display: flex; flex-direction: column; }
.home-ticker-quote {
    margin: auto 8px 2px;
    padding: 12px 10px 0;
    border-top: 1px solid #31465b;
    color: var(--blue);
    font-size: 14px;
    font-style: italic;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
}
/* When the cards stack or become cramped, there is no spare card space. */
@media (max-width: 1000px) {
    .home-ticker-quote { display: none; }
}

/* Business Profile — informational only; no Daily Analysis layout changes. */
.business-profile-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    border-color: #36516a;
    background: linear-gradient(135deg, #202c3a, #151a21);
}
.business-profile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 112px;
    width: 112px;
    height: 90px;
    background: #f4f7fb;
    border-radius: 9px;
    padding: 10px;
}
.business-profile-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.business-profile-headline { min-width: 0; }
.business-profile-headline h2 {
    color: var(--text);
    margin: 4px 0 5px;
    font-size: clamp(21px, 2.1vw, 27px);
    line-height: 1.25;
}
.business-profile-headline p { margin: 0; color: #d9e5f1; font-size: 16px; }
.business-profile-panel { border-color: #36516a; }
.business-profile-panel > h2 {
    margin: -16px -16px 15px;
    padding: 12px 16px;
    background: #1a2530;
    border-bottom: 1px solid #3c5b78;
    border-radius: 11px 11px 0 0;
    box-shadow: inset 3px 0 0 var(--blue);
    color: #edf5ff;
    font-size: 19px;
}
.business-profile-facts {
    display: grid;
    grid-template-columns: minmax(145px, 0.8fr) minmax(0, 1.2fr);
    margin: 0;
}
.business-profile-facts dt,
.business-profile-facts dd {
    margin: 0;
    padding: 10px 8px;
    border-bottom: 1px solid #2f3945;
    line-height: 1.45;
}
.business-profile-facts dt { color: #d2e0ed; font-weight: 700; }
.business-profile-facts dd { color: var(--text); font-weight: 650; overflow-wrap: anywhere; }
.business-profile-description {
    color: var(--text) !important;
    white-space: pre-line;
    line-height: 1.7;
    margin: 0;
    font-size: 16px;
}
.business-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.business-profile-grid > .panel { margin-bottom: 0; min-width: 0; }
.business-profile-link { color: #a9d2ff; text-underline-offset: 3px; }
.business-profile-link:hover { color: #fff; }
.business-profile-updated { color: #cbd4de; font-size: 14px; line-height: 1.55; margin: 15px 0 0; }
.business-profile-updated strong { color: var(--text); }
.business-profile-unavailable { margin-top: 4px; }
.business-profile-unavailable > h2 { margin: 8px 0; padding: 0; background: none; border: 0; box-shadow: none; }
.business-profile-unavailable p { margin-bottom: 0; }
@media (max-width: 820px) {
    .business-profile-grid { grid-template-columns: minmax(0, 1fr); }
    .business-profile-grid > .panel { margin-bottom: 0; }
}
@media (max-width: 520px) {
    .business-profile-hero { align-items: flex-start; flex-direction: column; gap: 12px; }
    .business-profile-logo { width: 100px; height: 80px; flex: 0 0 auto; }
    .business-profile-facts { grid-template-columns: minmax(115px, 0.8fr) minmax(0, 1.2fr); }
    .business-profile-facts dt, .business-profile-facts dd { padding: 9px 5px; }
}


/* ---- SEC Filings Guide: read-only reference library ---- */
.sec-guide-hero { padding: 22px 24px; }
.sec-guide-hero h2 { margin: 4px 0 8px; font-size: clamp(23px, 2.2vw, 30px); }
.sec-guide-hero p { max-width: 900px; margin: 6px 0; line-height: 1.55; }
.sec-guide-hero-note { color: var(--muted) !important; }
.sec-guide-tools label { margin-bottom: 8px; color: var(--text); }
#sec-guide-search { width: 100%; max-width: 650px; font-size: 16px; min-width: 0; }
.sec-guide-tools .hint { margin: 8px 0 12px; }
.sec-guide-jumps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sec-guide-jumps a { color: #c7def5; background: #182432; border: 1px solid #34495e; border-radius: 8px; padding: 7px 10px; text-decoration: none; font-weight: 700; }
.sec-guide-jumps a:hover, .sec-guide-jumps a:focus-visible { border-color: var(--blue); }
.sec-guide-section { padding: 0; overflow: hidden; scroll-margin-top: 84px; }
.sec-guide-section[hidden], .sec-guide-no-results[hidden] { display: none !important; }
.sec-guide-section-summary { display: flex; align-items: center; gap: 13px; padding: 16px 18px; cursor: pointer; list-style: none; background: #20252e; }
.sec-guide-section-summary::-webkit-details-marker { display: none; }
.sec-guide-section-summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
.sec-guide-index { display: inline-grid; place-items: center; flex: 0 0 auto; width: 34px; height: 30px; border-radius: 7px; background: #17283a; color: var(--blue); font-weight: 850; }
.sec-guide-section-title { font-size: clamp(16px, 1.45vw, 19px); font-weight: 850; line-height: 1.35; }
.sec-guide-chevron { margin-left: auto; color: var(--blue); font-size: 22px; transition: transform .15s ease; }
.sec-guide-section[open] .sec-guide-chevron { transform: rotate(180deg); }
.sec-guide-section-body { padding: 17px 20px 22px; }
.sec-guide-section-body h3 { margin: 23px 0 9px; font-size: 17px; color: var(--blue); }
.sec-guide-section-body h3:first-child { margin-top: 0; }
.sec-guide-section-body p { line-height: 1.65; margin: 10px 0 14px; }
.sec-guide-section-body a { color: var(--blue); overflow-wrap: anywhere; }
.sec-guide-bullets { padding-left: 22px; margin: 10px 0 17px; line-height: 1.65; }
.sec-guide-bullets li + li { margin-top: 7px; }
.sec-guide-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; margin: 12px 0 18px; }
.sec-guide-table { min-width: 680px; width: 100%; font-size: 14px; }
.sec-guide-table th, .sec-guide-table td { white-space: normal; vertical-align: top; line-height: 1.55; padding: 10px 12px; }
.sec-guide-table th { color: #e9f4ff; }
.sec-guide-table td:first-child { color: var(--blue); font-weight: 750; }
.sec-guide-callout { margin: 16px 0; padding: 13px 16px; border-left: 4px solid var(--blue); background: #172432; border-radius: 0 8px 8px 0; }
.sec-guide-callout strong { color: var(--blue); font-size: 14px; letter-spacing: .05em; }
.sec-guide-callout p { margin: 6px 0 0; }
.sec-guide-small-note { color: var(--muted) !important; font-size: 14px; }
.sec-guide-source-link { margin-bottom: 2px !important; font-weight: 750; }
.sec-guide-source-link + .sec-guide-small-note { margin-top: 2px; margin-bottom: 14px; }
.sec-guide-step { padding: 8px 12px; border-left: 2px solid #355371; background: #141d27; border-radius: 0 6px 6px 0; }
.sec-guide-no-results { color: var(--muted); }
@media (max-width: 600px) {
    .sec-guide-hero { padding: 16px; }
    .sec-guide-section-summary { padding: 12px; gap: 9px; }
    .sec-guide-section-body { padding: 14px; }
    .sec-guide-table { min-width: 590px; }
    .sec-guide-jumps a { font-size: 14px; }
}
