:root {
    color-scheme: light;
    --bg: #fbfaf7;
    --surface: #ffffff;
    --ink: #17211d;
    --muted: #66736e;
    --line: #dde4de;
    --accent: #1f6f5b;
    --accent-dark: #155242;
    --accent-soft: #e4f1ec;
    --warn: #9f3f2f;
    --ok: #176b3a;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

a {
    color: inherit;
}

.site-header {
    background: rgba(251, 250, 247, 0.96);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
}

.site-header-inner,
.page,
.footer-grid,
.footer-bottom {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.header-top {
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-size: 24px;
}

.brand-text {
    display: grid;
    line-height: 1.1;
}

.brand-text small {
    color: var(--muted);
    font-size: 13px;
}

.site-search,
.hero-search {
    display: flex;
    gap: 8px;
}

.site-search {
    margin-left: auto;
    width: min(420px, 42vw);
}

input[type="search"] {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

textarea {
    resize: vertical;
}

button,
.section-heading a {
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    padding: 12px 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

button:hover,
.section-heading a:hover {
    background: var(--accent-dark);
}

.menu-toggle {
    display: none;
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 14px;
}

.nav-link {
    color: var(--muted);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    font-weight: 700;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-dark);
    background: var(--accent-soft);
}

.page {
    padding: 24px 0 56px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
}

.hero,
.page-header {
    padding: 52px 0;
}

.hero-copy,
.article,
.page-header {
    max-width: 790px;
}

.eyebrow {
    color: var(--accent-dark);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 13px;
    margin: 0 0 10px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(42px, 7vw, 76px);
    line-height: 0.98;
    margin-bottom: 18px;
}

h2 {
    font-size: 28px;
    line-height: 1.15;
}

.hero p,
.page-header p,
.lead {
    color: var(--muted);
    font-size: 20px;
}

.hero-search {
    margin-top: 28px;
    max-width: 680px;
}

.section {
    margin-top: 44px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.entry-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.entry-card,
.category-list a,
.compact-list a,
.answer-box,
details,
.source-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.entry-card a,
.category-list a,
.compact-list a {
    display: block;
    min-height: 100%;
    padding: 18px;
    text-decoration: none;
}

.entry-card span,
.compact-list span,
.category-list span,
.category-list em {
    color: var(--muted);
    font-size: 14px;
}

.entry-card h3 {
    margin: 8px 0;
    font-size: 22px;
    line-height: 1.18;
}

.entry-card p,
.compact-list span,
.category-list span {
    margin: 0;
}

.two-column {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
}

.category-list,
.compact-list {
    display: grid;
    gap: 12px;
}

.category-list-large {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.category-list strong,
.compact-list strong {
    display: block;
    margin-bottom: 4px;
}

.article-header {
    margin-bottom: 32px;
}

.answer-box {
    padding: 20px;
    margin: 22px 0;
    background: var(--accent-soft);
}

.answer-box span {
    display: block;
    color: var(--accent-dark);
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
}

.answer-box strong {
    display: block;
    margin-top: 4px;
    font-size: 34px;
}

.answer-box p {
    margin: 6px 0 0;
    color: var(--muted);
}

.article-section {
    margin-top: 34px;
}

.prose {
    font-size: 18px;
}

.variant-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.variant {
    border-radius: 999px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--line);
    font-weight: 700;
}

.variant.correct {
    color: var(--ok);
    background: #eef8f1;
}

.variant.incorrect {
    color: var(--warn);
    background: #fff0ed;
    text-decoration: line-through;
}

.example-list {
    display: grid;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.example-list li {
    border-left: 4px solid var(--line);
    background: #fff;
    padding: 12px 14px;
    border-radius: 0 8px 8px 0;
}

.example-list li.correct {
    border-left-color: var(--ok);
}

.example-list li.incorrect {
    border-left-color: var(--warn);
    color: var(--muted);
}

details {
    padding: 16px 18px;
    margin-bottom: 10px;
}

summary {
    cursor: pointer;
    font-weight: 800;
}

.sources ul {
    padding-left: 20px;
}

.source-list {
    display: grid;
    gap: 14px;
    max-width: 790px;
}

.source-item {
    padding: 18px;
}

.source-item h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.source-item p {
    color: var(--muted);
    margin-bottom: 8px;
}

.source-item span {
    color: var(--accent-dark);
    font-weight: 800;
    font-size: 14px;
}

.ad-slot {
    display: block;
    width: 100%;
    min-height: 90px;
    margin: 28px 0;
}

.ad-slot-home_top,
.ad-slot-category_top {
    margin: 12px 0 34px;
}

.article .ad-slot {
    max-width: 790px;
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.6fr);
    gap: 28px;
    align-items: start;
}

.contact-form,
.contact-note {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
}

.contact-form {
    display: grid;
    gap: 16px;
}

.contact-form label {
    display: grid;
    gap: 6px;
    font-weight: 800;
}

.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.notice {
    border-radius: 8px;
    padding: 14px 16px;
}

.notice ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.notice.success {
    background: #eef8f1;
    color: var(--ok);
}

.notice.error {
    background: #fff0ed;
    color: var(--warn);
}

.empty-state {
    padding: 22px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
}

.site-footer {
    background: #17211d;
    color: #e8eee9;
    padding: 42px 0 22px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 28px;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
}

.site-footer nav {
    display: grid;
    gap: 8px;
}

.site-footer h2 {
    font-size: 16px;
    margin-bottom: 4px;
}

.site-footer p,
.footer-bottom {
    color: #b7c5bd;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 18px;
}

.footer-link-button {
    background: transparent;
    color: #e8eee9;
    border: 0;
    padding: 0;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(980px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(23, 33, 29, 0.18);
}

.cookie-banner h2,
.cookie-panel h2 {
    font-size: 20px;
    margin-bottom: 6px;
}

.cookie-banner p,
.cookie-panel p {
    margin-bottom: 8px;
    color: var(--muted);
}

.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.button.secondary,
button.secondary {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.button.secondary:hover,
button.secondary:hover {
    background: #d5e8e0;
}

.cookie-panel {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(23, 33, 29, 0.42);
}

.cookie-panel-inner {
    position: relative;
    width: min(620px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    padding: 24px;
    background: #fff;
    border-radius: 8px;
}

.cookie-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 24px;
    line-height: 1;
}

.cookie-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.cookie-choice strong,
.cookie-choice small {
    display: block;
}

.cookie-choice small {
    color: var(--muted);
}

@media (max-width: 820px) {
    .header-top {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 0;
    }

    .menu-toggle {
        display: inline-grid;
        gap: 4px;
        margin-left: auto;
        padding: 10px;
        width: 42px;
        height: 42px;
        place-content: center;
    }

    .menu-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: currentColor;
    }

    .site-search {
        order: 3;
        width: 100%;
        margin-left: 0;
    }

    .nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
    }

    .site-header.is-menu-open .nav,
    .nav.is-open {
        display: flex;
    }

    .entry-grid,
    .two-column,
    .category-list-large,
    .contact-layout,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero,
    .page-header {
        padding: 36px 0;
    }

    .hero-search {
        flex-direction: column;
    }

    .cookie-banner,
    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .cookie-actions {
        justify-content: flex-start;
    }
}
