:root {
    --bg: #f4f7f8;
    --panel: #ffffff;
    --ink: #162028;
    --muted: #667985;
    --line: #dbe5e9;
    --green: #0f9f6e;
    --green-dark: #08724f;
    --blue: #2367d1;
    --amber: #f4a51c;
    --danger: #d34b4b;
    --shadow: 0 18px 48px rgba(20, 42, 55, .08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-main { min-height: 70vh; }

.topline { background: #101b22; color: #c8d5dc; font-size: 13px; }
.topline-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topline-inner { min-height: 34px; }
.quick-links { display: flex; gap: 16px; }
.quick-links a { color: #eef7f4; }
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.header-main {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr) 230px;
    align-items: center;
    gap: 18px;
    min-height: 76px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-weight: 800; font-size: 22px; }
.brand-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 8px; background: var(--green); color: #fff; font-size: 16px; }
.main-nav { min-width: 0; }
.main-nav ul, .fallback-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; align-items: center; justify-content: center; }
.fallback-menu.is-hidden { display: none; }
.main-nav .menu + .fallback-menu, .main-nav ul:not(:empty) + .fallback-menu { display: none; }
.main-nav a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 42px;
    padding: 8px 9px;
    color: #31434e;
    font-weight: 750;
    line-height: 1.15;
    white-space: nowrap;
}
.main-nav li { position: relative; }
.main-nav li.menu-item-has-children > a::after {
    content: "⌄";
    display: inline-flex;
    align-items: center;
    margin-left: 3px;
    font-size: 14px;
    color: var(--muted);
}
.main-nav li.menu-item-has-children::after {
    content: "";
    position: absolute;
    left: -8px;
    right: -8px;
    top: 100%;
    height: 16px;
}
.main-nav .sub-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 230px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 8px;
    z-index: 40;
}
.main-nav li:hover > .sub-menu { display: grid; gap: 2px; }
.main-nav li:focus-within > .sub-menu { display: grid; gap: 2px; }
.main-nav .sub-menu a { display: block; padding: 9px 10px; border-radius: 6px; white-space: nowrap; }
.main-nav .sub-menu a:hover { background: #f1f6f7; }
.header-search input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    background: #f8fbfc;
}
.nav-toggle { display: none; border: 0; background: var(--ink); color: #fff; border-radius: 8px; width: 42px; height: 42px; font-size: 22px; }

.hero { background: linear-gradient(180deg, #fff 0%, #eef7f4 100%); padding: 42px 0 34px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.35fr .8fr; gap: 28px; align-items: center; }
.eyebrow { margin: 0 0 8px; color: var(--green-dark); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; }
h1, h2, h3 { line-height: 1.12; margin: 0; letter-spacing: 0; }
.hero h1 { font-size: clamp(36px, 5vw, 64px); max-width: 720px; }
.hero p:not(.eyebrow) { color: var(--muted); font-size: 19px; max-width: 650px; }
.hero-actions, .offer-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 8px;
    font-weight: 800;
    border: 1px solid transparent;
    cursor: pointer;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-wide { width: 100%; }

.loan-widget, .filters-panel, .guide-sidebar .side-block, .side-block, .profile-cta {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.loan-widget { padding: 22px; }
.loan-widget h2 { font-size: 24px; margin-bottom: 16px; }
.loan-widget label { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); }
input[type="range"] { width: 100%; accent-color: var(--green); }
.widget-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.widget-grid div { background: #f4f7f8; padding: 12px; border-radius: 8px; }
.widget-grid span, .offer-metrics span, .profile-metrics span { display: block; color: var(--muted); font-size: 13px; }

.product-rail {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 24px;
}
.product-rail a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    font-weight: 800;
}
.product-rail span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #eaf6f1; color: var(--green-dark); }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-top: 34px; margin-bottom: 14px; }
.section-head h2 { font-size: 32px; }
.section-head a { color: var(--blue); font-weight: 800; }
.compact { margin-top: 0; }

.offers-list { display: grid; gap: 14px; }
.offer-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) 172px;
    gap: 18px;
    align-items: center;
    padding: 18px 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.offer-logo {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfc;
    color: var(--green-dark);
    font-weight: 900;
    overflow: hidden;
}
.offer-logo.large { width: 104px; height: 104px; font-size: 28px; }
.offer-logo img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.offer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.offer-head h3 { font-size: 20px; margin-bottom: 5px; max-width: 620px; }
.offer-head p { margin: 0; color: var(--muted); }
.rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
    color: #7a5a13;
    background: #fff5d8;
    border-radius: 8px;
    padding: 6px 10px;
    font-weight: 900;
    white-space: nowrap;
}
.rating span { color: var(--amber); }
.offer-metrics, .profile-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.offer-metrics div, .profile-metrics div {
    background: #f5f8fa;
    border-radius: 8px;
    padding: 12px 13px;
    min-width: 0;
}
.offer-metrics strong, .profile-metrics strong { display: block; overflow-wrap: anywhere; }
.offer-actions { min-width: 0; flex-direction: column; }
.offer-actions .btn { width: 100%; min-height: 54px; font-size: 18px; }

.catalog-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; margin: 26px 0 40px; }
.filters-panel { padding: 16px; position: sticky; top: 94px; }
.filters-panel h2 { font-size: 22px; margin-bottom: 16px; }
.filters-panel label { display: block; margin: 0 0 14px; font-weight: 750; }
.filters-panel select, .filters-panel input[type="range"] { margin-top: 7px; width: 100%; }
.filters-panel select { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.filters-panel .check { display: flex; gap: 8px; align-items: center; color: #31434e; font-weight: 650; }
.catalog-head { display: flex; justify-content: space-between; align-items: start; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-bottom: 14px; }
.catalog-head h1 { font-size: 38px; }
.catalog-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: end; }
.catalog-chips span { background: #eaf3ff; color: #164c9b; padding: 7px 10px; border-radius: 8px; font-weight: 800; }
.catalog-intro { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; margin-bottom: 14px; color: #3f515c; }
.guide-sidebar { display: none; }
.side-block { padding: 16px; }
.side-block h3 { font-size: 20px; margin-bottom: 12px; }
.side-block a, .side-offer { display: block; padding: 10px 0; border-top: 1px solid var(--line); color: #2b4656; font-weight: 750; }
.side-offer span { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }

.split-section { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 34px; margin-bottom: 44px; }
.mini-grid, .article-list { display: grid; gap: 12px; }
.mini-card, .article-list a, .post-card a {
    display: block;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}
.mini-card span, .article-list span, .post-card span { color: var(--muted); font-size: 13px; }
.article-list strong, .mini-card strong { display: block; margin-top: 4px; }

.page-shell, .article-layout, .profile-layout { display: grid; gap: 24px; margin-top: 28px; margin-bottom: 46px; }
.page-shell { grid-template-columns: 1fr 310px; align-items: start; }
.article-layout { grid-template-columns: minmax(0, 760px) 320px; align-items: start; }
.profile-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.content-column, .article-body, .profile-main {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 26px;
}
.article-body h1 { font-size: clamp(32px, 5vw, 50px); margin-bottom: 16px; }
.article-body h2 { margin-top: 30px; margin-bottom: 10px; font-size: 28px; }
.article-body p, .article-body li { color: #334750; }
.article-body a { color: var(--blue); font-weight: 750; }
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    display: block;
    max-width: 100%;
}
.article-body tbody, .article-body thead { display: table; width: 100%; }
.article-body th, .article-body td { border-bottom: 1px solid var(--line); padding: 12px; text-align: left; vertical-align: top; }
.article-body th { background: #f2f7f8; color: #22353f; }
.article-body tr:last-child td { border-bottom: 0; }
.article-body blockquote {
    margin: 20px 0;
    padding: 16px 18px;
    border-left: 4px solid var(--green);
    background: #eef7f4;
    border-radius: 0 8px 8px 0;
}
.article-cover { border-radius: 8px; margin: 10px 0 20px; width: 100%; }
.article-sidebar { position: sticky; top: 94px; display: grid; gap: 14px; }
.internal-links {
    display: grid;
    gap: 8px;
    background: #eef7f4;
    border: 1px solid #cce6dc;
    border-radius: 8px;
    padding: 16px;
    margin: 18px 0 22px;
}
.internal-links a { color: var(--blue); font-weight: 800; }
.unsubscribe-hero-note {
    display: grid;
    gap: 4px;
    margin: 14px 0 18px;
    padding: 14px 16px;
    border: 1px solid #f1d79b;
    border-radius: 8px;
    background: #fff7df;
    color: #5b4512;
}
.editorial-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 14px 0 18px;
}
.editorial-box div {
    padding: 14px 15px;
    border-radius: 8px;
    background: #f6f9fb;
    border: 1px solid var(--line);
}
.editorial-box strong {
    display: block;
    margin-bottom: 5px;
    color: #20343f;
}
.editorial-box span {
    display: block;
    color: var(--muted);
    font-size: 14px;
}
.unsubscribe-hero-note strong { font-size: 18px; }
.unsubscribe-hero-note span { color: #765b19; }
.action-box {
    margin: 18px 0 22px;
    padding: 16px 18px;
    border-radius: 8px;
    background: #f1f8ff;
    border: 1px solid #cfe2fb;
}
.action-box strong {
    display: block;
    margin-bottom: 8px;
    color: #174d8f;
    font-size: 18px;
}
.action-box ol {
    margin: 0;
    padding-left: 20px;
}
.action-box li { margin: 5px 0; }
.inline-offers {
    margin: 24px 0;
    padding: 18px;
    border-radius: 8px;
    border: 1px solid #cce6dc;
    background: #f3fbf8;
}
.inline-offers-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}
.inline-offers-head span {
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}
.inline-offers-head strong { font-size: 20px; }
.inline-offers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.inline-offer {
    display: block;
    padding: 13px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
}
.inline-offer strong {
    display: block;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.25;
}
.inline-offer span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}
.faq-block details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq-block summary { cursor: pointer; font-weight: 900; }

.post-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 20px; }
.post-card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid var(--line);
    padding: 22px;
}
.post-card h2 { font-size: 22px; margin: 5px 0 8px; }

.profile-hero { display: flex; gap: 18px; align-items: center; margin-bottom: 20px; }
.profile-hero h1 { font-size: clamp(32px, 5vw, 52px); }
.profile-hero p:last-child { color: var(--muted); margin: 8px 0 0; }
.profile-metrics { margin-bottom: 22px; }
.profile-cta { padding: 18px; position: sticky; top: 94px; }
.profile-cta h2 { margin-bottom: 14px; }
.profile-cta .btn + .btn { margin-top: 10px; }

.site-footer { background: #101b22; color: #d7e1e6; padding: 34px 0 18px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.footer-brand { font-size: 24px; font-weight: 900; color: #fff; }
.site-footer h3 { color: #fff; margin-bottom: 10px; }
.site-footer a { display: block; color: #d7e1e6; margin: 8px 0; }
.footer-menu, .footer-menu li { list-style: none; margin: 0; padding: 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 24px; padding-top: 16px; color: #9fb0ba; }

@media (max-width: 1180px) {
    .header-main { grid-template-columns: 220px minmax(0, 1fr) 190px; gap: 12px; }
    .brand { font-size: 20px; }
    .main-nav a { padding: 8px 6px; font-size: 15px; }
}

@media (max-width: 1020px) {
    .header-main { display: flex; }
    .header-search { display: none; }
    .hero-grid, .catalog-layout, .page-shell, .article-layout, .profile-layout, .split-section { grid-template-columns: 1fr; }
    .filters-panel, .guide-sidebar, .article-sidebar, .profile-cta { position: static; }
    .catalog-layout { gap: 14px; }
    .product-rail { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
    .container { width: min(100% - 24px, 1180px); }
    .topline { display: none; }
    .header-main { min-height: 64px; }
    .nav-toggle { display: inline-grid; place-items: center; }
    .main-nav { display: none; position: absolute; inset: 64px 12px auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 12px; }
    .main-nav.is-open { display: block; }
    .main-nav ul, .fallback-menu { display: grid; gap: 6px; }
    .fallback-menu.is-hidden { display: none; }
    .main-nav a { display: flex; padding: 10px; white-space: normal; }
    .main-nav .sub-menu {
        position: static;
        display: grid;
        min-width: 0;
        border: 0;
        box-shadow: none;
        padding: 4px 0 4px 12px;
        background: #f8fbfc;
    }
    .hero { padding: 24px 0; }
    .hero h1 { font-size: 38px; }
    .hero p:not(.eyebrow) { font-size: 16px; }
    .product-rail { grid-template-columns: 1fr 1fr; }
    .offer-card { grid-template-columns: 64px 1fr; }
    .offer-logo { width: 58px; height: 58px; }
    .offer-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; min-width: 0; }
    .offer-actions .btn { min-height: 48px; font-size: 16px; }
    .offer-head { display: block; }
    .rating { display: inline-flex; margin-top: 8px; }
    .offer-metrics, .profile-metrics { grid-template-columns: 1fr 1fr; }
    .inline-offers-head { display: block; }
    .inline-offers-grid { grid-template-columns: 1fr; }
    .editorial-box { grid-template-columns: 1fr; }
    .catalog-head { display: block; }
    .catalog-head h1 { font-size: 32px; }
    .catalog-chips { justify-content: start; margin-top: 12px; }
    .content-column, .article-body, .profile-main { padding: 18px; }
    .post-grid, .footer-grid { grid-template-columns: 1fr; }
    .profile-hero { align-items: flex-start; }
}
