:root { color-scheme: light; --navigation-text: #7a8388; }
.theme-toggle:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 44px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  color: var(--teal);
}
.theme-toggle:hover { border-color: currentColor; }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .theme-sun { display: none; }
.theme-toggle[aria-checked="true"] .theme-sun { display: block; }
.theme-toggle[aria-checked="true"] .theme-moon { display: none; }
@media (max-width: 1024px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) auto auto; }
  .header-inner > .theme-toggle { grid-column: 3; grid-row: 1; }
  .header-inner > .mobile-menu-toggle { grid-column: 2; grid-row: 1; }
}
@media (max-width: 380px) {
  .header-inner { column-gap: 8px; }
  .header-inner > .brand { font-size: 28px; }
  .mobile-menu-toggle:not([hidden]) { padding: 8px; gap: 5px; }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #dde8eb;
  --teal: #7acabd;
  --muted: #a5b5be;
  --line: #34474f;
  --paper: #1b2931;
  --background: #111c23;
  --navigation-text: #9fb6c0;
}
html[data-theme="dark"] body { color: var(--ink); background: var(--background); }
html[data-theme="dark"] :is(.header, .panel, .search-bar, .nav-dropdown-items, .account-dropdown-items, .admin-dropdown-items, .forum-editor, .forum-smiley-dropdown, .admin-stats a) {
  background: var(--paper); border-color: var(--line); box-shadow: 0 2px 6px #0003;
}
html[data-theme="dark"] :is(.brand, nav a.active, .nav-dropdown.is-active > summary, .nav-dropdown.is-active > summary a, .posting-as strong, .auth-switch a, .admin-stats strong, .audit-entry summary strong) { color: var(--teal); }
html[data-theme="dark"] :is(.brand-mark i) { background: var(--teal); }
html[data-theme="dark"] .profile-shortcut { color: var(--teal); }
html[data-theme="dark"] .public-member-identity .profile-online-status { color: #8cdeb0; }
html[data-theme="dark"] :is(.extra-artists,.extra-genre-picker) { border-color: var(--line); }
html[data-theme="dark"] :is(.extra-artists > summary,.extra-genre-picker > summary) { color: var(--teal); }
html[data-theme="dark"] .extra-artist-remove { color: #ffb3a5; }
html[data-theme="dark"] .crew-list .member-name-link { background: #22363e; color: var(--teal); }
html[data-theme="dark"] .crew-list .member-name-link:hover { background: #2b424a; color: #86d9cb; }
html[data-theme="dark"] :is(a:hover, .member-name-link, .all-genres-link, .content-icon-link, .forum-rich-body a, .avatar-source-import summary) { color: #86d9cb; }
html[data-theme="dark"] :is(.intro p, .eyebrow, .muted, .body-text, .forum-rich-body, .comment p, .bottom-note, .bottom-note strong, .detail-meta, .detail-kicker, .event-title, .auth-story p, .auth-switch, .login-gate p, .posting-as, .form-hint, .optional, .entry-form label, .forum-editor-field > label, .account-details dt, .admin-stats span, .admin-stats small, .admin-item p, .admin-item-id, .admin-member p, .role-form label, .audit-entry summary, .audit-entry time, .avatar-gallery-filters label, .avatar-gallery-source, .forum-section-description) { color: #b0c1c9; }
html[data-theme="dark"] :is(nav a, .account-link, .text-button, .quiet-link, .section-meta, .live-label, .count, .disc, .at, .pagination, .topic-row small, .topic-row time, .comment time, .back-link, .list-header, .set-uploader, .uploader-label, .demo-notice, .search-icon, .topic-closed-icon, .forum-editor-footer, .forum-smiley-empty) { color: #9fb6c0; }
html[data-theme="dark"] :is(.entry-form input, .entry-form select, .entry-form textarea, .admin-search input, .role-form input, .role-form select, .avatar-gallery-filters input, .avatar-gallery-filters select, .search-bar select) {
  color: var(--ink); background: #142129; border-color: #425963;
}
html[data-theme="dark"] .search-bar input { color: var(--ink); }
html[data-theme="dark"] ::placeholder { color: #91a6b0; opacity: 1; }
html[data-theme="dark"] .forum-editor-content:empty::before { color: #91a6b0; }
html[data-theme="dark"] :is(.genre-tags, .topic-row, .large-rows .set-row, .comment, .list-header, .auth-switch, .account-details, .account-details > div, .admin-tabs, .admin-item, .admin-member, .member-tools, .audit-entry, .avatar-gallery-credit) { border-color: var(--line); }
html[data-theme="dark"] .section-heading { border-color: #608d96; }
html[data-theme="dark"] footer { background: #16232b; border-color: var(--line); }
html[data-theme="dark"] .footer-inner { color: #9fb6c0; }
html[data-theme="dark"] :is(.audio-placeholder, .login-gate, .topic-icon, .avatar, .member-avatar, .favorite-chips > a, .favorite-chips > span, .public-member-card, .entry-form .genre-choice-grid label, .forum-quote, .forum-rich-body blockquote, .audit-diff pre, .forum-editor-toolbar, .forum-editor-footer, .forum-editor-link, .admin-content-preview, .avatar-gallery-card, .avatar-source-import, .member-filters a) {
  background: #22363e; color: var(--ink); border-color: var(--line);
}
html[data-theme="dark"] :is(.audio-placeholder p, .record-icon, .forum-editor-toolbar button, .password-toggle) { color: #a8ccc9; }
html[data-theme="dark"] :is(.set-row:hover, .nav-dropdown-items a:hover, .account-dropdown-items a:hover, .account-dropdown-items button:hover, .admin-dropdown-items a:hover, .favorite-chips > a:hover, .forum-editor-toolbar button:hover, .password-toggle:hover) { background: #2b424a; color: var(--ink); }
html[data-theme="dark"] :is(.button, .page-button, .admin-tabs a.selected, .member-filters .selected) { background: #286e70; color: #fff; border-color: #428f8d; }
html[data-theme="dark"] :is(.button:hover, .page-button:hover) { background: #358580; color: #fff; }
html[data-theme="dark"] :is(.button-outline, .mobile-menu-toggle, .forum-editor-link button) { background: var(--paper); color: var(--teal); border-color: #527079; }
html[data-theme="dark"] :is(.button-outline:hover, .mobile-menu-toggle:hover, .forum-editor-link button:hover) { background: #2b424a; }
html[data-theme="dark"] :is(.genre-choice-grid label:has(input:checked), .avatar-gallery-card:has(input:checked), .forum-editor-toolbar button[aria-pressed="true"], .topic-status, .role-admin) { background: #24483f; color: #a8e5cc; border-color: #508976; }
html[data-theme="dark"] :is(.success) { background: #203b31; color: #b5e5c6; border-color: #477b60; }
html[data-theme="dark"] :is(.error, .member-banned) { background: #452e2e; color: #ffc0b3; border-color: #89534c; }
html[data-theme="dark"] :is(.text-danger, .content-icon-danger, .forum-editor-error, .forum-editor-footer .is-over-limit) { color: #ffb3a5; }
html[data-theme="dark"] .button-danger { background: #984d43; border-color: #bd7468; }
html[data-theme="dark"] .button-danger:hover { background: #b35c4f; }
html[data-theme="dark"] :is(.genre-star-button.is-favorite, .genre-star-button:hover, .role-moderator) { color: #f2d27e; background: #463e25; border-color: #7d6b35; }
html[data-theme="dark"] .role-badge:not(.role-admin, .role-moderator, .member-banned) { background: #2a3941; color: #bacbd2; border-color: #4a5e67; }
html[data-theme="dark"] :is(.avatar-gallery-card img, .forum-avatar-image, .member-avatar:has(.profile-avatar-image)) { background: #263b42; }
html[data-theme="dark"] :is(input[type="checkbox"], input[type="radio"]) { accent-color: #7acabd; }
