/* =========================================================
   FastCalc — дизайн-система
   Идея: калькуляторы имеют LCD/LED-экран — этот мотив стал
   фирменным элементом сайта: тёмная панель со светящимися
   моноширинными цифрами используется как результат на любой
   странице, объединяя все 23 инструмента в единый стиль.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600;700&display=swap');

:root {
    --bg: #F5F6F8;
    --surface: #FFFFFF;
    --surface-alt: #EEF0F4;
    --ink: #12141C;
    --ink-soft: #5B6270;
    --ink-faint: #9AA1AE;
    --border: #E2E5EB;

    --accent: #FF6B35;
    --accent-dark: #E8551F;
    --accent-ink: #FFFFFF;
    --accent-soft: #FFE8DD;

    --display-bg: #12141C;
    --display-bg-2: #1B1F2B;
    --display-fg: #4ADE80;
    --display-fg-dim: rgba(74, 222, 128, .32);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;

    --shadow-sm: 0 1px 2px rgba(18,20,28,.06), 0 1px 1px rgba(18,20,28,.04);
    --shadow-md: 0 10px 28px rgba(18,20,28,.09);
    --shadow-lg: 0 22px 48px rgba(18,20,28,.14);

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
p { margin: 0 0 1em; color: var(--ink-soft); }
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }

/* ===== Buttons & inputs ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-body); font-weight: 600; font-size: .95rem;
    padding: 13px 22px; border-radius: var(--radius-sm); border: none; cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: var(--surface-alt); color: var(--ink); }
.btn-ghost:hover { background: var(--border); }
.btn:active { transform: translateY(0); }
.btn-block { width: 100%; }

.field { margin-bottom: 16px; }
.field label { display:block; font-size: .84rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input[type=text],
.field input[type=number],
.field input[type=date],
.field select {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 1rem; color: var(--ink); background: var(--surface);
    transition: border-color .12s ease, box-shadow .12s ease;
}
.field input:focus, .field select:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-suffix { position: relative; }
.field-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-size: .9rem; pointer-events: none; }

.tabs { display: flex; gap: 6px; background: var(--surface-alt); padding: 5px; border-radius: var(--radius-sm); margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn { flex: 1; min-width: 100px; padding: 9px 12px; border: none; background: transparent; border-radius: 7px; font-family: var(--font-body); font-weight: 600; font-size: .87rem; color: var(--ink-soft); cursor: pointer; transition: all .12s ease; }
.tab-btn.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ===== Header ===== */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(245,246,248,.98); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 700; font-size: 1.18rem; color: var(--ink); flex-shrink: 0; }
.logo-badge {
    width: 34px; height: 34px; border-radius: 9px; background: var(--display-bg);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); color: var(--display-fg); font-size: .95rem; font-weight: 700;
    box-shadow: 0 0 0 1px rgba(74,222,128,.25), 0 0 14px rgba(74,222,128,.35) inset;
}
.main-nav { position: relative; margin-left: auto; display: flex; align-items: stretch; align-self: stretch; gap: 4px; }
.nav-item { position: relative; display: flex; align-items: center; }
.nav-link { padding: 9px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: .92rem; color: var(--ink-soft); cursor: pointer; }
.nav-link:hover { background: var(--surface-alt); color: var(--ink); }

.mega { display: none; position: absolute; top: 100%; left: 0; width: 320px; max-width: 92vw; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 20px; grid-template-columns: 1fr; gap: 4px 24px; }
.nav-item.open .mega { display: grid; }

/* Широкое мега-меню для 100 калькуляторов: колонки по категориям + свой скролл */
.mega-wide {
    width: 900px; left: auto; right: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px 26px; max-height: min(74vh, 620px); overflow-y: auto; align-content: start;
}
.mega-col { min-width: 0; break-inside: avoid; margin-bottom: 14px; }
.mega-col-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin: 0 0 6px; padding-bottom: 5px; border-bottom: 1px solid var(--border); }
.mega a { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 7px; font-size: .85rem; color: var(--ink-soft); line-height: 1.35; }
.mega a span { flex-shrink: 0; }
.mega a:hover { background: var(--surface-alt); color: var(--ink); }

.header-search { display: flex; align-items: center; background: var(--surface-alt); border-radius: 999px; padding: 8px 14px; gap: 8px; flex: 0 1 260px; }
.header-search input { border: none; background: transparent; outline: none; font-family: var(--font-body); font-size: .88rem; width: 100%; color: var(--ink); }
.header-search svg { flex-shrink: 0; opacity: .5; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; margin-left: auto; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; }

/* ===== Hero (homepage) ===== */
.hero { padding: 64px 0 48px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); letter-spacing: -.01em; }
.hero .lead { font-size: 1.08rem; max-width: 46ch; }
.hero-search { display:flex; gap:10px; background:var(--surface); border:1.5px solid var(--border); border-radius: var(--radius-md); padding: 8px; box-shadow: var(--shadow-sm); max-width: 480px; min-width: 0; }
.hero-search input { flex:1; min-width: 0; border:none; outline:none; font-family: var(--font-body); font-size: 1rem; padding: 10px 12px; background: transparent; color: var(--ink); }
.hero-cats { display:flex; gap:8px; margin-top:14px; flex-wrap: wrap; }
.hero-cat-pill { font-size:.82rem; font-weight:600; color: var(--ink-soft); background: var(--surface); border:1px solid var(--border); padding: 6px 13px; border-radius: 999px; }
.hero-cat-pill:hover { border-color: var(--accent); color: var(--accent-dark); }

.hero-display {
    background: linear-gradient(155deg, var(--display-bg), var(--display-bg-2));
    border-radius: var(--radius-lg); padding: 34px 30px; box-shadow: var(--shadow-lg);
    position: relative; overflow: hidden; min-width: 0;
}
.hero-display::before {
    content: ''; position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0px, rgba(255,255,255,.025) 1px, transparent 1px, transparent 3px);
    pointer-events: none;
}
.hero-display .label { font-family: var(--font-mono); font-size: .74rem; color: var(--display-fg-dim); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 10px; }
.hero-display .ticker { font-family: var(--font-mono); font-weight: 700; font-size: clamp(2.4rem, 6vw, 3.6rem); color: var(--display-fg); text-shadow: 0 0 18px rgba(74,222,128,.55); letter-spacing: .02em; overflow-wrap: break-word; word-break: break-word; }
.hero-display .sub { color: rgba(255,255,255,.55); font-size: .84rem; margin-top: 14px; }

/* ===== Category sections & cards (homepage) ===== */
.section-title-row { display:flex; align-items:baseline; gap:12px; margin: 44px 0 18px; }
.section-title-row h2 { font-size: 1.4rem; }
.cat-dot { width: 10px; height: 10px; border-radius: 50%; display:inline-block; }
.cat-count { color: var(--ink-faint); font-size: .85rem; font-weight: 500; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 14px; }
.calc-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 20px; display: flex; flex-direction: column; gap: 10px;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.calc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: transparent; }
.calc-card .icon-badge { width: 42px; height: 42px; border-radius: 11px; display:flex; align-items:center; justify-content:center; font-size: 1.3rem; }
.calc-card h3 { font-size: 1.02rem; margin: 0; }
.calc-card p { font-size: .87rem; margin: 0; }
.calc-card .arrow { margin-top: auto; font-family: var(--font-mono); font-size: .82rem; font-weight: 600; color: var(--accent-dark); }

.no-results { display: none; text-align: center; padding: 50px 20px; color: var(--ink-faint); }
.no-results.show { display: block; }

/* ===== Calculator page ===== */
.breadcrumbs { font-size: .82rem; color: var(--ink-faint); padding: 18px 0 0; }
.breadcrumbs a:hover { color: var(--accent-dark); }
.breadcrumbs .sep { margin: 0 6px; }

.calc-header { padding: 20px 0 30px; }
.calc-header .cat-badge { display:inline-flex; align-items:center; gap:6px; font-size:.78rem; font-weight:700; padding: 5px 11px; border-radius: 999px; margin-bottom: 14px; }
.calc-header h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.calc-header .lead { font-size: 1.02rem; max-width: 68ch; margin: 0; }

.calc-layout { display: grid; grid-template-columns: 1.05fr .95fr; gap: 26px; align-items: start; margin-bottom: 50px; }
.calc-panel {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 26px; box-shadow: var(--shadow-sm);
}
.calc-panel h2 { font-size: 1.05rem; margin-bottom: 18px; }

/* --- LCD display: сигнатурный элемент сайта --- */
.result-display {
    background: linear-gradient(160deg, var(--display-bg), var(--display-bg-2));
    border-radius: var(--radius-md); padding: 24px; position: relative; overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.result-display::before {
    content: ''; position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0px, rgba(255,255,255,.025) 1px, transparent 1px, transparent 3px);
    pointer-events: none;
}
.result-display .rd-label { font-family: var(--font-mono); font-size: .72rem; color: var(--display-fg-dim); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; }
.result-display .rd-value { font-family: var(--font-mono); font-weight: 700; font-size: clamp(1.7rem, 3.6vw, 2.5rem); color: var(--display-fg); text-shadow: 0 0 16px rgba(74,222,128,.5); word-break: break-word; }
.result-display .rd-note { color: rgba(255,255,255,.5); font-size: .82rem; margin-top: 8px; }
.result-display .rd-row { display:flex; justify-content: space-between; align-items:baseline; padding: 7px 0; border-top: 1px solid rgba(255,255,255,.08); }
.result-display .rd-row:first-of-type { border-top: none; }
.result-display .rd-row .k { color: rgba(255,255,255,.55); font-size: .84rem; }
.result-display .rd-row .v { font-family: var(--font-mono); color: var(--display-fg); font-weight: 600; font-size: .98rem; }
.result-sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.result-sub-grid .box { background: rgba(255,255,255,.05); border-radius: 10px; padding: 12px 14px; }
.result-sub-grid .box .k { color: rgba(255,255,255,.5); font-size: .74rem; text-transform: uppercase; letter-spacing:.05em; }
.result-sub-grid .box .v { font-family: var(--font-mono); color: var(--display-fg); font-weight: 700; font-size: 1.1rem; margin-top: 4px; }

.dyn-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.dyn-remove { background: var(--surface-alt); border: none; border-radius: var(--radius-sm); width: 44px; height: 44px; cursor: pointer; color: var(--ink-faint); font-size: 1.1rem; }
.dyn-remove:hover { background: #FCE4E4; color: #DC2626; }
.add-row-btn { background: none; border: 1.5px dashed var(--border); border-radius: var(--radius-sm); padding: 10px; width: 100%; color: var(--ink-soft); font-weight: 600; font-size: .87rem; cursor: pointer; }
.add-row-btn:hover { border-color: var(--accent); color: var(--accent-dark); }

/* --- Explainer / SEO text block --- */
.calc-info { max-width: 780px; margin: 0 auto 60px; }
.calc-info h2 { font-size: 1.3rem; margin-top: 40px; }
.calc-info h2:first-child { margin-top: 0; }
.calc-info ul { color: var(--ink-soft); padding-left: 22px; }
.calc-info li { margin-bottom: 6px; }
.formula-box { background: var(--surface-alt); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 14px 18px; font-family: var(--font-mono); font-size: .92rem; margin: 16px 0; overflow-x: auto; }

.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { display: flex; justify-content: space-between; align-items:center; padding: 16px 0; cursor: pointer; font-weight: 600; font-size: .98rem; }
.faq-q .plus { font-family: var(--font-mono); color: var(--accent-dark); font-size: 1.2rem; transition: transform .15s ease; flex-shrink:0; margin-left: 12px; }
.faq-item.open .faq-q .plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .2s ease; }
.faq-item.open .faq-a { max-height: 300px; }
.faq-a p { padding-bottom: 16px; margin: 0; }

/* --- Related calculators --- */
.related { margin: 30px 0 60px; }

/* ===== Автоподсказки поиска ===== */
.ac-wrap { position: relative; flex: 1; min-width: 0; display: flex; }
.header-search .ac-wrap { align-items: center; }
.ac-box {
    display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 200;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); overflow: hidden; max-height: 380px; overflow-y: auto;
}
.ac-box.show { display: block; }
.ac-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--border); }
.ac-item:last-child { border-bottom: none; }
.ac-item.active, .ac-item:hover { background: var(--surface-alt); }
.ac-icon { flex: none; width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.ac-text { display: flex; flex-direction: column; min-width: 0; }
.ac-title { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-cat { font-size: .74rem; color: var(--ink-faint); }
.hero-search .ac-box { top: calc(100% + 6px); }

/* ===== Рекламный блок РСЯ ===== */
.ad-slot {
    background: var(--surface); border: 1.5px dashed var(--border); border-radius: var(--radius-lg);
    padding: 14px 16px 18px; margin: 34px 0; position: relative;
}
.ad-slot-label {
    display: inline-block; font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase;
    letter-spacing: .08em; color: var(--ink-faint); background: var(--surface-alt);
    padding: 3px 9px; border-radius: 999px; margin-bottom: 10px;
}
.ad-slot-body { min-height: 90px; display: flex; align-items: center; justify-content: center; }
.ad-slot-placeholder {
    width: 100%; height: 90px; border-radius: var(--radius-md);
    background: linear-gradient(160deg, var(--display-bg), var(--display-bg-2));
    color: rgba(255,255,255,.45); font-family: var(--font-mono); font-size: .8rem; text-align: center;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; line-height: 1.5;
}
.ad-slot-placeholder small { color: rgba(255,255,255,.3); font-size: .72rem; }
.ad-slot-placeholder code { background: rgba(255,255,255,.1); padding: 1px 5px; border-radius: 4px; }
.ad-slot-placeholder-icon { font-size: 1.4rem; }
.ad-slot-hero { margin-top: 40px; }
.site-footer { background: var(--display-bg); color: rgba(255,255,255,.6); margin-top: 60px; padding: 50px 0 26px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 26px 24px; margin-bottom: 36px; }
.footer-brand { grid-column: span 2; min-width: 0; }
.footer-col { min-width: 0; }
.footer-brand .logo { color: #fff; }
.footer-brand p { color: rgba(255,255,255,.45); font-size: .87rem; margin-top: 12px; max-width: 30ch; }
.footer-col h4 { color: rgba(255,255,255,.85); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.footer-col a { display: block; color: rgba(255,255,255,.5); font-size: .87rem; padding: 5px 0; }
.footer-col a:hover { color: var(--display-fg); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; font-size: .82rem; color: rgba(255,255,255,.35); display:flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .mega-wide { width: min(700px, 92vw); grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: minmax(0, 1fr); }
    .calc-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .footer-brand { grid-column: 1 / -1; }
    .header-search { display: none; }
}
@media (max-width: 720px) {
    .main-nav { position: fixed; top: 68px; left: 0; right: 0; height: calc(100vh - 68px); z-index: 99; background: var(--bg); flex-direction: column; align-items: stretch; padding: 16px 20px; overflow-y: auto; transform: translateX(100%); transition: transform .22s ease; }
    .main-nav.open { transform: translateX(0); }
    .nav-item { width: 100%; }
    .mega, .mega-wide { position: static; display: none !important; width: 100%; max-width: 100%; box-shadow: none; border: none; padding: 8px 0 8px 14px; grid-template-columns: 1fr; max-height: none; overflow: visible; }
    .nav-item.open .mega { display: grid !important; }
    .nav-link { width: 100%; display:flex; justify-content: space-between; }
    .nav-toggle { display: block; }
    .field-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .footer-brand { grid-column: 1 / -1; }
    .dyn-row { grid-template-columns: 1fr 1fr; }
    .dyn-remove { grid-column: 1 / -1; width: 100%; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
    .result-sub-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   ТЕСТЫ — интерактивные страницы с иллюстрациями
   ============================================================ */
.test-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; align-items: center;
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-alt) 100%);
    border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; margin-bottom: 28px; }
.test-hero-art { display: flex; justify-content: center; align-items: center; }
.test-hero-art svg { width: 100%; max-width: 280px; height: auto; }
.test-meta { display: flex; gap: 18px; margin-top: 16px; flex-wrap: wrap; }
.test-meta-item { display: flex; align-items: center; gap: 7px; font-size: .88rem; color: var(--ink-soft); }
.test-meta-item b { color: var(--ink); }

.test-stage { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 30px; margin-bottom: 28px; box-shadow: var(--shadow-sm); }
.test-progress { height: 8px; background: var(--surface-alt); border-radius: 99px; overflow: hidden; margin-bottom: 22px; }
.test-progress-bar { height: 100%; background: var(--accent, #0D9488); border-radius: 99px; transition: width .3s ease; width: 0; }
.test-qnum { font-size: .82rem; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.test-question { font-size: 1.3rem; font-weight: 700; margin-bottom: 22px; line-height: 1.4; }
.test-qimage { display: flex; justify-content: center; margin-bottom: 22px; }
.test-qimage svg { max-width: 340px; width: 100%; height: auto; border-radius: 12px; }
.test-options { display: grid; gap: 12px; }
.test-option { display: flex; align-items: center; gap: 13px; padding: 15px 18px; text-align: left;
    background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md);
    font-family: var(--font-body); font-size: 1rem; color: var(--ink); cursor: pointer; transition: all .14s ease; width: 100%; }
.test-option:hover { border-color: var(--accent, #0D9488); background: var(--surface-alt); transform: translateY(-1px); }
.test-option.selected { border-color: var(--accent, #0D9488); background: color-mix(in srgb, var(--accent, #0D9488) 8%, transparent); }
.test-option .opt-key { flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-alt);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; color: var(--ink-soft); }
.test-option.selected .opt-key { background: var(--accent, #0D9488); color: #fff; }

.test-nav { display: flex; justify-content: space-between; margin-top: 24px; gap: 12px; }
.test-result { text-align: center; padding: 20px 0; }
.test-result-art { display: flex; justify-content: center; margin-bottom: 20px; }
.test-result-art svg { max-width: 200px; width: 100%; height: auto; }
.test-result-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 10px; color: var(--accent, #0D9488); }
.test-result-desc { font-size: 1.05rem; color: var(--ink-soft); max-width: 560px; margin: 0 auto 24px; line-height: 1.6; }
.test-score-big { font-size: 3rem; font-weight: 800; font-family: var(--font-mono); color: var(--accent, #0D9488); }
.test-scale { display: grid; gap: 14px; max-width: 480px; margin: 0 auto 24px; text-align: left; }
.test-scale-row { }
.test-scale-label { display: flex; justify-content: space-between; font-size: .88rem; font-weight: 600; margin-bottom: 5px; }
.test-scale-track { height: 10px; background: var(--surface-alt); border-radius: 99px; overflow: hidden; }
.test-scale-fill { height: 100%; border-radius: 99px; transition: width .5s ease; }

.reaction-zone { display: flex; align-items: center; justify-content: center; min-height: 300px; border-radius: var(--radius-lg);
    font-size: 1.3rem; font-weight: 700; color: #fff; cursor: pointer; user-select: none; text-align: center; padding: 20px; transition: background .1s; }
.reaction-wait { background: #DC2626; }
.reaction-ready { background: #16A34A; }
.reaction-idle { background: #334155; }
.reaction-result { background: #0D9488; }

.memory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; margin: 0 auto 20px; }
.memory-cell { aspect-ratio: 1; border-radius: 14px; background: var(--surface-alt); border: 2px solid var(--border);
    cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.memory-cell.lit { background: var(--accent, #0D9488); border-color: var(--accent, #0D9488); transform: scale(1.05); }
.memory-cell.wrong { background: #DC2626; border-color: #DC2626; }

@media (max-width: 720px) {
    .test-hero { grid-template-columns: 1fr; text-align: center; }
    .test-hero-art { order: -1; }
    .test-question { font-size: 1.1rem; }
}

/* Карточки тестов на главной */
.calc-card.test-card { position: relative; }
.test-pill { position: absolute; top: 16px; right: 16px; font-size: .68rem; font-weight: 700;
    color: #fff; padding: 3px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; }
.tests-section .icon-badge { font-size: 1.5rem; }

/* ===== Тест на цветовосприятие ===== */
.cv-grid { display: grid; gap: 8px; max-width: 380px; margin: 0 auto; }
.cv-cell { aspect-ratio: 1; border: none; border-radius: 10px; cursor: pointer; transition: transform .1s; padding: 0; }
.cv-cell:hover { transform: scale(1.06); }

/* ===== Тест на глазомер ===== */
.ee-track { position: relative; height: 46px; background: var(--surface-alt); border-radius: 12px; overflow: hidden; border: 1.5px solid var(--border); }
.ee-fill { height: 100%; background: color-mix(in srgb, var(--accent, #0284C7) 45%, transparent); transition: width .05s; }
.ee-handle { position: absolute; top: 0; width: 3px; height: 100%; background: var(--accent, #0284C7); transform: translateX(-50%); }
.ee-target-mark { position: absolute; top: 0; width: 3px; height: 100%; background: #16A34A; transform: translateX(-50%); box-shadow: 0 0 0 1px #fff; }

/* ===== Тест на чувство времени ===== */
.ts-zone { display: flex; align-items: center; justify-content: center; min-height: 200px; border-radius: var(--radius-lg);
    font-size: 1.25rem; font-weight: 700; color: #fff; cursor: pointer; user-select: none; text-align: center; padding: 20px;
    background: var(--accent, #9333EA); transition: background .15s; }
.ts-zone.ts-running { background: #DC2626; }

/* ===== Правовые страницы (политика, соглашение) ===== */
.legal-doc { max-width: 820px; margin: 0 auto; font-size: 1rem; line-height: 1.7; color: var(--ink-soft); }
.legal-doc h2 { font-size: 1.2rem; color: var(--ink); margin: 32px 0 12px; }
.legal-doc p { margin: 0 0 14px; }
.legal-doc ul { margin: 0 0 16px; padding-left: 22px; }
.legal-doc li { margin-bottom: 7px; }
.legal-doc a { color: var(--accent-color, #2563EB); }
.legal-doc code { background: var(--surface-alt); padding: 1px 6px; border-radius: 5px; font-family: var(--font-mono); font-size: .88em; color: #B45309; }
.legal-updated { font-size: .92rem; color: var(--ink-faint); }
.legal-note { background: #FEF3C7; border: 1px solid #FCD34D; border-radius: var(--radius-md); padding: 12px 16px; font-size: .92rem; color: #92400E; margin-bottom: 22px; }

/* ===== Cookie-баннер ===== */
.cookie-banner {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 9999;
    max-width: 720px; margin: 0 auto;
    background: var(--surface, #fff); border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-lg, 16px); box-shadow: 0 12px 40px rgba(0,0,0,.18);
    padding: 20px 22px; display: none;
}
.cookie-banner.show { display: block; animation: cookieUp .3s ease; }
@keyframes cookieUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.cookie-banner__text { font-size: .92rem; line-height: 1.55; color: var(--ink-soft, #475569); margin-bottom: 14px; }
.cookie-banner__text b { color: var(--ink, #0f172a); }
.cookie-banner__text a { color: var(--accent-color, #2563EB); text-decoration: underline; }
.cookie-banner__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-banner__btn {
    flex: 1; min-width: 140px; padding: 11px 18px; border-radius: var(--radius-md, 12px);
    font-family: var(--font-body); font-weight: 700; font-size: .92rem; cursor: pointer; border: 1.5px solid transparent; transition: all .14s ease;
}
.cookie-banner__btn--accept { background: #0D9488; color: #fff; }
.cookie-banner__btn--accept:hover { background: #0f766e; }
.cookie-banner__btn--decline { background: transparent; color: var(--ink-soft, #475569); border-color: var(--border, #e2e8f0); }
.cookie-banner__btn--decline:hover { background: var(--surface-alt, #f1f5f9); }
@media (max-width: 480px) { .cookie-banner__actions { flex-direction: column; } }

/* Ссылки на правовые страницы в подвале */
.footer-legal-links { display: inline-flex; gap: 16px; flex-wrap: wrap; }
.footer-legal-links a { color: #B2B2B2; text-decoration: underline; }
.footer-legal-links a:hover { color: #fff; }
