:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #10131a;
  --surface: #171b24;
  --surface-muted: #202633;
  --border: rgba(148, 163, 184, 0.24);
  --border-strong: rgba(174, 190, 214, 0.38);
  --text-primary: #e7edf7;
  --text-secondary: #a8b3c7;
  --text-muted: #7f8ba2;
  --brand-ddu-accent: #74ACF5;
  --brand-ddu-accent-strong: #a9d4ff;
  --accent: var(--brand-ddu-accent);
  --accent-strong: var(--brand-ddu-accent-strong);
  --success: #58c98b;
  --warning: #e7b95b;
  --danger: #ef8a8a;
  --bg: var(--background);
  --surface-alt: var(--surface-muted);
  --ink: var(--text-primary);
  --muted: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: rgba(116, 172, 245, 0.18);
  --red: var(--accent);
  --red-100: rgba(116, 172, 245, 0.14);
  --red-600: var(--accent);
  --red-700: var(--accent-strong);
  --red-pressed: #5e98dc;
  --red-ring: rgba(116, 172, 245, 0.28);
  --selection: var(--accent);
  --selection-soft: rgba(116, 172, 245, 0.16);
  --selection-ring: rgba(116, 172, 245, 0.32);
  --hover-bg: rgba(116, 172, 245, 0.12);
  --hover-border: rgba(116, 172, 245, 0.42);
  --hover-ink: var(--text-primary);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.24), 0 18px 44px rgba(0, 0, 0, 0.24);
  --hp-fill: #62d184;
  --hp-fill-soft: rgba(98, 209, 132, 0.22);
  --hp-green: #62d184;
  --hp-orange: #e7b95b;
  --hp-red: #ef8a8a;
  --damage-line: #ef8a8a;
  --damage-strong: #ffb0b0;
  --damage-ink: #ffd6d6;
  --damage-soft: rgba(239, 138, 138, 0.18);
  --focus: var(--accent);
  --type-normal-bg: #30343e;
  --type-normal-text: #d5dbe6;
  --type-normal-border: #5b6472;
  --type-fire-bg: #3b241f;
  --type-fire-text: #ffb19a;
  --type-fire-border: #8c4a3d;
  --type-water-bg: #1c2d42;
  --type-water-text: #9ec8ff;
  --type-water-border: #496f9e;
  --type-electric-bg: #383018;
  --type-electric-text: #f6d36e;
  --type-electric-border: #8d7330;
  --type-grass-bg: #1f3328;
  --type-grass-text: #9de0af;
  --type-grass-border: #4d8460;
  --type-ice-bg: #1e3440;
  --type-ice-text: #9fe6f5;
  --type-ice-border: #4e8191;
  --type-fighting-bg: #3a2a1d;
  --type-fighting-text: #ffc07f;
  --type-fighting-border: #8a6139;
  --type-poison-bg: #31243d;
  --type-poison-text: #d7b4ff;
  --type-poison-border: #765995;
  --type-ground-bg: #382b21;
  --type-ground-text: #e4c09b;
  --type-ground-border: #826449;
  --type-flying-bg: #223344;
  --type-flying-text: #add2ff;
  --type-flying-border: #567a9d;
  --type-psychic-bg: #3a2430;
  --type-psychic-text: #ffabc8;
  --type-psychic-border: #8d536a;
  --type-bug-bg: #2d351d;
  --type-bug-text: #cdda7f;
  --type-bug-border: #6d7c3d;
  --type-rock-bg: #332f24;
  --type-rock-text: #d7c99b;
  --type-rock-border: #777057;
  --type-ghost-bg: #2c2639;
  --type-ghost-text: #c7b4e6;
  --type-ghost-border: #6d5b86;
  --type-dragon-bg: #252b48;
  --type-dragon-text: #b6c0ff;
  --type-dragon-border: #5968b6;
  --type-dark-bg: #2f2d33;
  --type-dark-text: #d4cdd5;
  --type-dark-border: #6b636e;
  --type-steel-bg: #22323a;
  --type-steel-text: #a8d8e8;
  --type-steel-border: #567985;
  --type-fairy-bg: #3b253d;
  --type-fairy-text: #fab7fb;
  --type-fairy-border: #895a8c;
  --type-unknown-bg: #243832;
  --type-unknown-text: #a9d8cb;
  --type-unknown-border: #587d73;
}

[data-theme="dark"] body,
[data-theme="dark"] .app-shell,
[data-theme="dark"] .app-frame {
  background: var(--bg);
  color: var(--ink);
}

[data-theme="dark"] .app-frame,
[data-theme="dark"] .app-main,
[data-theme="dark"] .battle-setup-page,
[data-theme="dark"] .battle-screen,
[data-theme="dark"] .roster-editor-screen,
[data-theme="dark"] .opponent-select-screen,
[data-theme="dark"] .speed-dashboard,
[data-theme="dark"] .inquiry-board-content {
  background:
    radial-gradient(circle at 20% 0%, rgba(116, 172, 245, 0.10), transparent 28rem),
    var(--bg);
  color: var(--ink);
}

[data-theme="dark"] .guide-battle-frame {
  background:
    linear-gradient(180deg, rgba(23, 27, 36, 0.96), rgba(16, 19, 26, 0.98)),
    var(--bg);
}

[data-theme="dark"] .guide-battle-prompt-backdrop,
[data-theme="dark"] .guide-battle-loading-backdrop {
  background: rgba(0, 0, 0, 0.38);
}

[data-theme="dark"] .guide-battle-prompt,
[data-theme="dark"] .guide-battle-loading-panel,
[data-theme="dark"] .guide-battle-start-shortcut {
  border-color: var(--battle-frame);
  background: var(--surface);
  color: var(--ink);
}

[data-theme="dark"] .topbar,
[data-theme="dark"] .app-frame .app-topbar,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .app-topbar,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .app-topbar,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .app-topbar {
  background: rgba(16, 19, 26, 0.94);
  border-color: var(--line);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  color: var(--ink);
}

[data-theme="dark"] .brand-button,
[data-theme="dark"] .app-data-notice,
[data-theme="dark"] .page-header,
[data-theme="dark"] .legal-topbar,
[data-theme="dark"] .site-disclaimer {
  background: rgba(23, 27, 36, 0.88);
  border-color: var(--line);
  color: var(--muted);
}

[data-theme="dark"] .brand-name,
[data-theme="dark"] .page-title h1,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] strong {
  color: var(--ink);
}

[data-theme="dark"] .hint,
[data-theme="dark"] .muted,
[data-theme="dark"] small,
[data-theme="dark"] .empty,
[data-theme="dark"] .site-disclaimer p,
[data-theme="dark"] .setup-card-meta,
[data-theme="dark"] .setup-card-copy small,
[data-theme="dark"] .pokemon-card-meta,
[data-theme="dark"] .battle-dashboard-panel-head p,
[data-theme="dark"] .battle-subhead span,
[data-theme="dark"] .battle-subhead small {
  color: var(--muted);
}

[data-theme="dark"] a {
  color: #a9d4ff;
}

[data-theme="dark"] .panel,
[data-theme="dark"] .section-card,
[data-theme="dark"] .setup-overview-card,
[data-theme="dark"] .setup-status-panel,
[data-theme="dark"] .setup-current-action,
[data-theme="dark"] .battle-context-card,
[data-theme="dark"] .battle-action-recommendation-panel,
[data-theme="dark"] .battle-dashboard-panel,
[data-theme="dark"] .battle-dashboard-sidebar,
[data-theme="dark"] .battle-dashboard-opponent-sidebar,
[data-theme="dark"] .legal-document,
[data-theme="dark"] .roster-editor-main-panel,
[data-theme="dark"] .roster-team-editor-main,
[data-theme="dark"] .opponent-selected-card,
[data-theme="dark"] .setup-saved-team-popover,
[data-theme="dark"] .opponent-type-search-dialog,
[data-theme="dark"] .battle-speed-dialog,
[data-theme="dark"] .team-image-help-card {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-card);
  color: var(--ink);
}

[data-theme="dark"] .panel-head,
[data-theme="dark"] .section-card-head,
[data-theme="dark"] .setup-overview-head,
[data-theme="dark"] .setup-subhead,
[data-theme="dark"] .battle-dashboard-panel-head,
[data-theme="dark"] .legal-document-head,
[data-theme="dark"] .legal-section,
[data-theme="dark"] .battle-subhead {
  border-color: var(--line);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .dropdown-trigger,
[data-theme="dark"] .custom-dropdown,
[data-theme="dark"] .custom-dropdown-menu,
[data-theme="dark"] .search-results,
[data-theme="dark"] .search-result-list,
[data-theme="dark"] .result-button {
  background: #111722;
  background-color: #111722;
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .search-results,
[data-theme="dark"] .custom-dropdown-menu {
  background: #171b24;
  background-color: #171b24;
  border-color: var(--line);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
  color: var(--ink);
}

[data-theme="dark"] .search-results button,
[data-theme="dark"] .custom-dropdown-menu button {
  background: #171b24;
  background-color: #171b24;
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .search-results button:hover,
[data-theme="dark"] .search-results button.selected,
[data-theme="dark"] .custom-dropdown-menu button:hover,
[data-theme="dark"] .custom-dropdown-menu button.selected {
  background: rgba(116, 172, 245, 0.14);
  background-color: rgba(116, 172, 245, 0.14);
  border-color: rgba(116, 172, 245, 0.42);
  color: var(--ink);
}

[data-theme="dark"] .search-results .empty,
[data-theme="dark"] .custom-dropdown-menu .empty,
[data-theme="dark"] .search-results .search-message,
[data-theme="dark"] .custom-dropdown-menu .search-message,
[data-theme="dark"] .search-results .muted,
[data-theme="dark"] .custom-dropdown-menu .muted {
  color: var(--muted);
}

[data-theme="dark"] .search-results .search-message,
[data-theme="dark"] .custom-dropdown-menu .search-message {
  background: #171b24;
  background-color: #171b24;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #77849b;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] button:focus-visible,
[data-theme="dark"] .action-button:focus-visible,
[data-theme="dark"] .icon-button:focus-visible,
[data-theme="dark"] .dropdown-trigger:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(116, 172, 245, 0.24);
  outline: 0;
}

[data-theme="dark"] button,
[data-theme="dark"] .action-button,
[data-theme="dark"] .compact-button,
[data-theme="dark"] .icon-button,
[data-theme="dark"] .language-toggle,
[data-theme="dark"] .language-toggle button,
[data-theme="dark"] .battle-action-tabs button,
[data-theme="dark"] .segmented button {
  background: #1b2230;
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] button:hover,
[data-theme="dark"] .action-button:hover,
[data-theme="dark"] .compact-button:hover,
[data-theme="dark"] .icon-button:hover,
[data-theme="dark"] .dropdown-trigger:hover,
[data-theme="dark"] .result-button:hover {
  background: var(--hover-bg);
  border-color: var(--hover-border);
  color: var(--hover-ink);
}

[data-theme="dark"] button.primary,
[data-theme="dark"] .action-button.primary,
[data-theme="dark"] .theme-toggle[aria-pressed="true"],
[data-theme="dark"] .language-toggle button.active,
[data-theme="dark"] .battle-action-tabs button.active,
[data-theme="dark"] .segmented button.active,
[data-theme="dark"] .segmented button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #10131a;
}

[data-theme="dark"] .auth-user-pill,
[data-theme="dark"] .chip,
[data-theme="dark"] .status-pill,
[data-theme="dark"] .type-pill,
[data-theme="dark"] .type,
[data-theme="dark"] .battle-sidebar-pill,
[data-theme="dark"] .battle-speed-relation,
[data-theme="dark"] .move-pp-badge,
[data-theme="dark"] .rage-fist-badge {
  background: var(--surface-muted);
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .chip.active,
[data-theme="dark"] .status-pill.success,
[data-theme="dark"] .setup-card-status.complete {
  background: rgba(88, 201, 139, 0.16);
  border-color: rgba(88, 201, 139, 0.42);
  color: #a8f0c4;
}

[data-theme="dark"] .chip.warning,
[data-theme="dark"] .chip.medium {
  background: rgba(231, 185, 91, 0.16);
  border-color: rgba(231, 185, 91, 0.42);
  color: #f4d595;
}

[data-theme="dark"] .chip.danger,
[data-theme="dark"] button.danger,
[data-theme="dark"] .action-button.danger,
[data-theme="dark"] .compact-danger {
  background: rgba(239, 138, 138, 0.14);
  border-color: rgba(239, 138, 138, 0.42);
  color: #ffc2c2;
}

[data-theme="dark"] .pokemon-card,
[data-theme="dark"] .setup-candidate-card,
[data-theme="dark"] .setup-opponent-card,
[data-theme="dark"] .setup-final-card,
[data-theme="dark"] .setup-lead-slot,
[data-theme="dark"] .setup-team-card,
[data-theme="dark"] .setup-selected-opponent-card,
[data-theme="dark"] .battle-sidebar-card,
[data-theme="dark"] .battle-candidate-card,
[data-theme="dark"] .battle-opponent-candidate,
[data-theme="dark"] .battle-move-card,
[data-theme="dark"] .battle-action-card,
[data-theme="dark"] .roster-slot-row,
[data-theme="dark"] .roster-move-row,
[data-theme="dark"] .empty-slot-card,
[data-theme="dark"] .setup-opponent-card.empty,
[data-theme="dark"] .setup-lead-slot.empty {
  background: var(--surface-muted);
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .pokemon-card:hover,
[data-theme="dark"] .setup-candidate-card:hover,
[data-theme="dark"] .setup-team-card:hover,
[data-theme="dark"] .setup-selected-opponent-card:hover,
[data-theme="dark"] .battle-sidebar-card:hover,
[data-theme="dark"] .battle-move-card:hover,
[data-theme="dark"] .battle-action-card:hover,
[data-theme="dark"] .roster-slot-row:hover {
  background: rgba(116, 172, 245, 0.12);
  border-color: var(--hover-border);
}

[data-theme="dark"] .pokemon-card.selected,
[data-theme="dark"] .setup-candidate-card.selected,
[data-theme="dark"] .setup-opponent-card.selected,
[data-theme="dark"] .setup-final-card.selected,
[data-theme="dark"] .setup-lead-slot.selected,
[data-theme="dark"] .setup-team-card.selected,
[data-theme="dark"] .battle-sidebar-card.active,
[data-theme="dark"] .battle-sidebar-card.recommended,
[data-theme="dark"] .battle-move-card.active,
[data-theme="dark"] .battle-move-card.previewing,
[data-theme="dark"] .battle-action-card.top-ranked,
[data-theme="dark"] .battle-action-card.active {
  background: rgba(116, 172, 245, 0.16);
  border-color: rgba(116, 172, 245, 0.56);
}

[data-theme="dark"] .avatar,
[data-theme="dark"] .pokemon-card-image,
[data-theme="dark"] .stage-img,
[data-theme="dark"] .battle-sidebar-card img,
[data-theme="dark"] .battle-active-pokemon-layout > img,
[data-theme="dark"] .setup-team-art img,
[data-theme="dark"] .setup-speed-identity img,
[data-theme="dark"] .battle-setup-speed-identity img,
[data-theme="dark"] img[src*="/api/v1/pokemon/"][src*="/sprite"],
[data-theme="dark"] img[src*="/static/sprites/"] {
  background: rgba(231, 237, 247, 0.06);
  border-color: rgba(231, 237, 247, 0.12);
  box-shadow: 0 0 0 1px rgba(231, 237, 247, 0.08), 0 10px 24px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] img[src*="/static/sprites-dot/"] {
  background: transparent;
  box-shadow: none;
}

[data-theme="dark"] .hp-bar,
[data-theme="dark"] .battle-compact-hp > span,
[data-theme="dark"] .battle-speed-bars i {
  background: #101722;
  border-color: var(--line);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .hp-bar {
  background: #101722;
  background-color: #101722;
  border-color: var(--battle-line);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .hp-fill,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .hp-fill.hp-healthy,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .hp-fill.hp-warning,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .hp-fill.hp-danger {
  background: #5f9f73;
  background-color: #5f9f73;
}

[data-theme="dark"] .hp-damage-preview,
[data-theme="dark"] .damage-bar,
[data-theme="dark"] .battle-move-current-damage,
[data-theme="dark"] .battle-move-damage-cell {
  background: rgba(239, 138, 138, 0.12);
  border-color: rgba(239, 138, 138, 0.35);
  color: #ffd2d2;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .hp-damage-preview {
  background: rgba(239, 138, 138, 0.16);
  background-color: rgba(239, 138, 138, 0.16);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .hp-damage-preview.possible {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(239, 138, 138, 0.44) 0 5px,
      rgba(239, 138, 138, 0.18) 5px 10px
    ),
    rgba(239, 138, 138, 0.16);
}

[data-theme="dark"] .hp-damage-label {
  background: #1b2230;
  background-color: #1b2230;
  border-color: rgba(174, 190, 214, 0.34);
  color: var(--ink);
  box-shadow: none;
}

[data-theme="dark"] .hp-damage-label b {
  color: currentColor;
}

[data-theme="dark"] .hp-damage-label strong {
  color: var(--accent-strong);
}

[data-theme="dark"] .hp-damage-label.mode {
  background: #3a232b;
  background-color: #3a232b;
  border-color: rgba(255, 177, 200, 0.68);
  color: #ffdce5;
}

[data-theme="dark"] .hp-damage-label.mode strong {
  color: #ffdce5;
}

[data-theme="dark"] .hp-damage-label.survive {
  background: #183426;
  background-color: #183426;
  border-color: rgba(88, 201, 139, 0.58);
  color: #a8f0c4;
}

[data-theme="dark"] .hp-damage-label.possible {
  background: #3b2b1d;
  background-color: #3b2b1d;
  border-color: rgba(231, 185, 91, 0.66);
  color: #f4d595;
}

[data-theme="dark"] .hp-damage-label.guaranteed {
  background: #431f28;
  background-color: #431f28;
  border-color: rgba(239, 138, 138, 0.70);
  color: #ffc9cf;
}

[data-theme="dark"] .hp-damage-label.mode .hp-damage-dot {
  background: #ff9eaa;
}

[data-theme="dark"] .hp-damage-label.survive .hp-damage-dot {
  background: #58c98b;
}

[data-theme="dark"] .hp-damage-label.possible .hp-damage-dot {
  background: #e7b95b;
}

[data-theme="dark"] .hp-damage-label.guaranteed .hp-damage-dot {
  background: #ef8a8a;
}

[data-theme="dark"] .setup-stepper-item,
[data-theme="dark"] .setup-speed-card,
[data-theme="dark"] .battle-setup-speed-card,
[data-theme="dark"] .battle-setup-speed-band,
[data-theme="dark"] .setup-speed-chip,
[data-theme="dark"] .battle-full-speed-chip,
[data-theme="dark"] .battle-context-item,
[data-theme="dark"] .battle-top-pill,
[data-theme="dark"] .battle-current-stat-toggle,
[data-theme="dark"] .battle-rank-toggle,
[data-theme="dark"] .battle-current-stat-body,
[data-theme="dark"] .battle-status-row,
[data-theme="dark"] .battle-type-override-row,
[data-theme="dark"] .battle-speed-card,
[data-theme="dark"] .battle-recent-event-row {
  background: var(--surface-muted);
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .setup-stepper-item.active,
[data-theme="dark"] .setup-stepper-item.done,
[data-theme="dark"] .battle-context-item.active,
[data-theme="dark"] .battle-top-pill.tone-active,
[data-theme="dark"] .battle-top-pill.tone-mine,
[data-theme="dark"] .battle-top-pill.tone-room {
  background: rgba(116, 172, 245, 0.16);
  border-color: rgba(116, 172, 245, 0.42);
}

[data-theme="dark"] .toast {
  background: #e7edf7;
  border-color: #e7edf7;
  color: #10131a;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
}

[data-theme="dark"] .app-frame .chip.active,
[data-theme="dark"] .app-frame .status-pill.active,
[data-theme="dark"] .app-frame .chip.success,
[data-theme="dark"] .app-frame .status-pill.success {
  background: #183426;
  border-color: rgba(88, 201, 139, 0.52);
  color: #a8f0c4;
}

[data-theme="dark"] .app-frame .chip.warning,
[data-theme="dark"] .app-frame .chip.medium,
[data-theme="dark"] .app-frame .status-pill.warning {
  background: #3a2c17;
  border-color: rgba(231, 185, 91, 0.52);
  color: #f4d595;
}

[data-theme="dark"] .app-frame .chip.danger,
[data-theme="dark"] .app-frame .status-pill.danger {
  background: #3a1f24;
  border-color: rgba(239, 138, 138, 0.52);
  color: #ffc2c2;
}

[data-theme="dark"] .app-frame .speed-dashboard .chip.active,
[data-theme="dark"] .app-frame .speed-dashboard .chip.success {
  background: #183426 !important;
  border-color: rgba(88, 201, 139, 0.52) !important;
  color: #a8f0c4 !important;
}

[data-theme="dark"] .opponent-type-search-dialog-backdrop,
[data-theme="dark"] .battle-speed-dialog-backdrop,
[data-theme="dark"] .modal-backdrop {
  background: rgba(4, 7, 12, 0.66) !important;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) {
  --setup-frame: #7f8ba2;
  --setup-frame-dark: #e7edf7;
  --setup-line: rgba(148, 163, 184, 0.34);
  --setup-line-soft: rgba(148, 163, 184, 0.24);
  --setup-panel: #171b24;
  --setup-muted-panel: #202633;
  --setup-ink: #e7edf7;
  --setup-muted: #b7c2d6;
  --setup-gold: #74ACF5;
  --setup-gold-soft: rgba(116, 172, 245, 0.16);
  --selection-soft: rgba(116, 172, 245, 0.16);
  --hover-bg: rgba(116, 172, 245, 0.12);
  --hover-border: rgba(116, 172, 245, 0.46);
  background:
    radial-gradient(circle at 18% 0%, rgba(116, 172, 245, 0.10), transparent 28rem),
    var(--bg);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-team-card,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-selected-opponent-card,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-opponent-suggestion-card,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-roster-fill-chip,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-saved-team-button,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .ghost.compact-button,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .opponent-type-search-trigger,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-saved-team-popover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .pokemon-form-toggle.setup {
  background: var(--surface-muted);
  border-color: var(--setup-line);
  color: var(--setup-ink);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .app-topbar .action-button,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .app-topbar .icon-button,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .app-topbar .language-toggle button {
  background: #1b2230;
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .app-topbar .action-button.primary,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .app-topbar .theme-toggle[aria-pressed="true"],
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .app-topbar .language-toggle button.active {
  background: #74ACF5;
  border-color: #74ACF5;
  color: #10131a;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-team-card:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-selected-opponent-card:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-opponent-suggestion-card:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-roster-fill-chip:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .ghost.compact-button:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .opponent-type-search-trigger:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-saved-team-button:hover {
  background: rgba(116, 172, 245, 0.12);
  border-color: var(--hover-border);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-team-card.selected,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-selected-opponent-card.selected,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-roster-fill-chip.selected,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-saved-team-button.active,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .pokemon-form-toggle.setup button.active,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .pokemon-form-toggle.setup button[aria-pressed="true"] {
  background: rgba(116, 172, 245, 0.16);
  border-color: rgba(116, 172, 245, 0.52);
  color: var(--setup-ink);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-counter-card,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-counter-more,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-counter-empty,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-matchup-help,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-roster-fill-strip,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-empty,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-team-card.empty,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-selected-opponent-card.empty {
  background: #171f2c;
  border-color: var(--setup-line-soft);
  color: var(--setup-muted);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-team-card:disabled,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-opponent-suggestion-card:disabled,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-roster-fill-chip:disabled {
  opacity: 0.82;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-team-remove,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-roster-fill-chip b,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-opponent-suggestion-card b,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .pokemon-form-toggle.setup button,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .status-pill,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-opponent-search input {
  background: #111722;
  border-color: var(--setup-line);
  color: var(--setup-ink);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-team-copy strong,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-counter-copy strong,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-counter-move-text,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-selected-opponent-card strong,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-opponent-suggestion-card strong,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-subhead strong {
  color: var(--setup-ink);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-overview-head .hint,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-subhead small,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-sample-note,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-counter-head > span:first-child,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-card-matchup-label,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-matchup-separator,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-roster-fill-strip small,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-roster-fill-copy small {
  color: var(--setup-muted);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-matchup-chip,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-counter-effect {
  background: var(--matchup-bg, #202633);
  background-color: var(--matchup-bg, #202633);
  border-color: var(--matchup-border, rgba(148, 163, 184, 0.34));
  color: var(--matchup-text, var(--setup-ink));
  box-shadow: none;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-counter-ko {
  background: #4a2029;
  background-color: #4a2029;
  border-color: rgba(255, 150, 165, 0.72);
  color: #ffe0e5;
  box-shadow: none;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-counter-guard {
  background: #202b49;
  background-color: #202b49;
  border-color: rgba(116, 172, 245, 0.60);
  color: #dbe4ff;
  box-shadow: none;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-counter-speed {
  background: #242c3a;
  background-color: #242c3a;
  border-color: rgba(148, 163, 184, 0.42);
  color: #d8e1f0;
  box-shadow: none;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-counter-speed.faster {
  background: #183426;
  background-color: #183426;
  border-color: rgba(88, 201, 139, 0.58);
  color: #bdf3cf;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-counter-speed.slower,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-counter-speed.opponent-first {
  background: #43281a;
  background-color: #43281a;
  border-color: rgba(231, 185, 91, 0.68);
  color: #ffe1a6;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-counter-speed.tie {
  background: #2f2b1d;
  background-color: #2f2b1d;
  border-color: rgba(231, 185, 91, 0.48);
  color: #f4d595;
}

[data-theme="dark"] .app-frame .app-topbar,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .app-topbar,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .app-topbar,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .app-topbar {
  background: rgba(16, 19, 26, 0.94);
  border-bottom-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .app-frame .brand-button,
[data-theme="dark"] .app-frame .brand-button:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .brand-button,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .brand-button:hover,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .brand-button,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .brand-button:hover,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .brand-button,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .brand-button:hover,
[data-theme="dark"] .app-frame .app-data-notice,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .app-data-notice,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .app-data-notice,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .app-data-notice,
[data-theme="dark"] .app-frame .page-header,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .page-header,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .page-header,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .page-header {
  background: rgba(23, 27, 36, 0.88);
  border-color: var(--line);
  color: var(--muted);
  box-shadow: none;
}

[data-theme="dark"] .app-frame .brand-button strong,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .brand-button strong,
[data-theme="dark"] .app-frame .brand-button small,
[data-theme="dark"] .app-frame .page-title h1,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .page-title h1 {
  color: var(--ink);
}

[data-theme="dark"] .app-frame .app-topbar .action-button,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .app-topbar .action-button,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .app-topbar .action-button,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .app-topbar .page-actions .action-button,
[data-theme="dark"] .app-frame .app-topbar .icon-button,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .app-topbar .icon-button,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .app-topbar .icon-button,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .app-topbar .page-actions .icon-button,
[data-theme="dark"] .app-frame .app-topbar .language-toggle,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .app-topbar .language-toggle,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .app-topbar .language-toggle,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .app-topbar .language-toggle,
[data-theme="dark"] .app-frame .app-topbar .language-toggle button,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .app-topbar .language-toggle button,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .app-topbar .language-toggle button,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .app-topbar .language-toggle button {
  background: #1b2230;
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .app-frame .app-topbar .action-button.primary,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .app-topbar .action-button.primary,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .app-topbar .page-actions .action-button.primary,
[data-theme="dark"] .app-frame .app-topbar .theme-toggle[aria-pressed="true"],
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .app-topbar .theme-toggle[aria-pressed="true"],
[data-theme="dark"] .app-frame:has(.battle-dashboard) .app-topbar .page-actions .theme-toggle[aria-pressed="true"],
[data-theme="dark"] .app-frame .app-topbar .language-toggle button.active,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .app-topbar .language-toggle button.active,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .app-topbar .language-toggle button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #10131a;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .app-topbar .action-button.primary,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .app-topbar .theme-toggle[aria-pressed="true"],
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .app-topbar .language-toggle button.active {
  background: #74ACF5;
  border-color: #74ACF5;
  color: #10131a;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-roster-threat-toggle {
  background: #1b2230;
  border-color: var(--setup-line);
  color: var(--setup-muted);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-roster-threat-toggle.active {
  background: rgba(116, 172, 245, 0.16);
  border-color: rgba(116, 172, 245, 0.48);
  color: #a9d4ff;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-roster-threat-toggle b,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-roster-threat-toggle.active b {
  color: var(--setup-ink);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-card-order,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .pokemon-card-order,
[data-theme="dark"] .app-frame:has(.opponent-select-screen) .setup-card-order,
[data-theme="dark"] .app-frame:has(.opponent-select-screen) .pokemon-card-order {
  background: #2a3240;
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .selected > .setup-card-order,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-candidate-card.selected .setup-card-order,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-final-card.selected .setup-card-order,
[data-theme="dark"] .app-frame:has(.opponent-select-screen) .selected > .setup-card-order,
[data-theme="dark"] .app-frame:has(.opponent-select-screen) .setup-candidate-card.selected .setup-card-order,
[data-theme="dark"] .app-frame:has(.opponent-select-screen) .setup-final-card.selected .setup-card-order {
  background: var(--accent);
  border-color: var(--accent);
  color: #10131a;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-card,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-card.my-card,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-card.opponent-card,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-band,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-empty {
  background: #1b2230;
  background-color: #1b2230;
  border-color: var(--setup-line);
  color: var(--setup-ink);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-band {
  background: #202633;
  background-color: #202633;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-band.empty-band {
  background: transparent;
  background-color: transparent;
  border-color: transparent;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-card.my-card:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-card.my-card:focus-visible,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-card.my-card.is-focused,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-band.tie-band {
  background: rgba(116, 172, 245, 0.14);
  background-color: rgba(116, 172, 245, 0.14);
  border-color: rgba(116, 172, 245, 0.54);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-identity strong,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-opponent-name strong {
  color: var(--setup-ink);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-identity small,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-grid-head,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-compare-head small {
  color: var(--setup-muted);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-number,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-opponent-name span {
  background: #171f2c;
  background-color: #171f2c;
  border-color: rgba(174, 190, 214, 0.34);
  color: var(--accent-strong);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-badge {
  background: #1b2230;
  background-color: #1b2230;
  border-color: rgba(174, 190, 214, 0.34);
  color: var(--setup-ink);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-badge b {
  color: var(--accent-strong);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-badge.mode {
  background: #3a232b;
  background-color: #3a232b;
  border-color: rgba(255, 177, 200, 0.68);
  color: #ffdce5;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-badge.mode b {
  color: #ffdce5;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-badge.neutral {
  background: rgba(116, 172, 245, 0.16);
  background-color: rgba(116, 172, 245, 0.16);
  border-color: rgba(116, 172, 245, 0.56);
  color: #e7edff;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-badge.positive {
  background: #302b1d;
  background-color: #302b1d;
  border-color: rgba(231, 185, 91, 0.72);
  color: #f7dda0;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-badge.positive b {
  color: #ffe3a6;
}

[data-theme="dark"] .app-frame:has(.opponent-select-screen) .opponent-filter-chip.active,
[data-theme="dark"] .app-frame:has(.opponent-select-screen) .opponent-filter-chip:hover,
[data-theme="dark"] .app-frame:has(.opponent-select-screen) .opponent-filter-chip:focus {
  background: rgba(116, 172, 245, 0.16);
  border-color: rgba(116, 172, 245, 0.52);
  color: var(--accent-strong);
}

[data-theme="dark"] .type.normal,
[data-theme="dark"] .type[data-type="normal"] { --type-light: #5b6472; --type-main: #30343e; --type-dark: #5b6472; color: #d5dbe6; }
[data-theme="dark"] .type.fire,
[data-theme="dark"] .type[data-type="fire"] { --type-light: #8c4a3d; --type-main: #3b241f; --type-dark: #8c4a3d; color: #ffb19a; }
[data-theme="dark"] .type.water,
[data-theme="dark"] .type[data-type="water"] { --type-light: #496f9e; --type-main: #1c2d42; --type-dark: #496f9e; color: #9ec8ff; }
[data-theme="dark"] .type.electric,
[data-theme="dark"] .type[data-type="electric"] { --type-light: #8d7330; --type-main: #383018; --type-dark: #8d7330; color: #f6d36e; }
[data-theme="dark"] .type.grass,
[data-theme="dark"] .type[data-type="grass"] { --type-light: #4d8460; --type-main: #1f3328; --type-dark: #4d8460; color: #9de0af; }
[data-theme="dark"] .type.ice,
[data-theme="dark"] .type[data-type="ice"] { --type-light: #4e8191; --type-main: #1e3440; --type-dark: #4e8191; color: #9fe6f5; }
[data-theme="dark"] .type.fighting,
[data-theme="dark"] .type[data-type="fighting"] { --type-light: #8a6139; --type-main: #3a2a1d; --type-dark: #8a6139; color: #ffc07f; }
[data-theme="dark"] .type.poison,
[data-theme="dark"] .type[data-type="poison"] { --type-light: #765995; --type-main: #31243d; --type-dark: #765995; color: #d7b4ff; }
[data-theme="dark"] .type.ground,
[data-theme="dark"] .type[data-type="ground"] { --type-light: #826449; --type-main: #382b21; --type-dark: #826449; color: #e4c09b; }
[data-theme="dark"] .type.flying,
[data-theme="dark"] .type[data-type="flying"] { --type-light: #567a9d; --type-main: #223344; --type-dark: #567a9d; color: #add2ff; }
[data-theme="dark"] .type.psychic,
[data-theme="dark"] .type[data-type="psychic"] { --type-light: #8d536a; --type-main: #3a2430; --type-dark: #8d536a; color: #ffabc8; }
[data-theme="dark"] .type.bug,
[data-theme="dark"] .type[data-type="bug"] { --type-light: #6d7c3d; --type-main: #2d351d; --type-dark: #6d7c3d; color: #cdda7f; }
[data-theme="dark"] .type.rock,
[data-theme="dark"] .type[data-type="rock"] { --type-light: #777057; --type-main: #332f24; --type-dark: #777057; color: #d7c99b; }
[data-theme="dark"] .type.ghost,
[data-theme="dark"] .type[data-type="ghost"] { --type-light: #6d5b86; --type-main: #2c2639; --type-dark: #6d5b86; color: #c7b4e6; }
[data-theme="dark"] .type.dragon,
[data-theme="dark"] .type[data-type="dragon"] { --type-light: #5968b6; --type-main: #252b48; --type-dark: #5968b6; color: #b6c0ff; }
[data-theme="dark"] .type.dark,
[data-theme="dark"] .type[data-type="dark"] { --type-light: #6b636e; --type-main: #2f2d33; --type-dark: #6b636e; color: #d4cdd5; }
[data-theme="dark"] .type.steel,
[data-theme="dark"] .type[data-type="steel"] { --type-light: #567985; --type-main: #22323a; --type-dark: #567985; color: #a8d8e8; }
[data-theme="dark"] .type.fairy,
[data-theme="dark"] .type[data-type="fairy"] { --type-light: #895a8c; --type-main: #3b253d; --type-dark: #895a8c; color: #fab7fb; }
[data-theme="dark"] .type.unknown,
[data-theme="dark"] .type[data-type="unknown"] { --type-light: #587d73; --type-main: #243832; --type-dark: #587d73; color: #a9d8cb; }

[data-theme="dark"] .app-frame:has(.roster-editor-screen) {
  --team-navy: #e7edf7;
  --team-blue: #74ACF5;
  --team-blue-soft: rgba(116, 172, 245, 0.16);
  --team-blue-pale: #202633;
  --team-yellow: #74ACF5;
  --team-red: #ef8a8a;
  --team-green: #58c98b;
  --team-frame: #a8b3c7;
  --team-frame-dark: #e7edf7;
  --team-border: rgba(148, 163, 184, 0.30);
  --team-border-strong: rgba(116, 172, 245, 0.50);
  --team-ink: #e7edf7;
  --team-muted: #b7c2d6;
  background:
    radial-gradient(circle at 20% 0%, rgba(116, 172, 245, 0.10), transparent 28rem),
    var(--bg);
  color: var(--team-ink);
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) button,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .action-button,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .icon-button,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) input:not([type="range"]),
[data-theme="dark"] .app-frame:has(.roster-editor-screen) select,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) textarea,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .dropdown-trigger,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-image-import-button,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-team-editor-head .compact-button,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-team-draft-actions .compact-button {
  background: #1b2230;
  border-color: var(--team-border);
  color: var(--team-ink);
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) button:hover,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .action-button:hover,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .icon-button:hover,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .dropdown-trigger:hover,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-image-import-button:hover {
  background: rgba(116, 172, 245, 0.12);
  border-color: var(--hover-border);
  color: var(--team-ink);
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .action-button.primary,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) button.primary,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-team-editor-head button.primary,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-team-draft-actions button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #10131a;
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-team-editor-head .compact-danger {
  background: #341d24;
  background-color: #341d24;
  border-color: rgba(239, 138, 138, 0.62);
  color: #ffc9cf;
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-team-editor-head .compact-danger:hover,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-team-editor-head .compact-danger:active,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-team-editor-head .compact-danger:focus-visible {
  background: #44202a;
  background-color: #44202a;
  border-color: rgba(239, 138, 138, 0.72);
  color: #ffd6dc;
}

[data-theme="dark"] .roster-slot-list,
[data-theme="dark"] .roster-team-list,
[data-theme="dark"] .roster-mode-tabs,
[data-theme="dark"] .roster-search-mode.segmented,
[data-theme="dark"] .battle-opponent-add-search.roster-add-search,
[data-theme="dark"] .roster-editor-main-panel,
[data-theme="dark"] .roster-team-editor-main,
[data-theme="dark"] .roster-team-detail-main,
[data-theme="dark"] .roster-team-empty-main,
[data-theme="dark"] .roster-panel,
[data-theme="dark"] .roster-team-draft {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .roster-slot-row,
[data-theme="dark"] .roster-add-slot,
[data-theme="dark"] .roster-team-card,
[data-theme="dark"] .roster-empty-team-card,
[data-theme="dark"] .roster-mode-tabs button,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-mode-tabs button,
[data-theme="dark"] .roster-search-mode.segmented button,
[data-theme="dark"] .roster-move-row,
[data-theme="dark"] .roster-team-editor-member {
  background: var(--surface-muted);
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .roster-slot-add-art,
[data-theme="dark"] .roster-slot-main .avatar {
  background: rgba(231, 237, 247, 0.06);
  background-color: rgba(231, 237, 247, 0.06);
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-slot-add-art,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-slot-main .avatar {
  background: rgba(231, 237, 247, 0.06);
  background-color: rgba(231, 237, 247, 0.06);
}

[data-theme="dark"] .roster-slot-row.active,
[data-theme="dark"] .roster-team-card.active,
[data-theme="dark"] .roster-mode-tabs button.active,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-mode-tabs button.active,
[data-theme="dark"] .roster-search-mode.segmented button.active,
[data-theme="dark"] .roster-search-mode.segmented button[aria-pressed="true"],
[data-theme="dark"] .roster-team-editor-member.selected {
  background: rgba(116, 172, 245, 0.16);
  border-color: rgba(116, 172, 245, 0.52);
  color: var(--ink);
}

[data-theme="dark"] .roster-slot-title strong,
[data-theme="dark"] .roster-add-slot strong,
[data-theme="dark"] .roster-slot-copy,
[data-theme="dark"] .roster-slot-title,
[data-theme="dark"] .roster-editor-name-row h2,
[data-theme="dark"] .roster-editor-form-grid .field > span,
[data-theme="dark"] .roster-subsection-head h3,
[data-theme="dark"] .roster-ev-label {
  color: var(--ink);
}

[data-theme="dark"] .roster-slot-copy small,
[data-theme="dark"] .roster-mode-meta,
[data-theme="dark"] .roster-mode-tabs button.active .roster-mode-meta,
[data-theme="dark"] .battle-opponent-add-head p,
[data-theme="dark"] .roster-team-card small,
[data-theme="dark"] .roster-team-detail-copy small,
[data-theme="dark"] .roster-team-detail-fact,
[data-theme="dark"] .roster-team-detail-fact b {
  color: var(--muted);
}

[data-theme="dark"] .roster-team-editor-head {
  background: var(--surface-muted);
  background-color: var(--surface-muted);
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .roster-team-editor-head h2,
[data-theme="dark"] .roster-team-detail-heading h2,
[data-theme="dark"] .roster-team-editor-member-copy strong,
[data-theme="dark"] .roster-team-detail-copy strong,
[data-theme="dark"] .roster-team-detail-fact > span {
  color: var(--ink);
}

[data-theme="dark"] .roster-team-detail-member {
  background:
    linear-gradient(#171b24, #171b24) padding-box,
    linear-gradient(
      to bottom,
      color-mix(in srgb, var(--team-type-top, #8B8F95) 58%, #10131a) 0 50%,
      color-mix(in srgb, var(--team-type-bottom, var(--team-type-top, #8B8F95)) 58%, #10131a) 50% 100%
    ) border-box;
  background-color: var(--surface);
  border-color: transparent;
  color: var(--ink);
}

[data-theme="dark"] .roster-team-detail-member .avatar,
[data-theme="dark"] .roster-team-editor-member .avatar {
  background: rgba(231, 237, 247, 0.06);
  background-color: rgba(231, 237, 247, 0.06);
  border-color: rgba(148, 163, 184, 0.16);
}

[data-theme="dark"] .roster-team-check {
  background: #1b2230;
  background-color: #1b2230;
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .roster-team-member-toggle.selected .roster-team-check,
[data-theme="dark"] .roster-team-editor-member.selected .roster-team-check {
  background: var(--accent);
  background-color: var(--accent);
  border-color: var(--accent);
  color: #10131a;
}

[data-theme="dark"] .roster-team-detail-nature-badge.up {
  background: #183426;
  background-color: #183426;
  border-color: rgba(88, 201, 139, 0.52);
  color: #a8f0c4;
}

[data-theme="dark"] .roster-team-detail-nature-badge.down {
  background: #3a1f24;
  background-color: #3a1f24;
  border-color: rgba(239, 138, 138, 0.52);
  color: #ffc2c2;
}

[data-theme="dark"] .roster-team-detail-move {
  background: #1b2230;
  background-color: #1b2230;
  border-color: var(--line);
  border-left-color: var(--move-accent, #8B8F95);
  color: var(--ink);
}

[data-theme="dark"] .roster-slot-index,
[data-theme="dark"] .move-index {
  background: #2a3240;
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .roster-slot-row.active .roster-slot-index {
  background: var(--accent);
  border-color: var(--accent);
  color: #10131a;
}

[data-theme="dark"] .battle-popular-rank,
[data-theme="dark"] .roster-popular-card .battle-popular-rank {
  background: rgba(116, 172, 245, 0.16);
  border-color: rgba(116, 172, 245, 0.34);
  color: var(--accent-strong);
}

[data-theme="dark"] .roster-popular-card:first-child .battle-popular-rank,
[data-theme="dark"] .battle-popular-opponent-card:first-child .battle-popular-rank {
  background: rgba(231, 185, 91, 0.18);
  border-color: rgba(231, 185, 91, 0.42);
  color: #f4d595;
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-identity,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-subsection {
  background: #171b24;
  background-color: #171b24;
  border-color: var(--team-border);
  color: var(--team-ink);
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-art {
  background: #202633;
  background-color: #202633;
  border-color: var(--team-border);
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-art::after {
  background: rgba(231, 237, 247, 0.12);
  border-color: rgba(231, 237, 247, 0.18);
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-pokemon-actions .compact-danger {
  background: #341d24;
  background-color: #341d24;
  border-color: rgba(239, 138, 138, 0.62);
  color: #ffc9cf;
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-form-grid .selected-item-thumb {
  background: rgba(231, 237, 247, 0.08);
  background-color: rgba(231, 237, 247, 0.08);
  border-color: rgba(231, 237, 247, 0.14);
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-form-grid .search-results,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-move-row .search-results,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .custom-dropdown-menu {
  background: #171b24;
  background-color: #171b24;
  border-color: var(--team-border);
  color: var(--team-ink);
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .type.electric,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .type[data-type="electric"] {
  color: #f6d36e;
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-ev-cell {
  background: #1b2230;
  background-color: #1b2230;
  border-color: var(--team-border);
  color: var(--team-ink);
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-ev-cell.nature-up {
  background: #302b1d;
  background-color: #302b1d;
  border-color: rgba(231, 185, 91, 0.68);
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-ev-cell.nature-down {
  background: #2d2028;
  background-color: #2d2028;
  border-color: rgba(239, 138, 138, 0.52);
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-ev-cell > strong,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-ev-cell small {
  color: var(--team-ink);
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-ev-cell .stat-nature-detail,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-ev-cell > small:last-child {
  color: var(--team-muted);
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-ev-meter {
  background: #101722;
  background-color: #101722;
  border-color: rgba(174, 190, 214, 0.30);
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-ev-meter > span {
  background: #5f9f73;
  background-color: #5f9f73;
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .nature-stat-badge.up {
  background: rgba(88, 201, 139, 0.18);
  color: #a8f0c4;
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .nature-stat-badge.down {
  background: rgba(239, 138, 138, 0.18);
  color: #ffc9cf;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) {
  --battle-frame: #a8b3c7;
  --battle-frame-dark: #e7edf7;
  --battle-line: rgba(148, 163, 184, 0.30);
  --battle-panel: #171b24;
  --battle-muted-panel: #202633;
  --battle-ink: #e7edf7;
  --battle-muted: #b7c2d6;
  background:
    radial-gradient(circle at 20% 0%, rgba(116, 172, 245, 0.10), transparent 28rem),
    var(--bg);
  color: var(--battle-ink);
}

[data-theme="dark"] .battle-context-topbar,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-context-topbar,
[data-theme="dark"] .battle-dashboard-controls .segmented,
[data-theme="dark"] .battle-control-group,
[data-theme="dark"] .battle-dashboard-controls .weather-button,
[data-theme="dark"] .battle-dashboard-controls .battle-reset-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .page-actions .action-button,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard-controls button,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard button,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard input,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard .dropdown-trigger,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard .chip {
  background: #1b2230;
  border-color: var(--battle-line);
  color: var(--battle-ink);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-folder-tab,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .party-chip {
  background: #1b2230;
  border-color: var(--battle-line);
  color: var(--battle-ink);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-folder-tab.active,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .party-chip.active {
  background: rgba(116, 172, 245, 0.18);
  border-color: rgba(116, 172, 245, 0.72);
  color: #e8f4ff;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-folder-tab.active {
  border-bottom-color: transparent;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .party-chip-text strong {
  color: var(--battle-ink);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .party-chip-text span,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-folder-caption {
  color: var(--battle-muted);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-opponent-add-search,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-identity-field,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-detail-grid span {
  background: #171f2c;
  background-color: #171f2c;
  border-color: var(--battle-line);
  color: var(--battle-ink);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-opponent-add-head strong,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-identity-field > span {
  color: var(--battle-ink);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-opponent-add-head small,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-opponent-add-field > span,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-detail-grid small {
  color: var(--battle-muted);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-opponent-add-field input,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-identity-field input,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-identity-field .dropdown-trigger {
  background: #1b2230;
  background-color: #1b2230;
  border-color: rgba(174, 190, 214, 0.34);
  color: var(--battle-ink);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-opponent-add-field input::placeholder,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-identity-field input::placeholder {
  color: rgba(168, 179, 199, 0.82);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-identity-field .selected-item-thumb {
  background: rgba(231, 237, 247, 0.08);
  background-color: rgba(231, 237, 247, 0.08);
  border-color: rgba(231, 237, 247, 0.14);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .page-actions .action-button:hover,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard-controls button:hover,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard button:hover,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard .dropdown-trigger:hover {
  background: rgba(116, 172, 245, 0.12);
  border-color: var(--hover-border);
  color: var(--battle-ink);
}

[data-theme="dark"] .battle-dashboard-controls .segmented button,
[data-theme="dark"] .battle-dashboard-controls .weather-button {
  background: #1b2230;
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .battle-dashboard-controls .segmented button.active,
[data-theme="dark"] .battle-dashboard-controls .segmented button[aria-pressed="true"],
[data-theme="dark"] .battle-dashboard-controls .weather-button.active,
[data-theme="dark"] .battle-dashboard-controls .weather-button[aria-pressed="true"] {
  background: rgba(116, 172, 245, 0.24);
  border-color: rgba(116, 172, 245, 0.72);
  color: #e8f4ff;
}

[data-theme="dark"] .battle-dashboard-controls .battle-reset-button .button-icon {
  background: rgba(116, 172, 245, 0.16);
  color: var(--accent-strong);
}

[data-theme="dark"] .battle-current-stat-toggle,
[data-theme="dark"] .battle-rank-toggle,
[data-theme="dark"] .battle-current-stat-body,
[data-theme="dark"] .battle-status-row,
[data-theme="dark"] .battle-type-override-row,
[data-theme="dark"] .battle-speed-card,
[data-theme="dark"] .battle-full-speed-my,
[data-theme="dark"] .battle-full-speed-opponents,
[data-theme="dark"] .battle-full-speed-chip,
[data-theme="dark"] .battle-full-speed-empty,
[data-theme="dark"] .battle-recent-event-list,
[data-theme="dark"] .battle-current-stat-strip span,
[data-theme="dark"] .battle-current-point-row {
  background: var(--surface-muted);
  border-color: var(--battle-line);
  color: var(--battle-ink);
}

[data-theme="dark"] .battle-current-point-row .battle-current-point-number {
  background: #111722;
  border-color: var(--battle-line);
  color: var(--battle-ink);
}

[data-theme="dark"] .battle-control-label {
  color: var(--muted);
}

[data-theme="dark"] .app-frame .speed-dashboard .chip.warning,
[data-theme="dark"] .app-frame .speed-dashboard .chip.medium {
  background: #3a2c17 !important;
  border-color: rgba(231, 185, 91, 0.52) !important;
  color: #f4d595 !important;
}

[data-theme="dark"] .app-frame .speed-dashboard .chip.danger {
  background: #3a1f24 !important;
  border-color: rgba(239, 138, 138, 0.52) !important;
  color: #ffc2c2 !important;
}

[data-theme="dark"] .app-frame:has(.inquiry-board) {
  --setup-frame: #a8b3c7;
  --setup-frame-dark: #e7edf7;
  --setup-line: rgba(148, 163, 184, 0.34);
  --setup-line-soft: rgba(148, 163, 184, 0.24);
  --setup-panel: #171b24;
  --setup-muted-panel: #202633;
  --setup-ink: #e7edf7;
  --setup-muted: #b7c2d6;
  --setup-gold: #74ACF5;
  --setup-gold-soft: rgba(116, 172, 245, 0.16);
  background:
    radial-gradient(circle at 20% 0%, rgba(116, 172, 245, 0.10), transparent 28rem),
    var(--bg);
  color: var(--setup-ink);
}

[data-theme="dark"] .app-frame:has(.inquiry-board) button,
[data-theme="dark"] .app-frame:has(.inquiry-board) .action-button,
[data-theme="dark"] .app-frame:has(.inquiry-board) .compact-button,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-mail-link {
  background: #1b2230;
  border-color: var(--setup-line);
  color: var(--setup-ink);
}

[data-theme="dark"] .app-frame:has(.inquiry-board) button:hover,
[data-theme="dark"] .app-frame:has(.inquiry-board) .action-button:hover,
[data-theme="dark"] .app-frame:has(.inquiry-board) .compact-button:hover,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-mail-link:hover,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-mail-link:focus-visible {
  background: rgba(116, 172, 245, 0.12);
  border-color: var(--hover-border);
  color: var(--setup-ink);
}

[data-theme="dark"] .app-frame:has(.inquiry-board) button.primary,
[data-theme="dark"] .app-frame:has(.inquiry-board) .action-button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #10131a;
}

[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-intro,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-composer,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-list-panel,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-empty,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-item,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-comment {
  background: var(--setup-panel);
  border-color: var(--setup-line);
  color: var(--setup-ink);
}

[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-comment {
  background: var(--setup-muted-panel);
}

[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-field input,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-field textarea,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-comment-composer textarea {
  background: #111722;
  border-color: var(--setup-line);
  color: var(--setup-ink);
}

[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-intro-copy h2,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-panel-head h2,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-item h3 {
  color: var(--setup-ink);
}

[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-intro-copy p,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-panel-head p,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-field > span,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-item p,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-item-meta span,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-item-meta time,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-comment-meta strong,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-comment-meta time,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-submit-row > span,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-comment-submit-row span {
  color: var(--setup-muted);
}

[data-theme="dark"] .opponent-insight-list,
[data-theme="dark"] .selection-insight-list {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .insight-row,
[data-theme="dark"] .opponent-insight-row {
  background: var(--surface);
  border-bottom-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .insight-icon,
[data-theme="dark"] .opponent-insight-icon,
[data-theme="dark"] .bottom-action-icon {
  background: rgba(116, 172, 245, 0.16);
  color: var(--accent-strong);
}

[data-theme="dark"] .insight-row.high .insight-icon,
[data-theme="dark"] .insight-row.danger .insight-icon {
  background: rgba(239, 138, 138, 0.16);
  color: #ffc2c2;
}

[data-theme="dark"] .insight-row.medium .insight-icon,
[data-theme="dark"] .insight-row.warning .insight-icon {
  background: rgba(231, 185, 91, 0.16);
  color: #f4d595;
}

[data-theme="dark"] .insight-row.active .insight-icon,
[data-theme="dark"] .insight-row.success .insight-icon {
  background: rgba(88, 201, 139, 0.16);
  color: #a8f0c4;
}

[data-theme="dark"] .bottom-action-bar {
  background: rgba(23, 27, 36, 0.96);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.26);
}

[data-theme="dark"] .bottom-action-message {
  color: var(--muted);
}

[data-theme="dark"] .app-frame .status-pill.active,
[data-theme="dark"] .app-frame .status-pill.success,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .status-pill.active,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .status-pill.success,
[data-theme="dark"] .app-frame:has(.opponent-select-screen) .status-pill.active,
[data-theme="dark"] .app-frame:has(.opponent-select-screen) .status-pill.success,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .status-pill.active,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .status-pill.success {
  background: #183426;
  border-color: rgba(88, 201, 139, 0.52);
  color: #a8f0c4;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-status-options button,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .stat-stage-value,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .stat-stage-step {
  background: #1b2230 !important;
  background-color: #1b2230 !important;
  border-color: var(--battle-line) !important;
  color: var(--battle-ink) !important;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-status-options button.active,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-status-options button.active:hover,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-status-options button.active:focus-visible {
  background: var(--accent) !important;
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #10131a !important;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-current-stat-toggle,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-current-stat-toggle.active,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-current-stat-editor.open .battle-current-stat-toggle {
  background: #1b2230 !important;
  background-color: #1b2230 !important;
  border-color: var(--battle-line) !important;
  color: var(--battle-ink) !important;
}

[data-theme="dark"] .setup-floating-tooltip,
[data-theme="dark"] .setup-matchup-help::after,
[data-theme="dark"] .setup-sample-note::after,
[data-theme="dark"] .setup-counter-ko::after,
[data-theme="dark"] .setup-counter-guard::after,
[data-theme="dark"] .setup-counter-speed::after,
[data-theme="dark"] .setup-counter-more::after,
[data-theme="dark"] .battle-damage-help-tooltip {
  background: #111722;
  background-color: #111722;
  border-color: rgba(174, 190, 214, 0.48);
  color: var(--ink);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
}

[data-theme="dark"] .setup-floating-tooltip,
[data-theme="dark"] .setup-floating-tooltip *,
[data-theme="dark"] .battle-damage-help-tooltip,
[data-theme="dark"] .battle-damage-help-tooltip * {
  color: var(--ink);
}

[data-theme="dark"] .setup-matchup-help:hover,
[data-theme="dark"] .setup-matchup-help:focus-visible,
[data-theme="dark"] .setup-sample-note:hover,
[data-theme="dark"] .setup-sample-note:focus-visible,
[data-theme="dark"] .battle-damage-help:hover,
[data-theme="dark"] .battle-damage-help:focus-visible {
  background: rgba(116, 172, 245, 0.14);
  background-color: rgba(116, 172, 245, 0.14);
  border-color: rgba(116, 172, 245, 0.56);
  color: var(--accent-strong);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) button:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .action-button:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .compact-button:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-menu-title:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-team-card:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-opponent-suggestion-card:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-selected-opponent-card:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-card:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .battle-setup-speed-card:focus-visible,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .result-button:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .search-results button:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .dropdown-trigger:hover,
[data-theme="dark"] .app-frame:has(.opponent-select-screen) .opponent-candidate-card:hover,
[data-theme="dark"] .app-frame:has(.opponent-select-screen) .opponent-filter-chip:hover,
[data-theme="dark"] .app-frame:has(.opponent-select-screen) .opponent-suggested-chip:hover,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-slot-main:hover,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-slot-main:focus-visible,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-team-main:hover,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-team-main:focus-visible,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-popular-card:hover,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard-controls button:hover,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard button:hover,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard .dropdown-trigger:hover,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-sidebar-card:hover,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-move-card:hover,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-action-card:hover {
  background: rgba(116, 172, 245, 0.14);
  background-color: rgba(116, 172, 245, 0.14);
  border-color: rgba(116, 172, 245, 0.56);
  color: var(--ink);
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) button.primary:hover,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .action-button.primary:hover,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard button.primary:hover {
  background: #8fc3ff;
  background-color: #8fc3ff;
  border-color: #8fc3ff;
  color: #10131a;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard-controls button.active:not(.weather-button):not([data-field-kind]),
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard-controls button[aria-pressed="true"]:not(.weather-button):not([data-field-kind]) {
  background: rgba(116, 172, 245, 0.22);
  background-color: rgba(116, 172, 245, 0.22);
  border-color: rgba(116, 172, 245, 0.68);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(116, 172, 245, 0.22);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard-controls button.active:hover:not(.weather-button):not([data-field-kind]),
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard-controls button[aria-pressed="true"]:hover:not(.weather-button):not([data-field-kind]) {
  background: rgba(116, 172, 245, 0.30);
  background-color: rgba(116, 172, 245, 0.30);
  border-color: rgba(169, 212, 255, 0.82);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(169, 212, 255, 0.26);
}

[data-theme="dark"] .battle-dashboard-controls .weather-button[data-weather-kind="sand"] {
  --weather-color: #d8b16f;
  --weather-soft: rgba(216, 177, 111, 0.20);
}

[data-theme="dark"] .battle-dashboard-controls .weather-button[data-weather-kind="rain"] {
  --weather-color: #9fc7ff;
  --weather-soft: rgba(94, 149, 218, 0.22);
}

[data-theme="dark"] .battle-dashboard-controls .weather-button[data-weather-kind="snow"],
[data-theme="dark"] .battle-dashboard-controls .weather-button[data-weather-kind="hail"] {
  --weather-color: #a8e6f6;
  --weather-soft: rgba(88, 178, 202, 0.22);
}

[data-theme="dark"] .battle-dashboard-controls .weather-button[data-weather-kind="sun"] {
  --weather-color: #f2c96c;
  --weather-soft: rgba(231, 185, 91, 0.22);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard-controls .segmented.weather-group .weather-button.active,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard-controls .segmented.weather-group .weather-button.active:hover {
  background: var(--weather-soft);
  background-color: var(--weather-soft);
  border-color: color-mix(in srgb, var(--weather-color) 72%, transparent);
  color: var(--weather-color);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--weather-color) 42%, transparent);
}

[data-theme="dark"] .battle-dashboard-controls .field-group button[data-field-kind="grass"] {
  --field-color: #9de0af;
  --field-soft: rgba(83, 178, 111, 0.20);
}

[data-theme="dark"] .battle-dashboard-controls .field-group button[data-field-kind="misty"] {
  --field-color: #d7b4ff;
  --field-soft: rgba(168, 112, 196, 0.22);
}

[data-theme="dark"] .battle-dashboard-controls .field-group button[data-field-kind="psychic"] {
  --field-color: #ffb1c8;
  --field-soft: rgba(211, 92, 132, 0.22);
}

[data-theme="dark"] .battle-dashboard-controls .field-group button[data-field-kind="electric"] {
  --field-color: #f6d36e;
  --field-soft: rgba(231, 185, 91, 0.22);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard-controls .segmented.field-group button.active,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard-controls .segmented.field-group button.active:hover {
  background: var(--field-soft);
  background-color: var(--field-soft);
  border-color: color-mix(in srgb, var(--field-color) 72%, transparent);
  color: var(--field-color);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--field-color) 42%, transparent);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard-controls button:disabled,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard-controls button:disabled:hover {
  background: rgba(32, 38, 51, 0.66);
  background-color: rgba(32, 38, 51, 0.66);
  border-color: rgba(148, 163, 184, 0.18);
  color: rgba(168, 179, 199, 0.62);
  box-shadow: none;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard-controls .battle-reset-button:disabled .button-icon,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard-controls .battle-reset-button:disabled:hover .button-icon {
  background: rgba(148, 163, 184, 0.12);
  color: rgba(168, 179, 199, 0.70);
}

[data-theme="dark"] .legal-nav a[aria-current="page"] {
  background: rgba(116, 172, 245, 0.18);
  border-color: rgba(116, 172, 245, 0.52);
  color: var(--accent-strong);
}

[data-theme="dark"] button:active:not(.primary):not(.active):not(.weather-button):not([data-field-kind]):not(.compact-danger):not(.danger),
[data-theme="dark"] .action-button:active:not(.primary):not(.active):not(.danger),
[data-theme="dark"] .compact-button:active:not(.primary):not(.compact-danger),
[data-theme="dark"] .icon-button:active,
[data-theme="dark"] .dropdown-trigger:active,
[data-theme="dark"] .result-button:active {
  background: rgba(116, 172, 245, 0.18);
  background-color: rgba(116, 172, 245, 0.18);
  border-color: rgba(116, 172, 245, 0.62);
  color: var(--ink);
  box-shadow: none;
}

[data-theme="dark"] button:disabled,
[data-theme="dark"] button:disabled:hover,
[data-theme="dark"] button:disabled:active,
[data-theme="dark"] .action-button:disabled,
[data-theme="dark"] .action-button:disabled:hover,
[data-theme="dark"] .action-button:disabled:active,
[data-theme="dark"] .compact-button:disabled,
[data-theme="dark"] .compact-button:disabled:hover,
[data-theme="dark"] .compact-button:disabled:active,
[data-theme="dark"] .icon-button:disabled,
[data-theme="dark"] .icon-button:disabled:hover,
[data-theme="dark"] .icon-button:disabled:active,
[data-theme="dark"] .dropdown-trigger:disabled,
[data-theme="dark"] .dropdown-trigger:disabled:hover,
[data-theme="dark"] .dropdown-trigger:disabled:active {
  background: rgba(32, 38, 51, 0.66);
  background-color: rgba(32, 38, 51, 0.66);
  border-color: rgba(148, 163, 184, 0.18);
  color: rgba(168, 179, 199, 0.66);
  box-shadow: none;
  opacity: 1;
}

[data-theme="dark"] button.compact-danger:hover,
[data-theme="dark"] button.compact-danger:active,
[data-theme="dark"] .compact-danger:hover,
[data-theme="dark"] .compact-danger:active,
[data-theme="dark"] button.danger:hover,
[data-theme="dark"] button.danger:active,
[data-theme="dark"] .action-button.danger:hover,
[data-theme="dark"] .action-button.danger:active {
  background: rgba(239, 138, 138, 0.20);
  background-color: rgba(239, 138, 138, 0.20);
  border-color: rgba(239, 138, 138, 0.62);
  color: #ffd1d6;
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-pokemon-actions button,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-pokemon-actions .compact-button {
  background: #1b2230;
  background-color: #1b2230;
  border-color: var(--team-border);
  color: var(--team-ink);
  box-shadow: none;
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-pokemon-actions button:hover,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-pokemon-actions button:active,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-pokemon-actions .compact-button:hover,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-pokemon-actions .compact-button:active {
  background: rgba(116, 172, 245, 0.14);
  background-color: rgba(116, 172, 245, 0.14);
  border-color: rgba(116, 172, 245, 0.58);
  color: var(--team-ink);
  box-shadow: none;
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-pokemon-actions button:disabled,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-pokemon-actions button:disabled:hover,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-pokemon-actions button:disabled:active,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-pokemon-actions .compact-button:disabled,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-pokemon-actions .compact-button:disabled:hover,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-pokemon-actions .compact-button:disabled:active {
  background: rgba(32, 38, 51, 0.72);
  background-color: rgba(32, 38, 51, 0.72);
  border-color: rgba(148, 163, 184, 0.22);
  color: rgba(168, 179, 199, 0.68);
  box-shadow: none;
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-pokemon-actions .compact-danger,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-pokemon-actions .compact-danger:hover,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-editor-pokemon-actions .compact-danger:active {
  background: #341d24;
  background-color: #341d24;
  border-color: rgba(239, 138, 138, 0.62);
  color: #ffc9cf;
  box-shadow: none;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-move-card {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--move-card-bg) 88%, #10131a) 0%,
      color-mix(in srgb, var(--move-card-bg) 66%, #171b24) 100%
    );
  background-color: var(--move-card-bg);
  border-color: color-mix(in srgb, var(--move-card-border) 78%, var(--battle-line));
  color: var(--battle-ink);
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--move-card-border) 82%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--move-card-border) 20%, transparent);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-move-card:hover,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-move-card.active,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-move-card.previewing {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--move-card-bg) 94%, #10131a) 0%,
      color-mix(in srgb, var(--move-card-bg) 72%, #202633) 100%
    );
  background-color: var(--move-card-bg);
  border-color: color-mix(in srgb, var(--move-card-border) 92%, #e7edf7);
  color: var(--battle-ink);
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--move-card-border) 96%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--move-card-border) 32%, transparent);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-move-card-head > span:first-child {
  background: color-mix(in srgb, var(--move-card-bg) 70%, #e7edf7);
  border-color: color-mix(in srgb, var(--move-card-border) 72%, #e7edf7);
  color: var(--move-card-ink);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-move-card.active .battle-move-card-head > span:first-child,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-move-card.previewing .battle-move-card-head > span:first-child {
  background: var(--move-card-ink);
  border-color: color-mix(in srgb, var(--move-card-border) 88%, #e7edf7);
  color: #10131a;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-move-card-head .move-pp-badge,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-move-card-head .rage-fist-badge,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-move-stat-apply,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-move-rage-fist-step,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-move-field-apply {
  background: color-mix(in srgb, var(--move-card-bg) 72%, #10131a);
  background-color: color-mix(in srgb, var(--move-card-bg) 72%, #10131a);
  border-color: color-mix(in srgb, var(--move-card-border) 64%, var(--battle-line));
  color: var(--move-card-ink);
}

[data-theme="dark"] .battle-damage-help,
[data-theme="dark"] .battle-current-setting-help {
  background: #1b2230;
  background-color: #1b2230;
  border-color: var(--battle-line, var(--line));
  color: var(--accent-strong);
}

[data-theme="dark"] .battle-damage-help:hover,
[data-theme="dark"] .battle-damage-help:focus-visible,
[data-theme="dark"] .battle-current-setting-help:hover,
[data-theme="dark"] .battle-current-setting-help:focus-visible {
  background: rgba(116, 172, 245, 0.14);
  background-color: rgba(116, 172, 245, 0.14);
  border-color: rgba(116, 172, 245, 0.56);
  color: var(--accent-strong);
}

[data-theme="dark"] .battle-speed-relation,
[data-theme="dark"] .battle-dashboard-opponent-sidebar .battle-speed-relation {
  background: #1b2230;
  background-color: #1b2230;
  border-color: var(--battle-line, var(--line));
  color: var(--battle-muted, var(--muted));
}

[data-theme="dark"] .battle-speed-relation.faster,
[data-theme="dark"] .battle-dashboard-opponent-sidebar .battle-speed-relation.faster {
  background: #3a1f24;
  background-color: #3a1f24;
  border-color: rgba(239, 138, 138, 0.52);
  color: #ffc2c2;
}

[data-theme="dark"] .battle-speed-relation.slower,
[data-theme="dark"] .battle-dashboard-opponent-sidebar .battle-speed-relation.slower {
  background: #183426;
  background-color: #183426;
  border-color: rgba(88, 201, 139, 0.52);
  color: #a8f0c4;
}

[data-theme="dark"] .battle-speed-relation.tie,
[data-theme="dark"] .battle-dashboard-opponent-sidebar .battle-speed-relation.tie {
  background: #302b1d;
  background-color: #302b1d;
  border-color: rgba(231, 185, 91, 0.52);
  color: #f4d595;
}

[data-theme="dark"] .battle-speed-relation.loading,
[data-theme="dark"] .battle-speed-relation.empty,
[data-theme="dark"] .battle-dashboard-opponent-sidebar .battle-speed-relation.loading,
[data-theme="dark"] .battle-dashboard-opponent-sidebar .battle-speed-relation.empty {
  background: #202633;
  background-color: #202633;
  border-color: var(--battle-line, var(--line));
  color: var(--battle-muted, var(--muted));
}

[data-theme="dark"] .speed-matrix-panel,
[data-theme="dark"] .speed-matrix-wrap {
  background: var(--surface);
  background-color: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .speed-matrix {
  background: var(--surface);
  background-color: var(--surface);
  color: var(--ink);
}

[data-theme="dark"] .speed-matrix th,
[data-theme="dark"] .speed-matrix td {
  border-color: var(--line);
}

[data-theme="dark"] .speed-matrix th {
  background: #202633;
  background-color: #202633;
  color: var(--ink);
}

[data-theme="dark"] .speed-matrix th.active-axis {
  background: rgba(116, 172, 245, 0.16);
  background-color: rgba(116, 172, 245, 0.16);
  color: var(--accent-strong);
}

[data-theme="dark"] .speed-matrix th span {
  color: var(--muted);
}

[data-theme="dark"] .speed-matrix td {
  background: #171b24;
  background-color: #171b24;
  color: var(--muted);
}

[data-theme="dark"] .speed-matrix td.mine {
  background: #183426;
  background-color: #183426;
  color: #a8f0c4;
}

[data-theme="dark"] .speed-matrix td.opponent {
  background: #3a1f24;
  background-color: #3a1f24;
  color: #ffc2c2;
}

[data-theme="dark"] .speed-matrix td.tie {
  background: #302b1d;
  background-color: #302b1d;
  color: #f4d595;
}

[data-theme="dark"] .speed-matrix td.selected-cell {
  box-shadow: inset 0 0 0 2px var(--accent);
}

[data-theme="dark"] .opponent-selected-check {
  background: var(--accent);
  background-color: var(--accent);
  color: #10131a;
}

[data-theme="dark"] .battle-compact-speed-mini-card {
  background: var(--battle-panel, var(--surface));
  background-color: var(--battle-panel, var(--surface));
  border-color: var(--battle-frame, var(--line));
  color: var(--battle-ink, var(--ink));
}

[data-theme="dark"] .battle-compact-speed-mini-card:hover,
[data-theme="dark"] .battle-compact-speed-mini-card:focus {
  background: rgba(116, 172, 245, 0.14);
  background-color: rgba(116, 172, 245, 0.14);
  border-color: rgba(116, 172, 245, 0.56);
  color: var(--battle-ink, var(--ink));
}

[data-theme="dark"] .battle-compact-speed-mini-card strong,
[data-theme="dark"] .battle-compact-speed-mini-card b {
  color: var(--battle-ink, var(--ink));
}

[data-theme="dark"] .battle-compact-speed-mini-card b {
  background: #1b2230;
  background-color: #1b2230;
  border-color: var(--battle-line, var(--line));
  color: var(--battle-muted, var(--muted));
}

[data-theme="dark"] .battle-compact-speed-mini-card.opponent b,
[data-theme="dark"] .battle-compact-speed-mini-card.warning b {
  background: #3a1f24;
  background-color: #3a1f24;
  border-color: rgba(239, 138, 138, 0.52);
  color: #ffc2c2;
}

[data-theme="dark"] .battle-compact-speed-mini-card.mine b {
  background: #183426;
  background-color: #183426;
  border-color: rgba(88, 201, 139, 0.52);
  color: #a8f0c4;
}

[data-theme="dark"] .battle-compact-speed-mini-card.tie b {
  background: #302b1d;
  background-color: #302b1d;
  border-color: rgba(231, 185, 91, 0.52);
  color: #f4d595;
}

[data-theme="dark"] .battle-compact-speed-mini-card small {
  color: var(--battle-muted, var(--muted));
}

[data-theme="dark"] .battle-compact-hp-card {
  background: #1b2230;
  background-color: #1b2230;
  border-color: var(--battle-line, var(--line));
  color: var(--battle-ink, var(--ink));
}

[data-theme="dark"] .battle-compact-hp-card > span {
  color: var(--battle-muted, var(--muted));
}

[data-theme="dark"] .battle-compact-hp-card > strong {
  color: var(--battle-ink, var(--ink));
}

[data-theme="dark"] ::selection {
  background: rgba(116, 172, 245, 0.34);
  color: var(--ink);
}

/* Keep text-entry controls readable when screen-specific light styles win specificity. */
[data-theme="dark"] input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #111722 !important;
  background-color: #111722 !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
  caret-color: var(--accent);
  color-scheme: dark;
}

[data-theme="dark"] input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):focus,
[data-theme="dark"] input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):focus-visible,
[data-theme="dark"] select:focus,
[data-theme="dark"] select:focus-visible,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] textarea:focus-visible {
  background: #111722 !important;
  background-color: #111722 !important;
  color: var(--ink) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #91a0b8 !important;
  opacity: 1;
}

[data-theme="dark"] input:disabled,
[data-theme="dark"] select:disabled,
[data-theme="dark"] textarea:disabled {
  background: #202633 !important;
  background-color: #202633 !important;
  color: #a8b3c7 !important;
  opacity: 1;
}

[data-theme="dark"] select option {
  background: #111722;
  color: var(--ink);
}

[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus,
[data-theme="dark"] textarea:-webkit-autofill,
[data-theme="dark"] textarea:-webkit-autofill:hover,
[data-theme="dark"] textarea:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink) !important;
  box-shadow: 0 0 0 1000px #111722 inset !important;
  caret-color: var(--accent);
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] .app-frame:has(.roster-editor-screen) select,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) textarea,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-move-row input:not([type="range"]),
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-move-row input:not([type="range"]):focus,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-ev-stepper input,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .team-parser-field input,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .team-parser-stat-field input,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .team-parser-json-view textarea {
  background: #111722 !important;
  background-color: #111722 !important;
  border-color: var(--team-border) !important;
  color: var(--team-ink) !important;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] .app-frame:has(.battle-setup-overview) select,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) textarea {
  background: #111722 !important;
  background-color: #111722 !important;
  border-color: var(--setup-line) !important;
  color: var(--setup-ink) !important;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard select,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-dashboard textarea,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-opponent-add-field input,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-identity-field input {
  background: #111722 !important;
  background-color: #111722 !important;
  border-color: var(--battle-line) !important;
  color: var(--battle-ink) !important;
}

[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-field input,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-field textarea,
[data-theme="dark"] .app-frame:has(.inquiry-board) .inquiry-comment-composer textarea {
  background: #111722 !important;
  background-color: #111722 !important;
  border-color: var(--setup-line) !important;
  color: var(--setup-ink) !important;
}

[data-theme="dark"] .team-parser-upload,
[data-theme="dark"] input[type="file"]::file-selector-button,
[data-theme="dark"] input[type="file"]::-webkit-file-upload-button {
  background: #1b2230 !important;
  background-color: #1b2230 !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .team-parser-upload {
  border-color: var(--team-border) !important;
  color: var(--team-ink) !important;
}

[data-theme="dark"] .team-parser-upload:hover,
[data-theme="dark"] input[type="file"]::file-selector-button:hover,
[data-theme="dark"] input[type="file"]::-webkit-file-upload-button:hover {
  background: rgba(116, 172, 245, 0.14) !important;
  background-color: rgba(116, 172, 245, 0.14) !important;
  border-color: rgba(116, 172, 245, 0.56) !important;
  color: var(--ink) !important;
}

/* Surface audit overrides: keep legacy and nested cards from inheriting light-mode fills. */
[data-theme="dark"] .slot,
[data-theme="dark"] .popular-pokemon-button,
[data-theme="dark"] .opponent-slot-card {
  background: var(--surface-muted);
  background-color: var(--surface-muted);
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .slot.active,
[data-theme="dark"] .slot.selected,
[data-theme="dark"] .opponent-slot-card.active {
  background: rgba(116, 172, 245, 0.16);
  background-color: rgba(116, 172, 245, 0.16);
  border-color: rgba(116, 172, 245, 0.52);
  color: var(--ink);
}

[data-theme="dark"] .slot.empty-slot,
[data-theme="dark"] .opponent-slot-card.empty {
  background: #171f2c;
  background-color: #171f2c;
  border-color: var(--line);
  color: var(--muted);
}

[data-theme="dark"] .slot strong,
[data-theme="dark"] .opponent-slot-card strong,
[data-theme="dark"] .popular-pokemon-button strong {
  color: var(--ink);
}

[data-theme="dark"] .slot .muted,
[data-theme="dark"] .opponent-slot-card small {
  color: var(--muted);
}

[data-theme="dark"] .opponent-slot-card.active .opponent-slot-number {
  background: var(--accent);
  border-color: var(--accent);
  color: #10131a;
}

[data-theme="dark"] .roster-status,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .team-parser-slot-card,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .team-parser-form-choice,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .team-image-review-stepper button,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .team-image-review-status,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-ev-quick-actions button {
  background: #1b2230;
  background-color: #1b2230;
  border-color: var(--team-border, var(--line));
  color: var(--team-ink, var(--ink));
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .team-parser-form-choice.active,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .team-parser-form-choice[aria-pressed="true"],
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .team-image-review-stepper button.active {
  background: rgba(116, 172, 245, 0.18);
  background-color: rgba(116, 172, 245, 0.18);
  border-color: rgba(116, 172, 245, 0.62);
  color: var(--team-ink, var(--ink));
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .team-image-review-stepper button.saved {
  background: #183426;
  background-color: #183426;
  border-color: rgba(88, 201, 139, 0.52);
  color: #a8f0c4;
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .team-image-review-stepper button.ignored,
[data-theme="dark"] .app-frame:has(.roster-editor-screen) .team-parser-error {
  background: #3a1f24;
  background-color: #3a1f24;
  border-color: rgba(239, 138, 138, 0.52);
  color: #ffc2c2;
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .team-parser-warning-list {
  background: #3a2c17;
  background-color: #3a2c17;
  border-color: rgba(231, 185, 91, 0.52);
  color: #f4d595;
}

[data-theme="dark"] .app-frame:has(.roster-editor-screen) .roster-hp-bar {
  background: #101722;
  background-color: #101722;
  border-color: var(--team-border, var(--line));
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-card-foot small,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-remove-mark,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-speed-my,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-speed-opponents,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-step-toggle,
[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-saved-team-strip,
[data-theme="dark"] .app-frame:has(.opponent-select-screen) .opponent-candidate-tags small,
[data-theme="dark"] .selection-explanation-card,
[data-theme="dark"] .selection-matchup-row,
[data-theme="dark"] .selection-recommendation-option,
[data-theme="dark"] .selection-team-member,
[data-theme="dark"] .selection-pick,
[data-theme="dark"] .selection-plan-row,
[data-theme="dark"] .selection-risk-row,
[data-theme="dark"] .selection-scenario-row,
[data-theme="dark"] .selection-scenario-ref {
  background: #1b2230;
  background-color: #1b2230;
  border-color: var(--setup-line, var(--line));
  color: var(--setup-ink, var(--ink));
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-speed-warning {
  background: #3a1f24;
  background-color: #3a1f24;
  border-color: rgba(239, 138, 138, 0.52);
  color: #ffc2c2;
}

[data-theme="dark"] .app-frame:has(.battle-setup-overview) .setup-speed-opponents.is-tie,
[data-theme="dark"] .selection-pick.lead,
[data-theme="dark"] .selection-scenario-pick.lead {
  background: rgba(116, 172, 245, 0.16);
  background-color: rgba(116, 172, 245, 0.16);
  border-color: rgba(116, 172, 245, 0.52);
  color: var(--setup-ink, var(--ink));
}

[data-theme="dark"] .selection-explanation-card p,
[data-theme="dark"] .selection-team-member .muted,
[data-theme="dark"] .selection-risk-row span,
[data-theme="dark"] .selection-scenario-ref span {
  color: var(--setup-muted, var(--muted));
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-folder-index,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .bench-damage-badge,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .switch-candidate-card,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-action-reasons small,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-settings-toggle,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-settings-panel,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .turn-speed-panel,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .damage-summary-card,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .revenge-candidate-card,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .move-decision-callout,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .switch-in-candidate-card,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .move-button:not(.battle-move-card),
[data-theme="dark"] .app-frame:has(.battle-dashboard) .my-move-button:not(.battle-move-card),
[data-theme="dark"] .pokemon-stage {
  background: #1b2230;
  background-color: #1b2230;
  border-color: var(--battle-line, var(--line));
  color: var(--battle-ink, var(--ink));
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .bench-damage-badge,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .switch-candidate-card.danger,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .switch-candidate-meta small.risk {
  background: #3a1f24;
  background-color: #3a1f24;
  border-color: rgba(239, 138, 138, 0.52);
  color: #ffc2c2;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .switch-candidate-card.recommended,
[data-theme="dark"] .app-frame:has(.battle-dashboard) .my-move-button.active:not(.battle-move-card),
[data-theme="dark"] .app-frame:has(.battle-dashboard) .move-button.active:not(.battle-move-card) {
  background: rgba(116, 172, 245, 0.16);
  background-color: rgba(116, 172, 245, 0.16);
  border-color: rgba(116, 172, 245, 0.52);
  color: var(--battle-ink, var(--ink));
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-action-title-row em.safe {
  background: #183426;
  background-color: #183426;
  border-color: rgba(88, 201, 139, 0.52);
  color: #a8f0c4;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-action-title-row em.read {
  background: rgba(116, 172, 245, 0.16);
  background-color: rgba(116, 172, 245, 0.16);
  border-color: rgba(116, 172, 245, 0.52);
  color: #dbeafe;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-action-title-row em.long {
  background: #3a2c17;
  background-color: #3a2c17;
  border-color: rgba(231, 185, 91, 0.52);
  color: #f4d595;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .battle-action-title-row em.risk {
  background: #3a1f24;
  background-color: #3a1f24;
  border-color: rgba(239, 138, 138, 0.52);
  color: #ffc2c2;
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .mega-button {
  background: linear-gradient(135deg, rgba(242, 99, 178, 0.18), rgba(28, 189, 212, 0.16)), #1b2230;
  background-color: #1b2230;
  border-color: rgba(116, 172, 245, 0.46);
  color: var(--battle-ink, var(--ink));
  box-shadow: inset 0 1px 0 rgba(231, 237, 247, 0.08);
}

[data-theme="dark"] .app-frame:has(.battle-dashboard) .mega-button-icon {
  box-shadow: 0 0 0 1px rgba(231, 237, 247, 0.14), 0 1px 5px rgba(0, 0, 0, 0.34);
}

[data-theme="dark"] .speed-dashboard .speed-formula-current,
[data-theme="dark"] .speed-dashboard .speed-mode-card,
[data-theme="dark"] .speed-dashboard .speed-row,
[data-theme="dark"] .speed-dashboard .speed-duel-notes > div {
  background: #1b2230;
  background-color: #1b2230;
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .speed-dashboard .speed-metric.is-primary {
  background: rgba(116, 172, 245, 0.16);
  background-color: rgba(116, 172, 245, 0.16);
  border-color: rgba(116, 172, 245, 0.52);
  color: var(--ink);
}
