/* ══════════════════════════════════════════════════════════════
   Perfectly Unacceptable — Universal Dark Mode
   Shared across all pages. One file, one source of truth.
   Last updated: May 3, 2026
   ══════════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {

  /* ── Base Variables ── */
  :root {
    --cream: #1a1225;
    --ink: #f0e8f8;
    --slate: #c8b8d8;
    --purple-pale: #2a1f3a;
    --pink-pale: #2a1f3a;
    --blue-light: #1e2040;
    --lavender: rgba(196,167,244,0.25);
  }

  /* ── Body & Background ── */
  body {
    background: #1a1225 !important;
    color: #f0e8f8 !important;
  }

  /* ── Navigation ── */
  nav, .nav {
    background: rgba(26,18,37,0.92) !important;
    border-bottom-color: rgba(196,167,244,0.15) !important;
    backdrop-filter: blur(14px);
  }
  .nav-logo {
    filter: brightness(1.3);
  }
  .nav-links a, .nav-back {
    color: #c8b8d8 !important;
  }
  .nav-links a:hover, .nav-back:hover {
    color: #d4b8f9 !important;
  }
  .hamburger span {
    background: #d4b8f9 !important;
  }
  .nav-links.open {
    background: rgba(26,18,37,0.97) !important;
  }

  /* ── Dropdown Nav ── */
  .dropdown-menu {
    background: #2a1f3a !important;
    border: 1px solid rgba(196,167,244,0.2) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3) !important;
  }
  .dropdown-menu a {
    color: #c8b8d8 !important;
  }
  .dropdown-menu a:hover {
    background: rgba(196,167,244,0.1) !important;
    color: #d4b8f9 !important;
  }

  /* ── Hero Sections ── */
  .hero {
    background: linear-gradient(180deg, #1e1530 0%, #1a1225 100%) !important;
  }
  .hero-bg {
    opacity: 0.15 !important;
  }
  .hero h1, .hero-headline {
    color: #f0e8f8 !important;
  }
  .hero h1 em {
    filter: brightness(1.2);
  }
  .hero p, .hero-sub, .hero-desc {
    color: #c8b8d8 !important;
  }
  .hero-tag, .hero-label {
    background: rgba(196,167,244,0.18) !important;
    color: #d4b8f9 !important;
  }

  /* ── Search ── */
  .search-box input, .search-input {
    background: #2a1f3a !important;
    border-color: rgba(196,167,244,0.25) !important;
    color: #f0e8f8 !important;
  }
  .search-box input::placeholder {
    color: #8070a0 !important;
  }
  .search-box input:focus {
    border-color: var(--purple) !important;
    box-shadow: 0 4px 24px rgba(196,167,244,0.15) !important;
  }

  /* ── State Selector ── */
  .state-select, .sel, select, .form-select {
    background: #2a1f3a !important;
    border-color: rgba(196,167,244,0.25) !important;
    color: #f0e8f8 !important;
  }
  .state-row label {
    color: #c8b8d8 !important;
  }
  .state-badge {
    background: rgba(196,167,244,0.15) !important;
    color: #d4b8f9 !important;
  }
  .state-info-card {
    background: linear-gradient(135deg, #2a1f3a, #251a35) !important;
    border-color: rgba(196,167,244,0.25) !important;
    color: #c8b8d8 !important;
  }
  .state-info-card strong {
    color: #d4b8f9 !important;
  }

  /* ── Category Buttons ── */
  .cat-btn {
    background: #2a1f3a !important;
    border-color: rgba(196,167,244,0.2) !important;
    color: #c8b8d8 !important;
  }
  .cat-btn:hover, .cat-btn.active {
    border-color: var(--purple) !important;
    color: #d4b8f9 !important;
    background: rgba(196,167,244,0.15) !important;
  }

  /* ── Result Cards ── */
  .result-card {
    background: #2a1f3a !important;
    border-color: rgba(196,167,244,0.15) !important;
  }
  .result-card:hover {
    box-shadow: 0 12px 36px rgba(0,0,0,0.3) !important;
  }
  .result-card .law-name {
    color: #f0e8f8 !important;
  }
  .result-card .citation {
    color: #d4b8f9 !important;
  }
  .result-card .plain-english {
    color: #c8b8d8 !important;
  }
  .section-header {
    color: #d4b8f9 !important;
  }
  .know-list li {
    color: #c8b8d8 !important;
  }
  .results-count {
    color: #c8b8d8 !important;
  }

  /* ── AI Answer ── */
  .ai-answer {
    background: #2a1f3a !important;
    border-color: rgba(196,167,244,0.25) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2) !important;
  }
  .ai-answer-header {
    color: #d4b8f9 !important;
  }
  .ai-answer-text {
    color: #f0e8f8 !important;
  }
  .ai-citations {
    border-top-color: rgba(196,167,244,0.2) !important;
    color: #c8b8d8 !important;
  }
  .ai-citations span {
    background: rgba(196,167,244,0.15) !important;
    border-color: rgba(196,167,244,0.2) !important;
    color: #d4b8f9 !important;
  }

  /* ── Pushback Cards ── */
  .pushback-card {
    background: rgba(192,96,122,0.1) !important;
    border-color: rgba(192,96,122,0.2) !important;
  }
  .pushback-card .claim {
    color: #e8a0bf !important;
  }
  .pushback-card .response {
    color: #d4b8f9 !important;
  }

  /* ── Forms ── */
  .form-section {
    background: #2a1f3a !important;
    border-color: rgba(196,167,244,0.2) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2) !important;
  }
  .form-label {
    color: #d4b8f9 !important;
  }
  .form-label small {
    color: #a098b0 !important;
  }
  .form-input, .form-select, input[type="text"], input[type="email"], input[type="number"], input[type="tel"], textarea {
    background: #1e1530 !important;
    border-color: rgba(196,167,244,0.25) !important;
    color: #f0e8f8 !important;
  }
  input::placeholder, textarea::placeholder {
    color: #8070a0 !important;
  }
  input:focus, select:focus, textarea:focus {
    border-color: var(--purple) !important;
  }
  .section-title {
    color: #d4b8f9 !important;
    border-bottom-color: rgba(244,167,195,0.2) !important;
  }

  /* ── Option Buttons ── */
  .q-opt {
    background: #1e1530 !important;
    border-color: rgba(196,167,244,0.2) !important;
    color: #c8b8d8 !important;
  }
  .q-opt:hover {
    border-color: var(--purple) !important;
    color: #d4b8f9 !important;
  }

  /* ── Toggle / Action Buttons ── */
  .toggle-btn {
    background: #2a1f3a !important;
    border-color: rgba(196,167,244,0.25) !important;
    color: #d4b8f9 !important;
  }
  .toggle-btn:hover {
    background: rgba(196,167,244,0.15) !important;
  }
  .btn-white {
    background: #f0e8f8 !important;
    color: #2a1840 !important;
  }

  /* ── Feedback Widget ── */
  .feedback-btn {
    background: #2a1f3a !important;
    border-color: rgba(196,167,244,0.25) !important;
    color: #c8b8d8 !important;
  }
  .feedback-btn:hover {
    background: rgba(196,167,244,0.15) !important;
    color: #d4b8f9 !important;
  }
  .feedback-label {
    color: #c8b8d8 !important;
  }
  .feedback-row {
    border-top-color: rgba(196,167,244,0.15) !important;
  }
  .feedback-comment-box textarea {
    background: #1e1530 !important;
    border-color: rgba(196,167,244,0.25) !important;
    color: #f0e8f8 !important;
  }

  /* ── Cards (generic white bg) ── */
  .card, .cta-box, .registry-card, .finder-container {
    background: #2a1f3a !important;
    border-color: rgba(196,167,244,0.2) !important;
  }

  /* ── Tool-specific sections ── */
  .results-area, .results-container {
    color: #f0e8f8 !important;
  }
  .select-row, .select-wrap {
    color: #c8b8d8 !important;
  }

  /* ── Disclaimer / Legal ── */
  .disclaimer, .legal-note {
    color: #8070a0 !important;
  }

  /* ── Empty State ── */
  .empty-state {
    color: #c8b8d8 !important;
  }
  .empty-state p {
    color: #f0e8f8 !important;
  }

  /* ── Highlight ── */
  .highlight {
    background: rgba(196,167,244,0.2) !important;
  }

  /* ── Footer ── */
  footer, .footer {
    background: #1a1225 !important;
    border-top-color: rgba(196,167,244,0.15) !important;
  }
  .footer p, .footer-copy {
    color: rgba(255,255,255,0.5) !important;
  }
  .footer strong {
    color: #f0e8f8 !important;
  }
  .footer a, .footer-links a {
    color: rgba(255,255,255,0.6) !important;
  }
  .footer .quote {
    color: #f0e8f8 !important;
  }
  .footer-brand {
    color: #f0e8f8 !important;
  }

  /* ── Headings & Text ── */
  h1, h2, h3, h4 {
    color: #f0e8f8 !important;
  }
  p {
    color: #c8b8d8;
  }
  a {
    color: #d4b8f9;
  }

  /* ── Tables ── */
  table, th, td {
    border-color: rgba(196,167,244,0.15) !important;
  }
  th {
    background: #2a1f3a !important;
    color: #d4b8f9 !important;
  }
  td {
    background: #1e1530 !important;
    color: #c8b8d8 !important;
  }

  /* ── Inline white background overrides ──
     Universal: catches divs, sections, spans, anchors, buttons,
     articles, asides, lists, headers, footers, labels, etc.
     Covers background, background-color, all hex/keyword variants. */
  *[style*="background:white"],
  *[style*="background: white"],
  *[style*="background:#fff"],
  *[style*="background: #fff"],
  *[style*="background:#FFF"],
  *[style*="background: #FFF"],
  *[style*="background:#ffffff"],
  *[style*="background: #ffffff"],
  *[style*="background:#FFFFFF"],
  *[style*="background: #FFFFFF"],
  *[style*="background-color:white"],
  *[style*="background-color: white"],
  *[style*="background-color:#fff"],
  *[style*="background-color: #fff"],
  *[style*="background-color:#FFF"],
  *[style*="background-color:#ffffff"],
  *[style*="background-color: #ffffff"],
  *[style*="background-color:#FFFFFF"] {
    background: #2a1f3a !important;
    border-color: rgba(196,167,244,0.2) !important;
  }
  /* Keep CTA/buy buttons readable after the surface flips dark:
     if inline color was a brand purple, bump it to a dark-mode purple. */
  a[style*="background:#fff"][style*="color:#6c5ce7"],
  a[style*="background: #fff"][style*="color:#6c5ce7"],
  button[style*="background:#fff"][style*="color:#6c5ce7"] {
    color: #d4b8f9 !important;
  }
  /* Light-gray text inside white pill chips becomes unreadable on dark. */
  span[style*="background:#fff"][style*="color:#6b7280"],
  span[style*="background: #fff"][style*="color:#6b7280"] {
    color: #c8b8d8 !important;
    border-color: rgba(196,167,244,0.25) !important;
  }

  /* ── Inline color overrides ── */
  div[style*="color:var(--ink)"],
  span[style*="color:var(--ink)"],
  strong[style*="color:var(--ink)"],
  p[style*="color:var(--ink)"],
  h2[style*="color:var(--ink)"],
  h3[style*="color:var(--ink)"] {
    color: #f0e8f8 !important;
  }
  div[style*="color:var(--slate)"],
  span[style*="color:var(--slate)"],
  p[style*="color:var(--slate)"] {
    color: #c8b8d8 !important;
  }
  div[style*="color:var(--purple-deep)"],
  span[style*="color:var(--purple-deep)"],
  strong[style*="color:var(--purple-deep)"] {
    color: #d4b8f9 !important;
  }
  div[style*="color:var(--purple-mid)"],
  span[style*="color:var(--purple-mid)"] {
    color: #d4b8f9 !important;
  }

  /* ── Inline gradient overrides ── */
  div[style*="background:linear-gradient(135deg,var(--purple-pale)"],
  div[style*="background: linear-gradient(135deg, var(--purple-pale)"] {
    background: linear-gradient(135deg, #2a1f3a, #351f3a) !important;
    border-color: rgba(196,167,244,0.25) !important;
  }
  a[style*="background:linear-gradient(135deg,var(--blue-pale)"],
  div[style*="background:linear-gradient(135deg,var(--blue-pale)"] {
    background: linear-gradient(135deg, #2a2550, #1e2040) !important;
    border-color: rgba(167,196,244,0.25) !important;
  }
  section[style*="background:linear-gradient(135deg,#F0ECFD"],
  div[style*="background:linear-gradient(135deg,#F0ECFD"] {
    background: linear-gradient(135deg, #2a1f3a, #351f3a, #2a2550) !important;
  }
  div[style*="background:var(--cream)"],
  section[style*="background:var(--cream)"] {
    background: #1e1530 !important;
  }
  div[style*="background:var(--purple-pale)"],
  section[style*="background:var(--purple-pale)"] {
    background: #2a1f3a !important;
  }
  div[style*="background:var(--pink-pale)"],
  section[style*="background:var(--pink-pale)"] {
    background: #2a1f3a !important;
  }

  /* ── Dashed border sections (sponsored access etc) ── */
  div[style*="border:2px dashed"] {
    background: linear-gradient(135deg, #2a1f3a, #251a35, #2a2040) !important;
    border-color: rgba(244,167,195,0.3) !important;
  }

  /* ── Scrollbar ── */
  ::-webkit-scrollbar { width: 8px; }
  ::-webkit-scrollbar-track { background: #1a1225; }
  ::-webkit-scrollbar-thumb { background: #3a2f4a; border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: #4a3f5a; }
}
