/* =========================================================================
   ПолисБот — plain CSS, no build step, mobile-first (PB-001 §2.5, PB-002 WP5)
   ========================================================================= */

/* ---- Fonts: self-hosted, Cyrillic + Latin (no Google host, PB-001 M10) --- */
@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/onest-cyrillic-400-normal.woff2") format("woff2");
    unicode-range: U+0400-04FF, U+0500-052F, U+2DE0-2DFF, U+A640-A69F;
}
@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/onest-latin-400-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F;
}
@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/onest-cyrillic-500-normal.woff2") format("woff2");
    unicode-range: U+0400-04FF, U+0500-052F, U+2DE0-2DFF, U+A640-A69F;
}
@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/onest-latin-500-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F;
}
@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/onest-cyrillic-600-normal.woff2") format("woff2");
    unicode-range: U+0400-04FF, U+0500-052F, U+2DE0-2DFF, U+A640-A69F;
}
@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/onest-latin-600-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F;
}
@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/onest-cyrillic-700-normal.woff2") format("woff2");
    unicode-range: U+0400-04FF, U+0500-052F, U+2DE0-2DFF, U+A640-A69F;
}
@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/onest-latin-700-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F;
}
@font-face {
    font-family: "Source Serif 4";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/source-serif-4-cyrillic-500-normal.woff2") format("woff2");
    unicode-range: U+0400-04FF, U+0500-052F, U+2DE0-2DFF, U+A640-A69F;
}
@font-face {
    font-family: "Source Serif 4";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/source-serif-4-latin-500-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F;
}
@font-face {
    font-family: "Source Serif 4";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/source-serif-4-cyrillic-600-normal.woff2") format("woff2");
    unicode-range: U+0400-04FF, U+0500-052F, U+2DE0-2DFF, U+A640-A69F;
}
@font-face {
    font-family: "Source Serif 4";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F;
}

/* ---- Tokens (PB-001 §2.5) ---- */
:root {
    --color-ground: #F6F5F1;
    --color-sidebar: #EFEDE7;
    --color-surface: #FFFFFF;
    --color-ink: #17191C;
    --color-ink-soft: #2B2E33;
    --color-muted: #5B5F66;
    --color-muted-strong: #4A4E55;
    --color-line: #E2DFD7;
    --color-line-strong: #D9D5CB;
    --color-accent: #1E5B4F;
    --color-accent-hover: #174A40;
    --color-on-dark-hover: #C9CCD1; /* link text on hover over a dark or green background */
    --color-soft-green-1: #F0F7F3;
    --color-soft-green-2: #DAEAE2;
    --color-soft-green-border: #C7DDD5;
    --color-amber-1: #FEF8EA;
    --color-amber-2: #F6E4BE;
    --color-amber-border: #EBD6A8;
    --color-amber-text: #8A5A00;
    --color-amber-text-strong: #4D3A12;
    --color-tan-1: #F4EEE1;
    --color-tan-2: #E1D4B8;
    --color-blue-1: #EBF1F5;
    --color-blue-2: #CCDAE5;
    --color-nav-current: #E3E0D8;
    --color-archive-badge: #EFEDE7;

    --gradient-primary: linear-gradient(135deg, #2C7866 0%, #1E5B4F 55%, #174A40 100%);
    --gradient-dark: linear-gradient(135deg, #3A3F47 0%, #17191C 75%);
    --gradient-mint: linear-gradient(135deg, var(--color-soft-green-1) 0%, var(--color-soft-green-2) 100%);
    --gradient-amber: linear-gradient(135deg, var(--color-amber-1) 0%, var(--color-amber-2) 100%);
    --gradient-tan: linear-gradient(150deg, var(--color-tan-1) 0%, var(--color-tan-2) 100%);
    --gradient-blue: linear-gradient(150deg, var(--color-blue-1) 0%, var(--color-blue-2) 100%);
    --shadow-button: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 3px rgba(23, 73, 63, 0.25);
    --shadow-button-dark: inset 0 1px 0 rgba(255, 255, 255, 0.10);
    --shadow-card: 0 1px 2px rgba(23, 25, 28, 0.04), 0 8px 24px rgba(23, 25, 28, 0.06);
    --shadow-launcher: 0 10px 30px rgba(23, 73, 63, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.16);

    --font-ui: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Source Serif 4", Georgia, serif;

    --header-height: 64px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --tap-min: 44px;

    /* Vertical rhythm (visual fix pass, PB-002 WP5): a consistent spacing
       scale instead of one-off margins — section-to-section gaps and
       heading-to-text gaps, mobile vs desktop. */
    --space-section: 32px;
    --space-heading: 12px;
}
@media (min-width: 720px) {
    :root {
        --space-section: 56px;
        --space-heading: 16px;
    }
}

/* ---- Reset ---- */
* {
    box-sizing: border-box;
}
html, body {
    margin: 0;
    padding: 0;
}
html {
    overflow-x: hidden;
}
body {
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-ink);
    background: var(--color-ground);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}
a {
    color: var(--color-accent);
    text-decoration: none;
}
a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}
/* Links sitting on a dark or green background: the global a:hover colour
   (dark green) would vanish into the background, so hover turns the text gray. */
a.btn--primary:hover,
a.btn--dark:hover,
a.service-card--featured:hover,
.pill-tabs a[aria-current="page"]:hover,
.pagination a[aria-current="page"]:hover {
    color: var(--color-on-dark-hover);
}
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.2;
    margin: 0 0 0.5em;
    letter-spacing: -0.01em;
}
p {
    margin: 0 0 1em;
}
ul, ol {
    padding-left: 1.3em;
}
button {
    font-family: inherit;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 8px;
    min-height: var(--tap-min);
    padding: 0 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.btn:hover {
    text-decoration: none;
    filter: brightness(1.04);
}
.btn--primary {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-button);
    color: #FFFFFF;
}
.btn--dark {
    background: var(--gradient-dark);
    box-shadow: var(--shadow-button-dark);
    color: #FFFFFF;
}
.btn--ghost {
    background: var(--color-surface);
    border: 1px solid var(--color-line-strong);
    color: var(--color-ink);
    font-weight: 500;
}
.btn--block {
    width: 100%;
}

/* ---- Header ---- */
.site-header {
    flex: 0 0 auto;
    border-bottom: 1px solid var(--color-line);
    background: var(--color-ground);
}
.site-header__inner {
    max-width: 1280px;
    margin: 0 auto;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
}
.site-header__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-ink);
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}
.site-header__logo:hover {
    color: var(--color-ink);
    text-decoration: none;
}
.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.site-nav__link {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-min);
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--color-ink);
    text-decoration: none;
    font-size: 15px;
}
.site-nav__link:hover {
    text-decoration: none;
    background: var(--color-sidebar);
}
.site-nav__link[aria-current="page"] {
    background: var(--color-nav-current);
    font-weight: 500;
}
.site-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.site-nav__legal {
    display: none;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: var(--tap-min);
    height: var(--tap-min);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-line-strong);
    background: var(--color-surface);
    color: var(--color-ink);
    cursor: pointer;
    flex-shrink: 0;
}

@media (max-width: 899px) {
    .menu-toggle {
        display: inline-flex;
    }
    .site-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 2px;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-line);
        padding: 12px 16px 20px;
        box-shadow: 0 12px 24px rgba(23, 25, 28, 0.08);
        z-index: 20;
    }
    .site-nav.is-open {
        display: flex;
    }
    .site-nav__link {
        width: 100%;
        min-height: 52px;
    }
    .site-nav__legal {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 16px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--color-line);
        font-size: 13px;
    }
    .site-nav__legal a {
        color: var(--color-muted-strong);
    }
    .site-header {
        position: relative;
    }
}

/* ---- Main / layout ---- */
.site-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ---- Floating "ask" launcher slot: the widget styles its own button;
   we only keep room so it never overlaps the footer's tap targets. ---- */
.site-footer {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
}

/* ---- Home: sidebar + full-page chat (contract 4, CR-036 D2) ----
   Canvas (Main.dc.html): sidebar + chat fill the viewport, no top header,
   no footer. At phone width there's no sidebar either — a slim header
   (logo + menu button) takes over navigation via the shared drawer, and
   the chat fills the rest (visual fix pass, WP5). The footer never shows
   on home, at any width. */
.page-home .site-footer {
    display: none;
}
.page-home .site-main {
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));
}
.home-layout {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}
.home-sidebar {
    display: none;
}
.home-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 16px;
    overflow-y: auto;
}
.chat-page {
    /* Exactly one .home-content viewport, never shrunk by .home-about below
       it (seo-home-text-2026-09-27.md §1: "the chat keeps the first viewport
       untouched") and never grown by a long conversation: a definite height
       keeps the widget's message list scrolling inside the chat rather than
       the whole column. */
    flex: 0 0 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: 780px;
    width: 100%;
    margin: 0 auto;
}
/* ---- Home: crawlable text below the chat (seo-home-text-2026-09-27.md §1)
   Visible, in normal flow, reachable by scrolling — never hidden. Same
   max-width as .chat-page, so it reads as a continuation of the same
   column rather than a different page. ---- */
.home-about {
    flex: 0 0 auto;
    max-width: 780px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 0 48px;
    border-top: 1px solid var(--color-line);
}
.chat-page__container {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}
.chat-page__noscript {
    max-width: 640px;
    margin: 24px auto;
    padding: 0 16px;
}
.chat-page__footnote {
    margin: 0;
    padding: 12px 0 16px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--color-muted);
    text-align: center;
}

@media (min-width: 900px) {
    .home-sidebar {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 272px;
        flex-shrink: 0;
        background: var(--color-sidebar);
        border-right: 1px solid var(--color-line);
        padding: 20px 16px;
        overflow-y: auto;
    }
    .home-sidebar__logo {
        display: flex;
        align-items: center;
        gap: 10px;
        color: var(--color-ink);
        font-weight: 700;
        font-size: 19px;
        padding: 4px 8px;
    }
    .home-sidebar__new-chat {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: var(--tap-min);
        padding: 0 14px;
        border-radius: var(--radius-sm);
        background: var(--color-surface);
        border: 1px solid var(--color-line);
        color: var(--color-ink);
        font-weight: 500;
        font-size: 15px;
    }
    .home-sidebar__nav {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .home-sidebar__nav a {
        display: flex;
        align-items: center;
        min-height: var(--tap-min);
        padding: 0 14px;
        border-radius: var(--radius-sm);
        color: var(--color-ink);
        font-size: 15px;
    }
    .home-sidebar__nav a:hover {
        background: var(--color-ground);
        text-decoration: none;
    }
    .home-sidebar__spacer {
        flex-grow: 1;
    }
    .home-sidebar__legal {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 12px;
        font-size: 12px;
        color: var(--color-muted);
        padding: 0 8px;
    }
    .home-sidebar__legal a {
        color: var(--color-muted);
    }
}
@media (max-width: 899px) {
    .home-layout {
        flex-direction: column;
    }
    .home-about {
        padding: 24px 0 40px;
    }
}
@media (min-width: 900px) {
    /* Desktop home: the sidebar is the only navigation (PB-001 §2.5) — the
       shared site-header (logo + nav + menu button) is for every other
       page and for home below 900px, where there is no sidebar to show
       it. Hiding it here also removes the now-redundant menu button and
       lets the chat fill the true viewport height. */
    .page-home .site-header {
        display: none;
    }
    .page-home .site-main {
        height: 100vh;
        height: 100dvh;
    }
}

/* ---- Footer ---- */
.site-footer {
    flex: 0 0 auto;
    border-top: 1px solid var(--color-line);
    background: var(--color-sidebar);
    padding: 32px 16px;
}
.site-footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.site-footer__top {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.site-footer__about {
    max-width: 420px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-muted-strong);
}
.site-footer__about strong {
    display: block;
    font-size: 16px;
    color: var(--color-ink);
    margin-bottom: 6px;
}
.site-footer__columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    font-size: 14px;
}
.site-footer__column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.site-footer__column-title {
    font-weight: 600;
    color: var(--color-ink);
}
.site-footer__column a {
    color: var(--color-muted-strong);
}
.site-footer__bottom {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 20px;
    border-top: 1px solid var(--color-line);
}
.site-footer__agent {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-muted);
}
.site-footer__copyright {
    margin: 0;
    font-size: 12px;
    color: var(--color-muted);
}

@media (min-width: 720px) {
    .site-footer__top {
        flex-direction: row;
        justify-content: space-between;
        gap: 48px;
    }
    .site-footer__columns {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 48px;
    }
    /* Agent line left, copyright right, on one row. */
    .site-footer__bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        gap: 24px;
    }
    .site-footer__copyright {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

/* ---- Page hero ---- */
.page-hero {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 40px 0 24px;
    max-width: 820px;
}
.page-hero > .btn {
    /* Text children (h1, lede) should stretch to the hero's max-width, but
       a CTA button must stay its own intrinsic size, not the column's full
       width (visual fix pass: the "Рассчитать" button was stretching edge
       to edge). */
    align-self: flex-start;
    margin-top: 4px;
}
.page-hero__eyebrow {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
.page-hero h1 {
    font-size: clamp(32px, 6vw, 52px);
    line-height: 1.08;
}
.page-hero__lede {
    font-size: 17px;
    line-height: 1.55;
    color: var(--color-muted-strong);
    margin: 0;
}

/* ---- Breadcrumbs ---- */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    color: var(--color-muted);
    padding-top: 20px;
    margin: 0 0 var(--space-heading);
}
.breadcrumbs a {
    color: var(--color-muted);
}

/* ---- Generic content page shell ---- */
.content-page {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 16px 64px;
}
/* Consistent vertical rhythm between a page's top-level sections
   (breadcrumbs, hero, card grids, featured items, pagination, ...) instead
   of one-off margins per template (visual fix pass). */
.content-page > * + * {
    margin-top: var(--space-section);
}
.content-page__body {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 760px;
}

/* ---- Prose (rendered Markdown / RichText body) ---- */
.prose {
    font-size: 17px;
    line-height: 1.7;
    color: var(--color-ink-soft);
}
.prose h2 {
    font-size: 26px;
    font-weight: 600;
    font-family: var(--font-ui);
    margin: 1.6em 0 0.6em;
}
.prose h3 {
    font-size: 21px;
    font-weight: 600;
    font-family: var(--font-ui);
    margin: 1.4em 0 0.5em;
}
.prose h2:first-child, .prose h3:first-child {
    margin-top: 0;
}
.prose p, .prose ul, .prose ol, .prose table, .prose blockquote {
    margin: 0 0 1.1em;
}
.prose a {
    text-decoration: underline;
}
.prose blockquote {
    margin-left: 0;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--color-accent);
    font-family: var(--font-display);
    font-size: 19px;
    color: var(--color-ink-soft);
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: 12px;
    overflow: hidden;
}
.prose th, .prose td {
    padding: 12px 16px;
    text-align: left;
    border-top: 1px solid var(--color-line);
}
.prose thead th {
    background: var(--color-sidebar);
    border-top: none;
    font-weight: 600;
}
.prose img {
    border-radius: var(--radius-md);
}
.prose figure {
    margin: 0 0 1.1em;
}
.prose figcaption {
    font-size: 13px;
    color: var(--color-muted);
    margin-top: 6px;
}
.prose code {
    background: var(--color-sidebar);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}
.prose pre {
    background: var(--color-ink);
    color: #F6F5F1;
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
}
.prose pre code {
    background: none;
    padding: 0;
}

/* ---- FAQ accordion ---- */
.faq-block {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--color-line-strong);
}
.faq-block__item {
    border-bottom: 1px solid var(--color-line-strong);
    padding: 18px 0;
}
.faq-block__item summary {
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    min-height: var(--tap-min);
    display: flex;
    align-items: center;
}
.faq-block__answer {
    padding-top: 10px;
}

/* ---- Callouts ---- */
.callout {
    display: flex;
    gap: 14px;
    padding: 20px;
    border-radius: var(--radius-md);
}
.callout--amber {
    background: var(--gradient-amber);
    border: 1px solid var(--color-amber-border);
    color: var(--color-amber-text-strong);
}
.callout--mint {
    background: var(--gradient-mint);
    border: 1px solid var(--color-soft-green-border);
}

/* ---- Ask box (Справочник hero, 404) ---- */
.ask-box {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 6px 6px 6px 18px;
    margin-top: 8px;
    border-radius: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-line-strong);
    box-shadow: var(--shadow-card);
    max-width: 560px;
}
.ask-box__link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--tap-min);
    font-size: 16px;
    font-weight: 500;
    color: var(--color-ink);
    width: 100%;
}
.ask-box__link:hover {
    text-decoration: none;
    color: var(--color-accent);
}
.ask-box__input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 16px;
    color: var(--color-ink);
    min-height: var(--tap-min);
}
.ask-box__submit {
    width: var(--tap-min);
    height: var(--tap-min);
    flex-shrink: 0;
    border-radius: 12px;
    border: none;
    background: var(--gradient-primary);
    box-shadow: var(--shadow-button);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
}

/* ---- Section grids / cards (services, KB, blog, insurers) ---- */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media (min-width: 640px) {
    .card-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
    .card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.service-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-ink);
}
.service-card:hover {
    text-decoration: none;
}
.service-card--featured {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-button);
    color: #FFFFFF;
    min-height: 260px;
}
.service-card--featured .service-card__title {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 500;
}
.service-card--featured .service-card__text {
    color: #D7E8E1;
}
.service-card--soon {
    border: 1.5px dashed var(--color-line-strong);
    min-height: 220px;
    color: var(--color-ink);
}
.service-card__badge {
    align-self: flex-start;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 12px;
    font-weight: 600;
}
.service-card__group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.service-card__title {
    display: block;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px;
}
.service-card__text {
    display: block;
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-muted-strong);
    margin: 0;
}
.service-card__cta {
    margin-top: 16px;
    background: var(--color-surface);
    color: var(--color-ink);
}

.kb-card, .blog-card, .insurer-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    color: var(--color-ink);
    text-decoration: none;
}
.kb-card:hover, .blog-card:hover, .insurer-card:hover {
    text-decoration: none;
    border-color: var(--color-line-strong);
}
.kb-card__eyebrow, .blog-card__eyebrow {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.kb-card__title, .blog-card__title {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
}
.kb-card__text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-muted-strong);
    margin: 0;
}
.blog-card__cover {
    height: 160px;
    border-radius: var(--radius-md);
    background: var(--gradient-tan);
}
.blog-card__meta {
    font-size: 13px;
    color: var(--color-muted);
}

.section-heading {
    font-size: 22px;
    font-weight: 600;
    font-family: var(--font-ui);
    margin: 0 0 var(--space-heading);
}

/* ---- Featured blog post ---- */
.blog-featured {
    display: grid;
    grid-template-columns: 1fr;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    text-decoration: none;
    color: var(--color-ink);
}
.blog-featured:hover {
    text-decoration: none;
}
.blog-featured__cover {
    min-height: 220px;
    background: var(--gradient-primary);
}
.blog-featured__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 28px;
}
.blog-featured__title {
    font-family: var(--font-display);
    font-size: 28px;
    line-height: 1.15;
    font-weight: 500;
    margin: 0;
}
.blog-featured__text {
    font-size: 16px;
    line-height: 1.55;
    color: var(--color-muted-strong);
    margin: 0;
}
@media (min-width: 900px) {
    .blog-featured {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .blog-featured__cover {
        min-height: 320px;
    }
}

/* ---- Rubric tabs / filter pills ---- */
.pill-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid var(--color-line);
    padding-bottom: 16px;
}
.pill-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--color-line-strong);
    background: var(--color-surface);
    color: var(--color-ink);
    font-size: 14px;
    text-decoration: none;
}
.pill-tabs a[aria-current="page"] {
    border-color: var(--color-ink);
    background: var(--gradient-dark);
    box-shadow: var(--shadow-button-dark);
    color: #FFFFFF;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--tap-min);
    min-height: var(--tap-min);
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--color-line-strong);
    background: var(--color-surface);
    color: var(--color-ink);
    text-decoration: none;
    font-size: 15px;
}
.pagination a[aria-current="page"] {
    background: var(--gradient-dark);
    box-shadow: var(--shadow-button-dark);
    color: #FFFFFF;
    border-color: var(--color-ink);
}

/* ---- CTA band ---- */
.cta-band {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
    padding: 32px;
    border-radius: var(--radius-lg);
}
.cta-band--dark {
    background: var(--gradient-dark);
    box-shadow: var(--shadow-button-dark);
    color: #FFFFFF;
}
.cta-band--mint {
    background: var(--gradient-mint);
    border: 1px solid var(--color-soft-green-border);
}
.cta-band__title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 500;
    margin: 0;
}
.cta-band__text {
    margin: 4px 0 0;
    font-size: 16px;
}
.cta-band--dark .cta-band__text {
    color: #C9CCD1;
}
.cta-band--mint .cta-band__text {
    color: #3F4A46;
}
@media (min-width: 720px) {
    .cta-band {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* ---- Article layout (TOC + related) ---- */
.article-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.article-toc {
    display: none;
}
.article-toc__title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 12px;
}
.article-toc nav {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--color-line-strong);
}
.article-toc a {
    padding: 8px 0 8px 16px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: var(--color-muted-strong);
    font-size: 14px;
    text-decoration: none;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--color-muted);
}
.article-layout__main {
    display: flex;
    flex-direction: column;
    gap: var(--space-section);
}
.article-related {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.article-related__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 640px) {
    .article-related__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.article-cover {
    width: 100%;
    border-radius: var(--radius-lg);
}
@media (min-width: 1000px) {
    .article-layout {
        flex-direction: row;
        gap: 48px;
        align-items: flex-start;
    }
    .article-toc {
        display: block;
        width: 220px;
        flex-shrink: 0;
        position: sticky;
        top: 96px;
    }
    .article-layout__main {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 720px;
    }
}

/* ---- Insurer contacts / rules table ---- */
.insurer-contacts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 640px) {
    .insurer-contacts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.insurer-contacts__item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    border: 1px solid var(--color-line);
}
.insurer-contacts__label {
    font-size: 13px;
    color: var(--color-muted);
}
.insurer-contacts__value {
    font-size: 18px;
    font-weight: 600;
}
.rules-table {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    overflow: hidden;
}
.rules-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding: 18px 20px;
    border-top: 1px solid var(--color-line);
}
.rules-row:first-child {
    border-top: none;
}
.rules-row__info {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rules-row__title {
    font-size: 16px;
    font-weight: 600;
}
.rules-row__dates {
    font-size: 14px;
    color: var(--color-muted);
}
.rules-badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}
.rules-badge--current {
    background: var(--gradient-mint);
    color: var(--color-accent);
}
.rules-badge--archive {
    background: var(--color-archive-badge);
    color: var(--color-muted-strong);
}

/* ---- Legal doc nav ---- */
.legal-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
    /* Same top room as .page-hero on other pages: legal docs have no hero,
       so without this the nav and h1 sat flush against the header. */
    padding-top: 40px;
}
.legal-layout .content-page__body > h1 {
    margin: 0;
}
.legal-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.legal-nav__title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0 14px 8px;
}
.legal-nav a {
    display: flex;
    align-items: center;
    min-height: var(--tap-min);
    padding: 0 14px;
    border-radius: 10px;
    color: var(--color-ink);
    font-size: 15px;
    text-decoration: none;
}
.legal-nav a:hover {
    background: var(--color-sidebar);
    text-decoration: none;
}
.legal-nav a[aria-current="page"] {
    background: var(--color-nav-current);
    font-weight: 500;
}
.legal-meta {
    /* Keep the meta line with the h1 rather than a full body gap below it. */
    margin-top: -20px;
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--color-muted);
}
@media (min-width: 900px) {
    .legal-layout {
        flex-direction: row;
        gap: 64px;
    }
    .legal-nav {
        width: 260px;
        flex-shrink: 0;
    }
}

/* ---- 404 ---- */
.error-page {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 48px 16px;
    text-align: center;
}
.error-page__code {
    font-family: var(--font-display);
    font-size: clamp(64px, 20vw, 140px);
    line-height: 1;
    font-weight: 500;
    color: var(--color-accent);
}
.error-page__links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    font-size: 16px;
}
