/* Elektroprotokoll (Arbeitstitel) — Vorlagen-Website
   Farben: Dunkelblau #0F2A44 (Ruhe, Technik) · Signalgelb #FFC81E (nur als Fläche mit dunkler
   Schrift, nie als Text auf Weiß: Kontrast) · Grau-Blau für Fließtext.
   System-Schriftstapel, keine Webfonts, keine externen Skripte, keine Cookies.
   Raster 4 px (0.25rem), Radien 6/10/14 px, ein Schatten. Mobil zuerst. */

:root {
  --blue: #0F2A44;
  --blue-soft: #1B3A5C;
  --blue-line: #2E5A8A;
  --yellow: #FFC81E;
  --yellow-deep: #E0A800;
  --yellow-ink: #1A1A1A;

  --bg: #FFFFFF;
  --bg-alt: #F3F6F9;
  --text: #1F2933;
  --text-muted: #52606D;
  --link: #0B4F8A;
  --link-hover: #083A66;
  --card: #FFFFFF;
  --border: #D5DDE5;
  --focus: #E0A800;
  --header-bg: #0F2A44;
  --header-text: #FFFFFF;
  --todo-bg: #FFF4C2;
  --todo-border: #E0A800;
  --todo-text: #5C4300;
  --shadow: 0 1px 2px rgba(15, 42, 68, .08), 0 6px 20px rgba(15, 42, 68, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1620;
    --bg-alt: #16212E;
    --text: #E6EBF0;
    --text-muted: #A3B1BF;
    --link: #8CC4FF;
    --link-hover: #B8DBFF;
    --card: #16212E;
    --border: #2C3A4A;
    --header-bg: #0A1A2C;
    --header-text: #FFFFFF;
    --todo-bg: #3D3100;
    --todo-border: #E0A800;
    --todo-text: #FFE9A3;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; color: var(--text); overflow-wrap: anywhere; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); margin: 2.5rem 0 .75rem; }
h3 { font-size: 1.15rem; margin: 1.75rem 0 .5rem; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.5rem; margin: 0 0 1rem; }
li { margin-bottom: .375rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95em; background: var(--bg-alt); padding: .1em .35em; border-radius: 4px; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem; }
.fine { font-size: .9rem; color: var(--text-muted); }
.tag { display: inline-block; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--blue); background: var(--yellow); padding: .125rem .5rem; border-radius: 6px; }
@media (prefers-color-scheme: dark) { .tag { color: var(--yellow-ink); } }

/* Skip-Link */
.skip-link { position: absolute; left: -999px; top: .5rem; background: var(--yellow); color: var(--yellow-ink); padding: .5rem 1rem; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: .5rem; }

/* Kopf */
.site-header { background: var(--header-bg); color: var(--header-text); border-bottom: 3px solid var(--yellow); }
.site-header .bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; min-height: 3.5rem; padding-top: .5rem; padding-bottom: .5rem; }
.brand { display: inline-flex; align-items: center; gap: .625rem; color: var(--header-text); text-decoration: none; font-weight: 700; font-size: 1.125rem; min-height: 2.75rem; }
.brand .logo { flex: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.site-header nav a { color: var(--header-text); text-decoration: none; padding: .625rem .75rem; border-radius: 6px; min-height: 2.75rem; display: inline-flex; align-items: center; }
.site-header nav a:hover, .site-header nav a[aria-current] { background: var(--blue-soft); }
.site-header nav a[aria-current] { box-shadow: inset 0 -3px 0 var(--yellow); }
.site-header :focus-visible { outline-color: var(--yellow); }

/* Brotkrumen */
.crumbs { margin: 1.25rem 0 0; font-size: .9rem; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.crumbs li { margin: 0; color: var(--text-muted); }
.crumbs li + li::before { content: "›"; margin-right: .5rem; color: var(--text-muted); }

/* Artikel */
main { padding: 0 0 3rem; }
.page-head { margin: 1.25rem 0 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .5rem; font-size: .9rem; color: var(--text-muted); margin: .5rem 0 0; }
.page > p:first-of-type { font-size: 1.125rem; }

/* Kästen */
.box { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem; margin: 1.75rem 0; }
.box-title { font-size: 1.15rem; margin: 0 0 .75rem; }
.box ul { margin-bottom: .5rem; }
.box .fine { margin: .5rem 0 0; }
.box-norm { border-left: 6px solid var(--blue-line); }
.box-download { background: var(--card); border: 2px solid var(--yellow); box-shadow: var(--shadow); }
.box-haftung { border-left: 6px solid var(--yellow); }
.box-haftung p { margin: 0; font-size: .95rem; }
.box-newsletter { border-left: 6px solid var(--blue-line); }
.box-tool { background: var(--card); border: 2px solid var(--blue-line); }
/* Statusmeldung nach dem Newsletter-Formular: ohne Skript, nur der angesprungene Kasten ist sichtbar */
.box-status { display: none; }
.box-status:target { display: block; }
#gesendet { border-left: 6px solid var(--blue-line); }
#fehler { border-left: 6px solid var(--yellow); }

/* Download-Liste */
.dl-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .625rem; }
.dl-list li { margin: 0; }
.dl { display: grid; grid-template-columns: 3.25rem 1fr; grid-template-rows: auto auto; column-gap: .875rem; align-items: center; padding: .75rem .875rem; min-height: 3.5rem; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); }
.dl:hover { border-color: var(--blue-line); background: var(--card); }
.dl-type { grid-row: 1 / 3; display: inline-flex; align-items: center; justify-content: center; height: 2.5rem; font-size: .75rem; font-weight: 700; letter-spacing: .04em; color: var(--yellow-ink); background: var(--yellow); border-radius: 6px; }
.dl-label { font-weight: 600; color: var(--link); }
.dl-meta { font-size: .85rem; color: var(--text-muted); }
.dl-desc { display: block; font-size: .9rem; color: var(--text-muted); margin: .25rem 0 0 4.125rem; }

/* Buttons und Formulare */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: .625rem 1.25rem; font: inherit; font-weight: 600; color: var(--yellow-ink); background: var(--yellow); border: 0; border-radius: 10px; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--yellow-deep); color: var(--yellow-ink); }
input, select { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: .625rem .75rem; min-height: 2.75rem; width: 100%; }
label { display: block; font-weight: 600; font-size: .95rem; }
label input, label select { margin-top: .25rem; font-weight: 400; }
.nl-form { margin-top: .75rem; }
.nl-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
.nl-row input { flex: 1 1 14rem; }
.nl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fr-grid { display: grid; gap: .875rem; margin-bottom: 1rem; }
output { display: block; margin-top: 1rem; font-weight: 600; min-height: 1.5rem; }
output:not(:empty) { padding: .75rem 1rem; background: var(--bg-alt); border-left: 6px solid var(--yellow); border-radius: 8px; }
@media (min-width: 40rem) { .fr-grid { grid-template-columns: 1fr 1fr; } .fr-grid label:nth-child(2) { grid-column: 1 / -1; } }

/* FAQ */
.faq-item { border-top: 1px solid var(--border); }
.faq-item:last-of-type { border-bottom: 1px solid var(--border); }
.faq-item summary { cursor: pointer; padding: .875rem 0; min-height: 2.75rem; list-style: none; display: flex; gap: .75rem; align-items: baseline; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "+"; flex: none; width: 1.5rem; height: 1.5rem; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--yellow-ink); background: var(--yellow); border-radius: 6px; }
.faq-item[open] summary::before { content: "–"; }
.faq-item summary h3 { margin: 0; font-size: 1.05rem; }
.faq-item p { margin: 0 0 1rem 2.25rem; }

/* Kacheln */
.cards { list-style: none; padding: 0; margin: 1rem 0 2rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.cards li { margin: 0; }
.card a { display: flex; flex-direction: column; gap: .375rem; height: 100%; padding: 1.125rem; background: var(--card); border: 1px solid var(--border); border-top: 4px solid var(--yellow); border-radius: 14px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.card a:hover { border-color: var(--blue-line); border-top-color: var(--yellow); }
.card-type { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.card-title { color: var(--link); font-size: 1.05rem; line-height: 1.3; }
.card-text { font-size: .925rem; color: var(--text-muted); }

/* Tabellen: horizontal scrollbar auf kleinen Bildschirmen */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0 1.5rem; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; min-width: 32rem; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: .625rem .75rem; border-bottom: 1px solid var(--border); }
thead th { background: var(--bg-alt); font-weight: 600; position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-alt) 50%, transparent); }

/* Platzhalter (nur bis zur Textlieferung sichtbar; --strict verhindert Deploy mit Platzhaltern) */
.todo { background: var(--todo-bg); color: var(--todo-text); border: 1px dashed var(--todo-border); border-radius: 8px; padding: .75rem 1rem; margin: 1rem 0; font-size: .95rem; }
.todo strong { color: inherit; }

/* Fuß */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 2rem 0 2.5rem; margin-top: 2rem; }
.site-footer .links { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; margin-bottom: 1rem; }
.site-footer .links-label { font-size: .85rem; color: var(--text-muted); }
.site-footer .links a { min-height: 2.75rem; display: inline-flex; align-items: center; }
.site-footer .fine { font-size: .85rem; }

/* Druck */
@media print {
  .site-header, .site-footer .links, .box-newsletter, .skip-link, .crumbs, .todo, .btn { display: none; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .box, .card a, .table-scroll { border-color: #999; box-shadow: none; background: #fff; }
  a { color: #000; text-decoration: none; }
  .page a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; color: #444; }
  table { min-width: 0; }
  .faq-item { display: block; }
  .faq-item summary::before { display: none; }
  .faq-item p { margin-left: 0; }
}
