/* Muse Studio - Google Workspace / Material Design 3 Design System */

:root {
    /* Color Palette */
    --nyu-violet: #57068c;
    --nyu-violet-light: #f3ebf7;
    --google-blue: #1a73e8;
    --google-blue-hover: #1557b0;
    --google-blue-light: #e8f0fe;
    
    /* Neutral Shades */
    --bg-workspace: #f8f9fa;
    --surface-card: #ffffff;
    --text-primary: #3c4043;
    --text-secondary: #5f6368;
    --border-material: #dadce0;
    --border-focus: #1a73e8;
    
    /* Semantic Colors */
    --status-green: #137333;
    --status-green-bg: #e6f4ea;
    --status-yellow: #b06000;
    --status-yellow-bg: #fef7e0;
    --status-red: #c5221f;
    --status-red-bg: #fce8e6;

    /* Elevation Shadows */
    --shadow-elevation-1: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --shadow-elevation-2: 0 2px 6px 2px rgba(60,64,67,0.15), 0 1px 2px 0 rgba(60,64,67,0.3);
    --shadow-header: 0 1px 3px 0 rgba(60,64,67,0.15), 0 1px 1px 0 rgba(60,64,67,0.1);
    
    /* Transition Variables */
    --transition-standard: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-workspace);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-top: 64px; /* Space for the fixed header */
}

/* 1. Header Navigation Bar */
.workspace-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: var(--surface-card);
    border-bottom: 1px solid var(--border-material);
    box-shadow: var(--shadow-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 20px;
    font-weight: 500;
    color: var(--nyu-violet);
    letter-spacing: -0.25px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    font-size: 12px;
    font-weight: 600;
    background-color: var(--nyu-violet-light);
    color: var(--nyu-violet);
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 2. Main Containers */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    transition: var(--transition-standard);
}

.hidden {
    display: none !important;
}

/* 3. Hero Landing Area */
.hero-section {
    text-align: center;
    margin: 40px auto 48px auto;
    max-width: 760px;
}

.hero-title {
    font-size: 40px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 4. Material Card Grid Layout */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 56px;
}

.feature-card {
    background-color: var(--surface-card);
    border: 1px solid var(--border-material);
    border-radius: 8px;
    padding: 24px;
    transition: var(--transition-standard);
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.1);
}

.feature-card:hover {
    box-shadow: var(--shadow-elevation-1);
    transform: translateY(-2px);
}

.card-icon {
    font-size: 32px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 5. Central Authentication Card */
.login-cta-container {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.auth-card {
    background-color: var(--surface-card);
    border: 1px solid var(--border-material);
    border-radius: 12px;
    padding: 40px 32px;
    text-align: center;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-elevation-1);
}

.auth-title {
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.auth-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.5;
}

.auth-message code {
    background-color: var(--bg-workspace);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
}

/* 6. Buttons Styling (Google Design Language) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px; /* MD3 pill-shaped */
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-standard);
    height: 36px;
}

.btn-primary {
    background-color: var(--google-blue);
    color: var(--surface-card);
}

.btn-primary:hover {
    background-color: var(--google-blue-hover);
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-material);
    color: var(--google-blue);
}

.btn-outline:hover {
    background-color: var(--google-blue-light);
    border-color: var(--google-blue);
}

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

.btn-text:hover {
    background-color: #f1f3f4;
    color: var(--text-primary);
}

/* Dynamic Invite Add Row Button */
.btn-icon-plus {
    background-color: var(--bg-workspace);
    border: 1px solid var(--border-material);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-standard);
}

.btn-icon-plus:hover {
    background-color: #e8eaed;
    border-color: var(--text-secondary);
}

/* Google Sign-in Button Design Specifications */
.google-sign-in-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--surface-card);
    border: 1px solid var(--border-material);
    border-radius: 20px;
    padding: 8px 18px;
    height: 40px;
    cursor: pointer;
    transition: var(--transition-standard);
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.1);
}

.google-sign-in-btn:hover {
    background-color: var(--bg-workspace);
    box-shadow: 0 1px 3px 0 rgba(60,64,67,0.25);
    border-color: #c4c7c5;
}

.google-icon {
    margin-right: 12px;
    display: block;
}

.google-btn-text {
    font-size: 14px;
    font-weight: 500;
    color: #1f1f1f;
    font-family: 'Roboto', 'Inter', sans-serif;
}

/* 7. Portal Dashboard Screens */
.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--border-material);
    padding-bottom: 20px;
    margin-bottom: 32px;
}

.welcome-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.portal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.cohort-tag {
    background-color: var(--google-blue-light);
    color: var(--google-blue);
    font-weight: 600;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid rgba(26,115,232,0.15);
}

/* 8. Dashboard Layout Grid (Main vs. Sidebar) */
.dashboard-layout {
    display: grid;
    grid-template-columns: 8fr 4fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Content Cards */
.content-card {
    background-color: var(--surface-card);
    border: 1px solid var(--border-material);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.1);
}

.card-section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 9. Interactive Forms (Passport & Inputs) */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 600px) {
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    border: 1px solid var(--border-material);
    border-radius: 4px;
    background-color: var(--surface-card);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-standard);
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--google-blue-light);
}

/* 10. Audit Feedback Boxes */
.feedback-box {
    margin-top: 24px;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 14px;
    line-height: 1.6;
}

.feedback-box.hidden {
    display: none;
}

.feedback-box p {
    margin-bottom: 8px;
}

.feedback-box ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

.feedback-box li {
    margin-bottom: 6px;
}

/* Audit States */
.feedback-box-success {
    background-color: var(--status-green-bg);
    border-color: rgba(19,115,51,0.2);
    color: var(--status-green);
}

.feedback-box-warning {
    background-color: var(--status-red-bg);
    border-color: rgba(197,34,31,0.2);
    color: var(--status-red);
}

/* 11. Hand-Drawn FBD Upload Drag Zone */
.sidebar-help {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.drag-drop-area {
    border: 2px dashed var(--border-material);
    border-radius: 6px;
    padding: 32px 16px;
    text-align: center;
    cursor: pointer;
    background-color: var(--bg-workspace);
    transition: var(--transition-standard);
}

.drag-drop-area:hover, .drag-drop-area.dragover {
    border-color: var(--google-blue);
    background-color: var(--google-blue-light);
}

.upload-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}

.drag-drop-area p {
    font-size: 14px;
    color: var(--text-secondary);
}

.hidden-file-input {
    display: none;
}

.upload-status {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    color: var(--status-green);
}

/* 12. Roster Tables & Roster Cards */
.roster-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.roster-table th {
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-material);
    padding: 12px 16px;
}

.roster-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-material);
    color: var(--text-primary);
}

.roster-table tbody tr:hover {
    background-color: var(--bg-workspace);
}

/* Role Badges */
.role-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}

.role-student {
    background-color: var(--google-blue-light);
    color: var(--google-blue);
}

.role-ta {
    background-color: var(--nyu-violet-light);
    color: var(--nyu-violet);
}

.role-instructor {
    background-color: #feefe3;
    color: #b06000;
}

/* List History Statuses */
.submission-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.submission-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 8px 12px;
    background-color: var(--bg-workspace);
    border-radius: 4px;
    border: 1px solid var(--border-material);
}

.sub-title {
    font-weight: 500;
}

.sub-status {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.status-accepted {
    background-color: var(--status-green-bg);
    color: var(--status-green);
}

.status-pending {
    background-color: var(--status-yellow-bg);
    color: var(--status-yellow);
}

/* 13. Split Canvas Layout for FBD Review Queue */
.fbd-review-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    border: 1px solid var(--border-material);
    border-radius: 6px;
    overflow: hidden;
}

@media (max-width: 800px) {
    .fbd-review-split {
        grid-template-columns: 1fr;
    }
}

.fbd-pane-left {
    background-color: var(--bg-workspace);
    padding: 16px;
    border-right: 1px solid var(--border-material);
}

.fbd-pane-right {
    padding: 20px;
    background-color: var(--surface-card);
}

.canvas-header-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.mock-fbd-image-placeholder {
    height: 240px;
    background-color: #eaeaea;
    border: 2px solid #ccc;
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.draft-watermark {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #999;
    letter-spacing: 0.5px;
}

/* Vector Arrow Animations and Demos */
.mock-beam-sketch {
    position: relative;
    width: 80%;
    height: 120px;
}

.beam-line {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    height: 10px;
    background-color: #3c4043;
    border-radius: 2px;
}

.pin-support {
    position: absolute;
    top: 68px;
    font-size: 20px;
    transform: translateY(-5px);
}

.roller-support {
    position: absolute;
    top: 76px;
    font-size: 12px;
    font-weight: 500;
}

.force-arrow {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.force-arrow span {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 4px;
}

.arrow-down::before {
    content: "↓";
    font-size: 24px;
    color: var(--status-red);
    font-weight: bold;
}

.arrow-up::before {
    content: "↑";
    font-size: 24px;
    color: var(--google-blue);
    font-weight: bold;
}

/* Tag Checklist Selector */
.form-sub-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.tag-selector-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tag-checkbox-lbl {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
}

.tag-checkbox-lbl input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Stats Overview Layout */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--surface-card);
    border: 1px solid var(--border-material);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.1);
}

.stat-num {
    font-size: 32px;
    font-weight: 700;
}

.stat-lbl {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.text-warn .stat-num { color: var(--status-yellow); }
.text-violet .stat-num { color: var(--nyu-violet); }

/* Roster Table Specific Styles */
.roster-table {
    margin-top: 8px;
}

/* 14. Batch Invitation UI styling */
.invite-row-input {
    margin-bottom: 10px;
    display: flex;
    gap: 8px;
}

.invite-actions-row {
    display: flex;
    align-items: center;
    margin-top: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-material);
}

.sent-invites-section {
    margin-top: 16px;
}

.sent-invites-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.invite-status-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.invite-status-list li {
    display: flex;
    align-items: center;
    font-size: 14px;
    padding: 6px 10px;
    background-color: var(--bg-workspace);
    border-radius: 4px;
    border: 1px solid var(--border-material);
}

.invite-item-email {
    font-weight: 500;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invite-item-role {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 8px;
    background-color: #e8eaed;
    padding: 1px 6px;
    border-radius: 4px;
}

.invite-badge {
    margin-left: auto;
    font-size: 12px;
    font-weight: 700;
    background-color: var(--status-yellow-bg);
    color: var(--status-yellow);
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-resend {
    margin-left: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--google-blue);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--transition-standard);
}

.btn-resend:hover {
    background-color: var(--google-blue-light);
}

/* 15. Spot the Mistake Active Sandbox Styling */
.exercise-display {
    background-color: var(--bg-workspace);
    border: 1px solid var(--border-material);
    border-radius: 6px;
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.exercise-display p {
    margin-bottom: 12px;
}

.exercise-display ol {
    margin-left: 24px;
    margin-bottom: 16px;
}

.exercise-display li {
    margin-bottom: 8px;
}

/* 16. Google Account Chooser Modal Interface */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(32,33,36,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(1px);
}

.google-modal-card {
    background-color: var(--surface-card);
    border-radius: 8px;
    box-shadow: var(--shadow-elevation-2);
    width: 100%;
    max-width: 440px;
    padding: 36px 40px;
    display: flex;
    flex-direction: column;
}

.google-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.google-brand-logo {
    height: 24px;
    margin-bottom: 16px;
}

.google-modal-title {
    font-size: 24px;
    font-weight: 400;
    color: #202124;
    font-family: 'Roboto', 'Inter', sans-serif;
}

.google-modal-sub {
    font-size: 14px;
    color: #5f6368;
    margin-top: 6px;
}

.google-account-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

/* Microsoft (Entra ID) sign-in button — styled to sit alongside the GIS button,
   following Microsoft's brand guidance (white field, 4-square logo, Segoe UI). */
.ms-sign-in-btn {
    position: relative;             /* anchor the left-pinned icon */
    display: inline-flex;
    align-items: center;
    justify-content: center;        /* label centered in the full width */
    width: 280px;
    height: 40px;
    background-color: #fff;
    border: 1px solid #8c8c8c;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Segoe UI', 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #5e5e5e;
    transition: var(--transition-standard);
}

.ms-sign-in-btn:hover {
    background-color: var(--bg-workspace);
    border-color: #c4c7c5;
}

.ms-icon {
    position: absolute;             /* pinned to the left edge, like the GIS logo */
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.account-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-material);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-standard);
}

.account-item:hover {
    background-color: var(--bg-workspace);
    border-color: #c4c7c5;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--surface-card);
    position: relative;
    overflow: hidden;
}

/* Profile photo overlays the colored initials circle; if it fails to load it is
   removed (see onerror in app.js) and the initials show through. */
.avatar-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Avatar Color Coding */
.av-prof { background-color: var(--nyu-violet); }
.av-ta { background-color: #e06000; }
.av-student { background-color: var(--google-blue); }
.av-lighty { background-color: #34a853; }
.av-gmail { background-color: #5f6368; }

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 13px;
    flex-shrink: 0;
}

/* Signed-in user badge in the header — a button that opens the account menu */
.profile-menu-wrap {
    position: relative;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}

.user-profile-badge:hover {
    background: var(--surface-hover, rgba(60, 64, 67, 0.08));
}

.profile-menu-caret {
    font-size: 12px;
    color: var(--text-secondary);
}

.profile-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--surface-card, #fff);
    border: 1px solid var(--border-material);
    border-radius: 8px;
    box-shadow: var(--shadow-elevation-2, 0 4px 12px rgba(0,0,0,.15));
    padding: 6px;
    z-index: 200;
    display: flex;
    flex-direction: column;
}

.profile-menu-item {
    background: none;
    border: none;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.profile-menu-item:hover {
    background: var(--surface-hover, rgba(60, 64, 67, 0.08));
}

/* "View as" role switcher for multi-role accounts */
.profile-menu-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-secondary);
    padding: 6px 12px 2px;
}

.profile-menu-item.role-current {
    color: var(--nyu-violet, #57068c);
    font-weight: 600;
    cursor: default;
}

.profile-menu-item.role-current:hover { background: none; }

.profile-menu-divider {
    border-top: 1px solid var(--border-material);
    margin: 6px 0;
}

/* Instructor Admin — the live instructor allowlist (super-admin only) */
.admin-panel {
    background: var(--surface-card);
    border: 1px solid var(--border-material);
    border-radius: 8px;
    padding: 20px 24px;
    box-shadow: var(--shadow-elevation-1);
    max-width: 720px;
}

.admin-add-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.admin-add-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-material);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

/* Homework due dates (#57): due line on cards/detail, overdue/late flags */
.hw-due { color: var(--text-secondary); }
.hw-overdue { color: var(--status-red); font-weight: 600; }
.hw-late { color: var(--status-red); font-weight: 600; }

/* "What you've done" — participation recap inside the memory panel (#48) */
.activity-recap-title {
    margin-top: 20px;
}

.activity-recap-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-material);
    font-size: 14px;
    color: var(--text-primary);
}

.activity-recap-row:last-child { border-bottom: none; }

/* Muted "· detail" tail on the staff table's Last activity column */
.participation-detail { color: var(--text-secondary); }

/* Inline staff editor for changing/clearing a due date after posting */
.hw-due-editor {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 12px;
}

.hw-due-editor input {
    padding: 8px 10px;
    border: 1px solid var(--border-material);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.profile-info-header {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    text-align: left;
}

.profile-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.profile-email-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 14px;
}

.account-details {
    margin-left: 12px;
    flex: 1;
}

.account-name {
    font-size: 14px;
    font-weight: 500;
    color: #3c4043;
}

.account-email {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 1px;
}

.account-role-desc {
    font-size: 12px;
    color: var(--text-secondary);
    background-color: var(--bg-workspace);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid var(--border-material);
}

.modal-error {
    background-color: var(--status-red-bg);
    color: var(--status-red);
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 16px;
    border: 1px solid rgba(197,34,31,0.15);
}

.google-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Classes: cards, detail, people ──────────────────────────────────────── */

.class-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.class-card {
    background: var(--surface-card);
    border: 1px solid var(--border-material);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s, transform .05s;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.class-card:hover {
    box-shadow: 0 1px 6px rgba(60,64,67,0.15);
    border-color: var(--nyu-violet);
}

.class-card:active { transform: translateY(1px); }

.class-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.class-card-term {
    font-size: 14px;
    color: var(--text-secondary);
}

.class-card-code {
    margin-top: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    color: var(--nyu-violet);
    background: var(--nyu-violet-light);
    padding: 2px 8px;
    border-radius: 6px;
    align-self: flex-start;
}

.class-card-add {
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-style: dashed;
    font-weight: 500;
}

.class-card-add .add-plus {
    font-size: 32px;
    line-height: 1;
    color: var(--nyu-violet);
}

.mono-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--nyu-violet);
}

/* Class workspace: left nav + content */
.class-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 900px) {
    .class-layout {
        grid-template-columns: 1fr;
    }
}

.class-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 88px;
}

.class-nav-item {
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font: inherit;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-standard);
}

.class-nav-item:hover {
    background: var(--bg-workspace);
}

.class-nav-item.active {
    background: var(--nyu-violet-light);
    color: var(--nyu-violet);
    font-weight: 600;
}

/* Read-only class details (TA / student view) */
.detail-list {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 10px 16px;
}

.detail-list dt {
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-list dd {
    color: var(--text-primary);
    font-size: 14px;
}

/* Overflow safety: grid/flex items default to min-width:auto and won't shrink
   below their content, which can push the whole page wider than the viewport.
   Let the text containers shrink and wrap instead. */
.portal-header {
    flex-wrap: wrap;
    gap: 12px 16px;
}

.portal-header > div {
    min-width: 0;
}

.welcome-title,
.portal-subtitle {
    overflow-wrap: break-word;
}

.class-content,
.dashboard-main,
.dashboard-sidebar,
.dashboard-layout > * {
    min-width: 0;
}

.people-email,
.detail-list dd,
.class-card-code {
    overflow-wrap: anywhere;
}

/* Generic modal card (create-class) */
.modal-card {
    background: var(--surface-card);
    border-radius: 12px;
    padding: 28px;
    width: 92%;
    max-width: 520px;
    box-shadow: 0 4px 24px rgba(60,64,67,0.3);
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.modal-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Notice dialog body: one line per recipient, wraps and scrolls if many */
#notice-body {
    max-height: 50vh;
    overflow-y: auto;
}

.notice-line {
    padding: 3px 0;
    word-break: break-word;
}

/* Invite-result lines: status text left, Copy-link button right. */
.notice-line-invite {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-copy-link {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--google-blue);
    background: transparent;
    border: 1px solid var(--google-blue);
    border-radius: 4px;
    padding: 2px 10px;
    cursor: pointer;
}

.btn-copy-link:hover {
    background-color: var(--google-blue-light);
}

/* Fallback when the clipboard API is unavailable: a selectable raw link. */
.invite-link-raw {
    flex: 1 1 100%;
    font-size: 12px;
    padding: 4px 6px;
}

/* People lists */
.people-list { list-style: none; padding: 0; margin: 0; }

.people-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-material);
}

.people-list li:last-child { border-bottom: none; }

.people-identity { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.people-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.people-email { font-size: 13px; color: var(--text-secondary); }

.people-right { display: flex; align-items: center; gap: 10px; }

.people-empty { color: var(--text-secondary); font-size: 14px; }

.people-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.badge-enrolled { background: var(--status-green-bg); color: var(--status-green); }
.badge-invited  { background: var(--google-blue-light); color: var(--google-blue); }
.badge-expired  { background: var(--status-yellow-bg); color: var(--status-yellow); }

/* Inline form status (class detail save) */
.form-status {
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.form-status-ok  { background: var(--status-green-bg); color: var(--status-green); }
.form-status-err { background: var(--status-red-bg); color: var(--status-red); }

/* Disabled buttons (e.g. Save Changes with no edits) */
.btn:disabled,
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---------------------------------------------------------------------------
   Adaptive Study Buddy — "What I remember about you" memory panel
   --------------------------------------------------------------------------- */
.memory-panel {
    background: var(--surface-card);
    border: 1px solid var(--border-material);
    border-left: 4px solid var(--nyu-violet);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-elevation-1);
}

.memory-panel .card-section-title { margin: 0; }

.memory-sub {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin: 6px 0 16px;
}

.memory-empty {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 8px 0;
}

.memory-list { display: flex; flex-direction: column; gap: 14px; }

.memory-item { display: flex; align-items: flex-start; gap: 14px; }

.memory-rank {
    flex: 0 0 auto;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    background: var(--nyu-violet-light);
    color: var(--nyu-violet);
    font-weight: 700; font-size: 0.85rem;
    border-radius: 50%;
}

.memory-body { flex: 1 1 auto; min-width: 0; }

.memory-concept-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.memory-concept { font-weight: 600; color: var(--text-primary); font-size: 0.95rem; }

.memory-chip {
    font-size: 0.85rem; font-weight: 600;
    padding: 4px 11px; border-radius: 999px; white-space: nowrap;
}
.memory-chip.sev-high { color: var(--status-red); background: var(--status-red-bg); }
.memory-chip.sev-med  { color: var(--status-yellow); background: var(--status-yellow-bg); }
.memory-chip.sev-low  { color: var(--status-green); background: var(--status-green-bg); }

.memory-bar {
    height: 6px; border-radius: 999px;
    background: var(--bg-workspace);
    margin: 7px 0 5px; overflow: hidden;
}
.memory-bar > span {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--nyu-violet), #8a3fc0);
    border-radius: 999px;
}

.memory-detail {
    color: var(--text-secondary);
    font-size: 0.82rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Student insights — staff-only roster of per-student weak points */
.student-insights { display: flex; flex-direction: column; gap: 12px; }

.student-card {
    border: 1px solid var(--border-material);
    border-radius: 8px;
    padding: 14px 16px;
    background: var(--surface-card);
    transition: var(--transition-standard);
}
.student-card:hover { box-shadow: var(--shadow-elevation-1); }

.student-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 12px;
}

.student-identity { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.student-name { font-weight: 600; font-size: 1rem; color: var(--text-primary); }
.student-email { font-size: 0.9rem; color: var(--text-secondary); }

.student-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.student-chips .memory-chip { cursor: default; }

.student-clear { color: var(--status-green); font-size: 0.92rem; font-weight: 500; }

/* ---------------------------------------------------------------------------
   Boot overlay — covers everything until the session check resolves, so a
   deep-link reload never flashes the logged-out landing page.
   --------------------------------------------------------------------------- */
body.booting .page-container { display: none; }

#boot-loader { display: none; }
body.booting #boot-loader {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    background: var(--bg-workspace);
}
.boot-spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid var(--border-material);
    border-top-color: var(--nyu-violet);
    animation: boot-spin 0.7s linear infinite;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }

/* ── Course material: add-a-lesson form + lesson cards ────────────────────── */

.al-topic {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 78px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    padding: 12px 14px;
    border: 1px solid var(--border-material);
    border-radius: 8px;
}
.al-topic:focus { outline: none; border-color: var(--border-focus); }
.add-lesson-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.al-level-group { margin: 0; min-width: 180px; }
.add-lesson-row .btn-primary { margin-left: auto; }
.lw-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    vertical-align: -2px;
    border-radius: 50%;
    border: 2px solid var(--border-material);
    border-top-color: var(--nyu-violet);
    animation: boot-spin 0.7s linear infinite;
}

.lessons-list { display: flex; flex-direction: column; gap: 18px; }
.lesson-card {
    border: 1px solid var(--border-material);
    border-radius: 8px;
    padding: 18px 20px;
    background: var(--surface-card);
}
.lesson-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
}
.lesson-card:not(.collapsed) .lesson-head {
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-material);
}
.lesson-head-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1 1 auto;
    min-width: 0;
}
.lesson-caret {
    display: inline-block;
    color: var(--text-secondary);
    font-size: 12px;
    transition: transform 0.15s ease;
    flex: none;
}
.lesson-card:not(.collapsed) .lesson-caret { transform: rotate(90deg); }
.lesson-card.collapsed .lesson-body-wrap { display: none; }
.lesson-version-chip {
    flex: none;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface-subtle, rgba(0,0,0,0.04));
    border: 1px solid var(--border-material);
    padding: 2px 8px;
    border-radius: 999px;
}
.lesson-head-right { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.btn-lesson-edit {
    border: 1px solid var(--border-material);
    background: var(--surface-card);
    color: var(--nyu-violet);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-standard);
}
.btn-lesson-edit:hover { background: var(--nyu-violet-light); border-color: var(--nyu-violet); }
.btn-lesson-delete {
    border: 1px solid var(--border-material);
    background: var(--surface-card);
    color: var(--status-red);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-standard);
}
.btn-lesson-delete:hover { background: var(--status-red-bg); border-color: var(--status-red); }
.btn-danger { background: var(--status-red) !important; color: #fff !important; }
.btn-danger:hover { background: #a01613 !important; }
.lesson-title { font-size: 17px; font-weight: 600; color: var(--text-primary); }
.lesson-level {
    flex: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--nyu-violet);
    background: var(--nyu-violet-light);
    padding: 3px 10px;
    border-radius: 999px;
}
.lesson-material { color: var(--text-primary); font-size: 14.5px; }
.lesson-exercises {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-material);
}
.exercise-heading {
    margin: 0 0 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}
.exercise-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.exercise-q { font-size: 14.5px; }
.exercise-q .markdown-inline :first-child { display: inline; margin: 0; }
.exercise-answer {
    margin-top: 6px;
    background: var(--status-green-bg);
    border-radius: 6px;
    padding: 6px 10px;
}
.exercise-answer summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--status-green);
}
.exercise-answer .markdown-body { margin-top: 6px; font-size: 14px; }

/* Version bar (staff): pick which saved version to view, and publish it. */
.lesson-version-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: var(--surface-subtle, rgba(0,0,0,0.03));
    border: 1px solid var(--border-material);
    border-radius: 6px;
}
.lesson-version-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}
.lesson-version-select {
    font-size: 13px;
    padding: 4px 8px;
    border: 1px solid var(--border-material);
    border-radius: 6px;
    background: var(--surface-card);
    color: var(--text-primary);
}
.lesson-published-tag { font-size: 12px; font-weight: 600; color: var(--status-green); }

/* Lesson editor (staff): raw Markdown/KaTeX source editing + variable exercises. */
.lesson-editor { display: flex; flex-direction: column; gap: 14px; }
.le-hint { font-weight: 400; color: var(--text-secondary); font-size: 12px; }
.le-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; }
.le-material { width: 100%; resize: vertical; }
.le-ex-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.le-exercises { display: flex; flex-direction: column; gap: 10px; }
.le-ex-row { display: flex; gap: 8px; align-items: flex-start; }
.le-ex-fields { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; }
.le-ex-fields textarea { width: 100%; resize: vertical; }
.btn-ex-remove {
    border: 1px solid var(--border-material);
    background: var(--surface-card);
    color: var(--status-red);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    flex: none;
}
.btn-ex-remove:hover { background: var(--status-red-bg); border-color: var(--status-red); }
.le-actions { display: flex; align-items: center; gap: 10px; }
.le-spacer { flex: 1 1 auto; }
.le-preview {
    border: 1px dashed var(--border-material);
    border-radius: 6px;
    padding: 12px 14px;
    background: var(--surface-subtle, rgba(0,0,0,0.02));
}

/* Secondary (neutral filled) button + small field-help text. */
.btn-secondary {
    background-color: var(--nyu-violet-light);
    color: var(--nyu-violet);
    border-color: var(--nyu-violet-light);
}
.btn-secondary:hover { background-color: #e9dcf2; }
.field-help { margin: 6px 0 0; font-size: 12px; color: var(--text-secondary); }

/* Lesson index (grid of lesson cards, reusing .class-card). */
.lessons-index-header { margin-bottom: 4px; }
.lesson-index-card .class-card-name { font-size: 16px; }

/* Lesson detail page. */
.lesson-page { display: flex; flex-direction: column; gap: 18px; }
.lesson-page-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lesson-page-actions { display: inline-flex; align-items: center; gap: 10px; }
.lesson-page-title { font-size: 24px; font-weight: 700; color: var(--text-primary); margin: 0; }
.lesson-source-line { font-size: 13px; color: var(--text-secondary); margin: -10px 0 0; }
.lesson-source-line a { color: inherit; }
.lesson-page-body {
    border: 1px solid var(--border-material);
    border-radius: 8px;
    padding: 20px 22px;
    background: var(--surface-card);
}

/* Previous / next lesson navigation. */
.lesson-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding-top: 6px;
}
.lesson-nav-btn {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 260px;
    padding: 10px 14px;
    border: 1px solid var(--border-material);
    border-radius: 8px;
    background: var(--surface-card);
    cursor: pointer;
    transition: var(--transition-standard);
    text-align: left;
}
.lesson-nav-btn.next { text-align: right; margin-left: auto; align-items: flex-end; }
.lesson-nav-btn:hover { border-color: var(--nyu-violet); background: var(--nyu-violet-light); }
.lesson-nav-dir { font-size: 12px; font-weight: 600; color: var(--nyu-violet); }
.lesson-nav-name { font-size: 13.5px; color: var(--text-primary); max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-nav-count { font-size: 12.5px; color: var(--text-secondary); text-align: center; }

/* New lesson page. */
.new-lesson-card { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.new-lesson-card .form-group, .new-lesson-card .form-status { width: 100%; }
.new-lesson-actions { display: flex; gap: 10px; align-self: flex-end; }
.card-section-subtitle { font-size: 15px; font-weight: 600; color: var(--text-primary); margin: 4px 0 0; }

/* "or" divider between the generate-from-brief and upload-a-document options. */
.nl-or { width: 100%; display: flex; align-items: center; gap: 12px; color: var(--text-secondary); font-size: 13px; margin: 8px 0; }
.nl-or::before, .nl-or::after { content: ""; flex: 1; height: 1px; background: var(--border-material); }

/* Document upload control (hide the native file input, drive it via the label). */
.nl-upload-row { display: flex; align-items: center; gap: 12px; width: 100%; flex-wrap: wrap; }
.nl-file-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.nl-file-name { color: var(--text-secondary); font-size: 13px; }

/* Draft-preview banner for an ingested (not-yet-saved) document. */
.ingest-preview-banner { width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: var(--status-yellow-bg); color: var(--status-yellow); border: 1px solid #f0d9a8;
    border-radius: 8px; padding: 10px 14px; font-size: 13px; margin: 12px 0 4px; }
.ingest-preview-badge { background: var(--status-yellow); color: #fff; border-radius: 4px; padding: 2px 8px; font-weight: 600; font-size: 12px; }
.ingest-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ingest-preview-actions { display: flex; align-items: center; gap: 12px; }
.ingest-preview-actions .form-status { margin: 0; }
.ingest-preview-figures { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.ingest-preview-figures .card-section-subtitle,
.ingest-preview-figures .sidebar-help { flex-basis: 100%; }
.ingest-figure { margin: 0; max-width: 240px; }
.ingest-figure img { width: 100%; height: auto; border: 1px solid var(--border-material); border-radius: 6px; display: block; }
.ingest-figure figcaption { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* PDF slide viewer (uploaded lessons) — sits above the transcription. */
.slide-viewer { border: 1px solid var(--border-material); border-radius: 10px; background: var(--surface-card); margin-bottom: 20px; overflow: hidden; }
.slide-viewer:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.slide-viewer-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: var(--nyu-violet-light); border-bottom: 1px solid var(--border-material); }
.slide-viewer-title { font-weight: 600; color: var(--nyu-violet); font-size: 14px; }
.slide-viewer-body[hidden] { display: none; }
.slide-stage { display: flex; align-items: center; justify-content: center; min-height: 200px; padding: 14px; background: #f1f3f4; }
.slide-canvas { max-width: 100%; height: auto; box-shadow: var(--shadow-elevation-1); border-radius: 2px; background: #fff; }
.slide-status { color: var(--text-secondary); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.slide-status[hidden] { display: none; }   /* the display:flex above would otherwise defeat the `hidden` attribute */
.slide-controls { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 14px; flex-wrap: wrap; }
.slide-counter { font-size: 13px; color: var(--text-secondary); min-width: 92px; text-align: center; }
.slide-open { margin-left: auto; }

/* Markdown body: keep generated lesson content readable and contained. */
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
    margin: 0.8em 0 0.4em; line-height: 1.25;
}
.markdown-body h1 { font-size: 1.4em; }
.markdown-body h2 { font-size: 1.25em; }
.markdown-body h3 { font-size: 1.1em; }
.markdown-body p { margin: 0.5em 0; }
.markdown-body ul, .markdown-body ol { margin: 0.5em 0; padding-left: 1.5em; }
/* Figures extracted from an uploaded document: contain within the content width. */
.markdown-body img {
    max-width: 100%; height: auto; display: block; margin: 0.75em 0;
    border: 1px solid var(--border-material); border-radius: 6px;
}
.markdown-body code {
    background: var(--bg-workspace);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.9em;
}
.markdown-body pre {
    background: var(--bg-workspace);
    border: 1px solid var(--border-material);
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
}
.markdown-body pre code { background: none; padding: 0; }
.markdown-body table { border-collapse: collapse; margin: 0.6em 0; }
.markdown-body th, .markdown-body td {
    border: 1px solid var(--border-material);
    padding: 6px 10px;
    text-align: left;
}
.markdown-body .mermaid { margin: 12px 0; text-align: center; }
.markdown-body blockquote {
    margin: 0.6em 0;
    padding-left: 12px;
    border-left: 3px solid var(--border-material);
    color: var(--text-secondary);
}

/* ── Practice module: tabbed activities inside a class (issues #4/#34/#35/#36). */
.practice-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.practice-tab {
    border: 1px solid var(--border-material);
    background: var(--surface-card);
    color: var(--text-secondary);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
}
.practice-tab:hover { color: var(--text-primary); }
.practice-tab.active { background: var(--accent-primary); border-color: var(--accent-primary); color: #fff; }

.pp-checklist { list-style: none; padding: 0; margin: 10px 0; }
.pp-checklist li { display: flex; gap: 10px; align-items: baseline; margin: 8px 0; }
.pp-mark { font-weight: 700; flex: 0 0 auto; }
.pp-ok .pp-mark { color: #188038; }
.pp-bad .pp-mark { color: #c5221f; }
.pp-summary { margin-top: 10px; }
.pp-fb p, .mk-exp p, .cs-fb p { display: inline; margin: 0; }

.mk-problem { margin: 10px 0; }
.mk-hint { display: inline-block; margin-left: 6px; }
.mk-hint summary { cursor: pointer; color: var(--accent-primary); }
.cs-tag { font-size: 13.5px; }

/* FBD upload + review (issue #32). */
.fbd-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border-material); }
.fbd-item:last-child { border-bottom: none; }
.fbd-thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-material); flex: 0 0 auto; }
.fbd-item-body { flex: 1; min-width: 0; }
.fbd-item-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.fbd-review { margin-top: 8px; }
.fbd-feedback { margin: 6px 0 0; font-size: 13.5px; color: var(--text-secondary); }
.fbd-review-card { margin-bottom: 16px; }
.fbd-full { max-width: 100%; max-height: 420px; border-radius: 8px; border: 1px solid var(--border-material); margin: 10px 0; display: block; }
.fbd-tags { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0 12px; }
.fbd-tag-choice { font-size: 13px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* Participation rollup table (issue #33). */
.participation-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.participation-table th, .participation-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border-material); }
.participation-table th { font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.participation-table .p-num { text-align: center; }
.participation-email { color: var(--text-secondary); font-size: 12.5px; }
