/* Global theme ownership.
   Loaded with the app shell so theme behavior never depends on opening Microscope. */

/* App-wide black and white theme.
   User content such as imported images, card artwork, canvases, and editor content stays in its own colors. */
html[data-theme-accent="black"] {
  color-scheme: light;
  --app-bg: #f4f4f4 !important;
  --bg: #f4f4f4 !important;
  --panel: rgba(255,255,255,0.96) !important;
  --panel-2: rgba(247,247,247,0.94) !important;
  --surface-raised: rgba(255,255,255,0.98) !important;
  --surface-muted: rgba(239,239,239,0.92) !important;
  --surface-elevated: #ffffff !important;
  --text: #111111 !important;
  --muted: #5a5a5a !important;
  --line: #cfcfcf !important;
  --card-border: #d7d7d7 !important;
  --accent: #111111 !important;
  --accent-2: #5a5a5a !important;
  --accent-soft: rgba(0,0,0,0.08) !important;
  --accent-strong: #000000 !important;
  --accent-shadow: rgba(0,0,0,0.16) !important;
  --accent-shadow-soft: rgba(0,0,0,0.08) !important;
  --accent-ring: rgba(0,0,0,0.20) !important;
  --study-accent: #111111 !important;
  --study-accent-2: #5a5a5a !important;
  --study-text: #ffffff !important;
  --study-shadow: rgba(0,0,0,0.16) !important;
  --input-bg: #ffffff !important;
  --input-bg-strong: #ffffff !important;
  --secondary-bg: #ffffff !important;
  --soft-bg: #f1f1f1 !important;
  --menu-bg: #ffffff !important;
  --tab-bg: #ffffff !important;
  --tab-text: #555555 !important;
  --subtle-bg: #f2f2f2 !important;
  --subtle-border: #d2d2d2 !important;
  --count-bg: #eeeeee !important;
  --count-text: #111111 !important;
  --hero-bg: linear-gradient(135deg, #070707 0%, #1f1f1f 48%, #4a4a4a 100%) !important;
  --hero-pill-bg: rgba(255,255,255,0.12) !important;
  --hero-pill-border: rgba(255,255,255,0.28) !important;
  --hero-mark-opacity: 0.44 !important;
  --hero-mark-filter: grayscale(1) contrast(1.22) drop-shadow(0 0 18px rgba(255,255,255,0.12)) !important;
  --hero-mark-blend: screen !important;
  --theme-toggle-bg: rgba(255,255,255,0.92) !important;
  --theme-toggle-border: #cfcfcf !important;
  --theme-toggle-track: rgba(0,0,0,0.10) !important;
  --theme-toggle-thumb: #111111 !important;
  --theme-toggle-text: #111111 !important;
  --system-ambient-bg: #f4f4f4 !important;
  --system-ambient-panel: #ffffff !important;
  --system-ambient-border: #d4d4d4 !important;
  --system-toggle-track: rgba(0,0,0,0.10) !important;
  --danger-bg: #eeeeee !important;
  --danger-border: #b9b9b9 !important;
  --danger-text: #111111 !important;
  --good: #111111 !important;
  --good-bg: #f0f0f0 !important;
  --bad: #111111 !important;
  --bad-bg: #eeeeee !important;
  --warn: #111111 !important;
  --warn-bg: #f3f3f3 !important;
  --shadow: 0 20px 52px rgba(0,0,0,0.18) !important;
  --modal-solid-bg: #f8f8f8 !important;
  --modal-solid-panel: #ffffff !important;
  --modal-solid-soft: #eeeeee !important;
  --modal-solid-strong: #ffffff !important;
  --select-bg-hover: #eeeeee !important;
  --select-border: #cfcfcf !important;
  --select-border-hover: #111111 !important;
  --select-focus-ring: rgba(0,0,0,0.18) !important;
  --button-hover: #2d2d2d !important;
  --button-secondary-hover: #eeeeee !important;
  --chip-bg: #f2f2f2 !important;
  --chip-border: #cfcfcf !important;
  --chip-text: #111111 !important;
  --type-slides-bg: #f2f2f2 !important;
  --type-slides-border: #cfcfcf !important;
  --type-slides-text: #111111 !important;
  --type-cards-bg: #f2f2f2 !important;
  --type-cards-border: #cfcfcf !important;
  --type-cards-text: #111111 !important;
  --tag-bg: #eeeeee !important;
  --tag-border: #c8c8c8 !important;
  --tag-text: #111111 !important;
  --tag-icon: #333333 !important;
  --pack-action-primary-bg: #111111 !important;
  --pack-action-primary-border: #111111 !important;
  --pack-action-primary-text: #ffffff !important;
  --pack-action-primary-complete-bg: #2d2d2d !important;
  --pack-pin-active-bg: #eeeeee !important;
  --pack-pin-active-border: #b9b9b9 !important;
  --pack-pin-active-text: #111111 !important;
}

html[data-theme="dark"][data-theme-accent="black"] {
  color-scheme: dark;
  --app-bg: #050505 !important;
  --bg: #050505 !important;
  --panel: rgba(18,18,18,0.96) !important;
  --panel-2: rgba(26,26,26,0.92) !important;
  --surface-raised: rgba(24,24,24,0.96) !important;
  --surface-muted: rgba(32,32,32,0.92) !important;
  --surface-elevated: #171717 !important;
  --text: #f5f5f5 !important;
  --muted: #b8b8b8 !important;
  --line: #3a3a3a !important;
  --card-border: #303030 !important;
  --accent: #f5f5f5 !important;
  --accent-2: #a6a6a6 !important;
  --accent-soft: rgba(255,255,255,0.10) !important;
  --accent-strong: #ffffff !important;
  --accent-shadow: rgba(255,255,255,0.12) !important;
  --accent-shadow-soft: rgba(255,255,255,0.06) !important;
  --accent-ring: rgba(255,255,255,0.22) !important;
  --study-accent: #f5f5f5 !important;
  --study-accent-2: #a6a6a6 !important;
  --study-text: #050505 !important;
  --study-shadow: rgba(255,255,255,0.10) !important;
  --input-bg: #111111 !important;
  --input-bg-strong: #141414 !important;
  --secondary-bg: #171717 !important;
  --soft-bg: #1f1f1f !important;
  --menu-bg: #111111 !important;
  --tab-bg: #141414 !important;
  --tab-text: #cfcfcf !important;
  --subtle-bg: #1a1a1a !important;
  --subtle-border: #333333 !important;
  --count-bg: #232323 !important;
  --count-text: #f5f5f5 !important;
  --hero-bg: linear-gradient(135deg, #000000 0%, #171717 46%, #3a3a3a 100%) !important;
  --hero-pill-bg: rgba(255,255,255,0.08) !important;
  --hero-pill-border: rgba(255,255,255,0.20) !important;
  --theme-toggle-bg: rgba(18,18,18,0.92) !important;
  --theme-toggle-border: #373737 !important;
  --theme-toggle-track: rgba(255,255,255,0.10) !important;
  --theme-toggle-thumb: #f5f5f5 !important;
  --theme-toggle-text: #f5f5f5 !important;
  --system-ambient-bg: #050505 !important;
  --system-ambient-panel: #121212 !important;
  --system-ambient-border: #333333 !important;
  --system-toggle-track: rgba(255,255,255,0.10) !important;
  --danger-bg: #202020 !important;
  --danger-border: #505050 !important;
  --danger-text: #f5f5f5 !important;
  --good: #f5f5f5 !important;
  --good-bg: #202020 !important;
  --bad: #f5f5f5 !important;
  --bad-bg: #222222 !important;
  --warn: #f5f5f5 !important;
  --warn-bg: #1f1f1f !important;
  --shadow: 0 24px 70px rgba(0,0,0,0.58) !important;
  --modal-solid-bg: #101010 !important;
  --modal-solid-panel: #171717 !important;
  --modal-solid-soft: #202020 !important;
  --modal-solid-strong: #0f0f0f !important;
  --select-bg-hover: #202020 !important;
  --select-border: #393939 !important;
  --select-border-hover: #f5f5f5 !important;
  --select-focus-ring: rgba(255,255,255,0.18) !important;
  --button-hover: #ffffff !important;
  --button-secondary-hover: #242424 !important;
  --chip-bg: #202020 !important;
  --chip-border: #3a3a3a !important;
  --chip-text: #f5f5f5 !important;
  --type-slides-bg: #202020 !important;
  --type-slides-border: #3a3a3a !important;
  --type-slides-text: #f5f5f5 !important;
  --type-cards-bg: #202020 !important;
  --type-cards-border: #3a3a3a !important;
  --type-cards-text: #f5f5f5 !important;
  --tag-bg: #202020 !important;
  --tag-border: #3a3a3a !important;
  --tag-text: #f5f5f5 !important;
  --tag-icon: #d0d0d0 !important;
  --pack-action-primary-bg: #f5f5f5 !important;
  --pack-action-primary-border: #f5f5f5 !important;
  --pack-action-primary-text: #050505 !important;
  --pack-action-primary-complete-bg: #d8d8d8 !important;
  --pack-pin-active-bg: #202020 !important;
  --pack-pin-active-border: #505050 !important;
  --pack-pin-active-text: #f5f5f5 !important;
}

html[data-theme-accent="black"] body,
html[data-theme-accent="black"][data-system="histology"] body,
html[data-theme-accent="black"][data-system="anatomy"] body {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.65), rgba(255,255,255,0) 28%),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.018) 0 1px, transparent 1px 5px),
    var(--system-ambient-bg) !important;
}

html[data-theme="dark"][data-theme-accent="black"] body,
html[data-theme="dark"][data-theme-accent="black"][data-system="histology"] body,
html[data-theme="dark"][data-theme-accent="black"][data-system="anatomy"] body {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0) 30%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 5px),
    var(--system-ambient-bg) !important;
}

html[data-theme-accent="black"] .hero,
html[data-theme-accent="black"] .card,
html[data-theme-accent="black"] .sidebar,
html[data-theme-accent="black"] .main,
html[data-theme-accent="black"] .study-set-card,
html[data-theme-accent="black"] .settings-card,
html[data-theme-accent="black"] .author-profile-card,
html[data-theme-accent="black"] .current-user-profile-card,
html[data-theme-accent="black"] .app-prompt-card,
html[data-theme-accent="black"] .drive-import-chooser-card,
html[data-theme-accent="black"] .google-auth-modal,
html[data-theme-accent="black"] .study-profile-modal,
html[data-theme-accent="black"] .google-open-pack-restore-card {
  border-color: var(--card-border) !important;
  box-shadow: var(--shadow) !important;
}

html[data-theme-accent="black"] .hero {
  background: var(--hero-bg) !important;
  color: #ffffff !important;
}

html[data-theme-accent="black"] .hero::before {
  background: linear-gradient(90deg, #000000, #ffffff, #000000) !important;
  opacity: 0.20 !important;
}

html[data-theme-accent="black"] .hero::after,
html[data-theme-accent="black"] .gqb-logo-game-host,
html[data-theme-accent="black"] .gqb-logo-game-panel,
html[data-theme-accent="black"] .gqb-logo-game-dock {
  filter: grayscale(1) contrast(1.08) !important;
}

html[data-theme-accent="black"] .hero p,
html[data-theme-accent="black"] .pill {
  color: rgba(255,255,255,0.86) !important;
}

html[data-theme-accent="black"] .card,
html[data-theme-accent="black"] .sidebar,
html[data-theme-accent="black"] .main {
  background-color: var(--system-ambient-panel) !important;
}

html[data-theme-accent="black"] .tab.active,
html[data-theme-accent="black"] .btn-primary,
html[data-theme-accent="black"] .btn-study,
html[data-theme-accent="black"] .empty-guide-step button,
html[data-theme-accent="black"] .google-open-pack-restore-actions .btn-primary,
html[data-theme-accent="black"] .shared-pack-actions .btn-primary,
html[data-theme-accent="black"] .author-profile-pack-actions .btn-primary,
html[data-theme-accent="black"] .current-user-shared-actions .btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: var(--study-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"][data-theme-accent="black"] .tab.active,
html[data-theme="dark"][data-theme-accent="black"] .btn-primary,
html[data-theme="dark"][data-theme-accent="black"] .btn-study,
html[data-theme="dark"][data-theme-accent="black"] .empty-guide-step button,
html[data-theme="dark"][data-theme-accent="black"] .google-open-pack-restore-actions .btn-primary,
html[data-theme="dark"][data-theme-accent="black"] .shared-pack-actions .btn-primary,
html[data-theme="dark"][data-theme-accent="black"] .author-profile-pack-actions .btn-primary,
html[data-theme="dark"][data-theme-accent="black"] .current-user-shared-actions .btn-primary {
  color: #050505 !important;
}

html[data-theme-accent="black"] .btn-secondary,
html[data-theme-accent="black"] .btn-soft,
html[data-theme-accent="black"] .tab,
html[data-theme-accent="black"] .drive-import-file,
html[data-theme-accent="black"] .study-set-list-item,
html[data-theme-accent="black"] .shared-pack-card,
html[data-theme-accent="black"] .current-user-shared-card,
html[data-theme-accent="black"] .focus-process-row,
html[data-theme-accent="black"] .google-open-pack-restore-option {
  background: var(--modal-solid-strong) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

html[data-theme-accent="black"] .btn-secondary:hover,
html[data-theme-accent="black"] .btn-soft:hover,
html[data-theme-accent="black"] .tab:hover,
html[data-theme-accent="black"] .drive-import-file:hover,
html[data-theme-accent="black"] .drive-import-file:focus-visible,
html[data-theme-accent="black"] .study-set-list-item:hover,
html[data-theme-accent="black"] .study-set-list-item:focus-visible {
  background: var(--button-secondary-hover) !important;
  border-color: var(--accent) !important;
}

html[data-theme-accent="black"] .study-set-list-item.active,
html[data-theme-accent="black"] .study-set-list-item[aria-current="true"],
html[data-theme-accent="black"] .shared-pack-card.is-active,
html[data-theme-accent="black"] .current-user-shared-card.is-current,
html[data-theme-accent="black"] .profile-avatar-choice.active,
html[data-theme-accent="black"] .settings-theme-swatch.active {
  background: var(--accent-soft) !important;
  border-color: var(--accent) !important;
  outline-color: var(--accent-ring) !important;
}

html[data-theme-accent="black"] input,
html[data-theme-accent="black"] textarea,
html[data-theme-accent="black"] select,
html[data-theme-accent="black"] .search-box,
html[data-theme-accent="black"] .google-drive-shared-link-input,
html[data-theme-accent="black"] .anatomy-entry-field,
html[data-theme-accent="black"] .study-set-search {
  background: var(--input-bg-strong) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

html[data-theme-accent="black"] input:focus,
html[data-theme-accent="black"] textarea:focus,
html[data-theme-accent="black"] select:focus,
html[data-theme-accent="black"] button:focus-visible,
html[data-theme-accent="black"] [tabindex]:focus-visible {
  border-color: var(--accent) !important;
  outline-color: var(--accent-ring) !important;
  box-shadow: 0 0 0 3px var(--accent-ring) !important;
}

html[data-theme-accent="black"] .notice,
html[data-theme-accent="black"] .library-notice,
html[data-theme-accent="black"] .status-pill,
html[data-theme-accent="black"] [data-tone],
html[data-theme-accent="black"] .focus-process-card,
html[data-theme-accent="black"] .hard-item-slot.is-import-progress,
html[data-theme-accent="black"] .hard-item-slot.is-focus-notice {
  background: var(--modal-solid-soft) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

html[data-theme-accent="black"] .focus-process-kicker,
html[data-theme-accent="black"] .focus-process-row-label,
html[data-theme-accent="black"] .focus-import-kicker,
html[data-theme-accent="black"] .study-set-kicker,
html[data-theme-accent="black"] .shared-pack-kicker,
html[data-theme-accent="black"] .count,
html[data-theme-accent="black"] .badge,
html[data-theme-accent="black"] .count-pill {
  color: var(--accent-strong) !important;
  background: var(--accent-soft) !important;
  border-color: var(--line) !important;
}

html[data-theme-accent="black"] .focus-process-track,
html[data-theme-accent="black"] .focus-import-track,
html[data-theme-accent="black"] progress {
  background: var(--surface-muted) !important;
  border-color: var(--line) !important;
}

html[data-theme-accent="black"] .focus-process-track > span,
html[data-theme-accent="black"] .focus-import-track span,
html[data-theme-accent="black"] progress::-webkit-progress-value {
  background: var(--accent) !important;
}

html[data-theme-accent="black"] .settings-theme-swatch[data-theme-accent="black"] {
  background:
    linear-gradient(135deg, #111111 0 48%, #ffffff 49% 100%) !important;
  border-color: var(--accent) !important;
}

html[data-theme-accent="black"] .theme-toggle,
html[data-theme-accent="black"] .library-selector-option,
html[data-theme-accent="black"] .mobile-library-switch,
html[data-theme-accent="black"] .mobile-library-option,
html[data-theme-accent="black"] .library-selector-switch .mobile-switch-plate,
html[data-theme-accent="black"] .library-selector-switch .mobile-switch-slot,
html[data-theme-accent="black"] .library-selector-switch .mobile-switch-neck,
html[data-theme-accent="black"] .library-selector-switch .mobile-switch-lever {
  filter: grayscale(1) !important;
}

html[data-theme-accent="black"] #tab-import .import-card-icon {
  color: var(--accent-strong) !important;
  background: var(--surface-muted) !important;
  border-color: var(--line) !important;
}

/* Google Drive keeps its official mark colors; only the surrounding UI tile is monochrome. */
html[data-theme-accent="black"] #tab-import .import-card-icon-drive svg {
  filter: none !important;
}

html[data-theme-accent="black"] .shared-pack-badge,
html[data-theme-accent="black"] .drive-import-file-meta,
html[data-theme-accent="black"] .settings-item-meta,
html[data-theme-accent="black"] .muted,
html[data-theme-accent="black"] .empty,
html[data-theme-accent="black"] small {
  color: var(--muted) !important;
}

html[data-theme-accent="black"] ::selection {
  background: var(--accent) !important;
  color: var(--study-text) !important;
}

/* Complete the monochrome theme across UI chrome.
   Imported slides, editor canvases, and user-authored artwork remain unfiltered. */
html[data-theme-accent="black"] {
  --range-track-color: #d6d6d6 !important;
  --range-fill-color: #111111 !important;
  --swatch-ring: #111111 !important;
  --anatomy-card-front-a: #f4f4f4 !important;
  --anatomy-card-front-b: #dedede !important;
  --anatomy-card-front-c: #c8c8c8 !important;
  --anatomy-card-back-a: #b5b5b5 !important;
  --anatomy-card-back-b: #888888 !important;
  --anatomy-card-ink: #111111 !important;
  --anatomy-card-muted-ink: rgba(0,0,0,0.68) !important;
  --anatomy-card-border: rgba(0,0,0,0.28) !important;
  --blue: #111111 !important;
  --red: #333333 !important;
  --yellow: #777777 !important;
  --green: #555555 !important;
  --ink: #111111 !important;
  --soft-blue: rgba(0,0,0,0.08) !important;
  --soft-line: rgba(0,0,0,0.18) !important;
}

html[data-theme="dark"][data-theme-accent="black"] {
  --range-track-color: #3a3a3a !important;
  --range-fill-color: #f5f5f5 !important;
  --swatch-ring: #f5f5f5 !important;
  --anatomy-card-front-a: #343434 !important;
  --anatomy-card-front-b: #292929 !important;
  --anatomy-card-front-c: #1f1f1f !important;
  --anatomy-card-back-a: #202020 !important;
  --anatomy-card-back-b: #101010 !important;
  --anatomy-card-ink: #f5f5f5 !important;
  --anatomy-card-muted-ink: rgba(255,255,255,0.70) !important;
  --anatomy-card-border: rgba(255,255,255,0.26) !important;
  --blue: #f5f5f5 !important;
  --red: #d0d0d0 !important;
  --yellow: #a8a8a8 !important;
  --green: #c0c0c0 !important;
  --ink: #f5f5f5 !important;
  --soft-blue: rgba(255,255,255,0.10) !important;
  --soft-line: rgba(255,255,255,0.18) !important;
}

html[data-theme-accent="black"] .flag-stat-img {
  filter: grayscale(1) contrast(1.08) !important;
}

html[data-theme-accent="black"] .quiz-difficulty-control {
  background: var(--surface-muted) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}

html[data-theme-accent="black"] .quiz-difficulty-track {
  color: var(--muted) !important;
}

html[data-theme-accent="black"] .quiz-difficulty-track::before {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: none !important;
}

html[data-theme-accent="black"] .quiz-difficulty-control input[data-level="normal"] + .quiz-difficulty-track span:nth-child(1),
html[data-theme-accent="black"] .quiz-difficulty-control input[data-level="high"] + .quiz-difficulty-track span:nth-child(2),
html[data-theme-accent="black"] .quiz-difficulty-control input[data-level="strict"] + .quiz-difficulty-track span:nth-child(3) {
  color: var(--study-text) !important;
}

html[data-theme="dark"][data-theme-accent="black"] .quiz-difficulty-control {
  background: #181818 !important;
  border-color: rgba(255, 255, 255, 0.24) !important;
}

html[data-theme="dark"][data-theme-accent="black"] .quiz-difficulty-track {
  color: rgba(245, 245, 245, 0.72) !important;
}

html[data-theme="dark"][data-theme-accent="black"] .quiz-difficulty-option {
  color: rgba(245, 245, 245, 0.72) !important;
  box-shadow: none !important;
}

html[data-theme="dark"][data-theme-accent="black"] .quiz-difficulty-option:hover,
html[data-theme="dark"][data-theme-accent="black"] .quiz-difficulty-option:focus-visible {
  background: rgba(255, 255, 255, 0.10) !important;
  color: #ffffff !important;
}

html[data-theme="dark"][data-theme-accent="black"] .quiz-difficulty-option.is-selected {
  background: #e8e8e8 !important;
  color: #111111 !important;
  font-weight: 850 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22) !important;
}

html[data-theme-accent="black"] .embedded-note-surface,
html[data-theme-accent="black"] .study-timer-input,
html[data-theme-accent="black"] .study-timer-preset,
html[data-theme-accent="black"] .study-timer-btn.btn-secondary,
html[data-theme-accent="black"] .study-set-top,
html[data-theme-accent="black"] .study-set-list,
html[data-theme-accent="black"] .study-set-detail,
html[data-theme-accent="black"] #quizGroupSelect[multiple],
html[data-theme-accent="black"] .empty-app-guide,
html[data-theme-accent="black"] .empty-library-create-guide,
html[data-theme-accent="black"] .empty-guide-step,
html[data-theme-accent="black"] .drive-guide-step,
html[data-theme-accent="black"] .drive-publish-toggle,
html[data-theme-accent="black"] .drive-publish-link,
html[data-theme-accent="black"] .shared-pack-author-preview,
html[data-theme-accent="black"] .shared-pack-author-link,
html[data-theme-accent="black"] .shared-pack-thumbs-btn,
html[data-theme-accent="black"] .shared-pack-coffee-link,
html[data-theme-accent="black"] .author-profile-bio,
html[data-theme-accent="black"] .author-profile-pack-item,
html[data-theme-accent="black"] .group-filter-card,
html[data-theme-accent="black"] .reward-preview-card,
html[data-theme-accent="black"] details {
  background: var(--modal-solid-panel) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

html[data-theme-accent="black"] .study-set-list-code,
html[data-theme-accent="black"] .group-filter-summary,
html[data-theme-accent="black"] .empty-guide-kicker,
html[data-theme-accent="black"] .shared-pack-kicker,
html[data-theme-accent="black"] .author-profile-summary,
html[data-theme-accent="black"] .current-user-profile-summary {
  color: var(--text) !important;
}

html[data-theme-accent="black"] .disease-item.guided-sidebar-item,
html[data-theme-accent="black"] .disease-item.active,
html[data-theme-accent="black"] .disease-item.gold-selected,
html[data-theme-accent="black"] .guided-sidebar-item.is-active,
html[data-theme-accent="black"] .group-filter-card.active,
html[data-theme-accent="black"] .group-filter-card[aria-pressed="true"] {
  background: var(--accent-soft) !important;
  border-color: var(--accent) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

html[data-theme-accent="black"] .favorite-toggle,
html[data-theme-accent="black"] .favorite-badge,
html[data-theme-accent="black"] .star-picks-badge,
html[data-theme-accent="black"] .shared-pack-system-badge,
html[data-theme-accent="black"] .shared-pack-tag,
html[data-theme-accent="black"] .profile-system-badge,
html[data-theme-accent="black"] .drive-import-file-badge {
  background: var(--modal-solid-soft) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

html[data-theme-accent="black"] .favorite-toggle.active,
html[data-theme-accent="black"] .favorite-toggle[aria-pressed="true"] {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: var(--study-text) !important;
}

html[data-theme-accent="black"] .microscope-tool-primary,
html[data-theme-accent="black"] .microscope-import-button {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: var(--study-text) !important;
  box-shadow: none !important;
}

html[data-theme-accent="black"] .microscope-slide-dot,
html[data-theme-accent="black"] .microscope-slide-item.is-local-zif .microscope-slide-dot,
html[data-theme-accent="black"] .microscope-slide-item.is-slide-package .microscope-slide-dot,
html[data-theme-accent="black"] .microscope-slide-item.is-slide-json .microscope-slide-dot {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: none !important;
}

html[data-theme-accent="black"] .microscope-slide-item[data-microscope-group="histology"] .microscope-slide-dot,
html[data-theme-accent="black"] .microscope-slide-item[data-microscope-group="pathology"] .microscope-slide-dot,
html[data-theme-accent="black"] .microscope-slide-item[data-microscope-group="embryology"] .microscope-slide-dot {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 5px var(--accent-soft) !important;
}

html[data-theme-accent="black"] .microscope-slide-preview {
  background: var(--modal-solid-panel) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow) !important;
}

html[data-theme-accent="black"] .microscope-slide-preview-media {
  border-color: var(--line) !important;
  background: var(--surface-muted) !important;
}

html[data-theme-accent="black"] .microscope-slide-preview-placeholder,
html[data-theme-accent="black"] .microscope-slide-preview-copy strong {
  color: var(--text) !important;
}

html[data-theme-accent="black"] .microscope-slide-preview-copy small {
  color: var(--muted) !important;
}

html[data-theme-accent="black"] .microscope-slide-preview[data-state="error"] .microscope-slide-preview-placeholder {
  color: var(--text) !important;
  background: var(--surface-muted) !important;
}

html[data-theme-accent="black"] .quiz-answer-guide,
html[data-theme-accent="black"] .quiz-answer-hint,
html[data-theme-accent="black"] .quiz-only-input[data-answer-state] .row::before,
html[data-theme-accent="black"] .hard-item-slot.is-focus-notice-success,
html[data-theme-accent="black"] .hard-item-slot.is-focus-notice-warning,
html[data-theme-accent="black"] .hard-item-slot.is-focus-notice-error {
  background: var(--modal-solid-soft) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

html[data-theme-accent="black"] .study-set-scrim,
html[data-theme-accent="black"] .hard-card-scrim,
html[data-theme-accent="black"] .modal-backdrop {
  background: rgba(0,0,0,0.72) !important;
}

/* Neutral White theme.
   Subject/library colors may still identify actions and active controls, but they
   must not tint the page background, empty space, panels, menus, or form surfaces. */
html[data-theme-accent="white"],
html[data-theme-accent="white"][data-system="histology"],
html[data-theme-accent="white"][data-system="anatomy"] {
  color-scheme: light;
  --app-bg: #ffffff !important;
  --bg: #ffffff !important;
  --panel: #ffffff !important;
  --panel-2: #ffffff !important;
  --surface-raised: #ffffff !important;
  --surface-muted: #f7f7f8 !important;
  --surface-elevated: #ffffff !important;
  --text: #111827 !important;
  --muted: #667085 !important;
  --line: #e2e4e9 !important;
  --card-border: #e3e5e9 !important;
  --input-bg: #ffffff !important;
  --input-bg-strong: #ffffff !important;
  --secondary-bg: #ffffff !important;
  --soft-bg: #f8f8f9 !important;
  --menu-bg: #ffffff !important;
  --tab-bg: #ffffff !important;
  --tab-text: #667085 !important;
  --subtle-bg: #f8f8f9 !important;
  --subtle-border: #e2e4e9 !important;
  --count-bg: #f1f2f4 !important;
  --count-text: #344054 !important;
  --theme-toggle-bg: #ffffff !important;
  --theme-toggle-border: #d9dce2 !important;
  --theme-toggle-track: #eceef1 !important;
  --theme-toggle-text: #111827 !important;
  --system-ambient-bg: #ffffff !important;
  --system-ambient-panel: #ffffff !important;
  --system-ambient-border: #e3e5e9 !important;
  --system-toggle-track: #eceef1 !important;
  --modal-solid-bg: #ffffff !important;
  --modal-solid-panel: #ffffff !important;
  --modal-solid-soft: #f5f5f6 !important;
  --modal-solid-strong: #ffffff !important;
  --select-bg-hover: #f4f4f5 !important;
  --select-border: #dfe2e7 !important;
  --button-secondary-hover: #f4f4f5 !important;
  --theme-control-bg: #ffffff;
  --theme-control-hover-bg: #f2f3f5;
  --theme-control-border: #d9dde3;
  --theme-control-hover-border: #aeb5bf;
  --theme-control-selected-bg: #e9ebee;
  --theme-control-selected-border: #687281;
  --theme-control-selected-ring: rgba(52,64,84,0.16);
  --quiz-action-bg: #4285f4;
  --quiz-action-hover: #669df6;
  --quiz-action-text: #ffffff;
  --starred-quiz-bg: #a16207;
  --starred-quiz-hover: #854d0e;
  --study-action-bg: #34a853;
  --study-action-hover: color-mix(in srgb, #34a853 78%, white 22%);
  --study-action-text: #ffffff;
  --shadow: 0 20px 56px rgba(16,24,40,0.12) !important;
}

html[data-theme="dark"][data-theme-accent="white"],
html[data-theme="dark"][data-theme-accent="white"][data-system="histology"],
html[data-theme="dark"][data-theme-accent="white"][data-system="anatomy"] {
  color-scheme: dark;
  --app-bg: #101010 !important;
  --bg: #101010 !important;
  --panel: #171717 !important;
  --panel-2: #1b1b1b !important;
  --surface-raised: #1b1b1b !important;
  --surface-muted: #202020 !important;
  --surface-elevated: #1d1d1d !important;
  --text: #f5f5f5 !important;
  --muted: #b6b6b6 !important;
  --line: #383838 !important;
  --card-border: #343434 !important;
  --input-bg: #151515 !important;
  --input-bg-strong: #171717 !important;
  --secondary-bg: #1a1a1a !important;
  --soft-bg: #202020 !important;
  --menu-bg: #171717 !important;
  --tab-bg: #1a1a1a !important;
  --tab-text: #c7c7c7 !important;
  --subtle-bg: #1e1e1e !important;
  --subtle-border: #383838 !important;
  --count-bg: #262626 !important;
  --count-text: #f1f1f1 !important;
  --theme-toggle-bg: #171717 !important;
  --theme-toggle-border: #3a3a3a !important;
  --theme-toggle-track: #292929 !important;
  --theme-toggle-text: #f5f5f5 !important;
  --system-ambient-bg: #101010 !important;
  --system-ambient-panel: #171717 !important;
  --system-ambient-border: #343434 !important;
  --system-toggle-track: #292929 !important;
  --modal-solid-bg: #121212 !important;
  --modal-solid-panel: #191919 !important;
  --modal-solid-soft: #222222 !important;
  --modal-solid-strong: #171717 !important;
  --select-bg-hover: #242424 !important;
  --select-border: #3a3a3a !important;
  --button-secondary-hover: #252525 !important;
  --theme-control-bg: #1a1a1a;
  --theme-control-hover-bg: #282828;
  --theme-control-border: #3d3d3d;
  --theme-control-hover-border: #707070;
  --theme-control-selected-bg: #303030;
  --theme-control-selected-border: #b8b8b8;
  --theme-control-selected-ring: rgba(255,255,255,0.14);
  --quiz-action-bg: #4285f4;
  --quiz-action-hover: #669df6;
  --quiz-action-text: #ffffff;
  --starred-quiz-bg: #a16207;
  --starred-quiz-hover: #ca8a04;
  --study-action-bg: #34a853;
  --study-action-hover: color-mix(in srgb, #34a853 78%, white 22%);
  --study-action-text: #ffffff;
  --shadow: 0 24px 68px rgba(0,0,0,0.52) !important;
}

html[data-theme-accent="white"] body,
html[data-theme-accent="white"][data-system="histology"] body,
html[data-theme-accent="white"][data-system="anatomy"] body {
  background: var(--system-ambient-bg) !important;
}

html[data-theme-accent="white"] .card,
html[data-theme-accent="white"] .sidebar,
html[data-theme-accent="white"] .main,
html[data-theme-accent="white"] .study-set-card,
html[data-theme-accent="white"] .settings-card,
html[data-theme-accent="white"] .author-profile-card,
html[data-theme-accent="white"] .current-user-profile-card,
html[data-theme-accent="white"] .app-prompt-card,
html[data-theme-accent="white"] .drive-import-chooser-card,
html[data-theme-accent="white"] .google-auth-modal,
html[data-theme-accent="white"] .study-profile-modal,
html[data-theme-accent="white"] .google-open-pack-restore-card {
  background-color: var(--system-ambient-panel) !important;
  border-color: var(--system-ambient-border) !important;
}

html[data-theme-accent="white"] .embedded-note-surface,
html[data-theme-accent="white"] .study-timer-input,
html[data-theme-accent="white"] .study-timer-preset,
html[data-theme-accent="white"] .study-timer-btn.btn-secondary,
html[data-theme-accent="white"] .study-set-top,
html[data-theme-accent="white"] .study-set-list,
html[data-theme-accent="white"] .study-set-detail,
html[data-theme-accent="white"] #quizGroupSelect[multiple],
html[data-theme-accent="white"] .empty-app-guide,
html[data-theme-accent="white"] .empty-library-create-guide,
html[data-theme-accent="white"] .empty-guide-step,
html[data-theme-accent="white"] .drive-guide-step,
html[data-theme-accent="white"] .drive-publish-toggle,
html[data-theme-accent="white"] .drive-publish-link,
html[data-theme-accent="white"] .shared-pack-author-preview,
html[data-theme-accent="white"] .shared-pack-author-link,
html[data-theme-accent="white"] .author-profile-bio,
html[data-theme-accent="white"] .author-profile-pack-item,
html[data-theme-accent="white"] .group-filter-card,
html[data-theme-accent="white"] .reward-preview-card,
html[data-theme-accent="white"] details {
  background: var(--modal-solid-panel) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

html[data-theme-accent="white"] input,
html[data-theme-accent="white"] textarea,
html[data-theme-accent="white"] select,
html[data-theme-accent="white"] .search-box,
html[data-theme-accent="white"] .study-set-search {
  background: var(--input-bg-strong) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

/* White-theme control hierarchy.
   Use named action classes and known controls only; do not catch every button. */
html[data-theme-accent="white"] :is(
  .btn-primary:not(.btn-study):not(.btn-danger),
  .btn-secondary,
  .btn-soft,
  a.btn-primary,
  a.btn-secondary,
  #newLibraryBtn,
  #sharePackBtn,
  #tab-import .import-card-primary,
  #tab-import .import-file-choose,
  #tab-import .drive-link-arrow,
  .shared-pack-author-link,
  .shared-pack-coffee-link
):not(.disabled):not(:disabled) {
  background: var(--theme-control-bg) !important;
  background-image: none !important;
  border-width: 1px !important;
  border-style: solid !important;
  border-color: var(--theme-control-border) !important;
  background-clip: padding-box !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

html[data-theme-accent="white"] :is(
  .btn-primary:not(.btn-study):not(.btn-danger),
  .btn-secondary,
  .btn-soft,
  a.btn-primary,
  a.btn-secondary,
  #newLibraryBtn,
  #sharePackBtn,
  #tab-import .import-card-primary,
  #tab-import .import-file-choose,
  #tab-import .drive-link-arrow,
  .shared-pack-author-link,
  .shared-pack-coffee-link
):not(.disabled):not(:disabled):hover {
  background: var(--theme-control-hover-bg) !important;
  border-color: var(--theme-control-hover-border) !important;
  color: var(--text) !important;
}

html[data-theme-accent="white"] :is(
  .sort-option.active,
  .btn-primary.active:not(.btn-study):not(.btn-danger),
  .btn-secondary.active,
  .btn-soft.active,
  .study-timer-preset.active,
  .study-tool-btn.active
) {
  background: var(--theme-control-selected-bg) !important;
  border-color: var(--theme-control-selected-border) !important;
  color: var(--text) !important;
  box-shadow: 0 0 0 1px var(--theme-control-selected-ring) !important;
}

html[data-theme-accent="white"] :is(
  .btn-primary:not(.btn-study):not(.btn-danger),
  .btn-secondary,
  .btn-soft,
  a.btn-primary,
  a.btn-secondary,
  #newLibraryBtn,
  #sharePackBtn,
  #tab-import .import-card-primary,
  #tab-import .import-file-choose,
  #tab-import .drive-link-arrow,
  .shared-pack-author-link,
  .shared-pack-coffee-link
):focus-visible {
  border-color: var(--theme-control-selected-border) !important;
  outline: 2px solid var(--theme-control-selected-ring) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 1px var(--theme-control-selected-ring) !important;
}

html[data-theme-accent="white"] #startQuizBtn,
html[data-theme-accent="white"] #quizSetupStartBtn,
html[data-theme-accent="white"] #quizStartBtn,
html[data-theme-accent="white"] #quizCheckBtn,
html[data-theme-accent="white"] #restartQuizRoundBtn {
  background: var(--quiz-action-bg) !important;
  border-color: var(--quiz-action-bg) !important;
  color: var(--quiz-action-text) !important;
}

html[data-theme-accent="white"] #startQuizBtn:hover,
html[data-theme-accent="white"] #quizSetupStartBtn:hover,
html[data-theme-accent="white"] #quizStartBtn:hover,
html[data-theme-accent="white"] #quizCheckBtn:hover,
html[data-theme-accent="white"] #restartQuizRoundBtn:hover {
  background: var(--quiz-action-hover) !important;
  border-color: var(--quiz-action-hover) !important;
  color: var(--quiz-action-text) !important;
}

html[data-theme-accent="white"] #startStarredQuizBtn {
  background: var(--starred-quiz-bg) !important;
  border-color: var(--starred-quiz-bg) !important;
  color: #ffffff !important;
}

html[data-theme-accent="white"] #startStarredQuizBtn:hover {
  background: var(--starred-quiz-hover) !important;
  border-color: var(--starred-quiz-hover) !important;
  color: #ffffff !important;
}

html[data-theme-accent="white"] #libraryStudyModeBtn,
html[data-theme-accent="white"] #quizSetupStudyBtn,
html[data-theme-accent="white"] #quizStudySetBtn,
html[data-theme-accent="white"] #startStudyTimerBtn,
html[data-theme-accent="white"] #repeatWrongQuizBtn,
html[data-theme-accent="white"] #anatomyQuizRightBtn {
  background: var(--study-action-bg) !important;
  border-color: var(--study-action-bg) !important;
  color: var(--study-action-text) !important;
}

html[data-theme-accent="white"] #libraryStudyModeBtn:hover,
html[data-theme-accent="white"] #quizSetupStudyBtn:hover,
html[data-theme-accent="white"] #quizStudySetBtn:hover,
html[data-theme-accent="white"] #startStudyTimerBtn:hover,
html[data-theme-accent="white"] #repeatWrongQuizBtn:hover,
html[data-theme-accent="white"] #anatomyQuizRightBtn:hover {
  background: var(--study-action-hover) !important;
  border-color: var(--study-action-hover) !important;
  color: var(--study-action-text) !important;
}

html[data-theme-accent="white"] #exitQuizBtn {
  color: var(--danger-text) !important;
  border-color: color-mix(in srgb, var(--danger-border) 72%, var(--line) 28%) !important;
  background: color-mix(in srgb, var(--danger-bg) 58%, var(--surface-raised) 42%) !important;
}

html[data-theme-accent="white"] #exitQuizBtn:hover,
html[data-theme-accent="white"] #exitQuizBtn:focus-visible {
  color: var(--danger-text) !important;
  background: color-mix(in srgb, var(--danger-bg) 76%, var(--surface-raised) 24%) !important;
  border-color: var(--danger-border) !important;
}

html[data-theme-accent="white"] #exitQuizBtn.is-confirming-exit {
  color: #ffffff !important;
  background: color-mix(in srgb, var(--danger-text) 78%, var(--danger-bg) 22%) !important;
  border-color: color-mix(in srgb, var(--danger-text) 70%, var(--danger-border) 30%) !important;
}

/* White dark-mode difficulty contrast refinements. */
html[data-theme="dark"][data-theme-accent="white"] .quiz-difficulty-control {
  background: #171d26 !important;
  border-color: rgba(226, 232, 240, 0.30) !important;
  box-shadow: none !important;
}

html[data-theme="dark"][data-theme-accent="white"] .quiz-difficulty-track {
  color: rgba(248, 250, 252, 0.72) !important;
}

html[data-theme="dark"][data-theme-accent="white"] .quiz-difficulty-option {
  color: rgba(248, 250, 252, 0.72) !important;
  box-shadow: none !important;
}

html[data-theme="dark"][data-theme-accent="white"] .quiz-difficulty-option:hover,
html[data-theme="dark"][data-theme-accent="white"] .quiz-difficulty-option:focus-visible {
  background: rgba(255, 255, 255, 0.10) !important;
  color: #ffffff !important;
}

html[data-theme="dark"][data-theme-accent="white"] .quiz-difficulty-option.is-selected {
  background: #d9e2ec !important;
  color: #111827 !important;
  font-weight: 850 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24) !important;
}

/* White light-mode contrast refinements. */
html[data-theme="light"][data-theme-accent="white"] {
  --hero-bg: linear-gradient(135deg, var(--quiz-action-bg) 0%, #70a6cf 58%, #c6dfef 100%) !important;
  --hero-mark-opacity: 0.84 !important;
  --hero-mark-filter:
    contrast(1.16)
    saturate(0.92)
    drop-shadow(0 5px 18px rgba(15,23,42,0.26)) !important;
  --hero-mark-blend: normal !important;
}

html[data-theme="light"][data-theme-accent="white"] .quiz-difficulty-control {
  background: #f3f5f7 !important;
  border-color: #c7cdd6 !important;
}

html[data-theme="light"][data-theme-accent="white"] .quiz-difficulty-track {
  color: #667085 !important;
}

html[data-theme="light"][data-theme-accent="white"] .quiz-difficulty-track::before {
  background: #ffffff !important;
  border-color: #8f98a5 !important;
  box-shadow: none !important;
}

html[data-theme="light"][data-theme-accent="white"] .quiz-difficulty-control input[data-level="normal"] + .quiz-difficulty-track span:nth-child(1),
html[data-theme="light"][data-theme-accent="white"] .quiz-difficulty-control input[data-level="high"] + .quiz-difficulty-track span:nth-child(2),
html[data-theme="light"][data-theme-accent="white"] .quiz-difficulty-control input[data-level="strict"] + .quiz-difficulty-track span:nth-child(3) {
  color: #172033 !important;
  font-weight: 900 !important;
}

html[data-theme="light"][data-theme-accent="white"] .quiz-difficulty-control:focus-within {
  border-color: #8f98a5 !important;
  outline-color: rgba(71,85,105,0.16) !important;
}

/* The dark White theme uses a quiet selected-entry state, not a bright white block. */
html[data-theme="dark"][data-theme-accent="white"] .disease-item.active,
html[data-theme="dark"][data-theme-accent="white"] .disease-item.active:hover {
  background: #252525 !important;
  border-color: #555555 !important;
  color: var(--text) !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-theme="dark"][data-theme-accent="white"] .disease-item.gold-selected.active,
html[data-theme="dark"][data-theme-accent="white"] .disease-item.gold-selected.active:hover {
  background: #272727 !important;
  border-color: #5c5c5c !important;
  color: var(--text) !important;
  box-shadow: inset 3px 0 0 rgba(202,138,4,0.62) !important;
  transform: none !important;
}

/* Keep the Google-style avatar menu structure identical in every theme.
   Theme colors still come from the active token set; only layout and row
   treatment are standardized here. */
.account-menu {
  width: min(370px, calc(100vw - 28px)) !important;
  padding: 0 !important;
  overflow-x: hidden !important;
}

.account-menu-profile,
.account-menu-section {
  background: transparent !important;
  box-shadow: none !important;
}

.account-menu-profile {
  display: grid !important;
  grid-template-columns: 68px minmax(0, 1fr) !important;
  gap: 15px !important;
  align-items: start !important;
  padding: 20px !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.account-menu-section {
  padding: 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--line) !important;
  border-radius: 0 !important;
}

.account-menu-profile-link,
.account-menu-profile-link:hover,
.account-menu-profile-link:focus-visible {
  width: auto !important;
  min-height: 0 !important;
  margin-top: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--accent-strong) !important;
  text-align: left !important;
}

.account-menu-profile-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px 14px !important;
  margin-top: 10px !important;
}

.account-menu-profile-actions .account-menu-signout-link,
.account-menu-profile-actions .account-menu-signout-link:hover,
.account-menu-profile-actions .account-menu-signout-link:focus-visible {
  width: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--danger-text) !important;
  text-align: left !important;
}

.account-menu-signout-link[hidden] {
  display: none !important;
}

.account-menu-item,
.account-menu-item:active {
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) auto !important;
  gap: 10px !important;
  align-items: center !important;
  width: 100% !important;
  min-height: 68px !important;
  padding: 12px 20px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--text) !important;
  text-align: left !important;
}

.account-menu-item:hover,
.account-menu-item:focus-visible {
  border: 0 !important;
  background: color-mix(in srgb, var(--text) 7%, transparent 93%) !important;
  box-shadow: none !important;
  color: var(--text) !important;
  outline: none !important;
}

.account-menu-item[data-account-menu-action="auth"] {
  color: color-mix(in srgb, var(--text) 84%, var(--accent) 16%) !important;
}

.account-menu-item[data-auth-state="signed-in"] {
  color: var(--danger-text) !important;
}

.account-menu-item.account-menu-signout-link {
  color: var(--danger-text) !important;
}

.account-menu-item.account-menu-signout-link > svg {
  color: var(--danger-text) !important;
}

.account-menu-item.account-menu-signout-link:hover,
.account-menu-item.account-menu-signout-link:focus-visible {
  background: color-mix(in srgb, var(--danger-bg) 58%, var(--surface-raised) 42%) !important;
  color: var(--danger-text) !important;
  text-decoration: none !important;
}

@media (max-width: 520px) {
  .account-menu-profile {
    grid-template-columns: 60px minmax(0, 1fr) !important;
    padding: 16px !important;
  }

  .account-menu-item {
    min-height: 64px !important;
    padding: 11px 16px !important;
  }
}

/* Theme colors own the app shell.
   Slides and Cards must not impose one universal green or blue ambient color
   over Blue, Green, Amber, Yellow, or Rose themes. */
html[data-system="histology"][data-theme-accent]:not([data-theme-accent="black"]):not([data-theme-accent="white"]),
html[data-system="anatomy"][data-theme-accent]:not([data-theme-accent="black"]):not([data-theme-accent="white"]) {
  --system-ambient-bg: color-mix(in srgb, var(--accent) 4%, #f8fbff 96%) !important;
  --system-ambient-panel: color-mix(in srgb, var(--accent) 5%, var(--panel) 95%) !important;
  --system-ambient-border: color-mix(in srgb, var(--accent) 17%, var(--card-border) 83%) !important;
  --system-toggle-track: color-mix(in srgb, var(--accent) 13%, rgba(15,23,42,0.08) 87%) !important;
}

html[data-theme="dark"][data-system="histology"][data-theme-accent]:not([data-theme-accent="black"]):not([data-theme-accent="white"]),
html[data-theme="dark"][data-system="anatomy"][data-theme-accent]:not([data-theme-accent="black"]):not([data-theme-accent="white"]) {
  --system-ambient-bg: color-mix(in srgb, var(--accent-dark) 7%, #0a1426 93%) !important;
  --system-ambient-panel: color-mix(in srgb, var(--accent-dark) 8%, var(--panel) 92%) !important;
  --system-ambient-border: color-mix(in srgb, var(--accent-dark) 21%, var(--card-border) 79%) !important;
  --system-toggle-track: color-mix(in srgb, var(--accent-dark) 18%, rgba(148,163,184,0.14) 82%) !important;
}
