/* CohortMap
 *
 * Design notes, so later edits do not undo the reasoning:
 *
 * COLOUR. Long is green, short is red -- the convention every trader already
 * reads without thinking, and the default TradingView itself ships. Strength
 * is carried by shade rather than hue, so a marginal reading and a decisive
 * one are distinguishable at a glance. The exact values come from the brand
 * sheet and are the same ones the landing page uses.
 *
 * That means green cannot also mean "fresh", so FRESHNESS MOVED TO BLUE.
 * Blue is reserved the way green used to be: it appears only on the age chip
 * and means exactly one thing, that a number is current.
 *
 * COLOUR-SAFE MODE. Red and green is the pair colourblind readers can least
 * separate -- roughly 8% of men. html[data-palette="safe"] swaps green for
 * blue and keeps red, and moves the freshness chip off blue so blue still
 * means exactly one thing. Independently of the mode, colour never carries
 * meaning alone: every bar, cell and series prints its signed value or a text
 * label beside it, and the colour only confirms it.
 *
 * TYPE. One system sans across the whole product -- the same stack as the
 * landing page and the wordmark -- with monospace reserved for numbers so
 * columns align. Display voice comes from weight and tracking, not from a
 * second family: a visitor who lands on the marketing page and then opens the
 * dashboard should not feel they have changed products. All stacks are system
 * fonts: the app must run on a box with no internet, so there are no font
 * downloads.
 *
 * SIGNATURE. The age chip. Every panel states how old its data is and ticks
 * upward in real time; when it stops arriving the chip says so in words. It
 * used to also wash the panel amber -- that has been removed twice now,
 * because a coloured overlay on the numbers reads as a fault rather than a
 * warning. The chip carries it. No competitor shows this at all, and one of
 * them was frozen for eleven hours without anybody noticing.
 */

:root {
    /* Neutral black, matching the landing page exactly: a true black plane
     * with warm-grey ink over it. The earlier blue-black read as a tinted
     * theme next to the landing page, and two dark greys that are nearly the
     * same but not quite is worse than either on its own. */
    --ink: #0d0d0d;
    --panel: #131312;
    --panel-2: #1a1a19;
    --line: #2c2c2a;
    --line-soft: #212120;
    --paper: #ffffff;
    --paper-2: #c3c2b7;
    --muted: #898781;
    --muted-dim: #6b6a65;

    /* Long/short, with a lighter and darker shade of each for strength.
     * Base values are the brand sheet's dark-surface pair. */
    --long: #0ca30c;
    --long-soft: #0a6b18;
    --long-bright: #2fd42f;
    --short: #e66767;
    --short-soft: #a04444;
    --short-bright: #ff9090;

    /* Reserved for the freshness chip only. */
    --fresh: #3987e5;
    --stale: #ffa726;
    --accent: #3987e5;

    /* One typeface for the whole product, the same stack the landing page and
     * the wordmark use. The editorial serif was a nice idea and the wrong one:
     * the first thing a visitor sees is the landing page, and arriving in a
     * dashboard set in a different face reads as a different product. Weight
     * and tracking carry the display voice instead of a second family.
     * Numbers stay monospaced -- columns of figures have to align. */
    --display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --serif: var(--display);     /* kept: older rules still name it */
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;

    --gap: 20px;
    --radius: 3px;
}

/* Colour-safe: green becomes blue, red stays. Freshness gives up blue in
 * this mode and falls back to the muted ink, because two things sharing a
 * hue is exactly the confusion the mode exists to remove. */
html[data-palette="safe"] {
    --long: #3987e5;
    --long-soft: #245b9c;
    --long-bright: #6fb0ff;
    --fresh: #c3c2b7;
    --accent: #6fb0ff;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* A faint plotting grid. The product is measurement; the surface should feel
 * like graph paper, not a landing page. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(var(--line-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: .5;
}

.wrap { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 1600px; }

a { color: var(--long); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- type ------------------------------------------------------------- */
.eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted-dim);
}

h1, h2, h3 {
    font-family: var(--display); font-weight: 640;
    letter-spacing: -.02em; margin: 0;
}
h1 { font-size: clamp(34px, 5.2vw, 62px); line-height: 1.04; }
h2 { font-size: clamp(24px, 3vw, 34px); line-height: 1.15; }
h3 { font-size: 19px; }

.lede { font-size: 17px; color: var(--muted); max-width: 62ch; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--muted); }
.dimmer { color: var(--muted-dim); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }

/* --- chrome ----------------------------------------------------------- */
header.top {
    position: sticky; top: 0; z-index: 20;
    background: rgba(13, 13, 12, .88);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; gap: 22px; padding: 13px 0; }
/* The mark is the product in miniature: three positions at different prices,
 * joined in the order they were taken. Two are green, one red, so the logo
 * carries the same colour rule as every chart under it -- and it recolours
 * with the palette switch, because a logo that ignored the switch would be
 * the one green thing left on a colour-safe page. */
.brand {
    display: inline-flex; align-items: center; gap: 9px;
    font-family: var(--display); font-size: 20px; font-weight: 650;
    letter-spacing: -.02em; color: var(--paper);
}
.brand:hover { text-decoration: none; }
.brand b { font-weight: 650; }
.brand .wordmark { color: var(--paper); }
.brand .wordmark span { color: var(--long); }
.mark { display: block; flex: none; color: var(--muted); }
.mark .n-long { fill: var(--long); }
.mark .n-short { fill: var(--short); }

/* Colour-safe switch. Lives in the header on every page, so the reader who
 * needs it never has to find a settings screen first. */
.pal {
    display: inline-flex; align-items: center; gap: 5px;
    background: none; border: 1px solid var(--line); border-radius: 999px;
    padding: 4px 9px; cursor: pointer;
    font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted);
}
.pal:hover { color: var(--paper); border-color: var(--muted-dim); }
.pal .chip { width: 8px; height: 8px; border-radius: 2px; display: block; }
.pal .chip-l { background: var(--long); }
.pal .chip-s { background: var(--short); }
.top nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.top nav a { color: var(--muted); font-size: 14px; }
.top nav a:hover { color: var(--paper); text-decoration: none; }
/* The API link stays available and stops shouting: most visitors are traders
   who will never call an endpoint, and leading with it sent them away. */
.top nav a.quiet { color: var(--muted-dim); font-size: 13px; }

/* --- the signature: age chip ------------------------------------------ */
.age {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted);
    border: 1px solid var(--line); border-radius: 999px;
    padding: 3px 10px 3px 8px; white-space: nowrap;
}
.age .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--fresh); box-shadow: 0 0 0 0 rgba(76, 166, 255, .55);
    animation: pulse 2.6s ease-out infinite;
}
.age.is-stale { color: var(--stale); border-color: rgba(255, 167, 38, .45); }
.age.is-stale .dot { background: var(--stale); animation: none; }
.age.is-delayed { color: var(--muted); border-color: var(--line); }
.age.is-delayed .dot { background: var(--muted); animation: none; }

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(57, 135, 229, .5); }
    70%  { box-shadow: 0 0 0 7px rgba(57, 135, 229, 0); }
    100% { box-shadow: 0 0 0 0 rgba(57, 135, 229, 0); }
}

/* Out-of-date data is said, not decorated.
 *
 * This has been through three versions: a 45-degree amber hatch over the
 * panel, then an amber edge and border tint, now nothing at all. Each one
 * dressed the panel up to make a point the age chip was already making in
 * words -- and the chip is unambiguous where a colour wash is just something
 * odd on the screen. The class is still applied so anything that needs to
 * find a stale panel can, it simply no longer paints it. */
.panel.is-stale { position: relative; }

@media (prefers-reduced-motion: reduce) {
    .age .dot { animation: none; }
    * { transition: none !important; }
}

/* --- panels ----------------------------------------------------------- */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.panel-hd {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.panel-hd h3 { font-size: 15px; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
.panel-hd .age { margin-left: auto; }
.panel-bd { padding: 16px; }
.panel-bd.flush { padding: 0; }

/* --- tables ----------------------------------------------------------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
    font-family: var(--mono); font-size: 10.5px; font-weight: 500;
    letter-spacing: .12em; text-transform: uppercase; color: var(--muted-dim);
    text-align: right; padding: 9px 14px; border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td {
    padding: 9px 14px; text-align: right; border-bottom: 1px solid var(--line-soft);
    font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl .coin { font-weight: 600; letter-spacing: -.01em; }
.tbl .coin .dex { color: var(--muted-dim); font-size: 10px; margin-left: 5px; letter-spacing: .1em; }
.long { color: var(--long); }
.short { color: var(--short); }

/* bias bar: the table's most-read column, so it is a shape not a number */
.bias { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bias-bar {
    position: relative; width: 96px; height: 6px; border-radius: 2px;
    background: var(--line); overflow: hidden; flex: none;
}
.bias-bar i { position: absolute; top: 0; bottom: 0; display: block; }
.bias-bar .l { background: var(--long); right: 50%; }
.bias-bar .s { background: var(--short); left: 50%; }
.bias-bar::after {
    content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px;
    width: 1px; background: var(--muted-dim);
}
.bias-val { width: 40px; text-align: right; }

/* --- buttons / forms -------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--sans); font-size: 14px; font-weight: 500;
    padding: 9px 18px; border-radius: var(--radius); cursor: pointer;
    border: 1px solid var(--line); background: var(--panel-2); color: var(--paper);
    transition: background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--line); text-decoration: none; }
.btn-primary { background: var(--long); border-color: var(--long); color: #06121f; font-weight: 600; }
.btn-primary:hover { background: #6fb8ff; border-color: #6fb8ff; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--long); outline-offset: 2px;
}

input, select {
    font-family: var(--sans); font-size: 14px; color: var(--paper);
    background: var(--ink); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 8px 11px; width: 100%;
}
input:focus, select:focus { border-color: var(--long); outline: none; }
label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.field { margin-bottom: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 120px; }
.row > .narrow { flex: 0 0 110px; }

.err { color: var(--stale); font-size: 13px; margin-top: 8px; }
.ok-msg { color: var(--fresh); font-size: 13px; margin-top: 8px; }

code, kbd, pre { font-family: var(--mono); }
code { background: var(--panel-2); padding: 1.5px 5px; border-radius: 2px; font-size: 12.5px; }
pre {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.6;
    color: #cfe0f0;
}
pre .k { color: var(--long); }
pre .s { color: var(--short); }
pre .c { color: var(--muted-dim); }

/* --- landing ---------------------------------------------------------- */
.hero { padding: 68px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: 48px; align-items: start; }
.hero h1 { margin: 16px 0 20px; }
.hero h1 em { font-style: italic; color: var(--long); }
.hero-cta { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 12.5px; color: var(--muted-dim); }

.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }
.section { padding: 62px 0; }
.section-hd { max-width: 62ch; margin-bottom: 30px; }
.section-hd h2 { margin: 10px 0 12px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin-bottom: 9px; }
.card p { color: var(--muted); font-size: 14px; margin: 0; }
.card .tag {
    font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
    text-transform: uppercase; color: var(--muted-dim); display: block; margin-bottom: 12px;
}

/* the outage story -- the argument the whole product rests on */
.story { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.timeline { border-left: 1px solid var(--line); padding-left: 22px; }
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item::before {
    content: ""; position: absolute; left: -27px; top: 7px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--ink); border: 1px solid var(--muted-dim);
}
.tl-item.bad::before { background: var(--stale); border-color: var(--stale); }
.tl-item.good::before { background: var(--fresh); border-color: var(--fresh); }
.tl-t { font-family: var(--mono); font-size: 11px; color: var(--muted-dim); letter-spacing: .06em; }
.tl-item p { margin: 3px 0 0; font-size: 14px; color: var(--muted); }
.tl-item strong { color: var(--paper); font-weight: 500; }

/* --- pricing ---------------------------------------------------------- */
.prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.price {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; height: 100%;
}
.price.featured { border-color: var(--long); }
.price .amt {
    font-family: var(--display); font-size: 40px; font-weight: 640;
    line-height: 1; margin: 14px 0 4px;
}
.price .amt small { font-family: var(--mono); font-size: 12px; color: var(--muted-dim); letter-spacing: .05em; }
.price ul { list-style: none; padding: 0; margin: 18px 0; flex: 1; }
.price li { font-size: 13.5px; color: var(--muted); padding: 5px 0 5px 20px; position: relative; }
.price li::before { content: "+"; position: absolute; left: 0; color: var(--long); font-family: var(--mono); }
.price li.no { color: var(--muted-dim); }
.price li.no::before { content: "\2013"; color: var(--muted-dim); }
.price .blurb { font-size: 13.5px; color: var(--muted); min-height: 42px; }

footer.foot { border-top: 1px solid var(--line); padding: 30px 0 50px; color: var(--muted-dim); font-size: 13px; }
footer.foot a { color: var(--muted); }

/* --- dashboard -------------------------------------------------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tab {
    font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
    padding: 11px 15px; color: var(--muted-dim); cursor: pointer; background: none;
    border: none; border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--paper); }
.tab.on { color: var(--paper); border-bottom-color: var(--long); }
.view { display: none; }
.view.on { display: block; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.stack { display: flex; flex-direction: column; gap: var(--gap); }

.stat { padding: 14px 16px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat .k { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-dim); }
.stat .v { font-family: var(--mono); font-size: 21px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stats { display: flex; }

.chart { width: 100%; height: 190px; display: block; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .mid { stroke: var(--muted-dim); stroke-dasharray: 3 3; }
.chart .lbl { fill: var(--muted-dim); font-family: var(--mono); font-size: 9px; }

.zone-row { display: grid; grid-template-columns: 78px 1fr 92px; gap: 12px; align-items: center; padding: 7px 0; }
.zone-meter { height: 20px; background: var(--line-soft); border-radius: 2px; position: relative; overflow: hidden; }
.zone-meter i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--line); }
.zone-meter b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--long); opacity: .9; }
.zone-row.res .zone-meter b { background: var(--short); }
/* The at-mid bucket straddles the mid: neither side, so neither colour. */
.zone-row.mid .zone-meter b { background: var(--muted); }

.badge {
    font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
    padding: 2px 7px; border-radius: 2px; border: 1px solid var(--line); color: var(--muted);
}
.badge.conviction { color: var(--long-bright); border-color: rgba(46,189,133,.45); }
.badge.mixed { color: var(--short-bright); border-color: rgba(246,70,93,.35); }
.badge.depth { color: var(--muted-dim); }

.empty { padding: 34px 16px; text-align: center; color: var(--muted-dim); font-size: 13.5px; }
.empty strong { display: block; color: var(--muted); font-size: 14px; margin-bottom: 5px; font-weight: 500; }

.keyrow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.keyrow code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.modal-bg {
    position: fixed; inset: 0; background: rgba(4, 8, 13, .78); z-index: 50;
    display: flex; align-items: center; justify-content: center; padding: 22px;
}
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; width: 100%; max-width: 400px; }
.modal h3 { margin-bottom: 6px; }
.hide { display: none !important; }

.banner {
    background: var(--panel-2); border: 1px solid var(--line); border-left: 2px solid var(--short);
    border-radius: var(--radius); padding: 11px 15px; font-size: 13px; color: var(--muted);
    margin-bottom: var(--gap);
}
.banner b { color: var(--paper); font-weight: 500; }

/* --- responsive ------------------------------------------------------- */
@media (max-width: 940px) {
    .hero-grid, .story, .grid-2 { grid-template-columns: 1fr; }
    .cards, .prices, .grid-3 { grid-template-columns: 1fr; }
    .hero { padding: 40px 0 26px; }
    .section { padding: 44px 0; }
    .stats { flex-wrap: wrap; }
    .stat { border-right: none; border-bottom: 1px solid var(--line); flex: 1 1 50%; }
}

/* --- resolution toggle: the landing page's central argument ------------- */
.res-toggle { display: flex; gap: 2px; margin-bottom: 14px; }
.res-btn {
    flex: 1; font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
    text-transform: uppercase; padding: 7px 10px; cursor: pointer;
    background: var(--ink); color: var(--muted-dim);
    border: 1px solid var(--line); border-radius: var(--radius);
}
.res-btn:hover { color: var(--paper); }
.res-btn.on { color: var(--ink); background: var(--long); border-color: var(--long); font-weight: 600; }

.res-badge {
    display: inline-block; font-family: var(--mono); font-size: 10.5px;
    letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
    border: 1px solid var(--line); border-radius: 2px; padding: 3px 8px;
    margin-bottom: 12px;
}
.res-badge.fast { color: var(--long-bright); border-color: rgba(46,189,133,.45); }

.prices-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .prices-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .prices-4 { grid-template-columns: 1fr; } }

/* --- wallet page -------------------------------------------------------- */
.wallet-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.addr { font-family: var(--mono); font-size: 15px; word-break: break-all; }
.seg-badge {
    font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
    text-transform: uppercase; padding: 3px 9px; border-radius: 2px;
    border: 1px solid var(--line); color: var(--muted);
}
.seg-badge.profit { color: var(--long-bright); border-color: rgba(46,189,133,.45); }
.seg-badge.loss { color: var(--short-bright); border-color: rgba(246,70,93,.35); }
.seg-badge.size { color: var(--fresh); border-color: rgba(76, 166, 255, .35); }

/* liquidation proximity: closer = hotter, so it reads at a glance */
.liq { font-family: var(--mono); }
.liq.near { color: var(--short-bright); }
.liq.mid { color: var(--stale); }
.liq.far { color: var(--muted); }

/* the "get this via API" affordance on every panel */
.api-btn {
    font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
    color: var(--muted-dim); border: 1px solid var(--line); border-radius: 2px;
    padding: 2px 7px; cursor: pointer; background: none;
}
.api-btn:hover { color: var(--long); border-color: var(--long); }

.snippet {
    background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 14px; font-family: var(--mono); font-size: 12px;
    color: #cfe0f0; overflow-x: auto; white-space: pre; margin-top: 10px;
}

/* --- chart legend ------------------------------------------------------- */
.legend {
    display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px;
    font-size: 11.5px; color: var(--muted); align-items: center;
}
.legend .sw {
    display: inline-block; width: 16px; height: 9px; border-radius: 2px;
    vertical-align: -1px; margin-right: 5px;
}
.legend .sw.buy { background: var(--long); opacity: .8; }
.legend .sw.sell { background: var(--short); opacity: .8; }
.legend .sw.solid { height: 0; border-top: 2px solid var(--muted); }
.legend .sw.dashed { height: 0; border-top: 2px dashed var(--muted); }
#priceChart { cursor: crosshair; }

/* --- cohort heatmap ----------------------------------------------------- */
.tbl.heat th { padding: 8px 4px; font-size: 9px; letter-spacing: .04em; text-align: center; }
.tbl.heat th:first-child { text-align: left; padding-left: 14px; }
.tbl.heat td.cell {
    padding: 0; height: 30px; min-width: 30px;
    border-bottom: 1px solid var(--ink); border-right: 1px solid var(--ink);
}
/* The bias printed inside the cell. Quiet enough that the colour still
   carries the pattern at a glance, present enough that the grid is readable
   without relying on hue at all. */
.tbl.heat td.cell .cellv {
    display: block; text-align: center;
    font-family: var(--mono); font-size: 9.5px; line-height: 30px;
    color: var(--paper); opacity: .72;
}
/* A cell with no activity reads as a hole, not as a colour -- absent and
   balanced are different findings, and a neutral-coloured cell would merge
   them. It is the page black rather than the panel, with a dash printed in
   it, so the eye skips it instead of stopping on a texture. (It was a 45deg
   hatch; against the warm palette that came out looking brown and pulled
   more attention than an empty cell deserves.) */
.tbl.heat td.nodata { background: var(--ink); }
.tbl.heat td.nodata .cellv { color: var(--muted-dim); opacity: .5; }
/* The two cohort dimensions are separate questions, so they get a visible
   break rather than running together as one sixteen-wide band. */
.tbl.heat th.divider, .tbl.heat td.divider { border-left: 2px solid var(--muted-dim); }
.tbl.heat tbody tr:hover td.cell { outline: 1px solid var(--paper); outline-offset: -1px; }


/* --- favourites, quotas, segmented toggles ---------------------------- */
/* A star that reads as a state, not a decoration: filled means watched, and
   the same control appears on the wallet page, the leaderboard and the
   watchlist so the gesture is learned once. */
.star {
    background: none; border: 0; cursor: pointer; padding: 0 6px 0 0;
    color: var(--muted-dim); font-size: 15px; line-height: 1;
}
.star:hover { color: var(--stale); }
.star.on { color: var(--stale); }

.bell {
    background: none; border: 0; cursor: pointer; padding: 0 6px;
    color: var(--muted-dim); font-size: 14px; line-height: 1;
}
.bell:hover, .bell.on { color: var(--accent); }

.fav-name {
    background: none; border: 0; border-bottom: 1px dashed transparent;
    color: var(--paper); font: inherit; font-size: 13px; padding: 1px 0;
    max-width: 150px;
}
.fav-name:hover { border-bottom-color: var(--line); }
.fav-name:focus { outline: none; border-bottom-color: var(--accent); }
.fav-name::placeholder { color: var(--muted-dim); font-style: italic; }

/* Quota. Shown as a bar because a fraction is a shape before it is a number,
   and someone at 24 of 25 should see it without reading. */
.quota { height: 3px; background: var(--line-soft); margin: 0 16px; }
.quota i { display: block; height: 100%; background: var(--accent); }
.quota.full i { background: var(--stale); }

.seg-toggle { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg-btn {
    flex: 1; background: none; border: 0; cursor: pointer;
    padding: 8px 10px; color: var(--muted); font-family: var(--sans); font-size: 13px;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.on { background: var(--panel-2); color: var(--paper); }

.liqbar { display: inline-block; width: 70px; height: 5px; background: var(--line-soft); vertical-align: middle; margin-right: 7px; }
.liqbar i { display: block; height: 100%; background: var(--short); }
.liqbar.far i { background: var(--long-soft); }

/* Two cohort badges sit side by side on a watchlist row and ran together as
   one word. They are separate classifications and have to read as two. */
.tbl td .coin + .dex { margin-left: 7px; }
