/**
 * Allbanks.kz — orange brand theme (#ff8a16)
 * Overrides legacy style.min.css + platform app.css
 */

:root {
    --orange: #ff8a16;
    --orange-dark: #e67a0f;
    --orange-soft: #fef1e2;
    --orange-bg: #fff8f0;
    --font-body: "Golos Text", Arial, sans-serif;
    --font-heading: "Commissioner", "Golos Text", Arial, sans-serif;
}

:root[data-theme="dark"] {
    --orange-soft: #3a2a17;
    --orange-bg: #221a12;
}

/* ── Base ─────────────────────────────────────────────────── */

body.theme-orange,
body.theme-magazine {
    font-family: var(--font-body) !important;
    background: #f5f5f5 !important;
    color: #1a1a1a !important;
    line-height: 1.5 !important;
}

body.theme-orange h1,
body.theme-orange h2,
body.theme-orange h3,
body.theme-orange h4,
body.theme-orange h5,
body.theme-orange h6,
body.theme-magazine h1,
body.theme-magazine h2,
body.theme-magazine h3,
body.theme-magazine h4,
body.theme-magazine h5,
body.theme-magazine h6,
body.theme-orange .section-title,
body.theme-magazine .section-title,
body.theme-orange .page-hero h1,
body.theme-magazine .page-hero h1,
body.theme-orange .home-hero h1,
body.theme-magazine .list-card h2,
body.theme-magazine .office-card__title,
body.theme-magazine .cabinet-card__head h2,
body.theme-magazine .filter-box h2,
.mfo-page__head h1,
.mfo-page section h2,
.related-section h2 {
    font-family: var(--font-heading) !important;
}

.theme-orange .main {
    background: #f5f5f5;
}

.theme-orange a {
    color: #1a1a1a;
}

.theme-orange a:hover {
    color: #c45a00;
}

.theme-orange .section-link,
.theme-orange .page-hero__lead a,
.theme-orange .cross-link a,
.theme-orange .home-offer-card__link,
.theme-orange .bank-page a,
.theme-orange .data-table a:hover {
    color: #c45a00;
}

.theme-orange .section-link:hover,
.theme-orange .page-hero__lead a:hover {
    color: #a34d00;
}

.theme-orange .nav__link {
    color: #1a1a1a !important;
}

.theme-orange .header {
    background: #fff !important;
    border-bottom: 1px solid #ebebeb !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

/* Sticky translucent header (30% transparent).
   No backdrop-filter: it creates a containing block for the fixed mobile
   subnavs (.subnav { position: fixed; bottom: -300% }) and makes them overlap
   the content. position: sticky + rgba background is safe. */
.theme-orange .header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.7) !important;
}

.theme-orange .nav__link {
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.theme-orange .nav__link:hover {
    color: var(--orange) !important;
    background: var(--orange-soft);
}

.theme-orange .nav__link.nav__link--current {
    color: var(--orange) !important;
}

.theme-orange .header__btn.btn {
    background: var(--orange) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 7px 16px !important;
    font-weight: 600 !important;
}

.theme-orange .header__btn.btn:hover {
    background: var(--orange-dark) !important;
}

.theme-orange .language-switcher__circle {
    background-color: var(--orange) !important;
}

/* ── Stable desktop header (no jump on locale switch) ─────── */

@media (min-width: 1100px) {
    .theme-orange .header__inner {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px 20px;
    }

    .theme-orange .header__logo {
        margin-right: 0;
        grid-column: 1;
    }

    .theme-orange .header__menu {
        grid-column: 2;
        justify-self: center;
        min-width: 0;
        width: 100%;
    }

    .theme-orange .header__actions {
        grid-column: 3;
        display: flex;
        align-items: center;
        gap: 12px;
        flex-shrink: 0;
    }

    .theme-orange .header__actions .header__btn {
        margin-left: 0 !important;
        min-width: 76px;
        text-align: center;
        white-space: nowrap;
    }

    .theme-orange .header__actions .language-switcher {
        margin-left: 0;
        flex-shrink: 0;
    }

    .theme-orange .nav__list {
        justify-content: center;
        flex-wrap: nowrap;
        column-gap: clamp(6px, 0.85vw, 12px);
    }

    .theme-orange .nav__link {
        font-size: 13px;
        padding: 4px 5px;
    }

    .theme-orange .nav__text {
        white-space: nowrap;
    }
}

@media (min-width: 1100px) and (max-width: 1280px) {
    .theme-orange .nav__link {
        font-size: 12px;
        padding: 4px 3px;
    }

    .theme-orange .nav__list {
        column-gap: 6px;
    }
}

.theme-orange .subnav {
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
}

.theme-orange .subnav__link:hover {
    color: var(--orange) !important;
    background: var(--orange-soft) !important;
}

/* ── Header dropdowns (desktop) ───────────────────────────── */

.theme-orange .nav__link.nav__link--subnav {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.theme-orange .subnav__link--all {
    font-weight: 600;
    color: var(--orange) !important;
}

@media (min-width: 1100px) {
    .theme-orange .header,
    .theme-orange .header .container,
    .theme-orange .header__inner,
    .theme-orange .header__menu,
    .theme-orange .nav,
    .theme-orange .nav__list {
        overflow: visible !important;
    }

    .theme-orange .nav__item {
        z-index: 1;
    }

    .theme-orange .nav__item:hover,
    .theme-orange .nav__item:focus-within {
        z-index: 50;
    }

    .theme-orange .nav__item:hover .subnav,
    .theme-orange .nav__item:focus-within .subnav,
    .theme-orange .user_profile:hover .profile-subnav,
    .theme-orange .user_profile:focus-within .profile-subnav {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto;
    }

    .theme-orange .subnav,
    .theme-orange .profile-subnav {
        z-index: 100;
        margin-top: -2px;
        padding-top: 14px;
    }

    /* Invisible hover bridge between nav link and dropdown panel */
    .theme-orange .subnav::before,
    .theme-orange .profile-subnav::before {
        content: "";
        position: absolute;
        top: 0;
        left: -16px;
        right: -16px;
        height: 18px;
    }

    .theme-orange .nav__opacity:not(.active) {
        pointer-events: none !important;
        visibility: hidden !important;
    }

    .theme-orange .user_profile {
        z-index: 1;
    }

    .theme-orange .user_profile:hover,
    .theme-orange .user_profile:focus-within {
        z-index: 50;
    }
}

/* ── Buttons ──────────────────────────────────────────────── */

.theme-orange .btn,
.btn--primary {
    background: var(--orange) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    transition: background 0.15s;
}

.theme-orange .btn:hover,
.btn--primary:hover {
    background: var(--orange-dark) !important;
    color: #fff !important;
}

.btn--ghost {
    background: #fff !important;
    color: #1a1a1a !important;
    border: 1px solid #e6e6e6 !important;
}

.btn--ghost:hover {
    border-color: var(--orange) !important;
    color: var(--orange) !important;
    background: var(--orange-soft) !important;
}

/* ── Cards & sections ─────────────────────────────────────── */

.home-section--card,
.rates-table-wrap,
.list-card,
.card,
.highlight-card,
.toolbar,
.home-offer-card,
.bank-page__info,
.bank-page__branches,
.bank-page__news,
.product-page__specs,
.micro-card,
.blog-sidebar,
.search-panel {
    background: color-mix(in srgb, var(--surface) 70%, transparent) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05) !important;
}

.list-card:hover,
.home-offer-card:hover,
.highlight-card:hover {
    border-color: #ffd4a8 !important;
    box-shadow: 0 4px 16px rgba(255, 138, 22, 0.12) !important;
}

.section-title {
    color: #1a1a1a !important;
    font-weight: 700 !important;
}

.section-link {
    color: #c45a00 !important;
    font-weight: 600 !important;
}

.home-currency-card__head,
.data-table th,
.rates-table th {
    background: var(--orange-soft) !important;
    color: #555 !important;
}

.highlight-card__value {
    color: #1a1a1a !important;
}

/* ── Cross-links & chips ──────────────────────────────────── */

.cross-link {
    background: var(--orange-soft) !important;
    border: 1px solid #ffd4a8 !important;
    border-radius: 10px !important;
}

.cross-link a {
    color: #c45a00 !important;
    font-weight: 700 !important;
}

.cross-link--plain {
    background: #fff !important;
    border-color: #ebebeb !important;
}

.city-chip.is-active {
    background: var(--orange) !important;
    border-color: var(--orange) !important;
    color: #fff !important;
}

.city-chip:hover {
    border-color: #ffb366 !important;
    color: #1a1a1a !important;
    background: #fff8f0 !important;
}

.city-chip__count {
    opacity: 0.75;
}

/* ── Home hero ────────────────────────────────────────────── */

.home-hero__spotlight {
    background: linear-gradient(145deg, #d96a0a 0%, #ff8a16 50%, #ffb347 100%) !important;
}

.home-quick-nav__item {
    border-radius: 16px !important;
}

.home-quick-nav__item:hover {
    border-color: #ffd4a8 !important;
    color: #1a1a1a !important;
    box-shadow: 0 8px 28px rgba(255, 138, 22, 0.12) !important;
}

.home-quick-nav__icon {
    background: none !important;
    width: auto !important;
    height: auto !important;
}

.home-quick-nav__label {
    color: #1a1a1a !important;
}

.home-quick-nav__hint {
    color: #777 !important;
}

.rate-pill--buy {
    background: #e8f5e9 !important;
    color: #2e7d32 !important;
}

.rate-pill--sale {
    background: #ffebee !important;
    color: #c62828 !important;
}

.best-rate {
    color: #2e7d32 !important;
}

.badge--paid {
    background: var(--orange-soft) !important;
    color: var(--orange-dark) !important;
}

/* ── Tables (fix custom.css tr{display:flex}) ─────────────── */

.rates-table tr,
.data-table tr,
.home-bank-table tr {
    display: table-row !important;
}

.rates-table th,
.rates-table td,
.data-table th,
.data-table td {
    display: table-cell !important;
}

.rates-table tr:hover td {
    background: var(--orange-bg) !important;
}

/* ── Forms ────────────────────────────────────────────────── */

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 24px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.search-form label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #555;
}

.search-form input,
.search-form select {
    display: block;
    margin-top: 4px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font: inherit;
    min-width: 9rem;
    background: #fff;
}

.search-form input:focus,
.search-form select:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 138, 22, 0.15);
}

.search-form button,
.toolbar button {
    padding: 9px 20px;
    background: var(--orange) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    cursor: pointer;
}

.search-form button:hover {
    background: var(--orange-dark) !important;
}

.toolbar select {
    border-color: #ddd !important;
    border-radius: 6px !important;
}

/* ── Pagination & filters ───────────────────────────────── */

.pagination a,
.pagination span {
    border-radius: 6px !important;
}

.pagination .is-active,
.pagination span.is-active {
    background: var(--orange) !important;
    border-color: var(--orange) !important;
    color: #fff !important;
}

.list-filters a.is-active,
.list-filters a:hover,
.filter-chips a.is-active,
.filter-chips a:hover,
.blog-rubrics a.is-active,
.blog-rubrics a:hover {
    background: var(--orange) !important;
    color: #fff !important;
}

.list-filters a,
.filter-chips a,
.blog-rubrics a {
    background: var(--orange-soft);
}

/* ── MFO / offer pages ────────────────────────────────────── */

.mfo-page__head {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.mfo-page__head img {
    max-height: 64px;
    object-fit: contain;
}

.mfo-page__head h1 {
    margin: 0 0 6px;
    font-size: 1.5rem;
}

.mfo-page section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #ebebeb;
}

.mfo-page section h2 {
    font-size: 1.125rem;
    margin: 0 0 14px;
}

.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.link-list li + li {
    margin-top: 8px;
}

.quote-block {
    margin: 0 0 14px;
    padding: 16px 18px;
    background: var(--orange-bg);
    border-left: 3px solid var(--orange);
    border-radius: 0 8px 8px 0;
}

.quote-block footer {
    font-size: 0.8125rem;
    color: #888;
    margin-top: 8px;
}

.offer-cta {
    display: inline-block;
    padding: 12px 28px;
    background: var(--orange) !important;
    color: #fff !important;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none !important;
}

.offer-cta:hover {
    background: var(--orange-dark) !important;
    color: #fff !important;
}

.related-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #ebebeb;
}

.related-section h2 {
    font-size: 1.125rem;
    margin: 0 0 14px;
}

/* ── Footer ───────────────────────────────────────────────── */

.theme-orange .site-footer {
    background: #fff !important;
    border-top: 1px solid #ebebeb;
    margin-top: 0 !important;
}

.theme-orange .site-footer__bar {
    background: #fafafa;
    border-top: 1px solid #ebebeb;
}

.theme-orange .site-footer__links a:hover,
.theme-orange .site-footer__legal a:hover,
.theme-orange .site-footer__email:hover {
    color: var(--orange) !important;
}

.theme-orange .footer__link:hover {
    color: var(--orange) !important;
}

/* ── Alerts ───────────────────────────────────────────────── */

.alert-success {
    background: #e8f5e9 !important;
    border-color: #a5d6a7 !important;
    color: #2e7d32 !important;
}

.alert-danger {
    background: #ffebee !important;
    border-color: #ef9a9a !important;
    color: #c62828 !important;
}

@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form input,
    .search-form select {
        width: 100%;
        min-width: 0;
    }

    .mfo-page__head {
        flex-direction: column;
        text-align: center;
    }
}
/* ── Magazine theme (site-wide, aligned with news/blog) ─────── */

body.theme-magazine {
    background: #f4f5f8;
    --magazine-max: 1320px;
    --magazine-gutter: 40px;
}

body.theme-magazine .container {
    width: min(var(--magazine-max), calc(100% - var(--magazine-gutter)));
}

body.theme-magazine .container.page {
    max-width: none;
}

body.theme-magazine .page-hero {
    margin-bottom: 24px;
    padding: 28px 32px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff 0%, #fff8f0 100%);
    border: 1px solid var(--border);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

body.theme-magazine .page-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(1.75rem, 3.5vw, 2.35rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

body.theme-magazine .page-hero__lead {
    margin: 0;
    max-width: none;
    font-size: 1.0625rem;
    line-height: 1.65;
}

/* Wider content blocks (override narrow defaults in app.css) */

body.theme-magazine .content-article,
body.theme-magazine .content-page,
body.theme-magazine .bank-page,
body.theme-magazine .content-related,
body.theme-magazine .product-page,
body.theme-magazine .entity-reviews--page,
body.theme-magazine .author-page__experience {
    max-width: none;
    width: 100%;
}

body.theme-magazine .blog-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 36px;
}

body.theme-magazine .list-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

body.theme-magazine .home-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 540px);
}

body.theme-magazine .cabinet-grid {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

body.theme-magazine .filter-chips {
    margin-bottom: 22px;
}

body.theme-magazine .filter-chips a {
    border-radius: 999px;
    font-weight: 600;
}

body.theme-magazine .content-feed,
body.theme-magazine .list-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}

body.theme-magazine .list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

body.theme-magazine .list-grid .list-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
    margin: 0;
}

body.theme-magazine .list-card,
body.theme-magazine .content-card {
    border-bottom: 1px solid var(--border);
}

body.theme-magazine .list-card:last-child,
body.theme-magazine .content-card:last-child {
    border-bottom: none;
}

body.theme-magazine .list-card {
    padding: 20px 22px;
    transition: background 0.2s, box-shadow 0.2s;
}

body.theme-magazine .list-card:hover {
    background: #fffaf5;
}

body.theme-magazine .list-card h2,
body.theme-magazine .list-card h3 {
    font-size: 1.0625rem;
    line-height: 1.35;
}

body.theme-magazine .list-card--bank,
body.theme-magazine .list-card--mfo {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 16px;
    align-items: center;
}

body.theme-magazine .list-card__logo {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
}

body.theme-magazine .product-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

body.theme-magazine .product-card,
body.theme-magazine .micro-offer-card,
body.theme-magazine .bank-card {
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

body.theme-magazine .product-card:hover,
body.theme-magazine .micro-offer-card:hover,
body.theme-magazine .bank-card:hover {
    transform: translateY(-2px);
    border-color: #ffd4a8;
    box-shadow: 0 12px 28px rgba(255, 138, 22, 0.12);
}

body.theme-magazine .card {
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
}

body.theme-magazine .data-table {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
}

body.theme-magazine .data-table thead th {
    background: #fff8f0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

body.theme-magazine .section-head {
    margin-bottom: 18px;
}

body.theme-magazine .section-title {
    letter-spacing: -0.02em;
}

body.theme-magazine .home-section {
    margin-bottom: 36px;
}

body.theme-magazine .blog-layout {
    gap: 28px;
}

body.theme-magazine .blog-sidebar {
    padding: 20px 22px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
}

body.theme-magazine .product-page,
body.theme-magazine .entity-hero {
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

body.theme-magazine .detail-back a {
    font-weight: 600;
    color: var(--primary);
}

body.theme-magazine .pagination {
    margin-top: 24px;
}

/* ── User & bank cabinets ───────────────────────────────────── */

body.theme-magazine .page-hero--compact {
    padding: 22px 28px;
}

body.theme-magazine .user-profile__head {
    gap: 20px;
}

body.theme-magazine .user-profile__avatar {
    width: 72px;
    height: 72px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

body.theme-magazine .office-card,
body.theme-magazine .user-profile__card,
body.theme-magazine .auth-card {
    max-width: none;
    width: 100%;
    padding: 24px 28px;
    background: #fff;
}

body.theme-magazine .auth-card {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

body.theme-magazine .office-card__title {
    margin: 0 0 16px;
    font-size: 1.125rem;
    letter-spacing: -0.01em;
}

body.theme-magazine .office-stats li {
    padding: 12px 0;
    line-height: 1.65;
}

body.theme-magazine .office-stats li a {
    font-weight: 600;
    color: var(--primary);
}

body.theme-magazine .office-actions {
    gap: 12px;
    margin-top: 4px;
}

body.theme-magazine .meta-list li {
    padding: 12px 0;
}

body.theme-magazine .meta-list strong {
    min-width: 120px;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

body.theme-magazine .cabinet-grid {
    gap: 18px;
    margin: 24px 0 40px;
}

body.theme-magazine .cabinet-card {
    padding: 22px 24px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

body.theme-magazine .cabinet-card:hover {
    transform: translateY(-2px);
    border-color: #ffd4a8;
    box-shadow: 0 12px 28px rgba(255, 138, 22, 0.1);
}

body.theme-magazine .cabinet-card__head h2 {
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
}

body.theme-magazine .cabinet-card__actions {
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

body.theme-magazine .toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 20px;
    padding: 16px 20px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

body.theme-magazine .cabinet-toolbar {
    margin-bottom: 18px;
}

body.theme-magazine .cabinet-toolbar a {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    color: var(--primary);
    background: #fff8f0;
    border: 1px solid #ffd4a8;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

body.theme-magazine .cabinet-toolbar a:hover {
    background: #fff;
    border-color: var(--primary);
}

body.theme-magazine .cabinet-back a {
    font-weight: 600;
    color: var(--primary);
}

body.theme-magazine .office-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    margin: 0 0 24px;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
}

body.theme-magazine .office-table th,
body.theme-magazine .office-table td {
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
}

body.theme-magazine .office-table tr:last-child td {
    border-bottom: none;
}

body.theme-magazine .office-table th {
    background: #fff8f0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 700;
}

body.theme-magazine .office-table tr.altrow {
    background: #fffcf8;
}

body.theme-magazine .office-table .actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: 4px;
    border-radius: 8px;
    color: var(--primary);
    background: #fff8f0;
    text-decoration: none;
}

body.theme-magazine .office-table .actions a:hover {
    background: #ffd4a8;
}

body.theme-magazine .filter-box {
    max-width: none;
    margin: 0 0 24px;
    padding: 20px 22px;
    background: linear-gradient(135deg, #fff 0%, #fff8f0 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
}

body.theme-magazine .filter-box h2 {
    font-size: 1rem;
    letter-spacing: -0.01em;
}

body.theme-magazine .filter-box select,
body.theme-magazine .filter-box input[type=text] {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
}

body.theme-magazine .cabinet-form {
    max-width: none;
    width: 100%;
    margin: 0 0 24px;
    padding: 24px 28px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
}

body.theme-magazine .cabinet-form label {
    display: block;
    margin: 16px 0 8px;
    font-weight: 600;
    font-size: 0.875rem;
}

body.theme-magazine .cabinet-form label:first-child {
    margin-top: 0;
}

body.theme-magazine .cabinet-form input[type=text],
body.theme-magazine .cabinet-form input[type=number],
body.theme-magazine .cabinet-form select,
body.theme-magazine .cabinet-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

body.theme-magazine .cabinet-form input:focus,
body.theme-magazine .cabinet-form select:focus,
body.theme-magazine .cabinet-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 138, 22, 0.15);
}

body.theme-magazine .cabinet-form textarea {
    min-height: 7rem;
    resize: vertical;
}

body.theme-magazine .cabinet-form .row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

body.theme-magazine .cabinet-form .hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 6px;
}

body.theme-magazine .cabinet-form .checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    margin-top: 14px;
}

body.theme-magazine .cabinet-form .checkbox-row input {
    width: auto;
}

body.theme-magazine .cabinet-form .btn-submit {
    margin-top: 20px;
}

body.theme-magazine .office-form.card {
    max-width: none;
    width: 100%;
    margin: 0 0 24px;
    padding: 24px 28px;
}

body.theme-magazine .platform-form--inline .form-field__control {
    border-radius: 10px;
}

body.theme-magazine .auth-card__footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
}

body.theme-magazine .auth-card__footer a {
    font-weight: 600;
    color: var(--primary);
}

body.theme-magazine .confirm-code-hint {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff8f0;
}

body.theme-magazine .empty-state.card {
    padding: 48px 32px;
}

body.theme-magazine .pagination-wrap ul {
    gap: 6px;
}

body.theme-magazine .pagination-wrap a,
body.theme-magazine .pagination-wrap span {
    border-radius: 10px;
    border-color: var(--border);
    font-weight: 600;
}

body.theme-magazine .pagination-wrap span.current {
    background: var(--primary);
    border-color: var(--primary);
}

body.theme-magazine .flash-ok {
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    font-weight: 600;
}

body.theme-magazine .rates-table-wrap--readable {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
}

body.theme-magazine .rates-table--readable thead th {
    background: #fff8f0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 768px) {
    body.theme-magazine .page-hero {
        padding: 20px 18px;
    }

    body.theme-magazine .list-card--bank,
    body.theme-magazine .list-card--mfo {
        grid-template-columns: 56px 1fr;
    }

    body.theme-magazine .office-card,
    body.theme-magazine .auth-card,
    body.theme-magazine .cabinet-form,
    body.theme-magazine .office-form.card {
        padding: 18px 16px;
    }

    body.theme-magazine .cabinet-form .row-2 {
        grid-template-columns: 1fr;
    }

    body.theme-magazine .office-table {
        display: block;
        overflow-x: auto;
    }
}

/* Override legacy Gotham / Roboto (style.min.css, custom.css) */
body.theme-orange .wrapper *,
body.theme-magazine .wrapper * {
    font-family: var(--font-body) !important;
}

body.theme-orange h1,
body.theme-orange h2,
body.theme-orange h3,
body.theme-orange h4,
body.theme-orange h5,
body.theme-orange h6,
body.theme-magazine h1,
body.theme-magazine h2,
body.theme-magazine h3,
body.theme-magazine h4,
body.theme-magazine h5,
body.theme-magazine h6,
body.theme-orange .section-title,
body.theme-magazine .section-title,
body.theme-orange .page-hero h1,
body.theme-magazine .page-hero h1,
body.theme-orange .home-hero h1,
body.theme-magazine .list-card h2,
body.theme-magazine .office-card__title,
body.theme-magazine .cabinet-card__head h2,
body.theme-magazine .filter-box h2,
body.theme-orange .site-footer__title,
.mfo-page__head h1,
.mfo-page section h2,
.related-section h2 {
    font-family: var(--font-heading) !important;
}

/* ══════════════════════════════════════════════════════════════
   Dark theme — site-wide overrides for legacy (!important) rules.
   Toggle: [data-theme="dark"] on <html>, set by theme-toggle.js.
   Base tokens (--bg/--surface/--text/--text-muted/--border) are
   already redefined in app.css; this block covers hardcoded hex
   colors that don't read those tokens.
   ══════════════════════════════════════════════════════════════ */

:root[data-theme="dark"] .theme-orange,
:root[data-theme="dark"] .theme-magazine {
    background: var(--bg) !important;
    color: var(--text) !important;
}

:root[data-theme="dark"] .theme-orange .main,
:root[data-theme="dark"] body.theme-magazine {
    background: var(--bg) !important;
}

:root[data-theme="dark"] .theme-orange a {
    color: var(--text) !important;
}

/* Header */
:root[data-theme="dark"] .theme-orange .header {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.3) !important;
}

:root[data-theme="dark"] .theme-orange .nav__link {
    color: var(--text) !important;
}

:root[data-theme="dark"] .burger span,
:root[data-theme="dark"] .burger::before,
:root[data-theme="dark"] .burger::after {
    background: var(--text) !important;
}

:root[data-theme="dark"] .header__menu {
    background: var(--surface) !important;
}

:root[data-theme="dark"] .subnav__list,
:root[data-theme="dark"] .subnav__list::before {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

:root[data-theme="dark"] .language-switcher__wrap {
    border-color: var(--border) !important;
}

:root[data-theme="dark"] .language-switcher__wrap p {
    color: var(--text) !important;
}

:root[data-theme="dark"] .language-switcher__circle {
    background-color: var(--orange) !important;
}

:root[data-theme="dark"] .language-switcher-btn.active {
    color: #0f1115 !important;
}

/* Theme toggle button */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.theme-toggle__icon--dark { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--light { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--dark { display: block; }

/* ── City switcher (header) ────────────────────────────────── */
.city-switcher {
    position: relative;
    flex-shrink: 0;
}

.city-switcher__btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 12px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font: 600 0.8125rem/1 system-ui, -apple-system, "Segoe UI", sans-serif;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, color 0.15s;
}

.city-switcher__btn:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.city-switcher__icon {
    flex-shrink: 0;
    color: var(--orange);
}

.city-switcher__name {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.city-switcher__chevron {
    flex-shrink: 0;
    opacity: 0.6;
    transition: transform 0.18s;
}

.city-switcher.is-open .city-switcher__chevron {
    transform: rotate(180deg);
}

.city-switcher__list {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    min-width: 180px;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}

.city-switcher.is-open .city-switcher__list {
    display: flex;
}

.city-switcher__option {
    text-align: left;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: 600 0.8125rem/1.3 system-ui, -apple-system, "Segoe UI", sans-serif;
    cursor: pointer;
    white-space: nowrap;
}

.city-switcher__option:hover {
    background: var(--surface-alt);
}

.city-switcher__option.is-active {
    color: var(--orange);
    background: var(--surface-alt);
}

@media (max-width: 720px) {
    .city-switcher__name {
        max-width: 90px;
    }
}

/* Cards & generic surfaces */
:root[data-theme="dark"] .home-section--card,
:root[data-theme="dark"] .rates-table-wrap,
:root[data-theme="dark"] .list-card,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .highlight-card,
:root[data-theme="dark"] .toolbar,
:root[data-theme="dark"] .home-offer-card,
:root[data-theme="dark"] .bank-page__info,
:root[data-theme="dark"] .bank-page__branches,
:root[data-theme="dark"] .bank-page__news,
:root[data-theme="dark"] .product-page__specs,
:root[data-theme="dark"] .micro-card,
:root[data-theme="dark"] .blog-sidebar,
:root[data-theme="dark"] .search-panel,
:root[data-theme="dark"] .search-form,
:root[data-theme="dark"] .mfo-page__head {
    background: color-mix(in srgb, var(--surface) 70%, transparent) !important;
    border-color: var(--border) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3) !important;
}

:root[data-theme="dark"] .search-form input,
:root[data-theme="dark"] .search-form select,
:root[data-theme="dark"] .toolbar select {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

:root[data-theme="dark"] .search-form label {
    color: var(--text-muted) !important;
}

:root[data-theme="dark"] .section-title,
:root[data-theme="dark"] .highlight-card__value,
:root[data-theme="dark"] .home-quick-nav__label {
    color: var(--text) !important;
}

:root[data-theme="dark"] .home-quick-nav__hint {
    color: var(--text-muted) !important;
}

:root[data-theme="dark"] .btn--ghost {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* Footer */
:root[data-theme="dark"] .theme-orange .site-footer {
    background: var(--surface) !important;
    border-top-color: var(--border) !important;
}

:root[data-theme="dark"] .theme-orange .site-footer__bar {
    background: var(--bg) !important;
    border-top-color: var(--border) !important;
}

/* MFO / related sections */
:root[data-theme="dark"] .mfo-page section,
:root[data-theme="dark"] .related-section {
    border-top-color: var(--border) !important;
}

/* Alerts — keep semantic hue, darken background */
:root[data-theme="dark"] .alert-success {
    background: rgba(46, 125, 50, 0.15) !important;
    border-color: rgba(46, 125, 50, 0.4) !important;
    color: #6fcf73 !important;
}

:root[data-theme="dark"] .alert-danger {
    background: rgba(198, 40, 40, 0.15) !important;
    border-color: rgba(198, 40, 40, 0.4) !important;
    color: #ef5350 !important;
}

:root[data-theme="dark"] .rate-pill--buy {
    background: rgba(46, 125, 50, 0.18) !important;
    color: #6fcf73 !important;
}

:root[data-theme="dark"] .rate-pill--sale {
    background: rgba(198, 40, 40, 0.18) !important;
    color: #ef5350 !important;
}

:root[data-theme="dark"] .best-rate {
    color: #6fcf73 !important;
}

:root[data-theme="dark"] .list-card:hover,
:root[data-theme="dark"] .home-offer-card:hover,
:root[data-theme="dark"] .highlight-card:hover,
:root[data-theme="dark"] .home-quick-nav__item:hover {
    border-color: var(--orange) !important;
    box-shadow: 0 4px 16px rgba(255, 138, 22, 0.18) !important;
}

:root[data-theme="dark"] .city-chip {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

:root[data-theme="dark"] .city-chip:hover {
    background: var(--orange-bg) !important;
    color: var(--text) !important;
}

:root[data-theme="dark"] .cross-link--plain {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}
