/* ============================================================================
   fin.akv.by — финансовая аналитика курсов НБРБ
   Дизайн-система: тёмная по умолчанию, светлая по переключению.
   ========================================================================= */

:root {
    --up:        #16c79a;
    --up-soft:   rgba(22, 199, 154, .14);
    --down:      #ff5c79;
    --down-soft: rgba(255, 92, 121, .14);
    --accent:    #5b9dff;
    --accent-2:  #36e3c2;
    --gold:      #ffce6b;
    --radius:    20px;
    --radius-sm: 13px;
    --maxw:      1160px;
    --mono:      'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --sans:      'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --ease:      cubic-bezier(.22, .61, .36, 1);
}

/* ── Theme: dark ──────────────────────────────────────────────────────── */
html[data-theme='dark'] {
    --bg:        #080b12;
    --bg-2:      #0c1019;
    --surface:   rgba(255, 255, 255, .035);
    --surface-2: rgba(255, 255, 255, .055);
    --border:    rgba(255, 255, 255, .085);
    --border-2:  rgba(255, 255, 255, .14);
    --text:      #eaeef6;
    --muted:     #8d97ab;
    --faint:     #5a6379;
    --shadow:    0 24px 60px -28px rgba(0, 0, 0, .8);
    --glass:     blur(22px) saturate(140%);
    --grid:      rgba(255, 255, 255, .05);
    color-scheme: dark;
}

/* ── Theme: light ─────────────────────────────────────────────────────── */
html[data-theme='light'] {
    --bg:        #eef1f8;
    --bg-2:      #e7ebf5;
    --surface:   rgba(255, 255, 255, .8);
    --surface-2: #ffffff;
    --border:    rgba(18, 28, 54, .1);
    --border-2:  rgba(18, 28, 54, .16);
    --text:      #111827;
    --muted:     #5c6678;
    --faint:     #97a0b3;
    --shadow:    0 24px 50px -30px rgba(31, 45, 80, .35);
    --glass:     blur(20px) saturate(150%);
    --grid:      rgba(18, 28, 54, .07);
    color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    letter-spacing: -.01em;
    overflow-x: hidden;
}

/* Aurora background */
.aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(60% 50% at 12% 0%, rgba(91, 157, 255, .20), transparent 60%),
        radial-gradient(55% 45% at 92% 8%, rgba(54, 227, 194, .16), transparent 60%),
        radial-gradient(70% 60% at 70% 100%, rgba(150, 110, 255, .14), transparent 60%),
        var(--bg);
    transition: background .5s var(--ease);
}
html[data-theme='light'] .aurora {
    background:
        radial-gradient(60% 50% at 10% 0%, rgba(91, 157, 255, .22), transparent 60%),
        radial-gradient(55% 45% at 95% 6%, rgba(54, 227, 194, .20), transparent 60%),
        radial-gradient(70% 60% at 75% 100%, rgba(150, 110, 255, .14), transparent 60%),
        var(--bg);
}

::selection { background: rgba(91, 157, 255, .3); }

.num, .big, .cv-num, .cstat-val, .hchip-val, .rate-pill b, .cur-rate, input { font-variant-numeric: tabular-nums; }

/* ── Topbar ───────────────────────────────────────────────────────────── */
.topbar {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 22px 24px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-mark {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    font-size: 21px; font-weight: 800;
    border-radius: 13px;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    color: #04121a;
    box-shadow: 0 10px 26px -10px rgba(54, 227, 194, .7);
}
.brand-text strong { font-size: 18px; font-weight: 800; letter-spacing: .055em; line-height: 1.15; text-transform: uppercase; display: block; }
.brand-text .dot { color: var(--accent-2); font-weight: 700; margin: 0 .01em; }
.brand-text small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px; font-weight: 500;
    letter-spacing: .01em; line-height: 1.2;
    opacity: .9;
}

.topbar-right { display: flex; align-items: center; gap: 14px; }
.asof {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12.5px; color: var(--muted);
    padding: 8px 13px; border-radius: 100px;
    background: var(--surface); border: 1px solid var(--border);
    backdrop-filter: var(--glass);
}
.pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--up); box-shadow: 0 0 0 0 var(--up);
    animation: pulse 2.4s infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(22, 199, 154, .5); }
    70%  { box-shadow: 0 0 0 7px rgba(22, 199, 154, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 199, 154, 0); }
}

.theme-toggle {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 12px; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text); backdrop-filter: var(--glass);
    transition: transform .2s var(--ease), background .2s;
}
.theme-toggle:hover { transform: translateY(-1px); background: var(--surface-2); }
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.7; }
.theme-toggle .ic-moon { display: none; }
html[data-theme='light'] .ic-sun  { display: none; }
html[data-theme='light'] .ic-moon { display: block; }

.close-tab {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 12px; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--muted); backdrop-filter: var(--glass);
    transition: transform .2s var(--ease), background .2s, color .2s, border-color .2s;
}
.close-tab:hover {
    transform: translateY(-1px);
    color: var(--down);
    background: var(--down-soft);
    border-color: var(--down);
}
.close-tab:active { transform: translateY(0); }
.close-tab svg { fill: none; stroke: currentColor; stroke-width: 1.7; }

/* ── Tooltips (topbar tools) ──────────────────────────────────────────────
   Glassy hint dropping below top-right buttons, right-anchored so it never
   overflows the viewport edge. Shows on hover and keyboard focus. */
.has-tip { position: relative; }
/* While the tip shows, hover applies a transform → the button becomes its own
   stacking context. Lift it above the glass panels below so the tip isn't
   painted under them. */
.has-tip:hover, .has-tip:focus-visible { z-index: 100; }
.has-tip::after,
.has-tip::before {
    position: absolute;
    opacity: 0; pointer-events: none; z-index: 90;
}
.has-tip::after {
    content: attr(data-tip);
    top: calc(100% + 11px); right: 0;
    padding: 7px 11px; border-radius: 10px;
    font-family: var(--sans); font-size: 12px; font-weight: 600;
    letter-spacing: .01em; line-height: 1; white-space: nowrap;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    box-shadow: var(--shadow);
    backdrop-filter: var(--glass);
    transform: translateY(-6px);
    transition: opacity .2s var(--ease), transform .22s var(--ease);
}
.has-tip::before {
    content: '';
    top: calc(100% + 6px); right: 15px;
    width: 9px; height: 9px;
    background: var(--surface-2);
    border-left: 1px solid var(--border-2);
    border-top: 1px solid var(--border-2);
    transform: rotate(45deg);
    transition: opacity .18s var(--ease);
}
.has-tip:hover::after,
.has-tip:focus-visible::after { opacity: 1; transform: translateY(0); }
.has-tip:hover::before,
.has-tip:focus-visible::before { opacity: 1; }

/* Fade to the theme background when unwinding the tab — never a white flash */
.page-veil {
    position: fixed; inset: 0; z-index: 999;
    background: var(--bg);
    opacity: 0; pointer-events: none;
    transition: opacity .28s var(--ease);
}
.page-veil.show { opacity: 1; }

/* ── Layout ───────────────────────────────────────────────────────────── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 18px 24px 60px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: var(--glass);
    box-shadow: var(--shadow);
}

/* ── Controls ─────────────────────────────────────────────────────────── */
.controls {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px;
    padding: 18px;
    margin-bottom: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: var(--glass);
    box-shadow: var(--shadow);
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding-left: 2px; }
.field-amount { flex: 1 1 180px; }
.field-cur { flex: 2 1 260px; }

.field-amount input {
    width: 100%;
    font-family: var(--mono); font-size: 22px; font-weight: 600;
    padding: 13px 16px;
    color: var(--text);
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.field-amount input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(91, 157, 255, .16); }

/* Inline "Enter" keycap — a compact mirror of the Convert action */
.amount-wrap { position: relative; display: flex; align-items: center; }
.amount-wrap input { padding-right: 92px; }
.enter-key {
    position: absolute; right: 7px; top: 50%;
    transform: translateY(-50%);
    display: inline-flex; align-items: center; gap: 5px;
    height: 30px; padding: 0 11px;
    font-family: var(--sans); font-size: 11.5px; font-weight: 700;
    letter-spacing: .03em; line-height: 1;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 9px;
    box-shadow: 0 2px 0 var(--border-2), 0 5px 12px -6px rgba(0, 0, 0, .45);
    cursor: pointer; white-space: nowrap;
    transition: transform .14s var(--ease), box-shadow .14s var(--ease),
                color .18s, background .18s, border-color .18s;
}
.enter-key svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.amount-wrap input:focus + .enter-key { color: var(--text); border-color: var(--accent); }
.enter-key:hover {
    color: #04121a;
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    border-color: transparent;
    box-shadow: 0 10px 20px -8px rgba(54, 227, 194, .7);
    transform: translateY(-50%) translateY(-1px);
}
.enter-key:active {
    transform: translateY(-50%);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}

.select-wrap { position: relative; display: flex; align-items: center; }
.select-wrap .sel-flag {
    position: absolute; left: 15px; width: 24px; height: 18px;
    border-radius: 3px; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.12);
}
.select-wrap select {
    width: 100%;
    appearance: none; -webkit-appearance: none;
    font-family: var(--sans); font-size: 16px; font-weight: 600;
    color: var(--text);
    padding: 14px 44px 14px 50px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.select-wrap select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(91, 157, 255, .16); }
.select-wrap .chev { position: absolute; right: 14px; pointer-events: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.select-wrap select option { background: var(--bg-2); color: var(--text); }

.btn-convert {
    display: inline-flex; align-items: center; gap: 9px;
    font-family: var(--sans); font-size: 15px; font-weight: 700;
    padding: 14px 22px;
    color: #04121a;
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    border: none; border-radius: var(--radius-sm);
    cursor: pointer; white-space: nowrap;
    box-shadow: 0 14px 30px -12px rgba(54, 227, 194, .6);
    transition: transform .18s var(--ease), box-shadow .18s, filter .18s;
}
.btn-convert svg { fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.btn-convert:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -12px rgba(54, 227, 194, .75); filter: saturate(1.1); }
.btn-convert:active { transform: translateY(0); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; margin-top: 2px; }
.chip {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--sans); font-size: 13px; font-weight: 600;
    padding: 8px 13px;
    color: var(--muted);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 100px; cursor: pointer;
    transition: all .18s var(--ease);
}
.chip .fi { width: 18px; height: 13px; border-radius: 2px; }
.chip:hover { color: var(--text); border-color: var(--border-2); transform: translateY(-1px); }
.chip.is-active { color: var(--text); background: var(--surface-2); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,157,255,.14); }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero { padding: 26px 28px 22px; margin-bottom: 26px; overflow: hidden; position: relative; }
.hero-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 22px; }
.hero-head { min-width: 280px; }

.conv-line { display: flex; align-items: center; gap: 12px; color: var(--muted); margin-bottom: 4px; }
.conv-from { display: inline-flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 600; color: var(--text); }
.conv-from .fi { width: 26px; height: 19px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.1); }
.conv-from .num { font-family: var(--mono); }
.conv-from .code { color: var(--muted); font-weight: 700; }
.eq { font-size: 20px; color: var(--faint); font-weight: 300; }

.hero-value { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 2px 0 14px; }
.hero-value .big {
    font-family: var(--mono); font-weight: 700;
    font-size: clamp(40px, 7vw, 68px); line-height: 1;
    letter-spacing: -.03em;
    background: linear-gradient(120deg, var(--text) 30%, var(--accent-2));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-code { display: inline-flex; align-items: center; gap: 9px; font-size: 24px; font-weight: 700; color: var(--muted); }
.hero-code .fi { width: 30px; height: 22px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.1); }

/* Copy total to clipboard */
.copy-sum {
    align-self: center; position: relative;
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border-radius: 13px; cursor: pointer;
    color: var(--muted);
    background: var(--surface); border: 1px solid var(--border);
    backdrop-filter: var(--glass);
    transition: transform .2s var(--ease), background .2s, border-color .2s, color .2s;
}
.copy-sum:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-2); transform: translateY(-2px); }
.copy-sum:active { transform: translateY(0) scale(.94); }
.copy-sum:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(91,157,255,.16); }
.copy-sum svg {
    grid-area: 1 / 1; fill: none; stroke: currentColor;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.copy-sum .ic-check { opacity: 0; transform: scale(.55); }
.copy-sum.is-copied {
    color: var(--up); background: var(--up-soft); border-color: rgba(22,199,154,.4);
}
.copy-sum.is-copied .ic-copy  { opacity: 0; transform: scale(.55); }
.copy-sum.is-copied .ic-check { opacity: 1; transform: scale(1); }

.copy-tip {
    position: absolute; bottom: calc(100% + 9px); left: 50%;
    transform: translateX(-50%) translateY(4px) scale(.96);
    padding: 5px 11px; border-radius: 9px;
    font-family: var(--sans); font-size: 11.5px; font-weight: 700; white-space: nowrap;
    color: #04121a; background: var(--up);
    box-shadow: 0 10px 24px -10px rgba(22,199,154,.7);
    opacity: 0; pointer-events: none;
    transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.copy-tip::after {
    content: ''; position: absolute; top: 100%; left: 50%; margin-left: -5px;
    border: 5px solid transparent; border-top-color: var(--up);
}
.copy-sum.is-copied .copy-tip { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }

.hero-sub { display: flex; flex-wrap: wrap; gap: 9px; }
.rate-pill {
    font-size: 13.5px; color: var(--text);
    padding: 7px 13px; border-radius: 100px;
    background: var(--surface-2); border: 1px solid var(--border);
}
.rate-pill b { font-family: var(--mono); color: var(--accent-2); }
.rate-pill.ghost { color: var(--muted); background: transparent; }
.rate-pill.ghost b { color: var(--text); }

.hero-chips { display: grid; grid-template-columns: repeat(2, minmax(112px, 1fr)); gap: 10px; }
.hchip {
    padding: 11px 15px; border-radius: 14px;
    background: var(--surface-2); border: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 3px;
}
.hchip-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.hchip-val { font-family: var(--mono); font-size: 17px; font-weight: 700; }
.hchip.up   .hchip-val { color: var(--up); }
.hchip.down .hchip-val { color: var(--down); }
.hchip.flat .hchip-val { color: var(--muted); }
.hchip.up   { background: var(--up-soft);   border-color: rgba(22,199,154,.28); }
.hchip.down { background: var(--down-soft); border-color: rgba(255,92,121,.28); }

/* Chart toolbar */
.chart-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 12px; margin: 24px 0 4px;
}
.chart-modes, .period-tabs {
    display: inline-flex; gap: 3px; padding: 4px;
    background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
}
.mode, .period-tab {
    font-family: var(--sans); font-size: 13px; font-weight: 600;
    padding: 8px 14px; border: none; border-radius: 9px;
    background: transparent; color: var(--muted); cursor: pointer;
    transition: all .18s var(--ease); white-space: nowrap;
}
.mode:hover, .period-tab:hover { color: var(--text); }
.mode.is-active, .period-tab.is-active {
    color: var(--text); background: var(--surface-2);
    box-shadow: 0 2px 10px -4px rgba(0,0,0,.4);
}
.period-tab.is-active { color: #04121a; background: linear-gradient(135deg, var(--accent-2), var(--accent)); }

/* Chart stats */
.chart-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
    margin: 18px 0 6px; border-radius: 14px; overflow: hidden;
    background: var(--border);
}
.cstat { background: var(--bg-2); padding: 13px 16px; display: flex; flex-direction: column; gap: 4px; }
.cstat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.cstat-val { font-family: var(--mono); font-size: 18px; font-weight: 700; }
.cstat-val.up { color: var(--up); }
.cstat-val.down { color: var(--down); }
.cstat-val.accent { color: var(--accent-2); }
.cstat-valwrap { display: flex; align-items: baseline; gap: 5px; }
.cstat-cur { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--muted); }

.chart-host { margin: 6px -8px 0; min-height: 330px; }
#heroChart { min-height: 330px; }

/* ── Board ────────────────────────────────────────────────────────────── */
.board-head { margin: 34px 4px 16px; }
.board-head h2 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; line-height: 1.5; }
.board-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.board-source { white-space: nowrap; }
.board-source time {
    color: var(--text); font-weight: 600;
    border-bottom: 1px dashed rgba(91,157,255,.5);
    padding-bottom: 1px;
}

/* Highlighted amount inside the board heading */
.board-amount {
    display: inline-flex; align-items: baseline;
    font-family: var(--mono); font-weight: 700;
    font-size: .92em; letter-spacing: -.02em; white-space: nowrap;
    padding: 3px 11px; margin-right: 3px;
    border-radius: var(--radius-sm);
    color: var(--text);
    background: var(--surface);
    border: 1px solid rgba(91,157,255,.55);
    box-shadow:
        0 0 0 3px rgba(91,157,255,.1),
        0 4px 16px -6px rgba(91,157,255,.35);
}

.board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: 14px;
}
.cur-card {
    padding: 16px 17px 12px;
    display: flex; flex-direction: column; gap: 11px;
    position: relative; overflow: hidden;
    transition: transform .22s var(--ease), border-color .22s, box-shadow .22s;
}
.cur-card::after {
    content: ''; position: absolute; inset: 0; border-radius: var(--radius);
    background: radial-gradient(120% 80% at 100% 0%, rgba(91,157,255,.07), transparent 55%);
    opacity: 0; transition: opacity .25s; pointer-events: none;
}
.cur-card:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: 0 26px 50px -30px rgba(0,0,0,.7); }
.cur-card:hover::after { opacity: 1; }

.cur-card-top { display: flex; align-items: center; gap: 11px; }
.cc-flag { width: 34px; height: 25px; border-radius: 5px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); flex-shrink: 0; }
.cur-id { flex: 1; min-width: 0; }
.cur-id strong { display: block; font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.cur-id small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cur-trend {
    display: inline-flex; align-items: center; gap: 4px;
    font-family: var(--mono); font-size: 12px; font-weight: 700;
    padding: 4px 8px; border-radius: 8px; white-space: nowrap;
}
.cur-trend .trend-ic { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cur-trend.up   { color: var(--up);   background: var(--up-soft); }
.cur-trend.down { color: var(--down); background: var(--down-soft); }
.cur-trend.down .trend-ic { transform: scaleY(-1); }
.cur-trend.flat { color: var(--muted); background: var(--surface-2); }
.cur-trend.flat .trend-ic { display: none; }

.cur-value { display: flex; align-items: baseline; gap: 7px; }
.cv-num { font-family: var(--mono); font-size: 25px; font-weight: 700; letter-spacing: -.02em; }
.cv-code { font-size: 13px; font-weight: 700; color: var(--muted); }
.cur-rate { font-size: 12px; color: var(--muted); font-family: var(--mono); }

.cur-spark { height: 34px; margin: 2px -2px -2px; }
.spark-svg { width: 100%; height: 100%; overflow: visible; }
.spark-svg .spark-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark-svg .spark-fill { stroke: none; opacity: .14; }
.cur-card.up   .spark-line { stroke: var(--up); }   .cur-card.up   .spark-fill { fill: var(--up); }
.cur-card.down .spark-line { stroke: var(--down); } .cur-card.down .spark-fill { fill: var(--down); }
.cur-card.flat .spark-line { stroke: var(--muted); }.cur-card.flat .spark-fill { fill: var(--muted); }

/* ── Footer ───────────────────────────────────────────────────────────── */
.foot {
    margin-top: 42px;
    padding: 24px 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: var(--glass);
    box-shadow: var(--shadow);
}
.foot-main {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 24px 36px;
}
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-brand .brand-mark { width: 42px; height: 42px; font-size: 21px; border-radius: 13px; }
.foot-brand strong { display: block; font-size: 16px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.foot-brand .dot { color: var(--accent-2); font-weight: 700; margin: 0 .01em; }
.foot-brand small { display: block; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; }

.foot-info { display: flex; flex-wrap: wrap; gap: 14px 34px; }
.foot-col { display: flex; flex-direction: column; gap: 4px; }
.foot-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }
.foot-val { font-size: 13px; color: var(--text); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.foot-val .pulse { flex-shrink: 0; }

.foot-bottom {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 8px 18px;
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid var(--border);
}
.foot-copy { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.foot-note { font-size: 12px; color: var(--faint); }

/* ── Scroll-to-top ────────────────────────────────────────────────────── */
.to-top {
    position: fixed; right: 26px; bottom: 26px; z-index: 70;
    width: 54px; height: 54px;
    display: grid; place-items: center;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 50%; cursor: pointer;
    backdrop-filter: var(--glass);
    box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(16px) scale(.86);
    transition: opacity .38s var(--ease), transform .38s var(--ease),
                visibility .38s, background .22s, border-color .22s;
}
.to-top.show { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0) scale(1); }
.to-top:hover {
    background: var(--surface-2); border-color: var(--border-2);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 20px 40px -16px rgba(54, 227, 194, .5);
}
.to-top:active { transform: translateY(-1px) scale(.99); }

.tt-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.tt-ring circle { fill: none; stroke-width: 2.4; }
.tt-track { stroke: var(--border); }
.tt-prog {
    stroke: url(#ttGrad); stroke-linecap: round;
    stroke-dasharray: 125.66; stroke-dashoffset: 125.66;
    transition: stroke-dashoffset .12s linear;
}
.tt-arrow {
    position: relative; fill: none;
    stroke: var(--text); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
    transition: stroke .22s, transform .22s var(--ease);
}
.to-top:hover .tt-arrow { stroke: var(--accent-2); transform: translateY(-1px); }

/* ── Error ────────────────────────────────────────────────────────────── */
.error-wrap { display: grid; place-items: center; min-height: 70vh; }
.error-card { text-align: center; padding: 48px 40px; max-width: 460px; }
.error-mark { font-size: 46px; margin-bottom: 10px; }
.error-card h1 { margin: 0 0 8px; font-size: 24px; }
.error-card p { color: var(--muted); margin: 0 0 22px; }
.error-card .btn-convert { justify-content: center; }

/* Count-up shimmer while animating */
.is-counting { opacity: .96; }

/* Entrance animations */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.controls, .hero, .board-head, .board, .foot { animation: rise .6s var(--ease) both; }
.hero { animation-delay: .05s; }
.board-head { animation-delay: .1s; }
.board { animation-delay: .14s; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .topbar { padding: 16px 16px 4px; flex-wrap: wrap; }
    .asof { font-size: 11.5px; }
    .wrap { padding: 14px 14px 50px; }
    .hero { padding: 20px 18px; }
    .hero-top { flex-direction: column; }
    .hero-chips { grid-template-columns: repeat(4, 1fr); width: 100%; }
    .hchip { padding: 9px 8px; }
    .hchip-val { font-size: 14px; }
    .chart-stats { grid-template-columns: repeat(2, 1fr); }
    .chart-toolbar { gap: 8px; }
    .mode, .period-tab { padding: 7px 11px; font-size: 12px; }
    .brand-text small { font-size: 11px; }
    .to-top { right: 16px; bottom: 16px; width: 48px; height: 48px; }
}
@media (max-width: 420px) {
    .hero-chips { grid-template-columns: repeat(2, 1fr); }
    .board { grid-template-columns: 1fr 1fr; gap: 10px; }
    .cv-num { font-size: 21px; }
    .cc-flag { width: 28px; height: 21px; }
}
