/* =====================================================================
   Quantum Coin - Documentation styles
   ===================================================================== */

:root {
    --blue: #0c66e4;
    --blue-dark: #0055cc;
    --top-bar: #1558d6;
    --top-bar-grad: #1d6ae5;
    --ink: #172b4d;
    --ink-soft: #44546f;
    --muted: #626f86;
    --line: #dfe1e6;
    --line-soft: #ebecf0;
    --bg: #ffffff;
    --bg-subtle: #f7f8f9;
    --sidebar-bg: #fafcfd;
    --sel-bg: #e9f2ff;
    --info-bg: #e9f2ff;
    --info-border: #0c66e4;
    --warn-bg: #fffae6;
    --warn-border: #ffab00;
    --warn-icon: #b38600;
    --success-bg: #dcfff1;
    --success-border: #1f845a;
    --radius: 4px;
    --radius-lg: 8px;
    --shadow-card: 0 1px 1px rgba(9, 30, 66, .25), 0 0 1px rgba(9, 30, 66, .31);
    --shadow-pop: 0 4px 8px -2px rgba(9, 30, 66, .25), 0 0 1px rgba(9, 30, 66, .31);
    --topbar-h: 56px;
    --sidebar-w: 284px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* ---------------------------------------------------------------- TOP BAR */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    color: #fff;
    background: linear-gradient(180deg, var(--top-bar-grad), var(--top-bar));
    box-shadow: 0 1px 0 rgba(0, 0, 0, .12);
}

.topbar .icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: transparent;
    border: 0;
    cursor: pointer;
    flex: 0 0 auto;
}

.topbar .icon-btn:hover { background: rgba(255, 255, 255, .18); }
.topbar .icon-btn svg { width: 20px; height: 20px; fill: currentColor; }

.topbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
    margin-left: 2px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
    color: #fff;
}

.topbar .brand:hover { background: rgba(255, 255, 255, .14); text-decoration: none; }
.topbar .brand img { width: 28px; height: 28px; display: block; }
.topbar .brand .chev { width: 16px; height: 16px; fill: #fff; opacity: .85; }

.topbar .search {
    flex: 1 1 auto;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

.topbar .search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    fill: #5e6c84;
}

.topbar .search input {
    width: 100%;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: #fff;
    padding: 0 12px 0 36px;
    font-size: 14px;
    color: var(--ink);
    outline: none;
}

.topbar .search input:focus {
    border-color: #4c9aff;
    box-shadow: 0 0 0 2px rgba(76, 154, 255, .4);
}

.topbar .right { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; margin-left: auto; }

.topbar .social { gap: 6px; }

.social-link {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-link:hover { background: rgba(255, 255, 255, .18); }
.social-link img { width: 22px; height: 22px; display: block; object-fit: contain; }
.social-link .x-icon { width: 18px; height: 18px; display: block; fill: #fff; }
/* GitHub & Discord icons are dark, so render them as white silhouettes on the blue top bar (footer keeps the original dark icons for the light background). */
.social-link[aria-label="GitHub"] img,
.social-link[aria-label="Discord"] img { filter: brightness(0) invert(1); }

.topbar .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #c1c7d0 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%237a869a"><circle cx="12" cy="8" r="4"/><path d="M4 20c0-4 4-6 8-6s8 2 8 6z"/></svg>') center/22px no-repeat;
    border: 2px solid rgba(255, 255, 255, .6);
    margin-left: 4px;
    cursor: pointer;
}

/* ---------------------------------------------------------------- LAYOUT */
.layout {
    display: flex;
    align-items: stretch;
    min-height: calc(100vh - var(--topbar-h));
}

/* ---------------------------------------------------------------- SIDEBAR */
.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
}

.space-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px 16px;
    border-bottom: 1px solid var(--line-soft);
}

.space-header img { width: 36px; height: 36px; flex: 0 0 auto; }
.space-header .meta { line-height: 1.25; }
.space-header .meta .name { font-weight: 600; font-size: 15px; color: var(--ink); }
.space-header .meta .kind { font-size: 12px; color: var(--muted); }

.nav-tree {
    list-style: none;
    margin: 0;
    padding: 8px 8px 16px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.nav-tree ul { list-style: none; margin: 0; padding: 0; }
.nav-tree .children { display: none; }
.nav-tree .node.open > .children { display: block; }

.nav-row {
    display: flex;
    align-items: center;
    gap: 2px;
    border-radius: 6px;
    padding-right: 8px;
    color: var(--ink);
    margin: 1px 0;
}

.nav-row:hover { background: rgba(9, 30, 66, .06); }
.node.active > .nav-row { background: var(--sel-bg); }
.node.active > .nav-row .nav-link { color: var(--blue-dark); font-weight: 500; }
.node.active > .nav-row .doc-ico { fill: var(--blue); }

.twisty {
    width: 22px;
    height: 28px;
    flex: 0 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--muted);
    border-radius: var(--radius);
}

.twisty:hover { background: #dfe1e6; }
.twisty svg { width: 14px; height: 14px; fill: currentColor; transition: transform .15s ease; }
.node.open > .nav-row .twisty svg { transform: rotate(90deg); }
.twisty.leaf { visibility: hidden; cursor: default; }

.nav-link {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px;
    font-size: 14px;
    color: inherit;
    border-radius: 6px;
    min-width: 0;
}

.nav-link:hover { text-decoration: none; }
.nav-link .doc-ico { display: none; }
.nav-link .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.children .nav-link { padding-left: 6px; }
.children .children .nav-link { padding-left: 6px; }
.children .nav-row { margin-left: 22px; }
.children .children .nav-row { margin-left: 44px; }

.sidebar-footer {
    border-top: 1px solid var(--line-soft);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 13px;
}

.sidebar-footer svg { width: 16px; height: 16px; fill: var(--muted); }
.sidebar-footer .collapse-btn {
    margin-left: auto;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--muted);
    display: inline-flex;
}

/* ---------------------------------------------------------------- CONTENT */
.content-wrap {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: center;
    padding: 24px 40px 80px;
}

.content {
    width: 100%;
    max-width: 1600px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    flex-wrap: wrap;
}

.breadcrumb a { color: var(--blue); }
.breadcrumb .sep { color: #97a0af; }

.page-actions {
    float: right;
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-actions .act {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: var(--radius);
    color: var(--ink-soft);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.page-actions .act:hover { background: var(--bg-subtle); text-decoration: none; }
.page-actions .act svg { width: 16px; height: 16px; fill: currentColor; }

h1.page-title {
    font-size: 29px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -.01em;
    margin: 14px 0 6px;
    clear: both;
    color: var(--ink);
}

.page-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 22px;
}

.page-meta .dot { color: #c1c7d0; }
.page-meta a { display: inline-flex; align-items: center; gap: 4px; }
.page-meta svg { width: 14px; height: 14px; fill: currentColor; }

/* headings within body */
.content h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 36px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line-soft);
    scroll-margin-top: 72px;
    color: var(--ink);
}

.content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 26px 0 8px;
    scroll-margin-top: 72px;
    color: var(--ink);
}

.content h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 20px 0 6px;
    scroll-margin-top: 72px;
    color: var(--ink-soft);
}

.content p { margin: 0 0 14px; }

.content ul, .content ol { margin: 0 0 16px; padding-left: 26px; }
.content li { margin: 5px 0; }
.content ul ul, .content ol ol, .content ul ol, .content ol ul { margin: 4px 0; }
.content ul { list-style: disc; }
.content ul ul { list-style: circle; }
.content ol { list-style: decimal; }
.content ol ol { list-style: lower-alpha; }

/* ---------------------------------------------------------------- PANELS */
.panel {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    margin: 0 0 20px;
    border: 1px solid transparent;
    position: relative;
}

.panel .p-icon { flex: 0 0 24px; width: 24px; height: 24px; }
.panel .p-icon svg { width: 24px; height: 24px; }
.panel .p-body { flex: 1 1 auto; }
.panel .p-body > :last-child { margin-bottom: 0; }
.panel .p-title { font-weight: 700; margin: 0 0 4px; font-size: 14px; }

.panel.info { background: var(--info-bg); border-color: #cce0ff; }
.panel.info .p-icon svg { fill: var(--info-border); }

.panel.note { background: #f3f0ff; border-color: #dfd8fd; }
.panel.note .p-icon svg { fill: #6e5dc6; }

.panel.success { background: var(--success-bg); border-color: #b3f5d1; }
.panel.success .p-icon svg { fill: var(--success-border); }

/* Warning box - styled after connecting-to-mainnet-snapshot-compact.html alert */
.panel.warning {
    background: var(--warn-bg);
    border-color: #ffe380;
    border-left: 3px solid var(--warn-border);
}

.panel.warning .p-icon svg { fill: var(--warn-icon); }
.panel.warning .p-title { color: #7a5c00; }

.panel .close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius);
    color: var(--ink-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: .55;
}

.panel .close:hover { opacity: 1; background: rgba(9, 30, 66, .08); }
.panel .close svg { width: 14px; height: 14px; fill: currentColor; }
.panel.dismissed { display: none; }

/* ---------------------------------------------------------------- TOC MACRO */
.toc-macro {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg-subtle);
    padding: 16px 20px;
    margin: 0 0 24px;
}

.toc-macro .toc-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
    color: var(--ink);
}

.toc-macro .toc-head svg { width: 18px; height: 18px; fill: var(--ink-soft); }

.toc-macro ol {
    list-style: none;
    margin: 0;
    padding: 0;
    columns: 3;
    column-gap: 28px;
}

.toc-macro li { counter-increment: toc; margin: 4px 0; break-inside: avoid; }
.toc-macro ol { counter-reset: toc; }
.toc-macro a::before { content: counter(toc) ". "; color: var(--ink-soft); }

@media (max-width: 720px) { .toc-macro ol { columns: 1; } }

/* ---------------------------------------------------------------- EXPAND (toggle) */
.expand {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin: 0 0 14px;
    background: #fff;
    overflow: hidden;
}

.expand > .expand-trigger {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-subtle);
    border: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.expand > .expand-trigger:hover { background: #eef0f3; }
.expand > .expand-trigger .chev { width: 14px; height: 14px; fill: var(--ink-soft); transition: transform .15s ease; flex: 0 0 auto; }
.expand.open > .expand-trigger .chev { transform: rotate(90deg); }
.expand > .expand-content { display: none; padding: 14px 16px 4px; border-top: 1px solid var(--line-soft); }
.expand.open > .expand-content { display: block; }

/* OS toggle group (Windows / Mac / Linux) - styled after validator-deposit-withdraw.html */
.os-toggles { margin: 8px 0 16px; }

.toggle-btn {
    display: block;
    width: 100%;
    text-align: left;
    margin-top: 6px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--blue);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}

.toggle-btn:hover { background: var(--bg-subtle); }
.toggle-btn::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-70%) rotate(45deg);
    transition: transform .15s ease;
}

.toggle-btn.open::after { transform: translateY(-30%) rotate(-135deg); }
.toggle-body {
    display: none;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 14px;
    background: #fbfbfc;
    margin-top: -1px;
}

.toggle-body.open { display: block; }
.toggle-body .cap { display: block; font-weight: 600; font-size: 13px; color: var(--ink-soft); margin: 4px 0; }

/* code blocks */
pre {
    background: #091e42;
    color: #dfe5ee;
    border-radius: var(--radius);
    padding: 12px 14px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.5;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

p code, li code {
    background: var(--line-soft);
    color: #44546f;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12.5px;
}

/* ---------------------------------------------------------------- TABLE */
.content table {
    border-collapse: collapse;
    width: 100%;
    margin: 0 0 20px;
    font-size: 13.5px;
}

.content th, .content td {
    border: 1px solid var(--line);
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}

.content th { background: var(--bg-subtle); font-weight: 600; }

/* ---------------------------------------------------------------- BUTTONS */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 26px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--blue); border-color: #8fb8f6; }
.btn.secondary:hover { background: var(--info-bg); text-decoration: none; }

/* ---------------------------------------------------------------- PAGE FOOTER */
.page-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 30px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 13px;
    flex-wrap: wrap;
}

.page-footer .like {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: var(--radius);
    padding: 5px 12px;
    cursor: pointer;
    color: var(--ink-soft);
    font-weight: 600;
}

.page-footer .like:hover { background: var(--bg-subtle); }
.page-footer .like.active { color: var(--blue); border-color: #8fb8f6; }
.page-footer .like svg { width: 16px; height: 16px; fill: currentColor; }
.page-footer .labels { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.page-footer .labels svg { width: 16px; height: 16px; fill: var(--muted); }

/* ---------------------------------------------------------------- LEGACY BUTTONS */
.legacy-btns { margin: 12px 0 26px; }

.legacy-btn {
    display: inline-block;
    width: 220px;
    text-align: center;
    padding: 10px;
    margin-top: 10px;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, .3);
    text-decoration: none;
    font-weight: 600;
}

.legacy-btn:hover { color: #fff; text-decoration: none; opacity: .92; }
.legacy-btn.get { background: #007bff; }
.legacy-btn.wallet { background: #28a745; }

/* ---------------------------------------------------------------- CONTENT CARDS */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin: 10px 0 28px;
}

.doc-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    color: var(--ink);
    transition: box-shadow .12s ease, border-color .12s ease;
}

.doc-card:hover {
    border-color: #8fb8f6;
    box-shadow: var(--shadow-card);
    text-decoration: none;
}

.doc-card .ic {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.doc-card .ic img { max-width: 42px; max-height: 42px; object-fit: contain; }
.doc-card .tx { min-width: 0; }
.doc-card .tx h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--blue-dark); }
.doc-card .tx p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }

/* ---------------------------------------------------------------- LINK LIST */
.link-list { list-style: none; margin: 0 0 24px; padding: 0; }
.link-list li { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.link-list li:last-child { border-bottom: 0; }
.link-list a { font-weight: 500; }

/* ---------------------------------------------------------------- HIGHLIGHTED LINK CALLOUT */
/* Green callout with a checkmark bullet so key links (e.g. NPM package, whitepaper) stand out. */
.content .link {
    background: #f1fdf3;
    border: 1px solid #c5edcf;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 0 0 16px;
}
.content .link p {
    position: relative;
    margin: 0;
    padding-left: 32px;
}
.content .link p::before {
    content: "\2714";
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    line-height: 1;
    color: #10d631;
}

/* ---------------------------------------------------------------- DOWNLOAD BLOCKS */
.dl-block {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    padding: 14px 18px;
    margin: 0 0 12px;
}

.dl-block h4 { margin: 0 0 4px; font-size: 16px; color: var(--ink); }
.dl-block p { margin: 6px 0 0; font-size: 13.5px; }
.dl-block img { display: inline-block; }

/* ---------------------------------------------------------------- POPUP / MODAL */
.popup-buttons { margin: 8px 0 16px; }

.btn-yes,
.btn-no {
    display: inline-block;
    min-width: 160px;
    text-align: center;
    padding: 10px 14px;
    margin: 6px 0;
    border: 0;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--blue);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, .2);
}

.btn-yes:hover { background: var(--blue-dark); }
.btn-no { background: #6b778c; }

#popup-toggle { display: none; }

.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(9, 30, 66, .55);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#popup-toggle:checked ~ .popup-overlay { display: flex; }

.popup-content {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    padding: 22px 22px 18px;
    max-width: 440px;
    width: 100%;
    position: relative;
}

.popup-content > :last-child { margin-bottom: 0; }

.popup-close {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 22px;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
}

.popup-close:hover { color: var(--ink); text-decoration: none; }

/* ---------------------------------------------------------------- OFFLINE TOOL (scoped) */
.offline-tool { width: 100%; }

/* ---------------------------------------------------------------- CODE COPY */
.code-block { position: relative; }

.code-block .copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #c7d1e0;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: var(--radius);
    cursor: pointer;
    opacity: 0;
    transition: opacity .12s ease, background .12s ease;
}

.code-block:hover .copy-btn,
.code-block .copy-btn:focus { opacity: 1; }
.code-block .copy-btn:hover { background: rgba(255, 255, 255, .22); }
.code-block .copy-btn svg { width: 13px; height: 13px; fill: currentColor; }
.code-block .copy-btn.copied { color: #7ee2b8; border-color: rgba(126, 226, 184, .5); }

/* ---------------------------------------------------------------- BOTTOM BAR */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--bg-subtle);
}

.site-footer-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 16px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.site-footer .footer-link { margin: 0; font-size: 14px; }
.site-footer .footer-link a { font-weight: 600; }

.footer-social {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
}

.footer-social a:hover { background: rgba(9, 30, 66, .08); }
.footer-social img { width: 24px; height: 24px; display: block; object-fit: contain; }
.footer-social .x-icon { width: 20px; height: 20px; display: block; fill: var(--ink-soft); }
.footer-social a:hover .x-icon { fill: var(--ink); }

/* ---------------------------------------------------------------- SEARCH RESULTS DROPDOWN */
.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    max-height: 70vh;
    overflow-y: auto;
    padding: 6px;
    z-index: 95;
}
.search-results[hidden] { display: none; }

.search-empty { padding: 14px 12px; font-size: 14px; color: var(--muted); }

.search-list { list-style: none; margin: 0; padding: 0; }
.search-result { margin: 0; }

.search-result-link {
    display: block;
    padding: 8px 10px;
    border-radius: var(--radius);
    color: var(--ink);
    text-decoration: none;
}
.search-result-link:hover,
.search-result-link.active { background: var(--info-bg); text-decoration: none; }

.search-result-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--blue-dark);
    margin-bottom: 2px;
}
.search-result-excerpt {
    display: block;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--muted);
}
.search-results mark {
    background: #fff0b3;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.search-subs { list-style: none; margin: 2px 0 4px; padding: 0; }
.search-sub-link {
    display: block;
    margin-left: 10px;
    padding: 5px 10px;
    font-size: 12.5px;
    border-left: 2px solid var(--line);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--ink-soft);
    text-decoration: none;
}
.search-sub-link:hover,
.search-sub-link.active { background: var(--info-bg); color: var(--blue-dark); text-decoration: none; }

/* ---------------------------------------------------------------- MOBILE */
.topbar .menu-toggle { display: none; }
.scrim { display: none; }

@media (max-width: 860px) {
    .topbar .menu-toggle { display: inline-flex; }
    .sidebar {
        position: fixed;
        top: var(--topbar-h);
        left: 0;
        z-index: 90;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: var(--shadow-pop);
    }
    .sidebar.open { transform: translateX(0); }
    .scrim.show {
        display: block;
        position: fixed;
        inset: var(--topbar-h) 0 0 0;
        background: rgba(9, 30, 66, .45);
        z-index: 80;
    }
    .content-wrap { padding: 18px 18px 70px; }
    .site-footer-inner { padding: 14px 18px; }
}

@media (max-width: 540px) {
    .topbar .brand .name-text { display: none; }
    /* full-width dropdown anchored under the top bar on small screens */
    .search-results {
        position: fixed;
        top: var(--topbar-h);
        left: 0;
        right: 0;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        max-height: calc(100vh - var(--topbar-h));
    }
}
