@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500;600;700&display=swap");


:root {
  --figma-bg: #0d1424;
  --figma-shell: #0a1020;
  --figma-shell-2: #0c1628;
  --figma-card: #141e33;
  --figma-card-2: #1a2540;
  --figma-input: #1e2d4a;
  --figma-border: rgba(255, 255, 255, 0.08);
  --figma-border-strong: rgba(255, 255, 255, 0.16);
  --figma-text: #e2e8f0;
  --figma-text-strong: #f8fafc;
  --figma-muted: #94a3b8;
  --figma-muted-dark: #64748b;
  --figma-red: #694dd4;
  --figma-red-hover: #573fba;
  --figma-red-soft: rgba(105, 77, 212, 0.12);
  --figma-green: #22c55e;
  --figma-green-soft: rgba(34, 197, 94, 0.15);
  --figma-blue: #3b82f6;
  --figma-amber: #f59e0b;
  --figma-purple: #694dd4;
  --figma-cyan: #06b6d4;
  --figma-pink: #ec4899;
  --figma-radius: 8px;
  --figma-font: "IBM Plex Sans", "DM Sans", "Segoe UI", system-ui, sans-serif;
  --figma-mono: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;
  --ui-shell-gap: clamp(8px, 0.75vw, 12px);
  --ui-section-gap: clamp(16px, 1.25vw, 22px);
  --ui-card-gap: clamp(12px, 1vw, 18px);
  --filters-sidebar-padding: 18px;
  --filters-field-gap: 14px;
}

body[data-bs-theme="dark"] {
  margin: 0;
  background: var(--figma-bg);
  color: var(--figma-text);
  font-family: var(--figma-font);
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body[data-bs-theme="dark"] * {
  letter-spacing: 0;
}

body[data-bs-theme="dark"] .app-shell {
  width: 100%;
  margin: 0;
  padding: 0 0 28px;
  display: block;
  background: var(--figma-bg);
}

body[data-bs-theme="dark"][data-auth-state="locked"] {
  overflow: hidden;
}

body[data-bs-theme="dark"][data-auth-state="locked"] .app-shell {
  display: none;
}

body[data-bs-theme="dark"] .auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(105, 77, 212, 0.14), transparent 34%),
    var(--figma-bg);
}

body[data-bs-theme="dark"] .auth-gate[hidden] {
  display: none;
}

body[data-bs-theme="dark"] .auth-card {
  width: min(100%, 420px);
  padding: 24px;
  border-color: rgba(148, 163, 184, 0.22);
  background: linear-gradient(145deg, rgba(23, 32, 51, 0.98), rgba(15, 23, 42, 0.98));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

body[data-bs-theme="dark"] .auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

body[data-bs-theme="dark"] .auth-brand h1 {
  margin: 0;
  color: var(--figma-text-strong);
  font-size: 20px;
}

body[data-bs-theme="dark"] .auth-brand p {
  margin: 2px 0 0;
}

body[data-bs-theme="dark"] .auth-form {
  display: grid;
  gap: 12px;
}

body[data-bs-theme="dark"] .auth-form[hidden] {
  display: none;
}

body[data-bs-theme="dark"] .auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}

body[data-bs-theme="dark"] .top-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: auto;
  min-height: 57px;
  padding: 10px 24px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, auto) minmax(260px, 1fr);
  align-items: center;
  gap: 18px;
  border: 0;
  border-bottom: 1px solid var(--figma-border);
  border-radius: 0;
  background: var(--figma-shell);
  box-shadow: none;
}

body[data-bs-theme="dark"] .brand-lockup {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body[data-bs-theme="dark"] .brand-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  border-radius: 6px;
  background: var(--figma-red);
  color: #ffffff;
  font-family: var(--figma-font);
  font-size: 11px;
  font-weight: 800;
}

body[data-bs-theme="dark"] .top-header h1 {
  margin: 0;
  color: var(--figma-text-strong);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

body[data-bs-theme="dark"] .header-actions {
  grid-column: 3;
  justify-content: flex-end;
  gap: 8px;
}

body[data-bs-theme="dark"] .account-panel {
  min-height: 32px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--figma-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
}

body[data-bs-theme="dark"] .account-panel[hidden] {
  display: none;
}

body[data-bs-theme="dark"] .account-email {
  max-width: 220px;
  overflow: hidden;
  color: var(--figma-text);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-bs-theme="dark"] .btn {
  min-height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 6px;
  border: 1px solid var(--figma-border);
  background: var(--figma-card-2);
  color: var(--figma-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
  transform: none;
}

body[data-bs-theme="dark"] .btn:hover {
  border-color: var(--figma-border-strong);
  background: #223250;
  color: var(--figma-text-strong);
  transform: none;
}

body[data-bs-theme="dark"] .btn.primary {
  border-color: var(--figma-red);
  background: var(--figma-red);
  color: #ffffff;
}

body[data-bs-theme="dark"] .btn.primary:hover {
  background: var(--figma-red-hover);
}

body[data-bs-theme="dark"] .btn.danger {
  border-color: rgba(192, 40, 60, 0.32);
  background: rgba(192, 40, 60, 0.12);
  color: #f87171;
}

body[data-bs-theme="dark"] .btn:disabled {
  opacity: 0.48;
}

body[data-bs-theme="dark"] .btn-index {
  width: auto;
  height: auto;
  margin: 0;
  background: transparent;
  font-family: var(--figma-mono);
  font-size: 11px;
}

body[data-bs-theme="dark"] .stepper {
  position: fixed;
  top: 9px;
  left: 50%;
  z-index: 65;
  width: max-content;
  max-width: calc(100vw - 600px);
  min-height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: translateX(-50%);
  overflow: hidden;
}

body[data-bs-theme="dark"] .step-line {
  display: none;
}

body[data-bs-theme="dark"] .step {
  min-height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 6px;
  background: rgba(105, 77, 212, 0.1);
  color: #b9a9f3;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

body[data-bs-theme="dark"] .step span {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-family: var(--figma-mono);
  font-size: 11px;
  font-weight: 700;
}

body[data-bs-theme="dark"] .step.is-done,
body[data-bs-theme="dark"] .step.is-active {
  background: rgba(105, 77, 212, 0.13);
  color: #b9a9f3;
}

body[data-bs-theme="dark"] .guide-status {
  min-height: 37px;
  margin: 0;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--figma-shell-2);
  color: var(--figma-muted);
  font-size: 12px;
  font-weight: 400;
}

body[data-bs-theme="dark"] .filters-toggle-bar {
  min-height: 49px;
  margin: 0;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--figma-bg);
}

body[data-bs-theme="dark"] .filters-toggle {
  min-height: 34px;
  padding: 0 11px;
  border-color: var(--figma-border-strong);
  border-radius: 6px;
  background: var(--figma-card-2);
  color: var(--figma-text);
  box-shadow: none;
}

body[data-bs-theme="dark"] .filters-toggle-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 6px;
  background: var(--figma-red);
}

body[data-bs-theme="dark"] .filters-toggle-icon::before {
  top: 6px;
  left: 7px;
}

body[data-bs-theme="dark"] .workspace,
body[data-bs-theme="dark"] #workspace.is-filters-hidden {
  margin: 0;
  padding: 0 24px 24px;
  display: block;
  background: var(--figma-bg);
}

body[data-bs-theme="dark"] #filtersSidebar {
  position: fixed;
  top: 116px;
  left: 24px;
  z-index: 80;
  width: 284px;
  max-height: calc(100vh - 132px);
  padding: 14px;
  border: 1px solid var(--figma-border);
  border-radius: var(--figma-radius);
  background: var(--figma-card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  transform: translateX(0);
  opacity: 1;
  overflow: auto;
}

body[data-bs-theme="dark"] #workspace.is-filters-hidden #filtersSidebar {
  transform: translateX(-112%);
  opacity: 0;
  pointer-events: none;
}

body[data-bs-theme="dark"] .sidebar-head {
  margin: -2px -2px 12px;
  padding: 0 2px 12px;
  border-bottom: 1px solid var(--figma-border);
  background: var(--figma-card);
}

body[data-bs-theme="dark"] .sidebar h2 {
  color: var(--figma-text-strong);
  font-size: 14px;
  font-weight: 700;
}

body[data-bs-theme="dark"] .main-content {
  width: 100%;
  display: block;
}

body[data-bs-theme="dark"] .context-bar {
  min-height: 41px;
  margin: 0;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--figma-border);
  border-radius: var(--figma-radius);
  background: var(--figma-shell-2);
}

body[data-bs-theme="dark"] .context-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body[data-bs-theme="dark"] .context-title h2 {
  display: none;
}

body[data-bs-theme="dark"] .context-title .tiny {
  color: var(--figma-muted);
  font-size: 11px;
}

body[data-bs-theme="dark"] .context-meta {
  margin: 0;
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

body[data-bs-theme="dark"] .context-meta span:not(.status-chip),
body[data-bs-theme="dark"] .status-chip {
  min-height: 24px;
  max-width: 32vw;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--figma-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--figma-muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-bs-theme="dark"] .status-chip.success,
body[data-bs-theme="dark"] .status-chip.info {
  border-color: rgba(34, 197, 94, 0.2);
  background: var(--figma-green-soft);
  color: var(--figma-green);
  font-weight: 600;
}

body[data-bs-theme="dark"] #importStatus {
  display: none;
}

body[data-bs-theme="dark"] .tab-nav {
  position: sticky;
  top: 57px;
  z-index: 50;
  height: 43px;
  margin: 10px -24px 0;
  padding: 0 24px;
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 0;
  border-bottom: 1px solid var(--figma-border);
  border-radius: 0;
  background: var(--figma-shell-2);
  overflow-x: auto;
  box-shadow: none;
}

body[data-bs-theme="dark"] .tab-btn {
  min-height: 43px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--figma-muted);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

body[data-bs-theme="dark"] .tab-btn:hover {
  border-bottom-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
  color: var(--figma-text);
}

body[data-bs-theme="dark"] .tab-btn.is-active {
  border-bottom-color: var(--figma-red);
  background: var(--figma-red-soft);
  color: #ffffff;
}

body[data-bs-theme="dark"] .tab-panel {
  max-width: 1600px;
  margin: 0;
  padding: 18px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body[data-bs-theme="dark"] .tab-panel > h3 {
  margin: 0 0 12px;
  color: var(--figma-text-strong);
  font-size: 18px;
  font-weight: 700;
}

body[data-bs-theme="dark"] .tab-panel > * + * {
  margin-top: var(--ui-card-gap);
}

body[data-bs-theme="dark"] .panel.nested,
body[data-bs-theme="dark"] .overview-hero,
body[data-bs-theme="dark"] .quality-hero,
body[data-bs-theme="dark"] .segments-hero,
body[data-bs-theme="dark"] .direction-hero,
body[data-bs-theme="dark"] .satisfaction-hero,
body[data-bs-theme="dark"] .admin-hero,
body[data-bs-theme="dark"] #panel-overview .overview-section,
body[data-bs-theme="dark"] #panel-retention #retentionMainSection,
body[data-bs-theme="dark"] #panel-satisfaction #satisfactionReasonsSection,
body[data-bs-theme="dark"] #panel-admin .admin-grid > .panel.nested {
  padding: 16px;
  border: 1px solid var(--figma-border);
  border-radius: var(--figma-radius);
  background: var(--figma-card);
  color: var(--figma-text);
  box-shadow: none;
}

body[data-bs-theme="dark"] .overview-hero,
body[data-bs-theme="dark"] .segments-hero,
body[data-bs-theme="dark"] .direction-hero,
body[data-bs-theme="dark"] .quality-hero,
body[data-bs-theme="dark"] .satisfaction-hero,
body[data-bs-theme="dark"] .admin-hero {
  background:
    linear-gradient(115deg, rgba(105, 77, 212, 0.1) 0%, rgba(105, 77, 212, 0) 30%),
    var(--figma-card);
}

body[data-bs-theme="dark"] #panel-overview .overview-hero {
  margin-top: 0;
  padding: 16px;
}

body[data-bs-theme="dark"] .overview-hero-head,
body[data-bs-theme="dark"] .panel-head {
  margin: 0 0 12px;
  padding: 0 0 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--figma-border);
}

body[data-bs-theme="dark"] .overview-hero-head {
  align-items: center;
}

body[data-bs-theme="dark"] .overview-hero h3,
body[data-bs-theme="dark"] .panel-head h4 {
  color: var(--figma-text-strong);
  font-size: 14px;
  font-weight: 700;
}

body[data-bs-theme="dark"] .overview-eyebrow,
body[data-bs-theme="dark"] .kpi-label,
body[data-bs-theme="dark"] .overview-meta-label,
body[data-bs-theme="dark"] .segment-metric-label,
body[data-bs-theme="dark"] .direction-summary-label,
body[data-bs-theme="dark"] .quality-summary-label,
body[data-bs-theme="dark"] .satisfaction-summary-label,
body[data-bs-theme="dark"] .admin-summary-label {
  color: var(--figma-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body[data-bs-theme="dark"] .muted,
body[data-bs-theme="dark"] .tiny,
body[data-bs-theme="dark"] p {
  color: var(--figma-muted);
}

body[data-bs-theme="dark"] #panel-overview .overview-hero-tools {
  display: grid;
  grid-template-columns: max-content minmax(150px, 180px) minmax(190px, max-content) max-content;
  align-items: end;
  gap: 10px;
}

body[data-bs-theme="dark"] .overview-hero-footer {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

body[data-bs-theme="dark"] .overview-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-bs-theme="dark"] .overview-chip,
body[data-bs-theme="dark"] .satisfaction-tag-chip,
body[data-bs-theme="dark"] .satisfaction-inline-tag {
  min-height: 24px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--figma-border);
  border-radius: 6px;
  background: var(--figma-card-2);
  color: var(--figma-muted);
  font-size: 11px;
  font-weight: 600;
}

body[data-bs-theme="dark"] .overview-chip:hover,
body[data-bs-theme="dark"] .satisfaction-tag-chip:hover,
body[data-bs-theme="dark"] .satisfaction-inline-tag:hover {
  border-color: rgba(105, 77, 212, 0.44);
  background: var(--figma-red-soft);
  color: #ffffff;
}

body[data-bs-theme="dark"] .overview-meta-grid,
body[data-bs-theme="dark"] .kpi-grid,
body[data-bs-theme="dark"] .segments-summary-grid,
body[data-bs-theme="dark"] .quality-summary-grid,
body[data-bs-theme="dark"] .satisfaction-summary-grid,
body[data-bs-theme="dark"] .direction-summary-grid,
body[data-bs-theme="dark"] .admin-summary-grid {
  display: grid;
  gap: 10px;
}

body[data-bs-theme="dark"] .overview-meta-grid,
body[data-bs-theme="dark"] .segments-summary-grid,
body[data-bs-theme="dark"] .quality-summary-grid,
body[data-bs-theme="dark"] .satisfaction-summary-grid,
body[data-bs-theme="dark"] .direction-summary-grid,
body[data-bs-theme="dark"] .admin-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-bs-theme="dark"] #panel-overview #kpiCards,
body[data-bs-theme="dark"] #panel-direction #directionKpiCards,
body[data-bs-theme="dark"] #panel-satisfaction #satisfactionCards {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

body[data-bs-theme="dark"] .kpi-card,
body[data-bs-theme="dark"] .overview-meta-card,
body[data-bs-theme="dark"] .segment-metric-card,
body[data-bs-theme="dark"] .direction-summary-card,
body[data-bs-theme="dark"] .quality-summary-card,
body[data-bs-theme="dark"] .satisfaction-summary-card,
body[data-bs-theme="dark"] .admin-summary-card,
body[data-bs-theme="dark"] #panel-direction #directionKpiCards .direction-kpi-card {
  min-height: 92px;
  padding: 12px 14px;
  border: 1px solid var(--figma-border);
  border-radius: var(--figma-radius);
  background: var(--figma-card);
  color: var(--figma-text);
  box-shadow: none;
}

body[data-bs-theme="dark"] .kpi-card:hover,
body[data-bs-theme="dark"] .overview-meta-card:hover,
body[data-bs-theme="dark"] .segment-metric-card:hover,
body[data-bs-theme="dark"] .direction-summary-card:hover,
body[data-bs-theme="dark"] .quality-summary-card:hover,
body[data-bs-theme="dark"] .satisfaction-summary-card:hover,
body[data-bs-theme="dark"] .admin-summary-card:hover {
  border-color: var(--figma-border-strong);
  background: #17223a;
}

body[data-bs-theme="dark"] .kpi-value,
body[data-bs-theme="dark"] .overview-meta-value,
body[data-bs-theme="dark"] .segment-metric-value,
body[data-bs-theme="dark"] .direction-summary-value,
body[data-bs-theme="dark"] .quality-summary-value,
body[data-bs-theme="dark"] .satisfaction-summary-value,
body[data-bs-theme="dark"] .admin-summary-value {
  margin-top: 6px;
  color: var(--figma-text-strong);
  font-family: var(--figma-mono);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.1;
}

body[data-bs-theme="dark"] .overview-meta-value,
body[data-bs-theme="dark"] .segment-metric-value,
body[data-bs-theme="dark"] .direction-summary-value,
body[data-bs-theme="dark"] .quality-summary-value,
body[data-bs-theme="dark"] .satisfaction-summary-value,
body[data-bs-theme="dark"] .admin-summary-value {
  font-size: 20px;
}

body[data-bs-theme="dark"] .overview-grid,
body[data-bs-theme="dark"] .survey-grid,
body[data-bs-theme="dark"] .segments-top-grid,
body[data-bs-theme="dark"] .direction-detail-layout,
body[data-bs-theme="dark"] .admin-grid {
  display: grid;
  gap: 14px;
}

body[data-bs-theme="dark"] #adminSettingsSection {
  --readable-panel-pad: clamp(14px, 1.2vw, 18px);
  --panel-head-gap: 10px;
  --panel-head-padding-bottom: 10px;
  --panel-head-margin-bottom: 0;
  --row-actions-gap: 8px;
  --form-grid-gap: 10px;
  --form-grid-row-gap: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px;
  row-gap: 12px;
  align-items: start;
}

body[data-bs-theme="dark"] #adminSettingsSection > .panel-head {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  align-self: center;
}

body[data-bs-theme="dark"] #adminSettingsSection > .row-actions {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  margin: 0;
}

body[data-bs-theme="dark"] #adminSettingsSection > #settingsStatus {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: start;
  margin: 0;
}

body[data-bs-theme="dark"] #adminSettingsSection > .form-grid {
  grid-column: 1 / -1;
  grid-row: 3;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  align-items: end;
}

body[data-bs-theme="dark"] #adminSnapshotsSection > .snapshot-primary-actions {
  margin-top: 16px;
}

@media (max-width: 760px) {
  body[data-bs-theme="dark"] #adminSettingsSection {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-bs-theme="dark"] #adminSettingsSection > .panel-head,
  body[data-bs-theme="dark"] #adminSettingsSection > .row-actions,
  body[data-bs-theme="dark"] #adminSettingsSection > #settingsStatus,
  body[data-bs-theme="dark"] #adminSettingsSection > .form-grid {
    grid-column: 1;
    grid-row: auto;
  }

  body[data-bs-theme="dark"] #adminSettingsSection > .row-actions {
    justify-content: flex-start;
  }

  body[data-bs-theme="dark"] #adminSettingsSection > .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Daily chart series controls */
.daily-series-filters {
  min-width: 0;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(20, 22, 24, 0.1);
  border-radius: 7px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  background: #f8f9fa;
}

.daily-series-filters legend {
  float: left;
  margin: 0 4px 0 0;
  padding: 0;
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 700;
}

.daily-series-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  color: var(--gray-800);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.daily-series-filter input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--red-600);
}

.daily-series-swatch {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
}

.daily-series-filter.is-total .daily-series-swatch {
  color: #2563eb;
}

.daily-series-filter.is-cumulative .daily-series-swatch,
.daily-series-filter.is-newsletters .daily-series-swatch {
  color: #f87171;
}

.daily-series-filter.is-cumulative .daily-series-swatch {
  height: 2px;
  background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px);
}

.daily-series-filter.is-paid .daily-series-swatch {
  color: #0e7490;
}

.daily-series-filter.is-free .daily-series-swatch {
  color: #f59e0b;
}

.daily-series-filter.is-outstanding .daily-series-swatch {
  color: #6a4bb0;
}

.daily-series-reset.btn {
  min-height: 30px;
  margin-left: auto;
  padding: 5px 10px;
  font-size: 11px;
}

.daily-series-reset:disabled {
  opacity: 0.5;
  cursor: default;
}

body[data-color-theme="dark"] .daily-series-filters {
  border-color: rgba(203, 213, 225, 0.16);
  background: rgba(15, 23, 42, 0.56);
}

body[data-color-theme="dark"] .daily-series-filters legend,
body[data-color-theme="dark"] .daily-series-filter {
  color: var(--theme-text);
}

/* Ranked city markers keep dense maps readable. */
.rsm-location-row.has-index {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 7px;
}

.rsm-location-row .rsm-location-index {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(14, 116, 144, 0.3);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  overflow: visible;
  background: rgba(14, 116, 144, 0.1);
  color: #0e7490;
  font-family: var(--figma-mono);
  font-size: 10px;
  font-weight: 800;
}

.rsm-location-row .rsm-location-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rsm-city-marker-index {
  fill: #ffffff;
  font-family: var(--figma-mono);
  font-size: 8px;
  font-weight: 800;
  pointer-events: none;
}

.rsm-france-scope-note {
  padding-top: 10px;
  border-top: 1px solid rgba(20, 22, 24, 0.1);
}

.rsm-map-controls .rsm-map-export {
  min-width: 44px;
}

.rsm-map-controls .rsm-map-export:disabled {
  opacity: 0.6;
  cursor: wait;
}

body[data-color-theme="dark"] .rsm-location-row .rsm-location-index {
  border-color: rgba(34, 211, 238, 0.36);
  background: rgba(34, 211, 238, 0.12);
  color: #67e8f9;
}

body[data-color-theme="dark"] .rsm-france-scope-note {
  border-top-color: rgba(203, 213, 225, 0.12);
}

@media (max-width: 760px) {
  .daily-series-filters {
    align-items: flex-start;
  }

  .daily-series-filters legend {
    width: 100%;
    margin-bottom: 2px;
  }

  .daily-series-reset.btn {
    margin-left: 0;
  }
}

body[data-bs-theme="dark"] #panel-overview #overviewChartsBlock {
  grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.1fr);
}

body[data-bs-theme="dark"] #panel-overview #overviewChartsBlock .full-width {
  grid-column: auto;
}

body[data-bs-theme="dark"] #panel-segments .segments-top-grid {
  grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.1fr);
}

body[data-bs-theme="dark"] .chart-frame {
  height: 280px;
  padding: 0;
  border: 1px solid var(--figma-border);
  border-radius: var(--figma-radius);
  background: #0f172a;
}

body[data-bs-theme="dark"] .chart-frame.large {
  height: 320px;
}

body[data-bs-theme="dark"] .chart-frame.small {
  height: 220px;
}

body[data-bs-theme="dark"] #countryMapPanel .chart-frame {
  height: clamp(420px, 56vh, 720px);
  background: #0d1830;
}

body[data-bs-theme="dark"] #countryMap,
body[data-bs-theme="dark"] #countryMapPanel .js-plotly-plot {
  width: 100%;
  height: 100%;
}

body[data-bs-theme="dark"] .react-country-map-host,
body[data-bs-theme="dark"] .rsm-map-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
}

body[data-bs-theme="dark"] .rsm-map-shell {
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 12px;
  background: radial-gradient(circle at 42% 42%, rgba(30, 45, 74, 0.55), rgba(10, 16, 32, 0.96) 62%);
}

body[data-bs-theme="dark"] .rsm-map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--figma-radius);
  background: #091225;
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
  cursor: grab;
}

body[data-bs-theme="dark"] .rsm-map-stage.is-dragging {
  cursor: grabbing;
}

body[data-bs-theme="dark"] .rsm-map-svg {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
}

body[data-bs-theme="dark"] .rsm-map-controls {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
}

body[data-bs-theme="dark"] .rsm-map-controls button {
  min-width: 31px;
  height: 31px;
  padding: 0 9px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--figma-text-strong);
  font-family: var(--figma-mono);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

body[data-bs-theme="dark"] .rsm-map-controls button:hover,
body[data-bs-theme="dark"] .rsm-map-controls button:focus-visible {
  border-color: rgba(185, 169, 243, 0.42);
  background: rgba(105, 77, 212, 0.32);
  outline: none;
}

body[data-bs-theme="dark"] .rsm-marker-label {
  paint-order: stroke;
  stroke: rgba(9, 18, 37, 0.92);
  stroke-width: 3px;
  stroke-linejoin: round;
  fill: var(--figma-text-strong);
  font-family: var(--figma-font);
  font-size: 8px;
  font-weight: 900;
  pointer-events: none;
}

body[data-bs-theme="dark"] .rsm-map-detail {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--figma-radius);
  background: rgba(15, 23, 42, 0.82);
  overflow: auto;
}

body[data-bs-theme="dark"] .rsm-detail-label {
  margin: 0 0 8px;
  color: var(--figma-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

body[data-bs-theme="dark"] .rsm-map-detail h5 {
  margin: 0;
  color: var(--figma-text-strong);
  font-size: 16px;
}

body[data-bs-theme="dark"] .rsm-detail-total {
  margin: 4px 0 14px;
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 800;
}

body[data-bs-theme="dark"] .rsm-country-list,
body[data-bs-theme="dark"] .rsm-location-group {
  display: grid;
  gap: 7px;
}

body[data-bs-theme="dark"] .rsm-country-row,
body[data-bs-theme="dark"] .rsm-location-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body[data-bs-theme="dark"] .rsm-country-row {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 7px;
  background: rgba(30, 45, 74, 0.54);
  color: var(--figma-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

body[data-bs-theme="dark"] .rsm-country-row:hover,
body[data-bs-theme="dark"] .rsm-country-row:focus-visible {
  border-color: rgba(185, 169, 243, 0.42);
  background: rgba(105, 77, 212, 0.18);
  outline: none;
}

body[data-bs-theme="dark"] .rsm-country-row span,
body[data-bs-theme="dark"] .rsm-location-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-bs-theme="dark"] .rsm-country-row strong,
body[data-bs-theme="dark"] .rsm-location-row strong {
  color: var(--figma-text-strong);
  font-family: var(--figma-mono);
  font-size: 12px;
}

body[data-bs-theme="dark"] .rsm-location-group + .rsm-location-group {
  margin-top: 14px;
}

body[data-bs-theme="dark"] .rsm-location-group h6 {
  margin: 0 0 2px;
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

body[data-bs-theme="dark"] .rsm-location-row {
  padding: 6px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  color: var(--figma-text);
  font-size: 12px;
}

body[data-bs-theme="dark"] .rsm-map-muted {
  margin: 12px 0 0;
  color: var(--figma-muted);
  font-size: 12px;
  line-height: 1.45;
}

body[data-bs-theme="dark"] .rsm-map-tooltip {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  max-width: 240px;
  padding: 8px 10px;
  display: grid;
  gap: 2px;
  border: 1px solid rgba(185, 169, 243, 0.32);
  border-radius: 7px;
  background: rgba(10, 16, 32, 0.94);
  color: var(--figma-text);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

body[data-bs-theme="dark"] .rsm-map-tooltip strong {
  color: var(--figma-text-strong);
  font-size: 12px;
}

body[data-bs-theme="dark"] .rsm-map-tooltip span {
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 800;
}

body[data-bs-theme="dark"] .rsm-map-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--figma-muted);
  font-size: 10px;
  font-weight: 800;
}

body[data-bs-theme="dark"] .rsm-map-legend div {
  width: 98px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e9e5ff, #a994ed, #694dd4);
}

body[data-bs-theme="dark"] .react-map-loading,
body[data-bs-theme="dark"] .react-map-fallback {
  width: 100%;
  height: 100%;
  min-height: 280px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--figma-muted);
  font-size: 12px;
  text-align: center;
}

body[data-bs-theme="dark"] .react-map-fallback {
  place-items: stretch;
  align-content: center;
  gap: 10px;
}

body[data-bs-theme="dark"] .react-map-fallback-title {
  margin: 0;
  color: var(--figma-text-strong);
  font-weight: 800;
}

body[data-bs-theme="dark"] .react-map-fallback-copy {
  margin: 0;
}

body[data-bs-theme="dark"] .react-map-fallback ul {
  max-width: 420px;
  width: min(420px, 100%);
  margin: 0 auto;
  padding: 0;
  display: grid;
  gap: 6px;
  list-style: none;
}

body[data-bs-theme="dark"] .react-map-fallback li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

body[data-bs-theme="dark"] #countryMapPanel:fullscreen,
body[data-bs-theme="dark"] #countryMapPanel:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--figma-bg);
}

body[data-bs-theme="dark"] #countryMapPanel:fullscreen .panel-head,
body[data-bs-theme="dark"] #countryMapPanel:-webkit-full-screen .panel-head {
  flex: 0 0 auto;
}

body[data-bs-theme="dark"] #countryMapPanel:fullscreen .map-hint,
body[data-bs-theme="dark"] #countryMapPanel:-webkit-full-screen .map-hint {
  flex: 0 0 auto;
  margin-bottom: 8px;
}

body[data-bs-theme="dark"] #countryMapPanel:fullscreen .chart-frame,
body[data-bs-theme="dark"] #countryMapPanel:-webkit-full-screen .chart-frame {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

body[data-bs-theme="dark"] #countryMapPanel:fullscreen .rsm-map-shell,
body[data-bs-theme="dark"] #countryMapPanel:-webkit-full-screen .rsm-map-shell {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
}

body[data-bs-theme="dark"] #panel-segments .specialty-chart-frame {
  height: clamp(420px, 52vh, 560px);
}

body[data-bs-theme="dark"] .insight-box {
  padding: 14px 16px;
  border: 1px solid rgba(105, 77, 212, 0.28);
  border-radius: var(--figma-radius);
  background: rgba(105, 77, 212, 0.08);
  color: var(--figma-text);
}

body[data-bs-theme="dark"] .insight-box h4,
body[data-bs-theme="dark"] .insight-box li {
  color: var(--figma-text);
}

body[data-bs-theme="dark"] .field {
  gap: 5px;
  margin: 0;
  color: var(--figma-muted);
  font-size: 11px;
  font-weight: 600;
}

body[data-bs-theme="dark"] .field input:not([type="checkbox"]):not([type="radio"]),
body[data-bs-theme="dark"] .field select,
body[data-bs-theme="dark"] .field textarea {
  min-height: 33px;
  padding: 0 10px;
  border: 1px solid var(--figma-border);
  border-radius: 6px;
  background: var(--figma-input);
  color: var(--figma-text);
  font-size: 12px;
  box-shadow: none;
}

body[data-bs-theme="dark"] .field textarea {
  min-height: 78px;
  padding-top: 8px;
}

body[data-bs-theme="dark"] .field input::placeholder,
body[data-bs-theme="dark"] .field textarea::placeholder {
  color: var(--figma-muted-dark);
}

body[data-bs-theme="dark"] .field input:focus-visible,
body[data-bs-theme="dark"] .field select:focus-visible,
body[data-bs-theme="dark"] .field textarea:focus-visible {
  border-color: rgba(105, 77, 212, 0.65);
  box-shadow: 0 0 0 3px rgba(105, 77, 212, 0.22);
}

body[data-bs-theme="dark"] .overview-inline-check {
  min-height: 33px;
  padding: 0 10px;
  flex-direction: row;
  align-items: center;
  border: 1px solid var(--figma-border);
  border-radius: 6px;
  background: var(--figma-input);
}

body[data-bs-theme="dark"] input[type="checkbox"] {
  accent-color: var(--figma-red);
}

body[data-bs-theme="dark"] .form-grid,
body[data-bs-theme="dark"] .cross-config-grid,
body[data-bs-theme="dark"] .newsletter-form-grid,
body[data-bs-theme="dark"] .quality-filter-grid,
body[data-bs-theme="dark"] .satisfaction-filter-grid,
body[data-bs-theme="dark"] .admin-snapshot-filter-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  align-items: end;
}

body[data-bs-theme="dark"] .newsletter-form-grid {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
}

body[data-bs-theme="dark"] .row-actions,
body[data-bs-theme="dark"] .cross-toolbar,
body[data-bs-theme="dark"] .panel-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-bs-theme="dark"] .status-text:not(:empty) {
  min-height: 26px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--figma-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--figma-muted);
  font-size: 11px;
}

body[data-bs-theme="dark"] .status-text.success:not(:empty) {
  border-color: rgba(34, 197, 94, 0.22);
  background: var(--figma-green-soft);
  color: var(--figma-green);
}

body[data-bs-theme="dark"] .status-text.warning:not(:empty) {
  border-color: rgba(245, 158, 11, 0.22);
  background: rgba(245, 158, 11, 0.08);
  color: var(--figma-amber);
}

body[data-bs-theme="dark"] .status-text.error:not(:empty) {
  border-color: rgba(105, 77, 212, 0.28);
  background: rgba(105, 77, 212, 0.1);
  color: #f87171;
}

body[data-bs-theme="dark"] .table-wrap {
  margin-top: 12px;
  max-height: 480px;
  border: 1px solid var(--figma-border);
  border-radius: var(--figma-radius);
  background: var(--figma-card);
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

body[data-bs-theme="dark"] table {
  width: 100%;
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--figma-text);
  font-size: 12px;
}

body[data-bs-theme="dark"] thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

body[data-bs-theme="dark"] th {
  height: 34px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--figma-border);
  background: var(--figma-card-2);
  color: var(--figma-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

body[data-bs-theme="dark"] td {
  height: 36px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
  color: var(--figma-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  vertical-align: middle;
  white-space: nowrap;
}

body[data-bs-theme="dark"] tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

body[data-bs-theme="dark"] tbody tr:hover {
  background: rgba(255, 255, 255, 0.045);
}

body[data-bs-theme="dark"] td[colspan] {
  padding: 22px;
  color: var(--figma-muted);
  text-align: center;
}

@media (min-width: 1200px) {
  body[data-bs-theme="dark"] .table-wrap table th:first-child,
  body[data-bs-theme="dark"] .table-wrap table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
  }

  body[data-bs-theme="dark"] .table-wrap table th:first-child {
    z-index: 6;
    background: var(--figma-card-2);
  }

  body[data-bs-theme="dark"] .table-wrap table td:first-child {
    background: var(--figma-card);
  }
}

body[data-bs-theme="dark"] .cross-table-wrap table td,
body[data-bs-theme="dark"] .participants-table-wrap table td,
body[data-bs-theme="dark"] #annualComparisonBody td,
body[data-bs-theme="dark"] #newslettersBody td {
  font-family: var(--figma-mono);
  font-size: 11px;
}

body[data-bs-theme="dark"] .participants-table-wrap table td:nth-child(1),
body[data-bs-theme="dark"] .participants-table-wrap table td:nth-child(2),
body[data-bs-theme="dark"] .participants-table-wrap table td:nth-child(4),
body[data-bs-theme="dark"] #newslettersBody td:nth-child(2) {
  font-family: var(--figma-font);
}

body[data-bs-theme="dark"] .table-sort-btn {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-transform: inherit;
  cursor: pointer;
}

body[data-bs-theme="dark"] .table-sort-btn:hover,
body[data-bs-theme="dark"] .table-sort-btn:focus-visible {
  color: #ffffff;
  outline: none;
}

body[data-bs-theme="dark"] .table-sort-btn.is-sorted::after {
  content: attr(data-sort-dir);
  display: inline-block;
  margin-left: 6px;
  color: #fca5a5;
  font-family: var(--figma-mono);
  font-size: 9px;
}

body[data-bs-theme="dark"] #crossTableBody td:not(:first-child),
body[data-bs-theme="dark"] #annualComparisonBody td:not(:first-child) {
  color: var(--figma-blue);
  text-align: center;
}

body[data-bs-theme="dark"] #crossTableHead th:not(:first-child) {
  text-align: center;
}

body[data-bs-theme="dark"] #crossTableBody td:last-child,
body[data-bs-theme="dark"] #annualComparisonBody td:nth-child(4),
body[data-bs-theme="dark"] #annualComparisonBody td:nth-child(5) {
  color: var(--figma-text-strong);
}

body[data-bs-theme="dark"] .status-chip {
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--figma-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--figma-muted);
  font-size: 11px;
}

body[data-bs-theme="dark"] .status-chip.success,
body[data-bs-theme="dark"] .status-chip.info {
  border-color: rgba(34, 197, 94, 0.2);
  background: var(--figma-green-soft);
  color: var(--figma-green);
}

@media (max-width: 1500px) {
  body[data-bs-theme="dark"] .stepper {
    display: none;
  }

  body[data-bs-theme="dark"] .top-header {
    grid-template-columns: minmax(180px, 1fr) minmax(260px, auto);
  }

  body[data-bs-theme="dark"] .header-actions {
    grid-column: auto;
  }
}

@media (max-width: 1180px) {
  body[data-bs-theme="dark"] .top-header {
    position: static;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  body[data-bs-theme="dark"] .header-actions {
    justify-content: flex-start;
  }

  body[data-bs-theme="dark"] .tab-nav {
    position: static;
  }

  body[data-bs-theme="dark"] .context-bar,
  body[data-bs-theme="dark"] .context-title,
  body[data-bs-theme="dark"] .context-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-bs-theme="dark"] .context-meta {
    width: 100%;
    justify-content: flex-start;
  }

  body[data-bs-theme="dark"] .overview-meta-grid,
  body[data-bs-theme="dark"] .segments-summary-grid,
  body[data-bs-theme="dark"] .quality-summary-grid,
  body[data-bs-theme="dark"] .satisfaction-summary-grid,
  body[data-bs-theme="dark"] .direction-summary-grid,
  body[data-bs-theme="dark"] .admin-summary-grid,
  body[data-bs-theme="dark"] #panel-overview #kpiCards,
  body[data-bs-theme="dark"] #panel-direction #directionKpiCards,
  body[data-bs-theme="dark"] #panel-satisfaction #satisfactionCards,
  body[data-bs-theme="dark"] #panel-overview #overviewChartsBlock,
  body[data-bs-theme="dark"] #panel-segments .segments-top-grid,
  body[data-bs-theme="dark"] .form-grid,
  body[data-bs-theme="dark"] .cross-config-grid,
  body[data-bs-theme="dark"] .newsletter-form-grid,
  body[data-bs-theme="dark"] .quality-filter-grid,
  body[data-bs-theme="dark"] .satisfaction-filter-grid,
  body[data-bs-theme="dark"] .admin-snapshot-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-bs-theme="dark"] .workspace,
  body[data-bs-theme="dark"] #workspace.is-filters-hidden {
    padding: 0 10px 18px;
  }

  body[data-bs-theme="dark"] .guide-status,
  body[data-bs-theme="dark"] .filters-toggle-bar {
    padding-left: 10px;
    padding-right: 10px;
  }

  body[data-bs-theme="dark"] .overview-meta-grid,
  body[data-bs-theme="dark"] .segments-summary-grid,
  body[data-bs-theme="dark"] .quality-summary-grid,
  body[data-bs-theme="dark"] .satisfaction-summary-grid,
  body[data-bs-theme="dark"] .direction-summary-grid,
  body[data-bs-theme="dark"] .admin-summary-grid,
  body[data-bs-theme="dark"] #panel-overview #kpiCards,
  body[data-bs-theme="dark"] #panel-direction #directionKpiCards,
  body[data-bs-theme="dark"] #panel-satisfaction #satisfactionCards,
  body[data-bs-theme="dark"] #panel-overview #overviewChartsBlock,
  body[data-bs-theme="dark"] #panel-segments .segments-top-grid,
  body[data-bs-theme="dark"] .form-grid,
  body[data-bs-theme="dark"] .cross-config-grid,
  body[data-bs-theme="dark"] .newsletter-form-grid,
  body[data-bs-theme="dark"] .quality-filter-grid,
  body[data-bs-theme="dark"] .satisfaction-filter-grid,
  body[data-bs-theme="dark"] .admin-snapshot-filter-grid {
    grid-template-columns: 1fr;
  }

  body[data-bs-theme="dark"] #filtersSidebar {
    left: 10px;
    right: 10px;
    width: auto;
  }

  body[data-bs-theme="dark"] .overview-hero-head,
  body[data-bs-theme="dark"] .panel-head,
  body[data-bs-theme="dark"] #panel-overview .overview-hero-tools {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
}

/* Layout fixes: keep navigation readable and filters in the page flow. */
body[data-bs-theme="dark"] .top-header {
  min-height: 57px;
  grid-template-columns: minmax(180px, 1fr) max-content;
  align-items: center;
}

body[data-bs-theme="dark"] .header-actions {
  grid-column: 2;
  min-width: 0;
  width: max-content;
  max-width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  overflow-x: auto;
  overflow-y: hidden;
}

body[data-bs-theme="dark"] .header-actions .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

body[data-bs-theme="dark"] .stepper {
  position: sticky;
  top: 57px;
  left: auto;
  z-index: 55;
  width: 100%;
  max-width: none;
  min-height: 42px;
  padding: 6px 24px;
  display: flex;
  justify-content: center;
  transform: none;
  border-bottom: 1px solid var(--figma-border);
  background: var(--figma-shell);
  overflow-x: auto;
  overflow-y: hidden;
}

body[data-bs-theme="dark"] .step {
  flex: 0 0 auto;
}

body[data-bs-theme="dark"] .guide-status {
  position: relative;
  z-index: 1;
}

body[data-bs-theme="dark"] .workspace {
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 0 24px 24px;
  transition:
    grid-template-columns 320ms cubic-bezier(0.16, 1, 0.3, 1),
    gap 320ms ease;
}

body[data-bs-theme="dark"] #workspace.is-filters-hidden {
  display: grid;
  grid-template-columns: 0 minmax(0, 1fr);
  gap: 0;
  padding: 0 24px 24px;
}

body[data-bs-theme="dark"] #filtersSidebar {
  position: sticky;
  top: 111px;
  left: auto;
  z-index: 20;
  width: auto;
  min-width: 0;
  max-height: calc(100vh - 126px);
  transform: none;
  opacity: 1;
  box-shadow: none;
  overflow: auto;
  transition:
    transform 320ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 220ms ease,
    padding 320ms ease,
    border-color 320ms ease,
    box-shadow 320ms ease,
    max-height 320ms ease;
  will-change: transform, opacity;
}

body[data-bs-theme="dark"] #filtersSidebar > * {
  transition: opacity 180ms ease;
}

body[data-bs-theme="dark"] #workspace.is-filters-hidden #filtersSidebar {
  padding-left: 0;
  padding-right: 0;
  border-color: transparent;
  opacity: 0;
  transform: translateX(-32px);
  pointer-events: none;
  overflow: hidden;
}

body[data-bs-theme="dark"] #workspace.is-filters-hidden #filtersSidebar > * {
  opacity: 0;
}

body[data-bs-theme="dark"] .main-content,
body[data-bs-theme="dark"] .context-bar,
body[data-bs-theme="dark"] .tab-panel,
body[data-bs-theme="dark"] .overview-hero,
body[data-bs-theme="dark"] .panel.nested,
body[data-bs-theme="dark"] .table-wrap,
body[data-bs-theme="dark"] .kpi-card,
body[data-bs-theme="dark"] .overview-meta-card {
  min-width: 0;
  width: 100%;
}

body[data-bs-theme="dark"] .tab-panel {
  max-width: none;
}

body[data-bs-theme="dark"] .tab-nav {
  top: 99px;
  margin: 10px 0 0;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

body[data-bs-theme="dark"] .context-meta span:not(.status-chip),
body[data-bs-theme="dark"] .status-chip {
  max-width: min(34vw, 520px);
}

@media (max-width: 1180px) {
  body[data-bs-theme="dark"] .top-header {
    position: sticky;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  body[data-bs-theme="dark"] .header-actions {
    grid-column: auto;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  body[data-bs-theme="dark"] .stepper {
    position: static;
    justify-content: flex-start;
  }

  body[data-bs-theme="dark"] .workspace,
  body[data-bs-theme="dark"] #workspace.is-filters-hidden {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-bs-theme="dark"] #filtersSidebar {
    position: static;
    width: 100%;
    max-height: none;
  }

  body[data-bs-theme="dark"] #workspace.is-filters-hidden #filtersSidebar {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    transform: translateX(-24px);
  }

  body[data-bs-theme="dark"] .tab-nav {
    position: static;
    margin-top: 10px;
  }

  body[data-bs-theme="dark"] .context-meta span:not(.status-chip),
  body[data-bs-theme="dark"] .status-chip {
    max-width: 100%;
  }
}

/* Dark table contrast fixes: prevent legacy light rows and hover states. */
body[data-bs-theme="dark"] .status-text:not(:empty) {
  border-color: var(--figma-border);
  background: rgba(30, 45, 74, 0.78);
  color: var(--figma-text);
}

body[data-bs-theme="dark"] .table-wrap,
body[data-bs-theme="dark"] #panel-overview #overviewNewslettersSection .table-wrap,
body[data-bs-theme="dark"] #panel-overview #overviewAnnualSection .table-wrap,
body[data-bs-theme="dark"] #panel-segments .cross-table-wrap,
body[data-bs-theme="dark"] #panel-segments .participants-table-wrap,
body[data-bs-theme="dark"] #panel-admin .admin-snapshot-table-wrap {
  border-color: var(--figma-border);
  background: var(--figma-card);
  color: var(--figma-text);
}

body[data-bs-theme="dark"] .table-wrap table,
body[data-bs-theme="dark"] .table-wrap thead,
body[data-bs-theme="dark"] .table-wrap tbody {
  background: transparent;
  color: var(--figma-text);
}

body[data-bs-theme="dark"] .table-wrap table th,
body[data-bs-theme="dark"] .table-wrap table thead th:first-child {
  border-color: var(--figma-border);
  background: var(--figma-card-2);
  color: #bfdbfe;
}

body[data-bs-theme="dark"] .table-wrap table tbody tr {
  background: var(--figma-card);
}

body[data-bs-theme="dark"] .table-wrap table tbody tr:nth-child(even) {
  background: #17223a;
}

body[data-bs-theme="dark"] .table-wrap table td,
body[data-bs-theme="dark"] .table-wrap table tbody td:first-child {
  border-color: rgba(255, 255, 255, 0.055);
  background: transparent;
  color: var(--figma-text);
}

body[data-bs-theme="dark"] .table-wrap table tbody tr td:first-child {
  background: var(--figma-card);
  color: var(--figma-text-strong);
}

body[data-bs-theme="dark"] .table-wrap table tbody tr:nth-child(even) td:first-child {
  background: #17223a;
}

body[data-bs-theme="dark"] .table-wrap table tbody tr:hover,
body[data-bs-theme="dark"] .table-wrap table tbody tr:hover td,
body[data-bs-theme="dark"] .table-wrap table tbody tr:hover td:first-child {
  background: #20304f;
  color: var(--figma-text-strong);
}

body[data-bs-theme="dark"] #crossTableBody td:not(:first-child),
body[data-bs-theme="dark"] #annualComparisonBody td:not(:first-child) {
  color: #60a5fa;
}

body[data-bs-theme="dark"] #crossTableBody tr:hover td:not(:first-child),
body[data-bs-theme="dark"] #annualComparisonBody tr:hover td:not(:first-child) {
  color: #93c5fd;
}

/* Mapping screen: remove legacy light cards and stabilize the layout. */
body[data-bs-theme="dark"] #panel-mapping .mapping-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-health-block {
  margin-top: 12px;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-health-block .mapping-summary-bar {
  margin-top: 0;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-progress {
  height: 10px;
  border: 1px solid #d9d2f3;
  border-radius: 999px;
  background: #efecfb;
  overflow: hidden;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--figma-red) 0%, #b9a9f3 100%);
}

body[data-bs-theme="dark"] #panel-mapping .mapping-progress-fill.is-good {
  background: linear-gradient(90deg, #16a34a 0%, #4ade80 100%);
}

body[data-bs-theme="dark"] #panel-mapping .mapping-progress-fill.is-warning {
  background: linear-gradient(90deg, #d97706 0%, #fbbf24 100%);
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-progress {
  border-color: rgba(148, 163, 184, 0.24);
  background: #0f172a;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-actions {
  margin-top: 0;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-command-bar {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-command-bar .mapping-filter-grid {
  margin: 0;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-inline-control {
  min-height: 33px;
  padding: 0 10px;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--figma-border);
  border-radius: 6px;
  background: rgba(30, 45, 74, 0.72);
  color: var(--figma-muted);
}

body[data-bs-theme="dark"] #panel-mapping .mapping-config-actions {
  grid-column: auto;
  min-width: 0;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-config-workspace {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

body[data-bs-theme="dark"] #panel-mapping .mapping-config-workspace > .mapping-section-head {
  margin-bottom: 10px;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-config-grid {
  grid-template-columns: minmax(190px, 1fr) minmax(220px, 1fr) minmax(160px, 0.65fr) minmax(340px, auto);
  align-items: end;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-config-grid > .mapping-config-actions {
  grid-column: auto;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-action-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-action-pair .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  body[data-bs-theme="dark"] #panel-mapping .mapping-command-bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body[data-bs-theme="dark"] #panel-mapping .mapping-command-bar .mapping-filter-grid {
    grid-column: 1 / -1;
  }

  body[data-bs-theme="dark"] #panel-mapping .mapping-config-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-bs-theme="dark"] #panel-mapping .mapping-config-grid > .mapping-config-actions {
    grid-column: 1 / -1;
  }
}

body[data-bs-theme="dark"] #importMappingGrid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(620px, 1fr));
  align-items: start;
  gap: 14px;
}

body[data-bs-theme="dark"] #importMappingGrid > .muted {
  grid-column: 1 / -1;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-section,
body[data-bs-theme="dark"] #panel-mapping .mapping-section[data-mapping-section="survey"] {
  width: 100%;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--figma-border);
  border-radius: var(--figma-radius);
  background: var(--figma-card);
  color: var(--figma-text);
  box-shadow: none;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-section[data-mapping-section="survey"] {
  background:
    linear-gradient(135deg, rgba(105, 77, 212, 0.12) 0%, transparent 34%),
    var(--figma-card);
}

body[data-bs-theme="dark"] #panel-mapping .mapping-section-head h5 {
  margin: 0;
  color: var(--figma-text-strong);
  font-size: 15px;
  font-weight: 700;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-section-head p {
  margin: 4px 0 0;
  color: var(--figma-muted);
}

body[data-bs-theme="dark"] #panel-mapping .mapping-section-grid {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-row {
  min-width: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(150px, 1.12fr) minmax(130px, 0.72fr) minmax(120px, 0.8fr);
  align-items: end;
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--figma-radius);
  background: #101a2d;
  color: var(--figma-text);
  box-shadow: none;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-row:hover {
  border-color: rgba(185, 169, 243, 0.32);
  background: #17223a;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-row.is-mapped {
  border-color: rgba(34, 197, 94, 0.24);
  background: rgba(20, 83, 45, 0.16);
}

body[data-bs-theme="dark"] #panel-mapping .mapping-row.is-unmapped {
  border-color: rgba(148, 163, 184, 0.22);
}

body[data-bs-theme="dark"] #panel-mapping .mapping-row.is-required-missing {
  border-color: rgba(185, 169, 243, 0.46);
  background: rgba(127, 29, 29, 0.18);
}

body[data-bs-theme="dark"] #panel-mapping .mapping-row.is-duplicate {
  border-color: rgba(245, 158, 11, 0.46);
  background: rgba(120, 53, 15, 0.18);
}

body[data-bs-theme="dark"] #panel-mapping .mapping-row .field {
  min-width: 0;
  color: #bfdbfe;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-row .field input,
body[data-bs-theme="dark"] #panel-mapping .mapping-row .field select {
  width: 100%;
  min-width: 0;
  background: #16233d;
  color: var(--figma-text-strong);
}

body[data-bs-theme="dark"] #panel-mapping .mapping-row-actions {
  min-width: 0;
  align-items: stretch;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-row-actions .btn {
  width: 100%;
}

body[data-bs-theme="dark"] #panel-mapping .badge {
  min-height: 20px;
  width: max-content;
  max-width: 100%;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.12);
  color: var(--figma-text);
  font-size: 11px;
  font-weight: 700;
}

body[data-bs-theme="dark"] #panel-mapping .badge.good {
  border-color: rgba(34, 197, 94, 0.2);
  background: var(--figma-green-soft);
  color: var(--figma-green);
}

body[data-bs-theme="dark"] #panel-mapping .badge.warn {
  border-color: rgba(245, 158, 11, 0.24);
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

body[data-bs-theme="dark"] #panel-mapping .badge.bad {
  border-color: rgba(185, 169, 243, 0.3);
  background: rgba(105, 77, 212, 0.16);
  color: #fca5a5;
}

@media (max-width: 760px) {
  body[data-bs-theme="dark"] #panel-mapping .mapping-command-bar,
  body[data-bs-theme="dark"] #panel-mapping .mapping-config-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-bs-theme="dark"] #panel-mapping .mapping-command-bar .mapping-filter-grid,
  body[data-bs-theme="dark"] #panel-mapping .mapping-config-grid > .mapping-config-actions {
    grid-column: auto;
  }

  body[data-bs-theme="dark"] #importMappingGrid,
  body[data-bs-theme="dark"] #panel-mapping .mapping-row {
    grid-template-columns: 1fr;
  }

  body[data-bs-theme="dark"] #panel-mapping .mapping-actions {
    align-items: stretch;
  }

  body[data-bs-theme="dark"] #panel-mapping .mapping-actions .btn,
  body[data-bs-theme="dark"] #panel-mapping .mapping-inline-control {
    width: 100%;
  }

  body[data-bs-theme="dark"] #panel-mapping .mapping-config-actions {
    grid-column: auto;
  }

  body[data-bs-theme="dark"] #panel-mapping .mapping-action-pair {
    flex-direction: column;
    align-items: stretch;
  }

  body[data-bs-theme="dark"] #panel-mapping .mapping-action-pair .btn {
    width: 100%;
  }
}

/* Standalone Figma foundation: this file no longer depends on the legacy CSS. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--figma-bg);
}

body[data-bs-theme="dark"] button,
body[data-bs-theme="dark"] input,
body[data-bs-theme="dark"] select,
body[data-bs-theme="dark"] textarea {
  font: inherit;
}

body[data-bs-theme="dark"] button {
  cursor: pointer;
}

body[data-bs-theme="dark"] button:disabled,
body[data-bs-theme="dark"] input:disabled,
body[data-bs-theme="dark"] select:disabled,
body[data-bs-theme="dark"] textarea:disabled {
  cursor: not-allowed;
}

body[data-bs-theme="dark"] [hidden],
body[data-bs-theme="dark"] .hidden {
  display: none !important;
}

body[data-bs-theme="dark"] .panel:not(.top-header):not(.stepper):not(.tab-nav):not(.tab-panel):not(.context-bar):not(.sidebar) {
  border: 1px solid var(--figma-border);
  border-radius: var(--figma-radius);
  background: var(--figma-card);
  color: var(--figma-text);
}

body[data-bs-theme="dark"] .top-header,
body[data-bs-theme="dark"] .stepper,
body[data-bs-theme="dark"] .guide-status,
body[data-bs-theme="dark"] .filters-toggle-bar,
body[data-bs-theme="dark"] .tab-nav,
body[data-bs-theme="dark"] .tab-panel {
  border-left: 0;
  border-right: 0;
}

body[data-bs-theme="dark"] .tab-panel {
  display: none;
}

body[data-bs-theme="dark"] .tab-panel.is-active {
  display: block;
}

body[data-bs-theme="dark"] .field {
  display: flex;
  flex-direction: column;
}

body[data-bs-theme="dark"] .field.inline-field,
body[data-bs-theme="dark"] .inline-field {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

body[data-bs-theme="dark"] .field.full,
body[data-bs-theme="dark"] .btn.full {
  width: 100%;
}

body[data-bs-theme="dark"] .btn.neutral,
body[data-bs-theme="dark"] .btn.ghost {
  border-color: var(--figma-border);
  background: var(--figma-card-2);
  color: var(--figma-text);
}

body[data-bs-theme="dark"] .btn.ghost {
  background: rgba(30, 45, 74, 0.72);
}

body[data-bs-theme="dark"] .btn.tiny {
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
}

body[data-bs-theme="dark"] .badge {
  min-height: 20px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--figma-border);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--figma-text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

body[data-bs-theme="dark"] .badge.good {
  border-color: rgba(34, 197, 94, 0.24);
  background: var(--figma-green-soft);
  color: var(--figma-green);
}

body[data-bs-theme="dark"] .badge.warn {
  border-color: rgba(245, 158, 11, 0.24);
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

body[data-bs-theme="dark"] .badge.bad {
  border-color: rgba(185, 169, 243, 0.3);
  background: rgba(105, 77, 212, 0.16);
  color: #fca5a5;
}

body[data-bs-theme="dark"] .kpi-grid.compact,
body[data-bs-theme="dark"] .direction-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

body[data-bs-theme="dark"] .kpi-delta,
body[data-bs-theme="dark"] .overview-meta-hint,
body[data-bs-theme="dark"] .direction-summary-hint,
body[data-bs-theme="dark"] .quality-summary-hint,
body[data-bs-theme="dark"] .satisfaction-summary-hint,
body[data-bs-theme="dark"] .admin-summary-hint {
  margin: 4px 0 0;
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 700;
}

body[data-bs-theme="dark"] .overview-subtitle,
body[data-bs-theme="dark"] .chart-hint,
body[data-bs-theme="dark"] .map-hint {
  color: var(--figma-muted);
  font-size: 12px;
}

body[data-bs-theme="dark"] .plain-list {
  margin: 0;
  padding-left: 18px;
  color: var(--figma-text);
}

body[data-bs-theme="dark"] .plain-list li + li {
  margin-top: 4px;
}

body[data-bs-theme="dark"] .chart-frame {
  position: relative;
  overflow: hidden;
}

body[data-bs-theme="dark"] .chart-frame canvas,
body[data-bs-theme="dark"] .chart-frame > div {
  max-width: 100%;
}

body[data-bs-theme="dark"] .chart-frame.empty::after {
  content: attr(data-empty-message);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  color: var(--figma-muted);
  font-size: 12px;
  text-align: center;
}

body[data-bs-theme="dark"] .cross-library-list,
body[data-bs-theme="dark"] .direction-detail-stack,
body[data-bs-theme="dark"] .satisfaction-tag-list {
  display: grid;
  gap: 10px;
}

body[data-bs-theme="dark"] .cross-library-item,
body[data-bs-theme="dark"] .direction-detail-panel,
body[data-bs-theme="dark"] .satisfaction-tag-group,
body[data-bs-theme="dark"] .retention-section {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--figma-border);
  border-radius: var(--figma-radius);
  background: #101a2d;
}

body[data-bs-theme="dark"] .cross-library-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body[data-bs-theme="dark"] .cross-library-main,
body[data-bs-theme="dark"] .cross-library-meta {
  min-width: 0;
}

body[data-bs-theme="dark"] .cross-library-title,
body[data-bs-theme="dark"] .tag-label {
  color: var(--figma-text-strong);
  font-weight: 700;
}

body[data-bs-theme="dark"] .cross-library-sub,
body[data-bs-theme="dark"] .tag-count,
body[data-bs-theme="dark"] .satisfaction-tag-empty {
  color: var(--figma-muted);
  font-size: 12px;
}

body[data-bs-theme="dark"] .cross-library-actions,
body[data-bs-theme="dark"] .direction-hero-tools,
body[data-bs-theme="dark"] .satisfaction-actions,
body[data-bs-theme="dark"] .admin-snapshot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-bs-theme="dark"] .direction-chip-list,
body[data-bs-theme="dark"] .satisfaction-tag-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-bs-theme="dark"] .direction-inline-field,
body[data-bs-theme="dark"] .overview-inline-field {
  min-width: 0;
}

body[data-bs-theme="dark"] .daily-comparison-block,
body[data-bs-theme="dark"] .retention-similarity-table {
  min-width: 0;
}

body[data-bs-theme="dark"] .brand-copy,
body[data-bs-theme="dark"] .filters-toggle-text,
body[data-bs-theme="dark"] .country-map,
body[data-bs-theme="dark"] .overview-charts-grid,
body[data-bs-theme="dark"] .overview-insight,
body[data-bs-theme="dark"] .mapping-filter-grid {
  min-width: 0;
}

body[data-bs-theme="dark"] .overview-charts-grid {
  display: grid;
  gap: 14px;
}

body[data-bs-theme="dark"] .overview-insight {
  border-left: 3px solid rgba(185, 169, 243, 0.46);
}

body[data-bs-theme="dark"] .mapping-filter-grid {
  grid-template-columns: minmax(0, 1fr);
}

body[data-bs-theme="dark"] .filters-toggle.is-collapsed .filters-toggle-icon {
  transform: rotate(180deg);
}

body[data-bs-theme="dark"] .jump {
  cursor: pointer;
}

body[data-bs-theme="dark"] .daily-source-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--figma-muted);
  font-size: 12px;
}

body[data-bs-theme="dark"] .retention-similarity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

body[data-bs-theme="dark"] .quality-category-row,
body[data-bs-theme="dark"] .quality-anomaly-row {
  border-left: 3px solid rgba(185, 169, 243, 0.48);
}

@media (max-width: 760px) {
  body[data-bs-theme="dark"] .field.inline-field,
  body[data-bs-theme="dark"] .inline-field,
  body[data-bs-theme="dark"] .cross-library-item,
  body[data-bs-theme="dark"] .daily-source-control {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Compact overview report checkbox. */
body[data-bs-theme="dark"] #panel-overview .overview-hero-tools {
  grid-template-columns: max-content minmax(140px, 160px) max-content max-content;
}

body[data-bs-theme="dark"] #panel-overview .overview-inline-check {
  width: max-content;
  min-width: 0;
  min-height: 33px;
  padding: 0 9px;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

body[data-bs-theme="dark"] #panel-overview .overview-inline-check span {
  font-size: 11px;
  line-height: 1;
}

body[data-bs-theme="dark"] #panel-overview .overview-inline-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

@media (max-width: 760px) {
  body[data-bs-theme="dark"] #panel-overview .overview-hero-tools {
    grid-template-columns: 1fr;
  }

  body[data-bs-theme="dark"] #panel-overview .overview-inline-check {
    width: 100%;
    justify-content: space-between;
  }
}

/* Local UX experiment from the June roadmap: clearer filter state. */
body[data-bs-theme="dark"] .filters-toggle {
  position: relative;
}

body[data-bs-theme="dark"] .filters-toggle.has-active-filters::after {
  content: attr(data-active-count);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--figma-red);
  font-family: var(--figma-mono);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

body[data-bs-theme="dark"] .kpi-card,
body[data-bs-theme="dark"] .overview-meta-card {
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

body[data-bs-theme="dark"] .kpi-card:hover,
body[data-bs-theme="dark"] .overview-meta-card:hover {
  border-color: rgba(185, 169, 243, 0.35);
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.98), rgba(20, 30, 51, 0.98));
  transform: translateY(-1px);
}

/* Local roadmap expansion: drag import, busy feedback, and toast notifications. */
body[data-bs-theme="dark"] .import-drop-zone {
  margin: 14px 0;
  min-height: 118px;
  padding: 18px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(220px, max-content);
  align-items: center;
  gap: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.42);
  border-radius: var(--figma-radius);
  background:
    linear-gradient(135deg, rgba(105, 77, 212, 0.12), transparent 34%),
    rgba(13, 20, 36, 0.56);
  color: var(--figma-text);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

body[data-bs-theme="dark"] .import-drop-zone:hover,
body[data-bs-theme="dark"] .import-drop-zone:focus-visible,
body[data-bs-theme="dark"] .import-drop-zone.is-dragging {
  border-color: rgba(185, 169, 243, 0.7);
  background:
    linear-gradient(135deg, rgba(105, 77, 212, 0.2), transparent 40%),
    rgba(26, 37, 64, 0.9);
  outline: none;
  transform: translateY(-1px);
}

body[data-bs-theme="dark"] .import-drop-icon {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(185, 169, 243, 0.35);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0 12px, transparent 12px),
    var(--figma-red);
  box-shadow: 0 14px 28px rgba(105, 77, 212, 0.16);
  position: relative;
}

body[data-bs-theme="dark"] .import-drop-icon::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 19px;
  width: 16px;
  height: 12px;
  border-left: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
  transform: rotate(-45deg);
}

body[data-bs-theme="dark"] .import-drop-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

body[data-bs-theme="dark"] .import-drop-copy strong {
  color: var(--figma-text-strong);
  font-size: 15px;
}

body[data-bs-theme="dark"] .import-drop-copy span,
body[data-bs-theme="dark"] .import-drop-list {
  color: var(--figma-muted);
  font-size: 12px;
}

body[data-bs-theme="dark"] .import-drop-list {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--figma-border);
  border-radius: 999px;
  background: rgba(30, 45, 74, 0.72);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-busy="preview"] #panel-mapping .panel.nested:first-child,
body[data-busy="analysis"] .kpi-card,
body[data-busy="analysis"] .overview-meta-card,
body[data-busy="analysis"] .chart-frame {
  position: relative;
  overflow: hidden;
}

body[data-busy="preview"] #panel-mapping .panel.nested:first-child::after,
body[data-busy="analysis"] .kpi-card::after,
body[data-busy="analysis"] .overview-meta-card::after,
body[data-busy="analysis"] .chart-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.08) 45%, transparent 80%);
  transform: translateX(-100%);
  animation: ant-skeleton-sweep 1.1s linear infinite;
  pointer-events: none;
}

@keyframes ant-skeleton-sweep {
  to {
    transform: translateX(100%);
  }
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  width: min(380px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.app-toast {
  padding: 11px 13px;
  border: 1px solid var(--figma-border);
  border-radius: var(--figma-radius);
  background: rgba(20, 30, 51, 0.98);
  color: var(--figma-text-strong);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.app-toast.success {
  border-color: rgba(34, 197, 94, 0.36);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(20, 30, 51, 0.98));
}

.app-toast.warning {
  border-color: rgba(245, 158, 11, 0.42);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(20, 30, 51, 0.98));
}

.app-toast.error {
  border-color: rgba(185, 169, 243, 0.48);
  background: linear-gradient(135deg, rgba(105, 77, 212, 0.26), rgba(20, 30, 51, 0.98));
}

.app-toast.is-hiding {
  opacity: 0;
  transform: translateY(8px);
}

body[data-bs-theme="dark"] .kpi-card-action {
  cursor: pointer;
  outline: none;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

body[data-bs-theme="dark"] .kpi-card-action:hover,
body[data-bs-theme="dark"] .kpi-card-action:focus-visible {
  border-color: rgba(185, 169, 243, 0.62);
  background: #1a2741;
  transform: translateY(-1px);
}

body[data-bs-theme="dark"] .kpi-card-action.is-active {
  border-color: rgba(185, 169, 243, 0.86);
  background: linear-gradient(135deg, rgba(105, 77, 212, 0.22), rgba(20, 30, 51, 0.98));
}

body[data-bs-theme="dark"] .kpi-card-action.is-active .kpi-label,
body[data-bs-theme="dark"] .kpi-card-action.is-active .kpi-value {
  color: #ffffff;
}

body[data-bs-theme="dark"] .quality-score-gauge {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-top: 2px;
}

body[data-bs-theme="dark"] .quality-score-gauge svg {
  transform: rotate(-90deg);
}

body[data-bs-theme="dark"] .quality-score-track {
  stroke: rgba(148, 163, 184, 0.22);
}

body[data-bs-theme="dark"] .quality-score-fill {
  stroke-linecap: round;
  transition: stroke-dasharray 260ms ease;
}

body[data-bs-theme="dark"] .quality-score-gauge-value {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: inherit;
  font-family: var(--figma-mono);
  font-size: 20px;
  font-weight: 800;
}

body[data-bs-theme="dark"] .retention-person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body[data-bs-theme="dark"] .retention-avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid rgba(185, 169, 243, 0.28);
  border-radius: 50%;
  background: rgba(105, 77, 212, 0.2);
  color: #fecaca;
  font-family: var(--figma-mono);
  font-size: 11px;
  font-weight: 800;
}

body[data-bs-theme="dark"] .retention-name {
  overflow: hidden;
  color: var(--gray-900);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .retention-name {
  color: var(--theme-text-strong);
}

body[data-bs-theme="dark"] .retention-year-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

body[data-bs-theme="dark"] .retention-year-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(31, 45, 72, 0.85);
  color: #bfdbfe;
  font-family: var(--figma-mono);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

@media (max-width: 760px) {
  body[data-bs-theme="dark"] .import-drop-zone {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  body[data-bs-theme="dark"] .import-drop-list {
    grid-column: 1 / -1;
    text-align: left;
    white-space: normal;
  }
}

/* Tech-med identity layer: local visual polish, same purple/gray palette. */
:root {
  --tech-red-line: rgba(105, 77, 212, 0.34);
  --tech-red-faint: rgba(105, 77, 212, 0.1);
  --tech-cyan-line: rgba(6, 182, 212, 0.12);
  --tech-grid-line: rgba(148, 163, 184, 0.055);
}

body[data-bs-theme="dark"] {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(13, 20, 36, 0.96), rgba(7, 11, 20, 0.98)),
    radial-gradient(circle at 15% 12%, rgba(105, 77, 212, 0.13), transparent 28%),
    var(--figma-bg);
}

body[data-bs-theme="dark"] > .auth-gate,
body[data-bs-theme="dark"] > .app-shell {
  position: relative;
  z-index: 1;
}

body[data-bs-theme="dark"] .app-shell {
  background: transparent;
}

body[data-bs-theme="dark"] .top-header {
  border-bottom-color: rgba(105, 77, 212, 0.24);
  background:
    linear-gradient(180deg, rgba(10, 16, 32, 0.97), rgba(8, 14, 27, 0.9)),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(148, 163, 184, 0.05) 24px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 60px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(16px);
}

body[data-bs-theme="dark"] .brand-mark {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(135deg, #e23b3b, #9f1d1d);
  box-shadow:
    0 0 0 3px rgba(105, 77, 212, 0.14),
    0 0 24px rgba(105, 77, 212, 0.28);
}

body[data-bs-theme="dark"] .brand-mark::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(105, 77, 212, 0.18);
  border-radius: 10px;
  pointer-events: none;
}

body[data-bs-theme="dark"] .top-header h1 {
  font-weight: 800;
}

body[data-bs-theme="dark"] .panel,
body[data-bs-theme="dark"] .table-wrap,
body[data-bs-theme="dark"] .chart-frame,
body[data-bs-theme="dark"] .context-bar {
  position: relative;
  border-color: rgba(148, 163, 184, 0.14);
  background:
    linear-gradient(145deg, rgba(20, 30, 51, 0.94), rgba(11, 18, 32, 0.92)),
    linear-gradient(90deg, rgba(105, 77, 212, 0.06), transparent 34%, rgba(6, 182, 212, 0.045));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 20px 70px rgba(0, 0, 0, 0.16);
}

body[data-bs-theme="dark"] .panel:not(.top-header):not(.tab-panel)::before,
body[data-bs-theme="dark"] .table-wrap::before,
body[data-bs-theme="dark"] .chart-frame::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--tech-red-line), var(--tech-cyan-line), transparent);
  opacity: 0.75;
}

body[data-bs-theme="dark"] .context-bar {
  overflow: hidden;
}

body[data-bs-theme="dark"] .context-bar::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 12px;
  width: 220px;
  height: 44px;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(185, 169, 243, 0.28), transparent),
    repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.14) 0 1px, transparent 1px 12px);
  clip-path: polygon(0 52%, 18% 52%, 23% 27%, 29% 76%, 35% 52%, 58% 52%, 63% 39%, 68% 64%, 74% 52%, 100% 52%, 100% 58%, 74% 58%, 68% 70%, 63% 45%, 58% 58%, 35% 58%, 29% 82%, 23% 33%, 18% 58%, 0 58%);
  opacity: 0.45;
}

body[data-bs-theme="dark"] .btn {
  position: relative;
  overflow: hidden;
  border-color: rgba(148, 163, 184, 0.18);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(38, 53, 83, 0.96), rgba(24, 36, 61, 0.96));
  color: #dbeafe;
  font-family: var(--figma-font);
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 10px 26px rgba(0, 0, 0, 0.16);
}

body[data-bs-theme="dark"] .btn::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -45%;
  width: 42%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  transform: skewX(-18deg);
  transition: left 220ms ease;
}

body[data-bs-theme="dark"] .btn:hover::before,
body[data-bs-theme="dark"] .btn:focus-visible::before {
  left: 108%;
}

body[data-bs-theme="dark"] .btn:hover,
body[data-bs-theme="dark"] .btn:focus-visible {
  border-color: rgba(185, 169, 243, 0.4);
  background:
    linear-gradient(180deg, rgba(48, 65, 99, 0.98), rgba(27, 43, 72, 0.98));
  color: #ffffff;
}

body[data-bs-theme="dark"] .btn.primary {
  border-color: rgba(185, 169, 243, 0.7);
  background:
    linear-gradient(180deg, #db3838, #b42424);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 30px rgba(105, 77, 212, 0.22);
}

body[data-bs-theme="dark"] .btn.ghost {
  background:
    linear-gradient(180deg, rgba(31, 45, 72, 0.72), rgba(18, 28, 48, 0.72));
}

body[data-bs-theme="dark"] .field {
  color: #b6c6dd;
  font-size: 12px;
  font-weight: 800;
}

body[data-bs-theme="dark"] input,
body[data-bs-theme="dark"] select,
body[data-bs-theme="dark"] textarea {
  border-color: rgba(148, 163, 184, 0.2);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(28, 42, 69, 0.98), rgba(20, 31, 53, 0.98));
  color: #f8fafc;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    inset 3px 0 0 rgba(105, 77, 212, 0.18);
}

body[data-bs-theme="dark"] input::placeholder,
body[data-bs-theme="dark"] textarea::placeholder {
  color: rgba(148, 163, 184, 0.72);
}

body[data-bs-theme="dark"] input:focus,
body[data-bs-theme="dark"] select:focus,
body[data-bs-theme="dark"] textarea:focus {
  border-color: rgba(185, 169, 243, 0.72);
  outline: none;
  box-shadow:
    0 0 0 3px rgba(105, 77, 212, 0.14),
    0 0 24px rgba(105, 77, 212, 0.16),
    inset 3px 0 0 rgba(185, 169, 243, 0.72);
}

body[data-bs-theme="dark"] .tab-nav {
  background:
    linear-gradient(180deg, rgba(12, 22, 40, 0.94), rgba(10, 16, 32, 0.92));
  border-bottom-color: rgba(105, 77, 212, 0.18);
}

body[data-bs-theme="dark"] .tab-btn {
  position: relative;
  font-family: var(--figma-font);
  font-weight: 800;
}

body[data-bs-theme="dark"] .tab-btn.is-active {
  background:
    linear-gradient(180deg, rgba(105, 77, 212, 0.2), rgba(105, 77, 212, 0.08));
  box-shadow: inset 0 -1px 0 rgba(105, 77, 212, 0.5);
}

body[data-bs-theme="dark"] .tab-btn.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #b9a9f3, transparent);
}

body[data-bs-theme="dark"] .kpi-card,
body[data-bs-theme="dark"] .overview-meta-card,
body[data-bs-theme="dark"] .quality-summary-card,
body[data-bs-theme="dark"] .satisfaction-summary-card,
body[data-bs-theme="dark"] .direction-summary-card,
body[data-bs-theme="dark"] .admin-summary-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(22, 33, 55, 0.98), rgba(13, 22, 38, 0.98)),
    radial-gradient(circle at 0 0, rgba(105, 77, 212, 0.12), transparent 36%);
}

body[data-bs-theme="dark"] .kpi-card::before,
body[data-bs-theme="dark"] .overview-meta-card::before,
body[data-bs-theme="dark"] .quality-summary-card::before,
body[data-bs-theme="dark"] .satisfaction-summary-card::before,
body[data-bs-theme="dark"] .direction-summary-card::before,
body[data-bs-theme="dark"] .admin-summary-card::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(185, 169, 243, 0.62), transparent);
  opacity: 0.66;
  pointer-events: none;
}

body[data-bs-theme="dark"] table thead th {
  background:
    linear-gradient(180deg, rgba(31, 45, 72, 0.96), rgba(21, 33, 57, 0.96));
  color: #bfdbfe;
  font-family: var(--figma-mono);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

body[data-bs-theme="dark"] table tbody td {
  font-variant-numeric: tabular-nums;
}

body[data-bs-theme="dark"] table tbody tr:hover {
  background: rgba(105, 77, 212, 0.08);
}

body[data-bs-theme="dark"] .status-chip,
body[data-bs-theme="dark"] .badge,
body[data-bs-theme="dark"] .chip,
body[data-bs-theme="dark"] .overview-chip {
  border-radius: 999px;
  font-family: var(--figma-mono);
  font-weight: 800;
}

body[data-bs-theme="dark"] ::selection {
  background: rgba(185, 169, 243, 0.34);
  color: #ffffff;
}

/* Top alignment hardening: no floating overlap between header, stepper, tabs and hero. */
body[data-bs-theme="dark"] .top-header {
  position: sticky;
  top: 0;
  z-index: 90;
  min-height: 60px;
  grid-template-columns: minmax(220px, 1fr) minmax(0, auto);
  overflow: visible;
}

body[data-bs-theme="dark"] .header-actions {
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  overflow: visible;
}

body[data-bs-theme="dark"] .account-panel {
  min-width: 0;
  max-width: 330px;
  flex: 0 1 auto;
}

body[data-bs-theme="dark"] .account-email {
  min-width: 0;
  max-width: 210px;
}

body[data-bs-theme="dark"] .header-actions .btn {
  min-width: 0;
  flex: 0 0 auto;
}

body[data-bs-theme="dark"] .stepper {
  position: relative;
  top: auto;
  left: auto;
  z-index: 10;
  width: 100%;
  max-width: none;
  min-height: 42px;
  margin: 0;
  padding: 6px 24px;
  justify-content: center;
  border-top: 0;
  border-bottom: 1px solid rgba(105, 77, 212, 0.16);
  background: rgba(10, 16, 32, 0.86);
  transform: none;
}

body[data-bs-theme="dark"] .guide-status {
  min-height: 34px;
  padding: 8px 24px;
  position: relative;
  z-index: 5;
}

body[data-bs-theme="dark"] .filters-toggle-bar {
  min-height: 44px;
  padding: 7px 24px;
  position: relative;
  z-index: 5;
}

body[data-bs-theme="dark"] .workspace,
body[data-bs-theme="dark"] #workspace.is-filters-hidden {
  padding-top: 0;
}

body[data-bs-theme="dark"] .context-bar {
  margin-top: 0;
}

body[data-bs-theme="dark"] .tab-nav {
  position: relative;
  top: auto;
  z-index: 8;
  margin: 14px 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  overflow-x: auto;
  overflow-y: hidden;
}

body[data-bs-theme="dark"] .tab-panel {
  position: relative;
  z-index: 1;
  padding-top: 18px;
}

body[data-bs-theme="dark"] .overview-hero {
  position: relative;
  z-index: 1;
}

@media (max-width: 1180px) {
  body[data-bs-theme="dark"] .top-header {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body[data-bs-theme="dark"] .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  body[data-bs-theme="dark"] .account-panel {
    max-width: 100%;
  }

  body[data-bs-theme="dark"] .stepper {
    justify-content: flex-start;
  }
}

/* Title bands should span the available content width, without card-like limits. */
body[data-bs-theme="dark"] .tab-panel.panel {
  width: 100%;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

body[data-bs-theme="dark"] .tab-panel.panel::before {
  content: none;
  display: none;
}

body[data-bs-theme="dark"] .tab-panel > h3 {
  width: 100%;
  max-width: none;
  margin: 0 0 16px;
  padding: 16px 0 15px;
  border-top: 1px solid rgba(105, 77, 212, 0.24);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background:
    linear-gradient(90deg, rgba(105, 77, 212, 0.09), transparent 38%),
    linear-gradient(180deg, rgba(20, 30, 51, 0.72), rgba(13, 22, 38, 0.56));
  color: #ffffff;
}

body[data-bs-theme="dark"] .tab-panel > h3::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 18px;
  margin-right: 10px;
  border-radius: 999px;
  background: var(--figma-red);
  vertical-align: -3px;
  box-shadow: 0 0 18px rgba(105, 77, 212, 0.36);
}


/* ============================================================
   Latest redesign layer: imported from Downloads\styles.css
   Keep this section last so it drives the app visual identity.
   ============================================================ */
/* ============================================================
   EPU ANALYTICS — Design system tech-médecine
   Palette: violet #694dd4, gris charbon, blanc clinique
   Typographie: Inter (sans) + JetBrains Mono (data/code)
   Signature: lignes de circuit PCB en background SVG
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  /* Violet de marque */
  --red-900: #1c1454;
  --red-800: #2c207f;
  --red-700: #4f38b7;
  --red-600: #694dd4;   /* brand principal */
  --red-500: #8067df;
  --red-300: #b9a9f3;
  --red-100: #f2effd;

  /* Gris tech */
  --gray-950: #0d0f10;
  --gray-900: #141618;
  --gray-800: #1e2124;
  --gray-700: #272b30;
  --gray-600: #353b42;
  --gray-500: #4a5260;
  --gray-400: #6b7685;
  --gray-300: #9aa3ae;
  --gray-200: #c8cdd4;
  --gray-100: #e8eaed;
  --gray-50:  #f4f5f6;

  /* Sémantique */
  --brand:    var(--red-600);
  --surface:  #ffffff;
  --bg:       #f0f2f4;
  --line:     var(--gray-200);
  --ink-0:    var(--gray-900);
  --ink-1:    var(--gray-500);
  --success:  #1a7a46;
  --danger:   #c0283c;
  --warning:  #a06010;

  /* Circuit board lines (SVG background) */
  --circuit-color: rgba(105, 77, 212, 0.08);
  --circuit-dot:   rgba(105, 77, 212, 0.18);

  /* Typography */
  --font-sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Layout */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* ── RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-0);
  background-color: var(--bg);
  background-image:
    /* Circuit PCB — lignes horizontales */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg stroke='rgba(105,77,212,0.07)' stroke-width='1' fill='none'%3E%3Cpath d='M0 30 H40 V10 H80 V50 H120'/%3E%3Cpath d='M0 90 H20 V70 H60 V110 H120'/%3E%3Cpath d='M30 0 V40 H50 V80 H10 V120'/%3E%3Cpath d='M90 0 V20 H110 V60 H70 V120'/%3E%3C/g%3E%3Ccircle cx='40' cy='30' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='80' cy='10' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='80' cy='50' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='20' cy='90' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='60' cy='70' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='60' cy='110' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='30' cy='40' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='50' cy='80' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='90' cy='20' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='110' cy='60' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='70' cy='120' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3C/svg%3E"),
    linear-gradient(160deg, #f0f2f4 0%, #e8ecf0 100%);
  background-attachment: fixed;
}

/* ── TYPOGRAPHIE ─────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 600; margin-top: 0; line-height: 1.25; }

h1 { font-size: clamp(1.5rem, 2.5vw, 2rem); letter-spacing: -0.02em; }
h2 { font-size: 1.1rem; letter-spacing: -0.01em; margin-bottom: 10px; }
h3 { font-size: 0.95rem; letter-spacing: 0.005em; margin-bottom: 10px; }

/* Valeurs numériques en monospace — donne un aspect "terminal médical" */
.card-value,
td[data-num],
.stat-num {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.muted { margin-top: 0; color: var(--ink-1); font-size: 0.875rem; }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 16px;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 32px;
  bottom: 16px;
  width: 3px;
  background: linear-gradient(180deg, var(--red-600) 0%, transparent 100%);
  border-radius: 2px;
}

.kicker {
  margin: 0 0 10px 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--red-600);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kicker::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-600);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(105,77,212,0.4); }
  50%       { opacity: 0.7; box-shadow: 0 0 0 6px rgba(105,77,212,0); }
}

h1 { margin: 0 0 0 16px; color: var(--gray-900); }

.lead {
  margin: 8px 0 0 16px;
  color: var(--ink-1);
  font-size: 0.875rem;
  max-width: 700px;
}

/* ── LAYOUT ──────────────────────────────────────────────── */
.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 24px 40px;
  display: grid;
  gap: 16px;
}

/* ── PANELS ──────────────────────────────────────────────── */
.panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Accent violet en coin supérieur gauche — "clip médical" */
.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40px; height: 3px;
  background: var(--red-600);
  border-radius: 0 0 3px 0;
}

.panel.panel-focus {
  border-color: var(--red-600);
  box-shadow: 0 0 0 3px rgba(105, 77, 212, 0.1);
}

/* ── CARDS KPI ───────────────────────────────────────────── */
.cards {
  margin-top: 16px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  background: #fff;
  position: relative;
  overflow: hidden;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

/* Ligne haute colorée sur chaque card */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red-600) 0%, var(--red-300) 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: 0.6;
}

.card:hover {
  border-color: var(--red-300);
  box-shadow: 0 2px 12px rgba(105, 77, 212, 0.08);
}

.card-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.card-value {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 500;
  color: var(--gray-900);
  letter-spacing: -0.03em;
  line-height: 1;
}

/* ── BOUTONS ─────────────────────────────────────────────── */
button {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0 16px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease,
              box-shadow 120ms ease, transform 80ms ease;

  /* Bouton primaire — violet avec clipt angulaire côté droit */
  background: var(--red-600);
  color: #fff;
  position: relative;
  overflow: hidden;
}

/* Shimmer au hover sur les boutons primaires */
button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.12) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 350ms ease;
}
button:hover::after { transform: translateX(100%); }

button:hover {
  background: var(--red-700);
  box-shadow: 0 2px 8px rgba(105, 77, 212, 0.3);
  transform: translateY(-1px);
}
button:active {
  transform: translateY(0);
  box-shadow: none;
}
button:disabled {
  background: var(--gray-200);
  color: var(--gray-400);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
button:disabled::after { display: none; }

/* Ghost — contour violet, fond transparent */
.button-ghost {
  background: transparent;
  color: var(--gray-700);
  border-color: var(--line);
}
.button-ghost::after { display: none; }
.button-ghost:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  box-shadow: none;
  color: var(--gray-900);
}

/* ── INPUTS ──────────────────────────────────────────────── */
input[type="text"],
input[type="date"],
input[type="time"],
select {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--ink-0);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0 12px;
  height: 36px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  appearance: none;
  -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus {
  border-color: var(--red-600);
  box-shadow: 0 0 0 3px rgba(105, 77, 212, 0.12);
}

input[type="text"]::placeholder { color: var(--gray-300); font-style: italic; }

/* Select avec chevron SVG violet */
select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23694dd4' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

/* Input file — traitement spécial */
input[type="file"] {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-1);
  background: var(--gray-50);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  height: auto;
  min-height: 36px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
input[type="file"]:hover {
  border-color: var(--red-600);
  background: var(--red-100);
}

/* ── ACTIONS ROW ─────────────────────────────────────────── */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ── STATUS ──────────────────────────────────────────────── */
.status {
  min-height: 1.25rem;
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-1);
  letter-spacing: 0.01em;
}
.status::before { content: '> '; opacity: 0.4; }
.status:empty::before { display: none; }
.status.info    { color: var(--ink-1); }
.status.success { color: var(--success); }
.status.warning { color: var(--warning); }
.status.error   { color: var(--danger); }

/* ── TABLE CARDS & CHART CARDS ───────────────────────────── */
.table-card,
.chart-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: #fff;
  position: relative;
}

/* Numérotation monospace sur les h3 des cards */
.table-card h3,
.chart-card h3 {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-800);
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.table-card h3::before,
.chart-card h3::before {
  content: '//';
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--red-600);
  font-weight: 400;
  opacity: 0.8;
}

/* ── CHARTS GRID ─────────────────────────────────────────── */
.charts-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.chart-card canvas {
  width: 100%;
  height: 280px;
}

/* ── TABLES ──────────────────────────────────────────────── */
.table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.table-scroll {
  margin-top: 10px;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}
.table-scroll + .table-scroll { margin-top: 12px; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

th {
  background: var(--gray-900);
  color: var(--gray-200);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 10px;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--gray-700);
}
th:first-child { border-radius: var(--radius-md) 0 0 0; }
th:last-child  { border-radius: 0 var(--radius-md) 0 0; }

td {
  border-bottom: 1px solid var(--gray-100);
  padding: 8px 10px;
  font-size: 0.84rem;
  color: var(--gray-800);
  vertical-align: middle;
}

tr:last-child td { border-bottom: 0; }

tr:hover td { background: rgba(105, 77, 212, 0.025); }

/* Mise en évidence des valeurs numériques en monospace dans les tables */
td:nth-child(n+3) {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* ── PILLS ───────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}

.pill.new        { color: #155c78; background: #d8f2fb; border-color: rgba(21,92,120,0.2); }
.pill.occasional { color: #7a5008; background: #fff4d6; border-color: rgba(122,80,8,0.2); }
.pill.regular    { color: #1a7a46; background: #d9f4e5; border-color: rgba(26,122,70,0.2); }
.pill.since      { color: var(--red-800); background: var(--red-100); border-color: rgba(105,77,212,0.22); }
.pill.success    { color: #1a7a46; background: #d9f4e5; border-color: rgba(26,122,70,0.2); }
.pill.warning    { color: #7a5008; background: #fff4d6; border-color: rgba(122,80,8,0.2); }
.pill.error      { color: var(--red-800); background: var(--red-100); border-color: rgba(160,26,46,0.2); }
.pill.info       { color: #155c78; background: #d8f2fb; border-color: rgba(21,92,120,0.2); }

/* ── FORM GRID (Admin) ───────────────────────────────────── */
.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.8rem;
}

.field > span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--red-600);
  margin: 4px 0 0;
  cursor: pointer;
}

/* ── ANIMATIONS ──────────────────────────────────────────── */
@keyframes panelFadeIn {
  from { opacity: 0.15; transform: translateY(6px); }
  to   { opacity: 1;    transform: translateY(0); }
}
@keyframes panelSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

body[data-snapshot-transition="fade"] .tab-panel.is-active { animation: panelFadeIn 260ms ease; }
body[data-snapshot-transition="slide"] .tab-panel.is-active { animation: panelSlideIn 280ms ease; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 680px) {
  .hero, .layout { padding-left: 14px; padding-right: 14px; }
  .panel         { padding: 14px; }
  .chart-card canvas { height: 220px; }
  h2 { font-size: 1rem; }
}

/* ── SCROLLBAR CUSTOM ────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--red-600); }

/* ============================================================
   ANTanalytics compatibility layer
   Applies the provided tech-med redesign to the existing app DOM
   without changing routes, rendering logic, or Firebase hosting.
   ============================================================ */

body[data-bs-theme="dark"] {
  --figma-bg: var(--bg);
  --figma-shell: rgba(255, 255, 255, 0.88);
  --figma-shell-2: rgba(255, 255, 255, 0.74);
  --figma-card: rgba(255, 255, 255, 0.92);
  --figma-card-2: #ffffff;
  --figma-input: #ffffff;
  --figma-border: rgba(20, 22, 24, 0.12);
  --figma-border-strong: rgba(105, 77, 212, 0.28);
  --figma-text: var(--gray-800);
  --figma-text-strong: var(--gray-900);
  --figma-muted: var(--gray-500);
  --figma-muted-dark: var(--gray-400);
  --figma-red: var(--red-600);
  --figma-red-hover: var(--red-700);
  --figma-red-soft: rgba(105, 77, 212, 0.08);
  --figma-green: var(--success);
  --figma-blue: #155c78;
  --figma-amber: #a06010;
  --figma-purple: #694dd4;
  --figma-cyan: #157e91;
  --figma-radius: var(--radius-md);
  --figma-font: var(--font-sans);
  --figma-mono: var(--font-mono);
  color: var(--ink-0);
  background-color: var(--bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg stroke='rgba(105,77,212,0.07)' stroke-width='1' fill='none'%3E%3Cpath d='M0 30 H40 V10 H80 V50 H120'/%3E%3Cpath d='M0 90 H20 V70 H60 V110 H120'/%3E%3Cpath d='M30 0 V40 H50 V80 H10 V120'/%3E%3Cpath d='M90 0 V20 H110 V60 H70 V120'/%3E%3C/g%3E%3Ccircle cx='40' cy='30' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='80' cy='10' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='80' cy='50' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='20' cy='90' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='60' cy='70' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='60' cy='110' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='30' cy='40' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='50' cy='80' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='90' cy='20' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='110' cy='60' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3Ccircle cx='70' cy='120' r='2.5' fill='rgba(105,77,212,0.15)'/%3E%3C/svg%3E"),
    linear-gradient(160deg, #f0f2f4 0%, #e8ecf0 100%);
  background-attachment: fixed;
}

body[data-bs-theme="dark"] .app-shell,
body[data-bs-theme="dark"] .workspace,
body[data-bs-theme="dark"] #workspace.is-filters-hidden,
body[data-bs-theme="dark"] .main-content,
body[data-bs-theme="dark"] .filters-toggle-bar {
  background: transparent;
}

body[data-bs-theme="dark"] .top-header {
  margin: 10px 12px 0;
  border: 1px solid rgba(20, 22, 24, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 32px rgba(20, 22, 24, 0.08);
  backdrop-filter: blur(18px);
}

body[data-bs-theme="dark"] .brand-mark {
  border: 1px solid rgba(105, 77, 212, 0.24);
  background: linear-gradient(135deg, var(--red-600), var(--red-700));
  box-shadow: 0 8px 22px rgba(105, 77, 212, 0.24);
}

body[data-bs-theme="dark"] .top-header h1,
body[data-bs-theme="dark"] .panel h2,
body[data-bs-theme="dark"] .panel h3,
body[data-bs-theme="dark"] .panel h4,
body[data-bs-theme="dark"] .tab-panel > h3 {
  color: var(--gray-900);
}

body[data-bs-theme="dark"] .btn,
body[data-bs-theme="dark"] button.btn {
  border: 1px solid rgba(20, 22, 24, 0.12);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--gray-800);
  font-family: var(--font-sans);
  box-shadow: 0 2px 0 rgba(20, 22, 24, 0.04);
}

body[data-bs-theme="dark"] .btn:hover,
body[data-bs-theme="dark"] button.btn:hover {
  border-color: rgba(105, 77, 212, 0.35);
  background: var(--red-100);
  color: var(--red-800);
  transform: translateY(-1px);
}

body[data-bs-theme="dark"] .btn.primary,
body[data-bs-theme="dark"] button.btn.primary {
  border-color: var(--red-600);
  background: linear-gradient(135deg, var(--red-600), var(--red-700));
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(105, 77, 212, 0.22);
}

body[data-bs-theme="dark"] .btn.neutral,
body[data-bs-theme="dark"] .btn.ghost {
  background: rgba(255, 255, 255, 0.72);
}

body[data-bs-theme="dark"] .btn:disabled {
  border-color: rgba(20, 22, 24, 0.08);
  background: rgba(232, 234, 237, 0.72);
  color: var(--gray-400);
  box-shadow: none;
}

body[data-bs-theme="dark"] .stepper,
body[data-bs-theme="dark"] .guide-status,
body[data-bs-theme="dark"] .context-bar,
body[data-bs-theme="dark"] #filtersSidebar,
body[data-bs-theme="dark"] .tab-nav,
body[data-bs-theme="dark"] .panel.nested,
body[data-bs-theme="dark"] .overview-hero,
body[data-bs-theme="dark"] .quality-hero,
body[data-bs-theme="dark"] .segments-hero,
body[data-bs-theme="dark"] .direction-hero,
body[data-bs-theme="dark"] .satisfaction-hero,
body[data-bs-theme="dark"] .admin-hero,
body[data-bs-theme="dark"] .kpi-card,
body[data-bs-theme="dark"] .chart-frame,
body[data-bs-theme="dark"] .table-wrap,
body[data-bs-theme="dark"] .mapping-section,
body[data-bs-theme="dark"] .mapping-row {
  border: 1px solid rgba(20, 22, 24, 0.11);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  color: var(--gray-800);
  box-shadow: 0 14px 36px rgba(20, 22, 24, 0.06);
}

body[data-bs-theme="dark"] .panel.nested,
body[data-bs-theme="dark"] .overview-hero,
body[data-bs-theme="dark"] .quality-hero,
body[data-bs-theme="dark"] .segments-hero,
body[data-bs-theme="dark"] .direction-hero,
body[data-bs-theme="dark"] .satisfaction-hero,
body[data-bs-theme="dark"] .admin-hero {
  position: relative;
  overflow: hidden;
}

body[data-bs-theme="dark"] .panel.nested::before,
body[data-bs-theme="dark"] .overview-hero::before,
body[data-bs-theme="dark"] .quality-hero::before,
body[data-bs-theme="dark"] .segments-hero::before,
body[data-bs-theme="dark"] .direction-hero::before,
body[data-bs-theme="dark"] .satisfaction-hero::before,
body[data-bs-theme="dark"] .admin-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--red-600), transparent 72%);
  pointer-events: none;
}

body[data-bs-theme="dark"] .tab-panel.panel,
body[data-bs-theme="dark"] .tab-panel.panel::before {
  background: transparent;
  border: 0;
  box-shadow: none;
}

body[data-bs-theme="dark"] .tab-panel > h3 {
  border: 0;
  border-left: 3px solid var(--red-600);
  background: linear-gradient(90deg, rgba(255,255,255,0.9), rgba(255,255,255,0.18));
}

body[data-bs-theme="dark"] .tab-nav {
  padding: 6px;
  gap: 4px;
}

body[data-bs-theme="dark"] .tab-btn {
  border-radius: var(--radius-md);
  color: var(--gray-500);
}

body[data-bs-theme="dark"] .tab-btn:hover {
  color: var(--red-700);
  background: var(--red-100);
}

body[data-bs-theme="dark"] .tab-btn.is-active {
  border-bottom-color: transparent;
  background: var(--gray-900);
  color: #ffffff;
}

body[data-bs-theme="dark"] input,
body[data-bs-theme="dark"] select,
body[data-bs-theme="dark"] textarea {
  border: 1px solid rgba(20, 22, 24, 0.14);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--gray-900);
  box-shadow: inset 0 1px 2px rgba(20, 22, 24, 0.04);
}

body[data-bs-theme="dark"] input:focus,
body[data-bs-theme="dark"] select:focus,
body[data-bs-theme="dark"] textarea:focus {
  border-color: rgba(105, 77, 212, 0.55);
  box-shadow: 0 0 0 3px rgba(105, 77, 212, 0.12);
}

body[data-bs-theme="dark"] .status-text,
body[data-bs-theme="dark"] .muted,
body[data-bs-theme="dark"] .tiny,
body[data-bs-theme="dark"] .chart-hint,
body[data-bs-theme="dark"] .field,
body[data-bs-theme="dark"] .field > span {
  color: var(--gray-500);
}

body[data-bs-theme="dark"] .status-chip,
body[data-bs-theme="dark"] .badge,
body[data-bs-theme="dark"] .pill {
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

body[data-bs-theme="dark"] .status-chip.success,
body[data-bs-theme="dark"] .status-chip.info,
body[data-bs-theme="dark"] .badge.good {
  border-color: rgba(26, 122, 70, 0.18);
  background: #d9f4e5;
  color: var(--success);
}

body[data-bs-theme="dark"] .table-wrap {
  overflow: auto;
}

body[data-bs-theme="dark"] table {
  color: var(--gray-800);
}

body[data-bs-theme="dark"] th,
body[data-bs-theme="dark"] thead th {
  background: var(--gray-900);
  color: var(--gray-100);
  border-bottom: 1px solid var(--gray-700);
}

body[data-bs-theme="dark"] td,
body[data-bs-theme="dark"] tbody td {
  border-bottom: 1px solid var(--gray-100);
  background: rgba(255, 255, 255, 0.84);
  color: var(--gray-800);
}

body[data-bs-theme="dark"] tbody tr:hover td {
  background: rgba(242, 239, 253, 0.82);
  color: var(--gray-900);
}

body[data-bs-theme="dark"] .kpi-value,
body[data-bs-theme="dark"] .segment-metric-value,
body[data-bs-theme="dark"] .metric-value,
body[data-bs-theme="dark"] td:nth-child(n+3) {
  font-family: var(--font-mono);
}

body[data-bs-theme="dark"] .chart-frame {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 249, 250, 0.9));
}

body[data-bs-theme="dark"] #countryMapPanel .chart-frame,
body[data-bs-theme="dark"] .rsm-map-shell,
body[data-bs-theme="dark"] .rsm-map-stage,
body[data-bs-theme="dark"] .react-country-map-host {
  background: #101820;
  color: #e8eaed;
}

body[data-bs-theme="dark"] .rsm-map-detail,
body[data-bs-theme="dark"] .rsm-country-row {
  background: rgba(20, 22, 24, 0.86);
  color: #e8eaed;
}

body[data-bs-theme="dark"] .rsm-country-row:hover {
  background: rgba(105, 77, 212, 0.24);
}

body[data-bs-theme="dark"] #panel-mapping .mapping-row,
body[data-bs-theme="dark"] #panel-mapping .mapping-section {
  background: rgba(255, 255, 255, 0.92);
}

body[data-bs-theme="dark"] #panel-mapping .mapping-row input,
body[data-bs-theme="dark"] #panel-mapping .mapping-row select,
body[data-bs-theme="dark"] #panel-mapping .mapping-row .btn {
  min-width: 0;
}

/* ============================================================
   Light theme hardening
   The previous visual system was dark. Keep the latest redesign
   as the source of truth and force remaining legacy dark surfaces
   back to the clinical light theme.
   ============================================================ */

body[data-bs-theme="dark"] {
  color-scheme: light;
  --figma-bg: #f0f2f4;
  --figma-shell: rgba(255, 255, 255, 0.94);
  --figma-shell-2: rgba(255, 255, 255, 0.88);
  --figma-card: rgba(255, 255, 255, 0.94);
  --figma-card-2: #ffffff;
  --figma-input: #ffffff;
  --figma-border: rgba(20, 22, 24, 0.12);
  --figma-border-strong: rgba(105, 77, 212, 0.28);
  --figma-text: #1e2124;
  --figma-text-strong: #141618;
  --figma-muted: #4a5260;
  --figma-muted-dark: #6b7685;
}

body[data-bs-theme="dark"] .top-header,
body[data-bs-theme="dark"] .stepper,
body[data-bs-theme="dark"] .guide-status,
body[data-bs-theme="dark"] .filters-toggle-bar,
body[data-bs-theme="dark"] #filtersSidebar,
body[data-bs-theme="dark"] .sidebar-head,
body[data-bs-theme="dark"] .context-bar,
body[data-bs-theme="dark"] .tab-nav,
body[data-bs-theme="dark"] .panel,
body[data-bs-theme="dark"] .panel.nested,
body[data-bs-theme="dark"] .overview-hero,
body[data-bs-theme="dark"] .quality-hero,
body[data-bs-theme="dark"] .segments-hero,
body[data-bs-theme="dark"] .direction-hero,
body[data-bs-theme="dark"] .satisfaction-hero,
body[data-bs-theme="dark"] .admin-hero,
body[data-bs-theme="dark"] .overview-section,
body[data-bs-theme="dark"] .retention-section,
body[data-bs-theme="dark"] .insight-box,
body[data-bs-theme="dark"] .kpi-card,
body[data-bs-theme="dark"] .overview-meta-card,
body[data-bs-theme="dark"] .segment-metric-card,
body[data-bs-theme="dark"] .quality-summary-card,
body[data-bs-theme="dark"] .satisfaction-summary-card,
body[data-bs-theme="dark"] .admin-summary-card,
body[data-bs-theme="dark"] .direction-kpi-card,
body[data-bs-theme="dark"] .chart-frame,
body[data-bs-theme="dark"] .table-wrap,
body[data-bs-theme="dark"] .admin-snapshot-table-wrap,
body[data-bs-theme="dark"] .mapping-section,
body[data-bs-theme="dark"] .mapping-row,
body[data-bs-theme="dark"] .mapping-summary-bar,
body[data-bs-theme="dark"] .mapping-inline-control,
body[data-bs-theme="dark"] .import-drop-zone,
body[data-bs-theme="dark"] .daily-comparison-block,
body[data-bs-theme="dark"] .quality-score-card,
body[data-bs-theme="dark"] .retention-avatar,
body[data-bs-theme="dark"] .retention-year-chip,
body[data-bs-theme="dark"] .overview-chip,
body[data-bs-theme="dark"] .satisfaction-inline-tag,
body[data-bs-theme="dark"] .toast-stack .app-toast {
  border-color: rgba(20, 22, 24, 0.12);
  background: rgba(255, 255, 255, 0.94);
  color: var(--gray-800);
  box-shadow: 0 12px 32px rgba(20, 22, 24, 0.06);
}

body[data-bs-theme="dark"] .panel::after,
body[data-bs-theme="dark"] .panel.nested::after,
body[data-bs-theme="dark"] .context-bar::after,
body[data-bs-theme="dark"] .chart-frame::before,
body[data-bs-theme="dark"] .kpi-card::before,
body[data-bs-theme="dark"] .overview-meta-card::before,
body[data-bs-theme="dark"] .quality-summary-card::before,
body[data-bs-theme="dark"] .satisfaction-summary-card::before,
body[data-bs-theme="dark"] .admin-summary-card::before {
  opacity: 0.22;
}

body[data-bs-theme="dark"] .overview-hero,
body[data-bs-theme="dark"] .quality-hero,
body[data-bs-theme="dark"] .segments-hero,
body[data-bs-theme="dark"] .direction-hero,
body[data-bs-theme="dark"] .satisfaction-hero,
body[data-bs-theme="dark"] .admin-hero {
  background:
    linear-gradient(90deg, rgba(242, 239, 253, 0.82), rgba(255, 255, 255, 0.94) 45%, rgba(244, 245, 246, 0.88));
}

body[data-bs-theme="dark"] .overview-meta-card,
body[data-bs-theme="dark"] .segment-metric-card,
body[data-bs-theme="dark"] .kpi-card,
body[data-bs-theme="dark"] .quality-summary-card,
body[data-bs-theme="dark"] .satisfaction-summary-card,
body[data-bs-theme="dark"] .admin-summary-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 245, 246, 0.94));
}

body[data-bs-theme="dark"] .panel-head,
body[data-bs-theme="dark"] .sidebar-head {
  border-bottom-color: rgba(20, 22, 24, 0.09);
  background: transparent;
}

body[data-bs-theme="dark"] .tab-panel.panel {
  background: transparent;
}

body[data-bs-theme="dark"] .tab-btn.is-active {
  background: var(--red-600);
  color: #ffffff;
}

body[data-bs-theme="dark"] .step,
body[data-bs-theme="dark"] .step.is-active,
body[data-bs-theme="dark"] .step.is-done {
  border-color: rgba(105, 77, 212, 0.18);
  background: #ffffff;
  color: var(--gray-800);
}

body[data-bs-theme="dark"] .step span,
body[data-bs-theme="dark"] .filters-toggle-icon {
  background: var(--red-600);
  color: #ffffff;
}

body[data-bs-theme="dark"] .btn.neutral,
body[data-bs-theme="dark"] .btn.ghost,
body[data-bs-theme="dark"] .overview-chip,
body[data-bs-theme="dark"] .satisfaction-inline-tag {
  background: #ffffff;
  color: var(--gray-800);
}

body[data-bs-theme="dark"] .btn.neutral:hover,
body[data-bs-theme="dark"] .btn.ghost:hover,
body[data-bs-theme="dark"] .overview-chip:hover,
body[data-bs-theme="dark"] .satisfaction-inline-tag:hover {
  background: var(--red-100);
  color: var(--red-800);
}

body[data-bs-theme="dark"] .kpi-label,
body[data-bs-theme="dark"] .overview-meta-label,
body[data-bs-theme="dark"] .segment-metric-label,
body[data-bs-theme="dark"] .quality-summary-label,
body[data-bs-theme="dark"] .satisfaction-summary-label,
body[data-bs-theme="dark"] .admin-summary-label,
body[data-bs-theme="dark"] .mapping-section-head p,
body[data-bs-theme="dark"] .chart-hint,
body[data-bs-theme="dark"] .tiny,
body[data-bs-theme="dark"] .muted,
body[data-bs-theme="dark"] .field,
body[data-bs-theme="dark"] .field > span,
body[data-bs-theme="dark"] .status-text {
  color: var(--gray-500);
}

body[data-bs-theme="dark"] .kpi-value,
body[data-bs-theme="dark"] .overview-meta-value,
body[data-bs-theme="dark"] .segment-metric-value,
body[data-bs-theme="dark"] .quality-summary-value,
body[data-bs-theme="dark"] .satisfaction-summary-value,
body[data-bs-theme="dark"] .admin-summary-value,
body[data-bs-theme="dark"] .context-title h2,
body[data-bs-theme="dark"] .panel-head h4,
body[data-bs-theme="dark"] .mapping-section-head h5,
body[data-bs-theme="dark"] .tab-panel > h3 {
  color: var(--gray-900);
}

body[data-bs-theme="dark"] input,
body[data-bs-theme="dark"] select,
body[data-bs-theme="dark"] textarea,
body[data-bs-theme="dark"] #panel-mapping .mapping-row .field input,
body[data-bs-theme="dark"] #panel-mapping .mapping-row .field select {
  background: #ffffff;
  color: var(--gray-900);
  border-color: rgba(20, 22, 24, 0.14);
}

body[data-bs-theme="dark"] input::placeholder,
body[data-bs-theme="dark"] textarea::placeholder {
  color: var(--gray-300);
}

body[data-bs-theme="dark"] .table-wrap {
  background: rgba(255, 255, 255, 0.94);
}

body[data-bs-theme="dark"] th,
body[data-bs-theme="dark"] thead th {
  background: var(--gray-900);
  color: #ffffff;
}

body[data-bs-theme="dark"] td,
body[data-bs-theme="dark"] tbody td {
  background: rgba(255, 255, 255, 0.96);
  color: var(--gray-800);
}

body[data-bs-theme="dark"] tbody tr:nth-child(even) td {
  background: rgba(244, 245, 246, 0.96);
}

body[data-bs-theme="dark"] tbody tr:hover td {
  background: rgba(242, 239, 253, 0.98);
  color: var(--gray-900);
}

body[data-bs-theme="dark"] .chart-frame {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 245, 246, 0.92));
}

body[data-bs-theme="dark"] .quality-score-track {
  stroke: rgba(20, 22, 24, 0.12);
}

body[data-bs-theme="dark"] .auth-gate {
  background:
    radial-gradient(circle at 50% 0%, rgba(105, 77, 212, 0.11), transparent 36%),
    var(--bg);
}

body[data-bs-theme="dark"] .auth-card {
  background: rgba(255, 255, 255, 0.96);
}

body[data-bs-theme="dark"] .auth-brand h1,
body[data-bs-theme="dark"] .auth-brand p {
  color: var(--gray-900);
}

body[data-bs-theme="dark"] #countryMapPanel .chart-frame,
body[data-bs-theme="dark"] .rsm-map-shell,
body[data-bs-theme="dark"] .rsm-map-stage,
body[data-bs-theme="dark"] .react-country-map-host,
body[data-bs-theme="dark"] .rsm-map-detail,
body[data-bs-theme="dark"] .rsm-country-row {
  background: #ffffff;
  color: var(--gray-800);
}

body[data-bs-theme="dark"] .rsm-country-row:hover {
  background: var(--red-100);
  color: var(--red-800);
}

@media (max-width: 860px) {
  body[data-bs-theme="dark"] .top-header {
    margin: 8px;
  }

  body[data-bs-theme="dark"] .panel.nested,
  body[data-bs-theme="dark"] .overview-hero,
  body[data-bs-theme="dark"] .quality-hero,
  body[data-bs-theme="dark"] .segments-hero,
  body[data-bs-theme="dark"] .direction-hero,
  body[data-bs-theme="dark"] .satisfaction-hero,
  body[data-bs-theme="dark"] .admin-hero {
    border-radius: var(--radius-md);
  }
}

/* ============================================================
   Final light override
   Stronger than legacy dark selectors, including hover/focus states.
   ============================================================ */

body[data-bs-theme="dark"] .top-header,
body[data-bs-theme="dark"] .stepper,
body[data-bs-theme="dark"] .guide-status,
body[data-bs-theme="dark"] .filters-toggle-bar,
body[data-bs-theme="dark"] #filtersSidebar,
body[data-bs-theme="dark"] .sidebar-head,
body[data-bs-theme="dark"] .context-bar,
body[data-bs-theme="dark"] .tab-nav,
body[data-bs-theme="dark"] .panel,
body[data-bs-theme="dark"] .panel.nested,
body[data-bs-theme="dark"] .overview-hero,
body[data-bs-theme="dark"] .quality-hero,
body[data-bs-theme="dark"] .segments-hero,
body[data-bs-theme="dark"] .direction-hero,
body[data-bs-theme="dark"] .satisfaction-hero,
body[data-bs-theme="dark"] .admin-hero,
body[data-bs-theme="dark"] .overview-section,
body[data-bs-theme="dark"] .retention-section,
body[data-bs-theme="dark"] .insight-box,
body[data-bs-theme="dark"] .chart-frame,
body[data-bs-theme="dark"] .table-wrap,
body[data-bs-theme="dark"] .admin-snapshot-table-wrap,
body[data-bs-theme="dark"] .participants-table-wrap,
body[data-bs-theme="dark"] .daily-comparison-block,
body[data-bs-theme="dark"] .import-drop-zone,
body[data-bs-theme="dark"] #panel-mapping .mapping-summary-bar,
body[data-bs-theme="dark"] #panel-mapping .mapping-section,
body[data-bs-theme="dark"] #panel-mapping .mapping-row,
body[data-bs-theme="dark"] #panel-mapping .mapping-inline-control,
body[data-bs-theme="dark"] #panel-satisfaction #satisfactionReasonsSection,
body[data-bs-theme="dark"] #panel-admin .admin-grid > .panel.nested {
  background: rgba(255, 255, 255, 0.96) !important;
  color: var(--gray-800) !important;
  border-color: rgba(20, 22, 24, 0.12) !important;
}

body[data-bs-theme="dark"] .overview-hero,
body[data-bs-theme="dark"] .quality-hero,
body[data-bs-theme="dark"] .segments-hero,
body[data-bs-theme="dark"] .direction-hero,
body[data-bs-theme="dark"] .satisfaction-hero,
body[data-bs-theme="dark"] .admin-hero {
  background:
    linear-gradient(90deg, rgba(242, 239, 253, 0.9), rgba(255, 255, 255, 0.98) 46%, rgba(244, 245, 246, 0.92)) !important;
}

body[data-bs-theme="dark"] .kpi-card,
body[data-bs-theme="dark"] .kpi-card-action,
body[data-bs-theme="dark"] .overview-meta-card,
body[data-bs-theme="dark"] .segment-metric-card,
body[data-bs-theme="dark"] .direction-summary-card,
body[data-bs-theme="dark"] .quality-summary-card,
body[data-bs-theme="dark"] .satisfaction-summary-card,
body[data-bs-theme="dark"] .admin-summary-card,
body[data-bs-theme="dark"] .direction-kpi-card,
body[data-bs-theme="dark"] #panel-direction #directionKpiCards .direction-kpi-card {
  background: linear-gradient(180deg, #ffffff, #f4f5f6) !important;
  color: var(--gray-800) !important;
  border-color: rgba(20, 22, 24, 0.12) !important;
}

body[data-bs-theme="dark"] .kpi-card:hover,
body[data-bs-theme="dark"] .kpi-card-action:hover,
body[data-bs-theme="dark"] .kpi-card-action:focus-visible,
body[data-bs-theme="dark"] .overview-meta-card:hover,
body[data-bs-theme="dark"] .segment-metric-card:hover,
body[data-bs-theme="dark"] .direction-summary-card:hover,
body[data-bs-theme="dark"] .quality-summary-card:hover,
body[data-bs-theme="dark"] .satisfaction-summary-card:hover,
body[data-bs-theme="dark"] .admin-summary-card:hover,
body[data-bs-theme="dark"] .direction-kpi-card:hover,
body[data-bs-theme="dark"] #panel-direction #directionKpiCards .direction-kpi-card:hover,
body[data-bs-theme="dark"] .import-drop-zone:hover,
body[data-bs-theme="dark"] .import-drop-zone:focus-visible,
body[data-bs-theme="dark"] #panel-mapping .mapping-row:hover,
body[data-bs-theme="dark"] #panel-mapping .mapping-row.is-mapped:hover,
body[data-bs-theme="dark"] #panel-mapping .mapping-row.is-unmapped:hover,
body[data-bs-theme="dark"] #panel-mapping .mapping-row.is-required-missing:hover,
body[data-bs-theme="dark"] #panel-mapping .mapping-row.is-duplicate:hover {
  background: var(--red-100) !important;
  color: var(--gray-900) !important;
  border-color: rgba(105, 77, 212, 0.28) !important;
}

body[data-bs-theme="dark"] .kpi-card-action.is-active {
  background: linear-gradient(180deg, #ffffff, var(--red-100)) !important;
  color: var(--gray-900) !important;
  border-color: rgba(105, 77, 212, 0.34) !important;
}

body[data-bs-theme="dark"] .kpi-card-action.is-active .kpi-label,
body[data-bs-theme="dark"] .kpi-card-action.is-active .kpi-value {
  color: var(--gray-900) !important;
}

body[data-bs-theme="dark"] button:not(.primary):not(.btn-primary):hover,
body[data-bs-theme="dark"] button:not(.primary):not(.btn-primary):focus-visible,
body[data-bs-theme="dark"] .btn:not(.primary):hover,
body[data-bs-theme="dark"] .btn:not(.primary):focus-visible,
body[data-bs-theme="dark"] .table-sort-btn:hover,
body[data-bs-theme="dark"] .table-sort-btn:focus-visible,
body[data-bs-theme="dark"] .overview-chip:hover,
body[data-bs-theme="dark"] .overview-chip:focus-visible,
body[data-bs-theme="dark"] .satisfaction-tag-chip:hover,
body[data-bs-theme="dark"] .satisfaction-tag-chip:focus-visible,
body[data-bs-theme="dark"] .satisfaction-inline-tag:hover,
body[data-bs-theme="dark"] .satisfaction-inline-tag:focus-visible,
body[data-bs-theme="dark"] .rsm-map-controls button:hover,
body[data-bs-theme="dark"] .rsm-map-controls button:focus-visible,
body[data-bs-theme="dark"] .rsm-country-row:hover,
body[data-bs-theme="dark"] .rsm-country-row:focus-visible {
  background: var(--red-100) !important;
  color: var(--red-800) !important;
  border-color: rgba(105, 77, 212, 0.32) !important;
}

body[data-bs-theme="dark"] .tab-btn:hover,
body[data-bs-theme="dark"] .tab-btn:focus-visible {
  background: var(--red-100) !important;
  color: var(--red-800) !important;
}

body[data-bs-theme="dark"] .tab-btn.is-active {
  background: var(--red-600) !important;
  color: #ffffff !important;
  border-color: var(--red-600) !important;
}

body[data-bs-theme="dark"] .step,
body[data-bs-theme="dark"] .step.is-active,
body[data-bs-theme="dark"] .step.is-done,
body[data-bs-theme="dark"] .context-meta span:not(.status-chip),
body[data-bs-theme="dark"] .status-chip,
body[data-bs-theme="dark"] .badge,
body[data-bs-theme="dark"] .pill,
body[data-bs-theme="dark"] .retention-year-chip,
body[data-bs-theme="dark"] .retention-avatar,
body[data-bs-theme="dark"] .rsm-country-row,
body[data-bs-theme="dark"] .rsm-map-controls button {
  background: #ffffff !important;
  color: var(--gray-800) !important;
  border-color: rgba(20, 22, 24, 0.12) !important;
}

body[data-bs-theme="dark"] .status-chip.success,
body[data-bs-theme="dark"] .status-chip.info,
body[data-bs-theme="dark"] .badge.good,
body[data-bs-theme="dark"] .pill.success {
  background: #d9f4e5 !important;
  color: var(--success) !important;
  border-color: rgba(26, 122, 70, 0.2) !important;
}

body[data-bs-theme="dark"] .badge.warn,
body[data-bs-theme="dark"] .pill.warning {
  background: #fff4d6 !important;
  color: #7a5008 !important;
  border-color: rgba(122, 80, 8, 0.2) !important;
}

body[data-bs-theme="dark"] .badge.bad,
body[data-bs-theme="dark"] .pill.error {
  background: var(--red-100) !important;
  color: var(--red-800) !important;
  border-color: rgba(160, 26, 46, 0.2) !important;
}

body[data-bs-theme="dark"] th,
body[data-bs-theme="dark"] thead th,
body[data-bs-theme="dark"] .table-wrap table thead th {
  background: #f4f5f6 !important;
  color: var(--gray-900) !important;
  border-bottom-color: rgba(20, 22, 24, 0.14) !important;
}

body[data-bs-theme="dark"] td,
body[data-bs-theme="dark"] tbody td,
body[data-bs-theme="dark"] .table-wrap table tbody td,
body[data-bs-theme="dark"] .table-wrap table tbody td:first-child,
body[data-bs-theme="dark"] #crossTableBody td:not(:first-child),
body[data-bs-theme="dark"] #annualComparisonBody td:not(:first-child) {
  background: #ffffff !important;
  color: var(--gray-800) !important;
}

body[data-bs-theme="dark"] tbody tr:nth-child(even) td,
body[data-bs-theme="dark"] .table-wrap table tbody tr:nth-child(even) td,
body[data-bs-theme="dark"] .table-wrap table tbody tr:nth-child(even) td:first-child {
  background: #f8f9fa !important;
}

body[data-bs-theme="dark"] tbody tr:hover,
body[data-bs-theme="dark"] tbody tr:hover td,
body[data-bs-theme="dark"] .table-wrap table tbody tr:hover,
body[data-bs-theme="dark"] .table-wrap table tbody tr:hover td,
body[data-bs-theme="dark"] .table-wrap table tbody tr:hover td:first-child,
body[data-bs-theme="dark"] #crossTableBody tr:hover td:not(:first-child),
body[data-bs-theme="dark"] #annualComparisonBody tr:hover td:not(:first-child) {
  background: var(--red-100) !important;
  color: var(--gray-900) !important;
}

body[data-bs-theme="dark"] input,
body[data-bs-theme="dark"] select,
body[data-bs-theme="dark"] textarea,
body[data-bs-theme="dark"] .field input,
body[data-bs-theme="dark"] .field select,
body[data-bs-theme="dark"] .field textarea,
body[data-bs-theme="dark"] #panel-mapping .mapping-row .field input,
body[data-bs-theme="dark"] #panel-mapping .mapping-row .field select {
  background: #ffffff !important;
  color: var(--gray-900) !important;
  border-color: rgba(20, 22, 24, 0.14) !important;
}

body[data-bs-theme="dark"] input:hover,
body[data-bs-theme="dark"] select:hover,
body[data-bs-theme="dark"] textarea:hover,
body[data-bs-theme="dark"] input:focus,
body[data-bs-theme="dark"] select:focus,
body[data-bs-theme="dark"] textarea:focus,
body[data-bs-theme="dark"] input:focus-visible,
body[data-bs-theme="dark"] select:focus-visible,
body[data-bs-theme="dark"] textarea:focus-visible {
  background: #ffffff !important;
  color: var(--gray-900) !important;
  border-color: rgba(105, 77, 212, 0.42) !important;
  box-shadow: 0 0 0 3px rgba(105, 77, 212, 0.12) !important;
}

body[data-bs-theme="dark"] #countryMapPanel .chart-frame,
body[data-bs-theme="dark"] .react-country-map-host,
body[data-bs-theme="dark"] .rsm-map-shell,
body[data-bs-theme="dark"] .rsm-map-stage,
body[data-bs-theme="dark"] .rsm-map-detail,
body[data-bs-theme="dark"] .rsm-map-tooltip {
  background: #ffffff !important;
  color: var(--gray-800) !important;
  border-color: rgba(20, 22, 24, 0.12) !important;
}

body[data-bs-theme="dark"] .rsm-map-tooltip strong,
body[data-bs-theme="dark"] .rsm-map-tooltip span,
body[data-bs-theme="dark"] .rsm-map-detail h5,
body[data-bs-theme="dark"] .rsm-location-group h6,
body[data-bs-theme="dark"] .rsm-location-row,
body[data-bs-theme="dark"] .rsm-country-row strong {
  color: var(--gray-800) !important;
}

body[data-bs-theme="dark"] .chart-frame,
body[data-bs-theme="dark"] .chart-frame.large,
body[data-bs-theme="dark"] .chart-frame.small {
  background: linear-gradient(180deg, #ffffff, #f8f9fa) !important;
}

body[data-bs-theme="dark"] .panel::before,
body[data-bs-theme="dark"] .panel::after,
body[data-bs-theme="dark"] .panel.nested::after,
body[data-bs-theme="dark"] .context-bar::after,
body[data-bs-theme="dark"] .chart-frame::before,
body[data-bs-theme="dark"] .kpi-card::before,
body[data-bs-theme="dark"] .overview-meta-card::before,
body[data-bs-theme="dark"] .quality-summary-card::before,
body[data-bs-theme="dark"] .satisfaction-summary-card::before,
body[data-bs-theme="dark"] .admin-summary-card::before {
  opacity: 0.12 !important;
}

/* ============================================================
   Readability rhythm layer
   Better spacing, scanning distance and table/form density.
   ============================================================ */

body[data-bs-theme="dark"] {
  --readable-page-x: clamp(16px, 2vw, 30px);
  --readable-section-gap: clamp(18px, 2vw, 28px);
  --readable-panel-gap: clamp(14px, 1.5vw, 22px);
  --readable-card-gap: clamp(12px, 1.25vw, 18px);
  --readable-panel-pad: clamp(16px, 1.6vw, 24px);
  --readable-compact-pad: clamp(12px, 1.2vw, 18px);
  --readable-line: 1.58;
  line-height: var(--readable-line);
}

body[data-bs-theme="dark"] .app-shell {
  padding-bottom: 40px !important;
}

body[data-bs-theme="dark"] .top-header {
  margin: 12px var(--readable-page-x) 0 !important;
  padding: 12px clamp(16px, 1.5vw, 24px) !important;
  gap: clamp(14px, 1.6vw, 24px) !important;
}

body[data-bs-theme="dark"] .header-actions {
  gap: 10px !important;
  row-gap: 8px !important;
}

body[data-bs-theme="dark"] .stepper {
  margin: var(--ui-shell-gap) var(--readable-page-x) 0 !important;
  padding: 12px 18px !important;
  gap: 10px !important;
}

body[data-bs-theme="dark"] .step {
  padding: 8px 12px !important;
  min-height: 36px !important;
}

body[data-bs-theme="dark"] .guide-status {
  margin: 10px var(--readable-page-x) 0 !important;
  padding: 10px 16px !important;
}

body[data-bs-theme="dark"] .filters-toggle-bar {
  margin: var(--ui-shell-gap) var(--readable-page-x) 0 !important;
  padding: 0 !important;
}

body[data-bs-theme="dark"] .workspace,
body[data-bs-theme="dark"] #workspace.is-filters-hidden {
  padding: var(--ui-section-gap) var(--readable-page-x) 36px !important;
  column-gap: var(--ui-section-gap) !important;
  align-items: start !important;
}

body[data-bs-theme="dark"] #filtersSidebar {
  padding: var(--filters-sidebar-padding) !important;
  gap: 14px !important;
}

body[data-bs-theme="dark"] .sidebar-head {
  padding: 0 0 14px !important;
  margin-bottom: 16px !important;
}

body[data-bs-theme="dark"] .main-content {
  gap: var(--readable-section-gap) !important;
}

body[data-bs-theme="dark"] .context-bar {
  padding: 8px 12px !important;
  gap: 10px !important;
}

body[data-bs-theme="dark"] .context-title {
  gap: 6px !important;
}

body[data-bs-theme="dark"] .context-meta {
  gap: 8px !important;
  row-gap: 8px !important;
}

body[data-bs-theme="dark"] .context-meta span:not(.status-chip),
body[data-bs-theme="dark"] .status-chip {
  padding: 6px 10px !important;
}

body[data-bs-theme="dark"] .tab-nav {
  padding: 7px !important;
  gap: 6px !important;
  margin: 0 !important;
}

body[data-bs-theme="dark"] .tab-btn {
  min-height: 38px !important;
  padding: 9px 13px !important;
}

body[data-bs-theme="dark"] .tab-panel {
  padding-top: 0 !important;
}

body[data-bs-theme="dark"] .tab-panel > h3 {
  margin: 0 0 18px !important;
  padding: 14px 16px !important;
}

body[data-bs-theme="dark"] .panel:not(.context-bar),
body[data-bs-theme="dark"] .panel.nested,
body[data-bs-theme="dark"] .overview-hero,
body[data-bs-theme="dark"] .quality-hero,
body[data-bs-theme="dark"] .segments-hero,
body[data-bs-theme="dark"] .direction-hero,
body[data-bs-theme="dark"] .satisfaction-hero,
body[data-bs-theme="dark"] .admin-hero,
body[data-bs-theme="dark"] .overview-section,
body[data-bs-theme="dark"] .retention-section,
body[data-bs-theme="dark"] .insight-box {
  padding: var(--readable-panel-pad) !important;
}

body[data-bs-theme="dark"] .panel-head,
body[data-bs-theme="dark"] .overview-hero-head {
  gap: var(--panel-head-gap, 16px) !important;
  padding-bottom: var(--panel-head-padding-bottom, 12px) !important;
  margin-bottom: var(--panel-head-margin-bottom, 16px) !important;
}

body[data-bs-theme="dark"] .panel-head h4,
body[data-bs-theme="dark"] .overview-hero h3,
body[data-bs-theme="dark"] h2,
body[data-bs-theme="dark"] h3,
body[data-bs-theme="dark"] h4 {
  line-height: 1.28 !important;
}

body[data-bs-theme="dark"] .muted,
body[data-bs-theme="dark"] .chart-hint,
body[data-bs-theme="dark"] p,
body[data-bs-theme="dark"] li {
  line-height: 1.58 !important;
}

body[data-bs-theme="dark"] .overview-hero-footer,
body[data-bs-theme="dark"] .row-actions,
body[data-bs-theme="dark"] .panel-tools,
body[data-bs-theme="dark"] .overview-chip-list {
  gap: var(--row-actions-gap, 10px) !important;
  row-gap: var(--row-actions-gap, 10px) !important;
}

body[data-bs-theme="dark"] .overview-grid,
body[data-bs-theme="dark"] .overview-charts-grid,
body[data-bs-theme="dark"] .survey-grid,
body[data-bs-theme="dark"] .segments-top-grid,
body[data-bs-theme="dark"] .direction-detail-layout,
body[data-bs-theme="dark"] .admin-grid,
body[data-bs-theme="dark"] .retention-similarity-grid {
  gap: var(--ui-card-gap) !important;
}

body[data-bs-theme="dark"] .overview-meta-grid,
body[data-bs-theme="dark"] .kpi-grid,
body[data-bs-theme="dark"] .kpi-grid.compact,
body[data-bs-theme="dark"] .segments-summary-grid,
body[data-bs-theme="dark"] .quality-summary-grid,
body[data-bs-theme="dark"] .satisfaction-summary-grid,
body[data-bs-theme="dark"] .direction-summary-grid,
body[data-bs-theme="dark"] .admin-summary-grid {
  gap: var(--ui-card-gap) !important;
}

body[data-bs-theme="dark"] .kpi-card,
body[data-bs-theme="dark"] .kpi-card-action,
body[data-bs-theme="dark"] .overview-meta-card,
body[data-bs-theme="dark"] .segment-metric-card,
body[data-bs-theme="dark"] .direction-summary-card,
body[data-bs-theme="dark"] .quality-summary-card,
body[data-bs-theme="dark"] .satisfaction-summary-card,
body[data-bs-theme="dark"] .admin-summary-card,
body[data-bs-theme="dark"] .direction-kpi-card {
  padding: var(--readable-compact-pad) !important;
  gap: 6px !important;
  min-height: 112px !important;
}

body[data-bs-theme="dark"] .kpi-value,
body[data-bs-theme="dark"] .overview-meta-value,
body[data-bs-theme="dark"] .segment-metric-value,
body[data-bs-theme="dark"] .quality-summary-value,
body[data-bs-theme="dark"] .satisfaction-summary-value,
body[data-bs-theme="dark"] .admin-summary-value {
  margin: 6px 0 4px !important;
  line-height: 1.12 !important;
}

body[data-bs-theme="dark"] .chart-frame {
  padding: 14px !important;
  min-height: 280px !important;
}

body[data-bs-theme="dark"] .chart-frame.large {
  min-height: 360px !important;
}

body[data-bs-theme="dark"] .chart-frame.small {
  min-height: 220px !important;
}

body[data-bs-theme="dark"] .form-grid,
body[data-bs-theme="dark"] .newsletter-form-grid,
body[data-bs-theme="dark"] .quality-filter-grid,
body[data-bs-theme="dark"] .satisfaction-filter-grid,
body[data-bs-theme="dark"] .mapping-filter-grid,
body[data-bs-theme="dark"] .admin-snapshot-filter-grid {
  gap: var(--form-grid-gap, 16px) !important;
  row-gap: var(--form-grid-row-gap, 14px) !important;
}

body[data-bs-theme="dark"] .field {
  gap: 7px !important;
  line-height: 1.4 !important;
}

body[data-bs-theme="dark"] #filtersSidebar .field {
  margin: 0 0 var(--filters-field-gap);
}

body[data-bs-theme="dark"] #filtersSidebar #btnApplyFilters {
  margin-top: 2px;
}

body[data-bs-theme="dark"] .field input:not([type="checkbox"]):not([type="radio"]),
body[data-bs-theme="dark"] .field select,
body[data-bs-theme="dark"] .field textarea,
body[data-bs-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
body[data-bs-theme="dark"] select,
body[data-bs-theme="dark"] textarea {
  min-height: 38px !important;
  padding: 9px 11px !important;
}

body[data-bs-theme="dark"] .overview-inline-check {
  min-height: 42px !important;
  padding: 7px 10px !important;
}

body[data-bs-theme="dark"] .btn,
body[data-bs-theme="dark"] button.btn,
body[data-bs-theme="dark"] .overview-chip,
body[data-bs-theme="dark"] .satisfaction-tag-chip,
body[data-bs-theme="dark"] .satisfaction-inline-tag,
body[data-bs-theme="dark"] .table-sort-btn {
  min-height: 36px !important;
  padding: 8px 12px !important;
}

body[data-bs-theme="dark"] .table-wrap,
body[data-bs-theme="dark"] .admin-snapshot-table-wrap,
body[data-bs-theme="dark"] .participants-table-wrap {
  margin-top: 12px !important;
  padding: 0 !important;
}

body[data-bs-theme="dark"] table {
  border-spacing: 0 !important;
}

body[data-bs-theme="dark"] th,
body[data-bs-theme="dark"] thead th,
body[data-bs-theme="dark"] td,
body[data-bs-theme="dark"] tbody td,
body[data-bs-theme="dark"] .table-wrap table th,
body[data-bs-theme="dark"] .table-wrap table td {
  padding: 11px 14px !important;
  line-height: 1.45 !important;
}

body[data-bs-theme="dark"] tbody tr {
  min-height: 42px !important;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-actions,
body[data-bs-theme="dark"] #panel-mapping .mapping-config-actions,
body[data-bs-theme="dark"] #panel-mapping .mapping-action-pair {
  gap: 10px !important;
  row-gap: 10px !important;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-section-grid {
  gap: 14px !important;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-section {
  padding: 18px !important;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-row {
  padding: 13px !important;
  gap: 12px !important;
}

body[data-bs-theme="dark"] .satisfaction-tag-groups,
body[data-bs-theme="dark"] .satisfaction-tag-list {
  gap: 10px !important;
}

body[data-bs-theme="dark"] .toast-stack {
  gap: 10px !important;
}

body[data-bs-theme="dark"] .rsm-map-shell {
  gap: 16px !important;
  padding: 14px !important;
}

body[data-bs-theme="dark"] .rsm-map-detail {
  padding: 14px !important;
}

body[data-bs-theme="dark"] .rsm-country-list,
body[data-bs-theme="dark"] .rsm-location-group {
  gap: 9px !important;
}

@media (max-width: 980px) {
  body[data-bs-theme="dark"] {
    --readable-page-x: 12px;
    --readable-section-gap: 16px;
    --readable-panel-pad: 15px;
  }

  body[data-bs-theme="dark"] .workspace,
  body[data-bs-theme="dark"] #workspace.is-filters-hidden {
    padding-top: 14px !important;
  }

  body[data-bs-theme="dark"] .overview-hero-head,
  body[data-bs-theme="dark"] .panel-head,
  body[data-bs-theme="dark"] .context-bar {
    align-items: stretch !important;
  }
}

@media (max-width: 680px) {
  body[data-bs-theme="dark"] {
    --readable-page-x: 10px;
    --readable-panel-pad: 14px;
  }

  body[data-bs-theme="dark"] .top-header,
  body[data-bs-theme="dark"] .stepper,
  body[data-bs-theme="dark"] .guide-status,
  body[data-bs-theme="dark"] .filters-toggle-bar {
    margin-left: var(--readable-page-x) !important;
    margin-right: var(--readable-page-x) !important;
  }

  body[data-bs-theme="dark"] th,
  body[data-bs-theme="dark"] td,
  body[data-bs-theme="dark"] .table-wrap table th,
  body[data-bs-theme="dark"] .table-wrap table td {
    padding: 10px 11px !important;
  }
}

/* ============================================================
   Top layout correction
   Keep header, onboarding, filters and content on coherent widths.
   ============================================================ */

body[data-bs-theme="dark"] {
  --top-layout-x: clamp(14px, 1.35vw, 24px);
  --top-layout-gap: 12px;
}

body[data-bs-theme="dark"] .app-shell {
  overflow-x: clip !important;
}

body[data-bs-theme="dark"] .top-header {
  width: auto !important;
  max-width: none !important;
  min-height: 68px !important;
  margin: 10px var(--top-layout-x) 0 !important;
  padding: 12px 18px !important;
  display: grid !important;
  grid-template-columns: minmax(180px, 1fr) minmax(0, auto) !important;
  align-items: center !important;
  gap: 16px !important;
}

body[data-bs-theme="dark"] .header-actions {
  grid-column: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}

body[data-bs-theme="dark"] .account-panel {
  min-width: 0 !important;
  max-width: 330px !important;
  flex: 0 1 330px !important;
}

body[data-bs-theme="dark"] .account-email {
  min-width: 0 !important;
  max-width: 220px !important;
}

body[data-bs-theme="dark"] .stepper {
  position: relative !important;
  inset: auto !important;
  width: auto !important;
  max-width: none !important;
  min-height: 52px !important;
  margin: var(--top-layout-gap) var(--top-layout-x) 0 !important;
  padding: 10px 18px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  overflow: visible !important;
  transform: none !important;
}

body[data-bs-theme="dark"] .step {
  min-height: 32px !important;
  padding: 7px 10px !important;
}

body[data-bs-theme="dark"] .guide-status {
  width: auto !important;
  margin: var(--top-layout-gap) var(--top-layout-x) 0 !important;
  padding: 10px 16px !important;
}

body[data-bs-theme="dark"] .filters-toggle-bar {
  width: 100% !important;
  max-width: none !important;
  min-height: 46px !important;
  margin: var(--top-layout-gap) 0 0 !important;
  padding: 8px var(--top-layout-x) !important;
  border-right: 0 !important;
  border-left: 0 !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: center !important;
}

body[data-bs-theme="dark"] .filters-toggle {
  min-height: 34px !important;
  padding: 7px 12px !important;
}

body[data-bs-theme="dark"] .workspace,
body[data-bs-theme="dark"] #workspace.is-filters-hidden {
  width: 100% !important;
  padding: var(--ui-section-gap) var(--top-layout-x) 36px !important;
}

body[data-bs-theme="dark"] .context-bar,
body[data-bs-theme="dark"] .tab-nav,
body[data-bs-theme="dark"] .overview-hero,
body[data-bs-theme="dark"] .overview-meta-grid,
body[data-bs-theme="dark"] .kpi-grid,
body[data-bs-theme="dark"] .overview-insight,
body[data-bs-theme="dark"] .overview-grid {
  width: 100% !important;
  max-width: none !important;
}

body[data-bs-theme="dark"] .overview-hero-head {
  display: grid !important;
  grid-template-columns: minmax(280px, 1fr) minmax(520px, auto) !important;
  align-items: end !important;
  gap: 18px !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-hero-tools {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: max-content minmax(140px, 160px) max-content max-content !important;
  justify-content: end !important;
  align-items: end !important;
  gap: 10px !important;
}

body[data-bs-theme="dark"] .overview-inline-field {
  min-width: 0 !important;
}

body[data-bs-theme="dark"] .overview-inline-check {
  width: auto !important;
  min-width: 0 !important;
  min-height: 38px !important;
  padding: 8px 10px !important;
  white-space: nowrap !important;
}

body[data-bs-theme="dark"] .overview-hero-footer {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
}

body[data-bs-theme="dark"] .overview-meta-card,
body[data-bs-theme="dark"] .kpi-card,
body[data-bs-theme="dark"] .kpi-card-action {
  min-height: 104px !important;
}

@media (max-width: 1220px) {
  body[data-bs-theme="dark"] .top-header {
    grid-template-columns: 1fr !important;
  }

  body[data-bs-theme="dark"] .header-actions {
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
  }

  body[data-bs-theme="dark"] .account-panel {
    flex-basis: auto !important;
    max-width: 100% !important;
  }

  body[data-bs-theme="dark"] .stepper {
    justify-content: flex-start !important;
  }

  body[data-bs-theme="dark"] .overview-hero-head {
    grid-template-columns: 1fr !important;
  }

  body[data-bs-theme="dark"] #panel-overview .overview-hero-tools {
    justify-content: start !important;
  }
}

@media (max-width: 760px) {
  body[data-bs-theme="dark"] {
    --top-layout-x: 10px;
    --ui-section-gap: 14px;
    --ui-card-gap: 12px;
    --filters-sidebar-padding: 16px;
    --filters-field-gap: 16px;
    --compact-header-position: relative;
    --compact-header-padding: 14px 16px;
    --compact-header-columns: 1fr;
    --compact-header-gap: 12px;
    --compact-header-actions-column: 1;
    --compact-header-actions-display: grid;
    --compact-header-actions-width: 100%;
    --compact-header-actions-justify: stretch;
    --compact-header-actions-overflow: visible;
    --compact-stepper-display: grid;
    --compact-stepper-min-height: 0;
    --compact-stepper-justify: stretch;
    --compact-stepper-overflow: visible;
  }

  body[data-bs-theme="dark"] .stepper {
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
  }

  body[data-bs-theme="dark"] #panel-overview .overview-hero-tools,
  body[data-bs-theme="dark"] .overview-hero-footer {
    grid-template-columns: 1fr !important;
  }

  body[data-bs-theme="dark"] #panel-overview .overview-hero-tools > *,
  body[data-bs-theme="dark"] .overview-chip-list {
    width: 100% !important;
  }
}

/* Compact tab bar: prevent generic .panel spacing from stretching the tabs. */
body[data-bs-theme="dark"] .tab-nav.panel {
  position: relative !important;
  top: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 6px 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  border: 1px solid rgba(20, 22, 24, 0.12) !important;
  border-radius: var(--radius-lg) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  box-shadow: 0 10px 26px rgba(20, 22, 24, 0.05) !important;
}

body[data-bs-theme="dark"] .tab-nav.panel::before,
body[data-bs-theme="dark"] .tab-nav.panel::after {
  content: none !important;
  display: none !important;
}

body[data-bs-theme="dark"] .tab-nav.panel .tab-btn {
  height: 34px !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 13px !important;
  flex: 0 0 auto !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-md) !important;
  line-height: 1 !important;
}

body[data-bs-theme="dark"] .tab-nav.panel .tab-btn.is-active {
  border-color: var(--red-600) !important;
  background: var(--red-600) !important;
  color: #ffffff !important;
}

/* Compact overview hero: remove the empty vertical band in the report header. */
body[data-bs-theme="dark"] #panel-overview .overview-hero {
  padding: 14px 24px 16px !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-hero-head {
  margin-bottom: 8px !important;
  padding-bottom: 10px !important;
  align-items: center !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-hero h3 {
  margin-bottom: 6px !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-eyebrow,
body[data-bs-theme="dark"] #panel-overview .overview-subtitle {
  margin-bottom: 6px !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-subtitle {
  max-width: 760px !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-hero-tools {
  grid-template-columns: max-content minmax(132px, 154px) max-content max-content !important;
  gap: 8px !important;
  align-items: end !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-hero-tools .btn,
body[data-bs-theme="dark"] #panel-overview .overview-hero-tools select,
body[data-bs-theme="dark"] #panel-overview .overview-inline-check {
  min-height: 36px !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-inline-field {
  gap: 5px !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-inline-check {
  padding: 7px 10px !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-hero-footer {
  margin-top: 0 !important;
  min-height: 34px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-chip-list {
  gap: 8px !important;
  row-gap: 6px !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-chip {
  min-height: 30px !important;
  padding: 0 12px !important;
}

@media (max-width: 1220px) {
  body[data-bs-theme="dark"] #panel-overview .overview-hero {
    padding: 14px !important;
  }

  body[data-bs-theme="dark"] #panel-overview .overview-hero-tools {
    grid-template-columns: repeat(2, minmax(0, max-content)) !important;
  }

  body[data-bs-theme="dark"] #panel-overview .overview-hero-footer {
    justify-content: flex-start !important;
  }
}

/* Overview report tools: fixed proportions and aligned controls. */
body[data-bs-theme="dark"] #panel-overview .overview-hero-tools {
  grid-template-columns: 128px 154px 184px 160px !important;
  justify-content: end !important;
  align-items: end !important;
  column-gap: 10px !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-hero-tools .btn {
  width: 100% !important;
  height: 36px !important;
  min-height: 36px !important;
  padding-inline: 10px !important;
  white-space: nowrap !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-inline-field {
  width: 100% !important;
  min-width: 0 !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-inline-field select {
  width: 100% !important;
  height: 36px !important;
  min-height: 36px !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-inline-check {
  width: 184px !important;
  min-width: 184px !important;
  max-width: 184px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-inline-check span {
  min-width: 0 !important;
  overflow: hidden !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
  letter-spacing: 0.04em !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-bs-theme="dark"] #panel-overview .overview-inline-check input[type="checkbox"] {
  width: 14px !important;
  height: 14px !important;
  flex: 0 0 14px !important;
  margin: 0 !important;
}

@media (max-width: 1220px) {
  body[data-bs-theme="dark"] #panel-overview .overview-hero-tools {
    grid-template-columns: 128px 154px 184px 160px !important;
    justify-content: start !important;
    overflow-x: auto !important;
    padding-bottom: 2px !important;
  }
}

@media (max-width: 760px) {
  body[data-bs-theme="dark"] #panel-overview .overview-hero-tools {
    grid-template-columns: 1fr !important;
  }

  body[data-bs-theme="dark"] #panel-overview .overview-inline-check {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}

/* Unified onboarding bar: merge the stepper and guide status into one compact block. */
body[data-bs-theme="dark"] .stepper.panel {
  width: auto !important;
  min-height: 48px !important;
  margin: 12px var(--top-layout-x, clamp(14px, 1.35vw, 24px)) 0 !important;
  padding: 9px 14px !important;
  display: grid !important;
  grid-template-columns: minmax(240px, 0.72fr) minmax(520px, 1.28fr) !important;
  align-items: center !important;
  gap: 14px !important;
  border: 1px solid rgba(20, 22, 24, 0.1) !important;
  border-radius: var(--radius-lg) !important;
  background:
    linear-gradient(90deg, rgba(242, 239, 253, 0.78), rgba(255, 255, 255, 0.96) 30%, rgba(255, 255, 255, 0.92)) !important;
  box-shadow: 0 10px 28px rgba(20, 22, 24, 0.06) !important;
  overflow: hidden !important;
}

body[data-bs-theme="dark"] .stepper.panel::before,
body[data-bs-theme="dark"] .stepper.panel::after {
  content: none !important;
  display: none !important;
}

body[data-bs-theme="dark"] .stepper.panel .guide-status {
  width: auto !important;
  min-height: 32px !important;
  margin: 0 !important;
  padding: 7px 10px 7px 12px !important;
  display: flex !important;
  align-items: center !important;
  border: 0 !important;
  border-left: 3px solid var(--red-600) !important;
  border-radius: var(--radius-md) !important;
  background: rgba(255, 255, 255, 0.74) !important;
  color: var(--gray-700) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  box-shadow: none !important;
}

body[data-bs-theme="dark"] .stepper-track {
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  overflow-x: auto !important;
  scrollbar-width: thin;
}

body[data-bs-theme="dark"] .stepper-track .step {
  min-height: 30px !important;
  padding: 6px 9px !important;
  flex: 0 0 auto !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-md) !important;
  background: transparent !important;
  color: var(--gray-800) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

body[data-bs-theme="dark"] .stepper-track .step span {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: var(--red-600) !important;
  color: #ffffff !important;
  font-size: 10px !important;
  line-height: 1 !important;
}

body[data-bs-theme="dark"] .stepper-track .step.is-active,
body[data-bs-theme="dark"] .stepper-track .step.is-done {
  background: rgba(105, 77, 212, 0.08) !important;
  color: var(--red-800) !important;
}

body[data-bs-theme="dark"] .stepper-track .step-line {
  width: clamp(14px, 2vw, 32px) !important;
  height: 1px !important;
  flex: 0 0 clamp(14px, 2vw, 32px) !important;
  background: rgba(105, 77, 212, 0.28) !important;
}

@media (max-width: 1120px) {
  body[data-bs-theme="dark"] .stepper.panel {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  body[data-bs-theme="dark"] .stepper-track {
    justify-content: flex-start !important;
  }
}

@media (max-width: 680px) {
  body[data-bs-theme="dark"] .stepper.panel {
    margin-top: 10px !important;
    padding: 8px !important;
  }

  body[data-bs-theme="dark"] .stepper.panel .guide-status {
    font-size: 11px !important;
  }
}

/* Cross table readability: align controls and replace low-contrast grey pills. */
body[data-bs-theme="dark"] #panel-segments .cross-config-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(170px, 1fr)) !important;
  gap: 14px !important;
  align-items: end !important;
  margin-top: 14px !important;
}

body[data-bs-theme="dark"] #panel-segments .cross-config-grid .field {
  min-width: 0 !important;
}

body[data-bs-theme="dark"] #panel-segments .cross-config-grid select {
  width: 100% !important;
  min-height: 39px !important;
  border-color: rgba(20, 22, 24, 0.16) !important;
  background: #ffffff !important;
  color: var(--gray-900) !important;
  font-weight: 700 !important;
}

body[data-bs-theme="dark"] #panel-segments .cross-toolbar {
  width: 100% !important;
  margin-top: 12px !important;
  display: grid !important;
  grid-template-columns: minmax(280px, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
}

body[data-bs-theme="dark"] #panel-segments .cross-toolbar .row-actions {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 10px !important;
  row-gap: 8px !important;
}

body[data-bs-theme="dark"] #panel-segments .cross-toolbar .btn {
  min-height: 38px !important;
  padding: 0 13px !important;
  white-space: nowrap !important;
}

body[data-bs-theme="dark"] #panel-segments #crossStatus.status-text:not(:empty),
body[data-bs-theme="dark"] #panel-segments #crossLibraryStatus.status-text:not(:empty) {
  width: 100% !important;
  min-height: 38px !important;
  padding: 9px 12px !important;
  display: flex !important;
  align-items: center !important;
  border: 1px solid rgba(20, 22, 24, 0.13) !important;
  border-left: 3px solid var(--red-600) !important;
  border-radius: var(--radius-md) !important;
  background: #ffffff !important;
  color: var(--gray-700) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 1.35 !important;
  box-shadow: 0 4px 12px rgba(20, 22, 24, 0.04) !important;
}

body[data-bs-theme="dark"] #panel-segments #crossStatus.status-text.info:not(:empty),
body[data-bs-theme="dark"] #panel-segments #crossLibraryStatus.status-text.info:not(:empty) {
  border-left-color: #486278 !important;
  background: #f8fafc !important;
  color: #34495e !important;
}

body[data-bs-theme="dark"] #panel-segments #crossStatus.status-text.success:not(:empty),
body[data-bs-theme="dark"] #panel-segments #crossLibraryStatus.status-text.success:not(:empty) {
  border-left-color: #168a52 !important;
  background: #eefbf4 !important;
  color: #11663e !important;
}

body[data-bs-theme="dark"] #panel-segments #crossStatus.status-text.warning:not(:empty),
body[data-bs-theme="dark"] #panel-segments #crossLibraryStatus.status-text.warning:not(:empty) {
  border-left-color: #c9820f !important;
  background: #fff8e8 !important;
  color: #81520b !important;
}

body[data-bs-theme="dark"] #panel-segments #crossLibraryStatus {
  margin-top: 12px !important;
}

body[data-bs-theme="dark"] #panel-segments .cross-library-empty {
  margin: 0 !important;
  padding: 12px 14px !important;
  border: 1px dashed rgba(20, 22, 24, 0.16) !important;
  border-radius: var(--radius-md) !important;
  background: #ffffff !important;
  color: var(--gray-600) !important;
  font-size: 13px !important;
}

body[data-bs-theme="dark"] #panel-segments .cross-library-item {
  background: #ffffff !important;
  color: var(--gray-800) !important;
  border-color: rgba(20, 22, 24, 0.12) !important;
}

body[data-bs-theme="dark"] #panel-segments .cross-library-title {
  color: var(--gray-900) !important;
}

body[data-bs-theme="dark"] #panel-segments .cross-library-sub {
  color: var(--gray-600) !important;
}

body[data-bs-theme="dark"] #panel-segments .cross-table-wrap {
  margin-top: 14px !important;
  background: #ffffff !important;
}

body[data-bs-theme="dark"] #panel-segments .cross-table-wrap thead th {
  background: #f1f3f5 !important;
  color: var(--gray-700) !important;
}

body[data-bs-theme="dark"] #panel-segments #crossTableBody td {
  color: var(--gray-800) !important;
}

@media (max-width: 1080px) {
  body[data-bs-theme="dark"] #panel-segments .cross-config-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-bs-theme="dark"] #panel-segments .cross-toolbar {
    grid-template-columns: 1fr !important;
  }

  body[data-bs-theme="dark"] #panel-segments .cross-toolbar .row-actions {
    justify-content: flex-start !important;
  }
}

@media (max-width: 620px) {
  body[data-bs-theme="dark"] #panel-segments .cross-config-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Global status messages: replace dark low-contrast pills with readable light notices. */
body[data-bs-theme="dark"] .status-text:not(:empty) {
  min-height: 34px !important;
  padding: 8px 11px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  border: 1px solid rgba(20, 22, 24, 0.13) !important;
  border-left: 3px solid #64748b !important;
  border-radius: var(--radius-md) !important;
  background: #ffffff !important;
  color: var(--gray-700) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 1.35 !important;
  box-shadow: 0 5px 14px rgba(20, 22, 24, 0.04) !important;
}

body[data-bs-theme="dark"] .status-text.info:not(:empty) {
  border-left-color: #64748b !important;
  background: #f8fafc !important;
  color: #34495e !important;
}

body[data-bs-theme="dark"] .status-text.success:not(:empty) {
  border-color: rgba(22, 138, 82, 0.2) !important;
  border-left-color: #168a52 !important;
  background: #eefbf4 !important;
  color: #11663e !important;
}

body[data-bs-theme="dark"] .status-text.warning:not(:empty) {
  border-color: rgba(201, 130, 15, 0.22) !important;
  border-left-color: #c9820f !important;
  background: #fff8e8 !important;
  color: #81520b !important;
}

body[data-bs-theme="dark"] .status-text.error:not(:empty) {
  border-color: rgba(105, 77, 212, 0.24) !important;
  border-left-color: var(--red-600) !important;
  background: #f2effd !important;
  color: var(--red-800) !important;
}

body[data-bs-theme="dark"] .status-text:empty {
  display: none !important;
}

/* ============================================================
   User theme switch
   Light remains the default; this layer turns the current UI into a true dark theme.
   ============================================================ */

body[data-bs-theme="dark"] .theme-toggle {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
}

body[data-bs-theme="dark"] .theme-toggle-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: linear-gradient(90deg, currentColor 0 48%, transparent 50%);
  opacity: 0.9;
}

body[data-bs-theme="dark"][data-color-theme="light"] {
  background-color: #edf0f4;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360' viewBox='0 0 360 360'%3E%3Cg stroke='%23694dd4' stroke-opacity='.10' stroke-width='1.25' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0 72H54V34H132V112H218V72H360'/%3E%3Cpath d='M0 264H84V310H158V228H252V264H360'/%3E%3Cpath d='M72 0V56H30V146H112V232H72V360'/%3E%3Cpath d='M286 0V92H330V170H246V282H286V360'/%3E%3Cpath d='M160 0V48H208V152H170V190'/%3E%3C/g%3E%3Cg stroke='%232d8ca3' stroke-opacity='.07' stroke-width='1.1' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 180H46V202H126V178H182'/%3E%3Cpath d='M178 332V294H222V318H336'/%3E%3C/g%3E%3Cg fill='%23694dd4' fill-opacity='.22'%3E%3Ccircle cx='54' cy='72' r='2.6'/%3E%3Ccircle cx='132' cy='34' r='2.6'/%3E%3Ccircle cx='132' cy='112' r='2.6'/%3E%3Ccircle cx='218' cy='112' r='2.6'/%3E%3Ccircle cx='84' cy='264' r='2.6'/%3E%3Ccircle cx='158' cy='310' r='2.6'/%3E%3Ccircle cx='158' cy='228' r='2.6'/%3E%3Ccircle cx='252' cy='228' r='2.6'/%3E%3Ccircle cx='72' cy='56' r='2.6'/%3E%3Ccircle cx='30' cy='146' r='2.6'/%3E%3Ccircle cx='112' cy='146' r='2.6'/%3E%3Ccircle cx='112' cy='232' r='2.6'/%3E%3Ccircle cx='286' cy='92' r='2.6'/%3E%3Ccircle cx='330' cy='170' r='2.6'/%3E%3Ccircle cx='246' cy='170' r='2.6'/%3E%3Ccircle cx='246' cy='282' r='2.6'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(150deg, #f5f6f8 0%, #e8edf2 100%);
  background-repeat: repeat, no-repeat;
  background-size: 360px 360px, cover;
  background-attachment: fixed;
}

body[data-bs-theme="dark"][data-color-theme="dark"] {
  color-scheme: dark;
  --theme-bg: #080d18;
  --theme-bg-2: #0d1524;
  --theme-panel: #111b2d;
  --theme-panel-2: #162236;
  --theme-panel-3: #1b2940;
  --theme-line: rgba(172, 184, 201, 0.18);
  --theme-line-strong: rgba(210, 219, 232, 0.28);
  --theme-text: #eef3f8;
  --theme-text-strong: #ffffff;
  --theme-muted: #a9b6c7;
  --theme-muted-2: #7e8da3;
  --theme-red-soft: rgba(105, 77, 212, 0.2);
  --theme-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] {
  background-color: #080d18;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360' viewBox='0 0 360 360'%3E%3Cg stroke='%23b9a9f3' stroke-opacity='.13' stroke-width='1.25' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0 72H54V34H132V112H218V72H360'/%3E%3Cpath d='M0 264H84V310H158V228H252V264H360'/%3E%3Cpath d='M72 0V56H30V146H112V232H72V360'/%3E%3Cpath d='M286 0V92H330V170H246V282H286V360'/%3E%3Cpath d='M160 0V48H208V152H170V190'/%3E%3C/g%3E%3Cg stroke='%2360a5fa' stroke-opacity='.09' stroke-width='1.1' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 180H46V202H126V178H182'/%3E%3Cpath d='M178 332V294H222V318H336'/%3E%3C/g%3E%3Cg fill='%238067df' fill-opacity='.30'%3E%3Ccircle cx='54' cy='72' r='2.6'/%3E%3Ccircle cx='132' cy='34' r='2.6'/%3E%3Ccircle cx='132' cy='112' r='2.6'/%3E%3Ccircle cx='218' cy='112' r='2.6'/%3E%3Ccircle cx='84' cy='264' r='2.6'/%3E%3Ccircle cx='158' cy='310' r='2.6'/%3E%3Ccircle cx='158' cy='228' r='2.6'/%3E%3Ccircle cx='252' cy='228' r='2.6'/%3E%3Ccircle cx='72' cy='56' r='2.6'/%3E%3Ccircle cx='30' cy='146' r='2.6'/%3E%3Ccircle cx='112' cy='146' r='2.6'/%3E%3Ccircle cx='112' cy='232' r='2.6'/%3E%3Ccircle cx='286' cy='92' r='2.6'/%3E%3Ccircle cx='330' cy='170' r='2.6'/%3E%3Ccircle cx='246' cy='170' r='2.6'/%3E%3Ccircle cx='246' cy='282' r='2.6'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(150deg, #080d18 0%, #0d1728 100%);
  background-repeat: repeat, no-repeat;
  background-size: 360px 360px, cover;
  background-attachment: fixed;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .app-shell,
body[data-bs-theme="dark"][data-color-theme="dark"] .workspace,
body[data-bs-theme="dark"][data-color-theme="dark"] #workspace.is-filters-hidden,
body[data-bs-theme="dark"][data-color-theme="dark"] .main-content,
body[data-bs-theme="dark"][data-color-theme="dark"] .filters-toggle-bar {
  background: transparent !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .top-header,
body[data-bs-theme="dark"][data-color-theme="dark"] .stepper.panel,
body[data-bs-theme="dark"][data-color-theme="dark"] .filters-toggle-bar,
body[data-bs-theme="dark"][data-color-theme="dark"] #filtersSidebar,
body[data-bs-theme="dark"][data-color-theme="dark"] .sidebar-head,
body[data-bs-theme="dark"][data-color-theme="dark"] .context-bar,
body[data-bs-theme="dark"][data-color-theme="dark"] .tab-nav.panel,
body[data-bs-theme="dark"][data-color-theme="dark"] .panel,
body[data-bs-theme="dark"][data-color-theme="dark"] .panel.nested,
body[data-bs-theme="dark"][data-color-theme="dark"] .overview-hero,
body[data-bs-theme="dark"][data-color-theme="dark"] .quality-hero,
body[data-bs-theme="dark"][data-color-theme="dark"] .segments-hero,
body[data-bs-theme="dark"][data-color-theme="dark"] .direction-hero,
body[data-bs-theme="dark"][data-color-theme="dark"] .satisfaction-hero,
body[data-bs-theme="dark"][data-color-theme="dark"] .admin-hero,
body[data-bs-theme="dark"][data-color-theme="dark"] .overview-section,
body[data-bs-theme="dark"][data-color-theme="dark"] .retention-section,
body[data-bs-theme="dark"][data-color-theme="dark"] .insight-box,
body[data-bs-theme="dark"][data-color-theme="dark"] .chart-frame,
body[data-bs-theme="dark"][data-color-theme="dark"] .table-wrap,
body[data-bs-theme="dark"][data-color-theme="dark"] .admin-snapshot-table-wrap,
body[data-bs-theme="dark"][data-color-theme="dark"] .participants-table-wrap,
body[data-bs-theme="dark"][data-color-theme="dark"] .daily-comparison-block,
body[data-bs-theme="dark"][data-color-theme="dark"] .import-drop-zone,
body[data-bs-theme="dark"][data-color-theme="dark"] .mapping-summary-bar,
body[data-bs-theme="dark"][data-color-theme="dark"] .mapping-section,
body[data-bs-theme="dark"][data-color-theme="dark"] .mapping-row,
body[data-bs-theme="dark"][data-color-theme="dark"] .mapping-inline-control,
body[data-bs-theme="dark"][data-color-theme="dark"] .cross-library-item,
body[data-bs-theme="dark"][data-color-theme="dark"] .toast-stack .app-toast {
  border-color: var(--theme-line) !important;
  background: rgba(17, 27, 45, 0.94) !important;
  color: var(--theme-text) !important;
  box-shadow: var(--theme-shadow) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .overview-hero,
body[data-bs-theme="dark"][data-color-theme="dark"] .quality-hero,
body[data-bs-theme="dark"][data-color-theme="dark"] .segments-hero,
body[data-bs-theme="dark"][data-color-theme="dark"] .direction-hero,
body[data-bs-theme="dark"][data-color-theme="dark"] .satisfaction-hero,
body[data-bs-theme="dark"][data-color-theme="dark"] .admin-hero,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-overview .overview-hero {
  background:
    linear-gradient(115deg, rgba(105, 77, 212, 0.24), rgba(17, 27, 45, 0.95) 36%, rgba(22, 34, 54, 0.95)) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card,
body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card-action,
body[data-bs-theme="dark"][data-color-theme="dark"] .overview-meta-card,
body[data-bs-theme="dark"][data-color-theme="dark"] .segment-metric-card,
body[data-bs-theme="dark"][data-color-theme="dark"] .direction-summary-card,
body[data-bs-theme="dark"][data-color-theme="dark"] .quality-summary-card,
body[data-bs-theme="dark"][data-color-theme="dark"] .satisfaction-summary-card,
body[data-bs-theme="dark"][data-color-theme="dark"] .admin-summary-card,
body[data-bs-theme="dark"][data-color-theme="dark"] .direction-kpi-card,
body[data-bs-theme="dark"][data-color-theme="dark"] .quality-score-card {
  border-color: var(--theme-line) !important;
  background: linear-gradient(180deg, rgba(24, 37, 58, 0.96), rgba(16, 25, 41, 0.98)) !important;
  color: var(--theme-text) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] h1,
body[data-bs-theme="dark"][data-color-theme="dark"] h2,
body[data-bs-theme="dark"][data-color-theme="dark"] h3,
body[data-bs-theme="dark"][data-color-theme="dark"] h4,
body[data-bs-theme="dark"][data-color-theme="dark"] .top-header h1,
body[data-bs-theme="dark"][data-color-theme="dark"] .panel h2,
body[data-bs-theme="dark"][data-color-theme="dark"] .panel h3,
body[data-bs-theme="dark"][data-color-theme="dark"] .panel h4,
body[data-bs-theme="dark"][data-color-theme="dark"] .tab-panel > h3,
body[data-bs-theme="dark"][data-color-theme="dark"] .cross-library-title,
body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-value,
body[data-bs-theme="dark"][data-color-theme="dark"] .overview-meta-value,
body[data-bs-theme="dark"][data-color-theme="dark"] .segment-metric-value,
body[data-bs-theme="dark"][data-color-theme="dark"] .quality-summary-value,
body[data-bs-theme="dark"][data-color-theme="dark"] .satisfaction-summary-value,
body[data-bs-theme="dark"][data-color-theme="dark"] .admin-summary-value {
  color: var(--theme-text-strong) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .muted,
body[data-bs-theme="dark"][data-color-theme="dark"] .tiny,
body[data-bs-theme="dark"][data-color-theme="dark"] p,
body[data-bs-theme="dark"][data-color-theme="dark"] li,
body[data-bs-theme="dark"][data-color-theme="dark"] .field,
body[data-bs-theme="dark"][data-color-theme="dark"] .chart-hint,
body[data-bs-theme="dark"][data-color-theme="dark"] .cross-library-sub,
body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-label,
body[data-bs-theme="dark"][data-color-theme="dark"] .overview-meta-label,
body[data-bs-theme="dark"][data-color-theme="dark"] .segment-metric-label,
body[data-bs-theme="dark"][data-color-theme="dark"] .direction-summary-label,
body[data-bs-theme="dark"][data-color-theme="dark"] .quality-summary-label,
body[data-bs-theme="dark"][data-color-theme="dark"] .satisfaction-summary-label,
body[data-bs-theme="dark"][data-color-theme="dark"] .admin-summary-label {
  color: var(--theme-muted) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .btn,
body[data-bs-theme="dark"][data-color-theme="dark"] button.btn,
body[data-bs-theme="dark"][data-color-theme="dark"] .overview-chip,
body[data-bs-theme="dark"][data-color-theme="dark"] .satisfaction-tag-chip,
body[data-bs-theme="dark"][data-color-theme="dark"] .satisfaction-inline-tag,
body[data-bs-theme="dark"][data-color-theme="dark"] .table-sort-btn {
  border-color: var(--theme-line-strong) !important;
  background: var(--theme-panel-2) !important;
  color: var(--theme-text) !important;
  box-shadow: none !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .btn:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] button.btn:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .overview-chip:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .tab-btn:hover {
  border-color: rgba(185, 169, 243, 0.44) !important;
  background: rgba(105, 77, 212, 0.2) !important;
  color: #ffffff !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .btn.primary,
body[data-bs-theme="dark"][data-color-theme="dark"] button.btn.primary,
body[data-bs-theme="dark"][data-color-theme="dark"] .tab-btn.is-active,
body[data-bs-theme="dark"][data-color-theme="dark"] .tab-nav.panel .tab-btn.is-active {
  border-color: var(--red-500) !important;
  background: linear-gradient(135deg, var(--red-600), var(--red-800)) !important;
  color: #ffffff !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] input,
body[data-bs-theme="dark"][data-color-theme="dark"] select,
body[data-bs-theme="dark"][data-color-theme="dark"] textarea,
body[data-bs-theme="dark"][data-color-theme="dark"] .field input,
body[data-bs-theme="dark"][data-color-theme="dark"] .field select,
body[data-bs-theme="dark"][data-color-theme="dark"] .field textarea,
body[data-bs-theme="dark"][data-color-theme="dark"] .overview-inline-check {
  border-color: var(--theme-line-strong) !important;
  background: #0d1728 !important;
  color: var(--theme-text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] input::placeholder,
body[data-bs-theme="dark"][data-color-theme="dark"] textarea::placeholder {
  color: var(--theme-muted-2) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .status-text:not(:empty),
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments #crossStatus.status-text:not(:empty),
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments #crossLibraryStatus.status-text:not(:empty) {
  border-color: var(--theme-line) !important;
  border-left-color: #94a3b8 !important;
  background: #111d31 !important;
  color: var(--theme-text) !important;
  box-shadow: none !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .status-text.success:not(:empty) {
  border-left-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.12) !important;
  color: #bbf7d0 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .status-text.warning:not(:empty) {
  border-left-color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.13) !important;
  color: #fde68a !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .status-text.error:not(:empty) {
  border-left-color: #f87171 !important;
  background: rgba(105, 77, 212, 0.18) !important;
  color: #fecdd3 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .status-chip,
body[data-bs-theme="dark"][data-color-theme="dark"] .context-meta span:not(.status-chip),
body[data-bs-theme="dark"][data-color-theme="dark"] .badge,
body[data-bs-theme="dark"][data-color-theme="dark"] .pill {
  border-color: var(--theme-line) !important;
  background: #101a2d !important;
  color: var(--theme-muted) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] th,
body[data-bs-theme="dark"][data-color-theme="dark"] thead th,
body[data-bs-theme="dark"][data-color-theme="dark"] .table-wrap table th,
body[data-bs-theme="dark"][data-color-theme="dark"] .table-wrap table thead th:first-child,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments .cross-table-wrap thead th {
  border-bottom-color: var(--theme-line) !important;
  background: #17243a !important;
  color: #cbd5e1 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] td,
body[data-bs-theme="dark"][data-color-theme="dark"] tbody td,
body[data-bs-theme="dark"][data-color-theme="dark"] .table-wrap table tbody td,
body[data-bs-theme="dark"][data-color-theme="dark"] .table-wrap table tbody td:first-child,
body[data-bs-theme="dark"][data-color-theme="dark"] #crossTableBody td:not(:first-child),
body[data-bs-theme="dark"][data-color-theme="dark"] #annualComparisonBody td:not(:first-child) {
  border-color: rgba(203, 213, 225, 0.08) !important;
  background: #111b2d !important;
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] tbody tr:nth-child(even) td,
body[data-bs-theme="dark"][data-color-theme="dark"] .table-wrap table tbody tr:nth-child(even) td,
body[data-bs-theme="dark"][data-color-theme="dark"] .table-wrap table tbody tr:nth-child(even) td:first-child {
  background: #162236 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] tbody tr:hover td,
body[data-bs-theme="dark"][data-color-theme="dark"] .table-wrap table tbody tr:hover td,
body[data-bs-theme="dark"][data-color-theme="dark"] #crossTableBody tr:hover td:not(:first-child),
body[data-bs-theme="dark"][data-color-theme="dark"] #annualComparisonBody tr:hover td:not(:first-child) {
  background: rgba(105, 77, 212, 0.18) !important;
  color: #ffffff !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .chart-frame,
body[data-bs-theme="dark"][data-color-theme="dark"] .chart-frame.large,
body[data-bs-theme="dark"][data-color-theme="dark"] .chart-frame.small {
  background: #0d1728 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .stepper.panel .guide-status,
body[data-bs-theme="dark"][data-color-theme="dark"] .cross-library-empty {
  border-color: var(--theme-line) !important;
  border-left-color: var(--red-500) !important;
  background: rgba(13, 23, 40, 0.88) !important;
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .stepper-track .step {
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .stepper-track .step.is-active,
body[data-bs-theme="dark"][data-color-theme="dark"] .stepper-track .step.is-done {
  background: rgba(105, 77, 212, 0.2) !important;
  color: #ffffff !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-map-shell,
body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-map-stage,
body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-map-detail {
  border-color: var(--theme-line) !important;
  background: #0d1728 !important;
  color: var(--theme-text) !important;
}

/* Dark theme: override legacy light surfaces with ID-level selectors */
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-satisfaction #satisfactionReasonsSection,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-admin .admin-grid > .panel.nested,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-direction #directionKpiCards .direction-kpi-card {
  border-color: var(--theme-line) !important;
  background: linear-gradient(180deg, rgba(18, 29, 48, 0.98), rgba(13, 23, 40, 0.98)) !important;
  color: var(--theme-text) !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-satisfaction #satisfactionReasonsSection:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-admin .admin-grid > .panel.nested:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-direction #directionKpiCards .direction-kpi-card:hover {
  border-color: rgba(185, 169, 243, 0.36) !important;
  background: linear-gradient(180deg, rgba(28, 41, 63, 0.98), rgba(17, 27, 45, 0.98)) !important;
  color: var(--theme-text-strong) !important;
}

/* Dark theme: high-specificity mapping readability fixes */
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-summary-bar,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-inline-control,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-section,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-section[data-mapping-section="survey"] {
  border-color: var(--theme-line) !important;
  background: linear-gradient(180deg, rgba(18, 29, 48, 0.98), rgba(13, 23, 40, 0.98)) !important;
  color: var(--theme-text) !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-section-head h5 {
  color: var(--theme-text-strong) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-inline-control > span {
  color: var(--theme-text);
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-section-head p,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row .field,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row .tiny,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row .muted {
  color: var(--theme-muted) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row.is-unmapped {
  border-color: rgba(203, 213, 225, 0.18) !important;
  background: rgba(11, 20, 36, 0.92) !important;
  color: var(--theme-text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row.is-mapped {
  border-color: rgba(34, 197, 94, 0.28) !important;
  background: rgba(20, 83, 45, 0.18) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row.is-required-missing {
  border-color: rgba(185, 169, 243, 0.46) !important;
  background: rgba(127, 29, 29, 0.22) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row.is-duplicate {
  border-color: rgba(245, 158, 11, 0.48) !important;
  background: rgba(120, 53, 15, 0.22) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row.is-mapped:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row.is-unmapped:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row.is-required-missing:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row.is-duplicate:hover {
  border-color: rgba(185, 169, 243, 0.42) !important;
  background: rgba(105, 77, 212, 0.18) !important;
  color: #ffffff !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row input,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row select,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row .field input,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row .field select {
  border-color: rgba(203, 213, 225, 0.22) !important;
  background: #0d1728 !important;
  color: var(--theme-text-strong) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row input:focus,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row select:focus {
  border-color: rgba(185, 169, 243, 0.58) !important;
  box-shadow: 0 0 0 3px rgba(105, 77, 212, 0.18) !important;
  outline: none !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row .btn,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row-actions .btn {
  border-color: rgba(203, 213, 225, 0.24) !important;
  background: #17243a !important;
  color: var(--theme-text-strong) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row .btn:disabled,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row-actions .btn:disabled {
  border-color: rgba(148, 163, 184, 0.18) !important;
  background: rgba(71, 85, 105, 0.42) !important;
  color: rgba(226, 232, 240, 0.72) !important;
  opacity: 1 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .badge {
  border-color: rgba(203, 213, 225, 0.22) !important;
  background: #101a2d !important;
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .badge.good {
  border-color: rgba(34, 197, 94, 0.3) !important;
  background: rgba(20, 83, 45, 0.35) !important;
  color: #bbf7d0 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .badge.warn {
  border-color: rgba(245, 158, 11, 0.34) !important;
  background: rgba(120, 53, 15, 0.35) !important;
  color: #fde68a !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .badge.bad {
  border-color: rgba(185, 169, 243, 0.38) !important;
  background: rgba(127, 29, 29, 0.34) !important;
  color: #fecdd3 !important;
}

/* Dark theme: cross table readability fixes */
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments .cross-config-grid select {
  border-color: var(--theme-line-strong) !important;
  background: #0d1728 !important;
  color: var(--theme-text-strong) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments .cross-library-empty,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments .cross-library-item {
  border-color: var(--theme-line) !important;
  background: rgba(13, 23, 40, 0.9) !important;
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments .cross-library-title {
  color: var(--theme-text-strong) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments .cross-library-sub {
  color: var(--theme-muted) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments .cross-table-wrap {
  border-color: var(--theme-line) !important;
  background: #0d1728 !important;
  color: var(--theme-text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments .cross-table-wrap table {
  background: transparent !important;
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments #crossTableHead th,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments .cross-table-wrap thead th {
  border-color: rgba(203, 213, 225, 0.14) !important;
  background: #17243a !important;
  color: #e2e8f0 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments #crossTableBody td,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments #crossTableBody td:first-child,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments #crossTableBody td:not(:first-child),
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments .cross-table-wrap tbody td {
  border-color: rgba(203, 213, 225, 0.08) !important;
  background: #111b2d !important;
  color: #e2e8f0 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments #crossTableBody td:first-child {
  color: #f8fafc !important;
  font-weight: 750 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments #crossTableBody td:not(:first-child) {
  color: #bfdbfe !important;
  text-align: center !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments #crossTableBody td strong {
  color: #ffffff !important;
  font-weight: 850 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments #crossTableBody tr:nth-child(even) td,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments .cross-table-wrap tbody tr:nth-child(even) td {
  background: #162236 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments #crossTableBody tr:hover td,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments #crossTableBody tr:hover td:first-child,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments #crossTableBody tr:hover td:not(:first-child),
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments .cross-table-wrap tbody tr:hover td {
  background: rgba(105, 77, 212, 0.2) !important;
  color: #ffffff !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-segments #crossTableBody tr:last-child td {
  border-top: 1px solid rgba(185, 169, 243, 0.28) !important;
  background: rgba(105, 77, 212, 0.16) !important;
}

/* Dark theme: interactive map color calibration */
body[data-bs-theme="dark"][data-color-theme="dark"] #countryMapPanel .chart-frame {
  border-color: rgba(203, 213, 225, 0.16) !important;
  background: #0b1424 !important;
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #countryMap,
body[data-bs-theme="dark"][data-color-theme="dark"] .react-country-map-host {
  background: transparent !important;
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-map-shell {
  border-color: rgba(203, 213, 225, 0.12) !important;
  background:
    radial-gradient(circle at 42% 38%, rgba(50, 63, 90, 0.48), rgba(10, 18, 33, 0.98) 58%),
    linear-gradient(135deg, #0b1424, #111d31) !important;
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-map-stage {
  border-color: rgba(203, 213, 225, 0.16) !important;
  background: #07101e !important;
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-map-detail {
  border-color: rgba(203, 213, 225, 0.16) !important;
  background: rgba(13, 23, 40, 0.92) !important;
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-detail-label,
body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-map-muted,
body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-map-legend {
  color: var(--theme-muted) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-map-detail h5,
body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-country-row span,
body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-location-row span {
  color: var(--theme-text-strong) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-detail-total,
body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-location-group h6 {
  color: #bfdbfe !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-country-row {
  border-color: rgba(203, 213, 225, 0.14) !important;
  background: rgba(24, 37, 58, 0.88) !important;
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-country-row strong,
body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-location-row strong {
  color: #ffffff !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-country-row:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-country-row:focus-visible {
  border-color: rgba(185, 169, 243, 0.44) !important;
  background: rgba(105, 77, 212, 0.22) !important;
  color: #ffffff !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-location-row {
  border-bottom-color: rgba(203, 213, 225, 0.1) !important;
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-map-controls button {
  border-color: rgba(203, 213, 225, 0.22) !important;
  background: rgba(15, 23, 42, 0.92) !important;
  color: #ffffff !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-map-controls button:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-map-controls button:focus-visible {
  border-color: rgba(185, 169, 243, 0.5) !important;
  background: rgba(105, 77, 212, 0.3) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-map-tooltip {
  border-color: rgba(185, 169, 243, 0.36) !important;
  background: rgba(8, 13, 24, 0.96) !important;
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-map-tooltip strong {
  color: #ffffff !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-map-tooltip span {
  color: #bfdbfe !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .rsm-map-legend div {
  background: linear-gradient(90deg, #2a2157, #4f38b7, #b9a9f3) !important;
}

/* Dark theme: KPI cards text contrast */
body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card,
body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card-action,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-overview #kpiCards .kpi-card {
  border-color: var(--theme-line) !important;
  background: linear-gradient(180deg, rgba(24, 37, 58, 0.98), rgba(16, 25, 41, 0.98)) !important;
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card .kpi-label,
body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card-action .kpi-label,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-overview #kpiCards .kpi-card .kpi-label {
  color: #cbd5e1 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card .kpi-value,
body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card-action .kpi-value,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-overview #kpiCards .kpi-card .kpi-value {
  color: #ffffff !important;
  text-shadow: none !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card .kpi-delta,
body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card-action .kpi-delta,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-overview #kpiCards .kpi-card .kpi-delta {
  color: #bfdbfe !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card .kpi-delta.pos,
body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card-action .kpi-delta.pos {
  color: #bbf7d0 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card .kpi-delta.neg,
body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card-action .kpi-delta.neg {
  color: #fecdd3 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card-action:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] #panel-overview #kpiCards .kpi-card:hover {
  border-color: rgba(185, 169, 243, 0.4) !important;
  background: linear-gradient(180deg, rgba(29, 43, 65, 0.98), rgba(20, 32, 52, 0.98)) !important;
}

/* Light theme: KPI comparison deltas need stronger contrast. */
body[data-bs-theme="dark"][data-color-theme="light"] .kpi-card .kpi-delta,
body[data-bs-theme="dark"][data-color-theme="light"] .kpi-card-action .kpi-delta,
body[data-bs-theme="dark"][data-color-theme="light"] #panel-overview #kpiCards .kpi-card .kpi-delta {
  color: #315f95 !important;
  font-weight: 800 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .kpi-card .kpi-delta.pos,
body[data-bs-theme="dark"][data-color-theme="light"] .kpi-card-action .kpi-delta.pos {
  color: #167a46 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .kpi-card .kpi-delta.neg,
body[data-bs-theme="dark"][data-color-theme="light"] .kpi-card-action .kpi-delta.neg {
  color: #694dd4 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .import-drop-list {
  border-color: rgba(105, 77, 212, 0.24) !important;
  background: #f4f1ff !important;
  color: #342683 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .import-drop-zone:hover .import-drop-list,
body[data-bs-theme="dark"][data-color-theme="light"] .import-drop-zone:focus-visible .import-drop-list,
body[data-bs-theme="dark"][data-color-theme="light"] .import-drop-zone.is-dragging .import-drop-list {
  border-color: rgba(105, 77, 212, 0.38) !important;
  background: #ebe6ff !important;
  color: #2d216f !important;
}

/* Fidelity: keep similarity tables proportioned inside their cards. */
body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid {
  grid-template-columns: minmax(560px, 1.2fr) minmax(380px, 0.8fr) !important;
  align-items: stretch !important;
}

body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel {
  min-width: 0 !important;
  overflow: hidden !important;
}

body[data-bs-theme="dark"] #panel-retention .retention-similarity-table {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
}

body[data-bs-theme="dark"] #panel-retention .retention-similarity-table table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

body[data-bs-theme="dark"] #panel-retention .retention-similarity-table th,
body[data-bs-theme="dark"] #panel-retention .retention-similarity-table td {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  line-height: 1.35 !important;
  vertical-align: top !important;
}

body[data-bs-theme="dark"] #panel-retention .retention-similarity-table th {
  padding: 10px 12px !important;
}

body[data-bs-theme="dark"] #panel-retention .retention-similarity-table td {
  padding: 11px 12px !important;
}

body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel:first-child .retention-similarity-table th:nth-child(1),
body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel:first-child .retention-similarity-table td:nth-child(1),
body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel:first-child .retention-similarity-table th:nth-child(2),
body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel:first-child .retention-similarity-table td:nth-child(2) {
  width: 24% !important;
}

body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel:first-child .retention-similarity-table th:nth-child(3),
body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel:first-child .retention-similarity-table td:nth-child(3) {
  width: 28% !important;
}

body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel:first-child .retention-similarity-table th:nth-child(4),
body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel:first-child .retention-similarity-table td:nth-child(4) {
  width: 24% !important;
}

body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel:last-child .retention-similarity-table th:nth-child(1),
body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel:last-child .retention-similarity-table td:nth-child(1) {
  width: 34% !important;
}

body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel:last-child .retention-similarity-table th:nth-child(2),
body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel:last-child .retention-similarity-table td:nth-child(2) {
  width: 38% !important;
}

body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel:last-child .retention-similarity-table th:nth-child(3),
body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel:last-child .retention-similarity-table td:nth-child(3) {
  width: 12% !important;
  text-align: center !important;
}

body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel:last-child .retention-similarity-table th:nth-child(4),
body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid > .panel:last-child .retention-similarity-table td:nth-child(4) {
  width: 16% !important;
}

body[data-bs-theme="dark"] #panel-retention .retention-similarity-table .row-actions.compact {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  justify-content: stretch !important;
}

body[data-bs-theme="dark"] #panel-retention .retention-similarity-table .row-actions.compact .btn,
body[data-bs-theme="dark"] #panel-retention .retention-similarity-table td > .btn {
  width: 100% !important;
  min-width: 0 !important;
  padding-inline: 7px !important;
}

@media (max-width: 1180px) {
  body[data-bs-theme="dark"] #panel-retention .retention-similarity-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 760px) {
  body[data-bs-theme="dark"] #panel-retention .retention-similarity-table table {
    min-width: 620px !important;
  }
}

/* Dark theme: final hover and section-banner contrast pass. */
body[data-bs-theme="dark"][data-color-theme="dark"] .tab-panel > h3,
body[data-bs-theme="dark"][data-color-theme="dark"] .panel > h3 {
  border: 1px solid rgba(203, 213, 225, 0.14) !important;
  border-left: 3px solid var(--red-500) !important;
  background:
    linear-gradient(90deg, rgba(105, 77, 212, 0.24), rgba(24, 37, 58, 0.96) 32%, rgba(16, 25, 41, 0.88)) !important;
  color: var(--theme-text-strong) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .tab-panel > h3::before,
body[data-bs-theme="dark"][data-color-theme="dark"] .panel > h3::before {
  background: var(--red-500) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] tbody tr:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] table tbody tr:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .table-wrap table tbody tr:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .participants-table-wrap table tbody tr:hover {
  background: rgba(105, 77, 212, 0.18) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] tbody tr:hover td,
body[data-bs-theme="dark"][data-color-theme="dark"] table tbody tr:hover td,
body[data-bs-theme="dark"][data-color-theme="dark"] .table-wrap table tbody tr:hover td,
body[data-bs-theme="dark"][data-color-theme="dark"] .table-wrap table tbody tr:hover td:first-child,
body[data-bs-theme="dark"][data-color-theme="dark"] .participants-table-wrap table tbody tr:hover td,
body[data-bs-theme="dark"][data-color-theme="dark"] #participantsBody tr:hover td,
body[data-bs-theme="dark"][data-color-theme="dark"] #previewTableBody tr:hover td,
body[data-bs-theme="dark"][data-color-theme="dark"] #previewRowsBody tr:hover td,
body[data-bs-theme="dark"][data-color-theme="dark"] #newslettersBody tr:hover td,
body[data-bs-theme="dark"][data-color-theme="dark"] #retentionMailingBody tr:hover td,
body[data-bs-theme="dark"][data-color-theme="dark"] #retentionSuggestionsBody tr:hover td,
body[data-bs-theme="dark"][data-color-theme="dark"] #retentionMergedBody tr:hover td,
body[data-bs-theme="dark"][data-color-theme="dark"] #annualComparisonBody tr:hover td {
  border-color: rgba(185, 169, 243, 0.16) !important;
  background: rgba(105, 77, 212, 0.18) !important;
  color: #ffffff !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] tbody tr:hover td a,
body[data-bs-theme="dark"][data-color-theme="dark"] tbody tr:hover td strong,
body[data-bs-theme="dark"][data-color-theme="dark"] tbody tr:hover td span {
  color: inherit !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .btn:not(.primary):not(.danger):hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .btn:not(.primary):not(.danger):focus-visible,
body[data-bs-theme="dark"][data-color-theme="dark"] button.btn:not(.primary):not(.danger):hover,
body[data-bs-theme="dark"][data-color-theme="dark"] button.btn:not(.primary):not(.danger):focus-visible,
body[data-bs-theme="dark"][data-color-theme="dark"] .table-sort-btn:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .table-sort-btn:focus-visible,
body[data-bs-theme="dark"][data-color-theme="dark"] .overview-chip:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .overview-chip:focus-visible,
body[data-bs-theme="dark"][data-color-theme="dark"] .satisfaction-tag-chip:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .satisfaction-tag-chip:focus-visible,
body[data-bs-theme="dark"][data-color-theme="dark"] .satisfaction-inline-tag:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .satisfaction-inline-tag:focus-visible,
body[data-bs-theme="dark"][data-color-theme="dark"] .status-chip:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .badge:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .pill:hover {
  border-color: rgba(185, 169, 243, 0.44) !important;
  background: rgba(105, 77, 212, 0.22) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .kpi-card:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .overview-meta-card:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .segment-metric-card:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .direction-summary-card:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .quality-summary-card:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .satisfaction-summary-card:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .admin-summary-card:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .direction-kpi-card:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .import-drop-zone:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .import-drop-zone:focus-visible {
  border-color: rgba(185, 169, 243, 0.38) !important;
  background: linear-gradient(180deg, rgba(29, 43, 65, 0.98), rgba(20, 32, 52, 0.98)) !important;
  color: var(--theme-text-strong) !important;
}

/* Dark theme: authenticated account chip contrast */
body[data-bs-theme="dark"][data-color-theme="dark"] .top-header .account-panel {
  border-color: rgba(203, 213, 225, 0.18) !important;
  background: rgba(22, 34, 54, 0.94) !important;
  color: var(--theme-text) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .top-header .account-email,
body[data-bs-theme="dark"][data-color-theme="dark"] .top-header #accountEmail {
  color: #e2e8f0 !important;
  opacity: 1 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .top-header .account-panel .btn {
  border-color: rgba(203, 213, 225, 0.26) !important;
  background: rgba(24, 37, 58, 0.96) !important;
  color: #ffffff !important;
}

/* Dark theme: compact header layout inspired by the dark shell mockup. */
body[data-bs-theme="dark"][data-color-theme="dark"] .top-header.panel {
  position: var(--compact-header-position, sticky) !important;
  top: 0 !important;
  z-index: 90 !important;
  min-height: 60px !important;
  margin: 0 !important;
  padding: var(--compact-header-padding, 10px 20px) !important;
  display: grid !important;
  grid-template-columns: var(--compact-header-columns, minmax(180px, auto) minmax(0, 1fr) max-content) !important;
  gap: var(--compact-header-gap, 18px) !important;
  align-items: center !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(203, 213, 225, 0.12) !important;
  border-radius: 0 !important;
  background: #080d18 !important;
  color: var(--theme-text) !important;
  box-shadow: none !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .top-header.panel::before,
body[data-bs-theme="dark"][data-color-theme="dark"] .top-header.panel::after {
  content: none !important;
  display: none !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .top-header .brand-lockup {
  grid-column: 1 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .top-header h1 {
  color: #ffffff !important;
  font-size: 16px !important;
  font-weight: 800 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .top-header .header-actions {
  grid-column: var(--compact-header-actions-column, 3) !important;
  width: var(--compact-header-actions-width, auto) !important;
  min-width: 0 !important;
  display: var(--compact-header-actions-display, flex) !important;
  justify-content: var(--compact-header-actions-justify, flex-end) !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .top-header .btn {
  min-height: 34px !important;
  border-color: rgba(203, 213, 225, 0.16) !important;
  background: #17243a !important;
  color: #f8fafc !important;
  box-shadow: none !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .top-header .btn:hover,
body[data-bs-theme="dark"][data-color-theme="dark"] .top-header .btn:focus-visible {
  border-color: rgba(96, 165, 250, 0.34) !important;
  background: #1d2d49 !important;
  color: #ffffff !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .top-header .btn.primary,
body[data-bs-theme="dark"][data-color-theme="dark"] .top-header #btnExportParticipants {
  border-color: rgba(185, 169, 243, 0.32) !important;
  background: rgba(105, 77, 212, 0.72) !important;
  color: #ffffff !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .top-header .btn:disabled,
body[data-bs-theme="dark"][data-color-theme="dark"] .top-header .btn.neutral:disabled {
  border-color: rgba(203, 213, 225, 0.08) !important;
  background: rgba(71, 85, 105, 0.34) !important;
  color: rgba(226, 232, 240, 0.46) !important;
  opacity: 1 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .stepper.panel {
  min-height: 82px !important;
  margin: var(--ui-shell-gap) 0 0 !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: 42px 40px !important;
  gap: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(203, 213, 225, 0.12) !important;
  border-radius: 0 !important;
  background: #0d1728 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .stepper.panel .guide-status {
  order: 2 !important;
  grid-row: 2 !important;
  width: 100% !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 20px !important;
  display: flex !important;
  align-items: center !important;
  border: 0 !important;
  border-top: 1px solid rgba(203, 213, 225, 0.08) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #dcd4ff !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .stepper-track {
  order: 1 !important;
  grid-row: 1 !important;
  width: 100% !important;
  min-height: 42px !important;
  padding: 0 20px !important;
  display: var(--compact-stepper-display, flex) !important;
  justify-content: var(--compact-stepper-justify, center) !important;
  align-items: center !important;
  gap: 8px !important;
  overflow-x: auto !important;
  background: transparent !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .stepper-track .step {
  min-height: 30px !important;
  padding: 6px 10px !important;
  border: 1px solid rgba(185, 169, 243, 0.1) !important;
  border-radius: 7px !important;
  background: rgba(105, 77, 212, 0.12) !important;
  color: #e9e5ff !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .stepper-track .step span {
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  margin-right: 3px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #c9bcff !important;
  font-family: var(--figma-mono, monospace) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .stepper-track .step.is-active,
body[data-bs-theme="dark"][data-color-theme="dark"] .stepper-track .step.is-done {
  border-color: rgba(105, 77, 212, 0.35) !important;
  background: rgba(105, 77, 212, 0.18) !important;
  color: #ffffff !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .stepper-track .step-line {
  display: none !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .filters-toggle-bar {
  min-height: 48px !important;
  margin: var(--ui-shell-gap) 0 0 !important;
  padding: 8px 20px !important;
  display: flex !important;
  align-items: center !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(203, 213, 225, 0.12) !important;
  border-radius: 0 !important;
  background: #080d18 !important;
  box-shadow: none !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .filters-toggle-bar .filters-toggle {
  min-height: 34px !important;
  padding: 0 12px !important;
  border-color: rgba(96, 165, 250, 0.2) !important;
  background: #17243a !important;
  color: #ffffff !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .filters-toggle-bar .filters-toggle-icon {
  width: 20px !important;
  height: 20px !important;
  border-radius: 6px !important;
  background: #694dd4 !important;
}

@media (max-width: 1180px) {
  body[data-bs-theme="dark"][data-color-theme="dark"] .top-header.panel {
    grid-template-columns: minmax(160px, auto) minmax(0, 1fr) !important;
  }

  body[data-bs-theme="dark"][data-color-theme="dark"] .top-header .header-actions {
    grid-column: var(--compact-header-actions-column, 2) !important;
    overflow-x: var(--compact-header-actions-overflow, auto) !important;
  }
}

@media (max-width: 760px) {
  body[data-bs-theme="dark"][data-color-theme="dark"] .top-header .header-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-bs-theme="dark"][data-color-theme="dark"] .top-header .account-panel:not([hidden]) {
    grid-column: 1 / -1;
    width: 100%;
  }

  body[data-bs-theme="dark"][data-color-theme="dark"] .top-header .header-actions > .btn:not(.theme-toggle) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body[data-bs-theme="dark"][data-color-theme="dark"] .top-header .theme-toggle {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 2;
  }

  body[data-bs-theme="dark"][data-color-theme="dark"] .stepper.panel {
    min-height: auto !important;
    grid-template-rows: auto auto !important;
  }

  body[data-bs-theme="dark"][data-color-theme="dark"] .stepper-track {
    padding-block: 8px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-bs-theme="dark"][data-color-theme="dark"] .stepper-track .step {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }
}

/* Light theme: same compact header shell as the dark mode, with a clearer palette. */
body[data-bs-theme="dark"][data-color-theme="light"] .top-header.panel {
  position: var(--compact-header-position, sticky) !important;
  top: 0 !important;
  z-index: 90 !important;
  min-height: 60px !important;
  margin: 0 !important;
  padding: var(--compact-header-padding, 10px 20px) !important;
  display: grid !important;
  grid-template-columns: var(--compact-header-columns, minmax(180px, auto) minmax(0, 1fr) max-content) !important;
  gap: var(--compact-header-gap, 18px) !important;
  align-items: center !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(21, 24, 31, 0.12) !important;
  border-radius: 0 !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: #15181f !important;
  box-shadow: none !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .top-header.panel::before,
body[data-bs-theme="dark"][data-color-theme="light"] .top-header.panel::after {
  content: none !important;
  display: none !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .top-header .brand-lockup {
  grid-column: 1 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .top-header h1 {
  color: #15181f !important;
  font-size: 16px !important;
  font-weight: 800 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .top-header .header-actions {
  grid-column: var(--compact-header-actions-column, 3) !important;
  width: var(--compact-header-actions-width, auto) !important;
  min-width: 0 !important;
  display: var(--compact-header-actions-display, flex) !important;
  justify-content: var(--compact-header-actions-justify, flex-end) !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .top-header .account-panel {
  border-color: rgba(21, 24, 31, 0.12) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: #15181f !important;
  box-shadow: none !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .top-header .account-email {
  color: #15181f !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .top-header .btn {
  min-height: 34px !important;
  border-color: rgba(21, 24, 31, 0.12) !important;
  background: #ffffff !important;
  color: #15181f !important;
  box-shadow: none !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .top-header .btn:hover,
body[data-bs-theme="dark"][data-color-theme="light"] .top-header .btn:focus-visible {
  border-color: rgba(105, 77, 212, 0.3) !important;
  background: #f4f1ff !important;
  color: #342683 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .top-header .btn.primary,
body[data-bs-theme="dark"][data-color-theme="light"] .top-header #btnExportParticipants {
  border-color: rgba(105, 77, 212, 0.28) !important;
  background: rgba(105, 77, 212, 0.84) !important;
  color: #ffffff !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .top-header .btn:disabled,
body[data-bs-theme="dark"][data-color-theme="light"] .top-header .btn.neutral:disabled {
  border-color: rgba(21, 24, 31, 0.08) !important;
  background: #eef1f5 !important;
  color: #8b94a3 !important;
  opacity: 1 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .stepper.panel {
  min-height: 82px !important;
  margin: var(--ui-shell-gap) 0 0 !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: 42px 40px !important;
  gap: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(21, 24, 31, 0.1) !important;
  border-radius: 0 !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .stepper.panel .guide-status {
  order: 2 !important;
  grid-row: 2 !important;
  width: 100% !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 20px !important;
  display: flex !important;
  align-items: center !important;
  border: 0 !important;
  border-top: 1px solid rgba(21, 24, 31, 0.08) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #4b5563 !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .stepper-track {
  order: 1 !important;
  grid-row: 1 !important;
  width: 100% !important;
  min-height: 42px !important;
  padding: 0 20px !important;
  display: var(--compact-stepper-display, flex) !important;
  justify-content: var(--compact-stepper-justify, center) !important;
  align-items: center !important;
  gap: 8px !important;
  overflow-x: auto !important;
  background: transparent !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .stepper-track .step {
  min-height: 30px !important;
  padding: 6px 10px !important;
  border: 1px solid rgba(105, 77, 212, 0.12) !important;
  border-radius: 7px !important;
  background: rgba(105, 77, 212, 0.06) !important;
  color: #342683 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .stepper-track .step span {
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  margin-right: 3px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #694dd4 !important;
  font-family: var(--figma-mono, monospace) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .stepper-track .step.is-active,
body[data-bs-theme="dark"][data-color-theme="light"] .stepper-track .step.is-done {
  border-color: rgba(105, 77, 212, 0.25) !important;
  background: rgba(105, 77, 212, 0.12) !important;
  color: #15181f !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .stepper-track .step-line {
  display: none !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .filters-toggle-bar {
  min-height: 48px !important;
  margin: var(--ui-shell-gap) 0 0 !important;
  padding: 8px 20px !important;
  display: flex !important;
  align-items: center !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(21, 24, 31, 0.1) !important;
  border-radius: 0 !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: none !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .filters-toggle-bar .filters-toggle {
  min-height: 34px !important;
  padding: 0 12px !important;
  border-color: rgba(21, 24, 31, 0.12) !important;
  background: #ffffff !important;
  color: #15181f !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .filters-toggle-bar .filters-toggle:hover,
body[data-bs-theme="dark"][data-color-theme="light"] .filters-toggle-bar .filters-toggle:focus-visible {
  border-color: rgba(105, 77, 212, 0.28) !important;
  background: #f4f1ff !important;
  color: #342683 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] .filters-toggle-bar .filters-toggle-icon {
  width: 20px !important;
  height: 20px !important;
  border-radius: 6px !important;
  background: #694dd4 !important;
}

@media (max-width: 1180px) {
  body[data-bs-theme="dark"][data-color-theme="light"] .top-header.panel {
    grid-template-columns: minmax(160px, auto) minmax(0, 1fr) !important;
  }

  body[data-bs-theme="dark"][data-color-theme="light"] .top-header .header-actions {
    grid-column: var(--compact-header-actions-column, 2) !important;
    overflow-x: var(--compact-header-actions-overflow, auto) !important;
  }
}

@media (max-width: 760px) {
  body[data-bs-theme="dark"][data-color-theme="light"] .top-header .header-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-bs-theme="dark"][data-color-theme="light"] .top-header .account-panel:not([hidden]) {
    grid-column: 1 / -1;
    width: 100%;
  }

  body[data-bs-theme="dark"][data-color-theme="light"] .top-header .header-actions > .btn:not(.theme-toggle) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body[data-bs-theme="dark"][data-color-theme="light"] .top-header .theme-toggle {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 2;
  }

  body[data-bs-theme="dark"][data-color-theme="light"] .stepper.panel {
    min-height: auto !important;
    grid-template-rows: auto auto !important;
  }

  body[data-bs-theme="dark"][data-color-theme="light"] .stepper-track {
    padding-block: 8px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-bs-theme="dark"][data-color-theme="light"] .stepper-track .step {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }
}

/* Header shell: merge the guide status and steps into one compact row. */
body[data-bs-theme="dark"][data-color-theme="dark"] .stepper.panel,
body[data-bs-theme="dark"][data-color-theme="light"] .stepper.panel {
  min-height: 54px !important;
  padding: 0 20px !important;
  display: grid !important;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr) !important;
  grid-template-rows: 1fr !important;
  column-gap: 18px !important;
  align-items: center !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .stepper.panel .guide-status,
body[data-bs-theme="dark"][data-color-theme="light"] .stepper.panel .guide-status {
  order: 0 !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border-top: 0 !important;
  align-self: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .stepper-track,
body[data-bs-theme="dark"][data-color-theme="light"] .stepper-track {
  order: 0 !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: auto !important;
  min-height: 54px !important;
  padding: 0 !important;
  justify-content: center !important;
  align-self: center !important;
}

@media (max-width: 1040px) {
  body[data-bs-theme="dark"][data-color-theme="dark"] .stepper.panel,
  body[data-bs-theme="dark"][data-color-theme="light"] .stepper.panel {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    min-height: auto !important;
    padding: 8px 20px !important;
    row-gap: 8px !important;
  }

  body[data-bs-theme="dark"][data-color-theme="dark"] .stepper.panel .guide-status,
  body[data-bs-theme="dark"][data-color-theme="light"] .stepper.panel .guide-status,
  body[data-bs-theme="dark"][data-color-theme="dark"] .stepper-track,
  body[data-bs-theme="dark"][data-color-theme="light"] .stepper-track {
    grid-column: 1 !important;
  }

  body[data-bs-theme="dark"][data-color-theme="dark"] .stepper.panel .guide-status,
  body[data-bs-theme="dark"][data-color-theme="light"] .stepper.panel .guide-status {
    grid-row: 2 !important;
  }

  body[data-bs-theme="dark"][data-color-theme="dark"] .stepper-track,
  body[data-bs-theme="dark"][data-color-theme="light"] .stepper-track {
    grid-row: 1 !important;
    width: 100% !important;
    min-height: var(--compact-stepper-min-height, 34px) !important;
    justify-content: var(--compact-stepper-justify, flex-start) !important;
    overflow-x: var(--compact-stepper-overflow, auto) !important;
  }
}

/* Brand icon asset. */
body[data-bs-theme="dark"] .brand-mark.brand-logo-crop {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: transparent !important;
  line-height: 0 !important;
}

body[data-bs-theme="dark"] .brand-mark.brand-logo-crop::after {
  content: none !important;
  display: none !important;
}

body[data-bs-theme="dark"] .brand-mark.brand-logo-crop img {
  width: 100% !important;
  max-width: none !important;
  height: 36px !important;
  display: block !important;
  object-fit: contain !important;
  flex: 0 0 auto !important;
}

/* Main layout rhythm: keep context, tabs and content visually separated. */
body[data-bs-theme="dark"] .main-content > .context-bar.panel {
  margin-bottom: var(--ui-section-gap) !important;
}

body[data-bs-theme="dark"] .main-content > .tab-nav.panel {
  margin-top: 0 !important;
  margin-bottom: var(--ui-section-gap) !important;
}

body[data-bs-theme="dark"] .main-content > .tab-panel.panel {
  margin-top: 0 !important;
}

/* Survey free answers: align filters, shortcuts, actions and table as one readable group. */
body[data-bs-theme="dark"] #panel-satisfaction #satisfactionReasonsSection {
  display: block !important;
}

body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-filter-grid {
  grid-template-columns:
    minmax(280px, 1.7fr)
    minmax(140px, 0.75fr)
    minmax(150px, 0.8fr)
    minmax(260px, 1.25fr)
    minmax(100px, 0.5fr) !important;
  gap: 14px !important;
  align-items: end !important;
  margin-top: 14px !important;
}

body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-tag-groups {
  margin: 14px 0 0 !important;
  padding: 12px 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr) !important;
  gap: 20px !important;
  max-width: none !important;
  border-top: 1px solid rgba(148, 163, 184, 0.2) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2) !important;
}

body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-tag-group {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 10px !important;
  min-height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-tag-group > p {
  margin: 5px 0 0 !important;
  white-space: nowrap !important;
}

body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-tag-list {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px !important;
}

body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-tag-chip {
  width: auto !important;
  flex: 0 0 auto !important;
}

body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-actions {
  margin-top: 12px !important;
  justify-content: flex-end !important;
  align-items: center !important;
  white-space: nowrap !important;
}

body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-actions > #satisfactionFilterStatus {
  min-width: 0 !important;
  margin: 0 !important;
}

body[data-bs-theme="dark"] #panel-satisfaction #satisfactionExportStatus {
  margin: 8px 0 0 !important;
}

body[data-bs-theme="dark"] #panel-satisfaction #satisfactionReasonsSection > .table-wrap {
  width: 100% !important;
  margin-top: 12px !important;
}

body[data-bs-theme="dark"] #panel-satisfaction #satisfactionReasonsSection table {
  width: 100% !important;
  min-width: 1120px !important;
  table-layout: fixed !important;
}

body[data-bs-theme="dark"] #panel-satisfaction #satisfactionReasonsSection th:nth-child(1) {
  width: 16% !important;
}

body[data-bs-theme="dark"] #panel-satisfaction #satisfactionReasonsSection th:nth-child(2),
body[data-bs-theme="dark"] #panel-satisfaction #satisfactionReasonsSection th:nth-child(4) {
  width: 8% !important;
}

body[data-bs-theme="dark"] #panel-satisfaction #satisfactionReasonsSection th:nth-child(3) {
  width: 16% !important;
}

body[data-bs-theme="dark"] #panel-satisfaction #satisfactionReasonsSection td:nth-child(5) {
  min-width: 520px !important;
  max-width: none !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.45 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionReasonsSection {
  border-color: rgba(30, 41, 59, 0.14) !important;
  background: #ffffff !important;
  color: #15181f !important;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06) !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionReasonsSection .panel-head {
  padding-bottom: 14px !important;
  border-bottom: 1px solid rgba(30, 41, 59, 0.1) !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionReasonsSection h4,
body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionReasonsSection label,
body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionReasonsSection th {
  color: #1f2937 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionReasonsSection .muted,
body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionReasonsSection .tiny.muted,
body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionCommentsCount {
  color: #4b5563 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionReasonsSection input,
body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionReasonsSection select {
  border-color: rgba(30, 41, 59, 0.16) !important;
  background: #ffffff !important;
  color: #15181f !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionReasonsSection input::placeholder {
  color: #6b7280 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction .satisfaction-tag-group {
  border-color: transparent !important;
  background: transparent !important;
  color: #15181f !important;
  box-shadow: none !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction .satisfaction-tag-chip,
body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction .satisfaction-inline-tag {
  border-color: rgba(30, 41, 59, 0.14) !important;
  background: #ffffff !important;
  color: #1f2937 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction .satisfaction-tag-chip:hover,
body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction .satisfaction-tag-chip:focus-visible,
body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction .satisfaction-inline-tag:hover,
body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction .satisfaction-inline-tag:focus-visible {
  border-color: rgba(105, 77, 212, 0.32) !important;
  background: #f4f1ff !important;
  color: #342683 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction .satisfaction-tag-chip.is-active,
body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction .satisfaction-inline-tag.is-active {
  border-color: rgba(105, 77, 212, 0.42) !important;
  background: rgba(105, 77, 212, 0.1) !important;
  color: #342683 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction .satisfaction-tag-chip .tag-count,
body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction .satisfaction-inline-tag .tag-count {
  color: #475569 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-satisfaction .satisfaction-tag-chip .tag-label {
  color: var(--theme-text-strong) !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-satisfaction .satisfaction-tag-chip .tag-count {
  color: var(--theme-muted) !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction .satisfaction-actions .btn {
  border-color: rgba(30, 41, 59, 0.14) !important;
  background: #ffffff !important;
  color: #1f2937 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction .satisfaction-actions .btn:hover,
body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction .satisfaction-actions .btn:focus-visible {
  border-color: rgba(105, 77, 212, 0.28) !important;
  background: #f4f1ff !important;
  color: #342683 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionFilterStatus:not(:empty),
body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionExportStatus:not(:empty) {
  border-color: rgba(30, 41, 59, 0.14) !important;
  background: #f8fafc !important;
  color: #334155 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionReasonsSection .table-wrap {
  border-color: rgba(30, 41, 59, 0.12) !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionReasonsSection table,
body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionReasonsSection td {
  color: #15181f !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionReasonsSection thead th {
  border-color: rgba(30, 41, 59, 0.1) !important;
  background: #f3f4f6 !important;
  color: #111827 !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionReasonsSection tbody tr:nth-child(even) {
  background: #f8fafc !important;
}

body[data-bs-theme="dark"][data-color-theme="light"] #panel-satisfaction #satisfactionReasonsSection tbody tr:hover {
  background: #f4f1ff !important;
  color: #15181f !important;
}

@media (max-width: 1180px) {
  body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-filter-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
  }

  body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-filter-search,
  body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-filter-sort {
    grid-column: span 2 !important;
  }
}

@media (max-width: 980px) {
  body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-tag-groups {
    grid-template-columns: 1fr !important;
    max-width: none !important;
  }
}

@media (max-width: 760px) {
  body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-filter-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-filter-search,
  body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-filter-sort {
    grid-column: auto !important;
  }

  body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-tag-group {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-bs-theme="dark"] #panel-satisfaction .satisfaction-tag-group > p {
    margin-top: 0 !important;
  }
}

/* Semantic feedback remains red, separate from the purple brand theme. */
body[data-bs-theme="dark"] .btn.danger,
body[data-bs-theme="dark"][data-color-theme="light"] .btn.danger {
  border-color: rgba(192, 40, 60, 0.28) !important;
  background: #fff3f5 !important;
  color: #8f1d2e !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .btn.danger {
  border-color: rgba(248, 113, 113, 0.42) !important;
  background: rgba(192, 40, 60, 0.18) !important;
  color: #fca5a5 !important;
}

body[data-bs-theme="dark"] .status-text.error:not(:empty),
body[data-bs-theme="dark"][data-color-theme="light"] .status-text.error:not(:empty) {
  border-color: rgba(192, 40, 60, 0.24) !important;
  border-left-color: #c0283c !important;
  background: #fff3f5 !important;
  color: #8f1d2e !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .status-text.error:not(:empty) {
  border-color: rgba(248, 113, 113, 0.3) !important;
  border-left-color: #f87171 !important;
  background: rgba(192, 40, 60, 0.18) !important;
  color: #fecdd3 !important;
}

body[data-bs-theme="dark"] .badge.bad,
body[data-bs-theme="dark"] .pill.error {
  border-color: rgba(160, 26, 46, 0.2) !important;
  background: #fceef0 !important;
  color: #7a1220 !important;
}

body[data-bs-theme="dark"] .app-toast.error {
  border-color: rgba(248, 113, 113, 0.48) !important;
  background: linear-gradient(135deg, rgba(192, 40, 60, 0.26), rgba(20, 30, 51, 0.98)) !important;
}

/* Accessibility primitives shared by the light and dark application themes. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:where(
  a[href],
  button,
  input,
  select,
  textarea,
  summary,
  [role="button"],
  [role="tab"],
  [tabindex]:not([tabindex="-1"])
):focus-visible {
  outline: 3px solid #694dd4 !important;
  outline-offset: 3px !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] :where(
  a[href],
  button,
  input,
  select,
  textarea,
  summary,
  [role="button"],
  [role="tab"],
  [tabindex]:not([tabindex="-1"])
):focus-visible {
  outline-color: #b9a9f3 !important;
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mapping safety: expected types, source examples and non-color status cues. */
body[data-bs-theme="dark"] #panel-mapping .mapping-row {
  align-items: start;
}

body[data-bs-theme="dark"] #panel-mapping :is(
  .mapping-target-field,
  .mapping-source-field,
  .mapping-scope-field,
  .mapping-row-actions
) {
  display: grid;
  grid-template-rows: 22px 38px auto;
  align-content: start;
  gap: 6px;
}

body[data-bs-theme="dark"] #panel-mapping :is(
  .mapping-field-heading,
  .mapping-control-label,
  .mapping-status-line
) {
  min-height: 22px;
}

.survey-empty-state {
  grid-column: 1 / -1;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-control-label,
body[data-bs-theme="dark"] #panel-mapping .mapping-status-line {
  display: flex;
  align-items: center;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-status-line {
  min-width: 0;
  gap: 8px;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-status-line .badge {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-status-line .tiny {
  flex: 0 0 auto;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-row :is(input, select),
body[data-bs-theme="dark"] #panel-mapping .mapping-row-actions .btn {
  height: 38px;
  min-height: 38px;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-type-badge {
  min-width: 34px;
  min-height: 22px;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(105, 77, 212, 0.3);
  border-radius: 4px;
  background: #f2effd;
  color: #342683;
  font: 700 10px/1 "JetBrains Mono", monospace;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-value-preview,
body[data-bs-theme="dark"] #panel-mapping .mapping-type-warning {
  margin-top: 6px;
  display: block;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.4;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-value-preview {
  color: #4b5563;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-type-warning {
  color: #8a4b08;
  font-weight: 700;
}

body[data-bs-theme="dark"] #panel-mapping .mapping-row.is-type-warning:not(.is-duplicate) {
  border-color: rgba(217, 137, 27, 0.48) !important;
  background: #fff8e8 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-type-badge {
  border-color: rgba(185, 169, 243, 0.38);
  background: rgba(105, 77, 212, 0.2);
  color: #ddd6fe;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-value-preview {
  color: #cbd5e1 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-type-warning {
  color: #fbbf24 !important;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-mapping .mapping-row.is-type-warning:not(.is-duplicate) {
  border-color: rgba(245, 158, 11, 0.52) !important;
  background: rgba(120, 53, 15, 0.24) !important;
}

.badge.good::before,
.status-chip.success::before {
  content: "+";
  margin-right: 4px;
  font-weight: 900;
}

.badge.warn::before,
.status-chip.warning::before {
  content: "!";
  margin-right: 4px;
  font-weight: 900;
}

.badge.bad::before,
.status-chip.error::before {
  content: "x";
  margin-right: 4px;
  font-weight: 900;
}

body[data-bs-theme="dark"] #panel-overview .kpi-confidence {
  width: max-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 3px 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(217, 137, 27, 0.34);
  border-radius: 4px;
  background: #fff8e8;
  color: #7a3f05;
  font-size: 10px;
  font-weight: 800;
}

body[data-bs-theme="dark"][data-color-theme="dark"] #panel-overview .kpi-confidence {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(120, 53, 15, 0.24);
  color: #fcd34d;
}

body[data-bs-theme="dark"] .status-action-row {
  margin-top: 12px;
  flex-wrap: nowrap;
  justify-content: space-between;
}

body[data-bs-theme="dark"] .status-action-row > .status-text {
  min-width: 0;
  margin: 0;
}

body[data-bs-theme="dark"] .status-action-row > .btn {
  flex: 0 0 auto;
  margin-left: 0;
}

body[data-bs-theme="dark"] .status-action-row > .status-text + .btn {
  margin-left: auto;
}

@media (max-width: 760px) {
  body[data-bs-theme="dark"] .status-action-row {
    flex-direction: column;
    align-items: stretch;
  }

  body[data-bs-theme="dark"] .status-action-row > .status-text:not(:empty),
  body[data-bs-theme="dark"] .status-action-row > .btn {
    width: 100%;
    max-width: none;
    margin-left: 0;
  }
}

/* Application chrome: identity/session above, workflow controls below. */
body[data-bs-theme="dark"] .app-header {
  position: sticky;
  top: 0;
  z-index: 90;
  min-height: 64px;
  padding: 10px 20px;
  display: grid;
  grid-template-columns: max-content minmax(220px, 1fr) max-content;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid rgba(21, 24, 31, 0.12);
  background: rgba(255, 255, 255, 0.97);
  color: #15181f;
}

body[data-bs-theme="dark"] .app-header .brand-lockup {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body[data-bs-theme="dark"] .app-header h1 {
  margin: 0;
  color: #15181f;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

body[data-bs-theme="dark"] .app-header-guide {
  min-width: 0;
  display: flex;
  justify-content: center;
}

body[data-bs-theme="dark"] .app-guide-message {
  max-width: 100%;
  margin: 0;
  padding: 6px 10px;
  overflow: hidden;
  border-left: 2px solid rgba(105, 77, 212, 0.78);
  border-radius: 6px;
  background: rgba(105, 77, 212, 0.06);
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-bs-theme="dark"] .session-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

body[data-bs-theme="dark"] .app-header .account-panel {
  min-width: 0;
  border-color: rgba(21, 24, 31, 0.12);
  background: #ffffff;
  color: #15181f;
  box-shadow: none;
}

body[data-bs-theme="dark"] .app-header .account-email {
  max-width: 230px;
  color: #15181f;
}

body[data-bs-theme="dark"] .workflow-toolbar {
  min-height: 56px;
  margin-top: var(--ui-shell-gap);
  padding: 9px 20px;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(390px, 1fr);
  align-items: center;
  gap: 18px;
  border-top: 1px solid rgba(21, 24, 31, 0.08);
  border-bottom: 1px solid rgba(21, 24, 31, 0.1);
  background: rgba(255, 255, 255, 0.95);
}

body[data-bs-theme="dark"] .workflow-filter-action,
body[data-bs-theme="dark"] .workflow-actions,
body[data-bs-theme="dark"] .workflow-steps {
  min-width: 0;
  display: flex;
  align-items: center;
}

body[data-bs-theme="dark"] .workflow-filter-action {
  justify-content: flex-start;
}

body[data-bs-theme="dark"] .workflow-steps {
  justify-content: center;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: thin;
}

body[data-bs-theme="dark"] .workflow-step {
  min-height: 32px;
  padding: 6px 10px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(105, 77, 212, 0.13);
  border-radius: 7px;
  background: rgba(105, 77, 212, 0.055);
  color: #342683;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}

body[data-bs-theme="dark"] .workflow-step span {
  min-width: 16px;
  color: #694dd4;
  font-family: var(--figma-mono, monospace);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

body[data-bs-theme="dark"] .workflow-step.is-active,
body[data-bs-theme="dark"] .workflow-step.is-done {
  border-color: rgba(105, 77, 212, 0.28);
  background: rgba(105, 77, 212, 0.12);
  color: #15181f;
}

body[data-bs-theme="dark"] .workflow-actions {
  justify-content: flex-end;
  gap: 8px;
}

body[data-bs-theme="dark"] .workflow-actions .btn {
  min-width: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}

body[data-bs-theme="dark"] .workflow-filter-action .filters-toggle {
  white-space: nowrap;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .app-header,
body[data-bs-theme="dark"][data-color-theme="dark"] .workflow-toolbar {
  border-color: rgba(203, 213, 225, 0.12);
  background: rgba(8, 13, 24, 0.97);
  color: var(--theme-text);
}

body[data-bs-theme="dark"][data-color-theme="dark"] .app-header h1 {
  color: #ffffff;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .app-guide-message {
  border-left-color: #8067df;
  background: rgba(105, 77, 212, 0.14);
  color: #dcd4ff;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .app-header .account-panel {
  border-color: rgba(203, 213, 225, 0.18);
  background: rgba(22, 34, 54, 0.94);
  color: var(--theme-text);
}

body[data-bs-theme="dark"][data-color-theme="dark"] .app-header .account-email {
  color: #e2e8f0;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .workflow-step {
  border-color: rgba(185, 169, 243, 0.12);
  background: rgba(105, 77, 212, 0.1);
  color: #e9e5ff;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .workflow-step span {
  color: #c9bcff;
}

body[data-bs-theme="dark"][data-color-theme="dark"] .workflow-step.is-active,
body[data-bs-theme="dark"][data-color-theme="dark"] .workflow-step.is-done {
  border-color: rgba(185, 169, 243, 0.34);
  background: rgba(105, 77, 212, 0.2);
  color: #ffffff;
}

@media (max-width: 1320px) {
  body[data-bs-theme="dark"] .workflow-toolbar {
    grid-template-columns: minmax(170px, 1fr) max-content;
    grid-template-areas:
      "steps steps"
      "filter actions";
    row-gap: 8px;
  }

  body[data-bs-theme="dark"] .workflow-filter-action {
    grid-area: filter;
  }

  body[data-bs-theme="dark"] .workflow-steps {
    grid-area: steps;
    width: 100%;
  }

  body[data-bs-theme="dark"] .workflow-actions {
    grid-area: actions;
  }
}

@media (max-width: 1100px) {
  body[data-bs-theme="dark"] .app-header {
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-areas:
      "brand session"
      "guide guide";
    row-gap: 8px;
  }

  body[data-bs-theme="dark"] .app-header .brand-lockup {
    grid-area: brand;
  }

  body[data-bs-theme="dark"] .app-header-guide {
    grid-area: guide;
    justify-content: flex-start;
  }

  body[data-bs-theme="dark"] .session-actions {
    grid-area: session;
  }
}

@media (max-width: 760px) {
  body[data-bs-theme="dark"] .app-header {
    position: relative;
    padding: 10px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "brand"
      "session"
      "guide";
    gap: 8px;
  }

  body[data-bs-theme="dark"] .session-actions {
    width: 100%;
    justify-content: space-between;
  }

  body[data-bs-theme="dark"] .app-header .account-panel:not([hidden]) {
    min-width: 0;
    flex: 1 1 auto;
  }

  body[data-bs-theme="dark"] .app-header .account-email {
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
  }

  body[data-bs-theme="dark"] .app-header-guide {
    width: 100%;
  }

  body[data-bs-theme="dark"] .workflow-toolbar {
    padding: 9px 10px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "steps"
      "filter"
      "actions";
    gap: 8px;
  }

  body[data-bs-theme="dark"] .workflow-steps {
    justify-content: flex-start;
  }

  body[data-bs-theme="dark"] .workflow-filter-action .filters-toggle {
    width: 100%;
  }

  body[data-bs-theme="dark"] .workflow-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-bs-theme="dark"] .workflow-actions .btn {
    width: 100%;
    white-space: normal;
  }

  body[data-bs-theme="dark"] .workflow-actions #btnExportParticipants {
    grid-column: 1 / -1;
  }

  body[data-bs-theme="dark"] #countryMapPanel .chart-frame {
    height: 760px;
  }

  body[data-bs-theme="dark"] .rsm-map-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(390px, 1fr) minmax(230px, auto);
  }
}
