/* ============================================
   ТЕМЫ
   ============================================ */
:root {
    /* 🌌 Тёмный киберпанк (по умолчанию) */
    --bg-gradient: linear-gradient(135deg, #000000 0%, #0a0a1a 40%, #1a0033 100%);
    --text-color: #e0e0ff;
    --text-muted: #8888aa;
    --accent: #00d4ff;
    --accent-2: #a855f7;
    --card-bg: rgba(10, 10, 26, 0.7);
    --card-border: rgba(0, 212, 255, 0.15);
    --header-bg: rgba(10, 10, 26, 0.8);
    --header-border: rgba(0, 212, 255, 0.2);
    --footer-bg: rgba(5, 5, 15, 0.5);
    --input-bg: rgba(0, 0, 0, 0.5);
    --input-border: rgba(0, 212, 255, 0.3);
}

[data-theme="light"] {
    /* ☀️ Светлый минимализм */
    --bg-gradient: linear-gradient(135deg, #ffffff 0%, #f0f4ff 50%, #e0e8ff 100%);
    --text-color: #1a1a2e;
    --text-muted: #666688;
    --accent: #0066cc;
    --accent-2: #7c3aed;
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(0, 102, 204, 0.15);
    --header-bg: rgba(255, 255, 255, 0.9);
    --header-border: rgba(0, 102, 204, 0.2);
    --footer-bg: rgba(240, 245, 255, 0.7);
    --input-bg: rgba(255, 255, 255, 0.8);
    --input-border: rgba(0, 102, 204, 0.3);
}

[data-theme="sunset"] {
    /* 🌅 Закат */
    --bg-gradient: linear-gradient(135deg, #1a0a1f 0%, #3d1a33 40%, #7c2d4a 100%);
    --text-color: #ffe0e6;
    --text-muted: #cc99aa;
    --accent: #ff6b9d;
    --accent-2: #ffa94d;
    --card-bg: rgba(40, 10, 30, 0.7);
    --card-border: rgba(255, 107, 157, 0.2);
    --header-bg: rgba(30, 10, 25, 0.8);
    --header-border: rgba(255, 107, 157, 0.25);
    --footer-bg: rgba(20, 5, 15, 0.5);
    --input-bg: rgba(0, 0, 0, 0.4);
    --input-border: rgba(255, 107, 157, 0.3);
}

[data-theme="ocean"] {
    /* 🌊 Океан */
    --bg-gradient: linear-gradient(135deg, #001a2e 0%, #003d5c 50%, #00a0b0 100%);
    --text-color: #e0f7ff;
    --text-muted: #7ab8cc;
    --accent: #00d4ff;
    --accent-2: #00ffb3;
    --card-bg: rgba(0, 30, 50, 0.7);
    --card-border: rgba(0, 212, 255, 0.2);
    --header-bg: rgba(0, 25, 45, 0.8);
    --header-border: rgba(0, 212, 255, 0.25);
    --footer-bg: rgba(0, 15, 30, 0.5);
    --input-bg: rgba(0, 0, 0, 0.4);
    --input-border: rgba(0, 212, 255, 0.3);
}

[data-theme="forest"] {
    /* 🌲 Лес */
    --bg-gradient: linear-gradient(135deg, #0a1f0a 0%, #14331a 40%, #2d5a2d 100%);
    --text-color: #e0ffe6;
    --text-muted: #99cc99;
    --accent: #4ade80;
    --accent-2: #a3e635;
    --card-bg: rgba(15, 35, 20, 0.7);
    --card-border: rgba(74, 222, 128, 0.2);
    --header-bg: rgba(10, 25, 15, 0.8);
    --header-border: rgba(74, 222, 128, 0.25);
    --footer-bg: rgba(5, 15, 10, 0.5);
    --input-bg: rgba(0, 0, 0, 0.4);
    --input-border: rgba(74, 222, 128, 0.3);
}

/* ============================================
   ОБЩИЕ НАСТРОЙКИ
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
    transition: background 0.5s ease, color 0.3s ease;
}

a {
    color: #00d4ff;
    text-decoration: none;
    transition: color 0.3s;
}
a:hover {
    color: #a855f7;
}


/* ============================================
   ШАПКА
   ============================================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.header-title {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(90deg, #00d4ff, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.theme-switcher {
    display: flex;
    gap: 6px;
    margin-right: 12px;
}

.theme-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
    line-height: 1;
}

.theme-btn:hover {
    border-color: var(--accent);
    transform: scale(1.1);
}

.theme-btn.active {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent);
}

.btn-telegram {
    background: linear-gradient(90deg, #00d4ff, #0088cc);
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}
.btn-telegram:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.5);
}


/* ============================================
   КОНТЕЙНЕР
   ============================================ */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 30px 20px;
}

.section-title {
    font-size: 20px;
    margin-bottom: 15px;
    color: #00d4ff;
}


/* ============================================
   КОНВЕРТЕР
   ============================================ */
.converter {
    background: rgba(10, 10, 26, 0.7);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.1);
}

.converter-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.input, .select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 10px;
    padding: 12px 15px;
    color: #e0e0ff;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
}

.input:focus, .select:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.input {
    flex: 1;
    min-width: 120px;
}

.select {
    flex: 2;
    min-width: 150px;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(90deg, #a855f7, #00d4ff);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(168, 85, 247, 0.5);
}

.convert-result {
    margin-top: 15px;
    font-size: 18px;
    color: #00d4ff;
    font-weight: 600;
    min-height: 27px;
}


/* ============================================
   ПОИСК
   ============================================ */
.search-section {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    background: rgba(10, 10, 26, 0.7);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    padding: 15px 20px;
    color: #e0e0ff;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
}
.search-input:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}


/* ============================================
   КАТЕГОРИИ
   ============================================ */
.categories {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.cat-btn {
    background: rgba(10, 10, 26, 0.7);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    padding: 10px 18px;
    color: #e0e0ff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}
.cat-btn:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}
.cat-btn.active {
    background: linear-gradient(90deg, #00d4ff, #a855f7);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}


/* ============================================
   СЕТКА ВАЛЮТ
   ============================================ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.card {
    background: rgba(10, 10, 26, 0.7);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 14px;
    padding: 18px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.card:hover {
    border-color: #00d4ff;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.card-flag {
    font-size: 28px;
}

.card-code {
    font-size: 18px;
    font-weight: 700;
    color: #00d4ff;
}

.card-name {
    font-size: 13px;
    color: #8888aa;
    margin-left: auto;
    text-align: right;
}

.card-price {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 8px 0;
}

.card-price-unit {
    font-size: 13px;
    color: #8888aa;
}

.card-change {
    font-size: 14px;
    font-weight: 600;
    margin-top: 5px;
}
.card-change.up {
    color: #4ade80;
}
.card-change.down {
    color: #f87171;
}

.card-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 212, 255, 0.1);
    font-size: 12px;
    color: #8888aa;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #8888aa;
    font-size: 16px;
}


/* ============================================
   ПОДВАЛ
   ============================================ */
.footer {
    margin-top: 60px;
    padding: 30px 20px;
    border-top: 1px solid rgba(0, 212, 255, 0.15);
    background: rgba(5, 5, 15, 0.5);
}

.footer-content {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-fox {
    width: 60px;
    height: 60px;
    border-radius: 12px;
}

.footer-text {
    flex: 1;
}
.footer-text p {
    margin-bottom: 4px;
}
.footer-small {
    font-size: 12px;
    color: #666688;
}

.footer-links {
    display: flex;
    gap: 15px;
}
.footer-links a {
    font-size: 14px;
}


/* ============================================
   МОДАЛЬНОЕ ОКНО
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a0033 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    padding: 30px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.3);
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: #e0e0ff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover {
    background: rgba(0, 212, 255, 0.2);
    transform: rotate(90deg);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-right: 40px;
}

.modal-flag {
    font-size: 48px;
}

.modal-title-group {
    display: flex;
    flex-direction: column;
}

.modal-code {
    font-size: 24px;
    font-weight: 700;
    color: #00d4ff;
}

.modal-name {
    font-size: 14px;
    color: #8888aa;
}

.modal-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.modal-price-value {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
}

.modal-price-unit {
    font-size: 14px;
    color: #8888aa;
}

.modal-change {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    min-height: 27px;
}
.modal-change.up {
    color: #4ade80;
}
.modal-change.down {
    color: #f87171;
}

.modal-periods {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.period-btn {
    background: rgba(10, 10, 26, 0.7);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 10px;
    padding: 8px 16px;
    color: #e0e0ff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}
.period-btn:hover {
    border-color: #00d4ff;
}
.period-btn.active {
    background: linear-gradient(90deg, #00d4ff, #a855f7);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

.modal-chart-wrapper {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 300px;
    height: 300px;
}

.modal-chart-loading,
.modal-chart-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #8888aa;
    font-size: 16px;
    text-align: center;
}

.modal-btn-telegram {
    display: block;
    text-align: center;
    background: linear-gradient(90deg, #00d4ff, #0088cc);
    color: #fff !important;
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}
.modal-btn-telegram:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.5);
}


/* ============================================
   АДАПТИВ
   ============================================ */
@media (max-width: 768px) {
    .header {
        padding: 12px 15px;
    }
    .header-title {
        font-size: 18px;
    }
    .btn-telegram {
        padding: 8px 12px;
        font-size: 13px;
    }
    .grid {
        grid-template-columns: 1fr;
    }
    .converter-form {
        flex-direction: column;
    }
    .input, .select, .btn-primary {
        width: 100%;
    }
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    .modal-content {
        padding: 20px;
    }
    .modal-flag {
        font-size: 36px;
    }
    .modal-code {
        font-size: 20px;
    }
    .modal-price-value {
        font-size: 24px;
    }
    .modal-chart-wrapper {
        height: 250px;
    }
}
/* ============================================
   МЕНЮ НАВИГАЦИИ
   ============================================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: #0a0a1a;
    border-bottom: 1px solid #1a1a3a;
    flex-wrap: wrap;
    gap: 15px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 10px 18px;
    border-radius: 10px;
    background: transparent;
    color: #8899bb;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.nav-btn:hover {
    color: #fff;
    background: #1a1a3a;
}

.nav-btn.active {
    background: linear-gradient(90deg, #00d4ff, #7b2fff);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

/* ============================================
   TELEGRAM-ИКОНКА (квадрат с выезжающим текстом)
   ============================================ */
.telegram-icon {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #0088cc, #00d4ff);
    border-radius: 12px;
    padding: 12px;
    text-decoration: none;
    color: #fff;
    transition: all 0.4s ease;
    overflow: hidden;
    max-width: 50px;
    box-shadow: 0 0 20px rgba(0, 136, 204, 0.4);
}

.telegram-icon:hover {
    max-width: 300px;
    padding-right: 20px;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.7);
}

.tg-icon {
    font-size: 20px;
    min-width: 26px;
    text-align: center;
}

.tg-text {
    white-space: nowrap;
    font-weight: 700;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
    margin-left: 0;
}

.telegram-icon:hover .tg-text {
    opacity: 1;
    margin-left: 10px;
}
/* ============================================
   ШАПКА — новая версия (не дёргается)
   ============================================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: #0a0a1a;
    border-bottom: 1px solid #1a1a3a;
    gap: 15px;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-nav {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.nav-btn {
    padding: 10px 18px;
    border-radius: 10px;
    background: transparent;
    color: #8899bb;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    border: 2px solid transparent;
    white-space: nowrap;
}

.nav-btn:hover {
    color: #fff;
    background: #1a1a3a;
}

.nav-btn.active {
    background: linear-gradient(90deg, #00d4ff, #7b2fff);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

/* ============================================
   TELEGRAM — иконка + выезжающий текст
   ============================================ */
.telegram-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.telegram-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #0088cc, #00d4ff);
    border-radius: 12px;
    text-decoration: none;
    color: #fff;
    font-size: 20px;
    box-shadow: 0 0 20px rgba(0, 136, 204, 0.4);
    transition: box-shadow 0.3s, transform 0.3s;
    position: relative;
    z-index: 2;
}

.telegram-icon:hover {
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.8);
    transform: scale(1.05);
}

.tg-text {
    position: absolute;
    right: 55px;
    top: 50%;
    transform: translateY(-50%) translateX(15px);
    background: linear-gradient(135deg, #0088cc, #00d4ff);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
}

.telegram-wrap:hover .tg-text {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Темы — под Telegram */
.theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: #1a1a3a;
    border: 2px solid #2a2a5a;
    border-radius: 12px;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.theme-btn:hover {
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}
.theme-picker {
    display: flex;
    gap: 6px;
    background: #1a1a3a;
    padding: 6px;
    border-radius: 12px;
}

.theme-btn {
    width: 36px;
    height: 36px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:hover { background: #2a2a5a; }
.theme-btn.active {
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
}


/* Theme compatibility and shared variable-based surfaces */
[data-theme="dark"], [data-theme="cyberpunk"] {
    --bg-gradient: linear-gradient(135deg, #000 0%, #0a0a1a 40%, #1a0033 100%);
}
[data-theme="blue"] {
    --bg-gradient: linear-gradient(135deg, #001225 0%, #062d52 55%, #064b72 100%);
    --text-color: #e7f7ff; --text-muted: #91b8ce; --accent: #38bdf8; --accent-2: #2563eb;
    --card-bg: rgba(3, 30, 55, .82); --card-border: rgba(56, 189, 248, .25);
    --header-bg: rgba(2, 24, 45, .9); --header-border: rgba(56, 189, 248, .28);
    --footer-bg: rgba(2, 20, 38, .7); --input-bg: rgba(1, 18, 34, .75); --input-border: rgba(56, 189, 248, .35);
}
.header { background: var(--header-bg); border-color: var(--header-border); }
.converter, .search-input, .cat-btn, .card { background: var(--card-bg); border-color: var(--card-border); color: var(--text-color); }
.input, .select { background: var(--input-bg); border-color: var(--input-border); color: var(--text-color); }
.section-title, .convert-result { color: var(--accent); }
.theme-picker { background: var(--card-bg); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

[data-theme="violet"] {
    --bg-gradient: linear-gradient(135deg, #12051f 0%, #35105c 52%, #711b8d 100%);
    --text-color: #f7eaff; --text-muted: #c6a5d8; --accent: #e879f9; --accent-2: #8b5cf6;
    --card-bg: rgba(35, 12, 58, .82); --card-border: rgba(232, 121, 249, .25);
    --header-bg: rgba(25, 7, 43, .9); --header-border: rgba(232, 121, 249, .28);
    --footer-bg: rgba(20, 5, 35, .72); --input-bg: rgba(22, 5, 38, .8); --input-border: rgba(232, 121, 249, .35);
}

@media (max-width: 760px) {
    .theme-picker { max-width: 180px; overflow-x: auto; }
}

/* Единый аккуратный интерфейс: навигация и темы теперь только в боковом меню */
.header-nav, .header .theme-picker { display: none !important; }
.header { min-height: 74px; padding: 12px clamp(16px,4vw,42px); box-shadow: 0 10px 35px rgba(0,0,0,.12); }
.header-right { margin-left: auto; }
.container { animation: page-in .45s ease both; }
.card, .converter, .dashboard-card, .auth-card { box-shadow: 0 12px 35px rgba(0,0,0,.12); }
.card { transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
@keyframes page-in { from { opacity:0; transform:translateY(9px) } to { opacity:1; transform:none } }
[data-font="rounded"] body { font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", sans-serif; }
[data-font="serif"] body { font-family: Georgia, "Times New Roman", serif; }
[data-font="mono"] body { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
[data-theme="aurora"] { --bg-gradient:linear-gradient(135deg,#031b1d,#073e3b 48%,#41205f);--text-color:#e8fff9;--text-muted:#9ccbc2;--accent:#5eead4;--accent-2:#c084fc;--card-bg:rgba(5,42,43,.82);--card-border:rgba(94,234,212,.25);--header-bg:rgba(3,27,29,.92);--header-border:rgba(94,234,212,.25);--input-bg:rgba(2,28,29,.8);--input-border:rgba(94,234,212,.35) }
[data-theme="coffee"] { --bg-gradient:linear-gradient(135deg,#1d120d,#3b2418 52%,#6b4230);--text-color:#fff4e6;--text-muted:#cdb49e;--accent:#f5b971;--accent-2:#c67c4e;--card-bg:rgba(55,32,21,.84);--card-border:rgba(245,185,113,.22);--header-bg:rgba(30,18,12,.92);--header-border:rgba(245,185,113,.22);--input-bg:rgba(30,17,11,.78);--input-border:rgba(245,185,113,.32) }
[data-theme="mono"] { --bg-gradient:linear-gradient(135deg,#090909,#202020);--text-color:#f5f5f5;--text-muted:#aaa;--accent:#fff;--accent-2:#777;--card-bg:rgba(25,25,25,.9);--card-border:rgba(255,255,255,.16);--header-bg:rgba(10,10,10,.94);--header-border:rgba(255,255,255,.14);--input-bg:#111;--input-border:#555 }
[data-theme="rose"] { --bg-gradient:linear-gradient(135deg,#fff7fa,#ffe2ed 55%,#fbcfe8);--text-color:#4a1730;--text-muted:#93617a;--accent:#db2777;--accent-2:#f472b6;--card-bg:rgba(255,255,255,.82);--card-border:rgba(219,39,119,.18);--header-bg:rgba(255,248,251,.92);--header-border:rgba(219,39,119,.18);--input-bg:rgba(255,255,255,.75);--input-border:rgba(219,39,119,.28) }
.favorite-btn { position:absolute; right:12px; top:12px; z-index:2; border:0; background:rgba(0,0,0,.18); color:#aaa; width:32px; height:32px; border-radius:9px; cursor:pointer; font-size:17px; }
.favorite-btn.active { color:#ffd43b; background:rgba(255,212,59,.14); }
.font-section { margin-top:12px }.font-section select { width:100%;padding:9px;border-radius:9px;background:var(--input-bg);border:1px solid var(--input-border);color:var(--text-color) }
@media(max-width:760px){.header-title{font-size:19px}.header-logo{width:36px;height:36px}.telegram-icon{width:40px;height:40px}.header{min-height:64px}}

/* Polished controls and currency chart */
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb,var(--accent) 45%,transparent); outline-offset: 3px; }
.btn-primary, .cat-btn, .period-btn, .account-shortcut, .edit-profile { transition: transform .2s ease,box-shadow .2s ease,border-color .2s ease; }
.btn-primary { background:linear-gradient(105deg,var(--accent-2),var(--accent));box-shadow:0 8px 24px color-mix(in srgb,var(--accent) 22%,transparent) }
.btn-primary:hover,.cat-btn:hover,.period-btn:hover { transform:translateY(-2px) }
.cat-btn { background:var(--card-bg);border:1px solid var(--card-border);color:var(--text-muted);font-weight:750 }
.cat-btn.active { background:linear-gradient(105deg,var(--accent-2),var(--accent));box-shadow:0 8px 24px color-mix(in srgb,var(--accent) 20%,transparent) }
.modal-content { background:var(--header-bg);border-color:var(--card-border);box-shadow:0 32px 100px rgba(0,0,0,.42) }
.modal-code { color:var(--accent) }.modal-name,.modal-price-unit{color:var(--text-muted)}.modal-price-value{color:var(--text-color)}
.modal-chart-wrapper { background:var(--input-bg);border:1px solid var(--card-border);overflow:hidden }
.chart-stats { display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:0 0 12px }
.chart-stats span { display:grid;gap:2px;padding:10px 12px;border-radius:11px;background:var(--input-bg);color:var(--text-muted);font-size:12px }
.chart-stats b { color:var(--text-color);font-size:14px }
@media(max-width:520px){.chart-stats{grid-template-columns:1fr}.chart-stats span{display:flex;justify-content:space-between}.modal-periods{flex-wrap:nowrap;overflow-x:auto;padding-bottom:5px}.period-btn{flex:0 0 auto}}
.dashboard-settings{position:fixed;right:20px;bottom:20px;z-index:900}.dashboard-settings-button{padding:11px 15px;border:1px solid var(--card-border);border-radius:13px;background:var(--header-bg);backdrop-filter:blur(18px);color:var(--text-color);box-shadow:0 12px 35px rgba(0,0,0,.2);cursor:pointer}.dashboard-settings-popover{display:none;position:absolute;right:0;bottom:52px;width:230px;padding:16px;background:var(--header-bg);border:1px solid var(--card-border);border-radius:16px;box-shadow:0 20px 55px rgba(0,0,0,.3)}.dashboard-settings.open .dashboard-settings-popover{display:grid;gap:11px;animation:page-in .2s ease}.dashboard-settings-popover label{display:flex;gap:8px;color:var(--text-muted)}.dashboard-settings-popover button{padding:8px;border:1px solid var(--card-border);border-radius:9px;background:var(--input-bg);color:var(--text-color);cursor:pointer}.widget-hidden{display:none!important}.compact-grid{grid-template-columns:repeat(auto-fill,minmax(190px,1fr))}.compact-grid .card{padding:13px}.compact-grid .card-name,.compact-grid .card-footer{display:none}@media(max-width:600px){.dashboard-settings{right:12px;bottom:12px}.dashboard-settings-button{font-size:0}.dashboard-settings-button::first-letter{font-size:18px}}
[data-font="humanist"] body{font-family:Optima,"Segoe UI",Candara,sans-serif}[data-font="condensed"] body{font-family:"Arial Narrow","Roboto Condensed",Arial,sans-serif;font-stretch:condensed}[data-font="editorial"] body{font-family:Palatino,"Book Antiqua",Georgia,serif}[data-font="technical"] body{font-family:Eurostile,"Trebuchet MS",Arial,sans-serif;letter-spacing:.015em}[data-font="accessible"] body{font-family:Verdana,Tahoma,sans-serif;line-height:1.65}[data-font="playful"] body{font-family:"Comic Sans MS","Trebuchet MS",cursive}
[data-theme="arctic"]{--bg-gradient:linear-gradient(135deg,#eaf8ff,#ccecff 55%,#e8f5ff);--text-color:#102c3c;--text-muted:#537487;--accent:#087ea4;--accent-2:#38bdf8;--card-bg:rgba(255,255,255,.82);--card-border:rgba(8,126,164,.2);--header-bg:rgba(239,250,255,.94);--header-border:rgba(8,126,164,.2);--input-bg:rgba(255,255,255,.78);--input-border:rgba(8,126,164,.3)}
[data-theme="gold"]{--bg-gradient:linear-gradient(135deg,#130e02,#332508 55%,#171003);--text-color:#fff7d6;--text-muted:#c9b878;--accent:#f7c948;--accent-2:#b8860b;--card-bg:rgba(45,33,8,.86);--card-border:rgba(247,201,72,.25);--header-bg:rgba(20,14,2,.94);--header-border:rgba(247,201,72,.22);--input-bg:rgba(30,21,4,.85);--input-border:rgba(247,201,72,.35)}
[data-theme="matrix"]{--bg-gradient:linear-gradient(135deg,#010702,#061b0b);--text-color:#baffc4;--text-muted:#62a86e;--accent:#35ff63;--accent-2:#00a629;--card-bg:rgba(3,25,8,.9);--card-border:rgba(53,255,99,.22);--header-bg:rgba(1,10,3,.96);--header-border:rgba(53,255,99,.22);--input-bg:#031407;--input-border:rgba(53,255,99,.35)}
[data-theme="peach"]{--bg-gradient:linear-gradient(135deg,#fff3ea,#ffd8c2 52%,#ffebd8);--text-color:#512718;--text-muted:#966857;--accent:#e85d3f;--accent-2:#ff9b73;--card-bg:rgba(255,255,255,.78);--card-border:rgba(232,93,63,.18);--header-bg:rgba(255,246,239,.94);--header-border:rgba(232,93,63,.18);--input-bg:rgba(255,255,255,.72);--input-border:rgba(232,93,63,.3)}
[data-theme="space"]{--bg-gradient:radial-gradient(circle at 75% 15%,#38206b,#09051d 43%,#02030b);--text-color:#f0eeff;--text-muted:#aaa1cf;--accent:#9d7cff;--accent-2:#36d8ff;--card-bg:rgba(18,12,49,.82);--card-border:rgba(157,124,255,.24);--header-bg:rgba(6,4,22,.94);--header-border:rgba(54,216,255,.2);--input-bg:rgba(10,7,31,.82);--input-border:rgba(157,124,255,.34)}
[data-theme="mint"]{--bg-gradient:linear-gradient(135deg,#effff8,#c9f7df,#e6fff4);--text-color:#123b2c;--text-muted:#548271;--accent:#0d9f6e;--accent-2:#53d6a1;--card-bg:rgba(255,255,255,.8);--card-border:rgba(13,159,110,.18);--header-bg:rgba(241,255,249,.94);--header-border:rgba(13,159,110,.18);--input-bg:rgba(255,255,255,.74);--input-border:rgba(13,159,110,.3)}
[data-theme="volcano"]{--bg-gradient:linear-gradient(140deg,#130303,#40100a 50%,#160403);--text-color:#fff1e9;--text-muted:#d39b88;--accent:#ff593d;--accent-2:#ff9b32;--card-bg:rgba(47,10,7,.86);--card-border:rgba(255,89,61,.24);--header-bg:rgba(20,3,3,.95);--header-border:rgba(255,89,61,.22);--input-bg:rgba(32,6,5,.86);--input-border:rgba(255,89,61,.34)}
[data-theme="paper"]{--bg-gradient:linear-gradient(135deg,#f4eedf,#e8ddc5);--text-color:#302b23;--text-muted:#756b59;--accent:#765c31;--accent-2:#ad8750;--card-bg:rgba(255,252,242,.83);--card-border:rgba(80,64,38,.2);--header-bg:rgba(245,238,220,.95);--header-border:rgba(80,64,38,.2);--input-bg:rgba(255,253,247,.72);--input-border:rgba(80,64,38,.3)}
[data-text-size="large"] body{font-size:18px}[data-text-size="large"] small{font-size:.82em}[data-motion="reduced"] *,[data-motion="reduced"] *::before,[data-motion="reduced"] *::after{animation-duration:.001ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.001ms!important}
.market-lab{margin:24px 0}.market-lab-head{display:flex;align-items:end;justify-content:space-between;gap:15px;margin-bottom:14px}.market-lab-head label{display:grid;gap:6px;color:var(--text-muted);font-size:12px}.market-lab-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.lab-card{padding:18px;border:1px solid var(--card-border);border-radius:17px;background:var(--card-bg);box-shadow:0 12px 30px rgba(0,0,0,.08)}.lab-card h3{margin:0 0 6px}.lab-card>p{color:var(--text-muted);font-size:13px}.lab-form{display:grid;grid-template-columns:1fr 100px 1fr auto;gap:7px}.mini-list,.comparison-list,.cbdc-list{display:grid;gap:6px;margin-top:11px}.mini-list>div,.comparison-list>div,.cbdc-list>div{display:flex;align-items:center;gap:8px;padding:9px;border-radius:9px;background:var(--input-bg);font-size:12px}.mini-list>div span,.comparison-list>div span{color:var(--text-muted)}.mini-list>div small{margin-left:auto;color:var(--text-muted)}.mini-list>div button{margin-left:auto;border:0;background:transparent;color:var(--text-muted);cursor:pointer}.comparison-list>div b{min-width:74px}.comparison-list>div em{margin-left:auto;font-style:normal;font-weight:800}.cbdc-list>div{display:grid;grid-template-columns:auto 1fr}.cbdc-list>div span{grid-row:1/3;font-size:22px}.cbdc-list small{color:var(--text-muted)}.target-chips{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}.target-chips button{padding:7px 10px;border:1px solid var(--card-border);border-radius:8px;background:var(--input-bg);color:var(--text-muted);cursor:pointer}.target-chips button.active{border-color:var(--accent);color:var(--text-color);background:color-mix(in srgb,var(--accent) 12%,var(--input-bg))}.ghost-btn{margin-top:9px;padding:8px 11px;border:1px solid var(--card-border);border-radius:8px;background:transparent;color:var(--text-muted);cursor:pointer}.empty-lab{padding:12px!important;text-align:center}.metals-info a{color:var(--accent);font-weight:750}@media(max-width:800px){.market-lab-grid{grid-template-columns:1fr}.lab-form{grid-template-columns:1fr 1fr}.lab-form button{grid-column:1/-1}.market-lab-head{align-items:stretch;flex-direction:column}}@media(max-width:430px){.lab-form{grid-template-columns:1fr}.lab-form button{grid-column:auto}.comparison-list>div{display:grid;grid-template-columns:1fr 1fr}.comparison-list>div em{margin-left:0}.market-lab-head .select{width:100%}}

/* Единый конвертер: переключаемые режимы без перегрузки главной страницы. */
.converter-hub-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.converter-tools-link{padding:9px 12px;border:1px solid var(--card-border);border-radius:10px;color:var(--accent);white-space:nowrap}.converter-tabs{display:flex;gap:7px;margin:14px 0;overflow-x:auto;padding-bottom:4px}.converter-tabs button{flex:0 0 auto;padding:10px 14px;border:1px solid var(--card-border);border-radius:10px;background:var(--input-bg);color:var(--text-color);font:inherit;cursor:pointer}.converter-tabs button.active{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 14%,var(--input-bg));color:var(--accent)}.converter-view[hidden]{display:none}.converter-view>p{color:var(--text-muted)}@media(max-width:620px){.converter-hub-head{display:grid}.converter-tools-link{width:max-content}.converter-tabs{margin-inline:-4px}}
.currency-view-tools{display:flex;justify-content:flex-end;align-items:center;gap:9px;margin:-8px 0 16px}.currency-view-tools label{display:flex;align-items:center;gap:8px;color:var(--text-muted);font-size:13px}.currency-view-tools select,.currency-view-tools button{min-height:40px;padding:8px 11px;border:1px solid var(--input-border);border-radius:10px;background:var(--input-bg);color:var(--text-color);font:inherit}.currency-view-tools button{cursor:pointer;font-weight:750}.currency-view-tools button[aria-pressed="true"]{border-color:var(--accent);color:var(--accent);background:color-mix(in srgb,var(--accent) 12%,var(--input-bg))}.grid.compact-currencies{grid-template-columns:repeat(auto-fill,minmax(165px,1fr));gap:9px}.grid.compact-currencies .card{padding:13px;min-height:120px}.grid.compact-currencies .card-name,.grid.compact-currencies .card-footer{display:none}.grid.compact-currencies .card-price{font-size:21px}@media(max-width:560px){.currency-view-tools{align-items:stretch;display:grid;grid-template-columns:1fr auto}.currency-view-tools label{display:grid;gap:4px}.grid.compact-currencies{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Keep home-screen settings away from the site-wide assistant. */
.dashboard-settings{left:20px!important;right:auto!important}.dashboard-settings-popover{left:0!important;right:auto!important}@media(max-width:760px){.dashboard-settings{left:10px!important;right:auto!important;bottom:calc(78px + env(safe-area-inset-bottom))!important}}
