.appearance-options {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border: 0;
  padding: 0;
  margin: 0;
}
.appearance-options legend { margin-bottom: 12px; font-weight: 650; }
.appearance-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--crew-control);
  cursor: pointer;
}
.appearance-options input { margin: 0; accent-color: var(--crew-blue); }

:root[data-theme="dark"] {
  color-scheme: dark;
  --crew-canvas: #101721;
  --crew-ink: #eaf1fa;
  --crew-muted: #a7b8cc;
  --crew-control: #29374a;
  --crew-blue: #8ab9ff;
  --crew-blue-soft: #223b5c;
  --bg: var(--crew-canvas);
  --surface: #1b2635;
  --line: #3c4d63;
  --blue: var(--crew-blue);
  --blue-soft: var(--crew-blue-soft);
  --violet: #c7adff;
  --violet-soft: #34274b;
  --shadow: none;
  --dark-button: #2465bd;
}

[data-theme="dark"] body,
[data-theme="dark"] body :is(.schedule-toolbar,.crew-waiting-header,.app-sidebar,.topbar) {
  background-color: var(--crew-canvas);
  color: var(--crew-ink);
}

/* Content surfaces, including alternate card styles defined by individual pages. */
[data-theme="dark"] body :is(
  .card, dialog, .crew-entry, .crew-size-card, .crew-code-entry, .calendar-placeholder,
  .schedule-more, .profile-native-card, .native-settings-group>div, .native-account-identity,
  .private-crew-card, .crew-list-empty, .session-history-card, .past-session-list,
  .reservation-empty, .booking-time-card, .booking-waiting-card, .booking-sheet-footer,
  .schedule-notifications>div, .app-secondary-row, .conversation-workspace, .transcript-turn,
  .ai-exercise-context, .debrief-objective, .debrief-skills, .debrief-score-card,
  .debrief-feedback-section, .debrief-followup, .debrief-narrative, .debrief-outcome,
  .debrief-speaking-card, .debrief-speaker-icon, .transcript-part, .ai-criteria,
  .live-private-list li, .live-task-brief, .live-briefing-stage, .live-board-panel,
  .room-stage, .room-moderator
) {
  background-color: var(--surface) !important;
  color: var(--crew-ink) !important;
  border-color: var(--line);
  box-shadow: none;
}

[data-theme="dark"] body :is(
  .debrief-score-ring>span, .debrief-skill-ring>span, .debrief-speaking-ring::before,
  #profile-average-ring>span
) { background: var(--surface); color: var(--crew-ink); }

[data-theme="dark"] body :is(
  .table-button:not(.schedule-reserved), .crew-size-action, .crew-entry-private .crew-entry-action,
  .schedule-back, .schedule-tabbar, .app-tabbar, .segmented, .debrief-sections, .secondary-button,
  .app-mobile-profile, .account-avatar, .profile-button, .seat.vacant, .seat.taken,
  .crew-occupancy-members>span, #waiting-invite, .live-media-controls button,
  .live-preview-controls button:not([aria-pressed="true"]), #live-enter
) {
  background: var(--crew-control) !important;
  color: var(--crew-ink) !important;
  border-color: var(--line) !important;
}
[data-theme="dark"] body :is(.schedule-tabbar a[aria-current],.debrief-sections [aria-selected="true"],.segmented [aria-selected="true"]) {
  background: var(--crew-blue-soft) !important;
  color: var(--crew-blue) !important;
}

[data-theme="dark"] body :is(.primary,.booking-primary:enabled,.crew-entry-public .crew-entry-action) {
  background: var(--dark-button) !important;
  color: white !important;
}
[data-theme="dark"] body :is(input,textarea,select):not([type="radio"],[type="checkbox"],[type="range"],[type="color"]) {
  background: var(--crew-canvas) !important;
  border-color: var(--line);
  color: var(--crew-ink) !important;
}
[data-theme="dark"] body :is(
  .crew-slot-hour, .crew-size-number, .schedule-toolbar h1, .auth-card h2,
  .table-meta time, .native-settings-row, .debrief-title, .debrief-sections button,
  .live-moderator-row, #preflight-schedule strong
) { color: var(--crew-ink) !important; }

[data-theme="dark"] body :is(
  .crew-slot-date, .crew-slot-hour small, .crew-size-caption, .native-settings-row small,
  .auth-card>p, .auth-card label, #live-lobby-status, #live-recording-join-copy,
  .live-recording-notice, #waiting-invite-status
) { color: var(--crew-muted) !important; }

[data-theme="dark"] body :is(.ai-turn-review,.overlap-observation,#live-moderator-voice) {
  background: var(--violet-soft) !important;
  color: var(--crew-ink) !important;
  border-color: var(--violet) !important;
}
[data-theme="dark"] body :is(.ai-turn-review strong,#live-moderator-voice>span) { color: var(--violet) !important; }
[data-theme="dark"] #live-moderator-wave { stroke: var(--violet) !important; }
[data-theme="dark"] body :is(.live-board-sheet,.live-board-sheet canvas) { background-color: white; }

[data-theme="dark"] body :is(.native-settings-row+.native-settings-row,.native-settings-group hr) {
  border-color: var(--line);
}
[data-theme="dark"] body :is(.booking-calendar,.is-latest .session-history-icon) {
  color: var(--crew-blue);
  background-color: var(--crew-blue-soft);
}
