/* indicators.css — shared component system for /trading and its indicator
   pages ("Console" direction). Loaded after style.css, which owns the nav,
   footer and the base tokens this file builds on.

   Layout rule for the indicator pages: the desktop page shows everything at
   once; below 640px the detail moves behind a tab bar and the page opens on a
   single summary screen. Panes are always in the DOM — .mpane[hidden] is only
   honoured at phone width, so desktop and search engines see the whole page. */

:root {
    --amber: #D97706;
    --amber-08: rgba(217, 119, 6, .12);
    --red: #E0483D;
    --red-08: rgba(224, 72, 61, .11);
    --blue-08: rgba(37, 99, 235, .09);
    --radius: 16px;
}

/* ── page shell ── */
.ind-wrap {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: calc(var(--nav-h) + 3rem) var(--pad-x) 5rem;
}

.ind-crumb {
    font-family: var(--ff-mono);
    font-size: .76rem;
    letter-spacing: .04em;
    color: var(--muted);
    margin-bottom: 1.1rem;
}

.ind-crumb a { color: var(--blue); }
.ind-crumb a:hover { text-decoration: underline; }

.ind-head { margin-bottom: 1.6rem; }

.ind-eyebrow {
    font-family: var(--ff-mono);
    font-size: .72rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: .8rem;
}

.ind-title {
    font-family: var(--ff-display);
    font-weight: 800;
    font-size: clamp(1.8rem, 4.4vw, 2.6rem);
    line-height: 1.06;
    letter-spacing: -.03em;
    color: var(--navy);
    text-wrap: balance;
}

.ind-sub {
    margin-top: .8rem;
    max-width: 62ch;
    color: var(--mid);
    font-size: .98rem;
}

/* ── pills ── */
.pill {
    display: inline-block;
    font-family: var(--ff-mono);
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    padding: .3rem .6rem;
    border-radius: 999px;
    white-space: nowrap;
}

.pill.pos { color: var(--emerald); background: var(--emerald-12); }
.pill.neg { color: var(--red); background: var(--red-08); }
.pill.warn { color: var(--amber); background: var(--amber-08); }
.pill.acc { color: var(--blue); background: var(--blue-08); }
.pill.mute { color: var(--muted); background: var(--navy-08); }

/* ── summary card: the one thing that must be on screen ── */
.sumcard {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 14px 34px -28px rgba(27, 42, 92, .7);
}

.sum-stripe { height: 4px; background: var(--muted); }
.sum-stripe.pos { background: var(--emerald); }
.sum-stripe.neg { background: var(--red); }
.sum-stripe.warn { background: var(--amber); }

.sum-in { padding: 1.3rem 1.5rem 1.4rem; }

.sum-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .9rem;
    flex-wrap: wrap;
}

.sum-state {
    font-family: var(--ff-display);
    font-weight: 800;
    font-size: 1.9rem;
    line-height: 1;
    letter-spacing: -.03em;
    color: var(--muted);
}

.sum-state.pos { color: var(--emerald); }
.sum-state.neg { color: var(--red); }
.sum-state.warn { color: var(--amber); }

.sum-read {
    font-size: .93rem;
    color: var(--mid);
    line-height: 1.6;
    margin-top: .7rem;
    max-width: 68ch;
}

.sum-read b { color: var(--navy); font-weight: 700; }

/* ── divergence bar: two crowds on one track ── */
.divg { margin-top: 1.2rem; }

.divg-bar {
    height: 10px;
    border-radius: 99px;
    background: var(--surface);
    position: relative;
}

.divg-span {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: 99px;
    background: var(--emerald-12);
}

.divg-span.neg { background: var(--red-08); }

.divg-mk {
    position: absolute;
    top: -5px;
    width: 4px;
    height: 20px;
    border-radius: 3px;
    margin-left: -2px;
}

.divg-mk.sm { background: var(--blue); }
.divg-mk.dm { background: var(--red); }

.divg-thr {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 1px;
    background: var(--muted);
    opacity: .5;
}

.divg-key {
    display: flex;
    justify-content: space-between;
    gap: .6rem;
    margin-top: .9rem;
    font-family: var(--ff-mono);
    font-size: .7rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

.divg-key b {
    display: block;
    font-size: 1.15rem;
    letter-spacing: -.02em;
    margin-top: .15rem;
    text-transform: none;
}

.divg-key small {
    display: block;
    font-size: .62rem;
    letter-spacing: .06em;
    color: var(--muted);
    margin-top: .1rem;
}

.divg-key .k-sm { text-align: right; }
.divg-key .k-sm b { color: var(--blue); }
.divg-key .k-dm b { color: var(--red); }
.divg-key .k-sp { text-align: center; }
.divg-key .k-sp b { color: var(--navy); }

/* ── value band: price against the premium this name normally carries ── */
.vband { margin-top: 1.3rem; }

.vbar {
    height: 30px;
    border-radius: 9px;
    overflow: hidden;
    display: flex;
    position: relative;
}

/* Zones stay quiet until the price lands in one: the band is read for "where am I
   now", so the live zone carries the colour and the other two step back. */
.vbar .z { height: 100%; transition: background .2s ease; }
.vbar .z.c { background: rgba(5, 150, 105, .05); flex: 34; }
.vbar .z.f { background: rgba(217, 119, 6, .05); flex: 33; }
.vbar .z.e { background: rgba(224, 72, 61, .05); flex: 33; }

.vband.at-c .z.c { background: rgba(5, 150, 105, .20); }
.vband.at-f .z.f { background: rgba(217, 119, 6, .20); }
.vband.at-e .z.e { background: rgba(224, 72, 61, .20); }

.vbar .mk {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 3px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: var(--navy);
}

.vbar .mk.ghost { background: var(--muted); opacity: .55; width: 2px; }

.vband.at-c .mk:not(.ghost) { background: var(--emerald); }
.vband.at-f .mk:not(.ghost) { background: var(--amber); }
.vband.at-e .mk:not(.ghost) { background: var(--red); }

/* The live price rides its own row above the bar so it can never collide with the
   cheap/expensive end labels, however far out of band the price sits. */
.vnow {
    position: relative;
    height: 1.35rem;
    margin-bottom: .1rem;
}

.vnow #vScaleMid {
    position: absolute;
    top: 0;
    white-space: nowrap;
    font-family: var(--ff-mono);
    font-size: .66rem;
    font-weight: 700;
    line-height: 1.35rem;
    padding: 0 .4rem;
    border-radius: 5px;
    color: var(--navy);
    background: rgba(15, 23, 42, .06);
}

.vband.at-c #vScaleMid { color: var(--emerald); background: var(--emerald-12); }
.vband.at-f #vScaleMid { color: var(--amber); background: var(--amber-08); }
.vband.at-e #vScaleMid { color: var(--red); background: var(--red-08); }

.vband.at-c #vScaleLo { color: var(--emerald); }
.vband.at-e #vScaleHi { color: var(--red); }

.vscale {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    font-family: var(--ff-mono);
    font-size: .66rem;
    color: var(--muted);
    margin-top: .5rem;
}


/* ── health ring + pillars ── */
.health-row {
    display: flex;
    align-items: center;
    gap: 1.3rem;
    flex-wrap: wrap;
}

.health-ring { width: 96px; height: 96px; flex: none; }
.health-ring .rv { font-family: var(--ff-mono); font-size: 1.55rem; font-weight: 700; fill: var(--navy); }
.health-ring .rl { font-family: var(--ff-mono); font-size: .55rem; letter-spacing: .14em; fill: var(--muted); }

.pillars { display: grid; gap: .55rem; flex: 1 1 260px; min-width: 0; }
.pillars[hidden] { display: none; }

.health-row .note-p { flex: 1 1 260px; min-width: 240px; margin: 0; }

.pillar {
    display: grid;
    grid-template-columns: 92px 1fr 38px;
    gap: .7rem;
    align-items: center;
    font-family: var(--ff-mono);
    font-size: .7rem;
    color: var(--muted);
}

.pillar .tr { height: 6px; border-radius: 99px; background: var(--surface); }
.pillar .tr i { display: block; height: 100%; border-radius: 99px; background: var(--blue); }
.pillar .tr i.low { background: var(--red); }
.pillar .tr i.mid { background: var(--amber); }
.pillar .tr i.hi { background: var(--emerald); }
.pillar b { color: var(--mid); font-weight: 600; text-align: right; }

/* ── panels ── */
.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 1.1rem;
    box-shadow: 0 14px 34px -28px rgba(27, 42, 92, .7);
}

.panel-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.4rem;
    border-bottom: 1px solid var(--border);
}

.panel-title { font-weight: 700; color: var(--navy); font-size: .96rem; }

.panel-note {
    font-family: var(--ff-mono);
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}

.panel-body { padding: 1.1rem 1.4rem 1.3rem; }

.chart-box { height: 300px; position: relative; }
.chart-box.osc { height: 190px; margin-top: .4rem; }

.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--muted);
    font-family: var(--ff-mono);
    font-size: .85rem;
}

.legend {
    display: flex;
    gap: 1.1rem;
    flex-wrap: wrap;
    margin-top: .8rem;
    font-size: .8rem;
    color: var(--mid);
}

.legend i {
    display: inline-block;
    width: 15px;
    height: 3px;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: .4rem;
}

.legend i.dash {
    height: 0;
    border-top: 2px dashed var(--muted);
    border-radius: 0;
}

/* ── tabs: phone-only navigation over the panes ── */
.mtabs { display: none; }

.mpane[hidden] { display: block; }   /* desktop shows every pane */

/* ── compact metric rows (phone) ── */
.mrow {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .15rem .9rem;
    padding: .8rem 0;
    border-bottom: 1px solid var(--border);
}

.mrow:last-child { border-bottom: 0; }
.mrow .mk { font-weight: 600; color: var(--navy); font-size: .93rem; }
.mrow .mv { font-family: var(--ff-mono); font-size: .92rem; color: var(--navy); text-align: right; }
.mrow .mt { grid-column: 1 / -1; font-family: var(--ff-mono); font-size: .72rem; color: var(--muted); }
.mrow .mt .g { color: var(--emerald); }
.mrow .mt .b { color: var(--red); }

/* ── notes / disclaimer ── */
.notecard {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    margin-top: 1.1rem;
}

.notecard-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.notecard h2 {
    font-family: var(--ff-mono);
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--blue);
    font-weight: 700;
}

.notecard-date { font-family: var(--ff-mono); font-size: .7rem; color: var(--muted); }
.notecard-date:is(a) { color: var(--blue); }

.note-head {
    font-family: var(--ff-display);
    font-weight: 600;
    color: var(--navy);
    font-size: clamp(.96rem, 1.8vw, 1.1rem);
    line-height: 1.6;
    margin: .9rem 0 0;
    letter-spacing: -.005em;
    padding: .95rem 1.15rem;
    background: var(--navy-08);
    border-left: 3px solid var(--blue);
    border-radius: 0 10px 10px 0;
}

.fc-note-h {
    font-family: var(--ff-mono);
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--blue);
    font-weight: 700;
    margin: 1.5rem 0 .5rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
}

.fc-note-h:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.note-p, .fc-note-p { color: var(--mid); font-size: .93rem; line-height: 1.72; margin: .7rem 0 0; }
.fc-note-h + .fc-note-p { margin-top: 0; }

.fc-note-list { color: var(--mid); font-size: .93rem; line-height: 1.7; margin: .5rem 0 0; padding-left: 1.1rem; }
.fc-note-list li { margin-bottom: .5rem; }
.fc-note-list li:last-child { margin-bottom: 0; }
.fc-note-list li::marker { color: var(--blue); }

.disc {
    margin-top: 1.1rem;
    padding: 1rem 1.2rem;
    background: var(--navy-08);
    border-radius: 12px;
    font-size: .86rem;
    color: var(--mid);
    line-height: 1.6;
}

.disc b { color: var(--navy); }

.ind-updated {
    font-family: var(--ff-mono);
    font-size: .72rem;
    color: var(--muted);
    margin-top: 1.1rem;
}

/* ══════════════ PHONE ══════════════ */
@media (max-width: 640px) {
    .ind-wrap { padding: calc(var(--nav-h) + 1.2rem) var(--pad-x) 1.8rem; }
    .ind-head { margin-bottom: 1rem; }
    .ind-title { font-size: 1.55rem; letter-spacing: -.025em; }

    /* the long explainer moves into the "How it works" pane */
    .ind-sub.long { display: none; }

    .sum-in { padding: 1rem 1.1rem 1.1rem; }
    .sum-state { font-size: 1.5rem; }
    .sum-read { font-size: .88rem; }

    .mtabs {
        display: flex;
        gap: 2px;
        overflow-x: auto;
        position: sticky;
        top: var(--nav-h);
        z-index: 6;
        margin: 1rem calc(var(--pad-x) * -1) .9rem;
        padding: .5rem var(--pad-x);
        background: var(--bg);
        border-bottom: 1px solid var(--border);
    }

    .mtabs button {
        font-family: var(--ff-body);
        font-size: .84rem;
        font-weight: 600;
        white-space: nowrap;
        background: none;
        border: 0;
        border-radius: 9px;
        padding: .42rem .8rem;
        color: var(--muted);
        cursor: pointer;
    }

    .mtabs button[aria-selected="true"] { background: var(--blue-08); color: var(--blue); }
    .mtabs button:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

    .mpane[hidden] { display: none; }
    .mpane > .panel:first-child { margin-top: 0; }

    .panel-body { padding: .9rem 1rem 1.1rem; }
    .chart-box { height: 220px; }
    .chart-box.osc { height: 150px; }

    .health-ring { width: 80px; height: 80px; }
    .pillar { grid-template-columns: 84px 1fr 34px; }

    .health-row { flex-wrap: nowrap; align-items: flex-start; }
    .health-row .note-p { flex: 1 1 auto; min-width: 0; font-size: .86rem; }

    .notecard { padding: 1.1rem 1.1rem 1.2rem; }
}
