:root {
    --navy: #003b71;
    --navy-900: #00294f;
    --navy-800: #003462;
    --navy-700: #0b538f;
    --navy-100: #e8f0f8;
    --orange: #f26722;
    --orange-600: #d95516;
    --orange-100: #fff1e8;
    --ink: #18222f;
    --ink-soft: #334155;
    --muted: #617083;
    --line: #dfe6ee;
    --line-strong: #c9d4e0;
    --bg: #f4f7fa;
    --card: #ffffff;
    --green: #12855b;
    --green-100: #e7f7ef;
    --amber: #b7791f;
    --amber-100: #fff8e6;
    --red: #c0392b;
    --red-100: #fdecea;
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(16, 36, 58, .06), 0 2px 8px rgba(16, 36, 58, .05);
    --shadow: 0 8px 24px rgba(16, 36, 58, .10);
    --shadow-lg: 0 24px 60px rgba(16, 36, 58, .16);
    --header-height: 78px;
    --sidebar-width: 326px;
    --content-max: 1120px;
    --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --serif: Georgia, "Times New Roman", serif;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--navy-700);
    text-decoration: none;
}

a:hover {
    color: var(--orange-600);
}

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

::selection {
    background: #ffd8bf;
    color: var(--navy-900);
}

:focus-visible {
    outline: 3px solid rgba(242, 103, 34, .55);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    z-index: 1000;
    top: -80px;
    left: 16px;
    padding: 12px 18px;
    border-radius: 0 0 10px 10px;
    background: var(--orange);
    color: #fff;
    font-weight: 700;
    transition: top .2s ease;
}

.skip-link:focus {
    top: 0;
    color: #fff;
}

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

/* ------------------------------------------------------------------ header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(90deg, var(--navy-900), var(--navy) 55%, #084c88);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 8px 24px rgba(0, 25, 50, .18);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: 1440px;
    min-height: var(--header-height);
    margin: 0 auto;
    padding: 0 26px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    color: #fff;
}

.brand:hover {
    color: #fff;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--orange);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 16px rgba(0, 0, 0, .22);
}

.brand-mark svg {
    width: 31px;
    height: 31px;
}

.brand-mark-small {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-text strong {
    font-size: 17px;
    letter-spacing: .12em;
    font-weight: 800;
}

.brand-text span {
    margin-top: 4px;
    color: #b9d3ee;
    font-size: 11.5px;
    letter-spacing: .04em;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 12px;
    border-radius: 9px;
    color: #dbe9f7;
    font-size: 14px;
    font-weight: 600;
    transition: background .15s ease, color .15s ease;
}

.nav-link:hover,
.nav-menu[open] > .nav-link {
    background: rgba(255, 255, 255, .11);
    color: #fff;
}

.nav-menu {
    position: relative;
}

.nav-menu summary {
    list-style: none;
    cursor: pointer;
}

.nav-menu summary::-webkit-details-marker {
    display: none;
}

.caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: .7;
}

.nav-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 330px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-lg);
    animation: menu-in .15s ease both;
}

@keyframes menu-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

.nav-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 10px;
    border-radius: 10px;
    color: var(--ink);
}

.nav-menu-item:hover {
    background: var(--bg);
    color: var(--navy);
}

.nav-menu-item strong {
    display: block;
    font-size: 14px;
}

.nav-menu-item small {
    display: block;
    color: var(--muted);
    font-size: 11.5px;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 260px;
    max-width: 430px;
    margin-left: auto;
    padding: 7px 7px 7px 14px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;
    background: rgba(255, 255, 255, .10);
    transition: background .15s ease, border-color .15s ease;
}

.header-search:focus-within {
    background: #fff;
    border-color: #fff;
}

.header-search svg {
    width: 18px;
    height: 18px;
    color: #b9d3ee;
    flex: 0 0 auto;
}

.header-search:focus-within svg {
    color: var(--navy);
}

.header-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: 13.5px;
}

.header-search:focus-within input {
    color: var(--ink);
}

.header-search input::placeholder {
    color: #b9d3ee;
}

.header-search:focus-within input::placeholder {
    color: #8c9bab;
}

.header-search button {
    flex: 0 0 auto;
    border: 0;
    border-radius: 8px;
    padding: 7px 12px;
    background: var(--orange);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
}

.header-search button:hover {
    background: var(--orange-600);
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}

.mobile-search-link {
    display: none;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 9px;
    color: #dbe9f7;
}

.mobile-search-link:hover {
    background: rgba(255, 255, 255, .11);
    color: #fff;
}

.mobile-search-link svg {
    width: 18px;
    height: 18px;
}

.version-form {
    display: flex;
    align-items: center;
    gap: 7px;
}

.version-label {
    color: #b9d3ee;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.version-form select {
    max-width: 150px;
    padding: 7px 28px 7px 10px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    background: rgba(255, 255, 255, .1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23dbe9f7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    outline: 0;
    appearance: none;
}

.version-form select option {
    color: var(--ink);
    background: #fff;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 9px;
    background: transparent;
}

.menu-toggle span {
    display: block;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

/* ------------------------------------------------------------- page layout */
.page-main {
    min-width: 0;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 34px 30px 72px;
}

.page-main-wide {
    max-width: 1240px;
}

.page-grid {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    gap: 0;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 22px;
}

.sidebar {
    position: sticky;
    top: var(--header-height);
    align-self: start;
    height: calc(100vh - var(--header-height));
    padding: 24px 16px 28px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #bdcbd9 transparent;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c6d2df;
    border-radius: 8px;
}

.sidebar-inner {
    padding: 18px 16px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
}

.sidebar-head {
    padding: 2px 4px 14px;
    border-bottom: 1px solid var(--line);
}

.sidebar-eyebrow {
    display: block;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.sidebar-head h2 {
    margin: 5px 0 5px;
    font-size: 20px;
    line-height: 1.2;
    color: var(--navy-900);
}

.sidebar-head p {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.sidebar-search-form {
    display: flex;
    gap: 6px;
    padding: 10px 0 2px;
}

.sidebar-search-form input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
    font-size: 11.5px;
}

.sidebar-search-form input:focus {
    border-color: var(--navy-700);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(11, 83, 143, .12);
}

.sidebar-search-form button {
    flex: 0 0 auto;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: var(--navy);
    color: #fff;
    font-size: 11px;
    font-weight: 750;
}

.sidebar-search-form button:hover {
    background: var(--navy-900);
}

.section-switcher {
    display: grid;
    gap: 3px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.section-switch {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 8px;
    border-radius: 9px;
    color: var(--ink-soft);
    transition: background .12s ease, color .12s ease;
}

.section-switch:hover {
    background: var(--bg);
    color: var(--navy);
}

.section-switch.is-active {
    background: var(--navy-100);
    color: var(--navy-900);
}

.section-switch-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.section-switch-text strong {
    overflow: hidden;
    font-size: 12.5px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-switch-text small {
    color: var(--muted);
    font-size: 10.5px;
}

/* --------------------------------------------------------------- tree */
.tree-panel {
    padding-top: 13px;
}

.tree-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 3px 10px;
}

.tree-filter {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
}

.tree-filter:focus {
    border-color: var(--navy-700);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(11, 83, 143, .12);
}

.tree-root,
.tree-children {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tree-item {
    position: relative;
}

.tree-row {
    display: flex;
    align-items: flex-start;
    gap: 1px;
    border-radius: 7px;
}

.tree-row:hover {
    background: #f1f5f9;
}

.tree-twisty {
    display: grid;
    place-items: center;
    flex: 0 0 20px;
    width: 20px;
    height: 28px;
    margin-top: 1px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #7d8da0;
}

.tree-twisty::before {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid currentColor;
    content: "";
    transform: rotate(0deg);
    transition: transform .15s ease;
}

.tree-item.is-open > .tree-row .tree-twisty::before {
    transform: rotate(90deg);
}

.tree-spacer {
    flex: 0 0 20px;
    width: 20px;
}

.tree-link {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 5px 5px 5px 1px;
    border-radius: 5px;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.35;
}

.tree-link:hover {
    color: var(--navy);
}

.tree-code {
    flex: 0 0 auto;
    margin-top: 1px;
    padding: 0 3px;
    border: 1px solid #d7e1eb;
    border-radius: 4px;
    background: #f8fafc;
    color: var(--navy-700);
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 1.45;
}

.tree-label {
    min-width: 0;
    word-break: break-word;
}

.tree-link.is-branch .tree-label {
    font-weight: 650;
    color: #26374a;
}

.tree-count {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 0 4px;
    border-radius: 8px;
    background: #edf2f7;
    color: var(--muted);
    font-size: 9.5px;
    line-height: 1.6;
}

.tree-item.is-active > .tree-row {
    background: var(--orange-100);
}

.tree-item.is-active > .tree-row .tree-link,
.tree-item.is-active > .tree-row .tree-label {
    color: #a63c08;
    font-weight: 750;
}

.tree-children {
    display: none;
    margin-left: 11px;
    padding-left: 8px;
    border-left: 1px solid #e6ecf2;
}

.tree-item.is-open > .tree-children {
    display: block;
}

.tree-item.is-filtered-out {
    display: none;
}

.tree-empty {
    margin: 10px 4px;
    color: var(--muted);
    font-size: 12px;
}

/* --------------------------------------------------------------- mobile */
.mobile-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 10px 20px 0;
}

.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: #fff;
    color: var(--navy);
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle svg {
    width: 18px;
    height: 18px;
}

.mobile-active-section {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(9, 24, 40, .45);
    backdrop-filter: blur(2px);
}

/* ----------------------------------------------------------------- hero */
.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 82% 12%, rgba(242, 103, 34, .30), transparent 34%),
        radial-gradient(circle at 12% 90%, rgba(38, 111, 175, .35), transparent 32%),
        linear-gradient(120deg, #00294f 0%, #003b71 52%, #084c88 100%);
    color: #fff;
}

.hero-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 54px;
    align-items: center;
    max-width: 1240px;
    margin: 0 auto;
    padding: 72px 30px 80px;
}

.hero-copy {
    animation: rise .55s ease both;
}

@keyframes rise {
    from { transform: translateY(14px); }
    to { transform: none; }
}

.eyebrow {
    display: inline-block;
    color: var(--orange);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: #ffb48a;
}

.hero h1 {
    max-width: 720px;
    margin: 14px 0 18px;
    font-size: clamp(38px, 5.2vw, 66px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.02;
}

.hero h1 em {
    color: #ffb48a;
    font-family: var(--serif);
    font-weight: 400;
}

.hero-search {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 640px;
    padding: 7px 7px 7px 17px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 13px;
    background: rgba(255, 255, 255, .10);
    box-shadow: 0 18px 38px rgba(0, 18, 38, .18);
    backdrop-filter: blur(8px);
}

.hero-search svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: #cfe0f0;
}

.hero-search input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: 14.5px;
}

.hero-search input::placeholder {
    color: #acc8e2;
}

.hero-search button {
    flex: 0 0 auto;
    border: 0;
    border-radius: 9px;
    padding: 11px 18px;
    background: var(--orange);
    color: #fff;
    font-size: 13px;
    font-weight: 750;
    box-shadow: 0 6px 14px rgba(242, 103, 34, .28);
}

.hero-search button:hover {
    background: var(--orange-600);
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 30px;
    margin-top: 30px;
}

.hero-stats div {
    display: flex;
    flex-direction: column;
}

.hero-stats strong {
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
}

.hero-stats span {
    color: #a8c6e3;
    font-size: 11.5px;
    letter-spacing: .04em;
}

.hero-card {
    position: relative;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 22px;
    background: rgba(255, 255, 255, .97);
    color: var(--ink);
    box-shadow: 0 30px 70px rgba(0, 18, 38, .34);
    animation: rise .65s .08s ease both;
}

.hero-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.badge-live {
    background: var(--green-100);
    color: var(--green);
}

.hero-card-code {
    color: #b7c5d5;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
}

.hero-card-title {
    padding: 16px 22px 20px;
    border-bottom: 1px solid var(--line);
}

.hero-card-title span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .28em;
}

.hero-card-title strong {
    display: block;
    margin: 2px 0 2px;
    color: var(--navy-900);
    font-size: 42px;
    font-weight: 850;
    letter-spacing: -.04em;
    line-height: 1;
}

.hero-card-title small {
    color: var(--muted);
    font-size: 11.5px;
}

.hero-version-list {
    display: grid;
    gap: 7px;
    padding: 14px;
}

.hero-version {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--ink);
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.hero-version:hover {
    border-color: #b9cce0;
    background: #f8fbff;
    color: var(--ink);
    transform: translateY(-1px);
}

.hero-version.is-selected {
    border-color: #f5b28e;
    background: var(--orange-100);
    box-shadow: inset 0 0 0 1px rgba(242, 103, 34, .18);
}

.hero-version-code {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--navy);
    color: #fff;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 10px;
    font-weight: 700;
}

.hero-version strong {
    display: block;
    font-size: 13.5px;
    line-height: 1.2;
}

.hero-version small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.hero-version-check {
    display: none;
    margin-left: auto;
    color: var(--orange);
    font-size: 16px;
    font-weight: 800;
}

.hero-version.is-selected .hero-version-check {
    display: block;
}

.hero-version-all {
    display: block;
    padding: 8px 12px;
    color: var(--navy-700);
    font-size: 11.5px;
    font-weight: 650;
    text-align: center;
}

.hero-version-all:hover {
    color: var(--orange-600);
}

.hero-version-all.is-active {
    border-radius: 8px;
    background: var(--navy-100);
    color: var(--navy);
    font-weight: 800;
}

.hero-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 22px 17px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
}

.hero-card-foot strong {
    color: var(--navy);
    font-size: 12px;
}

.hero-pattern {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: .18;
    background-image:
        linear-gradient(rgba(255, 255, 255, .25) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .25) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(90deg, transparent 0%, #000 55%, #000 100%);
    pointer-events: none;
}

/* --------------------------------------------------------------- home */
.home-section {
    max-width: 1240px;
    margin: 0 auto;
    padding: 64px 30px 8px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 5px 0 0;
    color: var(--navy-900);
    font-size: clamp(25px, 3vw, 34px);
    letter-spacing: -.025em;
    line-height: 1.1;
}

.section-heading p {
    max-width: 430px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    text-align: right;
}

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

.section-card {
    display: flex;
    gap: 15px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--card);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.section-card:hover {
    border-color: #c3d3e2;
    box-shadow: var(--shadow);
    color: var(--ink);
    transform: translateY(-3px);
}

.section-card-icon {
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: var(--navy-100);
    color: var(--navy);
}

.section-card-icon svg {
    width: 25px;
    height: 25px;
}

.section-card-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.section-card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.section-card-name {
    color: var(--navy-900);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
}

.section-card-count {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 650;
}

.section-card-desc {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.section-card-cta {
    margin-top: auto;
    padding-top: 12px;
    color: var(--orange-600);
    font-size: 11.5px;
    font-weight: 750;
}

.section-card-electrical .section-card-icon { background: #e6f0ff; color: #1b5fae; }
.section-card-tests .section-card-icon { background: #e8f7ef; color: #13855b; }
.section-card-recipes .section-card-icon { background: #f4ecff; color: #6f42c1; }
.section-card-values .section-card-icon { background: #fff4e5; color: #b26108; }
.section-card-diagnostics .section-card-icon { background: #fdecea; color: #b03a2e; }
.section-card-procedures .section-card-icon { background: #e8f3f8; color: #0b6b8a; }

.section-dot {
    display: inline-block;
    flex: 0 0 9px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #1b5fae;
}

.section-dot-electrical { background: #1b5fae; }
.section-dot-tests { background: #13855b; }
.section-dot-recipes { background: #6f42c1; }
.section-dot-values { background: #c47a12; }
.section-dot-diagnostics { background: #b03a2e; }
.section-dot-procedures { background: #0b6b8a; }

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

.quick-card {
    display: flex;
    flex-direction: column;
    min-height: 108px;
    padding: 16px 17px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, transform .15s ease;
}

.quick-card:hover {
    border-color: #c8d7e5;
    color: var(--ink);
    transform: translateY(-2px);
}

.quick-card-kicker {
    min-height: 15px;
    color: var(--orange-600);
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
}

.quick-card strong {
    margin: 5px 0 10px;
    font-size: 14px;
    line-height: 1.35;
}

.quick-card-cta {
    margin-top: auto;
    color: var(--navy-700);
    font-size: 11px;
    font-weight: 700;
}

/* --------------------------------------------------------------- buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.button svg {
    width: 16px;
    height: 16px;
}

.button-primary {
    background: var(--navy);
    color: #fff;
}

.button-primary:hover {
    background: var(--navy-900);
    color: #fff;
}

.button-ghost {
    border-color: var(--line-strong);
    background: #fff;
    color: var(--navy);
}

.button-ghost:hover {
    border-color: #b4c8db;
    background: #f8fbff;
    color: var(--navy);
}

.button-quiet {
    border-color: var(--line);
    background: #fff;
    color: var(--ink-soft);
}

.button-quiet:hover {
    border-color: #c5d4e2;
    background: #f8fbff;
    color: var(--navy);
}

/* --------------------------------------------------------- document page */
.doc-page {
    animation: rise .35s ease both;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 19px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.5;
}

.breadcrumbs a {
    color: var(--muted);
    font-weight: 600;
}

.breadcrumbs a:hover {
    color: var(--orange-600);
}

.crumb-sep {
    color: #b4c1ce;
}

.doc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 26px;
    padding: 0 0 23px;
    border-bottom: 1px solid var(--line);
}

.doc-header-main {
    min-width: 0;
}

.doc-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
}

.section-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 9px;
    border-radius: 99px;
    background: #eef3f8;
    color: #3a4d62;
    font-size: 10.5px;
    font-weight: 750;
    letter-spacing: .02em;
}

.section-pill .section-dot {
    width: 7px;
    height: 7px;
    flex-basis: 7px;
}

.code-chip {
    display: inline-block;
    padding: 2px 7px;
    border: 1px solid #d8e2ec;
    border-radius: 6px;
    background: #f8fafc;
    color: var(--navy-700);
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
    vertical-align: 1px;
}

.code-chip-lg {
    font-size: 11px;
    padding: 3px 8px;
}

.doc-header h1 {
    margin: 0;
    color: var(--navy-900);
    font-size: clamp(25px, 3.1vw, 38px);
    font-weight: 800;
    letter-spacing: -.028em;
    line-height: 1.12;
}

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    background: #eef3f8;
    color: #4f6275;
    font-size: 10.5px;
    font-weight: 650;
}

.meta-chip svg {
    width: 12px;
    height: 12px;
}

.meta-chip-muted {
    background: transparent;
    padding-left: 0;
    color: #93a0ae;
}

.doc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    flex: 0 0 auto;
    padding-top: 4px;
}

/* ------------------------------------------------------------ doc content */
.doc-content {
    max-width: 960px;
    padding-top: 28px;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.72;
}

.doc-content p {
    margin: 0 0 10px;
}

.doc-p {
    color: var(--ink-soft);
}

.doc-heading {
    color: var(--navy-900);
    letter-spacing: -.015em;
    line-height: 1.25;
}

.doc-heading-1 {
    margin: 34px 0 11px;
    padding-bottom: 7px;
    border-bottom: 2px solid #e8eef5;
    font-size: 21px;
    font-weight: 800;
    text-transform: uppercase;
}

.doc-heading-2 {
    margin: 27px 0 9px;
    color: var(--navy);
    font-size: 17px;
    font-weight: 800;
    text-transform: uppercase;
}

.doc-heading-3 {
    margin: 22px 0 8px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 800;
}

.doc-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 32px 0 13px;
    padding: 9px 13px;
    border-left: 4px solid var(--orange);
    border-radius: 0 8px 8px 0;
    background: linear-gradient(90deg, #fff3eb, #fffaf7);
    color: var(--navy-900);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
    text-transform: uppercase;
}

.doc-content > .doc-title:first-child {
    margin-top: 0;
}

.title-icon {
    display: grid;
    place-items: center;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
}

.title-icon svg {
    width: 14px;
    height: 14px;
}

.title-icon-remove { background: #5f6f80; }
.title-icon-install { background: var(--green); }

.page-jump {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 4px;
    padding: 2px 7px;
    border: 1px solid #d7e4ef;
    border-radius: 5px;
    background: #f7fbff;
    font-size: 11.5px;
    font-weight: 700;
    vertical-align: 1px;
}

.page-jump .title-icon {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
}

.page-jump .title-icon svg {
    width: 10px;
    height: 10px;
}

.doc-list {
    margin: 12px 0 16px;
    padding: 13px 16px;
    border: 1px solid #e6edf4;
    border-radius: 10px;
    background: #fbfdff;
}

.doc-list-title {
    margin: 0 0 7px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.doc-list ul {
    margin: 0;
    padding-left: 20px;
}

.doc-list li {
    margin: 5px 0;
    padding-left: 2px;
}

.doc-ref {
    color: var(--navy-700);
    font-weight: 650;
    text-decoration: underline;
    text-decoration-color: #b9cfe4;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.doc-ref:hover {
    color: var(--orange-600);
    text-decoration-color: var(--orange);
}

.doc-ref .code-chip {
    text-decoration: none;
}

.doc-ref-missing {
    color: #9a6a2e;
    text-decoration: line-through;
    text-decoration-color: #d5b88f;
    cursor: help;
}

.ref-description {
    text-decoration: inherit;
}

.doc-ref-line {
    margin: 8px 0;
}

/* tables */
.table-scroll {
    max-width: 100%;
    margin: 16px 0 22px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.doc-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    font-size: 12.5px;
    line-height: 1.45;
}

.doc-table th,
.doc-table td {
    padding: 8px 10px;
    border: 1px solid #e4ebf2;
    vertical-align: top;
    text-align: left;
}

.doc-table thead th {
    background: linear-gradient(180deg, #f0f5fa, #e8eff6);
    color: var(--navy-900);
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.doc-table tbody tr:nth-child(even) td {
    background: #fbfcfe;
}

.doc-table tbody tr:hover td {
    background: #f4f9ff;
}

.doc-table p {
    margin: 0 0 3px;
}

.doc-table p:last-child {
    margin-bottom: 0;
}

.doc-table .code-chip {
    font-size: 10px;
}

/* figures */
.doc-figure {
    margin: 18px 0 22px;
    text-align: center;
}

.media-open {
    display: inline-block;
    max-width: 100%;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow .15s ease, transform .15s ease;
}

.media-open:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.media-open img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* diagrams */
.diagram {
    margin: 18px 0 24px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.diagram-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    background: #f7fafc;
}

.diagram-label {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.diagram-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.diagram-actions button {
    min-width: 29px;
    height: 27px;
    padding: 0 7px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: #fff;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 700;
}

.diagram-actions button:hover {
    border-color: #aebfd0;
    background: #f2f8ff;
    color: var(--navy);
}

.diagram-actions .diagram-fullscreen {
    font-size: 10.5px;
    letter-spacing: .02em;
}

.diagram-viewport {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    max-height: 620px;
    padding: 10px;
    overflow: auto;
    background:
        linear-gradient(#f0f4f8 1px, transparent 1px) 0 0 / 18px 18px,
        linear-gradient(90deg, #f0f4f8 1px, transparent 1px) 0 0 / 18px 18px,
        #fff;
}

.diagram-viewport {
    cursor: grab;
}

.diagram-viewport.is-panning {
    cursor: grabbing;
    user-select: none;
}

.diagram-viewport img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    transform-origin: center center;
    transition: transform .12s ease;
}

body.dialog-open {
    overflow: hidden;
}

.diagram-compact .diagram-viewport {
    min-height: 0;
    max-height: none;
    padding: 14px;
}

.diagram-compact .diagram-viewport img {
    width: auto;
    height: 180px;
    max-width: 100%;
}

.diagram.is-zoomed .diagram-viewport {
    align-items: flex-start;
    justify-content: flex-start;
}

/* callouts */
.callout {
    display: flex;
    gap: 11px;
    margin: 18px 0 22px;
    padding: 14px 15px;
    border: 1px solid #d9e7dc;
    border-left: 4px solid var(--green);
    border-radius: 9px;
    background: var(--green-100);
    color: #1d4636;
    font-size: 13.5px;
    line-height: 1.6;
}

.callout p {
    margin: 0 0 6px;
}

.callout p:last-child {
    margin-bottom: 0;
}

.callout-icon {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
}

.callout-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.callout-icon svg circle {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.callout-body {
    min-width: 0;
}

.callout-caution {
    border-color: #f0dfae;
    border-left-color: #c9931f;
    background: var(--amber-100);
    color: #5f4712;
}

.callout-caution .callout-icon {
    background: #c9931f;
}

.callout-danger {
    border-color: #f2c9c3;
    border-left-color: var(--red);
    background: var(--red-100);
    color: #6b2018;
}

.callout-danger .callout-icon {
    background: var(--red);
}

/* unit headings for aggregated pages */
.doc-unit {
    margin: 0 0 34px;
}

.doc-unit + .doc-unit {
    padding-top: 30px;
    border-top: 1px dashed #d7e2ed;
}

.unit-head {
    margin: 0 0 14px;
}

.unit-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.unit-title {
    margin: 0;
    color: var(--navy-900);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.25;
}

.unit-title a {
    color: inherit;
}

.unit-title a:hover {
    color: var(--orange-600);
}

/* page links / variant panel */
.page-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    max-width: 960px;
    margin: 22px 0 0;
    padding: 10px 12px;
    border: 1px solid #e4ebf2;
    border-radius: 10px;
    background: #fff;
}

.page-links-label {
    margin-right: 4px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.page-links a {
    padding: 3px 8px;
    border-radius: 6px;
    background: #f1f6fb;
    color: var(--navy-700);
    font-size: 11.5px;
    font-weight: 650;
}

.page-links a:hover {
    background: var(--orange-100);
    color: var(--orange-600);
}

.variant-panel {
    max-width: 960px;
    margin: 18px 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.variant-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    color: var(--navy);
    font-size: 12.5px;
    font-weight: 750;
    cursor: pointer;
    list-style: none;
}

.variant-panel summary::-webkit-details-marker {
    display: none;
}

.variant-count {
    padding: 1px 8px;
    border-radius: 99px;
    background: var(--navy-100);
    color: var(--navy);
    font-size: 10.5px;
}

.variant-panel ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0 14px 13px;
    list-style: none;
}

.variant-panel li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border: 1px solid #e5edf4;
    border-radius: 6px;
    background: #fafcff;
    font-size: 11.5px;
}

/* chapter / children */
.chapter-intro {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0 18px;
    padding: 17px 19px;
    border: 1px solid #dbe6f1;
    border-radius: 13px;
    background: linear-gradient(100deg, #f1f7fd, #fbfdff);
}

.chapter-intro-icon {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #fff;
    color: var(--navy);
    box-shadow: var(--shadow-sm);
}

.chapter-intro-icon svg {
    width: 25px;
    height: 25px;
}

.chapter-intro h2 {
    margin: 1px 0 3px;
    color: var(--navy-900);
    font-size: 18px;
}

.chapter-intro p {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
}

.child-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    margin: 18px 0 28px;
}

.child-card {
    display: flex;
    flex-direction: column;
    min-height: 132px;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.child-card:hover {
    border-color: #c6d7e6;
    box-shadow: var(--shadow);
    color: var(--ink);
    transform: translateY(-2px);
}

.child-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.child-card-count {
    color: var(--muted);
    font-size: 10px;
    font-weight: 650;
}

.child-card strong {
    color: var(--navy-900);
    font-size: 14px;
    line-height: 1.35;
}

.child-card-preview {
    display: -webkit-box;
    margin-top: 5px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.5;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.child-card-cta {
    margin-top: auto;
    padding-top: 10px;
    color: var(--orange-600);
    font-size: 11px;
    font-weight: 750;
}

/* notices */
.notice {
    margin: 20px 0;
    padding: 17px 19px;
    border: 1px solid #dbe6f1;
    border-left: 4px solid var(--navy-700);
    border-radius: 9px;
    background: #f4f9ff;
    color: var(--ink-soft);
    font-size: 13.5px;
}

.notice strong {
    display: block;
    margin-bottom: 4px;
    color: var(--navy-900);
    font-size: 14px;
}

.notice p {
    margin: 0 0 10px;
}

.notice p:last-child {
    margin-bottom: 0;
}

.notice-warning {
    border-color: #f0dfae;
    border-left-color: #c9931f;
    background: var(--amber-100);
}

.notice-warning strong {
    color: #5f4712;
}

.notice-empty {
    border-left-color: var(--orange);
    background: #fff8f4;
}

.doc-warning {
    margin: 12px 0;
    padding: 12px 15px;
    border: 1px solid #f2c9c3;
    border-radius: 8px;
    background: var(--red-100);
    color: #6b2018;
    font-size: 13px;
}

/* pager */
.doc-pager {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    max-width: 960px;
    margin: 46px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.pager-link {
    display: flex;
    flex-direction: column;
    max-width: 46%;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, transform .15s ease;
}

.pager-link:hover {
    border-color: #c5d5e4;
    color: var(--ink);
    transform: translateY(-1px);
}

.pager-next {
    align-items: flex-end;
    text-align: right;
}

.pager-dir {
    color: var(--orange-600);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.pager-link strong {
    margin-top: 3px;
    color: var(--navy-900);
    font-size: 12.5px;
    line-height: 1.35;
}

/* --------------------------------------------------------------- search */
.search-page {
    max-width: 900px;
}

.search-header {
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.search-header h1 {
    margin: 7px 0 8px;
    color: var(--navy-900);
    font-size: clamp(29px, 4vw, 42px);
    letter-spacing: -.03em;
    line-height: 1.1;
}

.search-summary {
    margin: 0 0 17px;
    color: var(--muted);
    font-size: 14px;
}

.search-summary strong {
    color: var(--ink);
}

.search-version {
    margin-left: 7px;
    color: var(--navy-700);
    font-size: 11px;
    font-weight: 700;
}

.search-page-form {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 7px 7px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.search-page-form svg {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    color: var(--muted);
}

.search-page-form input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
}

.search-page-form button {
    flex: 0 0 auto;
    border: 0;
    border-radius: 8px;
    padding: 9px 16px;
    background: var(--navy);
    color: #fff;
    font-size: 12.5px;
    font-weight: 750;
}

.search-page-form button:hover {
    background: var(--navy-900);
}

.search-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin-top: 13px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-field label {
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.filter-field select {
    min-width: 185px;
    padding: 7px 28px 7px 9px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23617083' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
    color: var(--ink);
    font-size: 12px;
    outline: 0;
    appearance: none;
}

.filter-field select:focus {
    border-color: var(--navy-700);
    box-shadow: 0 0 0 3px rgba(11, 83, 143, .12);
}

.search-filter-bar .button {
    padding: 8px 14px;
    font-size: 11.5px;
}

.search-filter-clear {
    align-self: center;
    margin-left: auto;
    color: var(--navy-700);
    font-size: 11.5px;
    font-weight: 750;
}

.search-filter-clear:hover {
    color: var(--orange-600);
}

.search-facets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 11px;
}

.search-facet {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: #fff;
    color: var(--ink-soft);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.25;
}

.search-facet:hover {
    border-color: #c4d4e3;
    background: #f8fbff;
    color: var(--navy);
}

.search-facet.is-active {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
}

.search-facet.is-empty {
    opacity: .5;
}

.search-facet .section-dot {
    width: 7px;
    height: 7px;
    flex-basis: 7px;
}

.search-facet-count {
    padding: 1px 6px;
    border-radius: 99px;
    background: #eef3f8;
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 800;
}

.search-facet.is-active .search-facet-count {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}

.search-scope {
    margin-left: 7px;
    color: var(--navy-700);
    font-size: 11px;
    font-weight: 700;
}

.search-suggestions {
    padding-top: 28px;
}

.search-suggestions h2 {
    margin: 0 0 13px;
    color: var(--navy-900);
    font-size: 19px;
}

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

.suggestion-grid a {
    display: flex;
    flex-direction: column;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.suggestion-grid a:hover {
    border-color: #c8d8e7;
    color: var(--ink);
    transform: translateY(-1px);
}

.suggestion-grid strong {
    color: var(--navy-900);
    font-size: 13.5px;
}

.suggestion-grid span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.4;
}

.search-results {
    display: grid;
    gap: 11px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: result;
}

.search-result {
    position: relative;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.search-result:hover {
    border-color: #c8d8e7;
    box-shadow: var(--shadow);
}

.search-result-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
}

.search-result h2 {
    margin: 0 0 3px;
    font-size: 17px;
    line-height: 1.3;
}

.search-result h2 a {
    color: var(--navy-900);
}

.search-result h2 a:hover {
    color: var(--orange-600);
}

.search-path {
    margin: 0 0 7px;
    color: #95a3b2;
    font-size: 10.5px;
}

.search-snippet {
    margin: 0;
    color: var(--ink-soft);
    font-size: 12.5px;
    line-height: 1.6;
}

.search-snippet mark {
    padding: 0 2px;
    border-radius: 3px;
    background: #ffe2c7;
    color: #7a3307;
}

.search-open {
    display: inline-block;
    margin-top: 8px;
    color: var(--navy-700);
    font-size: 11px;
    font-weight: 750;
}

.search-more {
    margin-top: 15px;
    color: var(--muted);
    font-size: 12px;
}

.empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

/* --------------------------------------------------------------- helpers */
.static-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

/* --------------------------------------------------------------- error */
.error-page {
    max-width: 650px;
    margin: 42px auto;
    padding: 30px 26px;
    text-align: center;
}

.error-code {
    color: #dbe5ee;
    font-size: clamp(80px, 16vw, 140px);
    font-weight: 900;
    letter-spacing: -.08em;
    line-height: .9;
}

.error-page h1 {
    margin: 5px 0 8px;
    color: var(--navy-900);
    font-size: 30px;
}

.error-page p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.error-search {
    max-width: 480px;
    margin: 0 auto 16px;
}

.error-page .static-actions {
    justify-content: center;
}

.error-sections {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 22px;
}

.error-sections a {
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: #fff;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

/* --------------------------------------------------------------- dialog */
.media-dialog {
    width: min(1200px, 94vw);
    max-width: 94vw;
    max-height: 92vh;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 40px 100px rgba(0, 0, 0, .45);
    overflow: hidden;
}

.media-dialog::backdrop {
    background: rgba(4, 14, 26, .72);
    backdrop-filter: blur(3px);
}

.media-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}

.media-dialog-title {
    color: var(--navy);
    font-size: 12px;
    font-weight: 750;
}

.media-dialog-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.media-dialog-actions button,
.media-dialog-actions a {
    padding: 5px 9px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: #fff;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 700;
}

.media-dialog-actions button:hover,
.media-dialog-actions a:hover {
    border-color: #aebfd0;
    color: var(--navy);
}

.media-dialog-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: min(78vh, 780px);
    padding: 12px;
    overflow: auto;
    background:
        linear-gradient(#eef3f8 1px, transparent 1px) 0 0 / 20px 20px,
        linear-gradient(90deg, #eef3f8 1px, transparent 1px) 0 0 / 20px 20px,
        #fff;
}

.media-dialog-body img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    transform-origin: center center;
    transition: transform .12s ease;
}

/* --------------------------------------------------------------- footer */
.site-footer {
    border-top: 1px solid var(--line);
    background: #fff;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px 34px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 30px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 260px;
}

.footer-brand strong {
    color: var(--navy-900);
    font-size: 13px;
}

.footer-brand p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links a {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.footer-links a:hover {
    color: var(--orange-600);
}

.footer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-left: auto;
    color: #93a0ae;
    font-size: 10.5px;
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
    .header-inner { gap: 14px; padding: 0 18px; }
    .brand-text span { display: none; }
    .header-search { max-width: 330px; }
    .primary-nav .nav-link { padding: 9px 9px; }
    .hero-grid { gap: 34px; padding: 56px 26px 62px; }
    .section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
    .doc-header h1 { font-size: 30px; }
}

@media (max-width: 980px) {
    :root { --sidebar-width: 290px; }
    .page-grid { padding: 0 14px; }
    .page-main { padding: 26px 20px 60px; }
    .header-search { display: none; }
    .mobile-search-link { display: grid; }
    .menu-toggle { display: flex; }
    .primary-nav {
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 10px 14px 14px;
        border-top: 1px solid rgba(255, 255, 255, .1);
        background: var(--navy-900);
        box-shadow: 0 18px 30px rgba(0, 10, 25, .25);
    }
    body.nav-open .primary-nav { display: flex; }
    .nav-menu-panel {
        position: static;
        width: auto;
        margin: 4px 0 6px;
        border-color: rgba(255, 255, 255, .12);
        background: rgba(255, 255, 255, .06);
        box-shadow: none;
    }
    .nav-menu-item { color: #e7f0f9; }
    .nav-menu-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
    .nav-menu-item small { color: #a9c6e2; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-card { max-width: 520px; }
    .section-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
    .section-heading p { max-width: none; text-align: left; }
    .home-section { padding: 46px 24px 6px; }
    .mobile-bar { display: flex; }
    .sidebar {
        position: fixed;
        z-index: 200;
        top: 0;
        left: 0;
        width: min(360px, 88vw);
        height: 100vh;
        padding: 14px;
        background: var(--bg);
        box-shadow: 20px 0 60px rgba(0, 15, 30, .25);
        transform: translateX(-105%);
        transition: transform .22s ease;
    }
    body.sidebar-open { overflow: hidden; }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-scrim { display: block; }
    .sidebar-inner { border-radius: 16px; }
    .page-grid { display: block; }
    .page-main { max-width: 100%; }
    .doc-header { flex-direction: column; gap: 12px; }
    .doc-actions { padding-top: 0; }
    .child-grid { grid-template-columns: 1fr; }
    .footer-inner { padding: 24px 20px; }
    .footer-meta { margin-left: 0; }
}

@media (max-width: 480px) {
    .brand-text { display: none; }
    .version-form select { max-width: 108px; }
    .header-tools { gap: 8px; }
    .mobile-search-link { width: 38px; height: 38px; }
    .menu-toggle { width: 38px; height: 38px; }
}

@media (max-width: 700px) {
    :root { --header-height: 68px; }
    body { font-size: 15px; }
    .header-inner { min-height: var(--header-height); padding: 0 13px; gap: 8px; }
    .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
    .brand-mark svg { width: 26px; height: 26px; }
    .brand-text strong { font-size: 14px; }
    .version-label { display: none; }
    .version-form select { max-width: 122px; font-size: 11.5px; }
    .hero-grid { padding: 38px 18px 48px; gap: 28px; }
    .hero h1 { font-size: clamp(34px, 10vw, 46px); }
    .hero-search { flex-wrap: wrap; padding: 8px; }
    .hero-search svg { display: none; }
    .hero-search input { flex-basis: 100%; padding: 8px 8px 6px; }
    .hero-search button { width: 100%; }
    .hero-stats { gap: 12px 20px; }
    .hero-stats strong { font-size: 20px; }
    .hero-card-title strong { font-size: 34px; }
    .home-section { padding: 38px 16px 4px; }
    .section-grid, .quick-grid, .suggestion-grid { grid-template-columns: 1fr; }
    .page-main { padding: 20px 14px 48px; }
    .breadcrumbs { font-size: 10.5px; }
    .doc-header h1 { font-size: 26px; }
    .doc-content { padding-top: 20px; font-size: 14.5px; }
    .doc-heading-1 { font-size: 18px; }
    .doc-title { font-size: 16px; }
    .doc-table { font-size: 11.5px; min-width: 360px; }
    .doc-table th, .doc-table td { padding: 6px 7px; }
    .diagram-viewport { min-height: 190px; max-height: 440px; }
    .diagram-actions .diagram-fullscreen { display: none; }
    .page-links { margin-top: 16px; }
    .doc-pager { flex-direction: column; }
    .pager-link { max-width: 100%; }
    .pager-next { align-items: flex-start; text-align: left; }
    .search-page { max-width: 100%; }
    .search-page-form { flex-wrap: wrap; }
    .search-page-form input { flex-basis: 100%; padding: 6px 4px; }
    .search-page-form button { width: 100%; }
    .search-filter-bar { flex-direction: column; align-items: stretch; }
    .filter-field select { width: 100%; min-width: 0; }
    .search-filter-bar .button { width: 100%; }
    .search-filter-clear { align-self: flex-start; margin-left: 0; }
    .footer-inner { gap: 16px; }
    .footer-brand { min-width: 0; }
    .media-dialog { width: 96vw; max-height: 90vh; }
    .media-dialog-head { flex-wrap: wrap; }
    .media-dialog-actions { flex-wrap: wrap; }
    .media-dialog-body { height: 70vh; }
}

/* --------------------------------------------------------------- print */
@media print {
    .site-header,
    .sidebar,
    .mobile-bar,
    .doc-actions,
    .doc-pager,
    .site-footer,
    .page-links,
    .variant-panel,
    .diagram-toolbar,
    .media-dialog,
    .skip-link,
    .sidebar-scrim {
        display: none !important;
    }
    .page-grid { display: block; }
    .page-main { max-width: none; padding: 0; }
    body { background: #fff; font-size: 10pt; }
    .doc-content { max-width: none; }
    .doc-header { border-bottom: 0; }
    .doc-title { break-after: avoid; background: #f4f4f4 !important; }
    .doc-table, .doc-figure, .callout, .diagram { break-inside: avoid; }
    .table-scroll { overflow: visible; box-shadow: none; }
    .doc-table { min-width: 0; }
    a { color: #000; text-decoration: none; }
    .diagram-viewport { max-height: none; min-height: 0; padding: 0; background: #fff; }
    .diagram-viewport img { width: 100%; height: auto; zoom: 1 !important; }
    .diagram-compact .diagram-viewport img { height: 120px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

/* -------------------------------------------------- auth & header user */
.header-tools-anon {
    margin-left: auto;
}

.header-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.header-user-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.header-blog-link,
.header-logout-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 9px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    transition: background .15s ease, border-color .15s ease;
}

.header-blog-link:hover,
.header-logout-btn:hover {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

.header-logout-form {
    margin: 0;
}

.auth-shell {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 220px);
    padding: 36px 16px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 30px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow);
}

.auth-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--navy-100);
    color: var(--navy);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.auth-title {
    margin: 12px 0 8px;
    color: var(--navy-900);
    font-size: 26px;
    line-height: 1.2;
    font-weight: 800;
}

.auth-subtitle {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.55;
}

.auth-alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
}

.auth-alert-error {
    border: 1px solid #f5c6cb;
    background: var(--red-100);
    color: var(--red);
}

.auth-alert-info {
    border: 1px solid #b8daff;
    background: var(--navy-100);
    color: var(--navy-900);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field label {
    color: var(--ink-soft);
    font-size: 13.5px;
    font-weight: 700;
}

.auth-field input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    font-size: 15px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--navy-700);
    box-shadow: 0 0 0 3px rgba(0, 59, 113, .14);
}

.auth-submit {
    margin-top: 4px;
    padding: 12px 16px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--orange);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    transition: background .15s ease;
}

.auth-submit:hover {
    background: var(--orange-600);
}

.auth-footer {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 14px;
}

.auth-footer p {
    margin: 0 0 8px;
}

.auth-note {
    color: var(--green);
    font-size: 13px;
    font-weight: 600;
}

.auth-back {
    margin-top: 10px !important;
    font-size: 13.5px;
}

@media (max-width: 900px) {
    .header-user-name {
        display: none;
    }
}
