/* ==========================================================================
   Learner's Aid to Success — design system
   Navy + gold education palette. Mobile-first, no CSS framework.
   ========================================================================== */

:root {
    --navy-900: #0b2140;
    --navy-800: #12305a;
    --navy-700: #1b437a;
    --ink: #101828;
    --muted: #5b6b82;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --paper: #f5f8fc;
    --white: #ffffff;
    --gold: #e8a33d;
    --gold-soft: #fdf3e1;
    --green: #12795b;
    --green-soft: #e6f4ef;
    --red: #b42318;
    --red-soft: #feecea;
    --amber: #b54708;
    --amber-soft: #fef3e7;
    --blue-soft: #eaf1fb;

    --radius: 18px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow: 0 14px 40px rgba(16, 24, 40, 0.08);
    --max: 1180px;
    --sidebar: 264px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
    margin: 0 0 0.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--ink);
}

h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.05rem); }
h3 { font-size: 1.12rem; }
h4 { font-size: 0.98rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

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

a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.9em;
    background: var(--blue-soft);
    padding: 0.1rem 0.35rem;
    border-radius: 5px;
}

hr.divider {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 1.5rem 0;
}

.container {
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 4vw, 2rem);
}

.narrow { max-width: 720px; }

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

.skip-link {
    position: absolute;
    left: 1rem;
    top: -60px;
    background: var(--navy-900);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 0 0 10px 10px;
    z-index: 100;
}
.skip-link:focus { top: 0; }

.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.top-gap { margin-top: 1rem; }
.align-right { text-align: right; }
.link-sm { font-size: 0.86rem; font-weight: 600; }

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.72rem 1.35rem;
    font: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.1;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid rgba(232, 163, 61, 0.55); outline-offset: 2px; }

.btn-primary {
    background: var(--navy-800);
    color: #fff;
    box-shadow: 0 8px 20px rgba(18, 48, 90, 0.22);
}
.btn-primary:hover { background: var(--navy-900); }

.btn-ghost {
    background: transparent;
    color: var(--navy-800);
    border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--white); border-color: var(--navy-800); }

.btn-outline {
    background: var(--white);
    color: var(--navy-800);
    border-color: var(--navy-800);
}
.btn-outline:hover { background: var(--blue-soft); }

.btn-danger {
    background: var(--red-soft);
    color: var(--red);
    border-color: rgba(180, 35, 24, 0.25);
}
.btn-danger:hover { background: #fbdcd9; }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.86rem; }
.btn-xs { padding: 0.32rem 0.7rem; font-size: 0.78rem; }
.btn-block { width: 100%; }
.btn.is-disabled { opacity: 0.45; pointer-events: none; }

/* --------------------------------------------------------------------------
   Badges & alerts
   -------------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.5;
    white-space: nowrap;
}

.badge-success { background: var(--green-soft); color: var(--green); }
.badge-danger { background: var(--red-soft); color: var(--red); }
.badge-warning { background: var(--amber-soft); color: var(--amber); }
.badge-muted { background: #eef1f6; color: var(--muted); }
.badge-soft { background: var(--blue-soft); color: var(--navy-700); }

.flash-stack { display: grid; gap: 0.6rem; margin-bottom: 1.5rem; }
.page-flashes { margin-top: 1.25rem; margin-bottom: -0.5rem; }

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.85rem 1.05rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--white);
    font-size: 0.93rem;
}

.alert-dot {
    flex: 0 0 auto;
    width: 9px; height: 9px;
    margin-top: 0.45rem;
    border-radius: 50%;
    background: var(--muted);
}

.alert-success { background: var(--green-soft); border-color: rgba(18, 121, 91, 0.2); color: #0b5a44; }
.alert-success .alert-dot { background: var(--green); }
.alert-error { background: var(--red-soft); border-color: rgba(180, 35, 24, 0.2); color: #8a1c13; }
.alert-error .alert-dot { background: var(--red); }
.alert-warning { background: var(--amber-soft); border-color: rgba(181, 71, 8, 0.2); color: #8a3a08; }
.alert-warning .alert-dot { background: var(--amber); }
.alert-info { background: var(--blue-soft); border-color: rgba(27, 67, 122, 0.15); color: var(--navy-800); }
.alert-info .alert-dot { background: var(--navy-700); }

/* --------------------------------------------------------------------------
   Brand
   -------------------------------------------------------------------------- */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--ink);
    text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
    width: 42px; height: 42px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.brand-name {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}
.brand-name strong { font-size: 1.02rem; letter-spacing: -0.02em; }
.brand-name small {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.brand-light { color: #fff; }
.brand-light .brand-name small { color: rgba(255, 255, 255, 0.6); }

/* --------------------------------------------------------------------------
   Public header / footer
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 76px;
}

.site-menu {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    margin-left: 1.5rem;
    font-size: 0.92rem;
    font-weight: 600;
}
.site-menu a { color: var(--muted); }
.site-menu a:hover, .site-menu a.is-active { color: var(--navy-800); text-decoration: none; }

.header-cta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    margin-left: auto;
    background: none;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.55rem 0.6rem;
    cursor: pointer;
}
.menu-toggle span { display: block; width: 20px; height: 2px; background: var(--navy-800); border-radius: 2px; }

.site-footer {
    background: var(--navy-900);
    color: rgba(255, 255, 255, 0.72);
    padding: 3.5rem 0 1.5rem;
    margin-top: 4rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.3fr;
    gap: 2rem;
}
.footer-brand p { margin-top: 1rem; max-width: 34ch; font-size: 0.9rem; }
.footer-col h4 {
    color: #fff;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}
.footer-col a {
    display: block;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
    padding: 0.22rem 0;
}
.footer-col a:hover { color: #fff; }
.footer-note { font-size: 0.86rem; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-top: 2.5rem;
    padding-top: 1.4rem;
    font-size: 0.82rem;
}
.footer-bottom a { color: rgba(255, 255, 255, 0.85); }

/* --------------------------------------------------------------------------
   Public sections
   -------------------------------------------------------------------------- */

.hero {
    padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem);
    background:
        radial-gradient(900px 420px at 85% -10%, rgba(232, 163, 61, 0.16), transparent 65%),
        radial-gradient(700px 400px at -5% 20%, rgba(27, 67, 122, 0.1), transparent 60%),
        var(--paper);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--navy-700);
    margin-bottom: 1rem;
}
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.eyebrow-light { color: var(--gold); }

.hero h1 { margin-bottom: 1.1rem; max-width: 15ch; }
.hero-lead { font-size: 1.1rem; color: var(--muted); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.75rem; }
.hero-note { margin-top: 1.5rem; font-size: 0.85rem; color: var(--muted); display: flex; align-items: center; gap: 0.5rem; }
.hero-note::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

.hero-panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow);
    padding: 1.35rem;
    position: relative;
}
.hero-panel::after {
    content: "";
    position: absolute;
    inset: auto -14px -14px auto;
    width: 90px; height: 90px;
    background: var(--gold-soft);
    border-radius: 24px;
    z-index: -1;
}
.panel-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}
.panel-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.panel-list { list-style: none; margin: 0; padding: 0.5rem 0 0; display: grid; gap: 0.9rem; }
.panel-list li { display: flex; gap: 0.85rem; align-items: flex-start; }
.panel-check {
    flex: 0 0 auto;
    width: 30px; height: 30px;
    border-radius: 9px;
    background: var(--blue-soft);
    color: var(--navy-800);
    display: grid; place-items: center;
    font-size: 0.8rem; font-weight: 700;
}
.panel-list strong { display: block; font-size: 0.94rem; }
.panel-list small { color: var(--muted); font-size: 0.82rem; line-height: 1.45; display: block; }
.panel-foot { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }

.section { padding: clamp(2.8rem, 6vw, 4.5rem) 0; }
.section-tint { background: var(--white); border-block: 1px solid var(--line); }
.section-dark { background: var(--navy-900); color: rgba(255, 255, 255, 0.78); }
.section-dark h2 { color: #fff; }
.section-head { max-width: 62ch; margin-bottom: 2rem; }
.section-lead { color: var(--muted); font-size: 1rem; }
.section-lead.light { color: rgba(255, 255, 255, 0.72); }

.chip-grid { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 1.5rem; }
.chip {
    background: var(--blue-soft);
    color: var(--navy-800);
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.6rem; }
.subject-pill {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 600;
}
.subject-code {
    flex: 0 0 auto;
    min-width: 42px;
    text-align: center;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0.15rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--navy-700);
}

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.steps-3 { grid-template-columns: repeat(3, 1fr); }
.step-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.step-number { display: inline-block; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em; color: var(--gold); margin-bottom: 0.75rem; }
.step-card h3 { margin-bottom: 0.45rem; }
.step-card p { color: var(--muted); font-size: 0.9rem; margin: 0; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.split-top { align-items: start; }

.check-list { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: 0.7rem; }
.check-list li { position: relative; padding-left: 1.8rem; font-size: 0.95rem; }
.check-list li::before {
    content: "✓";
    position: absolute;
    left: 0; top: 0.05rem;
    width: 1.2rem; height: 1.2rem;
    border-radius: 50%;
    background: var(--gold);
    color: var(--navy-900);
    font-size: 0.7rem;
    font-weight: 800;
    display: grid; place-items: center;
}
.check-list-dark li::before { background: var(--green); color: #fff; }

.cta-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    background: linear-gradient(120deg, var(--navy-800), var(--navy-900));
    color: rgba(255, 255, 255, 0.78);
    border-radius: calc(var(--radius) + 6px);
    padding: clamp(1.75rem, 4vw, 2.75rem);
}
.cta-band h2 { color: #fff; margin-bottom: 0.35rem; }
.cta-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.cta-band .btn-primary { background: var(--gold); color: var(--navy-900); }
.cta-band .btn-primary:hover { background: #f2b455; }
.cta-band .btn-outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.cta-band .btn-outline:hover { background: rgba(255, 255, 255, 0.1); }
.cta-band-plain { background: var(--white); border: 1px solid var(--line); color: var(--muted); margin-top: 2rem; }
.cta-band-plain h2 { color: var(--ink); }

.page-hero {
    padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.5rem, 3vw, 2rem);
    background: var(--white);
    border-bottom: 1px solid var(--line);
}
.page-hero h1 { margin-bottom: 0.75rem; }
.page-lead { max-width: 62ch; color: var(--muted); font-size: 1.05rem; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.feature-grid-tight { grid-template-columns: repeat(2, 1fr); }
.feature-card, .mini-feature {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.35rem;
}
.feature-card h3 { margin-bottom: 0.4rem; }
.feature-card p, .mini-feature p { color: var(--muted); font-size: 0.9rem; margin: 0; }
.mini-feature strong { display: block; margin-bottom: 0.25rem; }
.mini-feature { background: var(--paper); }

/* --------------------------------------------------------------------------
   Auth
   -------------------------------------------------------------------------- */

.auth-section { padding: clamp(2rem, 5vw, 4rem) 0; }
.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-radius: calc(var(--radius) + 6px);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    background: var(--white);
    max-width: 1040px;
    margin-inline: auto;
}
.auth-aside {
    background:
        radial-gradient(500px 300px at 100% 0%, rgba(232, 163, 61, 0.2), transparent 60%),
        linear-gradient(160deg, var(--navy-800), var(--navy-900));
    color: rgba(255, 255, 255, 0.78);
    padding: clamp(1.75rem, 4vw, 3rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: -40px;
}
.auth-aside h1 { color: #fff; font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: 0.9rem; }
.auth-lead { font-size: 0.98rem; }
.auth-points { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 0.65rem; font-size: 0.92rem; }
.auth-points span { color: var(--gold); font-weight: 800; margin-right: 0.4rem; }
.auth-aside-note { font-size: 0.8rem; color: rgba(255, 255, 255, 0.55); margin-top: 1.5rem; }

.auth-card { padding: clamp(1.5rem, 4vw, 2.75rem); }

.tabs {
    display: inline-flex;
    gap: 0.25rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.25rem;
    margin-bottom: 1.75rem;
}
.tab {
    border: 0;
    background: transparent;
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
}
.tab.is-active { background: var(--navy-800); color: #fff; }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fade-in 0.2s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.auth-help { margin-top: 1.5rem; font-size: 0.82rem; color: var(--muted); padding-top: 1.25rem; border-top: 1px solid var(--line); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.stack-form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; align-content: start; align-items: start; }
.field-inline { min-width: 170px; }
.label { font-size: 0.84rem; font-weight: 600; color: var(--ink); }
.optional { color: var(--muted); font-weight: 500; }
.required { color: var(--red); }

.input {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--white);
    padding: 0.7rem 0.85rem;
    font: inherit;
    font-size: 0.94rem;
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus {
    outline: none;
    border-color: var(--navy-700);
    box-shadow: 0 0 0 3px rgba(27, 67, 122, 0.14);
}
.input::placeholder { color: #94a3b8; }
textarea.input { resize: vertical; min-height: 90px; }

.input-code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 1.12rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.85rem 1rem;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.field-span { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.5rem; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: flex-end;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.25rem;
}
.filter-bar .field { flex: 1 1 170px; }
.filter-actions { display: flex; gap: 0.5rem; }

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.app-body { background: var(--paper); }
.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
    background: var(--navy-900);
    color: rgba(255, 255, 255, 0.72);
    display: flex;
    flex-direction: column;
    padding: 1.35rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 50;
    scrollbar-width: thin;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0.4rem 1.25rem; }
.sidebar-close {
    display: none;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 0.7rem;
    margin-bottom: 1.25rem;
    scrollbar-width: thin;
}
.sidebar-user-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar-user-text strong { color: #fff; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-text small { font-size: 0.6rem; color: rgba(255, 255, 255, 0.55); }

.avatar {
    flex: 0 0 auto;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--navy-900);
    display: grid; place-items: center;
    font-size: 0.8rem; font-weight: 800;
    letter-spacing: 0.03em;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.72rem; }

.side-nav { display: grid; gap: 0.2rem; }
.side-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.62rem 0.7rem;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: 0;
    background: transparent;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.side-link svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: 0.85; }
.side-link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; text-decoration: none; }
.side-link.is-active { background: var(--gold); color: var(--navy-900); font-weight: 700; }
.side-link.is-active svg { opacity: 1; }
.side-link-button { margin-top: 0.2rem; }

.sidebar-foot { margin-top: auto; padding-top: 1.5rem; display: grid; gap: 0.5rem; }
.side-footer-link {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.45);
    padding: 0 0.7rem;
}
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 33, 64, 0.5);
    z-index: 45;
    backdrop-filter: blur(2px);
}

.app-main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding: 1rem clamp(1rem, 3vw, 2rem);
    position: sticky;
    top: 0;
    z-index: 30;
}
.topbar-title { flex: 1 1 auto; min-width: 0; }
.topbar-eyebrow {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
}
.topbar-title h1 { font-size: 1.22rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 0.55rem; }
.topbar-user-name { font-size: 0.86rem; font-weight: 600; }

.icon-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.55rem 0.6rem;
    cursor: pointer;
}
.icon-btn span { display: block; width: 18px; height: 2px; background: var(--navy-800); border-radius: 2px; }

.content { padding: clamp(1.25rem, 3vw, 2rem); display: grid; gap: 1.25rem; align-content: start; }

/* --------------------------------------------------------------------------
   App content
   -------------------------------------------------------------------------- */

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.page-head h2 { margin-bottom: 0.2rem; }
.page-head p { margin: 0; }
.page-actions { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }

.breadcrumb { display: flex; gap: 0.4rem; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.35rem; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-wide-left { grid-template-columns: 1.55fr 1fr; }

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    margin-bottom: 10px;
}
.card-flush { overflow: hidden; }
.card-soft { background: #fbfcfe; }
.card-alert { border-color: rgba(232, 163, 61, 0.45); background: #fffdf8; }
.card-elevated { box-shadow: var(--shadow); }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.card-head h3 { margin: 0; }
.card-head-padded { padding: 1.25rem 1.4rem 0.25rem; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-decoration: none;
    color: inherit;
}
.stat-card:hover { text-decoration: none; }
.stat-link { transition: border-color 0.15s ease, transform 0.15s ease; }
.stat-link:hover { border-color: var(--navy-700); transform: translateY(-2px); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.stat-label { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin: 0.35rem 0 0; line-height: 1.1; }
.stat-value-sm { font-size: 1.15rem; letter-spacing: -0.01em; }
.stat-foot { margin: 0; font-size: 0.8rem; color: var(--muted); }

.empty-state { padding: 2rem 1.5rem; text-align: center; }
.empty-state h4 { margin-bottom: 0.35rem; }
.empty-state p { color: var(--muted); font-size: 0.9rem; max-width: 48ch; margin: 0 auto 1rem; }
.empty-note { color: var(--muted); font-size: 0.9rem; padding: 0.5rem 0; }

.subject-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.1rem; }
.subject-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}
.subject-list li:last-child { border-bottom: 0; }
.subject-name { font-weight: 600; }
.subject-lecturer { margin-left: auto; font-size: 0.78rem; color: var(--muted); }

.code-display {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--paper);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 1rem;
    letter-spacing: 0.08em;
}
.code-prefix { font-weight: 800; color: var(--navy-700); }
.code-secret { color: var(--muted); }
.code-secret strong { color: var(--ink); }

.code-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--navy-900);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 1.05rem;
    letter-spacing: 0.1em;
    flex-wrap: wrap;
}
.code-box .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.code-box .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

.mini-title { margin: 0 0 0.5rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }

.detail-list { display: grid; gap: 0.5rem; margin: 0; }
.detail-list > div { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.9rem; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 600; text-align: right; }

.access-meter { margin-bottom: 1rem; }
.access-meter-bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.access-meter-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #25a57c); border-radius: 999px; }
.access-meter-text { font-size: 0.9rem; margin: 0.5rem 0 0; color: var(--muted); }

.notice { border-radius: var(--radius-sm); padding: 0.9rem 1rem; font-size: 0.88rem; border: 1px solid var(--line); }
.notice p { margin: 0.25rem 0 0.65rem; color: var(--muted); }
.notice-info { background: var(--blue-soft); border-color: rgba(27, 67, 122, 0.15); }
.notice-warning { background: var(--amber-soft); border-color: rgba(181, 71, 8, 0.2); }
.notice strong { display: block; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.timeline li { display: flex; gap: 0.7rem; align-items: flex-start; }
.timeline-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; margin-top: 0.45rem; background: var(--muted); }
.timeline-active, .timeline-activated, .timeline-extended, .timeline-approved { background: var(--green); }
.timeline-expired, .timeline-revoked, .timeline-declined { background: var(--red); }
.timeline-suspended { background: var(--amber); }
.timeline strong { display: block; font-size: 0.88rem; font-weight: 600; }
.timeline small { color: var(--muted); font-size: 0.78rem; }
.timeline-wide { gap: 0.95rem; }

.activity-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.activity-list li { display: flex; gap: 0.7rem; align-items: flex-start; }
.activity-icon {
    flex: 0 0 auto;
    width: 10px; height: 10px;
    margin-top: 0.5rem;
    border-radius: 3px;
    background: var(--gold);
}
.activity-list strong { display: block; font-size: 0.86rem; font-weight: 600; }
.activity-list small { font-size: 0.76rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.7rem 1rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfcfe; }
.table-link { font-weight: 600; color: var(--navy-800); }
.table-sub { display: block; font-size: 0.75rem; color: var(--muted); }

.inline-actions { display: inline-flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.inline-actions form { display: inline; }

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.4rem;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
}
.pagination-text { font-size: 0.82rem; color: var(--muted); }

.ordered-list { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; font-size: 0.9rem; color: var(--muted); }
.ordered-list li::marker { color: var(--gold); font-weight: 700; }

/* --------------------------------------------------------------------------
   Errors
   -------------------------------------------------------------------------- */

.error-page { padding: clamp(3rem, 9vw, 6rem) 0; text-align: center; }
.error-code {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: var(--gold);
    margin-bottom: 0.5rem;
}
.error-page h1 { margin-bottom: 0.75rem; }
.error-page p { color: var(--muted); max-width: 52ch; margin-inline: auto; }
.error-actions { display: flex; gap: 0.6rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.debug-box {
    text-align: left;
    background: var(--navy-900);
    color: #fbdcd9;
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    overflow-x: auto;
}
.debug-box pre { margin: 0.5rem 0 0; white-space: pre-wrap; word-break: break-word; color: #cbd5e1; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .grid-wide-left { grid-template-columns: 1fr; }
}

.menu-auth { display: none; }

/* Long site names must not wrap into the surrounding controls on phones. */
@media (max-width: 640px) {
    .site-header .header-inner { min-height: 64px; gap: 0.6rem; }
    .site-header .header-cta .btn-primary { display: none; }
    .site-header .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
    .site-header .brand-name strong {
        font-size: 0.95rem;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .site-header .brand-name small { font-size: 0.58rem; letter-spacing: 0.1em; }
    .site-menu .menu-auth { display: block; }
}

@media (max-width: 960px) {
    .site-menu, .staff-link { display: none; }
    .menu-toggle { display: flex; order: 3; margin-left: 0; }
    .brand { order: 1; }
    .header-cta { order: 2; margin-left: auto; }
    .header-inner { gap: 0.75rem; }
    .site-header.is-open .site-menu {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        position: absolute;
        inset: 76px 0 auto 0;
        background: var(--white);
        border-bottom: 1px solid var(--line);
        padding: 1rem clamp(1rem, 4vw, 2rem) 1.5rem;
        gap: 0.4rem;
        margin: 0;
        box-shadow: var(--shadow);
    }
    .site-header.is-open .site-menu a { display: block; padding: 0.5rem 0; width: 100%; }

    .hero-grid { grid-template-columns: 1fr; }
    .hero-panel { order: -1; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .auth-grid { grid-template-columns: 1fr; }
    .auth-aside { padding: 2rem; margin-left: 0;}
    .split { grid-template-columns: 1fr; }

    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(300px, 84vw);
        transform: translateX(-102%);
        transition: transform 0.22s ease;
        box-shadow: var(--shadow);
        display: flex;
        flex-direction: column;
        scrollbar-width: thin;
    }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-close, .icon-btn { display: flex; }
    .topbar-user-name { display: none; }
}

@media (max-width: 760px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .feature-grid, .feature-grid-tight { grid-template-columns: 1fr; }
    .steps, .steps-3 { grid-template-columns: 1fr; }
    .header-cta .btn { padding: 0.45rem 0.85rem; font-size: 0.8rem; }
    .cta-band { flex-direction: column; align-items: flex-start; width: 90%; }
    .page-head { flex-direction: column; }
    .table th, .table td { padding: 0.65rem 0.8rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
    .site-footer { padding-top: 2.5rem; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    body { font-size: 15px; }
    .stat-grid { grid-template-columns: 1fr; }
    .brand-name strong { font-size: 0.95rem; }
    .brand-mark { width: 36px; height: 36px; }
    .hero-actions .btn, .cta-actions .btn { width: 100%; }
    .filter-actions { width: 100%; }
    .filter-actions .btn { flex: 1; }
}

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

/* Phase 2 — compact inline controls used by class/subject assignment tables */
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0; }
.inline-form .field-inline { min-width: 140px; }
.input-sm { padding: 0.35rem 0.55rem; font-size: 0.82rem; }

/* --- Timetable ------------------------------------------------------------ */
.lecture-spotlight {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
    color: #fff;
}

.lecture-spotlight .muted,
.lecture-spotlight .small {
    color: rgba(255, 255, 255, 0.78);
}

.lecture-title {
    margin: 0.4rem 0 0.15rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.lecture-when {
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.slot-time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-weight: 600;
    color: var(--navy-800);
}

.slot-topic {
    color: var(--muted);
    font-size: 0.92rem;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.filter-bar .field {
    margin: 0;
    flex: 1 1 180px;
    min-width: 160px;
}

/* --- Live lectures -------------------------------------------------------- */
.lecture-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--navy-900);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.lecture-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.lecture-chat .chat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.7rem;
    max-height: 420px;
    overflow-y: auto;
}

.chat-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    background: var(--white);
}

.chat-item.chat-question {
    border-left: 3px solid var(--gold);
    background: var(--gold-soft);
}

.chat-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.chat-meta strong { font-size: 0.94rem; }

.chat-item p {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chat-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.6rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.chat-form .field { margin: 0; }
.chat-form .chat-input { flex: 1 1 260px; }
.chat-form .chat-error { flex-basis: 100%; margin: 0; color: var(--red); }

/* Library: protected recording player and watermarked playback */
.player {
    position: relative;
    margin: 1rem 0;
    background: var(--ink);
    border-radius: var(--radius);
    overflow: hidden;
}

.player video {
    display: block;
    width: 100%;
    max-height: 70vh;
    background: #000;
}

.player-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0.75rem 1rem;
    pointer-events: none;
    background: repeating-linear-gradient(
        -35deg,
        transparent 0 120px,
        rgba(255, 255, 255, 0.05) 120px 121px
    );
}

.player-watermark span {
    margin-left: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.library-window {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.library-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.library-actions form { margin: 0; }

@media (max-width: 720px) {
    .library-window { grid-template-columns: 1fr; }
}

/* Assessments: timed attempts, question cards and marking */
.countdown {
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--navy-800);
    font-size: 0.85rem;
}

.countdown strong {
    font-size: 1.05rem;
    letter-spacing: 0.04em;
}

.countdown.is-low,
.countdown.is-expired {
    background: var(--red-soft);
    color: var(--red);
}

.question-card {
    margin: 0 0 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.question-card legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.35rem;
    font-weight: 600;
}

.question-prompt { margin: 0.5rem 0 0.75rem; }

.option-list { display: grid; gap: 0.45rem; }

.option-row {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 0.6rem;
    cursor: pointer;
}

.option-row:hover { background: #f8fafc; }

.option-correct { color: var(--green); font-weight: 600; }

.answer-block { margin: 0.5rem 0 0.85rem; }

.answer-text {
    margin: 0.25rem 0 0;
    padding: 0.6rem 0.7rem;
    background: #f8fafc;
    border-radius: 0.6rem;
}

.assessment-facts {
    display: grid;
    gap: 0.35rem;
    margin: 0.75rem 0 1rem;
    padding-left: 1.15rem;
}

.result-total {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
}

.result-total strong { font-size: 2rem; }

/* Communication: notification centre, announcements, threads and support */
.topbar-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    margin-left: 0;
    margin-right: 0.35rem;
    flex: 0 0 auto;
    border-radius: 999px;
    color: var(--navy-800);
    background: #fff;
    border: 1px solid var(--line);
}

.topbar-bell svg { width: 1.15rem; height: 1.15rem; }

.topbar-bell-count {
    position: absolute;
    top: -0.3rem;
    right: -0.3rem;
    min-width: 1.1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.1rem;
    text-align: center;
}

.notification-list { display: grid; gap: 0.6rem; }

.notification-row {
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.notification-row.is-unread { border-left: 4px solid var(--navy-700); background: #fbfdff; }

.notification-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.notification-head strong { margin-right: auto; }

.notification-body { margin: 0.45rem 0; color: var(--muted); }

.notification-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.notification-actions form { margin: 0; }

.thread-list { display: grid; gap: 0.55rem; }

.thread-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: inherit;
}

.thread-row:hover { background: #f8fafc; }

.thread-row-main { display: grid; gap: 0.2rem; }
.thread-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }

.thread-messages { display: grid; gap: 0.65rem; margin-bottom: 1.25rem; }

.thread-message {
    max-width: 85%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.thread-message.is-own { margin-left: auto; background: var(--blue-soft); }

.thread-message-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.3rem; }

.thread-message p { margin: 0; }

.faq-list details { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.faq-list details:last-child { border-bottom: 0; }
.faq-list summary { cursor: pointer; font-weight: 600; }
.faq-list p { margin: 0.5rem 0 0; color: var(--muted); }

.chat-history { display: grid; gap: 0.7rem; }

.chat-exchange {
    padding: 0.8rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.chat-question { margin: 0 0 0.35rem; }
.chat-answer { margin: 0; color: var(--muted); }
.chat-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }

/* Phase 9 accessibility and print polish */
:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.small-value { font-size: 1.15rem; }

.permission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.5rem; }

.code-block { background: var(--navy-900); color: #fff; padding: 0.8rem 1rem; border-radius: 12px; overflow-x: auto; font-size: 0.8rem; }

.receipt-card { max-width: 760px; }
.receipt-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }

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

@media print {
    .sidebar, .topbar, .page-actions, .sidebar-backdrop, .flash-stack { display: none !important; }
    .app-main, .content { margin: 0 !important; padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ccc !important; }
    body { background: #fff !important; }
}

/* Phase 10: bulk selection, history filters and pagination */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid rgba(11, 33, 64, 0.08);
}
.col-check { width: 2.25rem; text-align: center; }
.col-check input { width: 1rem; height: 1rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 0.9rem; }
.history-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.history-filters .input { flex: 1 1 160px; width: auto; min-width: 0; }
.history-filters .btn { flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   Dark theme (toggled on <html data-theme="dark">, remembered per browser)
   -------------------------------------------------------------------------- */
html[data-theme="dark"] {
    color-scheme: dark;
    --ink: #e7eef9;
    --muted: #9db0c8;
    --line: #22324a;
    --line-strong: #354961;
    --paper: #0b1624;
    --white: #121f31;
    --gold-soft: #2f2511;
    --green: #56d3ab;
    --green-soft: #10342a;
    --red: #ff9585;
    --red-soft: #3a1a16;
    --amber: #f0b46a;
    --amber-soft: #33240f;
    --blue-soft: #14263f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .site-header,
html[data-theme="dark"] .topbar { background: rgba(15, 24, 38, 0.94); }
html[data-theme="dark"] .table tbody tr:hover,
html[data-theme="dark"] .option-row:hover,
html[data-theme="dark"] .thread-row:hover { background: #17263a; }
html[data-theme="dark"] .card-soft { background: #16253a; }
html[data-theme="dark"] .card-alert { background: #2a2312; border-color: rgba(232, 163, 61, 0.35); }
html[data-theme="dark"] .badge-muted { background: #1c2b3f; }
html[data-theme="dark"] .btn-danger:hover { background: #46201b; }
html[data-theme="dark"] .notification-row.is-unread { background: #16263a; }
html[data-theme="dark"] .topbar-bell,
html[data-theme="dark"] .theme-btn { background: var(--white); color: var(--ink); }
html[data-theme="dark"] .brand-preview { background: #0f1c2e; }
html[data-theme="dark"] .code-block { background: #060f1b; }
html[data-theme="dark"] .tab { color: var(--muted); }
html[data-theme="dark"] ::placeholder { color: #7d8ea6; }

/* School-brand text/outline controls need a readable tint on dark surfaces. */
html[data-theme="dark"] {
    --navy-700: #d7e6fa;
    --navy-700: color-mix(in srgb, var(--navy-800) 40%, #d7e6fa);
}
html[data-theme="dark"] .btn-ghost,
html[data-theme="dark"] .btn-outline {
    color: var(--ink);
    border-color: var(--line-strong);
    background: transparent;
}
html[data-theme="dark"] .btn-ghost:hover,
html[data-theme="dark"] .btn-outline:hover {
    background: var(--white);
    border-color: var(--ink);
}
html[data-theme="dark"] .badge-soft { color: #d7e6fa; }

/* Password reveal + generator controls */
.password-field { position: relative; display: block; }
.password-field .input { padding-right: 4.8rem; }
.password-field .password-actions {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    display: flex;
    gap: 0.2rem;
}
.password-field .password-action {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.72rem;
    padding: 0.3rem 0.35rem;
    border-radius: var(--radius-xs);
    cursor: pointer;
}
.password-field .password-action:hover { background: var(--blue-soft); color: var(--ink); }

.side-badge {
    margin-left: auto;
    min-width: 1.25rem;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    background: var(--gold);
    color: #201a0c;
    font-size: 0.68rem;
    font-weight: 700;
    text-align: center;
}

/* Theme switch */
.theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    cursor: pointer;
    flex: 0 0 auto;
}
.theme-btn svg, .theme-toggle svg { width: 1.15rem; height: 1.15rem; }
.theme-btn .icon-sun, .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-btn .icon-sun,
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-btn .icon-moon,
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Per-school homepage cards */
.school-card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.school-card-head .brand-mark { width: 52px; height: 52px; object-fit: contain; background: var(--paper); }
.school-card-head strong { display: block; font-size: 1.02rem; }
.school-card-head small { color: var(--muted); font-size: 0.8rem; }
.check-row { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 0.9rem; }
.check-row input { margin-top: 0.25rem; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0 0 0.85rem; padding: 0.65rem 0.85rem; border: 1px solid rgba(148,163,184,.28); border-radius: 0.75rem; }
.check-col { width: 2.25rem; }
.table td input[type="checkbox"], .table th input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--navy-900); }

/* School logo preview */
.brand-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
    margin-bottom: 1rem;
}
.brand-preview-img { max-width: 120px; max-height: 120px; object-fit: contain; }

/* --------------------------------------------------------------------------
   Collapsible sidebar groups (admin navigation)
   -------------------------------------------------------------------------- */

.side-group {
    margin-top: 0.55rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}
.side-group:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}
.side-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    list-style: none;
    cursor: pointer;
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius-xs);
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}
.side-group-toggle::-webkit-details-marker { display: none; }
.side-group-toggle:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.side-group-chevron {
    width: 13px;
    height: 13px;
    margin-left: auto;
    transition: transform 0.18s ease;
}
.side-group[open] > .side-group-toggle .side-group-chevron { transform: rotate(90deg); }
.side-group-links { display: grid; gap: 0.15rem; padding-top: 0.15rem; }

/* --------------------------------------------------------------------------
   Ad placements (public pages)
   -------------------------------------------------------------------------- */

.ad-slot {
    margin: 1.25rem auto;
    padding: 0.65rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
}
.ad-slot-tag {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.ad-slot-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 90px;
    padding: 1rem;
    border-radius: var(--radius-xs);
    background: var(--paper);
    text-align: center;
}
.ad-slot-placeholder strong { font-size: 0.86rem; }
.ad-slot-placeholder span { color: var(--muted); font-size: 0.78rem; max-width: 56ch; }

/* Legal pages */
.legal-body { max-width: 78ch; }
.legal-body h2 { margin-top: 2rem; font-size: 1.18rem; }
.legal-body p, .legal-body li { color: var(--ink); }
.legal-body ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.legal-body li { margin-bottom: 0.45rem; }
.legal-updated { margin-top: 0.75rem; color: var(--muted); font-size: 0.82rem; }
.legal-contact { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.legal-contact li { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; margin: 0; font-size: 0.92rem; }
.legal-contact span { min-width: 4.6rem; color: var(--muted); font-weight: 600; }
.legal-contact a { color: var(--navy-700); overflow-wrap: anywhere; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; }
.footer-legal a { color: rgba(255, 255, 255, 0.85); }

/* --------------------------------------------------------------------------
   Unified dark theme overlay
   The school brand colour styles light-mode surfaces. In dark mode the shell
   uses one neutral slate palette and the brand survives only in the logo and
   the single gold accent, so the admin area is not purple + navy + orange.
   -------------------------------------------------------------------------- */

html[data-theme="dark"] {
    --navy-900: #0a111d;
    --navy-800: #142135;
    --navy-700: #c9dbf2;
    --ink: #e8eef7;
    --muted: #9fb0c7;
    --line: #243349;
    --line-strong: #3a4c66;
    --paper: #0b1420;
    --white: #111d2e;
    --gold: #f0b455;
    --gold-soft: #2c2413;
    --blue-soft: #16273f;
}

html[data-theme="dark"] .sidebar { background: #0a111d; border-right: 1px solid var(--line); }
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .topbar { background: rgba(10, 17, 29, 0.95); }

html[data-theme="dark"] .side-link.is-active {
    background: rgba(240, 180, 85, 0.14);
    color: #ffd18a;
    box-shadow: inset 3px 0 0 var(--gold);
}
html[data-theme="dark"] .side-footer-link { color: rgba(255, 255, 255, 0.55); }

html[data-theme="dark"] .site-menu a:hover,
html[data-theme="dark"] .site-menu a.is-active,
html[data-theme="dark"] .table-link,
html[data-theme="dark"] .slot-time { color: var(--navy-700); }

html[data-theme="dark"] .chip,
html[data-theme="dark"] .panel-check,
html[data-theme="dark"] .countdown { color: #d7e6fa; }

html[data-theme="dark"] .alert-success { color: #7ee0bf; border-color: rgba(86, 211, 171, 0.25); }
html[data-theme="dark"] .alert-error { color: #ffb3a6; border-color: rgba(255, 149, 133, 0.25); }
html[data-theme="dark"] .alert-warning { color: #f5c489; border-color: rgba(240, 180, 106, 0.25); }
html[data-theme="dark"] .alert-info { color: #cfe2fb; border-color: rgba(201, 219, 242, 0.2); }

html[data-theme="dark"] .notification-row,
html[data-theme="dark"] .chat-item,
html[data-theme="dark"] .thread-message,
html[data-theme="dark"] .chat-exchange { background: var(--white); }
html[data-theme="dark"] .chat-item.chat-question { background: var(--gold-soft); }
html[data-theme="dark"] .thread-message.is-own { background: var(--blue-soft); }
html[data-theme="dark"] .notification-row.is-unread { background: #16263a; }
html[data-theme="dark"] .option-row:hover,
html[data-theme="dark"] .answer-text { background: #17263a; }

html[data-theme="dark"] .lecture-spotlight { background: linear-gradient(135deg, #0b1220, #1c2f49); }
html[data-theme="dark"] .ad-slot { background: rgba(255, 255, 255, 0.02); }
html[data-theme="dark"] .ad-slot-placeholder { background: #0e1827; }

/* Dark mode: keep the mobile menu lines readable on dark header surfaces. */
html[data-theme="dark"] .menu-toggle span,
html[data-theme="dark"] .icon-btn span { background: var(--ink); }
html[data-theme="dark"] .menu-toggle,
html[data-theme="dark"] .icon-btn { border-color: var(--line-strong); }

/* Blog */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.post-card {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.post-card .post-title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.35;
}

.post-card .post-title a {
    color: inherit;
    text-decoration: none;
}

.post-card .post-title a:hover,
.post-card .post-title a:focus-visible {
    text-decoration: underline;
}

.post-meta,
.post-byline {
    margin: 0;
    font-size: .82rem;
    color: var(--text-muted, #64748b);
}

.post-meta a {
    color: inherit;
}

.post-container {
    max-width: 760px;
}

.post-article h1 {
    margin: .35rem 0 .75rem;
    line-height: 1.2;
}

.post-body {
    margin-top: 1.75rem;
    font-size: 1.05rem;
    line-height: 1.75;
}

.post-body h2,
.post-body h3 {
    margin: 1.75rem 0 .6rem;
    line-height: 1.3;
}

.post-body p,
.post-body ul {
    margin: 0 0 1rem;
}

.post-body ul {
    padding-left: 1.25rem;
}

.post-body li {
    margin-bottom: .4rem;
}

.post-footer {
    margin-top: 2rem;
}

/* School applications */
.application-card {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.application-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.application-head h3 {
    margin: 0 0 .25rem;
}

.application-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .6rem 1.25rem;
    margin: 0;
}

.application-details dt {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted, #64748b);
}

.application-details dd {
    margin: .15rem 0 0;
    font-size: .92rem;
    word-break: break-word;
}

.application-message {
    margin: 0;
    padding: .75rem 1rem;
    border-radius: 10px;
    background: var(--surface-2, #f1f5f9);
    font-size: .92rem;
}

.application-reject {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
}

.application-reject .field {
    flex: 1 1 260px;
}

/* Shared form helpers used by the new pages */
.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.steps-list {
    margin: 0 0 .75rem;
    padding-left: 1.25rem;
    display: grid;
    gap: .5rem;
}

.contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .7rem;
}

.contact-list li {
    display: grid;
    gap: .1rem;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}

.table-actions form {
    margin: 0;
}

.btn.danger {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, .35);
}

html[data-theme="dark"] .post-meta,
html[data-theme="dark"] .post-byline {
    color: #94a3b8;
}

html[data-theme="dark"] .application-card {
    border-color: #334155;
}

html[data-theme="dark"] .application-message {
    background: #1e293b;
}

html[data-theme="dark"] .btn.danger {
    color: #fca5a5;
    border-color: rgba(252, 165, 165, .4);
}

html[data-theme="dark"] .application-details dt {
    color: #94a3b8;
}

html[data-theme="dark"] .application-details dd {
    color: #e2e8f0;
}

/* ---------- Home hero: colour, motion and imagery ---------- */
.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(900px 460px at 88% -10%, rgba(20, 184, 166, .22), transparent 60%),
        radial-gradient(700px 420px at 4% 110%, rgba(251, 191, 36, .18), transparent 65%),
        linear-gradient(160deg, #f0fdfa 0%, #f8fafc 45%, #eef6ff 100%);
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(15, 118, 110, .14) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent 70%);
    pointer-events: none;
}

.hero-grid { position: relative; z-index: 1; }
.hero h1 .highlight {
    background: linear-gradient(120deg, #0f766e 0%, #0ea5e9 55%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-visual { position: relative; min-height: 320px; display: flex; align-items: center; justify-content: center; }
.hero-photo {
    position: relative;
    z-index: 1;
    margin: 0;
    width: 100%;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 30px 60px -25px rgba(15, 23, 42, .45);
    border: 6px solid rgba(255, 255, 255, .8);
    animation: hero-float 9s ease-in-out infinite;
}
.hero-photo img { display: block; width: 100%; height: auto; }
.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(26px);
    opacity: .6;
    z-index: 0;
    animation: blob-drift 18s ease-in-out infinite;
}
.hero-blob-one { width: 190px; height: 190px; background: #fbbf24; top: -34px; right: -18px; }
.hero-blob-two { width: 230px; height: 230px; background: #5eead4; bottom: -44px; left: -36px; animation-delay: -7s; }
.hero-spark { position: absolute; z-index: 2; color: #f59e0b; font-size: 1.4rem; animation: sparkle 4.5s ease-in-out infinite; }
.hero-spark-one { top: 12%; left: 4%; }
.hero-spark-two { bottom: 16%; right: 6%; color: #14b8a6; animation-delay: -2s; }
.float-card {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .6rem .85rem;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 40px -16px rgba(15, 23, 42, .35);
    animation: float-card 6.5s ease-in-out infinite;
}
.float-card strong { display: block; font-size: .82rem; color: #0f172a; line-height: 1.2; }
.float-card small { display: block; font-size: .72rem; color: #64748b; }
.float-live { top: 4%; left: -2%; }
.float-lesson { bottom: 10%; right: -2%; animation-delay: -2.4s; }
.float-badge { bottom: -4%; left: 8%; animation-delay: -4.2s; }
.float-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); }
.float-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(140deg, #0f766e, #0ea5e9);
    color: #fff;
    font-size: .78rem;
}
.hero-highlights { background: linear-gradient(110deg, #0f766e, #0e7490 55%, #1d4ed8); color: #ecfeff; padding: 1.2rem 0; }
.hero-highlight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1rem 1.5rem; }
.hero-highlight { display: flex; align-items: flex-start; gap: .6rem; font-size: .88rem; line-height: 1.35; }
.hero-highlight strong { display: block; color: #fff; }
.hero-highlight small { display: block; opacity: .78; font-size: .76rem; }
.hero-highlight-icon { font-size: 1.15rem; line-height: 1; }
@keyframes hero-float { 0%, 100% { transform: translateY(0) rotate(-.6deg); } 50% { transform: translateY(-12px) rotate(.4deg); } }
@keyframes float-card { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes blob-drift { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(16px, -14px) scale(1.08); } }
@keyframes sparkle { 0%, 100% { opacity: .45; transform: scale(.9) rotate(0deg); } 50% { opacity: 1; transform: scale(1.15) rotate(18deg); } }

html[data-theme="dark"] .hero {
    background:
        radial-gradient(900px 460px at 88% -10%, rgba(20, 184, 166, .2), transparent 60%),
        radial-gradient(700px 420px at 4% 110%, rgba(251, 191, 36, .12), transparent 65%),
        linear-gradient(160deg, #071b1c 0%, #0b1220 55%, #0b1a2b 100%);
}
html[data-theme="dark"] .float-card { background: #111c2e; }
html[data-theme="dark"] .float-card strong { color: #f1f5f9; }
html[data-theme="dark"] .float-card small { color: #94a3b8; }
html[data-theme="dark"] .hero-photo { border-color: rgba(148, 163, 184, .25); }

@media (max-width: 900px) {
    .hero-visual { margin-top: 1.5rem; }
    .float-live { left: 0; }
    .float-lesson { right: 0; }
    .float-badge { left: 4%; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-photo, .float-card, .hero-blob, .hero-spark { animation: none; }
}

/* ---------- Blog ---------- */
.featured-post {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 0;
    margin-bottom: 2.25rem;
    border-radius: 22px;
    overflow: hidden;
    background: var(--surface, #fff);
    border: 1px solid rgba(148, 163, 184, .28);
    box-shadow: 0 30px 60px -40px rgba(15, 23, 42, .5);
}
.featured-media { display: block; min-height: 280px; background: linear-gradient(135deg, #0f766e, #0ea5e9); }
.featured-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured-media .media-fallback { display: grid; place-items: center; height: 100%; color: #ecfeff; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.featured-copy { padding: 1.8rem 2rem; display: flex; flex-direction: column; gap: .7rem; justify-content: center; }
.featured-copy h2 { margin: 0; font-size: 1.7rem; line-height: 1.25; }
.featured-copy h2 a { color: inherit; text-decoration: none; }
.featured-copy h2 a:hover { text-decoration: underline; }
.post-grid-wide { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.post-category {
    display: inline-block;
    padding: .18rem .55rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, .12);
    color: #0f766e;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.post-thumb { display: block; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #0f766e, #0ea5e9); margin-bottom: .35rem; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.post-card:hover .post-thumb img { transform: scale(1.04); }
.post-thumb .media-fallback { display: grid; place-items: center; height: 100%; color: #ecfeff; font-weight: 700; text-transform: uppercase; font-size: .8rem; }
.post-excerpt { font-size: .92rem; }
.category-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
.chip.is-active { background: #0f766e; color: #fff; border-color: #0f766e; }
.chip-count { opacity: .65; font-size: .72em; }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 2.25rem; align-items: start; }
.post-main { min-width: 0; }
.post-side { display: grid; gap: 1rem; position: sticky; top: 1.25rem; }
.post-hero-image { margin: 1.4rem 0 1.75rem; border-radius: 18px; overflow: hidden; }
.post-hero-image img { width: 100%; height: auto; display: block; }
.post-body img { max-width: 100%; height: auto; border-radius: 12px; }
.post-body blockquote { margin: 1.4rem 0; padding: .9rem 1.2rem; border-left: 4px solid #14b8a6; background: rgba(20, 184, 166, .08); border-radius: 0 12px 12px 0; }
.post-body pre { overflow-x: auto; padding: 1rem; border-radius: 12px; background: #0f172a; color: #e2e8f0; }
.post-body a { color: #0f766e; }
.tag-list { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1.75rem 0 1rem; }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: 1rem 0; border-top: 1px solid rgba(148, 163, 184, .3); border-bottom: 1px solid rgba(148, 163, 184, .3); }
.share-btn { border: 1px solid rgba(148, 163, 184, .5); background: transparent; border-radius: 999px; padding: .32rem .8rem; font-size: .8rem; cursor: pointer; color: inherit; text-decoration: none; }
.share-btn:hover { border-color: #0f766e; color: #0f766e; }
.author-box { display: flex; gap: .9rem; align-items: center; margin: 1.5rem 0; padding: 1rem 1.15rem; border-radius: 16px; background: rgba(15, 118, 110, .07); }
.author-box p { margin: .2rem 0 0; }
.author-avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(140deg, #0f766e, #0ea5e9); color: #fff; font-weight: 700; text-transform: uppercase; }
.breadcrumb { display: flex; gap: .45rem; font-size: .82rem; margin-bottom: .6rem; color: var(--muted, #64748b); }
.sidebar-card h3 { margin-top: 0; }
.sidebar-links, .sidebar-posts { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; font-size: .9rem; }
.sidebar-posts small { display: block; margin-top: .15rem; }
.sidebar-cta { background: linear-gradient(160deg, rgba(15, 118, 110, .1), rgba(14, 165, 233, .08)); }
.admin-post-cell { display: flex; align-items: center; gap: .65rem; }
.admin-post-thumb { width: 52px; height: 40px; border-radius: 8px; object-fit: cover; background: #e2e8f0; }
.admin-post-thumb-empty { display: grid; place-items: center; color: #0f172a; font-weight: 700; }
.serp-preview { display: grid; gap: .2rem; padding: .9rem 1rem; border-radius: 12px; border: 1px solid rgba(148, 163, 184, .35); margin-bottom: 1.25rem; }
.serp-preview strong { color: #1a0dab; font-size: 1.05rem; font-weight: 500; }
.serp-preview span { font-size: .82rem; color: #4d5156; }
.serp-url { color: #202124; }

/* Blog editor */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.25rem; align-items: start; }
.editor-main, .editor-side { display: grid; gap: 1.25rem; min-width: 0; }
.editor-side { position: sticky; top: 1rem; }
.input-title { font-size: 1.2rem; font-weight: 600; }
.slug-row { display: flex; align-items: stretch; margin: .4rem 0 1.25rem; }
.slug-label { display: flex; align-items: center; padding: 0 1rem; border-radius: 8px 0 0 8px; background: #1e293b; color: #e2e8f0; font-size: .82rem; font-weight: 600; }
.slug-row .input { border-radius: 0 8px 8px 0; }
.rich-editor { border: 1px solid rgba(148, 163, 184, .45); border-radius: 12px; overflow: hidden; background: var(--surface, #fff); }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: .15rem; padding: .4rem .5rem; border-bottom: 1px solid rgba(148, 163, 184, .35); background: var(--surface-2, #f8fafc); }
.editor-toolbar button { border: 0; background: transparent; border-radius: 6px; padding: .35rem .5rem; font-size: .82rem; cursor: pointer; color: inherit; min-width: 30px; }
.editor-toolbar button:hover { background: rgba(15, 118, 110, .12); color: #0f766e; }
.editor-sep { width: 1px; align-self: stretch; margin: .2rem .3rem; background: rgba(148, 163, 184, .45); }
.editor-area { min-height: 340px; padding: 1rem 1.1rem; outline: none; line-height: 1.7; }
.editor-area:focus { box-shadow: inset 0 0 0 2px rgba(20, 184, 166, .35); }
.editor-area h2, .editor-area h3 { margin: 1rem 0 .5rem; }
.editor-area p { margin: 0 0 .8rem; }
.editor-status { display: flex; justify-content: space-between; padding: .4rem .8rem; font-size: .74rem; color: var(--muted, #64748b); border-top: 1px solid rgba(148, 163, 184, .3); }
.category-checks { display: grid; gap: .35rem; margin-bottom: .9rem; }
.feature-preview { aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: #94a3b8; margin-bottom: .9rem; }
.feature-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature-empty { display: grid; place-items: center; height: 100%; gap: .3rem; color: #f8fafc; background: linear-gradient(140deg, #94a3b8, #64748b); }
.feature-empty span { font-size: 2rem; }
html[data-theme="dark"] .serp-preview strong { color: #8ab4f8; }
html[data-theme="dark"] .serp-preview span { color: #bdc1c6; }
html[data-theme="dark"] .slug-label { background: #020617; }
html[data-theme="dark"] .editor-toolbar { background: #0f172a; }
html[data-theme="dark"] .post-category { background: rgba(45, 212, 191, .16); color: #5eead4; }
html[data-theme="dark"] .post-body a { color: #5eead4; }

@media (max-width: 1000px) {
    .featured-post { grid-template-columns: 1fr; }
    .featured-media { min-height: 220px; }
    .post-layout, .editor-layout { grid-template-columns: 1fr; }
    .post-side, .editor-side { position: static; }
}

/* Free tools */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.tool-card { display: flex; flex-direction: column; gap: .6rem; padding: 1.5rem; border-radius: 20px; background: var(--surface, #fff); border: 1px solid rgba(148, 163, 184, .3); text-decoration: none; color: inherit; transition: transform .25s ease, box-shadow .25s ease; position: relative; overflow: hidden; }
.tool-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--tool-accent, #0f766e); }
.tool-card:hover { transform: translateY(-4px); box-shadow: 0 24px 40px -28px rgba(15, 23, 42, .55); }
.tool-card h2 { font-size: 1.15rem; margin: 0; }
.tool-card p { margin: 0; font-size: .92rem; color: var(--muted, #64748b); }
.tool-link { margin-top: auto; font-weight: 600; font-size: .86rem; color: var(--tool-accent, #0f766e); }
.tool-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: rgba(15, 118, 110, .12); color: var(--tool-accent, #0f766e); font-size: 1.35rem; font-weight: 700; }
.tool-card-teal { --tool-accent: #0f766e; }
.tool-card-gold { --tool-accent: #b45309; }
.tool-card-purple { --tool-accent: #7c3aed; }
.tool-card-rose { --tool-accent: #be123c; }
.tool-card-gold .tool-icon { background: rgba(180, 83, 9, .12); }
.tool-card-purple .tool-icon { background: rgba(124, 58, 237, .12); }
.tool-card-rose .tool-icon { background: rgba(190, 18, 60, .12); }
.grade-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .85rem 1rem; margin: 1rem 0 1.25rem; }
.tool-result { margin-top: 1.4rem; padding: 1.2rem 1.35rem; border-radius: 16px; background: linear-gradient(150deg, rgba(15, 118, 110, .1), rgba(14, 165, 233, .08)); border: 1px solid rgba(15, 118, 110, .25); }
.tool-result[hidden] { display: none; }
.result-big { font-size: 2.8rem; font-weight: 800; line-height: 1; color: #0f766e; }
.result-label { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #64748b); }
.faq { display: grid; gap: .8rem; max-width: 780px; }
.faq details { background: var(--surface, #fff); border: 1px solid rgba(148, 163, 184, .3); border-radius: 14px; padding: .9rem 1.1rem; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: .6rem 0 0; color: var(--muted, #64748b); }
.day-picker { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; }
.day-chip { position: relative; }
.day-chip input { position: absolute; opacity: 0; pointer-events: none; }
.day-chip span { display: inline-block; padding: .4rem .8rem; border-radius: 999px; border: 1px solid rgba(148, 163, 184, .5); font-size: .82rem; cursor: pointer; }
.day-chip input:checked + span { background: #0f766e; border-color: #0f766e; color: #fff; }
.day-chip input:focus-visible + span { outline: 2px solid #0ea5e9; outline-offset: 2px; }
.timetable-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.timetable-wrap { overflow-x: auto; }
.timetable-table td:first-child { white-space: nowrap; }
.form-error { color: #b91c1c; margin: 0; }
.countdown-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; }
.countdown-card { border-top: 5px solid var(--count-accent, #0f766e); }
.countdown-card h2 { font-size: 1.05rem; margin-top: 0; }
.countdown-teal { --count-accent: #0f766e; }
.countdown-gold { --count-accent: #d97706; }
.countdown-purple { --count-accent: #7c3aed; }
.countdown-rose { --count-accent: #e11d48; }
.countdown-value { font-size: 1.05rem; margin: .8rem 0 .3rem; }
.countdown-value strong { font-size: 1.7rem; color: var(--count-accent, #0f766e); }
.countdown-note { margin: 0; font-size: .82rem; color: var(--muted, #64748b); }
.countdown-help { margin-top: 1rem; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; }
.topic-card { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem; border-radius: 14px; border: 1px solid rgba(148, 163, 184, .35); background: var(--surface, #fff); text-decoration: none; color: inherit; transition: border-color .2s ease, transform .2s ease; }
.topic-card:hover { border-color: #0f766e; transform: translateY(-2px); }
.topic-code { font-size: .72rem; font-weight: 700; letter-spacing: .08em; color: #0f766e; text-transform: uppercase; }
.topic-card small { color: var(--muted, #64748b); font-size: .8rem; }
.practice-wrap { display: grid; gap: 1.25rem; max-width: 860px; margin: 0 auto; }
.practice-score { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.practice-score h2 { margin: 0 0 .2rem; }
.practice-score .btn { margin-left: auto; }
.practice-score-value { font-size: 2.4rem; font-weight: 800; color: #0f766e; line-height: 1; }
.practice-number { margin: 0 0 .5rem; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted, #64748b); }
.practice-question h3 { margin-top: 0; font-size: 1.1rem; }
.practice-question.is-correct { border-left: 5px solid #16a34a; }
.practice-question.is-wrong { border-left: 5px solid #dc2626; }
.practice-options { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .5rem; }
.practice-option { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: 10px; border: 1px solid rgba(148, 163, 184, .45); cursor: pointer; }
.practice-option:hover { border-color: #0f766e; }
.practice-options li.is-answer { background: rgba(22, 163, 74, .1); border: 1px solid rgba(22, 163, 74, .45); border-radius: 10px; padding: .6rem .8rem; display: flex; gap: .6rem; align-items: center; }
.practice-options li.is-picked { background: rgba(220, 38, 38, .08); border: 1px solid rgba(220, 38, 38, .35); border-radius: 10px; padding: .6rem .8rem; display: flex; gap: .6rem; align-items: center; }
.option-letter { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(15, 118, 110, .12); color: #0f766e; font-weight: 700; font-size: .78rem; flex: none; }
.practice-explanation { margin: 1rem 0 0; padding: .8rem 1rem; border-radius: 10px; background: rgba(14, 165, 233, .08); font-size: .92rem; }
.auth-help-split { display: flex; flex-direction: column; gap: .3rem; }

html[data-theme="dark"] .tool-result { background: linear-gradient(150deg, rgba(45, 212, 191, .12), rgba(14, 165, 233, .1)); }
html[data-theme="dark"] .result-big, html[data-theme="dark"] .practice-score-value { color: #5eead4; }
html[data-theme="dark"] .serp-preview { border-color: #334155; }
html[data-theme="dark"] .editor-area, html[data-theme="dark"] .rich-editor { background: #0b1220; color: #e2e8f0; }
html[data-theme="dark"] .practice-options li.is-answer { background: rgba(34, 197, 94, .15); }
html[data-theme="dark"] .practice-options li.is-picked { background: rgba(248, 113, 113, .12); }
html[data-theme="dark"] .option-letter { background: rgba(45, 212, 191, .16); color: #5eead4; }

@media print {
    .site-header, .site-footer, .theme-btn, .ad-slot, .share-row, .post-side,
    [data-tt-form], .page-hero, .hero-highlights, .breadcrumb { display: none !important; }
    .timetable-wrap { overflow: visible; }
    .timetable-table { width: 100%; border-collapse: collapse; }
    .timetable-table th, .timetable-table td { border: 1px solid #999; padding: 6px 8px; }
}

html[data-theme="dark"] .tool-card,
html[data-theme="dark"] .topic-card,
html[data-theme="dark"] .featured-post,
html[data-theme="dark"] .faq details {
    background: #0f172a;
    border-color: #334155;
}

html[data-theme="dark"] .tool-card h2,
html[data-theme="dark"] .topic-card strong {
    color: #e2e8f0;
}

html[data-theme="dark"] .featured-copy h2 a {
    color: #f1f5f9;
}

html[data-theme="dark"] .hero h1 .highlight {
    background: linear-gradient(120deg, #5eead4 0%, #7dd3fc 55%, #fcd34d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Search preview URL must follow the theme */
.serp-url { color: #202124; }
html[data-theme="dark"] .serp-url { color: #9aa0a6; }
html[data-theme="dark"] .serp-preview strong { color: #8ab4f8; }

/* Article tables and TinyMCE textarea */
.post-body table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .95rem; }
.post-body th, .post-body td { border: 1px solid rgba(148, 163, 184, .45); padding: .55rem .7rem; text-align: left; vertical-align: top; }
.post-body thead th { background: rgba(15, 118, 110, .08); }
html[data-theme="dark"] .post-body thead th { background: rgba(45, 212, 191, .12); }
.editor-textarea { min-height: 420px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; line-height: 1.6; }
.tox-tinymce { border-radius: 12px !important; border-color: rgba(148, 163, 184, .45) !important; }

/* ---------- Header refresh ---------- */
.site-header {
    background: rgba(255, 255, 255, .88);
    border-bottom: 0;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .06), 0 18px 40px -38px rgba(15, 23, 42, .5);
    backdrop-filter: blur(14px) saturate(1.2);
}
.site-header::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(15, 118, 110, .35), rgba(245, 158, 11, .4), transparent);
}
.header-inner { min-height: 78px; gap: 1rem; }
.site-menu { margin-left: 2rem; margin-right: .5rem; gap: .1rem; font-size: .9rem; }
.site-menu > a,
.site-menu > .nav-drop > summary {
    display: inline-flex;
    align-items: center;
    padding: .5rem .7rem;
    border-radius: 9px;
    color: var(--muted);
    white-space: nowrap;
    transition: background .18s ease, color .18s ease;
}
.site-menu > a:hover,
.site-menu > .nav-drop > summary:hover,
.site-menu > .nav-drop[open] > summary {
    background: rgba(15, 118, 110, .08);
    color: var(--navy-800);
    text-decoration: none;
}
.site-menu > a.is-active,
.site-menu > .nav-drop > summary.is-active {
    background: rgba(15, 118, 110, .11);
    color: #0f766e;
}
.nav-drop { position: relative; }
.nav-drop > summary { cursor: pointer; list-style: none; font-weight: 600; }
.nav-drop > summary::-webkit-details-marker { display: none; }
.nav-caret {
    width: .4rem; height: .4rem;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .18s ease;
    margin-left:5px;
}
.nav-drop[open] > summary .nav-caret { transform: rotate(225deg) translateY(-1px); }
.nav-drop-panel {
    position: absolute;
    top: calc(100% + .55rem);
    left: 0;
    min-width: 270px;
    padding: .5rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 26px 55px -28px rgba(15, 23, 42, .5);
    display: grid;
    gap: .12rem;
    z-index: 60;
    animation: menu-pop .16s ease;
}
.nav-drop-panel a {
    display: block;
    padding: .55rem .7rem;
    border-radius: 9px;
    font-size: .87rem;
    font-weight: 600;
    color: var(--ink);
}
.nav-drop-panel a small {
    display: block;
    margin-top: .1rem;
    font-size: .74rem;
    font-weight: 500;
    color: var(--muted);
}
.nav-drop-panel a:hover { background: rgba(15, 118, 110, .08); text-decoration: none; }
.auth-drop > summary.btn { margin: 0; }
.auth-panel { left: auto; right: 0; min-width: 285px; }
@keyframes menu-pop { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }

html[data-theme="dark"] .site-header { background: rgba(8, 15, 28, .9); }
html[data-theme="dark"] .nav-drop-panel { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .nav-drop-panel a { color: #e2e8f0; }
html[data-theme="dark"] .nav-drop-panel a small { color: #94a3b8; }
html[data-theme="dark"] .nav-drop-panel a:hover { background: rgba(45, 212, 191, .12); }
html[data-theme="dark"] .site-menu > a.is-active,
html[data-theme="dark"] .site-menu > .nav-drop > summary.is-active { color: #5eead4; background: rgba(45, 212, 191, .12); }

/* ---------- Inner page hero ---------- */
.page-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(2.8rem, 6vw, 4.8rem) 0 clamp(2rem, 3.5vw, 3rem);
    background:
        radial-gradient(700px 320px at 92% -20%, rgba(20, 184, 166, .2), transparent 65%),
        radial-gradient(520px 280px at 0% 110%, rgba(251, 191, 36, .16), transparent 70%),
        linear-gradient(135deg, #f0fdfa 0%, #f8fafc 55%, #eef6ff 100%);
    border-bottom: 0;
}
.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(15, 118, 110, .12) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(to right, rgba(0, 0, 0, .45), transparent 62%);
    pointer-events: none;
}
.page-hero::after {
    content: "";
    position: absolute;
    right: -80px; top: -90px;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(251, 191, 36, .35), transparent 70%);
    filter: blur(8px);
    pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero .eyebrow {
    padding: .32rem .75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 8px 20px -14px rgba(15, 23, 42, .45);
    color: #0f766e;
}
.page-hero h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); max-width: 22ch; }
.page-hero .lede { font-size: 1.08rem; max-width: 62ch; }
html[data-theme="dark"] .page-hero {
    background:
        radial-gradient(700px 320px at 92% -20%, rgba(20, 184, 166, .18), transparent 65%),
        radial-gradient(520px 280px at 0% 110%, rgba(251, 191, 36, .1), transparent 70%),
        linear-gradient(135deg, #071b1c 0%, #0b1220 55%, #0b1a2b 100%);
}
html[data-theme="dark"] .page-hero .eyebrow { background: #0f172a; color: #5eead4; }

/* ---------- Section life ---------- */
.section-head .eyebrow { color: #0f766e; }
.step-card,
.feature-card,
.subject-pill {
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background .25s ease;
}
.step-card {
    position: relative;
    overflow: hidden;
    border-top: 3px solid transparent;
}
.step-card:nth-child(1) { --accent: #0f766e; }
.step-card:nth-child(2) { --accent: #d97706; }
.step-card:nth-child(3) { --accent: #7c3aed; }
.step-card:nth-child(4) { --accent: #e11d48; }
.step-card:hover {
    transform: translateY(-5px);
    border-top-color: var(--accent, #0f766e);
    box-shadow: 0 26px 45px -34px rgba(15, 23, 42, .55);
}
.step-number {
    background: linear-gradient(135deg, var(--accent, #0f766e), #0ea5e9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 26px 45px -36px rgba(15, 23, 42, .5); border-color: rgba(15, 118, 110, .35); }
.subject-pill:hover { transform: translateY(-2px); border-color: rgba(15, 118, 110, .45); background: rgba(15, 118, 110, .06); }
.cta-band {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, #0f766e 0%, #0e7490 48%, #1d4ed8 100%);
    color: #fff;
}
.cta-band::before {
    content: "";
    position: absolute;
    width: 320px; height: 320px;
    right: -80px; top: -140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(251, 191, 36, .45), transparent 68%);
    animation: cta-glow 9s ease-in-out infinite;
    pointer-events: none;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 255, 255, .82); }
.cta-band > * { position: relative; z-index: 1; }
@keyframes cta-glow { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-18px, 14px) scale(1.12); } }
.section-dark { position: relative; overflow: hidden; background: linear-gradient(135deg, #0b1220 0%, #0f2a3a 60%, #102a43 100%); }
.section-dark::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(94, 234, 212, .16) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent 80%);
    pointer-events: none;
}
.section-dark > * { position: relative; z-index: 1; }

/* Gentle reveal on scroll (added by alive.js) */
.reveal-ready .reveal-item { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal-ready .reveal-item.is-visible { opacity: 1; transform: none; }

@media (max-width: 960px) {
    .site-header .header-cta .auth-drop { display: none; }
    .site-menu .menu-auth { display: block; }
    .site-header.is-open .site-menu {
        inset: 78px 0 auto 0;
        background: var(--white);
        max-height: calc(100vh - 78px);
        overflow-y: auto;
    }
    .site-header.is-open .site-menu > a,
    .site-header.is-open .site-menu > .nav-drop > summary {
        display: flex;
        width: 100%;
        padding: .65rem .3rem;
        border-radius: 8px;
    }
    .site-menu .nav-drop { width: 100%; }
    .site-header .nav-drop-panel {
        position: static;
        min-width: 0;
        border: 0;
        box-shadow: none;
        padding: 0 0 .4rem .9rem;
        background: transparent;
        animation: none;
    }
    .nav-drop-panel a { padding: .45rem .5rem; font-size: .84rem; }
    html[data-theme="dark"] .site-header.is-open .site-menu { background: #0b1220; }
}

@media (max-width: 1080px) and (min-width: 961px) {
    .site-menu { margin-left: 1rem; gap: 0; font-size: .86rem; }
    .site-menu > a, .site-menu > .nav-drop > summary { padding: .45rem .55rem; }
}

@media (prefers-reduced-motion: reduce) {
    .reveal-ready .reveal-item { opacity: 1; transform: none; transition: none; }
    .cta-band::before { animation: none; }
}

.hero-upload-preview { max-width: 430px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #f8fafc; }
.hero-upload-preview img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

/* Mobile-only sign-in link must not duplicate the desktop Sign in menu. */
.site-menu > a.menu-auth { display: none; }
.site-menu { margin-left: auto; margin-right: .65rem; }
@media (max-width: 960px) {
    .site-menu { margin-left: 0; margin-right: 0; }
    .site-menu > a.menu-auth { display: flex; }
}

.referral-code-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }
.referral-code { padding: .5rem .8rem; border-radius: 10px; background: rgba(15, 118, 110, .1); color: #0f766e; font-size: 1.05rem; letter-spacing: .08em; font-weight: 700; }
html[data-theme="dark"] .referral-code { background: rgba(45, 212, 191, .14); color: #5eead4; }

.in-article-ad { margin: 1.75rem 0; padding: .75rem 0; text-align: center; border-top: 1px solid rgba(148,163,184,.25); border-bottom: 1px solid rgba(148,163,184,.25); }

/* Contact details must stay legible whatever the theme or brand colour. */
.footer-contact a, .footer-contact h4, .footer-contact .footer-socials a { color: #ffffff !important; }
.footer-contact a { opacity: .92; }
.footer-contact a:hover { opacity: 1; text-decoration: underline; }
.footer-socials { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .55rem; font-size: .8rem; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; }
.contact-card { position: relative; border-radius: 16px; padding: 1.4rem 1.35rem; color: #ffffff; overflow: hidden; }
.contact-card h2 { color: #ffffff; margin: .4rem 0 .3rem; font-size: 1.15rem; }
.contact-card p { color: rgba(255,255,255,.82); font-size: .9rem; margin-bottom: .7rem; }
.contact-card a { color: #ffffff; font-weight: 700; word-break: break-word; }
.contact-card a:hover { text-decoration: underline; }
.contact-card-teal { background: linear-gradient(135deg, #0f766e, #0e7490); }
.contact-card-navy { background: linear-gradient(135deg, #14213d, #1d4ed8); }
.contact-card-green { background: linear-gradient(135deg, #15803d, #0f766e); }
.contact-icon { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.16); font-size: 1.05rem; }
.social-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.social-link { display: inline-flex; padding: .5rem .85rem; border-radius: 999px; border: 1px solid rgba(148,163,184,.45); font-weight: 600; font-size: .88rem; }
.category-manage { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 20px;}
.category-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .4rem .35rem .7rem; border-radius: 999px; background: rgba(15,118,110,.1); color: #0f766e; font-weight: 600; font-size: .85rem; }
.category-chip form { display: inline; }
.category-chip button { border: 0; background: transparent; color: inherit; font-size: 1.05rem; line-height: 1; cursor: pointer; padding: 0 .2rem; }
.category-chip small { opacity: .7; font-weight: 500; }
.inline-form { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.inline-form .input { max-width: 280px; }
html[data-theme="dark"] .category-chip { background: rgba(45,212,191,.14); color: #5eead4; }

/* JAMB CBT area */
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.subject-card { border: 1px solid rgba(148,163,184,.28); border-radius: 14px; padding: 1rem; }
.subject-card h4 { margin: 0 0 .25rem; }
.jamb-price { font-size: 2rem; font-weight: 800; margin: .35rem 0; }
.feature-list { margin: .6rem 0 1rem; padding-left: 1.15rem; display: grid; gap: .4rem; }
.cbt-timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.35rem; padding: .45rem .8rem; border-radius: 10px; background: rgba(15,23,42,.08); color: #0f172a; }
html[data-theme="dark"] .cbt-timer { background: rgba(148,163,184,.18); color: #f8fafc; }
.cbt-question-head { display: flex; align-items: center; gap: .55rem; margin-bottom: .6rem; }
.cbt-number { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; background: #0f766e; color: #fff; font-weight: 700; font-size: .9rem; }
.cbt-text { font-size: 1rem; line-height: 1.6; }
.cbt-options { display: grid; gap: .5rem; }
.cbt-option { display: flex; gap: .65rem; align-items: flex-start; padding: .65rem .75rem; border: 1px solid rgba(148,163,184,.35); border-radius: 10px; cursor: pointer; }
.cbt-option:hover { border-color: #0f766e; }
.cbt-option input { margin-top: .2rem; }
.cbt-submit { display: flex; gap: .6rem; flex-wrap: wrap; position: sticky; bottom: 0; }
.cbt-score-card { display: flex; gap: 1.5rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cbt-score { font-size: 2.4rem; font-weight: 800; margin: .15rem 0; }
.cbt-meter { flex: 1; min-width: 180px; height: 12px; border-radius: 999px; background: rgba(148,163,184,.3); overflow: hidden; }
.cbt-meter span { display: block; height: 100%; background: #0f766e; }
.cbt-review.is-correct { border-left: 4px solid #15803d; }
.cbt-review.is-wrong { border-left: 4px solid #b91c1c; }
.cbt-answers { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .35rem; }
.cbt-answers li { padding: .45rem .6rem; border-radius: 8px; border: 1px solid rgba(148,163,184,.25); font-size: .92rem; }
.cbt-answers li.is-answer { border-color: #15803d; background: rgba(21,128,61,.08); }
.cbt-answers li.is-chosen:not(.is-answer) { border-color: #b91c1c; background: rgba(185,28,28,.08); }
.cbt-tag { margin-left: .5rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }
.cbt-explanation { margin-top: .7rem; padding: .65rem .75rem; border-radius: 8px; background: rgba(15,118,110,.08); font-size: .9rem; }
.question-feed { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .7rem; max-height: 420px; overflow-y: auto; }
.question-feed li { padding-bottom: .6rem; border-bottom: 1px solid rgba(148,163,184,.25); }
.question-feed p { margin: .2rem 0 0; font-size: .88rem; color: inherit; }

/* Custom confirmation dialog */
.confirm-backdrop { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(2, 6, 23, .62); backdrop-filter: blur(3px); }
.confirm-backdrop[hidden] { display: none; }
.confirm-dialog { width: min(440px, 100%); background: var(--surface, #fff); color: var(--text, #0f172a); border: 1px solid rgba(148,163,184,.35); border-radius: 18px; padding: 1.4rem; box-shadow: 0 24px 70px rgba(2,6,23,.35); animation: confirmIn .16s ease-out; }
.confirm-icon { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.2rem; color: #b91c1c; background: rgba(185,28,28,.12); margin-bottom: .7rem; }
.confirm-dialog h3 { margin: 0 0 .35rem; font-size: 1.15rem; }
.confirm-text { margin: 0 0 1.1rem; color: var(--muted, #475569); line-height: 1.55; }
.confirm-actions { display: flex; justify-content: flex-end; gap: .55rem; flex-wrap: wrap; }
@keyframes confirmIn { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
html[data-theme="dark"] .confirm-dialog { background: #0f172a; color: #f8fafc; border-color: rgba(148,163,184,.3); }
html[data-theme="dark"] .confirm-text { color: #cbd5e1; }

/* Registration payment choice */
.payment-option { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.1rem; border: 1px solid rgba(148,163,184,.35); border-radius: 14px; background: rgba(148,163,184,.06); }
.payment-option h3 { margin: 0 0 .2rem; }
.payment-option p { margin: 0; }
@media (max-width: 560px) { .payment-option { align-items: stretch; } .payment-option form, .payment-option .btn { width: 100%; } }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .9rem 1rem; border-top: 1px solid rgba(148,163,184,.22); }
.pagination .is-current { background: var(--primary, #2563eb); border-color: var(--primary, #2563eb); color: #fff; }
.pagination .is-disabled { opacity: .45; pointer-events: none; }
