:root {
    color-scheme: light;
    --bg: #fbfefe;
    --surface: rgba(255, 255, 255, 0.8);
    --surface-strong: rgba(255, 255, 255, 0.92);
    --ink: #122228;
    --muted: rgba(18, 34, 40, 0.62);
    --line: rgba(18, 34, 40, 0.09);
    --accent: #ff9900;
    --accent-soft: rgba(255, 153, 0, 0.16);
    --accent-strong: #e47911;
    --shadow: 0 30px 80px rgba(16, 30, 35, 0.08);
    --topbar-border: rgba(255, 255, 255, 0.72);
    --topbar-bg: rgba(255, 255, 255, 0.6);
    --topbar-shadow: 0 12px 34px rgba(17, 17, 17, 0.06);
    --topbar-bg-compact: rgba(255, 255, 255, 0.82);
    --topbar-shadow-compact: 0 16px 40px rgba(17, 17, 17, 0.08);
    --hero-backdrop: radial-gradient(circle at 18% 30%, rgba(255, 153, 0, 0.12), transparent 32%), radial-gradient(circle at 82% 32%, rgba(255, 153, 0, 0.1), transparent 28%);
    --heading-gradient: linear-gradient(180deg, #13242a 0%, #163036 100%);
    --button-ghost-bg: rgba(255, 255, 255, 0.66);
    --pointer-glow: radial-gradient(circle 180px at var(--pointer-x) var(--pointer-y), rgba(255, 255, 255, 0.42), transparent 72%);
    --device-glow-fill: radial-gradient(circle, rgba(255, 153, 0, 0.18), transparent 68%);
    --device-shell: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(241, 249, 250, 0.9));
    --device-border: rgba(255, 255, 255, 0.95);
    --device-rim: rgba(255, 255, 255, 0.72);
    --radius-xl: 34px;
    --radius-lg: 24px;
    --max-width: 1180px;
    --pointer-x: 50%;
    --pointer-y: 18%;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0b1115;
        --surface: rgba(14, 24, 29, 0.78);
        --surface-strong: rgba(16, 28, 33, 0.9);
        --ink: #eef7f8;
        --muted: rgba(238, 247, 248, 0.66);
        --line: rgba(238, 247, 248, 0.1);
        --accent: #ff9900;
        --accent-soft: rgba(255, 153, 0, 0.1);
        --accent-strong: #ffb84d;
        --shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
        --topbar-border: rgba(255, 255, 255, 0.08);
        --topbar-bg: rgba(11, 17, 21, 0.62);
        --topbar-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
        --topbar-bg-compact: rgba(12, 19, 24, 0.84);
        --topbar-shadow-compact: 0 16px 40px rgba(0, 0, 0, 0.3);
        --hero-backdrop: none;
        --heading-gradient: linear-gradient(180deg, #f3fbfc 0%, #ffd28a 100%);
        --button-ghost-bg: rgba(255, 255, 255, 0.04);
        --pointer-glow: radial-gradient(circle 180px at var(--pointer-x) var(--pointer-y), rgba(255, 255, 255, 0.08), transparent 72%);
        --device-glow-fill: none;
        --device-shell: linear-gradient(180deg, rgba(15, 26, 31, 0.96), rgba(10, 18, 22, 0.92));
        --device-border: rgba(255, 255, 255, 0.08);
        --device-rim: rgba(255, 255, 255, 0.12);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b1115;
    --surface: rgba(14, 24, 29, 0.78);
    --surface-strong: rgba(16, 28, 33, 0.9);
    --ink: #eef7f8;
    --muted: rgba(238, 247, 248, 0.66);
    --line: rgba(238, 247, 248, 0.1);
    --accent: #ff9900;
    --accent-soft: rgba(255, 153, 0, 0.1);
    --accent-strong: #ffb84d;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
    --topbar-border: rgba(255, 255, 255, 0.08);
    --topbar-bg: rgba(11, 17, 21, 0.62);
    --topbar-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
    --topbar-bg-compact: rgba(12, 19, 24, 0.84);
    --topbar-shadow-compact: 0 16px 40px rgba(0, 0, 0, 0.3);
    --hero-backdrop: none;
    --heading-gradient: linear-gradient(180deg, #f3fbfc 0%, #ffd28a 100%);
    --button-ghost-bg: rgba(255, 255, 255, 0.04);
    --pointer-glow: radial-gradient(circle 180px at var(--pointer-x) var(--pointer-y), rgba(255, 255, 255, 0.08), transparent 72%);
    --device-glow-fill: none;
    --device-shell: linear-gradient(180deg, rgba(15, 26, 31, 0.96), rgba(10, 18, 22, 0.92));
    --device-border: rgba(255, 255, 255, 0.08);
    --device-rim: rgba(255, 255, 255, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Instrument Sans", sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 88%, white 12%) 52%, color-mix(in srgb, var(--bg) 94%, #ffb84d 6%) 100%);
    overflow-x: hidden;
    position: relative;
}

body::before,
body::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
}

body::before {
    top: -120px;
    right: -80px;
    width: 360px;
    height: 360px;
    background: rgba(255, 153, 0, 0.12);
}

body::after {
    top: 20%;
    left: -140px;
    width: 320px;
    height: 320px;
    background: rgba(255, 153, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) body::before,
    :root:not([data-theme="light"]) body::after {
        display: none;
    }
}

:root[data-theme="dark"] body::before,
:root[data-theme="dark"] body::after {
    display: none;
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    min-height: 100vh;
    position: relative;
    isolation: isolate;
}

.page-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: var(--pointer-glow);
    mix-blend-mode: screen;
    opacity: 0.65;
}

.topbar {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 20;
    width: min(calc(100% - 24px), 1380px);
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 17px 22px;
    transform: translateX(-50%);
    border: 1px solid var(--topbar-border);
    border-radius: 999px;
    background: var(--topbar-bg);
    backdrop-filter: blur(18px);
    box-shadow: var(--topbar-shadow);
    transition: width 0.35s ease, padding 0.35s ease, box-shadow 0.35s ease, background-color 0.35s ease;
}

.topbar.is-compact {
    width: min(calc(100% - 56px), 940px);
    padding: 12px 16px;
    background: var(--topbar-bg-compact);
    box-shadow: var(--topbar-shadow-compact);
}

.brand,
.topnav a,
.button {
    letter-spacing: -0.03em;
}

.brand {
    display: inline-flex;
    align-items: center;
    position: relative;
    flex: 0 0 74px;
    width: 74px;
    height: 42px;
    font-family: "Manrope", sans-serif;
    font-weight: 800;
    line-height: 1;
    overflow: visible;
}

.brand-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    transform: scale(2);
    transform-origin: left center;
    display: block;
    position: absolute;
    left: 0;
    top: 50%;
    margin-top: -25px;
    transition: opacity 0.3s ease;
}

.header-wordmark {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(64px, 10.7vw);
    height: 22px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.header-wordmark-logo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.saga-watermark {
    position: fixed;
    right: clamp(18px, 2.6vw, 42px);
    bottom: clamp(28px, 3.2vw, 52px);
    z-index: 8;
    width: min(106px, 20.7vw);
    height: 36px;
    pointer-events: none;
    opacity: 0.42;
}

.saga-watermark-logo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* Light mode - show white logo, hide dark logo */
:root:not([data-theme="dark"]) .brand-logo-light {
    opacity: 1;
}

:root:not([data-theme="dark"]) .header-wordmark-light {
    opacity: 1;
}

:root:not([data-theme="dark"]) .saga-watermark-light {
    opacity: 1;
}

:root:not([data-theme="dark"]) .brand-logo-dark {
    opacity: 0;
}

:root:not([data-theme="dark"]) .header-wordmark-dark {
    opacity: 0;
}

:root:not([data-theme="dark"]) .saga-watermark-dark {
    opacity: 0;
}

/* Dark mode - show dark logo, hide white logo */
:root[data-theme="dark"] .brand-logo-light {
    opacity: 0;
}

:root[data-theme="dark"] .header-wordmark-light {
    opacity: 0;
}

:root[data-theme="dark"] .saga-watermark-light {
    opacity: 0;
}

:root[data-theme="dark"] .brand-logo-dark {
    opacity: 1;
}

:root[data-theme="dark"] .header-wordmark-dark {
    opacity: 1;
}

:root[data-theme="dark"] .saga-watermark-dark {
    opacity: 1;
}

/* Respect system preference when no manual theme is set */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) .brand-logo-light {
        opacity: 0;
    }

    :root:not([data-theme="light"]):not([data-theme="dark"]) .header-wordmark-light {
        opacity: 0;
    }

    :root:not([data-theme="light"]):not([data-theme="dark"]) .saga-watermark-light {
        opacity: 0;
    }

    :root:not([data-theme="light"]):not([data-theme="dark"]) .brand-logo-dark {
        opacity: 1;
    }

    :root:not([data-theme="light"]):not([data-theme="dark"]) .header-wordmark-dark {
        opacity: 1;
    }

    :root:not([data-theme="light"]):not([data-theme="dark"]) .saga-watermark-dark {
        opacity: 1;
    }
}

.topnav {
    display: flex;
    gap: 24px;
    margin-left: auto;
}

.topnav a,
.topnav button {
    position: relative;
    font-size: 0.95rem;
    color: var(--muted);
    transition: color 0.25s ease;
}

.topnav button {
    border: 0;
    padding: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.topnav a::after,
.topnav button::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}

.topnav a.is-active,
.topnav button.is-active {
    color: var(--ink);
}

.topnav a.is-active::after,
.topnav button.is-active::after {
    transform: scaleX(1);
}

.theme-toggle {
    position: relative;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--button-ghost-bg);
    backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    background: var(--accent-soft);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle i {
    position: absolute;
    font-size: 1.1rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-icon-dark {
    color: var(--ink);
}

.theme-icon-light {
    color: var(--accent-strong);
}

/* Default light mode - show moon icon */
:root:not([data-theme="dark"]) .theme-icon-dark {
    opacity: 1;
    transform: rotate(0deg);
}

:root:not([data-theme="dark"]) .theme-icon-light {
    opacity: 0;
    transform: rotate(180deg);
}

/* Dark mode - show sun icon */
:root[data-theme="dark"] .theme-icon-dark {
    opacity: 0;
    transform: rotate(-180deg);
}

:root[data-theme="dark"] .theme-icon-light {
    opacity: 1;
    transform: rotate(0deg);
}

main section {
    position: relative;
    width: min(calc(100% - 32px), var(--max-width));
    margin: 0 auto;
}

.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: 28px;
    align-items: center;
    padding: 120px 0 40px;
    perspective: 1600px;
    overflow: hidden;
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: var(--hero-backdrop);
    filter: blur(18px);
    transform: translate3d(0, calc(var(--hero-shift, 0px) * -0.3), 0) scale(1.02);
}

.hero-media,
.hero-copy,
.workspace-header {
    position: relative;
    z-index: 1;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
}

.hero-copy {
    max-width: 760px;
}

.hero-media {
    display: grid;
    place-items: center;
}

.hero-media-image {
    width: min(100%, 260px);
    height: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 28px 60px rgba(18, 34, 40, 0.12));
}

.eyebrow,
.panel-kicker,
.card-label {
    margin: 0 0 10px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

h1,
h2,
h3,
strong {
    font-family: "Manrope", sans-serif;
    letter-spacing: -0.06em;
}

h1 {
    margin: 0 0 14px;
    font-size: clamp(3.4rem, 8vw, 6.8rem);
    line-height: 0.94;
    padding-bottom: 0.08em;
    background: var(--heading-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

h2 {
    margin: 0;
    font-size: clamp(2.2rem, 4vw, 3.8rem);
    line-height: 0.98;
}

h3 {
    margin: 0;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    line-height: 1;
}

p {
    font-size: 1rem;
    line-height: 1.65;
}

.hero-text,
.status-message,
.preview-box,
.field span,
.pill,
.file-chip,
th,
td,
.story-strip span {
    color: var(--muted);
}

.hero-text {
    max-width: 34rem;
    margin: 10px 0 12px;
    line-height: 1.55;
}

.hero-actions,
.action-row,
.attachment-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero-actions {
    margin-top: 22px;
}

.scroll-arrow {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
    color: var(--ink);
    transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.scroll-arrow:hover {
    transform: translateY(3px);
    border-color: rgba(255, 153, 0, 0.38);
    background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
}

.scroll-arrow svg {
    width: 24px;
    height: 24px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 22px;
    border-radius: 999px;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-solid {
    border: 1px solid transparent;
    background: linear-gradient(135deg, #ffb84d, #ff9900);
    color: #143037;
}

.button-ghost {
    border: 1px solid var(--line);
    background: var(--button-ghost-bg);
    color: var(--ink);
}

.button-inline {
    min-height: 46px;
    padding: 0 18px;
}

.quick-metrics span,
.pill,
.file-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 10px 14px;
    background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
    border: 1px solid var(--line);
    font-size: 0.92rem;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.file-remove {
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
    color: var(--muted);
    border-radius: 999px;
    padding: 10px 14px;
    font: inherit;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.file-remove:hover {
    color: var(--ink);
    transform: translateY(-1px);
    border-color: rgba(18, 34, 40, 0.16);
}

.workspace {
    padding: 30px 0 40px;
}

.workspace-header {
    max-width: 620px;
    margin-bottom: 24px;
}

.workspace-grid,
.field-grid {
    display: grid;
    gap: 18px;
}

.workspace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.field-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.step-one-fields {
    grid-template-columns: 1fr;
}

.panel,
.preview-box,
.table-shell table,
.empty-state {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 18px 45px rgba(20, 43, 49, 0.06);
}

.panel {
    border-radius: var(--radius-xl);
    padding: 26px;
    backdrop-filter: blur(16px);
}

.workspace-grid > .panel:not(.panel-wide) {
    height: 100%;
}

#emailSection {
    padding: 22px 26px 24px;
}

.panel-wide {
    grid-column: 1 / -1;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

#emailSection .panel-head {
    margin-bottom: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.password-field {
    position: relative;
}

.field span,
.editor-label {
    font-size: 0.95rem;
    font-weight: 500;
}

#emailSection .field-grid {
    gap: 16px 18px;
}

#emailSection .field {
    gap: 12px;
    padding: 4px 0;
}

#emailSection .field span,
#emailSection .editor-label {
    line-height: 1.2;
    margin: 0;
}

#emailSection .editor-shell {
    gap: 12px;
    padding: 4px 0;
}

#emailSection .field + .field,
#emailSection .editor-shell,
#emailSection .attachment-row,
#emailSection .action-row,
#emailSection .progress-shell,
#emailSection .preview-box {
    margin-top: 0;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
    padding: 15px 16px;
    font: inherit;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.password-field input {
    padding-right: 54px;
}

input:focus {
    border-color: rgba(255, 153, 0, 0.36);
    box-shadow: 0 0 0 4px rgba(255, 153, 0, 0.14);
    background: var(--surface-strong);
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
}

.password-toggle:hover {
    color: var(--ink);
}

.password-toggle:focus-visible {
    outline: 2px solid rgba(255, 153, 0, 0.34);
    outline-offset: 2px;
    border-radius: 999px;
}

.eye-icon {
    width: 21px;
    height: 21px;
}

.eye-closed {
    display: none;
}

.password-toggle.is-visible .eye-open {
    display: none;
}

.password-toggle.is-visible .eye-closed {
    display: block;
}

.drop-zone {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 8px;
    padding: 32px 24px;
    border-radius: 28px;
    border: 1.5px dashed rgba(255, 153, 0, 0.36);
    background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.drop-zone:hover,
.drop-zone.dragover,
.drop-zone:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(255, 153, 0, 0.62);
    box-shadow: 0 16px 36px rgba(255, 153, 0, 0.1);
    outline: none;
}

.drop-zone h4,
.preview-box h3 {
    margin: 8px 0 0;
    font-family: "Manrope", sans-serif;
    letter-spacing: -0.04em;
    color: var(--ink);
}

.drop-zone p,
.status-message,
.preview-box,
.empty-state {
    margin: 0;
}

.status-message {
    min-height: 24px;
    margin-top: 16px;
}

.status-message.success {
    color: #2f8d77;
}

.status-message.error {
    color: #c45555;
}

.status-message.loading {
    color: var(--accent-strong);
}

.table-shell {
    margin-top: 18px;
    overflow: hidden;
    border-radius: 22px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 15px 16px;
    border-bottom: 1px solid rgba(18, 34, 40, 0.08);
    font-size: 0.95rem;
}

th {
    color: var(--ink);
    font-weight: 600;
    background: rgba(255, 153, 0, 0.08);
}

tbody tr:last-child td {
    border-bottom: 0;
}

.empty-state {
    padding: 24px;
    border-radius: 22px;
}

.editor-shell {
    display: grid;
    gap: 6px;
    margin-top: 0;
}

#editor {
    min-height: 240px;
    background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
    border: 1px solid var(--line);
    border-radius: 0 0 20px 20px;
}

.ql-toolbar.ql-snow {
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
    padding: 10px 12px;
}

.ql-container.ql-snow {
    border: 1px solid var(--line);
    border-radius: 0 0 20px 20px;
    font: inherit;
}

.ql-editor {
    padding: 14px 16px;
}

.ql-editor.ql-blank::before {
    left: 16px;
    right: 16px;
}

.attachment-row,
.action-row {
    margin-top: 14px;
}

.attachment-row {
    align-items: center;
    gap: 12px;
}

.action-row {
    align-items: center;
    gap: 12px;
}

.progress-shell {
    margin-top: 16px;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

.progress-bar {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 153, 0, 0.14);
    overflow: hidden;
}

#progressFill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ffb84d, #ff9900);
    transition: width 0.4s ease;
}

.preview-box {
    margin-top: 16px;
    border-radius: 26px;
    padding: 24px;
    min-height: 88px;
}

#emailSection .attachment-row + .action-row {
    margin-top: 10px;
}

#emailSection .action-row + .progress-shell {
    margin-top: 12px;
}

#emailSection .progress-shell + .preview-box {
    margin-top: 12px;
}

.hidden {
    display: none;
}

.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1024px) {
    .hero,
    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding-top: 112px;
        gap: 20px;
    }

    .hero-copy {
        max-width: 100%;
    }

    .hero-media {
        order: 2;
    }
}

@media (max-width: 720px) {
    .topbar {
        position: sticky;
        top: 10px;
        left: auto;
        transform: none;
        width: calc(100% - 20px);
        margin: 10px auto 0;
        padding: 14px 16px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        border-radius: 24px;
    }

    .topbar.is-compact {
        width: calc(100% - 20px);
        padding: 12px 14px;
    }

    .brand {
        height: 36px;
        flex: 0 0 auto;
    }

    .brand-logo {
        width: 56px;
        height: 56px;
        transform: none;
    }

    .topnav {
        flex-wrap: nowrap;
        gap: 16px;
        align-items: center;
        margin-left: auto;
    }

    main section {
        width: min(calc(100% - 20px), var(--max-width));
    }

    .field-grid.two-col,
    .panel-head {
        display: flex;
        flex-direction: column;
    }

    .hero {
        position: relative;
        padding: 26px 0 18px;
        gap: 14px;
        min-height: 560px;
    }

    h1 {
        font-size: clamp(3rem, 18vw, 5.2rem);
        line-height: 0.92;
        margin-bottom: 12px;
    }

    .hero-copy {
        padding-right: 112px;
        align-self: start;
    }

    .hero-text {
        max-width: 100%;
        font-size: 0.98rem;
    }

    .hero-media {
        position: absolute;
        right: 0;
        bottom: 10px;
        width: 148px;
        justify-items: end;
        pointer-events: none;
    }

    .hero-media-image {
        width: 100%;
        max-width: 148px;
        filter: drop-shadow(0 18px 36px rgba(18, 34, 40, 0.14));
    }

    .scroll-arrow {
        width: 56px;
        height: 56px;
    }

    .workspace {
        padding-top: 18px;
    }

    .workspace-header {
        margin-bottom: 18px;
    }

    .panel,
    #emailSection {
        padding: 20px 18px;
        border-radius: 26px;
    }

    #recipientTableCard,
    #emailSection {
        overflow: hidden;
    }

    .panel-head {
        gap: 10px;
        margin-bottom: 16px;
    }

    .pill,
    .file-chip,
    .file-remove {
        font-size: 0.9rem;
    }

    .drop-zone {
        padding: 24px 16px;
        border-radius: 24px;
    }

    .drop-zone h4 {
        font-size: 1.6rem;
        line-height: 1.05;
    }

    .file-actions,
    .attachment-row,
    .action-row {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .attachment-row .button,
    .action-row .button,
    .file-remove,
    .file-chip {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .progress-meta {
        font-size: 0.88rem;
    }

    .table-shell {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-top: 12px;
        border-radius: 18px;
    }

    .table-shell table {
        min-width: 0;
        width: 100%;
        table-layout: fixed;
    }

    .table-shell thead th:nth-child(1),
    .table-shell tbody td:nth-child(1) {
        width: 46%;
    }

    .table-shell thead th:nth-child(2),
    .table-shell tbody td:nth-child(2) {
        width: 24%;
    }

    .table-shell thead th:nth-child(3),
    .table-shell tbody td:nth-child(3) {
        width: 30%;
    }

    .table-shell th,
    .table-shell td {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
        vertical-align: top;
        font-size: 0.92rem;
        padding: 12px 12px;
    }

    .ql-toolbar.ql-snow {
        padding: 8px 10px;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    #editor {
        min-height: 200px;
    }

    .ql-toolbar.ql-snow .ql-formats {
        margin-right: 8px;
        white-space: nowrap;
    }

    #emailSection .panel-head .pill {
        align-self: flex-start;
    }

    #emailSection .field-grid.two-col {
        grid-template-columns: 1fr;
        display: grid;
        gap: 16px;
    }

    #emailSection input,
    #emailSection .ql-toolbar.ql-snow,
    #emailSection .ql-container.ql-snow {
        width: 100%;
        max-width: 100%;
    }

    #emailSection .attachment-row,
    #emailSection .action-row {
        gap: 14px;
    }

    .preview-box {
        padding: 18px;
        min-height: 72px;
    }

    th,
    td {
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .topbar {
        padding: 12px 14px;
        gap: 10px;
    }

    .topnav {
        gap: 10px;
    }

    .topnav a,
    .topnav button {
        font-size: 0.88rem;
    }

    .brand-logo {
        width: 50px;
        height: 50px;
    }

    .brand {
        flex: 0 0 50px;
        width: 50px;
    }

    .theme-toggle {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
    }

    #recipientTableCard,
    #emailSection,
    .panel {
        padding-left: 14px;
        padding-right: 14px;
    }

    .eyebrow,
    .panel-kicker,
    .card-label {
        font-size: 0.76rem;
        letter-spacing: 0.14em;
    }

    h1 {
        font-size: clamp(2.6rem, 20vw, 4.4rem);
    }

    .hero {
        min-height: 520px;
    }

    .hero-copy {
        padding-right: 92px;
    }

    .hero-media {
        width: 122px;
        bottom: 14px;
    }

    .hero-media-image {
        max-width: 122px;
    }

    h2 {
        font-size: clamp(1.8rem, 9vw, 2.6rem);
    }

    h3 {
        font-size: 1.3rem;
    }

    input {
        padding: 14px 14px;
        border-radius: 16px;
    }

    .table-shell th,
    .table-shell td {
        font-size: 0.88rem;
        padding: 10px 10px;
    }

    .password-field input {
        padding-right: 48px;
    }

    .password-toggle {
        right: 12px;
        width: 28px;
        height: 28px;
    }

    .button-inline,
    .button {
        min-height: 44px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .drop-zone p,
    .hero-text,
    p,
    .file-chip,
    .file-remove {
        font-size: 0.95rem;
    }

    .file-actions,
    .attachment-row,
    .action-row {
        gap: 12px;
    }

    .ql-toolbar.ql-snow {
        padding: 7px 8px;
    }

    #editor {
        min-height: 180px;
    }
}

/* AI Checker fit: keep the Bulk Emailer shell, tune only product-specific controls. */
:root {
    --red: #ff9f9f;
    --content-gutter: clamp(48px, 8vw, 180px);
    --topbar-gutter: clamp(40px, 5.8vw, 120px);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0b1115;
        --surface: rgba(14, 24, 29, 0.78);
        --surface-strong: rgba(16, 28, 33, 0.9);
        --ink: #eef7f8;
        --muted: rgba(238, 247, 248, 0.66);
        --line: rgba(238, 247, 248, 0.1);
        --accent: #ff9900;
        --accent-soft: rgba(255, 153, 0, 0.1);
        --accent-strong: #ffb84d;
        --shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
        --topbar-border: rgba(255, 255, 255, 0.1);
        --topbar-bg: rgba(11, 17, 21, 0.62);
        --topbar-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
        --topbar-bg-compact: rgba(12, 19, 24, 0.84);
        --topbar-shadow-compact: 0 16px 40px rgba(0, 0, 0, 0.3);
        --hero-backdrop: none;
        --heading-gradient: linear-gradient(180deg, #f3fbfc 0%, #ffd28a 100%);
        --button-ghost-bg: rgba(255, 255, 255, 0.04);
        --pointer-glow: radial-gradient(circle 180px at var(--pointer-x) var(--pointer-y), rgba(255, 255, 255, 0.08), transparent 72%);
    }

    :root:not([data-theme="light"]) body {
        min-height: 100vh;
        background: linear-gradient(180deg, #0b1115 0%, #151d21 58%, #252b2f 100%);
    }

    :root:not([data-theme="light"]) body::before,
    :root:not([data-theme="light"]) body::after {
        display: none;
    }
}

/* CORTEX medical workflow layer */
.cortex-wordmark,
.cortex-watermark {
    font-family: "Poppins", sans-serif;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--ink);
}

.cortex-wordmark {
    width: auto;
    height: auto;
    font-size: 0.8rem;
    transform: translate(-50%, -50%);
}

.hero-copy {
    max-width: 680px;
}

.hero-copy h1 {
    max-width: 11.5ch;
    font-size: clamp(3.5rem, 6.2vw, 5.45rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.hero-copy .hero-text {
    max-width: 39rem;
}

.cortex-watermark {
    display: grid;
    place-items: center;
    right: clamp(26px, 3vw, 56px);
    bottom: clamp(22px, 2.4vw, 40px);
    width: auto;
    height: auto;
    max-width: none;
    font-size: clamp(0.58rem, 0.72vw, 0.72rem);
    letter-spacing: 0.06em;
    line-height: 1;
    opacity: 0.3;
    white-space: nowrap;
}

.sample-note {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px;
    background: color-mix(in srgb, var(--surface-strong) 56%, transparent);
    margin-bottom: 18px;
}

.sample-note p {
    margin: 0;
    color: var(--muted);
}

.sample-actions {
    display: grid;
    justify-items: start;
    gap: 12px;
}

.sample-actions .status-msg {
    padding-left: 0;
}

textarea {
    width: 100%;
    min-height: 260px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
    padding: 16px 18px;
    font: inherit;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

textarea:focus {
    border-color: rgba(255, 153, 0, 0.36);
    box-shadow: 0 0 0 4px rgba(255, 153, 0, 0.14);
    background: var(--surface-strong);
}

textarea::placeholder {
    color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.clinical-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 16px;
}

.upload-zone.dragover .file-input-label {
    color: var(--ink);
    border-color: rgba(255, 184, 77, 0.82);
    background: rgba(255, 184, 77, 0.12);
}

.report-output {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: clamp(18px, 2.3vw, 28px);
    background: color-mix(in srgb, var(--surface-strong) 64%, transparent);
    max-height: 72vh;
    overflow: auto;
}

.report-output h2,
.report-output h3,
.report-output h4,
.report-output p {
    margin: 0;
}

.report-output h2 {
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    line-height: 1.02;
}

.report-output h3 {
    margin-top: 14px;
    font-size: clamp(1.35rem, 2vw, 1.85rem);
}

.report-output h4 {
    margin-top: 8px;
    font-family: "Manrope", sans-serif;
    font-size: 1.08rem;
    letter-spacing: -0.03em;
}

.report-output p,
.report-list-item,
.report-output blockquote {
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.65;
}

.report-list-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.report-list-item > span:first-child {
    color: var(--accent-strong);
    font-weight: 700;
}

.report-output blockquote {
    margin: 2px 0;
    border-left: 3px solid var(--accent);
    padding: 10px 0 10px 14px;
    background: rgba(255, 255, 255, 0.025);
    border-radius: 0 14px 14px 0;
}

.report-output code {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 2px 6px;
    color: var(--ink);
    background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
}

.report-output hr {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--line);
    margin: 10px 0;
}

.report-spacer {
    height: 4px;
}

.report-table-shell {
    margin: 6px 0 10px;
    overflow-x: auto;
}

.report-table-shell table {
    min-width: 680px;
}

.report-table-shell th,
.report-table-shell td {
    vertical-align: top;
}

#step-sample {
    min-height: 366px;
}

#step-note {
    min-height: 0;
}

body[data-active-tab="sample"] #step-sample {
    min-height: 420px;
}

body[data-active-tab="document"] #step-document {
    width: min(100%, 760px);
    min-height: 0;
    justify-self: center;
}

body[data-active-tab="document"] #step-document .paper-upload {
    max-width: 100%;
    min-height: 0;
}

body[data-active-tab="sample"] #step-sample {
    max-width: 760px;
    justify-self: center;
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

@media (max-width: 720px) {
    .cortex-wordmark {
        display: none;
    }

    .hero-copy h1 {
        max-width: 8.5ch;
        font-size: clamp(3rem, 14vw, 4.35rem);
        line-height: 0.98;
    }

    .cortex-watermark {
        right: 18px;
        bottom: 18px;
        width: auto;
        height: auto;
        font-size: 0.56rem;
        opacity: 0.28;
    }

    textarea {
        min-height: 220px;
    }

    .clinical-actions .button {
        width: 100%;
    }

    .report-output {
        max-height: none;
    }
}

.page-shell {
    border-right: 1px solid rgba(238, 247, 248, 0.14);
    border-bottom: 1px solid rgba(238, 247, 248, 0.14);
    border-left: 1px solid rgba(238, 247, 248, 0.14);
    border-radius: 0 0 28px 28px;
}

.topbar {
    width: min(calc(100% - (var(--topbar-gutter) * 2)), 1860px);
    border-color: var(--topbar-border);
    transition: width 0.35s ease, padding 0.35s ease, box-shadow 0.35s ease, background-color 0.35s ease, opacity 0.18s linear;
}

.topbar.is-compact {
    width: min(calc(100% - 56px), 940px);
}

.hero {
    width: min(calc(100% - (var(--content-gutter) * 2)), 1650px);
}

.workspace {
    width: min(calc(100% - (var(--content-gutter) * 2)), 1380px);
    padding-top: 42px;
}

.hero {
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
}

.hero-copy {
    max-width: 790px;
}

.hero-media-image {
    width: min(100%, 560px);
    max-width: 560px;
}

.workspace-header {
    max-width: 980px;
    margin-bottom: 28px;
}

.workspace-header h2 {
    font-size: clamp(2.6rem, 4vw, 4.45rem);
    line-height: 0.98;
}

.workspace-grid {
    align-items: stretch;
    gap: 14px;
}

.panel {
    min-height: 286px;
    padding: 24px;
}

#step-context,
#step-answerkey {
    min-height: 306px;
}

#step-students {
    min-height: 0;
}

#step-students .panel-head {
    align-items: center;
}

.panel-head {
    gap: 18px;
}

.field select {
    width: 100%;
    min-height: 58px;
    appearance: none;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px 48px 16px 18px;
    color: var(--ink);
    background:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 22px center / 7px 7px no-repeat,
        linear-gradient(135deg, var(--muted) 50%, transparent 50%) right 16px center / 7px 7px no-repeat,
        color-mix(in srgb, var(--surface-strong) 82%, transparent);
    font: inherit;
    outline: none;
}

.field select:focus,
.file-input-label:focus-within {
    border-color: rgba(207, 216, 220, 0.34);
    box-shadow: 0 0 0 4px rgba(207, 216, 220, 0.08);
}

.field select:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.paper-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.paper-upload {
    display: grid;
    gap: 18px;
    align-content: start;
    min-height: 100%;
}

.upload-icon {
    display: inline-grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 20px;
    color: #14262d;
    background: #ffb84d;
    font-size: 1.3rem;
}

.paper-upload h4,
.student-upload-copy h4,
#step-students > h4 {
    margin: 0;
    font-size: clamp(1.45rem, 1.75vw, 2rem);
    letter-spacing: -0.05em;
}

.paper-upload p,
.student-upload-copy p,
.hint {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.55;
}

.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.file-input-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
    gap: 12px;
    border: 1px dashed rgba(255, 153, 0, 0.36);
    border-radius: 18px;
    padding: 14px 18px;
    color: var(--muted);
    background: color-mix(in srgb, var(--surface-strong) 60%, transparent);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.file-input-label:hover,
.upload-zone.has-file .file-input-label {
    color: var(--ink);
    border-color: rgba(255, 184, 77, 0.65);
    background: rgba(255, 184, 77, 0.08);
}

.status-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.95rem;
}

.status-msg.success {
    color: #ffb84d;
}

.status-msg.error {
    color: #ff9f9f;
}

.student-upload-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(280px, 0.55fr);
    gap: 22px;
    align-items: center;
}

.file-list,
.stats-row,
#student-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.file-list .file-chip,
.stat-card,
.student-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
}

.file-list .file-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
}

.chip-icon {
    color: #ffb84d;
}

.button:disabled,
.button[disabled] {
    cursor: not-allowed;
    opacity: 0.45;
}

.button-content,
.results-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.badge {
    color: #ffb84d;
}

.marks-input {
    width: 110px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--ink);
    background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
    font: inherit;
}

.total-label,
.total-value {
    font-weight: 700;
}

.progress-shell {
    margin-top: 0;
}

.progress-bar #progress-bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #ffb84d, #e6eef1);
    transition: width 0.25s ease;
}

.progress-bar.indeterminate #progress-bar {
    width: 100%;
    background: linear-gradient(90deg, transparent 0%, #ffb84d 40%, #e6eef1 60%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite linear;
    transition: none;
}

@keyframes shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.progress-log {
    display: grid;
    gap: 10px;
    max-height: 260px;
    overflow: auto;
    margin-top: 20px;
    padding-right: 6px;
}

.log-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
}

.log-item.done {
    color: #ffb84d;
}

.log-item.err {
    color: #ff9f9f;
}

.stat-card,
.student-card {
    padding: 16px;
}

.stat-value {
    font-family: "Manrope", sans-serif;
    font-size: 1.8rem;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--ink);
}

.stat-label {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.student-cards {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.student-card {
    padding: 0;
    overflow: hidden;
}

.student-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    cursor: pointer;
}

.student-card-name,
.student-card-score,
.score-pill,
.flag-review,
.flag-ok,
.btn-pdf-single,
.detail-section-title,
.improvement-title,
.flag-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.student-card-name {
    font-weight: 700;
    color: var(--ink);
}

.score-pill,
.flag-review,
.flag-ok,
.btn-pdf-single {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 11px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.9rem;
}

.score-pill.high,
.pct-high,
.flag-ok,
.pt-covered .pt-icon {
    color: #ffb84d;
}

.score-pill.mid,
.pct-mid {
    color: #f0d38a;
}

.score-pill.low,
.pct-low,
.flag-review,
.pt-missed .pt-icon {
    color: #ff9f9f;
}

.btn-pdf-single {
    font: inherit;
    cursor: pointer;
}

.chevron {
    color: var(--muted);
    transition: transform 0.2s ease;
}

.chevron.open {
    transform: rotate(180deg);
}

.student-card-body {
    display: none;
    padding: 0 18px 18px;
}

.student-card-body.open {
    display: block;
}

.detail-grid {
    display: grid;
    gap: 14px;
}

.detail-section-row,
.improvement-box,
.flag-banner {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.detail-section-title {
    justify-content: space-between;
    width: 100%;
    font-weight: 700;
    color: var(--ink);
}

.detail-mark-badge {
    border-radius: 999px;
    padding: 6px 10px;
    color: #14262d;
    background: #ffb84d;
    font-size: 0.85rem;
}

.points-list,
.improvement-list {
    display: grid;
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
}

.points-list li {
    display: flex;
    gap: 10px;
}

.improvement-box,
.flag-banner {
    margin-top: 14px;
}

.table-shell {
    width: 100%;
}

.table-shell table {
    width: 100%;
}

.footer {
    display: none;
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 20%),
        linear-gradient(180deg, #09090b 0%, #111216 48%, #0b0b0d 100%);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.55s ease, visibility 0.55s ease;
}

.page-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-shell {
    display: grid;
    justify-items: center;
    gap: 1rem;
}

.notify-loader-mark {
    width: min(30rem, 76vw);
    height: auto;
    color: #f4f1ea;
}

.notify-loader-text {
    font-family: "Poppins", sans-serif;
}

.loader-by {
    margin-top: -0.2rem;
    font-size: 0.8rem;
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: lowercase;
    color: rgba(244, 241, 234, 0.62);
}

.loader-logo {
    width: min(7.5rem, 28vw);
    height: auto;
    object-fit: contain;
}

.loader-logo-wrap {
    display: block;
    width: min(7.5rem, 28vw);
}

.loader-logo-wrap .loader-logo {
    width: 100%;
}

@media (prefers-color-scheme: light) {
    .page-loader {
        background:
            radial-gradient(circle at top, rgba(255, 153, 0, 0.14), transparent 22%),
            linear-gradient(180deg, #fbfefe 0%, #f5fafb 48%, #eef6f7 100%);
    }

    .notify-loader-mark {
        color: #122228;
    }

    .notify-loader-text {
        text-shadow: none;
    }

    .loader-by {
        color: rgba(18, 34, 40, 0.6);
    }

    .loader-logo {
        filter: drop-shadow(0 8px 18px rgba(18, 34, 40, 0.1));
    }
}

:root[data-theme="light"] .page-loader {
    background:
        radial-gradient(circle at top, rgba(255, 153, 0, 0.14), transparent 22%),
        linear-gradient(180deg, #fbfefe 0%, #f5fafb 48%, #eef6f7 100%);
}

:root[data-theme="light"] .notify-loader-mark {
    color: #122228;
}

:root[data-theme="light"] .notify-loader-text {
    text-shadow: none;
}

:root[data-theme="light"] .loader-by {
    color: rgba(18, 34, 40, 0.6);
}

:root[data-theme="light"] .loader-logo {
    filter: drop-shadow(0 8px 18px rgba(18, 34, 40, 0.1));
}

:root[data-theme="dark"] .page-loader {
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 20%),
        linear-gradient(180deg, #09090b 0%, #111216 48%, #0b0b0d 100%);
}

:root[data-theme="dark"] .notify-loader-mark {
    color: #f4f1ea;
}

:root[data-theme="dark"] .loader-by {
    color: rgba(244, 241, 234, 0.62);
}

:root[data-theme="dark"] .loader-logo {
    filter: none;
}

@media (max-width: 1024px) {
    .topbar,
    .topbar.is-compact {
        width: calc(100% - 32px);
    }

    .header-wordmark {
        width: min(55px, 9.7vw);
        height: 19px;
    }

    .saga-watermark {
        width: 87px;
        height: 30px;
    }

    .hero {
        width: min(calc(100% - 24px), 900px);
    }

    .workspace {
        width: min(calc(100% - 24px), 900px);
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        max-width: 760px;
    }

    .hero-media {
        justify-content: flex-start;
    }

    .hero-media-image {
        width: min(64vw, 420px);
    }

    .paper-upload-grid,
    .student-upload-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .page-shell {
        border-radius: 0 0 18px 18px;
    }

    .topbar,
    .topbar.is-compact {
        width: calc(100% - 20px);
    }

    .brand-logo {
        width: 74px;
    }

    .header-wordmark {
        width: 43px;
        height: 14px;
    }

    .saga-watermark {
        right: 14px;
        bottom: 22px;
        width: 71px;
        height: 24px;
        opacity: 0.36;
    }

    .hero {
        min-height: 640px;
    }

    .hero-copy {
        padding-right: 90px;
    }

    .hero-media-image {
        width: 100%;
        max-width: 100%;
    }

    .panel-head,
    .results-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .results-actions,
    .results-actions .button {
        width: 100%;
    }
}
