/* Стили minecalc.ru (DESIGN.md): тёмный фон, оранжевый, неон у логотипа и главного числа; поверхности по уровням — фон,
   карточка, внутренний блок (поля, переключатели, рамка главного числа), каждый следующий светлее. Основа — образцы
   design/mockup-*.html (design/mockup.css). Шрифт Inter — со своего сервера: латиница и кириллица (₽ и знаки вне наборов —
   из системного шрифта). */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
    color-scheme: dark;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bg: #0D0C0B;
    --ambient: radial-gradient(900px 520px at 85% -12%, rgba(247, 147, 26, 0.07), transparent 70%), radial-gradient(700px 520px at -10% 30%, rgba(247, 147, 26, 0.035), transparent 70%);
    --surface: #161514;
    --surface-2: #1F1D1B;
    --surface-3: #2A2724;
    --line: rgba(255, 240, 225, 0.07);
    --line-strong: rgba(255, 240, 225, 0.14);
    --text: #F2F0ED;
    --text-2: #CFCAC4;
    --text-3: #9C968F;
    --orange: #F7931A;
    --orange-text: #F7931A;
    --key: #F7931A;
    --logo: #F7931A;
    --on-orange: #140C02;
    --red: #FF4D42;
    --green: #34C759;
    --risk-red: #FF3B30;
    --risk-orange: #F7931A;
    --risk-green: #34C759;
    --neon: 0 0 10px rgba(247, 147, 26, 0.6), 0 0 22px rgba(247, 147, 26, 0.25);
    --card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 30px rgba(0, 0, 0, 0.35);
    --key-edge: rgba(247, 147, 26, 0.32);
    --key-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 16px 48px -16px rgba(247, 147, 26, 0.3);
    --hero-bg: radial-gradient(120% 130% at 50% 0%, rgba(247, 147, 26, 0.17), rgba(247, 147, 26, 0) 62%), #1D1A17;
    --hero-edge: rgba(247, 147, 26, 0.28);
    --hero-glow-a: 0 0 0 0 rgba(247, 147, 26, 0);
    --hero-glow-b: 0 0 26px -4px rgba(247, 147, 26, 0.45);
    --seg-active: #2E2A26;
    --seg-active-edge: rgba(247, 147, 26, 0.4);
    --input-bg: #1F1D1B;
    --input-edge: rgba(255, 240, 225, 0.12);
    --input-edge-hover: rgba(255, 240, 225, 0.24);
    --focus-ring: rgba(247, 147, 26, 0.2);
    --btn-glow: 0 0 16px rgba(247, 147, 26, 0.4);
    --menu-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    --loss-fill: rgba(255, 77, 66, 0.1);
    --track: rgba(255, 240, 225, 0.08);
    --bar-glow: 0 0 8px rgba(247, 147, 26, 0.5);
    --chart-grid: rgba(255, 240, 225, 0.06);
    --chart-fill: rgba(247, 147, 26, 0.2);
    --tooltip-bg: #24211F;
    --bar-bg: rgba(22, 21, 20, 0.97);
    --bar-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
}
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #F3F2EF;
    --ambient: none;
    --surface: #FFFFFF;
    --surface-2: #F7F6F3;
    --surface-3: #EFEDE9;
    --line: #E8E5E0;
    --line-strong: #D8D3CC;
    --text: #1C1917;
    --text-2: #44403C;
    --text-3: #6F6A64;
    --orange-text: #B45309;
    --key: #C2410C;
    --logo: #D97706;
    --on-orange: #1C1917;
    --red: #DC2626;
    --green: #15803D;
    --risk-red: #EF4444;
    --risk-green: #22C55E;
    --neon: none;
    --card-shadow: 0 1px 2px rgba(28, 25, 23, 0.05), 0 6px 20px rgba(28, 25, 23, 0.05);
    --key-edge: rgba(217, 119, 6, 0.35);
    --key-shadow: 0 1px 2px rgba(28, 25, 23, 0.05), 0 12px 32px -12px rgba(217, 119, 6, 0.25);
    --hero-bg: radial-gradient(120% 130% at 50% 0%, rgba(247, 147, 26, 0.14), rgba(247, 147, 26, 0) 62%), #FFFAF4;
    --hero-edge: rgba(217, 119, 6, 0.3);
    --hero-glow-a: 0 0 0 0 rgba(247, 147, 26, 0);
    --hero-glow-b: 0 6px 20px -6px rgba(247, 147, 26, 0.35);
    --seg-active: #FFFFFF;
    --seg-active-edge: rgba(217, 119, 6, 0.45);
    --input-bg: #FFFFFF;
    --input-edge: #D8D3CC;
    --input-edge-hover: #BDB6AC;
    --focus-ring: rgba(247, 147, 26, 0.25);
    --btn-glow: 0 4px 14px rgba(247, 147, 26, 0.35);
    --menu-shadow: 0 16px 40px rgba(28, 25, 23, 0.12);
    --loss-fill: rgba(220, 38, 38, 0.07);
    --track: #ECE9E4;
    --bar-glow: none;
    --chart-grid: #EEEBE6;
    --chart-fill: rgba(247, 147, 26, 0.16);
    --tooltip-bg: #FFFFFF;
    --bar-bg: rgba(255, 255, 255, 0.97);
    --bar-shadow: 0 -6px 20px rgba(28, 25, 23, 0.08);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background-color: var(--bg); background-image: var(--ambient); background-repeat: no-repeat; color: var(--text); font: 400 16px/1.5 var(--font); }
a { color: var(--orange-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.container { max-width: 1200px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 768px) { .container { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Шапка: логотип, разделы, тема */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; color: var(--logo); text-shadow: var(--neon); }
.logo:hover { text-decoration: none; }
.main-nav { display: none; align-items: center; gap: 4px; }
.nav-item { position: relative; }
.nav-btn, .nav-link { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--text-3); font: 500 14px var(--font); cursor: pointer; transition: color 0.15s, background 0.15s; }
.nav-btn:hover, .nav-link:hover, .nav-btn[aria-expanded="true"] { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-btn.current, .nav-link.current { color: var(--orange-text); }
.nav-btn svg.i { width: 14px; height: 14px; transition: transform 0.2s; }
.nav-btn[aria-expanded="true"] svg.i { transform: rotate(180deg); }
.dropdown { position: absolute; left: 0; top: calc(100% + 8px); z-index: 50; min-width: 300px; padding: 6px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--menu-shadow); }
.dropdown a { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 8px; color: var(--text); font-size: 14px; }
.dropdown a:hover { background: var(--surface-2); text-decoration: none; }
.dropdown a.active { color: var(--orange-text); }
.dropdown small { font-size: 12px; color: var(--text-3); }
.header-actions { display: flex; gap: 8px; margin-left: auto; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.icon-btn:hover { color: var(--orange-text); border-color: var(--input-edge-hover); }
.mobile-menu { padding-bottom: 12px; border-top: 1px solid var(--line); }
.mobile-menu h3 { margin: 16px 0 0; font-size: 12px; font-weight: 600; color: var(--text-3); }
.mobile-menu a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.mobile-menu a.active { color: var(--orange-text); }
.mobile-menu small { font-size: 12px; color: var(--text-3); }
@media (min-width: 900px) { .main-nav { display: flex; } .menu-btn, .mobile-menu { display: none !important; } }

/* Заголовок страницы — одна строка */
.page-head { padding-block: 24px 16px; }
h1 { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; color: var(--text); text-wrap: balance; }
@media (min-width: 768px) { .page-head { padding-block: 32px 20px; } h1 { font-size: 24px; } }

/* Переключатель: монета, период графика, период доходов */
.segmented { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.segmented.inline { display: inline-flex; }
.seg-item {
    flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 10px; border: 0; border-radius: 7px;
    background: transparent; color: var(--text-3); font: 500 14px var(--font); white-space: nowrap; cursor: pointer; transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}
.seg-item:hover { color: var(--text); text-decoration: none; }
.seg-item.active, .seg-item[aria-pressed="true"] { background: var(--seg-active); color: var(--orange-text); box-shadow: inset 0 0 0 1px var(--seg-active-edge), 0 1px 2px rgba(0, 0, 0, 0.25); }
.segmented.small .seg-item { height: 30px; padding: 0 10px; font-size: 13px; }
@media (max-width: 479px) { .segmented.small .seg-item { padding: 0 8px; } }

/* Карточки */
.card { min-width: 0; padding: 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-shadow); }
@media (min-width: 768px) { .card { padding: 24px; } }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.card-head .card-title { margin-bottom: 0; }
.card-title { position: relative; margin: 0 0 20px; padding-bottom: 8px; color: var(--orange-text); font-size: 18px; font-weight: 600; letter-spacing: 0.01em; }
.card-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 32px; height: 2px; border-radius: 2px; background: var(--orange); }
/* Плашка «на какую дату цифры»: источники на страницах не называем (решение user 18.10.2026) */
.asof { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; font-size: 12px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.asof svg.i { width: 13px; height: 13px; }

/* Сетка калькулятора: на телефоне — параметры, цена отключения, доходы, сеть; на ПК — слева параметры и сеть, справа результат */
.calc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.calc .side, .calc .results { display: contents; }
.calc .params { order: 1; } .calc .key { order: 2; } .calc .money { order: 3; } .calc .network { order: 4; }
@media (min-width: 1024px) {
    .calc { grid-template-columns: 360px minmax(0, 1fr); gap: 24px; align-items: start; }
    .calc .side, .calc .results { display: grid; gap: 24px; min-width: 0; }
    .calc .side .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* Левая колонка прилипает в любом окне: «Параметры» на экране, а низ «Сети и курса» в низком окне — у конца калькулятора */
    .calc .side { position: sticky; top: 24px; }
}
/* Калькулятор без графика (LTC + DOGE, ETHW): на ПК колонки вровень — нижняя карточка короткой колонки тянется до низа
   соседней, пояснение под таблицей доходов прижато к низу */
@media (min-width: 1024px) {
    .calc.even { align-items: stretch; }
    .calc.even .side, .calc.even .results { grid-template-rows: auto minmax(0, 1fr); }
    .calc.even .money, .calc.even .network { display: flex; flex-direction: column; }
    .calc.even .money .fin-note { margin-top: auto; padding-top: 12px; }
}

/* Сетка страницы графика: на телефоне — ключевой блок, график, цена отключения, таблица; на ПК таблица и цена отключения — рядом */
.board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.board .key { order: 1; } .board .chart-card { order: 2; } .board .impact { order: 3; } .board .table-card { order: 4; }
@media (min-width: 1024px) {
    .board { grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
    .board .key, .board .chart-card { grid-column: 1 / -1; }
    .board .table-card { grid-column: 1; grid-row: 3; }
    .board .impact { grid-column: 2; grid-row: 3; }
    .board .table-card, .board .impact { align-self: stretch; }
    .board .impact { display: flex; flex-direction: column; }
    .board .impact .cta { margin-top: auto; }
}

/* Поля */
.fields { display: grid; gap: 16px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.label { font-size: 14px; font-weight: 500; color: var(--text-2); }
.control { position: relative; }
.input, .select {
    width: 100%; height: 48px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--input-edge); background: var(--input-bg); color: var(--text);
    font: 500 16px var(--font); font-variant-numeric: tabular-nums; transition: border-color 0.15s, box-shadow 0.15s;
}
.input:hover, .select:hover { border-color: var(--input-edge-hover); }
.input:focus, .select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--focus-ring); }
.input.with-unit { padding-right: 72px; }
.unit { position: absolute; top: 0; bottom: 0; right: 12px; display: flex; align-items: center; color: var(--text-3); font-size: 14px; pointer-events: none; }
.select { appearance: none; padding-right: 40px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239C968F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.select option { background: var(--surface); color: var(--text); }
.select optgroup { background: var(--surface); color: var(--text-3); font-weight: 600; }
.price .input { padding-right: 116px; }
.price .btn { position: absolute; top: 6px; right: 6px; }
.hint { font-size: 12px; color: var(--text-3); }
.btn { height: 36px; padding: 0 14px; border: 0; border-radius: 7px; background: var(--orange); color: var(--on-orange); font: 600 14px var(--font); cursor: pointer; transition: box-shadow 0.15s; }
.btn:hover { box-shadow: var(--btn-glow); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.prices-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Ключевой блок: рамка с тёплым свечением и главное число */
.key { border-color: var(--key-edge); box-shadow: var(--key-shadow); }
.key-hero { padding: 28px 16px; border-radius: 12px; text-align: center; background: var(--hero-bg); border: 1px solid var(--hero-edge); animation: hero-glow 2.4s ease-in-out infinite alternate; }
@keyframes hero-glow { from { box-shadow: var(--hero-glow-a); } to { box-shadow: var(--hero-glow-b); } }
.key-cap { font-size: 14px; color: var(--text-3); }
.key-value { margin: 4px 0 6px; font-size: 44px; line-height: 1.1; font-weight: 700; color: var(--key); text-shadow: var(--neon); font-variant-numeric: tabular-nums; }
.key-sub { max-width: 34em; margin: 0 auto; font-size: 14px; color: var(--text-3); text-wrap: balance; }
.key-sub b { color: var(--text-2); font-weight: 600; }
@media (min-width: 768px) { .key-value { font-size: 56px; } }
.key-top { display: grid; gap: 24px; }
@media (min-width: 900px) {
    .key-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
    .key-top .key-hero { display: flex; flex-direction: column; justify-content: center; }
}

/* Шкала риска: зоны совпадают с порогами (отношение цены к цене отключения 1 → 1,2 → 1,5 → 2) */
.risk { margin-top: 24px; }
.risk-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-3); }
.risk-head b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.risk-bar { position: relative; height: 10px; margin-top: 26px; border-radius: 5px; background: linear-gradient(90deg, var(--risk-red) 0 33.33%, var(--risk-orange) 33.33% 66.66%, var(--risk-green) 66.66% 100%); }
.risk-mark.high { color: var(--red); } .risk-mark.mid { color: var(--orange); } .risk-mark.low { color: var(--green); }
.risk-mark { position: absolute; top: -19px; width: 0; height: 0; transform: translateX(-50%); border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 15px solid currentColor; filter: drop-shadow(0 0 5px currentColor); transition: left 0.4s ease, color 0.3s; }
.risk-labels { display: flex; justify-content: space-between; margin-top: 12px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.risk-labels .on.high { color: var(--red); } .risk-labels .on.mid { color: var(--orange-text); } .risk-labels .on.low { color: var(--green); }
.risk-note { margin: 16px 0 0; color: var(--text-2); }
.risk-note b { color: var(--text); }

/* Следующий пересчёт и полоса периода */
.next-title { margin: 0 0 16px; font-size: 16px; font-weight: 600; color: var(--text); }
.next .stats dd { font-size: 20px; }
@media (min-width: 768px) { .next .stats dd { font-size: 22px; } }
.epoch { margin-top: 20px; }
.epoch-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-3); }
.epoch-head b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.epoch-bar { height: 8px; margin-top: 10px; border-radius: 4px; background: var(--track); }
.epoch-bar i { display: block; height: 100%; border-radius: 4px; background: var(--orange); box-shadow: var(--bar-glow); }
.next-note { margin: 14px 0 0; font-size: 13px; color: var(--text-3); }

/* Числа: сеть и курс, следующий пересчёт */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; margin: 0; }
@media (min-width: 768px) { .stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stats.key-stats { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.stat dt { font-size: 13px; color: var(--text-3); }
.stat dd { margin: 4px 0 0; font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat small, .stat .more { display: block; margin-top: 4px; font-size: 12px; color: var(--text-3); }
.stat .more { color: var(--orange-text); }

/* Графики */
.chart-part { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 8px; }
.chart-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.chart-sub { margin: 0 0 12px; font-size: 13px; color: var(--text-3); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 12px; font-size: 13px; color: var(--text-3); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 18px; height: 0; border-top: 2px solid var(--orange); }
.legend i.off { border-top: 2px dashed var(--red); }
.legend i.zone { height: 10px; border: 0; border-radius: 2px; background: var(--loss-fill); box-shadow: inset 0 0 0 1px var(--red); }
.legend i.forecast { border-top-style: dashed; }
.legend i.thin { border-top: 2px solid var(--orange); opacity: 0.35; }
.legend i.event { width: 0; height: 14px; border-top: 0; border-left: 1px dashed var(--text-3); margin: 0 8px; }
.chart-box { position: relative; height: 240px; }
@media (min-width: 768px) { .chart-box { height: 300px; } }
.chart-box.tall { height: 260px; }
@media (min-width: 768px) { .chart-box.tall { height: 340px; } }
.chart-note { margin: 12px 0 0; font-size: 14px; color: var(--text-3); }
.chart-note b { color: var(--text-2); font-weight: 600; }

/* Доходы и расходы */
.fin { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.fin th, .fin td { padding: 12px 0; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.fin th:first-child { text-align: left; }
.fin td { padding-left: 16px; font-size: 16px; font-weight: 600; color: var(--text); }
.fin thead th { padding-top: 0; font-size: 13px; font-weight: 500; color: var(--text-3); }
.fin tbody th { font-size: 15px; font-weight: 500; color: var(--text-2); }
.fin .sub { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--text-3); }
.fin tr.minus td { color: var(--text-2); }
.fin tr.total th, .fin tr.total td { background: var(--surface-2); border-bottom: 0; }
.fin tr.total th { padding-left: 12px; border-radius: 10px 0 0 10px; color: var(--text); font-weight: 700; }
.fin tr.total td:last-child { padding-right: 12px; border-radius: 0 10px 10px 0; }
.fin tr.total td { color: var(--green); font-weight: 700; }
.fin tr.total.loss td { color: var(--red); }
.fin tbody tr:last-child th, .fin tbody tr:last-child td { border-bottom: 0; }
.fin-note { margin: 12px 0 0; font-size: 12px; color: var(--text-3); }
.segmented.period-switch { display: none; }
@media (max-width: 639px) {
    .segmented.period-switch { display: inline-flex; }
    .fin[data-period="1"] .p30, .fin[data-period="1"] .p365,
    .fin[data-period="30"] .p1, .fin[data-period="30"] .p365,
    .fin[data-period="365"] .p1, .fin[data-period="365"] .p30 { display: none; }
}

/* Цена отключения при пересчёте: устройство и тариф выбирает посетитель; на ПК карточка вровень с таблицей, кнопка — внизу */
.impact-lead { margin: 0 0 16px; font-size: 15px; color: var(--text-2); }
.ladder { display: grid; margin: 20px 0 0; }
.ladder div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ladder div:last-child, .ladder div:has(+ .now) { border-bottom: 0; }
.ladder dt { font-size: 15px; color: var(--text-2); }
.ladder dd { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ladder .now { margin: 0 -12px; padding: 12px; border-bottom: 0; border-radius: 10px; background: var(--surface-2); }
.ladder .now dt { color: var(--text); font-weight: 600; }
.ladder .now dd { color: var(--key); font-size: 18px; font-weight: 700; }
.impact-hint { margin: 12px 0 20px; font-size: 12px; color: var(--text-3); }
.cta { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: 10px; background: var(--orange); color: var(--on-orange); font-size: 15px; font-weight: 600; transition: box-shadow 0.15s; }
.cta:hover { text-decoration: none; box-shadow: var(--btn-glow); }
.cta svg.i { width: 16px; height: 16px; }

/* Таблица по дням или пересчётам: на ПК — все столбцы, на телефоне — три, остальное второй строкой */
.adj { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.adj th, .adj td { padding: 12px 0 12px 16px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.adj th:first-child, .adj td:first-child { padding-left: 0; text-align: left; }
.adj thead th { padding-top: 0; font-size: 13px; font-weight: 500; color: var(--text-3); }
.adj td { font-size: 15px; color: var(--text-2); }
.adj td.c-diff, .adj td.c-change { color: var(--text); font-weight: 600; }
.adj tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 639px) {
    .adj, .adj thead, .adj tbody { display: block; }
    .adj tr { display: grid; grid-template-columns: minmax(0, 1fr) auto 84px; grid-template-areas: "date diff change" "block hash change"; column-gap: 12px; row-gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
    .adj thead tr { grid-template-areas: "date diff change"; padding-top: 0; }
    .adj tbody tr:last-child { border-bottom: 0; }
    .adj th, .adj td { display: block; padding: 0; border: 0; }
    .adj .c-date { grid-area: date; }
    .adj .c-block { grid-area: block; text-align: left; }
    .adj .c-diff { grid-area: diff; }
    .adj .c-hash { grid-area: hash; }
    .adj .c-change { grid-area: change; align-self: center; }
    .adj thead .c-block, .adj thead .c-hash { display: none; }
    .adj td.c-block, .adj td.c-hash { font-size: 13px; color: var(--text-3); }
    .adj.blocks td.c-block::before { content: "блок "; }
}
.table-note { margin: 12px 0 0; font-size: 12px; color: var(--text-3); }

/* Изменение: рост — зелёный, снижение — красный, как на сайте */
.up, .key-sub b.up, .stat dd.up, .adj td.up, .chart-note b.up, .ladder dd.up { color: var(--green); }
.down, .key-sub b.down, .stat dd.down, .adj td.down, .chart-note b.down, .ladder dd.down { color: var(--red); }

/* Текст и вопросы */
.article { margin-top: 24px; }
.article-in { max-width: 760px; }
.article h3 { margin: 28px 0 8px; font-size: 18px; font-weight: 600; color: var(--orange-text); }
.article p, .article li { color: var(--text-2); line-height: 1.7; }
.article p { margin: 0 0 14px; }
.article ul { margin: 0 0 14px; padding-left: 22px; }
.formula { padding: 12px 16px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-weight: 500; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; cursor: pointer; list-style: none; font-weight: 600; color: var(--text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--orange-text); }
.faq summary svg.i { flex: none; color: var(--text-3); transition: transform 0.2s; }
.faq details[open] summary svg.i { transform: rotate(180deg); color: var(--orange-text); }
.faq details p { margin: 0 0 16px; }

/* Подвал */
.site-footer { margin-top: 48px; border-top: 1px solid var(--line); }
.footer-grid { display: grid; gap: 24px; padding-block: 32px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 32px; } }
.footer-about p { max-width: 320px; margin: 8px 0 0; font-size: 14px; color: var(--text-3); }
.site-footer h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--orange-text); }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li a { display: block; padding: 8px 0; font-size: 14px; color: var(--text-3); }
.site-footer li a:hover { color: var(--orange-text); text-decoration: none; }
.site-footer li a.active { color: var(--orange-text); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 20px calc(20px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
@media (max-width: 1023px) { .has-sumbar .footer-bottom { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); } }

/* Строка итога на телефоне — у калькуляторов */
.sumbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    background: var(--bar-bg); border-top: 1px solid var(--line-strong); box-shadow: var(--bar-shadow);
}
.sumbar a { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--text); }
.sumbar a:hover { text-decoration: none; }
.sb-cap { display: block; font-size: 12px; color: var(--text-3); }
.sb-key { font-size: 22px; font-weight: 700; color: var(--key); text-shadow: var(--neon); font-variant-numeric: tabular-nums; }
.sb-right { text-align: right; }
.sb-profit { font-size: 16px; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }
.sb-profit.loss { color: var(--red); }
@media (min-width: 1024px) { .sumbar { display: none !important; } }

/* Пометки «не обновилось»: данные сети или цена не пришли — расчёт по прежним */
.hint.warn { color: var(--orange-text); }
.stale { margin: -8px 0 16px; font-size: 13px; color: var(--orange-text); }

/* Контакты: на ПК две карточки рядом, на телефоне — одна под другой */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; } }
.contact-grid .card { display: flex; flex-direction: column; }
.contact-lead { margin: 0 0 8px; font-size: 17px; color: var(--text); }
.contact-text { margin: 0 0 24px; color: var(--text-2); }
.contact-grid .cta { margin-top: auto; }
.contact-handle { margin: 12px 0 0; font-size: 13px; color: var(--text-3); text-align: center; }
.topics { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.topics li { position: relative; padding-left: 22px; color: var(--text-2); }
.topics li::before { content: ""; position: absolute; left: 4px; top: 0.6em; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: var(--bar-glow); }
.topics b { color: var(--text); font-weight: 600; }
