/* ==========================================================================
   Schriften (lokal gehostet, DSGVO-konform)
   Die woff2-Dateien gehören in assets/fonts/ – siehe assets/fonts/LIESMICH.txt
   Fehlen die Dateien, greifen automatisch die Systemschriften.
   ========================================================================== */
@font-face {
  font-family: "Sora";
  src: url("../fonts/sora-variable.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   ph-elektroden.com – Design-System
   Mobile-first. Farben, Typografie und Komponenten zentral definiert.
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* Markenfarben */
  --petrol-900: #082A38;
  --petrol-800: #0A3D52;
  --petrol:     #0B4F6C;
  --petrol-300: #5E8EA0;
  --petrol-100: #DCEAF1;
  --petrol-50:  #F2F7FA;

  --orange:     #E8742C;
  --orange-700: #C75E1D;
  --teal:       #0F6E56;
  --teal-100:   #E1F3EC;

  /* pH-Skala (sauer -> basisch) */
  --ph-1: #E24B4A;
  --ph-2: #E8742C;
  --ph-3: #E8B93C;
  --ph-4: #7BBE57;
  --ph-5: #1D9E75;
  --ph-6: #2E7FB8;
  --ph-7: #5B5BC0;

  /* Text */
  --ink:        #1C2B33;
  --ink-soft:   #44606E;
  --ink-faint:  #6E8794;

  /* Flächen & Linien */
  --paper:      #FFFFFF;
  --surface:    #F4F8FA;
  --line:       #DFE8EC;
  --header-bg:  rgba(255, 255, 255, 0.96);

  /* Komponenten-Akzente (im Dark Mode überschrieben) */
  --heading:    #082A38;
  --banner-h:   #0A3D33;
  --banner-p:   #2D6A5B;
  --gut:        #14684f;
  --warnung:    #9a4c17;
  --kritisch:   #8f251e;
  --kritisch-bg:#FBEAE8;
  --svg-text:   #44606E;
  --svg-line:   #8AA3B0;
  --svg-strong: #1A2D36;

  /* Typografie */
  --font-display: "Sora", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Maße */
  --radius:     12px;
  --radius-sm:  8px;
  --maxw:       1080px;
  --gap:        clamp(1rem, 3vw, 1.75rem);
}

/* --------------------------------------------------------------------------
   Basis
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--heading);
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.85rem, 5vw, 2.75rem); font-weight: 600; }
h2 { font-size: clamp(1.4rem, 3.5vw, 1.85rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1em; }

a { color: var(--petrol); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--orange-700); }

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--petrol-900);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* --------------------------------------------------------------------------
   Signatur-Element: pH-Skala-Linie
   -------------------------------------------------------------------------- */
.ph-scale {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg,
    var(--ph-1) 0 14.3%, var(--ph-2) 14.3% 28.6%, var(--ph-3) 28.6% 42.9%,
    var(--ph-4) 42.9% 57.2%, var(--ph-5) 57.2% 71.5%, var(--ph-6) 71.5% 85.8%,
    var(--ph-7) 85.8% 100%);
}
.ph-scale--short { width: 120px; }

h2.with-scale { display: flex; align-items: center; gap: 0.75rem; }
h2.with-scale::before {
  content: "";
  flex: 0 0 34px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg,
    var(--ph-1) 0 14.3%, var(--ph-2) 14.3% 28.6%, var(--ph-3) 28.6% 42.9%,
    var(--ph-4) 42.9% 57.2%, var(--ph-5) 57.2% 71.5%, var(--ph-6) 71.5% 85.8%,
    var(--ph-7) 85.8% 100%);
}

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.brand img { width: 28px; height: auto; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--petrol);
  white-space: nowrap;
}
.brand__name span { color: var(--petrol-300); font-weight: 500; }

.nav { display: none; }

.nav--open {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(8, 42, 56, 0.08);
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

.nav a {
  display: block;
  padding: 0.8rem clamp(1rem, 4vw, 2rem);
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.97rem;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--petrol); }

.lang-switch {
  display: inline-flex;
  gap: 0.25rem;
  margin: 0.4rem clamp(1rem, 4vw, 2rem) 0.8rem;
}
.lang-switch__item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  line-height: 1.4;
}
.lang-switch__item:hover { color: var(--petrol); border-color: var(--petrol); }
.lang-switch__item--active {
  background: var(--petrol);
  color: #fff;
  border-color: var(--petrol);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; stroke: var(--petrol); }

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .nav {
    display: flex;
    align-items: center;
    position: static;
    box-shadow: none;
    border: 0;
    background: transparent;
  }
  .nav ul { display: flex; padding: 0; }
  .nav a { padding: 0.4rem 0.8rem; }
  .lang-switch { margin: 0 0 0 0.5rem; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  background: var(--petrol-800);
  color: #fff;
  overflow: hidden;
}

.hero__blob {
  position: absolute;
  border-radius: 50% 42% 55% 45% / 48% 55% 45% 52%;
  background: rgba(255, 255, 255, 0.045);
  pointer-events: none;
}
.hero__blob--1 { width: 420px; height: 420px; top: -180px; right: -120px; }
.hero__blob--2 { width: 300px; height: 300px; bottom: -140px; left: -90px; background: rgba(29, 158, 117, 0.10); }

.hero__inner {
  position: relative;
  padding-block: clamp(3.5rem, 9vw, 6rem) clamp(4.5rem, 10vw, 7rem);
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
}

.hero__eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8FD8C2;
  margin-bottom: 0.9rem;
}

.hero h1 { color: #fff; }

.hero .ph-scale--short { margin: 1.1rem auto 1.4rem; }

.hero__lead {
  color: #C4D9E2;
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  max-width: 540px;
  margin-inline: auto;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 1.8rem;
}

.hero__wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  line-height: 0;
}
.hero__wave svg { width: 100%; height: clamp(34px, 6vw, 64px); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.97rem;
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.985); }

.btn--primary { background: var(--orange); color: #fff; }
.btn--primary:hover { background: var(--orange-700); color: #fff; }

.btn--ghost { border: 1.5px solid var(--petrol-300); color: #fff; }
.btn--ghost:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, 0.06); }

.btn--teal { background: var(--teal); color: #fff; white-space: nowrap; }
.btn--teal:hover { background: #0A5743; color: #fff; }

/* --------------------------------------------------------------------------
   Themen-Kacheln
   -------------------------------------------------------------------------- */
.section { padding-block: clamp(2.5rem, 6vw, 4rem); }
.section--surface { background: var(--surface); }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--gap);
  margin-top: 1.5rem;
}

.tile {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.3rem 1.3rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.tile:hover {
  border-color: var(--petrol-300);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(8, 42, 56, 0.08);
  color: inherit;
}

.tile__icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--petrol-50);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
}
.tile__icon svg { width: 22px; height: 22px; stroke: var(--petrol); fill: none; stroke-width: 1.8; }

.tile h2, .tile h3 { margin-bottom: 0.3rem; }
.tile p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
.tile__more {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--petrol);
}

/* --------------------------------------------------------------------------
   Kaufberatungs-Banner
   -------------------------------------------------------------------------- */
.banner {
  background: var(--teal-100);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.banner h2 { font-size: 1.25rem; color: var(--banner-h); margin-bottom: 0.25rem; }
.banner p { margin: 0; color: var(--banner-p); font-size: 0.95rem; }

@media (min-width: 700px) {
  .banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1.7rem 2rem;
  }
}

/* --------------------------------------------------------------------------
   FAQ (Akkordeon mit <details>)
   -------------------------------------------------------------------------- */
.faq {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  margin-top: 1.5rem;
  overflow: hidden;
}

.faq details + details { border-top: 1px solid var(--line); }

.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--petrol); }

.faq summary::after {
  content: "";
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink-faint);
  border-bottom: 2px solid var(--ink-faint);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); }

.faq .faq__answer {
  padding: 0 1.2rem 1.2rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.faq .faq__answer p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--petrol-900);
  color: #9FB9C4;
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.site-footer .ph-scale { border-radius: 0; height: 5px; }

.site-footer__inner {
  padding-block: 2.2rem 1.6rem;
  display: grid;
  gap: 1.5rem;
}

.site-footer h2, .site-footer h3 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.35rem; }
.site-footer a { color: #9FB9C4; text-decoration: none; font-size: 0.92rem; }
.site-footer a:hover { color: #fff; }

.site-footer__meta {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-block: 1.1rem;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

@media (min-width: 700px) {
  .site-footer__inner { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* --------------------------------------------------------------------------
   Bewegung reduzieren, wenn gewünscht
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* --------------------------------------------------------------------------
   Inhaltsseiten: Seitenkopf, Brotkrumen, Artikel
   -------------------------------------------------------------------------- */
.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-block: 1.8rem 2rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin: 0 0 0.8rem;
}
.breadcrumb a { color: var(--ink-faint); text-decoration: none; }
.breadcrumb a:hover { color: var(--petrol); text-decoration: underline; }

.page-head h1 { margin-bottom: 0.4rem; }
.page-head .ph-scale--short { margin-top: 0.9rem; }
.page-head__lead {
  color: var(--ink-soft);
  max-width: 680px;
  font-size: 1.05rem;
  margin: 0;
}

.article {
  max-width: 760px;
}
.article h2 { margin-top: 2.2rem; }
.article h3 { margin-top: 1.6rem; }
.article ul, .article ol { padding-left: 1.3rem; }
.article li { margin-bottom: 0.4rem; }
.article figure { margin: 2rem 0; }
.article figcaption {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: 0.6rem;
  text-align: center;
}

.info-box {
  background: var(--petrol-50);
  border: 1px solid var(--petrol-100);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: 1.6rem 0;
  font-size: 0.95rem;
}
.info-box strong:first-child { color: var(--petrol); }
.info-box p:last-child { margin-bottom: 0; }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1.5rem 0;
}
.compare-table th, .compare-table td {
  text-align: left;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.compare-table th {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--petrol-900);
  background: var(--surface);
}
.table-scroll { overflow-x: auto; }

.next-link {
  display: inline-block;
  margin-top: 1.5rem;
  font-weight: 600;
}

/* ============================================================
   Glossar
   ============================================================ */
.glossary-intro {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 70ch;
  margin-bottom: 1.5rem;
}
.glossary-az {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 2.25rem;
}
.glossary-az > span {
  font-weight: 600;
  color: var(--ink-soft);
  margin-right: 0.35rem;
}
.glossary-az a {
  display: inline-flex;
  min-width: 1.85rem;
  height: 1.85rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--petrol);
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.glossary-az a:hover,
.glossary-az a:focus-visible {
  background: var(--petrol);
  color: #fff;
  border-color: var(--petrol);
}
.glossary-group { margin-bottom: 2rem; scroll-margin-top: 1.5rem; }
.glossary-letter {
  position: relative;
  display: inline-block;
  font-size: 1.5rem;
  color: var(--petrol);
  margin: 0 0 0.85rem;
  padding-bottom: 0.3rem;
}
.glossary-letter::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #C2342B, #E8742C, #E8B23C, #1D9E75, #0B4F6C);
}
.glossary-list { margin: 0; }
.glossary-list dt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--ink);
  margin-top: 1.1rem;
  scroll-margin-top: 1.5rem;
}
.glossary-list dt:first-child { margin-top: 0; }
.glossary-list dd {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 75ch;
}
.glossary-more {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  white-space: nowrap;
}
.glossary-more:hover { text-decoration: underline; }

/* ------------------------------------------------------------------
   Dezenter Glossar-Hinweis
   ------------------------------------------------------------------ */
.glossary-hint {
  background: var(--surface);
  border-left: 3px solid var(--teal);
}
.glossary-hint .container { padding-block: 0.95rem; }
.glossary-hint p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}
.glossary-hint svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 0.12rem;
  stroke: var(--teal);
  fill: none;
  stroke-width: 1.8;
}
.glossary-hint a { color: var(--petrol); font-weight: 600; }

/* Kachel- und Footer-Überschriften: als h2 semantisch korrekt, optisch wie zuvor */
.tile h2 { font-size: 1.05rem; }
.site-footer h2 { font-size: 0.95rem; }

/* ------------------------------------------------------------------
   pH-Werte-Tabelle
   ------------------------------------------------------------------ */
.ph-table .ph-value { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ph-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: baseline;
}
.ph-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}
.ph-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.ph-group h3 { margin: 0 0 0.6rem; font-size: 1rem; color: var(--petrol); }
.ph-group__list { list-style: none; margin: 0; padding: 0; font-size: 0.92rem; }
.ph-group__list li {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--line);
}
.ph-group__list li:last-child { border-bottom: 0; }
.ph-group__list span { color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------------
   Fehlerdiagnose
   ------------------------------------------------------------------ */
.diagnose { margin: 1.5rem 0 0; }
.diagnose__card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  box-shadow: 0 2px 10px rgba(11, 79, 108, 0.06);
  outline: none;
}
.diagnose__card--result { border-top-color: var(--orange); }
.diagnose__step,
.diagnose__label {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.diagnose__label { color: var(--orange); font-weight: 600; }
.diagnose__question { margin: 0 0 1rem; font-size: 1.3rem; line-height: 1.35; }
.diagnose__text { margin: 0 0 1rem; }
.diagnose__subhead { margin: 1.2rem 0 0.5rem; font-size: 1rem; color: var(--petrol); }
.diagnose__options { display: grid; gap: 0.6rem; }
.diagnose__option {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--petrol);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.diagnose__option:hover,
.diagnose__option:focus-visible {
  background: var(--paper);
  border-left-color: var(--teal);
  transform: translateX(2px);
}
.diagnose__steps { margin: 0; padding-left: 1.2rem; }
.diagnose__steps li { margin-bottom: 0.4rem; }
.diagnose__links { margin: 1rem 0 0; font-size: 0.92rem; }
.diagnose__links a { color: var(--petrol); font-weight: 600; }
.diagnose__nav { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem; }
.btn--small { padding: 0.45rem 0.9rem; font-size: 0.88rem; }
.diagnose__noscript { margin: 0; color: var(--ink-soft); }

.dx-static__item {
  border-left: 3px solid var(--line);
  padding-left: 1rem;
  margin-bottom: 1.4rem;
}
.dx-static__item h3 { margin: 0 0 0.4rem; font-size: 1.02rem; color: var(--petrol); }
.dx-static__links { font-size: 0.92rem; }
.dx-static--collapsed .dx-static__item { display: none; }
.dx-static--collapsed.is-open .dx-static__item { display: block; }

/* ------------------------------------------------------------------
   Glossar-Sofortsuche
   ------------------------------------------------------------------ */
.glossary-search { margin: 0 0 1.4rem; }
.glossary-search__field { position: relative; max-width: 420px; }
.glossary-search input {
  width: 100%;
  font: inherit;
  padding: 0.65rem 0.9rem 0.65rem 2.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}
.glossary-search input:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.glossary-search svg {
  position: absolute;
  left: 0.75rem; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  stroke: var(--ink-soft); fill: none; stroke-width: 2;
  pointer-events: none;
}
.glossary-search__status { margin: 0.5rem 0 0; font-size: 0.88rem; color: var(--ink-soft); }
.glossary-az a.is-muted { opacity: 0.3; }
.glossary-empty { margin: 1.5rem 0; color: var(--ink-soft); }

/* ------------------------------------------------------------------
   Druckausgabe
   ------------------------------------------------------------------ */
@media print {
  @page { margin: 1.6cm; }
  html { font-size: 11pt; }
  body { background: #fff; color: #000; }

  .site-header, .nav, .nav-toggle, .lang-switch, .skip-link,
  .site-footer nav, .glossary-hint, .glossary-az, .glossary-search,
  .hero__blob, .hero__wave, .banner .btn, .next-link, .breadcrumb,
  .diagnose__options, .diagnose__nav, .tile__more {
    display: none !important;
  }

  .dx-static--collapsed .dx-static__item { display: block !important; }

  .section { padding: 0.6rem 0; }
  .container { max-width: none; padding: 0; }
  .page-head { padding: 0 0 0.6rem; background: none; }
  h1 { font-size: 20pt; margin-bottom: 0.3rem; }
  h2 { font-size: 14pt; margin-top: 1.1em; }
  h3 { font-size: 12pt; }
  h1, h2, h3, h4 { page-break-after: avoid; break-after: avoid; }
  p, li, tr, .info-box, figure { page-break-inside: avoid; break-inside: avoid; }

  .ph-scale { height: 4pt !important; }
  .info-box, .tile, .ph-group, .diagnose__card {
    border: 1px solid #999 !important;
    box-shadow: none !important;
    background: #fff !important;
  }
  .table-scroll { overflow: visible !important; }
  table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  th, td { border: 1px solid #999 !important; padding: 3pt 5pt !important; }
  thead { display: table-header-group; }

  /* Ziel-Adresse hinter internen Links ausschreiben */
  .article a[href^="../"]::after,
  .article a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8.5pt; color: #444; }
  .article a { text-decoration: underline; color: #000; }

  .site-footer { border-top: 1px solid #999; padding-top: 0.4rem; }
  .site-footer__meta { font-size: 8.5pt; }
}

.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;
}

.page-updated {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.page-updated time { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------
   Elektroden-Check
   ------------------------------------------------------------------ */
.check {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  box-shadow: 0 2px 10px rgba(11, 79, 108, 0.06);
  margin-top: 1.5rem;
}
.check__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem 1.4rem;
  margin-bottom: 1.2rem;
}
.check__field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
  color: var(--petrol);
}
.check__field input,
.check__field select {
  width: 100%;
  font: inherit;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
.check__field input:focus-visible,
.check__field select:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.check__help { margin: 0.3rem 0 0; font-size: 0.8rem; color: var(--ink-soft); }
.check__result {
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  outline: none;
}
.check__verdict { margin: 0 0 1rem; font-size: 1.25rem; padding-left: 0.9rem; border-left: 4px solid; }
.check__verdict--sehr_gut { border-color: #1D9E75; color: var(--gut); }
.check__verdict--gut { border-color: #1D9E75; color: var(--ink); }
.check__verdict--beobachten { border-color: var(--orange); color: var(--warnung); }
.check__verdict--kritisch { border-color: #C2342B; color: var(--kritisch); }
.check__verdict--plausi { border-color: var(--ink-soft); color: var(--ink-soft); }
.check__gauge { display: block; width: 100%; max-width: 460px; height: auto; margin: 0 0 1.2rem; }
.check__values {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1.2rem;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}
.check__values dt { font-weight: 600; color: var(--petrol); }
.check__values dd { margin: 0; font-variant-numeric: tabular-nums; }
.check__note { margin: 0.5rem 0 0; font-size: 0.92rem; color: var(--ink-soft); }
.check__links { margin: 1rem 0 0; font-size: 0.92rem; }
.check__links a { color: var(--petrol); font-weight: 600; }
.check__noscript { margin: 1rem 0 0; color: var(--ink-soft); }
@media (max-width: 480px) {
  .check__values { grid-template-columns: 1fr; gap: 0.1rem; }
  .check__values dd { margin-bottom: 0.5rem; }
}
@media print {
  .check__form { display: none !important; }
}

/* ------------------------------------------------------------------
   Elektroden-Logbuch
   ------------------------------------------------------------------ */
.log {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  box-shadow: 0 2px 10px rgba(11, 79, 108, 0.06);
  margin-top: 1.5rem;
}
.log__warn {
  margin: 0 0 1rem;
  padding: 0.6rem 0.9rem;
  background: var(--kritisch-bg);
  border-left: 3px solid #C2342B;
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--kritisch);
}
.log__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.8rem;
  margin-bottom: 1rem;
}
.log__label { font-weight: 600; font-size: 0.92rem; color: var(--petrol); }
.log__head select,
.log__new input {
  font: inherit;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
.log__head select { min-width: 150px; }
.log__head select:focus-visible,
.log__new input:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.log__danger { color: #8f251e; }
.log__new {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.log__new input { flex: 1 1 220px; }
.log__form { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.log__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem 1.2rem;
  margin-bottom: 1.1rem;
}
.log__field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
  color: var(--petrol);
}
.log__field input {
  width: 100%;
  font: inherit;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
.log__field input:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.log__help { margin: 0.3rem 0 0; font-size: 0.78rem; color: var(--ink-soft); }
.log__chart { margin: 1.4rem 0 0.4rem; }
.log__svg { display: block; width: 100%; max-width: 640px; height: auto; }
.log__forecast {
  margin: 0.8rem 0 0;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius);
  font-size: 0.95rem;
}
.log__tablebox { margin-top: 1.2rem; }
.log__table td { font-variant-numeric: tabular-nums; }
.log__table td:nth-child(4) { color: var(--ink-soft); font-size: 0.9rem; }
.log__del {
  font: inherit;
  line-height: 1;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #8f251e;
  cursor: pointer;
}
.log__del:hover,
.log__del:focus-visible { background: var(--kritisch-bg); border-color: #C2342B; }
.log__empty { margin: 1rem 0 0.4rem; color: var(--ink-soft); }
.log__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1rem;
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.log__ics {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.log__ics select {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.check__save { margin: 0.4rem 0 0.8rem; font-size: 0.95rem; }
.check__save a { color: var(--teal); font-weight: 600; }
@media print {
  .log__head, .log__new, .log__form, .log__actions, .log__warn, .log__del { display: none !important; }
}

/* ------------------------------------------------------------------
   Interaktive pH-Skala
   ------------------------------------------------------------------ */
.scale {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  box-shadow: 0 2px 10px rgba(11, 79, 108, 0.06);
  margin-top: 1.5rem;
}
.scale__band { display: block; width: 100%; height: auto; }
.scale__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1rem;
  margin: 0.6rem 0 1.3rem;
}
.scale__controls input[type="range"] {
  flex: 1 1 240px;
  accent-color: var(--petrol);
  height: 1.6rem;
}
.scale__numlabel { font-weight: 600; font-size: 0.92rem; color: var(--petrol); }
.scale__controls input[type="number"] {
  width: 5.2rem;
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
.scale__controls input[type="number"]:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.scale__big {
  margin: 0 0 0.8rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--petrol);
  font-variant-numeric: tabular-nums;
}
.scale__cat {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-left: 0.4rem;
}
.scale__values {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1.2rem;
  margin: 0 0 0.8rem;
  font-size: 0.95rem;
}
.scale__values dt { font-weight: 600; color: var(--petrol); }
.scale__values dd { margin: 0; font-variant-numeric: tabular-nums; }
.scale__factor {
  margin: 0 0 1.1rem;
  padding: 0.65rem 0.95rem;
  background: var(--surface);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius);
  font-size: 0.95rem;
}
.scale__ionen { display: block; width: 100%; max-width: 560px; height: auto; margin-bottom: 1.1rem; }
.scale__nearlabel { margin: 0 0 0.35rem; font-weight: 600; font-size: 0.92rem; color: var(--petrol); }
.scale__near {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  font-size: 0.93rem;
}
.scale__near a { color: var(--petrol); font-weight: 600; }
.scale__near span { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.scale__noscript { margin: 0; color: var(--ink-soft); }
@media (max-width: 480px) {
  .scale__values { grid-template-columns: 1fr; gap: 0.1rem; }
  .scale__values dd { margin-bottom: 0.45rem; }
}
@media print {
  .scale__controls { display: none !important; }
}

/* Inline-Code, u. a. auf der Offene-Daten-Seite */
.article code {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.08em 0.4em;
}

/* --------------------------------------------------------------------------
   Site-Suche
   -------------------------------------------------------------------------- */
.sitesearch {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--petrol);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.1rem;
  box-shadow: 0 2px 10px rgba(11, 79, 108, 0.06);
  margin-top: 1.4rem;
}
.sitesearch__label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--petrol);
  margin-bottom: 0.35rem;
}
.sitesearch input[type="search"] {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
.sitesearch input[type="search"]:focus-visible { outline: 3px solid var(--orange); outline-offset: 1px; }
.sitesearch__status {
  margin: 0.6rem 0 0;
  font-size: 0.88rem;
  color: var(--ink-faint);
}
.sitesearch__results {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}
.sitesearch__results li {
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}
.sitesearch__results a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--petrol);
  text-decoration: none;
}
.sitesearch__results a:hover { text-decoration: underline; }
.sitesearch__results p {
  margin: 0.2rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.sitesearch__sect {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.45rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--petrol);
  background: var(--petrol-100);
  border-radius: 999px;
  vertical-align: 0.1em;
}
.sitesearch mark {
  background: rgba(232, 116, 44, 0.22);
  color: inherit;
  border-radius: 3px;
  padding: 0 0.1em;
}
@media print {
  .sitesearch input, .sitesearch__status { display: none !important; }
}

/* ==========================================================================
   Dark Mode
   Folgt der Systemeinstellung (prefers-color-scheme). Die Farbwerte werden
   ausschliesslich ueber Variablen umgeschaltet; SVG-Presentation-Attribute
   in den Widgets werden gezielt per CSS ueberschrieben.
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  :root {
    /* Flächen und Linien */
    --paper:      #101B21;
    --surface:    #17252C;
    --line:       #2C3E48;
    --header-bg:  rgba(16, 27, 33, 0.95);

    /* Text */
    --ink:        #E3ECF1;
    --ink-soft:   #A7BFCB;
    --ink-faint:  #859DA9;
    --heading:    #EAF3F8;

    /* Marken- und Akzentfarben, für dunklen Grund aufgehellt */
    --petrol:     #7FBEDA;
    --petrol-300: #6F94A5;
    --petrol-100: #24404E;
    --petrol-50:  #17252C;
    --orange:     #F0904E;
    --orange-700: #F4A870;
    --teal:       #37B896;
    --teal-100:   #143029;

    /* Komponenten-Akzente */
    --banner-h:   #A9E3CE;
    --banner-p:   #93BEB0;
    --gut:        #4FCFA3;
    --warnung:    #F2AC72;
    --kritisch:   #F0938B;
    --kritisch-bg:#33201E;

    /* SVG-Grafiken */
    --svg-text:   #A7BFCB;
    --svg-line:   #4E6B78;
    --svg-strong: #E3ECF1;
  }

  /* Schatten wirken auf dunklem Grund als Schmutz – Kanten übernehmen */
  .tile, .info-box, .ph-group, .diagnose__card, .check, .log, .scale, .glossary-search input {
    box-shadow: none;
  }
  .tile:hover { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4); }

  /* Tabellenkopf und Zebrastreifen etwas kräftiger absetzen */
  .compare-table thead th { background: var(--petrol-100); color: var(--heading); }
  .compare-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }

  /* Formularelemente */
  input, select, textarea { background: var(--surface); color: var(--ink); border-color: var(--line); }

  /* SVG-Widgets: Presentation-Attribute haben die niedrigste Priorität
     und werden daher von diesen Regeln überschrieben. */
  .scale__band text,
  .scale__ionen text,
  .check__gauge text,
  .log__svg text { fill: var(--svg-text); }

  .scale__band line,
  .scale__ionen line,
  .log__svg line { stroke: var(--svg-line); }

  #skala-marker,
  .check__gauge polygon { fill: var(--svg-strong); }

  .log__svg polyline { stroke: var(--petrol); }
  .log__svg circle { fill: var(--petrol); }
  .log__svg line[stroke-dasharray] { stroke: var(--ink-soft); }

  .sitesearch { box-shadow: none; }
  .sitesearch mark { background: rgba(240, 144, 78, 0.30); }

  /* Logo und Farbskalen behalten ihre Signalfarben, nur der Rahmen wird ruhiger */
  .ph-scale, .ph-scale--short { opacity: 0.92; }
}
