.tt-site-header {
    --tt-header-bg: rgba(18, 18, 18, 0.94);
    --tt-header-surface: #1e1e1e;
    --tt-header-hover: #282828;
    --tt-header-border: #2c2c2c;
    --tt-header-text: #e0e0e0;
    --tt-header-muted: #9e9e9e;
    --tt-header-accent: #90caf9;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 53px;
    color: var(--tt-header-text);
    background: var(--tt-header-bg);
    border-bottom: 1px solid var(--tt-header-border);
    backdrop-filter: blur(8px);
    color-scheme: dark;
    font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.4;
}

.tt-site-nav {
    width: min(1500px, 90%);
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.tt-site-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--tt-header-text);
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
}

.tt-site-brand:hover {
    color: var(--tt-header-text);
    text-decoration: none;
}

.tt-site-logo {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    font-size: 20px;
    line-height: 1;
}

.tt-study-menu {
    position: relative;
}

.tt-study-menu>summary,
.tt-study-group>summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.tt-study-menu summary::-webkit-details-marker,
.tt-study-group summary::-webkit-details-marker {
    display: none;
}

.tt-study-menu>summary {
    color: var(--tt-header-muted);
    font-size: 13px;
    font-weight: 500;
}

.tt-study-menu>summary::after {
    content: "\25BE";
    display: inline-block;
    margin-left: 6px;
    color: var(--tt-header-accent);
    transition: transform 0.15s ease;
}

.tt-study-menu[open]>summary::after {
    transform: rotate(180deg);
}

.tt-study-menu>summary:hover,
.tt-study-menu>summary:focus-visible {
    color: var(--tt-header-text);
}

.tt-study-menu-panel {
    position: absolute;
    top: calc(100% + 17px);
    right: 0;
    width: max-content;
    min-width: 220px;
    max-width: calc(100vw - 24px);
    max-height: min(60vh, 360px);
    overflow-y: auto;
    padding: 6px;
    background: var(--tt-header-surface);
    border: 1px solid var(--tt-header-border);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.tt-study-group+.tt-study-group {
    border-top: 1px solid var(--tt-header-border);
}

.tt-study-group>summary {
    padding: 9px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--tt-header-text);
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
}

.tt-study-group>summary::after {
    content: "\25B8";
    margin-left: 16px;
    color: var(--tt-header-accent);
    transition: transform 0.15s ease;
}

.tt-study-group[open]>summary::after {
    transform: rotate(90deg);
}

.tt-study-group>summary:hover,
.tt-study-group>summary:focus-visible {
    background: var(--tt-header-hover);
}

.tt-study-links {
    padding: 0 4px 6px;
}

.tt-study-links a {
    display: block;
    padding: 9px 12px 9px 16px;
    color: var(--tt-header-muted);
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
    white-space: nowrap;
}

.tt-study-links a:hover,
.tt-study-links a:focus-visible,
.tt-study-links a[aria-current="page"] {
    color: var(--tt-header-text);
    background: var(--tt-header-hover);
    text-decoration: none;
}

.tt-site-header~.topbar,
.tt-site-header~#topnav,
.tt-site-header~.route {
    top: 53px;
}

.tt-site-header~.wrap nav.toc {
    top: 53px;
    max-height: calc(100vh - 53px);
}

@media (max-width: 640px) {
    .tt-site-nav {
        width: 100%;
        padding: 0 14px;
    }

    .tt-site-brand {
        font-size: 16px;
    }
}

@media print {
    .tt-site-header {
        display: none;
    }
}