/* Light colours remain the default; dark colours are scoped to the chosen theme. */
:root { color-scheme: light; }
.theme-switch {
  display: inline-flex;
  flex-shrink: 0;
  padding: 3px;
  gap: 2px;
  border: 1px solid #cdd2c5;
  background: #e7eadf;
  border-radius: 24px;
}
.theme-choice {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 6px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #626c59;
}
.theme-choice svg { width: 18px; height: 18px; }
.theme-choice:hover { color: #1847bb; }
.theme-choice[aria-pressed="true"] { background: #ffffff; color: #1847bb; box-shadow: 0 1px 4px #2330201a; }
.theme-choice:focus-visible { outline-offset: 3px; }

html[data-theme="dark"] {
  color-scheme: dark;
  --dark-page: #141b18;
  --dark-panel: #1c2721;
  --dark-input: #202d25;
  --dark-text: #f0f2e9;
  --dark-muted: #b2bdae;
  --dark-border: #415043;
  --dark-accent: #9abaff;
}
html[data-theme="dark"] body { background: var(--dark-page); color: var(--dark-text); }
html[data-theme="dark"] .header { background: #141b18f5; border-color: var(--dark-border); }
html[data-theme="dark"] .header-actions select,
html[data-theme="dark"] .menu-toggle { color: var(--dark-text); }
html[data-theme="dark"] .header nav a:hover,
html[data-theme="dark"] .hero h1 span,
html[data-theme="dark"] .cross,
html[data-theme="dark"] .value-icon,
html[data-theme="dark"] .role-arrow,
html[data-theme="dark"] .role-choice:hover strong,
html[data-theme="dark"] .document-note>span,
html[data-theme="dark"] .upload-icon,
html[data-theme="dark"] .inline-button,
html[data-theme="dark"] .file-list button,
html[data-theme="dark"] .faq summary span { color: var(--dark-accent); }
html[data-theme="dark"] .hero-intro,
html[data-theme="dark"] .hero-note,
html[data-theme="dark"] .section p,
html[data-theme="dark"] .role-choice small,
html[data-theme="dark"] .role-number,
html[data-theme="dark"] .document-note ul,
html[data-theme="dark"] .document-note small,
html[data-theme="dark"] footer>p { color: var(--dark-muted); }
html[data-theme="dark"] .section .eyebrow { color: var(--dark-text); }
html[data-theme="dark"] .split .large-copy { color: var(--dark-text); }
html[data-theme="dark"] .hero-note,
html[data-theme="dark"] .hero-bottom,
html[data-theme="dark"] .values article,
html[data-theme="dark"] .role-choice,
html[data-theme="dark"] .process-note,
html[data-theme="dark"] .document-note,
html[data-theme="dark"] legend,
html[data-theme="dark"] .file-list li,
html[data-theme="dark"] .faq,
html[data-theme="dark"] .faq details,
html[data-theme="dark"] footer,
html[data-theme="dark"] .header nav { border-color: var(--dark-border); }
html[data-theme="dark"] .units { background: #101611; }
html[data-theme="dark"] .units .section-heading>p,
html[data-theme="dark"] .units .section-note { color: #b5c1ac; }
html[data-theme="dark"] .unit-card:hover { background: #202d21; }
html[data-theme="dark"] .unit-card>p:not(.unit-uk) { color: #c1cbb8; }
html[data-theme="dark"] .unit-card .unit-uk { color: #b5c1ac; }
html[data-theme="dark"] .process,
html[data-theme="dark"] .closing { background: var(--dark-panel); }
html[data-theme="dark"] .step-number { color: #b5c999; border-color: var(--dark-border); }
html[data-theme="dark"] .process-note>span { border-color: #9cae8b; }
html[data-theme="dark"] label { color: #d8e0d0; }
html[data-theme="dark"] label>span[aria-hidden],
html[data-theme="dark"] legend span { color: var(--dark-muted); }
html[data-theme="dark"] input:not([type="checkbox"]):not([type="file"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] form select {
  border-color: #57654f;
  background: var(--dark-input);
  color: var(--dark-text);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #aab7a4; opacity: 1; }
html[data-theme="dark"] .field-help { color: var(--dark-muted)!important; }
html[data-theme="dark"] .upload { background: var(--dark-panel); border-color: #819273; }
html[data-theme="dark"] .upload:hover { border-color: var(--dark-accent); }
html[data-theme="dark"] .file-button { border-color: #819273; }
html[data-theme="dark"] .notice { background: #332f1c; border-color: #978449; }
html[data-theme="dark"] .notice p { color: #e1d5a4; }
html[data-theme="dark"] #form-status:not(:empty) { background: #3b2521; color: #ffd1c5; border-color: #a26b5d; }
html[data-theme="dark"] #form-status.success { background: #223724; color: #d2efba; border-color: #6b8e53; }
html[data-theme="dark"] dialog { background: var(--dark-panel); color: var(--dark-text); border-color: #65735b; }
html[data-theme="dark"] .dialog-close { color: var(--dark-text); }
html[data-theme="dark"] .theme-switch { border-color: #526348; background: #202c23; }
html[data-theme="dark"] .theme-choice { color: #b5c2ab; }
html[data-theme="dark"] .theme-choice:hover { color: #f8d44d; }
html[data-theme="dark"] .theme-choice[aria-pressed="true"] { background: #f8d44d; color: #20251f; box-shadow: none; }
html[data-theme="dark"] .checkbox input { accent-color: #9abaff; }
html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] summary:focus-visible,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] .upload:focus-within { outline-color: #9abaff; }

@media(max-width:1150px) { .header { gap: 16px; } }
@media(max-width:600px) {
  .header { gap: 9px; }
  .header .brand { flex: 1; min-width: 0; max-width: none; }
  .header .brand>span { overflow-wrap: anywhere; }
  .header .menu-toggle { flex-shrink: 0; margin-left: 0; }
  .header-actions { gap: 5px; }
  .theme-choice { width: 30px; height: 30px; }
  .theme-switch { padding: 2px; }
}
