/* ================================================================
   0. CSS-ПЕРЕМЕННЫЕ И ТЕМНАЯ ТЕМА
   ================================================================ */
:root {
    --bg: #ffffff;
    --bg-section: #f6f8fa;
    --text: #0f172a;
    --text-secondary: #64748b;
    --accent: #3b82f6;
    --accent-dark: #2563eb;
    --accent-light: #eff6ff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.04);
    --shadow-hover: 0 12px 32px rgba(59,130,246,.15);
    --radius: 16px;
    --transition: .35s cubic-bezier(.25,.46,.45,.94);
    
    --surface: var(--bg-section);
    --accent-soft: var(--accent-light);
    --success: #22c55e;
}

html[data-theme="dark"] {
    --bg: #0d1117;
    --bg-section: #161b22;
    --text: #c9d1d9;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-dark: #1f6feb;
    --accent-light: rgba(56, 139, 253, 0.15);
    --border: #30363d;
    --border-light: #21262d;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
    --shadow-hover: 0 12px 32px rgba(56,139,253,.2);
    --success: #3fb950;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

html.scrollbar-hidden,
html.scrollbar-hidden body {
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
html.scrollbar-hidden::-webkit-scrollbar { display: none; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px; line-height: 1.6; color: var(--text); background-color: var(--bg);
    -webkit-font-smoothing: antialiased; overflow-x: hidden;
    min-height: 100vh; display: flex; flex-direction: column;
    transition: background-color 0.4s ease, color 0.4s ease;
}

body.menu-open { overflow: hidden; -webkit-overflow-scrolling: auto; }
::selection { background: var(--accent); color: #fff; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4 { color: var(--text); line-height: 1.3; letter-spacing: -.02em; }
img { max-width: 100%; }

/* ================================================================
5. НАВБАР
================================================================ */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background-color: rgba(255,255,255,.86);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(0,0,0,.05);
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    padding: 0.8rem 0; transition: all .4s ease;
}
.navbar.scrolled { padding: 0.5rem 0; box-shadow: 0 4px 20px rgba(0,0,0,.05); background-color: rgba(255,255,255,.86); }

html[data-theme="dark"] .navbar {
    background-color: rgba(13, 17, 23, 0.86);
    border-bottom-color: rgba(255,255,255,.05);
}

.navbar .wrapper { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; }

.navbar-brand {
    font-weight: 800; letter-spacing: -.5px; display: flex; align-items: center; gap: 10px;
    text-transform: uppercase; transition: transform var(--transition) ease;
    color: var(--text); font-size: clamp(1.1rem, 0.5vw + 1rem, 1.3rem);
}
.navbar-brand::before { display: none; }
.navbar-brand:hover { color: var(--text); transform: translateY(-2px); }

.brand-icon { width: 26px; height: 26px; flex-shrink: 0; color: var(--accent); transition: transform var(--transition); }
.navbar-brand:hover .brand-icon { transform: rotate(-6deg) scale(1.08); }
.navbar-brand span { font-weight: 700; font-size: inherit; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; list-style: none; }
.nav-links > li > a, .nav-links > li > button {
    display: flex; align-items: center; gap: 6px; padding: 8px 16px;
    color: var(--text-secondary); font-size: clamp(0.85rem, 0.5vw + 0.8rem, 0.95rem); font-weight: 700;
    border-radius: 999px; background: var(--bg-section); transition: all var(--transition);
    white-space: nowrap; position: relative; overflow: hidden;
    border: 1px solid transparent; cursor: pointer; font-family: inherit;
}
.nav-links > li > a:hover, .nav-links > li > button:hover {
    color: var(--accent); background: var(--accent-light); text-decoration: none;
}
.nav-links > li > a:hover::after { width: 100%; opacity: 1; }
.nav-links > li > a .icon, .nav-links > li > button .icon { width: 15px; height: 15px; flex-shrink: 0; }

.nav-cta { background: var(--accent) !important; color: #fff !important; }
.nav-cta:hover { background: var(--accent-dark) !important; }
.nav-cta::after { display: none !important; }

/* DROPDOWN МЕНЮ */
.nav-item-dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: calc(100% + 10px); right: 0; background: var(--bg);
    border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); padding: 12px; 
    min-width: 480px; /* Увеличена ширина для двух колонок */
    display: grid; /* Сетка для колонок */
    grid-template-columns: repeat(2, 1fr); /* Две равные колонки */
    gap: 4px 8px; /* Отступы между ячейками */
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: all 0.3s ease; z-index: 1001; list-style: none;
}
.nav-item-dropdown.active .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    border-radius: 8px; color: var(--text-secondary) !important;
    background: transparent !important; font-weight: 500; font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap; /* Запрещаем перенос слов внутри пункта */
}
.dropdown-item:hover { background: var(--accent-light) !important; color: var(--accent) !important; }
.dropdown-item .icon { width: 16px; height: 16px; opacity: 0.8; flex-shrink: 0; }

/* ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ */
.theme-toggle {
    background: var(--bg-section); border: 1px solid transparent; border-radius: 999px;
    padding: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.theme-toggle:hover { background: var(--accent-light); border-color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; color: var(--text-secondary); transition: color 0.3s; }
.theme-toggle:hover svg { color: var(--accent); }
.theme-toggle .moon-icon { display: none; }
html[data-theme="dark"] .theme-toggle .sun-icon { display: none; }
html[data-theme="dark"] .theme-toggle .moon-icon { display: block; }

.nav-toggle {
    display: none; align-items: center; justify-content: center;
    width: 38px; height: 38px; background: var(--bg-section);
    border: 1px solid var(--border); border-radius: 10px;
    cursor: pointer; margin-left: auto; position: relative; z-index: 1100;
    -webkit-tap-highlight-color: transparent;
}
.nav-toggle span, .nav-toggle span:before, .nav-toggle span:after {
    display: block; width: 18px; height: 2px; background: var(--text);
    border-radius: 2px; position: absolute; transition: all .3s ease;
}
.nav-toggle span:before { content: ''; transform: translateY(-6px); }
.nav-toggle span:after { content: ''; transform: translateY(6px); }
.nav-toggle.active span { background: transparent; }
.nav-toggle.active span:before { transform: rotate(45deg); }
.nav-toggle.active span:after { transform: rotate(-45deg); }

@media (max-width: 1023px) { .nav-toggle { display: flex; } .nav-links { display: none; } }
@media (min-width: 1024px) {
    .navbar-brand { font-size: 1.3rem; }
    .brand-icon { width: 30px; height: 30px; }
    .nav-links > li > a { font-size: 0.95rem; }
}

/* ================================================================
6. OFFCANVAS (МОБИЛЬНОЕ МЕНЮ)
================================================================ */
.offcanvas-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0);
    opacity: 0; visibility: hidden; z-index: 1050;
    transition: opacity .4s ease, visibility .4s ease, background .4s ease;
}
.offcanvas-overlay.visible { opacity: 1; visibility: visible; background: rgba(0,0,0,.45); }

.offcanvas-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 90%; max-width: 360px;
    background: var(--bg); z-index: 1060; display: flex; flex-direction: column;
    transform: translateX(100%); visibility: hidden;
    transition: transform .45s cubic-bezier(.22,1,.36,1), visibility .45s cubic-bezier(.22,1,.36,1);
    box-shadow: -8px 0 40px rgba(0,0,0,0); overflow: hidden;
}
.offcanvas-panel.show { transform: translateX(0); visibility: visible; box-shadow: -8px 0 40px rgba(0,0,0,.15); }

.offcanvas-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px; background: linear-gradient(135deg, #0070c9 0%, #348efb 100%);
    color: #fff; flex-shrink: 0;
}
.offcanvas-title { font-size: clamp(1rem, 0.5vw + 0.95rem, 1.1rem); font-weight: 700; }

.offcanvas-close {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; background: rgba(255,255,255,.15);
    border: none; border-radius: 10px; cursor: pointer; color: #fff;
    transition: background .25s ease, transform .25s ease;
}
.offcanvas-close:hover { background: rgba(255,255,255,.3); transform: scale(1.08); }
.offcanvas-close:active { transform: scale(.95); }
.offcanvas-close svg { width: 20px; height: 20px; }

.offcanvas-nav { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 0; }

.offcanvas-link {
    display: flex; align-items: center; gap: 14px; padding: 15px 24px;
    color: var(--text); font-size: clamp(1rem, 0.5vw + 0.95rem, 1.05rem); font-weight: 500;
    position: relative; overflow: hidden; transition: color .3s ease, background .3s ease;
}
.offcanvas-link::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: var(--accent); transform: scaleY(0);
    transition: transform .3s cubic-bezier(.22,1,.36,1); border-radius: 0 4px 4px 0;
}
.offcanvas-link:hover { color: var(--accent-dark); background: var(--accent-light); }
.offcanvas-link:hover::before { transform: scaleY(1); }
.offcanvas-link:active { background: #dbeafe; }

.offcanvas-link .icon { width: 22px; height: 22px; flex-shrink: 0; color: var(--text-secondary); transition: color .3s ease; }
.offcanvas-link:hover .icon { color: var(--accent); }

.offcanvas-link .external-arrow {
    margin-left: auto; width: 16px; height: 16px; flex-shrink: 0;
    color: var(--border); transition: color .3s ease, transform .3s ease;
}
.offcanvas-link:hover .external-arrow { color: var(--accent); transform: translateX(3px); }

.offcanvas-footer {
    flex-shrink: 0; padding: 16px 24px; background: var(--bg-section); border-top: 1px solid var(--border-light);
}
.offcanvas-footer p { font-size: clamp(0.85rem, 0.5vw + 0.8rem, 0.9rem); line-height: 1.6; color: var(--text-secondary); }

@media (min-width: 1024px) { .offcanvas-overlay, .offcanvas-panel { display: none !important; } }

/* ================================================================
   3. PAGE HERO
   ================================================================ */
.page-hero {
    padding: 130px 1.25rem 48px;
    background: var(--bg-section);
    border-bottom: 1px solid var(--border-light);
    text-align: center;
}
.page-hero .container { max-width: 1200px; margin: 0 auto; }
.page-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800;
    letter-spacing: -.03em; margin-bottom: 12px;
}
.page-hero p {
    font-size: clamp(.95rem, 1.5vw, 1.1rem); color: var(--text-secondary);
    line-height: 1.7; max-width: 680px; margin: 0 auto;
}

@media (max-width: 360px) { .page-hero { padding: 115px 1rem 36px; } }
@media (min-width: 1024px) {
    .page-hero { padding: 140px 2rem 56px; }
    .page-hero h1 { font-size: 2.4rem; }
    .page-hero p { font-size: 1.15rem; }
}

/* ================================================================
   4. ОСНОВНОЙ КОНТЕЙНЕР
   ================================================================ */
main {
    flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 40px 24px;
}

.page-row { display: grid; grid-template-columns: 1fr; gap: 40px; }
.content-top { min-width: 0; }
.content-bottom { min-width: 0; }

.page-sidebar { display: block; margin: 0 auto 40px auto; max-width: 100%; order: 2; }
.content-top { order: 1; }
.content-bottom { order: 3; }

.ad-banner {
    width: 300px; max-width: 100%; height: 250px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); font-weight: 600; box-shadow: var(--shadow-sm); margin: 0 auto;
}

/* === Карточка калькулятора === */
.calc-card {
    background: var(--bg); border-radius: 18px; padding: 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.04);
    margin-bottom: 0;
}

.mode-toggle { display: inline-flex; background: var(--bg-section); border-radius: 11px; padding: 4px; margin-bottom: 24px; gap: 2px; }
.mode-btn {
    padding: 10px 22px; border: none; background: transparent; border-radius: 8px;
    font-size: 14px; font-weight: 500; color: var(--text-secondary);
    cursor: pointer; transition: all 0.18s ease; font-family: inherit; -webkit-tap-highlight-color: transparent;
}
.mode-btn.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.field { margin-bottom: 22px; }
.field > label {
    display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary);
    margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em;
}

.quick-sums { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.input-wrapper { position: relative; }
.field input {
    width: 100%; padding: 14px 68px 14px 16px; border: 1px solid var(--border); border-radius: 11px;
    font-size: 17px; font-family: inherit; color: var(--text); background: var(--bg);
    transition: border-color 0.18s, box-shadow 0.18s;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-light); }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.stepper-btns { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); display: flex; flex-direction: column; gap: 2px; }
.stepper-btn {
    background: transparent; border: none; width: 28px; height: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; color: var(--text-secondary);
    padding: 0; border-radius: 4px; transition: background 0.2s, color 0.2s; -webkit-tap-highlight-color: transparent;
}
.stepper-btn:hover, .stepper-btn:active { background: var(--bg-section); color: var(--accent); }
.stepper-btn svg { width: 14px; height: 14px; pointer-events: none; }

.clear-input-btn {
    position: absolute; top: 50%; right: 40px; transform: translateY(-50%);
    background: var(--border); border: none; width: 22px; height: 22px; border-radius: 50%;
    color: #fff; cursor: pointer; display: none; align-items: center; justify-content: center; transition: background 0.2s;
}
.clear-input-btn:hover { background: var(--text-secondary); }
.clear-input-btn.show { display: flex; }
.clear-input-btn svg { width: 12px; height: 12px; }

.rates { display: flex; flex-wrap: wrap; gap: 8px; }
.rate-btn {
    padding: 10px 18px; border: 1px solid var(--border); background: var(--bg); border-radius: 100px;
    font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; font-family: inherit;
    transition: all 0.15s ease; -webkit-tap-highlight-color: transparent;
}
.rate-btn:hover { border-color: var(--accent); color: var(--accent); }
.rate-btn.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.custom-rate { display: none; margin-top: 12px; max-width: 200px; }
.custom-rate.show { display: block; }

/* === Результаты === */
.results { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--border); }
.results-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px; }
.result-item { background: var(--bg-section); padding: 20px; border-radius: 13px; position: relative; }
.result-item .label { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; padding-right: 40px; }
.result-item .value { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; word-break: break-word; padding-right: 40px; }

.copy-icon-btn {
    position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-secondary); transition: all 0.2s ease; -webkit-tap-highlight-color: transparent;
}
.copy-icon-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); transform: scale(1.05); }
.copy-icon-btn svg { width: 16px; height: 16px; transition: all 0.2s ease; }
.copy-icon-btn .icon-check { display: none; color: var(--success); }
.copy-icon-btn.copied { background: rgba(34, 197, 94, 0.1); border-color: var(--success); color: var(--success); pointer-events: none; }
html[data-theme="dark"] .copy-icon-btn.copied { background: rgba(63, 185, 80, 0.1); }
.copy-icon-btn.copied .icon-copy { display: none; }
.copy-icon-btn.copied .icon-check { display: block; animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

.words-block { background: var(--bg-section); padding: 24px; border-radius: 13px; position: relative; }
.words-block h3 { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; }
#words-block p { font-size: 15px; color: var(--text); margin-bottom: 10px; line-height: 1.65; }
#words-block p:last-child { margin-bottom: 0; }

.words-actions { position: absolute; top: 18px; right: 18px; display: flex; gap: 8px; }
.copy-btn-text, .print-btn {
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 14px;
    font-size: 13px; color: var(--text); cursor: pointer; font-family: inherit; font-weight: 500;
    transition: all 0.15s ease; -webkit-tap-highlight-color: transparent;
}
.copy-btn-text:hover, .print-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

/* === Описание (SEO) === */
.description { max-width: 820px; font-size: 16px; color: var(--text-secondary); }
.description h2 { font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 18px; margin-top: 40px; letter-spacing: -0.01em; }
.description h3 { font-size: 19px; font-weight: 600; color: var(--text); margin: 28px 0 12px; }
.description p { margin-bottom: 16px; line-height: 1.75; }
.description ul { padding-left: 22px; margin-bottom: 16px; }
.description li { margin-bottom: 8px; line-height: 1.65; }

.rates-table-container { overflow-x: auto; margin-bottom: 24px; -webkit-overflow-scrolling: touch; }
.rates-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 500px; }
.rates-table th { background: var(--bg-section); padding: 12px; text-align: left; border: 1px solid var(--border); font-weight: 600; }
.rates-table td { padding: 12px; border: 1px solid var(--border); }
.rates-table td:first-child { font-weight: 700; color: var(--accent-dark); }
html[data-theme="dark"] .rates-table td:first-child { color: var(--accent); }

.author-block { display: flex; align-items: center; gap: 16px; margin-top: 40px; padding: 20px; background: var(--bg-section); border-radius: 12px; border: 1px solid var(--border); }
.author-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.2rem; flex-shrink: 0; }
.author-info p { margin: 0; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; }
.author-info strong { color: var(--text); font-size: 0.95rem; }

/* === FAQ Блок (Новый дизайн) === */
.faq-category { margin-bottom: 40px; }
.faq-category h2 {
    font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 20px; margin-top: 40px;
    padding-bottom: 10px; border-bottom: 1px solid var(--border-light); letter-spacing: -0.01em; line-height: 1.3;
}

.faq-item {
    margin-bottom: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: all .3s ease;
}
.faq-item:hover { box-shadow: 0 5px 15px rgba(0,0,0,.05); }

.faq-question {
    padding: 18px 22px;
    background: var(--bg);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.5;
    transition: background .3s ease;
    gap: 12px;
    -webkit-tap-highlight-color: transparent;
}
.faq-question:hover { background: var(--bg-section); }

.faq-toggle {
    width: 20px; height: 20px; flex-shrink: 0;
    color: var(--text-secondary);
    transition: transform .3s ease;
}
.faq-item.active .faq-toggle { transform: rotate(180deg); }

.faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 22px;
    transition: max-height .3s ease, padding .3s ease;
}

.faq-item.active .faq-answer {
    max-height: 800px;
    padding: 20px 22px 24px; 
}

.faq-answer p {
    color: var(--text-secondary); font-size: 0.95rem; line-height: 1.7; margin-bottom: 0;
}

/* === Кнопка "Смотреть все вопросы" внизу FAQ === */
.faq-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 28px auto 0; /* Центрирование кнопки */
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-dark);
    background: var(--accent-light);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    width: fit-content; /* Чтобы не занимала всю ширину */
}
html[data-theme="dark"] .faq-more-btn {
    color: var(--accent);
    background: var(--accent-light);
    border-color: rgba(56, 139, 253, 0.2);
}
.faq-more-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
    transform: translateY(-2px);
    text-decoration: none;
}
html[data-theme="dark"] .faq-more-btn:hover {
    color: #0d1117; /* Темный текст на светло-синем фоне для темной темы */
}
.faq-more-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}
.faq-more-btn:hover svg {
    transform: translateX(4px);
}

/* === Десктопная сетка сайдбара === */
@media (min-width: 1024px) {
    .page-row { grid-template-columns: 1fr 300px; grid-template-areas: "content-top sidebar" "content-bottom sidebar"; gap: 48px; }
    .content-top { grid-area: content-top; }
    .content-bottom { grid-area: content-bottom; }
    .page-sidebar { grid-area: sidebar; display: block; position: sticky; top: 90px; align-self: start; margin: 0; order: 0; }
    .ad-banner { height: 600px; width: 300px; }
}


/* ================================================================
   22. FOOTER (ПОДВАЛ)
   ================================================================ */
.footer {
  background: var(--bg);
  color: var(--text-secondary);
  padding: 60px 0 40px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.footer-title {
  color: var(--text);
  font-size: clamp(0.9rem, 0.5vw + 0.85rem, 1rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 20px;
  line-height: 1.4;
}

.footer-col > p {
  color: var(--text-secondary);
  font-size: clamp(0.9rem, 0.5vw + 0.85rem, 0.95rem);
  line-height: 1.7;
  word-break: normal;
  hyphens: none;
}

/* -- Ссылки подвала -- */
.footer-links {
  list-style: none;
}
.footer-links li { margin-bottom: 10px; }

.footer-links a {
  color: var(--text);
  font-size: clamp(0.9rem, 0.5vw + 0.85rem, 1rem);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition);
  line-height: 1.5;
}
.footer-links a:hover {
  color: var(--accent);
  transform: translateX(4px);
  text-decoration: none;
}

.footer-links a.disabled-link {
  opacity: .4;
  cursor: default;
}
.footer-links a.disabled-link:hover {
  color: var(--text-secondary);
  transform: none;
}

.arrow-icon {
  width: 14px;
  height: 14px;
  opacity: .35;
  transition: opacity var(--transition);
}
.footer-links a:hover .arrow-icon {
  opacity: 1;
  color: var(--accent);
}

/* -- Копирайт -- */
.copyright {
  background: #0a0a0a;
  padding: 20px 1.5rem;
  text-align: center;
  color: #555a6e;
  font-size: clamp(0.85rem, 0.5vw + 0.8rem, 0.95rem);
  border-top: 1px solid rgba(255,255,255,.04);
  line-height: 1.5;
}

/* -- Footer: адаптив -- */
@media (max-width: 992px) {
  .footer-row { grid-template-columns: repeat(2, 1fr); gap: 30px; }
}

@media (max-width: 768px) {
  .footer { padding: 36px 0 24px; }
  .footer-row { gap: 24px; }
  .footer-links a { font-size: 0.95rem; }
}

@media (max-width: 640px) {
  .footer { padding: 32px 0 20px; }
  .footer-row { grid-template-columns: 1fr; gap: 28px; }
  .copyright { font-size: 0.9rem; padding: 16px 1rem; }
}


@media print {
    .navbar, .footer, .copyright, .page-sidebar, .share-btn, .copy-icon-btn, .words-actions, .mode-toggle, .quick-sums, .clear-input-btn, .stepper-btns, .description, .rates, .offcanvas-overlay, .offcanvas-panel, .progress-wrap, .page-hero { display: none !important; }
    body { background: #fff; color: #000; }
    main { padding: 0; }
    .calc-card { box-shadow: none; border: none; padding: 0; }
    .result-item { border: 1px solid #000; background: #fff; }
    .words-block { background: #fff; border: 1px solid #000; }
}

/* === Адаптивность === */
@media (max-width: 768px) {
    main { padding: 40px 16px; }
    .calc-card { padding: 22px; border-radius: 14px; }
    .mode-toggle { display: flex; width: 100%; }
    .mode-btn { flex: 1; padding: 10px 14px; font-size: 13px; }
    .result-grid { grid-template-columns: 1fr; gap: 10px; }
    .result-item .value { font-size: 20px; }
    .words-actions { position: static; margin-bottom: 14px; }
    .description { font-size: 15px; }
    .description h2 { font-size: 22px; }
    .faq-category h2 { font-size: 22px; }
    .stepper-btns { right: 6px; background: var(--bg-section); border-radius: 6px; overflow: hidden; }
    .stepper-btn { width: 34px; height: 26px; }
    .field input { padding-right: 85px; }
    .clear-input-btn { right: 50px; }
}
@media (max-width: 480px) { h1 { font-size: 26px; } .calc-card { padding: 18px; } .field input { font-size: 16px; } .rate-btn { padding: 9px 14px; font-size: 13px; } }

/* ================================================================
   5. КНОПКА «НАВЕРХ»
   ================================================================ */
.progress-wrap {
    position: fixed; right: 22px; bottom: 40px; height: 46px; width: 46px;
    cursor: pointer; display: block; border-radius: 50px;
    box-shadow: inset 0 0 0 .1rem rgba(128,130,134,.25); z-index: 999;
    opacity: 0; visibility: hidden; transform: translateY(15px); transition: all 200ms linear;
}
.progress-wrap.active-progress { opacity: 1; visibility: visible; transform: translateY(0); }
.progress-wrap::after {
    position: absolute; font-family: 'Unicode'; font-weight: 900; content: '\25B3';
    text-align: center; line-height: 46px; font-size: 24px; color: #3f78e0;
    left: 0; top: 0; height: 46px; width: 46px; cursor: pointer; display: block; z-index: 1; transition: all 200ms linear;
}
.progress-wrap:hover::after { opacity: 0; }
.progress-wrap::before {
    position: absolute; font-family: 'Unicode'; font-weight: 900; content: '\25B3';
    text-align: center; line-height: 46px; font-size: 24px; opacity: 0;
    background-image: linear-gradient(298deg, #3f78e0, #193059);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    left: 0; top: 0; height: 46px; width: 46px; cursor: pointer; display: block; z-index: 2; transition: all 200ms linear;
}
.progress-wrap:hover::before { opacity: 1; }
.progress-wrap svg path { fill: none; }
.progress-wrap svg.progress-circle path { stroke: #3f78e0; stroke-width: 4; box-sizing: border-box; transition: all 200ms linear; }

@media (max-width: 640px) {
    .progress-wrap { right: 16px; bottom: 24px; height: 42px; width: 42px; }
    .progress-wrap::after, .progress-wrap::before { line-height: 42px; font-size: 20px; height: 42px; width: 42px; }
}
@media (min-width: 576px) { .progress-wrap.active-progress { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .progress-wrap, .progress-wrap::after { transition: none; } }