/* Settings panel (gear popover) */
.settings-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: min(360px, 90vw);
  padding: var(--space-4);
  background: var(--surface-1);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  color: var(--text);
  z-index: 10;
}

.settings-panel__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.settings-panel__title {
  font: 600 0.95rem var(--font-ui);
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.settings-panel__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.settings-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: var(--space-2);
  font: 500 0.95rem var(--font-ui);
  color: var(--text);
}

.settings-toggle input[type="checkbox"] {
  margin-top: 3px;
}

/* Auto-Key section styling */
.options-section-divider {
  width: 100%;
  height: 1px;
  background: var(--card-border);
  margin: 0.5rem 0;
}
.options-section-header {
  width: 100%;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-bottom: 0.25rem;
}
.auto-key-pattern-label {
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  gap: 0.5rem;
}
.auto-key-pattern-input {
  width: 100%;
  max-width: 400px;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--card-border);
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--text);
}
.auto-key-pattern-input:focus {
  border-color: var(--brand-primary);
  box-shadow: var(--focus-shadow);
}
/* Utility hidden class */
.hidden {
  display: none !important;
}
.mt-12 {
  margin-top: 12px;
}
/* Universal box-sizing rule to ensure consistent layout behavior */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;

  /* Light theme (kept for reference, but dark is default) */
  --bg: #FAFAFA;
  --text: #1A1A1A;

  /* New brand blue palette */
  --brand-primary: #2E6BFF;
  --brand-primary-hover: #2455CC;
  --brand-primary-active: #2455CC;
  --brand-primary-contrast: #FFFFFF;
  --brand-focus-ring: #7FB0FF;
  --accent: #2E6BFF;
  --accent-600: #2455CC;
  --accent-300: #7FB0FF;

  --surface: #F3F4F6;
  --secondary: #475569;
  --success: #22C55E;
  --warning: #F59E0B;
  --error: #F43F5E;
  --danger: #F43F5E;

  /* Status color tokens - theme-tinted for glass UI */
  --status-error-bg: rgba(244, 63, 94, 0.12);
  --status-error-border: rgba(244, 63, 94, 0.4);
  --status-error-text: #F43F5E;
  --status-neutral-bg: rgba(71, 85, 105, 0.1);
  --status-neutral-border: rgba(71, 85, 105, 0.35);
  --status-neutral-text: #64748B;
  --status-warn-bg: rgba(251, 191, 36, 0.12);
  --status-warn-border: rgba(251, 191, 36, 0.4);
  --status-warn-text: #F59E0B;
  --page-bg: #F8F9FB;
  --card-bg: #EEF1F5;
  --card-border: #CDD5DF;
  --card-shadow: 0 12px 40px rgba(8, 18, 40, 0.45);
  --focus-ring: color-mix(in srgb, var(--brand-primary) 55%, transparent);
  --focus-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 32%, transparent);
  --state-elevated: 0 12px 28px rgba(16, 24, 40, 0.14);
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-sans: var(--font-ui);
  --shell-row-min-height: clamp(64px, 8vw, 92px);

  /* Responsive typography scale */
  --fs-hero: clamp(2rem, 4vw, 3.5rem);
  --fs-h1: clamp(1.75rem, 3vw, 2.5rem);
  --fs-h2: clamp(1.25rem, 2.4vw, 2rem);
  --fs-h3: clamp(1.125rem, 2vw, 1.5rem);
  --fs-body: 1rem;
  --fs-sm: 0.9rem;
  --fs-xs: 0.85rem;
  --text-md: 1rem;
  --fw-semibold: 600;
  --surface-1: var(--surface);
  --text-1: var(--text);
  --border-1: var(--secondary);
  --brand-primary-soft-ring: color-mix(in srgb, var(--brand-primary) 35%, transparent);
  --select-caret: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpath fill='none' stroke='%23A0AEC0' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m1 1 5 5 5-5'/%3e%3c/svg%3e");

  /* Spacing scale tokens for consistent vertical rhythm */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-8: 48px;

  /* Animation tokens */
  --dur-xs: 140ms;
  --dur-sm: 200ms;
  --dur-md: 260ms;
  --ease-out: cubic-bezier(.22, .96, .3, 1);
  --stagger-sm: 60ms;

  /* Token aliases for validation dialog */
  --spacing-xs: var(--space-2);
  --spacing-sm: var(--space-3);
  --spacing-md: var(--space-4);
  --spacing-lg: var(--space-5);
  --spacing-xl: var(--space-6);

  --text-primary: var(--text);
  --text-secondary: var(--text-muted);
  --text-tertiary: color-mix(in srgb, var(--text-muted) 70%, transparent);

  --text-title-lg: 600 var(--fs-h2) var(--font-ui);
  --text-title-sm: 600 var(--fs-h3) var(--font-ui);
  --text-title-xs: 600 var(--text-md) var(--font-ui);
  --text-display-sm: 600 var(--fs-h1) var(--font-ui);
  --text-body-sm: 400 var(--fs-sm) var(--font-ui);
  --text-body-xs: 600 var(--fs-xs) var(--font-ui);
  --weight-semibold: var(--fw-semibold);

  --border-default: var(--border);
  --border-subtle: color-mix(in srgb, var(--border) 60%, transparent);
  --color-warning: var(--warning);
  --radius-md: var(--space-3);
  --radius-lg: var(--space-4);

  /* Legacy mappings */
  --brand-primary: var(--accent);
  --brand-primary-hover: var(--accent-600);
  --brand-primary-active: color-mix(in srgb, var(--accent-600) 85%, black 15%);
  --brand-primary-contrast: #FFFFFF;
  --brand-focus-ring: color-mix(in srgb, var(--accent-300) 60%, transparent);
  --surface: var(--surface-1);
  --secondary: var(--text-muted);
  --page-bg: var(--bg);
  --card-bg: var(--surface-1);
  --card-border: var(--border);
  --card-shadow: var(--shadow);
  --focus-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-300) 50%, transparent);
  --state-elevated: 0 12px 28px rgba(16, 24, 40, 0.14);
  --text-md: 1rem;
  --fw-semibold: 600;
  --surface-1: var(--surface-1);
  --text-1: var(--text);
  --border-1: var(--border);
  --brand-primary-soft-ring: color-mix(in srgb, var(--accent-300) 40%, transparent);
  --select-caret: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpath fill='none' stroke='%23556480' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m1 1 5 5 5-5'/%3e%3c/svg%3e");
}

:root[data-theme="dark"] {
  --bg: #0B1220;
  --surface-1: #0F1A2E;
  --surface-2: #12223A;
  --border: #1C2B46;
  --text: #E9F0FA;
  --text-muted: #A8B6CF;
  --accent: #2E6BFF;
  --accent-600: #2455CC;
  --accent-300: #7FB0FF;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #F43F5E;
  --shadow: 0 12px 40px rgba(8, 18, 40, 0.45);

  /* Status color tokens - theme-tinted for dark glass UI */
  --status-error-bg: rgba(244, 63, 94, 0.16);
  --status-error-border: rgba(244, 63, 94, 0.45);
  --status-error-text: #FCA5B4;
  --status-neutral-bg: rgba(148, 163, 184, 0.12);
  --status-neutral-border: rgba(148, 163, 184, 0.35);
  --status-neutral-text: #A8B6CF;
  --status-warn-bg: rgba(251, 191, 36, 0.14);
  --status-warn-border: rgba(251, 191, 36, 0.4);
  --status-warn-text: #FCD34D;
  --focus-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-300) 45%, transparent);
  --card-shadow: var(--shadow);
  --card-bg: var(--surface-1);
  --page-bg: var(--bg);
  --secondary: var(--text-muted);
  --brand-focus-ring: color-mix(in srgb, var(--accent-300) 65%, transparent);
  --select-caret: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpath fill='none' stroke='%23E9F0FA' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m1 1 5 5 5-5'/%3e%3c/svg%3e");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    /* NextlevelUI dark blue palette */
    --bg: #0B1220;
    --text: #E9F0FA;
    --text-muted: #A8B6CF;
    --surface: #0F1A2E;
    --surface-1: #0F1A2E;
    --surface-2: #12223A;
    --secondary: #A8B6CF;
    --page-bg: #0B1220;
    --card-bg: #0F1A2E;
    --card-border: #1C2B46;
    --card-shadow: 0 12px 40px rgba(8, 18, 40, 0.45);
    --border: #1C2B46;
    --border-1: #1C2B46;
    --focus-ring: #7FB0FF;
    --focus-shadow: 0 0 0 3px rgba(127, 176, 255, 0.35);
    --state-elevated: 0 12px 40px rgba(8, 18, 40, 0.45);
    --select-caret: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpath fill='none' stroke='%23E9F0FA' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m1 1 5 5 5-5'/%3e%3c/svg%3e");
  }
}

html[data-theme="light"] {
  --bg: #FAFAFA;
  --text: #1A1A1A;
  --surface: #F3F4F6;
  --secondary: #475569;
  --page-bg: #F8F9FB;
  --card-bg: #EEF1F5;
  --card-border: #CDD5DF;
  --card-shadow: 0 12px 30px rgba(16, 24, 40, 0.12);
}

html[data-theme="dark"] {
  /* NextlevelUI dark blue palette */
  --bg: #0B1220;
  --text: #E9F0FA;
  --text-muted: #A8B6CF;
  --surface: #0F1A2E;
  --surface-1: #0F1A2E;
  --surface-2: #12223A;
  --secondary: #A8B6CF;
  --page-bg: #0B1220;
  --card-bg: #0F1A2E;
  --card-border: #1C2B46;
  --card-shadow: 0 12px 40px rgba(8, 18, 40, 0.45);
  --border: #1C2B46;
  --border-1: #1C2B46;
  --focus-ring: #7FB0FF;
  --focus-shadow: 0 0 0 3px rgba(127, 176, 255, 0.35);
  --state-elevated: 0 12px 40px rgba(8, 18, 40, 0.45);
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 4rem 0;
  position: relative;
  z-index: 10; /* Higher than footer (z-index: 1) so dropdowns inside main can appear above footer */
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand-focus-ring);
  outline-offset: 2px;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--brand-primary);
}

.sr-only,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}


.page-title-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-1);
}

.page-title {
  text-align: center;
  margin-top: 0;
  margin-bottom: 0;
  font: 600 1.75rem var(--font-ui);
  color: var(--brand-primary);
}

.page-title-container .header-icon-cluster {
  position: absolute;
  right: 0;
}

/* Base: neutral and identical for both zones */
.dropzone {
  position: relative;
  font-family: var(--font-ui);
  border: 2px dashed var(--border);
  background: var(--surface-2);
  background-clip: padding-box; /* keep fill inside dashed rounded border */
  border-radius: 0.85rem;
  width: 100%;
  margin: 0 0 var(--space-2) 0;
  overflow: hidden; /* contain the gradient overlay */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  min-height: 220px;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.dropzone--hero {
  min-height: 360px;
}

/* Gradient overlay for active states */
.dropzone::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  z-index: 0;
  transition: opacity 120ms ease;
  /* Blue radial gradient wash - reduced brightness by 5% */
  background:
    radial-gradient(ellipse 100% 100% at 50% 50%, rgba(46, 107, 255, 0.20) 0%, rgba(46, 107, 255, 0.10) 50%, transparent 70%),
    linear-gradient(180deg, rgba(46, 107, 255, 0.06) 0%, rgba(46, 107, 255, 0.12) 100%);
}

.column-selector .dropzone {
  margin-bottom: 0; /* rely on panel header gap for consistent spacing */
}

/* Shared active look: hover, focus, and drag-over all use the same blue wash/gradient */
.dropzone:hover::before,
.dropzone:focus-within::before,
.dropzone.is-dragover::before,
.dropzone.dragover::before,
.dropzone.has-file::before {
  opacity: 1;
}

.dropzone:hover,
.dropzone:focus-within,
.dropzone.is-dragover,
.dropzone.dragover {
  border-color: var(--accent);
}

/* Only show box-shadow (blue ring) for dragover state, not hover or focus */
.dropzone.is-dragover,
.dropzone.dragover {
  box-shadow:
    0 0 0 2px color-mix(in oklab, var(--accent) 55%, transparent),
    0 10px 30px rgba(0, 0, 0, 0.25);
}

.dropzone:focus-visible,
.dropzone:focus-within {
  outline: none; /* Remove outline when clicked or focused - blue border/glow provides sufficient feedback */
}

.dz-label {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  cursor: pointer;
  padding: 2rem 1.75rem;
  width: 100%;
  min-height: 220px;
  position: relative;
  z-index: 1;
}

/* Reduce motion: disable transitions for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .dropzone,
  .dropzone::before {
    transition: none;
  }
}

.dropzone.has-file {
  /* Keep dashed border style like all other states - gradient overlay handled by ::before */
  border-color: var(--accent);
  /* No box-shadow (blue ring) for has-file state - border and gradient provide sufficient feedback */
}

.dropzone[aria-disabled="true"] {
  border-style: solid;
  border-color: color-mix(in srgb, var(--secondary) 35%, transparent);
  background: var(--surface);
}

.dropzone[aria-disabled="true"] .dz-label {
  cursor: not-allowed;
  opacity: 0.75;
}

.dropzone .dz-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: color-mix(in srgb, var(--surface) 35%, var(--text) 65%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.dropzone[aria-disabled="true"] .dz-overlay {
  opacity: 0;
}

.dz-icon {
  width: 48px;
  height: 48px;
  color: color-mix(in srgb, var(--secondary) 70%, var(--text) 30%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dz-message {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
}

.dz-title {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--text);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dz-subtitle {
  font: 500 0.85rem var(--font-ui);
  color: color-mix(in srgb, var(--secondary) 85%, black 15%);
}

.dz-trigger {
  margin-top: 0.75rem;
  padding: 0.45rem 1.5rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 82%, transparent);
  background: var(--brand-primary);
  color: var(--brand-primary-contrast);
  font: 600 0.9rem var(--font-ui);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

.dz-trigger:hover,
.dz-trigger:focus-visible {
  background: var(--brand-primary-hover);
  box-shadow: 0 0 0 3px var(--brand-primary-soft-ring);
  transform: translateY(-1px);
}

.dz-trigger:active {
  background: var(--brand-primary-active);
}

.app-card {
  max-width: 720px;
  margin: 0;
  padding: 20px 24px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  box-shadow: var(--card-shadow);
}

/* Ensure last child has no bottom margin */
.app-card > :last-child {
  margin-bottom: 0;
}

.validate-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: var(--space-3);
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  transition: padding-top 2400ms var(--ease-out);
}

.controls-pane {
  width: 100%;
  max-width: 720px;
  display: flex;
  justify-content: center;
  transform: translateX(calc(50% + var(--space-3) / 2));
  transition: transform 2400ms var(--ease-out);
  position: relative;
  z-index: 100; /* Higher than footer (z-index: 1) so dropdown inside can appear above footer */
}

.controls-pane > * {
  width: 100%;
}

.validate-shell.is-two-pane .controls-pane {
  transform: translateX(0);
}

.validate-shell.is-two-pane .app-card {
  height: auto;
}


.results-pane {
  display: none;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  width: 100%;
  max-width: 720px;
  justify-content: center;
  height: auto;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 4200ms var(--ease-out), visibility 0s linear 4200ms;
}

.validate-shell.is-two-pane .results-pane,
.validate-shell.has-results .results-pane {
  display: flex;
  max-height: none;
  overflow-y: visible;
  padding: 20px 24px 16px;
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  visibility: visible;
}

.validate-shell.results-visible .results-pane,
.validate-shell.has-results .results-pane {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.results-pane dialog#detailDialog {
  max-width: none;
  padding: 0;
  margin: 0;
}

/* Reduce top padding when one-click summary is hidden (manual validation) */
.results-pane:has(#one-click-summary-container:empty) {
  padding-top: var(--space-3);
}

button {
  flex: 1;
  padding: 0.75rem;
  font: 600 1rem var(--font-ui);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: transform 0.2s, background 0.2s;
}

/* Do not let JSON option buttons inherit global flex:1 */
#json-inline-controls button { flex: 0 0 auto; }

.actions .btn-primary {
  background: var(--brand-primary);
  color: var(--brand-primary-contrast);
  border: 1px solid var(--brand-primary);
}

.actions .btn-primary:hover:enabled {
  background: var(--brand-primary-hover);
  transform: translateY(-2px);
}

.actions .btn-primary:active {
  background: var(--brand-primary-active);
}

#downloadBtn {
  background: var(--brand-primary);
  color: var(--brand-primary-contrast);
}

#downloadBtn:hover:enabled {
  background: var(--brand-primary-hover);
  transform: translateY(-2px);
}

#downloadBtn:active {
  background: var(--brand-primary-active);
}

#resetBtn {
  background: transparent;
  color: var(--secondary);
  border: 1.5px solid color-mix(in srgb, var(--secondary) 40%, transparent);
  box-shadow: none;
}

#resetBtn:hover {
  background: color-mix(in srgb, var(--brand-primary) 15%, transparent);
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}

#downloadBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

:root {
  --lfm-progress-height: 24px;
  --vbar-height: 12px;
}

.lfm-progress {
  position: relative;
  width: 100%;
  max-width: none;
  min-width: min(100%, 240px);
  margin: 1rem auto 0;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  height: var(--lfm-progress-height);
  transition: opacity 180ms ease;
}

.lfm-progress.is-hidden {
  display: none;
}

.lfm-progress__fill {
  height: 100%;
  width: 0%;
  background: var(--brand-primary);
  transition: width 250ms linear;
}

.lfm-progress__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-primary-contrast);
  text-transform: none;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
  pointer-events: none;
}

.vbar {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
  height: var(--vbar-height);
}

.vbar__fill {
  height: 100%;
  width: 0%;
  background: var(--brand-primary);
  transition: width 120ms linear;
}

.vbar__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-primary-contrast);
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
}

.vbar[hidden] {
  display: none;
}

.vbar--fadeout {
  opacity: 0;
  transition: opacity 300ms ease;
}

#result {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  font: 500 1rem var(--font-ui);
  color: var(--secondary);
}

.is-visible { display: block !important; }
.is-success { color: var(--success) !important; }
.is-warning { color: var(--warning) !important; }
.is-error { color: var(--error) !important; }

.detail-panel {
  margin-top: 0.5rem;
  background: var(--surface);
  border-radius: 0.5rem;
  padding: 1rem;
  font: 0.9rem var(--font-ui);
} 

.detail-panel pre {
  padding: 0.5rem;
  font-family: var(--font-ui);
}

.detail-panel mark {
  background: rgba(245,158,11,0.25) !important;
  padding: 0 0.25rem;
  border-radius: 0.25rem;
  color: var(--text) !important;
}

/* --- Info button & modal -------------------------------------------- */
.info-btn {
  background: none;
  border: none;
  padding: 0;
  background: transparent;
  line-height: 0;
  font-size: 1rem;
  margin-left: 0.25rem;
  cursor: pointer;
  color: var(--secondary);
  vertical-align: middle;  /* Ensures baseline alignment */
}
.info-btn:hover { color: var(--brand-primary); }
.info-btn:focus-visible {
  outline: 2px solid var(--brand-focus-ring);
  outline-offset: 2px;
  box-shadow: var(--focus-shadow);
  border-radius: 999px;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--secondary);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  color: var(--secondary);
  background: transparent;
  pointer-events: none;
}

.info-btn:hover .info-icon {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}



.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 40, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.modal-box {
  width: min(96vw, 680px);      /* wider for less wrapping */
  max-width: 680px;
  max-height: 85vh;             /* still keeps it from full-screen */
  overflow: visible;            /* no internal scrollbars */
  margin: 1rem;                 /* breathing room on very small screens */
  padding: 1.5rem;
  border-radius: 0.85rem;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.modal-box h3 { margin-top: 0; margin-bottom: 0.75rem; }
.modal-box h4 { margin: 0.75rem 0 0.5rem; }
.modal-box p { margin: 0.5rem 0; }
.modal-box ul { margin: 0.25rem 0 0.75rem 1.25rem; padding-left: 1rem; }
.modal-box li { margin: 0.25rem 0; }
.modal-box button { width: 100%; margin-top: 0.75rem; }

@media (max-height: 560px) {
  .modal-box { max-height: 72vh; }
}

dialog#detailDialog {
  position: static;
  margin-top: 0;
  margin-bottom: 0;
  width: 100%;
  max-width: 760px;
  background: transparent;
  border: none;
  color: var(--text);
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: visible;
  max-height: none;
  box-sizing: border-box;
}


dialog#detailDialog pre {
  white-space: pre-wrap;         /* Wraps text in <pre> while preserving spaces */
  word-break: break-word;        /* Breaks words at arbitrary points if necessary */
  margin: 0;
  padding: 0.5rem;
  overflow-x: hidden;            /* Ensures no horizontal overflow in pre */
}

.results-dialog-shell {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  background: var(--surface-1);
  border: none;
  padding: var(--spacing-sm);
  border-radius: var(--radius-lg);
}

.results-dialog-shell[data-outcome="pass2_failed"] {
  padding-top: var(--space-1);
}

.results-dialog-header {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.results-dialog-topline {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  margin-bottom: 0;
}

.results-dialog-title {
  margin: 0;
  font: var(--text-title-lg);
  color: var(--text-primary);
}

.results-dialog-status-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  font: var(--text-title-sm);
  color: var(--text-primary);
  width: 100%;
}

.results-dialog-status-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: #fbbf24;
  flex-shrink: 0;
}

.results-dialog-body {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.results-dialog-body[data-compact="true"] {
  gap: var(--spacing-xs);
}

.results-dialog-status-overall {
  margin-bottom: 0;
}

.results-dialog-body[data-compact="true"] .validation-kpi-row {
  margin-top: var(--spacing-xs);
}

.results-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  align-items: center;
  text-align: center;
}

.results-section-heading {
  margin: 0;
  font: var(--text-title-sm);
  color: var(--text-primary);
}

.results-section-subtext {
  margin: 0;
  font: var(--text-body-sm);
  color: var(--text-tertiary);
  margin-top: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
}

.validation-kpi-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--spacing-sm);
  row-gap: var(--spacing-sm);
  width: 100%;
  margin: var(--spacing-sm) 0 0 0;
}

.validation-kpi-card {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: var(--spacing-xs) var(--spacing-sm);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  width: 100%;
}

.validation-kpi-number {
  font: var(--text-display-sm);
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.validation-kpi-label {
  font: var(--text-body-sm);
  color: var(--text-secondary);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  width: 100%;
}

.discrepancy-card {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.discrepancy-card__title {
  margin: 0;
  font: var(--text-title-xs);
  color: var(--text-primary);
}

.discrepancy-field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.discrepancy-field__label {
  font: var(--text-body-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
}

.discrepancy-field__value {
  font: var(--text-body-sm);
  color: var(--text-primary);
  word-break: break-word;
}

.results-cta-line {
  margin: var(--spacing-sm) 0 0 0;
  font: var(--text-body-sm);
  color: var(--text-secondary);
  text-align: center;
}

.results-cta-line strong {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.results-cta-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  text-decoration: underline;
  cursor: pointer;
}

.results-cta-button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Column selector panels */
.column-selector {
  --selector-block-gap: var(--space-4);
  --selector-label-gap: var(--space-2);
}

.column-selector {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: var(--space-4) var(--space-5);
  margin: 0;
  overflow-x: hidden;   /* guard against accidental horizontal scroll */
  font-family: var(--font-ui);
}

/* Harden adjacency: H1 → column selector */
.page-title-container + .column-selector {
  margin-top: var(--space-3);
}

.column-selector .panel {
  flex: 1 1 320px;
  min-width: 0;            /* allow flex item to shrink */
  overflow-y: visible;
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.column-selector .panel-header {
  display: flex;
  flex-direction: column;
  gap: var(--selector-block-gap);
  margin-bottom: var(--selector-block-gap);
  align-items: center;
  text-align: center;
  overflow: visible;
}

.column-selector .panel-header label {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.column-selector .panel-header input {
  width: auto;
  text-align: center;
  padding: 0.25rem;
  font-family: inherit;
}

.column-selector .panel-body {
  display: flex;
  flex-direction: column;
  gap: var(--selector-label-gap);
}

.column-selector .panel-body label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  max-width: 100%;
  padding: 0.4rem 0.55rem;
  border-radius: 0.6rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.column-selector .panel-body label:hover {
  background: color-mix(in srgb, var(--brand-primary) 12%, transparent);
}

.column-selector .panel-body label:focus-within {
  box-shadow: 0 0 0 3px var(--brand-primary-soft-ring);
  background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
}

.column-selector .panel-body label.is-selected {
  background: color-mix(in srgb, var(--brand-primary) 18%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary) 35%, transparent);
}

.column-selector .panel-body label.is-selected .label-text {
  color: var(--brand-primary);
  font-weight: 600;
}

.column-selector .panel-body label input {
  flex: 0 0 auto;
}

.column-selector .panel-body label .label-text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.column-selector fieldset.validate-cols {
  border: none;
  margin: 0;
  padding: 0;
}

/* Disable pointer events for sheet name elements */
#sheetNameA, #sheetNameB {
  pointer-events: none;
}

/* Unified select styling */
.ui-select,
.ui-select option {
  font-family: var(--font-ui);
  font-size: var(--text-md);
  font-weight: var(--fw-semibold);
}

.ui-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  background: var(--surface-1);
  color: var(--text-1);
  border: 1px solid var(--border-1);
  border-radius: 0.625rem;
  padding: 0.625rem 2.5rem;
  line-height: normal;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 0.75rem;
  background-clip: padding-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.ui-select--centered {
  text-align: center;
  text-align-last: center;
}

.ui-select option {
  text-align: center;
}

.ui-select--caret {
  background-image: var(--select-caret);
}

.ui-select:hover {
  border-color: var(--brand-primary);
}

.ui-select:focus,
.ui-select:focus-visible {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-soft-ring);
}

@media (prefers-color-scheme: dark) {
  .ui-select {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
  }
}

@supports (-webkit-appearance: none) {
  .ui-select {
    text-indent: 0;
  }
}

/* Sheet selector dropdown */
.sheet-select-wrap {
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--selector-label-gap);
  padding: 0;
  opacity: 0;
  max-height: 0;
  overflow: visible;
  margin-bottom: 0;
  transition: opacity 1200ms var(--ease-out), max-height 0s linear 0s, margin-bottom 0s linear 0s;
}

.sheet-select-wrap.fade-in {
  opacity: 1;
  max-height: 200px;
  overflow: visible; /* allow custom dropdown menus to escape the wrapper */
  transition: opacity 1200ms var(--ease-out), max-height 0s linear 0s, margin-bottom 0s linear 0s;
}

.sheet-select-wrap.hidden {
  display: none;
}

.sheet-select-label {
  text-transform: none;
}

.sheet-select,
.shared-select {
  display: block;
  width: min(260px, 90%);
  max-width: 100%;
  padding: 0.55rem 2rem 0.55rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--secondary) 45%, transparent);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--text);
  min-height: 2.25rem;
  line-height: 1.2;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  margin: 0 auto;
  font: 400 0.95rem/1.2 var(--font-ui);
  text-align: left;
  text-align-last: left;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: var(--select-caret);
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 0.65rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.column-selector .panel-header .sheet-select-wrap {
  margin-top: 0;
  align-self: center;
}

.sheet-select option,
.shared-select option {
  font: inherit;
  text-align: left;
}

.sheet-select.hidden {
  visibility: hidden;
  display: block;   /* remain in flow to reserve height */
  pointer-events: none;
}

.sheet-select:hover,
.shared-select:hover {
  border-color: var(--brand-primary);
  box-shadow:
    0 2px 6px rgba(15, 23, 42, 0.08),
    0 0 0 3px var(--brand-primary-soft-ring);
}

.sheet-select:focus,
.sheet-select:focus-visible,
.shared-select:focus,
.shared-select:focus-visible {
  border-color: var(--brand-primary);
  box-shadow:
    0 2px 6px rgba(15, 23, 42, 0.08),
    0 0 0 3px color-mix(in srgb, var(--brand-primary) 35%, transparent);
}

.column-search {
  display: block;
  width: min(260px, 90%);
  max-width: 100%;
  padding: 0.45rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--secondary) 35%, transparent);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--text);
  font: 400 0.95rem/1.2 var(--font-ui);
  margin: 0 auto 0.35rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07);
  text-align: left; /* keep caret at the left edge */
  appearance: none;
  -webkit-appearance: none;
}

.column-search::placeholder {
  text-align: center; /* center the placeholder text */
}

/* Override panel header centering so caret stays left inside shared; sheet centers until focus */
.shared-combo .column-search {
  text-align: left !important;
  text-align-last: left !important;
  -webkit-text-align-last: left !important;
}

.sheet-combo .column-search {
  text-align: left !important; /* caret at far left */
}

.combo-search-wrap {
  position: relative;
  width: 100%;
}

.combo-search-wrap .combo-search-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: color-mix(in srgb, var(--text) 65%, transparent);
  font: 400 0.95rem/1.2 var(--font-ui);
  transition: opacity 0.15s ease;
}

.combo-search-wrap.has-value .combo-search-placeholder {
  opacity: 0;
  visibility: hidden;
}

.sheet-search-wrap .sheet-search-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: color-mix(in srgb, var(--text) 65%, transparent);
  font: 400 0.95rem/1.2 var(--font-ui);
  transition: opacity 0.15s ease;
}

.sheet-search-wrap.has-value .sheet-search-placeholder,
.sheet-search-wrap.has-focus .sheet-search-placeholder {
  opacity: 0;
  visibility: hidden;
}

.column-search:focus,
.column-search:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow:
    0 1px 3px rgba(15, 23, 42, 0.07),
    0 0 0 3px color-mix(in srgb, var(--brand-primary) 35%, transparent);
}

.column-search__empty {
  text-align: center;
  color: color-mix(in srgb, var(--text) 70%, transparent);
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem 0.5rem;
}

.shared-search {
  margin-bottom: 0.25rem;
}

.validation-search {
  width: min(260px, 90%);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.shared-combo,
.sheet-combo {
  position: relative;
  width: min(260px, 90%);
  max-width: 100%;
  margin: 0 auto;
}

.shared-select--native,
.sheet-select--native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.shared-combo__button,
.sheet-combo__button {
  width: 100%;
  padding: 0.55rem 2rem 0.55rem 2rem;
  border: 1px solid color-mix(in srgb, var(--secondary) 45%, transparent);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--text);
  min-height: 2.25rem;
  line-height: 1.2;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  font: 400 0.95rem/1.2 var(--font-ui);
  text-align: center;
  background-image: var(--select-caret);
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 0.65rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.shared-combo__button:hover,
.sheet-combo__button:hover {
  border-color: var(--brand-primary);
  box-shadow:
    0 2px 6px rgba(15, 23, 42, 0.08),
    0 0 0 3px var(--brand-primary-soft-ring);
}

.shared-combo__button:focus,
.shared-combo__button:focus-visible,
.sheet-combo__button:focus,
.sheet-combo__button:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow:
    0 2px 6px rgba(15, 23, 42, 0.08),
    0 0 0 3px color-mix(in srgb, var(--brand-primary) 35%, transparent);
}

.shared-combo__menu,
.sheet-combo__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--secondary) 45%, transparent);
  border-radius: 0.75rem;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.18),
    0 2px 10px rgba(0, 0, 0, 0.12);
  padding: 0.5rem 0.6rem 0.65rem;
  z-index: 9999; /* High z-index to ensure dropdown appears above footer and other elements */
  overflow: visible;
  max-height: none; /* allow full-height expansion consistent with validation dropdown */
  /* Allow dropdown to expand wider than trigger for long sheet names */
  width: max-content;
  min-width: 100%;
  max-width: min(90vw, 480px);
}

.shared-combo__menu.hidden,
.sheet-combo__menu.hidden {
  display: none;
}

/* Portal-rendered dropdown menu - appended to body to escape stacking contexts */
.sheet-combo__menu--portal {
  position: fixed;
  z-index: 99999; /* Very high to ensure it's above everything including footer */
}

.shared-combo__options,
.sheet-combo__options {
  max-height: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.1rem 0.15rem 0.05rem;
}

.validation-combo__viewport {
  position: relative;
  overflow: hidden;
  border-radius: 0.65rem;
}

.validation-combo__scroll {
  position: relative;
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.1rem 0.15rem 0.05rem;
}

.shared-combo__option,
.sheet-combo__option {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 0.4rem;
  padding: 0.5rem 0.65rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.3;
  transition: background 0.1s ease, border-color 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-sizing: border-box;
  position: relative;
  overflow: visible; /* Allow full text to be visible */
  text-align: center;
  /* Allow long sheet names to wrap naturally */
  white-space: normal;
  overflow-wrap: anywhere; /* Works even with underscores in snake_case names */
  word-break: break-word;
}

.shared-combo__option:hover,
.shared-combo__option:focus,
.sheet-combo__option:hover,
.sheet-combo__option:focus {
  background: color-mix(in srgb, var(--brand-primary) 12%, transparent);
  border-color: color-mix(in srgb, var(--brand-primary) 30%, transparent);
  outline: none;
}

.shared-combo__option.is-selected,
.sheet-combo__option.is-selected {
  background: color-mix(in srgb, var(--brand-primary) 18%, transparent);
  border-color: color-mix(in srgb, var(--brand-primary) 40%, transparent);
  color: var(--brand-primary);
  font-weight: 600;
  position: relative;
}

.validation-option {
  position: relative;
}

.shared-combo__option input[type="radio"],
.sheet-combo__option input[type="radio"] {
  display: none;
}

.sheet-row {
  display: flex;
  justify-content: center;
  margin: 0 0 var(--selector-block-gap) 0;
}

.sheet-row[hidden] {
  display: none;
  margin: 0;
}

.sheet-row:empty {
  display: none;
}

/* --- Identical Column selector (red) --------------------------------------- */
.shared-row {
  display: flex;
  align-items: center;
  justify-content: stretch;
  margin: 0 0 var(--selector-block-gap) 0;
  opacity: 0;
  max-height: 0;
  overflow: visible;
  gap: var(--selector-label-gap);
  transition: opacity 1200ms var(--ease-out), max-height 0s linear 0s;
}

.shared-row.fade-in {
  opacity: 1;
  max-height: 100px;
  overflow: visible; /* keep dropdown menus from being clipped once visible */
  transition: opacity 1200ms var(--ease-out), max-height 0s linear 0s;
}

.shared-row[hidden] {
  display: none;
}

.shared-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--selector-label-gap);
  width: 100%;
}

.validation-columns-region {
  margin: 0;
  opacity: 0;
  max-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: var(--selector-label-gap);
  transition: opacity 1200ms var(--ease-out), max-height 0s linear 0s;
}

.validation-columns-region.fade-in {
  opacity: 1;
  max-height: 500px;
  overflow: visible;
  transition: opacity 1200ms var(--ease-out), max-height 0s linear 0s;
}

.validation-columns-region:empty,
.panel-body:empty {
  display: none;
}

.validation-columns-subtitle {
  margin: 0;
  padding: 0;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 1200ms var(--ease-out), max-height 0s linear 0s;
}

.validation-columns-subtitle.fade-in {
  opacity: 1;
  max-height: 50px;
  padding: 0;
  transition: opacity 1200ms var(--ease-out), max-height 0s linear 0s;
}

.validation-columns-subtitle[hidden] {
  display: none;
}

.form-section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  font: 500 0.85rem var(--font-ui);
  color: var(--secondary);
  margin: 0;
  padding: 0;
  text-align: center;
}

.shared-label {
  text-align: center;
}

#validate-hint {
  margin: 0;
  text-align: center;
}

#validate-hint:not(:empty) {
  margin: var(--space-2) 0 var(--space-1);
}

#json-inline-controls {
  margin-top: var(--space-2);
}

/* Persistent inline chip next to selected column */
.val-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.5rem;
  font: 700 0.85rem var(--font-ui);
  color: var(--text); /* auto white/black per theme */
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- Inline JSON controls in main panel ------------------------------ */
.json-slot-controls { 
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; 
  background: color-mix(in srgb, var(--surface) 95%, black 5%);
  border: 1px solid var(--secondary);
  border-radius: 10px;
  padding: 10px 12px;
  overflow-x: auto;  /* avoid visual clipping at edges */
}
/* Keep inline JSON controls centered; allow wrapping on small screens */
.json-inline-row { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.json-inline-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* Label + input sit on one baseline; label slightly smaller */
.json-inline-label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.json-inline-label span { font-size: 0.8rem; line-height: 1; color: var(--secondary); }
/* Pointer input height matches buttons; text stays on one line */
.json-inline-row .json-pointer { flex: 0 0 160px; width: 160px; max-width: 180px; font-size: 0.9rem; line-height: 1.2; height: 34px; padding: 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.json-slot-controls .btn.small { flex: 0 0 auto; white-space: nowrap; min-width: max-content; }
.json-slot-controls label { font-size: 0.95rem; color: var(--secondary); }
.json-slot-controls input[type="text"],
.json-slot-controls input[type="number"] {
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--secondary);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--text);
}
.json-slot-controls input[type="number"] { width: 100px; min-width: 90px; }
.json-chip {
  background: color-mix(in srgb, var(--surface) 92%, var(--text) 8%);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--secondary) 55%, transparent);
  padding: 4px 8px;
  border-radius: 10px;
  font-size: .9rem;
}
.json-status { opacity: 0.8; }
.btn.small { padding: 5px 10px; font-size: .88rem; border-radius: 0.5rem; border: 1px solid var(--secondary); background: var(--surface); color: var(--text); }
.btn.small:hover { filter: brightness(1.06); }
/* Advanced JSON options panel */
.json-advanced[hidden] { display: none; }
.json-advanced { 
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center;
  padding: 8px 10px; border: 1px dashed var(--secondary); border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 90%, black 10%);
}

/* === Actions: balanced, responsive buttons === */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-2) 0 0 0;
}

.actions .btn {
  min-width: 128px;          /* baseline so short labels don't look tiny */
  padding: 10px 16px;        /* consistent height */
  font-size: 15px;
  line-height: 1.2;
  border-radius: 6px;
}

.actions .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.actions .btn:focus-visible {
  outline: 2px solid var(--brand-focus-ring);
  outline-offset: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), var(--focus-shadow);
}

#one-click-summary-container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

#one-click-summary-container:empty {
  display: none;
}

.one-click-summary {
  display: grid;
  gap: 0;
}

.one-click-summary__main-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: var(--space-4);
}

.one-click-summary__bolt-icon {
  width: 24px;
  height: 24px;
  color: #fbbf24;
  flex-shrink: 0;
}

.one-click-summary__main-title {
  font: var(--text-title-sm);
  color: var(--text);
  line-height: 1;
}

.one-click-summary__row {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.one-click-summary__row + .one-click-summary__row {
  margin-top: var(--space-3);
}

.one-click-summary__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.one-click-summary__title {
  font: 600 0.98rem var(--font-ui);
  color: var(--text);
}

.one-click-summary__detail {
  margin: var(--space-2) 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 999px;
  font: 700 0.75rem var(--font-ui);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  width: 130px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.status-pill--pass {
  background: color-mix(in srgb, var(--success) 85%, transparent);
  border-color: color-mix(in srgb, var(--success) 55%, transparent);
  color: #0b1f13;
}

.status-pill--warn {
  background: var(--status-warn-bg);
  border-color: var(--status-warn-border);
  color: var(--status-warn-text);
}

.status-pill--fail {
  background: var(--status-error-bg);
  border-color: var(--status-error-border);
  color: var(--status-error-text);
}

.status-pill--skipped {
  background: var(--status-neutral-bg);
  border-color: var(--status-neutral-border);
  color: var(--status-neutral-text);
}

.status-pill--unknown {
  background: var(--status-neutral-bg);
  border-color: var(--status-neutral-border);
  color: var(--status-neutral-text);
}

/* Mobile: respect min width, but let buttons grow and wrap nicely */
@media (max-width: 520px) {
  .actions { gap: 8px; }
  .actions .btn { flex: 1 1 auto; }
}

/* Compact spacing adjustments for mobile */
@media (max-width: 480px) {
  .app-card {
    padding: 16px;
  }
  .column-selector {
    gap: var(--space-3) var(--space-4);
  }
  .actions {
    margin-top: var(--space-2);
  }
}

@media (max-width: 900px) {
  .validate-shell.is-two-pane,
  .validate-shell.has-results {
    grid-template-columns: 1fr;
  }
  .validate-shell.is-two-pane .controls-pane,
  .validate-shell.has-results .controls-pane {
    transform: none;
  }
  .validate-shell.is-two-pane .results-pane,
  .validate-shell.has-results .results-pane {
    max-height: none;
    overflow: visible;
    padding: var(--space-3) 0;
    box-shadow: none;
    border: none;
  }
}

/* Stack utility for vertical rhythm */
.stack > * + * {
  margin-top: var(--space-3);
}

/* --- Helpers to replace inline styles (CSP-friendly) ------------------- */
.toast-host {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2147483647;
  pointer-events: none;
}
.toast {
  min-width: 220px;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 8px;
  font: 500 0.9rem var(--font-ui);
  color: white;
  background: var(--error);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}
.toast--visible { opacity: 1; transform: translateY(0); }
.toast--success { background: var(--success); }
.toast--warning { background: var(--warning); }
.toast--error { background: var(--error); }

/* ===== Top banner & tabs ===== */
.site-header {
  background: var(--surface-1);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-ui);
}
.site-header a,
.site-header button {
  color: inherit;
  font-family: inherit;
}
.site-header__inner {
  width: 100%;
  margin: 0;
  padding: 1rem 2.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 1.5rem;
  min-height: var(--shell-row-min-height);
}
.site-header__actions {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.site-logo {
  grid-column: 2;
  justify-self: center;
  font: 700 1.35rem var(--font-ui);
  color: var(--brand-primary);
  text-decoration: none;
}
.top-tabs {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  gap: 1rem;
}
.top-tabs .tab {
  padding: 0.35rem 0;
  font: 600 0.95rem var(--font-ui);
  border: none;
  background: none;
  background-color: transparent;
  box-shadow: none;
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--secondary) 35%, var(--text) 65%);
  cursor: pointer;
  transition: color 0.2s ease;
  border-radius: 0;
  border-bottom: 0;
}
.top-tabs .tab:hover,
.top-tabs .tab:focus {
  color: var(--brand-primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.top-tabs .tab.active {
  color: var(--brand-primary);
}

.header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--surface-1) 85%, transparent);
  color: #fbbf24;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 120ms ease; /* Added transform to transition */
}
.header-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}
.header-icon:hover,
.header-icon:focus-visible {
  color: #fbbf24;
  border-color: #fbbf24;
  transform: translateY(-1px) scale(1.02); /* Added transform */
}
.header-icon:focus-visible {
  outline: 2px solid var(--brand-focus-ring);
  outline-offset: 2px;
  box-shadow: var(--focus-shadow);
}
.header-icon.active {
  color: #fbbf24;
  border-color: #fbbf24;
  box-shadow: 0 0 0 2px color-mix(in srgb, #fbbf24 35%, transparent);
  transform: scale(0.98); /* Added transform */
}

/* Lightning bolt charge animation */
@keyframes bolt-charge-rise {
  from {
    transform: translateY(24px);
  }
  to {
    transform: translateY(-12px);
  }
}

.header-icon--lightning .bolt-charge-bar {
  transform-box: fill-box;
  transform-origin: center;
  transform: translateY(24px);
  will-change: transform;
}

.header-icon--lightning:hover .bolt-charge-bar {
  animation: bolt-charge-rise 800ms ease-out forwards;
}

/* Override base header-icon hover to keep lightning bolt stationary */
.header-icon--lightning:hover,
.header-icon--lightning:focus-visible {
  transform: none;
}

.top-tabs .tab:focus-visible {
  outline: 2px solid var(--brand-focus-ring);
  outline-offset: 2px;
  box-shadow: var(--focus-shadow);
  border-radius: 0.25rem;
}

@media (prefers-color-scheme: dark) {
  .site-header {
    background: var(--surface-1);
    color: var(--text);
    border-bottom: 1px solid var(--border);
  }

  .site-header a,
  .site-header button {
    color: inherit;
  }

  .top-tabs .tab {
    color: var(--secondary);
  }
}

@media (max-width: 720px) {
  .site-header__inner {
    grid-template-columns: 1fr;
    row-gap: 0.75rem;
    justify-items: center;
  }
  .site-header__actions {
    grid-column: 1;
    justify-self: center;
  }
  .site-logo {
    grid-column: 1;
    width: auto;
    text-align: center;
  }
  .top-tabs {
    grid-column: 1;
    justify-self: center;
  }
  .about-main {
    padding: 2rem 1rem 3rem;
  }
}

/* ===== About page sections ===== */
.about-main {
  padding: 2.5rem 1.5rem 4rem;
  background: var(--page-bg);
}

.about-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.about-section {
  margin: 1rem 0 1.25rem;
  padding: 0.75rem 0;
  border-top: 1px solid color-mix(in srgb, var(--secondary) 20%, transparent);
}
.about-section:first-of-type { border-top: none; }

.about-list {
  margin: 0.5rem 0 0 1.25rem;
  padding-left: 0.75rem;
}

/* ===== Site footer ===== */
.site-footer {
  margin-top: 3rem;
  background: var(--card-bg);
  border-top: 1px solid var(--card-border);
  color: var(--secondary);
}

.site-footer__inner {
  width: 100%;
  margin: 0;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.25rem;
  font: 500 0.9rem var(--font-ui);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  justify-content: flex-end;
  grid-column: 3;
}

.footer-copy {
  white-space: nowrap;
  grid-column: 2;
  justify-self: center;
  text-align: center;
}

.footer-link {
  font: 600 0.95rem var(--font-ui);
  color: var(--accent);
  text-decoration: underline;
}

.footer-link:visited {
  color: var(--accent-600);
}

.footer-link:hover,
.footer-link:focus {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .site-footer__inner {
    display: flex;
    flex-direction: column;
    text-align: center;
  }
  .footer-copy { white-space: normal; }
  .footer-links {
    flex-direction: column;
    justify-content: center;
  }
}

/* Pricing */
.pricing-main {
  padding: 2.5rem 1.5rem 4rem;
  background: var(--page-bg);
}

.pricing-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.pricing-hero {
  padding: 3rem 0 2rem;
  text-align: center;
}

.pricing-hero h1 {
  margin: 0;
  font: 700 2.5rem var(--font-ui);
  color: var(--text);
}

.pricing-subhead {
  margin: 0.75rem auto 0;
  max-width: 560px;
  font: 500 1.1rem var(--font-ui);
  color: var(--secondary);
}

.pricing-tiers {
  padding: 2rem 0 3rem;
}

.pricing-tiers h2,
.pricing-compare h2,
.pricing-faq h2,
.pricing-help h2 {
  margin: 0 0 1.5rem;
  font: 600 1.75rem var(--font-ui);
  color: var(--text);
  text-align: center;
}

.pricing-billing {
  margin: 0 auto 2rem;
  padding: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  justify-content: center;
  align-items: center;
}

.pricing-billing__option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: 500 0.95rem var(--font-ui);
  color: var(--secondary);
  cursor: pointer;
}

.pricing-billing__option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.pricing-billing__option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.pricing-billing__option:hover span {
  background: color-mix(in srgb, var(--brand-primary) 14%, transparent);
  color: var(--brand-primary);
}

.pricing-billing__option input:checked + span {
  background: var(--brand-primary);
  color: var(--brand-primary-contrast);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand-primary) 35%, transparent);
}

.pricing-billing__option input:focus-visible + span {
  outline: 2px solid var(--brand-focus-ring);
  outline-offset: 2px;
  box-shadow: var(--focus-shadow);
}

.pricing-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pricing-card {
  position: relative;
  padding: 2rem 2.25rem 2.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.85rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 100%;
}

.pricing-card__header h3 {
  margin: 0;
  font: 600 1.35rem var(--font-ui);
  color: var(--text);
}

.pricing-card__subtitle {
  margin: 0.35rem 0 0;
  font: 500 0.95rem var(--font-ui);
  color: var(--secondary);
}

.pricing-card__price {
  margin: 1rem 0 0;
  font: 700 2rem var(--font-ui);
  color: var(--brand-primary);
}

.pricing-card__disclaimer {
  margin: 0.35rem 0 0;
  font: 500 0.85rem var(--font-ui);
  color: color-mix(in srgb, var(--secondary) 80%, transparent);
}

.pricing-features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.pricing-features li {
  position: relative;
  padding-left: 1.5rem;
  font: 500 0.95rem var(--font-ui);
  color: var(--secondary);
}

.pricing-features li::before {
  content: '';
  position: absolute;
  top: 0.55rem;
  left: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-primary) 70%, white 30%);
}

.pricing-card--featured {
  border-color: var(--brand-primary);
  box-shadow: var(--state-elevated);
}

.pricing-card--featured .pricing-card__price {
  color: var(--brand-primary-active);
}

.pricing-card__guarantee {
  margin: 0.25rem 0 0;
  text-align: center;
  font: 500 0.9rem var(--font-ui);
  color: color-mix(in srgb, var(--secondary) 85%, transparent);
}

.pricing-badge {
  position: absolute;
  top: -0.85rem;
  right: 1.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font: 600 0.75rem var(--font-ui);
  letter-spacing: 0.05em;
  background: var(--brand-primary);
  color: var(--brand-primary-contrast);
  text-transform: uppercase;
}

.pricing-cta {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.6rem;
  font: 600 1rem var(--font-ui);
  text-decoration: none;
  border: 1.5px solid color-mix(in srgb, var(--brand-primary) 35%, transparent);
  color: var(--brand-primary);
  background: transparent;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.pricing-cta:hover,
.pricing-cta:focus {
  background: color-mix(in srgb, var(--brand-primary) 18%, transparent);
  transform: translateY(-1px);
}

.pricing-cta:focus {
  outline: 2px solid var(--brand-focus-ring);
  outline-offset: 3px;
  box-shadow: var(--focus-shadow);
}

.pricing-cta--primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-primary-contrast);
}

.pricing-cta--primary:hover,
.pricing-cta--primary:focus {
  background: var(--brand-primary-hover);
  color: var(--brand-primary-contrast);
}

.pricing-cta--outline {
  border-color: color-mix(in srgb, var(--brand-primary) 45%, transparent);
}

.pricing-table-wrap {
  overflow-x: auto;
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.pricing-table caption {
  text-align: left;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.pricing-table th,
.pricing-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--secondary) 18%, transparent);
  text-align: center;
}

.pricing-table th:first-child,
.pricing-table td:first-child {
  text-align: left;
}

.pricing-table thead th {
  font: 600 0.95rem var(--font-ui);
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-table tbody th {
  font: 600 0.95rem var(--font-ui);
  color: var(--text);
}

.pricing-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 1.25rem;
  height: 1.25rem;
}

.icon-check::before {
  content: '';
  width: 0.45rem;
  height: 0.85rem;
  border-left: 2px solid var(--brand-primary);
  border-bottom: 2px solid var(--brand-primary);
  transform: rotate(-45deg);
  margin-top: -0.1rem;
}

.icon-dash::before {
  content: '';
  width: 0.8rem;
  height: 2px;
  background: color-mix(in srgb, var(--secondary) 70%, transparent);
}

.pricing-faq {
  padding: 3rem 0;
  background: rgba(255, 255, 255, 0.01);
}

.pricing-faq__list {
  margin: 0 auto;
  padding: 0;
  max-width: 720px;
  display: grid;
  gap: 1.5rem;
}

.pricing-faq__item {
  display: grid;
  gap: 0.5rem;
}

.pricing-faq__item dt {
  font: 600 1.05rem var(--font-ui);
  color: var(--text);
}

.pricing-faq__item dd {
  margin: 0;
  font: 500 0.95rem var(--font-ui);
  color: var(--secondary);
}

.pricing-help {
  padding: 3rem 0 0;
}

.pricing-help .pricing-container {
  max-width: 640px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.85rem;
  box-shadow: var(--card-shadow);
  padding: 2.5rem 2rem;
  text-align: center;
}

.pricing-help p {
  margin: 0 0 1.5rem;
  font: 500 1rem var(--font-ui);
  color: var(--secondary);
}

@media (max-width: 960px) {
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pricing-table {
    min-width: 520px;
  }
}

@media (max-width: 720px) {
  .pricing-main {
    padding: 2rem 1rem 3rem;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .pricing-card {
    padding: 1.75rem 1.75rem 2rem;
  }
  .pricing-billing {
    flex-direction: column;
    gap: 0.4rem;
  }
  .pricing-badge {
    right: 1.5rem;
  }
  .pricing-hero h1 {
    font-size: 2rem;
  }
  .pricing-subhead {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .pricing-table {
    min-width: 420px;
  }
  .pricing-card__price {
    font-size: 1.75rem;
  }
  .pricing-billing {
    width: 100%;
  }
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--secondary);
  cursor: pointer;
  line-height: 1;
}

.modal-close:focus-visible {
  outline: 2px solid var(--brand-focus-ring);
  outline-offset: 2px;
  box-shadow: var(--focus-shadow);
  border-radius: 999px;
}

.enterprise-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.enterprise-modal p {
  margin: 0;
  color: var(--secondary);
  font: 500 0.95rem var(--font-ui);
}

#enterpriseForm {
  display: grid;
  gap: 0.75rem;
}

#enterpriseForm label {
  font: 600 0.9rem var(--font-ui);
  color: var(--text);
}

#enterpriseForm input,
#enterpriseForm textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

#enterpriseForm input:focus-visible,
#enterpriseForm textarea:focus-visible {
  outline: 2px solid var(--brand-focus-ring);
  outline-offset: 2px;
  border-color: var(--focus-ring);
  box-shadow: var(--focus-shadow);
}

#enterpriseForm textarea {
  resize: vertical;
  min-height: 140px;
}

.modal-footer-note {
  margin: 0.5rem 0 0;
  font: 500 0.9rem var(--font-ui);
  color: var(--secondary);
}

.modal-footer-note a {
  color: var(--brand-primary);
  text-decoration: none;
}

.modal-footer-note a:hover,
.modal-footer-note a:focus {
  text-decoration: underline;
}

.usage {
  width: 100%;
  max-width: 640px;
  margin: 2px auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text);
}
.usage.hidden { display: none; }

.usage-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  opacity: 0.9;
}

.usage-bar {
  height: 10px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
}

#usage-fill {
  height: 10px;
  width: 0%;
  background: var(--accent);
  border-radius: 6px 0 0 6px;
  transition: width 0.25s ease-in-out;
}

@media (prefers-color-scheme: dark) {
  .usage { color: var(--text); }
  .usage-bar { background: var(--surface-2); }
  #usage-fill { background: var(--accent); }
}
:where([hidden]) {
  display: none !important;
}

/* Homepage layout */
html[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 16px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--dur-sm) var(--ease-out);
  z-index: 100;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 16px;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  background: radial-gradient(120% 130% at 30% -10%, rgba(46, 107, 255, 0.35) 0%, rgba(11, 18, 32, 0) 42%),
    radial-gradient(140% 100% at 80% -20%, rgba(18, 34, 58, 0.6) 0%, rgba(11, 18, 32, 0.1) 55%),
    var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -30% -50% auto;
  height: 500px;
  background: radial-gradient(60% 60% at 50% 40%, rgba(46, 107, 255, 0.35) 0%, rgba(46, 107, 255, 0) 70%);
  filter: blur(40px);
  animation: heroDrift 30s linear infinite;
  z-index: -1;
}

@keyframes heroDrift {
  0% {
    transform: translate3d(-10%, -10%, 0) scale(1);
  }
  50% {
    transform: translate3d(8%, 12%, 0) scale(1.05);
  }
  100% {
    transform: translate3d(-10%, -10%, 0) scale(1);
  }
}

.site-nav {
  position: sticky;
  top: 0;
  width: 100%;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  z-index: 50;
}

.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px clamp(16px, 4vw, 32px);
  display: flex;
  align-items: center;
  gap: clamp(18px, 5vw, 42px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  letter-spacing: 0.02em;
}

.logo-mark {
  display: inline-flex;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 65%, black) 100%);
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--bg);
}

.logo-type {
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--dur-sm) var(--ease-out);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.ghost-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.ghost-link:hover,
.ghost-link:focus-visible {
  color: var(--text);
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform var(--dur-sm) var(--ease-out), box-shadow var(--dur-sm) var(--ease-out), background var(--dur-sm) var(--ease-out), color var(--dur-sm) var(--ease-out);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.secondary-btn {
  padding: 10px 18px;
  border: 1px solid color-mix(in srgb, var(--text-muted) 40%, transparent);
  color: var(--text);
  background: transparent;
}

.secondary-btn:hover,
.secondary-btn:focus-visible {
  border-color: var(--accent-300);
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}

.ghost-btn {
  padding: 8px 18px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
}

.ghost-btn:hover,
.ghost-btn:focus-visible {
  border-color: color-mix(in srgb, var(--text-muted) 40%, transparent);
  color: var(--text);
}

.hero {
  position: relative;
  padding: clamp(60px, 12vw, 120px) clamp(16px, 6vw, 72px) clamp(48px, 8vw, 96px);
  display: flex;
  justify-content: center;
}

.hero-inner {
  max-width: 1200px;
  width: 100%;
  display: grid;
  gap: 48px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
}

.hero-copy {
  max-width: 560px;
}

.hero-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.8rem, 5vw, 3.6rem);
  line-height: 1.05;
  margin-bottom: 20px;
  white-space: nowrap;
}

.hero-subhead {
  font-size: 1.12rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.proof-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.proof-chips li {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  background: color-mix(in srgb, var(--surface-2) 40%, transparent);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.directory,
.reel,
.demo {
  padding: clamp(48px, 8vw, 96px) clamp(16px, 6vw, 72px);
}

.section-heading {
  max-width: 760px;
  margin: 0 auto 40px;
  text-align: center;
}

.section-heading h2 {
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  margin-bottom: 12px;
}

.section-subhead {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  border-radius: 16px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--surface-1) 85%, transparent) 0%, color-mix(in srgb, var(--surface-2) 65%, transparent) 100%);
  border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  text-decoration: none;
  color: var(--text);
  transition: transform var(--dur-sm) var(--ease-out), box-shadow var(--dur-sm) var(--ease-out), border-color var(--dur-sm) var(--ease-out);
  transform: translate3d(0, 0, 0);
  will-change: transform, box-shadow, border-color;
}

.tile[data-animate] {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
}

.tile.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.tile:hover,
.tile:focus-visible {
  transform: translate3d(0, -6px, 0);
  border-color: color-mix(in srgb, var(--accent-300) 70%, var(--border));
  box-shadow: var(--shadow);
}

/* Respect reduced motion: disable transforms, keep focus indicators */
@media (prefers-reduced-motion: reduce) {
  .tile {
    will-change: auto;
  }

  .tile:hover,
  .tile:focus-visible {
    transform: none;
  }
}

.tile-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-300);
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}

.tile-icon img {
  width: 30px;
  height: 30px;
  color: inherit;
}

.tile-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.tile-copy {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.reel-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  max-width: 1100px;
  margin: 0 auto;
}

.story {
  position: relative;
  padding: 32px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  background: linear-gradient(150deg, color-mix(in srgb, var(--surface-1) 80%, transparent) 0%, color-mix(in srgb, var(--surface-2) 65%, transparent) 100%);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  overflow: hidden;
  transition: transform var(--dur-sm) var(--ease-out), box-shadow var(--dur-sm) var(--ease-out);
  opacity: 0;
  transform: translateY(12px);
}

.story h3 {
  margin-top: 0;
  font-size: 1.25rem;
}

.story p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.story-visual {
  height: 120px;
  display: grid;
  place-items: center;
}

.story[data-story="large-files"] .chart-line {
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  transition: stroke-dashoffset var(--dur-md) var(--ease-out);
}

.story[data-story="privacy"] .privacy-icon {
  position: relative;
  width: 72px;
  height: 72px;
}

.story[data-story="privacy"] .shield {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}

.story[data-story="privacy"] .check {
  position: absolute;
  inset: 20px;
  border: 3px solid var(--accent);
  border-radius: 16px;
  transform-origin: center;
  opacity: 0;
}

.story[data-story="evidence"] .export-icons {
  display: flex;
  gap: 12px;
}

.story[data-story="evidence"] .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.9rem;
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
  color: var(--text-muted);
  transform: translateX(-6px);
  transition: transform var(--dur-md) var(--ease-out);
}

.story[data-story="evidence"] .icon.pdf {
  color: var(--accent);
}

.story.is-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  opacity: 1;
}

.story.is-visible[data-story="large-files"] .chart-line {
  stroke-dashoffset: 0;
}

.story.is-visible[data-story="privacy"] .check {
  opacity: 1;
  animation: privacyPulse var(--dur-md) var(--ease-out) forwards;
}

@keyframes privacyPulse {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  60% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.story.is-visible[data-story="evidence"] .icon {
  transform: translateX(0);
}

.demo {
  position: relative;
  background: linear-gradient(170deg, color-mix(in srgb, var(--surface-1) 85%, transparent) 0%, color-mix(in srgb, var(--surface-2) 75%, transparent) 100%);
  border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}

.demo-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.demo-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
}

.demo-step {
  display: grid;
  gap: 12px;
}

.demo-step .label {
  font-weight: 600;
  color: var(--text-muted);
}

.demo-step .bar {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  overflow: hidden;
  position: relative;
}

.demo-step.is-active .bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent-300) 0%, var(--accent) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-sm) var(--ease-out);
}

.demo-step.is-complete .bar::after {
  transform: scaleX(1);
}

.demo-status {
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.site-footer {
  padding: clamp(32px, 6vw, 64px) clamp(16px, 6vw, 72px) clamp(48px, 8vw, 80px);
  background: color-mix(in srgb, var(--surface-1) 90%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  position: relative;
  z-index: 1; /* Low z-index so dropdowns can appear above footer */
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
}

.footer-heading {
  display: block;
  font-weight: 600;
  margin-bottom: 12px;
}

.footer-column a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 8px;
  transition: color var(--dur-sm) var(--ease-out);
}

.footer-column a:hover,
.footer-column a:focus-visible {
  color: var(--text);
}

.footer-copy {
  color: var(--text-muted);
  margin: 0;
}

.footer-bottom {
  grid-column: 1 / -1;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid color-mix(in srgb, var(--border) 30%, transparent);
  text-align: center;
}

.footer-copyright {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Compact centered footer (used on all pages) */
.site-footer--home {
  margin-top: 0;
  padding: 24px clamp(16px, 4vw, 48px) 16px;
  background: color-mix(in srgb, var(--surface-1) 45%, var(--bg));
  border-top: 1px solid color-mix(in srgb, var(--border) 30%, transparent);
}

.site-footer--home .footer-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.site-footer--home .footer-heading {
  display: none;
}

.site-footer--home .footer-column {
  display: flex;
  gap: 24px;
  justify-content: center;
}

.site-footer--home .footer-column a {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 150ms ease;
}

.site-footer--home .footer-column a:hover,
.site-footer--home .footer-column a:focus-visible {
  color: var(--text);
}

.site-footer--home .footer-bottom {
  max-width: 480px;
  margin: 14px auto 0;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--border) 18%, transparent);
}

.site-footer--home .footer-copyright {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.5;
  letter-spacing: 0.01em;
  text-align: center;
}

@media (max-width: 480px) {
  .site-footer--home {
    padding: 20px 16px 12px;
  }

  .site-footer--home .footer-column {
    gap: 16px;
  }

  .site-footer--home .footer-bottom {
    margin-top: 12px;
    padding-top: 10px;
  }
}

.site-footer--app {
  padding: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--card-border);
}

.site-footer--app .site-footer__inner {
  padding: 1rem 2.5rem;
  max-width: none;
  min-height: calc(var(--shell-row-min-height) * 0.85);
  font: 600 0.95rem var(--font-ui);
}

/* ===== Scroll Density Redesign ===== */

/* Compact Hero */
.hero--compact {
  padding: clamp(40px, 8vw, 72px) clamp(16px, 6vw, 72px) clamp(24px, 4vw, 40px);
}

.hero--compact .hero-inner {
  grid-template-columns: 1fr;
  gap: 0;
  text-align: center;
  justify-items: center;
}

.hero--compact .hero-copy {
  max-width: 680px;
}

.hero--compact .hero-ctas {
  justify-content: center;
  margin-bottom: 0;
}

/* Hero Kicker (brand lead-in) */
.hero-kicker {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  margin: 0 0 12px;
}

/* Proof Bar */
.proof-bar {
  padding: 16px clamp(16px, 6vw, 72px);
  background: color-mix(in srgb, var(--surface-1) 60%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
}

.proof-bar-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.proof-stat {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.proof-stat strong {
  color: var(--text);
  font-weight: 600;
}

.proof-divider {
  width: 1px;
  height: 16px;
  background: color-mix(in srgb, var(--border) 60%, transparent);
}

/* Value Props Section */
.value-props {
  padding: clamp(32px, 6vw, 56px) clamp(16px, 6vw, 72px);
}

.value-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.value-card {
  padding: 24px;
  background: color-mix(in srgb, var(--surface-2) 50%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  border-radius: 12px;
  text-align: center;
  transition: border-color var(--dur-sm) var(--ease-out), background var(--dur-sm) var(--ease-out);
}

.value-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

.value-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}

.value-icon svg {
  width: 24px;
  height: 24px;
}

.value-card h3 {
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.value-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* How It Works Section */
.how-it-works {
  padding: clamp(32px, 6vw, 56px) clamp(16px, 6vw, 72px);
  background: color-mix(in srgb, var(--surface-1) 40%, transparent);
}

.section-heading--compact {
  margin-bottom: 24px;
}

.section-heading--compact h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
}

.steps-grid {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

.step {
  flex: 1;
  max-width: 260px;
  text-align: center;
  padding: 0 16px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.step-content h3 {
  font-size: 1rem;
  margin: 0 0 8px;
}

.step-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.step-connector {
  flex: 0 0 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent));
  margin-top: 20px;
  border-radius: 1px;
}

/* Compact Directory */
.directory--compact {
  padding: clamp(24px, 5vw, 48px) clamp(16px, 6vw, 72px);
}

.tile-grid--compact {
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.tile--compact {
  padding: 20px;
  gap: 10px;
}

.tile--compact .tile-icon {
  width: 32px;
  height: 32px;
}

.tile--compact .tile-icon img {
  width: 20px;
  height: 20px;
}

.tile--compact .tile-title {
  font-size: 0.95rem;
}

.tile--compact .tile-copy {
  font-size: 0.8rem;
  line-height: 1.4;
}

/* CTA Section */
.cta-section {
  padding: clamp(40px, 8vw, 72px) clamp(16px, 6vw, 72px);
  text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent);
}

.cta-inner {
  max-width: 600px;
  margin: 0 auto;
}

.cta-section h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0 0 12px;
}

.cta-subhead {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.primary-btn--large {
  padding: 14px 32px;
  font-size: 1.05rem;
}

/* ===== One-Viewport Sections (Homepage) ===== */
/* Each major section fills ~100vh for clean visual separation */
/* Natural scrolling only - no scroll-snapping */

/* Hero + Proof Bar fill first viewport together */
.hero--compact {
  min-height: calc(100vh - 70px); /* Account for sticky header height */
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 32px; /* Space above fold so proof bar isn't cut off */
}

.proof-bar {
  /* Proof bar sits at bottom edge of hero viewport */
  margin-top: auto;
}

/* Value Props Section - fills viewport */
.value-props {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.value-props .value-grid {
  width: 100%;
  flex-shrink: 0;
}

/* How It Works Section - fills viewport */
.how-it-works {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.how-it-works .section-heading--compact,
.how-it-works .steps-grid {
  width: 100%;
  flex-shrink: 0;
}

/* Directory Section - fills viewport */
.directory--compact {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.directory--compact .section-heading--compact,
.directory--compact .tile-grid--compact {
  width: 100%;
  flex-shrink: 0;
}

/* CTA Section - fills viewport */
.cta-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

/* Responsive: allow sections to grow naturally on smaller screens */
@media (max-width: 768px) {
  .hero--compact,
  .value-props,
  .how-it-works,
  .directory--compact,
  .cta-section {
    min-height: auto; /* Content may exceed viewport on mobile - that's OK */
  }

  /* But still provide generous spacing */
  .value-props,
  .how-it-works,
  .directory--compact,
  .cta-section {
    padding-top: clamp(48px, 10vw, 80px);
    padding-bottom: clamp(48px, 10vw, 80px);
  }
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive adjustments for new sections */
@media (max-width: 768px) {
  .proof-bar-inner {
    gap: 16px;
  }

  .proof-divider {
    display: none;
  }

  .proof-stat {
    font-size: 0.85rem;
  }

  .value-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .value-card {
    padding: 20px;
  }

  .steps-grid {
    flex-direction: column;
    gap: 24px;
  }

  .step {
    max-width: none;
    display: flex;
    align-items: flex-start;
    text-align: left;
    gap: 16px;
    padding: 0;
  }

  .step-number {
    flex-shrink: 0;
    margin-bottom: 0;
  }

  .step-connector {
    display: none;
  }

  .tile-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
  }

  .tile--compact {
    padding: 16px;
  }
}

@media (max-width: 960px) {
  .nav-inner {
    flex-wrap: wrap;
    gap: 16px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 6px;
    gap: 14px;
  }

  .push-end {
    order: 2;
    margin-left: 0;
  }

  .hero {
    padding-top: clamp(48px, 12vw, 80px);
  }

  .demo-heading {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .tile-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .reel-grid {
    grid-template-columns: 1fr;
  }
}

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

  .story[data-story="large-files"] .chart-line {
    transition: none;
  }

  .story[data-story="evidence"] .icon {
    transition: none;
  }
}

/* Custom Tooltip */
.custom-tooltip {
  position: fixed;
  z-index: 10000;
  padding: 8px 12px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-md);
  font-weight: var(--fw-semibold);
  line-height: 1.35;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: pre-wrap;
  max-width: 300px;
  text-align: center;
}

.custom-tooltip.visible {
  opacity: 1;
}

/* Settings Gear Integration */
.header-icon-cluster {
  display: flex;
  gap: 0.5rem; /* Re-introduced gap */
  align-items: center;
  position: relative;
}

/* Gear stays neutral (no brand tint), but has clear hover/focus affordance */
.header-icon--settings {
  /* Override yellow text/border from base class - keep neutral */
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.header-icon--settings svg {
  stroke: var(--text-muted);
  transform: scale(1.8);
  transition: stroke 120ms ease, transform 0.5s ease;
}

.header-icon--settings:hover:not(.is-selected),
.header-icon--settings:focus-visible:not(.is-selected) {
  /* Keep neutral color - metallic border applied below */
  color: var(--text-muted);
}

.header-icon--settings:hover:not(.is-selected) svg {
  stroke: var(--text-muted);
  transform: scale(1.8) rotate(90deg); /* Rotate on hover */
}

.header-icon--settings:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--text) 20%, transparent);
}

.header-icon--settings:active:not(.is-selected) {
  /* Darker grey for active state */
  color: color-mix(in oklab, var(--text-muted) 70%, var(--bg));
  border-color: color-mix(in oklab, var(--text-muted) 70%, var(--bg));
}

.header-icon--settings:active:not(.is-selected) svg {
  stroke: color-mix(in oklab, var(--text-muted) 70%, var(--bg));
}

/* when we add is-selected from JS */
.header-icon--settings.is-selected {
  color: var(--text-muted);
  /* border-color and box-shadow applied below with metallic colors */
  transform: scale(0.98);
}

.header-icon--settings.is-selected svg {
  /* Keep the hover rotation instead of snapping back on click */
  stroke: var(--text-muted);
  transform: scale(1.8) rotate(90deg);
}

/* Refactored inline styles for CSP compliance */
.bolt-icon {
  transform: scale(1.8) rotate(0deg);
}

/* Metallic/Luster icon enhancements */
/* Bolt icon - Gold luster borders on hover/active */
.header-icon--lightning:hover,
.header-icon--lightning:focus-visible {
  border-color: #FFB800;
}

.header-icon--lightning.active {
  border-color: #FFD36A;
  box-shadow: 0 0 0 2px color-mix(in srgb, #FFB800 35%, transparent);
}

.header-icon--lightning:hover svg path[stroke],
.header-icon--lightning:focus-visible svg path[stroke] {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 0.85;
}

/* Gear icon - Metallic silver borders on hover/selected */
.header-icon--settings:hover:not(.is-selected),
.header-icon--settings:focus-visible:not(.is-selected) {
  border-color: #9AA6B6;
}

.header-icon--settings.is-selected {
  border-color: #D7DEE8;
  box-shadow: 0 0 0 2px color-mix(in srgb, #9AA6B6 35%, transparent);
}

.header-icon--settings:hover:not(.is-selected) svg path[stroke],
.header-icon--settings:focus-visible:not(.is-selected) svg path[stroke] {
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 0.85;
}

/* Badge styles for validation summary */
.badge-success { background-color: #16a34a; color: #ffffff; }
.badge-mismatch { background-color: #ca8a04; color: #1f2937; }
.badge-config-error { background-color: #be123c; color: #ffffff; }
.badge-runtime-error { background-color: #b91c1c; color: #ffffff; }

/* ============================================================================
   Data Quality UI Components (Phase 1)
   ============================================================================ */

/* DQ Badges */
.dq-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  font: 600 0.75rem/1.2 var(--font-ui, system-ui, sans-serif);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dq-badge--compact {
  padding: 2px 6px;
  font-size: 0.65rem;
}

.dq-badge--ok {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.dq-badge--warn {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.dq-badge--error {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* DQ Summary Container */
.dq-summary {
  padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
  background: var(--surface-1, #1a1a2e);
  border-radius: 10px;
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.08));
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.dq-summary__header {
  margin-bottom: var(--space-2, 0.5rem);
  flex-shrink: 0;
}

.dq-summary__title {
  font: 600 0.95rem/1.3 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
  margin: 0 0 2px;
}

.dq-summary__subtitle {
  font: 400 0.8rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
  margin: 0;
}

.dq-summary__issues {
  color: #fbbf24;
}

/* DQ Column Cards Grid - This is the scrollable list */
.dq-column-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: var(--space-1, 0.25rem); /* Space for scrollbar */
}

.dq-card {
  padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
  background: var(--surface-2, #252538);
  border-radius: 8px;
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.06));
  transition: border-color 0.15s ease;
  flex-shrink: 0;
}

.dq-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.dq-card--warn {
  border-left: 3px solid #fbbf24;
}

.dq-card--error {
  border-left: 3px solid #ef4444;
}

.dq-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  margin-bottom: 6px;
}

.dq-card__name {
  font: 500 0.9rem/1.3 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.dq-card__reasons {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}

.dq-card__reasons li {
  font: 400 0.8rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
  padding-left: 12px;
  position: relative;
}

.dq-card__reasons li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--secondary, #9ca3af);
}

.dq-card__more {
  font-style: italic;
  opacity: 0.7;
}

.dq-card__details-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: var(--text, #e0e0e0);
  font: 500 0.75rem/1.2 var(--font-ui, system-ui, sans-serif);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dq-card__details-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
}

.dq-card__details-btn:focus-visible {
  outline: 2px solid var(--accent, #60a5fa);
  outline-offset: 2px;
}

/* DQ Details Panel - Full page overlay */
.dq-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: var(--surface-1, #1a1a2e);
  z-index: 10000;
  overflow-y: auto;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.dq-panel[hidden] {
  display: block !important;
  opacity: 0;
  pointer-events: none;
}

.dq-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4, 1rem);
  border-bottom: 1px solid var(--card-border, rgba(255, 255, 255, 0.08));
  position: sticky;
  top: 0;
  background: var(--surface-1, #1a1a2e);
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.dq-panel__title {
  font: 600 1rem/1.3 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
  margin: 0;
}

.dq-panel__column-name {
  color: var(--accent, #60a5fa);
}

.dq-panel__back {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: var(--secondary, #9ca3af);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dq-panel__back:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text, #e0e0e0);
  border-color: rgba(255, 255, 255, 0.3);
}

.dq-panel__back:focus-visible {
  outline: 2px solid var(--accent, #60a5fa);
  outline-offset: 2px;
}

.dq-panel__body {
  padding: var(--space-4, 1rem);
  max-width: 800px;
  margin: 0 auto;
}

/* DQ Editor-lite */
.dq-section--editor {
  border-bottom: 1px solid var(--card-border, rgba(255, 255, 255, 0.06));
}

.dq-editor {
  display: grid;
  gap: 16px;
}

@media (min-width: 860px) {
  .dq-editor {
    grid-template-columns: 1fr 1fr;
  }
}

.dq-editor__block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.06));
  border-radius: 8px;
  padding: 12px;
}

.dq-steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dq-steps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.dq-steps-header__meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dq-steps-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.dq-steps-search {
  flex: 1 1 160px;
  min-width: 160px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--secondary) 35%, transparent);
  background: var(--surface);
  color: var(--text);
  font: 400 0.75rem/1.2 var(--font-ui, system-ui, sans-serif);
}

.dq-steps-search::placeholder {
  color: color-mix(in srgb, var(--secondary) 70%, transparent);
}

.dq-steps-filter {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--secondary) 35%, transparent);
  background: var(--surface);
  color: var(--text);
  font: 500 0.7rem/1.2 var(--font-ui, system-ui, sans-serif);
}

.dq-steps-search:focus,
.dq-steps-search:focus-visible,
.dq-steps-filter:focus,
.dq-steps-filter:focus-visible,
.dq-steps-clear:focus,
.dq-steps-clear:focus-visible {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: var(--focus-shadow);
}

.dq-steps-summary {
  font: 400 0.7rem/1.2 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
  margin-bottom: 8px;
}

.dq-steps-count {
  font: 500 0.7rem/1.2 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
}

.dq-steps-clear {
  padding: 4px 8px;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--secondary) 35%, transparent);
  border-radius: 4px;
  color: var(--secondary);
  font: 500 0.7rem/1.2 var(--font-ui, system-ui, sans-serif);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dq-steps-clear:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--text, #e0e0e0);
}

.dq-steps-clear:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.dq-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dq-step-group__item {
  list-style: none;
}

.dq-step-group {
  background: transparent;
  border-radius: 6px;
}

.dq-step-group__summary {
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  font: 500 0.8rem/1.3 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
}

.dq-step-group__summary::marker,
.dq-step-group__summary::-webkit-details-marker {
  color: var(--secondary, #9ca3af);
}

.dq-step-group__list {
  list-style: none;
  padding: 8px 0 0 16px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dq-steps-empty {
  font: 400 0.8rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
  font-style: italic;
}

.dq-step {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
}

.dq-step--grouped {
  background: rgba(0, 0, 0, 0.12);
}

.dq-step--replaced {
  background: color-mix(in srgb, var(--secondary) 12%, transparent);
  border: 1px dashed color-mix(in srgb, var(--secondary) 35%, transparent);
}

.dq-step__main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.dq-step__label {
  font: 500 0.85rem/1.3 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
  word-break: break-word;
}

.dq-step__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.dq-step__meta-item {
  font: 400 0.7rem/1.2 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
}

.dq-step__details-toggle {
  padding: 0;
  border: none;
  background: transparent;
  font: 600 0.65rem/1.2 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.dq-step__details-toggle:hover {
  color: var(--text, #e0e0e0);
}

.dq-step__details-toggle:focus,
.dq-step__details-toggle:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: var(--focus-shadow);
  color: var(--text, #e0e0e0);
}

.dq-step__details {
  font: 400 0.7rem/1.2 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
}

.dq-step__meta-item--muted {
  color: rgba(156, 163, 175, 0.6);
}

.dq-risk-badge {
  font: 600 0.6rem/1.1 var(--font-ui, system-ui, sans-serif);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.dq-risk-badge--safe {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.35);
}

.dq-risk-badge--lossy {
  color: #fde68a;
  background: rgba(234, 179, 8, 0.18);
  border-color: rgba(234, 179, 8, 0.35);
}

.dq-risk-badge--destructive {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
}

.dq-step__remove {
  padding: 4px 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  color: var(--secondary, #9ca3af);
  font: 500 0.7rem/1.2 var(--font-ui, system-ui, sans-serif);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dq-step__remove:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--text, #e0e0e0);
}

.dq-steps-replaced {
  margin-top: 8px;
}

.dq-steps-replaced__details {
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 8px;
}

.dq-steps-replaced__summary {
  cursor: pointer;
  font: 500 0.7rem/1.2 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
}

.dq-steps-replaced__summary::marker,
.dq-steps-replaced__summary::-webkit-details-marker {
  color: var(--secondary, #9ca3af);
}

.dq-steps-replaced__empty {
  margin-top: 8px;
  font: 400 0.7rem/1.2 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
  font-style: italic;
}

.dq-steps-replaced__group {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dq-steps-replaced__group-title {
  font: 600 0.7rem/1.2 var(--font-ui, system-ui, sans-serif);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--secondary) 75%, transparent);
}

.dq-steps-replaced__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dq-preview-table {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 480px;
}

.dq-preview-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.dq-preview-controls__row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dq-preview-controls__label {
  font: 600 0.65rem/1.2 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dq-preview {
  width: 100%;
  border-collapse: collapse;
  font: 400 0.75rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
}

.dq-preview th,
.dq-preview td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--card-border, rgba(255, 255, 255, 0.08));
  white-space: nowrap;
  text-align: left;
}

.dq-preview__cell--active {
  background: rgba(96, 165, 250, 0.18);
}

/* Keep this after --active so changed cells take precedence in inspect/compare views. */
.dq-preview__cell--changed {
  background: rgba(234, 179, 8, 0.2);
}

.dq-preview-note {
  margin-top: 6px;
  font: 400 0.75rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
}

/* Manually edited cell: purple tint + dot indicator */
.dq-preview__cell--manual-edit {
  background: rgba(168, 85, 247, 0.2);
  position: relative;
}

.dq-preview__cell--manual-edit::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.7);
}

/* Hover hint for editable cells */
.dq-preview td:hover {
  outline: 1px solid rgba(255, 255, 255, 0.15);
  cursor: default;
}

/* Inline input for cell editing */
.dq-preview__cell-input {
  width: 100%;
  min-width: 60px;
  padding: 2px 4px;
  margin: -3px -4px;
  border: 1px solid var(--accent, #60a5fa);
  border-radius: 3px;
  background: var(--surface-1, #1a1a2e);
  color: var(--text, #e0e0e0);
  font: inherit;
  outline: none;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3);
}

/* Manual edits summary in steps list */
.dq-manual-edits {
  margin-top: 12px;
  padding: 8px;
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 6px;
  background: rgba(168, 85, 247, 0.06);
}

.dq-manual-edits__summary {
  font: 600 0.75rem/1.3 var(--font-ui, system-ui, sans-serif);
  color: rgba(168, 85, 247, 0.9);
  cursor: pointer;
}

.dq-manual-edits[open] > .dq-manual-edits__summary {
  margin-bottom: 8px;
}

.dq-manual-edits__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dq-manual-edit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  font: 400 0.72rem/1.3 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
}

.dq-manual-edit__info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.dq-manual-edit__column {
  font-weight: 600;
  color: var(--accent, #60a5fa);
  white-space: nowrap;
}

.dq-manual-edit__row {
  color: var(--secondary, #9ca3af);
  white-space: nowrap;
}

.dq-manual-edit__value {
  color: var(--secondary, #9ca3af);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dq-manual-edit__undo,
.dq-manual-edits__clear {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: transparent;
  color: rgba(239, 68, 68, 0.8);
  font: 500 0.68rem/1 var(--font-ui, system-ui, sans-serif);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dq-manual-edit__undo:hover,
.dq-manual-edits__clear:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.5);
}

.dq-manual-edits__clear {
  display: block;
  margin-top: 8px;
  font-size: 0.72rem;
}

.dq-fix-actions {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.dq-fix-actions__title {
  font: 600 0.7rem/1.2 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.dq-fix-actions__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dq-fix-action {
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(96, 165, 250, 0.18);
  color: var(--text, #e0e0e0);
  font: 500 0.75rem/1.2 var(--font-ui, system-ui, sans-serif);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dq-fix-action:hover {
  background: rgba(96, 165, 250, 0.28);
}

.dq-fix-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background: rgba(96, 165, 250, 0.08);
  border-color: rgba(96, 165, 250, 0.2);
}

.dq-fix-action__description {
  font: 400 0.72rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
}

.dq-fix-action__status {
  font: 400 0.7rem/1.3 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
}

.dq-lossy-confirm {
  margin: 6px 0 2px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.30);
}

.dq-lossy-confirm__msg {
  display: block;
  font: 400 0.72rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
  margin-bottom: 6px;
}

.dq-lossy-confirm__actions {
  display: flex;
  gap: 6px;
}

.dq-lossy-confirm__yes {
  padding: 4px 10px;
  border-radius: 4px;
  font: 500 0.72rem/1.3 var(--font-ui, system-ui, sans-serif);
  cursor: pointer;
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  transition: all 0.15s ease;
}

.dq-lossy-confirm__yes:hover {
  background: rgba(239, 68, 68, 0.35);
}

.dq-lossy-confirm__yes:focus,
.dq-lossy-confirm__yes:focus-visible,
.dq-lossy-confirm__no:focus,
.dq-lossy-confirm__no:focus-visible {
  outline: none;
  box-shadow: var(--focus-shadow);
}

.dq-lossy-confirm__no {
  padding: 4px 10px;
  border-radius: 4px;
  font: 500 0.72rem/1.3 var(--font-ui, system-ui, sans-serif);
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--secondary, #9ca3af);
  transition: all 0.15s ease;
}

.dq-lossy-confirm__no:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--text, #e0e0e0);
}

.dq-export-note {
  margin-top: 6px;
  text-align: center;
  font: 400 0.75rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
}

/* DQ Sections */
.dq-section {
  margin-bottom: var(--space-4, 1rem);
  padding-bottom: var(--space-4, 1rem);
  border-bottom: 1px solid var(--card-border, rgba(255, 255, 255, 0.06));
}

.dq-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.dq-section__title {
  font: 600 0.85rem/1.3 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 8px;
}

.dq-section__title--major {
  font-size: 0.95rem;
  margin-bottom: 0;
  text-align: center;
}

/* Health header: title + badge inline */
.dq-health-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.dq-health-header .dq-section__title {
  margin-bottom: 0;
}

.dq-health-header .dq-section__badge {
  margin-bottom: 0;
}

.dq-section--details-header {
  margin-bottom: var(--space-3, 0.75rem);
  padding-bottom: 0;
  border-bottom: none;
}

.dq-section__badge {
  margin-bottom: 8px;
  text-align: center;
}

/* DQ Metrics */
.dq-metric {
  font: 400 0.9rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
  margin: 0 0 4px;
}

.dq-metric strong {
  color: #ffffff;
}

.dq-metric--secondary {
  font-size: 0.8rem;
  color: var(--secondary, #9ca3af);
}

.dq-metric__note {
  font-size: 0.75rem;
  color: var(--secondary, #9ca3af);
  font-style: italic;
}

/* DQ Reason List */
.dq-reasons-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dq-reasons-list__item {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr auto;
  grid-template-rows: auto;
  align-items: start;
  gap: 8px 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--card-border, rgba(255, 255, 255, 0.04));
}

.dq-reasons-list__item:last-child {
  border-bottom: none;
}

.dq-reasons-list__empty {
  font: 400 0.85rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
  font-style: italic;
  padding: 4px 0;
}

.dq-reason__text {
  grid-column: 1;
  font: 600 0.9rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
  align-self: center;
}

/* Compact two-sentence warning format */
.dq-reason__compact {
  grid-column: 2;
  font: 400 0.85rem/1.5 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
  align-self: center;
}

.dq-reason__issue,
.dq-reason__next-step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.dq-reason__issue:last-child,
.dq-reason__next-step:last-child {
  margin-bottom: 0;
}

.dq-reason__compact strong {
  color: var(--text, #e0e0e0);
  font-weight: 700;
  white-space: nowrap;
}

/* Collapsible details for power users */
.dq-reason__details {
  grid-column: 3;
  font: 400 0.78rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
  align-self: center;
}

.dq-reason__details-toggle {
  cursor: pointer;
  color: var(--accent, #60a5fa);
  font-weight: 500;
  padding: 4px 0;
  list-style: none;
}

.dq-reason__details-toggle::-webkit-details-marker {
  display: none;
}

.dq-reason__details-toggle::before {
  content: '▶ ';
  font-size: 0.7em;
  transition: transform 0.15s ease;
  display: inline-block;
}

.dq-reason__details[open] .dq-reason__details-toggle::before {
  transform: rotate(90deg);
}

.dq-reason__details-toggle:hover {
  text-decoration: underline;
}

.dq-reason__details-content {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border-left: 2px solid var(--accent, #60a5fa);
}

.dq-reason__details-content div {
  margin-bottom: 4px;
}

.dq-reason__details-content div:last-child {
  margin-bottom: 0;
}

.dq-reason__details-content strong {
  color: var(--text, #e0e0e0);
  font-weight: 600;
}

/* Legacy template styles (hidden by default, kept for backwards compatibility) */
.dq-reason__template {
  display: none;
  margin-top: 6px;
  font: 400 0.78rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
}

.dq-reason__template strong {
  color: var(--text, #e0e0e0);
  font-weight: 600;
}

.dq-reason__dismiss {
  grid-column: 3;
  padding: 4px 12px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: var(--secondary, #9ca3af);
  font: 500 0.75rem/1.2 var(--font-ui, system-ui, sans-serif);
  cursor: pointer;
  transition: all 0.15s ease;
  align-self: center;
}

.dq-reason__dismiss:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text, #e0e0e0);
}

/* ==========================================================================
   DQ Issue Cards (New Unified Layout)
   ========================================================================== */

.dq-issues-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dq-issues-empty {
  font: 400 0.9rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
  font-style: italic;
  text-align: center;
  padding: 16px 0;
}

.dq-issue {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.06));
  border-radius: 8px;
  padding: 16px;
}

.dq-issue__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.dq-issue__title {
  flex: 1;
  font: 600 0.95rem/1.3 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
}

.dq-issue__dismiss {
  flex: none;
  padding: 2px 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  color: var(--secondary, #9ca3af);
  font: 500 0.65rem/1.2 var(--font-ui, system-ui, sans-serif);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dq-issue__dismiss:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text, #e0e0e0);
}

.dq-issue__description {
  font: 400 0.85rem/1.5 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
  margin-bottom: 12px;
}

.dq-issue__what,
.dq-issue__next {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.dq-issue__what:last-child,
.dq-issue__next:last-child {
  margin-bottom: 0;
}

.dq-issue__description strong {
  color: var(--text, #e0e0e0);
  font-weight: 700;
  white-space: nowrap;
}

/* Issue inline data */
.dq-issue__data {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  padding: 12px;
  margin-top: 4px;
}

.dq-issue__stat {
  font: 500 0.85rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--accent, #60a5fa);
}

.dq-issue__examples {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.dq-issue__examples li {
  font: 400 0.8rem/1.5 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
  padding: 3px 0;
}

.dq-issue__examples code {
  font-family: var(--font-mono, 'Consolas', monospace);
  font-size: 0.8rem;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  color: var(--text, #e0e0e0);
}

.dq-issue__count {
  font-size: 0.75rem;
  color: var(--secondary, #9ca3af);
}

.dq-issue__more {
  font-style: italic;
  opacity: 0.7;
}

/* DQ Examples List */
.dq-examples-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.dq-examples-list li {
  font: 400 0.8rem/1.5 var(--font-ui, system-ui, sans-serif);
  color: var(--secondary, #9ca3af);
  padding: 4px 0;
}

.dq-examples-list code {
  font-family: var(--font-mono, 'Consolas', monospace);
  font-size: 0.8rem;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  color: var(--text, #e0e0e0);
}

.dq-examples-list__empty,
.dq-examples-list__more {
  font-style: italic;
  opacity: 0.7;
}

/* DQ Top-K List */
.dq-topk-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dq-topk-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  font: 400 0.85rem/1.5 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
  padding: 4px 0;
}

.dq-topk__count {
  font-size: 0.75rem;
  color: var(--secondary, #9ca3af);
}

.dq-topk-list__empty,
.dq-topk-list__more {
  font-style: italic;
  color: var(--secondary, #9ca3af);
}

/* Mobile responsiveness for DQ components */
@media (max-width: 480px) {
  .dq-panel {
    width: 100vw;
  }

  .dq-card__name {
    max-width: 150px;
  }

  .dq-column-cards {
    gap: var(--space-2, 0.5rem);
  }
}

/* ==========================================================================
   Data Quality Page Styles
   ========================================================================== */

/* DQ Page: Viewport canvas layout - mirroring .validate-shell */
.dq-page-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: var(--space-3);
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.dq-controls-pane {
  width: 100%;
  max-width: 720px;
  display: flex;
  justify-content: center;
  transform: translateX(calc(50% + var(--space-3) / 2));
  transition: transform 300ms ease;
  position: relative;
  z-index: 100; /* Higher than footer (z-index: 1) so dropdown inside can appear above footer */
}

/* The upload card should not stretch */
.dq-controls-pane > .app-card {
  width: 100%;
}

.dq-results-pane {
  display: none;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  width: 100%;
  max-width: 720px;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Split view: show results pane */
.dq-page-shell.dq-layout-split .dq-controls-pane {
  transform: translateX(0);
}

.dq-page-shell.dq-layout-split .dq-results-pane {
  display: flex;
  max-height: none;
  overflow-y: visible;
  padding: 20px 24px 16px;
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.dq-card,
.dq-results-card {
  background: var(--card-bg, #1a1f2e);
  border: 1px solid var(--card-border, #2d3748);
  border-radius: 12px;
  padding: var(--space-3, 0.75rem);
}

/* Results card fills available height */
.dq-results-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Compact title for DQ page */
.dq-card .page-title-container {
  margin-bottom: var(--space-1, 0.25rem);
}

.dq-card .page-title {
  font-size: 1.35rem;
}

.dq-subtitle {
  font: 400 0.85rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--text-muted, #9ca3af);
  margin: 0 0 var(--space-2, 0.5rem) 0;
}

.dq-upload-section {
  --selector-block-gap: var(--space-4, 1rem);
  --selector-label-gap: var(--space-2, 0.5rem);
  margin: var(--space-3, 0.75rem) 0 var(--space-2, 0.5rem);
}

.dq-upload-section .dropzone {
  margin-bottom: var(--space-4, 1rem);
}

.dq-file-info {
  background: var(--surface-2, #1e2433);
  border: 1px solid var(--card-border, #2d3748);
  border-radius: 8px;
  padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
  margin-bottom: var(--selector-block-gap);
}

.dq-file-tile {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
}

.dq-file-icon {
  width: 32px;
  height: 32px;
  color: var(--accent, #3b82f6);
  flex-shrink: 0;
}

.dq-file-details {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: var(--space-2, 0.5rem);
}

.dq-file-name {
  display: block;
  font: 500 0.9rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dq-file-size {
  font: 400 0.8rem/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--text-muted, #9ca3af);
}

.dq-remove-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #9ca3af);
  cursor: pointer;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 4px 6px;
  min-width: 28px;
  height: 28px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.dq-remove-btn:hover {
  color: var(--danger, #f43f5e);
  background: rgba(244, 63, 94, 0.1);
}

.dq-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-2) 0 var(--space-3) 0;
}

.dq-actions .btn {
  min-width: 128px;
  padding: 10px 16px;
  font-size: 15px;
  line-height: 1.2;
  border-radius: 6px;
}

.dq-actions .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.dq-actions .btn:focus-visible {
  outline: 2px solid var(--brand-focus-ring);
  outline-offset: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), var(--focus-shadow);
}

.dq-actions .btn-primary {
  background: var(--brand-primary);
  color: var(--brand-primary-contrast);
  border: 1px solid var(--brand-primary);
}

.dq-actions .btn-primary:hover:enabled {
  background: var(--brand-primary-hover);
  transform: translateY(-2px);
}

.dq-actions .btn-primary:active {
  background: var(--brand-primary-active);
}

#dqResetBtn {
  background: transparent;
  color: var(--secondary);
  border: 1.5px solid color-mix(in srgb, var(--secondary) 40%, transparent);
  box-shadow: none;
}

#dqResetBtn:hover {
  background: color-mix(in srgb, var(--brand-primary) 15%, transparent);
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}

.dq-progress {
  margin-top: var(--space-2, 0.5rem);
}

.dq-progress-bar {
  height: 6px;
  background: var(--surface-2, #1e2433);
  border-radius: 3px;
  overflow: hidden;
}

.dq-progress-fill {
  height: 100%;
  background: var(--accent, #3b82f6);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.dq-progress-text {
  font: 400 0.8rem/1.5 var(--font-ui, system-ui, sans-serif);
  color: var(--text-muted, #9ca3af);
  margin: var(--space-1, 0.25rem) 0 0 0;
  text-align: center;
}

.dq-results-title {
  font: 600 1rem/1.3 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
  text-align: center;
  margin: 0 0 var(--space-2, 0.5rem) 0;
  padding-bottom: var(--space-2, 0.5rem);
  border-bottom: 1px solid var(--card-border, #2d3748);
  flex-shrink: 0; /* Keep title fixed at top */
}

.dq-results-container {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.dq-results-placeholder {
  font: 400 0.9rem/1.5 var(--font-ui, system-ui, sans-serif);
  color: var(--text-muted, #9ca3af);
  text-align: center;
  padding: var(--space-6, 1.5rem);
}

.dq-results-header {
  margin-bottom: var(--space-2, 0.5rem);
  flex-shrink: 0; /* Keep header fixed */
}

.dq-results-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2, 0.5rem);
}

.dq-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-1, 0.25rem) var(--space-3, 0.75rem);
  background: var(--surface-2, #1e2433);
  border-radius: 6px;
  min-width: 70px;
}

.dq-stat-value {
  font: 700 1.25rem/1.2 var(--font-ui, system-ui, sans-serif);
  color: var(--text, #e0e0e0);
}

.dq-stat-label {
  font: 400 0.7rem/1.3 var(--font-ui, system-ui, sans-serif);
  color: var(--text-muted, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dq-stat--warn .dq-stat-value {
  color: var(--warning, #f59e0b);
}

.dq-stat--error .dq-stat-value {
  color: var(--danger, #f43f5e);
}

.dq-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  padding: var(--space-4, 1rem);
  text-align: center;
}

.dq-error-icon {
  width: 48px;
  height: 48px;
  color: var(--danger, #f43f5e);
}

.dq-error-text {
  font: 400 0.9rem/1.5 var(--font-ui, system-ui, sans-serif);
  color: var(--text-muted, #9ca3af);
  margin: 0;
}

/* DQ Page responsive */
@media (max-width: 900px) {
  .dq-page-shell {
    flex-direction: column;
    height: auto;
    max-height: none;
    overflow: visible;
    min-height: calc(100vh - 100px);
  }

  .dq-page-shell.dq-layout-initial {
    justify-content: flex-start;
    align-items: stretch;
  }

  .dq-page-shell.dq-layout-initial .dq-controls-pane {
    max-width: none;
  }

  .dq-page-shell.dq-layout-split .dq-controls-pane {
    position: static;
    max-width: none;
    align-items: flex-start;
  }

  .dq-page-shell.dq-layout-split .dq-results-pane {
    flex: 1 1 auto;
    max-width: none;
    min-height: 300px;
    max-height: 60vh;
  }

  .dq-results-card {
    max-height: 100%;
  }
}

@media (max-width: 480px) {
  .dq-page-shell {
    padding: 0 var(--space-2, 0.5rem);
  }

  .dq-results-summary {
    justify-content: center;
  }

  .dq-stat {
    min-width: 60px;
    padding: var(--space-1, 0.25rem) var(--space-2, 0.5rem);
  }

  .dq-stat-value {
    font-size: 1.1rem;
  }
}
