:root,
html[data-theme="light"] {
    color-scheme: light;
    --bg: #f6f7fb;
    --panel: #ffffff;
    --panel-strong: #f0f4f8;
    --text: #19202a;
    --muted: #647084;
    --line: #d8dee8;
    --accent: #16675f;
    --accent-strong: #0f4f49;
    --danger: #b42318;
    --code-bg: #111827;
    --code-text: #e5e7eb;
    --shadow: 0 18px 45px rgba(22, 32, 44, 0.12);
    --landing-card: linear-gradient(145deg, #ffffff, #edf5f4);
    --auth-glass: rgba(255, 255, 255, 0.86);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f1419;
    --panel: #1a222d;
    --panel-strong: #232d3b;
    --text: #e8eef6;
    --muted: #9aa8bc;
    --line: #334155;
    --accent: #3db8a8;
    --accent-strong: #2a9a8c;
    --danger: #f97066;
    --code-bg: #020617;
    --code-text: #e2e8f0;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    --landing-card: linear-gradient(145deg, #1a222d, #15202b);
    --auth-glass: rgba(26, 34, 45, 0.88);
}

html[data-theme="gray"] {
    color-scheme: light;
    --bg: #e8eaed;
    --panel: #f3f4f6;
    --panel-strong: #e5e7eb;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #c4c7cc;
    --accent: #4b5563;
    --accent-strong: #374151;
    --danger: #b42318;
    --code-bg: #111827;
    --code-text: #e5e7eb;
    --shadow: 0 18px 45px rgba(55, 65, 81, 0.14);
    --landing-card: linear-gradient(145deg, #f9fafb, #e5e7eb);
    --auth-glass: rgba(243, 244, 246, 0.92);
}

html[data-theme="ocean"] {
    color-scheme: light;
    --bg: #e8f3f8;
    --panel: #ffffff;
    --panel-strong: #dff0f7;
    --text: #123447;
    --muted: #4f7388;
    --line: #b7d5e4;
    --accent: #0b6e99;
    --accent-strong: #085578;
    --danger: #b42318;
    --code-bg: #0b2533;
    --code-text: #e0f2fe;
    --shadow: 0 18px 45px rgba(11, 70, 100, 0.14);
    --landing-card: linear-gradient(145deg, #ffffff, #d9eef7);
    --auth-glass: rgba(255, 255, 255, 0.88);
}

html[data-theme="forest"] {
    color-scheme: light;
    --bg: #eaf3ea;
    --panel: #ffffff;
    --panel-strong: #e1efe1;
    --text: #1a2e1c;
    --muted: #5a735c;
    --line: #bfd4bf;
    --accent: #2f6b3a;
    --accent-strong: #23522c;
    --danger: #b42318;
    --code-bg: #142018;
    --code-text: #dcfce7;
    --shadow: 0 18px 45px rgba(35, 70, 40, 0.14);
    --landing-card: linear-gradient(145deg, #ffffff, #dcefdc);
    --auth-glass: rgba(255, 255, 255, 0.88);
}

html[data-theme="coffee"] {
    color-scheme: light;
    --bg: #f3ebe3;
    --panel: #fffaf6;
    --panel-strong: #efe3d7;
    --text: #3b2a1d;
    --muted: #7a6352;
    --line: #d8c4b2;
    --accent: #8a5a2b;
    --accent-strong: #6d4520;
    --danger: #b42318;
    --code-bg: #2a1c14;
    --code-text: #f5e6d8;
    --shadow: 0 18px 45px rgba(90, 55, 30, 0.14);
    --landing-card: linear-gradient(145deg, #fffaf6, #ead9c8);
    --auth-glass: rgba(255, 250, 246, 0.9);
}

html[data-theme="midnight"] {
    color-scheme: dark;
    --bg: #070b1a;
    --panel: #121a33;
    --panel-strong: #1a2544;
    --text: #e8eefc;
    --muted: #9aa8c7;
    --line: #2a3a63;
    --accent: #5b8cff;
    --accent-strong: #3f6fe0;
    --danger: #f97066;
    --code-bg: #040712;
    --code-text: #dbe7ff;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
    --landing-card: linear-gradient(145deg, #121a33, #0c142b);
    --auth-glass: rgba(18, 26, 51, 0.9);
}

html[data-theme="slate"] {
    color-scheme: light;
    --bg: #e6ebf1;
    --panel: #f7f9fc;
    --panel-strong: #dde5ef;
    --text: #1e293b;
    --muted: #64748b;
    --line: #c5d0de;
    --accent: #475569;
    --accent-strong: #334155;
    --danger: #b42318;
    --code-bg: #0f172a;
    --code-text: #e2e8f0;
    --shadow: 0 18px 45px rgba(51, 65, 85, 0.14);
    --landing-card: linear-gradient(145deg, #f7f9fc, #d9e2ec);
    --auth-glass: rgba(247, 249, 252, 0.9);
}

html[data-theme="coral"] {
    color-scheme: light;
    --bg: #fff1ec;
    --panel: #fffaf8;
    --panel-strong: #ffe4db;
    --text: #3f1f1a;
    --muted: #8a5a52;
    --line: #f0c7bb;
    --accent: #d4573c;
    --accent-strong: #b5442d;
    --danger: #b42318;
    --code-bg: #2a1410;
    --code-text: #ffe8e1;
    --shadow: 0 18px 45px rgba(180, 70, 50, 0.14);
    --landing-card: linear-gradient(145deg, #fffaf8, #ffd8cc);
    --auth-glass: rgba(255, 250, 248, 0.9);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
}

a {
    color: var(--accent);
}

.landing-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px;
}

.landing-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 12%, transparent), transparent 42%),
        linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--panel-strong) 70%, var(--bg)));
}

.landing-shell-simple {
    max-width: 920px;
    min-height: calc(100vh - 44px);
    display: flex;
    flex-direction: column;
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
}

.landing-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.landing-nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 14px;
}

.landing-nav-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
}

.landing-nav-links a:hover {
    color: var(--accent);
}

.landing-nav-cta {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 0 12px;
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    gap: 32px;
    align-items: center;
    min-height: calc(100vh - 190px);
}

.landing-hero-simple {
    grid-template-columns: 1fr;
    min-height: auto;
    flex: 1;
    align-content: center;
    padding: 48px 0 28px;
}

.landing-copy {
    display: grid;
    gap: 18px;
}

.landing-kicker {
    margin: 0;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.landing-hero-simple h1 {
    margin: 0;
    max-width: none;
    font-size: clamp(2.6rem, 8vw, 4.8rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
}

.landing-copy h2 {
    max-width: 760px;
    font-size: clamp(2rem, 4vw, 4.2rem);
    line-height: 1.02;
}

.landing-lead,
.landing-copy p {
    max-width: 620px;
    margin: 0;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.landing-actions .nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 0 16px;
    text-decoration: none;
    font-weight: 700;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 8px;
    background: var(--accent);
    color: #ffffff;
    padding: 0 16px;
    text-decoration: none;
    font-weight: 800;
}

.landing-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 12px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.landing-highlights article {
    padding: 4px 0;
}

.landing-highlights h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.landing-highlights p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.landing-footer {
    margin-top: auto;
    padding-top: 28px;
}

.landing-footer p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.landing-visual {
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--landing-card);
    box-shadow: var(--shadow);
    padding: 18px;
}

.visual-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    padding: 16px;
}

.visual-card span,
.analytics-cards span {
    display: block;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.visual-card pre {
    min-height: auto;
    border-radius: 8px;
    padding: 14px;
    white-space: pre-wrap;
}

.visual-card p,
.visual-card strong {
    margin: 0;
    line-height: 1.5;
}

.landing-section {
    display: grid;
    gap: 18px;
    padding: 28px 0 44px;
}

.landing-section-header h2 {
    font-size: 1.65rem;
}

.feature-grid,
.analytics-grid,
.analytics-cards {
    display: grid;
    gap: 14px;
}

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

.feature-grid article,
.analytics-cards article {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 16px;
}

.feature-grid h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.feature-grid p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.developer-section {
    border-top: 1px solid var(--line);
    margin-top: 8px;
}

.developer-section p {
    max-width: 860px;
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 16px;
}

.analytics-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 14px;
}

.analytics-cards strong {
    display: block;
    font-size: 1.1rem;
}

.pagination-row,
.maintenance-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    background: var(--panel-strong);
    padding: 12px 14px;
}

.maintenance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    justify-content: stretch;
    border-top: 0;
    background: transparent;
}

.maintenance-grid .form-stack h3 {
    margin: 0;
    font-size: 1rem;
}

.danger-zone {
    border: 1px solid #f2b8b5;
    border-radius: 8px;
    background: #fff7f6;
    padding: 14px;
}

.danger-button {
    background: var(--danger);
}

.service-restart-panel {
    border-top: 1px solid var(--line);
    margin-top: 8px;
}

.service-restart-panel .maintenance-grid {
    margin-top: 12px;
}

.restart-wait-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: rgba(12, 18, 28, 0.55);
    padding: 24px;
}

.restart-wait-card {
    width: min(420px, 100%);
    background: var(--panel, #fff);
    border: 1px solid var(--line, #d7dde7);
    border-radius: 12px;
    padding: 22px 24px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.restart-wait-card h2 {
    margin: 6px 0 10px;
    font-size: 1.25rem;
}

.tool-guide {
    display: grid;
    gap: 10px;
    overflow: auto;
    padding: 14px;
    line-height: 1.55;
}

.tool-guide h3,
.tool-guide p {
    margin: 0;
}

.tool-guide h3 {
    font-size: 1rem;
}

.tool-guide h4 {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.tool-guide-section {
    display: grid;
    gap: 4px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.tool-guide ul {
    margin: 0;
    padding-left: 18px;
}

.tool-guide pre {
    margin: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text);
    padding: 10px;
    font-size: 0.86rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.pane-actions {
    display: flex;
    justify-content: flex-start;
    border-top: 1px solid var(--line);
}

.practice-summary-card,
.mastery-summary-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    padding: 10px;
}

.practice-summary-card strong,
.mastery-summary-card strong {
    color: var(--accent);
}

.practice-challenge-card {
    display: grid;
    gap: 8px;
    border: 1px solid #b7e0d8;
    border-radius: 12px;
    background: #effaf7;
    padding: 12px;
}

.practice-challenge-card h4 {
    margin: 0;
    color: var(--accent-strong);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.practice-challenge-card p {
    margin: 0;
    color: var(--text);
    font-weight: 600;
    line-height: 1.45;
}

.practice-check-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.practice-check-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 10px;
}

.practice-check-item.is-pass {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.practice-check-item.is-fail {
    border-color: #fecaca;
    background: #fef2f2;
}

.practice-check-mark {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 800;
    background: #e2e8f0;
    color: #475569;
}

.practice-check-item.is-pass .practice-check-mark {
    background: #059669;
    color: #fff;
}

.practice-check-item.is-fail .practice-check-mark {
    background: #dc2626;
    color: #fff;
}

.practice-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.practice-assessment-list {
    display: grid;
    gap: 8px;
}

.practice-assessment-item {
    display: grid;
    gap: 4px;
    width: 100%;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 10px 12px;
    cursor: pointer;
}

.practice-assessment-item.is-active {
    border-color: var(--accent);
    background: #dff3ef;
}

.practice-assessment-item strong {
    color: var(--text);
}

.practice-assessment-item small {
    color: var(--muted);
}

.learning-menu-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.learning-menu-panel-actions button {
    flex: 1 1 auto;
}

.mastery-list {
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow: auto;
    padding-right: 2px;
}

.mastery-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}

.mastery-item.is-complete {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.mastery-item-title {
    font-weight: 700;
    color: var(--text);
}

.mastery-item small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.mastery-toggle {
    white-space: nowrap;
}

.practice-case-list {
    margin: 0;
    padding-left: 18px;
}

.guided-learning {
    display: grid;
    gap: 12px;
    overflow: auto;
    padding: 14px;
    line-height: 1.55;
}

.motivation-pane .pane-header {
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.12), rgba(37, 99, 235, 0.08));
}

.motivation-pane .pane-header,
.motivation-pane .guided-learning {
    padding-block: 8px;
}

.motivation-card {
    background:
        linear-gradient(135deg, rgba(240, 253, 250, 0.95), rgba(239, 246, 255, 0.95));
    border-top: 1px solid rgba(20, 184, 166, 0.14);
    gap: 8px;
}

.motivation-card p:first-of-type {
    border: 1px solid rgba(20, 184, 166, 0.18);
    border-radius: 8px;
    background: #ffffff;
    padding: 8px 10px;
    color: #12352f;
    font-weight: 700;
    line-height: 1.4;
}

.guided-learning h3,
.guided-learning h4,
.guided-learning p,
.guided-learning ol,
.guided-learning ul {
    margin: 0;
}

.guided-learning h3 {
    font-size: 0.95rem;
    color: var(--accent);
}

.motivation-focus {
    color: var(--muted);
    font-size: 0.8rem;
}

.console-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.console-header-actions #runButton {
    min-height: 34px;
    padding-inline: 14px;
}

.console-header-actions #saveProjectButton {
    min-height: 34px;
    padding-inline: 12px;
}

.save-project-panel {
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--line);
    background: #f8fafc;
    padding: 12px 14px;
}

.save-project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.save-project-message {
    margin: 0;
}

.save-project-message.success {
    color: var(--accent);
}

.save-project-message.error {
    color: var(--danger);
}

.guided-learning h4 {
    color: var(--accent);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.guided-step-list,
.guided-callout {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 12px;
}

.guided-learning ol,
.guided-learning ul {
    display: grid;
    gap: 7px;
    padding-left: 20px;
}

.guided-callout {
    border-color: #f7c7a6;
    background: #fff7ed;
}

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

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

.app-sidebar {
    position: fixed;
    z-index: 30;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: 248px;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 12px 0 35px rgba(22, 32, 44, 0.08);
    padding: 18px 14px;
}

.app-sidebar ~ .app-shell {
    padding-left: 268px;
}

.app-sidebar ~ .app-shell .topbar .actions .nav-link {
    display: none;
}

.app-sidebar ~ .app-shell .topbar .brand-block .brand-logo {
    display: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 18px;
}

.sidebar-brand > div {
    min-width: 0;
    flex: 1;
}

.sidebar-brand strong {
    display: block;
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
}

.sidebar-toggle {
    width: 34px;
    min-height: 34px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: var(--panel-strong);
    color: var(--text);
    padding: 0;
    font-size: 1rem;
}

.sidebar-toggle:hover {
    background: #e7f4f2;
    color: var(--accent-strong);
}

.sidebar-collapsed .app-sidebar {
    width: 0;
    overflow: visible;
    border-right: 0;
    box-shadow: none;
    padding: 0;
}

.sidebar-collapsed .app-sidebar ~ .app-shell {
    padding-left: 74px;
}

.sidebar-collapsed .sidebar-brand {
    padding: 0;
}

.sidebar-collapsed .sidebar-brand > div,
.sidebar-collapsed .sidebar-brand .brand-logo,
.sidebar-collapsed .sidebar-nav,
.sidebar-collapsed .sidebar-footer span,
.sidebar-collapsed .sidebar-footer small,
.sidebar-collapsed .sidebar-logout {
    display: none;
}

.sidebar-collapsed .sidebar-toggle {
    position: fixed;
    top: 16px;
    left: 14px;
    z-index: 50;
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(22, 32, 44, 0.18);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 6px 2px 12px;
}

.sidebar-group {
    display: block;
    width: 100%;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    overflow: visible;
}

.sidebar-main-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    margin: 0;
    border: 0;
    border-radius: 10px;
    color: var(--muted);
    padding: 11px 12px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--panel-strong);
}

.sidebar-main-menu::-webkit-details-marker {
    display: none;
}

.sidebar-main-chevron {
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    opacity: 0.7;
    transition: transform 0.15s ease;
    flex: 0 0 auto;
}

.sidebar-group[open] > .sidebar-main-menu {
    color: var(--accent-strong);
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid var(--line);
}

.sidebar-group[open] > .sidebar-main-menu .sidebar-main-chevron {
    transform: rotate(45deg);
}

.sidebar-submenu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    margin: 0;
    padding: 8px;
    border: 0;
    background: var(--panel);
    border-radius: 0 0 10px 10px;
}

.sidebar-nav a.sidebar-subitem,
.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    color: var(--text);
    padding: 0 10px 0 12px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.sidebar-subitem-label {
    min-width: 0;
}

.sidebar-count {
    margin-left: auto;
    min-width: 1.4rem;
    padding: 0 6px;
    border-radius: 999px;
    background: #b45309;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}

.pending-approval-banner {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.pending-approval-banner a {
    color: #9a3412;
    font-weight: 800;
    margin-left: 6px;
}

.sidebar-subitem-marker {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--muted) 55%, transparent);
    flex: 0 0 auto;
}

.sidebar-subitem-nested {
    margin-left: 12px;
    width: calc(100% - 12px);
    padding-left: 12px !important;
    border-left: 2px solid var(--line);
    border-radius: 0 8px 8px 0 !important;
    font-size: 0.86rem;
    color: var(--muted);
}

.sidebar-subitem-nested .sidebar-subitem-marker {
    width: 5px;
    height: 5px;
}

.sidebar-nav a.sidebar-subitem:hover,
.sidebar-nav a.sidebar-subitem.active {
    background: color-mix(in srgb, var(--accent) 12%, var(--panel));
    color: var(--accent-strong);
}

.sidebar-nav a.sidebar-subitem:hover .sidebar-subitem-marker,
.sidebar-nav a.sidebar-subitem.active .sidebar-subitem-marker {
    background: var(--accent);
}

.sidebar-group summary {
    cursor: pointer;
    list-style: none;
}

.submission-options-box {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.submission-options-box legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.submission-resource-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
    overflow: hidden;
}

.submission-resource-panel .form-grid,
.submission-resource-panel .list-content {
    padding: 14px;
}

.submission-resources {
    display: grid;
    gap: 10px;
    min-width: 220px;
}

.resource-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.resource-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 0 10px;
    text-decoration: none;
    font-size: 0.85rem;
}

.search-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid var(--line);
    padding: 12px 14px;
}

.search-toolbar input {
    flex: 1;
}

.sidebar-footer {
    display: grid;
    gap: 4px;
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding: 14px 6px 0;
}

.sidebar-footer span {
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 800;
}

.sidebar-footer small {
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
}

.sidebar-user-link {
    color: var(--text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}

.sidebar-logout {
    justify-content: center;
    margin-top: 8px;
    border: 1px solid var(--line);
    background: var(--panel-strong);
}

.profile-photo-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.profile-photo {
    width: 96px;
    height: 96px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #ffffff;
    object-fit: cover;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--muted);
    line-height: 1.45;
}

.check-row input {
    width: auto;
    height: auto;
    margin-top: 4px;
}

.workspace {
    max-width: 1720px;
    margin: 0 auto;
}

.topbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-logo {
    width: 210px;
    height: auto;
    max-height: 64px;
    flex: 0 0 auto;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
}

.brand-logo-wordmark {
    width: min(420px, 72vw);
    height: auto;
    max-height: 118px;
}

.sidebar-brand .brand-logo {
    width: 174px;
    height: auto;
    max-height: 62px;
}

.topbar .brand-logo {
    width: min(230px, 36vw);
    height: auto;
    max-height: 68px;
}

.topbar .brand-block {
    flex-wrap: nowrap;
}

.topbar .brand-block .eyebrow {
    font-size: 0.68rem;
}

.topbar .brand-block h1 {
    font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.code-example-field {
    min-width: min(260px, 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 6px 8px 8px;
}

.code-example-field select {
    height: 34px;
    border-color: transparent;
    background: #f8fafc;
    font-size: 0.86rem;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(1.65rem, 2.8vw, 2.35rem);
    line-height: 1.08;
}

h2 {
    font-size: 0.9rem;
}

.actions {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
}

.field {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.field small {
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 600;
}

.field.compact {
    min-width: 150px;
}

select {
    width: 100%;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    padding: 0 12px;
}

input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    padding: 0 12px;
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #ffffff;
    padding: 0 14px;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
}

button:hover {
    background: var(--accent-strong);
}

button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.ghost {
    min-height: 32px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    padding: 0 12px;
    font-size: 0.82rem;
}

.ghost:hover {
    background: var(--panel-strong);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    padding: 0 13px;
    font-weight: 800;
    font-size: 0.88rem;
    text-decoration: none;
}

.nav-link:hover {
    background: var(--panel-strong);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    max-width: 260px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #edf8f5;
    color: var(--accent-strong);
    padding: 0 12px;
    font-size: 0.84rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-logo {
    display: block;
    width: min(300px, 78vw);
    height: auto;
    margin: 0 0 16px;
}

.play-icon {
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 10px solid currentColor;
}

.editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
    gap: 16px;
    align-items: start;
    min-height: 0;
}

.category-cyber {
    --accent: #7f1d1d;
    --accent-strong: #5f1515;
}

.category-database {
    --accent: #0f766e;
    --accent-strong: #115e59;
}

.category-network {
    --accent: #075985;
    --accent-strong: #0c4a6e;
}

.category-mobile_web {
    --accent: #166534;
    --accent-strong: #14532d;
}

.category-multimedia {
    --accent: #9f1239;
    --accent-strong: #881337;
}

.category-data {
    --accent: #14532d;
    --accent-strong: #0f3f23;
}

.category-research {
    --accent: #6d3f0b;
    --accent-strong: #543008;
}

.category-blockchain {
    --accent: #854d0e;
    --accent-strong: #713f12;
}

.category-ai {
    --accent: #4338ca;
    --accent-strong: #3730a3;
}

.category-calculus {
    --accent: #0e7490;
    --accent-strong: #155e75;
}

.category-discrete_math {
    --accent: #7c2d12;
    --accent-strong: #5f2410;
}

.category-algorithms {
    --accent: #4d7c0f;
    --accent-strong: #3f6212;
}

.category-automata {
    --accent: #6d28d9;
    --accent-strong: #5b21b6;
}

.category-ai_foundations {
    --accent: #be123c;
    --accent-strong: #9f1239;
}

.category-tools {
    --accent: #334155;
    --accent-strong: #1f2937;
}

.category-network .editor-grid,
.category-database .editor-grid,
.category-mobile_web .editor-grid,
.category-multimedia .editor-grid,
.category-cyber .editor-grid,
.category-data .editor-grid,
.category-research .editor-grid,
.category-calculus .editor-grid,
.category-discrete_math .editor-grid,
.category-algorithms .editor-grid,
.category-automata .editor-grid,
.category-ai_foundations .editor-grid,
.category-blockchain .editor-grid,
.category-ai .editor-grid,
.category-tools .editor-grid {
    grid-template-columns: minmax(360px, 0.78fr) minmax(460px, 1fr);
}

.category-programming .editor-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.45fr);
}

body.editor-expanded .editor-grid,
.category-programming.editor-expanded .editor-grid {
    grid-template-columns: minmax(0, 1fr);
}

body.editor-expanded .side-column,
.category-programming.editor-expanded .side-column {
    display: none;
}

body.editor-expanded .editor-pane > textarea,
body.editor-expanded .editor-pane > .code-editor-wrap,
body.editor-expanded .editor-pane > .code-editor-shell,
.category-programming.editor-expanded .editor-pane > textarea,
.category-programming.editor-expanded .editor-pane > .code-editor-wrap,
.category-programming.editor-expanded .editor-pane > .code-editor-shell {
    min-height: min(78vh, 900px);
    height: min(78vh, 900px);
    max-height: none;
}

.crypto-lab-mode .editor-grid {
    grid-template-columns: minmax(0, 1fr);
}

.crypto-lab-mode .side-column {
    display: none;
}

.side-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    align-self: start;
}

.editor-pane {
    width: 100%;
    align-self: start;
    max-width: 100%;
    min-width: 0;
}

.output-pane {
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: visible;
}

.console-output-wrap {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    min-height: 160px;
    height: min(36vh, 320px);
    overflow: hidden;
    background: var(--code-bg);
}

.console-output-wrap > pre,
.console-output-wrap > .web-preview-shell {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    resize: none;
}

.pane {
    position: relative;
    display: flex;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.output-pane.pane {
    overflow: visible;
}

.pane-header {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-strong);
    padding: 9px 12px;
}

.pane-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.editor-toolbar {
    flex: 1;
    align-items: end;
    justify-content: flex-end;
}

.toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.64);
    padding: 4px;
}

.toolbar-group .ghost,
.toolbar-group button {
    min-height: 30px;
    border-radius: 6px;
}

.tutorial-toolbar .ghost {
    padding-inline: 10px;
}

.mini-select-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.mini-select-field select {
    min-height: 30px;
    border-radius: 6px;
    padding: 0 28px 0 8px;
    font-size: 0.84rem;
}

.icon-button {
    width: 40px;
    padding: 0;
    font-size: 0.82rem;
    font-weight: 800;
}

textarea,
pre,
.web-preview-shell {
    width: 100%;
    min-height: 0;
    flex: 1;
    margin: 0;
    border: 0;
    outline: 0;
    resize: vertical;
    background: var(--code-bg);
    color: var(--code-text);
    padding: 14px;
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
    font-size: 0.88rem;
    line-height: 1.55;
    tab-size: 4;
}

.code-editor-wrap {
    display: flex;
    flex: 0 0 auto;
    height: min(52vh, 520px);
    min-height: 280px;
    max-height: none;
    flex-direction: column;
    min-width: 0;
}

.code-editor-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: var(--code-bg);
}

.code-editor-resize {
    position: relative;
    z-index: 2;
    height: 14px;
    flex: none;
    cursor: ns-resize;
    touch-action: none;
    border-top: 1px solid var(--line);
    background:
        linear-gradient(90deg, transparent 0, transparent 42%, #94a3b8 42%, #94a3b8 58%, transparent 58%),
        linear-gradient(#e8edf4, #dce3ee);
}

.code-editor-resize::before {
    content: "Drag to resize";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    pointer-events: none;
}

.code-editor-resize::after {
    content: none;
}

.code-editor-resize:hover,
.code-editor-resize:focus-visible,
body.code-editor-resizing .code-editor-resize,
body.console-resizing .code-editor-resize.is-active-resize {
    background: linear-gradient(#dff3ef, #cfe8e3);
    outline: 0;
    color: var(--accent-strong);
}

.code-editor-resize:hover::before,
.code-editor-resize:focus-visible::before,
body.code-editor-resizing .code-editor-resize.is-active-resize::before,
body.console-resizing .code-editor-resize.is-active-resize::before {
    color: var(--accent-strong);
}

body.code-editor-resizing,
body.console-resizing {
    cursor: ns-resize;
    user-select: none;
}

body.code-editor-resizing iframe,
body.console-resizing iframe {
    pointer-events: none;
}

.code-line-numbers {
    width: auto;
    min-width: 48px;
    flex: none;
    overflow: hidden;
    border-right: 1px solid #263244;
    background: #0a1020;
    color: #7f8da3;
    padding: 14px 10px;
    text-align: right;
    font-size: var(--editor-font-size, 0.88rem);
    line-height: 1.55;
    user-select: none;
    white-space: pre;
    word-break: normal;
}

.code-editor-shell > textarea {
    min-width: 0;
    resize: none;
    font-size: var(--editor-font-size, 0.88rem);
}

.editor-pane > textarea,
.editor-pane > .code-editor-shell,
.assessment-form > textarea {
    min-height: 320px;
}

.editor-pane > .code-editor-wrap {
    min-height: 320px;
}

.code-zoom-90 {
    --editor-font-size: 0.8rem;
}

.code-zoom-100 {
    --editor-font-size: 0.88rem;
}

.code-zoom-110 {
    --editor-font-size: 0.97rem;
}

.code-zoom-120 {
    --editor-font-size: 1.06rem;
}

.code-zoom-130 {
    --editor-font-size: 1.15rem;
}

.code-zoom-140 {
    --editor-font-size: 1.24rem;
}

.code-zoom-150 {
    --editor-font-size: 1.32rem;
}

.web-preview-shell {
    overflow: auto;
    background: #f8fafc;
}

.web-preview {
    display: block;
    border: 0;
    background: #ffffff;
    width: 133.333%;
    height: 133.333%;
    min-height: 420px;
    transform: scale(0.75);
    transform-origin: top left;
}

[hidden] {
    display: none !important;
}

.small-textarea {
    background: #ffffff;
    color: var(--text);
}

.console-input-shell {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-bottom: 1px solid #263244;
    background: var(--code-bg);
    padding: 12px 14px 0;
}

.console-input-shell label {
    color: #93c5bd;
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.console-input-shell textarea {
    min-height: 72px;
    height: 96px;
    flex: none;
    border: 1px solid #263244;
    border-radius: 8px;
    background: #0b1220;
    color: var(--code-text);
    padding: 10px 12px;
    resize: none;
    overflow: hidden;
}

.console-input-shell .console-input-resize {
    margin: 0 -14px;
    border-top: 1px solid #263244;
}

.console-pane-resize {
    border-radius: 0 0 8px 8px;
}

#codeEditorShell > textarea#code {
    overflow: hidden;
    resize: none;
}

.crypto-tool-panel {
    display: grid;
    gap: 14px;
    flex: 1;
    overflow: auto;
    background: #f8fafc;
    padding: 14px;
}

.prompt-builder-panel {
    display: grid;
    gap: 14px;
    flex: 1;
    overflow: auto;
    background: #f8fafc;
    padding: 14px;
}

.sentiment-panel {
    display: grid;
    gap: 14px;
    flex: 1;
    overflow: auto;
    background: #f8fafc;
    padding: 14px;
}

.stats-panel {
    display: grid;
    gap: 14px;
    flex: 1;
    overflow: auto;
    background: #f8fafc;
    padding: 14px;
}

.number-systems-panel {
    display: grid;
    gap: 14px;
    flex: 1;
    overflow: auto;
    background: #f8fafc;
    padding: 14px;
}

.number-systems-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.number-systems-panel .field,
.number-systems-panel input {
    min-width: 0;
}

.number-systems-advanced {
    display: grid;
    gap: 12px;
    border-top: 1px solid #d8dee8;
    padding-top: 14px;
}

.number-systems-advanced h3 {
    margin: 0;
    color: var(--text);
    font-size: 0.95rem;
}

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

.survey-scale-panel {
    display: grid;
    gap: 14px;
    flex: 1;
    overflow: auto;
    background: #f8fafc;
    padding: 14px;
}

.research-title-panel {
    display: grid;
    gap: 14px;
    flex: 1;
    overflow: auto;
    background: #f8fafc;
    padding: 14px;
}

.research-title-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.research-title-panel .field,
.research-title-panel input,
.research-title-panel select,
.research-title-panel textarea {
    min-width: 0;
}

.research-title-panel .tool-text-field textarea {
    min-height: 120px;
}

.title-list {
    display: grid;
    gap: 12px;
    margin: 12px 0;
}

.title-list article {
    display: grid;
    gap: 6px;
    border: 1px solid #d8dee8;
    border-left: 5px solid var(--accent);
    border-radius: 8px;
    background: #ffffff;
    padding: 14px 16px;
}

.title-list span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.title-list h2 {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.45;
}

.option-objectives {
    display: grid;
    gap: 8px;
    border-top: 1px solid #e5e9f0;
    margin-top: 8px;
    padding-top: 10px;
}

.option-objectives strong {
    color: var(--text);
    font-size: 0.9rem;
}

.option-objectives ol {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 22px;
    color: var(--muted);
    line-height: 1.45;
}

.objectives-card {
    display: grid;
    gap: 10px;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #ffffff;
    padding: 16px;
    margin: 12px 0;
}

.objectives-card h2,
.objectives-card p {
    margin: 0;
}

.objectives-card ol {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 22px;
    color: var(--text);
    line-height: 1.5;
}

.survey-scale-summary,
.survey-preview-card {
    display: grid;
    gap: 8px;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #ffffff;
    padding: 14px;
}

.survey-scale-summary strong {
    color: var(--text);
    font-size: 1.05rem;
}

.survey-scale-summary span {
    color: var(--muted);
    line-height: 1.45;
}

.survey-scale-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.survey-scale-panel .field,
.survey-scale-panel input,
.survey-scale-panel select,
.survey-scale-panel textarea {
    min-width: 0;
}

.survey-scale-panel .tool-text-field textarea {
    min-height: 110px;
}

.survey-question {
    color: var(--text);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.45;
}

.survey-choice-list {
    display: grid;
    gap: 10px;
}

.survey-choice-list label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--text);
}

.survey-choice-list input {
    width: 16px;
    height: 16px;
    margin-top: 2px;
}

.survey-visual-scale {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) minmax(160px, 2fr) minmax(90px, 1fr);
    align-items: center;
    gap: 12px;
}

.survey-visual-scale input {
    width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stats-panel .field,
.stats-panel input,
.stats-panel select,
.stats-panel textarea {
    min-width: 0;
}

.stats-panel .tool-text-field textarea {
    min-height: 190px;
}

.stats-summary {
    display: grid;
    gap: 6px;
    border: 1px solid #d8dee8;
    border-left: 5px solid #16675f;
    border-radius: 8px;
    background: #ffffff;
    padding: 14px 16px;
    margin: 12px 0;
}

.stats-summary strong {
    color: var(--text);
    font-size: 1.05rem;
}

.sentiment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.sentiment-panel .field,
.sentiment-panel input,
.sentiment-panel select,
.sentiment-panel textarea {
    min-width: 0;
}

.sentiment-panel .tool-text-field textarea {
    min-height: 260px;
}

.sentiment-summary {
    display: grid;
    gap: 6px;
    border: 1px solid #d8dee8;
    border-left-width: 5px;
    border-radius: 8px;
    background: #ffffff;
    padding: 14px 16px;
    margin: 12px 0;
}

.sentiment-summary strong {
    color: var(--text);
    font-size: 1.05rem;
}

.sentiment-positive {
    border-left-color: #12805c;
}

.sentiment-negative {
    border-left-color: #b42318;
}

.sentiment-neutral-mixed {
    border-left-color: #b7791f;
}

.analysis-steps {
    display: grid;
    gap: 8px;
    margin: 10px 0 0;
    padding-left: 22px;
    color: var(--muted);
}

.prompt-builder-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.prompt-builder-grid.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.prompt-builder-panel .field {
    min-width: 0;
}

.prompt-builder-panel input,
.prompt-builder-panel select,
.prompt-builder-panel textarea {
    min-width: 0;
}

.prompt-builder-panel .tool-text-field textarea {
    min-height: 112px;
}

.prompt-output-card {
    display: grid;
    gap: 10px;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #ffffff;
    padding: 14px;
}

.prompt-output-card pre {
    min-height: 0;
    flex: none;
    border-radius: 8px;
    overflow-x: hidden;
    white-space: pre-wrap;
    word-break: break-word;
}

.prompt-output-card code {
    white-space: pre-wrap;
    word-break: break-word;
}

.tool-note {
    max-width: 860px;
    color: var(--muted);
    line-height: 1.55;
}

.tool-form-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(190px, 1fr) minmax(160px, 0.9fr) minmax(100px, 0.45fr);
    gap: 12px;
}

.tool-text-field {
    min-height: 0;
}

.tool-text-field textarea {
    min-height: 150px;
    flex: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

pre {
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.terminal-output {
    background: #0b1220;
    color: #d1d5db;
    white-space: pre;
    word-break: normal;
}

.terminal-user {
    color: #34d399;
    font-weight: 800;
}

.terminal-path {
    color: #60a5fa;
    font-weight: 800;
}

.terminal-symbol,
.terminal-command {
    color: #f8fafc;
}

.terminal-dir {
    color: #60a5fa;
    font-weight: 800;
}

.terminal-file {
    color: #e5e7eb;
}

.terminal-exe {
    color: #34d399;
    font-weight: 800;
}

.terminal-error {
    color: #fca5a5;
}

.autocomplete-menu {
    position: fixed;
    z-index: 50;
    display: grid;
    max-height: 260px;
    overflow: auto;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0b1220;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.35);
    padding: 6px;
}

.autocomplete-item {
    display: grid;
    min-height: 38px;
    justify-content: stretch;
    gap: 2px;
    border-radius: 6px;
    background: transparent;
    color: var(--code-text);
    padding: 7px 9px;
    text-align: left;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: #1f2a3d;
}

.autocomplete-item strong {
    font-size: 0.82rem;
    line-height: 1.2;
}

.autocomplete-item span {
    color: #9ca3af;
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    background: #dff3ef;
    color: var(--accent-strong);
    padding: 0 10px;
    font-size: 0.72rem;
    font-weight: 800;
}

.badge.error {
    background: #fee4e2;
    color: var(--danger);
}

.badge.neutral {
    background: #eef2f7;
    color: var(--muted);
}

.about-body {
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 12%, transparent), transparent 42%),
        linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--panel-strong) 70%, var(--bg)));
}

.about-shell {
    position: relative;
}

.app-shell.about-shell {
    background: transparent;
}

.about-page {
    max-width: 920px;
}

.about-nav {
    margin-bottom: 18px;
}

.about-simple {
    display: grid;
    gap: 36px;
    padding: 28px 0 12px;
}

.about-block h1 {
    margin: 0 0 12px;
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    line-height: 1;
    letter-spacing: -0.03em;
}

.about-block h2 {
    margin: 0 0 6px;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
}

.about-block p {
    margin: 0 0 12px;
    max-width: 640px;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.7;
}

.about-block .landing-lead {
    margin-bottom: 14px;
    color: var(--text);
    font-size: 1.12rem;
}

.about-block .muted {
    color: var(--muted);
    font-weight: 600;
}

.about-author-simple {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.author-logo {
    width: 120px;
    height: 120px;
    border: 1px solid var(--line);
    border-radius: 50%;
    object-fit: cover;
    background: var(--panel);
}

.auth-shell {
    display: grid;
    place-items: center;
}

.login-auth-shell {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        linear-gradient(105deg, rgba(246, 247, 251, 0.96) 0%, rgba(246, 247, 251, 0.9) 42%, rgba(230, 245, 249, 0.72) 100%),
        url("../img/coderkiosk.png") center right 5vw / min(900px, 75vw) auto no-repeat,
        var(--bg);
}

.login-auth-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 16% 22%, rgba(14, 116, 144, 0.18), transparent 26%),
        radial-gradient(circle at 82% 78%, rgba(22, 103, 95, 0.16), transparent 30%);
}

.login-auth-shell .auth-panel {
    backdrop-filter: blur(18px);
    background: var(--auth-glass);
}

.register-auth-shell {
    position: relative;
    isolation: isolate;
    overflow: auto;
    min-height: 100vh;
    padding: 24px 20px;
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 14%, transparent), transparent 40%),
        linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--panel-strong) 72%, var(--bg)));
}

.register-panel {
    width: min(100%, 640px);
    padding: 28px;
}

.register-panel-wide {
    width: min(100%, 1040px);
    max-width: 1040px;
    padding: 28px 32px;
}

.register-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px 28px;
    margin-bottom: 18px;
}

.register-header {
    display: flex;
    flex: 1 1 320px;
    align-items: center;
    gap: 16px;
    min-width: 0;
    margin-bottom: 0;
}

.register-header .auth-logo {
    margin: 0;
    width: auto;
    max-width: 150px;
    height: auto;
    max-height: 52px;
    flex-shrink: 0;
}

.register-header h1 {
    margin: 0;
    font-size: clamp(1.55rem, 2.6vw, 2rem);
}

.register-intro {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
    max-width: 36rem;
}

.register-form {
    gap: 14px;
}

.register-form-horizontal {
    display: grid;
    gap: 16px;
}

.register-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.register-section {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--panel-strong) 55%, var(--panel));
    min-width: 0;
}

.register-section h2 {
    margin: 0;
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.register-section .form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.register-role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 180px));
    gap: 10px;
    flex: 0 0 auto;
}

.register-role-option {
    position: relative;
    display: grid;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    padding: 10px 12px;
    cursor: pointer;
}

.register-role-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.register-role-option strong {
    font-size: 0.95rem;
}

.register-role-option small {
    color: var(--muted);
    line-height: 1.3;
    font-size: 0.8rem;
}

.register-role-option.is-selected,
.register-role-option:has(input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent);
}

.register-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(200px, 0.55fr);
    gap: 16px;
    align-items: center;
}

.register-privacy {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    font-size: 0.86rem;
}

.register-bottom-actions {
    display: grid;
    gap: 8px;
}

.register-bottom-actions button {
    width: 100%;
    min-height: 44px;
}

.register-footer-note {
    margin: 0;
    text-align: center;
}

@media (max-width: 920px) {
    .register-panel-wide {
        padding: 22px 18px;
    }

    .register-columns,
    .register-bottom,
    .register-section .form-grid.two {
        grid-template-columns: 1fr;
    }

    .register-role-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
}

@media (max-width: 640px) {
    .register-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .register-role-grid {
        grid-template-columns: 1fr;
        width: 100%;
    }
}

.auth-panel {
    width: min(100%, 420px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
    padding: 24px;
}

/* Must follow .auth-panel ? same specificity otherwise keeps the 420px login width. */
.auth-panel.register-panel-wide {
    width: min(100%, 1040px);
    max-width: 1040px;
    padding: 28px 32px;
}

.auth-panel h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.auth-panel.register-panel-wide h1 {
    font-size: clamp(1.55rem, 2.6vw, 2rem);
}

.form-stack {
    display: grid;
    gap: 12px;
}

.padded {
    padding: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

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

.light-textarea {
    min-height: 100px;
    flex: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
}

.check-row input {
    width: 18px;
    height: 18px;
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.question-builder-list,
.question-answer-form {
    display: grid;
    gap: 14px;
}

.question-card {
    background: #ffffff;
}

.question-card p {
    margin: 0;
    color: var(--text);
    line-height: 1.55;
}

.choice-list {
    display: grid;
    gap: 8px;
}

.question-answer-form .light-textarea,
.coding-answer {
    min-height: 150px;
}

.coding-answer {
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
    min-height: 220px;
}

.assessment-builder {
    gap: 18px;
}

.assessment-settings-card,
.assessment-question-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.builder-toolbar,
.builder-footer,
.question-card-header,
.assessment-record-card,
.compact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.builder-toolbar h3,
.compact-header h3 {
    margin: 0;
}

.builder-toolbar-actions,
.assessment-record-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.student-assign-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
}

.student-assign-list {
    display: grid;
    gap: 8px;
    max-height: 240px;
    overflow: auto;
}

.inline-toggle-form {
    margin: 0;
}

.compact-check {
    margin: 0;
}

fieldset {
    display: grid;
    gap: 10px;
    min-width: 0;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

legend {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
}

.manage-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
    gap: 16px;
    align-items: start;
}

.project-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 0.55fr);
    gap: 16px;
    align-items: start;
}

.project-side-column {
    display: grid;
    gap: 16px;
}

.project-runner-pane {
    min-height: 0;
}

.project-input-field {
    border-bottom: 1px solid var(--line);
    padding: 12px;
}

.project-input-field textarea {
    min-height: 72px;
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    flex: none;
}

.project-runner-pane pre {
    min-height: 150px;
    max-height: 240px;
    overflow: auto;
}

.project-runner-pane .web-preview-shell {
    min-height: 260px;
    max-height: 340px;
}

.project-editor-form {
    min-height: auto;
}

.project-code-field {
    min-height: 0;
    flex: 1;
}

.project-code-textarea {
    min-height: 260px;
    resize: vertical;
    border: 1px solid #1f2937;
    background: var(--code-bg);
    color: var(--code-text);
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
    font-size: 0.92rem;
    line-height: 1.65;
    tab-size: 4;
    white-space: pre;
    overflow: auto;
}

.project-editor-expanded .project-editor-grid {
    grid-template-columns: minmax(0, 1fr);
}

.project-editor-expanded .project-side-column {
    display: none;
}

.project-editor-expanded .project-code-textarea {
    min-height: calc(100vh - 230px);
}

.project-list-note {
    display: grid;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
    padding: 12px 16px;
}

.project-list-note strong {
    color: var(--text);
    font-size: 0.9rem;
}

.project-list-note span {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.student-project-feedback {
    display: grid;
    gap: 10px;
    border: 1px solid #b7ddd5;
    border-left: 5px solid var(--accent);
    border-radius: 8px;
    background: #edf8f5;
    padding: 12px;
}

.student-project-feedback span {
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.student-project-feedback strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
}

.student-project-feedback small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-weight: 700;
}

.student-project-feedback p {
    margin: 0;
    color: var(--text);
    line-height: 1.5;
}

.assignment-instructions-card {
    display: grid;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    background: #f8fbff;
    padding: 14px 16px;
}

.assignment-instructions-card span {
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.assignment-instructions-card strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: 1rem;
}

.assignment-instructions-card p {
    margin: 0;
    line-height: 1.55;
}

.assignment-instructions-card small {
    color: var(--muted);
    font-weight: 700;
}

.split-submit-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.split-submit-row button {
    flex: 1;
    min-width: 180px;
}

.faculty-followup-message,
.faculty-followup-card {
    border-top: 1px solid #b7ddd5;
    margin-top: 4px;
    padding-top: 10px;
}

.faculty-followup-message span {
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.student-reply-form {
    border-top: 1px solid var(--line);
    background: #fbfcfe;
}

.student-reply-form textarea {
    min-height: 110px;
}

.student-reply-card {
    display: grid;
    gap: 8px;
    border-top: 1px solid var(--line);
    background: #fbfcfe;
    padding: 12px 16px 16px;
}

.student-reply-card span {
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.student-reply-card p {
    margin: 0;
    line-height: 1.5;
}

.student-reply-card small {
    color: var(--muted);
    font-weight: 700;
}

.conversation-thread {
    display: grid;
    gap: 10px;
}

.conversation-message {
    display: grid;
    gap: 6px;
    border: 1px solid var(--line);
    border-left-width: 5px;
    border-radius: 8px;
    background: #ffffff;
    padding: 10px 12px;
}

.conversation-message header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.conversation-message header strong {
    display: inline;
    margin: 0;
    font-size: 0.86rem;
}

.conversation-message header span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: none;
}

.conversation-message p {
    margin: 0;
    color: var(--text);
    line-height: 1.5;
}

.faculty-message {
    border-left-color: var(--accent);
}

.student-message {
    border-left-color: #2563eb;
    background: #f8fbff;
}

.messages-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.75fr) minmax(320px, 0.95fr) minmax(460px, 1.3fr);
    gap: 16px;
    align-items: start;
}

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

.message-compose-pane,
.message-list-pane,
.message-thread-pane {
    min-height: calc(100vh - 208px);
}

.message-list-pane,
.message-thread-pane {
    max-height: calc(100vh - 208px);
}

.message-list {
    display: grid;
    gap: 8px;
    overflow: auto;
    padding: 10px;
}

.sent-list {
    max-height: 260px;
}

.message-row {
    display: grid;
    gap: 5px;
    border: 1px solid var(--line);
    border-left: 5px solid transparent;
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    padding: 10px 12px;
    text-decoration: none;
}

.message-row:hover,
.message-row.active {
    border-left-color: var(--accent);
    background: #f8fbff;
}

.message-row.unread {
    border-left-color: #991b1b;
    background: #fffafa;
}

.message-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-row span,
.message-row small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.message-body-input {
    min-height: 150px;
}

.message-thread {
    display: grid;
    align-content: start;
    gap: 12px;
    overflow: auto;
    padding: 16px;
}

.message-thread .conversation-message {
    max-width: 82%;
}

.own-message {
    justify-self: end;
}

.message-reply-form {
    border-top: 1px solid var(--line);
    background: var(--panel-strong);
}

.project-review-grid {
    display: grid;
    grid-template-columns: minmax(360px, 0.78fr) minmax(620px, 1.22fr);
    gap: 16px;
    align-items: start;
}

.project-review-list-pane {
    max-height: calc(100vh - 118px);
}

.compact-table-wrap table,
.compact-table {
    min-width: 760px;
}

.selected-row {
    background: #edf8f5;
}

.project-review-runner {
    min-height: calc(100vh - 118px);
}

.project-review-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
    padding: 12px;
}

.project-review-meta div {
    display: grid;
    gap: 4px;
}

.project-review-meta span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.project-review-meta strong {
    color: var(--text);
    line-height: 1.35;
}

.project-review-code-field {
    padding: 12px;
}

.project-review-extra-files {
    border-top: 1px solid var(--line);
    box-shadow: none;
}

.project-review-extra-files .java-files-list {
    max-height: 360px;
}

.project-review-code-field .project-code-textarea {
    min-height: 320px;
}

.project-review-output-grid {
    display: grid;
    grid-template-columns: minmax(240px, 0.58fr) minmax(320px, 1fr);
    gap: 12px;
    border-top: 1px solid var(--line);
    padding: 12px;
}

.flat-pane {
    box-shadow: none;
}

.project-review-output-grid pre {
    min-height: 170px;
    max-height: 320px;
    overflow: auto;
}

.project-review-output-grid .web-preview-shell {
    min-height: 320px;
}

.project-review-feedback-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.85fr) minmax(360px, 1fr);
    gap: 12px;
    border-top: 1px solid var(--line);
    padding: 12px;
}

.history-list {
    display: grid;
    gap: 10px;
    max-height: 520px;
    overflow: auto;
    padding: 12px;
}

.history-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 10px;
}

.history-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
}

.history-item summary span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.history-files {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.grade-history-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.grade-history-row span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.grade-history-row strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
}

.list-content {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.muted,
.auth-note {
    color: var(--muted);
}

.auth-note a {
    color: var(--accent);
    font-weight: 800;
}

.compact-auth-note {
    margin: -2px 0 0;
    text-align: right;
    font-size: 0.86rem;
}

.alert {
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 700;
}

.alert.error {
    background: #fee4e2;
    color: var(--danger);
}

.alert.success {
    background: #dff3ef;
    color: var(--accent-strong);
}

.assessment-form {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
}

.assessment-form textarea {
    flex: 1;
}

.java-files-panel {
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.web-mode .editor-pane > #code {
    min-height: 360px;
    flex: 1 1 52%;
}

.web-mode #webFilesPanel {
    display: flex;
    min-height: 360px;
    flex: 1 1 48%;
    flex-direction: column;
}

.java-files-list {
    display: grid;
    gap: 10px;
    max-height: 360px;
    overflow: auto;
    padding: 12px;
}

.web-mode #webFilesList {
    min-height: 0;
    flex: 1;
    max-height: none;
}

.web-file-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    padding: 8px 10px 0;
}

.web-file-tab {
    min-height: 34px;
    max-width: 180px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: #eef3f8;
    color: var(--muted);
    padding: 0 12px;
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.web-file-tab.active {
    background: var(--code-bg);
    color: var(--code-text);
}

.java-file-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.web-file-card {
    display: flex;
    min-height: 100%;
    flex-direction: column;
}

.java-file-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-strong);
    padding: 8px;
}

.java-file-name {
    max-width: 240px;
}

.java-file-code {
    min-height: 160px;
    flex: none;
}

.web-file-card .java-file-code {
    min-height: 300px;
    flex: 1;
}

.mini-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    padding: 0 12px;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.upload-button:hover {
    background: var(--panel-strong);
}

.upload-button input {
    display: none;
}

.asset-list {
    display: grid;
    gap: 8px;
    padding: 0 12px 12px;
}

.asset-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.submit-row {
    border-top: 1px solid var(--line);
    background: var(--panel-strong);
    padding: 12px;
}

.admin-section {
    margin-bottom: 16px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.faculty-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.stat-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
    padding: 14px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    color: var(--text);
    font-size: 1.55rem;
    line-height: 1;
}

.section-tabs {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(246, 247, 251, 0.94);
    padding: 8px;
    backdrop-filter: blur(8px);
}

.section-tabs a {
    min-height: 32px;
    border-radius: 8px;
    color: var(--text);
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
}

.section-tabs a:hover {
    background: var(--panel-strong);
}

.toolbar-form {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto auto;
    gap: 10px;
    align-items: end;
}

.user-accounts-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    border-top: 1px solid var(--line);
    background: #f8fafc;
}

.user-accounts-bulk-bar .bulk-select-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--text);
}

.user-accounts-bulk-bar .bulk-hint {
    margin: 0;
    margin-right: auto;
}

.user-accounts-bulk-bar button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.user-accounts-grid .bulk-check-col {
    width: 64px;
    text-align: center;
}

.hidden-form {
    display: none;
}

.table-wrap {
    width: 100%;
    overflow: auto;
    border-top: 1px solid var(--line);
    background: #ffffff;
    scrollbar-color: #a8b3c4 #eef2f7;
    scrollbar-width: thin;
}

.table-wrap::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.table-wrap::-webkit-scrollbar-track {
    background: #eef2f7;
}

.table-wrap::-webkit-scrollbar-thumb {
    border: 2px solid #eef2f7;
    border-radius: 999px;
    background: #a8b3c4;
}

.admin-section .table-wrap,
.project-review-list-pane .table-wrap,
.message-list-pane .table-wrap {
    max-height: min(68vh, 720px);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
    background: #ffffff;
    table-layout: auto;
}

.admin-section table {
    min-width: 1180px;
}

#users table,
#assessments table,
#account-logs table {
    min-width: 1360px;
}

.records-grid-wrap,
.user-accounts-pane .user-accounts-grid-wrap,
.assessment-records-pane .assessment-records-grid-wrap {
    max-height: min(52vh, 480px);
}

#assessment-records .assessment-records-grid,
.assessment-records-grid,
#user-accounts .user-accounts-grid,
.user-accounts-grid,
.records-grid {
    min-width: 920px;
}

.records-grid th,
.records-grid td,
.user-accounts-grid th,
.user-accounts-grid td,
.assessment-records-grid th,
.assessment-records-grid td {
    padding: 7px 10px;
    font-size: 0.82rem;
    white-space: nowrap;
    vertical-align: middle;
}

.records-grid td strong,
.user-accounts-grid td strong,
.assessment-records-grid td strong {
    display: block;
    font-size: 0.84rem;
    line-height: 1.25;
}

.records-grid .grid-sub,
.user-accounts-grid .grid-sub,
.assessment-records-grid .grid-sub {
    margin: 2px 0 0;
    font-size: 0.72rem;
    line-height: 1.2;
}

.records-grid .grid-ellipsis,
.user-accounts-grid .grid-ellipsis,
.assessment-records-grid .grid-ellipsis {
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

.records-grid td strong.grid-ellipsis,
.assessment-records-grid td strong.grid-ellipsis {
    display: block;
    max-width: 220px;
}

.records-grid .grid-datetime,
.user-accounts-grid .grid-datetime,
.assessment-records-grid .grid-datetime {
    font-size: 0.76rem;
    color: var(--muted);
}

.records-grid .role-chip,
.user-accounts-grid .role-chip {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f4f7fb;
    font-size: 0.72rem;
    font-weight: 700;
}

.records-grid .online-dot,
.user-accounts-grid .online-dot {
    padding: 2px 8px;
    font-size: 0.7rem;
}

.records-grid .table-actions,
.user-accounts-grid .table-actions,
.assessment-records-grid .table-actions {
    gap: 4px;
}

.records-grid .grid-feedback {
    display: inline-block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.76rem;
}

.records-grid .student-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 420px;
    max-height: 72px;
    overflow: auto;
    white-space: normal;
}

.user-edit-panel {
    border-top: 1px solid var(--line);
    background: #f8fafc;
}

.user-edit-panel .pane-header {
    background: #eef3f8;
}

.user-edit-grid {
    gap: 10px;
}

.user-edit-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}

.user-edit-meta p {
    margin: 0;
}

.assessment-records-pane .assessment-records-grid-wrap {
    max-height: min(52vh, 480px);
}

.assessment-edit-panel textarea {
    min-height: 88px;
}

.field-span {
    align-self: end;
}

.compact-table-wrap table,
.compact-table {
    min-width: 760px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
}

th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--panel-strong);
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
}

tbody tr:nth-child(even) {
    background: #fbfcfe;
}

tbody tr:hover {
    background: #eef8f6;
}

tr > form {
    display: contents;
}

td {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.4;
}

td p {
    margin: 4px 0 0;
}

td .badge {
    white-space: nowrap;
}

td input,
td select {
    width: 100%;
    min-width: 112px;
    height: 34px;
    border-color: #ced7e4;
    background: #ffffff;
    font-size: 0.86rem;
}

td input[type="checkbox"] {
    width: 18px;
    min-width: 18px;
    height: 18px;
}

td textarea {
    min-height: 62px;
    margin-top: 8px;
    min-width: 260px;
    border: 1px solid #ced7e4;
    border-radius: 8px;
    font-size: 0.84rem;
}

td > input + input,
td > select + input,
td > textarea + textarea,
td > input + textarea {
    margin-top: 8px;
}

table button,
table .nav-link {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.8rem;
}

table pre {
    box-shadow: none;
}

.compact-pre {
    max-width: 360px;
    max-height: 160px;
    overflow: auto;
    margin: 0;
    border-radius: 6px;
    padding: 8px;
    font-size: 0.78rem;
    white-space: pre-wrap;
}

.announcement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    padding: 16px;
}

.announcement-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.announcement-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 14px;
}

.announcement-card h2 {
    margin-bottom: 8px;
    font-size: 1rem;
}

.inline-chip-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 3px 6px 3px 0;
}

.mini-button {
    min-height: 28px;
    padding: 0 8px;
    font-size: 0.72rem;
}

.mini-review-form {
    display: grid;
    gap: 8px;
    min-width: 260px;
}

.mini-review-form input,
.mini-review-form textarea {
    width: 100%;
    min-width: 0;
}

.table-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    min-width: max-content;
}

.table-actions form,
.inline-form {
    margin: 0;
    display: inline-flex;
}

.filter-bar {
    border-bottom: 1px solid var(--line);
}

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

.table-actions button,
.table-actions .nav-link {
    white-space: nowrap;
}

.geo-cell {
    min-width: 220px;
}

.geo-cell strong {
    display: block;
    color: var(--text);
    font-size: 0.86rem;
}

.geo-cell p {
    font-size: 0.78rem;
    line-height: 1.35;
}

.danger-button {
    background: var(--danger);
}

.danger-button:hover {
    background: #8f1d14;
}

.ebook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.tutorial-hub {
    display: grid;
    gap: 16px;
}

.tutorial-hub-intro {
    padding: 20px;
}

.tutorial-hub-intro h2 {
    margin: 0 0 8px;
}

.tutorial-track-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.tutorial-track-card {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-top: 4px solid var(--tutorial-accent, var(--accent));
}

.tutorial-track-card h2 {
    margin: 0;
    font-size: 1.15rem;
}

.tutorial-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.tutorial-workspace {
    display: grid;
    gap: 12px;
}

.tutorial-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.tutorial-lang-switch select {
    min-width: 120px;
    padding: 6px 10px;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-weight: 700;
}

.tutorial-track-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #0f172a;
}

.tutorial-track-bar a {
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 8px 12px;
    border-radius: 6px;
}

.tutorial-track-bar a:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tutorial-track-bar a.active {
    background: #ffffff;
    color: #0f172a;
}

.tutorial-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.tutorial-toc {
    display: grid;
    gap: 2px;
    padding: 12px;
    max-height: calc(100vh - 180px);
    overflow: auto;
    position: sticky;
    top: 12px;
}

.tutorial-toc-group {
    margin: 12px 0 4px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tutorial-toc-group:first-child {
    margin-top: 0;
}

.tutorial-toc-link {
    display: block;
    padding: 8px 10px;
    border-left: 4px solid transparent;
    border-radius: 0 8px 8px 0;
    color: var(--text);
    text-decoration: none;
    font-size: 0.92rem;
}

.tutorial-toc-link:hover {
    background: #f1f5f9;
}

.tutorial-toc-link.active {
    background: #e2e8f0;
    border-left-color: var(--tutorial-accent, var(--accent));
    font-weight: 700;
}

.tutorial-content {
    padding: 22px;
    display: grid;
    gap: 12px;
}

.tutorial-content h2 {
    margin: 0;
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
}

.tutorial-summary {
    margin: 0;
    color: var(--muted);
    font-size: 1.02rem;
}

.tutorial-progress {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.tutorial-nav-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.tutorial-nav-bottom {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #d8dee8;
}

.tutorial-example {
    border: 1px solid #d8dee8;
    border-radius: 10px;
    overflow: hidden;
    background: #0b1220;
}

.tutorial-example-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px;
    background: #111827;
    color: #e5e7eb;
}

.tutorial-example-header .button-link {
    background: var(--tutorial-accent, var(--accent));
    color: #fff;
}

.tutorial-code {
    margin: 0;
    padding: 16px;
    overflow: auto;
    color: #e5e7eb;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92rem;
    line-height: 1.5;
    white-space: pre;
}

.tutorial-file-block {
    border-top: 1px solid #1f2937;
}

.tutorial-file-block strong {
    display: block;
    padding: 10px 14px 0;
    color: #93c5fd;
    font-size: 0.85rem;
}

.tutorial-tips {
    border: 1px solid #d8dee8;
    border-radius: 10px;
    background: #f8fafc;
    padding: 14px 16px;
}

.tutorial-tips h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.tutorial-tips ul {
    margin: 0;
    padding-left: 18px;
}

.tutorial-tips li + li {
    margin-top: 6px;
}

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

    .tutorial-toc {
        position: static;
        max-height: 260px;
    }
}

.ebook-card {
    display: grid;
    gap: 10px;
    padding: 18px;
}

.ebook-card h2 {
    font-size: 1.1rem;
}

.reader-body {
    overflow: auto;
}

.reader-shell {
    padding: 10px;
}

.reader-shell .workspace {
    max-width: 1680px;
}

.reader-topbar h1 {
    max-width: 980px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(1.15rem, 2vw, 1.65rem);
}

.reader-topbar {
    align-items: center;
    margin-bottom: 8px;
}

.reader-topbar .brand-logo {
    width: 48px;
    height: 48px;
}

.reader-topbar .eyebrow {
    font-size: 0.68rem;
}

.ebook-reader {
    height: calc(100vh - 82px);
    overflow: hidden;
}

.reader-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    padding: 10px 12px;
    backdrop-filter: blur(8px);
}

.reader-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    height: calc(100% - 96px);
    min-height: 0;
}

.reader-page-panel {
    min-width: 0;
    min-height: 0;
}

.reader-control-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.page-jump {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.page-jump input {
    width: 78px;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
}

.zoom-value {
    min-width: 54px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    color: var(--text);
    padding: 8px 10px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 800;
}

.flipbook-frame {
    position: relative;
    height: 100%;
    background:
        radial-gradient(circle at 50% 20px, rgba(255, 255, 255, 0.7), transparent 48%),
        linear-gradient(90deg, rgba(15, 23, 42, 0.08), transparent 16%, transparent 84%, rgba(15, 23, 42, 0.08)),
        #dfe5ee;
    perspective: 2400px;
    padding: 20px;
    overflow: auto;
    text-align: center;
    cursor: default;
    touch-action: pan-y;
}

.book-spread {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    transform-style: preserve-3d;
}

.book-spread.page-zoom-mode {
    grid-template-columns: minmax(0, 1fr);
    max-width: none;
}

.book-spread.page-zoom-mode::before {
    display: none;
}

.book-spread.page-zoom-mode.zoom-left .book-page-right,
.book-spread.page-zoom-mode.zoom-right .book-page-left {
    display: none;
}

.book-spread::before {
    content: "";
    position: absolute;
    z-index: 3;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 26px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.18), rgba(255, 255, 255, 0.45), rgba(15, 23, 42, 0.16));
    pointer-events: none;
}

.book-page {
    position: relative;
    min-width: 0;
    background: #ffffff;
    overflow: hidden;
    cursor: pointer;
}

.book-page-left {
    border-radius: 8px 0 0 8px;
    box-shadow: -18px 20px 40px rgba(15, 23, 42, 0.16);
}

.book-page-right {
    border-radius: 0 8px 8px 0;
    box-shadow: 18px 20px 40px rgba(15, 23, 42, 0.16);
}

.book-spread.page-zoom-mode .book-page {
    border-radius: 8px;
    box-shadow: 0 24px 54px rgba(15, 23, 42, 0.22);
    cursor: zoom-in;
}

.book-page.selected-page {
    outline: 3px solid rgba(22, 103, 95, 0.22);
    outline-offset: 4px;
}

.book-page::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.book-page-left::after {
    background: linear-gradient(90deg, transparent 82%, rgba(15, 23, 42, 0.14));
}

.book-page-right::after {
    background: linear-gradient(270deg, transparent 82%, rgba(15, 23, 42, 0.14));
}

.book-spread.page-zoom-mode .book-page::after {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.06), transparent 18%, transparent 82%, rgba(15, 23, 42, 0.06));
}

.book-page.blank-page {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.88), rgba(241, 245, 249, 0.98)),
        #ffffff;
}

.book-page.blank-page img {
    visibility: hidden;
}

.flipbook-frame img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: auto;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
    object-fit: contain;
    transform-origin: left center;
    transition: opacity 160ms ease;
    user-select: none;
}

.flipbook-frame.is-turning .book-page img {
    opacity: 0.9;
}

.ebook-page-underlay {
    position: absolute !important;
    z-index: 1 !important;
    max-width: none !important;
    opacity: 0;
    pointer-events: none;
    transform: none !important;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08) !important;
    transition: opacity 180ms ease;
}

.ebook-page-underlay.visible {
    opacity: 1;
}

.page-flip-sheet {
    position: absolute;
    z-index: 3;
    top: 20px;
    left: 50%;
    width: calc(100% - 40px);
    max-width: calc(100% - 40px);
    height: calc(100% - 40px);
    border-radius: 0 8px 8px 0;
    background-color: #ffffff;
    background-position: top center;
    background-repeat: no-repeat;
    background-size: contain;
    box-shadow: -18px 24px 54px rgba(15, 23, 42, 0.32), 18px 12px 34px rgba(15, 23, 42, 0.18);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) rotateY(0deg);
    transform-origin: left center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    --drag-shadow: 0.28;
    --fold-shadow: 0.22;
    --fold-width: 74px;
    will-change: transform, opacity;
}

.page-flip-sheet::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(var(--fold-angle, 90deg), transparent 0 calc(100% - var(--fold-width)), rgba(255, 255, 255, 0.55) calc(100% - 42px), rgba(15, 23, 42, 0.28) 100%),
        linear-gradient(var(--page-shade-angle, 100deg), rgba(15, 23, 42, 0.34), rgba(255, 255, 255, 0.1) 48%, rgba(15, 23, 42, 0.18));
    opacity: var(--drag-shadow, 0);
    mix-blend-mode: multiply;
}

.page-flip-sheet::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--fold-width);
    background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65) 36%, rgba(15, 23, 42, 0.26));
    opacity: var(--fold-shadow);
    filter: blur(0.2px);
}

.page-flip-sheet.drag-prev::before,
.page-flip-sheet.flip-prev::before {
    right: auto;
    left: 0;
    background:
        linear-gradient(270deg, transparent, rgba(255, 255, 255, 0.65) 36%, rgba(15, 23, 42, 0.26));
}

.page-flip-sheet.drag-next,
.page-flip-sheet.flip-next {
    border-radius: 0 8px 8px 0;
    --fold-angle: 90deg;
    --page-shade-angle: 100deg;
}

.page-flip-sheet.drag-prev,
.page-flip-sheet.flip-prev {
    border-radius: 8px 0 0 8px;
    --fold-angle: 270deg;
    --page-shade-angle: 80deg;
}

.page-flip-sheet.drag-prev::after,
.page-flip-sheet.flip-prev::after {
    background:
        linear-gradient(270deg, transparent 0 calc(100% - var(--fold-width)), rgba(255, 255, 255, 0.55) calc(100% - 42px), rgba(15, 23, 42, 0.28) 100%),
        linear-gradient(80deg, rgba(15, 23, 42, 0.34), rgba(255, 255, 255, 0.1) 48%, rgba(15, 23, 42, 0.18));
}

.page-flip-sheet.dragging {
    opacity: 1;
    transition: none;
}

.page-flip-sheet.snap-back {
    transition: transform 220ms ease-out, opacity 220ms ease-out;
}

.page-flip-sheet.flip-next {
    --fold-shadow: 0.42;
    --fold-width: 120px;
    animation: flipNextPage 620ms cubic-bezier(0.22, 0.72, 0.18, 1);
}

.page-flip-sheet.flip-prev {
    --fold-shadow: 0.42;
    --fold-width: 120px;
    animation: flipPrevPage 620ms cubic-bezier(0.22, 0.72, 0.18, 1);
}

.ebook-render-error {
    padding: 18px;
}

.compact-header {
    min-height: 42px;
    background: var(--panel-strong);
}

@keyframes flipNextPage {
    0% {
        opacity: 1;
        transform: translateX(-50%) rotateY(0deg) skewY(0deg) scaleX(1);
    }

    42% {
        opacity: 1;
        transform: translateX(calc(-50% - 18px)) rotateY(-94deg) skewY(-12deg) scaleX(0.95);
    }

    100% {
        opacity: 0;
        transform: translateX(calc(-50% - 44px)) rotateY(-174deg) skewY(-4deg) scaleX(0.91);
    }
}

@keyframes flipPrevPage {
    0% {
        opacity: 1;
        transform: translateX(-50%) rotateY(0deg) skewY(0deg) scaleX(1);
    }

    42% {
        opacity: 1;
        transform: translateX(calc(-50% + 18px)) rotateY(94deg) skewY(12deg) scaleX(0.95);
    }

    100% {
        opacity: 0;
        transform: translateX(calc(-50% + 44px)) rotateY(174deg) skewY(4deg) scaleX(0.91);
    }
}

@media (max-width: 920px) {
    .app-sidebar {
        position: static;
        width: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        box-shadow: none;
        padding: 12px;
    }

    .app-sidebar ~ .app-shell {
        padding-left: 12px;
    }

    .sidebar-brand {
        padding-bottom: 10px;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        overflow: visible;
    }

    .sidebar-collapsed .app-sidebar {
        position: fixed;
        width: 0;
        border-bottom: 0;
        padding: 0;
    }

    .sidebar-collapsed .app-sidebar ~ .app-shell {
        padding-left: 64px;
    }

    .sidebar-collapsed .sidebar-brand > div,
    .sidebar-collapsed .sidebar-brand .brand-logo,
    .sidebar-collapsed .sidebar-nav,
    .sidebar-collapsed .sidebar-footer span,
    .sidebar-collapsed .sidebar-footer small,
    .sidebar-collapsed .sidebar-logout {
        display: none;
    }

    .app-shell {
        padding: 12px;
    }

    .login-auth-shell {
        background:
            linear-gradient(180deg, rgba(246, 247, 251, 0.95), rgba(246, 247, 251, 0.9)),
            url("../img/coderkiosk.png") top 28px center / min(520px, 115vw) auto no-repeat,
            var(--bg);
        align-content: center;
    }

    .login-auth-shell .auth-panel {
        margin-top: 118px;
    }

    h1 {
        font-size: 1.65rem;
    }

    .topbar,
    .actions,
    .landing-nav {
        align-items: stretch;
        flex-direction: column;
    }

    .landing-nav-links {
        justify-content: flex-start;
    }

    .landing-shell {
        padding: 14px;
    }

    .landing-hero-simple {
        padding: 28px 0 18px;
    }

    .landing-highlights,
    .landing-hero,
    .feature-grid,
    .analytics-grid,
    .analytics-cards,
    .register-role-grid {
        grid-template-columns: 1fr;
    }

    .landing-hero {
        min-height: auto;
    }

    .brand-block {
        align-items: center;
    }

    .brand-logo,
    .topbar .brand-logo,
    .sidebar-brand .brand-logo {
        width: min(168px, 58vw);
        height: auto;
        max-height: 58px;
    }

    .brand-logo-wordmark {
        width: min(300px, 86vw);
        max-height: 82px;
    }

    .about-shell {
        background: transparent;
    }

    .about-page {
        padding-top: 8px;
    }

    .about-author-simple,
    .about-author {
        grid-template-columns: 1fr;
    }

    .author-logo {
        width: 110px;
        height: 110px;
    }

    .editor-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .category-programming .editor-grid,
    .category-network .editor-grid,
    .category-database .editor-grid,
    .category-mobile_web .editor-grid,
    .category-multimedia .editor-grid,
    .category-cyber .editor-grid,
    .category-data .editor-grid,
    .category-research .editor-grid,
    .category-calculus .editor-grid,
    .category-discrete_math .editor-grid,
    .category-algorithms .editor-grid,
    .category-automata .editor-grid,
    .category-ai_foundations .editor-grid,
    .category-blockchain .editor-grid,
    .category-ai .editor-grid,
    .category-tools .editor-grid {
        grid-template-columns: 1fr;
    }

    .pane-header,
    .pane-header-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .tutorial-toolbar,
    .toolbar-group {
        align-items: stretch;
        flex-wrap: wrap;
        justify-content: stretch;
    }

    .tutorial-toolbar .ghost {
        flex: 1 1 120px;
    }

    .code-example-field {
        min-width: 0;
    }

    .editor-toolbar,
    .toolbar-group {
        width: 100%;
    }

    .toolbar-group {
        justify-content: space-between;
    }

    .toolbar-group .ghost,
    .toolbar-group button {
        flex: 1;
    }

    .icon-button {
        width: auto;
    }

    .editor-pane {
        min-height: 0;
    }

    .code-editor-wrap {
        height: min(42vh, 380px);
        min-height: 280px;
    }

    .side-column {
        display: flex;
        flex-direction: column;
    }

    .output-pane {
        max-height: none;
        min-height: 240px;
    }

    .mastery-list {
        max-height: 220px;
    }

    .reader-body {
        overflow: auto;
    }

    .reader-topbar h1 {
        white-space: normal;
    }

    .ebook-reader {
        height: auto;
        min-height: 78vh;
        overflow: visible;
    }

    .reader-toolbar,
    .reader-control-group,
    .page-jump {
        align-items: stretch;
        flex-direction: column;
    }

    .reader-toolbar {
        position: static;
    }

    .reader-control-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-jump {
        gap: 6px;
    }

    .page-jump input {
        width: 100%;
    }

    .reader-main-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .reader-page-panel {
        border-bottom: 0;
    }

    .flipbook-frame {
        height: 72vh;
        padding: 10px;
    }

    .form-grid,
    .manage-grid,
    .messages-grid,
    .project-editor-grid,
    .project-review-grid,
    .project-review-meta,
    .project-review-output-grid,
    .project-review-feedback-grid,
    .dashboard-grid,
    .toolbar-form,
    .tool-form-grid,
    .prompt-builder-grid,
    .prompt-builder-grid.two-column,
    .stats-grid,
    .survey-scale-grid,
    .research-title-grid,
    .survey-visual-scale,
    .sentiment-grid {
        grid-template-columns: 1fr;
    }

    .list-item {
        align-items: stretch;
        flex-direction: column;
    }

    .table-wrap {
        max-height: 68vh;
        border: 1px solid var(--line);
        border-radius: 8px;
    }

    table,
    .admin-section table,
    #users table,
    #assessments table,
    #user-accounts table,
    #user-accounts .user-accounts-grid,
    #assessment-records table,
    #assessment-records .assessment-records-grid,
    #account-logs table,
    .compact-table-wrap table,
    .compact-table {
        min-width: 860px;
    }

    .user-accounts-pane .user-accounts-grid-wrap,
    .assessment-records-pane .assessment-records-grid-wrap,
    .records-grid-wrap {
        max-height: min(58vh, 420px);
    }

    .user-accounts-grid .grid-ellipsis,
    .assessment-records-grid .grid-ellipsis,
    .records-grid .grid-ellipsis {
        max-width: 140px;
    }

    th,
    td {
        padding: 9px 10px;
    }

    td input,
    td select {
        min-width: 104px;
    }

    .project-editor-form {
        min-height: auto;
    }

    .project-code-textarea {
        min-height: 280px;
    }

    .message-stats {
        grid-template-columns: 1fr;
    }

    .message-compose-pane,
    .message-list-pane,
    .message-thread-pane {
        min-height: auto;
        max-height: none;
    }

    .message-thread .conversation-message {
        max-width: 100%;
    }
}

/* Explain Code modal */
.explain-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 18px;
}

.explain-modal[hidden] {
    display: none !important;
}

.explain-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.explain-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: min(88vh, 920px);
    display: flex;
    flex-direction: column;
    background: #f4f8f7;
    border: 1px solid #cfe0db;
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
    overflow: hidden;
}

.explain-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
    background: #ffffff;
    border-bottom: 1px solid #d7e5e1;
}

.explain-modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.explain-lang-field {
    margin: 0;
}

.explain-lang-field span {
    font-size: 0.72rem;
}

.explain-modal-kicker {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.explain-modal-header h2 {
    margin: 0;
    font-size: 1.28rem;
    line-height: 1.25;
    color: #0f2f2a;
}

.explain-modal-close {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    font-size: 1.45rem;
    line-height: 1;
}

.explain-modal-body {
    overflow: auto;
    padding: 16px 18px 22px;
    -webkit-overflow-scrolling: touch;
}

.explain-wrap {
    display: grid;
    gap: 14px;
}

.explain-hero {
    background: #ffffff;
    border: 1px solid #d7e5e1;
    border-radius: 14px;
    padding: 16px 18px;
}

.explain-hero h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: #0f2f2a;
}

.explain-intro {
    margin: 0;
    color: #475569;
    font-size: 0.98rem;
    line-height: 1.6;
}

.explain-tip {
    margin-top: 12px;
    padding: 11px 13px;
    border-radius: 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 0.94rem;
    line-height: 1.5;
}

.explain-steps {
    display: grid;
    gap: 10px;
}

.explain-step {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #94a3b8;
    border-radius: 14px;
    padding: 12px 14px;
}

.explain-step.explain-entry { border-left-color: #0f766e; }
.explain-step.explain-io { border-left-color: #2563eb; }
.explain-step.explain-decision { border-left-color: #d97706; }
.explain-step.explain-loop { border-left-color: #0e7490; }
.explain-step.explain-comment,
.explain-step.explain-blank {
    border-left-color: #cbd5e1;
    background: #f8fafc;
}

.explain-num {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #0f766e;
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
}

.explain-blank .explain-num,
.explain-comment .explain-num {
    background: #64748b;
}

.explain-body {
    min-width: 0;
    display: grid;
    gap: 8px;
}

@media (min-width: 760px) {
    .explain-body {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
        gap: 14px;
        align-items: start;
    }
}

.explain-code {
    margin: 0;
    padding: 11px 12px;
    border-radius: 10px;
    background: #0b1220;
    color: #e2e8f0;
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.explain-empty {
    color: #94a3b8;
    font-style: italic;
}

.explain-note {
    margin: 0;
    color: #334155;
    font-size: 0.98rem;
    line-height: 1.55;
}

.explain-blank-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.9rem;
}

.explain-blank-row span:first-child {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 28px;
    border-radius: 999px;
    background: #cbd5e1;
    color: #334155;
    font-weight: 700;
    font-size: 0.8rem;
}

body.explain-modal-open {
    overflow: hidden;
}

.workspace-panel .tool-guide {
    max-height: min(48vh, 460px);
}

.workspace-panel .learning-menu-panel-actions {
    border-top: 1px solid var(--line);
}

.learning-menu-card {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.learning-menu-card > p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.learning-menu-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.learning-menu-actions > button:first-child {
    flex: 1 1 100%;
}

.learning-menu-dialog {
    width: min(860px, 100%);
    max-height: min(86vh, 840px);
}

.learning-menu-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #d7e5e1;
    background: #ffffff;
}

.learning-menu-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #d0ddd9;
    border-radius: 999px;
    background: #f4f8f7;
    color: #334155;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
}

.learning-menu-tab .badge {
    margin: 0;
}

.learning-menu-tab.is-active {
    border-color: var(--accent);
    background: #dff3ef;
    color: var(--accent-strong);
}

.learning-menu-panels {
    min-height: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}

.learning-menu-panel {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}

.learning-menu-panel.is-active {
    display: flex;
}

.learning-menu-panel .tool-guide {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.learning-menu-panel-actions {
    background: #ffffff;
}

.learning-menu-modal .mastery-list {
    max-height: min(48vh, 420px);
}

@media (max-width: 640px) {
    .explain-modal {
        padding: 0;
        place-items: stretch;
    }

    .explain-modal-dialog {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .learning-menu-tab {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
    }
}

/* Proctored Quiz / Exam */
.proctor-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 10px 16px;
    background: #7f1d1d;
    color: #fff7ed;
    border-bottom: 1px solid #991b1b;
    font-size: 0.9rem;
}

.proctor-banner strong {
    font-weight: 800;
}

.proctor-count {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-weight: 700;
}

.proctor-modal,
.proctor-warning {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.62);
}

.proctor-modal[hidden],
.proctor-warning[hidden] {
    display: none !important;
}

.proctor-modal-card,
.proctor-warning-card {
    width: min(620px, 100%);
    display: grid;
    gap: 12px;
    padding: 22px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #fecaca;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.proctor-warning-card {
    border-color: #f87171;
    background: #fff7f7;
}

.proctor-kicker {
    margin: 0;
    color: #b91c1c;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.proctor-modal-card h2,
.proctor-warning-card strong {
    margin: 0;
    color: #7f1d1d;
}

.proctor-rules {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
    color: #334155;
    line-height: 1.5;
}

.proctor-ack-row {
    align-items: flex-start;
}

.proctor-modal-card button,
.proctor-warning-card button {
    justify-self: start;
}

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

body.proctor-hide-nav .app-sidebar,
body.proctor-hide-nav .sidebar-toggle {
    display: none !important;
}

body.proctor-hide-nav .app-sidebar ~ .app-shell,
body.proctor-hide-nav .app-shell {
    padding-left: 0 !important;
}

body.proctor-hide-nav .topbar .actions .nav-link {
    display: none !important;
}

.anti-cheat-box {
    margin-top: 12px;
}

.anti-cheat-options {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    padding-left: 4px;
}

.attempt-timer {
    font-variant-numeric: tabular-nums;
}

.score-comment-list {
    margin: 8px 0 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 6px;
}

.score-comment-list li {
    line-height: 1.45;
}

.code-preview {
    max-height: 320px;
    overflow: auto;
    margin: 0;
    padding: 12px 16px;
    white-space: pre-wrap;
}

.create-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    padding: 16px;
}

.create-hub-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid #d7e3e0;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f4faf8 100%);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.create-hub-card:hover {
    transform: translateY(-2px);
    border-color: #0f766e;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.12);
}

.create-hub-card strong {
    font-size: 1.05rem;
    color: #0f766e;
}

.create-hub-card p {
    margin: 0;
    color: #475569;
    line-height: 1.45;
}

.due-hub {
    display: grid;
    gap: 18px;
    padding: 12px 16px 16px;
}

.due-bucket-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.due-bucket-header h3 {
    margin: 0;
    font-size: 1rem;
}

.proctor-timeline {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    max-height: 260px;
    overflow: auto;
    padding: 10px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fff7f7;
}

.proctor-timeline-item {
    display: grid;
    gap: 2px;
    padding-bottom: 8px;
    border-bottom: 1px solid #fee2e2;
}

.proctor-timeline-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.proctor-timeline-item strong {
    color: #7f1d1d;
}

.proctor-timeline-meta {
    color: #64748b;
    font-size: 0.82rem;
}

.proctor-events-cell details summary {
    cursor: pointer;
    color: #0f766e;
    font-weight: 700;
}

.sortable-th {
    white-space: nowrap;
}

.sortable-th .sort-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
    font-weight: 700;
}

.sortable-th .sort-link:hover {
    color: var(--accent);
}

.sortable-th.is-sorted .sort-link {
    color: var(--accent-strong);
}

.sortable-th .sort-indicator {
    font-size: 0.72rem;
    line-height: 1;
    opacity: 0.9;
}

.sort-hint {
    margin: 0;
    padding-top: 0;
}

/* Theme Settings (Admin) */
.theme-settings {
    display: grid;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
}

.theme-settings h3 {
    margin: 0;
    font-size: 1rem;
}

.theme-option-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.signup-approve-grid {
    margin-bottom: 16px;
}

.mail-test-form {
    border-top: 1px solid var(--line);
    margin-top: 4px;
}

.smtp-guide {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--panel-strong) 70%, var(--panel));
    padding: 12px 14px;
}

.smtp-guide summary {
    cursor: pointer;
    font-weight: 800;
}

.smtp-example-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.smtp-example {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    padding: 12px;
}

.smtp-example h4 {
    margin: 0 0 8px;
}

.smtp-example dl {
    display: grid;
    gap: 4px;
    margin: 0 0 8px;
}

.smtp-example dl div {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
}

.smtp-example dt {
    color: var(--muted);
    font-size: 0.78rem;
}

.smtp-example dd {
    margin: 0;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.84rem;
}

@media (max-width: 800px) {
    .smtp-example-grid {
        grid-template-columns: 1fr;
    }
}

.auto-approval-filters {
    display: grid;
    grid-template-columns: 180px minmax(220px, 1fr) auto auto;
    gap: 10px;
    align-items: end;
}

@media (max-width: 800px) {
    .auto-approval-filters {
        grid-template-columns: 1fr;
    }
}

.theme-option {
    position: relative;
    display: grid;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-strong);
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.theme-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-option strong {
    font-size: 0.95rem;
}

.theme-option small {
    color: var(--muted);
    line-height: 1.35;
}

.theme-option.is-selected,
.theme-option:has(input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}

.theme-swatch {
    display: block;
    height: 42px;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.theme-swatch-light {
    background: linear-gradient(135deg, #f6f7fb 40%, #ffffff 40%, #ffffff 70%, #16675f 70%);
}

.theme-swatch-dark {
    background: linear-gradient(135deg, #0f1419 40%, #1a222d 40%, #1a222d 70%, #3db8a8 70%);
}

.theme-swatch-gray {
    background: linear-gradient(135deg, #e8eaed 40%, #f3f4f6 40%, #f3f4f6 70%, #4b5563 70%);
}

.theme-swatch-ocean {
    background: linear-gradient(135deg, #e8f3f8 40%, #ffffff 40%, #ffffff 70%, #0b6e99 70%);
}

.theme-swatch-forest {
    background: linear-gradient(135deg, #eaf3ea 40%, #ffffff 40%, #ffffff 70%, #2f6b3a 70%);
}

.theme-swatch-coffee {
    background: linear-gradient(135deg, #f3ebe3 40%, #fffaf6 40%, #fffaf6 70%, #8a5a2b 70%);
}

.theme-swatch-midnight {
    background: linear-gradient(135deg, #070b1a 40%, #121a33 40%, #121a33 70%, #5b8cff 70%);
}

.theme-swatch-slate {
    background: linear-gradient(135deg, #e6ebf1 40%, #f7f9fc 40%, #f7f9fc 70%, #475569 70%);
}

.theme-swatch-coral {
    background: linear-gradient(135deg, #fff1ec 40%, #fffaf8 40%, #fffaf8 70%, #d4573c 70%);
}

html[data-theme="dark"] .app-sidebar,
html[data-theme="midnight"] .app-sidebar {
    box-shadow: 12px 0 35px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="midnight"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="midnight"] select,
html[data-theme="midnight"] textarea,
html[data-theme="ocean"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="ocean"] select,
html[data-theme="ocean"] textarea,
html[data-theme="forest"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="forest"] select,
html[data-theme="forest"] textarea,
html[data-theme="coffee"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="coffee"] select,
html[data-theme="coffee"] textarea,
html[data-theme="slate"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="slate"] select,
html[data-theme="slate"] textarea,
html[data-theme="coral"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="coral"] select,
html[data-theme="coral"] textarea,
html[data-theme="gray"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="gray"] select,
html[data-theme="gray"] textarea {
    background: var(--panel);
    color: var(--text);
    border-color: var(--line);
}

html[data-theme="dark"] .resource-link,
html[data-theme="gray"] .resource-link,
html[data-theme="ocean"] .resource-link,
html[data-theme="forest"] .resource-link,
html[data-theme="coffee"] .resource-link,
html[data-theme="midnight"] .resource-link,
html[data-theme="slate"] .resource-link,
html[data-theme="coral"] .resource-link,
html[data-theme="dark"] .profile-photo,
html[data-theme="gray"] .profile-photo,
html[data-theme="ocean"] .profile-photo,
html[data-theme="forest"] .profile-photo,
html[data-theme="coffee"] .profile-photo,
html[data-theme="midnight"] .profile-photo,
html[data-theme="slate"] .profile-photo,
html[data-theme="coral"] .profile-photo {
    background: var(--panel);
}

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

.pane-subtitle {
    margin: 4px 0 0;
    font-size: 0.9rem;
}

.form-hint {
    margin: 0 0 8px;
    font-size: 0.88rem;
}

.roster-section {
    border-top: 1px solid var(--line);
    padding: 14px 16px 18px;
}

/* Shared compact workspace pattern (classroom-style) */
.workspace-tools,
.classroom-tools {
    overflow: visible;
}

.workspace-tools-summary,
.classroom-tools-summary {
    cursor: pointer;
    list-style: none;
}

.workspace-tools-summary::-webkit-details-marker,
.classroom-tools-summary::-webkit-details-marker {
    display: none;
}

.workspace-tools-summary h2,
.classroom-tools-summary h2 {
    margin: 0;
    font-size: 1rem;
}

.workspace-tools[open] .workspace-tools-summary,
.classroom-tools[open] .classroom-tools-summary {
    border-bottom: 1px solid var(--line);
}

.workspace-tools-grid,
.classroom-tools-grid {
    margin: 0;
    border: 0;
    box-shadow: none;
}

.workspace-tool-block h3,
.classroom-tool-block h3 {
    margin: 0;
    padding: 12px 16px 0;
    font-size: 0.95rem;
}

.workspace-layout,
.classroom-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.workspace-layout.wide-list {
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
}

.workspace-list,
.classroom-section-list {
    max-height: min(78vh, 820px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.workspace-list-search,
.classroom-section-search {
    border-bottom: 1px solid var(--line);
    margin: 0;
}

.workspace-nav,
.classroom-section-nav {
    display: grid;
    gap: 6px;
    padding: 10px;
    overflow: auto;
    flex: 1 1 auto;
    max-height: calc(min(78vh, 820px) - 110px);
}

.workspace-item,
.classroom-section-item {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-strong);
    color: inherit;
    text-decoration: none;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease;
}

button.workspace-item {
    width: 100%;
    font: inherit;
    cursor: pointer;
}

.workspace-item:hover,
.classroom-section-item:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.workspace-item.is-active,
.classroom-section-item.is-active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, var(--panel));
}

.workspace-item strong,
.classroom-section-item strong {
    font-size: 0.95rem;
    color: var(--text);
}

.workspace-item .muted,
.classroom-section-item .muted {
    font-size: 0.78rem;
    margin: 0;
}

.classroom-section-code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    color: var(--accent-strong);
}

.workspace-detail,
.classroom-section-detail {
    min-height: 360px;
    max-height: min(78vh, 820px);
    overflow: auto;
}

.workspace-detail-toolbar,
.classroom-detail-toolbar {
    display: grid;
    gap: 12px;
    border-bottom: 1px solid var(--line);
}

.classroom-detail-toolbar .class-limit-form {
    margin: 0;
}

.workspace-scroll,
.classroom-roster-wrap,
.compact-records-wrap {
    max-height: min(56vh, 560px);
    overflow: auto;
}

.workspace-scroll.tall {
    max-height: min(68vh, 720px);
}

.workspace-editor-scroll {
    max-height: min(70vh, 780px);
    overflow: auto;
}

.workspace-stats-compact.dashboard-grid {
    margin-bottom: 12px;
}

.workspace-hub-compact .create-hub-grid {
    gap: 10px;
}

.workspace-hub-compact .create-hub-card {
    padding: 12px 14px;
}

.workspace-hub-compact .create-hub-card p {
    margin: 4px 0;
    font-size: 0.86rem;
}

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

.workspace-class-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    max-height: 88px;
    overflow: auto;
}

.workspace-class-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-strong);
    color: inherit;
    text-decoration: none;
    font-size: 0.78rem;
    line-height: 1.2;
    white-space: nowrap;
}

.workspace-class-chip:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.workspace-class-chip.is-active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, var(--panel));
    color: var(--text);
    font-weight: 600;
}

.workspace-class-chip .muted {
    font-size: 0.72rem;
    opacity: 0.85;
}

.workspace-class-group {
    display: grid;
    gap: 6px;
}

.workspace-class-heading {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 4px 0 0;
    padding: 6px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted, #6b7280);
    background: color-mix(in srgb, var(--panel) 92%, var(--accent) 8%);
    border-radius: 6px;
}

.workspace-class-heading:first-child {
    margin-top: 0;
}

@media (max-width: 960px) {
    .workspace-layout,
    .classroom-layout,
    .workspace-layout.wide-list {
        grid-template-columns: 1fr;
    }

    .workspace-list,
    .classroom-section-list {
        max-height: none;
    }

    .workspace-nav,
    .classroom-section-nav {
        max-height: 240px;
    }

    .workspace-detail,
    .classroom-section-detail {
        max-height: none;
    }
}

.roster-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 12px;
}

.roster-section-head h3 {
    margin: 0 0 4px;
    font-size: 1.05rem;
}

.roster-section-head .muted {
    margin: 0;
}

.class-limit-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 8px 12px;
    margin: 0 0 12px;
}

.class-limit-form .field {
    min-width: 140px;
    margin: 0;
}

.class-limit-form .muted {
    flex: 1 1 220px;
    margin: 0;
    font-size: 0.82rem;
}

.class-code-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 8px 12px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 88%, var(--accent, #0d9488) 12%);
}

.class-code-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.class-code-value {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text);
}

.class-code-input {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: ui-monospace, Consolas, monospace;
    font-weight: 600;
}

.roster-contact {
    color: var(--accent, #0d9488);
    text-decoration: none;
    word-break: break-all;
}

.roster-contact:hover {
    text-decoration: underline;
}

.simple-steps {
    margin: 0;
    padding-left: 1.2rem;
    line-height: 1.55;
}

.simple-steps li + li {
    margin-top: 8px;
}

.empty-state {
    text-align: left;
    max-width: 36rem;
}

.empty-state h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    color: var(--text);
}

.empty-state p {
    margin: 0;
}

.empty-state.compact {
    padding: 8px 0;
}

.search-records-filters {
    align-items: end;
}

.search-records-pane .search-records-sticky {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.messages-layout .message-list-pane,
.messages-layout .message-thread-pane {
    min-height: auto;
    max-height: none;
}

.project-browse-filters {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(120px, 1fr)) auto;
    gap: 10px;
    align-items: end;
    border-bottom: 1px solid var(--line);
}

.project-browse-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.project-view-panel {
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.project-view-panel .project-code-textarea {
    min-height: 360px;
    width: 100%;
}

.all-projects-hub .hub-hero {
    margin-bottom: 8px;
}

.all-projects-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.all-projects-toolbar .hub-search {
    flex: 1 1 220px;
    min-width: 180px;
}

.all-projects-toolbar .hub-select-field select {
    min-width: 160px;
    border: 1px solid color-mix(in srgb, var(--hub-line, #d7e0dc) 90%, transparent);
    border-radius: 999px;
    padding: 8px 12px;
    font: inherit;
    background: #fff;
}

.all-projects-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
}

.all-projects-layout.has-detail {
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr);
}

.all-projects-list .hub-card-grid {
    max-height: calc(100vh - 280px);
    overflow: auto;
    padding-right: 4px;
}

.all-projects-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.all-projects-detail {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 24px);
    overflow: auto;
}

.all-projects-detail.is-placeholder {
    display: none;
}

.all-projects-detail .hub-panel-head {
    margin-bottom: 12px;
}

.all-projects-detail .project-review-meta {
    margin-bottom: 12px;
}

.all-projects-code {
    margin: 12px 0;
    border: 1px solid color-mix(in srgb, var(--hub-line, #d7e0dc) 85%, transparent);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
}

.all-projects-code summary {
    cursor: pointer;
    font-weight: 800;
    margin-bottom: 8px;
}

.all-projects-code .project-code-textarea {
    min-height: 220px;
    width: 100%;
}

.all-projects-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

@media (min-width: 981px) {
    .all-projects-layout:not(.has-detail) .all-projects-detail.is-placeholder {
        display: block;
        opacity: 0.85;
    }
}

@media (max-width: 980px) {
    .all-projects-layout.has-detail {
        grid-template-columns: 1fr;
    }

    .all-projects-list .hub-card-grid {
        max-height: none;
    }

    .all-projects-detail {
        position: static;
        max-height: none;
    }
}

@media (max-width: 1000px) {
    .project-browse-filters {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .project-browse-filters {
        grid-template-columns: 1fr;
    }
}

/* Utility tools: less "IDE / programming" feel */
body.utility-workspace .editor-pane {
    background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 88%, var(--accent) 12%), var(--panel));
}

body.utility-workspace .editor-pane > .pane-header h2 {
    font-size: 1rem;
}

body.utility-workspace.network-utility-mode .editor-toolbar .tutorial-toolbar,
body.utility-workspace.network-utility-mode .editor-toolbar .code-example-field,
body.utility-workspace.network-utility-mode #codeZoomOutButton,
body.utility-workspace.network-utility-mode #codeZoomInButton {
    display: none;
}

body.network-utility-mode .editor-grid {
    grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
}

.network-utility-panel {
    display: grid;
    gap: 16px;
    flex: 1;
    overflow: auto;
    padding: 16px 18px 20px;
    background:
        radial-gradient(1200px 280px at 0% 0%, color-mix(in srgb, #38bdf8 22%, transparent), transparent 60%),
        linear-gradient(180deg, #f0f9ff, #ffffff 42%);
}

.network-utility-panel .net-hero {
    display: grid;
    gap: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid #bae6fd;
}

.network-utility-panel .net-eyebrow {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0369a1;
    font-weight: 700;
}

.network-utility-panel .net-hero h3 {
    margin: 0;
    font-size: 1.35rem;
    color: #0c4a6e;
}

.network-utility-panel .net-hero .muted {
    margin: 0;
    max-width: 42rem;
}

.net-tool-form {
    display: grid;
    gap: 12px;
}

.net-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.net-perm-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.net-perm-group {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    background: #fff;
}

.net-perm-group strong {
    color: #0c4a6e;
    font-size: 0.9rem;
}

.net-terminal-input {
    font-family: ui-monospace, Consolas, monospace;
    background: #0c4a6e !important;
    color: #e0f2fe !important;
    border-color: #075985 !important;
}

.network-utility-panel input[type="range"] {
    width: 100%;
    accent-color: #0284c7;
}

.network-utility-panel .tool-note code {
    font-size: 0.85em;
}

@media (max-width: 800px) {
    .search-records-filters {
        grid-template-columns: 1fr;
    }

    .roster-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .class-code-box {
        width: 100%;
    }

    .class-limit-form {
        flex-direction: column;
        align-items: stretch;
    }

    .class-limit-form .field {
        min-width: 0;
        width: 100%;
    }

    .roster-table th:nth-child(3),
    .roster-table td:nth-child(3) {
        display: none;
    }

    .net-form-grid,
    .net-perm-grid,
    body.network-utility-mode .editor-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Student Hub (Phase 1 ? E//DATA-inspired) ===== */
.hub-page {
    --hub-ink: #0f2f2c;
    --hub-mint: #e7f3f0;
    --hub-mint-strong: #d5ebe6;
    --hub-line: color-mix(in srgb, var(--accent) 18%, #d7e0dc);
    font-family: Manrope, ui-sans-serif, system-ui, sans-serif;
    color: var(--hub-ink);
    background:
        radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 42%),
        radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 36%),
        linear-gradient(180deg, #f7fbfa 0%, var(--bg) 48%, var(--bg) 100%);
    border-radius: 18px;
    padding: 18px 18px 28px;
}

.hub-page h1,
.hub-page h2,
.hub-page h3,
.hub-brand,
.hub-headline {
    font-family: Fraunces, Georgia, serif;
    letter-spacing: -0.02em;
}

.hub-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.hub-megamenu {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hub-menu {
    position: relative;
}

.hub-menu > summary {
    list-style: none;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--hub-ink);
}

.hub-menu > summary::-webkit-details-marker {
    display: none;
}

.hub-menu > summary::after {
    content: " ?";
    font-size: 0.75em;
    opacity: 0.7;
}

.hub-menu[open] > summary {
    background: var(--hub-mint);
    border-color: color-mix(in srgb, var(--accent) 25%, transparent);
}

.hub-menu[open] > summary::after {
    content: " ?";
}

.hub-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    min-width: 200px;
    display: grid;
    gap: 2px;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid var(--hub-line);
    background: #fff;
    box-shadow: 0 14px 36px rgba(15, 47, 44, 0.12);
}

.hub-menu-panel a {
    padding: 10px 12px;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.hub-menu-panel a:hover {
    background: var(--hub-mint);
}

.hub-topbar-actions {
    display: flex;
    gap: 14px;
}

.hub-ghost-link {
    color: var(--accent-strong);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
}

.hub-hero {
    max-width: 720px;
    padding: 8px 4px 8px;
    margin-bottom: 18px;
}

.hub-kicker {
    margin: 0 0 8px;
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hub-brand {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    line-height: 0.95;
    color: var(--hub-ink);
}

.hub-headline {
    margin: 10px 0 0;
    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 650;
    color: var(--hub-ink);
}

.hub-headline em {
    font-style: italic;
    color: var(--accent-strong);
    font-weight: 700;
}

.hub-lead {
    margin: 12px 0 0;
    max-width: 46ch;
    color: color-mix(in srgb, var(--hub-ink) 72%, #6b7280);
    font-size: 1.02rem;
    line-height: 1.55;
}

.hub-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.hub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.92rem;
    line-height: 1;
}

.hub-btn.primary {
    background: var(--accent-strong);
    color: #fff;
}

.hub-btn.secondary {
    background: #fff;
    color: var(--accent-strong);
    border-color: color-mix(in srgb, var(--accent) 35%, #c9d5d1);
}

.hub-btn.compact {
    padding: 10px 14px;
    font-size: 0.84rem;
    align-self: start;
}

.hub-path {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 20px;
}

.hub-path-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid var(--hub-line);
    background: #fff;
    color: var(--hub-ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.hub-path-pill:hover {
    border-color: var(--accent);
    background: var(--hub-mint);
    transform: translateY(-1px);
}

.hub-path-pill span {
    opacity: 0.55;
}

.hub-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}

.hub-metric {
    background: #fff;
    border: 1px solid var(--hub-line);
    border-radius: 16px;
    padding: 14px 12px;
    text-align: left;
}

.hub-metric strong {
    display: block;
    font-family: Fraunces, Georgia, serif;
    font-size: 1.55rem;
    line-height: 1;
    color: var(--hub-ink);
}

.hub-metric span {
    display: block;
    margin-top: 8px;
    color: color-mix(in srgb, var(--hub-ink) 55%, #6b7280);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hub-section {
    margin-bottom: 22px;
}

.hub-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.hub-section-head h2,
.hub-panel-head h2 {
    margin: 0;
    font-size: 1.7rem;
}

.hub-section-copy {
    margin: 6px 0 0;
    max-width: 52ch;
    color: color-mix(in srgb, var(--hub-ink) 65%, #6b7280);
}

.hub-toolbar {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.hub-search input {
    width: 100%;
    border: 1px solid var(--hub-line);
    border-radius: 14px;
    background: #fff;
    padding: 12px 14px;
    font: inherit;
}

.hub-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hub-chip {
    border: 1px solid var(--hub-line);
    background: #fff;
    color: var(--hub-ink);
    border-radius: 999px;
    padding: 8px 12px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.hub-chip.is-active {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    color: #fff;
}

.hub-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.hub-work-card {
    display: grid;
    gap: 8px;
    align-content: start;
    background: #fff;
    border: 1px solid var(--hub-line);
    border-radius: 18px;
    padding: 16px;
    min-height: 210px;
}

.hub-work-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.hub-work-index,
.hub-work-cat,
.hub-work-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hub-work-index {
    background: var(--hub-mint-strong);
    color: var(--accent-strong);
}

.hub-work-cat {
    background: #eef2f7;
    color: #334155;
}

.hub-work-status.status-open,
.hub-work-status.status-due_soon {
    background: color-mix(in srgb, var(--accent) 18%, #fff);
    color: var(--accent-strong);
}

.hub-work-status.status-submitted {
    background: #e8f5e9;
    color: #1b5e20;
}

.hub-work-status.status-missing {
    background: #fdecea;
    color: #b42318;
}

.hub-work-card h3 {
    margin: 2px 0 0;
    font-size: 1.15rem;
    line-height: 1.25;
}

.hub-work-card .muted {
    margin: 0;
    font-size: 0.86rem;
}

.hub-work-score {
    margin: 0;
    font-weight: 800;
    font-size: 0.92rem;
}

.hub-empty {
    background: #fff;
    border: 1px dashed var(--hub-line);
    border-radius: 18px;
    padding: 28px 22px;
    text-align: left;
}

.hub-empty h3 {
    margin: 0 0 8px;
    font-size: 1.4rem;
}

.hub-secondary-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 14px;
}

.hub-panel {
    background: #fff;
    border: 1px solid var(--hub-line);
    border-radius: 18px;
    padding: 16px;
}

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

.hub-announce-list,
.hub-progress-list {
    display: grid;
    gap: 10px;
}

.hub-announce-item,
.hub-progress-item {
    border: 1px solid var(--hub-line);
    border-radius: 14px;
    padding: 12px;
    background: #fbfdfc;
}

.hub-announce-item h3,
.hub-progress-item strong {
    margin: 0 0 4px;
    font-size: 1rem;
}

.hub-announce-item p {
    margin: 0;
    font-size: 0.9rem;
    color: color-mix(in srgb, var(--hub-ink) 70%, #6b7280);
}

.hub-progress-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.hub-progress-side {
    display: grid;
    gap: 4px;
    justify-items: end;
    text-align: right;
}

.hub-filter-empty {
    margin: 12px 0 0;
}

@media (max-width: 1100px) {
    .hub-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 860px) {
    .hub-secondary-grid {
        grid-template-columns: 1fr;
    }

    .hub-card-grid,
    .hub-metrics {
        grid-template-columns: 1fr;
    }

    .hub-page {
        padding: 12px;
    }
}

.hub-link-card {
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.hub-link-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 47, 44, 0.1);
}

.hub-work-card.hub-link-card.is-active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, #fff);
}

.hub-create-grid {
    margin-bottom: 8px;
}

.hub-tools {
    margin: 14px 0;
}

.hub-records-panel {
    margin-top: 8px;
}

.hub-analytics {
    margin-top: 8px;
}

.hub-metric a {
    color: inherit;
    text-decoration: none;
}

.hub-page .analytics-cards {
    padding: 0 4px 8px;
}

.hub-page .chart-panel {
    margin-bottom: 8px;
}

.hub-path-pill.is-active {
    background: var(--hub-mint, #e7f3f0);
    border-color: var(--accent);
    color: var(--accent-strong);
    font-weight: 800;
}

.hub-classwork-path {
    margin-bottom: 16px;
}

.hub-page .hub-toolbar {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.hub-page .workspace-class-filters.hub-filter-chips {
    border-bottom: 0;
    max-height: none;
    padding: 0;
}

.hub-page .workspace-class-chip.hub-chip {
    border-radius: 999px;
}

.hub-page .hub-panel + .hub-panel,
.hub-page .hub-card-grid + .hub-panel {
    margin-top: 14px;
}

.hub-page .hub-hero {
    margin-bottom: 12px;
}

.hub-page .hub-brand {
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
}

.hub-tutorial-card {
    border-top: 4px solid var(--tutorial-accent, var(--accent));
}

.tutorial-workspace.hub-page {
    gap: 14px;
}

.tutorial-workspace.hub-page .hub-topbar {
    align-items: flex-start;
}

.tutorial-workspace.hub-page .hub-topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tutorial-workspace.hub-page .hub-topbar-brand .hub-headline {
    margin: 0;
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
}

.tutorial-workspace.hub-page .tutorial-track-bar.hub-filter-chips {
    background: transparent;
    padding: 0;
}

.tutorial-workspace.hub-page .tutorial-track-bar a.hub-chip {
    text-decoration: none;
}

.tutorial-workspace.hub-page .hub-panel.tutorial-toc {
    max-height: calc(100vh - 220px);
}

.tutorial-workspace.hub-page .tutorial-content > .hub-kicker {
    margin: 0 0 10px;
}

.hub-tools-workspace .hub-tools-intro {
    margin-bottom: 4px;
}

.hub-tools-workspace .hub-path {
    margin: 10px 0 0;
}

.hub-tools-workspace .hub-headline {
    margin: 4px 0 0;
    font-size: clamp(1.35rem, 2.8vw, 1.85rem);
}

.hub-tools-workspace .hub-tools > summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--hub-ink, var(--text));
    padding: 4px 0;
    list-style-position: outside;
}

.hub-tools-workspace .hub-tool-category-grid {
    margin-top: 12px;
}

.hub-tool-category-card {
    cursor: pointer;
    text-align: left;
    font: inherit;
    width: 100%;
    border-top: 4px solid var(--accent);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.hub-tool-category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 47, 44, 0.08);
}

.hub-tool-category-card.is-active {
    border-color: var(--accent-strong);
    background: color-mix(in srgb, var(--accent) 12%, #fff);
}

.hub-tool-category-card strong {
    display: block;
    font-size: 1rem;
}

.hub-tool-category-card .muted {
    margin: 4px 0 0;
    font-size: 0.82rem;
}

/* Phase 4 ? Gamification */
.hub-metric-xp strong {
    color: var(--hub-accent, var(--accent-strong, #0f6b5c));
}

.hub-xp-section {
    margin-top: 4px;
}

.hub-xp-panel {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(220px, 280px) 1fr;
    align-items: start;
}

.hub-course-xp-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    margin-bottom: 16px;
}

.hub-course-xp-card.has-xp {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--hub-line, #d7e0dc));
    background: color-mix(in srgb, var(--accent) 8%, #fff);
}

.hub-badge-grid-below {
    margin-top: 4px;
}

.hub-xp-bar-wrap {
    background: color-mix(in srgb, var(--hub-surface, #fff) 92%, var(--accent) 8%);
    border: 1px solid color-mix(in srgb, var(--hub-line, #d7e0dc) 80%, transparent);
    border-radius: 14px;
    padding: 14px 16px;
}

.hub-xp-bar-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 8px;
    font-size: 0.88rem;
}

.hub-xp-bar-meta strong {
    font-family: Fraunces, Georgia, serif;
    font-size: 1.15rem;
}

.hub-xp-bar {
    height: 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--hub-line, #d7e0dc) 70%, #fff);
    overflow: hidden;
}

.hub-xp-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent, #1a9b7e), var(--accent-strong, #0f6b5c));
    min-width: 0;
    transition: width 0.35s ease;
}

.hub-xp-stats {
    margin: 10px 0 0;
    font-size: 0.8rem;
}

.hub-badge-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.hub-badge-card {
    border: 1px dashed color-mix(in srgb, var(--hub-line, #d7e0dc) 90%, transparent);
    border-radius: 12px;
    padding: 12px;
    background: color-mix(in srgb, #fff 88%, var(--hub-line, #d7e0dc));
    opacity: 0.72;
}

.hub-badge-card.is-earned {
    opacity: 1;
    border-style: solid;
    background: color-mix(in srgb, var(--accent) 10%, #fff);
}

.hub-badge-card strong {
    display: block;
    font-size: 0.92rem;
    margin-bottom: 4px;
}

.hub-badge-card .muted {
    margin: 0 0 8px;
    font-size: 0.78rem;
    line-height: 1.35;
}

.hub-badge-state {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hub-muted, #5a6b66);
}

.hub-badge-card.is-earned .hub-badge-state {
    color: var(--accent-strong, #0f6b5c);
}

.hub-tutorial-card.is-locked {
    opacity: 0.88;
    background: color-mix(in srgb, var(--hub-surface, #fff) 94%, #94a3b8 6%);
}

.hub-tutorial-card.is-locked .hub-work-status {
    background: color-mix(in srgb, #94a3b8 18%, #fff);
}

.hub-lock-hint {
    margin: 0 0 10px;
    font-size: 0.82rem;
    line-height: 1.4;
}

.hub-chip.is-locked {
    opacity: 0.55;
    text-decoration: line-through;
}

.hub-track-locked {
    max-width: 640px;
    margin: 8px auto 0;
    text-align: left;
}

.hub-track-locked .hub-cta-row {
    margin-top: 14px;
}

@media (max-width: 900px) {
    .hub-xp-panel {
        grid-template-columns: 1fr;
    }
}

.hub-section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.hub-xp-tips {
    margin: 0 0 14px;
    padding: 10px 14px;
    border: 1px solid color-mix(in srgb, var(--hub-line, #d7e0dc) 85%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, #fff 94%, var(--accent) 6%);
}

.hub-xp-tips summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--hub-ink, var(--text));
}

.hub-xp-tips ul {
    margin: 10px 0 0;
    padding-left: 1.1rem;
    color: var(--hub-muted, #5a6b66);
    font-size: 0.88rem;
    line-height: 1.45;
}

.hub-streak-row {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    margin-bottom: 14px;
}

.hub-streak-card,
.hub-goal-card {
    border: 1px solid color-mix(in srgb, var(--hub-line, #d7e0dc) 85%, transparent);
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
}

.hub-streak-card strong,
.hub-goal-card strong {
    display: block;
    font-family: Fraunces, Georgia, serif;
    font-size: 1.25rem;
    margin: 4px 0 6px;
}

.hub-goal-card .hub-xp-bar {
    margin: 8px 0;
}

.hub-goal-card.is-complete {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--hub-line, #d7e0dc));
    background: color-mix(in srgb, var(--accent) 8%, #fff);
}

.hub-empty-compact {
    margin: 8px 0 16px;
    padding: 16px;
}

.hub-fame-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.hub-fame-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    margin: 8px 0 16px;
}

.hub-fame-podium-card {
    border: 1px solid color-mix(in srgb, var(--hub-line, #d7e0dc) 85%, transparent);
    border-radius: 14px;
    padding: 14px;
    background: #fff;
    text-align: center;
}

.hub-fame-podium-card.rank-1 {
    order: 2;
    padding-top: 22px;
    border-top: 4px solid var(--accent-strong, #0f6b5c);
    transform: translateY(-6px);
}

.hub-fame-podium-card.rank-2 {
    order: 1;
    border-top: 4px solid #7a8f88;
}

.hub-fame-podium-card.rank-3 {
    order: 3;
    border-top: 4px solid #9aa8a3;
}

.hub-fame-podium-card.is-self,
.hub-fame-row.is-self {
    background: color-mix(in srgb, var(--accent) 10%, #fff);
}

.hub-fame-rank {
    display: inline-block;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--hub-muted, #5a6b66);
    margin-bottom: 6px;
}

.hub-fame-podium-card h3 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.hub-fame-list {
    display: grid;
    gap: 8px;
}

.hub-fame-row {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--hub-line, #d7e0dc) 85%, transparent);
    border-radius: 12px;
    background: #fff;
}

.hub-fame-viewer-note {
    margin-top: 12px;
}

.hub-certificate {
    border: 1px solid color-mix(in srgb, var(--hub-line, #d7e0dc) 80%, transparent);
    border-radius: 16px;
    padding: 16px;
    background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 8%, #fff), #fff 55%);
    margin-bottom: 16px;
}

.hub-certificate-head h3 {
    margin: 4px 0 6px;
    font-family: Fraunces, Georgia, serif;
}

.hub-badge-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.hub-badge-chip {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--hub-line, #d7e0dc));
    background: color-mix(in srgb, var(--accent) 12%, #fff);
    font-size: 0.78rem;
    font-weight: 700;
}

@media (max-width: 900px) {
    .hub-fame-podium {
        grid-template-columns: 1fr;
    }

    .hub-fame-podium-card.rank-1,
    .hub-fame-podium-card.rank-2,
    .hub-fame-podium-card.rank-3 {
        order: 0;
        transform: none;
    }

    .hub-fame-row {
        grid-template-columns: 40px 1fr;
    }

    .hub-fame-row .hub-work-score {
        grid-column: 2;
    }

    .hub-section-actions {
        width: 100%;
    }

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

@media (max-width: 560px) {
    .hub-path {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .hub-path-pill {
        flex: 0 0 auto;
    }

    .hub-cta-row {
        flex-direction: column;
        align-items: stretch;
    }

    .hub-cta-row .hub-btn {
        text-align: center;
    }
}

@media print {
    .app-sidebar,
    .hub-topbar,
    .hub-section-actions,
    .hub-path,
    .hub-metrics,
    .manage-grid,
    .hub-xp-tips {
        display: none !important;
    }

    .hub-certificate {
        border: 1px solid #222;
        box-shadow: none;
    }
}

/* Competitions page ? compact layout */
.competitions-hero .hub-lead {
    max-width: 54ch;
    margin-bottom: 10px;
}

.competitions-toolbar {
    margin-bottom: 12px;
}

.competitions-layout .competition-event-grid {
    grid-template-columns: 1fr;
    max-height: min(58vh, 520px);
    overflow: auto;
    padding-right: 2px;
}

.competition-event-card {
    padding: 12px 14px;
    gap: 6px;
}

.competition-event-card h3 {
    font-size: 1rem;
    margin: 0;
}

.competition-event-card .muted {
    margin: 0;
    font-size: 0.82rem;
}

.competition-detail-panel {
    align-self: start;
    max-height: min(70vh, 640px);
    overflow: auto;
}

.competition-detail-body {
    padding-top: 0;
}

.competition-instructions {
    max-height: 180px;
    overflow: auto;
    margin: 8px 0 12px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.competition-detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.competition-bank-pane {
    margin-top: 8px;
}

.competition-bank-body {
    padding: 12px 16px 16px;
}

.competition-bank-hint {
    margin: 0 0 10px;
    font-size: 0.88rem;
}

.competition-bank-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.competition-bank-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.competition-bank-lang-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
}

.competition-bank-search {
    flex: 1;
    min-width: 180px;
}

.competition-bank-search input {
    padding: 10px 12px;
    border-radius: 12px;
}

.competition-bank-list {
    display: grid;
    gap: 6px;
    max-height: min(42vh, 360px);
    overflow: auto;
    padding-right: 2px;
}

.competition-bank-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--hub-line);
    border-radius: 12px;
    background: #fff;
}

.competition-bank-row.is-active {
    border-color: var(--accent-strong);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-strong) 35%, transparent);
}

.competition-bank-row-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.competition-bank-row-main strong {
    display: block;
    font-size: 0.95rem;
}

.competition-bank-row-main .muted {
    margin: 2px 0 0;
    font-size: 0.78rem;
}

.competition-bank-index {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: color-mix(in srgb, var(--hub-ink) 45%, #6b7280);
    padding-top: 2px;
}

.competition-bank-row-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.competition-quick-panel {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--hub-line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent) 6%, #fff);
}

.competition-quick-form {
    margin-top: 8px;
}

@media (max-width: 900px) {
    .competitions-layout .competition-event-grid {
        max-height: none;
    }

    .competition-detail-panel {
        max-height: none;
    }

    .competition-bank-row {
        flex-direction: column;
        align-items: stretch;
    }

    .competition-bank-row-actions {
        justify-content: flex-start;
    }
}
