/* CRM Mate Docs — base styles
   Font: Montserrat
   Brand green: #2aac8d
   Text: #000312
*/

:root {
    --brand:        #2aac8d;
    --brand-dark:   #228d73;
    --brand-light:  #e8f7f2;
    --brand-50:     #f3fbf8;

    --text:         #000312;
    --text-muted:   #4a4d5b;
    --text-soft:    #6e7180;

    --bg:           #ffffff;
    --bg-soft:      #f7f8fa;
    --bg-muted:     #eef0f3;

    --border:       #e3e5ea;
    --border-soft:  #eff1f5;

    --info:         #1b6ad7;
    --info-bg:      #f3f7fd;
    --warning:      #b86b00;
    --warning-bg:   #fcf5e8;
    --danger:       #b80000;
    --danger-bg:    #fdf1f1;
    --success:      #00a862;
    --success-bg:   #effaf3;

    --shadow-sm:    0 1px 2px rgba(0, 3, 18, 0.05);
    --shadow-md:    0 4px 12px rgba(0, 3, 18, 0.08);

    --radius-sm:    6px;
    --radius-md:    10px;
    --radius-lg:    14px;

    --header-h:     64px;
    --sidebar-w:    280px;
    --toc-w:        240px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

/* When jumping to #anchor, push the heading 24px below the fixed header. */
html { scroll-padding-top: calc(var(--header-h) + 24px); scroll-behavior: smooth; }

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ============ HEADER ============ */
.docs-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
.header-container {
    display: grid;
    grid-template-columns: auto minmax(240px, 1fr) auto;
    align-items: center;
    gap: 32px;
    height: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Brand cluster: logo + "Docs" badge */
.header-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.header-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.header-logo:hover { text-decoration: none; opacity: 0.85; }
.logo-mark {
    /* Horizontal SVG: viewBox 420x120 → ~3.5:1. Height controls overall size. */
    height: 44px;
    width: auto;
    display: block;
}
.logo-badge {
    background: var(--brand-light);
    color: var(--brand-dark);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: all 0.15s;
}
.logo-badge:hover { background: var(--brand); color: #fff; text-decoration: none; }

/* Search trigger: roomy, centered, looks like a real input */
.header-search {
    display: flex;
    justify-content: center;
    width: 100%;
}
.search-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 520px;
    padding: 9px 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-soft);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-align: left;
}
.search-trigger:hover {
    border-color: var(--brand);
    background: var(--bg);
    color: var(--text);
}
.search-trigger:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}
.search-trigger svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-soft); }
.search-placeholder { flex: 1; font-size: 14px; }
.search-hint {
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 7px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg);
    color: var(--text-muted);
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.header-actions {
    display: flex; align-items: center; gap: 16px;
    margin-left: auto;
}
.lang-switch { display: inline-flex; gap: 4px; }
.lang-link {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.lang-link:hover { background: var(--bg-soft); text-decoration: none; }
.lang-link.is-active { background: var(--brand-light); color: var(--brand-dark); }
.header-link { font-size: 14px; color: var(--text-soft); }
.header-link:hover { color: var(--brand-dark); text-decoration: none; }

/* ============ LAYOUT ============ */
.docs-layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
    max-width: 1440px;
    margin: 0 auto;
    padding-top: var(--header-h);
    min-height: calc(100vh - var(--header-h));
}

/* ============ SIDEBAR ============ */
.docs-sidebar {
    border-right: 1px solid var(--border);
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 24px 0;
}
.docs-sidebar::-webkit-scrollbar { width: 6px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.sidebar-nav { padding: 0 12px 24px; }
.nav-list { list-style: none; padding: 0; margin: 0; }
.nav-list--top > .nav-item { margin-bottom: 4px; }
.nav-list--nested {
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--border-soft);
    margin-top: 4px;
}
.nav-link, .nav-group-label {
    display: block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
}
.nav-link:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav-item.is-group > .nav-group-label {
    font-weight: 600;
    color: var(--text);
    text-transform: none;
    padding: 8px 12px 4px;
    cursor: default;
}
.nav-item--depth-0 > .nav-link,
.nav-item--depth-0.is-group > .nav-group-label {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}
.nav-item--depth-1 > .nav-link,
.nav-item--depth-1.is-group > .nav-group-label { font-size: 13.5px; }
.nav-item--depth-2 > .nav-link { font-size: 13px; color: var(--text-soft); }

.nav-item.is-active > .nav-link {
    background: var(--brand-light);
    color: var(--brand-dark);
    font-weight: 600;
}
.nav-item.is-in-trail > .nav-link { color: var(--text); }

/* ============ CONTENT ============ */
.docs-content { min-width: 0; }
.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 48px 80px;
}

/* breadcrumbs */
.breadcrumbs { margin-bottom: 24px; }
.breadcrumbs-list {
    display: flex; flex-wrap: wrap; align-items: center;
    list-style: none; padding: 0; margin: 0;
    font-size: 13px;
    color: var(--text-soft);
}
.breadcrumbs-item a { color: var(--text-soft); }
.breadcrumbs-item a:hover { color: var(--brand-dark); }
.breadcrumbs-item.is-current { color: var(--text); }
.breadcrumbs-separator { padding: 0 8px; color: var(--text-soft); }

/* page content typography */
.page-content h1 {
    font-size: 34px; font-weight: 700;
    line-height: 1.2;
    margin: 0 0 8px;
    letter-spacing: -0.015em;
}
.page-content .page-lead {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.5;
}
.page-content h2 {
    font-size: 24px; font-weight: 600;
    margin: 48px 0 16px;
    line-height: 1.25;
    scroll-margin-top: calc(var(--header-h) + 16px);
}
.page-content h3 {
    font-size: 19px; font-weight: 600;
    margin: 32px 0 12px;
    scroll-margin-top: calc(var(--header-h) + 16px);
}
.page-content h4 {
    font-size: 16px; font-weight: 600;
    margin: 24px 0 8px;
    scroll-margin-top: calc(var(--header-h) + 16px);
}
.page-content p { margin: 0 0 16px; }
.page-content ul, .page-content ol { margin: 0 0 16px; padding-left: 24px; }
.page-content li { margin-bottom: 6px; }
.page-content li > p { margin-bottom: 4px; }
.page-content strong { font-weight: 600; }
.page-content code {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: var(--bg-muted);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text);
}
.page-content pre {
    position: relative;
    background: var(--bg-muted);
    border-radius: var(--radius-md);
    padding: 16px 16px 16px 16px;
    padding-right: 130px; /* room for copy button */
    overflow-x: auto;
    margin: 0 0 16px;
}
.page-content pre code {
    background: transparent;
    padding: 0;
    font-size: 13px;
    color: var(--text);
}

/* Copy button on code blocks */
.page-content pre .copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0.85;
}
.page-content pre .copy-button:hover {
    opacity: 1;
    color: var(--brand-dark);
    border-color: var(--brand);
}
.page-content pre .copy-button.is-copied {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    opacity: 1;
}
.page-content pre .copy-button svg { flex-shrink: 0; }

.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
    font-size: 14px;
}
.page-content th, .page-content td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.page-content th {
    background: var(--bg-soft);
    font-weight: 600;
}

.page-content img {
    display: block;
    margin: 24px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* Chip grid — for short single-token bullet lists (field names, statuses…) */
.page-content .chip-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.page-content .chip-list > li {
    background: var(--brand-light);
    color: var(--brand-dark);
    padding: 6px 12px;
    border-radius: 999px;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    border: 1px solid #c8eedd;
    margin: 0;
    white-space: nowrap;
}

/* Numbered annotation blocks — paired with numbered labels on a screenshot. */
.page-content .annotation-block {
    display: grid;
    grid-template-columns: 36px 1fr;
    column-gap: 16px;
    align-items: start;
    margin: 12px 0;
    padding: 12px 16px;
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
}
.page-content .annotation-block::before {
    content: attr(data-num);
    grid-column: 1;
    grid-row: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}
.page-content .annotation-block > * {
    grid-column: 2;
    margin-top: 0;
}
.page-content .annotation-block > p:first-of-type strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    display: inline-block;
    margin-bottom: 0;
}
.page-content .annotation-block > p:first-of-type {
    margin-bottom: 6px;
}
.page-content .annotation-block > p:last-child,
.page-content .annotation-block > ul:last-child,
.page-content .annotation-block > ol:last-child,
.page-content .annotation-block > table:last-child {
    margin-bottom: 0;
}
.page-content .annotation-block table {
    margin-top: 8px;
    margin-bottom: 0;
    background: var(--bg);
}

/* Inline UI-icon rows: small image + same-line description. */
.page-content .inline-icon-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    line-height: 1.45;
}
.page-content .inline-icon-row img.inline-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border-soft);
    box-shadow: none;
    margin: 0;
    flex-shrink: 0;
    object-fit: contain;
    background: var(--bg-soft);
}
.page-content .inline-icon-row span {
    color: var(--text);
    font-size: 14px;
}

/* heading anchor links (HeadingPermalinkExtension) — kept for shareable IDs
   but visually hidden, since the # symbol is noise to end users. */
.heading-anchor {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    margin: 0; padding: 0;
}

/* ============ FEATURE GRID (landings) ============ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 24px 0 32px;
}
.feature-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--text);
    transition: all 0.15s ease;
}
.feature-card:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    text-decoration: none;
}
.feature-title { margin: 0; font-size: 16px; font-weight: 600; }
.feature-description { margin: 0; font-size: 13px; color: var(--text-soft); }
.feature-link {
    margin-top: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-dark);
}

/* ============ TOC ============ */
.docs-toc {
    position: sticky;
    top: calc(var(--header-h) + 32px);
    height: fit-content;
    padding: 32px 16px 32px 32px;
}
.toc-wrapper {
    border-left: 1px solid var(--border);
    padding-left: 16px;
}
.toc-title {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-soft);
}
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-item { margin-bottom: 6px; }
.toc-item--h3 { padding-left: 12px; }
.toc-item--h4 { padding-left: 24px; }
.toc-link {
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.4;
    display: block;
    padding: 2px 0;
}
.toc-link:hover { color: var(--brand-dark); text-decoration: none; }
.toc-link.is-active { color: var(--brand-dark); font-weight: 600; }

/* ============ AUTO-LINKS ============ */
/* In-text mentions of other sections — subtle underline, brand-tinted on hover */
.page-content .docs-autolink {
    color: var(--text);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--brand);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.15s, text-decoration-style 0.15s;
}
.page-content .docs-autolink:hover {
    color: var(--brand-dark);
    text-decoration-style: solid;
}

/* ============ RELATED SECTIONS ============ */
.related-section {
    margin: 48px 0 16px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
/* When prev/next follows the related block, drop its top divider + reduce
   the gap — the related block already provides the visual break. */
.related-section + .prev-next {
    margin-top: 24px;
    padding-top: 0;
    border-top: none;
}
.related-heading {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--text);
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.related-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 36px 16px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
    transition: all 0.15s ease;
}
.related-card:hover {
    border-color: var(--brand);
    background: var(--brand-50);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.related-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.related-card-desc {
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-soft);
}
.related-card-arrow {
    position: absolute;
    right: 14px;
    top: 16px;
    color: var(--brand-dark);
    font-size: 14px;
    transition: transform 0.15s;
}
.related-card:hover .related-card-arrow { transform: translateX(3px); }

/* ============ PREV/NEXT ============ */
.prev-next {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.prev-next-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    transition: all 0.15s ease;
}
.prev-next-link:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.prev-next-link--next { text-align: right; align-items: flex-end; }
.prev-next-direction { font-size: 12px; color: var(--text-soft); font-weight: 500; }
.prev-next-title { font-size: 15px; font-weight: 600; }
.prev-next-link.is-disabled { border-color: transparent; pointer-events: none; }

/* ============ ALERTS (Markdown blockquote extension or custom) ============ */
.alert {
    display: flex; gap: 12px;
    padding: 14px 16px;
    border-left: 4px solid var(--info);
    background: var(--info-bg);
    border-radius: var(--radius-sm);
    margin: 20px 0;
}
.alert--success { background: var(--success-bg); border-color: var(--success); }
.alert--warning { background: var(--warning-bg); border-color: var(--warning); }
.alert--danger  { background: var(--danger-bg);  border-color: var(--danger); }

/* ============ SEARCH MODAL ============ */
.search-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
}
.search-modal.is-open { display: block; }
.search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 3, 18, 0.55);
    backdrop-filter: blur(2px);
}
.search-panel {
    position: relative;
    max-width: 680px;
    margin: 80px auto 0;
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 3, 18, 0.25);
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.search-input-wrap svg {
    width: 18px; height: 18px;
    color: var(--text-soft);
    flex-shrink: 0;
}
.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
}
.search-input::placeholder { color: var(--text-soft); }
.search-close {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.search-close:hover { color: var(--text); border-color: var(--text-soft); }

.search-results {
    overflow-y: auto;
    padding: 8px;
    flex: 1;
}
.search-result {
    display: block;
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.12s ease;
    cursor: pointer;
}
.search-result:hover, .search-result.is-selected {
    background: var(--brand-light);
    text-decoration: none;
}
.search-result.is-selected { outline: 2px solid var(--brand); outline-offset: -2px; }
.search-result-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
}
.search-result-group {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-soft);
    flex-shrink: 0;
}
.search-result-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.search-result-snippet {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.search-result mark {
    background: rgba(42, 172, 141, 0.2);
    color: var(--brand-dark);
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 600;
}
.search-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-soft);
    font-size: 14px;
}
.search-foot {
    display: flex;
    gap: 18px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    font-size: 12px;
    color: var(--text-soft);
}
.search-foot kbd {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

/* ============ MOBILE-ONLY ELEMENTS (hidden on desktop) ============ */
.sidebar-burger,
.search-icon-button {
    display: none;
}
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: rgba(0, 3, 18, 0.45);
    z-index: 850;
    opacity: 0;
    transition: opacity 0.22s ease;
}
.sidebar-backdrop.is-open { display: block; opacity: 1; }

/* ============ RESPONSIVE ============ */

/* Hide right TOC when there's no room for 3 columns */
@media (max-width: 1199px) {
    .docs-layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
    .docs-toc { display: none; }
}

/* Tablet & phone: sidebar slides in; hamburger + icon-search appear */
@media (max-width: 900px) {
    .docs-layout { grid-template-columns: 1fr; }

    .docs-sidebar {
        position: fixed;
        left: -320px;
        top: var(--header-h);
        width: 320px;
        max-width: 88vw;
        height: calc(100vh - var(--header-h));
        background: var(--bg);
        z-index: 900;
        box-shadow: var(--shadow-md);
        transition: left 0.25s ease;
        overflow-y: auto;
    }
    .docs-sidebar.is-open { left: 0; }

    .sidebar-burger,
    .search-icon-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: transparent;
        border: 1px solid var(--border);
        border-radius: 8px;
        color: var(--text);
        cursor: pointer;
        flex-shrink: 0;
    }
    .sidebar-burger:hover,
    .search-icon-button:hover {
        border-color: var(--brand);
        color: var(--brand-dark);
    }
    .search-icon-button { margin-left: auto; }
    .search-icon-button svg { width: 18px; height: 18px; }
    .sidebar-burger { margin-right: 4px; }

    /* Hide the full search trigger; show the icon button instead */
    .header-search { display: none; }

    /* Header reflows to flex */
    .header-container {
        display: flex;
        gap: 8px;
        padding: 0 14px;
    }
    .header-brand { gap: 8px; }
    .logo-mark { height: 32px; }
    .content-wrapper { padding: 24px 20px 56px; }
}

/* Phone: drop lang switch from header, compact everything */
@media (max-width: 600px) {
    .header-actions { display: none; }
    .logo-mark { height: 28px; }
    .logo-badge { padding: 2px 7px; font-size: 10px; }
    .content-wrapper { padding: 20px 16px 56px; }

    /* Tables wrap into a horizontal scroll box */
    .page-content table {
        display: block;
        overflow-x: auto;
        max-width: 100%;
        font-size: 13px;
    }

    /* Related cards → one column */
    .related-grid { grid-template-columns: 1fr; }

    /* prev/next stack vertically */
    .prev-next { grid-template-columns: 1fr; }
    .prev-next-link--next { text-align: left; align-items: flex-start; }

    /* Code blocks — icon-only copy button to save horizontal space */
    .page-content pre { padding-right: 56px; }
    .page-content pre .copy-button span { display: none; }
    .page-content pre .copy-button { padding: 5px; }

    /* Search modal — full screen */
    .search-panel {
        margin: 0;
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }

    /* Annotation blocks — tighter padding */
    .page-content .annotation-block {
        grid-template-columns: 28px 1fr;
        column-gap: 12px;
        padding: 10px 12px;
    }

    /* Headings — shrink */
    .page-content h1 { font-size: 26px; }
    .page-content h2 { font-size: 20px; margin-top: 36px; }
    .page-content h3 { font-size: 17px; }
    .page-content .page-lead { font-size: 16px; }
}
