/* Theme-only paint overrides. Layout and the established light palette remain
   in their original stylesheets; the same components are used in both modes. */
:root {
  --on-accent: #fff;
  --auth-surface: #fffdf8;
  --auth-input: #fff;
  --auth-text: #18251f;
  --auth-text-secondary: #5f6964;
  --auth-primary: #183d32;
  --auth-on-primary: #fff;
  --auth-border: #d7d8d0;
  --auth-danger: #b95145;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0b1210;
  --paper-deep: var(--paper);
  --card: #101a16;
  --ink: #f4f1e9;
  --muted: #adb7b0;
  --faint: #8a978e;
  --line: #294338;
  --line-strong: #526d5c;
  --forest: #b9e0ca;
  --forest-strong: #ccebd9;
  --forest-soft: var(--surface-raised);
  --forest-mid: var(--muted);
  --peach: #f3a67c;
  --peach-hover: #f6b58f;
  --peach-soft: var(--surface-raised);
  --amber: #e8bd77;
  --red: #ffada0;
  --accent: var(--forest);
  --on-accent: #13291d;
  --surface-raised: #15211c;
  --surface-hover: #1a2922;
  --surface-glass: rgba(21, 33, 28, .97);
  --surface-input: #0d1713;
  --warning-surface: #3c3020;
  --warning-text: #f3ce91;
  --danger-surface: #442b28;
  --danger-line: #855049;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .18), 0 8px 22px rgba(0, 0, 0, .12);
  --shadow-md: 0 16px 38px rgba(0, 0, 0, .22), 0 2px 8px rgba(0, 0, 0, .15);
  --shadow-lg: 0 32px 90px rgba(0, 0, 0, .48), 0 4px 12px rgba(0, 0, 0, .25);
  --network-card-surface: var(--card);
  --network-card-surface-hover: var(--surface-raised);
  --network-card-border: var(--line);
  --network-card-border-hover: var(--line-strong);
  --network-card-shadow: var(--shadow-sm);
  --network-card-shadow-hover: var(--shadow-md);
  --auth-surface: var(--card);
  --auth-input: var(--surface-input);
  --auth-text: var(--ink);
  --auth-text-secondary: var(--muted);
  --auth-primary: var(--forest);
  --auth-on-primary: var(--on-accent);
  --auth-border: var(--line-strong);
  --auth-danger: var(--red);
}

:root[data-theme="dark"] body {
  background: var(--paper);
  color: var(--ink);
}
:root[data-theme="dark"] dialog { color: var(--ink); }
:root[data-theme="dark"] ::selection { background: var(--forest); color: var(--on-accent); }
:root[data-theme="dark"] :is(button, a, input, textarea, select):focus-visible {
  outline-color: var(--forest);
}
:root[data-theme="dark"] :is(input, textarea, select) { caret-color: var(--forest); }

/* Ivory carries the content hierarchy; mint identifies actions and the Query feature. */
:root[data-theme="dark"] :is(.hero-card h2, .network-page-heading h2, .contact-identity-name, .detail-top-group h2, .reminder-tray-header h2, .profile-ai-usage h3, .profile-ai-metrics strong, .deep-search-panel h2, .settings-theme legend, .app-about-card h3, .app-about-contact h3) { color: var(--ink); }
:root[data-theme="dark"] .query-action-card h2 { color: var(--forest); }
:root[data-theme="dark"] :is(.home-note-composer > button, .note-dictate-button, .mobile-nav-capture, .hero-action, .button.peach) { background: var(--peach); color: #38231a; }
:root[data-theme="dark"] :is(.home-note-composer > button, .note-dictate-button, .mobile-nav-capture, .hero-action, .button.peach):hover { background: var(--peach-hover); }

/* Navigation, translucent layers and shared cards. */
:root[data-theme="dark"] .sidebar { background: var(--card); border-color: var(--line); }
:root[data-theme="dark"] .nav-item { color: var(--muted); }
:root[data-theme="dark"] .nav-item:hover { background: var(--forest-soft); }
:root[data-theme="dark"] .nav-item em { background: var(--forest-soft); }
:root[data-theme="dark"] .nav-item.active { background: var(--forest); color: var(--on-accent); }
:root[data-theme="dark"] .nav-item.active em { background: rgba(19, 41, 29, .12); color: var(--on-accent); }
:root[data-theme="dark"] :is(.how-it-works-button, .feedback-button, .topbar-about-link, .nested-back-button, .contact-log-button) {
  border-color: var(--line);
  background: var(--card);
}
:root[data-theme="dark"] :is(.how-it-works-button, .feedback-button, .topbar-about-link, .nested-back-button, .contact-log-button):hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}
:root[data-theme="dark"] :is(.how-it-works-button.active, .topbar-about-link.active) { background: var(--forest); color: var(--on-accent); }
:root[data-theme="dark"] .avatar-button { border-color: var(--line-strong); background: var(--forest-soft); }
:root[data-theme="dark"] .avatar-button:hover { background: var(--surface-hover); }
:root[data-theme="dark"] .account-sign-out { color: var(--red); }
:root[data-theme="dark"] .list-sort-toggle { background: var(--paper-deep); }
:root[data-theme="dark"] :is(.reminder-tray, .group-picker-suggestions) {
  border-color: var(--line-strong);
  background: var(--surface-glass);
  box-shadow: var(--shadow-lg);
}
:root[data-theme="dark"] .reminder-tray-scrim { background: rgba(0, 0, 0, .4); }
:root[data-theme="dark"] :is(.capture-draft-card, .memory-row, .activity-row, .panel-card, .how-note-example, .how-query-examples button, .how-reminder-panel) {
  border-color: var(--line);
  background: var(--card);
}
:root[data-theme="dark"] .empty-state { border-color: var(--line-strong); background: var(--card); }
:root[data-theme="dark"] :is(.person-card footer, .group-card footer, .reminder-row, .reminder-tray-item, .saved-note-card + .saved-note-card, .contact-profile-footer) { border-color: var(--line); }
:root[data-theme="dark"] .saved-notes-panel { border-color: var(--line); }
:root[data-theme="dark"] .group-pill { border-color: var(--line-strong); background: var(--forest-soft); color: var(--forest); }
/* Initials keep their assigned pastel avatar colors; photos are untouched. */
:root[data-theme="dark"] .person-avatar { color: #183d32; }
:root[data-theme="dark"] .group-icon:not([class*="group-icon-color-"]) { color: var(--on-accent); }
@media (hover: hover) and (pointer: fine) {
  :root[data-theme="dark"] .contact-identity-copy:has(> .contact-identity-edit-target:hover) { background: var(--forest-soft); }
}
/* Detail back arrows keep their full tap target without a frame beside the avatar. */
:root[data-theme="dark"] :is(.detail-top-group, .detail-top-contact) .nested-back-button,
:root[data-theme="dark"] :is(.detail-top-group, .detail-top-contact) .nested-back-button:hover {
  border-color: transparent;
  background: transparent;
}

/* Form surfaces use a quiet inset color, including all contact editors. */
:root[data-theme="dark"] :is(.field input, .field textarea, .field select, .search-control input, .home-query-form input, .contact-merge-search input, .group-picker-control, .contact-search-control, .ask-form, .voice-transcript-card) {
  border-color: var(--line-strong);
  background: var(--surface-input);
  color: var(--ink);
  box-shadow: none;
}
:root[data-theme="dark"] :is(.home-note-composer textarea, .note-composer-field textarea) {
  border-color: var(--line);
  background: var(--surface-input);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
:root[data-theme="dark"] :is(.home-note-composer textarea, .note-composer-field textarea):hover { background: var(--surface-input); border-color: var(--line-strong); }
:root[data-theme="dark"] :is(.field input, .field textarea, .field select, .home-query-form input):focus,
:root[data-theme="dark"] :is(.group-picker-control, .contact-search-control):focus-within {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(185, 224, 202, .18);
}
:root[data-theme="dark"] :is(.home-note-composer textarea, .note-composer-field textarea):focus {
  background: var(--surface-input);
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(185, 224, 202, .18);
}
:root[data-theme="dark"] :is(.field input:read-only, .field input:disabled, .field textarea:disabled, .field select:disabled, .home-query-form input:disabled, .ask-form[aria-disabled="true"]) {
  border-color: var(--line);
  background: #26312c;
  color: var(--muted);
  box-shadow: none;
}
:root[data-theme="dark"] :is(.field.provisional input, .field.provisional textarea) { background: var(--surface-input); }
:root[data-theme="dark"] .field input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 173, 160, .15); }
:root[data-theme="dark"] .contact-details-dialog .field > .date-control {
  border-color: var(--line-strong);
  background: var(--surface-input);
}
:root[data-theme="dark"] .contact-details-dialog .date-control:focus-within {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(185, 224, 202, .18);
}
:root[data-theme="dark"] .contact-details-dialog .date-control:has(input:disabled) {
  border-color: var(--line);
  background: var(--paper-deep);
}
/* The wrapper owns decoration so the native iPhone field stays within it. */
:root[data-theme="dark"] .contact-details-dialog .date-control input,
:root[data-theme="dark"] .contact-details-dialog .date-control input:focus {
  background: transparent;
  box-shadow: none;
}
:root[data-theme="dark"] :is(.search-control [data-standalone-icon], .contact-picker-search > span, .group-assignment-search > span) { color: var(--faint); }

/* Mint actions always have dark labels; destructive and peach actions retain
   their own contrasting foregrounds. */
:root[data-theme="dark"] :is(.button.primary, .home-query-form button, .ask-form button, .bulk-import-notice, .vault-pairing-row button, .install-steps li > span, .ask-choice .voice-choice-icon, .app-about-callout > button) {
  border-color: var(--forest);
  background: var(--forest);
  color: var(--on-accent);
}
:root[data-theme="dark"] :is(.button.primary:hover, .home-query-form button:hover, .ask-form button:hover, .bulk-import-notice:hover) { background: var(--forest-strong); color: var(--on-accent); }
:root[data-theme="dark"] :is(.home-query-form button:disabled, .ask-form button:disabled) { background: var(--line); color: var(--faint); }
:root[data-theme="dark"] .button:hover { border-color: var(--line-strong); }
:root[data-theme="dark"] .button:not(.primary):not(.peach):not(.danger):hover { background: var(--surface-hover); }
:root[data-theme="dark"] .button.danger { border-color: var(--danger-line); color: var(--red); }
:root[data-theme="dark"] .button.danger:hover { background: var(--danger-surface); }
:root[data-theme="dark"] .confirm-actions .button.danger { border-color: #8d4037; background: #8d4037; color: #fff4ef; }
:root[data-theme="dark"] :is(.group-add-option, .group-new-input-row .icon-button, .contact-reassignment-summary button, .capture-target-card button, .reminder-tray-actions button, .reminder-snooze-options button, .note-composer-close, .deep-search-button, .intent-pill) {
  border-color: var(--line-strong);
  background: var(--surface-raised);
}
:root[data-theme="dark"] :is(.group-add-option, .icon-button, .contact-reassignment-summary button, .capture-target-card button, .reminder-tray-actions button, .reminder-snooze-options button, .note-composer-close, .deep-search-button):hover {
  border-color: var(--forest-mid);
  background: var(--surface-hover);
}
:root[data-theme="dark"] .prompt-chip { border-color: var(--line-strong); background: var(--card); color: var(--muted); }
:root[data-theme="dark"] .prompt-chip:hover { border-color: var(--forest-mid); background: var(--surface-hover); color: var(--ink); }

/* Capture, Ask and their review states. */
:root[data-theme="dark"] :is(.home-action-grid .hero-card, .capture-dialog.note-composer-dialog, .capture-dialog.voice-dictation-dialog) {
  border-color: var(--line);
  background: var(--card);
}
:root[data-theme="dark"] :is(.query-action-card, .query-awaiting-first-contact, .ask-hero, .deep-search-invitation, .deep-search-panel, .profile-ai-usage, .profile-vault-security) {
  border-color: var(--line);
  background: var(--surface-raised);
}
:root[data-theme="dark"] .deep-search-invitation:hover { border-color: var(--forest-mid); background: var(--surface-hover); }
:root[data-theme="dark"] :is(.query-locked-note, .query-action-card .prompt-chip) { border-color: var(--line); background: var(--card); }
:root[data-theme="dark"] :is(.first-contact-reassurance > span, .duplicate-contact-search-icon, .action-step span) { background: var(--forest-soft); }
:root[data-theme="dark"] :is(.capture-dialog, .feedback-dialog, .confirm-dialog, .bulk-import-dialog) { border-color: var(--line-strong); }
:root[data-theme="dark"] :is(.capture-dialog, .feedback-dialog, .confirm-dialog, .bulk-import-dialog)::backdrop { background: rgba(0, 0, 0, .65); }
:root[data-theme="dark"] :is(.dialog-header, .feedback-header, .feedback-footer) { border-color: var(--line); background: var(--surface-raised); }
:root[data-theme="dark"] .capture-dialog.new-contact-review .dialog-header { border-color: var(--line); background: var(--peach-soft); }
:root[data-theme="dark"] .capture-dialog.existing-contact-review .dialog-header { border-color: var(--line-strong); background: var(--forest-soft); }
:root[data-theme="dark"] :is(.dictation-guide, .reminder-fields, .contact-create-new) { border-color: var(--line); background: var(--peach-soft); }
:root[data-theme="dark"] .contact-create-new:hover { border-color: var(--forest); background: var(--surface-hover); }
:root[data-theme="dark"] :is(.voice-choice-card.ask-choice, .action-rail, .spoken-groups, .original-words, .duplicate-contact-suggestions, .capture-target-card, .vault-recovery-code, .bulk-import-batch-field) {
  border-color: var(--line-strong);
  background: var(--forest-soft);
}
:root[data-theme="dark"] .voice-choice-card.capture-choice { background: var(--surface-raised); color: var(--ink); }
:root[data-theme="dark"] .capture-choice .voice-choice-copy span { color: var(--muted); }
:root[data-theme="dark"] .ask-choice .voice-choice-arrow { background: var(--surface-hover); }
:root[data-theme="dark"] :is(.memory-original-date, .contact-reassignment, .contact-chooser-empty, .reminder-contact-options, .deep-search-status-line, .evidence) {
  border-color: var(--line-strong);
  background: var(--paper-deep);
  color: var(--muted);
}
:root[data-theme="dark"] :is(.confidence, .duplicate-contact-search-all, .contact-reassignment-panel, .profile-ai-breakdown) { border-color: var(--line); }
:root[data-theme="dark"] :is(.group-merge-choice, .group-choice, .contact-choice, .duplicate-contact-option) { border-color: var(--line); background: var(--card); }
:root[data-theme="dark"] :is(.group-merge-choice, .group-choice, .contact-choice, .duplicate-contact-option):hover { border-color: var(--line-strong); background: var(--surface-hover); }
:root[data-theme="dark"] :is(.group-merge-choice, .group-choice, .contact-choice, .contact-picker-row):has(input:checked) { border-color: var(--forest-mid); background: var(--forest-soft); }
:root[data-theme="dark"] :is(.contact-reassignment-option:hover, .contact-reassignment-option:focus-visible, .contact-reassignment-option.selected) { border-color: var(--line-strong); background: var(--surface-hover); }
:root[data-theme="dark"] :is(.group-merge-check, .group-choice-check, .contact-choice-check, .bulk-contact-checkbox) { border-color: var(--line-strong); background: var(--surface-input); }
:root[data-theme="dark"] :is(.group-merge-choice, .group-choice):has(input:checked) :is(.group-merge-check, .group-choice-check),
:root[data-theme="dark"] .contact-choice input:checked + .contact-choice-check,
:root[data-theme="dark"] .bulk-contact-create-toggle[aria-checked="true"] .bulk-contact-checkbox {
  border-color: var(--forest);
  background: var(--forest);
  color: var(--on-accent);
}
:root[data-theme="dark"] :is(.contact-picker-empty, .group-assignment-empty) { border-color: var(--line-strong); }
:root[data-theme="dark"] .group-picker-chip button { background: rgba(185, 224, 202, .12); }
:root[data-theme="dark"] :is(.deep-result-card, .deep-search-match-block.is-low .deep-result-card, .deep-search-status > .deep-search-match-block, .query-group-result-card) { border-color: var(--line); background: var(--card); }
:root[data-theme="dark"] .deep-search-match-block.is-high .deep-result-card { border-color: #618c72; }
:root[data-theme="dark"] .deep-search-match-block.is-low .deep-result-card { border-color: #7e6846; }
:root[data-theme="dark"] :is(.deep-search-panel-mark, .profile-ai-metrics > div, .vault-device-row, .feedback-preview, .install-steps li) { border-color: var(--line); background: var(--surface-raised); }
:root[data-theme="dark"] .deep-match-strength.is-high > strong { background: var(--forest-soft); color: var(--forest); }
:root[data-theme="dark"] .deep-match-strength.is-low > strong { background: var(--warning-surface); color: var(--warning-text); }
:root[data-theme="dark"] .deep-search-match-block.is-high > h3 { color: var(--forest); }
:root[data-theme="dark"] :is(.deep-search-match-block.is-low > h3, .deep-lower-potential-toggle) { color: var(--warning-text); }
:root[data-theme="dark"] .deep-match-meter { background: var(--line); }
:root[data-theme="dark"] .deep-match-strength.is-high .deep-match-meter i { background: linear-gradient(90deg, #77b28d, var(--forest)); }
:root[data-theme="dark"] .deep-match-strength.is-low .deep-match-meter i { background: linear-gradient(90deg, #c89a52, var(--amber)); }
:root[data-theme="dark"] :is(.deep-search-badge, .vault-pairing-row, .completed-reminder-card) { border-color: var(--line); background: var(--peach-soft); }
:root[data-theme="dark"] :is(.result-card, .note-card, .query-group-result-card):hover { border-color: var(--line-strong); }

/* Replace fixed dark inks on secondary copy and colored chips. */
:root[data-theme="dark"] :is(.reminder-row strong, .fact-cell strong, .note-card p, .how-note-example > p, .query-summary, .live-transcript, .detail-top-contact .contact-identity-role, .deep-search-reason) { color: var(--ink); }
:root[data-theme="dark"] :is(.how-hero > p:last-child, .how-query-examples button, .original-words p, .dictation-purpose, .note-composer-heading p, .install-security-note, .note-composer-close) { color: var(--muted); }
:root[data-theme="dark"] :is(.first-contact-kicker, .home-note-meta > button, .query-locked-note span, .capture-draft-card > span, .query-summary span, .deep-search-badge, .group-add-option-icon.peach, .group-picker-suggestion.create > span:first-child, .contact-create-new-icon, .contact-create-new > svg, .how-kicker, .how-closing p, .voice-listening-heading .live-label, .note-composer-tip > span, .completed-reminder-card time, .completed-reminder-card .source-badge, .reminder-tray-item.is-due .reminder-tray-content span, .bulk-contact-issues) { color: var(--peach); }
:root[data-theme="dark"] :is(.delete-memory-link, .delete-contact-link, .form-error) { color: var(--red); }
:root[data-theme="dark"] :is(.auth-message, .form-save-error, .bulk-import-error) { border-color: var(--danger-line); background: var(--danger-surface); color: var(--red); }
:root[data-theme="dark"] .draft-warning { border-color: #7e6846; background: var(--warning-surface); color: var(--warning-text); }
:root[data-theme="dark"] .confirm-icon { background: var(--danger-surface); }
:root[data-theme="dark"] .vault-device-row button { border-color: var(--danger-line); background: var(--danger-surface); color: var(--red); }
:root[data-theme="dark"] .vault-device-row button[data-vault-action="rename"] { border-color: var(--line-strong); background: var(--surface-raised); color: var(--forest); }
:root[data-theme="dark"] .vault-pairing-row button { border-color: var(--forest); background: var(--forest); color: var(--on-accent); }
:root[data-theme="dark"] .feedback-upload { border-color: var(--line-strong); background: var(--paper-deep); }
:root[data-theme="dark"] :is(.install-app-icon, .how-step-number) { border-color: var(--line-strong); }
:root[data-theme="dark"] kbd { border-color: var(--line-strong); background: var(--surface-raised); }
:root[data-theme="dark"] .timeline::before { background: var(--line); }
:root[data-theme="dark"] .note-timeline-item::before { box-shadow: 0 0 0 1px var(--line-strong); }
:root[data-theme="dark"] :is(.reminder-check, .reminder-check::before) { border-color: var(--faint); }
:root[data-theme="dark"] .reminder-tray-item.is-complete { background: var(--forest-soft); }
:root[data-theme="dark"] .reminder-tray-item.is-due { background: var(--peach-soft); }
:root[data-theme="dark"] .how-reminder-row .reminder-content:hover strong { color: var(--forest); }
:root[data-theme="dark"] .bulk-review-group:has(input:checked) { border-color: var(--forest-mid); }
:root[data-theme="dark"] .bulk-contact-checkbox { color: var(--surface-input); }
:root[data-theme="dark"] .toast { border-color: var(--line-strong); background: var(--surface-hover); }
:root[data-theme="dark"] .toast.error { background: #6c302b; }

/* Auth and recovery screens follow the same palette before the app loads. */
:root[data-theme="dark"] .auth-gate { background: var(--paper); }
:root[data-theme="dark"] .auth-card { border-color: var(--line-strong); background: var(--surface-glass); box-shadow: var(--shadow-lg); }
:root[data-theme="dark"] .auth-gate[data-auth-screen="sign-in"] .auth-waitlist-callout { background: var(--forest-soft); border-color: var(--line-strong); color: var(--ink); }
:root[data-theme="dark"] .auth-waitlist-callout h2 { color: var(--ink); }
:root[data-theme="dark"] .auth-waitlist-button { border-color: var(--forest); background: var(--forest); color: var(--on-accent); }
:root[data-theme="dark"] .auth-waitlist-button:hover,
:root[data-theme="dark"] .auth-waitlist-button:focus-visible { background: var(--forest-strong); }

/* In-app About retains its illustrations, videos and brand-colored panels. */
:root[data-theme="dark"] :is(.app-about-card, .app-about-number, .app-about-examples > p, .app-about-contact > a, .app-about-video-shell) { border-color: var(--line-strong); }
:root[data-theme="dark"] .app-about-log { background: var(--peach-soft); }
:root[data-theme="dark"] .app-about-query { background: var(--card); }
:root[data-theme="dark"] .app-about-remind { background: var(--forest-soft); }
:root[data-theme="dark"] .app-about-card header p { color: var(--muted); }
:root[data-theme="dark"] .app-about-examples > p { background: var(--card); }
:root[data-theme="dark"] .app-about-query .app-about-examples > p { background: var(--forest-soft); color: var(--ink); }
:root[data-theme="dark"] .app-about-query .app-about-examples > p > span { background: rgba(185, 224, 202, .1); color: var(--peach); }
:root[data-theme="dark"] .app-about-remind .app-about-examples > p > span { background: var(--forest-soft); }
:root[data-theme="dark"] .app-about-security { background: var(--surface-raised); }
:root[data-theme="dark"] :is(.app-about-security-proof, .app-about-key-stays p > span, .app-about-ai-boundary p > span, .app-about-protection-flow article > p, .app-about-security-details p, .app-about-flow-label, .app-about-flow-arrow span) { color: var(--muted); }
:root[data-theme="dark"] .app-about-video-error { background: var(--forest-soft); }
:root[data-theme="dark"] .about-video-error { background: var(--danger-surface); color: var(--red); }
:root[data-theme="dark"] .about-video-pagination button { background: var(--line-strong); }
:root[data-theme="dark"] .about-video-pagination button[aria-current="true"] { background: var(--forest); }

/* Evidence pulses must not flash a light card while its text is light. */
:root[data-theme="dark"] .note-timeline-item.search-evidence-focus .note-card {
  border-color: var(--peach);
  background: var(--peach-soft);
  animation-name: dark-evidence-note-pulse;
}
:root[data-theme="dark"] .reminder-row.search-evidence-focus { background: var(--peach-soft); animation-name: dark-evidence-reminder-pulse; }
@keyframes dark-evidence-note-pulse {
  0%, 18% { border-color: var(--peach); background: var(--peach-soft); box-shadow: 0 0 0 5px rgba(243, 166, 124, .24), var(--shadow-md); }
  48% { border-color: var(--peach); background: var(--surface-hover); box-shadow: 0 0 0 3px rgba(243, 166, 124, .14), var(--shadow-md); }
  100% { border-color: var(--line); background: var(--card); box-shadow: var(--shadow-sm); }
}
@keyframes dark-evidence-reminder-pulse {
  0%, 20% { background: var(--peach-soft); box-shadow: 0 0 0 5px rgba(243, 166, 124, .24), var(--shadow-md); }
  48% { background: var(--surface-hover); box-shadow: 0 0 0 3px rgba(243, 166, 124, .14), var(--shadow-sm); }
  100% { background: transparent; box-shadow: none; }
}

@media (max-width: 800px) {
  :root[data-theme="dark"] .topbar { border-color: var(--line); background: linear-gradient(to bottom, var(--paper), rgba(11, 18, 16, .72) 42%, rgba(11, 18, 16, 0)); }
  :root[data-theme="dark"] .mobile-brand .reminder-badge { border-color: var(--paper); }
  :root[data-theme="dark"] .mobile-nav-item { color: var(--faint); }
  :root[data-theme="dark"] .mobile-nav-item.active { color: var(--forest); }
  :root[data-theme="dark"] .mobile-nav-item.active::after { background: var(--forest); }
  :root[data-theme="dark"] .list-sort-toggle { background: transparent; }
  :root[data-theme="dark"] .mobile-nav {
    border-color: var(--line-strong);
    background: var(--surface-glass);
    box-shadow: inset 0 1px 0 rgba(185, 224, 202, .08), var(--shadow-md);
  }
  :root[data-theme="dark"] .mobile-nav-capture { border-color: var(--card); box-shadow: 0 0 0 1px var(--line-strong), 0 9px 22px rgba(0, 0, 0, .3); }
  :root[data-theme="dark"] .mobile-nav-capture:active { box-shadow: 0 0 0 1px var(--line-strong), 0 5px 13px rgba(0, 0, 0, .3); }
  :root[data-theme="dark"] :is(.dictation-actions, .draft-actions) { background: var(--surface-glass); }
  :root[data-theme="dark"] .note-composer-view .dictation-actions { background: transparent; }
  :root[data-theme="dark"] :is(.note-composer-view .dictation-actions, .voice-dictation-view .listening-actions) .button.ghost { background: var(--surface-raised); }
}
:root[data-theme="dark"] .bulk-import-footer { background: var(--surface-glass); }
