/* =========================================================
   AeroESP Design System
   Phase 5 — Premium Aerospace EdTech Interface
   ========================================================= */


/* =========================================================
   01. DESIGN TOKENS
   ========================================================= */

:root {

    /* Brand */
    --aero-ink: #071926;
    --aero-ink-soft: #102a3b;
    --aero-navy: #0b3047;

    --aero-blue: var(--theme-accent);
    --aero-sky: var(--theme-accent);
    --aero-cyan: var(--theme-accent);

    --aero-ice: #eaf7fc;
    --aero-cloud: #f5f8fa;
    --aero-white: #ffffff;

    --aero-warm: #f5eee4;
    --aero-sand: #e8d7c2;

    /* Semantic */
    --success: #14855f;
    --success-soft: #e9f7f1;

    --warning: #b77418;
    --warning-soft: #fff6e8;

    --danger: #c84949;
    --danger-soft: #fff0f0;

    --info: var(--theme-accent-strong);
    --info-soft: #edf6fd;

    /* Text on the soft fills above. Redefined for the dark theme in
       UI-04, with the fills, so an alert or a status box never stays
       light on a dark page. */
    --success-text: #176746;
    --warning-text: #8a5a12;
    --danger-text: #a43a3a;
    --info-text: #24566b;

    /* Text */
    --text-primary: #0b1f2d;
    --text-secondary: #526878;
    --text-muted: #81919c;

    /* Borders */
    --border-soft: rgba(17, 46, 65, 0.09);
    --border-medium: rgba(17, 46, 65, 0.15);

    /* Surfaces */
    --surface: #ffffff;
    --surface-soft: #f5f8fa;
    --surface-elevated: rgba(255,255,255,.88);

    /* Typography - the reader's own preference, not the design's.
       Every absolute font-size below is written as
       calc(<size> * var(--font-scale)), so this one number is the
       whole text-size setting. Spacing, widths and chart boxes stay
       in their own units and do not grow with it. A signed-in user's
       choice overrides these three from an inline style on <html>;
       see accounts/typography.py, which is the one list of values. */
    --font-scale: 1;

    --font-body:
        Inter,
        "Avenir Next",
        "Segoe UI",
        Arial,
        sans-serif;

    --font-rtl:
        Tahoma,
        "Segoe UI",
        sans-serif;

    /* Sidebar */
    --sidebar-width: 274px;

    /* Topbar */
    --topbar-height: 76px;

    /* Radius */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --radius-xl: 36px;
    --radius-pill: 999px;

    /* Shadow */
    --shadow-xs:
        0 1px 2px rgba(7, 25, 38, .03);

    --shadow-sm:
        0 8px 24px rgba(7, 25, 38, .06);

    --shadow-md:
        0 18px 50px rgba(7, 25, 38, .09);

    --shadow-lg:
        0 32px 90px rgba(7, 25, 38, .15);

    /* Animation */
    --ease:
        cubic-bezier(.22, .8, .24, 1);

    --transition:
        180ms var(--ease);
}


/* =========================================================
   02. RESET
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-body);

    background:
        radial-gradient(
            circle at 80% -10%,
            rgba(var(--theme-accent-rgb), .11),
            transparent 34rem
        ),
        #f5f8fa;

    color: var(--text-primary);

    font-size: calc(15px * var(--font-scale));
    line-height: 1.6;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

img,
svg {
    max-width: 100%;
}

::selection {
    color: #ffffff;

    /* Not --theme-accent-strong: that token is solved for reading as
       text *on* a surface, so in dark mode it is bright and a white
       selection on it is unreadable. The gradient's dark stop is the
       accent role solved for carrying a white label. */
    background: var(--theme-accent-grad-a);
}


/* =========================================================
   03. APPLICATION SHELL
   ========================================================= */

.app-shell {
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;

    width: var(--sidebar-width);

    display: flex;
    flex-direction: column;

    overflow-y: auto;
    overscroll-behavior: contain;

    padding: 22px 16px 18px;

    background:
        linear-gradient(
            180deg,
            #082235 0%,
            #071b2a 65%,
            #071824 100%
        );

    color: #ffffff;

    z-index: 1200;
}

.app-frame {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.app-topbar {
    height: var(--topbar-height);

    position: sticky;
    top: 0;

    z-index: 900;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    padding: 0 34px;

    background:
        rgba(245, 248, 250, .78);

    backdrop-filter:
        blur(18px)
        saturate(145%);

    border-bottom:
        1px solid rgba(17, 46, 65, .07);
}

.app-main {
    min-height:
        calc(
            100vh
            - var(--topbar-height)
        );
}

.app-content {
    width: min(100%, 1540px);

    margin: 0 auto;

    padding:
        38px
        clamp(22px, 3vw, 48px)
        80px;
}


/* =========================================================
   04. AEROESP BRAND
   ========================================================= */

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 4px 0 22px;
}

.app-brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    flex: 0 0 44px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.app-brand-mark::before,
.app-brand-mark::after {
    display: none !important;
}

.app-brand-symbol {
    width: 42px;
    height: 42px;
    display: block;
    object-fit: contain;
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    line-height: 1.05;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.app-brand-name {
    display: block;
    font-size: calc(1rem * var(--font-scale));
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #f7fbfe;
    line-height: 1;
    white-space: nowrap;
}

.app-brand-name span {
    color: var(--theme-accent);
}

.app-brand-tagline {
    display: block;
    margin-top: 4px;
    font-size: calc(0.50rem * var(--font-scale));
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #c5d4df;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 150px;
}

.sidebar-brand,
.app-sidebar-brand,
.sidebar-header {
    overflow: hidden;
}

.sidebar-brand {
    width: 100%;
    overflow: hidden;
}


/* =========================================================
   05. SIDEBAR
   ========================================================= */

.app-sidebar-nav {
    flex: 1;
}

.app-nav-group {
    margin:
        6px 0
        24px;
}

.app-nav-label {
    margin:
        0 13px
        9px;

    color:
        rgba(255,255,255,.35);

    font-size: calc(10px * var(--font-scale));

    font-weight: 800;

    letter-spacing: .12em;

    text-transform: uppercase;
}

.app-nav-link {
    position: relative;

    display: flex;
    align-items: center;

    gap: 12px;

    min-height: 44px;

    margin: 3px 0;

    padding: 10px 13px;

    color:
        rgba(255,255,255,.70);

    border:
        1px solid transparent;

    border-radius: 14px;

    text-decoration: none;

    font-size: calc(13.5px * var(--font-scale));

    font-weight: 620;

    transition:
        color var(--transition),
        background var(--transition),
        border-color var(--transition),
        transform var(--transition);
}

.app-nav-link:hover {
    color: #ffffff;

    background:
        rgba(255,255,255,.065);

    transform: translateX(2px);
}

.app-nav-link.is-active {
    color: #ffffff;

    background:
        linear-gradient(
            90deg,
            rgba(var(--theme-accent-rgb), .18),
            rgba(var(--theme-accent-rgb), .06)
        );

    border-color:
        rgba(var(--theme-accent-rgb), .13);
}

.app-nav-link.is-active::after {
    content: "";

    position: absolute;

    right: 10px;

    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: var(--theme-accent);

    box-shadow:
        0 0 0 5px
        rgba(var(--theme-accent-rgb), .09);
}

.app-nav-icon {
    width: 24px;
    height: 24px;

    flex: 0 0 24px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    background:
        rgba(255,255,255,.055);

    color: var(--theme-accent);

    font-size: calc(11px * var(--font-scale));
    font-weight: 800;

    letter-spacing: -.03em;
}

.app-nav-link.is-active
.app-nav-icon {
    color: #071c2a;
    background: var(--theme-accent);
}


/* =========================================================
   06. SIDEBAR USER AREA
   ========================================================= */

.sidebar-user {
    margin-top: 12px;

    padding: 14px;

    border:
        1px solid
        rgba(255,255,255,.08);

    border-radius: 18px;

    background:
        rgba(255,255,255,.045);
}

.sidebar-user-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    flex: 0 0 38px;

    border-radius: 50%;

    background:
        linear-gradient(
            145deg,
            #def6ff,
            var(--theme-accent)
        );

    color: #08314b;

    font-size: calc(14px * var(--font-scale));
    font-weight: 850;
}

.sidebar-user-copy {
    min-width: 0;
}

.sidebar-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #ffffff;

    font-size: calc(13px * var(--font-scale));
    font-weight: 700;
}

.sidebar-user-role {
    margin-top: 2px;

    color:
        rgba(255,255,255,.42);

    font-size: calc(11px * var(--font-scale));
}

.sidebar-user-actions {
    display: grid;
    grid-template-columns: 1fr auto;

    gap: 7px;

    margin-top: 12px;
}

.sidebar-account-link,
.sidebar-logout {
    min-height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 7px 10px;

    border-radius: 10px;

    border:
        1px solid
        rgba(255,255,255,.08);

    color:
        rgba(255,255,255,.69);

    background:
        rgba(255,255,255,.035);

    text-decoration: none;

    font-size: calc(11px * var(--font-scale));
    font-weight: 700;

    cursor: pointer;
}

.sidebar-account-link:hover,
.sidebar-logout:hover {
    color: #ffffff;

    background:
        rgba(255,255,255,.08);
}


/* =========================================================
   07. TOPBAR
   ========================================================= */

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mobile-menu-button {
    width: 43px;
    height: 43px;

    display: none;

    place-items: center;

    border: 0;

    border-radius: 13px;

    color: var(--text-primary);

    background: var(--theme-surface);

    box-shadow: var(--shadow-xs);

    cursor: pointer;
}

.mobile-menu-button span,
.mobile-menu-button span::before,
.mobile-menu-button span::after {
    display: block;

    width: 18px;
    height: 2px;

    border-radius: 20px;

    background: currentColor;
}

.mobile-menu-button span {
    position: relative;
}

.mobile-menu-button span::before,
.mobile-menu-button span::after {
    content: "";

    position: absolute;
    left: 0;
}

.mobile-menu-button span::before {
    top: -6px;
}

.mobile-menu-button span::after {
    top: 6px;
}

.topbar-context {
    color: var(--text-muted);

    font-size: calc(12px * var(--font-scale));

    font-weight: 700;

    letter-spacing: .08em;

    text-transform: uppercase;
}

.topbar-status {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    padding: 7px 11px;

    color: #496272;

    background:
        rgba(255,255,255,.75);

    border:
        1px solid
        var(--border-soft);

    border-radius: var(--radius-pill);

    font-size: calc(11px * var(--font-scale));

    font-weight: 700;
}

.topbar-status::before {
    content: "";

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #30b983;

    box-shadow:
        0 0 0 4px
        rgba(48,185,131,.11);
}

.topbar-user {
    display: flex;
    align-items: center;

    gap: 10px;

    padding:
        6px 9px
        6px 6px;

    border-radius: 15px;

    background:
        rgba(255,255,255,.68);

    border:
        1px solid
        var(--border-soft);

    text-decoration: none;

    transition:
        background var(--transition),
        transform var(--transition);
}

.topbar-user:hover {
    background: var(--theme-surface);

    transform: translateY(-1px);
}

.topbar-user-avatar {
    width: 33px;
    height: 33px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: var(--aero-ink);

    color: #ffffff;

    font-size: calc(12px * var(--font-scale));
    font-weight: 800;
}

.topbar-user-name {
    max-width: 160px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: calc(12px * var(--font-scale));

    font-weight: 700;
}


/* =========================================================
   08. PAGE TYPOGRAPHY
   ========================================================= */

.page-eyebrow {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    margin-bottom: 12px;

    color: #36758f;

    font-size: calc(11px * var(--font-scale));
    font-weight: 800;

    letter-spacing: .11em;

    text-transform: uppercase;
}

.page-eyebrow::before {
    content: "";

    width: 20px;
    height: 1px;

    background: var(--theme-accent);
}

.page-title,
h1.page-title {
    margin:
        0 0
        10px;

    font-size:
        calc(clamp(
            30px,
            3vw,
            48px
        ) * var(--font-scale));

    line-height: 1.05;

    letter-spacing: -.045em;

    font-weight: 760;

    color: var(--aero-ink);
}

.page-lead {
    max-width: 760px;

    margin:
        0 0
        26px;

    color: var(--text-secondary);

    font-size: calc(16px * var(--font-scale));
    line-height: 1.72;
}

h1,
h2,
h3,
h4 {
    color: var(--aero-ink);

    letter-spacing: -.025em;
}

h2 {
    font-size: calc(24px * var(--font-scale));
}

h3 {
    font-size: calc(17px * var(--font-scale));
}

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

.text-secondary {
    color: var(--text-secondary);
}


/* =========================================================
   09. HERO SURFACES
   ========================================================= */

.app-hero,
.program-header {
    position: relative;

    overflow: hidden;

    margin-bottom: 30px;

    padding:
        clamp(25px, 4vw, 46px);

    border:
        1px solid
        var(--theme-hero-border);

    border-radius: var(--radius-xl);

    background: var(--theme-hero-surface);

    box-shadow: var(--shadow-sm);
}

.app-hero::before,
.program-header::before {
    content: "";

    position: absolute;

    width: 280px;
    height: 280px;

    right: -95px;
    top: -135px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(var(--theme-accent-rgb),.19),
            rgba(var(--theme-accent-rgb),0) 68%
        );
}

.app-hero::after,
.program-header::after {
    content: "";

    position: absolute;

    width: 240px;
    height: 90px;

    right: 30px;
    bottom: -60px;

    border-radius: 50%;

    background:
        color-mix(in srgb, var(--theme-warm) 28%, transparent);

    filter: blur(8px);

    transform: rotate(-8deg);
}

.app-hero > *,
.program-header > * {
    position: relative;
    z-index: 1;
}


/* =========================================================
   10. CARDS
   ========================================================= */

.cards,
.app-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(230px, 1fr)
        );

    gap: 18px;
}

.card,
.app-card,
.module {
    position: relative;

    background:
        rgba(255,255,255,.95);

    border:
        1px solid
        var(--border-soft);

    border-radius: var(--radius-md);

    padding: 22px;

    box-shadow: var(--shadow-xs);

    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        transform var(--transition);
}

.card:hover,
.app-card:hover,
.module:hover {
    border-color:
        rgba(var(--theme-accent-strong-rgb), .19);

    box-shadow: var(--shadow-sm);
}

.app-card-interactive:hover,
.course-card:hover {
    transform: translateY(-3px);
}

.card h3,
.app-card h3 {
    margin:
        0 0
        8px;
}

.course-card {
    min-height: 185px;
}

.stat-card {
    min-height: 140px;
}

.stat-label {
    color: var(--text-muted);

    font-size: calc(11px * var(--font-scale));

    font-weight: 800;

    letter-spacing: .08em;

    text-transform: uppercase;
}

.stat-number,
.metric-value {
    margin: 6px 0;

    color: var(--aero-ink);

    font-size:
        calc(clamp(
            28px,
            3vw,
            40px
        ) * var(--font-scale));

    line-height: 1;

    font-weight: 780;

    letter-spacing: -.05em;
}

.stat-detail {
    color: var(--text-secondary);

    font-size: calc(12px * var(--font-scale));
}


/* =========================================================
   11. SPECIAL FEATURE CARDS
   ========================================================= */

.aero-feature-card {
    /* ::after below is an absolutely-positioned decorative glow. With
       no positioned ancestor here it resolved against the initial
       containing block instead of the card, so it escaped the
       overflow:hidden that was meant to clip it and painted itself
       somewhere else on the page entirely. */
    position: relative;

    overflow: hidden;

    min-height: 240px;

    padding: 28px;

    border: 1px solid var(--theme-hero-border);
    border-radius: 26px;

    color: var(--theme-text);

    background: var(--theme-hero-bg);

    box-shadow: var(--theme-hero-shadow);
}

.aero-feature-card h2,
.aero-feature-card h3 {
    color: var(--theme-text);
}

.aero-feature-card p {
    color: var(--theme-text-soft);
}

.aero-feature-card::after {
    content: "";

    position: absolute;

    width: 170px;
    height: 170px;

    right: -50px;
    bottom: -70px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(var(--theme-accent-rgb),.35),
            rgba(var(--theme-accent-rgb),0)
        );
}


/* =========================================================
   12. BADGES
   ========================================================= */

.badge,
.app-badge {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    padding: 6px 10px;

    border-radius: var(--radius-pill);

    background: var(--aero-ice);

    color: var(--theme-accent-strong);

    font-size: calc(10.5px * var(--font-scale));

    font-weight: 800;

    letter-spacing: .035em;
}

.badge-success {
    color: var(--success);
    background: var(--success-soft);
}

.badge-warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.badge-danger {
    color: var(--danger);
    background: var(--danger-soft);
}


/* =========================================================
   13. BUTTON SYSTEM
   ========================================================= */

.button,
.btn,
.app-button {
    min-height: 43px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 10px 17px;

    border: 1px solid transparent;

    border-radius: 13px;

    background: var(--aero-ink);

    color: #ffffff;

    text-decoration: none;

    font-size: calc(12.5px * var(--font-scale));

    font-weight: 760;

    letter-spacing: -.01em;

    cursor: pointer;

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background var(--transition),
        border-color var(--transition);
}

.button:hover,
.btn:hover,
.app-button:hover {
    transform: translateY(-2px);

    background: #103750;

    box-shadow:
        0 10px 24px
        rgba(7, 37, 55, .15);
}

.button-primary {
    color: #06293b;

    background:
        linear-gradient(
            135deg,
            var(--theme-accent-grad-a),
            var(--theme-accent-grad-b)
        );
}

.button-primary:hover {
    background:
        linear-gradient(
            135deg,
            #a2e9fc,
            var(--theme-accent)
        );
}

.button-secondary,
.btn-secondary {
    color: var(--text-primary);

    background: #edf3f6;

    border-color:
        rgba(18,61,83,.06);
}

.button-secondary:hover,
.btn-secondary:hover {
    color: var(--text-primary);

    background: #e3edf2;

    box-shadow: none;
}

.button-outline {
    color: var(--aero-ink);

    background: transparent;

    border-color: var(--border-medium);
}

.button-danger {
    color: var(--danger-text);

    background: var(--danger-soft);

    border-color:
        color-mix(in srgb, var(--danger) 14%, transparent);
}


/* =========================================================
   14. FORMS
   ========================================================= */

form p {
    margin:
        0 0
        17px;
}

label {
    display: block;

    margin-bottom: 7px;

    color: #395466;

    font-size: calc(11.5px * var(--font-scale));

    font-weight: 760;
}

input,
select,
textarea {
    width: 100%;

    min-height: 45px;

    padding: 11px 13px;

    color: var(--text-primary);

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-medium);

    border-radius: 12px;

    outline: 0;

    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color:
        rgba(var(--theme-accent-strong-rgb), .58);

    box-shadow:
        0 0 0 4px
        rgba(var(--theme-accent-rgb), .10);
}

input[type="radio"],
input[type="checkbox"] {
    width: auto;
    min-height: auto;
}

.errorlist {
    margin:
        6px 0
        10px;

    padding-left: 18px;

    color: var(--danger);

    font-size: calc(12px * var(--font-scale));
}


/* =========================================================
   15. TABLES
   ========================================================= */

.table-wrap {
    overflow-x: auto;

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-soft);

    border-radius: var(--radius-md);

    box-shadow: var(--shadow-xs);
}

table {
    width: 100%;

    border-collapse: collapse;

    background: transparent;
}

th,
td {
    padding:
        14px 16px;

    border-bottom:
        1px solid
        var(--border-soft);

    text-align: left;
    vertical-align: middle;
}

th {
    color: #748692;

    background:
        rgba(244,248,250,.8);

    font-size: calc(10.5px * var(--font-scale));

    font-weight: 800;

    letter-spacing: .055em;

    text-transform: uppercase;
}

td {
    color: #314b5b;

    font-size: calc(13px * var(--font-scale));
}

tr:last-child td {
    border-bottom: 0;
}

tbody tr {
    transition:
        background var(--transition);
}

tbody tr:hover {
    background:
        rgba(236,247,251,.6);
}


/* =========================================================
   16. PROGRESS
   ========================================================= */

.progress-track {
    width: 100%;
    height: 8px;

    overflow: hidden;

    background: var(--theme-surface-soft);

    border-radius: var(--radius-pill);
}

.progress-fill {
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--theme-accent-grad-a),
            var(--theme-accent-grad-b)
        );

    box-shadow:
        0 0 12px
        rgba(var(--theme-accent-rgb),.18);
}

.course-progress {
    margin-top: 20px;
}

.course-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 9px;

    color: var(--text-secondary);

    font-size: calc(12px * var(--font-scale));
}


/* =========================================================
   17. BREADCRUMBS
   ========================================================= */

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 7px;

    margin-bottom: 19px;

    color: var(--text-muted);

    font-size: calc(11.5px * var(--font-scale));

    font-weight: 650;
}

.breadcrumb a {
    color: #3d7f9f;

    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--theme-accent-strong);
}


/* =========================================================
   18. MODULES
   ========================================================= */

.module {
    margin-bottom: 13px;
}

.module-header {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 24px;
}

.program-top {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 24px;
}

.program-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 9px;

    margin-top: 19px;
}

.meta-box {
    padding: 8px 12px;

    color: var(--theme-text-soft);

    background:
        var(--theme-surface-soft);

    border:
        1px solid
        rgba(var(--theme-accent-strong-rgb),.07);

    border-radius: 11px;

    font-size: calc(11.5px * var(--font-scale));

    font-weight: 650;
}

.skill-card {
    min-height: 230px;

    display: flex;
    flex-direction: column;
}

.skill-card .button {
    margin-top: auto;
    align-self: flex-start;
}

.skill-number {
    margin-bottom: 9px;

    color: #80a1b1;

    font-size: calc(10px * var(--font-scale));

    font-weight: 850;

    letter-spacing: .1em;
}

.skill-meta {
    margin:
        9px 0
        16px;

    color: var(--text-secondary);

    font-size: calc(12.5px * var(--font-scale));
    line-height: 1.7;
}


/* =========================================================
   19. SECTIONS
   ========================================================= */

.section {
    margin-bottom: 34px;
}

.section-header {
    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 17px;
}

.section-header h2 {
    margin: 0;
}

.section-description {
    margin-top: 5px;

    color: var(--text-muted);

    font-size: calc(12.5px * var(--font-scale));
}


/* =========================================================
   20. ALERTS / MESSAGES
   ========================================================= */

.app-messages {
    display: grid;

    gap: 10px;

    margin-bottom: 20px;
}

.message,
.app-alert {
    position: relative;

    padding:
        13px 16px;

    border:
        1px solid
        rgba(var(--theme-accent-strong-rgb), .10);

    border-radius: 13px;

    color: var(--info-text);

    background: var(--info-soft);

    font-size: calc(12.5px * var(--font-scale));
}

.app-alert-success,
.app-alert.success {
    color: var(--success-text);
    background: var(--success-soft);
}

.app-alert-warning,
.app-alert.warning {
    color: var(--warning-text);
    background: var(--warning-soft);
}

.app-alert-error,
.app-alert.error {
    color: var(--danger-text);
    background: var(--danger-soft);
}


/* =========================================================
   21. EMPTY STATES
   ========================================================= */

.empty-state {
    min-height: 250px;

    display: grid;
    place-items: center;

    padding: 45px 25px;

    text-align: center;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.95),
            rgba(239,248,252,.8)
        );

    border:
        1px dashed
        rgba(44, 112, 142, .19);

    border-radius: var(--radius-lg);
}

.empty-state h3 {
    margin-bottom: 7px;
}

.empty-state p {
    max-width: 490px;

    margin:
        0 auto
        16px;

    color: var(--text-muted);
}


/* =========================================================
   22. EXAMS
   ========================================================= */

.question {
    margin:
        18px 0;

    padding: 22px;

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-soft);

    border-radius: var(--radius-md);

    box-shadow: var(--shadow-xs);
}

.option {
    display: flex;

    align-items: flex-start;

    gap: 10px;

    margin: 10px 0;

    padding: 11px 12px;

    border:
        1px solid
        var(--border-soft);

    border-radius: 12px;

    background: var(--theme-surface-soft);

    transition:
        border-color var(--transition),
        background var(--transition);
}

.option:hover {
    background: #f1f9fc;

    border-color:
        rgba(var(--theme-accent-strong-rgb),.20);
}

.timer {
    position: sticky;
    top:
        calc(
            var(--topbar-height)
            + 10px
        );

    z-index: 100;

    width: fit-content;

    margin:
        0 0
        18px auto;

    padding: 9px 14px;

    color: #ffffff;

    background: var(--aero-ink);

    border-radius: var(--radius-pill);

    box-shadow: var(--shadow-sm);

    font-size: calc(13px * var(--font-scale));

    font-weight: 800;
}

.save-status {
    margin-top: 8px;

    color: var(--text-muted);

    font-size: calc(11px * var(--font-scale));
}


/* =========================================================
   23. WORKSPACE NAV
   ========================================================= */

.workspace-nav {
    display: flex;
    flex-wrap: wrap;

    gap: 7px;

    margin-bottom: 25px;
}

.workspace-nav a {
    display: inline-flex;

    min-height: 38px;

    align-items: center;

    padding: 8px 13px;

    color: #476879;

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-soft);

    border-radius: 11px;

    text-decoration: none;

    font-size: calc(11.5px * var(--font-scale));

    font-weight: 700;

    transition:
        transform var(--transition),
        background var(--transition);
}

.workspace-nav a:hover {
    color: var(--aero-ink);

    background: #edf8fc;

    transform: translateY(-1px);
}


/* =========================================================
   24. DASHBOARD WELCOME
   ========================================================= */

.dashboard-welcome {
    position: relative;

    overflow: hidden;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 30px;

    margin-bottom: 24px;

    padding:
        clamp(27px, 4vw, 45px);

    color: var(--theme-text);

    background: var(--theme-hero-bg);

    border: 1px solid var(--theme-hero-border);
    border-radius:
        34px 34px
        34px 12px;

    box-shadow: var(--theme-hero-shadow);
}

.dashboard-welcome::before {
    content: "";

    position: absolute;

    width: 320px;
    height: 320px;

    right: -100px;
    top: -160px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(var(--theme-accent-rgb),.29),
            rgba(var(--theme-accent-rgb),0) 69%
        );
}

.dashboard-welcome::after {
    content: "";

    position: absolute;

    width: 240px;
    height: 80px;

    right: 80px;
    bottom: -45px;

    border-radius: 50%;

    background:
        color-mix(in srgb, var(--theme-warm) 17%, transparent);

    filter: blur(5px);

    transform: rotate(-9deg);
}

.dashboard-welcome > * {
    position: relative;
    z-index: 1;
}

.dashboard-welcome h1 {
    max-width: 720px;

    margin:
        0 0
        12px;

    color: var(--theme-text);

    font-size:
        calc(clamp(
            31px,
            4vw,
            51px
        ) * var(--font-scale));

    line-height: 1.04;

    letter-spacing: -.045em;
}

.dashboard-welcome p {
    max-width: 660px;

    margin: 0;

    color: var(--theme-text-soft);

    font-size: calc(14px * var(--font-scale));
    line-height: 1.7;
}

.dashboard-orbit {
    width: 112px;
    height: 112px;

    position: relative;

    border:
        1px solid
        var(--theme-hero-inset-border);

    border-radius: 50%;
}

.dashboard-orbit::before {
    content: "";

    position: absolute;

    width: 47px;
    height: 47px;

    left: 31px;
    top: 31px;

    border-radius: 50%;

    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--theme-accent) 45%, white),
            var(--theme-accent)
        );

    box-shadow:
        0 15px 40px
        rgba(var(--theme-accent-rgb),.24);
}

.dashboard-orbit::after {
    content: "";

    position: absolute;

    width: 12px;
    height: 12px;

    left: -4px;
    top: 48px;

    border-radius: 50%;

    background: var(--theme-warm);

    box-shadow:
        100px -27px 0 -3px
        var(--theme-hero-inset-border);
}


/* =========================================================
   25. ACTION CARDS
   ========================================================= */

.action-card {
    display: flex;
    flex-direction: column;

    min-height: 190px;
}

.action-card-index {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    margin-bottom: 22px;

    border-radius: 12px;

    color: var(--theme-accent-strong);

    background: #e8f8fd;

    font-size: calc(11px * var(--font-scale));

    font-weight: 850;
}

.action-card p {
    color: var(--text-secondary);

    font-size: calc(12.5px * var(--font-scale));
}

.action-card .app-button {
    margin-top: auto;
    align-self: flex-start;
}


/* =========================================================
   26. SIDEBAR OVERLAY
   ========================================================= */

.sidebar-overlay {
    position: fixed;
    inset: 0;

    display: none;

    background:
        rgba(4,18,27,.50);

    backdrop-filter: blur(2px);

    z-index: 1100;
}


/* =========================================================
   27. RESPONSIVE
   ========================================================= */

@media (max-width: 1080px) {

    :root {
        --sidebar-width: 250px;
    }

    .app-content {
        padding-left: 24px;
        padding-right: 24px;
    }

}


@media (max-width: 860px) {

    .app-sidebar {
        width: min(84vw, 290px);

        transform:
            translateX(-105%);

        transition:
            transform
            240ms
            var(--ease);

        box-shadow: var(--shadow-lg);
    }

    body.sidebar-open
    .app-sidebar {
        transform:
            translateX(0);
    }

    body.sidebar-open
    .sidebar-overlay {
        display: block;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .app-frame {
        margin-left: 0;
    }

    .mobile-menu-button {
        display: grid;
    }

    .app-topbar {
        height: 68px;
        padding:
            0 17px;
    }

    .topbar-context {
        display: none;
    }

    .app-content {
        padding:
            25px 17px
            60px;
    }

    .dashboard-welcome {
        grid-template-columns: 1fr;
    }

    .dashboard-orbit {
        display: none;
    }

}


@media (max-width: 600px) {

    .cards,
    .app-grid {
        grid-template-columns: 1fr;
    }

    .program-top,
    .module-header,
    .section-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-title,
    h1.page-title {
        font-size: calc(31px * var(--font-scale));
    }

    .topbar-status {
        display: none;
    }

    .topbar-user-name {
        display: none;
    }

    .app-hero,
    .program-header {
        border-radius: 24px;
    }

    .dashboard-welcome {
        padding: 28px 24px;

        border-radius:
            26px 26px
            26px 10px;
    }

    th,
    td {
        padding: 11px 12px;
    }

}

/* =========================================================
   UI-02 — Learning Experience
   ========================================================= */

.learning-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 36px;
    align-items: center;
}

.learning-hero-copy {
    max-width: 820px;
}

.learning-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 22px;
}

.learning-hero-action {
    min-width: 170px;
    text-align: right;
}


/* ----- course library ----- */

.course-library {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(320px, 1fr)
        );
    gap: 22px;
}

.course-premium-card {
    position: relative;
    overflow: hidden;

    min-height: 310px;

    display: flex;
    flex-direction: column;

    padding: 28px;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.98),
            rgba(244,250,252,.96)
        );

    border:
        1px solid
        var(--border-soft);

    border-radius:
        30px 30px
        30px 12px;

    box-shadow: var(--shadow-sm);

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        border-color var(--transition);
}

.course-premium-card:hover {
    transform: translateY(-5px);

    box-shadow: var(--shadow-md);

    border-color:
        rgba(var(--theme-accent-rgb),.22);
}

.course-premium-card::before {
    content: "";

    position: absolute;

    width: 190px;
    height: 190px;

    right: -65px;
    top: -80px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(var(--theme-accent-rgb),.20),
            transparent 68%
        );
}

.course-premium-card > * {
    position: relative;
    z-index: 1;
}

.course-card-index {
    margin-bottom: 24px;

    color: #8da2ad;

    font-size: calc(11px * var(--font-scale));

    font-weight: 850;

    letter-spacing: .12em;
}

.course-premium-card h2 {
    margin:
        11px 0
        9px;

    font-size: calc(27px * var(--font-scale));
    line-height: 1.08;
}

.course-premium-card p {
    color: var(--text-secondary);
}

.course-card-meta {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 9px;

    margin:
        18px 0
        24px;
}

.course-meta-cell {
    padding: 12px;

    background:
        rgba(237,245,248,.78);

    border-radius: 13px;
}

.course-meta-label {
    display: block;

    margin-bottom: 3px;

    color: var(--text-muted);

    font-size: calc(9px * var(--font-scale));

    font-weight: 850;

    letter-spacing: .08em;

    text-transform: uppercase;
}

.course-meta-value {
    color: #2b4c5d;

    font-size: calc(12px * var(--font-scale));

    font-weight: 700;
}

.course-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-top: auto;
}


/* ----- course overview ----- */

.metric-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;
}

.metric-card {
    min-height: 128px;

    padding: 20px;

    background:
        rgba(255,255,255,.93);

    border:
        1px solid
        var(--border-soft);

    border-radius: 19px;

    box-shadow: var(--shadow-xs);
}

.metric-card .metric-value {
    margin-top: 14px;
}

.metric-caption {
    color: var(--text-muted);

    font-size: calc(10px * var(--font-scale));

    font-weight: 800;

    letter-spacing: .08em;

    text-transform: uppercase;
}


/* ----- continue panel ----- */

.continue-panel {
    position: relative;

    overflow: hidden;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto;

    gap: 30px;
    align-items: center;

    padding: 27px;

    background: var(--theme-hero-bg);

    color: var(--theme-text);

    border: 1px solid var(--theme-hero-border);
    border-radius:
        27px 27px
        27px 10px;

    box-shadow: var(--theme-hero-shadow);
}

.continue-panel::after {
    content: "";

    position: absolute;

    width: 220px;
    height: 220px;

    right: -80px;
    top: -100px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(var(--theme-accent-rgb),.30),
            transparent 70%
        );
}

.continue-panel > * {
    position: relative;
    z-index: 1;
}

.continue-panel h2 {
    margin:
        8px 0
        4px;

    color: var(--theme-text);
}

.continue-panel p {
    margin: 0;

    color: var(--theme-text-soft);
}


/* ----- module list ----- */

.module-list {
    display: grid;
    gap: 12px;
}

.module-row {
    display: grid;

    grid-template-columns:
        56px
        minmax(0, 1fr)
        auto;

    gap: 18px;
    align-items: center;

    padding: 20px;

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-soft);

    border-radius: 18px;

    transition:
        transform var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

.module-row:hover {
    transform: translateX(3px);

    border-color:
        rgba(var(--theme-accent-rgb),.20);

    box-shadow: var(--shadow-sm);
}

.module-index {
    width: 47px;
    height: 47px;

    display: grid;
    place-items: center;

    border-radius: 15px;

    color: var(--theme-accent-strong);

    background:
        linear-gradient(
            145deg,
            #e8f8fd,
            #dff4fa
        );

    font-size: calc(12px * var(--font-scale));

    font-weight: 850;
}

.module-row h3 {
    margin:
        3px 0
        3px;
}

.module-row p {
    margin: 0;

    color: var(--text-secondary);

    font-size: calc(12.5px * var(--font-scale));
}

.module-row-meta {
    margin-top: 7px;

    color: var(--text-muted);

    font-size: calc(10.5px * var(--font-scale));

    font-weight: 700;
}


/* ----- topic cloud ----- */

.topic-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(220px, 1fr)
        );

    gap: 13px;
}

.topic-card {
    min-height: 160px;

    display: flex;
    flex-direction: column;

    padding: 19px;

    background:
        linear-gradient(
            150deg,
            #ffffff,
            #f5fafc
        );

    border:
        1px solid
        var(--border-soft);

    border-radius: 17px;
}

.topic-card h3 {
    margin:
        9px 0
        5px;
}

.topic-card p {
    color: var(--text-secondary);

    font-size: calc(12px * var(--font-scale));
}

.topic-card .button {
    margin-top: auto;
    align-self: flex-start;
}


/* ----- learning content list ----- */

.learning-content-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(290px, 1fr)
        );

    gap: 15px;
}

.learning-content-card {
    min-height: 220px;

    display: flex;
    flex-direction: column;

    padding: 22px;

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-soft);

    border-radius: 20px;
}

.learning-content-card h3 {
    margin:
        9px 0
        7px;

    font-size: calc(19px * var(--font-scale));
}

.learning-content-preview {
    color: var(--text-secondary);

    font-size: calc(12.5px * var(--font-scale));

    line-height: 1.65;
}

.learning-content-card
.course-card-actions {
    margin-top: auto;
}


/* ----- study workspace ----- */

.study-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        300px;

    gap: 22px;
    align-items: start;
}

.study-main,
.study-side {
    display: grid;
    gap: 16px;
}

.study-content {
    padding:
        clamp(22px, 4vw, 40px);

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-soft);

    border-radius: 25px;

    box-shadow: var(--shadow-xs);
}

.study-block {
    padding:
        23px 0;

    border-bottom:
        1px solid
        var(--border-soft);
}

.study-block:first-child {
    padding-top: 0;
}

.study-block:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.study-block-label {
    margin-bottom: 7px;

    color: #3a809d;

    font-size: calc(10px * var(--font-scale));

    font-weight: 850;

    letter-spacing: .1em;

    text-transform: uppercase;
}

.study-block h3 {
    margin:
        0 0
        7px;
}

.study-block p {
    margin: 0;

    color: #355263;

    line-height: 1.8;
}

.study-block-important {
    padding: 18px;

    background: #fff6ee;

    border:
        1px solid
        rgba(194,121,52,.10);

    border-radius: 15px;
}

/* The two rules above are deliberately warm and light - that is the
   intended look in day mode. They just had no night-mode counterpart,
   so the fixed body colour went dark-on-dark and the cream panel stayed
   bright behind themed text. Overriding here keeps the light design
   exactly as designed and only supplies what was missing. */
html[data-theme="dark"] .study-block p {
    color: var(--theme-text-soft);
}

html[data-theme="dark"] .study-block-important {
    background: rgba(194, 121, 52, .10);

    border-color: rgba(232, 182, 106, .28);
}

.rtl-content {
    direction: rtl;

    text-align: right;

    font-family: var(--font-rtl);
}


/* ----- practice question ----- */

.practice-card {
    margin-bottom: 16px;

    padding: 24px;

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-soft);

    border-radius: 22px;
}

.practice-question-text {
    margin:
        13px 0
        20px;

    font-size: calc(16px * var(--font-scale));

    line-height: 1.7;

    font-weight: 650;
}

.answer-grid {
    display: grid;
    gap: 9px;

    margin-bottom: 18px;
}

.answer-option {
    position: relative;

    display: grid;

    grid-template-columns:
        auto
        28px
        minmax(0, 1fr);

    gap: 9px;
    align-items: center;

    margin: 0;

    padding: 12px 14px;

    color: #31505f;

    background: #f8fbfc;

    border:
        1px solid
        var(--border-soft);

    border-radius: 13px;

    cursor: pointer;

    transition:
        background var(--transition),
        border-color var(--transition),
        transform var(--transition);
}

.answer-option:hover {
    transform: translateX(2px);

    background: #edf8fb;

    border-color:
        rgba(var(--theme-accent-strong-rgb),.23);
}

.answer-letter {
    width: 28px;
    height: 28px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    color: var(--theme-accent-strong);

    background: #e6f6fb;

    font-size: calc(11px * var(--font-scale));

    font-weight: 850;
}


/* ----- resource library ----- */

.resource-grid,
.guide-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(280px, 1fr)
        );

    gap: 17px;
}

.resource-card,
.guide-card {
    min-height: 240px;

    display: flex;
    flex-direction: column;

    padding: 23px;

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-soft);

    border-radius:
        23px 23px
        23px 9px;

    box-shadow: var(--shadow-xs);
}

.resource-card h3,
.guide-card h3 {
    margin:
        11px 0
        7px;
}

.resource-description,
.guide-description {
    color: var(--text-secondary);

    font-size: calc(12.5px * var(--font-scale));

    line-height: 1.7;
}

.resource-context,
.guide-context {
    display: flex;
    flex-wrap: wrap;

    gap: 7px;

    margin:
        12px 0
        18px;
}

.resource-actions,
.guide-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: auto;
}


/* ----- placement ----- */

.placement-program-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(300px, 1fr)
        );

    gap: 19px;
}

.placement-program-card {
    min-height: 300px;

    display: flex;
    flex-direction: column;

    padding: 28px;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #eef9fc
        );

    border:
        1px solid
        var(--border-soft);

    border-radius:
        29px 29px
        29px 10px;

    box-shadow: var(--shadow-sm);
}

.placement-program-card h2 {
    margin:
        12px 0
        9px;
}

.placement-program-card p {
    color: var(--text-secondary);
}

.placement-program-card
.button {
    margin-top: auto;
    align-self: flex-start;
}

.placement-shell {
    width: min(100%, 900px);

    margin: 0 auto;
}

.placement-progress {
    margin-bottom: 17px;
}

.placement-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 7px;

    color: var(--text-muted);

    font-size: calc(11px * var(--font-scale));

    font-weight: 700;
}

.placement-question-card {
    padding:
        clamp(23px, 4vw, 38px);

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-soft);

    border-radius: 27px;

    box-shadow: var(--shadow-sm);
}

.placement-question-card h2 {
    margin:
        14px 0
        23px;

    font-size:
        calc(clamp(20px, 3vw, 29px) * var(--font-scale));

    line-height: 1.4;
}


/* ----- nav pager ----- */

.study-navigation {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: 25px;
}


/* ----- responsive UI-02 ----- */

@media (max-width: 1050px) {

    .metric-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .study-layout {
        grid-template-columns: 1fr;
    }

    .study-side {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 700px) {

    .learning-hero {
        grid-template-columns: 1fr;
    }

    .learning-hero-action {
        text-align: left;
    }

    .course-library,
    .placement-program-grid {
        grid-template-columns: 1fr;
    }

    .metric-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .module-row {
        grid-template-columns:
            46px
            minmax(0, 1fr);
    }

    .module-row > .button {
        grid-column:
            1 / -1;
    }

    .continue-panel {
        grid-template-columns: 1fr;
    }

    .study-side {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 430px) {

    .metric-grid,
    .course-card-meta {
        grid-template-columns: 1fr;
    }

}

/* =========================================================
   28. ACCESSIBILITY
   ========================================================= */

:focus-visible {
    outline:
        3px solid
        rgba(var(--theme-accent-rgb), .35);

    outline-offset: 3px;
}

@media (
    prefers-reduced-motion:
    reduce
) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition-duration:
            .01ms !important;

        animation-duration:
            .01ms !important;
    }

}

/* =========================================================
   UI-03 — Teacher Workspace
   ========================================================= */

.teacher-hero {
    position: relative;

    overflow: hidden;

    padding:
        clamp(30px, 4vw, 48px);

    margin-bottom: 26px;

    color: var(--theme-text);

    background: var(--theme-hero-bg);

    border: 1px solid var(--theme-hero-border);
    border-radius:
        34px 34px
        34px 12px;

    box-shadow: var(--theme-hero-shadow);
}

.teacher-hero::after {
    content: "";

    position: absolute;

    width: 300px;
    height: 300px;

    right: -100px;
    top: -150px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(var(--theme-accent-rgb),.30),
            transparent 68%
        );
}

.teacher-hero > * {
    position: relative;
    z-index: 1;
}

.teacher-hero h1 {
    max-width: 850px;

    margin:
        0 0
        12px;

    color: var(--theme-text);

    font-size:
        calc(clamp(
            32px,
            4vw,
            52px
        ) * var(--font-scale));

    line-height: 1.04;
}

.teacher-hero p {
    max-width: 720px;

    margin: 0;

    color: var(--theme-text-soft);

    font-size: calc(14px * var(--font-scale));
}


.teacher-kpi-grid {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 14px;

    margin-bottom: 34px;
}


.teacher-kpi {
    padding: 22px;

    min-height: 140px;

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-soft);

    border-radius: 20px;

    box-shadow: var(--shadow-xs);
}

.teacher-kpi-label {
    color: var(--text-muted);

    font-size: calc(10px * var(--font-scale));

    font-weight: 850;

    letter-spacing: .09em;

    text-transform: uppercase;
}

.teacher-kpi-value {
    margin-top: 15px;

    color: var(--aero-ink);

    font-size: calc(38px * var(--font-scale));

    font-weight: 780;

    line-height: 1;

    letter-spacing: -.05em;
}


.teacher-class-grid {
    display: grid;
    gap: 15px;
}

.teacher-class-card {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto;

    gap: 22px;

    padding: 24px;

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-soft);

    border-radius: 22px;

    box-shadow: var(--shadow-xs);
}

.teacher-class-card h3 {
    margin:
        8px 0
        5px;

    font-size: calc(20px * var(--font-scale));
}

.teacher-class-metrics {
    display: flex;
    flex-wrap: wrap;

    gap: 9px;

    margin-top: 17px;
}

.teacher-class-metric {
    min-width: 105px;

    padding: 10px 12px;

    background: #f3f8fa;

    border-radius: 12px;
}

.teacher-class-metric span {
    display: block;
}

.teacher-class-metric-label {
    color: var(--text-muted);

    font-size: calc(9px * var(--font-scale));

    font-weight: 850;

    text-transform: uppercase;

    letter-spacing: .07em;
}

.teacher-class-metric-value {
    margin-top: 3px;

    color: #264b5e;

    font-size: calc(15px * var(--font-scale));

    font-weight: 760;
}


.teacher-attention-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(260px, 1fr)
        );

    gap: 15px;
}

.teacher-attention-card {
    padding: 20px;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #fff9f4
        );

    border:
        1px solid
        rgba(186,111,54,.12);

    border-radius: 18px;
}

.teacher-attention-card h3 {
    margin:
        8px 0
        5px;
}


.teacher-data-card {
    padding: 24px;

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-soft);

    border-radius: 22px;

    box-shadow: var(--shadow-xs);
}


.teacher-toolbar {
    display: flex;

    align-items: center;
    justify-content: space-between;

    flex-wrap: wrap;

    gap: 12px;

    margin-bottom: 20px;
}

.teacher-toolbar-actions {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;
}

/* The AI dashboard's experiment buttons: a gap before the panels. */
.ai-experiment-actions {
    margin-bottom: 22px;
}

.ai-experiment-actions form {
    margin: 0;
}


.teacher-form-shell {
    width: min(100%, 980px);

    padding:
        clamp(22px, 4vw, 36px);

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-soft);

    border-radius: 26px;

    box-shadow: var(--shadow-sm);
}

.teacher-form-shell form p {
    margin-bottom: 19px;
}


.teacher-table-title {
    max-width: 430px;

    color: var(--aero-ink);

    font-weight: 650;
}


.status-chip {
    display: inline-flex;

    align-items: center;

    padding: 5px 9px;

    border-radius: 999px;

    background: #edf5f8;

    color: #426877;

    font-size: calc(10px * var(--font-scale));

    font-weight: 800;
}


.resource-admin-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(290px, 1fr)
        );

    gap: 16px;
}

.resource-admin-card {
    min-height: 230px;

    display: flex;
    flex-direction: column;

    padding: 22px;

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-soft);

    border-radius:
        22px 22px
        22px 8px;

    box-shadow: var(--shadow-xs);
}

.resource-admin-card h3 {
    margin:
        10px 0
        7px;
}

.resource-admin-card p {
    color: var(--text-secondary);

    font-size: calc(12.5px * var(--font-scale));
}

.resource-admin-actions {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin-top: auto;
}

.inline-delete-form {
    display: inline;
}


.ai-feature-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(280px, 1fr)
        );

    gap: 16px;
}

/* A grid whose children are not peers: on the AI dashboard a short
   feature card shares a row with the analytics panel, which runs to
   several thousand pixels of tables. Under the default
   align-items:stretch the card was stretched to match it, leaving its
   title, text and button stranded at the top of a column of empty
   box - which reads as the border being on one side of the page and
   the content on the other. Items here take their own height instead.

   Scoped to a modifier rather than applied to .ai-feature-grid at
   large, because the other grids using that class hold rows of
   like-for-like cards, which do look better matched in height. */
.ai-feature-grid--mixed > * {
    align-self: start;
}

.ai-feature-card {
    min-height: 220px;

    padding: 23px;

    /* Themed tokens, not literals. This card used to hardcode a
       white-to-pale-blue gradient and a fixed border, while its text
       colour was inherited from the theme - so in dark mode light text
       landed on a near-white card and the content read as detached
       from the column behind it. Every other card in the design system
       uses var(--theme-surface); this one now does too. */
    background: var(--theme-surface);

    color: var(--theme-text);

    border:
        1px solid
        var(--theme-border);

    border-radius:
        24px 24px
        24px 9px;
}

.ai-feature-card h3 {
    margin:
        11px 0
        7px;
}

.ai-confidence {
    font-size: calc(27px * var(--font-scale));

    font-weight: 780;

    letter-spacing: -.04em;
}


.weak-area-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(180px, 1fr)
        );

    gap: 12px;
}

.weak-area-card {
    padding: 18px;

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-soft);

    border-radius: 17px;
}

.weak-area-card h3 {
    margin:
        0 0
        12px;

    font-size: calc(14px * var(--font-scale));
}


.analytics-student-row {
    display: grid;

    grid-template-columns:
        minmax(180px, 1.4fr)
        repeat(4, minmax(80px, .7fr))
        auto;

    gap: 12px;

    align-items: center;

    padding: 16px 18px;

    margin-bottom: 8px;

    background: var(--theme-surface);

    border:
        1px solid
        var(--border-soft);

    border-radius: 15px;
}

.analytics-student-name {
    font-weight: 730;
}

.analytics-cell-label {
    display: block;

    color: var(--text-muted);

    font-size: calc(8.5px * var(--font-scale));

    font-weight: 850;

    letter-spacing: .07em;

    text-transform: uppercase;
}

.analytics-cell-value {
    display: block;

    margin-top: 2px;

    color: #315365;

    font-size: calc(13px * var(--font-scale));

    font-weight: 700;
}


@media (max-width: 900px) {

    .teacher-kpi-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .analytics-student-row {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .analytics-student-name {
        grid-column:
            1 / -1;
    }

}


@media (max-width: 650px) {

    .teacher-kpi-grid {
        grid-template-columns: 1fr;
    }

    .teacher-class-card {
        grid-template-columns: 1fr;
    }

    .analytics-student-row {
        grid-template-columns: 1fr;
    }

}

/* ==========================================================
   UI-04 — AeroESP Theme + Brand System
   ========================================================== */

:root {
    color-scheme: light;

    --theme-bg: #f5f8fb;
    --theme-surface: #ffffff;
    --theme-surface-soft: #eef4f8;
    --theme-surface-raised: #ffffff;

    --theme-text: #10243a;
    --theme-text-soft: #68798b;
    --theme-text-faint: #8595a5;

    --theme-border: rgba(15, 42, 67, 0.11);
    --theme-border-strong: rgba(15, 42, 67, 0.18);

    --theme-navy: #07182d;
    --theme-navy-soft: #0b2340;

    /* Decorative: washes, glows, hover tints. Never the sole
       carrier of information, so it is chosen for appearance. */
    --theme-accent: #48b9e8;
    --theme-accent-rgb: 72, 185, 232;

    /* Text and interactive affordances. Solved for 4.5:1 on the
       light surface - the old #159bd4 managed only 3.15:1. */
    --theme-accent-strong: #007eb4;
    --theme-accent-strong-rgb: 0, 126, 180;

    /* Gradient buttons carry white labels; the lighter stop clears
       4.5:1 against white. */
    --theme-accent-grad-a: #02618b;
    --theme-accent-grad-b: #007baf;

    /* Derived, so a palette only has to redefine the two above. */
    --theme-accent-soft: rgba(var(--theme-accent-rgb), 0.13);

    --theme-warm: #e8b66a;

    --theme-shadow-sm:
        0 4px 16px rgba(7, 24, 45, 0.06);

    --theme-shadow-md:
        0 14px 36px rgba(7, 24, 45, 0.10);

    --theme-shadow-lg:
        0 24px 64px rgba(7, 24, 45, 0.14);

    /* Page headers, welcome banners and feature panels. Every one of
       them paints with these, so a header follows the theme like the
       rest of the page instead of keeping a colour of its own. */
    --theme-hero-surface:
        linear-gradient(
            120deg,
            rgba(255, 255, 255, .98),
            rgba(240, 249, 252, .94)
        );
    --theme-hero-glow:
        radial-gradient(
            circle at 88% 14%,
            rgba(var(--theme-accent-rgb), .14),
            transparent 22rem
        );
    /* Surface and glow together, for headers without a glow of
       their own. Composed here, so each theme defines only the two
       parts above. */
    --theme-hero-bg: var(--theme-hero-glow), var(--theme-hero-surface);
    --theme-hero-border: rgba(9, 55, 80, .07);
    --theme-hero-shadow: 0 22px 54px rgba(7, 33, 49, .08);

    /* A panel inside a header (a score, a summary) and its outline. */
    --theme-hero-inset: rgba(var(--theme-accent-rgb), .08);
    --theme-hero-inset-border: rgba(var(--theme-accent-rgb), .18);

    /* Avatar marks (accounts/avatars.py): a ground in the palette's
       deep accent, the mark in the surface colour. */
    --avatar-ground: var(--theme-accent-strong);
    --avatar-ink: var(--theme-surface);
    --avatar-soft: color-mix(in srgb, var(--theme-surface) 55%, transparent);
}


html[data-theme="dark"] {
    color-scheme: dark;

    --theme-bg: #06111f;
    --theme-surface: #0b1b2d;
    --theme-surface-soft: #10253b;
    --theme-surface-raised: #12293f;

    --theme-text: #eef6fc;
    --theme-text-soft: #a9bac9;
    --theme-text-faint: #8297aa;

    --theme-border: rgba(255, 255, 255, 0.09);
    --theme-border-strong: rgba(255, 255, 255, 0.16);

    --theme-navy: #06111f;
    --theme-navy-soft: #0b1b2d;

    --theme-accent: #55c7ef;
    --theme-accent-rgb: 85, 199, 239;

    --theme-accent-strong: #7bd8f5;
    --theme-accent-strong-rgb: 123, 216, 245;

    /* Same pair as light mode on purpose: these buttons carry a
       white label in both schemes, so the 4.5:1 requirement is the
       same and a brighter fill would fail it. */
    --theme-accent-grad-a: #02618b;
    --theme-accent-grad-b: #007baf;

    --theme-accent-soft: rgba(var(--theme-accent-rgb), 0.13);

    --theme-warm: #efbd75;

    --theme-shadow-sm:
        0 4px 20px rgba(0, 0, 0, 0.20);

    --theme-shadow-md:
        0 16px 40px rgba(0, 0, 0, 0.28);

    --theme-shadow-lg:
        0 28px 70px rgba(0, 0, 0, 0.36);

    --theme-hero-surface:
        linear-gradient(
            135deg,
            #0d2235 0%,
            #10293d 100%
        );
    --theme-hero-glow:
        radial-gradient(
            circle at 88% 20%,
            rgba(var(--theme-accent-rgb), .15),
            transparent 22rem
        );
    --theme-hero-bg: var(--theme-hero-glow), var(--theme-hero-surface);
    --theme-hero-border: rgba(255, 255, 255, .08);
    --theme-hero-shadow: 0 18px 50px rgba(0, 0, 0, .18);

    --theme-hero-inset: rgba(255, 255, 255, .055);
    --theme-hero-inset-border: rgba(255, 255, 255, .11);

    /* Avatars on a dark page: a dark ground, the mark in the
       palette's bright accent. */
    --avatar-ground: var(--theme-surface-raised);
    --avatar-ink: var(--theme-accent);
    --avatar-soft: color-mix(in srgb, var(--theme-accent) 50%, transparent);

    /* Status fills and their text (defined for light at the top of
       this file). */
    --success-soft: rgba(38, 167, 122, .14);
    --warning-soft: rgba(239, 189, 117, .13);
    --danger-soft: rgba(229, 104, 104, .14);
    --info-soft: rgba(var(--theme-accent-rgb), .12);

    --success-text: #7fdcb5;
    --warning-text: #f2c98a;
    --danger-text: #f3a3a3;
    --info-text: #a9dcf2;
}


/* Page */

html {
    background:
        var(--theme-bg);
}

body {
    color:
        var(--theme-text);

    background:
        radial-gradient(
            circle at 82% 5%,
            rgba(var(--theme-accent-rgb), 0.10),
            transparent 28rem
        ),
        var(--theme-bg);

    transition:
        background-color 180ms ease,
        color 180ms ease;
}


html[data-theme="dark"] body {
    background:
        radial-gradient(
            circle at 80% 3%,
            rgba(var(--theme-accent-rgb), 0.08),
            transparent 30rem
        ),
        linear-gradient(
            180deg,
            #071421 0%,
            #06111f 100%
        );
}


/* Frame */

.app-frame,
.app-main {
    background:
        transparent;
}


/* Topbar */

.app-topbar {
    border-bottom:
        1px solid
        var(--theme-border);

    background:
        color-mix(
            in srgb,
            var(--theme-surface) 87%,
            transparent
        );

    backdrop-filter:
        blur(18px);

    -webkit-backdrop-filter:
        blur(18px);
}

.topbar-context,
.topbar-user-name {
    color:
        var(--theme-text);
}

.topbar-status {
    border-color:
        var(--theme-border);
}

.topbar-user {
    border-color:
        var(--theme-border);
}

.topbar-user:hover {
    background:
        var(--theme-surface-soft);
}


/* Cards / panels */

.app-content :where(
    .card,
    .panel,
    .surface,
    .dashboard-card,
    .metric-card,
    .teacher-card,
    .learning-card,
    .resource-card,
    .question-card
) {
    border-color:
        var(--theme-border);
}


/* Generic white surfaces in dark mode */

html[data-theme="dark"] .app-content :where(
    .card,
    .panel,
    .surface,
    .dashboard-card,
    .metric-card,
    .teacher-card,
    .learning-card,
    .resource-card,
    .question-card,
    table,
    form
) {
    color:
        var(--theme-text);
}


/* Forms */

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    color:
        var(--theme-text);

    border-color:
        var(--theme-border-strong);

    background:
        var(--theme-surface-soft);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color:
        var(--theme-text-faint);
}


/* Tables */

html[data-theme="dark"] table {
    color:
        var(--theme-text);
}

html[data-theme="dark"] tbody tr:hover {
    background:
        rgba(var(--theme-accent-rgb), 0.06);
}


/* Theme control */

.theme-control {
    position:
        relative;

    display:
        flex;

    align-items:
        center;
}

.theme-toggle {
    display:
        inline-flex;

    align-items:
        center;

    gap:
        7px;

    min-height:
        38px;

    padding:
        7px 11px;

    border:
        1px solid
        var(--theme-border);

    border-radius:
        12px;

    color:
        var(--theme-text-soft);

    background:
        var(--theme-surface);

    cursor:
        pointer;

    font:
        inherit;

    font-size:
        calc(13px * var(--font-scale));

    transition:
        border-color 160ms ease,
        background 160ms ease,
        color 160ms ease,
        transform 160ms ease;
}

.theme-toggle:hover {
    color:
        var(--theme-text);

    border-color:
        var(--theme-border-strong);

    background:
        var(--theme-surface-soft);
}

.theme-toggle:active {
    transform:
        translateY(1px);
}

.theme-toggle-icon {
    display:
        grid;

    place-items:
        center;

    width:
        19px;

    height:
        19px;

    font-size:
        calc(16px * var(--font-scale));
}

.theme-menu {
    position:
        absolute;

    top:
        calc(100% + 10px);

    right:
        0;

    z-index:
        1000;

    width:
        154px;

    padding:
        6px;

    border:
        1px solid
        var(--theme-border);

    border-radius:
        14px;

    background:
        var(--theme-surface-raised);

    box-shadow:
        var(--theme-shadow-md);
}

.theme-menu[hidden] {
    display:
        none;
}

.theme-option {
    display:
        flex;

    align-items:
        center;

    gap:
        9px;

    width:
        100%;

    padding:
        9px 10px;

    border:
        0;

    border-radius:
        9px;

    color:
        var(--theme-text-soft);

    background:
        transparent;

    cursor:
        pointer;

    font:
        inherit;

    font-size:
        calc(13px * var(--font-scale));

    text-align:
        left;
}

.theme-option:hover {
    color:
        var(--theme-text);

    background:
        var(--theme-surface-soft);
}

.theme-option.is-active {
    color:
        var(--theme-accent-strong);

    background:
        var(--theme-accent-soft);
}


/* Dark sidebar refinement */

html[data-theme="dark"] .app-sidebar {
    border-right-color:
        rgba(255, 255, 255, 0.06);

    box-shadow:
        18px 0 50px
        rgba(0, 0, 0, 0.16);
}


/* Messages */

html[data-theme="dark"] .app-alert {
    border-color:
        var(--theme-border);
}


/* Scrollbar */

html[data-theme="dark"] {
    scrollbar-color:
        #294359
        #081625;
}


/* Responsive */

@media (max-width: 720px) {

    .theme-toggle-label {
        display:
            none;
    }

    .theme-toggle {
        width:
            38px;

        justify-content:
            center;

        padding:
            7px;
    }

}


/* Reduced motion */

@media (prefers-reduced-motion: reduce) {

    .theme-toggle,
    body {
        transition:
            none;
    }

}


/* ==========================================================
   UI-04 Theme Selector Fix
   ========================================================== */

.theme-control {
    display: inline-flex;
    align-items: center;
    gap: 3px;

    padding: 3px;

    border: 1px solid var(--theme-border);
    border-radius: 12px;

    background: var(--theme-surface);
}

.theme-choice {
    display: grid;
    place-items: center;

    width: 32px;
    height: 32px;

    padding: 0;
    border: 0;
    border-radius: 9px;

    color: var(--theme-text-soft);
    background: transparent;

    font: inherit;
    font-size: calc(15px * var(--font-scale));

    cursor: pointer;

    transition:
        color 150ms ease,
        background 150ms ease,
        transform 150ms ease;
}

.theme-choice:hover {
    color: var(--theme-text);
    background: var(--theme-surface-soft);
}

.theme-choice.is-active {
    color: var(--theme-accent-strong);
    background: var(--theme-accent-soft);
}

.theme-choice:active {
    transform: scale(0.94);
}

.theme-menu,
.theme-toggle {
    display: none !important;
}



/* ==========================================================
   UI-04 Theme Runtime Fix
   ========================================================== */

html,
body,
.app-frame,
.app-main,
.app-content,
.app-topbar {
    transition:
        background-color 180ms ease,
        color 180ms ease,
        border-color 180ms ease;
}


/* Theme selector */

.theme-control {
    display: inline-flex;
    align-items: center;
    gap: 2px;

    padding: 4px;

    border: 1px solid var(--theme-border);
    border-radius: 14px;

    background: var(--theme-surface);
    box-shadow: var(--theme-shadow-sm);
}

.theme-choice {
    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;

    padding: 0;

    border: 0;
    border-radius: 10px;

    color: var(--theme-text-soft);
    background: transparent;

    cursor: pointer;

    transition:
        background 150ms ease,
        color 150ms ease,
        transform 150ms ease;
}

.theme-choice svg {
    width: 17px;
    height: 17px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-choice:hover {
    color: var(--theme-text);
    background: var(--theme-surface-soft);
}

.theme-choice.is-active {
    color: var(--theme-accent-strong);
    background: var(--theme-accent-soft);
}

html[data-theme="dark"] .theme-choice.is-active {
    color: var(--theme-accent-strong);
}


/* DARK */

html[data-theme="dark"] {

    --aero-ink: #eef6fc;
    --aero-text: #eef6fc;
    --aero-muted: #a9bac9;
    --aero-ice: #10253b;

    background: #06111f;
}

html[data-theme="dark"] body {
    color: #eef6fc !important;

    background:
        radial-gradient(
            circle at 78% 3%,
            rgba(var(--theme-accent-rgb), 0.10),
            transparent 34rem
        ),
        #06111f !important;
}

html[data-theme="dark"] .app-frame,
html[data-theme="dark"] .app-main,
html[data-theme="dark"] .app-content {
    background: transparent !important;
}

html[data-theme="dark"] .app-topbar {
    color: #eef6fc !important;
    border-color: rgba(255,255,255,.08) !important;

    background:
        rgba(7, 20, 33, .88) !important;
}

html[data-theme="dark"] .topbar-context,
html[data-theme="dark"] .topbar-user-name {
    color: #eef6fc !important;
}

html[data-theme="dark"] .topbar-status,
html[data-theme="dark"] .topbar-user,
html[data-theme="dark"] .theme-control {
    color: #a9bac9 !important;
    border-color: rgba(255,255,255,.10) !important;
    background: #0b1b2d !important;
}


/* Common content surfaces */

html[data-theme="dark"] .app-content > *,
html[data-theme="dark"] .app-content section {
    border-color: rgba(255,255,255,.09);
}

html[data-theme="dark"] .app-content :where(
    .card,
    .panel,
    .surface,
    .dashboard-card,
    .metric-card,
    .teacher-card,
    .learning-card,
    .resource-card,
    .question-card,
    .course-card,
    .program-card
) {
    color: #eef6fc !important;
    border-color: rgba(255,255,255,.09) !important;
    background: #0b1b2d !important;
}


/* Headings and regular text */

html[data-theme="dark"] .app-content :where(
    h1,h2,h3,h4,h5,h6,
    p,strong,label,
    th,td
) {
    color: inherit;
}


/* Links */

html[data-theme="dark"] .app-content a:not(.btn):not(.button) {
    color: var(--theme-accent-strong);
}


/* Inputs */

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    color: #eef6fc !important;
    border-color: rgba(255,255,255,.12) !important;
    background: #10253b !important;
}


/* Tables */

html[data-theme="dark"] table,
html[data-theme="dark"] thead,
html[data-theme="dark"] tbody,
html[data-theme="dark"] tr,
html[data-theme="dark"] td,
html[data-theme="dark"] th {
    border-color: rgba(255,255,255,.08) !important;
}

html[data-theme="dark"] tbody tr:hover {
    background: rgba(var(--theme-accent-rgb),.06) !important;
}


/* Light mode */

html[data-theme="light"] body {
    color: #10243a;

    background:
        radial-gradient(
            circle at 82% 5%,
            rgba(var(--theme-accent-rgb),.10),
            transparent 28rem
        ),
        #f5f8fb !important;
}


/* Keyboard focus */

.theme-choice:focus-visible {
    outline: 2px solid var(--theme-accent);
    outline-offset: 2px;
}



/* ==========================================================
   UI-04 Dark Contrast Final Fix
   ========================================================== */

html[data-theme="dark"] {
    --aero-ink: #07182d;
    --aero-text: #eef6fc;
    --aero-muted: #9fb2c3;
    --aero-ice: #10253b;
}


/* ----------------------------------------------------------
   Main typography
   ---------------------------------------------------------- */

html[data-theme="dark"] .app-content h1,
html[data-theme="dark"] .app-content h2,
html[data-theme="dark"] .app-content h3,
html[data-theme="dark"] .app-content h4,
html[data-theme="dark"] .app-content h5,
html[data-theme="dark"] .app-content h6 {
    color: #f4f9fd !important;
}

html[data-theme="dark"] .app-content p,
html[data-theme="dark"] .app-content li,
html[data-theme="dark"] .app-content td,
html[data-theme="dark"] .app-content label {
    color: #b7c7d5;
}


/* ----------------------------------------------------------
   Hero / banner / intro areas
   ---------------------------------------------------------- */

html[data-theme="dark"] .app-content :where(
    [class*="hero"],
    [class*="banner"],
    [class*="intro"],
    [class*="welcome"]
) {
    color: var(--theme-text) !important;

    border-color: var(--theme-hero-border) !important;

    background: var(--theme-hero-bg) !important;

    box-shadow: var(--theme-hero-shadow);
}

html[data-theme="dark"] .app-content :where(
    [class*="hero"],
    [class*="banner"],
    [class*="intro"],
    [class*="welcome"]
) h1,
html[data-theme="dark"] .app-content :where(
    [class*="hero"],
    [class*="banner"],
    [class*="intro"],
    [class*="welcome"]
) h2,
html[data-theme="dark"] .app-content :where(
    [class*="hero"],
    [class*="banner"],
    [class*="intro"],
    [class*="welcome"]
) h3 {
    color: #f5fbff !important;
}

html[data-theme="dark"] .app-content :where(
    [class*="hero"],
    [class*="banner"],
    [class*="intro"],
    [class*="welcome"]
) p {
    color: #b7cad9 !important;
}


/* ----------------------------------------------------------
   Cards / programs / statistics
   ---------------------------------------------------------- */

html[data-theme="dark"] .app-content :where(
    [class*="card"],
    [class*="panel"],
    [class*="program"],
    [class*="metric"],
    [class*="stat"]
) {
    color: #eef6fc !important;

    border-color: rgba(255,255,255,.09) !important;

    background:
        linear-gradient(
            180deg,
            #0c2033 0%,
            #0b1b2d 100%
        ) !important;
}

html[data-theme="dark"] .app-content :where(
    [class*="card"],
    [class*="panel"],
    [class*="program"],
    [class*="metric"],
    [class*="stat"]
) h1,
html[data-theme="dark"] .app-content :where(
    [class*="card"],
    [class*="panel"],
    [class*="program"],
    [class*="metric"],
    [class*="stat"]
) h2,
html[data-theme="dark"] .app-content :where(
    [class*="card"],
    [class*="panel"],
    [class*="program"],
    [class*="metric"],
    [class*="stat"]
) h3,
html[data-theme="dark"] .app-content :where(
    [class*="card"],
    [class*="panel"],
    [class*="program"],
    [class*="metric"],
    [class*="stat"]
) strong {
    color: #f5fbff !important;
}

html[data-theme="dark"] .app-content :where(
    [class*="card"],
    [class*="panel"],
    [class*="program"],
    [class*="metric"],
    [class*="stat"]
) p {
    color: #afc1d0 !important;
}


/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */

html[data-theme="dark"] .app-content :where(
    .btn,
    .button,
    button,
    [class*="btn-"],
    [class*="button-"]
) {
    border-color: rgba(255,255,255,.10);
}

html[data-theme="dark"] .app-content :where(
    .btn-primary,
    .button-primary,
    [class*="primary"]
) {
    color: #ffffff !important;

    background:
        linear-gradient(
            135deg,
            var(--theme-accent-grad-a),
            var(--theme-accent-grad-b)
        ) !important;
}

html[data-theme="dark"] .app-content :where(
    .btn-primary,
    .button-primary,
    [class*="primary"]
):hover {
    background:
        linear-gradient(
            135deg,
            var(--theme-accent-grad-a),
            var(--theme-accent-grad-b)
        ) !important;
}


/* Existing dark buttons that use aero-ink */

html[data-theme="dark"] .app-content a[class*="btn"]:not([class*="secondary"]),
html[data-theme="dark"] .app-content button[class*="btn"]:not([class*="secondary"]) {
    color: #ffffff;
}


/* ----------------------------------------------------------
   Secondary / quiet buttons
   ---------------------------------------------------------- */

html[data-theme="dark"] .app-content :where(
    .btn-secondary,
    .button-secondary
) {
    color: #d9e8f2 !important;

    border-color: rgba(255,255,255,.11) !important;

    background: #132b40 !important;
}


/* ----------------------------------------------------------
   Badges
   ---------------------------------------------------------- */

html[data-theme="dark"] .app-content :where(
    [class*="badge"],
    [class*="pill"],
    [class*="tag"]
) {
    color: var(--theme-accent) !important;

    border-color: rgba(var(--theme-accent-rgb),.18) !important;

    background: rgba(var(--theme-accent-rgb),.10) !important;
}


/* ----------------------------------------------------------
   Dividers
   ---------------------------------------------------------- */

html[data-theme="dark"] .app-content hr {
    border-color: rgba(255,255,255,.12);
}


/* ----------------------------------------------------------
   Theme selector refinement
   ---------------------------------------------------------- */

.theme-control {
    gap: 1px !important;

    padding: 3px !important;

    border-color: var(--theme-border) !important;

    border-radius: 13px !important;

    box-shadow: none !important;
}

.theme-choice {
    width: 32px !important;
    height: 32px !important;

    border-radius: 9px !important;
}

.theme-choice svg {
    width: 16px !important;
    height: 16px !important;

    stroke-width: 1.7 !important;
}

html[data-theme="light"] .theme-choice {
    color: #667b8c;
}

html[data-theme="light"] .theme-choice.is-active {
    color: var(--theme-accent-strong) !important;
    background: #dff4fc !important;
}

html[data-theme="dark"] .theme-choice {
    color: #839bad !important;
}

html[data-theme="dark"] .theme-choice:hover {
    color: #dcebf5 !important;
    background: #132c42 !important;
}

html[data-theme="dark"] .theme-choice.is-active {
    color: var(--theme-accent) !important;
    background: #14354b !important;
}


/* ----------------------------------------------------------
   Topbar account
   ---------------------------------------------------------- */

/* Only the fallback initial needs this pale background for contrast
   against the dark topbar - a chosen avatar-mark SVG already carries
   its own dark ground (see UI-11 below), so forcing this background
   underneath it too left a pale ring visible around the mark's edges
   in dark mode. */
html[data-theme="dark"] .topbar-user-avatar:not(:has(.avatar-mark)) {
    color: #07182d !important;
    background: #dff5fc !important;
}

html[data-theme="dark"] .topbar-user-name {
    color: #eaf4fa !important;
}


/* ----------------------------------------------------------
   Scrollbar
   ---------------------------------------------------------- */

/* Dark scrollbars are coloured by scrollbar-color on html (see
   "Scrollbar" under UI-04). No ::-webkit-scrollbar sizing here: a
   width set in one theme only changed the page's width with it. */



/* ==========================================================
   UI-04 Final Dark Readability
   ========================================================== */

html[data-theme="dark"] .app-content :where(
    [class*="metric"],
    [class*="stat"],
    [class*="summary"]
) :where(
    strong,
    b,
    .value,
    [class*="value"],
    [class*="number"],
    [class*="count"]
) {
    color: #f5fbff !important;
}

html[data-theme="dark"] .app-content table thead,
html[data-theme="dark"] .app-content table th {
    color: #dce9f2 !important;
    background: #132b40 !important;
}

html[data-theme="dark"] .app-content table tbody td {
    color: #c4d3df !important;
}

html[data-theme="dark"] .app-content table tbody td strong {
    color: #f2f8fc !important;
}

/* ==========================================================
   UI-04 Brand Refinement
   ========================================================== */

.app-brand-mark {
    display: grid !important;
    place-items: center !important;

    width: 46px !important;
    height: 46px !important;

    min-width: 46px !important;

    overflow: visible !important;

    border: 0 !important;
    border-radius: 14px !important;

    background: transparent !important;

    box-shadow:
        0 8px 22px rgba(var(--theme-accent-strong-rgb), .20) !important;
}

.app-brand-mark::before,
.app-brand-mark::after {
    display: none !important;
}

.app-brand-symbol {
    display: block;

    width: 46px;
    height: 46px;

    object-fit: contain;
}

.app-brand-name {
    letter-spacing: -.03em;
}

.app-brand-name span {
    color: var(--theme-accent);
}

.app-brand-tagline {
    letter-spacing: .09em;
}


/* ----------------------------------------------------------
   Workspace atmospheric system
   ---------------------------------------------------------- */

.app-main {
    position: relative;
    isolation: isolate;
}

.app-main::before {
    content: "";

    position: fixed;
    z-index: -1;

    top: var(--topbar-height);
    right: 0;
    bottom: 0;
    left: var(--sidebar-width);

    pointer-events: none;

    background:
        radial-gradient(
            circle at 87% 8%,
            rgba(var(--theme-accent-rgb), .09),
            transparent 28rem
        ),
        radial-gradient(
            circle at 38% 62%,
            rgba(232, 182, 106, .035),
            transparent 34rem
        );
}

html[data-theme="dark"] .app-main::before {
    background:
        radial-gradient(
            circle at 88% 8%,
            rgba(var(--theme-accent-rgb), .08),
            transparent 30rem
        ),
        radial-gradient(
            circle at 38% 62%,
            rgba(var(--theme-accent-rgb), .025),
            transparent 36rem
        );
}


/* ----------------------------------------------------------
   Shared surface refinement
   ---------------------------------------------------------- */

.app-content :where(
    [class*="hero"],
    [class*="banner"]
) {
    position: relative;
    overflow: hidden;
}

.app-content :where(
    [class*="hero"],
    [class*="banner"]
)::after {
    content: "";

    position: absolute;

    width: 260px;
    height: 260px;

    right: -90px;
    bottom: -160px;

    border-radius: 50%;

    pointer-events: none;

    background:
        radial-gradient(
            circle,
            rgba(var(--theme-accent-rgb), .15),
            transparent 68%
        );
}

html[data-theme="dark"] .app-content :where(
    [class*="hero"],
    [class*="banner"]
)::after {
    background:
        radial-gradient(
            circle,
            rgba(var(--theme-accent-rgb), .15),
            transparent 68%
        );
}


/* ----------------------------------------------------------
   Topbar polish
   ---------------------------------------------------------- */

.app-topbar {
    box-shadow:
        0 1px 0 var(--theme-border);
}

.topbar-status {
    min-height: 36px;
}

.topbar-user {
    min-height: 42px;
    border-radius: 14px;
}


/* ----------------------------------------------------------
   Sidebar refinement
   ---------------------------------------------------------- */

.app-sidebar {
    background:
        radial-gradient(
            circle at 20% 0%,
            rgba(var(--theme-accent-rgb), .08),
            transparent 19rem
        ),
        linear-gradient(
            180deg,
            #071f31 0%,
            #061a29 100%
        ) !important;
}

.app-nav-link {
    border-radius: 12px;
}

.app-nav-link.is-active {
    box-shadow:
        inset 0 0 0 1px
        rgba(var(--theme-accent-rgb), .12);
}


/* ----------------------------------------------------------
   Responsive background
   ---------------------------------------------------------- */

@media (max-width: 860px) {

    .app-main::before {
        left: 0;
    }

}

/* ==========================================================
   UI-04 Final AeroESP Logo
   ========================================================== */

/* Override the earlier brand styles with the final ones */
.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 4px 0 22px;
}

.app-brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    flex: 0 0 44px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.app-brand-mark::before,
.app-brand-mark::after {
    display: none !important;
}

.app-brand-symbol {
    width: 42px;
    height: 42px;
    display: block;
    object-fit: contain;
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    line-height: 1.05;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.app-brand-name {
    display: block;
    font-size: calc(1rem * var(--font-scale));
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #f7fbfe;
    line-height: 1;
    white-space: nowrap;
}

.app-brand-name span {
    color: var(--theme-accent);
}

.app-brand-tagline {
    display: block;
    margin-top: 4px;
    font-size: calc(0.50rem * var(--font-scale));
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #c5d4df;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 150px;
}

.sidebar-brand,
.app-sidebar-brand,
.sidebar-header {
    overflow: hidden;
}

.sidebar-brand {
    width: 100%;
    overflow: hidden;
}

/* ==========================================================
   UI-05 Student Exam Foundation
   ========================================================== */

/* Sidebar logo clipping fix */

.app-sidebar {
    overflow-y: auto;
    overflow-x: hidden;
}

.app-brand {
    flex-shrink: 0;
    min-height: 76px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.app-brand-mark,
.app-brand-symbol {
    flex-shrink: 0;
}


/* Exam workspace */

.exam-home,
.student-exam-home,
.exam-dashboard {
    width: 100%;
}

.exam-access-card {
    max-width: 760px;

    padding: 28px;

    border: 1px solid var(--theme-border);
    border-radius: 22px;

    background: var(--theme-surface);

    box-shadow: var(--theme-shadow-sm);
}

.exam-access-card h2,
.exam-access-card h3 {
    margin-top: 0;
}


/* Exam code field */

.exam-code-field {
    width: 100%;
    min-height: 52px;

    padding: 0 16px;

    border: 1px solid var(--theme-border-strong);
    border-radius: 14px;

    color: var(--theme-text);

    background: var(--theme-surface);

    font: inherit;
    font-size: calc(15px * var(--font-scale));

    outline: none;

    transition:
        border-color 150ms ease,
        box-shadow 150ms ease;
}

.exam-code-field:focus {
    border-color: var(--theme-accent);

    box-shadow:
        0 0 0 4px
        rgba(var(--theme-accent-rgb), .12);
}


/* Primary exam action */

.exam-open-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;

    padding: 0 20px;

    margin-top: 14px;

    border: 0;
    border-radius: 13px;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            var(--theme-accent-grad-a),
            var(--theme-accent-grad-b)
        );

    box-shadow:
        0 8px 22px
        rgba(var(--theme-accent-strong-rgb), .18);

    cursor: pointer;

    font: inherit;
    font-weight: 700;

    transition:
        transform 150ms ease,
        box-shadow 150ms ease,
        filter 150ms ease;
}

.exam-open-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 12px 28px
        rgba(var(--theme-accent-strong-rgb), .24);

    filter: brightness(1.04);
}

.exam-open-button:active {
    transform: translateY(0);
}


/* Attempts */

.exam-attempts {
    margin-top: 32px;
}

.exam-empty-state {
    padding: 28px;

    border: 1px dashed var(--theme-border-strong);
    border-radius: 18px;

    color: var(--theme-text-soft);

    background: var(--theme-surface-soft);
}


/* Dark mode */

html[data-theme="dark"] .exam-access-card {
    background:
        linear-gradient(
            180deg,
            #0d2235,
            #0b1b2d
        );
}

html[data-theme="dark"] .exam-code-field {
    color: #eef6fc;

    background: #10253b;
}

html[data-theme="dark"] .exam-empty-state {
    background: #0d2032;
}

/* ==========================================================
   UI-05 Premium Exam Experience
   ========================================================== */

.exam-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;

    margin-bottom: 30px;
    padding: 42px 44px;

    border: 1px solid var(--theme-border);
    border-radius: 28px;

    background:
        radial-gradient(
            circle at 88% 18%,
            rgba(var(--theme-accent-rgb),.18),
            transparent 25rem
        ),
        linear-gradient(
            135deg,
            var(--theme-surface),
            var(--theme-surface-soft)
        );

    box-shadow: var(--theme-shadow-sm);
}

.exam-eyebrow,
.exam-kicker {
    display: block;

    margin-bottom: 10px;

    color: var(--theme-accent-strong);

    font-size: calc(11px * var(--font-scale));
    font-weight: 800;

    letter-spacing: .13em;
    text-transform: uppercase;
}

.exam-hero h1 {
    margin: 0;

    font-size: calc(clamp(32px, 4vw, 48px) * var(--font-scale));
    letter-spacing: -.04em;
}

.exam-hero p {
    max-width: 670px;

    margin: 12px 0 0;

    color: var(--theme-text-soft);
}


.exam-home-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.5fr)
        minmax(280px, .7fr);

    gap: 22px;
}


.exam-access-card,
.exam-info-card,
.exam-form-page {
    padding: 30px;

    border: 1px solid var(--theme-border);
    border-radius: 22px;

    background: var(--theme-surface);

    box-shadow: var(--theme-shadow-sm);
}


.exam-section-icon,
.exam-empty-icon {
    display: grid;
    place-items: center;

    width: 44px;
    height: 44px;

    border-radius: 13px;

    color: var(--theme-accent-strong);

    background: var(--theme-accent-soft);

    font-size: calc(12px * var(--font-scale));
    font-weight: 800;
}


.exam-section-copy {
    margin-top: 20px;
}

.exam-section-copy h2,
.exam-info-card h3 {
    margin: 0 0 8px;

    color: var(--theme-text);
}

.exam-section-copy p {
    margin: 0;

    color: var(--theme-text-soft);
}


.exam-access-form {
    margin-top: 26px;
}

.exam-access-form p {
    margin-bottom: 16px;
}

.exam-access-form label {
    display: block;

    margin-bottom: 7px;

    color: var(--theme-text);

    font-size: calc(13px * var(--font-scale));
    font-weight: 700;
}

.exam-access-form input {
    width: 100%;

    min-height: 54px;

    padding: 0 16px;

    border: 1px solid var(--theme-border-strong);
    border-radius: 14px;

    color: var(--theme-text);

    background: var(--theme-surface-soft);

    font: inherit;

    outline: none;
}

.exam-access-form input:focus {
    border-color: var(--theme-accent);

    box-shadow:
        0 0 0 4px
        rgba(var(--theme-accent-rgb),.12);
}


.exam-open-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    min-height: 46px;

    padding: 0 20px;

    border: 0;
    border-radius: 13px;

    color: #ffffff !important;

    background:
        linear-gradient(
            135deg,
            var(--theme-accent-grad-a),
            var(--theme-accent-grad-b)
        ) !important;

    box-shadow:
        0 9px 22px
        rgba(var(--theme-accent-strong-rgb),.20);

    cursor: pointer;

    font: inherit;
    font-weight: 750;

    text-decoration: none;

    transition:
        transform 150ms ease,
        box-shadow 150ms ease;
}

.exam-open-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 13px 28px
        rgba(var(--theme-accent-strong-rgb),.28);
}


.exam-info-card {
    background:
        linear-gradient(
            150deg,
            var(--theme-surface-soft),
            var(--theme-surface)
        );
}

.exam-readiness-list {
    display: grid;
    gap: 17px;

    margin-top: 24px;
}

.exam-readiness-list div {
    display: grid;
    grid-template-columns: 35px 1fr;
    gap: 9px;

    color: var(--theme-text-soft);

    font-size: calc(14px * var(--font-scale));
}

.exam-readiness-list span {
    color: var(--theme-accent-strong);

    font-size: calc(11px * var(--font-scale));
    font-weight: 800;
}


.exam-attempts,
.teacher-exam-section {
    margin-top: 38px;
}

.exam-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}

.exam-section-heading h2 {
    margin: 0;
}

.exam-count {
    padding: 7px 11px;

    border-radius: 99px;

    color: var(--theme-text-soft);

    background: var(--theme-surface-soft);

    font-size: calc(12px * var(--font-scale));
    font-weight: 700;
}


.exam-empty-state {
    display: flex;
    align-items: center;

    gap: 18px;

    padding: 28px;

    border: 1px dashed var(--theme-border-strong);
    border-radius: 20px;

    background: var(--theme-surface-soft);
}

.exam-empty-state h3 {
    margin: 0 0 5px;
}

.exam-empty-state p {
    margin: 0;

    color: var(--theme-text-soft);
}

.exam-empty-large {
    min-height: 220px;
}


.exam-table-shell {
    overflow-x: auto;

    border: 1px solid var(--theme-border);
    border-radius: 20px;

    background: var(--theme-surface);
}

.exam-table {
    width: 100%;

    border-collapse: collapse;
}

.exam-table th {
    padding: 14px 18px;

    color: var(--theme-text-soft);

    background: var(--theme-surface-soft);

    font-size: calc(11px * var(--font-scale));
    letter-spacing: .07em;
    text-transform: uppercase;

    text-align: left;
}

.exam-table td {
    padding: 17px 18px;

    border-top: 1px solid var(--theme-border);
}

.exam-table-action {
    text-align: right;
}


.exam-status {
    display: inline-flex;

    padding: 6px 9px;

    border-radius: 99px;

    color: var(--theme-text-soft);

    background: var(--theme-surface-soft);

    font-size: calc(11px * var(--font-scale));
    font-weight: 750;
}


.exam-action-link {
    display: inline-flex;

    padding: 7px 10px;

    border-radius: 9px;

    color: var(--theme-text-soft) !important;

    text-decoration: none;

    font-size: calc(13px * var(--font-scale));
    font-weight: 700;
}

.exam-action-link:hover {
    color: var(--theme-text) !important;

    background: var(--theme-surface-soft);
}

.exam-action-primary {
    color: var(--theme-accent-strong) !important;
}


/* Teacher exam cards */

.teacher-exam-grid {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(300px, 1fr)
        );

    gap: 18px;
}

.teacher-exam-card {
    padding: 24px;

    border: 1px solid var(--theme-border);
    border-radius: 20px;

    background: var(--theme-surface);

    box-shadow: var(--theme-shadow-sm);
}

.teacher-exam-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
}

.teacher-exam-card h3 {
    margin: 23px 0;

    font-size: calc(21px * var(--font-scale));
}

.teacher-exam-question-count {
    color: var(--theme-text-soft);

    font-size: calc(12px * var(--font-scale));
}

.teacher-exam-meta {
    display: flex;
    justify-content: space-between;

    padding: 13px 0;

    border-top: 1px solid var(--theme-border);
    border-bottom: 1px solid var(--theme-border);

    color: var(--theme-text-soft);

    font-size: calc(13px * var(--font-scale));
}

.teacher-exam-actions {
    display: flex;
    gap: 4px;

    margin-top: 15px;
}


/* Exam builder */

.exam-form-page {
    max-width: 940px;

    margin-inline: auto;
}

.exam-form-header {
    margin-bottom: 28px;

    padding-bottom: 22px;

    border-bottom: 1px solid var(--theme-border);
}

.exam-form-header h1 {
    margin: 0;
}

.exam-form-header p {
    color: var(--theme-text-soft);
}


.exam-builder-fields p {
    margin: 0 0 20px;
}

.exam-builder-fields label {
    display: block;

    margin-bottom: 7px;

    font-size: calc(13px * var(--font-scale));
    font-weight: 750;
}

.exam-builder-fields input:not(
    [type="checkbox"]
):not(
    [type="radio"]
),
.exam-builder-fields select,
.exam-builder-fields textarea {
    width: 100%;

    padding: 12px 14px;

    border: 1px solid var(--theme-border-strong);
    border-radius: 13px;

    color: var(--theme-text);

    background: var(--theme-surface-soft);

    font: inherit;
}

.exam-builder-fields .helptext {
    display: block;

    margin-top: 6px;

    color: var(--theme-text-faint);

    font-size: calc(12px * var(--font-scale));
}


.exam-builder-actions {
    display: flex;
    gap: 10px;

    margin-top: 28px;
    padding-top: 22px;

    border-top: 1px solid var(--theme-border);
}

.exam-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;

    padding: 0 18px;

    border: 1px solid var(--theme-border);
    border-radius: 13px;

    color: var(--theme-text) !important;

    background: var(--theme-surface-soft);

    font-weight: 700;

    text-decoration: none;
}


/* Result */

.exam-result-shell {
    max-width: 820px;

    margin: 30px auto;

    padding: 42px;

    border: 1px solid var(--theme-border);
    border-radius: 26px;

    background: var(--theme-surface);

    box-shadow: var(--theme-shadow-md);
}

.exam-result-status {
    display: grid;
    place-items: center;

    width: 58px;
    height: 58px;

    margin-bottom: 24px;

    border-radius: 50%;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #19a879,
            #34c997
        );

    font-size: calc(25px * var(--font-scale));
    font-weight: 800;
}

.exam-result-shell h1 {
    margin: 0;
}

.exam-result-lead {
    color: var(--theme-text-soft);
}

.exam-result-meta {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;

    margin: 28px 0;
}

.exam-result-meta > div {
    padding: 17px;

    border: 1px solid var(--theme-border);
    border-radius: 15px;

    background: var(--theme-surface-soft);
}

.exam-result-meta span,
.exam-score-card span {
    display: block;

    margin-bottom: 6px;

    color: var(--theme-text-soft);

    font-size: calc(12px * var(--font-scale));
}

.exam-score-card {
    display: grid;
    grid-template-columns:
        repeat(2, 1fr);

    gap: 14px;

    margin-bottom: 26px;
}

.exam-score-card > div {
    padding: 23px;

    border-radius: 18px;

    background: var(--theme-accent-soft);
}

.exam-score-card strong {
    color: var(--theme-accent-strong);

    font-size: calc(32px * var(--font-scale));
}

.exam-score-card small {
    font-size: calc(14px * var(--font-scale));
}

.exam-result-policy {
    margin-bottom: 25px;

    padding: 18px;

    border-radius: 15px;

    color: var(--theme-text-soft);

    background: var(--theme-surface-soft);
}


/* Dark */

html[data-theme="dark"] .exam-hero,
html[data-theme="dark"] .exam-access-card,
html[data-theme="dark"] .exam-info-card,
html[data-theme="dark"] .teacher-exam-card,
html[data-theme="dark"] .exam-form-page,
html[data-theme="dark"] .exam-result-shell,
html[data-theme="dark"] .exam-table-shell {
    background:
        linear-gradient(
            180deg,
            #0d2235,
            #0b1b2d
        );
}


/* Responsive */

@media (max-width: 900px) {

    .exam-home-grid {
        grid-template-columns: 1fr;
    }

    .exam-hero {
        align-items: flex-start;
        flex-direction: column;
    }

}

@media (max-width: 620px) {

    .exam-hero {
        padding: 28px 24px;
    }

    .exam-result-meta,
    .exam-score-card {
        grid-template-columns: 1fr;
    }

    .exam-result-shell {
        padding: 28px 22px;
    }

}

/* ==========================================================
   AeroESP Account Center
   ========================================================== */

.account-hero {
    display: flex;
    align-items: center;
    gap: 24px;

    margin-bottom: 26px;
    padding: 34px;

    border: 1px solid var(--theme-border);
    border-radius: 26px;

    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(var(--theme-accent-rgb),.16),
            transparent 24rem
        ),
        var(--theme-surface);

    box-shadow: var(--theme-shadow-sm);
}

.account-avatar-large {
    display: grid;
    place-items: center;

    width: 76px;
    height: 76px;
    min-width: 76px;

    border-radius: 50%;

    color: #07182d;

    background:
        linear-gradient(
            135deg,
            var(--theme-accent-grad-a),
            var(--theme-accent-grad-b)
        );

    font-size: calc(28px * var(--font-scale));
    font-weight: 800;
}

.account-kicker {
    display: block;

    margin-bottom: 8px;

    color: var(--theme-accent-strong);

    font-size: calc(11px * var(--font-scale));
    font-weight: 800;

    letter-spacing: .12em;
    text-transform: uppercase;
}

.account-hero h1 {
    margin: 0;

    font-size: calc(38px * var(--font-scale));
    letter-spacing: -.04em;
}

.account-hero p {
    margin: 8px 0 0;

    color: var(--theme-text-soft);
}


.account-grid {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(280px, 1fr)
        );

    gap: 18px;
}

.account-card {
    padding: 26px;

    border: 1px solid var(--theme-border);
    border-radius: 21px;

    background: var(--theme-surface);

    box-shadow: var(--theme-shadow-sm);
}

.account-card h2 {
    margin: 0 0 20px;
}

.account-card-copy {
    margin-top: -8px;
    margin-bottom: 22px;

    color: var(--theme-text-soft);
}

.account-info-list {
    display: grid;
}

.account-info-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 14px 0;

    border-top: 1px solid var(--theme-border);
}

.account-info-list > div:last-child {
    border-bottom: 1px solid var(--theme-border);
}

.account-info-list span {
    color: var(--theme-text-soft);

    font-size: calc(13px * var(--font-scale));
}

.account-info-value {
    display: flex;
    flex-direction: column;
    align-items: flex-end;

    gap: 2px;
}

.account-info-hint {
    color: var(--theme-text-faint);

    font-size: calc(10.5px * var(--font-scale));
    font-style: normal;

    text-align: right;
}

.account-info-list strong {
    color: var(--theme-text);

    text-align: right;
}


.account-primary-action,
.account-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    min-height: 46px;

    padding: 0 18px;

    border-radius: 13px;

    font: inherit;
    font-weight: 750;

    text-decoration: none;

    cursor: pointer;
}

.account-primary-action {
    border: 0;

    color: #ffffff !important;

    background:
        linear-gradient(
            135deg,
            var(--theme-accent-grad-a),
            var(--theme-accent-grad-b)
        );

    box-shadow:
        0 8px 22px
        rgba(var(--theme-accent-strong-rgb),.20);
}

.account-secondary-action {
    border: 1px solid var(--theme-border-strong);

    color: var(--theme-text);

    background: var(--theme-surface-soft);
}

.account-primary-action:hover,
.account-secondary-action:hover {
    transform: translateY(-1px);
}


/* An account holding more than one role gets one of these per
   dashboard, stacked. The first keeps the filled accent treatment as
   the obvious way in; the rest read as alternatives rather than as a
   row of equally-weighted primary buttons. */

.account-primary-action--secondary {
    margin-top: 10px;

    border: 1px solid var(--theme-border-strong);

    color: var(--theme-text) !important;

    background: var(--theme-surface-soft);

    box-shadow: none;
}

.account-primary-action {
    width: 100%;

    justify-content: space-between;

    text-align: left;
}

.account-action-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;

    min-width: 0;
}

.account-action-copy small {
    font-size: calc(11.5px * var(--font-scale));
    font-weight: 500;

    opacity: .82;
}


html[data-theme="dark"] .account-hero,
html[data-theme="dark"] .account-card {
    background:
        linear-gradient(
            180deg,
            #0d2235,
            #0b1b2d
        );
}


@media (max-width: 620px) {

    .account-hero {
        align-items: flex-start;
        flex-direction: column;

        padding: 26px;
    }

}

/* ==========================================================
   UI-05 Stage 2 — Exam Runner & Builder
   ========================================================== */


/* Focus mode */

.exam-focus-mode .app-sidebar {
    display: none !important;
}

.exam-focus-mode .sidebar-overlay {
    display: none !important;
}

.exam-focus-mode .app-frame {
    margin-left: 0 !important;
}

.exam-focus-mode .app-main::before {
    left: 0 !important;
}

.exam-focus-mode .mobile-menu-button {
    display: none !important;
}


/* Preview */

.exam-preview-hero {
    margin-bottom: 22px;
    padding: 34px;

    border: 1px solid var(--theme-border);
    border-radius: 25px;

    background:
        radial-gradient(
            circle at 88% 12%,
            rgba(var(--theme-accent-rgb),.17),
            transparent 24rem
        ),
        var(--theme-surface);
}

.exam-preview-hero h1 {
    margin: 0;

    font-size: calc(38px * var(--font-scale));
    letter-spacing: -.04em;
}

.exam-preview-hero p {
    color: var(--theme-text-soft);
}


.exam-preview-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.5fr)
        minmax(270px, .55fr);

    gap: 20px;
}

.exam-preview-main,
.exam-preview-side {
    padding: 27px;

    border: 1px solid var(--theme-border);
    border-radius: 21px;

    background: var(--theme-surface);

    box-shadow: var(--theme-shadow-sm);
}


.exam-preview-stats {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0,1fr));

    gap: 10px;
}

.exam-preview-stats > div,
.exam-preview-schedule > div {
    padding: 16px;

    border-radius: 14px;

    background: var(--theme-surface-soft);
}

.exam-preview-stats span,
.exam-preview-schedule span {
    display: block;

    margin-bottom: 6px;

    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
}

.exam-preview-schedule {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 10px;

    margin-top: 10px;
}

.exam-instructions {
    margin-top: 24px;
    padding-top: 22px;

    border-top: 1px solid var(--theme-border);
}

.exam-instructions p {
    color: var(--theme-text-soft);
}

.exam-preview-actions {
    display: flex;
    align-items: center;
    gap: 9px;

    margin-top: 25px;
}

.exam-preview-checklist {
    display: grid;
    gap: 17px;

    margin-top: 22px;
}

.exam-preview-checklist div {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 8px;

    color: var(--theme-text-soft);

    font-size: calc(14px * var(--font-scale));
}

.exam-preview-checklist span {
    color: var(--theme-accent-strong);
}

.exam-unavailable {
    padding: 14px 16px;

    border-radius: 13px;

    color: var(--theme-text-soft);

    background: var(--theme-surface-soft);
}


/* Runner */

.exam-runner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 16px;
    padding: 22px 25px;

    border: 1px solid var(--theme-border);
    border-radius: 20px;

    background: var(--theme-surface);
}

.exam-runner-header h1 {
    margin: 0;

    font-size: calc(26px * var(--font-scale));
}

.exam-runner-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.exam-tool-button {
    width: 43px;
    height: 43px;

    border: 1px solid var(--theme-border);
    border-radius: 12px;

    color: var(--theme-text);

    background: var(--theme-surface-soft);

    cursor: pointer;

    font-size: calc(20px * var(--font-scale));
}

.exam-timer-card {
    min-width: 142px;

    padding: 8px 14px;

    border: 1px solid var(--theme-border);
    border-radius: 13px;

    background: var(--theme-surface-soft);

    text-align: center;
}

.exam-timer-card span {
    display: block;

    color: var(--theme-text-soft);

    font-size: calc(9px * var(--font-scale));
    font-weight: 750;

    letter-spacing: .08em;
    text-transform: uppercase;
}

.exam-timer-card strong {
    display: block;

    margin-top: 2px;

    font-size: calc(20px * var(--font-scale));
}

.exam-timer-card.is-warning {
    border-color: rgba(225,113,72,.35);

    background: rgba(225,113,72,.10);
}

.exam-timer-card.is-warning strong {
    color: #e17148;
}


.exam-progress-strip {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0,1fr));

    gap: 8px;

    margin-bottom: 18px;
}

.exam-progress-strip > div {
    padding: 11px 14px;

    border: 1px solid var(--theme-border);
    border-radius: 12px;

    background: var(--theme-surface-soft);
}

.exam-progress-strip span {
    color: var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));
    text-transform: uppercase;
    letter-spacing: .07em;
}

.exam-progress-strip strong {
    float: right;
}


.exam-runner-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        270px;

    gap: 20px;
}


.exam-question-column {
    display: grid;
    gap: 17px;
}

.exam-question-card {
    scroll-margin-top: 95px;

    padding: 28px;

    border: 1px solid var(--theme-border);
    border-radius: 21px;

    background: var(--theme-surface);

    box-shadow: var(--theme-shadow-sm);
}

.exam-question-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 23px;
}

.exam-question-number {
    display: block;

    color: var(--theme-text);

    font-size: calc(14px * var(--font-scale));
    font-weight: 800;
}

.exam-question-points {
    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
}

.exam-question-text {
    margin-bottom: 22px;

    color: var(--theme-text);

    font-size: calc(18px * var(--font-scale));
    font-weight: 650;

    line-height: 1.65;
}


.exam-options {
    display: grid;
    gap: 10px;
}

.exam-option {
    display: grid;
    grid-template-columns:
        22px 36px 1fr;

    align-items: center;

    gap: 9px;

    padding: 14px;

    border: 1px solid var(--theme-border);
    border-radius: 13px;

    color: var(--theme-text);

    background: var(--theme-surface-soft);

    cursor: pointer;

    transition:
        border-color 140ms ease,
        background 140ms ease,
        transform 140ms ease;
}

.exam-option:hover {
    border-color: var(--theme-accent);

    transform: translateY(-1px);
}

.exam-option:has(input:checked) {
    border-color: var(--theme-accent);

    background: var(--theme-accent-soft);
}

.exam-option input {
    width: 17px;
    height: 17px;

    accent-color: var(--theme-accent-strong);
}

.exam-option-key {
    display: grid;
    place-items: center;

    width: 32px;
    height: 32px;

    border-radius: 9px;

    background: var(--theme-surface);
}

.exam-option-text {
    line-height: 1.45;
}


.exam-flag-button {
    min-height: 35px;

    padding: 0 12px;

    border: 1px solid var(--theme-border);
    border-radius: 10px;

    color: var(--theme-text-soft);

    background: var(--theme-surface-soft);

    cursor: pointer;

    font: inherit;
    font-size: calc(12px * var(--font-scale));
    font-weight: 700;
}

.exam-flag-button.is-active {
    color: #c78723;

    border-color: rgba(215,157,56,.30);

    background: rgba(215,157,56,.11);
}


.exam-save-status {
    min-height: 18px;

    margin-top: 12px;

    font-size: calc(11px * var(--font-scale));
}

.exam-save-status.is-saving {
    color: var(--theme-text-soft);
}

.exam-save-status.is-saved {
    color: #26a77a;
}

.exam-save-status.is-error {
    color: #d96a65;
}


/* Navigator */

.exam-navigator {
    position: relative;
}

.exam-navigator-inner {
    position: sticky;
    top: calc(var(--topbar-height) + 18px);

    padding: 21px;

    border: 1px solid var(--theme-border);
    border-radius: 19px;

    background: var(--theme-surface);
}

.exam-navigator-grid {
    display: grid;
    grid-template-columns:
        repeat(5, 1fr);

    gap: 7px;

    margin-top: 17px;
}

.exam-nav-question {
    aspect-ratio: 1;

    border: 1px solid var(--theme-border);
    border-radius: 9px;

    color: var(--theme-text);

    background: var(--theme-surface-soft);

    cursor: pointer;

    font: inherit;
    font-size: calc(12px * var(--font-scale));
    font-weight: 750;
}

.exam-nav-question.is-answered {
    color: var(--theme-accent-strong);

    border-color: rgba(var(--theme-accent-rgb),.30);

    background: var(--theme-accent-soft);
}

.exam-nav-question.is-flagged {
    box-shadow:
        inset 0 -3px 0
        #d39a3a;
}

.exam-nav-legend {
    display: grid;
    gap: 8px;

    margin-top: 20px;
    padding-top: 17px;

    border-top: 1px solid var(--theme-border);

    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
}

.legend-dot {
    display: inline-block;

    width: 8px;
    height: 8px;

    margin-right: 6px;

    border-radius: 50%;
}

.legend-dot.answered {
    background: var(--theme-accent);
}

.legend-dot.unanswered {
    border: 1px solid var(--theme-border-strong);

    background: var(--theme-surface-soft);
}

.legend-dot.flagged {
    background: #d39a3a;
}


/* Submit */

.exam-submit-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 24px;

    border: 1px solid var(--theme-border);
    border-radius: 18px;

    background: var(--theme-surface-soft);
}

.exam-submit-zone h3 {
    margin: 0 0 4px;
}

.exam-submit-zone p {
    margin: 0;

    color: var(--theme-text-soft);
}

.exam-submit-button,
.exam-publish-button {
    min-height: 46px;

    padding: 0 19px;

    border: 0;
    border-radius: 13px;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            var(--theme-accent-grad-a),
            var(--theme-accent-grad-b)
        );

    cursor: pointer;

    font: inherit;
    font-weight: 750;
}


.exam-submit-modal {
    position: fixed;
    z-index: 5000;

    inset: 0;

    display: grid;
    place-items: center;

    padding: 20px;

    background: rgba(3,13,22,.70);

    backdrop-filter: blur(8px);
}

.exam-submit-modal[hidden] {
    display: none !important;
}

.exam-submit-dialog {
    width: min(500px, 100%);

    padding: 32px;

    border: 1px solid var(--theme-border);
    border-radius: 23px;

    background: var(--theme-surface);

    box-shadow: var(--theme-shadow-lg);
}

.exam-submit-dialog-icon {
    display: grid;
    place-items: center;

    width: 50px;
    height: 50px;

    margin-bottom: 20px;

    border-radius: 15px;

    color: var(--theme-accent-strong);

    background: var(--theme-accent-soft);

    font-size: calc(22px * var(--font-scale));
}

.exam-submit-dialog h2 {
    margin: 0 0 9px;
}

.exam-submit-dialog p {
    color: var(--theme-text-soft);
}

.exam-submit-dialog-actions {
    display: flex;
    justify-content: flex-end;

    gap: 9px;

    margin-top: 24px;
}


/* Teacher detail */

.teacher-exam-detail-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 25px;

    padding: 34px;

    border: 1px solid var(--theme-border);
    border-radius: 24px;

    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(var(--theme-accent-rgb),.17),
            transparent 26rem
        ),
        var(--theme-surface);
}

.teacher-exam-detail-hero h1 {
    margin: 0;

    font-size: calc(38px * var(--font-scale));
    letter-spacing: -.04em;
}

.teacher-exam-detail-tags {
    display: flex;
    gap: 7px;

    margin-top: 13px;
}

.teacher-exam-detail-tags > span {
    padding: 6px 10px;

    border-radius: 99px;

    color: var(--theme-text-soft);

    background: var(--theme-surface-soft);

    font-size: calc(11px * var(--font-scale));
    font-weight: 700;
}

.teacher-exam-detail-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;
}


.teacher-exam-metrics {
    display: grid;
    grid-template-columns:
        repeat(4, 1fr);

    gap: 10px;

    margin: 18px 0;
}

.teacher-exam-metrics > div {
    padding: 18px;

    border: 1px solid var(--theme-border);
    border-radius: 15px;

    background: var(--theme-surface);
}

.teacher-exam-metrics span {
    display: block;

    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
}

.teacher-exam-metrics strong {
    display: block;

    margin-top: 5px;

    font-size: calc(22px * var(--font-scale));
}


.teacher-exam-detail-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.4fr)
        minmax(250px, .55fr);

    gap: 18px;
}

.teacher-exam-settings-card,
.teacher-exam-flow-card,
.teacher-exam-question-section,
.exam-publish-page,
.exam-builder-page,
.exam-bank-page {
    padding: 27px;

    border: 1px solid var(--theme-border);
    border-radius: 21px;

    background: var(--theme-surface);

    box-shadow: var(--theme-shadow-sm);
}

.teacher-exam-setting-list {
    display: grid;

    margin-top: 18px;
}

.teacher-exam-setting-list > div {
    display: flex;
    justify-content: space-between;

    gap: 20px;

    padding: 13px 0;

    border-top: 1px solid var(--theme-border);
}

.teacher-exam-setting-list span {
    color: var(--theme-text-soft);

    font-size: calc(12px * var(--font-scale));
}

.teacher-exam-text-block {
    margin-top: 22px;
    padding-top: 18px;

    border-top: 1px solid var(--theme-border);
}

.teacher-exam-text-block p {
    color: var(--theme-text-soft);
}


.teacher-exam-flow-card {
    display: flex;
    flex-direction: column;
}

.teacher-exam-flow-card a {
    display: grid;
    grid-template-columns: 32px 1fr;
    align-items: center;

    gap: 9px;

    padding: 12px;

    border-radius: 11px;

    color: var(--theme-text) !important;

    text-decoration: none;
}

.teacher-exam-flow-card a:hover {
    background: var(--theme-surface-soft);
}

.teacher-exam-flow-card a span {
    color: var(--theme-accent-strong);

    font-size: calc(10px * var(--font-scale));
    font-weight: 800;
}

.teacher-exam-question-section {
    margin-top: 18px;
}


/* Publish */

.exam-publish-page {
    max-width: 850px;

    margin-inline: auto;

    padding: 36px;
}

.exam-publish-page h1 {
    margin: 0;

    font-size: calc(38px * var(--font-scale));
}

.exam-publish-lead {
    color: var(--theme-text-soft);
}

.exam-publish-summary {
    display: grid;
    grid-template-columns:
        repeat(3, 1fr);

    gap: 9px;

    margin: 27px 0;
}

.exam-publish-summary > div {
    padding: 16px;

    border-radius: 14px;

    background: var(--theme-surface-soft);
}

.exam-publish-summary span {
    display: block;

    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
}

.exam-publish-summary strong {
    display: block;

    margin-top: 5px;
}

.exam-publish-warning {
    padding: 18px;

    border: 1px solid rgba(211,154,58,.25);
    border-radius: 14px;

    background: rgba(211,154,58,.08);
}

.exam-publish-warning p {
    margin-bottom: 0;

    color: var(--theme-text-soft);
}

.exam-publish-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;

    gap: 9px;

    margin-top: 25px;
}


/* Builder */

.exam-builder-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;

    gap: 20px;

    margin-bottom: 24px;
}

.exam-builder-page-header h1 {
    margin: 0;

    font-size: calc(34px * var(--font-scale));
}

.exam-builder-page-header p {
    margin-bottom: 0;

    color: var(--theme-text-soft);
}

.exam-structure-table input[type="number"] {
    width: 90px;

    padding: 8px;

    border: 1px solid var(--theme-border);
    border-radius: 9px;

    color: var(--theme-text);

    background: var(--theme-surface-soft);
}

.exam-structure-table input[type="checkbox"] {
    width: 17px;
    height: 17px;

    accent-color: var(--theme-accent-strong);
}

.exam-structure-question {
    max-width: 520px;

    line-height: 1.45;
}

.exam-table-empty {
    padding: 25px;

    color: var(--theme-text-soft);

    text-align: center;
}


/* Question bank */

.exam-bank-search {
    display: flex;
    gap: 8px;

    margin-bottom: 15px;
}

.exam-bank-search input {
    flex: 1;

    min-height: 46px;

    padding: 0 14px;

    border: 1px solid var(--theme-border);
    border-radius: 12px;

    color: var(--theme-text);

    background: var(--theme-surface-soft);

    font: inherit;
}

.exam-bank-toolbar {
    display: flex;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 14px;
}

.exam-question-checkbox {
    width: 17px;
    height: 17px;

    accent-color: var(--theme-accent-strong);
}

.exam-added-badge {
    display: inline-flex;

    padding: 5px 8px;

    border-radius: 99px;

    color: #299b78;

    background: rgba(41,155,120,.10);

    font-size: calc(10px * var(--font-scale));
    font-weight: 800;
}

.exam-pagination {
    display: grid;
    grid-template-columns:
        1fr auto 1fr;

    align-items: center;

    margin-top: 18px;

    font-size: calc(12px * var(--font-scale));
}

.exam-pagination a {
    color: var(--theme-accent-strong) !important;

    text-decoration: none;
}

.exam-pagination a:last-child {
    justify-self: end;
}


/* Dark */

html[data-theme="dark"] :where(
    .exam-preview-main,
    .exam-preview-side,
    .exam-runner-header,
    .exam-question-card,
    .exam-navigator-inner,
    .teacher-exam-settings-card,
    .teacher-exam-flow-card,
    .teacher-exam-question-section,
    .exam-publish-page,
    .exam-builder-page,
    .exam-bank-page,
    .exam-submit-dialog
) {
    background:
        linear-gradient(
            180deg,
            #0d2235,
            #0b1b2d
        );
}


/* Responsive */

@media (max-width: 1000px) {

    .exam-runner-layout {
        grid-template-columns: 1fr;
    }

    .exam-navigator {
        order: -1;
    }

    .exam-navigator-inner {
        position: static;
    }

    .exam-navigator-grid {
        grid-template-columns:
            repeat(10, 1fr);
    }

    .teacher-exam-detail-grid,
    .exam-preview-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 720px) {

    .exam-preview-stats,
    .teacher-exam-metrics,
    .exam-progress-strip {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .exam-preview-schedule,
    .exam-publish-summary {
        grid-template-columns: 1fr;
    }

    .exam-runner-header,
    .teacher-exam-detail-hero,
    .exam-builder-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .exam-navigator-grid {
        grid-template-columns:
            repeat(5, 1fr);
    }

    .exam-submit-zone {
        align-items: flex-start;
        flex-direction: column;
    }

}

/* ==========================================================
   UI-05 Flag Review Notes
   ========================================================== */

.exam-flag-note-panel {
    display: none;

    margin-top: 18px;
    padding: 17px;

    border: 1px solid rgba(211,154,58,.24);
    border-radius: 14px;

    background: rgba(211,154,58,.065);
}

.exam-flag-note-panel.is-open {
    display: block;
}

.exam-flag-note-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 12px;
}

.exam-flag-note-head strong {
    display: block;

    color: var(--theme-text);

    font-size: calc(13px * var(--font-scale));
}

.exam-flag-note-head span {
    display: block;

    margin-top: 3px;

    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
}

.exam-flag-save-state {
    color: var(--theme-accent-strong) !important;

    font-size: calc(11px * var(--font-scale)) !important;
    font-weight: 700;
}

.exam-flag-note {
    display: block;

    width: 100%;
    min-height: 94px;

    resize: vertical;

    padding: 12px 13px;

    border: 1px solid var(--theme-border-strong);
    border-radius: 11px;

    color: var(--theme-text);

    background: var(--theme-surface);

    font: inherit;
    font-size: calc(13px * var(--font-scale));
    line-height: 1.55;

    outline: none;
}

.exam-flag-note:focus {
    border-color: #d39a3a;

    box-shadow:
        0 0 0 3px
        rgba(211,154,58,.10);
}

.exam-flag-note-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-top: 10px;
}

.exam-flag-note-actions > span {
    color: var(--theme-text-faint);

    font-size: calc(10px * var(--font-scale));
}

.exam-note-save-button {
    min-height: 34px;

    padding: 0 12px;

    border: 1px solid rgba(211,154,58,.25);
    border-radius: 9px;

    color: #b47c21;

    background: rgba(211,154,58,.10);

    cursor: pointer;

    font: inherit;
    font-size: calc(11px * var(--font-scale));
    font-weight: 750;
}


/* Result review */

.exam-flag-review-result {
    margin: 30px 0;
    padding-top: 26px;

    border-top: 1px solid var(--theme-border);
}

.exam-result-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 15px;
}

.exam-result-section-heading h2 {
    margin: 0;
}

.exam-result-flag-list {
    display: grid;
    gap: 10px;
}

.exam-result-flag-card {
    padding: 18px;

    border: 1px solid var(--theme-border);
    border-radius: 15px;

    background: var(--theme-surface-soft);
}

.exam-result-flag-number {
    margin-bottom: 7px;

    color: #c0872b;

    font-size: calc(10px * var(--font-scale));
    font-weight: 800;

    letter-spacing: .08em;
    text-transform: uppercase;
}

.exam-result-flag-question {
    color: var(--theme-text);

    font-size: calc(14px * var(--font-scale));
    font-weight: 700;

    line-height: 1.5;
}

.exam-result-flag-note {
    margin-top: 13px;
    padding: 12px;

    border-left: 3px solid #d39a3a;
    border-radius: 8px;

    background: rgba(211,154,58,.07);
}

.exam-result-flag-note span {
    display: block;

    margin-bottom: 5px;

    color: var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));
    font-weight: 700;

    text-transform: uppercase;
}

.exam-result-flag-note p {
    margin: 0;

    color: var(--theme-text);

    font-size: calc(13px * var(--font-scale));
}

.exam-result-flag-note.is-empty {
    color: var(--theme-text-soft);

    font-size: calc(12px * var(--font-scale));
}


html[data-theme="dark"] .exam-flag-note {
    background: #10253b;
}

/* ==========================================================
   UI-06 Adaptive Learning
   ========================================================== */

.adaptive-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;

    margin-bottom: 18px;
    padding: 6px;

    border: 1px solid var(--theme-border);
    border-radius: 15px;

    background: var(--theme-surface);
}

.adaptive-nav a {
    padding: 8px 12px;

    border-radius: 10px;

    color: var(--theme-text-soft) !important;

    font-size: calc(12px * var(--font-scale));
    font-weight: 700;

    text-decoration: none;
}

.adaptive-nav a:hover {
    color: var(--theme-text) !important;

    background: var(--theme-surface-soft);
}


.adaptive-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 24px;

    margin-bottom: 18px;
    padding: 34px;

    border: 1px solid var(--theme-border);
    border-radius: 25px;

    background:
        radial-gradient(
            circle at 88% 10%,
            rgba(var(--theme-accent-rgb),.16),
            transparent 25rem
        ),
        var(--theme-surface);

    box-shadow: var(--theme-shadow-sm);
}

.adaptive-kicker {
    display: block;

    margin-bottom: 8px;

    color: var(--theme-accent-strong);

    font-size: calc(10px * var(--font-scale));
    font-weight: 800;

    letter-spacing: .13em;
    text-transform: uppercase;
}

.adaptive-hero h1 {
    margin: 0;

    font-size: calc(clamp(32px,4vw,45px) * var(--font-scale));
    letter-spacing: -.045em;
}

.adaptive-hero p {
    max-width: 680px;

    margin: 9px 0 0;

    color: var(--theme-text-soft);
}


.adaptive-hero-number {
    min-width: 145px;

    padding: 15px;

    border-radius: 15px;

    background: var(--theme-surface-soft);
}

.adaptive-hero-number span {
    display: block;

    color: var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));
    text-transform: uppercase;
}

.adaptive-hero-number strong {
    display: block;

    margin-top: 4px;

    font-size: calc(27px * var(--font-scale));
}


.adaptive-metrics {
    display: grid;
    grid-template-columns:
        repeat(4,minmax(0,1fr));

    gap: 10px;

    margin-bottom: 18px;
}

.adaptive-metrics.six {
    grid-template-columns:
        repeat(6,minmax(0,1fr));
}

.adaptive-metrics article {
    padding: 17px;

    border: 1px solid var(--theme-border);
    border-radius: 15px;

    background: var(--theme-surface);
}

.adaptive-metrics span {
    display: block;

    color: var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));
    text-transform: uppercase;
    letter-spacing: .06em;
}

.adaptive-metrics strong {
    display: block;

    margin-top: 5px;

    font-size: calc(23px * var(--font-scale));
}


.adaptive-mode-switch,
.adaptive-scope-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 18px;
    padding: 12px 14px;

    border: 1px solid var(--theme-border);
    border-radius: 14px;

    background: var(--theme-surface);
}

.adaptive-mode-switch > span {
    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
    font-weight: 700;
}

.adaptive-mode-switch > div,
.adaptive-scope-switch {
    gap: 5px;
}

.adaptive-mode-switch a,
.adaptive-scope-switch a {
    display: inline-flex;

    padding: 8px 11px;

    border-radius: 9px;

    color: var(--theme-text-soft) !important;

    font-size: calc(11px * var(--font-scale));
    font-weight: 750;

    text-decoration: none;
}

.adaptive-mode-switch a.is-active,
.adaptive-scope-switch a.is-active {
    color: var(--theme-accent-strong) !important;

    background: var(--theme-accent-soft);
}


.adaptive-practice-card,
.adaptive-feedback,
.adaptive-section,
.adaptive-next-card,
.adaptive-diagnostic-card {
    padding: 27px;

    border: 1px solid var(--theme-border);
    border-radius: 21px;

    background: var(--theme-surface);

    box-shadow: var(--theme-shadow-sm);
}


.adaptive-practice-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 24px;
}

.adaptive-pill,
.adaptive-reason {
    display: inline-flex;

    padding: 6px 9px;

    border-radius: 99px;

    font-size: calc(10px * var(--font-scale));
    font-weight: 750;
}

.adaptive-pill {
    color: var(--theme-text-soft);

    background: var(--theme-surface-soft);
}

.adaptive-reason {
    color: var(--theme-accent-strong);

    background: var(--theme-accent-soft);
}


.adaptive-learning-item {
    margin-bottom: 17px;
}

.adaptive-learning-item span {
    display: block;

    color: var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));
    text-transform: uppercase;
}

.adaptive-learning-item strong {
    display: block;

    margin-top: 3px;
}

.adaptive-question {
    max-width: 900px;

    margin-bottom: 23px;

    font-size: calc(clamp(19px,2.5vw,26px) * var(--font-scale));
    line-height: 1.45;
}


.adaptive-answer-form {
    display: grid;
    gap: 10px;
}

.adaptive-option {
    display: grid;
    grid-template-columns:
        20px 38px 1fr;

    align-items: center;

    gap: 9px;

    padding: 14px;

    border: 1px solid var(--theme-border);
    border-radius: 13px;

    background: var(--theme-surface-soft);

    cursor: pointer;
}

.adaptive-option:hover {
    border-color: var(--theme-accent);
}

.adaptive-option:has(input:checked) {
    border-color: var(--theme-accent);

    background: var(--theme-accent-soft);
}

.adaptive-option input {
    width: 17px;
    height: 17px;

    accent-color: var(--theme-accent-strong);
}

.adaptive-option > span {
    display: grid;
    place-items: center;

    width: 33px;
    height: 33px;

    border-radius: 9px;

    background: var(--theme-surface);

    font-size: calc(11px * var(--font-scale));
    font-weight: 800;
}

.adaptive-option > strong {
    font-size: calc(13px * var(--font-scale));
    font-weight: 600;
}


.adaptive-practice-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-top: 12px;
    padding-top: 18px;

    border-top: 1px solid var(--theme-border);
}

.adaptive-practice-footer div span {
    display: block;

    color: var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));
}

.adaptive-primary-action,
.adaptive-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 0 15px;

    border-radius: 11px;

    font: inherit;
    font-size: calc(12px * var(--font-scale));
    font-weight: 750;

    text-decoration: none;

    cursor: pointer;
}

.adaptive-primary-action {
    border: 0;

    color: #fff !important;

    background:
        linear-gradient(
            135deg,
            var(--theme-accent-grad-a),
            var(--theme-accent-grad-b)
        );
}

.adaptive-secondary-action {
    border: 1px solid var(--theme-border);

    color: var(--theme-text) !important;

    background: var(--theme-surface-soft);
}


.adaptive-empty {
    padding: 45px 25px;

    border: 1px dashed var(--theme-border-strong);
    border-radius: 19px;

    background: var(--theme-surface-soft);

    text-align: center;
}

.adaptive-empty.compact {
    padding: 25px;
}

.adaptive-empty-icon {
    display: grid;
    place-items: center;

    width: 50px;
    height: 50px;

    margin: 0 auto 15px;

    border-radius: 15px;

    color: var(--theme-accent-strong);

    background: var(--theme-accent-soft);

    font-size: calc(20px * var(--font-scale));
}

.adaptive-empty p {
    color: var(--theme-text-soft);
}


/* Feedback */

.adaptive-feedback {
    max-width: 900px;

    margin-inline: auto;
}

.adaptive-feedback-icon {
    display: grid;
    place-items: center;

    width: 55px;
    height: 55px;

    margin-bottom: 21px;

    border-radius: 16px;

    font-size: calc(24px * var(--font-scale));
    font-weight: 800;
}

.adaptive-feedback.is-correct .adaptive-feedback-icon {
    color: #188361;

    background: rgba(37,169,124,.12);
}

.adaptive-feedback.is-incorrect .adaptive-feedback-icon {
    color: #c85e57;

    background: rgba(214,91,83,.11);
}

.adaptive-feedback h1 {
    margin: 0;
}

.adaptive-feedback-question {
    color: var(--theme-text-soft);

    font-size: calc(16px * var(--font-scale));
}

.adaptive-feedback-grid,
.adaptive-feedback-progress {
    display: grid;
    grid-template-columns:
        repeat(2,1fr);

    gap: 10px;

    margin: 22px 0;
}

.adaptive-feedback-grid > div,
.adaptive-feedback-progress > div {
    padding: 16px;

    border-radius: 13px;

    background: var(--theme-surface-soft);
}

.adaptive-feedback-grid span,
.adaptive-feedback-progress span {
    display: block;

    margin-bottom: 5px;

    color: var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));
}

.adaptive-feedback-progress {
    grid-template-columns:
        repeat(3,1fr);
}

.adaptive-explanation {
    padding: 17px;

    border-left: 3px solid var(--theme-accent);
    border-radius: 10px;

    background: var(--theme-accent-soft);
}

.adaptive-explanation span {
    color: var(--theme-accent-strong);

    font-size: calc(10px * var(--font-scale));
    font-weight: 800;

    text-transform: uppercase;
}

.adaptive-explanation p {
    margin-bottom: 0;
}

.adaptive-feedback-actions {
    display: flex;
    gap: 8px;

    margin-top: 22px;
}


/* Sections */

.adaptive-section {
    margin-bottom: 18px;
}

.adaptive-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 18px;
}

.adaptive-section-heading h2 {
    margin: 0;
}

.adaptive-list {
    display: grid;
    gap: 9px;
}

.adaptive-list-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 15px;

    border: 1px solid var(--theme-border);
    border-radius: 13px;

    background: var(--theme-surface-soft);
}

.adaptive-list-card.subtle {
    opacity: .9;
}

.adaptive-list-card h3 {
    margin: 6px 0 3px;

    font-size: calc(14px * var(--font-scale));
}

.adaptive-list-card p {
    margin: 0;

    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
}

.adaptive-due-time,
.adaptive-error-count {
    flex: 0 0 auto;

    text-align: right;
}

.adaptive-due-time span,
.adaptive-error-count span {
    display: block;

    color: var(--theme-text-soft);

    font-size: calc(9px * var(--font-scale));
    text-transform: uppercase;
}

.adaptive-due-time strong,
.adaptive-error-count strong {
    display: block;

    margin-top: 3px;

    font-size: calc(12px * var(--font-scale));
}


.adaptive-two-column,
.adaptive-path-columns {
    display: grid;
    grid-template-columns:
        repeat(2,minmax(0,1fr));

    gap: 18px;
}


.adaptive-category-grid {
    display: grid;
    grid-template-columns:
        repeat(2,minmax(0,1fr));

    gap: 8px;
}

.adaptive-category-grid article {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 14px;

    border-radius: 12px;

    background: var(--theme-surface-soft);
}

.adaptive-category-grid span {
    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
}

.adaptive-category-grid strong {
    font-size: calc(18px * var(--font-scale));
}


/* Mastery */

.adaptive-mastery-card {
    position: relative;

    display: grid;
    grid-template-columns:
        1fr auto;

    gap: 12px;

    padding: 15px;

    border: 1px solid var(--theme-border);
    border-radius: 13px;

    background: var(--theme-surface-soft);
}

.adaptive-mastery-card h3 {
    margin: 0 0 3px;

    font-size: calc(13px * var(--font-scale));
}

.adaptive-mastery-card p {
    margin: 0;

    color: var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));
}

.adaptive-progress {
    grid-column: 1 / -1;

    height: 5px;

    overflow: hidden;

    border-radius: 99px;

    background: var(--theme-border);
}

.adaptive-progress span {
    display: block;

    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--theme-accent-grad-a),
            var(--theme-accent-grad-b)
        );
}


/* Recommendations */

.adaptive-next-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 25px;

    margin-bottom: 18px;

    background:
        radial-gradient(
            circle at 90% 20%,
            rgba(var(--theme-accent-rgb),.15),
            transparent 24rem
        ),
        var(--theme-surface);
}

.adaptive-next-card h2 {
    margin: 8px 0 4px;
}

.adaptive-next-card p {
    color: var(--theme-text-soft);
}

.adaptive-next-warning {
    display: inline-flex;

    padding: 7px 10px;

    border-radius: 9px;

    color: #bb7e27;

    background: rgba(211,154,58,.10);

    font-size: calc(10px * var(--font-scale));
    font-weight: 700;
}

.adaptive-recommend-grid {
    display: grid;
    grid-template-columns:
        repeat(3,minmax(0,1fr));

    gap: 10px;
}

.adaptive-recommend-grid article {
    padding: 17px;

    border: 1px solid var(--theme-border);
    border-radius: 14px;

    background: var(--theme-surface-soft);
}

.adaptive-recommend-grid header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;
}

.adaptive-recommend-grid header > strong {
    color: var(--theme-text-soft);

    font-size: calc(9px * var(--font-scale));
}

.adaptive-recommend-grid h3 {
    margin: 17px 0 5px;

    font-size: calc(14px * var(--font-scale));
}

.adaptive-recommend-grid p {
    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
}


/* Learning Path */

.adaptive-diagnostic-card {
    display: grid;
    grid-template-columns:
        1fr auto auto;

    align-items: center;

    gap: 30px;

    margin-bottom: 18px;
}

.adaptive-diagnostic-card h2 {
    margin: 0;
}

.adaptive-diagnostic-card > div:not(:first-child) span {
    display: block;

    color: var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));
}

.adaptive-diagnostic-card > div:not(:first-child) strong {
    display: block;

    margin-top: 3px;

    font-size: calc(20px * var(--font-scale));
}

.adaptive-path-list {
    display: grid;
    gap: 9px;
}

.adaptive-path-list article {
    display: grid;
    grid-template-columns:
        38px 1fr;

    gap: 11px;

    padding: 14px;

    border: 1px solid var(--theme-border);
    border-radius: 13px;

    background: var(--theme-surface-soft);
}

.adaptive-path-step {
    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;

    border-radius: 10px;

    color: var(--theme-accent-strong);

    background: var(--theme-accent-soft);

    font-size: calc(10px * var(--font-scale));
    font-weight: 800;
}

.adaptive-path-list h3 {
    margin: 7px 0 3px;

    font-size: calc(13px * var(--font-scale));
}

.adaptive-path-list p {
    margin: 0 0 7px;

    color: var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));
}


/* Dark */

html[data-theme="dark"] :where(
    .adaptive-hero,
    .adaptive-nav,
    .adaptive-practice-card,
    .adaptive-feedback,
    .adaptive-section,
    .adaptive-next-card,
    .adaptive-diagnostic-card,
    .adaptive-mode-switch,
    .adaptive-scope-switch
) {
    background:
        linear-gradient(
            180deg,
            #0d2235,
            #0b1b2d
        );
}


/* Responsive */

@media (max-width: 1050px) {

    .adaptive-metrics.six {
        grid-template-columns:
            repeat(3,1fr);
    }

    .adaptive-recommend-grid {
        grid-template-columns:
            repeat(2,1fr);
    }

}

@media (max-width: 760px) {

    .adaptive-hero,
    .adaptive-next-card,
    .adaptive-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .adaptive-metrics,
    .adaptive-metrics.six,
    .adaptive-two-column,
    .adaptive-path-columns,
    .adaptive-feedback-grid,
    .adaptive-feedback-progress {
        grid-template-columns:
            repeat(2,minmax(0,1fr));
    }

    .adaptive-recommend-grid {
        grid-template-columns: 1fr;
    }

    .adaptive-diagnostic-card {
        grid-template-columns: 1fr 1fr;
    }

    .adaptive-diagnostic-card > div:first-child {
        grid-column: 1 / -1;
    }

}

@media (max-width: 520px) {

    .adaptive-metrics,
    .adaptive-metrics.six,
    .adaptive-two-column,
    .adaptive-path-columns,
    .adaptive-feedback-grid,
    .adaptive-feedback-progress,
    .adaptive-category-grid {
        grid-template-columns: 1fr;
    }

    .adaptive-mode-switch {
        align-items: flex-start;
        flex-direction: column;
    }

    .adaptive-mode-switch > div {
        display: flex;
        flex-wrap: wrap;
    }

    .adaptive-practice-footer,
    .adaptive-list-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .adaptive-due-time,
    .adaptive-error-count {
        text-align: left;
    }

}

/* ==========================================================
   SEC-01A Secure Exam Controls
   ========================================================== */

.secure-preview-notice {
    display: flex;
    align-items: flex-start;

    gap: 14px;

    margin-top: 23px;
    padding: 16px;

    border: 1px solid rgba(211,154,58,.26);
    border-radius: 14px;

    background: rgba(211,154,58,.075);
}

.secure-preview-icon {
    display: grid;
    place-items: center;

    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    border-radius: 11px;

    color: #b77d22;

    background: rgba(211,154,58,.13);

    font-size: calc(12px * var(--font-scale));
    font-weight: 900;
}

.secure-preview-notice strong {
    color: var(--theme-text);
}

.secure-preview-notice p {
    margin: 4px 0 0;

    color: var(--theme-text-soft);

    font-size: calc(12px * var(--font-scale));
    line-height: 1.55;
}


.exam-secure-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 12px;
    padding: 11px 14px;

    border: 1px solid rgba(38,167,122,.23);
    border-radius: 13px;

    background: rgba(38,167,122,.07);
}

.exam-secure-banner > div:first-child {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;
}

.exam-secure-banner strong {
    font-size: calc(12px * var(--font-scale));
}

.exam-secure-banner span:not(
    .exam-secure-indicator
) {
    color: var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));
}

.exam-secure-indicator {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: #28ad80;

    box-shadow:
        0 0 0 4px
        rgba(40,173,128,.10);
}

.exam-secure-event-counter {
    color: var(--theme-text-soft);

    font-size: calc(9px * var(--font-scale));
    text-transform: uppercase;
    letter-spacing: .06em;

    white-space: nowrap;
}

.exam-secure-event-counter strong {
    display: inline-grid;
    place-items: center;

    min-width: 24px;
    height: 24px;

    margin-left: 6px;

    border-radius: 8px;

    color: var(--theme-text);

    background: var(--theme-surface-soft);

    font-size: calc(11px * var(--font-scale));
}


.secure-mode-overlay {
    position: fixed;
    z-index: 10000;

    inset: 0;

    display: grid;
    place-items: center;

    padding: 20px;

    background:
        rgba(3,13,22,.84);

    backdrop-filter:
        blur(13px);
}

.secure-mode-overlay[hidden] {
    display: none !important;
}

.secure-mode-dialog {
    width: min(
        560px,
        100%
    );

    padding: 34px;

    border: 1px solid var(--theme-border);
    border-radius: 24px;

    background: var(--theme-surface);

    box-shadow:
        0 35px 100px
        rgba(0,0,0,.35);
}

.secure-mode-shield {
    display: grid;
    place-items: center;

    width: 55px;
    height: 55px;

    margin-bottom: 21px;

    border-radius: 17px;

    color: #188361;

    background: rgba(37,169,124,.12);

    font-size: calc(18px * var(--font-scale));
    font-weight: 900;
}

.secure-mode-dialog h2 {
    margin: 0 0 10px;

    font-size: calc(28px * var(--font-scale));
}

.secure-mode-dialog > p {
    color: var(--theme-text-soft);

    line-height: 1.65;
}

.secure-mode-rules {
    display: grid;
    grid-template-columns:
        repeat(2,1fr);

    gap: 8px;

    margin: 22px 0;
}

.secure-mode-rules span {
    padding: 10px;

    border-radius: 10px;

    color: var(--theme-text-soft);

    background: var(--theme-surface-soft);

    font-size: calc(10px * var(--font-scale));
    font-weight: 700;
}

.secure-mode-dialog small {
    display: block;

    margin-top: 10px;

    color: var(--theme-text-faint);

    font-size: calc(9px * var(--font-scale));
}


.exam-security-toast {
    position: fixed;
    z-index: 11000;

    right: 24px;
    bottom: 24px;

    max-width: 370px;

    padding: 12px 15px;

    border: 1px solid rgba(220,105,96,.24);
    border-radius: 12px;

    color: #d66860;

    background: var(--theme-surface);

    box-shadow: var(--theme-shadow-lg);

    font-size: calc(11px * var(--font-scale));
    font-weight: 750;
}


/*
Best-effort browser hardening only.
This is not equivalent to a native lockdown browser.
*/

body.secure-exam-active
.secure-exam-content {
    -webkit-user-drag: none;
}

body.secure-exam-active
.secure-exam-content img {
    pointer-events: none;

    -webkit-user-drag: none;
}


@media print {

    body.secure-exam-active * {
        visibility: hidden !important;
    }

    body.secure-exam-active::before {
        content:
            "Printing is disabled for this secure AeroESP assessment.";

        position: fixed;

        inset: 0;

        display: grid;
        place-items: center;

        visibility: visible !important;

        font-size: calc(20px * var(--font-scale));
    }
}


html[data-theme="dark"]
.secure-mode-dialog {
    background:
        linear-gradient(
            180deg,
            #0d2235,
            #0b1b2d
        );
}


@media (max-width: 620px) {

    .exam-secure-banner {
        align-items: flex-start;
        flex-direction: column;
    }

    .secure-mode-dialog {
        padding: 27px 22px;
    }

    .secure-mode-rules {
        grid-template-columns: 1fr;
    }

}

/* ==========================================================
   UI-07 Analytics + Integrity
   ========================================================== */


/* Student analytics */

.analytics07-hero,
.integrity-hero,
.integrity-attempt-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 24px;

    margin-bottom: 18px;
    padding: 32px;

    border: 1px solid var(--theme-border);
    border-radius: 24px;

    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(var(--theme-accent-rgb),.15),
            transparent 24rem
        ),
        var(--theme-surface);

    box-shadow: var(--theme-shadow-sm);
}

.analytics07-hero h1,
.integrity-hero h1,
.integrity-attempt-hero h1 {
    margin: 0;

    font-size: calc(clamp(31px,4vw,44px) * var(--font-scale));
    letter-spacing: -.045em;
}

.analytics07-hero p,
.integrity-hero p,
.integrity-attempt-hero p {
    max-width: 720px;

    color: var(--theme-text-soft);
}


.analytics07-kpis,
.integrity-kpi-grid {
    display: grid;
    grid-template-columns:
        repeat(5,minmax(0,1fr));

    gap: 10px;

    margin-bottom: 18px;
}

.analytics07-kpis {
    grid-template-columns:
        repeat(3,minmax(0,1fr));
}

.integrity-kpi-grid.four {
    grid-template-columns:
        repeat(4,minmax(0,1fr));
}

.analytics07-kpis article,
.integrity-kpi-grid article {
    padding: 18px;

    border: 1px solid var(--theme-border);
    border-radius: 15px;

    background: var(--theme-surface);
}

.analytics07-kpis span,
.integrity-kpi-grid span {
    display: block;

    color: var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));
    text-transform: uppercase;
    letter-spacing: .07em;
}

.analytics07-kpis strong,
.integrity-kpi-grid strong {
    display: block;

    margin-top: 6px;

    font-size: calc(25px * var(--font-scale));
}

.analytics07-kpis small {
    color: var(--theme-text-faint);

    font-size: calc(10px * var(--font-scale));
}


.analytics07-section,
.integrity-section,
.integrity-review-panel {
    margin-bottom: 18px;
    padding: 24px;

    border: 1px solid var(--theme-border);
    border-radius: 19px;

    background: var(--theme-surface);

    box-shadow: var(--theme-shadow-sm);
}

.analytics07-heading,
.integrity-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 17px;
}

.analytics07-heading h2,
.integrity-section-heading h2 {
    margin: 0;
}


.analytics07-program-grid,
.analytics07-columns {
    display: grid;
    grid-template-columns:
        repeat(2,minmax(0,1fr));

    gap: 12px;
}

.analytics07-program-grid > article {
    padding: 20px;

    border: 1px solid var(--theme-border);
    border-radius: 16px;

    background: var(--theme-surface-soft);
}

.analytics07-score {
    margin-top: 18px;

    font-size: calc(34px * var(--font-scale));
    font-weight: 800;
}

.analytics07-program-grid > article > span:not(.adaptive-pill) {
    color: var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));
}

.analytics07-bar {
    height: 7px;

    margin: 11px 0;

    overflow: hidden;

    border-radius: 99px;

    background: var(--theme-border);
}

.analytics07-bar span {
    display: block;

    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--theme-accent-grad-a),
            var(--theme-accent-grad-b)
        );
}

.analytics07-mini-grid {
    display: grid;
    grid-template-columns:
        repeat(3,1fr);

    gap: 8px;

    margin-top: 15px;
}

.analytics07-mini-grid div {
    padding: 10px;

    border-radius: 10px;

    background: var(--theme-surface);
}

.analytics07-mini-grid span,
.analytics07-placement span {
    display: block;

    color: var(--theme-text-soft);

    font-size: calc(9px * var(--font-scale));
}

.analytics07-mini-grid strong {
    display: block;

    margin-top: 3px;
}


.analytics07-placement {
    display: grid;
    grid-template-columns:
        repeat(6,minmax(0,1fr));

    gap: 8px;
}

.analytics07-placement article {
    padding: 15px;

    border-radius: 13px;

    background: var(--theme-surface-soft);
}

.analytics07-placement strong {
    display: block;

    margin-top: 5px;

    font-size: calc(19px * var(--font-scale));
}


.analytics07-error-list {
    display: grid;
    gap: 7px;
}

.analytics07-error-list article {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 13px;

    border-radius: 11px;

    background: var(--theme-surface-soft);
}

.analytics07-error-list span {
    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
}


.analytics07-domain-grid {
    display: grid;
    grid-template-columns:
        repeat(3,minmax(0,1fr));

    gap: 9px;
}

.analytics07-domain-grid article {
    padding: 15px;

    border: 1px solid var(--theme-border);
    border-radius: 13px;

    background: var(--theme-surface-soft);
}

.analytics07-domain-grid header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;
}

.analytics07-domain-grid h3 {
    margin: 0;

    font-size: calc(12px * var(--font-scale));
}

.analytics07-domain-meta {
    display: flex;
    justify-content: space-between;

    gap: 10px;

    color: var(--theme-text-soft);

    font-size: calc(9px * var(--font-scale));
}


.analytics07-topic-list {
    display: grid;
    gap: 7px;
}

.analytics07-topic-list article {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 13px;

    border-radius: 11px;

    background: var(--theme-surface-soft);
}

.analytics07-topic-list div > span {
    display: block;

    margin-top: 3px;

    color: var(--theme-text-soft);

    font-size: calc(9px * var(--font-scale));
}

.analytics07-topic-score {
    font-size: calc(16px * var(--font-scale));
    font-weight: 800;
}


/* Integrity */

.integrity-entry-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 22px;

    margin-bottom: 18px;
    padding: 18px;

    border: 1px solid rgba(38,167,122,.22);
    border-radius: 15px;

    background: rgba(38,167,122,.06);
}

.integrity-entry-banner h3 {
    margin: 3px 0;
}

.integrity-entry-banner p {
    margin: 0;

    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
}


.integrity-exam-grid {
    display: grid;
    grid-template-columns:
        repeat(3,minmax(0,1fr));

    gap: 10px;
}

.integrity-exam-card {
    padding: 18px;

    border: 1px solid var(--theme-border);
    border-radius: 15px;

    background: var(--theme-surface-soft);
}

.integrity-exam-card h3 {
    margin: 13px 0;
}

.integrity-mini-metrics {
    display: grid;
    grid-template-columns:
        repeat(3,1fr);

    gap: 6px;

    margin-bottom: 15px;
}

.integrity-mini-metrics div {
    padding: 9px;

    border-radius: 9px;

    background: var(--theme-surface);
}

.integrity-mini-metrics span {
    display: block;

    color: var(--theme-text-soft);

    font-size: calc(8px * var(--font-scale));
}

.integrity-mini-metrics strong {
    display: block;

    margin-top: 2px;
}


.integrity-table-shell {
    overflow-x: auto;

    border: 1px solid var(--theme-border);
    border-radius: 14px;
}

.integrity-table {
    width: 100%;

    border-collapse: collapse;
}

.integrity-table th,
.integrity-table td {
    padding: 12px 13px;

    border-bottom: 1px solid var(--theme-border);

    text-align: left;

    font-size: calc(11px * var(--font-scale));
}

.integrity-table th {
    color: var(--theme-text-soft);

    background: var(--theme-surface-soft);

    font-size: calc(9px * var(--font-scale));
    text-transform: uppercase;
    letter-spacing: .06em;
}

.integrity-table tr:last-child td {
    border-bottom: 0;
}


.integrity-risk {
    display: inline-flex;

    padding: 6px 9px;

    border-radius: 99px;

    font-size: calc(9px * var(--font-scale));
    font-weight: 800;
}

.integrity-risk-low {
    color: #188361;

    background: rgba(37,169,124,.11);
}

.integrity-risk-medium {
    color: #b97a22;

    background: rgba(211,154,58,.11);
}

.integrity-risk-high {
    color: #c45750;

    background: rgba(214,91,83,.11);
}


.integrity-score-card {
    min-width: 130px;

    padding: 17px;

    border-radius: 17px;

    text-align: center;
}

.integrity-score-card span,
.integrity-score-card small {
    display: block;

    font-size: calc(9px * var(--font-scale));
}

.integrity-score-card strong {
    display: block;

    margin: 3px 0;

    font-size: calc(33px * var(--font-scale));
}

.integrity-score-low {
    color: #188361;

    background: rgba(37,169,124,.10);
}

.integrity-score-medium {
    color: #b97a22;

    background: rgba(211,154,58,.10);
}

.integrity-score-high {
    color: #c45750;

    background: rgba(214,91,83,.10);
}


.integrity-reason-grid {
    display: grid;
    grid-template-columns:
        repeat(5,minmax(0,1fr));

    gap: 8px;
}

.integrity-reason-grid article {
    padding: 13px;

    border-radius: 12px;

    background: var(--theme-surface-soft);
}

.integrity-reason-grid span {
    display: block;

    min-height: 30px;

    color: var(--theme-text-soft);

    font-size: calc(9px * var(--font-scale));
}

.integrity-reason-grid strong {
    display: block;

    margin-top: 4px;

    font-size: calc(20px * var(--font-scale));
}

.integrity-reason-grid small {
    color: var(--theme-text-faint);

    font-size: calc(8px * var(--font-scale));
}


.integrity-timeline {
    display: grid;
    gap: 0;
}

.integrity-timeline article {
    position: relative;

    display: grid;
    grid-template-columns:
        20px 1fr;

    gap: 12px;

    padding-bottom: 20px;
}

.integrity-timeline article:not(:last-child)::before {
    content: "";

    position: absolute;

    left: 5px;
    top: 13px;
    bottom: 0;

    width: 1px;

    background: var(--theme-border);
}

.integrity-timeline-dot {
    position: relative;
    z-index: 1;

    width: 11px;
    height: 11px;

    margin-top: 4px;

    border-radius: 50%;

    background: var(--theme-accent);

    box-shadow:
        0 0 0 4px
        var(--theme-accent-soft);
}

.integrity-timeline header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;
}

.integrity-timeline time {
    color: var(--theme-text-soft);

    font-size: calc(9px * var(--font-scale));
}

.integrity-timeline p {
    margin: 6px 0;

    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
}

.integrity-event-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 5px;
}

.integrity-event-meta span {
    padding: 4px 7px;

    border-radius: 7px;

    color: var(--theme-text-soft);

    background: var(--theme-surface-soft);

    font-size: calc(8px * var(--font-scale));
}


.integrity-review-panel {
    display: grid;
    grid-template-columns:
        minmax(0,.75fr)
        minmax(0,1.25fr);

    gap: 28px;
}

.integrity-review-panel h2 {
    margin-top: 0;
}

.integrity-review-panel p {
    color: var(--theme-text-soft);
}

.integrity-review-panel form {
    display: grid;
    gap: 13px;
}

.integrity-review-panel label {
    display: grid;
    gap: 5px;

    color: var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));
    font-weight: 700;
}

.integrity-review-panel select,
.integrity-review-panel textarea {
    width: 100%;

    padding: 11px;

    border: 1px solid var(--theme-border);
    border-radius: 10px;

    color: var(--theme-text);

    background: var(--theme-surface-soft);

    font: inherit;
}

.integrity-review-history {
    grid-column: 1 / -1;

    padding-top: 12px;

    border-top: 1px solid var(--theme-border);

    color: var(--theme-text-soft);

    font-size: calc(9px * var(--font-scale));
}


.integrity-method-note {
    padding: 16px;

    border-left: 3px solid var(--theme-accent);
    border-radius: 10px;

    color: var(--theme-text-soft);

    background: var(--theme-accent-soft);

    font-size: calc(11px * var(--font-scale));
}

.integrity-method-note p {
    margin-bottom: 0;
}


.teacher-analytics-actions {
    margin-top: 18px;
}


/* Dark */

html[data-theme="dark"] :where(
    .analytics07-hero,
    .analytics07-section,
    .integrity-hero,
    .integrity-attempt-hero,
    .integrity-section,
    .integrity-review-panel
) {
    background:
        linear-gradient(
            180deg,
            #0d2235,
            #0b1b2d
        );
}


/* Responsive */

@media (max-width: 1050px) {

    .integrity-kpi-grid {
        grid-template-columns:
            repeat(3,1fr);
    }

    .analytics07-placement {
        grid-template-columns:
            repeat(3,1fr);
    }

    .analytics07-domain-grid,
    .integrity-exam-grid {
        grid-template-columns:
            repeat(2,1fr);
    }

    .integrity-reason-grid {
        grid-template-columns:
            repeat(3,1fr);
    }

}

@media (max-width: 760px) {

    .analytics07-hero,
    .integrity-hero,
    .integrity-attempt-hero,
    .integrity-entry-banner,
    .analytics07-heading,
    .integrity-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .analytics07-kpis,
    .integrity-kpi-grid,
    .integrity-kpi-grid.four,
    .analytics07-program-grid,
    .analytics07-columns,
    .integrity-review-panel {
        grid-template-columns:
            repeat(2,minmax(0,1fr));
    }

    .integrity-review-panel {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 520px) {

    .analytics07-kpis,
    .integrity-kpi-grid,
    .integrity-kpi-grid.four,
    .analytics07-program-grid,
    .analytics07-columns,
    .analytics07-placement,
    .analytics07-domain-grid,
    .integrity-exam-grid,
    .integrity-reason-grid {
        grid-template-columns: 1fr;
    }

    .analytics07-mini-grid {
        grid-template-columns: 1fr 1fr;
    }

}

/* ==========================================================
   UI-08 — Final Product Polish
   ========================================================== */


/* ----------------------------------------------------------
   Accessibility
   ---------------------------------------------------------- */

.skip-link {
    position: fixed;
    z-index: 20000;

    left: 16px;
    top: 14px;

    transform: translateY(-180%);

    padding: 10px 14px;

    border-radius: 10px;

    color: #ffffff !important;
    background: var(--theme-accent-grad-a);

    font-size: calc(12px * var(--font-scale));
    font-weight: 800;

    text-decoration: none;

    transition:
        transform 150ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}


.sr-only {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    padding: 0 !important;
    margin: -1px !important;

    overflow: hidden !important;

    clip: rect(0,0,0,0) !important;

    white-space: nowrap !important;

    border: 0 !important;
}


button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline:
        3px solid
        rgba(var(--theme-accent-rgb),.35);

    outline-offset: 3px;
}


#main-content:focus {
    outline: none;
}


/* ----------------------------------------------------------
   Public shell
   ---------------------------------------------------------- */

.aeroesp-public {
    min-height: 100vh;

    color: var(--theme-text);

    background:
        radial-gradient(
            circle at 82% 4%,
            rgba(var(--theme-accent-rgb),.13),
            transparent 34rem
        ),
        radial-gradient(
            circle at 8% 70%,
            rgba(232,182,106,.08),
            transparent 32rem
        ),
        var(--theme-bg);
}

.public-shell {
    min-height: 100vh;

    display: flex;
    flex-direction: column;
}


.public-header {
    position: sticky;
    z-index: 1000;

    top: 0;

    border-bottom:
        1px solid var(--theme-border);

    background:
        color-mix(
            in srgb,
            var(--theme-bg) 84%,
            transparent
        );

    backdrop-filter:
        blur(20px)
        saturate(140%);

    -webkit-backdrop-filter:
        blur(20px)
        saturate(140%);
}

.public-header-inner {
    width: min(
        calc(100% - 40px),
        1240px
    );

    min-height: 76px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 22px;
}


.public-brand {
    display: inline-flex;
    align-items: center;

    gap: 10px;

    min-width: 0;

    color: var(--theme-text) !important;

    text-decoration: none;
}

.public-brand img {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;
}

.public-brand > span {
    display: flex;
    flex-direction: column;

    line-height: 1.05;
}

.public-brand strong {
    font-size: calc(16px * var(--font-scale));
    font-weight: 850;

    letter-spacing: -.04em;
}

.public-brand strong span {
    color: var(--theme-accent-strong);
}

.public-brand small {
    margin-top: 4px;

    color: var(--theme-text-faint);

    font-size: calc(7px * var(--font-scale));
    font-weight: 750;

    letter-spacing: .10em;
    text-transform: uppercase;
}


.public-nav-actions {
    display: flex;
    align-items: center;

    gap: 7px;
}


.public-main {
    width: min(
        calc(100% - 64px),
        1440px
    );

    flex: 1;

    margin: 0 auto;

    padding:
        58px 0
        90px;
}


.public-message-stack {
    display: grid;
    gap: 8px;

    margin-bottom: 20px;
}


.public-footer {
    width: min(
        calc(100% - 64px),
        1440px
    );

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 30px 0;

    border-top:
        1px solid var(--theme-border);

    color: var(--theme-text-faint);

    font-size: calc(10px * var(--font-scale));
}

.public-footer > div:first-child {
    display: flex;
    align-items: center;

    gap: 8px;
}

.public-footer strong {
    color: var(--theme-text);

    font-size: calc(12px * var(--font-scale));
}


/* ----------------------------------------------------------
   Public buttons
   ---------------------------------------------------------- */

.public-button {
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 15px;

    border:
        1px solid transparent;

    border-radius: 11px;

    font-size: calc(11px * var(--font-scale));
    font-weight: 780;

    text-decoration: none;

    cursor: pointer;

    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background 150ms ease,
        box-shadow 150ms ease;
}

.public-button:hover {
    transform: translateY(-1px);
}

.public-button-primary {
    color: #ffffff !important;

    background:
        linear-gradient(
            135deg,
            var(--theme-accent-grad-a),
            var(--theme-accent-grad-b)
        );

    box-shadow:
        0 8px 22px
        rgba(var(--theme-accent-strong-rgb),.17);
}

.public-button-primary:hover {
    box-shadow:
        0 13px 30px
        rgba(var(--theme-accent-strong-rgb),.25);
}

.public-button-secondary {
    color: var(--theme-text) !important;

    border-color:
        var(--theme-border);

    background:
        var(--theme-surface);
}

.public-button-secondary:hover {
    background:
        var(--theme-surface-soft);
}

.public-button-large {
    min-height: 50px;

    padding: 0 20px;

    border-radius: 13px;

    font-size: calc(12px * var(--font-scale));
}


/* ----------------------------------------------------------
   Landing hero
   ---------------------------------------------------------- */

.public-hero {
    display: grid;

    grid-template-columns:
        minmax(0, 1.12fr)
        minmax(330px, .72fr);

    gap:
        clamp(35px, 6vw, 85px);

    align-items: center;

    min-height:
        min(
            680px,
            calc(100vh - 140px)
        );

    padding:
        25px 0
        70px;
}


.public-eyebrow,
.public-panel-kicker {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    color: var(--theme-accent-strong);

    font-size: calc(9px * var(--font-scale));
    font-weight: 850;

    letter-spacing: .12em;
    text-transform: uppercase;
}

.public-eyebrow::before {
    content: "";

    width: 22px;
    height: 1px;

    background:
        var(--theme-accent);
}


.public-hero h1 {
    max-width: 780px;

    margin:
        17px 0
        20px;

    color: var(--theme-text);

    font-size:
        calc(clamp(
            45px,
            6.5vw,
            82px
        ) * var(--font-scale));

    line-height: .98;

    letter-spacing: -.06em;

    font-weight: 780;
}

.public-hero h1 > span {
    color:
        var(--theme-accent-strong);
}


.public-hero-copy > p {
    max-width: 690px;

    margin:
        0 0
        28px;

    color: var(--theme-text-soft);

    font-size:
        calc(clamp(
            15px,
            1.5vw,
            18px
        ) * var(--font-scale));

    line-height: 1.75;
}


.public-hero-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 9px;
}


.public-hero-signals {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: 38px;
    padding-top: 25px;

    border-top:
        1px solid var(--theme-border);
}

.public-hero-signals > div {
    min-width: 130px;
}

.public-hero-signals strong {
    display: block;

    color: var(--theme-text);

    font-size: calc(11px * var(--font-scale));
}

.public-hero-signals span {
    display: block;

    margin-top: 2px;

    color: var(--theme-text-faint);

    font-size: calc(9px * var(--font-scale));
}


/* ----------------------------------------------------------
   Aerospace visual
   ---------------------------------------------------------- */

.public-flight-panel {
    position: relative;

    overflow: hidden;

    min-height: 500px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding: 30px;

    border:
        1px solid
        rgba(var(--theme-accent-rgb),.19);

    border-radius:
        38px 38px
        38px 13px;

    color: #ffffff;

    background:
        radial-gradient(
            circle at 75% 20%,
            rgba(var(--theme-accent-rgb),.22),
            transparent 17rem
        ),
        linear-gradient(
            145deg,
            #071f31,
            #0b3851 62%,
            #105974
        );

    box-shadow:
        0 34px 80px
        rgba(5,30,45,.18);
}

.public-flight-panel::after {
    content: "";

    position: absolute;

    width: 280px;
    height: 100px;

    left: -65px;
    bottom: 110px;

    border-radius: 50%;

    background:
        rgba(234,193,142,.11);

    filter: blur(12px);

    transform: rotate(-11deg);
}


.public-flight-orbit {
    position: relative;
    z-index: 1;

    width: 260px;
    height: 260px;

    margin:
        10px auto
        35px;

    border:
        1px solid
        rgba(255,255,255,.12);

    border-radius: 50%;
}

.public-flight-orbit::before {
    content: "";

    position: absolute;

    inset: 38px;

    border:
        1px solid
        rgba(255,255,255,.09);

    border-radius: 50%;
}

.public-flight-orbit::after {
    content: "";

    position: absolute;

    left: 50%;
    top: -2px;

    width: 55%;
    height: 55%;

    border-top:
        1px solid var(--theme-accent);

    border-radius: 50%;

    transform:
        rotate(24deg)
        translateX(-10%);
}


.public-flight-core {
    position: absolute;

    left: 50%;
    top: 50%;

    width: 78px;
    height: 78px;

    display: grid;
    place-items: center;

    transform:
        translate(-50%, -50%);

    border-radius: 24px;

    color: #062339;

    background:
        linear-gradient(
            145deg,
            #b5effd,
            var(--theme-accent)
        );

    box-shadow:
        0 18px 45px
        rgba(var(--theme-accent-rgb),.27);

    font-size: calc(27px * var(--font-scale));
    font-weight: 900;
}


.orbit-node {
    position: absolute;

    padding: 7px 10px;

    border:
        1px solid
        rgba(255,255,255,.10);

    border-radius: 99px;

    color:
        rgba(255,255,255,.70);

    background:
        rgba(255,255,255,.06);

    font-size: calc(8px * var(--font-scale));
    font-weight: 750;

    backdrop-filter: blur(8px);
}

.orbit-node-one {
    left: -16px;
    top: 74px;
}

.orbit-node-two {
    right: -12px;
    top: 122px;
}

.orbit-node-three {
    left: 92px;
    bottom: -10px;
}


.public-flight-copy {
    position: relative;
    z-index: 1;
}

.public-flight-copy h2 {
    margin:
        8px 0
        7px;

    color: #ffffff;

    font-size: calc(29px * var(--font-scale));
}

.public-flight-copy p {
    margin: 0;

    color:
        rgba(255,255,255,.62);

    font-size: calc(12px * var(--font-scale));
    line-height: 1.7;
}


/* ----------------------------------------------------------
   Landing sections
   ---------------------------------------------------------- */

.public-trust-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 13px;

    margin-bottom: 90px;
    padding: 16px 20px;

    border-top:
        1px solid var(--theme-border);

    border-bottom:
        1px solid var(--theme-border);

    color: var(--theme-text-faint);

    font-size: calc(9px * var(--font-scale));
    font-weight: 750;

    text-transform: uppercase;

    letter-spacing: .08em;
}

.public-trust-strip i {
    width: 3px;
    height: 3px;

    border-radius: 50%;

    background:
        var(--theme-accent);
}


.public-section {
    margin-bottom: 100px;
}

.public-section-heading {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(280px, .6fr);

    gap: 35px;

    align-items: end;

    margin-bottom: 33px;
}

.public-section-heading h2,
.public-split-section h2,
.public-final-cta h2 {
    margin:
        9px 0
        0;

    color: var(--theme-text);

    font-size:
        calc(clamp(
            29px,
            4vw,
            50px
        ) * var(--font-scale));

    line-height: 1.06;

    letter-spacing: -.045em;
}

.public-section-heading > p {
    margin: 0;

    color: var(--theme-text-soft);

    font-size: calc(13px * var(--font-scale));
    line-height: 1.7;
}


.public-feature-grid {
    display: grid;

    grid-template-columns:
        repeat(
            4,
            minmax(0,1fr)
        );

    gap: 11px;
}

.public-feature-grid article {
    min-height: 245px;

    padding: 23px;

    border:
        1px solid
        var(--theme-border);

    border-radius:
        21px 21px
        21px 8px;

    background:
        var(--theme-surface);

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        border-color var(--transition);
}

.public-feature-grid article:hover {
    transform:
        translateY(-4px);

    border-color:
        rgba(var(--theme-accent-rgb),.25);

    box-shadow:
        var(--theme-shadow-md);
}

.public-card-index {
    display: inline-grid;
    place-items: center;

    width: 36px;
    height: 36px;

    margin-bottom: 45px;

    border-radius: 11px;

    color: var(--theme-accent-strong);

    background:
        var(--theme-accent-soft);

    font-size: calc(9px * var(--font-scale));
    font-weight: 850;
}

.public-feature-grid h3 {
    margin:
        0 0
        7px;

    color: var(--theme-text);

    font-size: calc(18px * var(--font-scale));
}

.public-feature-grid p {
    margin: 0;

    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
    line-height: 1.7;
}


.public-split-section {
    display: grid;

    grid-template-columns:
        minmax(0, .8fr)
        minmax(340px, 1fr);

    gap:
        clamp(35px, 7vw, 90px);

    align-items: center;

    margin-bottom: 100px;
    padding:
        clamp(
            30px,
            5vw,
            55px
        );

    border:
        1px solid
        var(--theme-border);

    border-radius: 31px;

    background:
        var(--theme-surface);

    box-shadow:
        var(--theme-shadow-sm);
}

.public-split-section p {
    color: var(--theme-text-soft);

    line-height: 1.75;
}

.public-text-link {
    display: inline-flex;

    margin-top: 10px;

    color:
        var(--theme-accent-strong) !important;

    font-size: calc(11px * var(--font-scale));
    font-weight: 800;

    text-decoration: none;
}


.public-system-stack {
    display: grid;
    gap: 8px;
}

.public-system-stack article {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 18px;

    border-radius: 14px;

    background:
        var(--theme-surface-soft);
}

.public-system-stack span {
    color:
        var(--theme-text-faint);

    font-size: calc(9px * var(--font-scale));
    font-weight: 800;

    letter-spacing: .08em;
    text-transform: uppercase;
}

.public-system-stack strong {
    color:
        var(--theme-text);

    font-size: calc(12px * var(--font-scale));
}


.public-final-cta {
    overflow: hidden;
    position: relative;

    margin-bottom: 45px;
    padding:
        clamp(
            38px,
            6vw,
            70px
        );

    border-radius:
        34px 34px
        34px 11px;

    color: #ffffff;

    background:
        radial-gradient(
            circle at 84% 20%,
            rgba(var(--theme-accent-rgb),.22),
            transparent 24rem
        ),
        linear-gradient(
            135deg,
            #071f30,
            #0b415a
        );
}

.public-final-cta h2 {
    max-width: 760px;

    color: #ffffff;
}

.public-final-cta p {
    max-width: 620px;

    color:
        rgba(255,255,255,.62);

    line-height: 1.7;
}


/* ----------------------------------------------------------
   Login
   ---------------------------------------------------------- */

.auth-layout {
    width: min(
        100%,
        950px
    );

    min-height: 590px;

    margin: 25px auto;

    display: grid;

    grid-template-columns:
        minmax(0, .95fr)
        minmax(360px, .70fr);

    border:
        1px solid
        var(--theme-border);

    border-radius:
        31px;

    overflow: hidden;

    background:
        var(--theme-surface);

    box-shadow:
        var(--theme-shadow-lg);
}


.auth-story {
    position: relative;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding:
        clamp(
            35px,
            6vw,
            65px
        );

    color: #ffffff;

    background:
        radial-gradient(
            circle at 80% 15%,
            rgba(var(--theme-accent-rgb),.23),
            transparent 21rem
        ),
        linear-gradient(
            145deg,
            #071f30,
            #0c4560
        );
}

.auth-story::after {
    content: "";

    position: absolute;

    width: 260px;
    height: 80px;

    left: -70px;
    bottom: 55px;

    border-radius: 50%;

    background:
        rgba(237,202,158,.12);

    filter: blur(10px);

    transform: rotate(-11deg);
}

.auth-story > * {
    position: relative;
    z-index: 1;
}

.auth-story h1 {
    max-width: 520px;

    margin:
        15px 0;

    color: #ffffff;

    font-size:
        calc(clamp(
            35px,
            5vw,
            55px
        ) * var(--font-scale));

    line-height: 1.03;

    letter-spacing: -.05em;
}

.auth-story > p {
    max-width: 540px;

    color:
        rgba(255,255,255,.65);

    line-height: 1.75;
}


.auth-story-grid {
    display: grid;
    grid-template-columns:
        repeat(2,1fr);

    gap: 8px;

    margin-top: 35px;
}

.auth-story-grid > div {
    padding: 15px;

    border:
        1px solid
        rgba(255,255,255,.09);

    border-radius: 13px;

    background:
        rgba(255,255,255,.05);
}

.auth-story-grid strong,
.auth-story-grid span {
    display: block;
}

.auth-story-grid strong {
    color: #ffffff;

    font-size: calc(11px * var(--font-scale));
}

.auth-story-grid span {
    margin-top: 4px;

    color:
        rgba(255,255,255,.51);

    font-size: calc(9px * var(--font-scale));
    line-height: 1.55;
}


.auth-card {
    display: flex;
    flex-direction: column;
    justify-content: center;

    padding:
        clamp(
            28px,
            4vw,
            42px
        );

    background:
        var(--theme-surface);
}

.auth-card-brand {
    margin-bottom: 28px;
}

.auth-card-brand h2 {
    margin:
        6px 0
        5px;

    color:
        var(--theme-text);

    font-size: calc(31px * var(--font-scale));

    letter-spacing: -.04em;
}

.auth-card-brand p {
    margin: 0;

    color:
        var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
}


.auth-field {
    margin-bottom: 17px;
}

.auth-field label {
    color:
        var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));

    font-weight: 800;

    letter-spacing: .04em;
}

.auth-field input {
    min-height:49px;

    border-radius:14px;

    padding-left:15px;

    background:
        var(--theme-surface-soft);
}


.auth-submit {
    width: 100%;
    min-height: 49px;

    border: 0;
    border-radius: 12px;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            var(--theme-accent-grad-a),
            var(--theme-accent-grad-b)
        );

    cursor: pointer;

    font: inherit;
    font-size: calc(12px * var(--font-scale));
    font-weight: 800;

    box-shadow:
        0 9px 23px
        rgba(var(--theme-accent-strong-rgb),.19);
}

.auth-submit:hover {
    filter:
        brightness(1.04);
}


.auth-error {
    margin-bottom: 20px;
    padding: 12px;

    border:
        1px solid
        rgba(207,81,75,.15);

    border-radius: 10px;

    color: #bb4d49;

    background:
        rgba(207,81,75,.08);

    font-size: calc(10px * var(--font-scale));
    line-height: 1.55;
}


.auth-security-note {
    display: flex;
    align-items: center;

    gap: 7px;

    margin-top: 24px;
    padding-top: 18px;

    border-top:
        1px solid
        var(--theme-border);

    color:
        var(--theme-text-faint);

    font-size: calc(9px * var(--font-scale));
}

/* =========================================================
   Registration captcha
   =========================================================
   The challenge is a PNG, so it cannot follow the theme on its own -
   the widget requests a light or dark rendering and the plate below
   gives it the same rounded, recessed surface as the form inputs.
*/

.captcha-widget {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.captcha-plate {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 10px;

    border: 1px solid var(--theme-border);
    border-radius: 14px;

    background: var(--theme-surface-soft);
}

.captcha-image {
    display: block;

    max-width: 100%;
    height: auto;

    border-radius: 8px;

    /* The glyphs are the point; stop the browser smoothing them away
       on high-density screens. */
    image-rendering: -webkit-optimize-contrast;
}

.captcha-refresh {
    position: absolute;
    top: 8px;
    right: 8px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;
    padding: 0;

    border: 1px solid var(--theme-border);
    border-radius: 9px;

    color: var(--theme-text-soft);
    background: var(--theme-surface);

    cursor: pointer;
}

.captcha-refresh svg {
    width: 15px;
    height: 15px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.captcha-refresh:hover {
    color: var(--theme-accent-strong);
    border-color: var(--theme-border-strong);
}

.captcha-refresh:focus-visible {
    outline: 2px solid var(--theme-accent);
    outline-offset: 2px;
}

/* The answer box is a normal auth input; the hidden key must not
   inherit the input sizing and leave a gap. */
.captcha-widget input[type="hidden"] {
    display: none;
}


/* Inline "Resend code" action: a POST form styled as a link. */
.auth-link-button {
    padding: 0;

    background: none;
    border: 0;

    color: var(--theme-accent, inherit);

    font-size: inherit;
    font-family: inherit;

    text-decoration: underline;
    cursor: pointer;
}

.auth-security-dot {
    width: 7px;
    height: 7px;

    flex: 0 0 7px;

    border-radius: 50%;

    background: #28ad80;

    box-shadow:
        0 0 0 4px
        rgba(40,173,128,.10);
}


/* ----------------------------------------------------------
   Status / error pages
   ---------------------------------------------------------- */

.status-page,
.error-page {
    width: min(
        100%,
        760px
    );

    min-height: 540px;

    margin: 15px auto;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;

    padding:
        clamp(
            32px,
            6vw,
            65px
        );

    border:
        1px solid
        var(--theme-border);

    border-radius:
        31px;

    background:
        radial-gradient(
            circle at 88% 10%,
            rgba(var(--theme-accent-rgb),.14),
            transparent 23rem
        ),
        var(--theme-surface);

    box-shadow:
        var(--theme-shadow-md);
}

.status-code,
.error-number {
    display: grid;
    place-items: center;

    width: 68px;
    height: 68px;

    margin-bottom: 25px;

    border-radius: 20px;

    color:
        var(--theme-accent-strong);

    background:
        var(--theme-accent-soft);

    font-size: calc(17px * var(--font-scale));
    font-weight: 900;
}

.error-number {
    width: auto;
    height: auto;

    display: block;

    margin-bottom: 18px;

    color:
        var(--theme-accent-strong);

    background: transparent;

    font-size:
        calc(clamp(
            54px,
            9vw,
            95px
        ) * var(--font-scale));

    line-height: 1;

    letter-spacing: -.07em;
}

.status-code-pending {
    color: #b77d22;

    background:
        rgba(211,154,58,.11);
}


.status-page h1,
.error-page h1 {
    max-width: 650px;

    margin:
        12px 0;

    color:
        var(--theme-text);

    font-size:
        calc(clamp(
            30px,
            5vw,
            48px
        ) * var(--font-scale));

    line-height: 1.05;

    letter-spacing: -.045em;
}

.status-page > p,
.error-page > p {
    max-width: 610px;

    color:
        var(--theme-text-soft);

    line-height: 1.75;
}

.status-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: 22px;
}

.status-actions form {
    margin: 0;
}


/* ----------------------------------------------------------
   Global responsive stabilization
   ---------------------------------------------------------- */

.app-content,
.app-grid > *,
.cards > *,
.teacher-class-grid > *,
.analytics07-columns > *,
.adaptive-two-column > * {
    min-width: 0;
}


.exam-table-shell,
.integrity-table-shell,
.table-wrap {
    max-width: 100%;

    overflow-x: auto;
}


.workspace-nav {
    scrollbar-width: thin;
}


pre {
    max-width: 100%;

    overflow-x: auto;
}


/* Tablet */

@media (max-width: 980px) {

    .public-feature-grid {
        grid-template-columns:
            repeat(2,1fr);
    }

    .public-hero {
        grid-template-columns:
            1fr 340px;

        gap: 35px;
    }

}


/* Mobile */

@media (max-width: 760px) {

    .public-header-inner,
    .public-main,
    .public-footer {
        width:
            min(
                calc(100% - 28px),
                1240px
            );
    }

    .public-header-inner {
        min-height: 66px;
    }

    .public-brand small {
        display: none;
    }

    .public-brand img {
        width: 36px;
        height: 36px;
    }


    .public-main {
        padding:
            35px 0
            60px;
    }


    .public-hero {
        display: grid;
        grid-template-columns: 1fr;

        min-height: auto;

        padding-top: 15px;
    }

    .public-flight-panel {
        min-height: 430px;
    }


    .public-section-heading,
    .public-split-section,
    .auth-layout {
        grid-template-columns: 1fr;
    }


    .auth-story {
        min-height: 360px;
    }


    .public-trust-strip {
        margin-bottom: 65px;
    }

    .public-section,
    .public-split-section {
        margin-bottom: 65px;
    }


    .public-footer {
        align-items: flex-start;
        flex-direction: column;
    }


    .workspace-nav {
        flex-wrap: nowrap;

        overflow-x: auto;

        padding-bottom: 5px;
    }

    .workspace-nav a {
        flex: 0 0 auto;

        white-space: nowrap;
    }


    .teacher-exam-detail-actions,
    .exam-preview-actions,
    .exam-builder-actions,
    .exam-publish-actions,
    .adaptive-feedback-actions,
    .teacher-toolbar-actions {
        flex-wrap: wrap;
    }


    .app-content :where(
        h1,
        h2,
        h3
    ) {
        overflow-wrap: anywhere;
    }

}


/* Small mobile */

@media (max-width: 520px) {

    .public-nav-actions
    .public-button-secondary {
        display: none;
    }


    .public-nav-actions {
        gap: 5px;
    }


    .public-nav-actions
    .public-button {
        min-height: 38px;

        padding:
            0 11px;

        font-size: calc(9px * var(--font-scale));
    }


    .public-nav-actions
    .theme-control {
        padding: 2px !important;
    }

    .public-nav-actions
    .theme-choice {
        width: 29px !important;
        height: 29px !important;
    }


    .public-hero h1 {
        font-size:
            calc(clamp(
                39px,
                13vw,
                58px
            ) * var(--font-scale));
    }


    .public-feature-grid,
    .auth-story-grid {
        grid-template-columns: 1fr;
    }


    .public-flight-orbit {
        transform:
            scale(.86);

        transform-origin:
            center top;
    }


    .public-flight-panel {
        padding: 22px;
    }


    .public-split-section,
    .public-final-cta,
    .status-page,
    .error-page {
        padding: 28px 23px;
    }


    .auth-layout {
        border-radius: 23px;
    }


    .auth-story,
    .auth-card {
        padding: 30px 23px;
    }


    .app-topbar {
        padding:
            0 11px;
    }


    .topbar-right {
        gap: 5px;
    }


    .topbar-right
    .theme-control {
        padding: 2px !important;
    }


    .topbar-right
    .theme-choice {
        width: 29px !important;
        height: 29px !important;
    }


    .topbar-user {
        padding: 4px;
    }


    .topbar-user-avatar {
        width: 31px;
        height: 31px;
    }


    .app-content {
        padding-left: 13px;
        padding-right: 13px;
    }


    .exam-question-card,
    .adaptive-practice-card,
    .teacher-exam-settings-card,
    .teacher-exam-flow-card,
    .teacher-exam-question-section,
    .analytics07-section,
    .integrity-section {
        padding: 20px 17px;
    }


    .exam-submit-dialog {
        padding: 25px 20px;
    }


    .public-hero-actions
    .public-button,
    .status-actions
    .public-button {
        width: 100%;
    }


    .status-actions {
        width: 100%;
    }

    .status-actions form {
        width: 100%;
    }

}


/* ----------------------------------------------------------
   Dark public surfaces
   ---------------------------------------------------------- */

html[data-theme="dark"]
.public-header {
    background:
        rgba(6,17,31,.86);
}


html[data-theme="dark"] :where(
    .public-feature-grid article,
    .public-split-section,
    .auth-layout,
    .auth-card,
    .status-page,
    .error-page
) {
    border-color:
        var(--theme-border);

    background:
        linear-gradient(
            180deg,
            #0d2235,
            #0b1b2d
        );
}


html[data-theme="dark"]
.public-button-secondary {
    background:
        #10253b;
}


html[data-theme="dark"]
.public-system-stack article {
    background:
        #10253b;
}


/* ----------------------------------------------------------
   Touch / reduced motion
   ---------------------------------------------------------- */

@media (hover: none) {

    .public-feature-grid article:hover,
    .app-card-interactive:hover,
    .course-premium-card:hover {
        transform: none;
    }

}


@media (
    prefers-reduced-motion:
    reduce
) {

    .public-button,
    .public-feature-grid article,
    .skip-link {
        transition: none;
    }

}


/* ==========================================================
   UI-09 — Visual Consistency Fixes
   ========================================================== */


/* ----------------------------------------------------------
   Final brand assets
   ---------------------------------------------------------- */

.public-brand-complete {
    display: flex !important;
    align-items: center;

    width: 210px;
    max-width: 34vw;

    min-width: 165px;

    text-decoration: none;
}

.public-logo {
    display: block;

    width: 100%;
    height: auto;

    object-fit: contain;
    object-position: left center;
}

.public-logo-dark {
    display: none;
}

html[data-theme="dark"]
.public-logo-light {
    display: none;
}

html[data-theme="dark"]
.public-logo-dark {
    display: block;
}


.app-brand-complete {
    width: 100% !important;
    min-height: 68px !important;

    display: flex !important;
    align-items: center !important;

    padding:
        4px 4px
        18px !important;

    overflow: visible !important;
}

.app-brand-horizontal {
    display: block;

    width: 194px;
    max-width: 100%;

    height: auto;

    object-fit: contain;
    object-position: left center;
}


/* Remove legacy recreated logo pieces */

.app-brand-complete
.app-brand-mark,
.app-brand-complete
.app-brand-text {
    display: none !important;
}


/* ----------------------------------------------------------
   IMPORTANT:
   Grid containers must stay transparent.

   Earlier [class*="card"] dark selector also matched ".cards",
   which produced rectangular dark paint behind rounded cards.
   ---------------------------------------------------------- */

.cards,
.app-grid,
.teacher-kpi-grid,
.teacher-class-grid,
.teacher-attention-grid,
.weak-area-grid,
.guide-grid,
.resource-grid,
.analytics07-columns,
.analytics07-program-grid,
.analytics07-domain-grid,
.integrity-exam-grid,
.integrity-kpi-grid,
.adaptive-metrics,
.adaptive-recommend-grid {
    background: transparent !important;

    border: 0 !important;

    box-shadow: none !important;
}


/* ----------------------------------------------------------
   Core card geometry consistency
   ---------------------------------------------------------- */

.card,
.app-card,
.module,
.teacher-kpi,
.teacher-class-card,
.teacher-attention-card,
.weak-area-card,
.guide-card,
.resource-card {
    overflow: hidden;

    border-radius:
        20px !important;

    background-clip:
        padding-box !important;
}


/* ----------------------------------------------------------
   Dashboard / Recent Errors dark mode
   ---------------------------------------------------------- */

html[data-theme="dark"]
.card,
html[data-theme="dark"]
.app-card,
html[data-theme="dark"]
.module {
    color: #eef6fc !important;

    border-color:
        rgba(255,255,255,.09) !important;

    background:
        linear-gradient(
            180deg,
            #0d2235 0%,
            #0b1b2d 100%
        ) !important;

    box-shadow:
        0 8px 22px
        rgba(0,0,0,.10) !important;
}


html[data-theme="dark"]
.module :where(
    strong,
    h1,
    h2,
    h3,
    h4
) {
    color:
        #f5fbff !important;
}


html[data-theme="dark"]
.module p {
    color:
        #b7c7d5 !important;
}


html[data-theme="dark"]
.module .badge {
    color:
        var(--theme-accent) !important;

    background:
        rgba(var(--theme-accent-rgb),.10) !important;
}


/* ----------------------------------------------------------
   Student dashboard visual continuity
   ---------------------------------------------------------- */

html[data-theme="dark"]
.program-header {
    border-color:
        var(--theme-hero-border) !important;

    background: var(--theme-hero-bg) !important;
}


html[data-theme="dark"]
.cards {
    isolation: isolate;
}


/* ----------------------------------------------------------
   Teacher KPI readability
   ---------------------------------------------------------- */

html[data-theme="dark"]
.teacher-kpi {
    border-color:
        rgba(255,255,255,.09) !important;

    background:
        linear-gradient(
            180deg,
            #0d2235,
            #0b1b2d
        ) !important;
}


html[data-theme="dark"]
.teacher-kpi-value {
    color:
        #f5fbff !important;

    text-shadow:
        0 1px 12px
        rgba(255,255,255,.025);
}


html[data-theme="dark"]
.teacher-kpi-label {
    color:
        #90a9bb !important;
}


/* Teacher metric boxes */

html[data-theme="dark"]
.teacher-class-metric {
    background:
        #10283c !important;
}

html[data-theme="dark"]
.teacher-class-metric-label {
    color:
        #91aabd !important;
}

html[data-theme="dark"]
.teacher-class-metric-value {
    color:
        #f5fbff !important;
}


/* ----------------------------------------------------------
   Guide Hub — remove bright white / cream blocks
   ---------------------------------------------------------- */

.guide-card {
    border-radius:
        20px !important;
}


html[data-theme="dark"]
.guide-card {
    border-color:
        rgba(255,255,255,.09) !important;

    background:
        linear-gradient(
            180deg,
            #0d2235,
            #0b1b2d
        ) !important;
}


html[data-theme="dark"]
.guide-card
.study-block-important {
    color:
        #c1d2de !important;

    border-color:
        rgba(var(--theme-accent-rgb),.13) !important;

    background:
        #10283c !important;
}


html[data-theme="dark"]
.guide-card
.study-block-important
.text-secondary {
    color:
        #b9cad7 !important;
}


html[data-theme="dark"]
.guide-card
.study-block-label {
    color:
        var(--theme-accent) !important;
}


html[data-theme="dark"]
.guide-card
.button {
    color:
        #edf8fd !important;

    border-color:
        rgba(255,255,255,.10) !important;

    background:
        #10283c !important;
}


/* Also harmonize resource cards */

html[data-theme="dark"]
.resource-card {
    border-color:
        rgba(255,255,255,.09) !important;

    background:
        linear-gradient(
            180deg,
            #0d2235,
            #0b1b2d
        ) !important;
}


/* ----------------------------------------------------------
   Integrity workspace
   ---------------------------------------------------------- */

html[data-theme="dark"]
.integrity-kpi-grid article {
    border-color:
        rgba(255,255,255,.09) !important;

    background:
        linear-gradient(
            180deg,
            #0d2235,
            #0b1b2d
        ) !important;
}

html[data-theme="dark"]
.integrity-kpi-grid strong {
    color:
        #f5fbff !important;
}


/* ----------------------------------------------------------
   Light brand sizing
   ---------------------------------------------------------- */

html[data-theme="light"]
.public-brand-complete {
    filter: none;
}


/* ----------------------------------------------------------
   Responsive brand
   ---------------------------------------------------------- */

@media (max-width: 760px) {

    .public-brand-complete {
        width: 175px;

        min-width: 145px;

        max-width: 43vw;
    }

    .app-brand-horizontal {
        width: 180px;
    }

}


@media (max-width: 520px) {

    .public-brand-complete {
        width: 145px;
        min-width: 130px;
    }

}


/* ==========================================================
   UI-10 — Navigation + Brand Precision
   ========================================================== */


/* ----------------------------------------------------------
   Public AeroESP brand
   ---------------------------------------------------------- */

.public-brand-wordmark {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;

    display: inline-flex !important;
    align-items: center !important;

    gap: 11px !important;

    text-decoration: none !important;
}


.public-brand-symbol {
    width: 54px !important;
    height: 54px !important;

    flex: 0 0 54px !important;

    display: block;

    object-fit: contain;
}


.public-brand-copy {
    display: flex;
    flex-direction: column;

    min-width: 0;

    line-height: 1;
}


.public-brand-copy strong {
    color:
        var(--theme-text) !important;

    font-size: calc(20px * var(--font-scale)) !important;
    font-weight: 850 !important;

    letter-spacing: -.045em !important;
}


.public-brand-copy strong span {
    color:
        var(--theme-accent) !important;
}


.public-brand-copy small {
    display: block !important;

    margin-top: 5px !important;

    color:
        var(--theme-text-faint) !important;

    font-size: calc(7.5px * var(--font-scale)) !important;
    font-weight: 750 !important;

    letter-spacing: .105em !important;

    text-transform: uppercase;
}


/* Hide obsolete horizontal assets if old markup remains */

.public-brand-complete
.public-logo {
    display: none !important;
}


/* ----------------------------------------------------------
   Hero actual AeroESP icon
   ---------------------------------------------------------- */

.public-flight-core {
    width: 96px !important;
    height: 96px !important;

    padding: 0 !important;

    overflow: hidden;

    border-radius: 27px !important;

    background:
        transparent !important;

    box-shadow:
        0 18px 46px
        rgba(var(--theme-accent-rgb),.25) !important;
}


.public-flight-brand-icon {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
}


/* ----------------------------------------------------------
   Mobile menu button
   ---------------------------------------------------------- */

.mobile-menu-button {
    position: relative;

    overflow: hidden;
}


.mobile-menu-icon {
    width: 20px;
    height: 16px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    pointer-events: none;
}


.mobile-menu-icon i {
    width: 100%;
    height: 2px;

    display: block;

    border-radius: 99px;

    background:
        currentColor;

    transition:
        transform 160ms ease,
        opacity 160ms ease;
}


body.sidebar-open
.mobile-menu-icon i:nth-child(1) {
    transform:
        translateY(7px)
        rotate(45deg);
}


body.sidebar-open
.mobile-menu-icon i:nth-child(2) {
    opacity: 0;
}


body.sidebar-open
.mobile-menu-icon i:nth-child(3) {
    transform:
        translateY(-7px)
        rotate(-45deg);
}


/* ----------------------------------------------------------
   Edge handle
   ---------------------------------------------------------- */

.sidebar-edge-handle {
    display: none;
}


@media (max-width: 860px) {

    .sidebar-edge-handle {
        position: fixed;

        z-index: 1040;

        left: 0;
        top: 50%;

        width: 28px;
        height: 78px;

        display: grid;
        place-items: center;

        transform:
            translateY(-50%);

        padding: 0;

        border:
            1px solid
            rgba(var(--theme-accent-rgb),.24);

        border-left: 0;

        border-radius:
            0 14px 14px 0;

        color:
            var(--theme-accent);

        background:
            rgba(8,39,58,.94);

        box-shadow:
            5px 8px 22px
            rgba(0,0,0,.16);

        cursor: pointer;

        backdrop-filter:
            blur(12px);

        -webkit-backdrop-filter:
            blur(12px);

        touch-action:
            pan-y;
    }


    .sidebar-edge-handle span {
        display: block;

        transform:
            translateX(-1px);

        font-size: calc(27px * var(--font-scale));
        font-weight: 300;

        line-height: 1;
    }


    body.sidebar-open
    .sidebar-edge-handle {
        opacity: 0;

        pointer-events: none;
    }


    .mobile-menu-button {
        display: grid !important;

        place-items: center;

        width: 43px !important;
        height: 43px !important;

        color:
            var(--theme-text) !important;

        border:
            1px solid
            var(--theme-border) !important;

        border-radius:
            12px !important;

        background:
            var(--theme-surface) !important;
    }

}


/* ----------------------------------------------------------
   Mobile logo sizing
   ---------------------------------------------------------- */

@media (max-width: 600px) {

    .public-brand-symbol {
        width: 43px !important;
        height: 43px !important;

        flex-basis: 43px !important;
    }


    .public-brand-copy strong {
        font-size: calc(17px * var(--font-scale)) !important;
    }


    .public-brand-copy small {
        font-size: calc(6px * var(--font-scale)) !important;
    }

}


@media (max-width: 420px) {

    .public-brand-copy small {
        display: none !important;
    }

}


/* ==========================================================
   UI-11 — Exact Brand + Single Mobile Navigation
   ========================================================== */


/* ----------------------------------------------------------
   Exact supplied primary logo
   ---------------------------------------------------------- */

.public-brand-exact {
    display: flex !important;
    align-items: center !important;

    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;

    height: auto;

    padding: 0 !important;

    text-decoration: none !important;
}


.public-brand-exact-image {
    display: block;

    width: 240px;
    height: auto;

    object-fit: contain;
    object-position: left center;
}


.public-brand-exact-dark {
    display: none;
}


html[data-theme="dark"]
.public-brand-exact-light {
    display: none;
}


html[data-theme="dark"]
.public-brand-exact-dark {
    display: block;
}


html[data-theme="light"]
.public-brand-exact-light {
    display: block;
}


html[data-theme="light"]
.public-brand-exact-dark {
    display: none;
}


/* Remove every previous reconstructed public-logo variation */

.public-brand-exact
.public-brand-symbol,
.public-brand-exact
.public-brand-copy,
.public-brand-exact
.public-logo {
    display: none !important;
}


/* Header has enough room for the actual logo */

.public-header-inner {
    min-height: 88px;
}


/* ----------------------------------------------------------
   Exact sidebar logo
   ---------------------------------------------------------- */

.app-brand-exact {
    display: flex !important;
    align-items: center !important;

    width: 100% !important;

    min-height: 82px !important;

    padding:
        5px 0
        18px !important;

    overflow: visible !important;
}


.app-brand-exact-image {
    display: block;

    width: 205px;
    max-width: 100%;

    height: auto;

    object-fit: contain;
    object-position: left center;
}


/* Kill all previous reconstructed sidebar brand parts */

.app-brand-exact
.app-brand-mark,
.app-brand-exact
.app-brand-text,
.app-brand-exact
.app-brand-symbol,
.app-brand-exact
.app-brand-horizontal {
    display: none !important;
}


/* ----------------------------------------------------------
   Exact supplied app icon in landing visual
   ---------------------------------------------------------- */

.public-flight-brand-icon {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    object-fit: contain !important;
}


.public-flight-core {
    overflow: visible !important;

    padding: 0 !important;

    background:
        transparent !important;

    box-shadow:
        none !important;
}


/* ----------------------------------------------------------
   ONE mobile navigation method only:
   hamburger in topbar.
   ---------------------------------------------------------- */

.sidebar-edge-handle {
    display: none !important;
}


@media (max-width: 860px) {

    .mobile-menu-button {
        display: grid !important;

        place-items: center !important;

        width: 46px !important;
        height: 46px !important;

        border:
            1px solid
            var(--theme-border) !important;

        border-radius:
            13px !important;

        color:
            var(--theme-text) !important;

        background:
            var(--theme-surface) !important;
    }


    .mobile-menu-icon {
        width: 21px;
        height: 16px;
    }


    .mobile-menu-icon i {
        height: 2px;

        background:
            currentColor !important;
    }

}


/* ----------------------------------------------------------
   Mobile public logo
   ---------------------------------------------------------- */

@media (max-width: 600px) {

    .public-brand-exact,
    .public-brand-exact-image {
        width: 185px !important;
        min-width: 185px !important;
        max-width: 185px !important;
    }


    .public-header-inner {
        min-height: 76px;
    }

}


@media (max-width: 420px) {

    .public-brand-exact,
    .public-brand-exact-image {
        width: 155px !important;
        min-width: 155px !important;
        max-width: 155px !important;
    }

}

/* =========================================================
   UI-12 FINAL BRAND INTEGRATION
   ========================================================= */

:root {
    --aero-radius-xl: 32px;
    --aero-radius-lg: 28px;
    --aero-radius-md: 22px;
    --aero-radius-sm: 18px;
}

/* ---------- Final logos ---------- */

.aero-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.aero-brand__logo {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.aero-brand__img {
    display: block;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.aero-brand__img--light {
    width: min(220px, 100%);
}

.aero-brand__img--dark {
    width: min(220px, 100%);
    display: none;
}

.aero-brand--login .aero-brand__img--light,
.aero-brand--login .aero-brand__img--dark {
    width: min(240px, 100%);
}

html[data-theme="dark"] .aero-brand__img--light,
body[data-theme="dark"] .aero-brand__img--light {
    display: none;
}

html[data-theme="dark"] .aero-brand__img--dark,
body[data-theme="dark"] .aero-brand__img--dark {
    display: block;
}

/* اگر جایی لوگوی قبلی ریز شده بود */
.aero-brand img {
    max-height: none !important;
}

/* ---------- Hero visual ---------- */

.aero-hero-visual-card {
    width: 100%;
    max-width: 480px;
    border-radius: var(--aero-radius-xl);
    overflow: hidden;
    position: relative;
    background: transparent;
    box-shadow: 0 20px 60px rgba(8, 24, 49, 0.16);
}

.aero-hero-visual-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: var(--aero-radius-xl);
}

/* ---------- Cards: rounded and theme-consistent ---------- */

.card,
.aero-card,
.dashboard-card,
.metric-card,
.stat-card,
.guide-card,
.error-card,
.panel-card,
.hero-card,
.content-card {
    border-radius: var(--aero-radius-lg) !important;
    overflow: hidden;
}

/* فاصله رنگی ناخوشایند بین کارت‌ها در دارک مود کمتر شود */
html[data-theme="dark"] .card,
html[data-theme="dark"] .aero-card,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .guide-card,
html[data-theme="dark"] .error-card,
html[data-theme="dark"] .panel-card,
html[data-theme="dark"] .hero-card,
html[data-theme="dark"] .content-card {
    background-clip: padding-box;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.20),
        inset 0 0 0 1px rgba(145, 190, 222, 0.08);
}

/* ---------- Recent errors: enforce theme ---------- */

html[data-theme="dark"] .recent-errors,
html[data-theme="dark"] .recent-errors .card,
html[data-theme="dark"] .recent-errors .error-card,
html[data-theme="dark"] .recent-errors .content-card {
    background: linear-gradient(180deg, rgba(9, 30, 58, 0.96), rgba(8, 24, 49, 0.96)) !important;
    color: #eef6ff !important;
    border-color: rgba(120, 180, 220, 0.16) !important;
}

html[data-theme="dark"] .recent-errors .muted,
html[data-theme="dark"] .recent-errors .text-muted,
html[data-theme="dark"] .recent-errors p,
html[data-theme="dark"] .recent-errors span,
html[data-theme="dark"] .recent-errors div {
    color: rgba(231, 241, 250, 0.88) !important;
}

/* ---------- Guide Hub white inner boxes -> themed ---------- */

html[data-theme="dark"] .guide-card .how-to-use,
html[data-theme="dark"] .guide-card .guide-note,
html[data-theme="dark"] .guide-card .guide-inner,
html[data-theme="dark"] .guide-card .guide-highlight,
html[data-theme="dark"] .guide-card .guide-body-note {
    background: rgba(241, 248, 255, 0.08) !important;
    color: #eef6ff !important;
    border-color: rgba(var(--theme-accent-rgb), 0.15) !important;
    border-radius: var(--aero-radius-md) !important;
}

/* ---------- Dark mode numbers visibility ---------- */

html[data-theme="dark"] .kpi-value,
html[data-theme="dark"] .metric-value,
html[data-theme="dark"] .stat-value,
html[data-theme="dark"] .analytics-number,
html[data-theme="dark"] .dashboard-number {
    color: #f4f9ff !important;
}

/* ---------- Keep only topbar panel button ---------- */

/* هر دسته‌ای از دسته‌های شناور/لبه‌ای را مخفی کن */
.workspace-edge-handle,
.workspace-peek-handle,
.workspace-drawer-handle,
.workspace-flyout-handle,
.sidebar-edge-handle,
.sidebar-peek-handle,
.sidebar-drag-handle,
.aero-sidebar-edge-tab,
.aero-sidebar-float-toggle,
.drawer-edge-toggle,
.drawer-peek-toggle,
.mobile-edge-toggle {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* دکمه منوی بالای صفحه حفظ شود */
.topbar-menu-toggle,
.workspace-topbar-toggle,
.mobile-nav-toggle,
.sidebar-toggle,
.aero-topbar-toggle {
    display: inline-flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* ---------- Mobile polish ---------- */

@media (max-width: 900px) {
    .aero-brand__img--light,
    .aero-brand__img--dark {
        width: 150px;
    }

    .aero-hero-visual-card {
        max-width: 100%;
        border-radius: var(--aero-radius-lg);
    }

    .aero-hero-visual-image {
        border-radius: var(--aero-radius-lg);
    }
}


/* ==========================================================
   UI-13 — Designer Credit
   ========================================================== */

.aeroesp-designer-credit {
    color: var(--theme-text-faint);

    font-size: calc(9px * var(--font-scale));
    font-weight: 500;

    line-height: 1.5;

    letter-spacing: .015em;
}

.aeroesp-designer-credit strong {
    color: var(--theme-text-soft);

    font-weight: 750;
}

.public-footer
.aeroesp-designer-credit {
    margin-left: auto;

    text-align: right;
}

.aeroesp-designer-credit-sidebar {
    margin:
        10px 8px
        2px;

    padding-top: 10px;

    border-top:
        1px solid
        rgba(255,255,255,.07);

    color:
        rgba(210,226,238,.48);

    text-align: center;

    font-size: calc(8px * var(--font-scale));
}

.aeroesp-designer-credit-sidebar strong {
    display: block;

    margin-top: 1px;

    color:
        rgba(233,244,250,.68);

    font-size: calc(8.5px * var(--font-scale));
}


@media (max-width: 760px) {

    .public-footer
    .aeroesp-designer-credit {
        width: 100%;

        margin-left: 0;

        text-align: left;
    }

}


/* ==========================================================
   UI-14 — Brand / Course / Header Polish
   ========================================================== */


/* ----------------------------------------------------------
   Sign In must stay on one line
   ---------------------------------------------------------- */

.public-nav-actions .public-button {
    white-space: nowrap !important;
}

.public-nav-actions
.public-button-primary {
    min-width: 78px;
}


/* ----------------------------------------------------------
   Sidebar final logo
   Make the rectangular PNG presentation intentional
   and visually integrated with the sidebar.
   ---------------------------------------------------------- */

.app-brand-exact {
    padding:
        7px !important;

    margin:
        4px 0 12px !important;

    border:
        1px solid
        rgba(var(--theme-accent-rgb),.10) !important;

    border-radius:
        18px !important;

    overflow: hidden !important;

    background:
        linear-gradient(
            145deg,
            #061d31,
            #08283e
        ) !important;

    box-shadow:
        inset 0 0 0 1px
        rgba(255,255,255,.015);
}


.app-brand-exact-image {
    width: 100% !important;
    max-width: 215px !important;

    display: block;

    margin: auto;

    border-radius:
        12px !important;

    object-fit:
        contain !important;
}


/* ----------------------------------------------------------
   Public header logo
   ---------------------------------------------------------- */

.aero-brand__logo {
    overflow: hidden;

    border-radius:
        12px;
}


.aero-brand__img {
    border-radius:
        12px;

    object-fit:
        contain;
}


/* ----------------------------------------------------------
   My Courses dark-theme metadata
   ---------------------------------------------------------- */

html[data-theme="dark"]
.course-card :where(
    .course-meta,
    .course-meta-item,
    .course-stat,
    .course-stat-item,
    .course-detail-stat,
    .course-detail-meta,
    .course-summary-item,
    .course-info-item,
    .course-premium-stat,
    .course-premium-meta-item
) {
    color:
        #eaf4fb !important;

    border-color:
        rgba(var(--theme-accent-rgb),.10) !important;

    background:
        #10283c !important;

    box-shadow:
        none !important;
}


html[data-theme="dark"]
.course-card :where(
    .course-meta,
    .course-meta-item,
    .course-stat,
    .course-stat-item,
    .course-detail-stat,
    .course-detail-meta,
    .course-summary-item,
    .course-info-item,
    .course-premium-stat,
    .course-premium-meta-item
) :where(
    strong,
    b
) {
    color:
        #f5fbff !important;
}


/*
Fallback for the current 2 × 2 metadata grid if its
class name changed between UI revisions.
*/

html[data-theme="dark"]
.course-card
[class*="meta"]
> div,

html[data-theme="dark"]
.course-card
[class*="stat"]
> div,

html[data-theme="dark"]
.course-card
[class*="info"]
> div {

    color:
        #eaf4fb !important;

    border-color:
        rgba(var(--theme-accent-rgb),.10) !important;

    background:
        #10283c !important;
}


/* Metadata labels */

html[data-theme="dark"]
.course-card
[class*="meta"]
:where(
    small,
    span
),

html[data-theme="dark"]
.course-card
[class*="stat"]
:where(
    small,
    span
) {
    color:
        #8ca8bb !important;
}


/* Card itself */

html[data-theme="dark"]
.course-card {
    border-color:
        rgba(255,255,255,.08) !important;

    background:
        linear-gradient(
            180deg,
            #0d2235,
            #0a1d30
        ) !important;
}


/* ----------------------------------------------------------
   Avoid sharp visual blocks in course UI
   ---------------------------------------------------------- */

.course-card,
.course-card
[class*="meta"]
> div,
.course-card
[class*="stat"]
> div,
.course-card
[class*="info"]
> div {
    border-radius:
        16px !important;

    background-clip:
        padding-box !important;
}


/* ----------------------------------------------------------
   Mobile topbar
   ---------------------------------------------------------- */

@media (max-width: 520px) {

    .public-nav-actions
    .public-button-primary {
        min-width: 70px;

        padding-left: 11px;
        padding-right: 11px;
    }

}


/* ==========================================================
   UI-15 — Assessment + Dark Surface Consistency
   ========================================================== */


/* ----------------------------------------------------------
   Global dark workspace continuity
   ---------------------------------------------------------- */

html[data-theme="dark"] .app-main,
html[data-theme="dark"] .app-content {
    background:
        #06111f !important;
}


/* ----------------------------------------------------------
   My Courses
   ---------------------------------------------------------- */

html[data-theme="dark"]
.course-library {
    background:
        transparent !important;
}


html[data-theme="dark"]
.course-premium-card {

    color:
        var(--theme-text) !important;

    border-color:
        var(--theme-border) !important;

    background:
        linear-gradient(
            180deg,
            #0d2235,
            #0a1b2c
        ) !important;
}


html[data-theme="dark"]
.course-card-meta {

    background:
        transparent !important;
}


html[data-theme="dark"]
.course-meta-cell {

    color:
        var(--theme-text) !important;

    border-color:
        rgba(255,255,255,.07) !important;

    background:
        #10253b !important;

    box-shadow:
        none !important;
}


html[data-theme="dark"]
.course-meta-label {

    color:
        #8297aa !important;
}


html[data-theme="dark"]
.course-meta-value {

    color:
        #eef6fc !important;
}


/* ----------------------------------------------------------
   Adaptive surfaces
   Remove visible strips between grid cards
   ---------------------------------------------------------- */

html[data-theme="dark"]
.adaptive-metrics,

html[data-theme="dark"]
.adaptive-two-column,

html[data-theme="dark"]
.adaptive-path-columns,

html[data-theme="dark"]
.adaptive-list,

html[data-theme="dark"]
.adaptive-category-grid,

html[data-theme="dark"]
.adaptive-recommend-grid,

html[data-theme="dark"]
.analytics07-kpis,

html[data-theme="dark"]
.analytics07-program-grid,

html[data-theme="dark"]
.analytics07-domain-grid {

    background:
        transparent !important;
}


html[data-theme="dark"]
.adaptive-metrics article {

    color:
        var(--theme-text) !important;

    border-color:
        var(--theme-border) !important;

    background:
        #0b1b2d !important;

    box-shadow:
        none !important;
}


html[data-theme="dark"]
.adaptive-metrics article strong {

    color:
        #f5fbff !important;
}


html[data-theme="dark"]
.adaptive-section {

    border-color:
        var(--theme-border) !important;

    background:
        linear-gradient(
            180deg,
            #0d2235,
            #0b1b2d
        ) !important;
}


html[data-theme="dark"]
.adaptive-list-card,

html[data-theme="dark"]
.adaptive-list-card.subtle,

html[data-theme="dark"]
.adaptive-path-list article,

html[data-theme="dark"]
.adaptive-mastery-card,

html[data-theme="dark"]
.adaptive-category-grid article,

html[data-theme="dark"]
.adaptive-recommend-grid article {

    color:
        var(--theme-text) !important;

    border-color:
        rgba(255,255,255,.07) !important;

    background:
        #10253b !important;

    box-shadow:
        none !important;
}


/* review queue specific */

html[data-theme="dark"]
.adaptive-scope-switch {

    background:
        #0b1b2d !important;
}


html[data-theme="dark"]
.adaptive-scope-switch a {

    color:
        #a9bac9 !important;
}


html[data-theme="dark"]
.adaptive-scope-switch a.is-active {

    color:
        var(--theme-accent-strong) !important;

    background:
        rgba(var(--theme-accent-rgb),.13) !important;
}


/* ----------------------------------------------------------
   Generic legacy grids
   ---------------------------------------------------------- */

html[data-theme="dark"]
.cards,

html[data-theme="dark"]
.metric-grid,

html[data-theme="dark"]
.teacher-kpi-grid,

html[data-theme="dark"]
.weak-area-grid {

    background:
        transparent !important;
}


/* ----------------------------------------------------------
   Quiz 15
   ---------------------------------------------------------- */

.quiz15-shell {

    width:
        min(100%, 1120px);

    margin:
        0 auto;
}


.quiz15-hero {

    position:
        relative;

    overflow:
        hidden;

    display:
        grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto;

    align-items:
        center;

    gap:
        36px;

    margin-bottom:
        28px;

    padding:
        clamp(30px, 5vw, 55px);

    border:
        1px solid
        var(--theme-hero-border);

    border-radius:
        34px;

    background: var(--theme-hero-bg);

    box-shadow: var(--theme-hero-shadow);
}


.quiz15-hero h1 {

    max-width:
        720px;

    margin:
        8px 0
        14px;

    color:
        var(--theme-text);

    font-size:
        calc(clamp(
            36px,
            5vw,
            62px
        ) * var(--font-scale));

    line-height:
        1.02;

    letter-spacing:
        -.05em;
}


.quiz15-hero h1 span {

    color:
        var(--theme-accent-strong);
}


.quiz15-hero p {

    max-width:
        670px;

    margin:
        0;

    color:
        var(--theme-text-soft);

    font-size:
        calc(14px * var(--font-scale));

    line-height:
        1.75;
}


.quiz15-summary {

    width:
        150px;

    min-height:
        150px;

    display:
        flex;

    flex-direction:
        column;

    align-items:
        center;

    justify-content:
        center;

    border:
        1px solid
        var(--theme-hero-inset-border);

    border-radius:
        27px;

    background:
        var(--theme-hero-inset);

    backdrop-filter:
        blur(12px);
}


.quiz15-summary span,
.quiz15-summary small {

    color:
        var(--theme-text-soft);

    font-size:
        calc(10px * var(--font-scale));

    font-weight:
        750;

    letter-spacing:
        .08em;

    text-transform:
        uppercase;
}


.quiz15-summary strong {

    margin:
        2px 0;

    color:
        var(--theme-text);

    font-size:
        calc(48px * var(--font-scale));

    line-height:
        1;

    letter-spacing:
        -.06em;
}


.quiz15-form {

    display:
        grid;

    gap:
        18px;
}


.quiz15-question {

    padding:
        clamp(22px, 4vw, 34px);

    border:
        1px solid
        var(--theme-border);

    border-radius:
        26px;

    color:
        var(--theme-text);

    background:
        var(--theme-surface);

    box-shadow:
        var(--theme-shadow-sm);
}


.quiz15-question-header {

    display:
        flex;

    align-items:
        center;

    gap:
        14px;

    margin-bottom:
        18px;
}


.quiz15-number {

    width:
        42px;

    height:
        42px;

    flex:
        0 0 42px;

    display:
        grid;

    place-items:
        center;

    border-radius:
        13px;

    color:
        var(--theme-accent-strong);

    background:
        var(--theme-accent-soft);

    font-size:
        calc(11px * var(--font-scale));

    font-weight:
        850;
}


.quiz15-meta {

    display:
        flex;

    flex-wrap:
        wrap;

    gap:
        7px;
}


.quiz15-meta span {

    padding:
        5px 9px;

    border-radius:
        99px;

    color:
        var(--theme-text-soft);

    background:
        var(--theme-surface-soft);

    font-size:
        calc(10px * var(--font-scale));

    font-weight:
        700;
}


.quiz15-question h2 {

    max-width:
        920px;

    margin:
        0 0
        23px;

    color:
        var(--theme-text);

    font-size:
        calc(clamp(
            18px,
            2vw,
            23px
        ) * var(--font-scale));

    line-height:
        1.55;
}


.quiz15-options {

    display:
        grid;

    gap:
        10px;
}


.quiz15-option {

    display:
        grid;

    grid-template-columns:
        auto
        35px
        minmax(0,1fr);

    align-items:
        center;

    gap:
        11px;

    margin:
        0;

    padding:
        13px 15px;

    border:
        1px solid
        var(--theme-border);

    border-radius:
        15px;

    color:
        var(--theme-text);

    background:
        var(--theme-surface-soft);

    cursor:
        pointer;

    transition:
        transform 160ms ease,
        background 160ms ease,
        border-color 160ms ease;
}


.quiz15-option:hover {

    transform:
        translateX(3px);

    border-color:
        rgba(var(--theme-accent-rgb),.28);

    background:
        color-mix(
            in srgb,
            var(--theme-accent-soft) 55%,
            var(--theme-surface-soft)
        );
}


.quiz15-option input {

    width:
        auto;

    min-height:
        auto;
}


.quiz15-letter {

    width:
        32px;

    height:
        32px;

    display:
        grid;

    place-items:
        center;

    border-radius:
        10px;

    color:
        var(--theme-accent-strong);

    background:
        var(--theme-accent-soft);

    font-size:
        calc(11px * var(--font-scale));

    font-weight:
        850;
}


.quiz15-submit {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        25px;

    margin-top:
        8px;

    padding:
        24px;

    border:
        1px solid
        var(--theme-border);

    border-radius:
        22px;

    background:
        var(--theme-surface);
}


.quiz15-submit span {

    display:
        block;

    color:
        var(--theme-text-faint);

    font-size:
        calc(10px * var(--font-scale));

    text-transform:
        uppercase;

    letter-spacing:
        .08em;
}


.quiz15-submit strong {

    display:
        block;

    margin-top:
        4px;

    color:
        var(--theme-text);
}


.quiz15-empty {

    padding:
        50px 30px;

    border:
        1px dashed
        var(--theme-border-strong);

    border-radius:
        25px;

    text-align:
        center;

    background:
        var(--theme-surface);
}


/* quiz dark */

html[data-theme="dark"]
.quiz15-question,

html[data-theme="dark"]
.quiz15-submit,

html[data-theme="dark"]
.quiz15-empty {

    border-color:
        rgba(255,255,255,.08);

    background:
        #0b1b2d;
}


html[data-theme="dark"]
.quiz15-option {

    border-color:
        rgba(255,255,255,.08);

    background:
        #10253b;
}


html[data-theme="dark"]
.quiz15-meta span {

    color:
        #a8bdcc;

    background:
        #10253b;
}


/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */

@media (max-width: 760px) {

    .quiz15-hero {

        grid-template-columns:
            1fr;

        border-radius:
            27px;
    }


    .quiz15-summary {

        width:
            100%;

        min-height:
            100px;

        align-items:
            flex-start;

        padding:
            18px;
    }


    .quiz15-question {

        border-radius:
            21px;
    }


    .quiz15-submit {

        align-items:
            stretch;

        flex-direction:
            column;
    }

}


@media (max-width: 500px) {

    .quiz15-meta {

        width:
            100%;
    }


    .quiz15-question-header {

        align-items:
            flex-start;
    }


    .quiz15-option {

        grid-template-columns:
            auto
            31px
            minmax(0,1fr);

        padding:
            12px;
    }

}


/* ==========================================================
   UI-16 — Fully Theme-Aware Sidebar
   ========================================================== */

.app-sidebar {
    transition:
        background 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        color 180ms ease !important;
}


/* ==========================================================
   LIGHT SIDEBAR
   ========================================================== */

html[data-theme="light"] .app-sidebar {

    color:
        #10243a !important;

    border-right:
        1px solid
        rgba(15,42,67,.10) !important;

    background:
        radial-gradient(
            circle at 15% 0%,
            rgba(var(--theme-accent-rgb),.10),
            transparent 18rem
        ),
        linear-gradient(
            180deg,
            #f8fbfd 0%,
            #edf5f9 100%
        ) !important;

    box-shadow:
        14px 0 42px
        rgba(7,24,45,.06) !important;
}


/* Brand in light sidebar */

html[data-theme="light"]
.app-sidebar
.aero-brand {

    padding:
        4px 0 18px;

    background:
        transparent !important;
}


html[data-theme="light"]
.app-sidebar
.aero-brand__logo {

    background:
        #ffffff;

    border:
        1px solid
        rgba(15,42,67,.07);

    border-radius:
        16px;

    overflow:
        hidden;

    box-shadow:
        0 8px 24px
        rgba(7,24,45,.05);
}


html[data-theme="light"]
.app-sidebar
.aero-brand__img--light {

    display:
        block !important;
}


html[data-theme="light"]
.app-sidebar
.aero-brand__img--dark {

    display:
        none !important;
}


/* Navigation labels */

html[data-theme="light"]
.app-sidebar
.app-nav-label {

    color:
        #8799a7 !important;
}


/* Navigation links */

html[data-theme="light"]
.app-sidebar
.app-nav-link {

    color:
        #506879 !important;
}


html[data-theme="light"]
.app-sidebar
.app-nav-link:hover {

    color:
        #102f43 !important;

    background:
        rgba(var(--theme-accent-rgb),.09) !important;
}


html[data-theme="light"]
.app-sidebar
.app-nav-link.is-active {

    color:
        #0b3047 !important;

    border-color:
        rgba(var(--theme-accent-strong-rgb),.16) !important;

    background:
        linear-gradient(
            90deg,
            rgba(var(--theme-accent-rgb),.17),
            rgba(var(--theme-accent-rgb),.05)
        ) !important;
}


html[data-theme="light"]
.app-sidebar
.app-nav-link.is-active::after {

    background:
        var(--theme-accent-strong) !important;

    box-shadow:
        0 0 0 5px
        rgba(var(--theme-accent-strong-rgb),.10) !important;
}


/* Navigation icons */

html[data-theme="light"]
.app-sidebar
.app-nav-icon {

    color:
        var(--theme-accent-strong) !important;

    background:
        #e4f3f8 !important;
}


html[data-theme="light"]
.app-sidebar
.app-nav-link.is-active
.app-nav-icon {

    color:
        #073247 !important;

    background:
        var(--theme-accent) !important;
}


/* User account card */

html[data-theme="light"]
.app-sidebar
.sidebar-user {

    border-color:
        rgba(15,42,67,.09) !important;

    background:
        rgba(255,255,255,.66) !important;

    box-shadow:
        0 7px 20px
        rgba(7,24,45,.035);
}


html[data-theme="light"]
.app-sidebar
.sidebar-user-name {

    color:
        #173247 !important;
}


html[data-theme="light"]
.app-sidebar
.sidebar-user-role {

    color:
        #7d91a0 !important;
}


html[data-theme="light"]
.app-sidebar
.sidebar-account-link,

html[data-theme="light"]
.app-sidebar
.sidebar-logout {

    color:
        #506879 !important;

    border-color:
        rgba(15,42,67,.09) !important;

    background:
        #f4f8fa !important;
}


html[data-theme="light"]
.app-sidebar
.sidebar-account-link:hover,

html[data-theme="light"]
.app-sidebar
.sidebar-logout:hover {

    color:
        #102f43 !important;

    background:
        #e8f3f8 !important;
}


/* Designer credit */

html[data-theme="light"]
.app-sidebar
.aeroesp-designer-credit-sidebar {

    color:
        #91a1ad !important;

    border-top-color:
        rgba(15,42,67,.08) !important;
}


html[data-theme="light"]
.app-sidebar
.aeroesp-designer-credit-sidebar strong {

    color:
        #607787 !important;
}


/* ==========================================================
   DARK SIDEBAR
   ========================================================== */

html[data-theme="dark"] .app-sidebar {

    color:
        #ffffff !important;

    border-right-color:
        rgba(255,255,255,.06) !important;

    background:
        radial-gradient(
            circle at 20% 0%,
            rgba(var(--theme-accent-rgb),.08),
            transparent 19rem
        ),
        linear-gradient(
            180deg,
            #071f31 0%,
            #061a29 100%
        ) !important;

    box-shadow:
        18px 0 50px
        rgba(0,0,0,.16) !important;
}


html[data-theme="dark"]
.app-sidebar
.aero-brand__img--light {

    display:
        none !important;
}


html[data-theme="dark"]
.app-sidebar
.aero-brand__img--dark {

    display:
        block !important;
}


/* Keep logo image corners consistent */

.app-sidebar
.aero-brand__logo {

    width:
        100%;

    border-radius:
        16px;

    overflow:
        hidden;
}


.app-sidebar
.aero-brand__img {

    width:
        100% !important;

    height:
        auto !important;

    object-fit:
        contain !important;
}


/* ==========================================================
   Small-screen theme sidebar
   ========================================================== */

@media (max-width: 860px) {

    html[data-theme="light"]
    .app-sidebar {

        box-shadow:
            20px 0 55px
            rgba(7,24,45,.16) !important;
    }


    html[data-theme="dark"]
    .app-sidebar {

        box-shadow:
            20px 0 60px
            rgba(0,0,0,.36) !important;
    }

}


/* ==========================================================
   UI-17 — AeroESP Assessment Results
   ========================================================== */

.result17-shell {
    width: min(100%, 1180px);

    margin: 0 auto;
}


/* ----------------------------------------------------------
   Hero
   ---------------------------------------------------------- */

.result17-hero {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        285px;

    align-items: center;

    gap: 42px;

    overflow: hidden;

    margin-bottom: 18px;

    padding:
        clamp(30px, 5vw, 56px);

    border:
        1px solid
        rgba(var(--theme-accent-rgb),.15);

    border-radius:
        34px;

    color: var(--theme-text);

    background: var(--theme-hero-bg);

    box-shadow: var(--theme-hero-shadow);
}


.result17-hero-copy h1 {
    max-width: 720px;

    margin:
        11px 0
        15px;

    color: var(--theme-text);

    font-size:
        calc(clamp(
            38px,
            5.5vw,
            65px
        ) * var(--font-scale));

    line-height: 1.02;

    letter-spacing: -.055em;
}


.result17-hero-copy h1 span {
    color: var(--theme-accent-strong);
}


.result17-hero-copy > p {
    max-width: 670px;

    margin:
        0 0
        25px;

    color: var(--theme-text-soft);

    font-size: calc(14px * var(--font-scale));

    line-height: 1.75;
}


.result17-hero-actions {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;
}


.result17-score-panel {
    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 17px;

    min-height: 280px;

    padding: 24px;

    border:
        1px solid
        var(--theme-hero-inset-border);

    border-radius: 29px;

    background:
        var(--theme-hero-inset);

    backdrop-filter:
        blur(12px);

    -webkit-backdrop-filter:
        blur(12px);
}


.result17-score-ring {
    position: relative;

    width: 166px;
    height: 166px;

    display: grid;

    place-items: center;

    border-radius: 50%;

    background:
        conic-gradient(
            var(--theme-accent)
                calc(
                    var(--result-score)
                    * 1%
                ),
            var(--theme-hero-inset-border)
                0
        );

    box-shadow:
        0 12px 36px
        rgba(var(--theme-accent-strong-rgb),.15);
}


.result17-score-ring::after {
    content: "";

    position: absolute;

    inset: 10px;

    border-radius: 50%;

    background:
        var(--theme-surface);
}


.result17-score-ring-inner {
    position: relative;
    z-index: 1;

    display: flex;

    flex-direction: column;

    align-items: center;
}


.result17-score-ring-inner strong {
    color: var(--theme-text);

    font-size: calc(42px * var(--font-scale));

    line-height: 1;

    letter-spacing: -.055em;
}


.result17-score-ring-inner span {
    margin-top: 6px;

    color: var(--theme-text-soft);

    font-size: calc(9px * var(--font-scale));

    font-weight: 800;

    letter-spacing: .11em;

    text-transform: uppercase;
}


.result17-score-copy {
    text-align: center;
}


.result17-score-copy strong,
.result17-score-copy span {
    display: block;
}


.result17-score-copy strong {
    color: var(--theme-text);

    font-size: calc(19px * var(--font-scale));
}


.result17-score-copy span {
    margin-top: 3px;

    color: var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));
}


/* ----------------------------------------------------------
   KPI Summary
   ---------------------------------------------------------- */

.result17-summary-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 10px;

    margin-bottom: 18px;

    background: transparent;
}


.result17-summary-grid article {
    min-height: 112px;

    display: flex;

    flex-direction: column;

    justify-content: center;

    padding: 20px;

    border:
        1px solid
        var(--theme-border);

    border-radius: 19px;

    background:
        var(--theme-surface);

    box-shadow:
        var(--theme-shadow-sm);
}


.result17-summary-grid span {
    color:
        var(--theme-text-faint);

    font-size: calc(9px * var(--font-scale));

    font-weight: 800;

    letter-spacing: .08em;

    text-transform: uppercase;
}


.result17-summary-grid strong {
    margin-top: 4px;

    color:
        var(--theme-text);

    font-size: calc(30px * var(--font-scale));

    letter-spacing: -.045em;
}


/* ----------------------------------------------------------
   Analysis
   ---------------------------------------------------------- */

.result17-analysis-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0,1fr));

    gap: 14px;

    margin-bottom: 18px;

    background: transparent;
}


.result17-section {
    padding:
        clamp(23px, 4vw, 34px);

    border:
        1px solid
        var(--theme-border);

    border-radius: 25px;

    background:
        var(--theme-surface);

    box-shadow:
        var(--theme-shadow-sm);
}


.result17-section-header {
    margin-bottom: 24px;
}


.result17-kicker {
    display: block;

    color:
        var(--theme-accent-strong);

    font-size: calc(9px * var(--font-scale));

    font-weight: 850;

    letter-spacing: .11em;

    text-transform: uppercase;
}


.result17-section h2,
.result17-review-section h2 {
    margin:
        6px 0
        0;

    color:
        var(--theme-text);

    font-size:
        calc(clamp(22px, 2.7vw, 31px) * var(--font-scale));

    letter-spacing: -.035em;
}


.result17-metric-list {
    display: grid;

    gap: 20px;
}


.result17-metric {
    min-width: 0;
}


.result17-metric-heading {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 16px;

    margin-bottom: 8px;
}


.result17-metric-heading strong {
    color:
        var(--theme-text);

    font-size: calc(12px * var(--font-scale));
}


.result17-metric-heading span {
    color:
        var(--theme-text-soft);

    font-size: calc(10px * var(--font-scale));

    white-space: nowrap;
}


.result17-progress {
    overflow: hidden;

    height: 9px;

    border-radius: 99px;

    background:
        var(--theme-surface-soft);
}


.result17-progress > span {
    display: block;

    height: 100%;

    min-width: 0;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--theme-accent-grad-a),
            var(--theme-accent-grad-b)
        );

    transition:
        width 400ms ease;
}


/* ----------------------------------------------------------
   Question review
   ---------------------------------------------------------- */

.result17-review-section {
    padding:
        clamp(23px, 4vw, 35px);

    border:
        1px solid
        var(--theme-border);

    border-radius: 27px;

    background:
        var(--theme-surface);

    box-shadow:
        var(--theme-shadow-sm);
}


.result17-review-header {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 30px;

    margin-bottom: 26px;
}


.result17-review-header p {
    max-width: 650px;

    margin:
        8px 0
        0;

    color:
        var(--theme-text-soft);

    font-size: calc(12px * var(--font-scale));

    line-height: 1.7;
}


.result17-review-count {
    min-width: 76px;

    padding: 12px;

    border-radius: 15px;

    text-align: center;

    background:
        var(--theme-accent-soft);
}


.result17-review-count strong,
.result17-review-count span {
    display: block;
}


.result17-review-count strong {
    color:
        var(--theme-accent-strong);

    font-size: calc(25px * var(--font-scale));
}


.result17-review-count span {
    color:
        var(--theme-text-faint);

    font-size: calc(8px * var(--font-scale));

    text-transform: uppercase;
}


.result17-question-list {
    display: grid;

    gap: 12px;

    background: transparent;
}


.result17-question {
    padding: 22px;

    border:
        1px solid
        var(--theme-border);

    border-radius: 18px;

    background:
        var(--theme-surface-soft);
}


.result17-question.is-correct {
    border-left:
        4px solid #2eb889;
}


.result17-question.is-incorrect {
    border-left:
        4px solid #d55f59;
}


.result17-question-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 14px;
}


.result17-question-number {
    width: 35px;
    height: 35px;

    display: grid;

    place-items: center;

    border-radius: 11px;

    color:
        var(--theme-accent-strong);

    background:
        var(--theme-accent-soft);

    font-size: calc(9px * var(--font-scale));

    font-weight: 850;
}


.result17-status {
    padding:
        5px 9px;

    border-radius: 99px;

    font-size: calc(9px * var(--font-scale));

    font-weight: 800;
}


.result17-status.is-correct {
    color: #238363;

    background:
        rgba(46,184,137,.10);
}


.result17-status.is-incorrect {
    color: #bd504c;

    background:
        rgba(213,95,89,.10);
}


.result17-question h3 {
    margin:
        0 0
        18px;

    color:
        var(--theme-text);

    font-size: calc(15px * var(--font-scale));

    line-height: 1.6;
}


.result17-answer-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0,1fr));

    gap: 9px;
}


.result17-answer-grid > div {
    padding: 13px;

    border:
        1px solid
        var(--theme-border);

    border-radius: 13px;

    background:
        var(--theme-surface);
}


.result17-answer-grid span,
.result17-answer-grid strong {
    display: block;
}


.result17-answer-grid span {
    color:
        var(--theme-text-faint);

    font-size: calc(8px * var(--font-scale));

    font-weight: 800;

    letter-spacing: .07em;

    text-transform: uppercase;
}


.result17-answer-grid strong {
    margin-top: 4px;

    color:
        var(--theme-text);

    font-size: calc(11px * var(--font-scale));
}


.result17-explanation {
    margin-top: 12px;

    padding: 14px;

    border-radius: 13px;

    background:
        var(--theme-accent-soft);
}


.result17-explanation span {
    color:
        var(--theme-accent-strong);

    font-size: calc(8px * var(--font-scale));

    font-weight: 850;

    letter-spacing: .08em;

    text-transform: uppercase;
}


.result17-explanation p {
    margin:
        5px 0
        0;

    color:
        var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));

    line-height: 1.7;
}


/* ----------------------------------------------------------
   Empty
   ---------------------------------------------------------- */

.result17-empty {
    padding: 20px;

    border:
        1px dashed
        var(--theme-border-strong);

    border-radius: 14px;

    color:
        var(--theme-text-soft);

    text-align: center;

    font-size: calc(11px * var(--font-scale));
}


/* ----------------------------------------------------------
   Footer
   ---------------------------------------------------------- */

.result17-footer {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 25px;

    margin-top: 18px;

    padding: 24px;

    border:
        1px solid
        var(--theme-border);

    border-radius: 22px;

    background:
        var(--theme-surface);
}


.result17-footer span,
.result17-footer strong {
    display: block;
}


.result17-footer span {
    color:
        var(--theme-text-faint);

    font-size: calc(9px * var(--font-scale));

    font-weight: 800;

    letter-spacing: .08em;

    text-transform: uppercase;
}


.result17-footer strong {
    margin-top: 3px;

    color:
        var(--theme-text);

    font-size: calc(12px * var(--font-scale));
}


.result17-footer-actions {
    display: flex;

    flex-wrap: wrap;

    gap: 7px;
}


/* ----------------------------------------------------------
   DARK MODE
   ---------------------------------------------------------- */

html[data-theme="dark"]
.result17-summary-grid article,

html[data-theme="dark"]
.result17-section,

html[data-theme="dark"]
.result17-review-section,

html[data-theme="dark"]
.result17-footer {
    border-color:
        rgba(255,255,255,.08);

    background:
        #0b1b2d;
}


html[data-theme="dark"]
.result17-progress {
    background:
        #132b40;
}


html[data-theme="dark"]
.result17-question {
    border-color:
        rgba(255,255,255,.07);

    background:
        #10253b;
}


html[data-theme="dark"]
.result17-answer-grid > div {
    border-color:
        rgba(255,255,255,.07);

    background:
        #0b1b2d;
}


html[data-theme="dark"]
.result17-explanation {
    background:
        rgba(var(--theme-accent-rgb),.09);
}


/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */

@media (max-width: 850px) {

    .result17-hero {
        grid-template-columns: 1fr;
    }


    .result17-score-panel {
        min-height: auto;

        flex-direction: row;
    }


    .result17-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0,1fr));
    }


    .result17-analysis-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 600px) {

    .result17-score-panel {
        flex-direction: column;
    }


    .result17-score-ring {
        width: 145px;
        height: 145px;
    }


    .result17-review-header,
    .result17-footer {
        flex-direction: column;

        align-items: stretch;
    }


    .result17-review-count {
        width: 74px;
    }


    .result17-answer-grid {
        grid-template-columns: 1fr;
    }


    .result17-footer-actions {
        flex-direction: column;
    }


    .result17-footer-actions
    .public-button {
        width: 100%;
    }

}


@media (max-width: 420px) {

    .result17-summary-grid {
        grid-template-columns: 1fr;
    }


    .result17-metric-heading {
        align-items: flex-start;

        flex-direction: column;

        gap: 3px;
    }

}
/* Landing hero image card */

.aero-hero-visual-card {
    overflow: hidden;

    border-radius: 38px 38px 38px 13px;

    border: 1px solid var(--theme-border);

    background: var(--theme-surface);

    box-shadow: var(--theme-shadow-md);

    min-height: 500px;

    display: flex;

    align-items: center;

    justify-content: center;
}


.aero-hero-visual-image {
    width: 100%;
    height: 100%;

    min-height: 500px;

    object-fit: cover;

    display: block;
}

/* =========================================================
   Dark mode contrast safety net
   =========================================================

   Headings are painted with the fixed brand ink
   (h1..h4 { color: var(--aero-ink) }), and the dark-mode correction
   for that only ever covered .app-content - the signed-in shell.
   Public pages (sign in, register, password reset, landing) sit
   outside it, so in dark mode their headings kept a near-black ink on
   a near-black surface and became unreadable.

   Everything below re-points text at theme tokens wherever the
   .app-content rules do not reach. Light mode is unchanged: the tokens
   already resolve to the same inks there.
*/

html[data-theme="dark"] :where(
    .public-main,
    .public-shell,
    .auth-layout,
    .auth-card,
    .public-section,
    .public-card
) :where(h1, h2, h3, h4, h5, h6) {
    color: var(--theme-text);
}

/* The story panel keeps its own light-on-navy palette in both themes,
   so it must not be pulled back to the body text colour. */
html[data-theme="dark"] .auth-story :where(h1, h2, h3, h4, h5, h6) {
    color: #ffffff;
}

html[data-theme="dark"] .auth-story > p {
    color: rgba(255, 255, 255, .65);
}

/* Body copy placed directly in a card, without one of the labelled
   wrappers, used to inherit whatever the surrounding context gave it. */
.auth-card > p,
.auth-card li {
    color: var(--theme-text-soft);
    line-height: 1.7;
}

.auth-help {
    margin-top: 6px;
    color: var(--theme-text-faint);
    font-size: calc(10px * var(--font-scale));
    line-height: 1.6;
}

.auth-help ul {
    margin: 4px 0 0;
    padding-left: 16px;
}

/* An <a> styled as the primary action needs the button's centring. */
a.auth-submit {
    display: block;
    text-align: center;
    text-decoration: none;
}


/* =========================================================
   Legal pages (Terms of Use)
   ========================================================= */

.legal-page {
    width: min(calc(100% - 48px), 820px);

    margin: 48px auto 80px;
}

.legal-page h1 {
    margin: 10px 0 14px;

    font-size: calc(clamp(28px, 4vw, 40px) * var(--font-scale));

    letter-spacing: -.03em;
}

.legal-updated {
    max-width: 640px;

    margin-bottom: 32px;

    color: var(--theme-text-soft);

    line-height: 1.7;
}

.legal-body h2 {
    margin: 34px 0 10px;

    font-size: calc(18px * var(--font-scale));

    color: var(--theme-text);
}

.legal-body h2:first-child {
    margin-top: 0;
}

.legal-body p {
    margin: 0 0 12px;

    color: var(--theme-text-soft);

    line-height: 1.75;
}

.legal-body ul {
    margin: 0 0 14px;
    padding-left: 20px;

    color: var(--theme-text-soft);

    line-height: 1.75;
}

.legal-body li {
    margin-bottom: 6px;
}

.legal-body a {
    color: var(--theme-accent-strong);
}

.legal-back-link {
    margin-top: 36px;
}

.legal-back-link a {
    color: var(--theme-text-soft);

    font-size: calc(13px * var(--font-scale));

    text-decoration: none;
}

.legal-back-link a:hover {
    color: var(--theme-accent-strong);
}


/* Footer links (public shell) */

.public-footer-links {
    display: flex;
    align-items: center;

    gap: 16px;
}

.public-footer-links a {
    color: var(--theme-text-faint);

    text-decoration: none;

    font-size: calc(10px * var(--font-scale));
}

.public-footer-links a:hover {
    color: var(--theme-text-soft);
}


/* Terms-of-use checkbox on the registration form */

.auth-field-checkbox {
    margin-top: 4px;
}

.auth-checkbox-label {
    display: flex;
    align-items: flex-start;

    gap: 9px;

    cursor: pointer;
}

.auth-checkbox-label input[type="checkbox"] {
    flex: 0 0 auto;

    margin-top: 3px;

    width: 15px;
    height: 15px;

    accent-color: var(--theme-accent-strong);
}

.auth-checkbox-label span {
    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
    line-height: 1.6;
}

.auth-checkbox-label span a {
    color: var(--theme-accent-strong);
}


/* Topbar Help icon */

.topbar-help {
    display: grid;
    place-items: center;

    width: 32px;
    height: 32px;

    border: 1px solid var(--theme-border);
    border-radius: 12px;

    color: var(--theme-text-soft);
    background: var(--theme-surface);

    text-decoration: none;

    transition:
        color 150ms ease,
        background 150ms ease,
        transform 150ms ease;
}

.topbar-help:hover {
    color: var(--theme-accent-strong);
    background: var(--theme-surface-soft);
}

.topbar-help:active {
    transform: scale(0.94);
}

.topbar-help svg {
    width: 17px;
    height: 17px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* Guide list (public /help/ page) */

.help-group {
    margin-top: 32px;
}

.help-group:first-of-type {
    margin-top: 8px;
}

.help-group h2 {
    margin-bottom: 12px;

    font-size: calc(16px * var(--font-scale));

    color: var(--theme-text);
}

.help-group-highlighted h2 {
    color: var(--theme-accent-strong);
}

.help-guide-list {
    list-style: none;

    margin: 0;
    padding: 0;

    display: grid;
    gap: 10px;
}

.help-guide-list li {
    padding: 14px 16px;

    border: 1px solid var(--theme-border);
    border-radius: 12px;

    background: var(--theme-surface);
}

.help-guide-list a {
    display: block;

    margin-bottom: 3px;

    color: var(--theme-text);

    font-weight: 700;

    text-decoration: none;
}

.help-guide-list a:hover {
    color: var(--theme-accent-strong);
}

.help-guide-list span {
    color: var(--theme-text-soft);

    font-size: calc(12px * var(--font-scale));
}


/* =========================================================
   UI-11 - Avatars

   Each container already has its own size and radius; the mark just
   fills whichever it lands in. The gradient ground those containers
   carry is for the initial - a chosen mark brings its own, so it is
   painted over the top rather than blended with it.
   ========================================================= */

.avatar-mark {
    display: block;

    width: 100%;
    height: 100%;

    border-radius: inherit;

    object-fit: cover;
}

.user-avatar:has(.avatar-mark),
.topbar-user-avatar:has(.avatar-mark),
.account-avatar-large:has(.avatar-mark) {
    padding: 0;
    overflow: hidden;

    /* :has() is well supported now, but a browser without it simply
       shows the mark on the existing gradient - legible, just less
       tidy. Nothing depends on this rule. */
    background: transparent;
}


/* The picker */

.account-avatar-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-top: 4px;
    margin-bottom: 14px;
}

.avatar-choice {
    width: 44px;
    height: 44px;

    padding: 3px;

    border: 1px solid var(--theme-border);
    border-radius: 50%;

    background: var(--theme-surface);

    cursor: pointer;

    transition:
        border-color 150ms ease,
        transform 150ms ease,
        box-shadow 150ms ease;
}

.avatar-choice:hover {
    transform: translateY(-1px);
    border-color: var(--theme-border-strong);
}

.avatar-choice:active {
    transform: scale(0.95);
}

.avatar-choice:focus-visible {
    outline: 2px solid var(--theme-accent-strong);
    outline-offset: 2px;
}

.avatar-choice.is-active {
    border-color: var(--theme-accent-strong);

    box-shadow:
        0 0 0 1px var(--theme-surface),
        0 0 0 3px var(--theme-accent-strong);
}

.avatar-choice-face {
    display: grid;
    place-items: center;

    width: 100%;
    height: 100%;

    border-radius: 50%;

    object-fit: cover;
}

.avatar-choice-initial .avatar-choice-face {
    color: var(--theme-text);

    background: var(--theme-surface-soft);

    font-size: calc(16px * var(--font-scale));
    font-weight: 800;
}



/* =========================================================
   UI-10 - Charts

   A canvas has no intrinsic height, and Chart.js with
   maintainAspectRatio:false fills its parent - so the parent is what
   has to be sized. Without an explicit height here the canvas
   collapses to nothing on first paint and then grows on resize.
   ========================================================= */

.chart-frame {
    position: relative;

    height: 320px;

    margin-top: 6px;
    padding: 18px 16px 12px;

    border: 1px solid var(--theme-border);
    border-radius: var(--radius-md);

    background: var(--theme-surface);
    box-shadow: var(--theme-shadow-sm);
}

.chart-frame-tall {
    height: 420px;
}

/* A wide table scrolls inside its own width instead of widening the
   page. Scrolling only - no border or background of its own, so a
   table already inside a card does not become a box in a box. */
.table-overflow {
    max-width: 100%;
    overflow-x: auto;
}

.chart-frame canvas {
    display: block;
}

@media (max-width: 620px) {

    .chart-frame {
        height: 260px;
        padding: 14px 10px 8px;
    }

    .chart-frame-tall {
        height: 380px;
    }
}

/* Injected by charts.js (build with options.types) into whichever
   .chart-frame is passed to it - floats in the corner rather than
   taking a row of its own, since .chart-frame has a fixed height
   Chart.js's maintainAspectRatio:false expects to fill entirely. */

.chart-type-switcher {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;

    display: inline-flex;
    align-items: center;
    gap: 2px;

    padding: 3px;

    border: 1px solid var(--theme-border);
    border-radius: 10px;

    background: var(--theme-surface);
    box-shadow: var(--theme-shadow-sm);
}

.chart-type-option {
    padding: 4px 9px;

    border: 0;
    border-radius: 7px;

    background: transparent;

    font-size: calc(11px * var(--font-scale));
    font-weight: 600;
    color: var(--theme-text-soft);
    cursor: pointer;

    transition:
        background 150ms ease,
        color 150ms ease;
}

.chart-type-option:hover {
    background: var(--theme-surface-soft);
}

.chart-type-option--active,
.chart-type-option--active:hover {
    background: var(--theme-accent-strong);
    color: #fff;
}


/* A wide table scrolls inside its own box rather than pushing the
   page sideways. */

.table-scroll {
    overflow-x: auto;

    border: 1px solid var(--theme-border);
    border-radius: var(--radius-md);

    background: var(--theme-surface);
}

.review-table {
    width: 100%;

    border-collapse: collapse;

    font-size: calc(14px * var(--font-scale));
}

.review-table th,
.review-table td {
    padding: 11px 16px;

    text-align: left;

    border-bottom: 1px solid var(--theme-border);
}

.review-table thead th {
    color: var(--theme-text-soft);

    font-size: calc(12px * var(--font-scale));
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.review-table tbody tr:last-child th,
.review-table tbody tr:last-child td {
    border-bottom: 0;
}

.review-table tbody th {
    font-weight: 600;
}

.review-table td {
    color: var(--theme-text-soft);

    font-variant-numeric: tabular-nums;
}



/* =========================================================
   UI-09 - Palette picker

   Deliberately mirrors .theme-control: same height, same border,
   same radius, so the two controls read as one pair of settings
   rather than two unrelated widgets.
   ========================================================= */

.palette-control {
    display: inline-flex;
    align-items: center;
    gap: 2px;

    padding: 4px;

    border: 1px solid var(--theme-border);
    border-radius: 14px;

    background: var(--theme-surface);
    box-shadow: var(--theme-shadow-sm);
}

.palette-choice {
    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;

    padding: 0;

    border: 0;
    border-radius: 10px;

    background: transparent;

    cursor: pointer;

    transition:
        background 150ms ease,
        transform 150ms ease;
}

.palette-choice:hover {
    background: var(--theme-surface-soft);
}

.palette-choice:active {
    transform: scale(0.94);
}

.palette-choice:focus-visible {
    outline: 2px solid var(--theme-accent-strong);
    outline-offset: 2px;
}

.palette-swatch {
    width: 16px;
    height: 16px;

    border-radius: 999px;

    /* A ring rather than a border, so the swatch keeps its full
       diameter and the five dots stay the same visual weight. */
    box-shadow:
        0 0 0 1px rgba(15, 42, 67, 0.16) inset;

    transition:
        box-shadow 150ms ease,
        transform 150ms ease;
}

html[data-theme="dark"] .palette-swatch {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.22) inset;
}

.palette-choice.is-active .palette-swatch {
    transform: scale(1.12);

    box-shadow:
        0 0 0 2px var(--theme-surface),
        0 0 0 4px var(--theme-accent-strong);
}

/* On a narrow screen the topbar has no room for the picker, so the
   account centre carries the same controls - which is also where a
   preference belongs. There it stays visible at every width. */

.account-appearance-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;

    margin-top: 4px;
}

@media (max-width: 760px) {

    .account-appearance-controls .palette-control {
        display: inline-flex;
    }
}

/* The swatches show each palette's own colour, so they cannot use
   the accent tokens - those follow whatever is currently selected. */

.palette-skyline .palette-swatch { background: #48b9e8; }
.palette-copper .palette-swatch { background: #df9a5b; }
.palette-indigo .palette-swatch { background: #a49ef9; }
.palette-verdigris .palette-swatch { background: #5dc0a9; }
.palette-slate .palette-swatch { background: #97aec7; }

/* Below the sidebar breakpoint the topbar is tight; the picker is a
   preference, not a task, so it steps aside before anything else. */
@media (max-width: 760px) {

    .palette-control {
        display: none;
    }
}



/* =========================================================
   Role switcher

   Shown only to a user who is both an approved Teacher and an
   active Expert Reviewer - see templates/aeroesp/_role_switcher.html.
   Mirrors .theme-control / .palette-control: same height, border and
   radius, so the three read as one family of pill controls.
   ========================================================= */

.role-switcher {
    display: inline-flex;
    align-items: center;
    gap: 2px;

    padding: 4px;

    border: 1px solid var(--theme-border);
    border-radius: 14px;

    background: var(--theme-surface);
    box-shadow: var(--theme-shadow-sm);
}

.role-switcher-label {
    padding: 0 8px 0 6px;

    font-size: calc(12px * var(--font-scale));
    font-weight: 600;
    color: var(--theme-text-soft);
    white-space: nowrap;
}

.role-switcher-option {
    padding: 6px 12px;

    border-radius: 10px;

    font-size: calc(13px * var(--font-scale));
    font-weight: 600;
    color: var(--theme-text-soft);
    text-decoration: none;
    white-space: nowrap;

    transition:
        background 150ms ease,
        color 150ms ease;
}

.role-switcher-option:hover {
    background: var(--theme-surface-soft);
}

.role-switcher-option--active,
.role-switcher-option--active:hover {
    background: var(--theme-accent-strong);
    color: #fff;
}

/* In the sidebar the options are submit buttons of one form. */
.app-sidebar .role-switcher {
    display: flex;
    flex-wrap: wrap;

    margin: 0 0 14px;
}

.role-switcher-form {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 2px;

    margin: 0;
}

button.role-switcher-option {
    flex: 1 1 auto;

    border: 0;

    background: transparent;

    font-family: inherit;

    cursor: pointer;
}

.app-sidebar .role-switcher-label {
    flex-basis: 100%;

    padding: 2px 6px 4px;
}

@media (max-width: 760px) {

    .role-switcher-label {
        display: none;
    }
}



/* =========================================================
   UI-09 - Selectable colour palettes

   Only six tokens are redefined per palette. Everything else in
   this stylesheet derives from them, which is why a palette is a
   handful of declarations rather than a second stylesheet.

   Two roles, two accessibility rules:

     --theme-accent is decorative - low-alpha washes, glows, hover
     tints. Nothing is legible only because of it, so it is chosen
     for appearance and pinned to the same perceptual lightness as
     the default blue.

     --theme-accent-strong carries text and interactive state, and
     is solved numerically against the surface it sits on: at least
     4.5:1 (WCAG AA) in light mode, and matched to the existing
     design's brightness in dark mode, which is well beyond AA.

   Placed at the end of the file deliberately. The palette
   selectors and html[data-theme="dark"] have equal specificity in
   the light case, so source order decides.
   ========================================================= */

/* Skyline */
html[data-palette="skyline"] {
    --theme-accent: #48b9e8;
    --theme-accent-rgb: 72, 185, 232;
    --theme-accent-strong: #007eb4;
    --theme-accent-strong-rgb: 0, 126, 180;
    --theme-accent-grad-a: #02618b;
    --theme-accent-grad-b: #007baf;
}
html[data-palette="skyline"][data-theme="dark"] {
    --theme-accent: #55c7ef;
    --theme-accent-rgb: 85, 199, 239;
    --theme-accent-strong: #49baf9;
    --theme-accent-strong-rgb: 73, 186, 249;
    --theme-accent-grad-a: #02618b;
    --theme-accent-grad-b: #007baf;
}

/* Copper */
html[data-palette="copper"] {
    --theme-accent: #df9a5b;
    --theme-accent-rgb: 223, 154, 91;
    --theme-accent-strong: #af6400;
    --theme-accent-strong-rgb: 175, 100, 0;
    --theme-accent-grad-a: #884c00;
    --theme-accent-grad-b: #ab6100;
}
html[data-palette="copper"][data-theme="dark"] {
    --theme-accent: #eca667;
    --theme-accent-rgb: 236, 166, 103;
    --theme-accent-strong: #f09e50;
    --theme-accent-strong-rgb: 240, 158, 80;
    --theme-accent-grad-a: #884c00;
    --theme-accent-grad-b: #ab6100;
}

/* Indigo */
html[data-palette="indigo"] {
    --theme-accent: #a49ef9;
    --theme-accent-rgb: 164, 158, 249;
    --theme-accent-strong: #7469cd;
    --theme-accent-strong-rgb: 116, 105, 205;
    --theme-accent-grad-a: #5a4cae;
    --theme-accent-grad-b: #7165ca;
}
html[data-palette="indigo"][data-theme="dark"] {
    --theme-accent: #b1acfe;
    --theme-accent-rgb: 177, 172, 254;
    --theme-accent-strong: #aca7fe;
    --theme-accent-strong-rgb: 172, 167, 254;
    --theme-accent-grad-a: #5a4cae;
    --theme-accent-grad-b: #7165ca;
}

/* Verdigris */
html[data-palette="verdigris"] {
    --theme-accent: #5dc0a9;
    --theme-accent-rgb: 93, 192, 169;
    --theme-accent-strong: #008670;
    --theme-accent-strong-rgb: 0, 134, 112;
    --theme-accent-grad-a: #006756;
    --theme-accent-grad-b: #00826d;
}
html[data-palette="verdigris"][data-theme="dark"] {
    --theme-accent: #6acdb5;
    --theme-accent-rgb: 106, 205, 181;
    --theme-accent-strong: #41c4a9;
    --theme-accent-strong-rgb: 65, 196, 169;
    --theme-accent-grad-a: #006756;
    --theme-accent-grad-b: #00826d;
}

/* Slate */
html[data-palette="slate"] {
    --theme-accent: #97aec7;
    --theme-accent-rgb: 151, 174, 199;
    --theme-accent-strong: #5b799c;
    --theme-accent-strong-rgb: 91, 121, 156;
    --theme-accent-grad-a: #3f5d7e;
    --theme-accent-grad-b: #577699;
}
html[data-palette="slate"][data-theme="dark"] {
    --theme-accent: #a3bad4;
    --theme-accent-rgb: 163, 186, 212;
    --theme-accent-strong: #92b3d9;
    --theme-accent-strong-rgb: 146, 179, 217;
    --theme-accent-grad-a: #3f5d7e;
    --theme-accent-grad-b: #577699;
}


/* =========================================================
   Problem report form

   Replaces the mailto: link the footer and sidebar used to carry.
   Built from the same theme tokens as the rest of the public pages,
   so it follows the light/dark switch and the accent palette without
   any colour of its own.
   ========================================================= */

.report-problem-form {
    display: flex;
    flex-direction: column;
    gap: 6px;

    max-width: 640px;

    margin-top: 22px;
}

.report-problem-form label {
    margin-top: 12px;

    color: var(--theme-text);

    font-size: calc(13px * var(--font-scale));
    font-weight: 700;
}

.report-problem-form input[type="text"],
.report-problem-form textarea {
    width: 100%;

    padding: 12px 14px;

    border: 1px solid var(--theme-border);
    border-radius: 12px;

    color: var(--theme-text);
    background: var(--theme-surface);

    font: inherit;
    font-size: calc(14px * var(--font-scale));

    transition:
        border-color 150ms ease,
        box-shadow 150ms ease;
}

.report-problem-form textarea {
    min-height: 170px;
    resize: vertical;
}

.report-problem-form input[type="text"]:focus,
.report-problem-form textarea:focus {
    outline: none;

    border-color: var(--theme-accent-strong);

    box-shadow:
        0 0 0 3px
        rgba(var(--theme-accent-rgb), .18);
}

.report-problem-form button {
    align-self: flex-start;

    margin-top: 18px;
}

.report-problem-error {
    margin: 2px 0 0;

    color: var(--danger);

    font-size: calc(12.5px * var(--font-scale));
    font-weight: 600;
}

.report-problem-message {
    max-width: 640px;

    margin-top: 18px;
    padding: 12px 14px;

    border: 1px solid var(--theme-border);
    border-radius: 12px;

    background: var(--theme-surface-soft);

    font-size: calc(13.5px * var(--font-scale));
    font-weight: 600;
}

.report-problem-message--success {
    border-color: rgba(20, 133, 95, .35);
    color: var(--success);
}

.report-problem-message--error {
    border-color: rgba(200, 73, 73, .35);
    color: var(--danger);
}

.report-problem-fallback {
    margin-top: 26px;

    color: var(--theme-text-soft);

    font-size: calc(13px * var(--font-scale));
}


/* =========================================================
   Exam result reports

   The student's own breakdown and the teacher's class distribution.
   Both carry the figures as text beside the canvas, so the numbers
   survive a screen reader, a copy-paste and a chart that fails to
   draw.
   ========================================================= */

.exam-result-breakdown,
.exam-results-report {
    margin-top: 26px;
}

.exam-result-breakdown-list,
.exam-results-report-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    margin: 14px 0 0;
    padding: 0;

    list-style: none;
}

.exam-result-breakdown-list li,
.exam-results-report-list li {
    display: flex;
    align-items: baseline;
    gap: 8px;

    padding: 8px 12px;

    border: 1px solid var(--theme-border);
    border-radius: 10px;

    background: var(--theme-surface-soft);
}

.exam-result-breakdown-list span,
.exam-results-report-list span {
    color: var(--theme-text-soft);

    font-size: calc(12px * var(--font-scale));
    font-weight: 600;
}

.exam-result-breakdown-list strong,
.exam-results-report-list strong {
    color: var(--theme-text);

    font-size: calc(15px * var(--font-scale));
    font-weight: 800;

    font-variant-numeric: tabular-nums;
}



/* =========================================================
   UI-11 - Text size and typeface

   Account Center only. Mirrors .theme-control / .palette-control:
   same height, border and radius, so all four appearance settings
   read as one family of controls.
   ========================================================= */

.account-typography {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;

    margin-top: 16px;
}

.typography-field {
    display: grid;
    gap: 6px;

    min-width: 0;
}

.typography-label {
    color: var(--theme-text-soft);

    font-size: calc(12px * var(--font-scale));
    font-weight: 700;
    letter-spacing: .02em;
}

.typography-control {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;

    max-width: 100%;

    padding: 4px;

    border: 1px solid var(--theme-border);
    border-radius: 14px;

    background: var(--theme-surface);
    box-shadow: var(--theme-shadow-sm);
}

/* min-width/min-height rather than a fixed box: these labels grow
   with the very setting they control, and at step 5 a fixed 34px
   would clip the largest "A". */
.typography-choice {
    display: inline-grid;
    place-items: center;

    min-width: 34px;
    min-height: 34px;

    padding: 0 8px;

    border: 0;
    border-radius: 10px;

    color: var(--theme-text-soft);
    background: transparent;

    font: inherit;
    font-size: calc(13px * var(--font-scale));
    font-weight: 600;
    line-height: 1.2;

    cursor: pointer;

    transition:
        background 150ms ease,
        color 150ms ease,
        transform 150ms ease;
}

.typography-choice--wide {
    display: inline-flex;
    gap: 6px;

    padding: 0 12px;

    white-space: nowrap;
}

.typography-choice:hover {
    color: var(--theme-text);
    background: var(--theme-surface-soft);
}

.typography-choice:active {
    transform: scale(0.94);
}

.typography-choice:focus-visible {
    outline: 2px solid var(--theme-accent-strong);
    outline-offset: 2px;
}

.typography-choice.is-active {
    color: var(--theme-accent-strong);
    background: var(--theme-accent-soft);
}

/* Five steps of the same letter, so the control shows the scale it
   sets. They multiply by --font-scale like everything else: the
   relative steps are what matter, and the row stays readable at
   either end. */
.typography-size-sample { font-weight: 800; line-height: 1; }
.typography-size-1 { font-size: calc(11px * var(--font-scale)); }
.typography-size-2 { font-size: calc(13px * var(--font-scale)); }
.typography-size-3 { font-size: calc(15px * var(--font-scale)); }
.typography-size-4 { font-size: calc(17px * var(--font-scale)); }
.typography-size-5 { font-size: calc(19px * var(--font-scale)); }

/* Each typeface button is set in its own face, as a preview. The
   system one names the stack directly rather than var(--font-body),
   which by then may already be another choice. Keep the families in
   step with accounts/typography.py. */
.typography-font-system {
    font-family:
        Inter,
        "Avenir Next",
        "Segoe UI",
        Arial,
        sans-serif;
}

.typography-font-inter {
    font-family: "Inter Variable", "Segoe UI", Arial, sans-serif;
}

.typography-font-atkinson {
    font-family: "Atkinson Hyperlegible Next Variable", "Segoe UI", Arial, sans-serif;
}

.typography-font-source_serif {
    font-family: "Source Serif 4 Variable", Georgia, "Times New Roman", serif;
}

.typography-font-jetbrains_mono {
    font-family: "JetBrains Mono Variable", Consolas, "Courier New", monospace;
}

.typography-font-vazirmatn {
    font-family: "Vazirmatn", Tahoma, sans-serif;
}



/* =========================================================
   UI-12 - Teacher and student matching (mentorship app)
   ========================================================= */

.mentorship-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    align-items: start;
    gap: 14px 18px;
}

.mentorship-field {
    display: grid;
    gap: 6px;

    min-width: 0;
}

.mentorship-field label,
.mentorship-inline-form label span {
    color: var(--theme-text-soft);

    font-size: calc(12px * var(--font-scale));
    font-weight: 700;
}

.mentorship-field small {
    color: var(--theme-text-soft);

    font-size: calc(12px * var(--font-scale));
}

.mentorship-field .errorlist,
.mentorship-form > .errorlist {
    margin: 0;
    padding: 0;

    list-style: none;

    color: var(--danger);

    font-size: calc(12.5px * var(--font-scale));
    font-weight: 600;
}

/* Help text under one field would push it out of line with the
   others in a flex row; on a grid each field starts at the top and
   the button gets a row of its own. */
.mentorship-form > .errorlist,
.mentorship-form .teacher-toolbar-actions {
    grid-column: 1 / -1;
}

/* Date pickers and buttons in one row inside a table cell; wraps
   rather than widening the table on a phone. */
.mentorship-inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px 10px;
}

.mentorship-inline-form label {
    display: grid;
    gap: 4px;
}

.mentorship-inline-form input[type="date"] {
    max-width: 170px;
}

.mentorship-periods {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mentorship-period {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;

    padding: 8px 12px;

    border: 1px solid var(--theme-border);
    border-radius: 12px;

    background: var(--theme-surface);

    font-size: calc(13px * var(--font-scale));
}

.mentorship-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;

    margin-bottom: 22px;
}

@media (max-width: 860px) {

    .mentorship-split {
        grid-template-columns: minmax(0, 1fr);
    }
}

.mentorship-split h3,
.section > h3 {
    margin: 18px 0 10px;

    font-size: calc(15px * var(--font-scale));
}

.mentorship-topic-list {
    display: grid;
    gap: 6px;

    margin: 0 0 14px;
    padding: 0;

    list-style: none;
}

.mentorship-topic-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    padding: 8px 12px;

    border: 1px solid var(--theme-border);
    border-radius: 10px;

    background: var(--theme-surface-soft);
}

.mentorship-options {
    margin: 8px 0 0;
    padding-left: 22px;

    color: var(--theme-text-soft);

    font-size: calc(13px * var(--font-scale));
}

.mentorship-options .is-correct {
    color: var(--success);
    font-weight: 700;
}

.mentorship-options .is-wrong {
    color: var(--danger);
    text-decoration: line-through;
}


/* =========================================================
   UI-13 - Library (learning.Resource)

   The detail page renders in both shells - the public site for a
   signed-out visitor, the app for everyone else - so everything here
   reads the theme tokens rather than either shell's own classes.
   ========================================================= */

.library-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    margin-bottom: 22px;
}

.library-filter input[type="search"] {
    flex: 1 1 260px;
    min-width: 0;
}

.library-filter select {
    flex: 0 1 200px;
}

.resource-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.resource-card h3 a,
.resource-admin-card h3 a {
    color: inherit;
    text-decoration: none;
}

.resource-card h3 a:hover,
.resource-admin-card h3 a:hover {
    color: var(--theme-accent-strong);
}

.resource-author {
    margin: -4px 0 8px;

    color: var(--theme-text-soft);

    font-size: calc(13px * var(--font-scale));
    font-weight: 600;
}

.resource-ratings {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;

    margin: 8px 0;

    color: var(--theme-text-soft);

    font-size: calc(12.5px * var(--font-scale));
}

.resource-ratings strong {
    color: var(--theme-text);
}

.library-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    gap: 32px;

    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 0 48px;
}

@media (max-width: 860px) {

    .library-detail {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }
}

.library-detail-title {
    margin: 12px 0 16px;

    color: var(--theme-text);

    font-size: calc(clamp(26px, 3.4vw, 38px) * var(--font-scale));
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.library-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;

    margin: 0 0 24px;
}

.library-facts div {
    padding: 10px 12px;

    border: 1px solid var(--theme-border);
    border-radius: 12px;

    background: var(--theme-surface);
}

.library-facts dt {
    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.library-facts dd {
    margin: 4px 0 0;

    color: var(--theme-text);

    font-weight: 600;
    overflow-wrap: anywhere;
}

.library-abstract h2,
.library-ratings-block h2,
.library-rate-box h2 {
    margin: 0 0 8px;

    color: var(--theme-text);

    font-size: calc(16px * var(--font-scale));
}

.library-abstract p {
    color: var(--theme-text);

    line-height: 1.75;
}

.library-cover {
    display: block;

    width: 100%;
    max-height: 420px;
    margin-bottom: 16px;

    border: 1px solid var(--theme-border);
    border-radius: 16px;

    object-fit: cover;
}

.library-download-box,
.library-rate-box {
    display: grid;
    gap: 10px;

    margin-bottom: 16px;
    padding: 18px;

    border: 1px solid var(--theme-border);
    border-radius: 16px;

    background: var(--theme-surface);
    box-shadow: var(--theme-shadow-sm);
}

.library-download-button {
    justify-content: center;

    width: 100%;
}

.library-denied {
    margin: 0;
    padding: 10px 12px;

    border-radius: 10px;

    background: var(--warning-soft);
    color: var(--warning);

    font-size: calc(13.5px * var(--font-scale));
}

.library-denied strong {
    display: block;
    margin-bottom: 4px;
}

.library-scope-note {
    margin: 0;

    color: var(--theme-text-soft);

    font-size: calc(12px * var(--font-scale));
}

.library-stars {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;

    margin-bottom: 10px;
}

.library-stars input {
    position: absolute;

    opacity: 0;
    pointer-events: none;
}

.library-stars label {
    display: grid;
    place-items: center;

    min-width: 38px;
    min-height: 38px;

    border: 1px solid var(--theme-border);
    border-radius: 10px;

    background: var(--theme-surface-soft);
    color: var(--theme-text);

    font-weight: 800;

    cursor: pointer;
}

.library-stars input:checked + label {
    border-color: var(--theme-accent-strong);

    background: var(--theme-accent-soft);
    color: var(--theme-accent-strong);
}

.library-stars input:focus-visible + label {
    outline: 2px solid var(--theme-accent-strong);
    outline-offset: 2px;
}



/* =========================================================
   UI-14 - Reading passage above a question
   ========================================================= */

.question-passage {
    margin: 0 0 18px;
    padding: 14px 18px;

    border: 1px solid var(--theme-border);
    border-left: 4px solid var(--theme-accent-strong);
    border-radius: 14px;

    background: var(--theme-surface-soft);
}

.question-passage summary {
    color: var(--theme-accent-strong);

    font-size: calc(12px * var(--font-scale));
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;

    cursor: pointer;
}

.question-passage-body {
    max-height: 420px;
    margin-top: 10px;
    overflow-y: auto;

    color: var(--theme-text);

    line-height: 1.75;
}

.question-passage-body p {
    margin: 0 0 10px;
}


/* =========================================================
   UI-15 - Reviewer specialty and two-stage bank status
   ========================================================= */

.specialty-banner {
    margin-bottom: 18px;
}

.specialty-banner p {
    margin: 0;
}

.specialty-banner--todo {
    border-color: var(--warning);

    background: var(--warning-soft);
}

.specialty-banner .button {
    margin-left: 8px;
}

.specialty-hidden {
    margin-top: 8px !important;

    color: var(--theme-text-soft);

    font-size: calc(13px * var(--font-scale));
}

.specialty-form {
    display: grid;
    gap: 16px;
}

.specialty-track {
    margin: 0;
    padding: 14px 16px;

    border: 1px solid var(--theme-border);
    border-radius: 14px;
}

.specialty-track legend {
    padding: 0 6px;

    color: var(--theme-text);

    font-weight: 800;
}

.specialty-track legend label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.specialty-track ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 6px 16px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.specialty-track li label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.specialty-hint {
    margin: 4px 0 8px;

    color: var(--theme-text-soft);

    font-size: calc(12.5px * var(--font-scale));
}

.specialty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bank-note {
    margin-bottom: 18px;
}

.bank-note p {
    margin: 0;
}

.bank-total {
    margin: 10px 0 0;

    color: var(--theme-text-soft);

    font-size: calc(13px * var(--font-scale));
}



/* =========================================================
   UI-16 - Sample (demo) questions

   Deliberately loud: a full-width amber strip directly above the
   question (and above its reading passage, if it has one), not a
   small badge in a corner. Amber rather than the accent colour so it
   reads as a caution in every palette, light or dark.
   ========================================================= */

.demo-question-flag {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;

    margin: 0 0 14px;
    padding: 10px 14px;

    border: 1px solid rgba(183, 116, 24, .45);
    border-left: 5px solid var(--warning);
    border-radius: 12px;

    background: var(--warning-soft);
    color: #7a4a0c;
}

.demo-question-flag-mark {
    display: grid;
    place-items: center;

    width: 24px;
    height: 24px;

    border-radius: 50%;

    background: var(--warning);
    color: #fff;

    font-size: calc(13px * var(--font-scale));
    font-style: italic;
    font-weight: 800;
}

.demo-question-flag-text {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;

    font-size: calc(14px * var(--font-scale));
}

.demo-question-flag-text strong {
    letter-spacing: .02em;
    text-transform: uppercase;
}

.demo-question-flag-note {
    margin-left: auto;

    font-size: calc(12.5px * var(--font-scale));
    opacity: .9;
}

@media (max-width: 560px) {

    .demo-question-flag-note {
        margin-left: 0;
        flex-basis: 100%;
    }
}

html[data-theme="dark"] .demo-question-flag {
    border-color: rgba(240, 180, 90, .45);

    background: rgba(183, 116, 24, .16);
    color: #f5d29a;
}

.demo-notice {
    margin: 0 0 20px;
    padding: 14px 18px;

    border: 1px solid rgba(183, 116, 24, .35);
    border-radius: 16px;

    background: var(--warning-soft);
    color: #6b4210;
}

.demo-notice strong {
    display: block;
    margin-bottom: 4px;

    font-size: calc(15px * var(--font-scale));
}

.demo-notice p {
    margin: 0 0 6px;

    font-size: calc(13.5px * var(--font-scale));
    line-height: 1.6;
}

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

html[data-theme="dark"] .demo-notice {
    border-color: rgba(240, 180, 90, .35);

    background: rgba(183, 116, 24, .14);
    color: #f1d3a4;
}

.result17-saved {
    margin-top: 10px;

    font-size: calc(14px * var(--font-scale));
    font-weight: 600;
}



.diagnostic-demo-note {
    margin: 0 0 12px;

    color: var(--warning);

    font-size: calc(13px * var(--font-scale));
    font-weight: 600;
}



/* =========================================================
   UI-17 - Rotating readings of "ESP" beside the AeroESP name

   The list and the @keyframes stops come from config/branding.py,
   through templates/aeroesp/_name_readings.html. Here: a box of
   fixed height (it scales with the reader's text size, and never
   with the reading), readings stacked in it and faded in turn, and
   the two places it lives.

   Desktop: inline beside the logo (public) or the workspace name
   (app), behind a hairline divider. Phone: a full-width row of its
   own under the header, because there is no room beside anything
   there - the header's height is then fixed at the taller size, so
   it still does not move as the text changes.
   ========================================================= */

:root {
    --reading-height: calc(20px * var(--font-scale));
}

.name-readings-slot {
    display: flex;
    align-items: center;

    min-width: 0;
    margin-right: auto;
    margin-left: 4px;
    padding-left: 16px;

    border-left: 1px solid var(--theme-border);
}

.name-readings {
    position: relative;

    display: block;

    width: min(380px, 34vw);
    height: var(--reading-height);

    overflow: hidden;
}

.name-reading {
    position: absolute;
    inset: 0;

    overflow: hidden;

    color: var(--theme-accent-strong);

    font-size: calc(12.5px * var(--font-scale));
    font-weight: 700;
    letter-spacing: .02em;
    line-height: var(--reading-height);
    text-overflow: ellipsis;
    white-space: nowrap;

    opacity: 0;

    animation-name: aeroesp-name-reading;
    animation-duration: var(--reading-cycle, 40s);
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    animation-fill-mode: both;
}

/* Paused while the reader is using the header - so a reading can be
   read to the end, and nothing moves under a pointer or focus ring. */
.public-header:hover .name-reading,
.public-header:focus-within .name-reading,
.app-topbar:hover .name-reading,
.app-topbar:focus-within .name-reading {
    animation-play-state: paused;
}

.name-readings-sr {
    position: absolute;

    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;

    overflow: hidden;

    clip: rect(0 0 0 0);
    white-space: nowrap;

    border: 0;
}

/* Reduced motion: no animation at all - the first reading, still. */
@media (prefers-reduced-motion: reduce) {

    .name-reading {
        animation: none;
        opacity: 0;
        transform: none;
    }

    .name-reading:first-child {
        opacity: 1;
    }
}

/* ---- Public header on a phone: a row of its own ---- */

@media (max-width: 760px) {

    .public-header-inner {
        flex-wrap: wrap;
        row-gap: 0;
    }

    .name-readings-slot--public {
        order: 3;
        flex-basis: 100%;

        margin: 0 0 8px;
        padding-left: 0;

        border-left: 0;
    }

    .name-readings-slot--public .name-readings {
        width: 100%;
    }
}

/* ---- App topbar on a phone: a row of its own ---- */

@media (max-width: 860px) {

    /* The topbar grows by one reading row. Setting the variable,
       not just the height, keeps everything that is positioned from
       the topbar's height (sticky offsets, min-heights) in step. */
    :root {
        --topbar-height: calc(68px + var(--reading-height) + 6px);
    }

    .app-topbar {
        height: var(--topbar-height);

        flex-wrap: wrap;
        align-content: center;
        row-gap: 2px;
    }

    .name-readings-slot--app {
        order: 3;
        flex-basis: 100%;

        margin: 0;
        padding-left: 0;

        border-left: 0;
    }

    .name-readings-slot--app .name-readings {
        width: 100%;
    }
}

.library-eyebrow {
    margin: 0 0 10px;

    color: var(--theme-accent-strong);

    font-size: calc(11.5px * var(--font-scale));
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}


/* The public logo sits in a shrink-to-fit box with a percentage width
   (min(220px, 100%)), so the box sized itself from the image's natural
   1804px and took the whole row - invisible until something needed to
   sit beside it. A definite width, the 220px the logo already shows
   at, lets the readings sit next to it. Desktop only: on a phone the
   readings have their own row and the logo keeps shrinking as before. */
@media (min-width: 761px) {

    .public-header-inner > .aero-brand {
        flex: 0 0 auto;
    }

    .public-header-inner .aero-brand__logo {
        width: 220px;
    }
}




/* =========================================================
   UI-18 - Time zone setting (Account Center)
   ========================================================= */

.timezone-form {
    display: grid;
    gap: 6px;

    margin-top: 18px;
}

.timezone-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.timezone-row input {
    flex: 1 1 220px;
    min-width: 0;
}

.timezone-hint {
    margin: 0;

    color: var(--theme-text-soft);

    font-size: calc(12.5px * var(--font-scale));
}

.timezone-tag {
    margin-left: 4px;

    color: var(--theme-text-soft);

    font-size: calc(11px * var(--font-scale));
    font-weight: 600;
}

.timezone-note {
    margin: 0 0 14px;
    padding: 10px 14px;

    border: 1px solid var(--theme-border);
    border-radius: 12px;

    background: var(--theme-surface-soft);
    color: var(--theme-text-soft);

    font-size: calc(13px * var(--font-scale));
}




/* =========================================================
   UI-19 - Topbar clock / stopwatch

   Fixed width and the readings' fixed height, with tabular figures,
   so neither a changing digit nor a mode switch moves the topbar.
   ========================================================= */

.topbar-timer {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: baseline;
    gap: 6px;

    height: var(--reading-height);
    margin-left: 14px;
    padding-left: 14px;

    border-left: 1px solid var(--theme-border);

    color: var(--theme-text);

    font-size: calc(12.5px * var(--font-scale));
    line-height: var(--reading-height);
    white-space: nowrap;
}

.topbar-timer[data-mode="OFF"] {
    display: none;
}

.topbar-timer-label {
    color: var(--theme-text-soft);

    font-size: calc(10.5px * var(--font-scale));
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.topbar-timer-value {
    min-width: 8ch;

    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.topbar-timer[data-mode="CLOCK"] .topbar-timer-value {
    min-width: 5ch;
}

.topbar-timer.is-idle .topbar-timer-value {
    opacity: .55;
}

.name-readings-slot--app .name-readings {
    flex: 1 1 auto;
}

@media (max-width: 860px) {

    .name-readings-slot--app {
        align-items: center;
    }

    .name-readings-slot--app .name-readings {
        width: auto;
        min-width: 0;
    }
}

.timer-field {
    margin-top: 18px;
}

.study-time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;

    margin-bottom: 16px;
}

.study-time-grid article {
    display: grid;
    gap: 4px;

    padding: 14px 16px;

    border: 1px solid var(--theme-border);
    border-radius: 14px;

    background: var(--theme-surface);
}

.study-time-grid span {
    color: var(--theme-text-soft);

    font-size: calc(11.5px * var(--font-scale));
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.study-time-grid strong {
    color: var(--theme-text);

    font-size: calc(20px * var(--font-scale));
}

.study-time-note {
    margin: 10px 0 0;

    color: var(--theme-text-soft);

    font-size: calc(12.5px * var(--font-scale));
}


/* =========================================================
   UI-20 - Teacher courses and storage
   ========================================================= */

/* The "Adding to: ..." line on the journal item form - was an inline
   style with a fixed light background. */
.item-form-scope {
    margin-bottom: 20px;
    padding: 12px 14px;

    border-radius: 8px;

    color: var(--theme-text);
    background: var(--theme-surface-soft);
}

.button-small {
    min-height: 32px;
    padding: 4px 12px;

    font-size: calc(12.5px * var(--font-scale));
}

.storage-meter {
    display: grid;
    gap: 8px;

    margin: 0 0 22px;
    padding: 16px 18px;

    border: 1px solid var(--theme-border);
    border-radius: 16px;

    background: var(--theme-surface);
    box-shadow: var(--theme-shadow-sm);
}

.storage-meter-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;

    color: var(--theme-text);
    font-size: calc(14px * var(--font-scale));
}

.storage-meter-head span {
    color: var(--theme-text-soft);
    font-size: calc(13px * var(--font-scale));
}

.storage-meter-bar {
    height: 8px;
    overflow: hidden;

    border-radius: 999px;

    background: var(--theme-surface-soft);
}

.storage-meter-bar span {
    display: block;
    height: 100%;
    min-width: 2px;

    border-radius: inherit;

    background: var(--theme-accent);
}

.storage-meter-bar.is-high span {
    background: var(--warning);
}

.storage-meter-bar.is-full span {
    background: var(--danger);
}

.storage-meter-note {
    margin: 0;

    color: var(--theme-text-soft);
    font-size: calc(12.5px * var(--font-scale));
    line-height: 1.5;
}

.storage-table-card {
    padding: 18px;
}

.storage-table {
    width: 100%;
    border-collapse: collapse;

    font-size: calc(13.5px * var(--font-scale));
}

.storage-table th,
.storage-table td {
    padding: 10px 12px;

    border-bottom: 1px solid var(--theme-border);

    text-align: left;
    white-space: nowrap;
}

.storage-table th {
    color: var(--theme-text-soft);
    font-size: calc(12px * var(--font-scale));
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.storage-table td small {
    display: block;

    color: var(--theme-text-soft);
    font-size: calc(12px * var(--font-scale));
}

.course-material-list {
    display: grid;
    gap: 14px;

    margin-bottom: 26px;
}

.course-material {
    display: grid;
    gap: 12px;

    padding: 16px 18px;

    border: 1px solid var(--theme-border);
    border-radius: 16px;

    background: var(--theme-surface);
    box-shadow: var(--theme-shadow-sm);
}

.course-material-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px 16px;
}

.course-material-head h3 {
    margin: 6px 0 4px;

    font-size: calc(17px * var(--font-scale));
}

.course-material-head p {
    margin: 0;
}

.course-material-note {
    color: var(--theme-text-soft);
    line-height: 1.55;
}

.course-material-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.course-material-actions form {
    margin: 0;
}

.course-material-body {
    min-width: 0;
}

.course-player {
    display: block;
    width: 100%;
    max-width: 720px;
}

.course-player--video {
    max-height: 420px;

    border-radius: 12px;

    background: #000;
}

.course-image-link {
    display: inline-block;
    max-width: 100%;
}

.course-image {
    display: block;
    max-width: min(100%, 720px);
    max-height: 480px;

    border: 1px solid var(--theme-border);
    border-radius: 12px;
}

.course-add-shell h2 {
    margin-top: 0;
}

.course-delete-form {
    margin-top: 18px;
}

.class-course-section {
    margin-top: 34px;
}

.class-course-section h2 {
    margin: 4px 0 16px;
}


/* =========================================================
   UI-21 - Pending teacher: how to speed up the review
   ========================================================= */

.pending-help {
    width: 100%;
    margin-top: 18px;
    padding-top: 22px;

    border-top: 1px solid var(--theme-border);
}

.pending-help h2 {
    margin: 0 0 8px;

    color: var(--theme-text);
    font-size: calc(21px * var(--font-scale));
}

.pending-help > p {
    max-width: 610px;
    margin: 0 0 16px;

    color: var(--theme-text-soft);
    line-height: 1.7;
}

.pending-help a {
    color: var(--theme-accent-strong);
    overflow-wrap: anywhere;
}

.pending-sample {
    margin-top: 14px;
    padding: 14px 16px;

    border: 1px solid var(--theme-border);
    border-radius: 16px;

    background: var(--theme-surface-soft);
}

.pending-sample-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;

    margin-bottom: 10px;
}

.pending-sample-head h3 {
    margin: 0;

    color: var(--theme-text);
    font-size: calc(15px * var(--font-scale));
}

.pending-sample-text {
    max-height: 260px;
    margin: 0;
    padding: 12px 14px;
    overflow: auto;

    border: 1px solid var(--theme-border);
    border-radius: 12px;

    color: var(--theme-text);
    background: var(--theme-surface);

    font-family: var(--font-body);
    font-size: calc(13px * var(--font-scale));
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}


/* =========================================================
   UI-22 - Support AeroESP (donations)
   Quiet on purpose: no accent-filled banners, no urgency.
   ========================================================= */

.support-page {
    display: grid;
    gap: 22px;

    width: min(100%, 860px);
    margin: 15px auto 30px;
}

.support-page > section {
    padding: clamp(20px, 4vw, 34px);

    border: 1px solid var(--theme-border);
    border-radius: 22px;

    background: var(--theme-surface);
    box-shadow: var(--theme-shadow-sm);
}

.support-page h1 {
    margin: 10px 0 14px;

    color: var(--theme-text);
    font-size: calc(clamp(28px, 4.5vw, 40px) * var(--font-scale));
    line-height: 1.1;
    letter-spacing: -.03em;
}

.support-page h2 {
    margin: 0 0 10px;

    color: var(--theme-text);
    font-size: calc(19px * var(--font-scale));
}

.support-page p {
    margin: 0 0 12px;

    color: var(--theme-text-soft);
    line-height: 1.7;
}

.support-page a {
    color: var(--theme-accent-strong);
}

.support-page > section.support-purposes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;

    padding: 0;

    border: 0;

    background: transparent;
    box-shadow: none;
}

.support-purpose {
    padding: 18px 20px;

    border: 1px solid var(--theme-border);
    border-radius: 18px;

    background: var(--theme-surface);
}

.support-purpose h2 {
    font-size: calc(16px * var(--font-scale));
}

.support-purpose p {
    margin: 0;

    font-size: calc(14px * var(--font-scale));
}

.support-form {
    display: grid;
    gap: 16px;
}

.support-field {
    display: grid;
    gap: 6px;

    margin: 0;
    padding: 0;

    border: 0;
}

.support-field > label,
.support-field legend {
    color: var(--theme-text);
    font-size: calc(14px * var(--font-scale));
    font-weight: 700;
}

.support-field legend {
    margin-bottom: 6px;
}

.support-field small {
    color: var(--theme-text-soft);
    font-size: calc(12.5px * var(--font-scale));
}

.support-field input[type="number"],
.support-field input[type="text"],
.support-field textarea {
    width: 100%;
    max-width: 420px;
    padding: 10px 12px;

    border: 1px solid var(--theme-border-strong);
    border-radius: 12px;

    color: var(--theme-text);
    background: var(--theme-surface);

    font: inherit;
}

.support-field textarea {
    max-width: 100%;
}

.support-field ul {
    display: grid;
    gap: 8px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.support-field ul label {
    display: flex;
    align-items: center;
    gap: 10px;

    color: var(--theme-text);
    font-size: calc(14px * var(--font-scale));
}

.support-field--check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.support-field--check label {
    font-weight: 500;
}

.support-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.support-preset {
    padding: 7px 14px;

    border: 1px solid var(--theme-border-strong);
    border-radius: 999px;

    color: var(--theme-text);
    background: var(--theme-surface);

    font: inherit;
    font-size: calc(13.5px * var(--font-scale));
    font-weight: 600;

    cursor: pointer;
}

.support-preset:hover,
.support-preset.is-active {
    border-color: var(--theme-accent);
    background: var(--theme-accent-soft);
}

.support-closed {
    padding: 14px 16px;

    border-radius: 14px;

    background: var(--theme-surface-soft);
}

.support-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;

    margin: 14px 0;
}

.support-total {
    display: grid;
    gap: 4px;

    padding: 14px 16px;

    border: 1px solid var(--theme-border);
    border-radius: 14px;

    background: var(--theme-surface-soft);
}

.support-total span,
.support-total small {
    color: var(--theme-text-soft);
    font-size: calc(12.5px * var(--font-scale));
}

.support-total strong {
    color: var(--theme-text);
    font-size: calc(17px * var(--font-scale));
}

.support-recent {
    display: grid;
    gap: 0;

    margin: 0;
    padding: 0;

    list-style: none;
}

.support-recent li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;

    padding: 10px 0;

    border-top: 1px solid var(--theme-border);

    font-size: calc(14px * var(--font-scale));
}

.support-recent li span,
.support-recent li time {
    color: var(--theme-text-soft);
}

.support-recent li time {
    margin-left: auto;
}


/* =========================================================
   UI-23 - AI question generation: one card component
   Every block is the site's standard card: the templates put
   .teacher-data-card (the question bank's card) on .gen-panel,
   .gen-card and .gen-notice, so border, radius, shadow, background
   and padding come from that one rule in both themes. The gen-*
   rules below only lay out what is inside; nothing inside a card
   draws a border of its own. Theme tokens only.

   Inner class names avoid "card", "panel", "stat", "badge", "pill"
   and "tag": the dark theme's catch-alls paint any element whose
   class contains one of those as a card or a badge, which would draw
   a box behind every row and recolour the status.
   ========================================================= */

.gen-layout {
    display: grid;
    gap: 20px;

    min-width: 0;
}

.gen-panel,
.gen-card,
.gen-notice {
    min-width: 0;
}

.gen-panel h2,
.gen-results > h2,
.gen-notice h2 {
    margin: 0 0 6px;

    color: var(--theme-text);
    font-size: calc(18px * var(--font-scale));
}

.gen-lead {
    margin: 0 0 18px;

    color: var(--theme-text-soft);
    line-height: 1.6;
}

/* ---- the settings form: label above field, two columns ---- */

.gen-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.gen-field {
    display: grid;
    align-content: start;
    gap: 6px;

    min-width: 0;
}

.gen-field--wide {
    grid-column: 1 / -1;
}

.gen-field label {
    color: var(--theme-text);
    font-size: calc(13px * var(--font-scale));
    font-weight: 700;
}

.gen-field select,
.gen-field input,
.gen-field textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;

    border: 1px solid var(--theme-border-strong);
    border-radius: 12px;

    color: var(--theme-text);
    background: var(--theme-surface);

    font: inherit;
    font-size: calc(14px * var(--font-scale));
}

.gen-field textarea {
    min-height: 110px;
    resize: vertical;
}

.gen-field small {
    color: var(--theme-text-soft);
    font-size: calc(12px * var(--font-scale));
}

.gen-field-error {
    color: var(--danger-text);
    font-size: calc(12.5px * var(--font-scale));
}

.gen-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;

    margin-top: 20px;
}

.gen-form-actions .button {
    margin: 0;
}

.gen-form-actions .button[disabled] {
    cursor: progress;
    opacity: .7;
}

.gen-form-note {
    margin: 0;

    color: var(--theme-text-soft);
    font-size: calc(12.5px * var(--font-scale));
}

/* ---- states: loading, error, empty ---- */

.gen-live-region:empty {
    display: none;
}

.gen-notice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.gen-notice[hidden] {
    display: none;
}

.gen-notice p {
    margin: 4px 0 0;

    color: var(--theme-text-soft);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* An error is a standard card too; it says what it is with a label
   (.gen-flag--error) and its title, not with a fill of its own. */
.gen-notice--error {
    display: block;
}

.gen-notice--error .gen-flag {
    display: inline-block;
    margin-bottom: 10px;
}

.gen-notice--error a {
    font-weight: 700;
}

.gen-notice-hint {
    font-size: calc(12.5px * var(--font-scale));
}

.gen-spinner {
    flex: 0 0 auto;

    width: 22px;
    height: 22px;
    margin-top: 2px;

    border: 3px solid var(--theme-accent-soft);
    border-top-color: var(--theme-accent-strong);
    border-radius: 50%;

    animation: gen-spin .9s linear infinite;
}

@keyframes gen-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gen-spinner {
        animation-duration: 3s;
    }
}

.gen-notice--empty {
    justify-content: center;

    text-align: center;
}

.gen-notice--empty h3 {
    margin: 0;

    font-size: calc(15px * var(--font-scale));
}

/* ---- results ---- */

.gen-results {
    display: grid;
    gap: 16px;

    min-width: 0;
}

.gen-results > h2 {
    margin-top: 8px;
}

/* ---- the question card ---- */

.gen-card {
    display: grid;
    gap: 16px;
}

.gen-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.gen-flag {
    padding: 4px 10px;

    border-radius: 999px;

    color: var(--info-text);
    background: var(--info-soft);

    font-size: calc(11.5px * var(--font-scale));
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.gen-flag--accepted {
    color: var(--success-text);
    background: var(--success-soft);
}

.gen-flag--rejected,
.gen-flag--error {
    color: var(--danger-text);
    background: var(--danger-soft);
}

.gen-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.gen-labels li {
    padding: 3px 9px;

    border-radius: 999px;

    color: var(--theme-text-soft);
    background: var(--theme-surface-soft);

    font-size: calc(12px * var(--font-scale));
}

.gen-stem {
    margin: 0;

    color: var(--theme-text);
    font-size: calc(17px * var(--font-scale));
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.gen-options {
    display: grid;
    gap: 6px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.gen-option {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;

    padding: 10px 12px;

    border-radius: 12px;

    background: var(--theme-surface-soft);
}

.gen-option-letter {
    display: grid;
    place-items: center;

    width: 30px;
    height: 30px;

    border-radius: 50%;

    color: var(--theme-text-soft);
    background: var(--theme-surface);

    font-size: calc(13px * var(--font-scale));
    font-weight: 800;
}

.gen-option-text {
    align-self: center;

    color: var(--theme-text);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.gen-option-mark {
    align-self: center;

    color: var(--success-text);
    font-size: calc(12px * var(--font-scale));
    font-weight: 800;
    white-space: nowrap;
}

.gen-option.is-correct {
    background: var(--success-soft);
}

.gen-option.is-correct .gen-option-letter {
    color: var(--theme-surface);
    background: var(--success);
}

.gen-panel .gen-section {
    margin-top: 18px;
}

.gen-section h3,
.gen-section h4 {
    margin: 0 0 4px;

    color: var(--theme-text-soft);
    font-size: calc(12px * var(--font-scale));
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.gen-section p {
    margin: 0;

    color: var(--theme-text);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.gen-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px 18px;

    margin: 0;
    padding-top: 14px;

    border-top: 1px solid var(--theme-border);
}

.gen-meta dt {
    color: var(--theme-text-soft);
    font-size: calc(11.5px * var(--font-scale));
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.gen-meta dd {
    margin: 2px 0 0;

    color: var(--theme-text);
    font-size: calc(13.5px * var(--font-scale));
    overflow-wrap: anywhere;
}

.gen-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;

    padding-top: 14px;

    border-top: 1px solid var(--theme-border);
}

.gen-actions form {
    margin: 0;
}

.gen-actions .button {
    margin: 0;
}

.gen-note {
    color: var(--theme-text-soft);
    font-size: calc(12.5px * var(--font-scale));
}

.gen-timeline {
    display: grid;
    gap: 0;

    margin: 0;
    padding: 0;

    list-style: none;
}

.gen-timeline li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;

    padding: 10px 0;

    border-top: 1px solid var(--theme-border);
}

.gen-timeline li:first-child {
    border-top: 0;
}

.gen-timeline span,
.gen-timeline time {
    color: var(--theme-text-soft);
    font-size: calc(13px * var(--font-scale));
}

.gen-timeline time {
    margin-left: auto;
}

@media (max-width: 620px) {

    .gen-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .gen-option {
        grid-template-columns: 30px minmax(0, 1fr);
    }

    .gen-option-mark {
        grid-column: 2;
    }

    .gen-actions .button,
    .gen-actions form {
        flex: 1 1 100%;
    }

    .gen-actions form .button {
        width: 100%;
    }
}


/* =========================================================
   UI-24 - Account Center sections and themed avatars
   ========================================================= */

/* ---- layout: section list beside small cards ---- */

.account-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}

.account-sections {
    display: grid;
    gap: 18px;

    min-width: 0;
}

.account-section {
    scroll-margin-top: calc(var(--topbar-height) + 18px);
}

.account-section-nav {
    position: sticky;
    top: calc(var(--topbar-height) + 18px);

    display: grid;
    gap: 2px;

    padding: 10px;

    border: 1px solid var(--theme-border);
    border-radius: 18px;

    background: var(--theme-surface);
    box-shadow: var(--theme-shadow-sm);
}

/* Specific enough to outrank the dark theme's rule for links in
   .app-content, so the list reads the same in both themes. */
:root .app-content .account-layout .account-section-nav a.account-section-link {
    display: block;

    padding: 9px 12px;

    border-radius: 12px;

    color: var(--theme-text-soft);

    font-size: calc(13.5px * var(--font-scale));
    font-weight: 650;
    text-decoration: none;
}

:root .app-content .account-layout .account-section-nav a.account-section-link:hover {
    color: var(--theme-text);
    background: var(--theme-surface-soft);
}

:root .app-content .account-layout .account-section-nav a.account-section-link[aria-current="true"] {
    color: var(--theme-accent-strong);
    background: var(--theme-accent-soft);
}

.account-security-card .account-info-list .button {
    margin: 0;
}

.account-session-copy {
    margin-top: 18px;
}

.account-email-form {
    margin-bottom: 8px;
}

.account-password-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.account-password-actions .button {
    margin: 0;
}

@media (max-width: 900px) {

    .account-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    /* A row that scrolls sideways, held under the topbar. */
    .account-section-nav {
        top: var(--topbar-height);
        z-index: 5;

        display: flex;
        gap: 4px;

        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;

        padding: 6px;
    }

    .account-section-nav::-webkit-scrollbar {
        display: none;
    }

    :root .app-content .account-layout .account-section-nav a.account-section-link {
        flex: 0 0 auto;

        white-space: nowrap;
    }
}

/* ---- avatars: drawn inline, painted from the palette and theme ----
   The colours are the tokens --avatar-ground / --avatar-ink /
   --avatar-soft, defined in the theme blocks (UI-04) from the accent
   palette, so a palette or theme change repaints every avatar: the
   sidebar's, the topbar's, the Account Center's and the picker's. */

.avatar-svg {
    display: block;

    width: 100%;
    height: 100%;

    border-radius: 50%;
}

.avatar-svg .av-ground {
    fill: var(--avatar-ground);
}

.avatar-svg .av-fill {
    fill: var(--avatar-ink);
}

.avatar-svg .av-soft {
    fill: var(--avatar-soft);
}

.avatar-svg .av-line,
.avatar-svg .av-soft-line {
    fill: none;

    stroke-linecap: round;
    stroke-linejoin: round;
}

.avatar-svg .av-line {
    stroke: var(--avatar-ink);
}

.avatar-svg .av-soft-line {
    stroke: var(--avatar-soft);
}

/* =========================================================
   UI-25 - Course chat and unread badges
   ========================================================= */

.nav-badge {
    display: inline-grid;
    place-items: center;

    min-width: 20px;
    height: 20px;
    margin-left: auto;
    padding: 0 6px;

    border-radius: 999px;

    color: var(--theme-surface);
    background: var(--danger);

    font-size: calc(11px * var(--font-scale));
    font-weight: 800;
    line-height: 1;
}

.nav-badge[hidden] {
    display: none;
}

.nav-badge--inline {
    margin-left: 6px;
}

.chat-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 18px;
}

.chat-head .page-title {
    margin: 4px 0;
}

.chat-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.chat-head-actions form {
    margin: 0;
}

.chat-mode-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.chat-mode-form select {
    min-height: 40px;
    padding: 8px 10px;

    border: 1px solid var(--theme-border-strong);
    border-radius: 12px;

    color: var(--theme-text);
    background: var(--theme-surface);

    font: inherit;
}

.chat-panel {
    display: grid;
    gap: 16px;
}

.chat-older {
    justify-self: center;
    margin: 0;
}

.chat-messages {
    display: grid;
    gap: 10px;

    max-height: 60vh;
    margin: 0;
    padding: 0;
    overflow-y: auto;

    list-style: none;
}

.chat-message {
    max-width: min(100%, 680px);
    padding: 10px 14px;

    border-radius: 14px;

    background: var(--theme-surface-soft);
}

.chat-message--own {
    justify-self: end;

    background: var(--theme-accent-soft);
}

.chat-message-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;

    color: var(--theme-text-soft);
    font-size: calc(12px * var(--font-scale));
}

.chat-message-meta strong {
    color: var(--theme-text);
}

.chat-message-meta form {
    margin: 0 0 0 auto;
}

.chat-flag {
    padding: 1px 8px;

    border-radius: 999px;

    color: var(--info-text);
    background: var(--info-soft);

    font-size: calc(11px * var(--font-scale));
    font-weight: 700;
}

.chat-message-body {
    margin: 6px 0 0;

    color: var(--theme-text);
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.chat-unread-divider {
    color: var(--danger-text);
    font-size: calc(12px * var(--font-scale));
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.chat-empty,
.chat-readonly {
    margin: 0;

    color: var(--theme-text-soft);
}

.chat-composer {
    display: grid;
    gap: 8px;

    padding-top: 14px;

    border-top: 1px solid var(--theme-border);
}

.chat-composer textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 10px 12px;

    border: 1px solid var(--theme-border-strong);
    border-radius: 12px;

    color: var(--theme-text);
    background: var(--theme-surface);

    font: inherit;
    resize: vertical;
}

.chat-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chat-composer-actions .button {
    margin: 0;
}

.chat-composer-error {
    color: var(--danger-text);
    font-size: calc(12.5px * var(--font-scale));
}

/* =========================================================
   UI-26 - Excel imports (exam, vocabulary)
   ========================================================= */

.excel-upload-form {
    display: grid;
    gap: 10px;
}

.excel-upload-form input[type="file"] {
    max-width: 100%;
}

.import-errors {
    margin-bottom: 18px;
}

.import-table {
    width: 100%;
    border-collapse: collapse;

    font-size: calc(13.5px * var(--font-scale));
}

.import-table th,
.import-table td {
    padding: 8px 10px;

    border-bottom: 1px solid var(--theme-border);

    text-align: left;
    vertical-align: top;
}

.import-table th {
    color: var(--theme-text-soft);
    font-size: calc(12px * var(--font-scale));
    text-transform: uppercase;
    letter-spacing: .03em;
}

.import-stem {
    min-width: 240px;
    overflow-wrap: anywhere;
}

.import-row--error td {
    background: var(--danger-soft);
}

.import-confirm {
    margin-top: 16px;
}

.import-confirm .button[disabled] {
    cursor: not-allowed;
    opacity: .55;
}



/* Account Center notifications and reviewer title (V6 Task 8) - tokens only */

.notification-list {
    display: grid;
    gap: 10px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.notification-item {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
}

.notification-item p {
    margin: 0;
    color: var(--text-secondary);
}

.notification-item time {
    color: var(--text-muted);
    font-size: .85em;
}

.notification-item--new {
    border-color: var(--theme-accent);
    background: var(--theme-accent-soft);
}

.reviewer-title-badge {
    background: var(--theme-accent-soft);
    color: var(--theme-accent-strong);
}

.sidebar-account-link .nav-badge {
    margin-left: 6px;
}
