/* Knowledge library: shared, responsive styling for all kb- pages. */
@font-face {
    font-family: Gilroy;
    src: url('/assets/fonts/Gilroy-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: Gilroy;
    src: url('/assets/fonts/Gilroy-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

.kb-body {
    --kb-green: #086b3b;
    --kb-green-hover: #07532f;
    --kb-forest: #083e2c;
    --kb-ink: #183b2b;
    --kb-muted: #536b5f;
    --kb-line: #ccdcd1;
    --kb-light: #edf7ef;
    --kb-paper: #fff;
    margin: 0;
    background: #f7faf7;
    color: var(--kb-ink);
    font: 500 16px/1.65 Gilroy, 'Segoe UI', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-size-adjust: 100%;
}
.kb-body *, .kb-body *::before, .kb-body *::after { box-sizing: border-box; }
.kb-body a { color: var(--kb-green); text-underline-offset: .2em; }
.kb-body a:hover { color: var(--kb-green-hover); }
.kb-body :where(a, button, input, select, summary):focus-visible {
    outline: 3px solid #126b45;
    outline-offset: 4px;
}
.kb-body :where(button, input, select) { font: inherit; }
.kb-body :where(h1, h2, h3, p, ul, ol) { margin-top: 0; }
.kb-body :where(p, ul, ol) { margin-bottom: 1em; }
.kb-body :where(h1, h2, h3) { font-weight: 700; line-height: 1.25; text-wrap: balance; }
.kb-body h2 { font-size: clamp(24px, 2.5vw, 30px); }
.kb-body h3 { font-size: 20px; }
.kb-body :where(img, svg) { max-width: 100%; }
.kb-body :where(article, section, aside, nav, form, details) { min-width: 0; }
.kb-body :where(input, select) { min-width: 0; }
.kb-body :where(code, pre) { overflow-wrap: anywhere; }
.kb-shell { width: calc(100% - 48px); max-width: 1200px; margin-inline: auto; }

.kb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px 28px;
    padding-block: 22px;
    border-bottom: 1px solid var(--kb-line);
}
.kb-logo { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; text-decoration: none; font-size: 24px; font-weight: 700; }
.kb-logo img { display: block; width: 180px; height: 42px; object-fit: contain; }
.kb-header-links { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 22px; }
.kb-header-links a { display: inline-block; padding-block: 8px; font-weight: 700; }
.kb-breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px 12px; padding-block: 20px 0; color: var(--kb-muted); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.kb-breadcrumbs :where(ol, ul) { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 0; margin: 0; list-style: none; }
.kb-breadcrumbs a { color: var(--kb-muted); }

.kb-hero {
    margin-block: 24px;
    padding: clamp(24px, 4vw, 44px);
    border-radius: 22px;
    background: var(--kb-forest);
    color: #fff;
}
.kb-hero h1 { margin: 0 0 20px; max-width: 30ch; font-size: clamp(30px, 4.1vw, 48px); line-height: 1.14; letter-spacing: -.02em; overflow-wrap: anywhere; }
.kb-hero p { max-width: 86ch; margin-bottom: 16px; color: #e1efe6; }
.kb-hero a { color: #d3f8df; }
.kb-hero a:hover { color: #fff; }
.kb-hero :where(a, button):focus-visible { outline-color: #d3f8df; }
.kb-eyebrow { margin-bottom: 14px; color: #2b7250; font-size: 14px; font-weight: 700; line-height: 1.4; letter-spacing: .08em; text-transform: uppercase; }
.kb-hero .kb-eyebrow { color: #bce5cc; }
.kb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 12px; margin-top: 28px; }
.kb-stat { padding: 15px 18px; border: 1px solid #38725a; border-radius: 12px; background: #164c37; color: #e1efe6; font-size: 14px; line-height: 1.4; }
.kb-stat :where(strong, b) { display: block; margin-bottom: 5px; color: #fff; font-size: 28px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }

.kb-search { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(125px, 1fr)) auto; align-items: end; gap: 14px; margin-block: 24px; padding: 24px; border: 1px solid var(--kb-line); border-radius: 16px; background: var(--kb-paper); }
.kb-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.kb-field :where(label, span) { color: var(--kb-ink); font-size: 14px; font-weight: 700; line-height: 1.4; }
.kb-field :where(input, select), .kb-search > :where(input, select) { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #718c7b; border-radius: 8px; background: #fff; color: var(--kb-ink); line-height: 1.4; }
.kb-field input::placeholder { color: #607467; opacity: 1; }
.kb-field select { padding-right: 30px; }
.kb-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 22px; border: 1px solid var(--kb-green); border-radius: 8px; background: var(--kb-green); color: #fff !important; font-weight: 700; line-height: 1.4; text-align: center; text-decoration: none; cursor: pointer; }
.kb-button:hover { border-color: var(--kb-green-hover); background: var(--kb-green-hover); }
.kb-button:disabled { opacity: .6; cursor: default; }
.kb-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 24px; padding: 5px; border: 1px solid var(--kb-line); border-radius: 12px; background: #eaf2ec; }
.kb-tabs :where(a, button) { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--kb-ink); font-weight: 700; line-height: 1.4; text-decoration: none; }
.kb-tabs :where(a, button):hover { background: #fff; }
.kb-tabs .kb-active, .kb-tabs [aria-current='page'], .kb-tabs [aria-selected='true'] { border-color: var(--kb-green); background: #fff; color: var(--kb-green); }

.kb-categories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-block: 24px 32px; }
.kb-category { display: block; min-width: 0; padding: 22px; border: 1px solid var(--kb-line); border-radius: 14px; background: #fff; color: var(--kb-ink); text-decoration: none; overflow-wrap: anywhere; }
.kb-category:hover { border-color: #6a9e7e; background: var(--kb-light); }
.kb-category :where(h2, h3, strong) { display: block; margin-bottom: 8px; color: var(--kb-forest); font-size: 20px; line-height: 1.3; }
.kb-category :where(p, small) { margin-bottom: 0; color: var(--kb-muted); font-size: 14px; line-height: 1.6; }
.kb-layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 28px; align-items: start; margin-block: 28px 40px; }
.kb-sidebar { min-width: 0; padding: 20px; border: 1px solid var(--kb-line); border-radius: 14px; background: #fff; }
.kb-sidebar :where(h2, h3) { font-size: 18px; }
.kb-sidebar ul { padding: 0; margin-bottom: 0; list-style: none; }
.kb-sidebar li + li { margin-top: 7px; }
.kb-sidebar a { display: block; padding: 7px 9px; border-radius: 6px; line-height: 1.45; }
.kb-sidebar .kb-active, .kb-sidebar [aria-current='page'] { background: var(--kb-light); color: var(--kb-forest); font-weight: 700; }
.kb-main { min-width: 0; }
.kb-section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-block: 28px 18px; }
.kb-section-heading :where(h1, h2, h3, p) { margin: 0; }
.kb-section-heading p { color: var(--kb-muted); font-size: 14px; }

.kb-topic, .kb-code, .kb-guide, .kb-pair-card { min-width: 0; padding: 24px; border: 1px solid var(--kb-line); border-radius: 14px; background: #fff; overflow-wrap: anywhere; }
.kb-topic + .kb-topic, .kb-code + .kb-code, .kb-guide + .kb-guide { margin-top: 16px; }
.kb-topic :where(h2, h3), .kb-code :where(h2, h3), .kb-guide :where(h2, h3), .kb-pair-card :where(h2, h3) { margin-bottom: 12px; font-size: 22px; }
.kb-topic > :last-child, .kb-code > :last-child, .kb-guide > :last-child, .kb-pair-card > :last-child { margin-bottom: 0; }
.kb-topic :where(h2, h3) a, .kb-pair-card :where(h2, h3) a { color: var(--kb-forest); text-decoration-thickness: 1px; }
.kb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; margin-block: 8px 14px; color: var(--kb-muted); font-size: 14px; line-height: 1.5; }
.kb-meta :where(p, span, small) { margin: 0; font-size: inherit; }
.kb-badge { display: inline-block; max-width: 100%; padding: 4px 9px; border: 1px solid #c0d6c7; border-radius: 6px; background: #edf5ef; color: #305f43; font-size: 14px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.kb-badge.verified, .kb-badge--verified, .kb-badge-verified { border-color: #9fc7ad; background: #e7f4eb; color: #14552f; }
.kb-badge.source, .kb-badge--source, .kb-badge-source { border-color: #c5d7d0; background: #f0f5f2; color: #39594b; }
.kb-badge.info, .kb-badge--info, .kb-badge-info { border-color: #b4cbd5; background: #edf4f7; color: #275269; }
.kb-topic details, .kb-code details, .kb-guide details { margin-top: 18px; padding-top: 14px; border-top: 1px solid #dce6df; }
.kb-topic summary, .kb-code summary, .kb-guide summary { padding: 7px 0; color: var(--kb-green); font-weight: 700; cursor: pointer; }
.kb-topic details[open] summary, .kb-code details[open] summary, .kb-guide details[open] summary { margin-bottom: 12px; }
.kb-source-list { margin: 12px 0 0; padding-left: 22px; color: var(--kb-muted); font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.kb-source-list li { padding-left: 2px; margin-bottom: 12px; }
.kb-source-list :where(p, small) { margin: 4px 0 0; font-size: 14px; }
.kb-source-list a { overflow-wrap: anywhere; }
.kb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-block: 22px; }
.kb-grid > :where(.kb-guide, .kb-topic, .kb-code) { margin: 0; }
.kb-pair-card { display: flex; flex-direction: column; gap: 10px; }
.kb-pair-card :where(h2, h3, p) { margin: 0; }
.kb-pair-card > a:last-child { margin-top: auto; padding-top: 8px; }
.kb-code-list { display: grid; gap: 16px; margin-block: 22px; }
.kb-code-list .kb-code { margin: 0; }
.kb-code code { display: inline-block; padding: 2px 7px; border-radius: 5px; background: #edf3ef; color: #164b31; font: 700 16px/1.5 ui-monospace, 'Cascadia Code', Consolas, monospace; overflow-wrap: anywhere; }
.kb-code :where(dl, dd) { margin-left: 0; }
.kb-code dt { font-size: 14px; font-weight: 700; color: var(--kb-muted); }
.kb-code dd { margin-bottom: 14px; }
.kb-guide { border-left: 4px solid #639c76; }
.kb-guide :where(ul, ol) { padding-left: 24px; }
.kb-guide li + li { margin-top: 7px; }
.kb-note { margin-block: 20px; padding: 18px 22px; border: 1px solid #b9d5c3; border-left: 4px solid #477e59; border-radius: 10px; background: var(--kb-light); color: #2e523d; font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.kb-note > :last-child { margin-bottom: 0; }
.kb-related { margin-block: 28px; padding-top: 22px; border-top: 1px solid var(--kb-line); }
.kb-related :where(ul, ol) { padding-left: 22px; }
.kb-related li + li { margin-top: 8px; }
.kb-pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-block: 30px; }
.kb-pagination :where(a, span, button) { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px 13px; border: 1px solid var(--kb-line); border-radius: 8px; background: #fff; font-size: 16px; line-height: 1.3; text-decoration: none; }
.kb-pagination .kb-active, .kb-pagination [aria-current='page'] { border-color: var(--kb-green); background: var(--kb-green); color: #fff; font-weight: 700; }
.kb-pagination a:hover { border-color: var(--kb-green); }
.kb-footer { margin-top: 44px; padding-block: 28px 34px; border-top: 1px solid var(--kb-line); color: var(--kb-muted); font-size: 14px; line-height: 1.6; }
.kb-footer a { display: inline-block; margin-right: 18px; padding-block: 5px; }
.kb-footer p { margin-bottom: 10px; }
.kb-empty { padding: 36px 24px; border: 1px dashed #a5bfb0; border-radius: 14px; background: #fff; text-align: center; }
.kb-empty h2 { margin-bottom: 12px; font-size: 24px; }
.kb-empty p { max-width: 65ch; margin-inline: auto; color: var(--kb-muted); }
.kb-empty .kb-button { margin-top: 8px; }

@media (max-width: 1100px) {
    .kb-search { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kb-search .kb-field:first-child { grid-column: span 2; }
    .kb-search .kb-button { width: 100%; }
    .kb-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 820px) {
    .kb-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kb-layout { grid-template-columns: minmax(0, 1fr); }
    .kb-sidebar { padding: 18px; }
    .kb-sidebar ul { display: flex; flex-wrap: wrap; gap: 8px; }
    .kb-sidebar li + li { margin-top: 0; }
    .kb-sidebar a { padding: 8px 10px; background: #f0f5f1; }
    .kb-grid { gap: 14px; }
    .kb-header-links { gap: 5px 16px; }
}
@media (max-width: 600px) {
    .kb-shell { width: calc(100% - 32px); }
    .kb-header { align-items: flex-start; gap: 12px; padding-block: 16px; }
    .kb-header-links { justify-content: flex-start; width: 100%; gap: 4px 18px; font-size: 14px; }
    .kb-logo img { width: 160px; height: 38px; }
    .kb-breadcrumbs { padding-top: 16px; }
    .kb-hero { margin-block: 20px; padding: 24px 20px; border-radius: 16px; }
    .kb-hero h1 { font-size: 30px; }
    .kb-stats { grid-template-columns: minmax(0, 1fr); gap: 9px; margin-top: 22px; }
    .kb-stat { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 12px 14px; }
    .kb-stat :where(strong, b) { margin: 0; font-size: 25px; }
    .kb-search { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 20px 16px; }
    .kb-search .kb-field:first-child { grid-column: auto; }
    .kb-search .kb-button { width: 100%; }
    .kb-tabs { gap: 6px; }
    .kb-tabs :where(a, button) { flex: 1 1 130px; padding: 10px 12px; }
    .kb-categories, .kb-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .kb-category, .kb-topic, .kb-code, .kb-guide, .kb-pair-card { padding: 20px 18px; border-radius: 12px; }
    .kb-topic :where(h2, h3), .kb-code :where(h2, h3), .kb-guide :where(h2, h3), .kb-pair-card :where(h2, h3) { font-size: 21px; }
    .kb-note { padding: 16px; }
    .kb-layout { margin-block: 22px 28px; gap: 20px; }
    .kb-footer { margin-top: 30px; }
    .kb-pagination { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
    .kb-body *, .kb-body *::before, .kb-body *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media print {
    .kb-body { background: #fff; color: #000; }
    .kb-shell { width: 100%; max-width: none; }
    .kb-search, .kb-tabs, .kb-sidebar, .kb-pagination, .kb-header-links { display: none; }
    .kb-layout, .kb-grid, .kb-categories { display: block; }
    .kb-hero { background: #fff; color: #000; border: 1px solid #999; }
    .kb-hero p, .kb-hero .kb-eyebrow { color: #222; }
    .kb-topic, .kb-code, .kb-guide, .kb-pair-card { margin-block: 12px; break-inside: avoid; }
}
