/* Optional classroom theme: subdued surfaces and clear, low-glare controls. */
:root {
  color-scheme: dark;
  --bg: #101216;
  --surface: #181b21;
  --surface-raised: #222630;
  --field: #12151b;
  --ink: #d6d9e0;
  --muted: #a4adbc;
  --line: #343a47;
  --white: var(--surface);
  --accent: #5558b5;
  --accent-hover: #6265c6;
  --accent-ink: #c0c2ff;
  --accent-soft: #272b45;
  --green: var(--accent);
  --lime: var(--accent-soft);
  --orange: #e4bd7a;
  --warning-bg: #2c251b;
  --warning-line: #6b5331;
  --danger-bg: #322126;
  --danger-ink: #e5a6af;
  --wheel-1: #282d3d;
  --wheel-2: #1d222c;
  --wheel-3: #343a50;
  --wheel-4: #242a35;
  --wheel-line: #596274;
  --wheel-ink: #d6d9e0;
  background: var(--bg);
  color: var(--ink);
  scrollbar-color: #505867 var(--bg);
}
html, body, .shell, .student-shell, .login-layout, .boot { background: var(--bg); color: var(--ink); }
::selection { background: #464b7a; color: #e8e9f4; }
:focus-visible { outline-color: #a1a7ed; }
.hint, .muted, .footer, .eyebrow, .page-heading p, .page-heading .eyebrow,
.rounds-heading p, .round-page-heading>p, .round-context-label,
.live-note, .topbar .date, .back-to-rounds { color: var(--muted); }

/* Shared controls, including native menus and saved browser autofill. */
input, select, textarea, .demo-banner select { background: var(--field); color: var(--ink); border-color: var(--line); }
input::placeholder, textarea::placeholder { color: #939dac; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: #9299de; outline-color: #535a86; }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--field) inset;
  caret-color: var(--ink);
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.btn { background: var(--accent); color: #f0f0ff; }
.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn.outline { background: var(--surface-raised); color: var(--ink); border-color: #4c5566; }
.btn.outline:hover:not(:disabled) { background: #2b303e; border-color: #79849a; }
.btn.light, .btn.lime { background: var(--accent-soft); color: var(--accent-ink); }
.btn.light:hover:not(:disabled), .btn.lime:hover:not(:disabled) { background: #343952; }
.btn.danger { background: var(--danger-bg); color: var(--danger-ink); border-color: #70454d; }
.btn.danger:hover:not(:disabled) { background: #442a31; }
.text-btn { color: var(--muted); }
.text-btn:hover { color: var(--accent-ink); background: var(--accent-soft); }
.btn[aria-pressed=true].outline { background: var(--accent-soft); border-color: #8a90cf; color: var(--accent-ink); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline-color: #a1a7ed; }
button:disabled { opacity: .55; }

/* Teacher navigation and page surfaces. */
.sidebar, .topbar, .student-topbar { background: #14171c; border-color: var(--line); color: var(--ink); }
.brand, .student-brand, .profile strong, .breadcrumb strong { color: var(--ink); }
.brand .caption, .nav-label, .profile small, .profile .text-btn, .nav button .arrow { color: var(--muted); }
.nav button { color: #b3bdcc; }
.nav button:hover:not(:disabled) { background: var(--surface-raised); }
.nav button.active { background: var(--accent-soft); color: var(--accent-ink); }
.sidebar-management, .sidebar .profile { border-color: var(--line); }
.avatar { background: var(--surface-raised); color: var(--accent-ink); }
.live-dot { background: #a3a6ec; }
.panel, .round-card, .round-history-row, .gallery-card, .metric, .teacher-manual-list,
.student-focus, .ranking-celebration { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: none; }
.panel-head, .round-tabs, .entry-row, .summary-item, .score-row,
.student-vote-panel, .teacher-manual-list, .file-row { border-color: var(--line); }
.round-card.active { background: var(--surface); border-color: #555f8c; border-left-color: #9196dc; }
.round-card-title>.icon, .round-history-row>.icon, .metric .metric-icon { background: var(--surface-raised); color: var(--accent-ink); }
.round-card p, .round-history-row p, .round-history>h2,
.round-card-stats span, .metric-label, .metric-number small, .metric-note { color: var(--muted); }
.round-card-stats strong { color: var(--ink); }
.round-card-stats .missing-number strong { color: var(--orange); }
.round-filters .btn { background: transparent; color: var(--muted); }
.round-filters .btn[aria-pressed=true] { background: var(--accent-soft); color: var(--accent-ink); }
.round-delete-action .btn { background: transparent; border-color: transparent; color: var(--danger-ink); }
.round-history-row .btn.danger { border-color: #70454d; }
.round-progress progress, .round-progress progress::-webkit-progress-bar, .progress { background: #2c313d; }
.round-progress progress::-webkit-progress-value, .progress-fill { background: #888dc7; }
.round-progress progress::-moz-progress-bar { background: #888dc7; }
.demo-banner, .notice { background: #202530; color: #b4bdcc; border-color: var(--line); }
.notice strong { color: #d0d5e7; }
.connection-error { background: var(--warning-bg); border-color: var(--warning-line); color: var(--orange); }
.chip, .chip.dark { background: var(--surface-raised); color: #b7c1d2; }
.chip.green, .chip.violet { background: var(--accent-soft); color: var(--accent-ink); }
.chip.orange { background: var(--warning-bg); color: var(--orange); }
.steps, .presenter-bar, .viewer, .upload-zone { background: var(--surface); border-color: var(--line); }
.step, .step b { color: var(--muted); border-color: var(--line); }
.step.on { color: var(--accent-ink); }
.step.on b { background: var(--accent-soft); border-color: #636b98; }
.step-line { background: var(--line); }

/* Presentation roulette and vote completion monitor. */
.wheel-pointer { border-top-color: #b0b3f0; }
.roulette-hub { background: #1b1f29; border-color: #5a637a; color: var(--accent-ink); box-shadow: 0 3px 16px #0005; }
.roulette-hub span, .wheel-action p, .wheel-roster p, .wheel-roster summary,
.wheel-roster, .teacher-manual-list>summary { color: var(--muted); }
.roulette-hub strong { color: var(--ink); }
.wheel-roster { border-color: var(--line); }
.wheel-stage.is-spinning:after { border-color: #8d93ce; }
.presenter-card-label, .presenter-question { background: var(--surface-raised); color: var(--accent-ink); border-color: var(--line); }
.presenter-name, .presenter-placeholder h2 { color: var(--ink); }
.presenter-card h2 { color: #bdc6d5; }
.defer-button { background: var(--surface-raised)!important; color: #bdc6d5!important; border-color: #4c5566!important; }
.presentation-completed { background: #1d222c; border-color: var(--line); color: #bdc6d5; }
.presentation-completed p { color: var(--muted); }
.presentation-completed h3 .icon { color: #a1bfae; }
.student-name-chip { background: var(--surface-raised); border-color: #434c5d; color: #c6cedb; }
.now-presenting { color: var(--muted); border-color: var(--line); }
.now-presenting strong { color: var(--accent-ink); }
.deferred-names>div { background: var(--surface-raised); border-color: var(--line); }
.participation-panel, .voting-status-bar>.participation-panel { background: var(--surface); border-color: var(--line); box-shadow: none; }
.participation-heading h3 strong { color: var(--accent-ink); }
.all-complete { background: #21322c; color: #a2d0ba; }
.teacher-assessment, .voter-group>b, .voter-none, .excluded-voters { color: var(--muted); }
.voter-name.pending { background: var(--warning-bg); color: var(--orange); }
.voter-name.completed { background: var(--accent-soft); color: var(--accent-ink); }
.online { color: #a5cbb9; }
.offline, .voter-name small { color: var(--muted); }
.close-vote-warning { background: var(--warning-bg); border-color: var(--warning-line); }
.close-vote-warning>strong { color: #e6c38b; }
.close-vote-warning p { color: #cebea6; }
.pending-confirm-names span { background: #393022; border-color: #6b583b; color: #edcfa0; }

/* Submitted / missing states remain identifiable without bright panels. */
.submission-group.missing, .roster-person.missing { background: #252119; border-color: var(--warning-line); color: var(--orange); }
.submission-group.missing h2, .roster-person.missing span { color: var(--orange); }
.submission-group.received, .roster-person.received { background: #202436; border-color: #535b86; color: var(--accent-ink); }
.submission-group.received h2, .roster-person.received span { color: var(--accent-ink); }
.submission-group>p, .workflow-order .hint, .workflow-help { color: var(--muted); }
.submission-name { background: #191d25; color: #cbd2df; border-color: #444c5e; }
.submission-excluded, .submission-overview>.submission-excluded, .roster-person.excluded {
  background: #1c2027; color: var(--muted); border-color: var(--line);
}
.entry-row.submission-missing, .workflow-table tr.submission-missing td { background: #252119; }
.entry-row.submission-received, .workflow-table tr.submission-received td { background: #202436; }
.entry-row.submission-excluded, .workflow-table tr.submission-excluded td { background: #1c2027; }
.entry-row.submission-missing, .workflow-table .submission-missing td:first-child { border-left-color: #a27d43; }
.entry-row.submission-received, .workflow-table .submission-received td:first-child { border-left-color: #8088bd; }
.entry-row.current { background: #2a2e49; border-left-color: #9b9fe0; box-shadow: inset 0 0 0 1px #6c73a1; }
.entry-title { color: #d1d6e0; }
.entry-meta, .entry-row .num { color: var(--muted); }
.participant-picker { background: #1d222c; border-color: var(--line); }
.participant-count { color: var(--accent-ink); }
.participant-options label { background: var(--surface-raised); color: var(--ink); }
.material-link, .directory-reference, .drive-reference, .saved-entry, .entry-link-row,
.work-description { background: #1e232d; color: #c9d1e1; border-color: #424c60; }
.material-link:hover { background: #2a3040; border-color: #818cb0; }
.material-link small, .drive-reference>span, .work-description summary,
.work-description p, .legacy-files>summary, .large-file-guide { color: #b4bed0; }

/* Student waiting, voting and saved scores. */
.student-account strong { color: #c4cbd9; }
.student-topbar nav .btn.light { background: var(--accent-soft); color: var(--accent-ink); }
.student-class-label, .student-next-task>span, .student-roster .panel-head p { color: var(--muted); }
.stage-tag { background: var(--surface-raised); color: #b7c1d7; }
.stage-tag.voting { background: var(--accent-soft); color: var(--accent-ink); }
.student-next-task h2, .student-saved .student-next-task h2 { color: var(--ink); }
.student-instruction, .student-voting .student-instruction { color: #b3bdcf; }
.student-presenter, .student-voting .student-presenter, .student-focus h1 { color: #c2cbdd; }
.student-focus .student-state-icon { background: var(--surface-raised); color: #b0bad5; }
.student-focus[data-stage=missed] .student-next-task h2 { color: var(--orange); }
.student-vote-panel .score-row label { color: #cbd2df; }
.score-picked { color: var(--accent-ink); }
.score-buttons button, .student-vote-panel .score-buttons button { background: var(--surface-raised); color: #d6dbe7; border-color: #555f73; }
.score-buttons button:hover:not(:disabled) { background: #30364a; border-color: #929bd0; }
.score-buttons button.selected, .student-vote-panel .score-buttons button.selected {
  background: #5558a6; border-color: #b2b6f6; color: #f1f1ff; box-shadow: inset 0 0 0 1px #b2b6f6;
}
.submitted-score-grid>div { background: #24283f; border-color: #565f89; }
.submitted-score-grid span, .submitted-score-grid small { color: #b9c2d5; }
.submitted-score-grid strong { color: #d0d2ff; }
.gallery-card p { color: var(--muted); }

/* Results and detailed ballots, including sticky table headers. */
.ranking-celebration { background: var(--surface); color: var(--ink); border-color: var(--line); }
.ranking-hero p, .ranking-hero .eyebrow, .podium-card p, .podium-place { color: var(--muted); }
.podium-card, .podium-card.place-1, .podium-card.place-2, .podium-card.place-3 { background: #20242e; color: var(--ink); border-color: #495367; box-shadow: none; }
.podium-card.place-1 { background: #272b41; border-color: #8289bf; }
.podium-card strong { color: #d0d4f1; }
.podium-card strong small { color: var(--muted); }
.podium-card.is-mine { outline-color: #a0a7e7; }
.my-ranking { background: var(--accent-soft); color: #c3cbe0; border-color: #525b80; }
.my-ranking strong { color: #d0d2ff; }
.rank-medal, .rank-medal.top { background: var(--surface-raised); color: #c5cedd; }
.rank-medal.place-1 { background: #383122; color: #e1c48b; }
.rank-medal.place-2 { background: #2b3240; color: #c8d2e4; }
.rank-medal.place-3 { background: #382d26; color: #dab493; }
.my-ranking-row { background: #252a42!important; }
.score-text { color: #c8d0ed; }
.score-track { background: #303644; }
.score-track i { background: #8f97ce; }
.vote-matrix, .work-ballots { border-color: var(--line); }
.vote-matrix th:first-child, th { background: #21262f; color: #b6c0d1; border-color: var(--line); }
.work-ballots summary, .vote-matrix summary, .vote-detail-title { color: #c0c9dc; }
.work-ballots summary span { color: var(--muted); }
td { color: #c3ccda; border-color: var(--line); }

/* Login, dialogs and alerts use the same dark surfaces. */
.login-art { background: #14171e; color: var(--ink); }
.login-art .brand, .login-art h1 { color: var(--ink); }
.login-art p, .login-art .brand .caption, .login-art .eyebrow, .login-art .tiny { color: var(--muted); }
.login-form-wrap { background: var(--surface); }
.login-form p, .login-form .eyebrow, .login-form .divider, .login-form .hint { color: var(--muted); }
.login-form label { color: #c1cad9; }
dialog { background: #1b1f27; color: var(--ink); border-color: #50596b; box-shadow: 0 20px 90px #0008; }
dialog::backdrop { background: #07090db8; }
dialog .dialog-head { border-color: var(--line); }
dialog .close { background: #2c3240; color: #c5cddd; }
#toast { background: #30364c; color: #e0e4f0; border: 1px solid #68728d; box-shadow: 0 8px 26px #0005; }
#toast.error { background: #432a32; color: #f0c2c9; border-color: #96616b; }
.filter-tabs button { background: var(--surface-raised); color: var(--muted); }
.filter-tabs button.active { background: var(--accent-soft); color: var(--accent-ink); }
.art-thumb, .art-thumb.art1, .art-thumb.art2, .art-thumb.art3 { background: var(--surface-raised); color: var(--muted); }
.sidebar-note { background: var(--surface); color: var(--ink); border-color: var(--line); }
.sidebar-note small { color: var(--muted); }
.feature { background: #242a40; color: var(--ink); }
.feature:after { border-color: #46516b; }
.feature p, .feature .eyebrow, .feature .meta, .feature .feature-bottom span { color: #b2bfd5; }
.feature .feature-bottom { border-color: var(--line); }
@media(max-width:700px) { .sidebar-management { border-left-color: var(--line); } }

.theme-toggle{color:var(--ink);border-color:#535d72}.theme-toggle:hover{background:var(--surface-raised);color:var(--ink)}
