/* Shared theme semantics; each page retains its existing surfaces and layout. */
html { color-scheme: light; background-color: #f8fafc; }
html.dark-theme { color-scheme: dark; background-color: #060b18; }
:root {
    --ink-faint: #596a80;
    --theme-accent-text: #2451c4;
    --theme-accent-hover: #15306b;
    --status-danger-text: #b91c1c;
    --status-success-text: #166534;
    --status-warning-text: #92400e;

    /* Clean Signature Blue Theme Foundation (UI v2) */
    --ui-font: 'Switzer', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ui-font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --ui-bg: #f8fafc;
    --ui-surface: #ffffff;
    --ui-surface-soft: #f1f5f9;
    --ui-surface-hover: #f8fafc;
    --ui-text: #0f172a;
    --ui-text-soft: #475569;
    --ui-text-faint: #94a3b8;
    --ui-border: #e2e8f0;
    --ui-border-soft: #edf2f7;
    --ui-border-strong: #cbd5e1;
    --ui-blue: #2451c4;
    --ui-blue-hover: #15306b;
    --ui-blue-soft: #eaf0fc;
    --ui-blue-border: rgba(36, 81, 196, 0.25);
    --ui-blue-text: #2451c4;
    --ui-primary: var(--ui-blue);
    --ui-primary-hover: var(--ui-blue-hover);
    --ui-ink: var(--ui-text);
    --ui-ink-soft: var(--ui-text-soft);
    --ui-radius-sm: 8px;
    --ui-radius-md: 12px;
    --ui-radius-lg: 16px;
    --ui-radius-xl: 20px;
    --ui-radius-pill: 999px;
    --ui-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    --ui-shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.03);
    --ui-shadow-lg: 0 10px 28px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
}
:root.dark-theme {
    --ink-faint: #9ca3af;
    --theme-accent-text: #93c5fd;
    --theme-accent-hover: #bfdbfe;
    --status-danger-text: #fda4af;
    --status-success-text: #86efac;
    --status-warning-text: #fcd34d;

    /* Clean Signature Blue Theme Foundation (UI v2 Dark Mode) */
    --ui-bg: #090d16;
    --ui-surface: #101624;
    --ui-surface-soft: #172033;
    --ui-surface-hover: #1c273e;
    --ui-text: #f8fafc;
    --ui-text-soft: #94a3b8;
    --ui-text-faint: #64748b;
    --ui-border: rgba(255, 255, 255, 0.09);
    --ui-border-soft: rgba(255, 255, 255, 0.05);
    --ui-border-strong: rgba(255, 255, 255, 0.16);
    --ui-blue: #3b82f6;
    --ui-blue-hover: #60a5fa;
    --ui-blue-soft: rgba(59, 130, 246, 0.16);
    --ui-blue-border: rgba(59, 130, 246, 0.35);
    --ui-blue-text: #93c5fd;
    --ui-primary: var(--ui-blue);
    --ui-primary-hover: var(--ui-blue-hover);
    --ui-ink: var(--ui-text);
    --ui-ink-soft: var(--ui-text-soft);
    --ui-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --ui-shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
    --ui-shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.5);
}

/* Scoped mapping for UI v2 opt-in pilot pages */
body.ui-v2 {
    --ink: var(--ui-text);
    --ink-soft: var(--ui-text-soft);
    --ink-faint: var(--ui-text-faint);
    --surface: var(--ui-bg);
    --card: var(--ui-surface);
    --border: var(--ui-border);
    --primary: var(--ui-blue);
    --primary-dark: var(--ui-blue-hover);
    --primary-soft: var(--ui-blue-soft);
    --theme-accent-text: var(--ui-blue-text);
    --theme-accent-hover: var(--ui-blue-hover);
    --ui-primary: var(--ui-blue);
    --ui-ink: var(--ui-text);
    --ui-ink-soft: var(--ui-text-soft);
    background-color: var(--ui-bg);
    color: var(--ui-text);
    font-family: var(--ui-font);
}
body:not(.admin-page) {
    --text-primary: var(--ink, #0e1b33);
    --text-secondary: var(--ink-soft, #475569);
    --surface-elevated: var(--card, #fff);
    --input-bg: var(--card, #fff);
    --input-text: var(--ink, #0e1b33);
    --border-color: var(--border, #dce6f5);
}
input::placeholder, textarea::placeholder { color: var(--ink-soft, #64748b); opacity: 1; }
input, textarea, select { accent-color: var(--primary, #2451c4); }
[role="switch"]:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--theme-accent-text);
    outline-offset: 3px;
}
body.theme-dark-shell { --accent-cyan: #0369a1; }
html.dark-theme body.theme-dark-shell { --accent-cyan: #7dd3fc; }
body.landing-portal { --accent-cyan: #075985; }
html.dark-theme body.landing-portal { --accent-cyan: #7dd3fc; }
body.theme-dark-shell a:not([class]):hover { color: #075985; }
html.dark-theme body.theme-dark-shell a:not([class]):hover { color: #bae6fd; }
html.dark-theme body.theme-dark-shell .action-chip-btn.primary { color: #0e1b33; }
.hub-promo-feedback { color: var(--text-secondary); }
body.admin-page { --text-muted: #596a80; }
html.dark-theme body.admin-page { --text-muted: #a1b0c6; }
body.admin-page .brand-icon span { color: var(--status-danger-text); }
/* The printable sheet deliberately stays paper-white in both modes. */
html.dark-theme body.assignment-cover-page .editor {
    background: #111827; color: #e2e8f0; border-color: #334155;
}
html.dark-theme body.assignment-cover-page .editor .fields label {
    color: #cbd5e1;
}
body.assignment-cover-page .editor input::placeholder { color: #52627f; }
html.dark-theme body.assignment-cover-page .editor input::placeholder { color: #94a3b8; }
html.dark-theme body.assignment-cover-page .editor input,
html.dark-theme body.assignment-cover-page .editor select {
    background: #1e293b; color: #f8fafc; border-color: #475569;
}
body.assignment-cover-page .paper { color-scheme: light; }
body.assignment-cover-page .paper h3 { color: #52637b; }
html.dark-theme body.assignment-cover-page .cover-footer a { color: #93c5fd; }
@media print {
    html, html.dark-theme { background: #fff; color-scheme: light; }
}

html.dark-theme body.assignment-cover-page .cover-top-nav { background: #111827; border-color: #334155; }
html.dark-theme body.assignment-cover-page .cover-nav-links a { color: #cbd5e1; }
html.dark-theme body.assignment-cover-page .cover-nav-back:hover { color: var(--theme-accent-hover); }

html.dark-theme body.assignment-cover-page .cover-footer { color: #cbd5e1; }
