/* ==========================================================
   ALICE Design System — alice.css
   Decision 011: No CSS framework. Single handwritten file.
   Decision 010: Okabe-Ito aligned palette. Triple-signal status.
   ========================================================== */

/* 1. CSS Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

/* 2. CSS Custom Properties */
:root {
    --alice-blue: #185FA5;
    --alice-amber: #EF9F27;
    --alice-teal: #1D9E75;
    --alice-warning: #BA7517;
    --alice-gray: #888780;
    --alice-surface: #FFFFFF;
    --alice-bg: #F5F5F2;
    --alice-text: #1A1A1A;
    --alice-text-secondary: #555550;
    --alice-text-tertiary: #888880;
    --alice-border: #E0DFD8;
    --alice-border-strong: #C0BFB8;
    --alice-focus: #185FA5;

    /* Tints for status badges */
    --alice-teal-tint: #E6F5EF;
    --alice-amber-tint: #FFF5E0;
    --alice-gray-tint: #F0EFEC;
    --alice-blue-tint: #E8F0FA;

    --alice-border-secondary: #D0CFc8;
    --alice-border-tertiary: #E8E7E0;

    /* Radii */
    --radius-md: 6px;
    --radius-lg: 10px;

    /* Map path / inactive elements */
    --alice-map-path:  #888880;
    --alice-map-muted: #C0BFB8;

    /* Hyperlink color */
    --link-color: #7ab8f5;   /* light blue, readable on navy, WCAG AA */

    /* Font stacks */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ── STANDARD (default) ─── already in :root ─────────── */
/* --alice-blue:    #185FA5  */
/* --alice-amber:   #EF9F27  */
/* --alice-teal:    #1D9E75  */
/* --alice-warning: #BA7517  */
/* --alice-gray:    #888780  */

/* ── DARK MODE ───────────────────────────────────── */
body.th-dark {
  --alice-blue:         #85B7EB;
  --alice-amber:        #EF9F27;
  --alice-teal:         #5DCAA5;
  --alice-warning:      #FAC775;
  --alice-gray:         #B4B2A9;
  --alice-surface:      #1E1E1E;
  --alice-bg:           #121212;
  --alice-text:         #E8E6E0;
  --alice-text-secondary:#A8A6A0;
  --alice-text-tertiary: #888880;
  --alice-border:       #3A3A38;
  --alice-border-strong:#555550;
  --alice-teal-tint:    #1A2E26;
  --alice-amber-tint:   #2E2618;
  --alice-gray-tint:    #2A2A28;
  --alice-blue-tint:    #1A2436;
  --alice-map-path:     #888880;
  --alice-map-muted:    #555550;
  --link-color:         #85B7EB;
}

/* ── LIGHT MODE ──────────────────────────────────── */
body.th-light {
  --alice-blue:          #185FA5;
  --alice-amber:         #EF9F27;
  --alice-teal:          #1D9E75;
  --alice-surface:       #FFFFFF;
  --alice-bg:            #F5F5F2;
  --alice-text:          #1A1A1A;
  --alice-text-secondary:#555550;
  --alice-border:        #E0DFD8;
  --alice-border-strong: #C0BFB8;
  --alice-teal-tint:     #E6F5EF;
  --alice-amber-tint:    #FFF5E0;
  --alice-gray-tint:     #F0EFEC;
  --alice-blue-tint:     #E8F0FA;
  --alice-map-path:      #444440;
  --alice-map-muted:     #C0BFB8;
  --link-color:          #185FA5;
}

/* ── HIGH CONTRAST (theme) ──────────────────────────── */
body.th-hico {
  --alice-blue:          #0000EE;
  --alice-amber:         #FFDD00;
  --alice-teal:          #006600;
  --alice-warning:       #CC4400;
  --alice-gray:          #555555;
  --alice-surface:       #FFFFFF;
  --alice-bg:            #F0F0F0;
  --alice-text:          #000000;
  --alice-text-secondary:#111111;
  --alice-border:        #000000;
  --alice-map-path:      #000000;
  --alice-map-muted:     #888888;
  --alice-focus:         #0000EE;
  --link-color:          #4488FF;
}

/* High contrast: heavier borders everywhere */
body.th-hico .card,
body.th-hico .nav,
body.th-hico .form-input,
body.th-hico .status-badge {
  border-width: 2px;
  border-color: var(--alice-border);
}

/* ── DEUTERANOPIA (accessibility overlay) ───────────── */
body.th-deut {
  --alice-blue:    #0072B2;   /* sky blue — unambiguous   */
  --alice-amber:   #F0E442;   /* yellow — distinct from blue */
  --alice-teal:    #009E73;   /* bluish green              */
  --alice-warning: #E69F00;   /* orange-gold               */
  --alice-focus:   #0072B2;
  --link-color:    #56B4E9;
}

/* ── PROTANOPIA (accessibility overlay) ─────────────── */
body.th-prot {
  --alice-blue:    #0072B2;
  --alice-amber:   #F0E442;
  --alice-teal:    #009E73;
  --alice-warning: #E69F00;
  --alice-focus:   #0072B2;
  --link-color:    #56B4E9;
}

/* ── TRITANOPIA (accessibility overlay) ─────────────── */
body.th-trit {
  --alice-blue:    #D55E00;   /* vermilion — distinct for trit */
  --alice-amber:   #CC79A7;   /* reddish purple                */
  --alice-teal:    #009E73;   /* green — unaffected            */
  --alice-warning: #D55E00;
  --alice-focus:   #009E73;
  --link-color:    #CC79A7;
}

/* ── HYPERLINK COLORS ───────────────────────────────── */
a {
  color: var(--link-color, #7ab8f5);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/*
 * WCAG AA contrast verification (4.5:1 body text, 3:1 large/UI):
 *
 * Standard:      #1A1A1A on #F5F5F2 = 14.5:1 ✓   Nav: #555550 on #FFFFFF = 7.2:1 ✓
 *                Btn: #FFFFFF on #185FA5 = 5.7:1 ✓  Error: #C13030 on #FFF0F0 = 5.1:1 ✓
 * Deuteranopia:  #1A1A1A on #F5F5F2 = 14.5:1 ✓   Btn: #FFFFFF on #0072B2 = 4.9:1 ✓
 * Protanopia:    #1A1A1A on #F5F5F2 = 14.5:1 ✓   Btn: #FFFFFF on #0072B2 = 4.9:1 ✓
 * Tritanopia:    #1A1A1A on #F5F5F2 = 14.5:1 ✓   Btn: #FFFFFF on #D55E00 = 4.6:1 ✓
 * High Contrast: #000000 on #F0F0F0 = 18.1:1 ✓   Btn: #FFFFFF on #0000EE = 8.6:1 ✓
 *                Focus: #0000EE outline = 8.6:1 ✓
 *
 * Badge text on badge tint backgrounds all exceed 4.5:1 in all themes.
 */

/* 3. Dark mode overrides */
@media (prefers-color-scheme: dark) {
    :root {
        --alice-blue: #85B7EB;
        --alice-amber: #EF9F27;
        --alice-teal: #5DCAA5;
        --alice-warning: #FAC775;
        --alice-gray: #B4B2A9;
        --alice-surface: #1E1E1E;
        --alice-bg: #121212;
        --alice-text: #E8E6E0;
        --alice-text-secondary: #A8A6A0;
        --alice-text-tertiary: #888880;
        --alice-border: #3A3A38;
        --alice-border-strong: #555550;

        --alice-teal-tint: #1A2E26;
        --alice-amber-tint: #2E2618;
        --alice-gray-tint: #2A2A28;
        --alice-blue-tint: #1A2436;
    }
}

/* 4. Typography */
body {
    font-family: var(--font-sans);
    background-color: var(--alice-bg);
    color: var(--alice-text);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

h1, h2, h3 {
    color: var(--alice-text);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

.wordmark,
.nav__wordmark,
.login-wordmark {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: normal;
    font-style: normal;
    color: var(--alice-text);
    letter-spacing: 0.05em;
}

/* 5. Layout utilities */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

/* 6. Navigation */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background-color: var(--alice-surface);
    border-bottom: 1px solid var(--alice-border);
}

.nav__wordmark {
    font-size: 1.5rem;
}

.nav__links {
    display: flex;
    gap: 1.5rem;
}

.nav__link {
    text-decoration: none;
    color: var(--alice-text-secondary);
    font-size: 0.9rem;
    padding: 0.25rem 0;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.nav__link:hover {
    color: var(--alice-text);
}

.nav__link--active {
    color: var(--alice-text);
    border-bottom: 2px solid var(--alice-amber);
    font-weight: 600;
}

.nav__user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

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

.nav__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--alice-blue);
    color: var(--alice-surface);
    font-size: 0.75rem;
    font-weight: 600;
}

/* 7. Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--alice-text);
}

.form-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--alice-border);
    border-radius: 4px;
    background-color: var(--alice-surface);
    color: var(--alice-text);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--alice-blue);
    box-shadow: 0 0 0 2px var(--alice-blue-tint);
}

.form-error {
    color: #C13030;
    background-color: #FFF0F0;
    border: 1px solid #C13030;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

@media (prefers-color-scheme: dark) {
    .form-error {
        color: #FF8A8A;
        background-color: #2E1A1A;
        border-color: #FF8A8A;
    }
}

.btn-primary {
    display: inline-block;
    width: auto;
    max-width: var(--btn-max-width, 300px);
    padding: 0.65rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--alice-surface);
    background-color: var(--alice-blue);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    color: var(--alice-text-secondary);
    background-color: var(--alice-surface);
    border: 1px solid var(--alice-border);
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-family: inherit;
}

.btn-secondary:hover {
    border-color: var(--alice-blue);
    color: var(--alice-blue);
}

/* 8. Cards */
.card {
    background-color: var(--alice-surface);
    border: 1px solid var(--alice-border);
    border-radius: 8px;
    padding: 1.25rem;
}

.card__tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--alice-blue);
    background-color: var(--alice-blue-tint);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    margin-bottom: 0.5rem;
}

.card__title {
    margin: 0.5rem 0 0.35rem;
    font-size: 1.05rem;
}

.card__meta {
    font-size: 0.85rem;
    color: var(--alice-text-secondary);
    margin: 0 0 0.75rem;
}

.card__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.card__actions .btn-primary {
    width: auto;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

/* 9. Progress bar */
.progress-track {
    height: 6px;
    background-color: var(--alice-gray-tint);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: var(--alice-teal);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-label {
    font-size: 0.8rem;
    color: var(--alice-text-secondary);
    margin-top: 0.25rem;
    display: inline-block;
}

/* 10. Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-complete {
    background-color: var(--alice-teal-tint);
    color: var(--alice-teal);
}

.status-complete .status-dot {
    background-color: var(--alice-teal);
}

.status-next {
    background-color: var(--alice-amber-tint);
    color: var(--alice-warning);
}

.status-next .status-dot {
    background-color: var(--alice-amber);
}

.status-skipped {
    background-color: var(--alice-gray-tint);
    color: var(--alice-gray);
}

.status-skipped .status-dot {
    background-color: var(--alice-gray);
}

.status-inprogress {
    background-color: var(--alice-blue-tint);
    color: var(--alice-blue);
}

.status-inprogress .status-dot {
    background-color: var(--alice-blue);
}

/* 11. Activity table */
.activity-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
}

.activity-table th,
.activity-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--alice-border);
    font-size: 0.9rem;
}

.activity-table th {
    font-weight: 600;
    color: var(--alice-text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.activity-table tbody tr:hover {
    background-color: var(--alice-blue-tint);
}

/* 12. Login page */
.login-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--alice-bg);
}

.login-card {
    background-color: var(--alice-surface);
    border: 1px solid var(--alice-border);
    border-radius: 10px;
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: 340px;
    text-align: center;
}

.login-wordmark {
    font-size: 2rem;
    margin-bottom: 0.2rem;
}

.login-tagline {
    font-size: 0.8rem;
    color: var(--alice-text-secondary);
    font-style: italic;
    margin: 0 0 0.75rem;
}

.login-divider {
    height: 2px;
    background-color: var(--alice-amber);
    margin: 0 auto 1rem;
    width: 40%;
    border-radius: 1px;
}

.login-card .form-group {
    text-align: left;
}

.login-card .btn-primary {
    width: 100%;
    max-width: none;
    margin-top: 0.5rem;
}

/* 13. Language selector */
.lang-toggle {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.lang-btn {
    background: none;
    border: 1px solid var(--alice-border);
    border-radius: 4px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    color: var(--alice-text-secondary);
    cursor: pointer;
    font-family: inherit;
}

.lang-btn:hover,
.lang-btn.active,
.lang-btn.lang-btn--active {
    border-color: var(--alice-blue);
    color: var(--alice-blue);
}

/* Accessibility notice */
.a11y-notice {
    margin-top: 2rem;
    font-size: 0.78rem;
    color: var(--alice-text-secondary);
    text-align: center;
    font-style: italic;
}

.subtitle {
    color: var(--alice-text-secondary);
    margin-top: -0.5rem;
}

/* ── Accessibility: Skip link ─────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--alice-blue);
  color: #fff;
  font-size: 14px;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
  transition: top 0.1s;
}
.skip-link:focus {
  top: 0;
}

/* ── Accessibility: Focus indicators ──────────────── */
/* Visible focus indicator — applies to all interactive elements */
:focus-visible {
  outline: 3px solid var(--alice-focus, var(--alice-blue));
  outline-offset: 2px;
}

/* Never suppress focus outlines */
:focus:not(:focus-visible) {
  outline: none;
}

/* Screen-reader-only utility class */
.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;
}

/* ── Gear button ───────────────────────────────── */
.nav__gear {
  background: none;
  border: 0.5px solid var(--alice-border);
  border-radius: var(--radius-md);
  color: var(--alice-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  transition: color 0.15s, border-color 0.15s;
}
.nav__gear:hover {
  color: var(--alice-text);
  border-color: var(--alice-border-strong);
}
.nav__gear:focus-visible {
  outline: 3px solid var(--alice-focus, var(--alice-blue));
  outline-offset: 2px;
}

/* ── Theme panel ───────────────────────────────── */
.theme-panel {
  position: fixed;
  top: 60px;
  right: 1rem;
  z-index: 500;
  width: 220px;
  background: var(--alice-surface);
  border: 0.5px solid var(--alice-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 1rem;
}
.theme-panel--hidden {
  display: none;
}
.theme-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.theme-panel__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--alice-text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.theme-panel__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--alice-text-tertiary);
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1;
}
.theme-panel__options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.theme-option {
  width: 100%;
  padding: 7px 10px;
  text-align: left;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--alice-text);
  background: none;
  border: 0.5px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.1s;
}
.theme-option:hover {
  background: var(--alice-bg);
}
.theme-option--active {
  background: var(--alice-bg);
  border-color: var(--alice-blue);
  color: var(--alice-blue);
  font-weight: 500;
}
.theme-option:focus-visible {
  outline: 3px solid var(--alice-focus, var(--alice-blue));
  outline-offset: 2px;
}
.theme-panel__note {
  margin-top: 0.75rem;
  font-size: 11px;
  color: var(--alice-text-tertiary);
  text-align: center;
}

/* ── Site shell and top nav ─────────────────────────── */
.site-shell {
  width: 100%;
  background: var(--alice-surface);
  border-bottom: 1px solid var(--alice-border);
}

/* (topnav rules moved to SPECS12 block below) */

.nav-logo {
  display: flex; align-items: center;
  flex-shrink: 0; margin-right: 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px; font-weight: 700;
  color: var(--alice-text); text-decoration: none; letter-spacing: .02em;
}

.nav-links {
  flex: 1;
  display: flex; align-items: stretch; justify-content: center;
  gap: 2px;
}
.nav-link {
  display: flex; align-items: center;
  font-size: 11px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--alice-text-secondary); text-decoration: none;
  padding: 0 12px;
  border-bottom: 2px solid transparent;
  transition: color .18s, border-color .18s;
  cursor: pointer; background: none; border-top: none;
  border-left: none; border-right: none;
}
.nav-link:hover, .nav-link.active {
  color: var(--alice-text); border-bottom-color: var(--alice-amber);
}

.nav-user {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; margin-left: 24px;
  font-size: 12px; color: var(--alice-text-secondary);
}
.nav-role-badge {
  font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--alice-blue);
  background: var(--alice-blue-tint);
  border: 1px solid var(--alice-blue);
  border-radius: 10px; padding: 2px 8px;
}
body.th-dark .nav-role-badge {
  background: #CCCCCC;
}
body.th-hico .nav-role-badge {
  background: #FFFFFF;
}
body.th-hico .capstone-card {
  background: #EEEEEE;
}
body.th-hico .capstone-card--active {
  background: #FFFFFF;
}
.nav-email {
  font-size: 12px; color: var(--alice-text-secondary);
}

/* ── Burger button ─────────────────────────────────── */
.burger-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: none; border: 1px solid var(--alice-border);
  border-radius: 6px; cursor: pointer; color: var(--alice-text-secondary);
  transition: color .18s, border-color .18s;
}
.burger-btn:hover { color: var(--alice-text); border-color: var(--alice-border-strong); }
.burger-btn svg { pointer-events: none; }

/* ── Burger panel ──────────────────────────────────── */
.burger-panel {
  position: absolute; top: 44px; right: 0; z-index: 300;
  background: var(--alice-surface);
  border: 1px solid var(--alice-border);
  border-radius: 0 0 8px 8px;
  min-width: 220px; padding: 12px 0;
  box-shadow: -4px 4px 24px rgba(0,0,0,.15);
}
.burger-panel.hidden { display: none; }
.burger-section {
  padding: 6px 16px 2px;
  font-size: 9px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--alice-text-tertiary);
}
.burger-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; font-size: 13px; color: var(--alice-text-secondary);
  cursor: pointer; background: none; border: none; width: 100%;
  text-align: left; text-decoration: none;
  transition: background .12s;
  font-family: inherit;
}
.burger-item:hover { background: var(--alice-bg); }
.burger-divider {
  height: 1px; background: var(--alice-border); margin: 6px 0;
}

/* ── Content container ─────────────────────────────── */
.content-container {
  max-width: var(--content-max-width, 960px);
  margin: 0 auto; padding: 0 16px;
}

/* ── Login shell ───────────────────────────────────── */
.login-shell {
  min-height: calc(100vh - 44px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}

/* ── Cookie notice ─────────────────────────────────── */
.cookie-notice {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 400;
  background: var(--alice-surface);
  border-top: 1px solid var(--alice-border);
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; font-size: 13px; color: var(--alice-text-secondary);
}
.cookie-notice__text { margin: 0; }
.cookie-notice__ok {
  flex-shrink: 0; padding: 6px 18px;
  background: var(--alice-blue); border: none; border-radius: 6px;
  color: #fff; font-size: 13px; cursor: pointer;
}

/* ── Responsive: collapse nav links into burger ────── */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-user .nav-role-badge { display: none; }
}

/* ── Breadcrumb ────────────────────────────────────── */
.breadcrumb {
  font-size: 12px;
  color: var(--alice-text-secondary);
  margin-bottom: 1.25rem;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--alice-text-secondary);
                text-decoration: none; }
.breadcrumb a:hover { color: var(--alice-text); }
.breadcrumb__sep { color: var(--alice-gray); }
.breadcrumb__current { color: var(--alice-text); }

/* ── Category selector ─────────────────────────────── */
.category-selector { margin-bottom: 1.5rem; }
.category-selector__label {
  font-size: 12px; font-weight: 500;
  color: var(--alice-text-secondary);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.category-selector__options {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.category-btn {
  padding: 6px 14px; font-size: 13px;
  font-family: var(--font-sans);
  color: var(--alice-text); background: none;
  border: 0.5px solid var(--alice-border-secondary);
  border-radius: var(--radius-md); cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.category-btn:hover { background: var(--alice-bg); }
.category-btn--active {
  background: var(--alice-bg);
  border: 1.5px solid var(--alice-blue);
  color: var(--alice-blue); font-weight: 500;
}
.category-btn:focus-visible {
  outline: 3px solid var(--alice-focus, var(--alice-blue));
  outline-offset: 2px;
}

/* ── Map container ─────────────────────────────────── */
.map-container {
  border: 0.5px solid var(--alice-border-tertiary);
  border-radius: var(--radius-lg);
  overflow: hidden; margin-bottom: 1rem;
  background: var(--alice-surface);
}
.map-controls { display: flex; gap: 8px;
                margin-bottom: 0.75rem; }

/* ── Map legend (moved to SPECS13 block below) ────── */

/* ── Syllabus table ────────────────────────────────── */
.syllabus-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.syllabus-table th {
  font-size: 11px; font-weight: 500;
  color: var(--alice-text-tertiary);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 8px 12px; text-align: left;
  border-bottom: 0.5px solid var(--alice-border-tertiary);
}
.syllabus-table td {
  padding: 10px 12px;
  border-bottom: 0.5px solid var(--alice-border-tertiary);
  color: var(--alice-text); vertical-align: middle;
}
.syllabus-table tr:last-child td { border-bottom: none; }
.syllabus-table tr:hover td { background: var(--alice-bg); }

/* ── Admin table ────────────────────────────────── */
.admin-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.admin-table th {
  font-size: 11px; font-weight: 500;
  color: var(--alice-text-tertiary);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 8px 12px; text-align: left;
  border-bottom: 1px solid var(--alice-border);
}
.admin-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--alice-border-tertiary, var(--alice-border));
  vertical-align: middle;
}
.admin-table tr:hover td { background: var(--alice-bg); }

/* ── Admin form ─────────────────────────────────── */
.admin-form { max-width: 900px; }
.form-row {
  display: grid; grid-template-columns: 180px 1fr;
  gap: 8px; align-items: start; margin-bottom: 14px;
}

/* Search bar: input fills space, button fixed width, right-aligned */
.search-bar {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 14px;
}
.search-bar .form-input { flex: 1; }
.search-bar .btn-primary,
.search-bar .btn-secondary { flex-shrink: 0; }

/* Action bar: right-aligned row of buttons below tables */
.action-bar {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 12px;
}

/* ── Split columns (HISPANIA/BRITANNIA pattern) ─── */
.lingua-split {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.lingua-col-header {
  font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--alice-amber); margin-bottom: 12px;
}

/* ── Permission matrix ──────────────────────────── */
.matrix-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.matrix-table th { padding: 6px 10px; text-align: left;
                   background: var(--alice-bg); }
.matrix-table .fasciculus-row td {
  background: var(--alice-blue-tint);
  font-weight: 600; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; padding: 4px 10px;
  color: var(--alice-blue);
}
.matrix-table td { padding: 5px 10px;
  border-bottom: 1px solid var(--alice-border-tertiary, var(--alice-border)); }

/* ── Badge ──────────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 10px; font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.badge-systema  { background: var(--alice-blue-tint); color: var(--alice-blue); }
.badge-hospes   { background: var(--alice-amber-tint); color: var(--alice-warning); }
.badge-start    { background: var(--alice-teal-tint); color: var(--alice-teal); }
.badge-end      { background: var(--alice-amber-tint); color: var(--alice-amber); }

/* ── Flash message ──────────────────────────────── */
.flash-msg {
  padding: 10px 16px; border-radius: 6px; font-size: 13px;
  margin-bottom: 16px;
}
.flash-msg.ok { background: var(--alice-teal-tint);
                border: 1px solid var(--alice-teal);
                color: var(--alice-teal); }
.flash-msg.err { background: #FFF0F0;
                 border: 1px solid #C13030;
                 color: #C13030; }

/* ── Untranslated labels ────────────────────────── */
.untranslated-label {
  color: var(--alice-warning);
  text-decoration: underline dashed;
  cursor: pointer;
}

/* ── Markdown preview ──────────────────────────── */
.md-preview {
  margin-top: 6px; padding: 10px 14px;
  background: var(--alice-bg);
  border: 1px solid var(--alice-border);
  border-radius: 6px;
  font-size: 13px; color: var(--alice-text);
  line-height: 1.6; min-height: 40px;
}
.md-preview h1,.md-preview h2,.md-preview h3 {
  color: var(--alice-text); margin-bottom: 8px;
}
.md-preview code {
  background: var(--alice-bg);
  padding: 1px 5px; border-radius: 3px;
}

/* ── Calculus card ─────────────────────────────── */
.action-card--calculus {
  border-color: var(--alice-warning);
  background: var(--alice-amber-tint);
}
.action-card--calculus:hover {
  opacity: .9;
}
.btn-calculus {
  background: var(--alice-warning); color: #fff;
  border: none; padding: 8px 20px; border-radius: 6px;
  font-weight: 600; cursor: pointer;
}
.modal-warn {
  color: var(--alice-warning); font-size: 12px; margin-top: 8px;
}

/* ── Modal ─────────────────────────────────────── */
.modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000; display: flex;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.5);
}
.modal.hidden { display: none; }
.modal-box {
  background: var(--alice-surface);
  border: 1px solid var(--alice-border);
  border-radius: 10px; padding: 2rem;
  max-width: 480px; width: 90%;
}
.modal-actions {
  display: flex; gap: 8px; margin-top: 1rem;
}

/* ── NUNTIUS body ──────────────────────────────── */
.nuntius-body {
  line-height: 1.7; font-size: 15px;
}
.nuntius-body h1,.nuntius-body h2,.nuntius-body h3 {
  margin-top: 1.5rem; margin-bottom: 0.5rem;
}

/* ── Edge editor ───────────────────────────────── */
.edge-editor {
  margin-top: 1rem;
  border: 1px solid var(--alice-border);
  border-radius: 8px; padding: 1rem;
}
.edge-editor__hint {
  color: var(--alice-text-secondary);
  font-size: 13px; font-style: italic;
}

/* 14. Responsive overrides */
@media (max-width: 480px) {
    .nav__links {
        display: none;
    }

    .grid-2col {
        grid-template-columns: 1fr;
    }

    .col-course {
        display: none;
    }

    .login-card {
        margin: 1rem;
    }
}

/* ── Submission text display ─────────────────── */
.submission-text {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px; padding: 10px 14px;
  font-size: 13px; color: rgba(255,255,255,.8);
  line-height: 1.6; white-space: pre-wrap;
  max-height: 200px; overflow-y: auto;
  margin-bottom: 10px;
}

/* ── Tessera share view ──────────────────────── */
.tessera-notice {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 10px;
  background: rgba(212,168,67,.15);
  border: 1px solid rgba(212,168,67,.3);
  font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 16px;
}

/* ── Status pill ─────────────────────────────── */
.pill {
  display: inline-block; padding: 2px 8px;
  border-radius: 10px; font-size: 11px;
  font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase;
}
.pill-ok  { background:rgba(0,120,100,.25); color:#4dd; }
.pill-warn{ background:rgba(212,168,67,.2);  color:var(--gold); }
.pill-err { background:rgba(232,75,31,.2);   color:var(--orange); }

/* ── Lingua tabs ─────────────────────────────────── */
.lingua-tabs { margin-top: 1.5rem; }

.lingua-tab-bar {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--alice-border);
  margin-bottom: 0;
}
.lingua-tab-btn {
  padding: 6px 14px; font-size: 12px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  background: none; border: 1px solid transparent;
  border-bottom: none; border-radius: 4px 4px 0 0;
  cursor: pointer; color: var(--alice-text-secondary);
  transition: color .15s, background .15s;
  margin-bottom: -1px;
}
.lingua-tab-btn:hover { color: var(--alice-text); }
.lingua-tab-btn.active {
  background: var(--alice-surface);
  border-color: var(--alice-border);
  border-bottom-color: var(--alice-surface);
  color: var(--alice-blue); font-weight: 700;
}
.lingua-panel {
  border: 1px solid var(--alice-border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  padding: 20px;
}
.lingua-panel.hidden { display: none; }

.lingua-add-section {
  margin-top: 1.5rem;
  padding: 16px;
  border: 1px dashed var(--alice-border);
  border-radius: 6px;
}
.lingua-add-section h3 {
  margin-top: 0; font-size: 13px;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--alice-text-secondary);
}

/* ── Chip input ──────────────────────────────────── */
.chip-input { display: flex; flex-direction: column; gap: 8px; }
.chip-list {
  display: flex; flex-wrap: wrap; gap: 6px; min-height: 32px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  background: rgba(0,85,164,.1);
  border: 1px solid var(--alice-blue);
  border-radius: 4px; font-size: 12px;
}
.chip-label {
  color: var(--alice-blue); text-decoration: none; max-width: 300px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip-label:hover { text-decoration: underline; }
.chip-remove {
  background: none; border: none; cursor: pointer;
  color: var(--alice-text-secondary); font-size: 12px;
  padding: 0 2px; line-height: 1;
}
.chip-remove:hover { color: var(--alice-text); }
.chip-entry { max-width: 480px; }

/* ── Button alignment (admin forms) ─────────────── */
.form-actions {
  display: flex; justify-content: flex-end;
  margin-top: 16px;
}
.form-actions--bordered {
  padding-top: 12px;
  border-top: 1px solid var(--alice-border);
}
.form-actions .btn-primary,
.form-actions .btn-secondary,
.form-actions .btn-danger,
.admin-btn,
.admin-table .btn-primary,
.admin-table .btn-secondary,
.admin-table .btn-danger {
  max-width: var(--btn-max-width, 300px);
  width: auto;
  display: inline-block;
  margin-left: 8px;
}

/* ── Tall textarea ─────────────────────────── */
.form-textarea.tall { min-height: 200px; }

/* ── Lesson page progress chips ────────────── */
.pagina-progress {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 1rem; font-size: 12px;
}
.progress-chip {
  padding: 3px 10px; border-radius: 10px;
  font-weight: 600; letter-spacing: .04em;
}
.progress-graded {
  background: rgba(0,120,100,.12);
  color: var(--alice-teal); border: 1px solid var(--alice-teal);
}
.progress-read {
  background: rgba(212,168,67,.12);
  color: var(--alice-amber); border: 1px solid var(--alice-amber);
}
.progress-pending {
  background: rgba(128,128,128,.12);
  color: var(--alice-gray); border: 1px solid var(--alice-gray);
}

/* ── Lesson page tab bar ──────────────────── */
.pagina-tab-bar {
  display: flex; gap: 2px; flex-wrap: wrap;
  border-bottom: 2px solid var(--alice-border);
  margin-bottom: 0;
}
.pagina-tab-btn {
  padding: 8px 18px; font-size: 13px; font-weight: 600;
  background: none; border: 1px solid transparent;
  border-bottom: none; border-radius: 4px 4px 0 0;
  cursor: pointer; color: var(--alice-text-secondary);
  transition: color .15s; margin-bottom: -2px;
  display: flex; align-items: center; gap: 6px;
}
.pagina-tab-btn:hover { color: var(--alice-text); }
.pagina-tab-btn.active {
  background: var(--alice-surface);
  border-color: var(--alice-border);
  border-bottom-color: var(--alice-surface);
  color: var(--alice-blue); font-weight: 700;
}
.tab-count {
  background: var(--alice-amber);
  color: var(--alice-surface);
  border-radius: 10px; font-size: 10px;
  padding: 1px 6px; font-weight: 700;
}

/* ── Lesson page panels ───────────────────── */
.pagina-panel { padding: 20px 0; min-height: 200px; }
.pagina-panel.hidden { display: none; }
.pagina-tag {
  font-size: 14px; color: var(--alice-text-secondary);
  font-style: italic; margin-bottom: 1rem;
}
.pagina-content { font-size: 15px; line-height: 1.7; }
.pagina-content h1,
.pagina-content h2,
.pagina-content h3 { margin-top: 1.5rem; }

/* ── Collapsible SLO/Assessment ───────────── */
.pagina-collapsible {
  margin-top: 1.5rem;
  border: 1px solid var(--alice-border);
  border-radius: 6px; overflow: hidden;
}
.pagina-collapsible summary {
  padding: 10px 14px; cursor: pointer;
  font-weight: 600; font-size: 14px;
  background: var(--alice-bg);
  list-style: none; user-select: none;
}
.pagina-collapsible summary::-webkit-details-marker { display: none; }
.pagina-collapsible summary::before {
  content: '+ '; color: var(--alice-blue);
}
.pagina-collapsible[open] summary::before { content: '- '; }
.pagina-collapsible-body {
  padding: 14px; font-size: 14px; line-height: 1.6;
}

/* ── Asset notice ─────────────────────────── */
.pagina-asset-notice {
  font-size: 12px; color: var(--alice-text-secondary);
  background: rgba(212,168,67,.08);
  border: 1px solid var(--alice-amber);
  border-radius: 4px; padding: 6px 12px;
  margin-bottom: 12px; display: inline-block;
}

/* ── PDF embed ────────────────────────────── */
.pdf-embed-wrapper { margin-bottom: 20px; }
.pdf-embed {
  width: 100%; height: 600px; border: 1px solid var(--alice-border);
  border-radius: 4px;
}

/* ── Video embed ──────────────────────────── */
.video-embed-wrapper {
  position: relative; padding-bottom: 56.25%;
  height: 0; overflow: hidden; margin-bottom: 20px;
  border-radius: 6px;
}
.video-embed {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; border: none;
}

/* ── Map inline ───────────────────────────── */
.pagina-map-container {
  width: 100%; height: 520px;
  border: 1px solid var(--alice-border);
  border-radius: 6px; overflow: hidden;
  margin-bottom: 12px;
}

/* ── Survey embed ─────────────────────────── */
.survey-embed {
  width: 100%; height: 700px;
  border: 1px solid var(--alice-border); border-radius: 4px;
}

/* ── Submission form ──────────────────────── */
.pagina-submission {
  margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid var(--alice-border);
}
.pagina-existing-submission {
  background: var(--alice-bg);
  border: 1px solid var(--alice-border);
  border-radius: 6px; padding: 12px;
  margin-bottom: 12px; font-size: 13px;
}
.pagina-existing-submission pre {
  margin: 0; white-space: pre-wrap; word-break: break-word;
}

/* ── Next lessons ─────────────────────────── */
.pagina-next-section {
  margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid var(--alice-border);
}
.pagina-next-list {
  display: flex; flex-direction: column; gap: 8px; margin-top: 8px;
}
.pagina-next-link {
  display: block; padding: 10px 14px;
  background: var(--alice-surface);
  border: 1px solid var(--alice-border);
  border-radius: 6px; text-decoration: none;
  color: var(--alice-text); font-size: 14px;
  transition: border-color .15s, background .15s;
}
.pagina-next-link:hover {
  border-color: var(--alice-blue);
  background: rgba(0,85,164,.06);
  color: var(--alice-blue);
}
.pagina-empty {
  color: var(--alice-text-secondary); font-style: italic;
  font-size: 14px;
}

/* ── Capstone list ────────────────────────── */
.capstone-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.capstone-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--alice-border);
  border-radius: 6px; background: var(--alice-surface);
}
.cap-status { flex-shrink: 0; margin-top: 2px; }
.cap-body   { flex: 1; min-width: 0; }
.cap-title  {
  font-size: 15px; font-weight: 600;
  color: var(--alice-text); text-decoration: none;
  display: block; margin-bottom: 2px;
}
.cap-title:hover {
  color: var(--alice-blue); text-decoration: underline;
}
.cap-known-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--alice-teal); margin-left: 6px;
}
.cap-tag {
  font-size: 13px; color: var(--alice-text-secondary);
  margin: 4px 0 8px; line-height: 1.4;
}
.cap-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cap-action-btn {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--alice-blue);
  text-decoration: underline; padding: 0;
}
.cap-action-btn:hover { color: var(--alice-amber); }

/* ── Course page tab bar ──────────────────── */
.crs-tab-bar {
  display: flex; gap: 2px;
  border-bottom: 2px solid var(--alice-border);
  margin-bottom: 16px;
}
.crs-tab-btn {
  padding: 8px 20px; font-size: 13px; font-weight: 600;
  background: none; border: 1px solid transparent;
  border-bottom: none; border-radius: 4px 4px 0 0;
  cursor: pointer; color: var(--alice-text-secondary);
  margin-bottom: -2px; transition: color .15s;
}
.crs-tab-btn:hover { color: var(--alice-text); }
.crs-tab-btn.active {
  background: var(--alice-surface);
  border-color: var(--alice-border);
  border-bottom-color: var(--alice-surface);
  color: var(--alice-blue); font-weight: 700;
}
.crs-panel { padding: 0; }
.crs-panel.hidden { display: none; }

/* ── Public home page grid ───────────────────────── */
.home-public-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 1.5rem;
}
@media (max-width: 640px) {
  .home-public-grid { grid-template-columns: 1fr; }
}

.home-panel {
  background: var(--alice-surface);
  border: 1px solid var(--alice-border);
  border-radius: 8px;
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.home-panel__title {
  font-size: 13px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--alice-text-secondary);
  margin: 0;
}
.home-panel__body {
  flex: 1; font-size: 14px; line-height: 1.6;
  color: var(--alice-text);
}
.home-panel__body p { margin: 6px 0 0; }
.home-panel__body h1,
.home-panel__body h2,
.home-panel__body h3 {
  font-size: 15px; font-weight: 700;
  color: var(--alice-text); margin: 0 0 6px;
}
.home-panel__more {
  display: inline-block; font-size: 13px;
  color: var(--alice-blue); text-decoration: none;
  align-self: flex-start;
}
.home-panel__more:hover { text-decoration: underline; }
.home-panel__empty {
  font-size: 13px; color: var(--alice-text-secondary);
  font-style: italic; margin: 0;
}

/* ── Textarea and preview fixes ──────────────────── */
.lingua-panel textarea,
.lingua-panel .form-textarea {
  width: 100%;
  box-sizing: border-box;
}
.md-preview:empty { display: none; }

/* ── Nuntius body content ───────────────────────────────────────────── */

.nuntius-body img {
    height: 60px;
    width: auto;
    vertical-align: middle;
    margin-right: 0.6rem;
}

.nuntius-body p {
    margin-block: 0.75rem;
}

.nuntius-body p:has(img) {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nuntius-body a {
    color: var(--alice-blue);
}

.nuntius-body a:hover {
    text-decoration: underline;
}

.nuntius-body hr {
    border: none;
    border-top: 1px solid var(--alice-border);
    margin-block: 1.5rem;
}

/* ── Asset list (PDF / Video tab) ───────────────────────────── */

.asset-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.asset-list-btn {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    background: var(--alice-surface);
    border: 1px solid var(--alice-border);
    border-radius: 6px;
    padding: 10px 14px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
}

.asset-list-btn:hover,
.asset-list-btn.active {
    border-color: var(--alice-blue);
    background: var(--alice-blue-tint);
}

.asset-list-btn[aria-expanded="true"] {
    border-color: var(--alice-blue);
}

.asset-list-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

.asset-list-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--alice-text);
    line-height: 1.4;
}

.asset-list-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--alice-text-secondary);
    margin-top: 2px;
    font-weight: 400;
}

/* ── Asset viewer ────────────────────────────────────────────── */

.asset-viewer {
    margin-top: 12px;
    border: 1px solid var(--alice-border);
    border-radius: 6px;
    overflow: hidden;
}

.asset-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--alice-surface);
    border-bottom: 1px solid var(--alice-border);
}

.asset-viewer-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--alice-text);
}

.asset-viewer-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--alice-text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}

.asset-viewer-close:hover {
    background: var(--alice-bg);
    color: var(--alice-text);
}

/* ── AI Agent sidebar ────────────────────────────────────────── */

.agent-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--alice-blue);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: background 0.15s, box-shadow 0.15s;
}

.agent-toggle-btn:hover {
    opacity: 0.9;
    box-shadow: 0 4px 14px rgba(0,0,0,0.22);
}

.agent-toggle-label {
    white-space: nowrap;
}

.agent-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    height: 100vh;
    background: var(--alice-surface);
    border-left: 1px solid var(--alice-border);
    box-shadow: -4px 0 20px rgba(0,0,0,0.12);
    z-index: 400;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
}

.agent-panel.hidden {
    display: none;
}

.agent-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--alice-border);
    flex-shrink: 0;
}

.agent-panel-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--alice-text);
}

.agent-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--alice-text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}

.agent-panel-close:hover {
    background: var(--alice-bg);
}

.agent-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agent-msg {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 92%;
    word-break: break-word;
}

.agent-msg--user {
    background: var(--alice-blue);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.agent-msg--agent {
    background: var(--alice-bg);
    color: var(--alice-text);
    border: 1px solid var(--alice-border);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.agent-msg--thinking {
    background: var(--alice-bg);
    color: var(--alice-text-secondary);
    border: 1px solid var(--alice-border);
    align-self: flex-start;
    font-style: italic;
}

.agent-msg--error {
    background: rgba(200,0,0,0.08);
    color: #b00;
    border: 1px solid rgba(200,0,0,0.2);
    align-self: flex-start;
}

.agent-form {
    padding: 12px;
    border-top: 1px solid var(--alice-border);
    flex-shrink: 0;
}

.agent-input {
    width: 100%;
    font-size: 0.85rem;
    resize: vertical;
    min-height: 64px;
}

@media (max-width: 600px) {
    .agent-panel { width: 100vw; }
    .agent-toggle-label { display: none; }
}

/* ── Capstone cards (SPECS11) ───────────────────────────────── */

.capstone-card {
    border: 1px solid var(--alice-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: var(--alice-surface);
    transition: border-color 0.15s;
}

.capstone-card--active {
    border-color: var(--alice-blue);
    background: var(--alice-blue-tint);
}

.capstone-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.capstone-star {
    font-size: 1.3rem;
    color: var(--alice-amber);
    flex-shrink: 0;
}

.capstone-star--empty {
    color: var(--alice-text-secondary);
}

.capstone-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.capstone-card-tag {
    font-size: 0.82rem;
    color: var(--alice-text-secondary);
    margin: 0 0 10px 0;
}

.capstone-card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.capstone-active-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--alice-blue);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.btn-ghost {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--alice-text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: underline;
}

.btn-ghost:hover { color: var(--alice-text); }

/* ── Syllabus (SPECS11) ─────────────────────────────────────── */

.syllabus-no-capstone {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--alice-text-secondary);
}

.syllabus-tag {
    display: block;
    font-size: 0.78rem;
    color: var(--alice-text-secondary);
    margin-top: 2px;
}

/* ── Map inline container (SPECS11) ─────────────────────────── */

.map-container-inline {
    width: 100%;
    height: 540px;
    border: 1px solid var(--alice-border);
    border-radius: 6px;
    margin-top: 12px;
}

/* ── Category selector (SPECS11) ────────────────────────────── */

.category-selector {
    margin-bottom: 12px;
}

.category-selector__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--alice-text-secondary);
    margin-bottom: 6px;
}

.category-selector__options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── Cytoscape map cursor (SPECS11) ─────────────────────────── */

#cy canvas {
    cursor: default;
}

/* ── Map controls bar ────────────────────────────────────────── */

.map-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.map-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--alice-text-secondary);
}

.map-ctrl-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-ctrl-btn {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    background: var(--alice-surface);
    border: 1px solid var(--alice-border);
    border-radius: 4px;
    cursor: pointer;
    color: var(--alice-text-secondary);
    transition: border-color 0.12s, color 0.12s;
}

.map-ctrl-btn:hover {
    border-color: var(--alice-blue);
    color: var(--alice-text);
}

.map-ctrl-btn--active {
    background: var(--alice-blue-tint);
    border-color: var(--alice-blue);
    color: var(--alice-blue);
}

.map-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: none; border: none; cursor: pointer; padding: 0;
}
.map-toggle-label {
    font-size: 11px; font-weight: 600;
    color: var(--alice-text-secondary);
}
.map-toggle-track {
    display: inline-flex; align-items: center;
    width: 32px; height: 18px;
    background: var(--alice-border); border-radius: 9px;
    flex-shrink: 0; transition: background 0.2s;
    position: relative;
}
.map-toggle--on .map-toggle-track { background: var(--alice-blue); }
.map-toggle-thumb {
    position: absolute; left: 2px;
    width: 14px; height: 14px; border-radius: 50%;
    background: #fff; transition: left 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.map-toggle--on .map-toggle-thumb { left: 16px; }

.map-font-ctrl {
    display: inline-flex;
    border: 1px solid var(--alice-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--alice-surface);
}
.map-font-btn {
    width: 26px; height: 26px;
    border: none; background: none;
    cursor: pointer;
    font-size: 15px; font-weight: 600; line-height: 1;
    color: var(--alice-text-secondary);
    display: flex; align-items: center; justify-content: center;
}
.map-font-btn:hover { color: var(--alice-text); background: var(--alice-blue-tint); }
.map-font-btn + .map-font-btn { border-left: 1px solid var(--alice-border); }

/* ── EasyMDE overrides for ALICE theme ───────────────────────── */

.EasyMDEContainer {
    border-radius: var(--radius-md);
    border-color: var(--alice-border);
}

.EasyMDEContainer .CodeMirror {
    background: var(--alice-surface);
    color: var(--alice-text);
    border-color: var(--alice-border);
    font-family: var(--font-mono, 'Courier New', monospace);
    font-size: 13px;
}

.EasyMDEContainer .editor-toolbar {
    background: var(--alice-bg);
    border-color: var(--alice-border);
}

.EasyMDEContainer .editor-toolbar button {
    color: var(--alice-text-secondary);
}

.EasyMDEContainer .editor-toolbar button:hover,
.EasyMDEContainer .editor-toolbar button.active {
    background: var(--alice-blue-tint);
    border-color: var(--alice-border);
    color: var(--alice-blue);
}

.EasyMDEContainer .editor-preview {
    background: var(--alice-surface);
    color: var(--alice-text);
    border-color: var(--alice-border);
}

/* ── Top navigation (SPECS12) ──────────────────────────────── */

.topnav {
    display: flex;
    align-items: stretch;
    height: 44px;
    background: var(--alice-surface);
    border-bottom: 1px solid var(--alice-border);
    z-index: 200;
    top: 0;
}

.topnav--locked {
    position: sticky;
    top: 0;
    z-index: 500;
    box-shadow: 0 1px 8px rgba(0,0,0,0.08);
}

.topnav-inner {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: var(--content-max-width, 1200px);
    margin: 0 auto;
    padding: 0 16px;
    gap: 0;
    position: relative;
}

.topnav-wordmark {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--alice-text);
    text-decoration: none;
    margin-right: 24px;
    flex-shrink: 0;
}

.topnav-links {
    display: flex;
    align-items: stretch;
    flex: 1;
    gap: 0;
}

.topnav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
    font-size: 12px;
    color: var(--alice-text-secondary);
}

/* ── Burger category (collapsible, SPECS12) ───────────────── */

.burger-category {
    border-bottom: 1px solid var(--alice-border);
}

.burger-category:last-of-type { border-bottom: none; }

.burger-category-header {
    padding: 8px 16px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--alice-text-secondary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.burger-category-header::-webkit-details-marker { display: none; }

.burger-category-header::after {
    content: '+';
    font-size: 13px;
    font-weight: 400;
    color: var(--alice-text-secondary);
    transition: transform 0.15s;
}

.burger-category[open] .burger-category-header::after {
    content: '\2212';
}

.burger-category-body {
    padding-bottom: 4px;
}

.burger-sublabel {
    padding: 4px 16px 2px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--alice-text-secondary);
}

/* ── Burger toggle (nav lock switch, SPECS12) ─────────────── */

.burger-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.burger-toggle-track {
    display: inline-flex;
    align-items: center;
    width: 32px;
    height: 18px;
    background: var(--alice-border);
    border-radius: 9px;
    flex-shrink: 0;
    transition: background 0.2s;
    position: relative;
}

.burger-toggle--on .burger-toggle-track {
    background: var(--alice-blue);
}

.burger-toggle-thumb {
    position: absolute;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.burger-toggle--on .burger-toggle-thumb {
    left: 16px;
}

/* ── Burger footer (SPECS12) ──────────────────────────────── */

.burger-footer {
    border-top: 1px solid var(--alice-border);
    padding-top: 4px;
    margin-top: 4px;
}

.burger-item--danger {
    color: var(--alice-warning);
}

.burger-item--active {
    font-weight: 700;
    color: var(--alice-blue);
}

/* ── Mobile: hide desktop nav links, show burger nav (SPECS12) ── */

@media (max-width: 640px) {
    .topnav-links { display: none; }
    .burger-category--mobile { display: block; }
}

@media (min-width: 641px) {
    .burger-category--mobile { display: none; }
}

/* ── Syllabus START/END row indicators (SPECS14) ───────────── */

.syllabus-row--capstone {
    background: rgba(239, 159, 39, 0.05);
}

.syllabus-row--start {
    background: rgba(29, 158, 117, 0.05);
}

.syllabus-start-mark {
    color: var(--alice-teal);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.syllabus-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.syllabus-tag {
    display: block;
    font-size: 0.78rem;
    color: var(--alice-text-secondary);
    margin-top: 2px;
}

/* ── Pagina title bar (SPECS14) ──────────────────────────────── */

.pagina-title-bar {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--alice-border);
}

.pagina-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--alice-text);
    line-height: 1.2;
}

.pagina-title-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 2px solid var(--alice-amber);
    padding-bottom: 1px;
}

.pagina-title-link:hover { color: var(--alice-blue); }

.pagina-subtitle {
    font-size: 0.85rem;
    color: var(--alice-text-secondary);
    margin: 0;
}

/* ── Content tab edit button (SPECS14) ───────────────────────── */

.pagina-content-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

/* ── Assessment tab with survey (SPECS14) ────────────────────── */

.pagina-assess-content + .pagina-submission,
.pagina-assess-content + .survey-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--alice-border);
}

.survey-section--with-submission {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--alice-border);
}

/* ── Segmented progress bar (SPECS15) ──────────────────────── */

.progress-bar-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
}

.progress-bar-track {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--alice-bg);
    border: 1px solid var(--alice-border);
}

.progress-seg {
    height: 100%;
    transition: width 0.3s ease;
    flex-shrink: 0;
}

.progress-seg--graded    { background: var(--alice-teal); }
.progress-seg--submitted { background: var(--alice-amber); }
.progress-seg--read      { background: var(--alice-blue); }
.progress-seg--pending   { background: var(--alice-gray); }

.progress-labels {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    white-space: nowrap;
}

.progress-label {
    display: flex;
    align-items: center;
    gap: 2px;
}

.progress-label--graded    { color: var(--alice-teal); }
.progress-label--submitted { color: var(--alice-warning); }
.progress-label--read      { color: var(--alice-blue); }
.progress-label--pending   { color: var(--alice-gray); }

.progress-label-text {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.progress-label-sep {
    color: var(--alice-gray);
    font-size: 10px;
}

/* ── Tab bar row (tabs + progress on same line) ──────────────── */

.tab-bar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0;
}

.tab-bar-progress {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .progress-labels { display: none; }
    .progress-bar-track { height: 8px; }
    .progress-bar-wrap { min-width: 80px; }
}

/* ── Inline asset table (SPECS15) ──────────────────────────── */

.asset-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--alice-text-secondary);
    margin: 12px 0 8px 0;
    padding-top: 8px;
    border-top: 1px solid var(--alice-border);
}

.asset-inline-table {
    width: 100%;
    margin-bottom: 8px;
}

.asset-url-cell {
    max-width: 240px;
    overflow: hidden;
}

.asset-url-link {
    font-size: 11px;
    color: var(--alice-blue);
    word-break: break-all;
}

.asset-actions {
    white-space: nowrap;
    display: flex;
    gap: 4px;
}

.btn-ghost--danger {
    color: var(--alice-warning);
}

.btn-ghost--danger:hover {
    color: var(--alice-text);
    background: rgba(186, 117, 23, 0.08);
}

.asset-empty {
    font-size: 12px;
    color: var(--alice-text-secondary);
    font-style: italic;
    margin: 4px 0 8px 0;
}

.asset-add-details {
    margin-top: 8px;
}

.asset-add-summary {
    font-size: 12px;
    font-weight: 600;
    color: var(--alice-blue);
    cursor: pointer;
    padding: 4px 0;
    list-style: none;
    user-select: none;
}

.asset-add-summary::-webkit-details-marker { display: none; }

.asset-add-form {
    margin-top: 8px;
    padding: 12px;
    background: var(--alice-bg);
    border: 1px solid var(--alice-border);
    border-radius: 6px;
}

.asset-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
}

.asset-editing {
    background: var(--alice-amber-tint);
}

/* ── Nuntius protected column (SPECS15) ────────────────────── */

.nuntius-col-protected {
    width: 80px;
    text-align: center;
}

.protected-check {
    color: var(--alice-teal);
    font-size: 1rem;
    font-weight: 700;
}
