/* ==========================================================================
   Schrift: IBM Plex Sans (wie woobie.eu), selbst gehostet – Lizenz: /fonts/OFL-LICENSE.txt
   ========================================================================== */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-300-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-ext-300-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ==========================================================================
   Design-Tokens – hell (Standard) und dunkel
   ========================================================================== */
:root {
  --bg: #f3f8fb;
  --surface: #ffffff;
  --surface-2: #eaf3f8;
  --border: #d9e6ee;
  --text: #050e17;
  --text-muted: #2f4253;
  --nav-group-color: #142636; /* Menü-Hauptpunkte */
  --estimated: #a5a8ab; /* geschätzte Werte in der Statistik */
  --chart-1: #0369a1; --chart-2: #0d9488; --chart-3: #d97706; --chart-4: #c026d3; /* Linien im Diagramm: links 1/2, rechts 1/2 */
  --primary: #0891b2;
  --primary-strong: #0e7490;
  --primary-soft: #cff4fc;
  --on-primary: #ffffff;
  --gradient: linear-gradient(135deg, #22d3ee 0%, #0ea5e9 45%, #3b82f6 100%);
  --gradient-strong: linear-gradient(135deg, #0e7490 0%, #0369a1 55%, #1e40af 100%); /* Buttons, Konto-Widget */
  --shadow: 0 1px 2px rgb(15 34 51 / 0.04), 0 8px 24px rgb(15 34 51 / 0.06);
  --shadow-hover: 0 2px 4px rgb(15 34 51 / 0.06), 0 16px 40px rgb(14 116 144 / 0.16);
  --header-bg: var(--surface);

  --radius: 8px;          /* Widgets: Karten, Menüs, Meldungen */
  --radius-control: 6px;  /* Eingabefelder und Buttons */
  --topbar-h: 72px;       /* Kopfzeile (am Handy 64px, siehe unten) */
  --brand-ink: #0b2a42;   /* Schriftzug HYDRO im Logo */
  --sidebar-w: 320px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a141d;
    --surface: #111f2b;
    --surface-2: #172a39;
    --border: #213749;
    --text: #e4f0f7;
    --text-muted: #8ea6b8;
    --nav-group-color: #b4c6d4;
    --estimated: #686b6e;
    --chart-1: #38bdf8; --chart-2: #2dd4bf; --chart-3: #fbbf24; --chart-4: #e879f9;
    --primary: #22d3ee;
    --primary-strong: #67e8f9;
    --primary-soft: rgb(34 211 238 / 0.14);
    --on-primary: #04222b;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    --shadow-hover: 0 2px 4px rgb(0 0 0 / 0.3), 0 16px 40px rgb(34 211 238 / 0.12);
    --header-bg: #1c3244;   /* Kopfzeile etwas heller als der Rest */
    --brand-ink: #f1f7fb;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a141d;
  --surface: #111f2b;
  --surface-2: #172a39;
  --border: #213749;
  --text: #e4f0f7;
  --text-muted: #8ea6b8;
  --nav-group-color: #b4c6d4;
  --estimated: #686b6e;
  --chart-1: #38bdf8; --chart-2: #2dd4bf; --chart-3: #fbbf24; --chart-4: #e879f9;
  --primary: #22d3ee;
  --primary-strong: #67e8f9;
  --primary-soft: rgb(34 211 238 / 0.14);
  --on-primary: #04222b;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
  --shadow-hover: 0 2px 4px rgb(0 0 0 / 0.3), 0 16px 40px rgb(34 211 238 / 0.12);
  --header-bg: #1c3244;   /* Kopfzeile etwas heller als der Rest */
  --brand-ink: #f1f7fb;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  transition: background-color .2s, color .2s;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; font-weight: 400; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem); }
h2 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.content p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.content .placeholder p, .content p.auth-switch { text-align: center; }
a { color: var(--primary); }
ul[role="list"] { list-style: none; margin: 0; padding: 0; }

.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; }

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

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn, .pill-btn, .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color .15s, border-color .15s, transform .15s, box-shadow .15s;
}

.btn { padding: .6em 1.2em; border-radius: var(--radius-control); }
.btn-primary { background: var(--gradient-strong); color: #fff; box-shadow: 0 4px 14px rgb(3 105 161 / 0.35); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgb(3 105 161 / 0.45); }
.btn-light { background: #fff; color: #0e7490; }
.btn-light:hover { transform: translateY(-1px); }

.icon-btn {
  width: 42px; height: 42px;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text);
}
.icon-btn:hover { background: var(--surface-2); }

.pill-btn {
  height: 42px;
  padding: 0 .9em;
  border-radius: var(--radius-control);
  background: var(--surface-2);
  color: var(--text);
  font-size: .9rem;
  list-style: none;
}
.pill-btn::-webkit-details-marker { display: none; }
.pill-btn:hover { border-color: var(--border); }

/* Theme-Schalter: Mond im hellen, Sonne im dunklen Design */
.theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-light { display: none; }
  :root:not([data-theme="light"]) .theme-icon-dark { display: inline-flex; }
}

/* ==========================================================================
   Kopfzeile
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 1.25rem;
  background: color-mix(in srgb, var(--header-bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

/* Logo: Tropfen + Schriftzug HYDRO (kräftig) KONTOR (leicht, Akzentfarbe) */
.brand {
  display: inline-flex; align-items: center; gap: .65rem; min-width: 0;
  padding: 4px 6px; border-radius: var(--radius); text-decoration: none;
}
.brand-drop { flex-shrink: 0; width: 34px; height: 42px; filter: drop-shadow(0 0 6px rgb(34 211 238 / .5)); }
.brand-word { font-size: 1.5rem; line-height: 1; letter-spacing: .09em; white-space: nowrap; }
.brand-hydro { font-weight: 700; color: var(--brand-ink); }
.brand-kontor { font-weight: 300; color: var(--primary); margin-left: .18em; }
@media (max-width: 760px) { :root { --topbar-h: 64px; } }
/* Handy: Schriftzug zweizeilig (HYDRO über KONTOR, gleich breit), damit er neben die Buttons passt */
@media (max-width: 520px) {
  .brand { gap: .45rem; padding: 2px 4px; }
  .brand-drop { width: 26px; height: 32px; }
  .brand-word { display: grid; font-size: .98rem; line-height: 1.02; }
  .brand-hydro { letter-spacing: .2em; margin-right: -.2em; }
  .brand-kontor { margin-left: 0; letter-spacing: .085em; }
}
@media (max-width: 360px) {
  .brand { gap: .35rem; }
  .brand-drop { width: 22px; height: 27px; }
  .brand-word { font-size: .84rem; }
  .brand-hydro { letter-spacing: .16em; margin-right: -.16em; }
  .brand-kontor { letter-spacing: .06em; }
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.nav-toggle { display: none; }

/* Dropdowns (Sprache, Benutzer) */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  padding: .4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
}
.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .7rem;
  border-radius: var(--radius-control);
  color: var(--text);
  text-decoration: none;
}
.dropdown-menu a:hover { background: var(--surface-2); }
.dropdown-menu a[aria-current] { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.lang-code { font-size: .75rem; font-weight: 700; color: var(--text-muted); width: 1.6em; }

/* ==========================================================================
   Layout: Seitenleiste + Inhalt
   ========================================================================== */
.shell {
  flex: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  max-height: calc(100vh - var(--topbar-h));
  max-height: calc(100dvh - var(--topbar-h)); /* dvh: sichtbare Höhe ohne Browserleisten (Handy) */
  overflow-y: auto;
  overscroll-behavior: contain;               /* beim Scrollen im Menü nicht die Seite mitscrollen */
  padding: 1.5rem 1rem;
}
.sidebar-head { display: none; }
.backdrop { display: none; } /* nur im Ausklappmenü (schmale Fenster), siehe unten */

.nav-group + .nav-group { margin-top: 1.4rem; }
.nav-group-title {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: 0 .75rem .45rem;
  color: var(--nav-group-color);
  font-size: .86rem;
  font-weight: 600;          /* Hauptpunkte kräftiger als die Unterpunkte */
  letter-spacing: .08em;
  text-transform: uppercase;
}
.nav-group-title .icon { width: 1.1rem; height: 1.1rem; color: var(--primary); }

/* Ein-/ausklappbare Menügruppen */
.nav-group + .nav-group-collapsible { margin-top: .9rem; }
.nav-group-collapsible > summary {
  list-style: none;
  cursor: pointer;
  padding-top: .35rem;
  padding-bottom: .35rem;
  margin-bottom: .1rem;
  border-radius: var(--radius-control);
  user-select: none;
  transition: background-color .15s, color .15s;
}
.nav-group-collapsible > summary::-webkit-details-marker { display: none; }
.nav-group-collapsible > summary:hover { background: var(--surface-2); color: var(--text); }
.nav-chevron { margin-left: auto; display: inline-flex; transition: transform .2s; }
.nav-chevron .icon { color: var(--text-muted); }
.nav-group-collapsible[open] > summary .nav-chevron { transform: rotate(180deg); }

.nav-link {
  display: block;
  padding: .45rem .6rem .45rem 2.4rem; /* = Textbeginn der Hauptpunkte: .75rem + Symbol 1.1rem + Abstand .55rem */
  border-radius: var(--radius-control);
  color: var(--text);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;      /* immer eine Zeile … */
  overflow: hidden;
  text-overflow: ellipsis;  /* … und notfalls gekürzt statt umbrochen */
  transition: background-color .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); }
.nav-link[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 700;
}

.content { padding: 2rem 1.5rem 3rem; min-width: 0; }

/* ==========================================================================
   Inhalte
   ========================================================================== */
.hero { padding: 1rem 0 1rem; max-width: 1000px; }
.lead { font-size: 1rem; color: var(--text-muted); }
.hero h1[data-fit-text] { max-width: 100%; }
/* Teaser-Video (Startseite, Gäste) */
.teaser { position: relative; margin: -22px 0 1rem; } /* so breit wie die Rechner-Kacheln darunter, etwas näher am Einleitungstext */
.teaser + .hero-hint, .content .teaser + .hero-hint { margin: 0 0 2rem; } /* Hinweis für Gäste direkt unter dem Video */
.section-title { margin: 0 0 .9rem; font-size: 1.3rem; font-weight: 300; } /* z. B. "Unsere Rechentools" über den Kacheln */
.teaser video {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  /* Ränder laufen weich in den Seitenhintergrund aus (Video wirkt wie im Hintergrund statt hart abgegrenzt) */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  mask-composite: intersect;
}

/* Play-Button über dem Video, nur wenn es nicht automatisch starten darf */
.teaser-play {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  width: 72px; height: 72px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  color: #fff; background: color-mix(in srgb, var(--primary) 85%, transparent);
  box-shadow: 0 8px 30px rgb(0 0 0 / .35);
}
.teaser-play[hidden] { display: none; }
.teaser-play .icon { width: 30px; height: 30px; margin-left: 4px; }
.teaser-play:hover { background: var(--primary); }

/* Hinweis für Gäste auf der Startseite */
.content .hero-hint {
  display: block;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  color: var(--text);
  text-decoration: none;
  transition: background-color .15s;
  margin: -.25rem 0 0;
  padding: .7rem 1rem;
  background: var(--primary-soft);
  border-radius: var(--radius);
  font-size: .95rem;
}
.content .hero-hint:hover { background: color-mix(in srgb, var(--primary) 22%, var(--surface)); }
.content .hero-hint strong { color: var(--primary-strong); text-decoration: underline; font-weight: 500; }

.page-head { margin-bottom: 1.5rem; }
.eyebrow {
  margin: 0 0 .4rem;
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-grid {
  /* Rechner-Kacheln als geschlossener Block: jede Zeile füllt die volle Breite.
     5 nebeneinander → 3 + 2 → 2 + 2 + 1 → 1 pro Zeile (je nach Breite des Blocks, Kachel mind. ca. 175 px) */
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  container-type: inline-size;
}
/* "- 0.1px": Rundungsreserve, damit die geplante Anzahl sicher in eine Zeile passt */
.card-grid > * { flex: 1 1 calc((100% - 4rem) / 5 - 0.1px); min-width: 0; }
@container (max-width: 938px) {
  .card-grid > :nth-child(-n+3) { flex-basis: calc((100% - 2rem) / 3 - 0.1px); }
  .card-grid > :nth-child(n+4) { flex-basis: calc((100% - 1rem) / 2 - 0.1px); }
}
@container (max-width: 556px) {
  .card-grid > :nth-child(n) { flex-basis: calc((100% - 1rem) / 2 - 0.1px); }
  .card-grid > :last-child:nth-child(odd) { flex-basis: 100%; }
}
@container (max-width: 365px) {
  .card-grid > :nth-child(n) { flex-basis: 100%; }
}

.card-link {
  position: relative;
  display: block;
  padding: 1.15rem;
  color: var(--text);
  text-decoration: none;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--primary); }
.card-link h3 { font-size: 1.05rem; padding-right: 1.5rem; } /* Abstände wie vorher bei h2 (h1, h2, h3) */
.card-link p { color: var(--text-muted); margin: 0; font-size: .9rem; text-align: left; }
.card-arrow { position: absolute; top: 1.15rem; right: 1.15rem; color: var(--text-muted); transition: transform .2s, color .2s; }
.card-link:hover .card-arrow { transform: translateX(3px); color: var(--primary); }

.card-icon {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  margin-bottom: .85rem;
  border-radius: var(--radius);
  color: #fff;
}
.card-icon .icon { width: 22px; height: 22px; }
.card-icon-1 { background: linear-gradient(135deg, #22d3ee, #0ea5e9); }
.card-icon-2 { background: linear-gradient(135deg, #34d399, #10b981); }
.card-icon-3 { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.card-icon-4 { background: linear-gradient(135deg, #fb923c, #f43f5e); }
.card-icon-5 { background: linear-gradient(135deg, #38bdf8, #6366f1); }

.card-accent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--gradient-strong);
  border: 0;
  color: #fff;
}
.card-accent p { margin: 0; opacity: .92; max-width: 640px; }
.card-accent .btn { flex-shrink: 0; }

.legal, .article { max-width: 1000px; line-height: 1.65; }
.article p:last-child { margin-bottom: 0; }
.article h2 { font-size: 1.25rem; margin: 2rem 0 .6rem; }
.article > :is(h2, h3):first-child { margin-top: 0; } /* Artikel, die mit einer Zwischenüberschrift beginnen (z. B. pH-Wert) */
.article h2.article-h2-space { margin-top: 2.75rem; } /* neuer großer Abschnitt (z. B. „Unsere Rechner im Überblick“) */
.article h3 { font-size: 1.05rem; margin: 1.5rem 0 .4rem; }
.article ul { margin: 0 0 1em; padding-left: 1.4rem; }
.article li, .legal li, .legal dd { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.article li + li { margin-top: .35em; }
.article li::marker { color: var(--primary); }
.article-note { margin-top: 1.5rem; color: var(--text-muted); font-size: .9rem; font-style: italic; }
.article-figure { margin: 1.5rem 0; }
.article-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius);
  background: #fff; /* Grafik hat weißen Hintergrund – auch im dunklen Design */
}
.legal h2 { font-size: 1.15rem; margin: 2rem 0 .6rem; }
.legal h2:first-child { margin-top: 0; }
.legal h3 { font-size: 1rem; margin: 1.5rem 0 .4rem; }
.legal address, address { font-style: normal; margin-bottom: 1em; }
.legal ul { margin: 0 0 1em; padding-left: 1.25rem; }
.legal li + li { margin-top: .3em; }
.legal dl { margin: 0 0 1em; }
.legal dt { font-weight: 600; margin-top: .8em; }
.legal dd { margin: .2em 0 0; }
.legal dd ul { margin: 0; }
.legal-note { margin: 2.5rem 0 0; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .85rem; }

.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}
.placeholder > .icon { width: 44px; height: 44px; margin-bottom: 1rem; color: var(--primary); }
.placeholder h1 { color: var(--text); }
.error-code {
  font-size: 4rem;
  font-weight: 400;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==========================================================================
   Fußzeile
   ========================================================================== */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .875rem;
}
.footer nav { display: flex; gap: 1.25rem; }
.footer a { color: inherit; text-decoration: none; }
.footer a:hover { color: var(--primary); }

/* ==========================================================================
   Formulare & Meldungen
   ========================================================================== */
.muted { color: var(--text-muted); }

.auth-card { max-width: 460px; margin: 1rem auto; padding: 2rem; }
.auth-card h1 { font-size: 1.6rem; }
.auth-switch { margin: 1.5rem 0 0; text-align: center; color: var(--text-muted); }

.stack { display: grid; gap: 1.25rem; max-width: 640px; }
.form-card h2 { margin-bottom: 1rem; }

.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field label, .field .field-label { font-weight: 600; font-size: .9rem; }
.field input {
  width: 100%;
  padding: .7rem .9rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 3rem; }
.input-btn {
  position: absolute;
  top: 50%; right: .3rem;
  transform: translateY(-50%);
  display: grid; place-items: center;
  width: 2.4rem; height: 2.4rem;
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.input-btn:hover { color: var(--primary); background: var(--surface-2); }
.input-btn .when-shown, .input-btn[aria-pressed="true"] .when-hidden { display: none; }
.input-btn[aria-pressed="true"] .when-shown { display: contents; }
.input-btn > span { display: contents; }
.label-range { color: var(--text-muted); font-weight: 400; font-size: .85em; white-space: nowrap; }
.field-hint { color: var(--text-muted); font-size: .8rem; }

.form-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; font-size: .9rem; }
.check { display: flex; align-items: flex-start; gap: .55rem; font-size: .9rem; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; margin-top: .15rem; accent-color: var(--primary); flex-shrink: 0; }

.btn-block { width: 100%; padding-block: .8em; }
.btn-danger { background: #e11d48; color: #fff; }
.btn-danger:hover { background: #be123c; }
.danger-zone { border-color: color-mix(in srgb, #e11d48 35%, var(--border)); }

.alert {
  margin-bottom: 1rem;
  padding: .8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: .95rem;
}
.alert-error { background: color-mix(in srgb, #e11d48 10%, var(--surface)); border-color: color-mix(in srgb, #e11d48 40%, transparent); color: color-mix(in srgb, #e11d48 70%, var(--text)); }
.alert-info { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 35%, transparent); color: var(--text); }
.alert-success { background: color-mix(in srgb, #10b981 12%, var(--surface)); border-color: color-mix(in srgb, #10b981 40%, transparent); color: color-mix(in srgb, #059669 70%, var(--text)); }
/* Wartungsmodus: Hinweis oben auf jeder Seite (orange) */
.alert-maintenance { display: flex; align-items: flex-start; gap: .7rem; background: color-mix(in srgb, #f59e0b 14%, var(--surface)); border-color: color-mix(in srgb, #f59e0b 50%, transparent); color: var(--text); }
.alert-maintenance .icon { flex-shrink: 0; width: 1.3rem; height: 1.3rem; margin-top: .1rem; color: #d97706; }
.alert-maintenance p { margin: 0; }
/* Im Wartungsmodus gesperrte Bedienelemente (das Skript setzt disabled) */
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.switch:has(input:disabled) { opacity: .5; cursor: not-allowed; }
:root[data-theme="dark"] .alert-maintenance .icon { color: #fbbf24; }

/* Abmelden-Button im Benutzermenü sieht aus wie ein Link */
.dropdown-menu form { margin: 0; }
.dropdown-menu button {
  display: flex; align-items: center; gap: .7rem;
  width: 100%;
  padding: .55rem .7rem;
  border: 0; border-radius: var(--radius-control);
  background: none;
  color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.dropdown-menu button:hover { background: var(--surface-2); }

/* ==========================================================================
   Rechner
   ========================================================================== */
.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  max-width: 1000px;
}
.calc-form { display: grid; gap: 1rem; }
.calc-main { display: grid; gap: 0; align-content: start; min-width: 0; }
/* Rechner: Eingabefelder etwas niedriger (Innenabstand oben/unten −6px) */
.calc-form .field input,
.calc-form .field select { padding-top: calc(.7rem - 6px); padding-bottom: calc(.7rem - 6px); }
.calc-form h2 { margin: .25rem 0 -.25rem; font-size: 1rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.calc-form h2:not(:first-child) { margin-top: .75rem; }

.calc-form .field label,
.calc-form .field .field-label {
  display: block;
  padding-left: 2px;        /* Beschriftung leicht eingerückt gegenüber dem Feld */
  white-space: nowrap;      /* nie umbrechen … */
  overflow: hidden;
  text-overflow: ellipsis;  /* … sondern mit "…" kürzen */
}
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) 6.5rem; gap: .75rem; align-items: start; }

.input-unit { position: relative; display: flex; align-items: center; }
.input-unit input { padding-right: 3.5rem; }
.input-unit .unit { position: absolute; right: .9rem; color: var(--text-muted); font-size: .9rem; pointer-events: none; }
/* Wert aus LabCom übernommen (app.js markLabcom): Feld leicht eingefärbt, "[LabCom 14:05]" rechts vor der Einheit */
.input-unit.is-labcom input { background: color-mix(in srgb, var(--primary) 9%, var(--bg)); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); padding-right: 10.5rem; }
.input-unit:not(:has(.unit)).is-labcom input { padding-right: 8rem; }
.labcom-tag { position: absolute; right: 3.4rem; font-size: .75rem; color: color-mix(in srgb, var(--primary-strong) 75%, transparent); pointer-events: none; white-space: nowrap; }
.input-unit:not(:has(.unit)) .labcom-tag { right: .9rem; }

.field select {
  width: 100%;
  padding: .7rem .9rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}
.field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.field input[aria-invalid="true"] { border-color: #e11d48; }
.field-error { color: #e11d48; font-size: .85rem; }

.calc-result { position: sticky; top: calc(var(--topbar-h) + 1rem); }
.calc-result.is-loading { opacity: .55; transition: opacity .15s .1s; }
.calc-result h2 { font-size: 1.15rem; }
.result-block + .result-block { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.result-block h3 { font-size: 1rem; margin-bottom: .5rem; }
.result-main { display: flex; flex-direction: column; gap: .15rem; margin: .5rem 0 1rem; }
.result-label { color: var(--text-muted); font-size: .9rem; }
.result-value { font-size: 2.4rem; line-height: 1.1; font-weight: 500; color: var(--primary-strong); }
.result-value small { font-size: 1rem; color: var(--text-muted); font-weight: 400; }
.result-sub { color: var(--text-muted); font-size: .9rem; }

.result-list { display: grid; gap: .75rem; margin: 1rem 0; }
.result-list div { padding: .75rem 1rem; background: var(--surface-2); border-radius: var(--radius); }
.result-list dt { font-size: .85rem; color: var(--text-muted); }
.result-list dd { margin: .15rem 0 0; font-size: 1.15rem; font-weight: 500; }

.content p.status { padding: .7rem 1rem; border-radius: var(--radius); font-size: .95rem; text-align: left; }
.status-ok { background: color-mix(in srgb, #10b981 14%, var(--surface)); color: color-mix(in srgb, #059669 75%, var(--text)); }
.status-low { background: color-mix(in srgb, #e11d48 12%, var(--surface)); color: color-mix(in srgb, #e11d48 75%, var(--text)); }
.status-high { background: color-mix(in srgb, #f59e0b 15%, var(--surface)); color: color-mix(in srgb, #b45309 80%, var(--text)); }
/* Dunkles Design: Hinweise der Rechner (Ampel-Absätze) heller, damit sie sich vom Hintergrund abheben */
:root[data-theme="dark"] .content p.status-ok { color: color-mix(in srgb, #6ee7b7 85%, var(--text)); background: color-mix(in srgb, #10b981 16%, var(--surface)); }
:root[data-theme="dark"] .content p.status-low { color: color-mix(in srgb, #fda4af 85%, var(--text)); background: color-mix(in srgb, #e11d48 16%, var(--surface)); }
:root[data-theme="dark"] .content p.status-high { color: color-mix(in srgb, #fcd34d 85%, var(--text)); background: color-mix(in srgb, #f59e0b 16%, var(--surface)); }

/* Schalter "automatisch in Statistik speichern" */
.switch-row { display: flex; align-items: center; gap: .5rem; }
.switch-row[hidden] { display: none; }
.help-btn {
  position: relative;
  margin-top: 4px;
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 1.6rem; height: 1.6rem;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--primary-strong);
  font: inherit; font-size: .85rem; font-weight: 500;
  cursor: pointer;
}
.help-btn:hover { background: var(--primary-soft); }
/* 2px orangener, glänzender Rand, der sich dreht – bis die Hilfe einmal geöffnet wurde */
.help-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #fdba74, #ea580c 25%, #fff7ed 40%, #f97316 55%, #c2410c 75%, #fed7aa 90%, #fdba74);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  animation: help-spin 4s linear infinite;
}
.help-btn.is-seen::before { animation: none; }
@keyframes help-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .help-btn::before { animation: none; } }
/* Hilfe-Popups: am Handy volle Breite, auf größeren Bildschirmen breiter, damit mehr ohne Scrollen lesbar ist */
.modal.modal-help { width: min(560px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; }
@media (min-width: 900px) { .modal.modal-help { width: min(760px, calc(100vw - 4rem)); } }
.title-row { display: flex; align-items: center; gap: .75rem; }
.title-row h1 { margin: 0; }
@media (min-width: 761px) { .help-cards-only { display: none; } } /* am PC steht das "?" im Tabellenkopf */
.stats-table thead .cell-actions { text-align: right; }
.stats-table thead .help-btn { display: grid; margin: 0 6px 0 auto; } /* rechts, über der Mülltonne */
.modal-help ul { margin: .55rem 0 1.25rem; padding-left: 1.2rem; text-align: left; } /* Abstand zur Überschrift wie zwischen den Punkten */
.modal-help ul ul { margin: .35rem 0 0; list-style: circle; } /* Unterpunkte */
.modal-help li { color: var(--text); text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.modal-help li + li { margin-top: .55rem; }
.modal-help li::marker { color: var(--primary); }
.switch { display: flex; align-items: center; gap: .65rem; font-size: .9rem; cursor: pointer; user-select: none; }
.switch[hidden] { display: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative;
  flex-shrink: 0;
  width: 2.5rem; height: 1.4rem;
  border-radius: 999px;
  background: var(--border);
  transition: background-color .15s;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: .2rem; left: .2rem;
  width: 1rem; height: 1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / .25);
  transition: transform .15s;
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(1.1rem); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--primary); outline-offset: 2px; }

.content p.saved-note {
  display: flex; align-items: center; gap: .5rem;
  margin: 0 0 1rem;
  padding: .5rem .8rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, #10b981 12%, var(--surface));
  color: color-mix(in srgb, #059669 80%, var(--text));
  font-size: .85rem;
  text-align: left;
}
.saved-note .icon { width: 1.05em; height: 1.05em; }
/* Automatisch ausgeblendete Meldungen (Rechner-Rückmeldung, kurze Bestätigungen, Import ohne neue Daten):
   wie beim Abschalten eines Röhrenfernsehers – Bild fällt zu einer hellen Linie zusammen, die Linie zieht sich
   zur Mitte und verlischt; danach schließt sich der Platz (autoHide in public/js/app.js) */
.tv-off, .content p.saved-note.tv-off { animation: tv-off .6s cubic-bezier(.6, 0, .4, 1) forwards; }
.tv-off > * { animation: tv-content-off .25s ease-in forwards; }
@keyframes tv-off {
  0%   { transform: scale(1, 1); filter: brightness(1); }
  40%  { transform: scale(1, .06); filter: brightness(2.2); background: #fff; color: transparent; border-color: #fff; box-shadow: 0 0 14px 3px rgb(255 255 255 / .85); }
  75%  { transform: scale(.18, .06); background: #fff; color: transparent; border-color: #fff; box-shadow: 0 0 12px 3px rgb(255 255 255 / .8); opacity: 1; }
  100% { transform: scale(0, .06); background: #fff; color: transparent; box-shadow: none; opacity: 0; }
}
@keyframes tv-content-off { to { opacity: 0; } }

.calc-notes { margin: 1rem 0; padding-left: 1.2rem; color: var(--text-muted); font-size: .85rem; }
.calc-notes li + li { margin-top: .25rem; }

.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary-strong); }

/* Kachel "Messwerte aus LabCom Cloud holen" (partials/calc-labcom-prefill): nebeneinander über dem Ergebnis,
   untereinander (Handy) über dem Rechner */
.calc-layout.has-prefill { grid-template-rows: auto 1fr; } /* Zeile 1 nur so hoch wie die Kachel */
.calc-layout.has-prefill .calc-prefill { grid-column: 2; grid-row: 1; }
.calc-layout.has-prefill .calc-main { grid-column: 1; grid-row: 1 / span 2; }
.calc-layout.has-prefill .calc-result { grid-column: 2; grid-row: 2; }
.calc-prefill { display: grid; gap: .75rem; min-width: 0; padding: 1rem 1.1rem; }
.calc-prefill-head { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.content p.calc-prefill-text { margin: 0; flex: 1; min-width: 0; font-weight: 600; text-align: left; overflow: hidden; } /* Schrift passt das Skript an (data-fit-text) */
.calc-prefill-head .help-btn { margin-top: 0; }
.calc-prefill-body { display: grid; gap: .5rem; justify-items: start; }
.calc-prefill-body :is([data-prefill-start], .calc-prefill-refresh) { justify-self: stretch; } /* Importieren / Neu abrufen über die volle Breite */
.content .calc-prefill-body p.saved-note { margin: 0; justify-self: stretch; }
/* gesperrt (30 s nach einem Abruf, Countdown): grau statt Akzentfarbe */
.calc-prefill .btn:disabled { background: var(--surface-2); border-color: var(--border); color: var(--text-muted); box-shadow: none; cursor: not-allowed; opacity: 1; } /* "LabCom-Import aktuell" wie die Rechner-Rückmeldung */
.content .calc-prefill-note { margin: 0; font-size: .92rem; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.calc-prefill-note.is-loading { color: var(--text-muted); font-style: italic; }
.calc-prefill-note.is-warning { color: color-mix(in srgb, #d97706 90%, var(--text)); }
.calc-prefill-list { margin: 0; padding-left: 1.2rem; font-size: .92rem; }
.calc-prefill-list li::marker { color: var(--primary); }
.calc-prefill-body .calc-prefill-buttons { justify-self: stretch; }
/* Übernehmen / Nicht übernehmen immer nebeneinander, gleich breit */
.calc-prefill-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.calc-prefill-buttons .btn { min-width: 0; padding-left: .5rem; padding-right: .5rem; white-space: nowrap; font-size: .92rem; }
@media (max-width: 360px) { .calc-prefill-buttons .btn { font-size: .8rem; padding-left: .3rem; padding-right: .3rem; } }

@media (max-width: 760px) {
  .calc-layout { grid-template-columns: minmax(0, 1fr); }
  .calc-layout.has-prefill { grid-template-rows: none; }
  .calc-layout.has-prefill :is(.calc-prefill, .calc-main, .calc-result) { grid-column: auto; grid-row: auto; }
  .calc-prefill { order: -1; }
  .calc-result { position: static; }
  /* Handy: Formular, Ergebnis, dann der Zähler ganz unten */
  .calc-main { display: contents; }
  .calc-main .calc-usage { order: 3; margin-top: .25rem; }
}

/* ==========================================================================
   Mein Konto
   ========================================================================== */
.account-facts { display: grid; gap: .6rem; margin: 0; }
.account-facts div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; }
.account-facts dt { color: var(--text-muted); }
.account-facts dd { margin: 0; font-weight: 500; }
.account-facts code { font-size: .85rem; word-break: break-all; }
.account-facts dt a { color: inherit; }
.account-facts dt a:hover { color: var(--primary); }
.content p.account-note { margin: 1rem 0 0; padding-top: .9rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .85rem; }

.calc-counts li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.calc-counts a { color: var(--text); text-decoration: none; }
.calc-counts a:hover { color: var(--primary); }
.calc-counts li span:last-child { font-weight: 500; font-variant-numeric: tabular-nums; }
.calc-counts .calc-counts-total { border-bottom: 0; font-weight: 500; }

/* Aufklappbare Karten */
.fold > summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h2 { margin: 0; }
.fold > summary .nav-chevron { margin-left: auto; }
.fold[open] > summary .nav-chevron { transform: rotate(180deg); }
.fold > summary:hover h2 { color: var(--primary-strong); }
.fold-body { margin-top: 1.25rem; }
.badge {
  padding: .15rem .55rem;
  border-radius: 999px;
  background: color-mix(in srgb, #f59e0b 18%, var(--surface));
  color: color-mix(in srgb, #b45309 85%, var(--text));
  font-size: .75rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Nutzungszähler unter den Rechnern */
.calc-usage {
  display: flex;
  align-items: center;
  gap: .5rem;
  max-width: 1000px;
  margin: 1.25rem 0 0;
  color: var(--text-muted);
  font-size: .85rem;
}
.content p.calc-usage { text-align: left; }
.calc-usage .icon { color: var(--primary); width: 1.1em; height: 1.1em; }

/* ==========================================================================
   Statistik – Tabelle
   ========================================================================== */
/* Lockfelder gegen Spam-Bots (Registrierung): außerhalb des sichtbaren Bereichs, nicht display:none */
.hp-fields { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Eine Zeile: Datum, Zeitraum, Spalten filtern, CSV, Messung hinzufügen – alle gleich hoch (2,3rem) */
.stats-toolbar { position: relative; z-index: 10; /* Auswahl-Menüs über der Tabellenüberschrift */ display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; margin-bottom: .75rem; }
.stats-toolbar .btn { height: 2.3rem; padding: 0 1em; font-size: .9rem; white-space: nowrap; }
/* "Messung hinzufügen" verhält sich beim Darüberfahren wie die anderen Buttons der Leiste */
.stats-toolbar .btn-primary:hover { transform: none; border-color: var(--primary-strong); box-shadow: 0 4px 14px rgb(3 105 161 / 0.35); }
.stats-toolbar summary.btn { list-style: none; }
.stats-toolbar summary.btn::-webkit-details-marker { display: none; }
.stats-fill { margin-bottom: 1rem; }
.period-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; }
.period-field { display: grid; gap: .2rem; font-size: .8rem; color: var(--text-muted); }
.period-field select, .period-field input {
  height: 2.3rem; padding: 0 .6rem;
  font: inherit; font-size: .9rem; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}
.period-field select:focus, .period-field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.period-form .btn[hidden] { display: none; }
.columns-menu .dropdown-menu { width: max-content; min-width: 230px; padding: .5rem .75rem; left: 0; right: auto; }
.columns-menu .check { white-space: nowrap; } /* z. B. „Carbonathärte / Alkalinität“ in einer Zeile */
.stats-actions { margin: 1rem 0 0; justify-content: center; }
.stats-demo { margin: 1.5rem 0 0; justify-content: center; }
/* Zeitraum-Leiste (Tabelle/Diagramm): nie umbrechen – wird es eng, schieben sich Felder und Button zusammen,
   der Buttontext wird notfalls mit "…" abgeschnitten */
.stats-toolbar:has(> [data-period-form]) { flex-wrap: nowrap; }
.stats-toolbar:has(> [data-period-form]) > * { flex: 0 1 auto; min-width: 0; }
.stats-toolbar [data-period-form] { flex-wrap: nowrap; }
.stats-toolbar:has(> [data-period-form]) .period-field { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.stats-toolbar:has(> [data-period-form]) .period-field > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats-toolbar:has(> [data-period-form]) .period-field input,
.stats-toolbar:has(> [data-period-form]) .period-field select { width: 100%; min-width: 0; }
/* Safari (iPhone/iPad): Datumsfelder haben eine eigene Mindestbreite und schrumpfen sonst nicht mit –
   dann überlappen sie das Nachbarfeld. Ohne natives Aussehen gilt die normale Breite (Rahmen etc. kommen aus .period-field). */
.stats-toolbar:has(> [data-period-form]) .period-field input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
/* …ohne natives Aussehen setzt Safari den Datumswert oben an: über die Zeilenhöhe senkrecht mittig ausrichten */
.stats-toolbar:has(> [data-period-form]) .period-field input[type="date"] { line-height: calc(2.3rem - 2px); }
.stats-toolbar:has(> [data-period-form]) .period-field input[type="date"]::-webkit-date-and-time-value {
  text-align: left; min-width: 0; margin: 0; padding: 0; line-height: inherit;
}
/* nur iOS (iPhone/iPad): Datumswert dort 1px tiefer, damit er genau mittig sitzt */
@supports (-webkit-touch-callout: none) {
  .stats-toolbar:has(> [data-period-form]) .period-field input[type="date"]::-webkit-date-and-time-value { margin-top: 1px; }
}
/* Sicherheitsnetz: falls ein Feld trotzdem breiter rendert, nicht über das Nachbarfeld ragen lassen */
.stats-toolbar:has(> [data-period-form]) .period-field { overflow: hidden; padding: 4px; margin: -4px; } /* Rand für den Fokus-Ring */
.stats-toolbar:has(> [data-period-form]) > .btn { min-width: 2.5rem; overflow: hidden; text-overflow: ellipsis; }
/* Wechsel-Buttons mit Kurzform: "Tabelle" unter 620 px, "Graphik" unter 520 px */
.label-short { display: none; }
@media (max-width: 620px) { .short-620 .label-long { display: none; } .short-620 .label-short { display: inline; } }
@media (max-width: 520px) { .short-520 .label-long { display: none; } .short-520 .label-short { display: inline; } }
@media (max-width: 480px) {
  /* etwas engere Felder am Handy */
  .stats-toolbar .period-form { gap: .4rem; }
  .stats-toolbar:has(> [data-period-form]) { gap: .4rem; }
  .stats-toolbar .period-field input, .stats-toolbar .period-field select { padding-left: .45rem; padding-right: .3rem; }
  .stats-toolbar:has(> [data-period-form]) > .btn { padding: 0 .6em; }
}
@media (max-width: 480px) {
  /* am Handy enger, damit die drei Buttons in eine Reihe passen (sehr schmale Displays brechen um) */
  .stats-actions { gap: .3rem; }
  .stats-actions .btn { padding: 0 .45em; font-size: .74rem; }
  /* Spaltenfilter mittig unter der (zentrierten) Buttonleiste statt am Button – passt so auch auf 320 px */
  .stats-actions .columns-menu { position: static; }
  .stats-actions .columns-menu .dropdown-menu { left: 50%; right: auto; transform: translateX(-50%); max-width: calc(100vw - 1rem); }
}
.stats-actions .dropdown-menu { top: auto; bottom: calc(100% + 8px); } /* unter der Tabelle: nach oben aufklappen */
.columns-menu li + li { margin-top: .35rem; }
.stats-count { margin: 0 0 .5rem; font-size: .85rem; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
/* --table-scale: setzt das Skript (< 1), damit die Tabelle ohne seitliches Scrollen passt (höchstens bis 0,8) */
.stats-table { width: 100%; border-collapse: collapse; font-size: calc(.9rem * var(--table-scale, 1)); }
.stats-table th, .stats-table td { padding: calc(.55rem * var(--table-scale, 1)) calc(.7rem * var(--table-scale, 1) * var(--table-scale, 1)); border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.stats-table thead th { position: sticky; top: 0; background: var(--surface-2); font-weight: 500; font-size: max(.72rem, calc(.8rem * var(--table-scale, 1))); color: var(--text-muted); }
.stats-table thead small { display: block; font-size: max(.66rem, calc(.7rem * var(--table-scale, 1))); font-weight: 400; }
.stats-table tbody tr:last-child > * { border-bottom: 0; }
.stats-table tbody tr:hover { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.stats-table .num { text-align: center; font-variant-numeric: tabular-nums; }
.stats-table abbr { text-decoration: none; cursor: help; }
/* Spalten per Drag & Drop verschieben */
.stats-table th.col-draggable, .stats-table th.col-draggable abbr { cursor: grab; }
.stats-table th.col-draggable:hover { color: var(--text); }
.stats-table th.is-dragging { opacity: .4; }
.stats-table th.drop-before { box-shadow: inset 3px 0 0 var(--primary); }
.stats-table th.drop-after { box-shadow: inset -3px 0 0 var(--primary); }
.stats-table .cell-date { font-weight: 500; }
.stats-table .cell-source, .stats-table thead th:nth-last-child(2) { text-align: center; } /* Herkunft */
.stats-table [data-col="activeChlorine"] { font-weight: 500; }
.status-cell.status-ok { color: color-mix(in srgb, #059669 85%, var(--text)); }
.status-cell.status-high { color: color-mix(in srgb, #d97706 90%, var(--text)); }
.status-cell.status-low { color: color-mix(in srgb, #e11d48 85%, var(--text)); }
.is-estimated { color: var(--estimated); font-style: italic; font-weight: 400; cursor: help; }
/* Ohne Messwert (und ohne Schätzung bzw. bei ausgeschalteten Schätzungen): heller Strich "–" */
.no-value { color: var(--text-muted); opacity: .55; cursor: help; }
.no-value-alt { display: none; }
.hide-estimated .is-estimated { display: none; }
.hide-estimated .no-value-alt { display: inline; }
.hide-estimated .status-cell:has(> .is-estimated) { background: none; } /* ausgeblendete Schätzung: keine Ampelfarbe */
.source-badge { font-size: .75rem; color: var(--text-muted); }
/* Ausgeblendete Messungen (nur sichtbar nach "Alle wieder einblenden") */
.stats-table tr.row-hidden > * { opacity: .5; }
.stats-table tr.row-hidden > .cell-actions { opacity: 1; }
.inline-form { display: inline; margin: 0; }
.link-btn { padding: 0; border: 0; background: none; font: inherit; color: var(--primary); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--primary-strong); }
.row-actions { display: flex; gap: .15rem; justify-content: flex-end; }
.row-actions form { margin: 0; }
.icon-btn-danger { color: var(--text-muted); }
.icon-btn-danger:hover { color: #e11d48; background: color-mix(in srgb, #e11d48 10%, transparent); }
.modal-icon-danger { background: color-mix(in srgb, #e11d48 12%, var(--surface)); color: #e11d48; }
.cell-actions { width: 1%; }
.cell-actions .icon-btn { width: 34px; height: 34px; }
.stats-table.hide-freeChlorine [data-col="freeChlorine"],
.stats-table.hide-activeChlorine [data-col="activeChlorine"],
.stats-table.hide-totalChlorine [data-col="totalChlorine"],
.stats-table.hide-combinedChlorine [data-col="combinedChlorine"],
.stats-table.hide-ph [data-col="ph"],
.stats-table.hide-cya [data-col="cya"],
.stats-table.hide-alkalinity [data-col="alkalinity"],
.stats-table.hide-temperature [data-col="temperature"],
.stats-table.hide-bromine [data-col="bromine"],
.stats-table.hide-activeOxygen [data-col="activeOxygen"],
.stats-table.hide-hydrogenPeroxide [data-col="hydrogenPeroxide"] { display: none; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem; margin-top: 1rem; }
.page-link {
  min-width: 2.25rem; height: 2.25rem; padding: 0 .5rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-control);
  background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem;
}
a.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.is-current { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-link.is-disabled { opacity: .35; }
.page-gap { color: var(--text-muted); padding: 0 .15rem; }
.gap-mobile { display: none; }
/* Handy: Seitenzahlen nur ±1 um die aktuelle, erste/letzte Seite über die Zahlen (ohne « »), eine Zeile */
@media (max-width: 480px) {
  .pagination { flex-wrap: nowrap; gap: .25rem; }
  .page-link { min-width: 2rem; padding: 0 .35rem; }
  .page-far, .page-edge, .gap-desktop { display: none; }
  .gap-mobile { display: inline; }
}


/* Formular "Messung hinzufügen/bearbeiten" */
.modal.modal-form { width: min(640px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; overflow-x: hidden; text-align: left; }
.measurement-form h2 { font-size: 1.25rem; }
.modal p.measurement-hint, .content p.measurement-hint { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.measurement-page { max-width: 640px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.measurement-form input[type="datetime-local"] { width: 100%; padding: .5rem .9rem; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-control); }
/* iOS/Safari: Datumsfelder haben eine eigene Darstellung mit Mindestbreite (wären ~20 px breiter als die übrigen
   Felder und schieben das Popup seitlich) – auf normale Felddarstellung zurücksetzen */
.measurement-form input[type="datetime-local"] { display: block; min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; text-align: left; padding: calc(.7rem - 6px) .9rem; line-height: 1.5; } /* gleiche Höhe wie die Zahlenfelder */
.measurement-form input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; }
.measurement-form .field, .form-grid > * { min-width: 0; }
.form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .4rem; } /* Speichern + Abbrechen zusammen so breit wie die Felder */

/* Pooltagebuch: Tageskacheln – oben die Messwerte (eine Zeile, [+] klappt alle Messungen auf), darunter die Einträge */
.journal-days { display: grid; gap: 1rem; }
.journal-day { padding: 1rem 1.25rem; }
.journal-day-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.journal-day-head h2 { margin: 0; font-size: 1.05rem; }
.btn.journal-add { height: 2rem; padding: 0 .75em; gap: .3rem; font-size: .85rem; white-space: nowrap; }
.journal-add .icon { width: 1rem; height: 1rem; }
.journal-items { list-style: none; margin: 0; padding: 0; }
.journal-item { display: grid; grid-template-columns: 1.6rem 3.4rem minmax(0, 1fr) auto; gap: .5rem; align-items: start; padding: .55rem 0; border-top: 1px solid var(--border); }
.journal-icon { display: grid; place-items: center; height: 1.5rem; color: var(--primary); }
.journal-icon .icon { width: 1.15rem; height: 1.15rem; }
.journal-measurement .journal-icon { color: var(--text-muted); }
.journal-time { line-height: 1.5rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.journal-body { display: grid; gap: .15rem; min-width: 0; line-height: 1.5rem; }
.journal-label strong { font-weight: 600; }
.journal-sub, .journal-source { color: var(--text-muted); font-size: .85rem; }
.journal-values { display: flex; flex-wrap: wrap; gap: .1rem .9rem; line-height: 1.5rem; font-variant-numeric: tabular-nums; }
.journal-value { white-space: nowrap; }
.journal-value abbr { text-decoration: none; color: var(--text-muted); font-size: .85rem; }
.journal-value-time { color: var(--text-muted); font-size: .75rem; }
.content p.journal-note { margin: 0; white-space: pre-line; overflow-wrap: anywhere; text-align: left; }
.journal-note:not(:first-child) { color: var(--text-muted); }
.journal-item .row-actions { margin: -5px -7px 0 0; } /* Symbole (nicht die Klickflächen) bündig mit „+ Eintrag“ und [+] am rechten Rand */
.journal-item .row-actions .icon-btn { width: 34px; height: 34px; }
/* Messwerte mit mehreren Messungen: die Zeile ist der Aufklapper, rechts [+] bzw. [−] */
.journal-measures > summary { list-style: none; cursor: pointer; }
.journal-measures > summary::-webkit-details-marker { display: none; }
.journal-toggle { position: relative; display: block; width: 1.5rem; height: 1.5rem; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); }
.journal-toggle::before, .journal-toggle::after { content: ""; position: absolute; left: 50%; top: 50%; width: .7rem; height: 2px; background: currentColor; border-radius: 1px; transform: translate(-50%, -50%); }
.journal-toggle::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .15s; }
.journal-measures[open] .journal-toggle::after { transform: translate(-50%, -50%) rotate(0deg); }
:root[data-theme="dark"] .journal-toggle { border-color: color-mix(in srgb, var(--text) 45%, transparent); color: color-mix(in srgb, var(--text) 80%, transparent); }
:root[data-theme="dark"] .btn.journal-add { border-color: color-mix(in srgb, var(--text) 45%, transparent); } /* gleiche Rahmenfarbe wie [+] */
.journal-measures > summary:hover .journal-toggle, .journal-measures > summary:focus-visible .journal-toggle { color: var(--primary); border-color: var(--primary); }
.journal-measures > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.journal-measure-list .journal-item { border-top-style: dashed; font-size: .92rem; }
@media (max-width: 480px) {
  .journal-day { padding: .85rem .9rem; }
  .journal-item { grid-template-columns: 1.4rem 3rem minmax(0, 1fr) auto; gap: .4rem; }
}

/* Gesamtmengen im Zeitraum (Popup) */
.stats-toolbar > .journal-search-btn { margin-left: auto; width: 2.3rem; padding: 0; justify-content: center; flex: 0 0 auto; } /* Lupe + Gesamtmengen rechts bündig mit den Kacheln */
.journal-search-btn .icon { width: 1.15rem; height: 1.15rem; }
.journal-search .field[hidden] { display: none; }
.modal.journal-search p.muted { margin: 0 0 .5rem; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
/* Aktive Suche: Hinweisleiste über den Kacheln, passende Einträge hervorgehoben */
.journal-search-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .4rem .8rem; align-items: center; margin-bottom: 1rem; padding: .7rem 1rem; border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border)); border-radius: var(--radius); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.journal-search-bar-icon { color: var(--primary); display: grid; }
.journal-search-bar-icon .icon { width: 1.3rem; height: 1.3rem; }
.content .journal-search-bar p { margin: 0; text-align: left; }
.journal-search-bar-actions { display: flex; flex-wrap: wrap; gap: .3rem 1rem; justify-content: flex-end; }
.journal-search-bar .result-link { font-size: .88rem; font-weight: 500; white-space: nowrap; }
@media (max-width: 560px) {
  .journal-search-bar { grid-template-columns: auto minmax(0, 1fr); }
  .journal-search-bar-actions { grid-column: 2; justify-content: flex-start; }
}
.journal-item.is-match { margin: 0 -.5rem; padding-left: calc(.5rem - 1px); padding-right: calc(.5rem - 1px); background: color-mix(in srgb, var(--primary) 9%, transparent); border-radius: 6px; border: 1px solid color-mix(in srgb, var(--primary) 55%, var(--border)); }
.journal-item.is-match + .journal-item { border-top-color: transparent; } /* keine doppelte Linie unter dem Treffer */
.content p.journal-totals-period, .modal p.journal-totals-period { margin: 0 0 .9rem; font-weight: 500; text-align: center; }
.journal-totals-table { width: 100%; border-collapse: collapse; margin-bottom: .75rem; font-size: .92rem; text-align: left; }
.journal-totals-table th, .journal-totals-table td { padding: .4rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.journal-totals-table thead th { font-size: .78rem; color: var(--text-muted); font-weight: 600; }
.journal-totals-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.journal-totals-group th { padding-top: .8rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); }
.modal p.journal-totals-note { font-size: .82rem; text-align: left; }

/* Unter den Kacheln: Filter, Export, neuer Eintrag – passt die Reihe nicht, 2 + 2 gleich breite Buttons */
.journal-actions-wrap { container-type: inline-size; margin-top: 1rem; }
.journal-actions { justify-content: center; margin: 0; }
.journal-actions .dropdown-menu { top: auto; bottom: calc(100% + 8px); left: 50%; right: auto; transform: translateX(-50%); width: max-content; min-width: 240px; max-width: calc(100vw - 1rem); max-height: min(65vh, 32rem); overflow-y: auto; padding: .6rem .8rem; display: grid; gap: .35rem; }
.content .journal-filter-menu p { margin: 0; text-align: left; }
.journal-filter-hint { font-size: .82rem; }
.journal-filter-group { margin-top: .4rem !important; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.journal-filter-menu .check { white-space: nowrap; }
@container (max-width: 660px) {
  .journal-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
  .journal-actions > .btn, .journal-actions summary.btn { width: 100%; justify-content: center; padding: 0 .5em; font-size: .85rem; overflow: hidden; }
  .journal-actions .dropdown { position: static; min-width: 0; } /* Menü mittig unter der ganzen Leiste */
}
@container (max-width: 340px) {
  .journal-actions > .btn, .journal-actions summary.btn { font-size: .76rem; padding: 0 .3em; }
}

/* Formular "Tagebucheintrag": Art des Eintrags als Umschalter, Notizfeld */
.segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; margin: 0; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--bg); }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: .45rem .5rem; text-align: center; border-radius: calc(var(--radius-control) - 3px); font-weight: 500; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.segmented input:checked + span { background: var(--primary); color: var(--on-primary, #fff); }
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-soft); }
.journal-type-fields { display: grid; gap: 1rem; }
.journal-type-fields[hidden], .journal-form .field[hidden] { display: none; }
/* Rückfrage Liter oder m³ unter dem Feld Wassermenge */
.water-ask { display: grid; gap: .6rem; margin-top: .4rem; padding: .7rem .9rem; border-radius: var(--radius); background: color-mix(in srgb, #f59e0b 15%, var(--surface)); color: color-mix(in srgb, #b45309 80%, var(--text)); }
:root[data-theme="dark"] .water-ask { color: color-mix(in srgb, #fcd34d 85%, var(--text)); background: color-mix(in srgb, #f59e0b 16%, var(--surface)); }
.water-ask p { margin: 0; text-align: left; }
.water-ask-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.water-ask-actions .btn { padding: .5em .6em; font-size: .9rem; }
.field textarea { width: 100%; min-height: 5.5rem; padding: .6rem .9rem; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-control); resize: vertical; }
.field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #e11d48; }
.content p.journal-done { margin: 0; }
.journal-take { margin-top: .9rem; }
.journal-take .result-link { font-size: .88rem; font-weight: 500; }
.journal-take + .journal-take { margin-top: .35rem; }

/* Benutzerverwaltung (Admin) */
.admin-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: 0 0 1.25rem; }
.admin-summary .card { padding: .85rem 1rem; }
.admin-summary dt { font-size: .82rem; color: var(--text-muted); }
.admin-summary dd { margin: .15rem 0 0; font-size: 1.5rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.admin-search input[type="search"] { min-width: min(320px, 100%); }
.admin-table thead a { color: inherit; text-decoration: none; }
.admin-table thead a:hover { color: var(--primary); }
.admin-table .cell-email { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .4rem; white-space: normal; }
.admin-email { overflow-wrap: anywhere; }
.admin-table td:not(.num) { white-space: normal; }
.shell.shell-wide { max-width: 1460px; } /* Verwaltung: 100px breiter (nur am PC genutzt) */
.admin-log { font-size: .85rem; table-layout: fixed; }
.admin-log thead th:nth-child(1) { width: 2.4rem; }
.admin-log thead th:nth-child(2) { width: 10.5rem; }
.admin-log thead th:nth-child(3) { width: 10rem; }
.admin-log thead th:nth-child(4) { width: 12.5rem; }
.admin-log thead th:nth-child(n) { text-align: left; } /* gegen die Zentrierung aus .stats-table */
.admin-log th, .admin-log td { padding: .45rem .6rem; vertical-align: top; }
.admin-log td { white-space: normal; }
.admin-log .cell-select { text-align: center; padding-right: 0; }
.admin-log .cell-select input { width: 1rem; height: 1rem; margin: .1rem 0 0; accent-color: var(--primary); cursor: pointer; }
.admin-log .cell-date { white-space: nowrap; font-weight: 400; color: var(--text-muted); }
.admin-log .log-actor { display: block; margin-top: .1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.admin-log tbody tr:has(.cell-select input:checked) { background: color-mix(in srgb, var(--primary) 9%, transparent); }
.log-badge { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 500; background: var(--surface-2); color: var(--text-muted); }
.log-ok { color: #15803d; }
.log-badge.log-ok { background: color-mix(in srgb, #16a34a 14%, var(--surface)); color: color-mix(in srgb, #15803d 85%, var(--text)); }
.log-badge.log-warn { background: color-mix(in srgb, #f59e0b 18%, var(--surface)); color: color-mix(in srgb, #b45309 85%, var(--text)); }
.log-badge.log-bad { background: color-mix(in srgb, #dc2626 14%, var(--surface)); color: color-mix(in srgb, #b91c1c 85%, var(--text)); }
.log-badge.log-neutral { background: var(--primary-soft); color: var(--primary-strong); }
.log-email { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Details: eine Zeile, zu lang → "…"; "mehr" rechts daneben, aufgeklappt darunter */
.log-row { display: flex; flex-wrap: nowrap; align-items: baseline; column-gap: .6rem; }
.log-row:has(.log-more[open]) { flex-wrap: wrap; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.log-line { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-line > * + *::before { content: "·"; margin: 0 .4rem; color: var(--text-muted); font-weight: 400; }
.log-ip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; }
.log-outcome { font-weight: 500; }
.log-flag { color: #b91c1c; font-weight: 500; }
.log-more { flex: none; }
.log-more[open] { flex-basis: 100%; }
.log-more summary { display: inline; cursor: pointer; font-size: .78rem; color: var(--primary); list-style: none; white-space: nowrap; }
.log-more summary::-webkit-details-marker { display: none; }
.log-more summary::after { content: " ▾"; }
.log-more[open] summary::after { content: " ▴"; }
.log-facts { display: grid; gap: .15rem; margin: .3rem 0 0; padding: .4rem .6rem; font-size: .78rem; background: var(--surface-2); border-radius: var(--radius-control); }
.log-facts div { display: flex; gap: .5rem; }
.log-facts dt { flex: 0 0 8.5rem; color: var(--text-muted); }
.log-facts dd { margin: 0; overflow-wrap: anywhere; }
.log-facts code { font-size: .76rem; }
/* Rohdaten in eigener Zeile über die ganze Tabellenbreite (app.js) */
.admin-log tr.log-facts-row td { padding-top: 0; border-top: 0; }
.admin-log tr.log-facts-row .log-facts { margin: 0 0 .2rem; }
.admin-log tr:has(+ tr.log-facts-row) > * { border-bottom: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .log-flag { color: #f87171; } :root:not([data-theme="light"]) .log-ok { color: #4ade80; } }
:root[data-theme="dark"] .log-flag { color: #f87171; }
:root[data-theme="dark"] .log-ok { color: #4ade80; }
.log-auto { color: var(--text-muted); }
.badge-info { background: var(--primary-soft); color: var(--primary-strong); }
.badge-danger { background: color-mix(in srgb, #dc2626 15%, var(--surface)); color: color-mix(in srgb, #b91c1c 85%, var(--text)); }
.admin-user-form h2 { font-size: 1.25rem; }
.admin-user-form .account-facts { margin-bottom: 1.25rem; font-size: .92rem; }
.admin-verify { margin: 0 0 1.25rem; padding: .9rem 1rem; border-radius: var(--radius); background: color-mix(in srgb, #f59e0b 12%, var(--surface)); }
.admin-verify p, .modal .admin-verify p { margin: 0 0 .75rem; text-align: left; font-size: .9rem; }

/* Diagramm (grafische Statistik) */
.chart-card { position: relative; padding: 1rem; }
.chart-canvas { width: 100%; height: clamp(360px, 62vh, 640px); }
.chart-selects { position: absolute; z-index: 2; top: 1rem; left: 1rem; right: 1rem; display: grid; grid-template-columns: auto auto; grid-auto-flow: column; grid-template-rows: auto auto; justify-content: space-between; gap: .3rem 1rem; pointer-events: none; }
.chart-select { pointer-events: auto; }
.chart-right { justify-self: end; }
.chart-select select { min-width: 12rem; max-width: 100%; padding: .2rem .6rem; border: 1px solid transparent; border-radius: var(--radius-control); font: inherit; font-size: .85rem; font-weight: 500; color: #fff; cursor: pointer; }
.chart-slot-0 select { background: var(--chart-1); }
.chart-slot-1 select { background: var(--chart-2); }
.chart-slot-2 select { background: var(--chart-3); }
.chart-slot-3 select { background: var(--chart-4); }
.chart-select select option { color: var(--text); background: var(--surface); }
.chart-select select:has(option[value=""]:checked) { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }
.chart-empty { position: absolute; inset: 45% 0 auto; text-align: center; }
.chart-tip-head { margin-bottom: .3rem; font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chart-select select { color: #06121c; } }
:root[data-theme="dark"] .chart-select select { color: #06121c; }
@media (max-width: 760px) {
  /* Handy: Auswahllisten über dem Diagramm, zwei Spalten */
  .chart-selects { position: static; grid-template-columns: 1fr 1fr; margin-bottom: .5rem; }
  .chart-select select { min-width: 0; width: 100%; }
  .chart-right { justify-self: stretch; }
  .chart-canvas { height: 420px; }
}

/* Datenimport (LabCom) */
.import-steps { max-width: 720px; }
.import-steps h2 { display: flex; align-items: center; gap: .6rem; }
.step-no { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong); font-size: .9rem; font-weight: 600; flex-shrink: 0; }
.import-status { margin: 0 0 1rem; font-weight: 500; }
.import-status.is-ok { color: color-mix(in srgb, #059669 85%, var(--text)); }
.import-status.is-error { color: color-mix(in srgb, #e11d48 85%, var(--text)); }
.import-steps .field select { width: 100%; }

/* Handy: jede Messung als Karte */
@media (max-width: 760px) {
  .table-wrap { overflow: visible; background: none; border: 0; box-shadow: none; }
  .stats-table, .stats-table tbody { display: block; }
  .stats-table thead { display: none; }
  .stats-table tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: .25rem 1rem;
    margin-bottom: .75rem; padding: .85rem 1rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .stats-table th, .stats-table td { padding: 0; border: 0; white-space: normal; }
  .stats-table .cell-date { grid-column: 1 / -2; font-size: 1rem; }
  .stats-table .cell-actions { grid-column: -2; grid-row: 1; justify-self: end; width: auto; }
  .stats-table td[data-label] { display: flex; flex-direction: column; text-align: left; }
  .stats-table tr { font-size: 1rem; }
  .stats-table td[data-label]::before { content: attr(data-label); font-size: .82rem; color: var(--text-muted); font-style: normal; font-weight: 400; }
  /* Herkunft über die ganze Breite, mittig als „Herkunft: LabCom“ */
  .stats-table td.cell-source { grid-column: 1 / -1; flex-direction: row; justify-content: center; align-items: baseline; gap: .3em; text-align: center; }
  .stats-table td.cell-source::before { content: attr(data-label) ":"; }
  .stats-table td.cell-source .source-badge { font-size: .82rem; }
  .stats-table td[data-label]:empty { display: none; }
  /* Protokoll als kompakte Karte: Häkchen + Zeitpunkt + Aktion oben, darunter Konto und Details */
  .admin-log tr { grid-template-columns: auto 1fr auto; gap: .3rem .6rem; padding: .7rem .85rem; font-size: .88rem; }
  .admin-log td { display: block !important; }
  .admin-log .cell-select { grid-column: 1; grid-row: 1; }
  .admin-log .cell-date { grid-column: 2; grid-row: 1; font-size: .85rem; }
  .admin-log td:nth-child(3) { grid-column: 3; grid-row: 1; justify-self: end; }
  .admin-log td:nth-child(n+4) { grid-column: 1 / -1; }
  .admin-log .log-email { font-weight: 500; }
  .admin-log .log-line { white-space: normal; }
}

/* ==========================================================================
   Popup (z. B. "Konto erforderlich")
   ========================================================================== */
.modal {
  width: min(440px, calc(100vw - 2rem));
  padding: 2rem 1.75rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-hover);
  text-align: center;
}
.modal::backdrop { background: rgb(4 16 26 / 0.5); backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-close { position: absolute; top: .5rem; right: .5rem; }
.modal-icon, .auth-required .modal-icon {
  display: inline-grid; place-items: center;
  width: 52px; height: 52px;
  margin-bottom: .75rem;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-strong);
}
.modal-icon .icon { width: 26px; height: 26px; }
.modal h2, .auth-required h2 { font-size: 1.25rem; }
.modal p, .content .auth-required p { color: var(--text-muted); text-align: center; }
.modal p.auth-required-text, .content .auth-required p.auth-required-text { text-align: justify; hyphens: auto; -webkit-hyphens: auto; } /* Hinweis „Login nötig“ im Blocksatz */
.modal .confirm-option { justify-content: center; margin-top: .75rem; }
.modal-actions { display: grid; gap: .6rem; margin-top: 1.25rem; }
.auth-required { max-width: 520px; text-align: center; padding: 2rem 1.75rem; }

/* ==========================================================================
   Tablet & Handy
   ========================================================================== */
/* Ausklappmenü: schmale Fenster und niedrige Fenster (z. B. Handy im Querformat) */
@media (max-width: 960px), (max-height: 520px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-flex; }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(var(--sidebar-w), 88vw);
    height: 100vh;
    height: 100dvh;
    max-height: none;
    -webkit-overflow-scrolling: touch;
    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-hover);
    transform: translateX(-105%);
    transition: transform .25s ease;
    padding-top: 1rem;
  }
  .nav-open .sidebar { transform: none; }
  .nav-link { padding-top: calc(.45rem + 2px); padding-bottom: calc(.45rem + 2px); } /* +4px Abstand je Unterpunkt */
  .nav-open { overflow: hidden; } /* Seite dahinter festhalten, solange das Menü offen ist */
  .sidebar { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }

  .sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 .25rem 1rem .75rem;
    font-weight: 400;
  }

  .backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgb(4 16 26 / 0.45);
    backdrop-filter: blur(2px);
  }
  .backdrop[hidden] { display: none; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 .75rem; gap: .4rem; }
  .btn-login span, .hide-sm { display: none; }
  .btn-login { width: 42px; height: 42px; padding: 0; }
  .content { padding: 1.25rem 1rem 2rem; }
  .card-accent { flex-direction: column; align-items: flex-start; }
  .auth-card { padding: 1.5rem 1.25rem; margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
.import-steps .alert { margin: 0; }
.import-skipped-title { margin: .6rem 0 .2rem; font-weight: 600; }
.import-skipped { margin: 0; padding-left: 1.2rem; font-size: .9rem; }
sup.reg { font-size: .7em; line-height: 0; vertical-align: super; margin-left: .05em; }
.has-basis { cursor: help; text-decoration: underline dotted color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 3px; }
.placeholder-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: .5rem; }

/* --- Admin: SEO ------------------------------------------------------------ */
.counter { font-size: .78rem; font-variant-numeric: tabular-nums; color: var(--text-muted); white-space: nowrap; }
.counter.is-warn { color: #d97706; font-weight: 600; }
.counter.is-over { color: #e11d48; font-weight: 600; }
.seo-table .seo-page a { font-weight: 600; }
.seo-table .seo-page small { display: block; font-weight: 400; color: var(--text-muted); font-size: .75rem; }
.seo-table .seo-title-cell { white-space: normal; min-width: 18rem; }
.seo-table .seo-title-text { margin-right: .4rem; }
.seo-lang { font-size: .55em; font-weight: 600; vertical-align: middle; padding: .1em .45em; border-radius: 6px; background: var(--primary-soft); color: var(--primary); }
.seo-form { display: grid; gap: 1.25rem; max-width: 820px; }
.seo-form .form-card { display: grid; gap: 1rem; }
.seo-form .form-card h2 { margin-bottom: 0; }
.seo-label { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.seo-label label { font-weight: 600; font-size: .9rem; }
.seo-field textarea, .seo-form select {
  width: 100%; padding: .6rem .75rem; font: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); resize: vertical;
}
.seo-field textarea:focus, .seo-form select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.seo-sitemap-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; }
.seo-actions { display: flex; justify-content: flex-end; gap: .6rem; }
/* Vorschau wie in den Google-Suchergebnissen */
.serp-preview { display: grid; gap: .15rem; padding: 1rem 1.1rem; border-radius: var(--radius-control); background: #fff; color: #202124; font-family: Arial, sans-serif; border: 1px solid var(--border); }
.serp-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #70757a; margin-bottom: .3rem; font-family: inherit; }
.serp-url { font-size: .8rem; color: #4d5156; }
.serp-title { font-size: 1.25rem; line-height: 1.3; color: #1a0dab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 600px; }
.serp-desc { font-size: .875rem; line-height: 1.55; color: #4d5156; max-width: 600px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Vorschau wie eine geteilte Link-Karte */
.og-preview { max-width: 520px; border: 1px solid var(--border); border-radius: var(--radius-control); overflow: hidden; background: var(--surface-2); }
.og-preview img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; }
.og-text { display: grid; gap: .2rem; padding: .7rem .9rem; }
.og-host { font-size: .75rem; text-transform: uppercase; color: var(--text-muted); }
.og-title { font-weight: 600; }
.og-desc { font-size: .85rem; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.coming-soon { font-size: 1.3rem; font-weight: 500; color: var(--text); }

/* --- Cookie-Hinweis (unten, über allem) – im Stil des Teaser-Videos: Tropfen, Farbschimmer, leuchtender Rand --- */
.cookie-notice {
  position: fixed; z-index: 1000; left: 50%; bottom: 1.25rem; transform: translateX(-50%);
  width: min(700px, calc(100% - 2rem));
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.1rem 1rem 1.2rem; border-radius: 14px;
  background:
    radial-gradient(120% 140% at 0% 100%, rgb(34 211 238 / .16), transparent 55%),
    radial-gradient(90% 120% at 100% 0%, rgb(99 102 241 / .12), transparent 60%),
    var(--surface);
  border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent);
  box-shadow: 0 18px 50px rgb(15 34 51 / .22), 0 0 0 4px color-mix(in srgb, var(--primary) 8%, transparent);
  animation: cookie-in .45s cubic-bezier(.2, .8, .2, 1) both;
}
.cookie-drop { flex-shrink: 0; width: 40px; height: 50px; filter: drop-shadow(0 0 10px rgb(34 211 238 / .55)); animation: cookie-bob 3.2s ease-in-out infinite; }
.cookie-notice p { flex: 1; margin: 0; font-size: .9rem; line-height: 1.5; color: var(--text); }
.cookie-notice .cookie-title { font-size: 1rem; color: var(--primary-strong); }
.cookie-notice .btn { flex-shrink: 0; }
/* Dunkles Design: dunkler als die Seite, mit kräftigerem Schimmer und leuchtendem Rand */
:root[data-theme="dark"] .cookie-notice {
  background:
    radial-gradient(120% 140% at 0% 100%, rgb(8 145 178 / .38), transparent 55%),
    radial-gradient(90% 120% at 100% 0%, rgb(67 56 202 / .34), transparent 60%),
    #05090f;
  border-color: rgb(34 211 238 / .55);
  box-shadow: 0 20px 60px rgb(0 0 0 / .6), 0 0 32px rgb(34 211 238 / .22);
}
:root[data-theme="dark"] .cookie-notice .cookie-title { color: var(--primary); }
@keyframes cookie-in { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes cookie-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .cookie-notice, .cookie-drop { animation: none; } }
@media (max-width: 520px) {
  .cookie-notice { flex-wrap: wrap; gap: .75rem; bottom: .75rem; }
  .cookie-notice p { flex: 1 1 calc(100% - 56px); }
  .cookie-notice .btn { flex: 1 1 100%; }
}

/* --- Admin: Statistik ------------------------------------------------------- */
.admin-stats-block { margin-bottom: 2rem; }
.admin-stats-block h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.admin-stats th[scope="row"] { font-weight: 500; text-align: left; }
.admin-stats .total-input {
  width: 8rem; text-align: right; padding: .35rem .5rem; font: inherit; font-variant-numeric: tabular-nums;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control);
}
.admin-stats .total-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.admin-stats-actions { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .75rem; }
.admin-stats-block .table-wrap + .admin-stats-top { margin-top: 1rem; }
.admin-stats .visitors-humans th, .admin-stats .visitors-humans td { font-weight: 600; color: var(--primary-strong); }
.admin-stats .visitors-sub th { font-weight: 400; }
/* Unterzeilen (KI-Crawler nach Zweck): in der Tabelle eingerückt, in der Kartenansicht mit Vorsatz „KI-Crawler –“ */
.admin-stats .sub-prefix { display: none; }
@media (min-width: 761px) { .admin-stats .visitors-sub th { padding-left: 1.75rem; } }
@media (max-width: 760px) { .admin-stats .visitors-sub .sub-prefix { display: inline; } }
.admin-stats .visitors-sub th, .admin-stats .visitors-sub td { font-size: .85rem; color: var(--text-muted); }
.admin-stats-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.admin-stats-top h3 { font-size: .95rem; margin: 0 0 .5rem; }
.admin-stats-top ol { margin: 0; padding-left: 1.2rem; font-size: .88rem; }
.admin-stats-top li { display: list-item; }
.admin-stats-top li span.num { float: right; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.import-howto { margin: 0 0 1rem; padding-left: 1.3rem; display: grid; gap: .35rem; font-size: .92rem; }
.file-input {
  width: 100%; padding: .55rem; font: inherit; font-size: .9rem; color: var(--text);
  background: var(--surface); border: 1px dashed color-mix(in srgb, var(--primary) 50%, var(--border)); border-radius: var(--radius-control);
}
.file-input::file-selector-button {
  margin-right: .8rem; padding: .45rem .9rem; border: 0; border-radius: var(--radius-control);
  background: var(--primary-soft); color: var(--primary-strong); font: inherit; font-weight: 600; cursor: pointer;
}
.admin-stats .import-source-head th { background: var(--surface-2); font-weight: 600; color: var(--primary-strong); text-align: left; }
.result-list .result-link { display: inline-block; margin-top: .3rem; font-size: .88rem; font-weight: 500; }
.calc-result { scroll-margin-top: calc(var(--topbar-h) + .75rem); } /* Scrollen zum Ergebnis: nicht unter der Kopfzeile */

/* Statistik-Rundgänge im Artikel "Was berechnet dieses Tool" (partials/stats-teaser): zwei Videos nebeneinander,
   am Handy untereinander, je mit Beschriftung; Play-Button wie beim Startseiten-Video (.teaser-play) */
.stats-teaser { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 1.25rem 0 1.5rem; }
.stats-teaser-video { margin: 0; min-width: 0; }
.stats-teaser-frame { position: relative; }
.stats-teaser-video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--radius); border: 1px solid var(--border); background: #05090f; }
.stats-teaser-video .teaser-play { transform: translate(-50%, -50%) scale(.7); }
.stats-teaser figcaption { margin-top: .4rem; font-size: .85rem; color: var(--text-muted); font-style: italic; text-align: center; }
@media (max-width: 620px) { .stats-teaser { grid-template-columns: 1fr; gap: 1rem; } }

/* Auswahlfeld mit Hilfe-Button "?" rechts daneben (Rechner, z. B. Chlorprodukt) */
.select-with-help { display: flex; align-items: center; gap: .6rem; }
.select-with-help select { flex: 1; min-width: 0; }
.select-with-help .help-btn { margin-top: 0; margin-left: -1px; }
/* Hilfe Chlorprodukt: Treffer mit "Übernehmen" */
.product-help .field { margin: 1rem 0 .9rem; }
/* Eingabefeld deutlich vom Ergebnisfeld darunter absetzen (v. a. im hellen Design): kräftiger Rahmen, leichter Schatten */
.product-help #product-identify {
  padding: .8rem 1rem; font-size: 1.05rem; background: var(--surface);
  border: 2px solid color-mix(in srgb, var(--primary) 60%, var(--border));
  box-shadow: 0 2px 10px rgb(15 40 60 / .12);
}
.product-help #product-identify:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft), 0 2px 10px rgb(15 40 60 / .12); }
.product-help-drop { display: block; width: 48px; height: auto; margin: 0 auto .6rem; filter: drop-shadow(0 0 10px rgb(34 211 238 / .35)); } /* HydroKontor-Tropfen mit Augen */
.product-help .product-help-text { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.product-match { display: grid; justify-items: center; gap: .3rem; padding: 1rem 1.25rem 1.1rem; margin-bottom: 1rem; border-radius: var(--radius); background: var(--primary-soft); text-align: center; }
.product-match p { margin: 0; }
.modal-help .product-match-text { color: var(--text-muted); font-size: .9rem; }
.modal-help .product-match-name { font-size: 1.35rem; font-weight: 700; color: var(--primary-strong); line-height: 1.25; }
.modal-help .product-match-substance { font-size: .92rem; color: var(--text); }
.modal-help .product-match-type { font-size: .92rem; color: var(--text); }
.product-match :is(.product-match-name, .product-match-substance, .product-match-type):empty { display: none; }
.modal-help .product-match.is-waiting .product-match-text { font-style: italic; }
.product-match.is-wrong { background: color-mix(in srgb, #f59e0b 15%, var(--surface)); }
.modal-help .product-match.is-wrong .product-match-text { color: color-mix(in srgb, #d97706 90%, var(--text)); font-size: .95rem; font-weight: 500; }
.product-match-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .5rem; }
.product-match-buttons:empty { display: none; }

/* --- Admin: Wartung (Wartungsmodus, Backup, Restore) --------------------------------- */
.maintenance-status { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 .75rem; }
.maintenance-list { margin: 0 0 1rem; padding-left: 1.2rem; font-size: .9rem; }
.maintenance-hint { margin: 0 0 1rem; font-size: .9rem; color: color-mix(in srgb, #d97706 90%, var(--text)); }
.maintenance-safety { margin: 0; padding: 0; list-style: none; display: grid; gap: .4rem; }
.maintenance-safety a { display: inline-flex; align-items: center; gap: .4rem; }
