@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&family=Fraunces:wght@600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --primary: #0054fb;
    --primary-light: #818cf8;
    --accent: #4f46e5;
    --zen-bg: #f8fafc;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --sidebar-width: 280px;
    --heading-font: 'Fraunces', serif;
    --body-font: 'Space Grotesk', sans-serif;
}

html {
    scroll-behavior: smooth;
}

/* MIDNIGHT PRO DARK MODE */
[data-bs-theme="dark"],
body.dark-mode {
    --zen-bg: #0b111a;
    --sidebar-bg: #0f172a;
    --card-bg: #111827;
    --text-main: #e5e7eb;
    --text-muted: #9aa4b2;
    --border-color: #1f2937;
    --primary: #7aa2ff;
    --primary-light: #a5b4fc;
    --accent: #4f46e5;
}

/* --- General Layout --- */
body.zen-body {
    background-color: var(--zen-bg);
    color: var(--text-main);
    font-family: var(--body-font);
    transition: background-color 0.3s, color 0.3s;
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.zen-body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(900px 520px at 10% -10%, rgba(0, 84, 251, 0.12), transparent 60%),
        radial-gradient(800px 420px at 95% 5%, rgba(79, 70, 229, 0.08), transparent 55%);
    pointer-events: none;
    z-index: -1;
}

body.dark-mode.zen-body {
    background-image: radial-gradient(circle at 20% 20%, rgba(122, 162, 255, 0.12), transparent 45%),
        radial-gradient(circle at 80% 0%, rgba(165, 180, 252, 0.08), transparent 40%);
    background-attachment: fixed;
}

/* --- Optimized Gradient Typography (Yellow Line Fix) --- */
h1.text-gradient,
h2.text-gradient,
.text-gradient {
    background-image: linear-gradient(90deg,
            var(--primary) 0%,
            var(--accent) 55%,
            var(--primary-light) 100%) !important;
    /* Standard property - removes the linting warning */
    background-clip: text !important;
    /* Vendor prefixed versions for App/Mobile views */
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    /* Fallback and display logic */
    display: inline-block;
    color: var(--primary);
    font-weight: 800;
}

body.dark-mode h1.text-gradient,
body.dark-mode h2.text-gradient,
body.dark-mode .text-gradient {
    background-image: linear-gradient(90deg,
            #9bb8ff 0%,
            #b7c7ff 55%,
            #a5b4fc 100%) !important;
}

.workspace-heading-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.workspace-mobile-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    flex: 0 0 auto;
    filter: drop-shadow(0 8px 14px rgba(2, 20, 63, 0.16));
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--heading-font);
    letter-spacing: 0.01em;
}

.x-small {
    font-size: 0.75rem;
}


/* Sidebar */
.zen-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    transition: width .28s var(--ease), background-color .28s var(--ease), transform .28s var(--ease);
    z-index: 1045;
    box-shadow: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.zen-sidebar > .p-4 {
    min-height: 100%;
}

.zen-sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* Google Picker is injected outside app markup; keep it above sidebar/nav chrome. */
.picker-dialog,
.picker-dialog-bg,
iframe[src*="docs.google.com/picker"],
iframe[src*="apis.google.com/picker"],
iframe[src*="google.com/picker"] {
    z-index: 3000 !important;
}

.legal-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
}

.legal-link-row a {
    color: var(--text-muted);
    text-decoration: none;
}

.legal-link-row a:hover,
.legal-link-row a:focus {
    color: var(--primary);
    text-decoration: underline;
}

.zen-sidebar .legal-link-row,
.assignment-sidebar-card .legal-link-row {
    justify-content: center;
    margin-top: 14px;
}

/* fixed desktop layout */
@media(min-width: 992px) {
    .zen-sidebar {
        position: fixed;
        height: 100vh;
        top: 0;
        left: 0;
    }

    .zen-main {
        margin-left: var(--sidebar-width);
        padding: 48px 56px;
    }
}

/* mobile layout */
@media(max-width: 991.98px) {
    .zen-sidebar {
        max-height: 100vh;
    }

    .zen-main {
        margin-left: 0;
        padding: 20px 16px calc(90px + env(safe-area-inset-bottom, 0px)) 16px !important;
    }

    .mobile-nav {
        display: flex !important;
    }

    .workspace-header {
        margin-bottom: 24px !important;
    }

    .workspace-heading-lockup {
        align-items: center;
        gap: 12px;
    }

    .workspace-heading-lockup h2 {
        font-size: 1.42rem;
        line-height: 1.05;
    }

    .workspace-heading-lockup #liveStatus {
        font-size: .78rem;
        margin-top: 3px !important;
    }
}

@media(max-width: 420px) {
    .workspace-mobile-logo {
        width: 50px;
        height: 50px;
    }

    .workspace-heading-lockup {
        gap: 10px;
    }

    .workspace-heading-lockup h2 {
        font-size: 1.24rem;
    }
}

/* Navigation links — subtle, accessible */
.nav-link {
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px 14px;
    border-radius: calc(var(--radius) - 2px);
    margin: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color .18s var(--ease), color .18s var(--ease), transform .12s ease;
}

.nav-link:hover {
    color: var(--primary);
    background: linear-gradient(90deg,
            rgba(24, 103, 255, 0.14),
            rgba(108, 99, 255, 0.08),
            rgba(24, 103, 255, 0.04));
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 6px 18px rgba(24, 103, 255, 0.18),
        inset 0 0 0 1px rgba(24, 103, 255, 0.12);
    transition:
        transform 0.35s cubic-bezier(.22, .9, .3, 1),
        box-shadow 0.35s cubic-bezier(.22, .9, .3, 1),
        background 0.35s ease,
        color 0.2s ease;
}

body.dark-mode .nav-link:hover {
    background: linear-gradient(90deg,
            rgba(122, 162, 255, 0.12),
            rgba(122, 162, 255, 0.06),
            rgba(122, 162, 255, 0.02));
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(122, 162, 255, 0.18);
}


.nav-link.active {
    background: rgba(24, 103, 255, 0.12);
    color: var(--primary);
    box-shadow: none;
    border-left: 4px solid var(--primary);
    padding-left: 10px;
    /* compensate for left border */
}

body.dark-mode .nav-link.active {
    background: rgba(122, 162, 255, 0.14);
    border-left-color: var(--primary);
}


/* --- Zen Cards --- */
.zen-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.zen-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body.dark-mode .zen-card {
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
    background-color: #111827;
}

body.dark-mode .zen-card:hover {
    box-shadow: 0 14px 22px rgba(0, 0, 0, 0.45);
}

.border-start-thick {
    border-left-width: 6px !important;
}

/* --- Input Fields Refined --- */
.zen-input {
    background: var(--zen-bg) !important;
    border: 1.5px solid var(--border-color) !important;
    color: var(--text-main) !important;
    border-radius: 14px !important;
    padding: 0.75rem 1.25rem;
    transition: all 0.2s;
}

.zen-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1) !important;
    outline: none;
}

body.dark-mode .zen-input {
    background: #0f172a !important;
    border-color: #1f2937 !important;
    color: #e5e7eb !important;
}

body.dark-mode .zen-input:focus {
    box-shadow: 0 0 0 4px rgba(122, 162, 255, 0.2) !important;
}

/* --- Drive Connection Choice UI --- */
.drive-choice-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 14px;
}

.drive-choice-btn {
    appearance: none;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 18px;
    min-height: 132px;
    padding: 18px;
    width: 100%;
    text-align: left;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    position: relative;
    overflow: hidden;
    color: var(--text-main);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, filter .22s ease;
}

.drive-choice-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .95;
    z-index: 0;
}

.drive-choice-btn > span {
    position: relative;
    z-index: 1;
}

.drive-choice-primary {
    color: #ffffff;
    border-color: rgba(0, 84, 251, 0.18);
    box-shadow: 0 22px 40px rgba(0, 84, 251, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.drive-choice-primary::before {
    background:
        linear-gradient(135deg, #0054fb 0%, #2563eb 45%, #10b981 120%),
        repeating-linear-gradient(135deg, rgba(255,255,255,.16) 0 1px, transparent 1px 12px);
}

.drive-choice-secondary {
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.drive-choice-secondary::before {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(248, 250, 252, .86)),
        radial-gradient(circle at 14% 18%, rgba(16, 185, 129, .14), transparent 30%);
}

.drive-choice-btn:hover,
.drive-choice-btn.is-active {
    transform: translateY(-3px);
    border-color: rgba(16, 185, 129, 0.36);
    filter: saturate(1.06);
}

.drive-choice-primary:hover,
.drive-choice-primary.is-active {
    box-shadow: 0 26px 46px rgba(0, 84, 251, 0.28), 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.drive-choice-secondary:hover,
.drive-choice-secondary.is-active {
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12), 0 0 0 4px rgba(0, 84, 251, 0.08);
}

.drive-choice-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.24);
}

.drive-choice-secondary .drive-choice-icon {
    color: var(--primary);
    background: rgba(0, 84, 251, 0.08);
    box-shadow: inset 0 0 0 1px rgba(0, 84, 251, 0.12);
}

.drive-choice-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.drive-choice-kicker {
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: rgba(255,255,255,.78);
}

.drive-choice-secondary .drive-choice-kicker {
    color: #10b981;
}

.drive-choice-title {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.15;
    margin-top: 3px;
}

.drive-choice-text {
    font-size: .84rem;
    line-height: 1.35;
    margin-top: 6px;
    color: rgba(255,255,255,.82);
}

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

.drive-choice-arrow {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.18);
}

.drive-choice-secondary .drive-choice-arrow {
    color: var(--primary);
    background: rgba(0, 84, 251, 0.08);
}

.manual-link-panel {
    animation: manual-link-rise .24s ease both;
}

@keyframes manual-link-rise {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.dark-mode .drive-choice-secondary {
    background: #0f172a;
    border-color: rgba(122, 162, 255, 0.18);
}

body.dark-mode .drive-choice-secondary::before {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .96), rgba(17, 24, 39, .86)),
        radial-gradient(circle at 14% 18%, rgba(16, 185, 129, .18), transparent 32%);
}

@media (max-width: 767.98px) {
    .drive-choice-grid {
        grid-template-columns: 1fr;
    }

    .drive-choice-btn {
        min-height: 118px;
        padding: 16px;
    }
}

.drive-connect-card {
    border: 1.5px solid #0d6efd !important;
    border-left-width: 5px !important;
    border-radius: 28px;
    padding: 18px 20px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.94)),
        radial-gradient(circle at 18% 0%, rgba(0, 84, 251, .08), transparent 36%);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08) !important;
}

.drive-connect-pending {
    border-color: #0d6efd !important;
}

.drive-connect-verified {
    border-color: #16a34a !important;
}

.drive-connect-error {
    border-color: #dc3545 !important;
}

.drive-connect-card:hover {
    transform: none;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1) !important;
}

.drive-connect-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.drive-connect-header h6 {
    font-family: var(--heading-font);
    font-size: .98rem;
    letter-spacing: 0;
}

.drive-help-btn {
    border: 1px solid rgba(203, 213, 225, .9);
    background: rgba(255,255,255,.88);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 6px 13px;
    font-weight: 700;
    font-size: .82rem;
    line-height: 1;
}

.drive-choice-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
}

.drive-picker-card,
.drive-manual-card,
.drive-quick-setup {
    border-radius: 8px;
    border: 1px solid #cfe0ff;
    background: rgba(255,255,255,.92);
}

.drive-picker-card,
.drive-manual-card {
    min-height: 108px;
    padding: 18px 20px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
}

.drive-picker-card {
    box-shadow: inset 0 0 0 1px rgba(0, 84, 251, 0.02);
}

.drive-manual-card,
.drive-quick-setup {
    border-color: rgba(16, 185, 129, .36);
}

.drive-manual-stack {
    position: relative;
    display: grid;
    gap: 16px;
}

.drive-manual-stack::after {
    content: "";
    position: absolute;
    top: 102px;
    left: 48%;
    width: 14px;
    height: 14px;
    background: #f8fffb;
    border-left: 1px solid rgba(16, 185, 129, .36);
    border-top: 1px solid rgba(16, 185, 129, .36);
    transform: rotate(45deg);
    z-index: 2;
}

.drive-folder-art {
    width: 84px;
    height: 66px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    position: relative;
    color: #8ab4ff;
    background:
        radial-gradient(circle at 18% 42%, rgba(37, 99, 235, .2) 0 4px, transparent 5px),
        radial-gradient(circle at 86% 15%, rgba(37, 99, 235, .16) 0 3px, transparent 4px),
        linear-gradient(135deg, rgba(239, 246, 255, .9), rgba(255,255,255,.75));
}

.drive-folder-art > i {
    font-size: 3.3rem;
    line-height: 1;
    filter: drop-shadow(0 10px 14px rgba(37, 99, 235, .16));
}

.drive-folder-art span {
    position: absolute;
    width: 34px;
    height: 34px;
    right: 17px;
    bottom: 8px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: #fff;
    color: #16a34a;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .1);
}

.drive-folder-art span i {
    font-size: 1.2rem;
}

.drive-choice-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(16, 185, 129, .12);
    color: #10b981;
    box-shadow: none;
}

.drive-choice-title {
    color: #172554;
    font-size: .98rem;
    letter-spacing: 0;
}

.drive-choice-text {
    color: #475569;
    font-size: .84rem;
    max-width: 250px;
}

.drive-open-btn,
.drive-paste-btn {
    border-radius: 7px;
    min-width: 126px;
    min-height: 38px;
    padding: 9px 14px;
    font-weight: 800;
    font-size: .86rem;
    white-space: nowrap;
}

.drive-open-btn {
    border: none;
    color: #fff;
    background: linear-gradient(135deg, #0b63ff, #0f6df7);
    box-shadow: 0 10px 20px rgba(11, 99, 255, .22);
}

.drive-paste-btn {
    border: 1px solid rgba(16, 185, 129, .68);
    color: #16a34a;
    background: rgba(255,255,255,.92);
}

.drive-open-btn:hover,
.drive-paste-btn:hover,
.drive-paste-btn.is-active {
    transform: translateY(-1px);
}

.drive-quick-setup {
    position: relative;
    padding: 0;
    background: linear-gradient(180deg, #fbfffd, #f3fff8);
}

.drive-quick-setup p {
    font-size: .78rem;
}

.drive-quick-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 13px 14px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    color: #334155;
    font-size: .82rem;
    font-weight: 800;
    text-align: left;
}

.drive-quick-toggle-copy {
    color: var(--text-muted);
    font-weight: 700;
    font-size: .76rem;
    text-align: right;
}

.drive-quick-toggle > i:last-child {
    color: #10b981;
    transition: transform .18s ease;
}

.drive-quick-toggle.is-open > i:last-child {
    transform: rotate(180deg);
}

.drive-quick-body {
    border-top: 1px solid rgba(16, 185, 129, .18);
    padding: 12px 14px 14px;
    animation: manual-link-rise .2s ease both;
}

.drive-email-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.drive-email-row code {
    display: block;
    padding: 12px 14px;
    border-radius: 7px;
    border: 1px solid rgba(203, 213, 225, .78);
    background: #ffffff;
    font-size: .8rem;
}

.drive-copy-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, .25);
    color: #10b981;
    background: rgba(16, 185, 129, .08);
}

body.dark-mode .drive-connect-card,
body.dark-mode .drive-picker-card,
body.dark-mode .drive-manual-card,
body.dark-mode .drive-quick-setup {
    background: #111827;
    border-color: rgba(122, 162, 255, .22) !important;
}

body.dark-mode .drive-connect-pending {
    border-color: #7aa2ff !important;
}

body.dark-mode .drive-connect-verified {
    border-color: #22c55e !important;
}

body.dark-mode .drive-connect-error {
    border-color: #ef4444 !important;
}

body.dark-mode .drive-choice-title {
    color: #e5edff;
}

body.dark-mode .drive-choice-text {
    color: #9aa4b2;
}

body.dark-mode .drive-email-row code,
body.dark-mode .drive-help-btn,
body.dark-mode .drive-paste-btn {
    background: #0f172a;
}

body.dark-mode .drive-quick-toggle {
    color: #e5e7eb;
}

@media (max-width: 991.98px) {
    .drive-picker-card,
    .drive-manual-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .drive-open-btn,
    .drive-paste-btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    .drive-manual-stack::after {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .drive-connect-card {
        padding: 14px;
        border-radius: 18px;
    }

    .drive-connect-header {
        margin-bottom: 14px;
        align-items: center;
    }

    .drive-connect-header h6 {
        font-size: .9rem;
        line-height: 1.2;
    }

    .drive-help-btn {
        padding: 7px 11px;
        font-size: .78rem;
    }

    .drive-choice-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .drive-picker-card,
    .drive-manual-card {
        min-height: auto;
        padding: 14px;
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 12px;
        border-radius: 10px;
    }

    .drive-folder-art {
        width: 52px;
        height: 46px;
        border-radius: 11px;
    }

    .drive-folder-art > i {
        font-size: 2.35rem;
    }

    .drive-folder-art span {
        width: 25px;
        height: 25px;
        right: 8px;
        bottom: 5px;
        border-radius: 6px;
    }

    .drive-folder-art span i {
        font-size: .9rem;
    }

    .drive-choice-icon {
        width: 48px;
        height: 48px;
        font-size: 1.35rem;
    }

    .drive-choice-title {
        font-size: .94rem;
        line-height: 1.2;
    }

    .drive-choice-text {
        font-size: .78rem;
        line-height: 1.32;
        max-width: none;
    }

    .drive-open-btn,
    .drive-paste-btn {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        min-height: 42px;
        margin-top: 2px;
    }

    .drive-manual-stack {
        gap: 10px;
    }

    .drive-quick-toggle {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 12px;
        row-gap: 4px;
    }

    .drive-quick-toggle-copy {
        grid-column: 1 / -1;
        grid-row: 2;
        text-align: left;
        font-size: .73rem;
    }

    .drive-quick-toggle > i:last-child {
        grid-column: 2;
        grid-row: 1;
    }

    .drive-quick-body {
        padding: 11px 12px 12px;
    }

    .drive-email-row {
        grid-template-columns: 1fr auto;
        gap: 8px;
    }

    .drive-email-row code {
        min-width: 0;
        font-size: .68rem;
        padding: 10px;
    }

    .drive-copy-btn {
        width: 36px;
        height: 36px;
    }

    #manualLinkPanel .zen-input,
    #manualLinkPanel .btn {
        min-height: 44px;
        padding-top: .72rem !important;
        padding-bottom: .72rem !important;
    }
}

/* --- Step 2 Rubric Surface --- */
.rubric-card {
    border: 1.5px solid #0d6efd !important;
    border-left-width: 5px !important;
    border-radius: 28px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05) !important;
}

.rubric-card:hover {
    transform: none;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .07) !important;
}

.rubric-title {
    font-family: var(--body-font);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 26px;
}

.rubric-grid {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(240px, 1.35fr) minmax(170px, .8fr) auto;
    gap: 18px;
    align-items: end;
}

.rubric-grid.rubric-grid-numeric {
    grid-template-columns: minmax(170px, .75fr) minmax(220px, 1.25fr) minmax(150px, .75fr) minmax(120px, .42fr) auto;
}

.rubric-field {
    min-width: 0;
}

.rubric-label {
    display: block;
    margin-bottom: 12px;
    color: #334155;
    font-size: .92rem;
    font-weight: 800;
    letter-spacing: 0;
}

.rubric-select-shell {
    min-height: 70px;
    border: 1px solid rgba(203, 213, 225, .86);
    border-radius: 12px;
    background: rgba(255, 255, 255, .86);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .04);
    position: relative;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.rubric-select-shell:focus-within {
    border-color: rgba(0, 84, 251, .42);
    box-shadow: 0 0 0 4px rgba(0, 84, 251, .08), 0 12px 24px rgba(15, 23, 42, .06);
}

.rubric-select-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0b63ff;
    background: rgba(11, 99, 255, .09);
    box-shadow: inset 0 0 0 1px rgba(11, 99, 255, .12);
    font-size: 1.1rem;
}

.rubric-select {
    border: 0 !important;
    background: transparent !important;
    color: #1e293b !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-height: 68px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    appearance: none;
    background-image: none !important;
}

.rubric-select:focus {
    outline: 0;
}

.rubric-select-chevron {
    color: #475569;
    font-size: 1.05rem;
    pointer-events: none;
}

.rubric-hint {
    margin-top: 18px;
    color: #64748b;
    font-size: .94rem;
    font-weight: 500;
}

.rubric-action-field {
    min-width: 160px;
}

.rubric-grade-btn {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 11px;
    padding: 0 20px;
    color: #ffffff;
    background: linear-gradient(135deg, #0b63ff, #10b981);
    font-weight: 800;
    box-shadow: 0 14px 24px rgba(11, 99, 255, .18);
    white-space: nowrap;
}

.rubric-grade-btn:disabled {
    opacity: .58;
    cursor: not-allowed;
}

.rubric-custom-wrap {
    margin-top: 18px;
}

body.dark-mode .rubric-label {
    color: #cbd5e1;
}

body.dark-mode .rubric-select-shell {
    background: #111827;
    border-color: rgba(122, 162, 255, .2);
}

body.dark-mode .rubric-card {
    background: rgba(17, 24, 39, .78);
    border-color: #7aa2ff !important;
}

body.dark-mode .rubric-select {
    color: #e5e7eb !important;
}

body.dark-mode .rubric-select-chevron {
    color: #9aa4b2;
}

body.dark-mode .rubric-hint {
    color: #9aa4b2;
}

/* ===== Phase 3: Rubric Preview Card ===== */
.rubric-preview-card {
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    padding: 16px 20px;
    margin-top: 16px;
    background: rgba(0, 84, 251, 0.03);
    transition: all 0.25s ease;
    display: none;
}
.rubric-preview-card.visible {
    display: block;
    animation: rubric-fade-in 0.3s ease both;
}
@keyframes rubric-fade-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rubric-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.rubric-preview-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
}
.rubric-preview-badge {
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(0, 84, 251, 0.1);
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
}
.rubric-preview-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
}
.rubric-preview-criteria {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rubric-preview-criterion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}
.rubric-preview-criterion-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    min-width: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rubric-preview-criterion-bar {
    flex: 0 0 120px;
    height: 6px;
    border-radius: 999px;
    background: var(--border-color);
    overflow: hidden;
}
.rubric-preview-criterion-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.4s ease;
}
.rubric-preview-criterion-weight {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 36px;
    text-align: right;
}
.rubric-preview-total {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-muted);
}
.rubric-preview-total strong {
    color: var(--text-main);
}
body.dark-mode .rubric-preview-card {
    background: rgba(122, 162, 255, 0.05);
    border-color: rgba(122, 162, 255, 0.12);
}
body.dark-mode .rubric-preview-badge {
    background: rgba(122, 162, 255, 0.12);
    color: #a5b4fc;
}

/* ===== Phase 4: Rubric Customizer Modal ===== */
.rubric-customizer .modal-header {
    border-bottom: 0;
    padding: 20px 24px 0;
}
.rubric-customizer .modal-body {
    padding: 16px 24px 8px;
}
.rubric-customizer .modal-footer {
    border-top: 0;
    padding: 8px 24px 20px;
}
.rubric-customizer-section {
    margin-bottom: 18px;
}
.rubric-customizer-section h6 {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}
.customizer-criterion-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: var(--card-bg);
    transition: box-shadow 0.2s ease;
}
.customizer-criterion-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.customizer-criterion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.customizer-criterion-header .form-control {
    font-size: 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    min-height: 32px;
}
.customizer-criterion-header .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 84, 251, 0.1);
}
.customizer-criterion-remove {
    border: none;
    background: none;
    color: #ef4444;
    font-size: 1.1rem;
    padding: 4px;
    line-height: 1;
    border-radius: 6px;
    transition: background 0.15s;
    cursor: pointer;
}
.customizer-criterion-remove:hover {
    background: rgba(239, 68, 68, 0.1);
}
.customizer-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.customizer-slider-row label {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 44px;
}
.customizer-slider-row input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}
.customizer-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    cursor: pointer;
}
.customizer-slider-row input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    cursor: pointer;
}
.customizer-slider-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 28px;
    text-align: right;
}
.customizer-add-btn {
    border: 1px dashed var(--border-color);
    background: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: center;
}
.customizer-add-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 84, 251, 0.04);
}
.customizer-total-summary {
    display: flex;
    justify-content: space-between;
    padding: 8px 14px;
    background: rgba(0, 84, 251, 0.04);
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}
.customizer-total-summary .text-success {
    color: #16a34a;
}
.customizer-total-summary .text-danger {
    color: #ef4444;
}
.customizer-weight-warning {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 4px;
    display: none;
}
.customizer-weight-warning.visible {
    display: block;
}
body.dark-mode .customizer-criterion-card {
    background: #111827;
    border-color: #1f2937;
}
body.dark-mode .customizer-total-summary {
    background: rgba(122, 162, 255, 0.06);
}
body.dark-mode .customizer-add-btn {
    border-color: #1f2937;
    color: #9aa4b2;
}
body.dark-mode .customizer-add-btn:hover {
    border-color: #7aa2ff;
    color: #7aa2ff;
    background: rgba(122, 162, 255, 0.08);
}
body.dark-mode .customizer-criterion-header .form-control {
    background: #0f172a;
    border-color: #1f2937;
    color: #e5e7eb;
}
body.dark-mode .customizer-slider-row input[type="range"] {
    background: #1f2937;
}
body.dark-mode .customizer-criterion-remove:hover {
    background: rgba(239, 68, 68, 0.2);
}


@media (max-width: 991.98px) {
    .rubric-grid,
    .rubric-grid.rubric-grid-numeric {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }

    .rubric-action-field {
        grid-column: 1 / -1;
        min-width: 0;
    }
}

@media (max-width: 767.98px) {
    .rubric-card {
        padding: 14px;
        border-radius: 18px;
    }

    .rubric-title {
        font-size: 1rem;
        margin-bottom: 16px;
    }

    .rubric-grid,
    .rubric-grid.rubric-grid-numeric {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .rubric-label {
        font-size: .86rem;
        margin-bottom: 8px;
    }

    .rubric-select-shell {
        min-height: 58px;
        border-radius: 10px;
        padding: 0 14px;
        gap: 12px;
    }

    .rubric-select-icon {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    .rubric-select {
        min-height: 56px;
        font-size: .94rem;
    }

    .rubric-hint {
        margin-top: 12px;
        font-size: .82rem;
        line-height: 1.35;
    }

    .rubric-grade-btn {
        min-height: 46px;
        border-radius: 10px;
    }
}

/* --- Primary Action Buttons (Connect / Sync) --- */
.btn.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    box-shadow: 0 10px 18px rgba(79, 70, 229, 0.22);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 22px rgba(79, 70, 229, 0.28);
    filter: brightness(1.03);
}

.btn.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.2);
}

.btn.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18), 0 10px 18px rgba(79, 70, 229, 0.22);
}

body.dark-mode .btn.btn-primary {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(122, 162, 255, 0.25) inset;
}

body.dark-mode .btn.btn-primary:hover {
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(165, 180, 252, 0.35) inset;
}

.btn.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0) 100%);
    transform: translateX(-120%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.btn.btn-primary:hover::after {
    transform: translateX(120%);
}

.btn.btn-primary i {
    transition: transform 0.2s ease;
}

.btn.btn-primary:hover i {
    animation: icon-pulse 0.8s ease-in-out infinite;
}

@keyframes icon-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

/* --- Tables & Badges --- */
.table thead th {
    background-color: rgba(0, 0, 0, 0.02);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-top: none;
}

body.dark-mode .table thead th {
    background-color: rgba(255, 255, 255, 0.02);
}

body.dark-mode .table {
    color: var(--text-main);
}

body.dark-mode .table td,
body.dark-mode .table th {
    border-color: rgba(31, 41, 55, 0.9);
}

/* Normalize light utility classes in dark mode */
body.dark-mode .bg-white {
    background-color: #111827 !important;
}

body.dark-mode .bg-light,
body.dark-mode .bg-light-subtle,
body.dark-mode .table-light {
    background-color: rgba(15, 23, 42, 0.6) !important;
}

body.dark-mode .text-dark {
    color: var(--text-main) !important;
}

body.dark-mode .border {
    border-color: var(--border-color) !important;
}

body.dark-mode .input-group-text {
    background-color: #0f172a !important;
    color: var(--text-muted) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .offcanvas,
body.dark-mode .modal-content {
    background-color: #111827 !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

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

.criteria-score-card {
    border: 1px solid rgba(203, 213, 225, .9);
    border-radius: 12px;
    padding: 14px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .04);
}

.criteria-score-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #0f172a;
    font-weight: 800;
    font-size: .92rem;
}

.criteria-score-head strong {
    color: #0b63ff;
    white-space: nowrap;
}

.criteria-score-bar {
    height: 7px;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
    margin: 10px 0;
}

.criteria-score-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0b63ff, #22c55e);
}

.criteria-score-card p {
    margin: 0;
    color: #64748b;
    font-size: .9rem;
    line-height: 1.45;
}

body.dark-mode .criteria-score-card {
    background: #0f172a;
    border-color: rgba(71, 85, 105, .75);
}

body.dark-mode .criteria-score-head {
    color: #e5e7eb;
}

body.dark-mode .criteria-score-card p {
    color: #cbd5e1;
}

.zen-badge {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border: 1px solid rgba(79, 70, 229, 0.2);
    font-weight: 700;
    border-radius: 10px;
    padding: 0.4em 0.8em;
}

body.dark-mode .zen-badge {
    background: rgba(129, 140, 248, 0.2) !important;
    color: #a5b4fc !important;
}

/* --- Process Overlay --- */
.process-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 16, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.process-overlay.active {
    display: flex;
}

.process-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 480px;
    border-radius: 28px;
    border: 1px solid var(--border-color);
    padding: 2rem;
}

.process-steps li {
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.process-steps li.active {
    animation: step-pulse 1.2s ease-in-out infinite;
}

.process-steps li.active i {
    animation: step-slide 0.6s ease-out;
}

@keyframes step-pulse {
    0% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(4px);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes step-slide {
    0% {
        transform: translateX(-4px);
        opacity: 0.6;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.progress-bar-wrap {
    height: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

body.dark-mode .progress-bar-wrap {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .progress-bar-fill {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    width: 0%;
    transition: width 0.4s ease;
}

/* --- Theme Toggle --- */
.theme-switch-wrapper {
    background: rgba(0, 0, 0, 0.05);
    padding: 8px 12px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
}

body.dark-mode .theme-switch-wrapper {
    background: rgba(255, 255, 255, 0.06);
}

.theme-switch {
    display: inline-block;
    height: 20px;
    position: relative;
    width: 40px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #cbd5e1;
    position: absolute;
    cursor: pointer;
    inset: 0;
    transition: .4s;
    border-radius: 34px;
}

body.dark-mode .slider {
    background-color: #334155;
}

.slider:before {
    background-color: #fff;
    bottom: 3px;
    content: "";
    height: 14px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 14px;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(18px);
}

/* --- Transcription Box --- */
.ocr-text {
    background: rgba(0, 0, 0, 0.02);
    border: 1px dashed var(--border-color);
    padding: 1.5rem;
    border-radius: 16px;
    font-family: var(--body-font);
    font-size: 0.95rem;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
}

body.dark-mode .ocr-text {
    background: rgba(15, 23, 42, 0.7);
}

/* --- Mobile Submission Cards --- */
.mobile-submission-list {
    padding: 12px;
    display: grid;
    gap: 10px;
}

.mobile-sub-card {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px;
    background: var(--card-bg);
}

.mobile-file-name {
    font-size: 0.95rem;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.mobile-score-wrap {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(79, 70, 229, 0.05) 100%);
}

/* --- Mobile Bottom Navigation --- */
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
    backdrop-filter: blur(6px);
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-decoration: none;
    font-weight: 600;
}

.mobile-bottom-nav a i {
    font-size: 1.05rem;
}

.mobile-bottom-nav a.active {
    color: var(--primary);
}

.mobile-feedback-fab {
    position: fixed;
    right: 14px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    z-index: 1030;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.24);
}

body.dark-mode .mobile-feedback-fab {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    border-color: rgba(122, 162, 255, 0.32);
}

@media(max-width: 991.98px) {
    .zen-main {
        padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* compact phones */
@media(max-width: 575.98px) {
    .zen-main {
        padding-left: 12px;
        padding-right: 12px;
    }

    .mobile-sub-card {
        padding: 10px;
    }

    .mobile-file-name {
        font-size: 0.9rem;
    }

    .ocr-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

body.dark-mode .mobile-bottom-nav {
    background: #111827;
    border-top-color: var(--border-color);
}

/* --- Analytics Layout --- */
.analytics-tools {
    position: static;
}

.analytics-kpi {
    border-left: 4px solid var(--primary);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.analytics-kpi:hover {
    transform: translateY(-4px);
}

.analytics-kpi-value {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-main);
}

.analytics-filters .btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

body.dark-mode .analytics-tools {
    background: transparent;
}

body.dark-mode .bg-light,
body.dark-mode .bg-light-subtle {
    background-color: rgba(15, 23, 42, 0.65) !important;
}

/* analytics first-load motion */
.analytics-reveal {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
    filter: blur(2px);
    transition:
        opacity 0.62s cubic-bezier(.22, .9, .3, 1),
        transform 0.62s cubic-bezier(.22, .9, .3, 1),
        filter 0.62s ease;
    will-change: opacity, transform, filter;
}

.analytics-reveal.in-view {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

@media(max-width: 991.98px) {
    .analytics-tools {
        position: static;
    }
}

@media (prefers-reduced-motion: reduce) {
    .analytics-reveal {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        transition: none !important;
    }

    .analytics-kpi:hover {
        transform: none;
    }
}

/* --- Help Modal (Softer Look) --- */
.help-modal-content {
    background: var(--card-bg);
}

.help-modal-header {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.14), rgba(79, 70, 229, 0.04));
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color) !important;
}

.help-hero {
    border: 1px solid rgba(79, 70, 229, 0.22);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(79, 70, 229, 0.03));
}

.help-email-code {
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.85);
    padding: 10px 12px;
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 10px;
    width: 100%;
    word-break: break-all;
}

.help-step-card {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.65);
}

.help-step-badge {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(79, 70, 229, 0.12);
    border: 1px solid rgba(79, 70, 229, 0.24);
}

#helpModal .modal-body .bg-light {
    background-color: rgba(0, 0, 0, 0.025) !important;
}

body.dark-mode .help-modal-header {
    background: linear-gradient(180deg, rgba(122, 162, 255, 0.12), rgba(122, 162, 255, 0.05));
}

body.dark-mode .help-step-badge {
    color: #c7d5ff;
    background: rgba(122, 162, 255, 0.16);
    border-color: rgba(122, 162, 255, 0.32);
}

body.dark-mode .help-hero {
    border-color: rgba(122, 162, 255, 0.32);
    background: linear-gradient(135deg, rgba(122, 162, 255, 0.14), rgba(122, 162, 255, 0.05));
}

body.dark-mode .help-email-code {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(122, 162, 255, 0.32);
}

body.dark-mode .help-step-card {
    background: rgba(15, 23, 42, 0.45);
    border-color: var(--border-color);
}

/* --- Case View --- */
.case-text {
    background: rgba(0, 0, 0, 0.02);
    border: 1px dashed var(--border-color);
    padding: 1.25rem;
    border-radius: 16px;
    max-height: 480px;
    overflow-y: auto;
    line-height: 1.65;
    font-size: 0.95rem;
}

.case-text mark {
    background: rgba(249, 115, 22, 0.25);
    color: inherit;
    padding: 0 2px;
    border-radius: 4px;
}

body.dark-mode .case-text {
    background: rgba(15, 23, 42, 0.7);
}

/* --- Landing Hero --- */
.hero-wrap {
    border: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(0, 84, 251, 0.08), rgba(79, 70, 229, 0.04));
    border-radius: 28px;
    padding: 28px;
}

#connect {
    scroll-margin-top: 90px;
}

.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
}

.hero-title {
    font-size: clamp(2rem, 3.4vw, 3.2rem);
    line-height: 1.05;
}

.hero-subtext {
    font-size: 1rem;
    color: var(--text-muted);
}

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

.metric-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.75);
}

.metric-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    font-weight: 700;
}

.metric-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
}

.trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trust-pill {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
    color: var(--text-muted);
}

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

.step-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.75);
}

.step-index {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.step-title {
    font-weight: 800;
    color: var(--text-main);
    margin-top: 4px;
}

.step-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.fade-in-up {
    animation: fadeUp 0.7s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-reveal>* {
    opacity: 0;
    transform: translateY(14px);
    animation: staggerUp 0.7s ease forwards;
}

.stagger-reveal>*:nth-child(1) {
    animation-delay: 0.05s;
}

.stagger-reveal>*:nth-child(2) {
    animation-delay: 0.12s;
}

.stagger-reveal>*:nth-child(3) {
    animation-delay: 0.2s;
}

.stagger-reveal>*:nth-child(4) {
    animation-delay: 0.28s;
}

.stagger-reveal>*:nth-child(5) {
    animation-delay: 0.36s;
}

.stagger-reveal>*:nth-child(6) {
    animation-delay: 0.44s;
}

.stagger-reveal>*:nth-child(7) {
    animation-delay: 0.52s;
}

@keyframes staggerUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.dark-mode .hero-wrap {
    background: linear-gradient(135deg, rgba(122, 162, 255, 0.1), rgba(122, 162, 255, 0.06));
    border-color: var(--border-color);
}

body.dark-mode .metric-card,
body.dark-mode .trust-pill,
body.dark-mode .step-card {
    background: rgba(15, 23, 32, 0.65);
}

/* --- Student Landing --- */
.landing-body::before {
    background:
        radial-gradient(900px 520px at 10% -10%, rgba(0, 84, 251, 0.12), transparent 60%),
        radial-gradient(820px 420px at 90% 0%, rgba(79, 70, 229, 0.1), transparent 52%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
}

.landing-shell {
    min-height: 100vh;
    padding: 24px 0 48px;
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0 28px;
}

.landing-brand {
    font-size: 1.4rem;
    letter-spacing: 0.01em;
}

.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.landing-nav-links a,
.footer-professor-link {
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
}

.landing-nav-links a:hover,
.footer-professor-link:hover {
    color: var(--primary);
}

.landing-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.landing-hero-section {
    padding-top: 12px;
}

.landing-hero-card,
.assignment-entry-card {
    border: 1px solid var(--border-color);
    border-radius: 32px;
    padding: clamp(24px, 4vw, 40px);
    background:
        linear-gradient(135deg, rgba(0, 84, 251, 0.1), rgba(79, 70, 229, 0.04)),
        var(--card-bg);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.landing-hero-title {
    font-family: var(--heading-font);
    font-size: clamp(2.5rem, 5vw, 4.4rem);
    line-height: 0.98;
    color: var(--text-main);
    margin: 0;
}

.landing-hero-copy {
    font-size: 1.08rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 62ch;
}

.landing-trust-note {
    color: var(--text-muted);
    font-size: 0.94rem;
}

.assignment-preview-card {
    height: 100%;
}

.preview-window {
    border: 1px solid rgba(0, 84, 251, 0.12);
    border-radius: 24px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.82);
    display: grid;
    gap: 14px;
}

.preview-toolbar {
    display: flex;
    gap: 8px;
}

.preview-toolbar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.24);
}

.preview-code-block,
.preview-output-card {
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 16px;
    background: var(--card-bg);
}

.preview-chip,
.assignment-success-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(0, 84, 251, 0.12);
    color: var(--primary);
    padding: 8px 14px;
    font-size: 0.84rem;
    font-weight: 700;
}

.preview-line {
    font-family: var(--body-font);
    font-size: 0.92rem;
    color: var(--text-main);
    line-height: 1.6;
}

.preview-line-indent {
    padding-left: 20px;
}

.preview-line-indent-2 {
    padding-left: 40px;
}

.preview-output-title,
.assignment-status-label {
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.preview-output-text,
.assignment-status-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-top: 6px;
}

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

.preview-actions span {
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(79, 70, 229, 0.08);
    color: var(--text-main);
    font-size: 0.84rem;
    font-weight: 600;
}

.landing-section {
    padding-top: 56px;
}

.section-intro {
    max-width: 720px;
    margin: 0 auto 28px;
}

.landing-card-title {
    font-size: 1.35rem;
    color: var(--text-main);
    margin-bottom: 12px;
}

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

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

.landing-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    color: var(--text-main);
}

.landing-solution-copy {
    color: var(--text-main);
    font-size: 1.08rem;
    line-height: 1.7;
}

.landing-flow {
    margin-top: 8px;
}

.feature-card {
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0.9;
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(0, 84, 251, 0.12);
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 14px;
}

.differentiation-card {
    padding: clamp(24px, 4vw, 36px);
}

.landing-proof-title,
.landing-final-title {
    font-family: var(--heading-font);
    color: var(--text-main);
}

.landing-final-cta {
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: clamp(28px, 4vw, 42px);
    background: linear-gradient(135deg, rgba(0, 84, 251, 0.08), rgba(79, 70, 229, 0.06));
}

.landing-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
}

.assignment-status-card {
    border-radius: 24px;
}

body.dark-mode .landing-hero-card,
body.dark-mode .assignment-entry-card,
body.dark-mode .landing-final-cta {
    background:
        linear-gradient(135deg, rgba(122, 162, 255, 0.12), rgba(122, 162, 255, 0.05)),
        var(--card-bg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

body.dark-mode .preview-window,
body.dark-mode .landing-list-item {
    background: rgba(15, 23, 42, 0.78);
}

body.dark-mode .preview-actions span {
    background: rgba(122, 162, 255, 0.14);
}

@media(max-width: 767.98px) {
    .landing-shell {
        padding-top: 16px;
    }

    .landing-nav {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .landing-nav-actions {
        width: 100%;
        justify-content: space-between;
    }

    .landing-hero-title {
        font-size: clamp(2rem, 11vw, 3rem);
    }

    .landing-section {
        padding-top: 40px;
    }

    .landing-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* --- Assignment Wizard --- */
.assignment-shell {
    padding-bottom: 60px;
}

.assignment-page {
    padding-top: 12px;
}

.assignment-page-title {
    font-size: clamp(2.1rem, 4vw, 3.4rem);
}

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

.assignment-topbar-actions {
    display: grid;
    gap: 12px;
    min-width: 260px;
}

.assignment-status-banner {
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-main);
    font-weight: 600;
}

.assignment-status-banner[data-tone="success"],
.assignment-autosave[data-tone="success"] {
    color: #166534;
}

.assignment-status-banner[data-tone="danger"],
.assignment-autosave[data-tone="danger"] {
    color: #b91c1c;
}

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

.assignment-step {
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.assignment-step span {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 84, 251, 0.08);
    color: var(--primary);
    font-weight: 700;
}

.assignment-step.active {
    background: linear-gradient(135deg, rgba(0, 84, 251, 0.12), rgba(79, 70, 229, 0.06));
    color: var(--text-main);
}

.assignment-sidebar-card {
    position: sticky;
    top: 24px;
}

.assignment-main-grid {
    display: grid;
    gap: 20px;
}

.assignment-panel {
    border-radius: 28px;
}

.assignment-panel-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.assignment-panel-title {
    font-size: 1.35rem;
    color: var(--text-main);
}

.assignment-section-kicker {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.assignment-draft-list {
    display: grid;
    gap: 10px;
}

.assignment-draft-item {
    text-align: left;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    padding: 14px;
    display: grid;
    gap: 4px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.assignment-draft-item:hover,
.assignment-draft-item.active {
    border-color: rgba(0, 84, 251, 0.3);
    transform: translateY(-2px);
}

.assignment-draft-name {
    font-weight: 700;
    color: var(--text-main);
}

.assignment-draft-meta {
    font-size: 0.84rem;
    color: var(--text-muted);
}

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

.assignment-type-card {
    text-align: left;
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.78);
    display: grid;
    gap: 8px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.assignment-type-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 84, 251, 0.3);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.assignment-type-title {
    font-weight: 800;
    color: var(--text-main);
}

.assignment-type-copy {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.assignment-autosave,
.assignment-preview-badge,
.assignment-inline-hint {
    border-radius: 999px;
    background: rgba(0, 84, 251, 0.08);
    color: var(--primary);
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}

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

.assignment-field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.assignment-ai-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.assignment-textarea,
.assignment-codearea,
.assignment-inputarea,
.assignment-outputarea {
    min-height: 120px;
}

.assignment-code-editor {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 24px;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 26%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.08);
}

.assignment-code-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(248, 250, 252, 0.86);
}

.assignment-code-toolbar-left,
.assignment-code-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.assignment-code-dots {
    display: inline-flex;
    gap: 6px;
}

.assignment-code-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.assignment-code-dots span:nth-child(1) {
    background: #fb7185;
}

.assignment-code-dots span:nth-child(2) {
    background: #fbbf24;
}

.assignment-code-dots span:nth-child(3) {
    background: #34d399;
}

.assignment-code-file {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.01em;
}

.assignment-code-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 10px;
    background: rgba(0, 84, 251, 0.08);
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.assignment-code-pill-muted {
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-muted);
}

.assignment-code-shell {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    align-items: stretch;
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.92), rgba(255, 255, 255, 0.98));
}

.assignment-code-gutter {
    max-height: 420px;
    overflow: hidden;
    padding: 14px 0 14px 16px;
    border-right: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(241, 245, 249, 0.88);
}

.assignment-code-lines {
    margin: 0;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #94a3b8;
    text-align: right;
}

.assignment-code-lines span {
    display: block;
}

.assignment-runner-card {
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.62);
    display: grid;
    gap: 14px;
}

.assignment-runner-toolbar {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
}

.assignment-runner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.assignment-runner-title {
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
}

.assignment-runner-panel {
    display: grid;
    gap: 8px;
}

.assignment-runner-subhint {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.assignment-terminal-shell {
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    background: #0f172a;
}

.assignment-terminal-output {
    min-height: 260px;
    max-height: 360px;
    margin: 0;
    padding: 16px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: #e5e7eb;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.92rem;
    line-height: 1.55;
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(15, 23, 42, 0)),
        #0f172a;
}

.assignment-terminal-entry {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(2, 6, 23, 0.75);
}

.assignment-terminal-prompt {
    color: #60a5fa;
    font-family: "Courier New", Courier, monospace;
    font-weight: 700;
}

.assignment-terminal-input {
    background: rgba(15, 23, 42, 0.92) !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
    color: #e5e7eb !important;
    font-family: "Courier New", Courier, monospace;
}

.assignment-terminal-input::placeholder {
    color: #94a3b8;
}

.assignment-run-state {
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.assignment-run-state[data-run-tone="success"] {
    background: rgba(22, 163, 74, 0.14);
    color: #166534;
}

.assignment-run-state[data-run-tone="error"],
.assignment-run-state[data-run-tone="timeout"] {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.assignment-codearea,
.assignment-outputarea,
.assignment-preview-code,
.assignment-preview-output {
    font-family: "Courier New", Courier, monospace;
}

.assignment-codearea {
    min-height: 420px;
    max-height: 420px;
    margin: 0;
    padding: 14px 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    resize: vertical;
    box-shadow: none !important;
    tab-size: 4;
    line-height: 1.7;
    font-size: 0.94rem;
    color: #0f172a;
    overflow: auto;
}

.assignment-codearea:focus {
    border: 0;
    box-shadow: none !important;
    background: transparent;
}

.assignment-codearea::placeholder {
    color: #94a3b8;
}

.assignment-code-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 12px 16px 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(248, 250, 252, 0.92);
}

.assignment-code-footer-item {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.assignment-code-footer-item:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin-left: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.55);
    vertical-align: middle;
}

.assignment-outputreadonly {
    background: rgba(248, 250, 252, 0.95) !important;
}

.assignment-inputarea {
    min-height: 100px;
    font-family: "Courier New", Courier, monospace;
}

.assignment-outputerror {
    color: #b91c1c !important;
}

.assignment-qa-editor {
    display: grid;
    gap: 14px;
}

.assignment-qa-editor-item {
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.68);
}

.assignment-preview-frame {
    min-height: 280px;
    border: 1px dashed var(--border-color);
    border-radius: 24px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.58);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: auto;
}

.layout-switcher-bar {
    background: rgba(248, 250, 252, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 10px 16px;
    backdrop-filter: blur(6px);
}

.layout-switcher-bar .btn-group {
    gap: 4px;
}

.layout-switcher-bar .layout-switch-btn {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px !important;
    transition: all 0.2s ease;
}

.layout-switcher-bar .layout-switch-btn.active {
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
    pointer-events: none;
}

.assignment-preview-sheet {
    background: #fff;
    color: #0f172a;
    border-radius: 24px;
    padding: 40px;
    border: 1px solid #dbe5f1;
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
}

/* --- Template: Academic (Formal, serif, ruled lines) --- */
.assignment-preview-sheet.template-academic {
    font-family: "Georgia", "Times New Roman", serif;
    border-radius: 0;
    border: 2px solid #1e293b;
    padding: 32px 36px;
}

.assignment-preview-sheet.template-academic .assignment-preview-header {
    border-bottom: 2px solid #1e293b;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.assignment-preview-sheet.template-academic .assignment-preview-header h2 {
    font-family: "Georgia", serif;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.assignment-preview-sheet.template-academic .assignment-preview-section h3 {
    font-family: "Georgia", serif;
    border-bottom: 1px solid #94a3b8;
    padding-bottom: 6px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: #475569;
}

.assignment-preview-sheet.template-academic .assignment-qa-item {
    border-radius: 0;
    border: none;
    border-bottom: 1px dashed #cbd5e1;
    background: transparent;
    padding: 12px 0;
}

.assignment-preview-sheet.template-academic .assignment-preview-code {
    border-radius: 0;
    border: 1px solid #1e293b;
}

/* --- Template: Notebook (Lined paper, relaxed) --- */
.assignment-preview-sheet.template-notebook {
    background: #fffef5;
    border: none;
    border-radius: 4px;
    padding: 32px 40px 32px 72px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.08);
    position: relative;
    background-image:
        repeating-linear-gradient(transparent, transparent 31px, #e8d8c4 31px, #e8d8c4 32px);
    background-size: 100% 32px;
    line-height: 32px;
}

.assignment-preview-sheet.template-notebook::before {
    content: "";
    position: absolute;
    left: 56px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e8a4a4;
    opacity: 0.6;
}

.assignment-preview-sheet.template-notebook .assignment-preview-header {
    border-bottom: none;
    margin-bottom: 0;
}

.assignment-preview-sheet.template-notebook .assignment-preview-header h2 {
    font-family: "Caveat", "Comic Sans MS", cursive, sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #2d3748;
}

.assignment-preview-sheet.template-notebook .assignment-preview-section h3 {
    font-family: "Caveat", cursive, sans-serif;
    font-size: 1.15rem;
    color: #1d4ed8;
    border: none;
}

.assignment-preview-sheet.template-notebook .assignment-qa-item {
    background: transparent;
    border: none;
    border-radius: 0;
}

.assignment-preview-sheet.template-notebook .assignment-preview-code {
    background: rgba(30, 41, 59, 0.04);
    border: 1px solid #d5c9b1;
    border-radius: 4px;
    line-height: 1.4;
}

/* --- Template: Executive (Bold accents, thick left borders) --- */
.assignment-preview-sheet.template-executive {
    border: none;
    border-radius: 0;
    padding: 36px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border-top: 4px solid #1d4ed8;
}

.assignment-preview-sheet.template-executive .assignment-preview-header {
    border-bottom: none;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-left: 5px solid #1d4ed8;
    padding-left: 18px;
}

.assignment-preview-sheet.template-executive .assignment-preview-header h2 {
    font-weight: 900;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.assignment-preview-sheet.template-executive .assignment-preview-section h3 {
    font-weight: 800;
    font-size: 0.9rem;
    color: #1d4ed8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.assignment-preview-sheet.template-executive .assignment-qa-item {
    border-radius: 0;
    border: none;
    border-left: 4px solid #e2e8f0;
    background: #f8fafc;
    padding: 14px 18px;
    margin-bottom: 8px;
}

.assignment-preview-sheet.template-executive .assignment-qa-item:hover {
    border-left-color: #1d4ed8;
}

.assignment-preview-sheet.template-executive .assignment-preview-code {
    border-radius: 0;
    border-left: 4px solid #1d4ed8;
}

.assignment-preview-sheet.theme-dark {
    background: #111827;
    color: #e5e7eb;
    border-color: #1f2937;
}

.assignment-preview-sheet.theme-dark .assignment-preview-header {
    border-bottom-color: #1f2937;
}

.assignment-preview-sheet.theme-dark .assignment-preview-header h2,
.assignment-preview-sheet.theme-dark .assignment-preview-meta strong,
.assignment-preview-sheet.theme-dark .assignment-preview-brand {
    color: #e5e7eb;
}

.assignment-preview-sheet.theme-dark .assignment-preview-header p,
.assignment-preview-sheet.theme-dark .assignment-preview-meta span,
.assignment-preview-sheet.theme-dark .assignment-preview-caption,
.assignment-preview-sheet.theme-dark .assignment-preview-tag {
    color: #9aa4b2;
}

.assignment-preview-sheet.theme-dark .assignment-preview-code,
.assignment-preview-sheet.theme-dark .assignment-preview-output,
.assignment-preview-sheet.theme-dark .assignment-qa-item {
    background: #0f172a;
    border-color: #1f2937;
    color: #e5e7eb;
}

.assignment-preview-sheet.theme-dark .assignment-preview-terminal {
    border-color: #1f2937;
}

.assignment-preview-sheet.theme-blue {
    background: #eff6ff;
    color: #0f172a;
    border-color: #bfdbfe;
}

.assignment-preview-sheet.theme-blue .assignment-preview-header {
    border-bottom-color: #bfdbfe;
}

.assignment-preview-sheet.theme-blue .assignment-preview-code,
.assignment-preview-sheet.theme-blue .assignment-preview-output,
.assignment-preview-sheet.theme-blue .assignment-qa-item {
    background: #dbeafe;
    border-color: #bfdbfe;
}

.assignment-preview-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid #dbe5f1;
}

.assignment-preview-header h2 {
    font-size: 1.7rem;
    color: #0f172a;
    margin: 8px 0 6px;
}

.assignment-preview-header p,
.assignment-preview-meta span {
    color: #64748b;
    margin: 0;
}

.assignment-preview-brand-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    position: relative;
    padding-right: 32px;
}

.assignment-preview-brand {
    font-weight: 800;
    color: #0f172a;
}

.assignment-brand-remove {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: #dc2626;
    background: transparent;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.assignment-brand-remove:hover {
    background: #fee2e2;
    border-color: #dc2626;
    opacity: 1;
}

.assignment-preview-brand span {
    color: #2563eb;
}

.assignment-preview-editable {
    outline: none;
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.assignment-preview-editable:hover {
    background: rgba(37, 99, 235, 0.05);
}

.assignment-preview-editable:focus {
    background: rgba(37, 99, 235, 0.08);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
    border-radius: 8px;
}

.assignment-preview-output.assignment-preview-editable:focus {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 28%),
        linear-gradient(180deg, #111827, #0f172a);
    color: #e5e7eb;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), 0 0 0 2px rgba(37, 99, 235, 0.16);
    border-radius: 0 0 18px 18px;
}

.assignment-preview-output.assignment-preview-editable:hover,
.assignment-preview-output.assignment-preview-editable:focus,
.assignment-preview-output.assignment-preview-editable:focus-within,
.assignment-preview-output.assignment-preview-editable:active {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 28%),
        linear-gradient(180deg, #111827, #0f172a) !important;
    color: #e5e7eb !important;
}

.assignment-preview-editable-title:focus {
    border-radius: 12px;
}

.assignment-preview-meta {
    min-width: 180px;
    display: grid;
    gap: 12px;
}

.assignment-preview-meta strong {
    display: block;
    color: #0f172a;
    margin-top: 4px;
}

.assignment-preview-section {
    margin-bottom: 24px;
}

.assignment-preview-section h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #2563eb;
    margin-bottom: 10px;
}

.assignment-preview-body {
    line-height: 1.7;
}

.assignment-preview-terminal {
    border: 1px solid #1e293b;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.assignment-preview-terminal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: linear-gradient(180deg, #111827, #0f172a);
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.assignment-preview-terminal-dots {
    display: flex;
    gap: 7px;
}

.assignment-preview-terminal-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.assignment-preview-terminal-dots span:nth-child(1) {
    background: #f97316;
}

.assignment-preview-terminal-dots span:nth-child(2) {
    background: #facc15;
}

.assignment-preview-terminal-dots span:nth-child(3) {
    background: #22c55e;
}

.assignment-preview-terminal-title {
    color: #94a3b8;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.assignment-preview-code,
.assignment-preview-output {
    background: #f8fafc;
    border: 1px solid #dbe5f1;
    border-radius: 16px;
    padding: 16px;
    white-space: pre-wrap;
    line-height: 1.5;
    margin: 0;
}

.assignment-preview-code-editable {
    outline: none;
}

.assignment-preview-output-editable {
    outline: none;
}

.assignment-preview-output {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 28%),
        linear-gradient(180deg, #111827, #0f172a);
    border: 0;
    border-radius: 0;
    color: #e5e7eb;
    caret-color: #e5e7eb;
    padding: 18px 20px;
    min-height: 140px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.assignment-preview-output * {
    color: inherit !important;
}

.assignment-preview-output::selection,
.assignment-preview-output *::selection {
    background: rgba(96, 165, 250, 0.35);
    color: #e5e7eb;
}

.terminal-part-prompt {
    color: #93c5fd;
}

.terminal-part-input {
    color: #f8fafc;
    font-weight: 700;
}

.terminal-part-output {
    color: #cbd5e1;
}

.assignment-preview-tag,
.assignment-preview-caption {
    color: #475569;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.assignment-qa-list {
    display: grid;
    gap: 16px;
}

.assignment-qa-item {
    border: 1px solid #dbe5f1;
    border-radius: 18px;
    padding: 16px;
    background: #f8fafc;
}

.assignment-qa-question {
    font-weight: 700;
    margin-bottom: 10px;
}

.assignment-empty-state {
    border: 1px dashed var(--border-color);
    border-radius: 18px;
    padding: 24px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.5);
    text-align: center;
}

body.dark-mode .assignment-status-banner,
body.dark-mode .assignment-step,
body.dark-mode .assignment-draft-item,
body.dark-mode .assignment-type-card,
body.dark-mode .assignment-runner-card,
body.dark-mode .assignment-qa-editor-item,
body.dark-mode .assignment-empty-state,
body.dark-mode .assignment-preview-frame {
    background: rgba(15, 23, 42, 0.75);
}

body.dark-mode .assignment-run-state {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
}

body.dark-mode .assignment-run-state[data-run-tone="success"] {
    background: rgba(34, 197, 94, 0.16);
    color: #bbf7d0;
}

body.dark-mode .assignment-run-state[data-run-tone="error"],
body.dark-mode .assignment-run-state[data-run-tone="timeout"] {
    background: rgba(248, 113, 113, 0.14);
    color: #fecaca;
}

body.dark-mode .assignment-outputreadonly {
    background: rgba(15, 23, 42, 0.92) !important;
}

body.dark-mode .assignment-terminal-shell {
    border-color: #1f2937;
}

body.dark-mode .assignment-code-editor {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 28%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.94));
    border-color: rgba(148, 163, 184, 0.16);
    box-shadow: 0 22px 48px rgba(2, 6, 23, 0.34);
}

body.dark-mode .assignment-code-toolbar,
body.dark-mode .assignment-code-footer {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.12);
}

body.dark-mode .assignment-code-file {
    color: #e2e8f0;
}

body.dark-mode .assignment-code-shell {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.94));
}

body.dark-mode .assignment-code-gutter {
    background: rgba(2, 6, 23, 0.62);
    border-color: rgba(148, 163, 184, 0.12);
}

body.dark-mode .assignment-codearea {
    color: #e2e8f0;
}

body.dark-mode .assignment-codearea::placeholder {
    color: #64748b;
}

body.dark-mode .assignment-code-footer-item {
    color: #94a3b8;
}

body.dark-mode .assignment-preview-sheet {
    background: #111827;
    color: #e5e7eb;
    border-color: #1f2937;
}

body.dark-mode .assignment-preview-header {
    border-bottom-color: #1f2937;
}

body.dark-mode .assignment-preview-header h2,
body.dark-mode .assignment-preview-meta strong,
body.dark-mode .assignment-preview-brand {
    color: #e5e7eb;
}

body.dark-mode .assignment-preview-header p,
body.dark-mode .assignment-preview-meta span,
body.dark-mode .assignment-preview-caption,
body.dark-mode .assignment-preview-tag {
    color: #9aa4b2;
}

body.dark-mode .assignment-preview-code,
body.dark-mode .assignment-preview-output,
body.dark-mode .assignment-qa-item {
    background: #0f172a;
    border-color: #1f2937;
    color: #e5e7eb;
}

body.dark-mode .assignment-preview-terminal {
    border-color: #1f2937;
}

@media(max-width: 991.98px) {
    .assignment-topbar {
        padding: 24px;
        border-radius: 24px;
        text-align: center;
    }

    .assignment-topbar,
    .assignment-panel-header,
    .assignment-preview-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .assignment-topbar-actions {
        width: 100%;
        margin-top: 16px;
    }

    .assignment-status-banner {
        max-width: 100%;
        margin-bottom: 12px;
    }

    .assignment-runner-toolbar,
    .assignment-code-toolbar,
    .assignment-field-label-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .assignment-ai-button {
        width: 100%;
        justify-content: center;
    }

    .assignment-code-shell {
        grid-template-columns: 40px 1fr;
    }

    .assignment-stepper {
        display: flex;
        overflow-x: auto;
        padding-bottom: 8px;
        gap: 10px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .assignment-stepper::-webkit-scrollbar {
        display: none;
    }

    .assignment-step {
        flex: 0 0 160px;
        min-height: 54px;
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .assignment-sidebar-card {
        position: static;
        margin-top: 24px;
    }

    /* Mobile Sticky Action Bar */
    .mobile-assignment-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1050;
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
        display: flex;
        gap: 12px;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05);
        animation: slide-up 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    }

    body.dark-mode .mobile-assignment-actions {
        background: rgba(17, 17, 17, 0.85);
        border-color: #222;
    }

    .mobile-assignment-actions .btn {
        flex: 1;
        font-weight: 700;
        padding: 14px;
    }

    /* Landing Page Mobile Refinements */
    .landing-nav {
        top: 0;
        margin-top: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 12px 16px;
    }

    .landing-brand img {
        height: 60px !important;
    }

    .landing-hero-title {
        font-size: 2.5rem;
        max-width: 100%;
        text-align: center;
    }

    .landing-hero-copy {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
        font-size: 1rem;
    }

    .landing-hero-metrics {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .landing-hero-section {
        padding-left: 12px;
        padding-right: 12px;
    }

    .landing-hero-card {
        padding: 24px 16px;
        border-radius: 24px;
    }

    .landing-hero-card .d-flex {
        justify-content: center;
    }

    .landing-trust-note {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    .assignment-preview-card {
        margin-top: 20px;
        transform: scale(0.95);
    }

    .landing-section {
        padding-top: 40px;
    }

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

    .landing-nav-actions .btn-primary {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

@keyframes slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media(max-width: 575.98px) {
    .assignment-stepper {
        grid-template-columns: 1fr;
    }

    .assignment-form-actions {
        flex-direction: column;
    }

    .assignment-form-actions .btn {
        width: 100%;
    }
}

/* --- Student Refresh --- */
body.landing-body {
    background:
        radial-gradient(1200px 560px at 8% -10%, rgba(0, 84, 251, 0.14), transparent 58%),
        radial-gradient(900px 520px at 100% 0%, rgba(79, 70, 229, 0.10), transparent 52%),
        linear-gradient(180deg, #f5f8ff 0%, #f8fafc 42%, #eef4ff 100%);
}

body.landing-body::before {
    background:
        linear-gradient(rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.56)),
        repeating-linear-gradient(90deg, transparent 0 118px, rgba(37, 99, 235, 0.035) 118px 119px);
    opacity: 0.9;
}

.landing-shell {
    position: relative;
}

.landing-nav {
    position: sticky;
    top: 18px;
    z-index: 30;
    margin-top: 18px;
    margin-bottom: 24px;
    padding: 14px 18px;
    border: 1px solid rgba(219, 229, 241, 0.92);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.landing-brand {
    font-size: 1.22rem;
    letter-spacing: 0.02em;
}

.landing-nav-links a {
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
    margin: 0 12px;
}

.landing-hero-section {
    padding-top: 10px;
}

.landing-hero-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(219, 229, 241, 0.95);
    border-radius: 36px;
    padding: 34px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 255, 0.9)),
        linear-gradient(180deg, rgba(59, 130, 246, 0.05), transparent 50%);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.10);
}

.landing-hero-card::after {
    content: "";
    position: absolute;
    inset: auto 22px 22px auto;
    width: 160px;
    height: 160px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(37, 99, 235, 0));
    pointer-events: none;
}

.landing-hero-title {
    max-width: 11ch;
    font-size: clamp(2.8rem, 5vw, 4.8rem);
    line-height: 0.94;
    margin-bottom: 18px;
}

.landing-hero-copy {
    max-width: 600px;
    font-size: 1.08rem;
    line-height: 1.7;
    color: #51627f;
}

.landing-trust-note {
    max-width: 520px;
    font-size: 0.92rem;
    color: #5c6d88;
}

.landing-hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 680px;
}

.landing-metric-card {
    border: 1px solid rgba(219, 229, 241, 0.92);
    border-radius: 20px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.landing-metric-label {
    display: block;
    margin-bottom: 6px;
    color: #7b8ba5;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.landing-metric-card strong {
    color: #14213d;
    font-size: 0.95rem;
}

.assignment-preview-card {
    position: relative;
    padding: 18px;
    border-radius: 32px;
    background: linear-gradient(180deg, #0f172a, #16213e);
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.24);
}

.preview-window {
    border-radius: 26px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, #101826, #0f172a);
}

.preview-toolbar {
    background: rgba(255, 255, 255, 0.04);
    padding: 14px 16px;
}

.preview-code-block {
    padding: 18px 20px 14px;
}

.preview-output-card {
    margin: 0 20px 16px;
    border-radius: 18px;
    border: 1px solid rgba(96, 165, 250, 0.22);
    background: rgba(15, 23, 42, 0.72);
}

.preview-actions {
    padding: 0 20px 20px;
}

.landing-orbit-card {
    position: absolute;
    z-index: 2;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.92);
    color: #1d4ed8;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.landing-orbit-card-top {
    top: -10px;
    right: 26px;
}

.landing-orbit-card-bottom {
    left: -8px;
    bottom: 18px;
}

.landing-section {
    padding-top: 30px;
    padding-bottom: 10px;
}

.problem-card,
.solution-card,
.feature-card,
.differentiation-card,
.landing-final-cta,
.social-proof {
    border-radius: 30px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.feature-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 255, 0.92));
}

.feature-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(79, 70, 229, 0.10));
    color: #1d4ed8;
    font-size: 1.2rem;
}

.assignment-shell .landing-nav {
    position: relative;
    top: 0;
    margin-bottom: 28px;
}

.assignment-page {
    position: relative;
}

.assignment-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    padding: 30px 30px 26px;
    border: 1px solid rgba(219, 229, 241, 0.95);
    border-radius: 34px;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 255, 0.9));
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
}

.assignment-page-title {
    max-width: 12ch;
}

.assignment-studio-strip {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
}

.assignment-studio-strip span {
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #1e293b;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.assignment-status-banner {
    max-width: 360px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(219, 229, 241, 0.92);
    border-radius: 20px;
    padding: 14px 16px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.assignment-stepper {
    margin-top: 24px;
    margin-bottom: 24px;
    gap: 14px;
}

.assignment-step {
    min-height: 64px;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 20px;
    border: 1px solid rgba(219, 229, 241, 0.92);
}

.assignment-sidebar-card,
.assignment-panel {
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.assignment-sidebar-card {
    border-radius: 30px;
}

.assignment-sidebar-copy {
    margin-bottom: 16px;
    color: #61738e;
    line-height: 1.65;
}

.assignment-draft-item {
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 247, 255, 0.88));
}

.assignment-panel {
    border-radius: 32px;
    padding: 28px;
}

.assignment-type-card {
    min-height: 180px;
    align-content: end;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 246, 255, 0.92));
    border: 1px solid rgba(219, 229, 241, 0.96);
}

.assignment-preview-frame {
    min-height: 420px;
    border-style: solid;
    border-width: 1px;
    border-color: rgba(219, 229, 241, 0.96);

    .assignment-preview-card {
        position: relative;
        padding: 18px;
        border-radius: 32px;
        background: linear-gradient(180deg, #0f172a, #16213e);
        box-shadow: 0 30px 70px rgba(15, 23, 42, 0.24);
    }

    .preview-window {
        border-radius: 26px;
        overflow: hidden;
        border: 1px solid rgba(148, 163, 184, 0.18);
        background: linear-gradient(180deg, #101826, #0f172a);
    }

    .preview-toolbar {
        background: rgba(255, 255, 255, 0.04);
        padding: 14px 16px;
    }

    .preview-code-block {
        padding: 18px 20px 14px;
    }

    .preview-output-card {
        margin: 0 20px 16px;
        border-radius: 18px;
        border: 1px solid rgba(96, 165, 250, 0.22);
        background: rgba(15, 23, 42, 0.72);
    }

    .preview-actions {
        padding: 0 20px 20px;
    }

    .landing-orbit-card {
        position: absolute;
        z-index: 2;
        border-radius: 999px;
        padding: 10px 14px;
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        background: rgba(255, 255, 255, 0.92);
        color: #1d4ed8;
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
    }

    .landing-orbit-card-top {
        top: -10px;
        right: 26px;
    }

    .landing-orbit-card-bottom {
        left: -8px;
        bottom: 18px;
    }

    .landing-section {
        padding-top: 30px;
        padding-bottom: 10px;
    }

    .problem-card,
    .solution-card,
    .feature-card,
    .differentiation-card,
    .landing-final-cta,
    .social-proof {
        border-radius: 30px;
        box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
    }

    .feature-card {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 255, 0.92));
    }

    .feature-icon {
        width: 52px;
        height: 52px;
        margin-bottom: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 16px;
        background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(79, 70, 229, 0.10));
        color: #1d4ed8;
        font-size: 1.2rem;
    }

    .assignment-shell .landing-nav {
        margin-bottom: 28px;
    }

    .assignment-page {
        position: relative;
    }

    .assignment-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 24px;
        padding: 30px 30px 26px;
        border: 1px solid rgba(219, 229, 241, 0.95);
        border-radius: 34px;
        background:
            radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 24%),
            linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 255, 0.9));
        box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
    }

    .assignment-page-title {
        max-width: 12ch;
    }

    .assignment-studio-strip {
        display: inline-flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .assignment-studio-strip span {
        padding: 9px 12px;
        border-radius: 999px;
        background: rgba(15, 23, 42, 0.06);
        color: #1e293b;
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .assignment-status-banner {
        max-width: 360px;
        background: rgba(255, 255, 255, 0.76);
        border: 1px solid rgba(219, 229, 241, 0.92);
        border-radius: 20px;
        padding: 14px 16px;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    }

    .assignment-stepper {
        margin-top: 24px;
        margin-bottom: 24px;
        gap: 14px;
    }

    .assignment-step {
        min-height: 64px;
        background: rgba(255, 255, 255, 0.72);
        border-radius: 20px;
        border: 1px solid rgba(219, 229, 241, 0.92);
    }

    .assignment-sidebar-card,
    .assignment-panel {
        background: rgba(255, 255, 255, 0.84);
        box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    }

    .assignment-sidebar-card {
        border-radius: 30px;
    }

    .assignment-sidebar-copy {
        margin-bottom: 16px;
        color: #61738e;
        line-height: 1.65;
    }

    .assignment-draft-item {
        border-radius: 18px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 247, 255, 0.88));
    }

    .assignment-panel {
        border-radius: 32px;
        padding: 28px;
    }

    .assignment-type-card {
        min-height: 180px;
        align-content: end;
        background:
            radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 30%),
            linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 246, 255, 0.92));
        border: 1px solid rgba(219, 229, 241, 0.96);
    }

    .assignment-preview-frame {
        min-height: 420px;
        border-style: solid;
        border-width: 1px;
        border-color: rgba(219, 229, 241, 0.96);
        background:
            linear-gradient(rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.76)),
            repeating-linear-gradient(90deg, transparent 0 108px, rgba(37, 99, 235, 0.035) 108px 109px);
    }

    /* Dark Mode – Refreshed Design */
    body.dark-mode.landing-body {
        background: linear-gradient(180deg, #0a0a0a, #111111);
        color: #e5e7eb;
    }

    /* Nav and panels */
    body.dark-mode .landing-nav,
    body.dark-mode .assignment-topbar,
    body.dark-mode .assignment-sidebar-card,
    body.dark-mode .assignment-panel,
    body.dark-mode .assignment-step,
    body.dark-mode .assignment-status-banner,
    body.dark-mode .landing-hero-card,
    body.dark-mode .landing-metric-card,
    body.dark-mode .assignment-type-card,
    body.dark-mode .assignment-draft-item {
        background: #111111;
        border-color: #222222;
        color: #e5e7eb;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    }

    /* Accent for interactive elements */
    body.dark-mode a,
    body.dark-mode .btn-primary {
        color: #2563eb;
    }

    /* Studio strip tags */
    body.dark-mode .assignment-studio-strip span {
        background: rgba(37, 99, 235, 0.15);
        color: #e5e7eb;
    }

    /* Image preview wrapper */
    body.dark-mode .assignment-image-preview-wrapper {
        background: rgba(255, 255, 255, 0.03);
    }


    @media(max-width: 991.98px) {
        .landing-nav {
            top: 12px;
        }

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

        .assignment-topbar {
            grid-template-columns: 1fr;
        }
    }

    /* --- Utilities --- */
    .avatar-box {
        width: 40px;
        height: 40px;
        background: var(--primary);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        font-weight: 700;
    }

    /* --- Output Image Support --- */
    .assignment-image-preview-wrapper {
        margin-top: 12px;
        padding: 12px;
        background: rgba(0, 0, 0, 0.03);
        border-radius: 16px;
        text-align: center;
    }

    .assignment-image-preview-wrapper img {
        max-height: 250px;
        object-fit: contain;
        background: #fff;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    }

    body.dark-mode .assignment-image-preview-wrapper {
        background: rgba(255, 255, 255, 0.05);
    }

    .assignment-preview-image-container {
        margin: 18px 0;
        border-radius: 12px;
        overflow: hidden;
    }
}

/* --- Academic OS Rebrand --- */
.mobile-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.mobile-brand-copy strong,
.sidebar-brand-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-main);
}

.mobile-brand-copy span,
.sidebar-brand-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.sidebar-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-section-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-label {
    margin: 14px 14px 4px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.nav-divider {
    list-style: none;
    height: 1px;
    margin: 10px 12px;
    background: rgba(148, 163, 184, 0.18);
}

.nav-link {
    justify-content: space-between;
}

.nav-link-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.nav-link-button {
    width: calc(100% - 24px);
    border: 0;
    background: transparent;
    text-align: left;
}

.nav-link-badge,
.workspace-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    background: rgba(0, 84, 251, 0.1);
    color: var(--primary);
}

.nav-link-badge.muted,
.workspace-pill.muted {
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-muted);
}

.workspace-hero-card {
    padding: 2rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(241,245,249,0.92));
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.workspace-hero-title,
.workspace-section-title {
    font-family: var(--heading-font);
    font-size: clamp(1.6rem, 2vw, 2.2rem);
    line-height: 1.05;
    margin: 0;
}

.workspace-hero-copy,
.workspace-panel-copy {
    color: var(--text-muted);
    line-height: 1.65;
}

.workspace-summary-grid,
.workspace-overview-grid,
.assistant-channel-grid {
    display: grid;
    gap: 12px;
}

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

.workspace-summary-item,
.workspace-overview-stat,
.assistant-channel-card,
.workspace-module-card,
.workspace-panel {
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.88);
}

.workspace-summary-item,
.workspace-overview-stat {
    border-radius: 18px;
    padding: 16px;
}

.workspace-summary-item span,
.workspace-overview-stat span,
.workspace-mini-meta,
.workspace-section-kicker {
    display: block;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.workspace-summary-item strong,
.workspace-overview-stat strong,
.workspace-mini-title {
    display: block;
    margin-top: 6px;
    color: var(--text-main);
}

.workspace-panel,
.workspace-module-card,
.assistant-channel-card {
    border-radius: 22px;
    padding: 1.5rem;
}

.workspace-overview-grid,
.assistant-channel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workspace-recent-strip,
.assistant-command-panel,
.assistant-example-flow {
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    padding-top: 1.25rem;
}

.workspace-activity-list,
.assistant-channel-list,
.assistant-roadmap-list,
.assistant-side-links {
    display: grid;
    gap: 12px;
}

.workspace-activity-item,
.assistant-channel-list > div,
.assistant-roadmap-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.9);
}

.workspace-activity-item strong,
.assistant-channel-list strong,
.assistant-roadmap-list strong {
    display: block;
}

.workspace-activity-item span,
.assistant-channel-list span,
.assistant-roadmap-list span {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.workspace-activity-score {
    font-weight: 800;
    color: var(--primary);
}

.workspace-empty-inline {
    padding: 14px 16px;
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    color: var(--text-muted);
}

.workspace-module-head,
.assistant-channel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.workspace-module-head i,
.assistant-channel-head i {
    font-size: 1.25rem;
    color: var(--primary);
}

.workspace-module-card h4,
.assistant-channel-card h4 {
    margin-bottom: 10px;
}

.workspace-module-card p,
.assistant-channel-card p {
    color: var(--text-muted);
    min-height: 72px;
}

.workspace-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mobile-bottom-nav-os {
    grid-template-columns: repeat(5, 1fr);
}

body.dark-mode .workspace-hero-card,
body.dark-mode .workspace-panel,
body.dark-mode .workspace-module-card,
body.dark-mode .assistant-channel-card,
body.dark-mode .workspace-summary-item,
body.dark-mode .workspace-overview-stat,
body.dark-mode .workspace-activity-item,
body.dark-mode .assistant-channel-list > div,
body.dark-mode .assistant-roadmap-list > div {
    background: #111827;
    border-color: #1f2937;
}

@media (max-width: 991.98px) {
    .workspace-summary-grid,
    .workspace-overview-grid,
    .assistant-channel-grid {
        grid-template-columns: 1fr;
    }

    .workspace-hero-card {
        padding: 1.4rem;
    }
}

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

.sidebar-search-trigger,
.workspace-header-btn,
.workspace-header-icon,
.sidebar-icon-btn {
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.88);
    color: var(--text-main);
}

.sidebar-search-trigger {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border-radius: 16px;
    padding: 12px 14px;
    text-align: left;
}

.sidebar-search-trigger span {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.sidebar-search-trigger kbd,
.workspace-command-input kbd,
.workspace-search-input-row kbd {
    border-radius: 8px;
    padding: 3px 7px;
    font-size: 0.72rem;
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

.sidebar-context-card,
.sidebar-sections-card,
.workspace-command-card,
.workspace-alerts-panel .offcanvas-body {
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: rgba(255,255,255,0.9);
}

.sidebar-context-card,
.sidebar-sections-card {
    padding: 16px;
}

.sidebar-context-label,
.sidebar-sections-copy {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.sidebar-context-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.sidebar-context-grid span {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.sidebar-context-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 0.84rem;
}

.sidebar-icon-btn,
.workspace-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.sidebar-section-chip {
    border: 1px solid var(--border-color);
    background: rgba(248,250,252,0.9);
    color: var(--text-main);
    border-radius: 999px;
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
}

.sidebar-section-chip.is-active {
    color: var(--primary);
    border-color: rgba(0,84,251,0.18);
    background: rgba(0,84,251,0.08);
}

.workspace-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 700;
}

.workspace-header-icon {
    position: relative;
}

.workspace-header-dot {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
}

.workspace-context-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media(max-width: 991.98px) {
    .workspace-context-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
        margin-bottom: 16px !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .workspace-context-bar::-webkit-scrollbar {
        display: none;
    }
    .workspace-context-chip {
        flex-shrink: 0;
    }
}

.workspace-context-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.82);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.workspace-command-card {
    padding: 1.6rem;
}

.workspace-command-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.workspace-command-input {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(0,84,251,0.18);
    border-radius: 20px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(0,84,251,0.08), rgba(79,70,229,0.05), rgba(255,255,255,0.92));
    color: var(--text-main);
    text-align: left;
}

.workspace-command-input i {
    color: var(--primary);
    font-size: 1.1rem;
}

.workspace-command-input span {
    color: var(--text-muted);
}

.workspace-command-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.workspace-command-chip {
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.88);
    border-radius: 999px;
    padding: 9px 12px;
    font-size: 0.82rem;
    color: var(--text-main);
}

.workspace-section-list,
.workspace-task-list,
.workspace-schedule-list,
.workspace-service-grid {
    display: grid;
    gap: 12px;
}

.workspace-section-item,
.workspace-schedule-item,
.workspace-service-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: rgba(248,250,252,0.9);
}

.workspace-section-item span,
.workspace-schedule-item span,
.workspace-service-item span {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.workspace-task-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(148,163,184,0.14);
}

.workspace-task-item:last-child {
    border-bottom: 0;
}

.workspace-task-item i {
    font-size: 0.56rem;
    margin-top: 7px;
    color: var(--primary);
}

.workspace-search-shell {
    padding: 18px;
}

.workspace-search-input-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

.workspace-search-input-row i {
    color: var(--primary);
}

.workspace-search-input-row input {
    background: transparent;
    color: var(--text-main);
}

.workspace-search-suggestions {
    display: grid;
    gap: 10px;
    padding-top: 14px;
}

.workspace-search-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.workspace-search-item {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px 14px;
    text-align: left;
    background: rgba(248,250,252,0.9);
    color: var(--text-main);
}

.workspace-alerts-panel {
    width: min(420px, 100vw);
}

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

.workspace-alert-item {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: rgba(248,250,252,0.9);
}

.workspace-alert-item strong {
    display: block;
    margin-bottom: 5px;
}

.workspace-alert-item span {
    color: var(--text-muted);
    font-size: 0.86rem;
}

body.dark-mode .sidebar-search-trigger,
body.dark-mode .workspace-header-btn,
body.dark-mode .workspace-header-icon,
body.dark-mode .sidebar-icon-btn,
body.dark-mode .sidebar-context-card,
body.dark-mode .sidebar-sections-card,
body.dark-mode .workspace-command-card,
body.dark-mode .workspace-search-item,
body.dark-mode .workspace-alert-item,
body.dark-mode .workspace-section-item,
body.dark-mode .workspace-schedule-item,
body.dark-mode .workspace-service-item,
body.dark-mode .workspace-command-chip,
body.dark-mode .workspace-context-chip {
    background: #111827;
    border-color: #1f2937;
}

@media (max-width: 991.98px) {
    .sidebar-context-grid {
        grid-template-columns: 1fr;
    }

    .workspace-command-head {
        flex-direction: column;
    }

    .workspace-command-input {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .workspace-command-input kbd {
        display: none;
    }
}

/* --- Avatar Box Styles --- */
.avatar-box {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50% !important;
    overflow: hidden;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    vertical-align: middle;
}

.avatar-box img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

.avatar-box:hover {
    transform: scale(1.05);
}

.avatar-box.avatar-sm {
    width: 30px;
    height: 30px;
    font-size: 0.65rem;
}

.avatar-box.avatar-md {
    width: 34px;
    height: 34px;
    font-size: 0.72rem;
}
