/* Unified semantic theme contract — 2026-10-02
 * Keep this final in the cascade. Feature modules should consume these tokens
 * instead of introducing light-only or dark-only literal surface colors.
 */
:root,
html[data-theme="light"] {
  color-scheme: light;
  --theme-canvas: #f3f7fb;
  --theme-canvas-muted: #eaf1f6;
  --theme-surface: #ffffff;
  --theme-surface-subtle: #f7fafc;
  --theme-surface-raised: #ffffff;
  --theme-surface-hover: #edf6f7;
  --theme-overlay: rgba(15, 23, 42, 0.48);
  --theme-text: #172235;
  --theme-text-strong: #0f1b2d;
  --theme-text-muted: #596d80;
  --theme-text-faint: #72869a;
  --theme-border: #d1dde7;
  --theme-border-strong: #b9c9d6;
  --theme-accent: #0f766e;
  --theme-accent-hover: #0b625c;
  --theme-accent-soft: #e7f6f3;
  --theme-link: #235eb8;
  --theme-focus: rgba(13, 148, 136, 0.2);
  --theme-success: #166534;
  --theme-success-soft: #eaf8ef;
  --theme-success-border: #abd9bc;
  --theme-warning: #7a4b00;
  --theme-warning-soft: #fff7df;
  --theme-warning-border: #e7c36e;
  --theme-danger: #a42626;
  --theme-danger-soft: #fff0f0;
  --theme-danger-border: #e1aaaa;
  --theme-info: #215a9b;
  --theme-info-soft: #ebf3ff;
  --theme-info-border: #b6caea;
  --theme-solid-action: #0f766e;
  --theme-solid-action-hover: #0b625c;
  --theme-solid-action-text: #ffffff;
  --theme-on-dark: #f2f7fb;
  --theme-on-dark-muted: #b5c5d2;
  --theme-documentation-panel: linear-gradient(145deg, #edf7f8, #f9fbfd);
  --theme-documentation-card: rgba(255, 255, 255, 0.9);
  --theme-documentation-card-hover: #ffffff;
  --theme-documentation-boundary: linear-gradient(100deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0.78));
  --theme-documentation-title: #0a2238;
  --theme-documentation-copy: #415f73;
  --theme-documentation-label: #0f766e;
  --theme-documentation-border: #b8d3d8;
  --theme-documentation-border-strong: #75aaa5;
  --theme-documentation-grid: rgba(15, 118, 110, 0.055);
  --theme-shadow: 0 12px 30px rgba(32, 55, 78, 0.08);
}

html[data-theme="dark"] {
  --theme-canvas: #08131f;
  --theme-canvas-muted: #0a1825;
  --theme-surface: #101f2e;
  --theme-surface-subtle: #0c1926;
  --theme-surface-raised: #142536;
  --theme-surface-hover: #183044;
  --theme-overlay: rgba(0, 6, 13, 0.78);
  --theme-text: #dce7f1;
  --theme-text-strong: #f2f7fb;
  --theme-text-muted: #a7b7c6;
  --theme-text-faint: #8296a8;
  --theme-border: #30465a;
  --theme-border-strong: #436078;
  --theme-accent: #67e8d5;
  --theme-accent-hover: #99f6e4;
  --theme-accent-soft: #123634;
  --theme-link: #8db8ff;
  --theme-focus: rgba(94, 234, 212, 0.22);
  --theme-success: #a7f3c0;
  --theme-success-soft: #123725;
  --theme-success-border: #2d6648;
  --theme-warning: #fde68a;
  --theme-warning-soft: #3a2b12;
  --theme-warning-border: #745a24;
  --theme-danger: #ffb4ae;
  --theme-danger-soft: #3c2025;
  --theme-danger-border: #784047;
  --theme-info: #b7d3ff;
  --theme-info-soft: #172e50;
  --theme-info-border: #365985;
  --theme-solid-action: #0f766e;
  --theme-solid-action-hover: #0b625c;
  --theme-solid-action-text: #ffffff;
  --theme-on-dark: #f2f7fb;
  --theme-on-dark-muted: #b5c5d2;
  --theme-documentation-panel: linear-gradient(145deg, #0a2130, #061521);
  --theme-documentation-card: rgba(11, 34, 50, 0.9);
  --theme-documentation-card-hover: #102b3e;
  --theme-documentation-boundary: linear-gradient(100deg, rgba(250, 204, 21, 0.1), rgba(15, 35, 50, 0.78));
  --theme-documentation-title: #f8fbff;
  --theme-documentation-copy: #c4d5e0;
  --theme-documentation-label: #72ead7;
  --theme-documentation-border: #2d5263;
  --theme-documentation-border-strong: #4b807d;
  --theme-documentation-grid: rgba(122, 232, 217, 0.04);
  --theme-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

/* The landing footer remains an intentionally dark brand surface in both modes. */
html[data-theme] {
  --theme-footer-title: #f7fbff;
  --theme-footer-copy: #bccdd8;
  --theme-footer-muted: #96acb9;
  --theme-footer-link: #b6c9d4;
  --theme-footer-border: #2c4a5c;
  --theme-footer-control: #102838;
  --theme-footer-control-hover: #123d3a;
  --theme-footer-accent: #72ead7;
}

html[data-theme] body:not(.landing-active),
html[data-theme] body:not(.landing-active) .shell,
html[data-theme] body:not(.landing-active) .main {
  color: var(--theme-text);
}

html[data-theme="dark"] body:not(.landing-active),
html[data-theme="dark"] body:not(.landing-active) .shell {
  background: var(--theme-canvas);
}

html[data-theme] body:not(.landing-active) .main :is(h1, h2, h3, h4, h5, h6, strong),
html[data-theme] .auth-dialog :is(h1, h2, h3, h4, strong) {
  color: var(--theme-text-strong);
}

html[data-theme] body:not(.landing-active) .main :is(p, small, .muted, .helper-text, .form-help),
html[data-theme] .auth-dialog :is(p, small, .muted, .helper-text, .form-help) {
  color: var(--theme-text-muted);
}

/* Shared surfaces: all current modules and future cards inherit the same depth. */
html[data-theme] body:not(.landing-active) :is(
  .panel, .dashboard-card, .detail-card, .metric-card, .profile-card,
  .billing-current-card, .billing-plan-card, .conversation-sidebar, .chat-main-panel,
  .chat-composer, .knowledge-hero, .knowledge-panel, .knowledge-document-card,
  .knowledge-query-card, .upload-intake-panel, .upload-recent-panel, .upload-file-card,
  .log-glass-panel, .log-analysis-history-item, .intel-workspace-header,
  .intel-workspace-nav, .intel-workspace-card, .intel-history-panel,
  .incident-card, .incident-create-panel, .incident-composer, .incident-facts-panel,
  .incident-check-card, .incident-action-card, .incident-recommendation-card,
  .incident-resolution-card, .incident-report-panel, .administration-summary-card,
  .admin-metric-card, .admin-detail-card, .admin-user-card, .admin-user-drawer
) {
  border-color: var(--theme-border);
  background-color: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] :is(.auth-modal, .modal-backdrop, .dialog-backdrop) {
  background-color: var(--theme-overlay);
}

html[data-theme] :is(.auth-dialog, .knowledge-dialog, [role="dialog"]) {
  border-color: var(--theme-border);
  color: var(--theme-text);
}

html[data-theme="dark"] :is(.auth-dialog, .knowledge-dialog, [role="dialog"]) {
  background-color: var(--theme-surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.52);
}

/* Forms remain calm and readable; native dropdowns follow the selected scheme. */
html[data-theme] body:not(.landing-active) :is(input, textarea, select),
html[data-theme] .auth-dialog :is(input, textarea, select) {
  border-color: var(--theme-border);
  background-color: var(--theme-surface-subtle);
  color: var(--theme-text);
  caret-color: var(--theme-accent);
}

html[data-theme] body:not(.landing-active) :is(input, textarea)::placeholder,
html[data-theme] .auth-dialog :is(input, textarea)::placeholder {
  color: var(--theme-text-faint);
  opacity: 1;
}

html[data-theme] body:not(.landing-active) :is(input, textarea, select):focus,
html[data-theme] .auth-dialog :is(input, textarea, select):focus {
  border-color: var(--theme-accent);
  outline: 0;
  box-shadow: 0 0 0 3px var(--theme-focus);
}

html[data-theme] a:not(.primary):not(.landing-button) {
  text-decoration-color: color-mix(in srgb, var(--theme-link) 42%, transparent);
}

html[data-theme] body:not(.landing-active) a:not(.nav-button),
html[data-theme] .auth-dialog a {
  color: var(--theme-link);
}

/* Buttons and hover states use surface elevation, never pure black/white flashes. */
html[data-theme] body:not(.landing-active) :is(
  .secondary, .icon-button, .table-action, .conversation-action, .conversation-menu-button,
  .dashboard-menu-button, .dashboard-top-pill, .new-chat-button, .prompt-chip,
  .admin-shell-nav button, .admin-shell-footer button
) {
  border-color: var(--theme-border);
  background-color: var(--theme-surface-raised);
  color: var(--theme-text);
}

html[data-theme] body:not(.landing-active) :is(
  .secondary, .icon-button, .table-action, .conversation-action, .conversation-menu-button,
  .dashboard-menu-button, .dashboard-top-pill, .new-chat-button, .prompt-chip,
  .admin-shell-nav button, .admin-shell-footer button
):hover,
html[data-theme] body:not(.landing-active) :is(
  .secondary, .icon-button, .table-action, .conversation-action, .conversation-menu-button,
  .dashboard-menu-button, .dashboard-top-pill, .new-chat-button, .prompt-chip,
  .admin-shell-nav button, .admin-shell-footer button
):focus-visible {
  border-color: var(--theme-border-strong);
  background-color: var(--theme-surface-hover);
  color: var(--theme-text-strong);
}

/* Tables: distinct headers, quiet row separators, and comfortable hover contrast. */
html[data-theme] body:not(.landing-active) :is(table, .administration-table, .intel-bulk-table) {
  color: var(--theme-text);
}

html[data-theme] body:not(.landing-active) :is(th, .administration-table th, .intel-bulk-table th) {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text-muted);
}

html[data-theme] body:not(.landing-active) :is(td, .administration-table td, .intel-bulk-table td) {
  border-color: var(--theme-border);
  color: var(--theme-text);
}

html[data-theme] body:not(.landing-active) :is(tr:hover td, .administration-table tr:hover td) {
  background: var(--theme-surface-hover);
}

/* Semantic alerts/statuses share accessible foreground, fill, and border tokens. */
html[data-theme] :is(.success, .status.success, .badge.success, .upload-toast.success,
  .upload-file-security-clean, .selected-file-summary.has-file) {
  border-color: var(--theme-success-border);
  background-color: var(--theme-success-soft);
  color: var(--theme-success);
}

html[data-theme] :is(.warning, .status.warning, .badge.warning, .upload-security-note,
  .upload-security-note-pending, .upload-file-security-pending) {
  border-color: var(--theme-warning-border);
  background-color: var(--theme-warning-soft);
  color: var(--theme-warning);
}

html[data-theme] :is(.error, .danger, .status.error, .badge.error, .upload-toast.error,
  .upload-security-note-warning, .upload-file-security-attention) {
  border-color: var(--theme-danger-border);
  background-color: var(--theme-danger-soft);
  color: var(--theme-danger);
}

html[data-theme] :is(.info, .status.info, .badge.info, .badge.neutral,
  .dashboard-status-chip, .knowledge-status-chip) {
  border-color: var(--theme-info-border);
  background-color: var(--theme-info-soft);
  color: var(--theme-info);
}

html[data-theme] :focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: 2px;
}

html[data-theme="dark"] {
  scrollbar-color: var(--theme-border-strong) var(--theme-canvas-muted);
}

html[data-theme="dark"] ::selection {
  background: rgba(94, 234, 212, 0.28);
  color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme] *,
  html[data-theme] *::before,
  html[data-theme] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* Recent activity: keep titles, metadata, and time badges readable even if
 * JavaScript is delayed or unavailable during the first paint. */
.dashboard-activity-item {
  border-color: var(--theme-warning-border, #e7c36e);
  background: var(--theme-surface-subtle, #f7fafc);
  color: var(--theme-text, #172235);
  box-shadow: inset 3px 0 0 var(--theme-warning-border, #e7c36e);
}

.dashboard-activity-item strong {
  color: var(--theme-warning, #7a4b00);
}

.dashboard-activity-item small {
  color: var(--theme-text-muted, #596d80);
}

.dashboard-activity-item em {
  border: 1px solid var(--theme-warning-border, #e7c36e);
  background: var(--theme-warning-soft, #fff7df);
  color: var(--theme-warning, #7a4b00);
  opacity: 1;
}


/* Knowledge Base refinement: calmer cards, consistent chips, accessible hierarchy. */
html[data-theme] #knowledge-view .knowledge-toolbar {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
  box-shadow: none;
}

html[data-theme] #knowledge-view .knowledge-toolbar :is(input, select) {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text);
  box-shadow: none;
}

html[data-theme] #knowledge-view .knowledge-toolbar label > span {
  color: var(--theme-text-muted);
}

html[data-theme] #knowledge-view .knowledge-document-card {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] #knowledge-view .knowledge-document-card::before {
  height: 3px;
  opacity: 0.78;
}

html[data-theme] #knowledge-view .knowledge-document-card:hover {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-raised);
  box-shadow: var(--theme-shadow);
  transform: translateY(-1px);
}

html[data-theme] #knowledge-view .knowledge-card-title-row h3 {
  color: var(--theme-text-strong);
}

html[data-theme] #knowledge-view :is(.knowledge-card-title-row p, .knowledge-card-summary) {
  color: var(--theme-text-muted);
}

html[data-theme] #knowledge-view :is(.knowledge-card-file-meta span, .knowledge-type-chip, .knowledge-collection-chip) {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text-muted);
  box-shadow: none;
}

html[data-theme] #knowledge-view :is(.knowledge-card-topics span, .knowledge-detail-topics span) {
  border-color: var(--theme-info-border);
  background: var(--theme-info-soft);
  color: var(--theme-info);
  box-shadow: none;
}

html[data-theme] #knowledge-view .knowledge-card-meta span {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text-faint);
}

html[data-theme] #knowledge-view .knowledge-status-chip.success {
  border-color: var(--theme-success-border);
  background: var(--theme-success-soft);
  color: var(--theme-success);
  box-shadow: none;
}

html[data-theme] #knowledge-view .knowledge-card-question .knowledge-suggestion-card {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
  box-shadow: none;
}

html[data-theme] #knowledge-view .knowledge-card-question .knowledge-suggestion-card span {
  color: var(--theme-accent);
}

html[data-theme] #knowledge-view .knowledge-card-question .knowledge-suggestion-card strong {
  color: var(--theme-text-strong);
}

html[data-theme] #knowledge-view .knowledge-card-question .knowledge-suggestion-card:hover,
html[data-theme] #knowledge-view .knowledge-card-question .knowledge-suggestion-card:focus-visible {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-hover);
}

html[data-theme] #knowledge-view .knowledge-primary-action {
  border-color: var(--theme-accent);
  background: var(--theme-accent);
  color: var(--theme-canvas);
  box-shadow: none;
}

html[data-theme] #knowledge-view .knowledge-primary-action:hover,
html[data-theme] #knowledge-view .knowledge-primary-action:focus-visible {
  border-color: var(--theme-accent-hover);
  background: var(--theme-accent-hover);
  color: var(--theme-canvas);
}

html[data-theme] #knowledge-view .knowledge-card-actions .secondary,
html[data-theme] #knowledge-view .knowledge-card-actions .icon-button {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text);
}

/* Document details: prevent legacy light cards and oversized auth headings from
 * making the modal unreadable or horizontally scrollable. */
html[data-theme] #knowledge-details-modal .knowledge-dialog {
  width: min(820px, calc(100vw - 32px));
  overflow-x: hidden;
}

html[data-theme] #knowledge-details-modal #knowledge-details-content,
html[data-theme] #knowledge-details-modal .auth-heading,
html[data-theme] #knowledge-details-modal .knowledge-detail-grid > div {
  min-width: 0;
}

html[data-theme] #knowledge-details-modal .auth-heading h2 {
  max-width: 100%;
  color: var(--theme-text-strong);
  font-size: clamp(1.5rem, 3.4vw, 2.15rem);
  letter-spacing: -0.025em;
  line-height: 1.12;
  overflow-wrap: anywhere;
  white-space: normal;
}

html[data-theme] #knowledge-details-modal .knowledge-detail-grid > div,
html[data-theme] #knowledge-details-modal .knowledge-insight-section {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
  color: var(--theme-text);
  box-shadow: none;
}

html[data-theme] #knowledge-details-modal .knowledge-detail-grid span {
  color: var(--theme-text-muted);
}

html[data-theme] #knowledge-details-modal .knowledge-detail-grid strong {
  color: var(--theme-text-strong);
  overflow-wrap: anywhere;
}

html[data-theme] #knowledge-details-modal .knowledge-insight-section h3 {
  color: var(--theme-text-strong);
}

html[data-theme] #knowledge-details-modal :is(
  .knowledge-insight-section p,
  .knowledge-description
) {
  color: var(--theme-text-muted);
}

html[data-theme] #knowledge-details-modal .auth-close {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text-strong);
  box-shadow: none;
}

html[data-theme] #knowledge-details-modal .auth-close:hover,
html[data-theme] #knowledge-details-modal .auth-close:focus-visible {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-hover);
  color: var(--theme-accent);
}

html[data-theme="dark"] #knowledge-details-modal .knowledge-dialog {
  border-color: #30465a;
  background:
    radial-gradient(circle at 100% 0%, rgba(29, 78, 216, 0.14), transparent 34%),
    #101f2e;
  color: #dce7f1;
}

html[data-theme="dark"] #knowledge-details-modal .auth-heading h2,
html[data-theme="dark"] #knowledge-details-modal .knowledge-detail-grid strong,
html[data-theme="dark"] #knowledge-details-modal .knowledge-insight-section h3 {
  color: #f4fbff;
}

html[data-theme="dark"] #knowledge-details-modal .knowledge-detail-grid > div,
html[data-theme="dark"] #knowledge-details-modal .knowledge-insight-section {
  border-color: #30465a;
  background: #0c1926;
  color: #dce7f1;
}

html[data-theme="dark"] #knowledge-details-modal .knowledge-detail-grid span {
  color: #a7b7c6;
}

html[data-theme="dark"] #knowledge-details-modal :is(
  .knowledge-insight-section p,
  .knowledge-description
) {
  color: #b8c8d6;
}

html[data-theme="dark"] #knowledge-details-modal .knowledge-detail-topics span {
  border-color: #416178;
  background: #143247;
  color: #dff7ff;
}


/* Landing security cards: keep headings readable before theme bootstrap too. */
.landing-v2 .security-item strong {
  color: var(--theme-text-strong, #0f1b2d);
  font-weight: 800;
}

/* Landing documentation owns its surfaces and foregrounds in each theme.
 * Generic landing heading rules must not leak into this high-contrast panel. */
html[data-theme] #landing-view.landing-v2 .documentation-panel {
  border-color: var(--theme-documentation-border);
  background:
    radial-gradient(circle at 94% 4%, color-mix(in srgb, var(--theme-documentation-label) 14%, transparent), transparent 36%),
    var(--theme-documentation-panel);
  box-shadow: var(--theme-shadow);
}

html[data-theme] #landing-view.landing-v2 .documentation-panel::before {
  background-image:
    linear-gradient(var(--theme-documentation-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--theme-documentation-grid) 1px, transparent 1px);
}

html[data-theme] #landing-view.landing-v2 .documentation-heading .section-kicker {
  border-color: var(--theme-documentation-border);
  background: color-mix(in srgb, var(--theme-documentation-label) 10%, transparent);
  color: var(--theme-documentation-label);
}

html[data-theme] #landing-view.landing-v2 .documentation-heading h2 {
  color: var(--theme-documentation-title);
  font-weight: 850;
  text-shadow: none;
}

html[data-theme] #landing-view.landing-v2 .documentation-heading > p {
  color: var(--theme-documentation-copy);
}

html[data-theme] #landing-view.landing-v2 .documentation-card {
  border-color: var(--theme-documentation-border);
  background: var(--theme-documentation-card);
}

html[data-theme] #landing-view.landing-v2 .documentation-card:hover {
  border-color: var(--theme-documentation-border-strong);
  background: var(--theme-documentation-card-hover);
}

html[data-theme] #landing-view.landing-v2 :is(
  .documentation-label,
  .documentation-boundary-kicker
) {
  color: var(--theme-documentation-label);
}

html[data-theme] #landing-view.landing-v2 .documentation-boundary {
  border-color: var(--theme-documentation-border);
  background: var(--theme-documentation-boundary);
}


/* Incident Response: remove light-only surfaces and preserve label contrast. */
html[data-theme] #incident-view .section-title,
html[data-theme] #incident-view .incident-stepper,
html[data-theme] #incident-view .incident-guided-panel {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] #incident-view .section-title h2,
html[data-theme] #incident-view .incident-step strong,
html[data-theme] #incident-view .incident-guided-panel h3 {
  color: var(--theme-text-strong);
}

html[data-theme] #incident-view .section-title p,
html[data-theme] #incident-view .incident-step small,
html[data-theme] #incident-view .incident-guided-panel p {
  color: var(--theme-text-muted);
}

html[data-theme] #incident-view .incident-stepper::before {
  background: var(--theme-border);
}

html[data-theme] #incident-view .incident-step {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text-muted);
  box-shadow: none;
}

html[data-theme] #incident-view .incident-step.active,
html[data-theme] #incident-view .incident-step.complete.active {
  border-color: var(--theme-accent);
  background: var(--theme-accent-soft);
  box-shadow: 0 8px 22px var(--theme-focus);
}

html[data-theme] #incident-view .incident-step-number {
  background: var(--theme-canvas-muted);
  color: var(--theme-text-muted);
  box-shadow: none;
}

html[data-theme] #incident-view label {
  color: var(--theme-text-strong);
}

html[data-theme] #incident-view label .muted {
  color: var(--theme-text-muted);
}

html[data-theme] #incident-view :is(input, textarea, select) {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text);
  box-shadow: none;
}

html[data-theme] #incident-view :is(input, textarea)::placeholder {
  color: var(--theme-text-faint);
  opacity: 1;
}

html[data-theme] #incident-view :is(input, textarea, select):focus {
  border-color: var(--theme-accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--theme-focus);
}

html[data-theme] #incident-view .incident-upload-zone {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-subtle);
  color: var(--theme-text);
}

html[data-theme] #incident-view .incident-upload-zone span {
  color: var(--theme-link);
}

html[data-theme] #incident-view .incident-upload-zone small {
  color: var(--theme-text-muted);
}

html[data-theme] #incident-view .incident-upload-zone:hover,
html[data-theme] #incident-view .incident-upload-zone.dragover,
html[data-theme] #incident-view .incident-upload-zone:focus-visible {
  border-color: var(--theme-accent);
  background: var(--theme-surface-hover);
}


/* Administration feedback: theme-aware cards, labels, and submitted text. */
html[data-theme] .admin-feedback-filters,
html[data-theme] .admin-feedback-retention,
html[data-theme] .admin-feedback-card {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] .admin-feedback-card {
  border-left-color: var(--theme-accent);
}

html[data-theme] .admin-feedback-filters label,
html[data-theme] .admin-feedback-card-head small,
html[data-theme] .admin-feedback-exchange span,
html[data-theme] .admin-feedback-retention span {
  color: var(--theme-text-muted);
}

html[data-theme] .admin-feedback-card-head strong,
html[data-theme] .admin-feedback-retention strong {
  color: var(--theme-text-strong);
}

html[data-theme] .admin-feedback-filters :is(input, select) {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text);
}

html[data-theme] .admin-feedback-exchange > div,
html[data-theme] .admin-feedback-comment {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
}

html[data-theme] .admin-feedback-exchange p,
html[data-theme] .admin-feedback-comment p {
  color: var(--theme-text);
}

html[data-theme] .admin-feedback-retention > span,
html[data-theme] .admin-feedback-count {
  border: 1px solid var(--theme-info-border);
  background: var(--theme-info-soft);
  color: var(--theme-info);
}

html[data-theme] .admin-feedback-retention.disabled {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
  color: var(--theme-text-muted);
}


/* Threat Intelligence: balanced command layout and theme-aware workspace surfaces. */
html[data-theme] #intel-view .intel-workspace-header,
html[data-theme] #intel-view .intel-workspace-nav,
html[data-theme] #intel-view .intel-command-bar,
html[data-theme] #intel-view .intel-output {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] #intel-view .intel-command-bar {
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
}

html[data-theme] #intel-view .intel-output {
  min-height: 460px;
  border: 1px solid var(--theme-border);
  border-radius: 10px;
  padding: 24px;
}

html[data-theme] #intel-view :is(.intel-workspace-header h2, .intel-brand-lockup strong, .intel-empty-state h2) {
  color: var(--theme-text-strong);
}

html[data-theme] #intel-view :is(.intel-workspace-header p, .intel-brand-lockup span:not(.brand-logo), .intel-empty-state p) {
  color: var(--theme-text-muted);
}

html[data-theme] #intel-view .intel-search :is(input, select) {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text);
}

html[data-theme] #intel-view .intel-search input::placeholder {
  color: var(--theme-text-faint);
  opacity: 1;
}

html[data-theme] #intel-view #inspect-indicator {
  border-color: #0f766e;
  background: linear-gradient(135deg, #0f766e, #0b625c);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.16);
}

html[data-theme] #intel-view #inspect-indicator:hover,
html[data-theme] #intel-view #inspect-indicator:focus-visible {
  border-color: #0a5a54;
  background: linear-gradient(135deg, #0b625c, #094f4a);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.2);
}

html[data-theme="dark"] #intel-view #inspect-indicator {
  border-color: #3f6373;
  background: linear-gradient(135deg, #172f42, #155766);
  color: #f4fbff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 28px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] #intel-view #inspect-indicator:hover,
html[data-theme="dark"] #intel-view #inspect-indicator:focus-visible {
  border-color: #4f8490;
  background: linear-gradient(135deg, #1c4154, #197083);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 14px 30px rgba(0, 0, 0, 0.26);
}

html[data-theme] #intel-view .intel-workspace-nav button {
  color: var(--theme-text-muted);
}

html[data-theme] #intel-view .intel-workspace-nav button:hover,
html[data-theme] #intel-view .intel-workspace-nav button:focus-visible {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-hover);
  color: var(--theme-text-strong);
}

html[data-theme] #intel-view .intel-workspace-nav button.active {
  border-color: var(--theme-info-border);
  background: var(--theme-info-soft);
  color: var(--theme-info);
  box-shadow: none;
}

@media (max-width: 900px) {
  html[data-theme] #intel-view .intel-command-bar {
    grid-template-columns: 1fr;
  }
}


/* Plans & Billing: readable subscription summary in both themes. */
html[data-theme] #billing-view .billing-current-card,
html[data-theme] #billing-view .billing-plan-card {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] #billing-view .billing-current-grid div {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text);
}

html[data-theme] #billing-view .billing-current-grid span {
  color: var(--theme-text-muted);
}

html[data-theme] #billing-view .billing-current-grid strong,
html[data-theme] #billing-view :is(.billing-current-header h3, .billing-plan-head h3) {
  color: var(--theme-text-strong);
}

html[data-theme] #billing-view .billing-note {
  color: var(--theme-text-muted);
}

html[data-theme] #billing-view :is(.billing-status-chip, .billing-current-badge) {
  border: 1px solid var(--theme-success-border);
  background: var(--theme-success-soft);
  color: var(--theme-success);
}


/* Profile demographics and experience controls. */
.profile-personal-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.38fr) minmax(220px, 1fr);
  gap: 14px;
}

.profile-personal-grid > div {
  display: grid;
  gap: 7px;
}

.profile-experience-fieldset {
  margin: 0;
  border: 1px solid var(--theme-border);
  border-radius: 9px;
  background: var(--theme-surface-subtle);
  padding: 12px;
}

.profile-experience-fieldset legend {
  color: var(--theme-text-strong);
  padding: 0 6px;
  font-weight: 850;
}

.profile-experience-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

html[data-theme] .profile-experience-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: var(--theme-surface-raised);
  color: var(--theme-text);
  padding: 9px 11px;
  cursor: pointer;
}

html[data-theme] .profile-experience-options label:has(input:checked) {
  border-color: var(--theme-accent);
  background: var(--theme-accent-soft);
  color: var(--theme-text-strong);
}

.profile-experience-options input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--theme-accent);
}

@media (max-width: 720px) {
  .profile-personal-grid,
  .profile-experience-options {
    grid-template-columns: 1fr;
  }
}


/* Full authenticated workspace readability audit — all ten views. */
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

/* Universal hierarchy for every authenticated view. */
html[data-theme] body:not(.landing-active) :is(
  #dashboard-view, #chat-view, #analyzer-view, #knowledge-view, #upload-view,
  #intel-view, #incident-view, #billing-view, #administration-view, #profile-view
) {
  color: var(--theme-text);
}

html[data-theme] body:not(.landing-active) :is(
  #dashboard-view, #chat-view, #analyzer-view, #knowledge-view, #upload-view,
  #intel-view, #incident-view, #billing-view, #administration-view, #profile-view
) :is(h2, h3, h4, h5, legend, label) {
  color: var(--theme-text-strong);
}

html[data-theme] body:not(.landing-active) :is(
  #dashboard-view, #chat-view, #analyzer-view, #knowledge-view, #upload-view,
  #intel-view, #incident-view, #billing-view, #administration-view, #profile-view
) :is(p, small, .muted, .field-help, .form-help, .helper-text) {
  color: var(--theme-text-muted);
}

/* Shared containers, overlays, and empty states. */
html[data-theme] body:not(.landing-active) :is(
  .view .panel, .view .detail, .view .detail-card, .view .muted-box,
  .modal-content, .dialog-content, .drawer-content, .popover,
  .data-table-wrap, .empty-state
) {
  border-color: var(--theme-border);
  background-color: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] body:not(.landing-active) :is(
  .view .section-title, .view .panel-title, .view .card-header,
  .modal-header, .dialog-header, .drawer-header
) {
  border-color: var(--theme-border);
  color: var(--theme-text-strong);
}

/* All form controls, including disabled and placeholder states. */
html[data-theme] body:not(.landing-active) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  textarea, select
) {
  border-color: var(--theme-border);
  background-color: var(--theme-surface-raised);
  color: var(--theme-text);
  box-shadow: none;
}

html[data-theme] body:not(.landing-active) :is(input, textarea)::placeholder {
  color: var(--theme-text-faint);
  opacity: 1;
}

html[data-theme] body:not(.landing-active) :is(input, textarea, select):focus {
  border-color: var(--theme-accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--theme-focus);
}

html[data-theme] body:not(.landing-active) :is(input, textarea, select):disabled,
html[data-theme] body:not(.landing-active) :is(input, textarea, select)[readonly] {
  border-color: var(--theme-border);
  background-color: var(--theme-canvas-muted);
  color: var(--theme-text-muted);
  opacity: 1;
}

html[data-theme] body:not(.landing-active) :is(input[type="checkbox"], input[type="radio"]) {
  accent-color: var(--theme-accent);
}

/* Primary, secondary, destructive, and disabled actions. */
html[data-theme] body:not(.landing-active) :is(.primary, .primary-action) {
  border-color: var(--theme-accent);
  background: var(--theme-accent);
  color: var(--theme-canvas);
  box-shadow: none;
}

html[data-theme] body:not(.landing-active) :is(.primary, .primary-action):hover,
html[data-theme] body:not(.landing-active) :is(.primary, .primary-action):focus-visible {
  border-color: var(--theme-accent-hover);
  background: var(--theme-accent-hover);
  color: var(--theme-canvas);
}

html[data-theme] body:not(.landing-active) :is(
  .secondary, .icon-button, .table-action, .compact, .prompt-chip,
  .conversation-action, .conversation-menu-button
) {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text);
}

html[data-theme] body:not(.landing-active) :is(
  .secondary, .icon-button, .table-action, .compact, .prompt-chip,
  .conversation-action, .conversation-menu-button
):hover,
html[data-theme] body:not(.landing-active) :is(
  .secondary, .icon-button, .table-action, .compact, .prompt-chip,
  .conversation-action, .conversation-menu-button
):focus-visible {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-hover);
  color: var(--theme-text-strong);
}

html[data-theme] body:not(.landing-active) :is(
  .danger, .danger-action, .danger-soft, .danger-soft-button
) {
  border-color: var(--theme-danger-border);
  background: var(--theme-danger-soft);
  color: var(--theme-danger);
}

html[data-theme] body:not(.landing-active) button:disabled {
  border-color: var(--theme-border);
  background: var(--theme-canvas-muted);
  color: var(--theme-text-faint);
  opacity: 0.72;
  cursor: not-allowed;
}

/* Tables and list rows. */
html[data-theme] body:not(.landing-active) :is(table, .data-table, .administration-table, .intel-bulk-table) {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
}

html[data-theme] body:not(.landing-active) :is(th, .data-table-header, .administration-table th, .intel-bulk-table th) {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text-muted);
}

html[data-theme] body:not(.landing-active) :is(td, .data-table-row, .administration-table td, .intel-bulk-table td) {
  border-color: var(--theme-border);
  color: var(--theme-text);
}

html[data-theme] body:not(.landing-active) :is(tr:hover td, .data-table-row:hover, .administration-table tr:hover td) {
  background: var(--theme-surface-hover);
}

/* Dashboard. */
html[data-theme] body.dashboard-view-active #dashboard-view :is(
  .dashboard-card, .dashboard-metric-card, .dashboard-alert-detail-shell,
  .dashboard-alert-report-panel, .dashboard-trend-counts button,
  .dashboard-table > div, .dashboard-alert-row
) {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] body.dashboard-view-active #dashboard-view :is(
  .dashboard-card-title h3, .dashboard-card h3, .dashboard-card h4,
  .dashboard-metric-card strong, .dashboard-table strong, .dashboard-alert-row strong
) {
  color: var(--theme-text-strong);
}

html[data-theme] body.dashboard-view-active #dashboard-view :is(
  .dashboard-card-title span, .dashboard-card-note, .dashboard-metric-card span,
  .dashboard-metric-card small, .dashboard-table .muted, .dashboard-alert-row small
) {
  color: var(--theme-text-muted);
}

html[data-theme] body.dashboard-view-active #dashboard-view :is(
  .dashboard-alert-row:hover, .dashboard-alert-row.active,
  .dashboard-trend-counts button:hover, .dashboard-trend-counts button.active
) {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-hover);
}

/* Dashboard alert details keep a dark evidence surface in both themes. */
html[data-theme] body.dashboard-view-active #dashboard-view :is(
  .dashboard-alert-detail-hero h4,
  .dashboard-alert-detail-score strong,
  .dashboard-alert-detail-grid strong,
  .dashboard-alert-detail-columns h4,
  .dashboard-alert-report-panel > strong
) {
  color: #f8fbff;
}

html[data-theme] body.dashboard-view-active #dashboard-view :is(
  .dashboard-alert-detail-hero span,
  .dashboard-alert-detail-hero p,
  .dashboard-alert-detail-score small,
  .dashboard-alert-detail-grid span,
  .dashboard-alert-report-panel > span
) {
  color: #c4d3e2;
}

/* Chat. */
html[data-theme] body.chat-view-active :is(
  .chat-section-title, .persistent-chat, .conversation-sidebar, .chat-main-panel,
  .chat-thread, .chat-log, .chat-composer, .conversation-menu,
  .conversation-rename-form, .chat-file-chip, .chat-source, .chat-attachment
) {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] body.chat-view-active :is(.conversation-row > button:first-child, .chat-empty-action) {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text);
}

html[data-theme] body.chat-view-active :is(
  .conversation-row.active > button:first-child, .conversation-row > button:first-child:hover,
  .conversation-menu button:hover, .prompt-chip:hover
) {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-hover);
  color: var(--theme-text-strong);
}

html[data-theme] body.chat-view-active :is(.message, .chat-message) {
  border-color: var(--theme-border);
  color: var(--theme-text);
  box-shadow: none;
}

html[data-theme] body.chat-view-active :is(.message.assistant, .chat-message.assistant) {
  background: var(--theme-surface-raised);
}

html[data-theme] body.chat-view-active :is(.message.user, .chat-message.user) {
  border-color: var(--theme-info-border);
  background: var(--theme-info-soft);
  color: var(--theme-text-strong);
}

html[data-theme] body.chat-view-active :is(.message code, .chat-message code, .chat-mitre-context) {
  border-color: var(--theme-border);
  background: var(--theme-canvas-muted);
  color: var(--theme-text);
}

/* File upload. */
html[data-theme] body.upload-view-active #upload-view :is(
  .upload-panel, .upload-recent-panel, .upload-drop-zone, .upload-file-card,
  .upload-file-card-header, .upload-file-integrity, .upload-collection-toolbar
) {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] body.upload-view-active #upload-view :is(
  .upload-file-name, .upload-collection-title, .upload-recent-heading h3,
  .upload-security-note strong, .upload-file-security strong
) {
  color: var(--theme-text-strong);
}

html[data-theme] body.upload-view-active #upload-view :is(
  .upload-file-meta-item > span, .upload-file-integrity-value > span,
  .upload-collection-description, .upload-recent-heading p, .upload-file-security > span
) {
  color: var(--theme-text-muted);
}

html[data-theme] body.upload-view-active #upload-view :is(
  .upload-file-card:hover, .upload-drop-zone:hover, .upload-drop-zone:focus-visible
) {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-hover);
}

/* Log analyzer. */
html[data-theme] #analyzer-view {
  border-color: var(--theme-border);
  background: var(--theme-canvas-muted);
  color: var(--theme-text);
}

html[data-theme] #analyzer-view :is(
  .log-glass-panel, .log-analysis-card, .log-upload-box, .log-analysis-history-item,
  .log-kpi-card, .log-analyst-summary, .log-analysis-facts div, .log-finding-card, .log-mitre-card,
  .log-evidence-card, .log-timeline article, .log-recommendations article,
  .log-analysis-tabs, .log-table
) {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] #analyzer-view .log-analyst-summary {
  background: var(--theme-surface-raised);
}

html[data-theme] #analyzer-view .log-analyst-summary > span {
  border: 1px solid var(--theme-info-border);
  background: var(--theme-info-soft);
  color: var(--theme-info);
  box-shadow: none;
}

html[data-theme] #analyzer-view .log-analyst-summary strong {
  color: var(--theme-text-strong);
}

html[data-theme] #analyzer-view .log-analyst-summary p {
  color: var(--theme-text-muted);
}

html[data-theme] #analyzer-view :is(
  .log-kpi-card strong, .log-finding-card h4, .log-table strong,
  .log-analysis-history-item strong
) {
  color: var(--theme-text-strong);
}

html[data-theme] #analyzer-view :is(
  .log-kpi-card > span:not(.log-kpi-icon), .log-finding-meta span,
  .log-analysis-history-item small, .log-recommendations span
) {
  color: var(--theme-text-muted);
}

html[data-theme] #analyzer-view .log-analysis-tabs button {
  color: var(--theme-text-muted);
}

html[data-theme] #analyzer-view .log-analysis-tabs button:hover,
html[data-theme] #analyzer-view .log-analysis-tabs button.active {
  border-color: var(--theme-info-border);
  background: var(--theme-info-soft);
  color: var(--theme-info);
}

/* Knowledge Base. */
html[data-theme] #knowledge-view :is(
  .knowledge-hero, .knowledge-panel, .knowledge-tabs, .knowledge-query-card,
  .knowledge-citation-card, .knowledge-selected-card, .knowledge-dialog,
  .knowledge-file-option, .knowledge-history-item
) {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] #knowledge-view .knowledge-tabs button {
  color: var(--theme-text-muted);
}

html[data-theme] #knowledge-view .knowledge-tabs button:hover,
html[data-theme] #knowledge-view .knowledge-tabs button.active {
  border-color: var(--theme-info-border);
  background: var(--theme-info-soft);
  color: var(--theme-info);
}

/* Knowledge ask and answer surfaces must follow the active theme instead of
 * retaining legacy light cards with low-contrast inherited text. */
html[data-theme] #knowledge-view .knowledge-selected-card {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
  color: var(--theme-text);
  box-shadow: none;
}

html[data-theme] #knowledge-view .knowledge-selected-head strong {
  color: var(--theme-text-strong);
}

html[data-theme] #knowledge-view :is(.knowledge-selected-head small, .knowledge-selected-card p) {
  color: var(--theme-text-muted);
}

html[data-theme] #knowledge-view :is(
  .knowledge-context-questions button,
  .knowledge-detail-questions button
) {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text-strong);
  box-shadow: none;
}

html[data-theme] #knowledge-view :is(
  .knowledge-context-questions button:hover,
  .knowledge-context-questions button:focus-visible,
  .knowledge-detail-questions button:hover,
  .knowledge-detail-questions button:focus-visible
) {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-hover);
  color: var(--theme-accent);
}

html[data-theme] #knowledge-view #knowledge-question {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text-strong);
  caret-color: var(--theme-accent);
  box-shadow: none;
}

html[data-theme] #knowledge-view #knowledge-question::placeholder {
  color: var(--theme-text-faint);
  opacity: 1;
}

html[data-theme] #knowledge-view #knowledge-question:focus,
html[data-theme] #knowledge-view #knowledge-question:focus-visible {
  border-color: var(--theme-border-strong);
  outline: 3px solid var(--theme-focus);
  outline-offset: 1px;
}

html[data-theme] #knowledge-view .knowledge-answer-card {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] #knowledge-view .knowledge-answer-head {
  border-color: var(--theme-border);
}

html[data-theme] #knowledge-view .knowledge-answer-head h3,
html[data-theme] #knowledge-view .knowledge-answer-body :is(h1, h2, h3, h4, h5, h6, strong) {
  color: var(--theme-text-strong);
}

html[data-theme] #knowledge-view .knowledge-answer-body,
html[data-theme] #knowledge-view .knowledge-answer-body :is(p, li) {
  color: var(--theme-text);
}

html[data-theme] #knowledge-view .knowledge-answer-body :is(code, pre) {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
  color: var(--theme-text-strong);
}

html[data-theme] #knowledge-view .knowledge-evidence-grid div {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
}

html[data-theme] #knowledge-view .knowledge-evidence-grid span {
  color: var(--theme-text-muted);
}

html[data-theme] #knowledge-view .knowledge-evidence-grid strong {
  color: var(--theme-text-strong);
}

/* Threat Intelligence. */
html[data-theme] #intel-view :is(
  .intel-workspace-card, .intel-history-panel, .intel-bulk-table-wrap,
  .intel-catalog-grid article, .intel-lookup-history-item, .intel-workspace-empty
) {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] #intel-view :is(
  .intel-workspace-card-heading h3, .intel-catalog-grid h4,
  .intel-history-heading h3, .intel-empty-state h2
) {
  color: var(--theme-text-strong);
}

html[data-theme] #intel-view :is(
  .intel-workspace-card-heading p, .intel-catalog-grid p,
  .intel-workspace-empty, .intel-empty-state p
) {
  color: var(--theme-text-muted);
}

/* Incident Response. */
html[data-theme] #incident-view :is(
  .incident-card, .incident-create-panel, .incident-composer, .incident-help-card,
  .incident-facts-panel, .incident-check-card, .incident-action-card,
  .incident-recommendation-card, .incident-resolution-card, .incident-report-panel,
  .incident-decision-card, .incident-evidence-state-card, .incident-hypothesis-card,
  .incident-next-investigation-card, .incident-pending-response-card,
  .incident-closure-requirement, .incident-response-accordion, .incident-phase-toolbar,
  .incident-final-validation, .incident-remaining-risk
) {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

/* Final validation must stay readable in both themes. The base incident CSS
 * uses light surfaces, so explicitly remap this closure section to semantic
 * theme colors instead of leaving white cards inside dark mode. */
html[data-theme] #incident-view .incident-final-validation-head strong,
html[data-theme] #incident-view .incident-readiness-meter strong,
html[data-theme] #incident-view .incident-final-validation-form label,
html[data-theme] #incident-view .incident-final-validation-form label > span,
html[data-theme] #incident-view .incident-remaining-risk strong {
  color: var(--theme-text-strong);
}

html[data-theme] #incident-view .incident-final-validation-head p,
html[data-theme] #incident-view .incident-remaining-risk p {
  color: var(--theme-text-muted);
}

html[data-theme] #incident-view .incident-final-validation-head > span {
  border: 1px solid var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-accent);
}

html[data-theme] #incident-view .incident-final-validation-form :is(input, select, textarea),
html[data-theme] #incident-view .incident-closure-form :is(input, select, textarea) {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-subtle);
  color: var(--theme-text-strong);
}

html[data-theme] #incident-view .incident-final-validation-form textarea::placeholder,
html[data-theme] #incident-view .incident-final-validation-form input::placeholder,
html[data-theme] #incident-view .incident-closure-form textarea::placeholder,
html[data-theme] #incident-view .incident-closure-form input::placeholder {
  color: var(--theme-text-muted);
  opacity: 1;
}

html[data-theme] #incident-view .incident-remaining-risk.ready {
  border-left-color: var(--theme-success);
  background: var(--theme-success-soft);
}

html[data-theme] #incident-view :is(
  .incident-decision-head h4, .incident-decision-body strong,
  .incident-decision-impact strong, .incident-action-card strong
) {
  color: var(--theme-text-strong);
}

html[data-theme] #incident-view :is(
  .incident-decision-body p, .incident-decision-impact p,
  .incident-action-card p, .incident-timeline span, .incident-timeline small
) {
  color: var(--theme-text-muted);
}

/* Incident assessment summary uses semantic surfaces instead of fixed white
 * cards, which otherwise become glaring and unreadable in dark mode. */
html[data-theme] #incident-view .incident-decision-overview > div > strong,
html[data-theme] #incident-view .incident-summary-grid > div > strong,
html[data-theme] #incident-view .incident-main-reasons > strong,
html[data-theme] #incident-view .incident-evidence-state-card > strong {
  color: var(--theme-text-strong);
}

html[data-theme] #incident-view .incident-decision-overview > div > p,
html[data-theme] #incident-view .incident-summary-grid > div > span,
html[data-theme] #incident-view .incident-risk-tile :is(span, small),
html[data-theme] #incident-view .incident-main-reasons li,
html[data-theme] #incident-view .incident-evidence-state-card ul {
  color: var(--theme-text-muted);
}

html[data-theme] #incident-view .incident-summary-grid > div {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text);
  box-shadow: none;
}

html[data-theme] #incident-view .incident-main-reasons {
  border-color: color-mix(in srgb, var(--theme-accent) 35%, var(--theme-border));
  background: var(--theme-surface-subtle);
  color: var(--theme-text);
}

html[data-theme] #incident-view .incident-evidence-state-card {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
  color: var(--theme-text);
  box-shadow: none;
}

html[data-theme] #incident-view .incident-risk-tile {
  border-color: var(--theme-info-border);
  background: var(--theme-info-soft);
  color: var(--theme-text);
  box-shadow: none;
}

html[data-theme] #incident-view .incident-risk-tile > strong {
  color: var(--theme-info);
}

html[data-theme] #incident-view .incident-risk-tile.severity-critical {
  border-color: var(--theme-danger-border);
  background: var(--theme-danger-soft);
}

html[data-theme] #incident-view .incident-risk-tile.severity-critical > strong {
  color: var(--theme-danger);
}

html[data-theme] #incident-view .incident-risk-tile:is(.severity-high, .severity-medium) {
  border-color: var(--theme-warning-border);
  background: var(--theme-warning-soft);
}

html[data-theme] #incident-view .incident-risk-tile:is(.severity-high, .severity-medium) > strong {
  color: var(--theme-warning);
}

html[data-theme] #incident-view .incident-risk-tile.severity-low {
  border-color: var(--theme-success-border);
  background: var(--theme-success-soft);
}

html[data-theme] #incident-view .incident-risk-tile.severity-low > strong {
  color: var(--theme-success);
}

/* Complete the Incident Response workspace theme pass. History rows,
 * investigation cards, reviewed findings, and context panels previously kept
 * fixed light fills that hid their text in dark mode. */
html[data-theme] #incident-view :is(
  .incident-history-drawer,
  .incident-history-item,
  .incident-progress-strip > div,
  .incident-analyst-path span,
  .incident-task-card,
  .incident-finding-form,
  .incident-task-complete-summary,
  .incident-task-finding-view,
  .incident-finding-values > div,
  .incident-readiness-details,
  .incident-investigation-grid > div,
  .incident-resolution-grid > div
) {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text);
  box-shadow: none;
}

html[data-theme] #incident-view .incident-history-item:hover,
html[data-theme] #incident-view .incident-history-item:focus-visible {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-hover);
  color: var(--theme-text-strong);
}

html[data-theme] #incident-view :is(
  .incident-history-item strong,
  .incident-progress-strip strong,
  .incident-task-head strong,
  .incident-finding-title strong,
  .incident-finding-values strong,
  .incident-readiness-details summary,
  .incident-investigation-grid strong,
  .incident-resolution-grid strong
) {
  color: var(--theme-text-strong);
}

html[data-theme] #incident-view :is(
  .incident-history-item small,
  .incident-progress-strip span,
  .incident-task-category,
  .incident-task-head p,
  .incident-finding-title p,
  .incident-finding-form span,
  .incident-finding-values span,
  .incident-readiness-details p,
  .incident-investigation-grid li,
  .incident-resolution-grid li
) {
  color: var(--theme-text-muted);
}

html[data-theme] #incident-view .incident-task-complete-summary > strong {
  color: var(--theme-success);
}

html[data-theme] #incident-view .incident-task-complete-summary > p {
  color: var(--theme-text-muted);
}

html[data-theme] #incident-view .incident-verified-findings article {
  border-color: var(--theme-success-border);
  border-left-color: var(--theme-success);
  background: var(--theme-success-soft);
  color: var(--theme-text);
}

html[data-theme] #incident-view .incident-verified-findings article.unknown {
  border-color: var(--theme-info-border);
  border-left-color: var(--theme-info);
  background: var(--theme-info-soft);
}

html[data-theme] #incident-view .incident-verified-findings article > span {
  color: var(--theme-success);
}

html[data-theme] #incident-view .incident-verified-findings article.unknown > span {
  color: var(--theme-info);
}

html[data-theme] #incident-view .incident-verified-findings article > strong {
  color: var(--theme-text-strong);
}

html[data-theme] #incident-view .incident-verified-findings article > p {
  color: var(--theme-text-muted);
}

html[data-theme] #incident-view .incident-next-recommendation {
  border-color: color-mix(in srgb, var(--theme-accent) 35%, var(--theme-border));
  background: var(--theme-accent-soft);
  color: var(--theme-text);
}

html[data-theme] #incident-view .incident-next-recommendation.incident-decision-status.pending {
  border-color: var(--theme-warning-border);
  background: var(--theme-warning-soft);
}

html[data-theme] #incident-view .incident-next-recommendation.incident-decision-status.ready {
  border-color: var(--theme-success-border);
  background: var(--theme-success-soft);
}

html[data-theme] #incident-view .incident-next-recommendation strong {
  color: var(--theme-text-strong);
}

html[data-theme] #incident-view .incident-next-recommendation p {
  color: var(--theme-text-muted);
}

html[data-theme] #incident-view .incident-task-status {
  background: var(--theme-canvas-muted);
  color: var(--theme-text-muted);
}

html[data-theme] #incident-view .incident-task-status.in-progress {
  background: var(--theme-info-soft);
  color: var(--theme-info);
}

html[data-theme] #incident-view .incident-task-status.completed {
  background: var(--theme-success-soft);
  color: var(--theme-success);
}

html[data-theme] #incident-view .incident-task-status.unknown {
  background: var(--theme-accent-soft);
  color: var(--theme-accent);
}

html[data-theme] #incident-view .incident-task-status.blocked {
  background: var(--theme-warning-soft);
  color: var(--theme-warning);
}

html[data-theme] #incident-view :is(.severity-critical, .severity-high) {
  background: var(--theme-danger-soft);
  color: var(--theme-danger);
}

html[data-theme] #incident-view .severity-medium {
  background: var(--theme-warning-soft);
  color: var(--theme-warning);
}

html[data-theme] #incident-view .severity-low {
  background: var(--theme-info-soft);
  color: var(--theme-info);
}

/* Plans and Billing. */
html[data-theme] #billing-view :is(
  .billing-current-card, .billing-plan-card, .billing-current-grid div,
  .billing-mini-list span, .billing-quota-list li
) {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] #billing-view :is(.billing-plan-price, .billing-current-grid strong) {
  color: var(--theme-text-strong);
}

html[data-theme] #billing-view :is(.billing-mini-list span, .billing-quota-list small, .billing-note) {
  color: var(--theme-text-muted);
}

/* Administration. */
html[data-theme] body.administration-view-active :is(.admin-shell-main, #administration-view) {
  background: var(--theme-canvas);
  color: var(--theme-text);
}

html[data-theme] body.administration-view-active :is(
  .admin-shell-header, .admin-panel, .admin-panel .panel, .admin-metric-card,
  .admin-detail-card, .admin-user-drawer, .admin-user-card, .admin-setting-control,
  .administration-summary-card, .administration-system-list div,
  .administration-audit-item, .admin-feedback-empty, .admin-feedback-pagination
) {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] body.administration-view-active :is(
  .admin-shell-header h2, .admin-panel h3, .admin-panel h4,
  .admin-metric-card strong, .admin-setting-control-copy strong
) {
  color: var(--theme-text-strong);
}

html[data-theme] body.administration-view-active :is(
  .admin-shell-header p, .admin-panel p, .admin-panel small,
  .admin-setting-control-copy p, .admin-setting-control-copy small
) {
  color: var(--theme-text-muted);
}

html[data-theme] body.administration-view-active .admin-shell-sidebar {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
  color: var(--theme-text);
}

html[data-theme] body.administration-view-active :is(
  .admin-shell-nav button, .admin-shell-footer button
) {
  border-color: transparent;
  background: transparent;
  color: var(--theme-text-muted);
}

html[data-theme] body.administration-view-active :is(
  .admin-shell-nav button:hover, .admin-shell-nav button:focus-visible,
  .admin-shell-nav button.active, .admin-shell-footer button:hover
) {
  border-color: var(--theme-border);
  background: var(--theme-surface-hover);
  color: var(--theme-text-strong);
}

/* Profile and account security. */
html[data-theme] #profile-view :is(
  .profile-card, .profile-preview, .account-security, .account-security form,
  .profile-photo-panel, .profile-information-panel
) {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] #profile-view :is(
  .profile-card h3, .profile-preview strong, .account-security h3
) {
  color: var(--theme-text-strong);
}

html[data-theme] #profile-view :is(
  .profile-preview p, .profile-summary, .account-security p, #profile-email-help
) {
  color: var(--theme-text-muted);
}

/* Status and alert semantics stay recognizable without washed-out text. */
html[data-theme] body:not(.landing-active) :is(
  .success, .status.success, .badge.success, .tone-success
) {
  border-color: var(--theme-success-border);
  background: var(--theme-success-soft);
  color: var(--theme-success);
}

html[data-theme] body:not(.landing-active) :is(
  .warning, .status.warning, .badge.warning, .tone-warning
) {
  border-color: var(--theme-warning-border);
  background: var(--theme-warning-soft);
  color: var(--theme-warning);
}

html[data-theme] body:not(.landing-active) :is(
  .error, .status.error, .badge.error, .tone-error
) {
  border-color: var(--theme-danger-border);
  background: var(--theme-danger-soft);
  color: var(--theme-danger);
}

html[data-theme] body:not(.landing-active) :is(
  .info, .status.info, .badge.info, .tone-info
) {
  border-color: var(--theme-info-border);
  background: var(--theme-info-soft);
  color: var(--theme-info);
}

/* Links, selection, keyboard focus, and scrollbars. */
html[data-theme] body:not(.landing-active) a:not(.primary):not(.cta-button) {
  color: var(--theme-link);
}

html[data-theme] body:not(.landing-active) :focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: 2px;
}

html[data-theme] body:not(.landing-active) ::selection {
  background: var(--theme-focus);
  color: var(--theme-text-strong);
}

html[data-theme] body:not(.landing-active) {
  scrollbar-color: var(--theme-border-strong) var(--theme-canvas-muted);
}


/* Customer Incident Response final cascade — 2026-10-04
 * These rules intentionally live in the last stylesheet so legacy light
 * gradients cannot wash out the signed-in workspace after a theme change.
 */
html[data-theme] #incident-view > .section-title,
html[data-theme] #incident-view .incident-stepper,
html[data-theme] #incident-view .incident-guided-panel {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] #incident-view .incident-stepper::before {
  background: var(--theme-border);
}

html[data-theme] #incident-view .incident-step {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
  color: var(--theme-text-muted);
  box-shadow: none;
}

html[data-theme] #incident-view .incident-step.active {
  border-color: var(--theme-info-border);
  background: var(--theme-info-soft);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--theme-info) 12%, transparent);
}

html[data-theme] #incident-view .incident-step.complete {
  border-color: var(--theme-success-border);
  background: var(--theme-success-soft);
}

html[data-theme] #incident-view .incident-step.complete.active {
  border-color: var(--theme-success-border);
  background: var(--theme-success-soft);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--theme-success) 12%, transparent);
}

html[data-theme] #incident-view .incident-step-number {
  background: var(--theme-surface-raised);
  color: var(--theme-text-muted);
  box-shadow: none;
}

html[data-theme] #incident-view :is(
  .incident-step strong, .incident-step.active strong,
  .incident-help-card strong, .incident-source-card strong,
  .incident-upload-zone strong
) {
  color: var(--theme-text-strong);
}

html[data-theme] #incident-view :is(
  .incident-step small, .incident-source-card small,
  .incident-upload-zone small, .field-counter
) {
  color: var(--theme-text-muted);
}

html[data-theme] #incident-view :is(
  .incident-help-card, .incident-source-options, .incident-source-card,
  .incident-upload-zone, .incident-upload-summary
) {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
  color: var(--theme-text);
  box-shadow: none;
}

html[data-theme] #incident-view .incident-source-card + .incident-source-card {
  border-top-color: var(--theme-border);
}

html[data-theme] #incident-view .incident-source-card.active {
  border-color: var(--theme-accent);
  background: var(--theme-accent-soft);
}

html[data-theme] #incident-view .incident-source-icon {
  background: var(--theme-accent-soft);
  color: var(--theme-accent);
}

html[data-theme] #incident-view .incident-upload-zone:hover,
html[data-theme] #incident-view .incident-upload-zone.dragover,
html[data-theme] #incident-view .incident-upload-zone:focus-visible {
  border-color: var(--theme-accent);
  background: var(--theme-surface-hover);
}

html[data-theme] #incident-view .incident-upload-zone span {
  color: var(--theme-link);
}

html[data-theme] #incident-view .incident-form-actions {
  border-top-color: var(--theme-border);
}

/* Incident summary action: keep both the title and supporting instruction
 * readable instead of inheriting the bright generic primary-button fill. */
html[data-theme] #incident-view #incident-quick-analyze {
  border-color: var(--theme-solid-action);
  background: var(--theme-solid-action);
  color: var(--theme-solid-action-text);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--theme-solid-action) 26%, transparent);
}

html[data-theme] #incident-view #incident-quick-analyze span {
  color: var(--theme-solid-action-text);
  opacity: 1;
}

html[data-theme] #incident-view #incident-quick-analyze:hover,
html[data-theme] #incident-view #incident-quick-analyze:focus-visible {
  border-color: var(--theme-solid-action-hover);
  background: var(--theme-solid-action-hover);
  color: var(--theme-solid-action-text);
}


/* Threat Intelligence result workspace — 2026-10-05
 * The result renderer previously mixed dark-only cards with light-theme text.
 * Keep every result option on the shared semantic theme contract instead. */
html[data-theme] #intel-view :is(
  .intel-card, .intel-section-card, .intel-tabs, .intel-review-tray,
  .intel-report-note, .intel-technical-details, #intel-action-message
) {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] #intel-view :is(
  .intel-summary-card, .intel-priority-banner, .intel-evidence-list,
  .intel-domain-grid > div, .intel-decision-status, .intel-decision-grid > div,
  .intel-decision-hero, .intel-decision-metrics > div,
  .intel-evidence-status-grid > div, .intel-next-step-card,
  .intel-quick-actions button, .intel-relationship-list > div,
  .intel-mitre-list > div, .intel-recommendation-list > div,
  .intel-history-timeline > div, .intel-provider-row,
  .intel-exposure-summary > div
) {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
  color: var(--theme-text);
  box-shadow: none;
}

html[data-theme] #intel-view :is(
  .intel-breadcrumbs strong, .intel-title-row h2,
  .intel-card h3, .intel-section-card h4,
  .intel-summary-card strong, .intel-priority-banner strong,
  .intel-evidence-list h4, .intel-domain-grid strong,
  .intel-decision-status strong, .intel-decision-grid strong,
  .intel-decision-hero > strong, .intel-decision-metrics strong,
  .intel-evidence-status-grid strong, .intel-next-step-card strong,
  .intel-inline-stats strong, .intel-info-list strong,
  .intel-quick-actions strong, .intel-relationship-list strong,
  .intel-mitre-list strong, .intel-history-timeline strong,
  .intel-provider-row strong, .intel-exposure-summary strong,
  .intel-technical-details > summary strong, .intel-sighting-row strong
) {
  color: var(--theme-text-strong);
}

html[data-theme] #intel-view :is(
  .intel-breadcrumbs, .intel-card p, .intel-card small,
  .intel-section-card p, .intel-section-card small,
  .intel-card-title-row > span, .intel-summary-card span,
  .intel-summary-card small, .intel-priority-banner p,
  .intel-evidence-list li, .intel-domain-grid span,
  .intel-decision-status span, .intel-decision-grid span,
  .intel-decision-grid p, .intel-decision-hero > span,
  .intel-decision-hero > p, .intel-decision-metrics span,
  .intel-evidence-status-grid span, .intel-evidence-status-grid small,
  .intel-next-step-card > span, .intel-next-step-card p,
  .intel-inline-stats span, .intel-info-list span,
  .intel-quick-actions small, .intel-relationship-list span,
  .intel-relationship-list em, .intel-relationship-list small,
  .intel-mitre-list span, .intel-history-timeline span,
  .intel-history-timeline p, .intel-history-timeline small,
  .intel-provider-row span, .intel-provider-row p,
  .intel-exposure-summary span, .intel-technical-details > summary small,
  .intel-technical-details > summary > span:last-child,
  .intel-sighting-row small, .intel-review-note-label,
  .intel-review-tray > span
) {
  color: var(--theme-text-muted);
}

html[data-theme] #intel-view :is(
  .intel-inline-stats > div, .intel-assessment-list > div,
  .intel-info-list > div, .intel-status-details
) {
  border-color: var(--theme-border);
}

html[data-theme] #intel-view :is(
  .intel-type-badge, .intel-table-status, .intel-freshness,
  .intel-recommendation-list > div > span
) {
  border: 1px solid var(--theme-info-border);
  background: var(--theme-info-soft);
  color: var(--theme-info);
}

html[data-theme] #intel-view .intel-confidence-bar {
  background: var(--theme-border);
}

html[data-theme] #intel-view .intel-confidence-bar em,
html[data-theme] #intel-view .intel-history-timeline > div::before {
  background: var(--theme-info);
}

html[data-theme] #intel-view .intel-next-step-card {
  border-left-color: var(--theme-info);
}

html[data-theme] #intel-view .intel-limitation-box {
  border-color: var(--theme-warning-border);
  background: var(--theme-warning-soft);
  color: var(--theme-warning);
}

html[data-theme] #intel-view :is(
  .intel-header-actions button, .intel-quick-actions button,
  .intel-review-tray button, .intel-decision-actions .secondary
) {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text);
}

html[data-theme] #intel-view :is(
  .intel-header-actions button, .intel-quick-actions button,
  .intel-review-tray button, .intel-decision-actions .secondary
):hover,
html[data-theme] #intel-view :is(
  .intel-header-actions button, .intel-quick-actions button,
  .intel-review-tray button, .intel-decision-actions .secondary
):focus-visible {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-hover);
  color: var(--theme-text-strong);
}

html[data-theme] #intel-view .intel-quick-actions button:hover strong,
html[data-theme] #intel-view .intel-quick-actions button:focus-visible strong {
  color: var(--theme-text-strong);
}

html[data-theme] #intel-view .intel-quick-actions button:hover small,
html[data-theme] #intel-view .intel-quick-actions button:focus-visible small {
  color: var(--theme-text-muted);
}

html[data-theme] #intel-view .intel-tabs button {
  border-color: var(--theme-border);
  background: transparent;
  color: var(--theme-text-muted);
}

html[data-theme] #intel-view .intel-tabs button:hover,
html[data-theme] #intel-view .intel-tabs button:focus-visible {
  background: var(--theme-surface-hover);
  color: var(--theme-text-strong);
}

html[data-theme] #intel-view .intel-tabs button.active {
  background: var(--theme-info-soft);
  color: var(--theme-info);
  box-shadow: inset 0 -2px 0 var(--theme-info);
}

html[data-theme] #intel-view .intel-tabs button span {
  background: var(--theme-surface-raised);
  color: var(--theme-text-strong);
}

html[data-theme] #intel-view .intel-tabs button.active span {
  background: var(--theme-info);
  color: var(--theme-surface);
}

html[data-theme] #intel-view :is(
  .intel-review-tray textarea, .intel-report-note textarea
) {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text);
}

html[data-theme] #intel-view .intel-technical-details > summary:hover,
html[data-theme] #intel-view .intel-technical-details > summary:focus-visible {
  background: var(--theme-surface-hover);
}

html[data-theme] #intel-view .intel-technical-details[open] > summary {
  border-bottom-color: var(--theme-border);
}

html[data-theme] #intel-view .intel-provider-table {
  color: var(--theme-text);
}

html[data-theme] #intel-view .intel-provider-table :is(th, td) {
  border-color: var(--theme-border);
}

html[data-theme] #intel-view .intel-provider-table th {
  background: var(--theme-surface-raised);
  color: var(--theme-text-muted);
}

html[data-theme] #intel-view .intel-provider-table td {
  color: var(--theme-text);
}

html[data-theme] #intel-view .intel-provider-table tbody tr:hover td {
  background: var(--theme-surface-hover);
}

html[data-theme] #intel-view .intel-line-chart {
  border-color: var(--theme-border);
  background-color: var(--theme-surface-subtle);
}

html[data-theme] #intel-view :is(
  strong.tone-warning, strong.tone-medium, span.tone-warning, span.tone-medium
) {
  border-color: transparent;
  background: transparent;
  color: var(--theme-warning) !important;
}

html[data-theme] #intel-view :is(
  strong.tone-safe, strong.tone-low, span.tone-safe, span.tone-low
) {
  border-color: transparent;
  background: transparent;
  color: var(--theme-success) !important;
}

html[data-theme] #intel-view :is(
  strong.tone-danger, strong.tone-critical, strong.tone-high,
  span.tone-danger, span.tone-critical, span.tone-high
) {
  border-color: transparent;
  background: transparent;
  color: var(--theme-danger) !important;
}

html[data-theme] #intel-view :is(
  strong.tone-neutral, span.tone-neutral
) {
  border-color: transparent;
  background: transparent;
  color: var(--theme-info) !important;
}

html[data-theme] #intel-view :is(
  .intel-summary-card, .intel-priority-banner, .intel-evidence-list,
  .intel-decision-hero, .intel-decision-status, .intel-table-status
):is(.tone-warning, .tone-medium) {
  border-color: var(--theme-warning-border);
  background: var(--theme-warning-soft);
  color: var(--theme-warning) !important;
}

html[data-theme] #intel-view :is(
  .intel-summary-card, .intel-priority-banner, .intel-evidence-list,
  .intel-decision-hero, .intel-decision-status, .intel-table-status
):is(.tone-warning, .tone-medium) :is(h3, h4, strong, span, small, p, li) {
  color: var(--theme-warning);
}

html[data-theme] #intel-view :is(
  .intel-summary-card, .intel-priority-banner, .intel-evidence-list,
  .intel-decision-hero, .intel-decision-status, .intel-table-status
):is(.tone-safe, .tone-low) {
  border-color: var(--theme-success-border);
  background: var(--theme-success-soft);
  color: var(--theme-success) !important;
}

html[data-theme] #intel-view :is(
  .intel-summary-card, .intel-priority-banner, .intel-evidence-list,
  .intel-decision-hero, .intel-decision-status, .intel-table-status
):is(.tone-safe, .tone-low) :is(h3, h4, strong, span, small, p, li) {
  color: var(--theme-success);
}

html[data-theme] #intel-view :is(
  .intel-summary-card, .intel-priority-banner, .intel-evidence-list,
  .intel-decision-hero, .intel-decision-status, .intel-table-status
):is(.tone-danger, .tone-critical, .tone-high) {
  border-color: var(--theme-danger-border);
  background: var(--theme-danger-soft);
  color: var(--theme-danger) !important;
}

html[data-theme] #intel-view :is(
  .intel-summary-card, .intel-priority-banner, .intel-evidence-list,
  .intel-decision-hero, .intel-decision-status, .intel-table-status
):is(.tone-danger, .tone-critical, .tone-high) :is(h3, h4, strong, span, small, p, li) {
  color: var(--theme-danger);
}

html[data-theme] #intel-view :is(
  .intel-summary-card, .intel-priority-banner, .intel-evidence-list,
  .intel-decision-hero, .intel-decision-status, .intel-table-status
).tone-neutral {
  border-color: var(--theme-info-border);
  background: var(--theme-info-soft);
  color: var(--theme-info) !important;
}

html[data-theme] #intel-view :is(
  .intel-summary-card, .intel-priority-banner, .intel-evidence-list,
  .intel-decision-hero, .intel-decision-status, .intel-table-status
).tone-neutral :is(h3, h4, strong, span, small, p, li) {
  color: var(--theme-info);
}

html[data-theme] #intel-view .intel-evidence-list.tone-warning li::before {
  background: var(--theme-warning);
}

html[data-theme] #intel-view .intel-evidence-list:is(.tone-safe, .tone-low) li::before {
  background: var(--theme-success);
}

html[data-theme] #intel-view .intel-evidence-list:is(.tone-danger, .tone-critical, .tone-high) li::before {
  background: var(--theme-danger);
}

html[data-theme] #intel-view .intel-evidence-list.tone-neutral li::before {
  background: var(--theme-info);
}

html[data-theme] #intel-view .intel-decision-hero:is(.tone-warning, .tone-medium) {
  border-left-color: var(--theme-warning);
}

html[data-theme] #intel-view .intel-decision-hero:is(.tone-safe, .tone-low) {
  border-left-color: var(--theme-success);
}

html[data-theme] #intel-view .intel-decision-hero:is(.tone-danger, .tone-critical, .tone-high) {
  border-left-color: var(--theme-danger);
}

html[data-theme] #intel-view .intel-decision-hero.tone-neutral {
  border-left-color: var(--theme-info);
}

/* Threat Intelligence option contrast guard — 2026-10-06.
 * Evidence cards and action options can mix tone-specific fills with inherited
 * dark workspace text. Keep each option readable regardless of active theme. */
html[data-theme] #intel-view :is(.intel-card-title-row h3, .intel-card h3) {
  color: var(--theme-text-strong) !important;
}

html[data-theme] #intel-view .intel-card-title-row > span {
  color: var(--theme-text-muted) !important;
}

html[data-theme] #intel-view .intel-evidence-grid .intel-evidence-list {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
  color: var(--theme-text);
}

html[data-theme] #intel-view .intel-evidence-grid .intel-evidence-list :is(h4, li, p, span, strong, small) {
  color: var(--theme-text) !important;
}

html[data-theme] #intel-view .intel-evidence-grid .intel-evidence-list p.muted {
  color: var(--theme-text-muted) !important;
}

html[data-theme="light"] #intel-view .intel-evidence-grid .intel-evidence-list:is(.tone-warning, .tone-medium) {
  border-color: #d8b35d;
  background: #fff7df;
}

html[data-theme="light"] #intel-view .intel-evidence-grid .intel-evidence-list:is(.tone-warning, .tone-medium) :is(h4, li, p, span, strong, small) {
  color: #6f4500 !important;
}

html[data-theme="light"] #intel-view .intel-evidence-grid .intel-evidence-list:is(.tone-safe, .tone-low) {
  border-color: #abd9bc;
  background: #eaf8ef;
}

html[data-theme="light"] #intel-view .intel-evidence-grid .intel-evidence-list:is(.tone-safe, .tone-low) :is(h4, li, p, span, strong, small) {
  color: #14552f !important;
}

html[data-theme="light"] #intel-view .intel-evidence-grid .intel-evidence-list.tone-neutral {
  border-color: #b6caea;
  background: #ebf3ff;
}

html[data-theme="light"] #intel-view .intel-evidence-grid .intel-evidence-list.tone-neutral :is(h4, li, p, span, strong, small) {
  color: #1f4f88 !important;
}

html[data-theme="dark"] #intel-view .intel-evidence-grid .intel-evidence-list {
  border-color: #30465a;
  background: #0c1926;
}

html[data-theme="dark"] #intel-view .intel-evidence-grid .intel-evidence-list :is(h4, li, p, span, strong, small) {
  color: #dce7f1 !important;
}

html[data-theme="dark"] #intel-view .intel-evidence-grid .intel-evidence-list:is(.tone-warning, .tone-medium) {
  border-color: #745a24;
  background: #3a2b12;
}

html[data-theme="dark"] #intel-view .intel-evidence-grid .intel-evidence-list:is(.tone-warning, .tone-medium) :is(h4, li, p, span, strong, small) {
  color: #fde68a !important;
}

html[data-theme="dark"] #intel-view .intel-evidence-grid .intel-evidence-list:is(.tone-safe, .tone-low) {
  border-color: #2d6648;
  background: #123725;
}

html[data-theme="dark"] #intel-view .intel-evidence-grid .intel-evidence-list:is(.tone-safe, .tone-low) :is(h4, li, p, span, strong, small) {
  color: #a7f3c0 !important;
}

html[data-theme="dark"] #intel-view .intel-evidence-grid .intel-evidence-list.tone-neutral {
  border-color: #365985;
  background: #172e50;
}

html[data-theme="dark"] #intel-view .intel-evidence-grid .intel-evidence-list.tone-neutral :is(h4, li, p, span, strong, small) {
  color: #b7d3ff !important;
}

html[data-theme] #intel-view .intel-side-column .intel-quick-actions button,
html[data-theme] #intel-view .intel-technical-details {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
}

html[data-theme] #intel-view .intel-side-column .intel-quick-actions button strong,
html[data-theme] #intel-view .intel-technical-details > summary strong {
  color: var(--theme-text-strong) !important;
}

html[data-theme] #intel-view .intel-side-column .intel-quick-actions button small,
html[data-theme] #intel-view .intel-technical-details > summary small,
html[data-theme] #intel-view .intel-technical-details > summary > span:last-child {
  color: var(--theme-text-muted) !important;
}

html[data-theme] #intel-view .intel-side-column .intel-quick-actions button:hover,
html[data-theme] #intel-view .intel-side-column .intel-quick-actions button:focus-visible,
html[data-theme] #intel-view .intel-technical-details > summary:hover,
html[data-theme] #intel-view .intel-technical-details > summary:focus-visible {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-hover);
  color: var(--theme-text-strong);
}

/* 2026-10-07 audit hardening: explicit contrast for intentionally dark landing surfaces. */
html[data-theme] #landing-view.landing-v2 :is(
  .documentation-card h3,
  .documentation-boundary strong
) {
  color: var(--theme-documentation-title);
}

html[data-theme] #landing-view.landing-v2 :is(
  .documentation-card p,
  .documentation-boundary p
) {
  color: var(--theme-documentation-copy);
}

html[data-theme] #landing-view.landing-v2 .site-footer {
  border-top-color: var(--theme-footer-border);
  background:
    radial-gradient(circle at 12% 0%, rgba(45, 212, 191, 0.08), transparent 30%),
    linear-gradient(180deg, #071824, #030d16);
}

html[data-theme] #landing-view.landing-v2 .site-footer :is(
  .landing-brand strong,
  .footer-column h2,
  .footer-about strong
) {
  color: var(--theme-footer-title) !important;
}

html[data-theme] #landing-view.landing-v2 .site-footer .footer-column h2 {
  font-weight: 850;
  letter-spacing: 0.12em;
}

html[data-theme] #landing-view.landing-v2 .site-footer :is(
  .landing-brand span:not(.brand-logo),
  .footer-about p,
  .footer-column a,
  .footer-column span,
  .footer-copy-inline p
) {
  color: var(--theme-footer-copy) !important;
}

html[data-theme] #landing-view.landing-v2 .site-footer .footer-copy-inline p {
  color: var(--theme-footer-muted) !important;
}

html[data-theme] #landing-view.landing-v2 .site-footer .footer-column a {
  color: var(--theme-footer-link) !important;
}

html[data-theme] #landing-view.landing-v2 .site-footer .footer-column a:hover,
html[data-theme] #landing-view.landing-v2 .site-footer .footer-column a:focus-visible {
  color: var(--theme-footer-accent) !important;
}

html[data-theme] #landing-view.landing-v2 .footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--theme-footer-border);
}

html[data-theme] #landing-view.landing-v2 .footer-meta .footer-copy-inline {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

html[data-theme] #landing-view.landing-v2 .footer-meta .social-links {
  flex: 0 0 auto;
}

html[data-theme] #landing-view.landing-v2 .footer-meta .social-links a {
  width: 36px;
  height: 36px;
  border-color: var(--theme-footer-border);
  background: var(--theme-footer-control);
  color: var(--theme-footer-title);
  box-shadow: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

html[data-theme] #landing-view.landing-v2 .footer-meta .social-links svg {
  width: 18px;
  height: 18px;
}

html[data-theme] #landing-view.landing-v2 .footer-meta .social-links a:hover,
html[data-theme] #landing-view.landing-v2 .footer-meta .social-links a:focus-visible {
  border-color: var(--theme-footer-accent);
  background: var(--theme-footer-control-hover);
  color: var(--theme-footer-accent);
  transform: translateY(-2px);
}

@media (max-width: 420px) {
  html[data-theme] #landing-view.landing-v2 .footer-meta {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Keep the incident-history label inside a calm, clearly bounded action in
 * both themes. The legacy span rule sized the text label like the 24px icon. */
html[data-theme] #incident-view .incident-history-button {
  border-color: color-mix(in srgb, var(--theme-accent) 48%, var(--theme-border));
  background: linear-gradient(
    135deg,
    var(--theme-accent-soft),
    color-mix(in srgb, var(--theme-surface-raised) 76%, var(--theme-accent-soft))
  );
  color: var(--theme-accent);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--theme-accent) 14%, transparent);
}

html[data-theme] #incident-view .incident-history-button #incident-history-toggle-label {
  display: inline;
  width: auto;
  height: auto;
}

html[data-theme] #incident-view .incident-history-button:hover,
html[data-theme] #incident-view .incident-history-button:focus-visible,
html[data-theme] #incident-view .incident-history-button[aria-expanded="true"] {
  border-color: var(--theme-solid-action);
  background: var(--theme-solid-action);
  color: var(--theme-solid-action-text);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--theme-solid-action) 24%, transparent);
}

/* The primary incident action uses a restrained security accent in both modes. */
html[data-theme] #incident-view .incident-analyze-button {
  border-color: var(--theme-solid-action);
  background: linear-gradient(135deg, var(--theme-solid-action), #155e75);
  color: var(--theme-solid-action-text);
  box-shadow: 0 14px 28px color-mix(in srgb, var(--theme-solid-action) 24%, transparent);
}

html[data-theme] #incident-view .incident-analyze-button span {
  color: rgba(255, 255, 255, 0.84);
}

html[data-theme] #incident-view .incident-analyze-button:hover,
html[data-theme] #incident-view .incident-analyze-button:focus-visible {
  background: linear-gradient(135deg, var(--theme-solid-action-hover), #164e63);
}

/* Prevent desktop toolbars and security tables from pushing outside the workspace. */
html[data-theme] #intel-view .intel-command-bar,
html[data-theme] #intel-view .intel-search,
html[data-theme] #knowledge-view .knowledge-toolbar,
html[data-theme] .admin-security-detail-panel,
html[data-theme] .admin-security-detail-panel .administration-table-wrap {
  min-width: 0;
  max-width: 100%;
}

html[data-theme] #intel-view .intel-search > *,
html[data-theme] #knowledge-view .knowledge-toolbar > * {
  min-width: 0;
}

html[data-theme] .admin-security-detail-panel .administration-table-wrap {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

html[data-theme] .admin-security-table td {
  overflow-wrap: anywhere;
}

@media (max-width: 1360px) {
  html[data-theme] #intel-view .intel-command-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-theme] #knowledge-view .knowledge-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme] #knowledge-view .knowledge-toolbar > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  html[data-theme] #intel-view .intel-search,
  html[data-theme] #knowledge-view .knowledge-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-theme] #knowledge-view .knowledge-toolbar > :first-child {
    grid-column: auto;
  }
}

/* Administration audit workspace contrast repair — 2026-10-08
 * Audit surfaces use the semantic theme contract so light text is never
 * rendered on legacy light-only cards or alternating table rows.
 */
html[data-theme] body.administration-view-active .admin-audit-rail-heading strong,
html[data-theme] body.administration-view-active .admin-audit-rail-copy strong,
html[data-theme] body.administration-view-active .admin-audit-time strong,
html[data-theme] body.administration-view-active .admin-audit-resource strong {
  color: var(--theme-text-strong);
}

html[data-theme] body.administration-view-active .admin-audit-rail-heading small,
html[data-theme] body.administration-view-active .admin-audit-rail-copy small,
html[data-theme] body.administration-view-active .admin-audit-time small,
html[data-theme] body.administration-view-active .admin-audit-resource small,
html[data-theme] body.administration-view-active .admin-audit-pagination {
  color: var(--theme-text-muted);
}

html[data-theme] body.administration-view-active .admin-audit-filter-row :is(input, select) {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
  color: var(--theme-text-strong);
}

html[data-theme] body.administration-view-active .admin-audit-filter-row input::placeholder {
  color: var(--theme-text-faint);
  opacity: 1;
}

html[data-theme] body.administration-view-active .admin-audit-table-wrap {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  box-shadow: var(--theme-shadow);
}

html[data-theme] body.administration-view-active .admin-audit-table th {
  border-bottom-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text-muted);
}

html[data-theme] body.administration-view-active .admin-audit-table td {
  border-bottom-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
}

html[data-theme] body.administration-view-active .admin-audit-table tr:nth-child(even) td {
  background: var(--theme-surface-subtle);
}

html[data-theme] body.administration-view-active .admin-audit-table tr:hover td,
html[data-theme] body.administration-view-active .admin-audit-table tr:nth-child(even):hover td {
  background: var(--theme-surface-hover);
}

html[data-theme] body.administration-view-active .admin-audit-actor {
  border: 1px solid var(--theme-border);
  background: var(--theme-surface-hover);
  color: var(--theme-text-strong);
}

html[data-theme] body.administration-view-active .admin-audit-details {
  color: var(--theme-text);
}

html[data-theme] body.administration-view-active .admin-audit-table td::before {
  color: var(--theme-text-muted);
}

html[data-theme="dark"] body.administration-view-active :is(
  .admin-audit-rail-item,
  .admin-audit-rail-item.blue,
  .admin-audit-rail-item.teal,
  .admin-audit-rail-item.purple,
  .admin-audit-rail-item.green,
  .admin-audit-rail-item.amber,
  .admin-audit-rail-item.orange,
  .admin-audit-rail-item.red,
  .admin-audit-rail-item.cyan,
  .admin-audit-rail-item.slate
) {
  border-top-color: var(--theme-border);
  border-right-color: var(--theme-border);
  border-bottom-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme="dark"] body.administration-view-active :is(
  .admin-audit-rail-item:hover,
  .admin-audit-rail-item:focus-visible,
  .admin-audit-rail-item.active
) {
  border-top-color: var(--theme-border-strong);
  border-right-color: var(--theme-border-strong);
  border-bottom-color: var(--theme-border-strong);
  background: var(--theme-surface-hover);
}

html[data-theme="dark"] body.administration-view-active .admin-audit-rail-item.active::after {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-hover);
}

html[data-theme="dark"] body.administration-view-active .admin-audit-rail-item.blue .admin-audit-rail-token {
  border: 1px solid var(--theme-info-border);
  background: var(--theme-info-soft);
  color: var(--theme-info);
}

html[data-theme="dark"] body.administration-view-active :is(
  .admin-audit-rail-item.teal,
  .admin-audit-rail-item.green,
  .admin-audit-rail-item.cyan
) .admin-audit-rail-token {
  border: 1px solid var(--theme-success-border);
  background: var(--theme-accent-soft);
  color: var(--theme-accent);
}

html[data-theme="dark"] body.administration-view-active .admin-audit-rail-item.purple .admin-audit-rail-token {
  border: 1px solid #5b4a88;
  background: #2e2550;
  color: #ddd6fe;
}

html[data-theme="dark"] body.administration-view-active :is(
  .admin-audit-rail-item.amber,
  .admin-audit-rail-item.orange
) .admin-audit-rail-token {
  border: 1px solid var(--theme-warning-border);
  background: var(--theme-warning-soft);
  color: var(--theme-warning);
}

html[data-theme="dark"] body.administration-view-active .admin-audit-rail-item.red .admin-audit-rail-token {
  border: 1px solid var(--theme-danger-border);
  background: var(--theme-danger-soft);
  color: var(--theme-danger);
}

html[data-theme="dark"] body.administration-view-active .admin-audit-rail-item.slate .admin-audit-rail-token {
  border: 1px solid var(--theme-border-strong);
  background: var(--theme-surface-hover);
  color: var(--theme-text);
}

/* Administration user drawer contrast repair — 2026-10-08
 * Detail and action blocks follow the selected theme independently of the
 * transient administration body class used during navigation.
 */
html[data-theme] .admin-user-drawer-header {
  border-bottom-color: var(--theme-border);
}

html[data-theme] .admin-drawer-close {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text-muted);
}

html[data-theme] .admin-drawer-close:hover,
html[data-theme] .admin-drawer-close:focus-visible {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-hover);
  color: var(--theme-text-strong);
}

html[data-theme] .admin-user-detail-section {
  border-color: var(--theme-border);
  background: var(--theme-surface-subtle);
  color: var(--theme-text);
}

html[data-theme] .admin-user-detail-section h4,
html[data-theme] .admin-user-detail-grid strong,
html[data-theme] .admin-user-action-panel h4 {
  color: var(--theme-text-strong);
}

html[data-theme] .admin-user-detail-grid,
html[data-theme] .admin-user-detail-grid > span {
  color: var(--theme-text-muted);
}

html[data-theme] .admin-user-action-panel {
  border-color: var(--theme-success-border);
  background: var(--theme-success-soft);
  color: var(--theme-text);
}

html[data-theme] .admin-user-action-panel.danger {
  border-color: var(--theme-danger-border);
  background: var(--theme-danger-soft);
  color: var(--theme-text);
}

html[data-theme] .admin-user-action-panel p,
html[data-theme] .admin-user-action-panel label {
  color: var(--theme-text-muted);
}

html[data-theme] .admin-user-action-panel select {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text-strong);
}

/* Administration user action menu contrast repair — 2026-10-09
 * The overflow trigger and popover use semantic theme surfaces so every
 * action remains readable in both light and dark modes.
 */
html[data-theme] .admin-kebab {
  border-color: var(--theme-border);
  background: var(--theme-surface-raised);
  color: var(--theme-text-muted);
}

html[data-theme] .admin-kebab:hover,
html[data-theme] .admin-kebab:focus-visible {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface-hover);
  color: var(--theme-text-strong);
}

html[data-theme] .admin-user-menu {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow);
}

html[data-theme] .admin-user-menu button:not(.danger) {
  background: transparent;
  color: var(--theme-text-strong);
}

html[data-theme] .admin-user-menu button:not(.danger):hover,
html[data-theme] .admin-user-menu button:not(.danger):focus-visible {
  background: var(--theme-surface-hover);
  color: var(--theme-text-strong);
}

html[data-theme] .admin-user-menu button.danger {
  background: transparent;
  color: var(--theme-danger);
}

html[data-theme] .admin-user-menu button.danger:hover,
html[data-theme] .admin-user-menu button.danger:focus-visible {
  background: var(--theme-danger-soft);
  color: var(--theme-danger);
}
