.doc-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-h);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.25rem;
    background: var(--doc-surface);
    border-bottom: 1px solid var(--doc-border);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.doc-topbar__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.doc-topbar__logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

.doc-topbar__title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--doc-text);
    line-height: 1.2;
}

.doc-topbar__subtitle {
    font-size: 0.72rem;
    color: var(--doc-muted);
    font-weight: 500;
}

.doc-topbar__search {
    flex: 1;
    max-width: 420px;
    min-width: 140px;
    position: relative;
}

.doc-topbar__search input {
    width: 100%;
    height: 38px;
    padding: 0 2.5rem 0 2.75rem;
    border: 1px solid var(--doc-border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: #f8fafc;
    color: var(--doc-text);
}

.doc-topbar__search input:focus {
    outline: none;
    border-color: var(--doc-accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.doc-topbar__search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.45;
    pointer-events: none;
    font-size: 0.9rem;
}

.doc-topbar__search-hint {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    color: var(--doc-muted);
    pointer-events: none;
}

.doc-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    background: #fff;
    border: 1px solid var(--doc-border);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
    max-height: 360px;
    overflow-y: auto;
    z-index: 1200;
}

.doc-search-results__item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.6rem 0.75rem;
    text-decoration: none;
    border-bottom: 1px solid #eef2f7;
}

.doc-search-results__item:last-child {
    border-bottom: 0;
}

.doc-search-results__item:hover {
    background: #f8fafc;
}

.doc-search-results__title {
    color: var(--doc-text);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.25;
}

.doc-search-results__meta {
    color: var(--doc-muted);
    font-size: 0.7rem;
    line-height: 1.3;
}

.doc-search-results__empty {
    padding: 0.75rem;
    color: var(--doc-muted);
    font-size: 0.78rem;
}

.doc-topbar__links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.audience-toggle {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--doc-border);
    border-radius: var(--radius-md);
    background: #fff;
    overflow: hidden;
}

.audience-toggle__btn {
    border: 0;
    background: transparent;
    color: var(--doc-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 0.45rem 0.75rem;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.audience-toggle__btn:hover {
    background: #f1f5f9;
    color: var(--doc-text);
}

.audience-toggle__btn.is-active {
    background: var(--doc-accent);
    color: #fff;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.topbar-link--primary {
    background: var(--doc-accent);
    color: #fff;
}

.topbar-link--primary:hover {
    background: var(--doc-accent-hover);
    color: #fff;
}

.topbar-link--secondary {
    background: #fff;
    color: var(--doc-text);
    border-color: var(--doc-border);
}

.topbar-link--secondary:hover {
    border-color: var(--doc-accent);
    color: var(--doc-accent);
}

.topbar-link--assetstore {
    height: 38px;
    padding: 0;
    border-radius: 10px;
    background: transparent;
    border-color: transparent;
}

.topbar-link--assetstore:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.topbar-link__assetstore-logo {
    height: 100%;
    width: auto;
    max-width: none;
    display: block;
}

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

.search-match-count {
    font-size: 0.75rem;
    color: var(--doc-muted);
    margin-left: 0.5rem;
}

.layout {
    display: flex;
    padding-top: var(--topbar-h);
    min-height: 100vh;
}

.sidebar {
    width: 300px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-right: 1px solid #1e293b;
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
    padding: 1.25rem 1rem 2.5rem;
}

.sidebar-brand {
    border: 1px solid #334155;
    border-radius: var(--radius-lg);
    padding: 1rem;
    background: rgba(255, 255, 255, 0.04);
    margin-bottom: 1rem;
}

.sidebar-brand h2 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.sidebar-brand p {
    color: var(--sidebar-muted);
    font-size: 0.78rem;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 0.2rem;
}

.sidebar a {
    color: #cbd5e1;
    text-decoration: none;
    display: block;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    font-size: 0.82rem;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar a.nav-disabled {
    opacity: 0.35;
    pointer-events: none;
}

.sidebar a.active {
    background: var(--doc-accent);
    color: #fff;
}

.sub-menu {
    margin-left: 0.5rem;
    margin-bottom: 0.35rem;
    border-left: 1px solid #334155;
    padding-left: 0.5rem;
}

.sidebar-section-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sidebar-muted);
    padding: 0.6rem 0.6rem 0.35rem;
    font-weight: 600;
}

.main-content {
    margin-left: 300px;
    width: calc(100% - 300px);
    padding: 2rem 2.5rem 4rem;
}

@media (max-width: 1100px) {
    .doc-topbar__subtitle { display: none; }
}

@media (max-width: 900px) {
    .layout { display: block; }
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem 1rem 3rem;
    }
    .doc-topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 0.65rem 1rem;
        gap: 0.5rem;
    }
    .doc-topbar__search {
        max-width: none;
        order: 3;
        width: 100%;
    }
    .audience-toggle__btn {
        padding: 0.4rem 0.55rem;
        font-size: 0.69rem;
    }
}
