/* vorlagenfix.de – Dunkelmodus (nur Bildschirm; Vorlagen/Dokumente bleiben immer weiß) */
.theme-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none; background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); cursor: pointer; padding: 0; }
.theme-btn:hover { background: var(--blue-l); }
.theme-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .i-sun { display: none; }
html[data-theme="dark"] .theme-btn .i-sun { display: block; }
html[data-theme="dark"] .theme-btn .i-moon { display: none; }

@media screen {
  html[data-theme="dark"] { color-scheme: dark; }
  html[data-theme="dark"] {
    --blue: #6aa6f8; --blue-d: #9cc3fb; --blue-l: #1b2a42;
    --ink: #e8ebf0; --muted: #9aa3b2; --line: #272d38; --bg: #0f1218; --card: #171b23;
    --shadow: 0 1.6px 3.6px rgba(0,0,0,.5), 0 .3px .9px rgba(0,0,0,.4);
    --shadow-l: 0 6.4px 14.4px rgba(0,0,0,.55), 0 1.2px 3.6px rgba(0,0,0,.4);
  }
  html[data-theme="dark"] [class*="c-"] { --acc-l: color-mix(in srgb, var(--acc) 13%, #171b23); }
  html[data-theme="dark"] body { background: var(--bg); color: var(--ink); }

  /* Flächen, die im hellen Modus weiß sind */
  html[data-theme="dark"] :is(.skip, .site-head, .mock, .sec.white, .cat, .step, .faq details, .prose, .ribbon, .list-card, .content article, .content aside .box, .foot, .view-tabs, .grp, .modal-card, .consent-in, .navdd .dd, .nav, .stats, .fcard, .f2, .float, .pill, .hero-search) { background: var(--card); color: var(--ink); border-color: var(--line); }
  html[data-theme="dark"] .nav a { color: var(--ink); }
  html[data-theme="dark"] .nav a:hover, html[data-theme="dark"] .nav a[aria-current] { background: var(--blue-l); color: var(--blue-d); }
  html[data-theme="dark"] .hero, html[data-theme="dark"] .hero2 { background: linear-gradient(180deg, #16213a 0%, var(--bg) 100%); }
  html[data-theme="dark"] .hero p.lead, html[data-theme="dark"] .hero2 .lead { color: #c3cad6; }
  html[data-theme="dark"] .cat2 { background: linear-gradient(180deg, var(--acc-l), var(--card) 70%); border-color: var(--line); }
  html[data-theme="dark"] .mock-form, html[data-theme="dark"] .form-panel { background: #131720; border-color: var(--line); }
  html[data-theme="dark"] .mock-form span, html[data-theme="dark"] .mock-form .v { background: #1e232d; border-color: #343b48; color: var(--ink); }
  html[data-theme="dark"] .workspace { background: #0b0d11; }
  html[data-theme="dark"] .preview-panel { background: radial-gradient(circle at 50% 0, #1d222b, #0d1015); }
  html[data-theme="dark"] .preview-panel::before { color: #b3b0ad; }
  html[data-theme="dark"] .muster { background: #fff; color: #000; }
  html[data-theme="dark"] .mock-bar { background: #2b579a; color: #fff; }
  html[data-theme="dark"] .mock .mock-paper { background: #fff; }
  html[data-theme="dark"] .grad { background: linear-gradient(90deg, #7db3f5, #4aa8ff 55%, #4cc38a); -webkit-background-clip: text; background-clip: text; color: transparent; }
  html[data-theme="dark"] :is(.cat, .fcard, .f2, .step, .grp) { box-shadow: none; }
  html[data-theme="dark"] :is(.fcard, .cat2, .cat):hover { border-color: color-mix(in srgb, var(--acc) 60%, #272d38); }

  html[data-theme="dark"] .filterbar.stk { background: rgba(15,18,24,.94); }
  html[data-theme="dark"] .chips a { background: rgba(255,255,255,.07); border-color: #272d38; }

  /* Formulare */
  html[data-theme="dark"] :is(.field input[type=text], .field input[type=date], .field input[type=number], .field input[type=email], .field select, .field textarea, .search input, .rfont select, .rsel select, .cform input[type=text], .cform input[type=email], .cform textarea, .hero-search input) { background: #1e232d; color: var(--ink); border-color: #343b48; }
  html[data-theme="dark"] .field label, html[data-theme="dark"] .grp h2 { color: var(--ink); }
  html[data-theme="dark"] .field .hint, html[data-theme="dark"] .hint { color: var(--muted); }

  /* Buttons */
  html[data-theme="dark"] :is(.btn-ghost, .modal-actions .btn-ghost, .btn-add, .fchip, .expand, .btn-light) { background: #1e232d; color: var(--ink); border-color: #343b48; }
  html[data-theme="dark"] .btn-add, html[data-theme="dark"] .expand { color: color-mix(in srgb, var(--acc) 60%, #fff); border-color: var(--acc); }
  html[data-theme="dark"] .fchip.on { background: var(--blue); border-color: var(--blue); color: #10223a; }
  html[data-theme="dark"] .rb { color: var(--ink); }
  html[data-theme="dark"] .rb:hover { background: #212733; border-color: #343b48; }
  html[data-theme="dark"] .rb.primary { background: var(--acc); color: #fff; }
  html[data-theme="dark"] .chips a { color: var(--ink); }
  html[data-theme="dark"] .chips a:hover { background: var(--card); }

  /* Texte */
  html[data-theme="dark"] :is(.faq details p, .prose p, .prose li, .content p, .content li, .seo-text p, .consent-text p, .terms-list, .noticebar p, .lead-p) { color: #cfd5de; }
  html[data-theme="dark"] .noticebar { background: #1a1f29; border-color: var(--line); }
  html[data-theme="dark"] .disclaimer { background: #25220f; border-color: #4a4220; color: #d6cfae; }
  html[data-theme="dark"] .toast { background: #e8ebf0; color: #10131a; }
  html[data-theme="dark"] .modal-backdrop, html[data-theme="dark"] .modal { color: var(--ink); }
  html[data-theme="dark"] a { color: var(--blue); }
  html[data-theme="dark"] :is(.btn, .rb.primary, .appbar a, .appbar, .cat .ico, .step::before, .fcard .ico, .cat2 .ico, .ddi, .go) { color: inherit; }
  html[data-theme="dark"] .btn:not(.btn-ghost):not(.btn-light):not(.btn-outline) { color: #fff; }
  html[data-theme="dark"] .appbar, html[data-theme="dark"] .appbar a { color: #fff; }
  html[data-theme="dark"] .cat .ico, html[data-theme="dark"] .fcard .ico, html[data-theme="dark"] .cat2 .ico, html[data-theme="dark"] .ddi { color: #fff; }
  html[data-theme="dark"] .cta-band, html[data-theme="dark"] .cta-band a { color: #fff; }
  html[data-theme="dark"] .btn-light { color: #1e3f73; background: #fff; border-color: #fff; }
  html[data-theme="dark"] .navdd summary { color: var(--ink); }
  html[data-theme="dark"] table { color: inherit; }
  html[data-theme="dark"] .sw { border-color: #171b23; }

  /* Dokumente bleiben immer hell */
  html[data-theme="dark"] :is(.sheet, .muster) {
    --blue: #2b579a; --blue-d: #1e3f73; --blue-l: #e8eef8;
    --ink: #201f1e; --muted: #605e5c; --line: #e1dfdd; --card: #fff;
    color: #000; background: #fff; color-scheme: light;
  }
  html[data-theme="dark"] .sheet :is(a, a:hover) { color: inherit; }
}
