/* The Securities page's price chart (SecurityPriceChart.razor + wwwroot/js/security-chart.js): the canvas tokens the
   script reads (--scx-*, light and dark), the chart toolbar (Inspect / Measure, layers, zoom, image, full screen), the
   stage, the glass reading island with its notch, tiles and footer, the hint toast, the full-screen layout and the
   narrow-width folds (a container query on the chart, so it folds by its own width, not the window's). Every color is
   an --iv-* token or derived from one. */

.scx {
    --scx-up: var(--iv-candle-up, #26A69A);
    --scx-down: var(--iv-candle-down, #EF5350);
    --scx-gain: var(--iv-positive, #16A34A);
    --scx-loss: var(--iv-negative, #DC2626);
    --scx-sma50: var(--iv-slice-4, #F59E0B);
    --scx-sma200: var(--iv-accent, #6D5DF6);
    --scx-grid: var(--iv-tile-border, #E4E9EF);
    --scx-axis: var(--iv-muted, #565973);
    --scx-text: var(--iv-text, #0B0F19);
    --scx-muted: var(--iv-muted, #565973);
    --scx-cross: #64748B;
    --scx-tag-bg: #1E293B;
    --scx-tag-text: #FFFFFF;
    --scx-you: var(--iv-you, #2563EB);
    --scx-surface: #FFFFFF;
    --scx-nav: #F2F6F4;
    --scx-nav-line: #5E8F7A;
    --scx-focus: var(--iv-green, #0B6E4F);
    --scx-export-bg: #FFFFFF;
    --scx-full-bg: #FCFDFD;
    --scx-font: var(--tx-font, system-ui, sans-serif);

    --scx-glass-1: rgba(255, 255, 255, .82);
    --scx-glass-2: rgba(236, 247, 241, .70);
    --scx-glass-3: rgba(255, 255, 255, .60);
    --scx-glass-line: rgba(255, 255, 255, .90);
    --scx-glass-edge: rgba(11, 110, 79, .14);
    --scx-glass-hi: rgba(255, 255, 255, 1);
    --scx-notch-bg: rgba(246, 251, 248, .94);
    --scx-tile: rgba(255, 255, 255, .62);
    --scx-tile-line: rgba(15, 23, 42, .06);
    --scx-seg-pill: #FFFFFF;

    container: scx / inline-size;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

[data-bs-theme="dark"] .scx {
    --scx-cross: #94A3B8;
    --scx-tag-bg: #E2E8F0;
    --scx-tag-text: #0B0F19;
    --scx-surface: #10131C;
    --scx-nav: rgba(255, 255, 255, .035);
    --scx-nav-line: #6CC79F;
    --scx-export-bg: #0B0F19;
    --scx-full-bg: #0B0F19;

    --scx-glass-1: rgba(34, 42, 62, .74);
    --scx-glass-2: rgba(10, 46, 34, .64);
    --scx-glass-3: rgba(16, 19, 28, .60);
    --scx-glass-line: rgba(255, 255, 255, .11);
    --scx-glass-edge: rgba(46, 173, 120, .26);
    --scx-glass-hi: rgba(255, 255, 255, .16);
    --scx-notch-bg: rgba(20, 34, 36, .92);
    --scx-tile: rgba(255, 255, 255, .045);
    --scx-tile-line: rgba(255, 255, 255, .07);
    --scx-seg-pill: rgba(46, 173, 120, .22);
}

/* ------------------------------------------------------------------ Bar: legend and toolbar */

.scx-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
    min-width: 0;
}

.scx-legend { flex: 1 1 240px; margin: 0; }
.ivs-overlay-cost { width: 14px; height: 0; border-radius: 0; border-top: 2px dashed var(--scx-you); background: none; }

.scx-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}

.scx-seg,
.scx-group {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--iv-tile-border);
    border-radius: 12px;
    background: var(--iv-range-bg);
}

.scx-seg {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.scx-seg-glider {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    z-index: 0;
    width: calc(50% - 3px);
    border-radius: 9px;
    background: var(--scx-seg-pill);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--iv-green) 30%, transparent);
    transition: transform .34s cubic-bezier(.3, 1.35, .5, 1);
}

.scx[data-scx-current="measure"] .scx-seg-glider { transform: translateX(100%); }

.scx-seg-btn,
.scx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    height: 30px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--iv-muted);
    font-family: var(--tx-font);
    font-size: var(--ci-fs-btn-xs, 12px);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.scx-seg-btn { position: relative; z-index: 1; min-width: 92px; padding: 0 12px; }
.scx-seg-btn .fa-solid { font-size: 12px; }
.scx-seg-btn.is-on { color: var(--iv-text); }
.scx-seg-btn.is-on .fa-solid { color: var(--iv-icon); }
.scx-seg-btn:hover:not(.is-on) { color: var(--iv-text); }

.scx-btn { min-width: 30px; padding: 0 9px; }
.scx-btn .fa-solid { font-size: 12px; }
.scx-btn:hover:not(:disabled) { color: var(--iv-text); background: var(--iv-neutral-soft); }
.scx-btn.is-on { color: var(--iv-icon); background: var(--scx-seg-pill); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--iv-green) 30%, transparent); }
.scx-btn:disabled { opacity: .38; cursor: default; }
.scx-btn-full .scx-when-full,
.scx.is-full .scx-btn-full .scx-when-normal { display: none; }
.scx.is-full .scx-btn-full .scx-when-full { display: inline; }

.scx-seg-btn:focus-visible,
.scx-btn:focus-visible,
.scx-isl-btn:focus-visible { outline: 2px solid var(--iv-focus); outline-offset: 2px; }

/* ------------------------------------------------------------------ Stage */

.scx-stage {
    position: relative;
    height: 480px;
    border-radius: 14px;
    overflow: hidden;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.scx-stage.has-volume { height: 560px; }

.scx-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
    touch-action: pan-y;
    transition: opacity .2s ease, filter .2s ease;
}

.scx-canvas:focus-visible { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--iv-focus) 55%, transparent); border-radius: 14px; }
.scx.is-loading .scx-canvas { opacity: .5; filter: saturate(.6); }
.scx-stage .ivs-chart-spinner { z-index: 5; }

/* ------------------------------------------------------------------ The glass island */

.scx-island {
    --scx-tone: var(--scx-gain);
    position: absolute;
    top: 10px;
    left: 8px;
    z-index: 3;
    box-sizing: border-box;
    width: min(calc(100% - 16px), 1180px);
    padding: 12px 14px 10px;
    border: 1px solid var(--scx-glass-line);
    border-radius: 20px;
    color: var(--iv-text);
    background:
        radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--scx-tone) 20%, transparent) 0%, transparent 52%),
        radial-gradient(90% 120% at 100% 100%, color-mix(in srgb, var(--scx-tone) 9%, transparent) 0%, transparent 60%),
        linear-gradient(135deg, var(--scx-glass-1) 0%, var(--scx-glass-2) 55%, var(--scx-glass-3) 100%);
    box-shadow: inset 0 1px 0 var(--scx-glass-hi), inset 0 0 0 1px var(--scx-glass-edge);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    backdrop-filter: blur(20px) saturate(170%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-12px) scale(.97);
    transform-origin: var(--scx-notch, 50%) 100%;
    transition: opacity .18s ease, transform .3s cubic-bezier(.2, .9, .25, 1.15), left .12s ease-out, visibility 0s linear .3s;
}

.scx-island[data-tone="down"] { --scx-tone: var(--scx-loss); }
.scx-island[data-tone="flat"] { --scx-tone: var(--scx-muted); }

.scx-island.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .2s ease, transform .36s cubic-bezier(.2, .9, .25, 1.15), left .12s ease-out, visibility 0s;
}

.scx-island.is-open.is-measure { pointer-events: auto; }

/* The top sheen and the notch pointing at the bar being read (or the middle of the measured stretch). */
.scx-island::before {
    content: "";
    position: absolute;
    top: 0;
    left: 22px;
    right: 22px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--scx-glass-hi), transparent);
    pointer-events: none;
}

.scx-island::after {
    content: "";
    position: absolute;
    bottom: -7px;
    left: var(--scx-notch, 50%);
    width: 13px;
    height: 13px;
    margin-left: -6.5px;
    border-right: 1px solid var(--scx-glass-line);
    border-bottom: 1px solid var(--scx-glass-line);
    border-bottom-right-radius: 4px;
    background: var(--scx-notch-bg);
    transform: rotate(45deg);
    transition: left .12s ease-out;
}

.scx-isl-head { display: flex; align-items: center; gap: 12px; min-width: 0; }

.scx-isl-badge {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--ci-icon-pill);
    color: var(--scx-tone);
    font-size: 15px;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--scx-tone) 24%, transparent);
}

.scx-isl-titles { display: flex; flex: 1 1 auto; flex-direction: column; gap: 3px; min-width: 0; }
.scx-isl-title { overflow: hidden; font-family: var(--tx-font); font-size: 14.5px; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.scx-isl-arrow { margin: 0 3px; color: var(--iv-muted); font-size: 11px; }
.scx-narrow { display: none; }
.scx-isl-sub { overflow: hidden; color: var(--iv-muted); font-size: 11.5px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }

.scx-isl-figure { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.scx-isl-figure-text { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.scx-isl-price { font-family: var(--tx-font); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1; }
.scx-isl-price.tone-up { color: var(--scx-gain); }
.scx-isl-price.tone-down { color: var(--scx-loss); }

.scx-candle { flex: 0 0 auto; width: 14px; height: 40px; }
.scx-candle line { stroke: currentColor; stroke-width: 1.4; }
.scx-candle rect { fill: currentColor; }
.scx-candle.is-up { color: var(--scx-up); }
.scx-candle.is-down { color: var(--scx-down); }

.scx-chip {
    --scx-chip: var(--scx-muted);
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    padding: 3px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--scx-chip) 15%, transparent);
    color: var(--scx-chip);
    font-family: var(--tx-font);
    font-size: 11.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    white-space: nowrap;
}

.scx-chip.tone-up { --scx-chip: var(--scx-gain); }
.scx-chip.tone-down { --scx-chip: var(--scx-loss); }
.scx-chip .fa-solid { font-size: 10.5px; }
.scx-chip-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .55; }

.scx-tiles {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
    margin-top: 11px;
}

.scx-tile {
    --scx-ico: var(--iv-muted);
    display: flex;
    align-items: flex-start;
    gap: 7px;
    min-width: 0;
    padding: 8px 8px 7px;
    border: 1px solid var(--scx-tile-line);
    border-radius: 12px;
    background: var(--scx-tile);
}

.scx-tile.tone-up { --scx-ico: var(--scx-gain); }
.scx-tile.tone-down { --scx-ico: var(--scx-loss); }
.scx-tile.tone-sma50 { --scx-ico: var(--scx-sma50); }
.scx-tile.tone-sma200 { --scx-ico: var(--scx-sma200); }
.scx-tile.tone-you { --scx-ico: var(--scx-you); }

.scx-tile-ico {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: var(--ci-icon-pill);
    color: var(--scx-ico);
    font-size: 10.5px;
}

.scx-tile-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.scx-tile-label,
.scx-tile-value,
.scx-tile-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scx-tile-label { color: var(--iv-muted); font-family: var(--tx-font); font-size: 9.5px; font-weight: 700; letter-spacing: .06em; line-height: 1.25; text-transform: uppercase; }
.scx-tile-value { color: var(--iv-text); font-family: var(--tx-font); font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.scx-tile-sub { color: var(--iv-muted); font-size: 10.5px; line-height: 1.25; }

.scx-isl-foot {
    display: flex;
    align-items: center;
    gap: 8px 14px;
    min-height: 28px;
    margin-top: 9px;
    overflow: hidden;
    color: var(--iv-muted);
    font-size: 12px;
}

.scx-foot-item { display: inline-flex; flex: 0 1 auto; align-items: center; gap: .4rem; min-width: 0; overflow: hidden; white-space: nowrap; }
.scx-foot-item .fa-solid { color: var(--iv-muted); font-size: 11px; }
.scx-foot-item b { color: var(--iv-text); font-weight: 700; font-variant-numeric: tabular-nums; }
.scx-foot-item.tone-up b,
.scx-foot-item.tone-up .fa-solid { color: var(--scx-gain); }
.scx-foot-item.tone-down b,
.scx-foot-item.tone-down .fa-solid { color: var(--scx-loss); }

.scx-trade {
    display: inline-flex;
    flex: 0 1 auto;
    align-items: center;
    gap: .38rem;
    min-width: 0;
    max-width: 340px;
    padding: 3px 10px;
    overflow: hidden;
    border-radius: 999px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scx-trade.is-buy { background: color-mix(in srgb, var(--scx-up) 15%, transparent); color: var(--scx-up); }
.scx-trade.is-sell { background: color-mix(in srgb, var(--scx-down) 15%, transparent); color: var(--scx-down); }

.scx-foot-hint { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; margin-left: auto; font-size: 11px; white-space: nowrap; }

.scx kbd {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 1px solid var(--iv-tile-border);
    border-radius: 5px;
    background: var(--iv-pill);
    box-shadow: inset 0 -1px 0 var(--iv-tile-border);
    color: var(--iv-text);
    font-family: var(--tx-font);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.scx kbd .fa-solid { font-size: 8.5px; color: inherit; }

.scx-isl-actions { display: inline-flex; flex: 0 0 auto; gap: 6px; margin-left: auto; }

.scx-isl-btn {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    height: 28px;
    padding: 0 12px;
    border: 1px solid color-mix(in srgb, var(--scx-tone) 45%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--scx-tone) 14%, transparent);
    color: var(--scx-tone);
    font-family: var(--tx-font);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease;
}

.scx-isl-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--scx-tone) 24%, transparent); }
.scx-isl-btn.is-quiet { justify-content: center; width: 28px; padding: 0; border-color: var(--scx-tile-line); background: var(--scx-tile); color: var(--iv-muted); }
.scx-isl-btn.is-quiet:hover { color: var(--iv-text); }
.scx-isl-btn:disabled { opacity: .45; cursor: default; }

/* ------------------------------------------------------------------ Toast and footnote */

.scx-toast {
    position: absolute;
    bottom: 60px;
    left: 50%;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    max-width: calc(100% - 24px);
    padding: 8px 15px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--scx-tag-bg) 90%, transparent);
    color: var(--scx-tag-text);
    font-family: var(--tx-font);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 10px);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: opacity .2s ease, transform .28s cubic-bezier(.2, .9, .25, 1.2);
}

.scx-toast .fa-solid { color: var(--iv-green-bright); }
.scx-toast > span { overflow: hidden; text-overflow: ellipsis; }
.scx-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.scx-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0; color: var(--iv-muted); font-size: 11.5px; }
.scx-foot > span { display: inline-flex; align-items: center; gap: 5px; }
.scx-foot .fa-solid { color: var(--iv-icon); font-size: 11px; }

/* ------------------------------------------------------------------ Full screen */

html.scx-lock,
html.scx-lock body { overflow: hidden; }

.scx.is-full {
    position: fixed;
    inset: 0;
    z-index: 2000;
    padding: 18px 22px 14px;
    overflow: auto;
    background: var(--scx-full-bg);
}

.scx:fullscreen { padding: 18px 22px 14px; background: var(--scx-full-bg); }
.scx::backdrop { background: var(--scx-full-bg); }

.scx.is-full .scx-stage,
.scx:fullscreen .scx-stage { flex: 1 1 auto; height: auto; min-height: 320px; }

/* ------------------------------------------------------------------ Narrow charts */

@container scx (max-width: 1080px) {
    .scx-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@container scx (max-width: 820px) {
    .scx-btn-label { display: none; }
    .scx-toolbar { width: 100%; justify-content: flex-start; margin-left: 0; }
}

@container scx (max-width: 560px) {
    .scx-stage { height: 420px; }
    .scx-stage.has-volume { height: 480px; }
    .scx-seg-btn { min-width: 0; padding: 0 10px; }
    .scx-island { padding: 10px 10px 8px; border-radius: 16px; }
    .scx-isl-badge { width: 32px; height: 32px; border-radius: 10px; font-size: 13px; }
    .scx-isl-title { font-size: 13px; }
    .scx-wide { display: none; }
    .scx-narrow { display: inline; }
    .scx-isl-price { font-size: 18px; }
    .scx-candle { display: none; }
    .scx-tiles { gap: 4px; margin-top: 8px; }
    .scx-tile { padding: 6px 6px 5px; border-radius: 10px; }
    .scx-tile-ico,
    .scx-tile-sub { display: none; }
    .scx-tile-label { font-size: 8.5px; letter-spacing: .04em; }
    .scx-tile-value { font-size: 12px; }
    .scx-isl-foot { flex-wrap: wrap; row-gap: 6px; margin-top: 7px; overflow: visible; font-size: 11px; }
    .scx-foot-hint,
    .scx-isl-btn span { display: none; }
    .scx-isl-btn { width: 28px; justify-content: center; padding: 0; }
    .scx-foot { display: none; }
}

@media (hover: none), (pointer: coarse) {
    .scx-seg-btn,
    .scx-btn { height: 38px; }
    .scx-btn { min-width: 38px; }
    .scx-foot-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .scx-island,
    .scx-island.is-open,
    .scx-island::after,
    .scx-seg-glider,
    .scx-toast,
    .scx-canvas,
    .scx-seg-btn,
    .scx-btn,
    .scx-isl-btn { transition: none; }
}

/* ------------------------------------------------------------------ Series charts (Performance: value, vs the market, compare)
   wwwroot/js/series-chart.js on the same tokens and island: the layer chips (one per line, its color as the key; a click
   shows or hides the line), pins (amber), tiles that fit however many lines there are, and the reading island taking
   clicks (its Pin button). */

.scx { --scx-pin: #D97706; }
[data-bs-theme="dark"] .scx { --scx-pin: #FBBF24; }

.scx-stage.scx-stage-value { height: 440px; }
.scx-stage.scx-stage-returns { height: 400px; }

.scx-layers { display: flex; flex: 1 1 260px; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }

.scx-layer {
    --scx-layer: var(--iv-green);
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    height: 30px;
    padding: 0 10px 0 9px;
    border: 1px solid color-mix(in srgb, var(--scx-layer) 40%, var(--iv-tile-border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--scx-layer) 10%, transparent);
    color: var(--iv-text);
    font-family: var(--tx-font);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, opacity .15s ease, border-color .15s ease;
}

.scx-layer:hover { background: color-mix(in srgb, var(--scx-layer) 18%, transparent); }
.scx-layer:focus-visible { outline: 2px solid var(--iv-focus); outline-offset: 2px; }
.scx-layer-key { width: 14px; height: 3px; border-radius: 2px; background: var(--scx-layer); }
.scx-layer.is-dash .scx-layer-key { height: 0; border-top: 2px dashed var(--scx-layer); border-radius: 0; background: none; }
.scx-layer-eye { color: var(--iv-muted); font-size: 10.5px; }
.scx-layer:not(.is-on) { border-style: dashed; border-color: var(--iv-tile-border); background: transparent; opacity: .6; }
.scx-layer:not(.is-on) > span:not(.scx-layer-key) { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--iv-muted) 60%, transparent); }

.scx-tiles.scx-tiles-fit { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }

.scx-series .scx-island.is-open.is-read { pointer-events: auto; }
.scx-isl-btn.is-pinned { --scx-tone: var(--scx-pin); }
.scx-series .scx-isl-actions + .scx-foot-hint { margin-left: 4px; }
.scx-pin-list { gap: 5px; overflow: hidden; }

.scx-pin-chip {
    height: 22px;
    padding: 0 8px;
    border: 1px solid color-mix(in srgb, var(--scx-pin) 45%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--scx-pin) 14%, transparent);
    color: var(--scx-pin);
    font-family: var(--tx-font);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.scx-pin-chip.is-quiet { border-color: var(--scx-tile-line); background: var(--scx-tile); color: var(--iv-muted); }
.scx-pin-chip:focus-visible { outline: 2px solid var(--iv-focus); outline-offset: 2px; }

.scx-pin-count {
    display: inline-grid;
    place-items: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--scx-pin);
    color: #FFFFFF;
    font-size: 9.5px;
    font-weight: 700;
}

.scx-pin-count:empty { display: none; }

@container scx (max-width: 560px) {
    .scx-stage.scx-stage-value { height: 380px; }
    .scx-stage.scx-stage-returns { height: 360px; }
    .scx-tiles.scx-tiles-fit { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
    .scx-pin-list { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .scx-layer { transition: none; }
}

/* ------------------------------------------------------------------ Underwater (series chart, unit "dd")
   The chart is upside down (the high along the top, the dips hanging under it), so the glass island opens UNDER the plot:
   it rises from the bottom edge with its notch on top pointing up at the day, and the plot lifts to make room. The
   reading leads with a sentence on why (lightbulb), then the eight tiles. */

.scx-stage.scx-stage-underwater { height: 470px; }

.scx-dd .scx-island {
    --scx-tone: var(--scx-loss);
    top: auto;
    bottom: 10px;
    transform: translateY(12px) scale(.97);
    transform-origin: var(--scx-notch, 50%) 0%;
}

.scx-dd .scx-island.is-open { transform: none; }

.scx-dd .scx-island::before { top: auto; bottom: 0; }

.scx-dd .scx-island::after {
    top: -7px;
    bottom: auto;
    border: 0;
    border-top: 1px solid var(--scx-glass-line);
    border-left: 1px solid var(--scx-glass-line);
    border-radius: 0;
    border-top-left-radius: 4px;
}

.scx-dd .scx-island[data-tone="up"] { --scx-tone: var(--scx-gain); }

.scx-isl-why {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 0 0;
    padding: 8px 11px;
    border: 1px solid color-mix(in srgb, var(--scx-tone) 26%, var(--scx-tile-line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--scx-tone) 8%, var(--scx-tile));
    color: var(--iv-text);
    font-size: 12.5px;
    line-height: 1.45;
}

.scx-isl-why .fa-solid { flex: 0 0 auto; margin-top: 3px; color: var(--scx-tone); font-size: 11.5px; }
.scx-isl-why b { font-weight: 700; font-variant-numeric: tabular-nums; }

@container scx (max-width: 560px) {
    .scx-stage.scx-stage-underwater { height: 500px; }
    .scx-isl-why { margin-top: 8px; padding: 6px 9px; font-size: 11.5px; }
}
