/* ---------- header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--bg);
    border-bottom: 1.5px solid var(--text);
}

.header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 32px;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 36px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

/* Brand lockup (Concept A, "Admit One"): the ticket mark, then CRAM at 800 with
   "CPA REVIEW" at 600 and "REVIEW" in italic accent. The inline form sits in
   the public header and the footer. .brand--stacked (CRAM over "CPA REVIEW")
   goes where width is short, like the sidebar head. The mark on its own is the
   collapsed rail and the favicon. The <svg> carries the 64:44 viewBox, so set
   one dimension and the other follows. */
.brand-ticket {
    display: block;
    flex: none;
    width: 32px;
    height: auto;
    aspect-ratio: 64 / 44;
    color: var(--accent);
}

.brand .word,
.brand-mark .word {
    font-family: 'Big Shoulders Display', sans-serif;
    font-weight: 600;
    font-size: 1.4rem;
    letter-spacing: .01em;
    color: var(--text);
}

.brand .word b,
.brand-mark .word b {
    font-weight: 800;
}

.brand .word i,
.brand-mark .word i {
    font-style: italic;
    color: var(--accent);
}

.brand--stacked {
    gap: 10px;
}

.brand--stacked .brand-ticket {
    width: 44px;
}

.brand--stacked .word {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: .86;
    font-size: .9rem;
}

.brand--stacked .word b {
    font-size: 2.05rem;
    letter-spacing: .01em;
}

.auth-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    /* The nav used to take the slack between the brand and these buttons. */
    margin-left: auto;
}

/* Public header links (signed-out view only; the app has its sidebar). */
.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 6px;
}

.site-nav-link {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 6px 10px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: .74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    cursor: pointer;
}

.site-nav-link:hover,
.site-nav-link.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

:root[data-view="app"] .site-nav {
    display: none;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 2px;
    border: 1.5px solid var(--text);
    background: none;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--text);
    color: var(--bg);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border: 1.5px solid var(--border-strong);
    border-radius: 2px;
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: .68rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.user-name {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Public Sans', sans-serif;
    padding: 12px 22px;
    border-radius: 2px;
    font-weight: 700;
    font-size: .88rem;
    letter-spacing: .01em;
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}

.btn-primary:hover {
    filter: brightness(1.08);
}

.btn-outline {
    background: transparent;
    border-color: var(--text);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--text);
    color: var(--bg);
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--accent);
    padding: 8px 2px;
    font-weight: 700;
}

.btn-gold {
    background: var(--gold);
    color: #241a06;
    border-color: var(--gold);
}

.btn-gold:hover {
    filter: brightness(1.1);
}

.btn-danger {
    background: var(--danger);
    color: var(--bg);
    border-color: var(--danger);
}

.btn-danger:hover {
    filter: brightness(1.08);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: .78rem;
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* ---------- pages ---------- */
.page {
    display: none;
}

.page.active {
    display: block;
}

section {
    padding: 64px 0;
}

section.tight {
    padding: 0 0 64px;
}

section+section {
    border-top: 1px solid var(--border);
}

/* ---------- badges ---------- */
.tag {
    display: inline-flex;
    align-items: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 2px;
    white-space: nowrap;
    border: 1px solid currentColor;
}

.tag-lesson {
    color: var(--text-muted);
}

.tag-quiz {
    color: var(--gold);
}

.tag-review {
    color: var(--success);
}

.tag-exam {
    color: var(--danger);
}

.tag-custom {
    color: var(--text-muted);
    font-style: italic;
}


@media (max-width: 900px) {
    .header-inner {
        gap: 16px;
    }
}

@media (max-width: 720px) {
    .header-inner {
        height: 60px;
        padding: 0 16px;
        gap: 12px;
    }

    .header-actions {
        gap: 8px;
    }

    .site-nav {
        margin-right: 0;
    }

    .site-nav-link {
        padding: 6px 4px;
    }

    .auth-area .btn {
        white-space: nowrap;
    }

    .wrap {
        padding: 0 20px;
    }

    section {
        padding: 48px 0;
    }
}

@media (max-width: 400px) {
    .site-header .brand {
        gap: 7px;
    }

    .site-header .brand .brand-ticket {
        width: 26px;
    }

    .site-header .brand .word {
        font-size: 1.15rem;
    }

    .header-inner {
        gap: 8px;
    }
}

