/* GreenNose V2 - Dashboard
   Farbrollen: validierte Kategorial-Palette, Reihenfolge fest pro
   Messgroesse - eine Groesse behaelt ihre Farbe ueber alle Ansichten.
   Geprueft mit dem Palettenvalidator in beiden Modi: Wassertank liegt hell
   unter 3:1 Kontrast und Tank/CO2 unter CVD bei dE 6.9 - beides ist nur
   zulaessig, weil jede Kurve zusaetzlich am Endpunkt beschriftet ist, eine
   Legende traegt und es zu jedem Diagramm eine Tabellenansicht gibt. */

:root {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --surface-2: #f4f4f1;
  --plane: #f9f9f7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);

  --s-temp: #eb6834;
  --s-hum: #2a78d6;
  --s-co2: #e34948;
  --s-tank: #1baf7a;
  --s-batt: #4a3aa7;
  --s-lead: #008300;

  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 11, 11, .05), 0 8px 24px rgba(11, 11, 11, .04);
  --shadow-lift: 0 2px 4px rgba(11, 11, 11, .06), 0 14px 30px rgba(11, 11, 11, .09);
  --ease: cubic-bezier(.4, 0, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --surface-2: #232322;
    --plane: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);

    --s-temp: #d95926;
    --s-hum: #3987e5;
    --s-co2: #e66767;
    --s-tank: #199e70;
    --s-batt: #9085e9;
    --s-lead: #008300;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .5), 0 14px 30px rgba(0, 0, 0, .4);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #1a1a19;
  --surface-2: #232322;
  --plane: #0d0d0d;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);

  --s-temp: #d95926;
  --s-hum: #3987e5;
  --s-co2: #e66767;
  --s-tank: #199e70;
  --s-batt: #9085e9;
  --s-lead: #008300;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .5), 0 14px 30px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  /* Hauch von Farbe oben - bleibt unter der Wahrnehmungsschwelle fuer
     "bunt", nimmt der Flaeche aber das Sterile */
  background:
    radial-gradient(1100px 520px at 15% -10%,
      color-mix(in srgb, var(--s-tank) 7%, transparent), transparent 60%),
    radial-gradient(900px 420px at 92% -8%,
      color-mix(in srgb, var(--s-hum) 5%, transparent), transparent 55%),
    var(--plane);
  background-attachment: fixed;
  color: var(--text-primary);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: 22px 20px 56px;
}

.wrap { max-width: min(1900px, 97vw); margin: 0 auto; }

/* ---------- Ladebalken statt Abdunkeln ----------
   Frueher wurde die ganze Seite bei jedem Update kurz dunkler - das las
   sich als Blinken. Jetzt bleibt der Inhalt unangetastet stehen (kein
   Skelett, kein Layoutsprung) und nur dieser Balken zeigt Betrieb an. */
.loadbar {
  position: fixed; inset: 0 auto auto 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--s-tank), var(--s-hum));
  z-index: 60; opacity: 0; pointer-events: none;
  transition: width .5s var(--ease), opacity .25s var(--ease);
}
.loadbar.run { width: 78%; opacity: 1; }
.loadbar.done { width: 100%; opacity: 0; transition: width .2s, opacity .35s .1s; }

/* ---------- Kopfzeile ---------- */
header {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap; margin-bottom: 4px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo svg { width: 30px; height: 30px; }
h1 { font-size: 21px; font-weight: 650; letter-spacing: -.01em; }
h1 em { font-style: normal; color: var(--s-tank); }
.sub { font-size: 12.5px; color: var(--text-muted); margin-bottom: 16px; }
.sub a { color: inherit; }

.status {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-1);
  font-size: 12.5px; color: var(--text-secondary);
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted); flex: none;
}
.status.on .dot {
  background: var(--good);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent);
  animation: pulse 2.6s var(--ease) infinite;
}
.status.off .dot { background: var(--critical); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.spacer { flex: 1 1 auto; }

.iconbtn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface-1);
  color: var(--text-secondary); border-radius: 10px;
  padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease),
              transform .12s var(--ease);
}
.iconbtn:hover { color: var(--text-primary); border-color: var(--axis); }
.iconbtn:active { transform: translateY(1px); }

.ic {
  width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}
.warn { color: var(--warning); }
.bad { color: var(--critical); }

/* ---------- Reiter ---------- */
.tabs {
  position: relative; display: flex; gap: 2px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border); overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: transparent; color: var(--text-muted);
  font: inherit; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  padding: 10px 14px 11px; border-radius: 10px 10px 0 0;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.tab:hover { color: var(--text-secondary); background: var(--surface-2); }
.tab[aria-selected="true"] { color: var(--text-primary); font-weight: 600; }
.tab[aria-selected="true"] .ic { color: var(--s-tank); }
/* Der Strich wandert mit - macht den Wechsel greifbar statt sprunghaft */
.tabink {
  position: absolute; bottom: -1px; height: 2px; border-radius: 2px;
  background: var(--s-tank); width: 0; left: 0;
  transition: left .32s var(--ease), width .32s var(--ease);
}
@media (max-width: 620px) { .tab span { display: none; } .tab { padding: 11px 16px; } }

/* Panel-Wechsel: kurz einblenden, ohne Layoutsprung */
.panel[hidden] { display: none; }
.panel { animation: panelIn .28s var(--ease); }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Kacheln ---------- */
.tiles {
  display: grid; gap: 12px; margin-bottom: 14px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.tile {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 15px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease);
}
.tile::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--tc, transparent); opacity: .85;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.tile .k {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 7px;
}
.swatch { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.tile .v { font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.tile .v small { font-size: 15px; font-weight: 500; color: var(--text-secondary); margin-left: 3px; }
.tile .sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
/* Kurzes Aufleuchten, wenn sich ein Wert wirklich geaendert hat */
@keyframes bump {
  0% { color: var(--tc); }
  100% { color: inherit; }
}
.tile .v.changed { animation: bump 1.1s var(--ease); }

/* ---------- Karten & Raster ---------- */
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.charts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 16px 12px; box-shadow: var(--shadow);
  min-width: 0;
}
.card.wide { grid-column: 1 / -1; }
.card h2 {
  font-size: 13.5px; font-weight: 600; color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px; margin-bottom: 2px;
}
.card .now { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.card .now small { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-left: 2px; }
.cardhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cardtools { display: flex; align-items: center; gap: 6px; flex: none; }
.lbl { font-size: 12.5px; color: var(--text-muted); }

.kvlist { margin-top: 8px; }
.kvrow { display: flex; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--grid); font-size: 13px; }
.kvrow:last-child { border-bottom: 0; }
.kvrow .k { color: var(--text-muted); min-width: 132px; }
.kvrow .v { color: var(--text-secondary); word-break: break-all; }

.todaygrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 12px; margin: 10px 0 6px;
}
.todaygrid .k { font-size: 11.5px; color: var(--text-muted); }
.todaygrid .v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.todaygrid .s { font-size: 11.5px; color: var(--text-muted); }

/* ---------- Tank-Anzeige ---------- */
.tankwrap { display: flex; gap: 16px; align-items: stretch; margin-top: 10px; }
.tankviz {
  position: relative; width: 82px; flex: none; min-height: 128px;
  border: 1px solid var(--axis); border-radius: 6px 6px 10px 10px;
  overflow: hidden; background: var(--surface-2);
}
.tankfill {
  position: absolute; inset: auto 0 0 0; height: 0;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--s-tank) 72%, transparent),
    color-mix(in srgb, var(--s-tank) 42%, transparent));
  transition: height .9s var(--ease);
}
.tankfill::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--s-tank);
}
.tanklabel {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: 17px; font-weight: 650;
  color: var(--text-primary); text-shadow: 0 1px 3px var(--surface-1);
}
.tankinfo { flex: 1 1 auto; display: flex; flex-direction: column; gap: 7px; justify-content: center; }
.tankinfo .row { font-size: 13px; color: var(--text-secondary); }
.tankinfo .row b { font-variant-numeric: tabular-nums; }
.tankinfo .big { font-size: 15px; }

/* ---------- Filterzeile ---------- */
.filters {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin: 0 0 14px;
}
.chip {
  border: 1px solid var(--border); background: var(--surface-1);
  color: var(--text-secondary); border-radius: 999px;
  padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background .16s var(--ease), color .16s var(--ease),
              border-color .16s var(--ease), transform .12s var(--ease);
}
.chip:hover { color: var(--text-primary); border-color: var(--axis); }
.chip:active { transform: translateY(1px); }
.chip[aria-pressed="true"] {
  background: var(--text-primary); color: var(--plane);
  border-color: var(--text-primary); font-weight: 550;
}
.chip:disabled { opacity: .35; cursor: not-allowed; }
.navgroup { display: flex; gap: 6px; margin-left: 10px;
  padding-left: 12px; border-left: 1px solid var(--border); }
.chip.nav { padding: 6px 11px; font-size: 12px; }
.winlabel { font-variant-numeric: tabular-nums; margin-left: 8px; }

/* ---------- Schalter ---------- */
.switch {
  display: inline-flex; align-items: flex-start; gap: 9px; cursor: pointer;
  font-size: 13px; color: var(--text-secondary); user-select: none;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  position: relative; width: 34px; height: 20px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); flex: none;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%; background: var(--text-muted);
  transition: transform .22s var(--ease), background .2s var(--ease);
}
.switch input:checked + .track { background: color-mix(in srgb, var(--s-tank) 28%, transparent); border-color: var(--s-tank); }
.switch input:checked + .track::after { transform: translateX(14px); background: var(--s-tank); }
.switch input:focus-visible + .track { outline: 2px solid var(--s-hum); outline-offset: 2px; }
.switch.big { display: flex; margin-bottom: 14px; }
.switch.big .switchlbl { font-size: 13.5px; color: var(--text-primary); }
.switchlbl em { display: block; font-style: normal; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Vergleichsfenster ---------- */
#comparecard { margin-bottom: 14px; }
.cmpchecks { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 10px 0 4px; }
.cmpitem {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 13px; color: var(--text-secondary); margin: 0;
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px 4px 8px;
  transition: color .15s var(--ease), border-color .15s var(--ease),
              background .15s var(--ease);
}
.cmpitem:hover { color: var(--text-primary); border-color: var(--axis); }
.cmpitem:has(input:checked) { background: var(--surface-2); border-color: var(--axis); color: var(--text-primary); }
.cmpitem input { accent-color: var(--s-tank); margin: 0; }
.cmpunit { color: var(--text-muted); font-size: 11px; }
.cmplegend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px;
  font-size: 12.5px; color: var(--text-secondary); }
.cmplegend .lg { display: inline-flex; align-items: center; gap: 6px; }
.cmplegend i { color: var(--text-muted); font-style: normal; font-size: 11px; }
.norm-note { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }

/* ---------- Diagramme ---------- */
.plot { position: relative; margin-top: 6px; }
.plot svg { display: block; width: 100%; touch-action: pan-y; }
.plot svg:focus-visible { outline: 2px solid var(--s-hum); outline-offset: 2px; border-radius: 6px; }
/* Linien zeichnen sich beim ersten Aufbau einmal kurz - danach nicht mehr,
   sonst wuerde jedes 20-Sekunden-Update zappeln. */
@media (prefers-reduced-motion: no-preference) {
  body:not(.ready) .plot path.line {
    stroke-dasharray: var(--len); stroke-dashoffset: var(--len);
    animation: draw .85s var(--ease) forwards;
  }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.empty {
  height: 150px; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 13px;
}
.miniranges { display: flex; gap: 3px; }
.minichip {
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  border-radius: 7px; padding: 3px 7px; font: inherit; font-size: 11px; cursor: pointer;
  line-height: 1.3; transition: color .15s var(--ease), background .15s var(--ease);
}
.minichip:hover { color: var(--text-primary); }
.minichip[aria-pressed="true"] {
  background: var(--text-primary); color: var(--plane);
  border-color: var(--text-primary); font-weight: 600;
}
.tblbtn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  border-radius: 7px; padding: 3px 8px; font: inherit; font-size: 12px; cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.tblbtn:hover { color: var(--text-primary); }
.tblbtn.on { background: var(--text-primary); color: var(--plane); border-color: var(--text-primary); }

/* Tabellenansicht (Zwilling zu jedem Diagramm) */
.tblwrap { max-height: 260px; overflow: auto; margin-top: 8px; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th { color: var(--text-muted); font-weight: 550; position: sticky; top: 0; background: var(--surface-1); }
td.num, th.num { text-align: right; }
tbody tr { transition: background .12s var(--ease); }
tbody tr:hover { background: var(--surface-2); }

/* Tooltip */
.tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 9px; padding: 6px 9px; box-shadow: var(--shadow);
  font-size: 12.5px; white-space: nowrap; opacity: 0;
  transition: opacity .12s var(--ease);
}
.tip b { font-variant-numeric: tabular-nums; }
.tip .t { color: var(--text-muted); font-size: 11px; display: block; }

/* ---------- Kalender ---------- */
.calendar {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
  box-shadow: var(--shadow); width: fit-content;
  animation: panelIn .2s var(--ease);
}
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; font-size: 13.5px; font-weight: 600; margin-bottom: 8px;
}
.cal-nav {
  border: 1px solid var(--border); background: transparent; color: var(--text-secondary);
  border-radius: 7px; padding: 1px 9px; font-size: 14px; cursor: pointer; line-height: 1.5;
}
.cal-nav:hover { color: var(--text-primary); }
.cal-grid {
  display: grid; grid-template-columns: repeat(8, 34px); gap: 2px;
  font-variant-numeric: tabular-nums;
}
.cal-dow, .cal-kw {
  font-size: 10.5px; color: var(--text-muted); text-align: center;
  padding: 3px 0; font-weight: 600;
}
.cal-kw.btn {
  border: 1px solid transparent; background: transparent; cursor: pointer;
  border-radius: 6px; font: inherit; font-size: 10.5px; color: var(--text-muted);
}
.cal-kw.btn:hover { border-color: var(--border); color: var(--text-primary); }
.cal-kw.btn.sel { background: var(--s-hum); color: #fff; border-color: var(--s-hum); }
.cal-day {
  border: 1px solid transparent; background: transparent; color: var(--text-secondary);
  border-radius: 7px; padding: 5px 0; font: inherit; font-size: 12px; cursor: pointer;
  font-variant-numeric: tabular-nums; transition: background .14s var(--ease);
}
.cal-day:hover:not(:disabled) { border-color: var(--border); color: var(--text-primary); }
.cal-day.other { opacity: .35; }
.cal-day.future { opacity: .2; cursor: not-allowed; }
.cal-day.today { font-weight: 700; text-decoration: underline; }
.cal-day.inweek { background: color-mix(in srgb, var(--s-hum) 16%, transparent); }
.cal-day.sel { background: var(--s-hum); color: #fff; font-weight: 650; }

/* ---------- Bedienelemente ---------- */
.pumprow { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
label { display: block; font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px; }
input[type=number], input[type=text], input[type=time], select {
  background: var(--plane); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: 9px; padding: 8px 10px; font: inherit;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input[type=number] { width: 100px; }
input:focus-visible, select:focus-visible {
  outline: none; border-color: var(--s-hum);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--s-hum) 20%, transparent);
}
.btn {
  border: 0; border-radius: 9px; padding: 9px 16px;
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--s-tank); color: #fff;
  transition: filter .15s var(--ease), transform .12s var(--ease),
              box-shadow .15s var(--ease);
}
.btn:not(:disabled):hover { filter: brightness(1.07); box-shadow: 0 4px 14px color-mix(in srgb, var(--s-tank) 30%, transparent); }
.btn:not(:disabled):active { transform: translateY(1px); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn.ghost:hover { filter: none; box-shadow: none; border-color: var(--axis); color: var(--text-primary); }
.btn.danger { background: var(--critical); color: #fff; }
.btn.danger:hover { box-shadow: 0 4px 14px color-mix(in srgb, var(--critical) 30%, transparent); }
.btn.sec2 { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--border); }
.btn.sec2:hover { box-shadow: none; border-color: var(--axis); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.hint { font-size: 12px; color: var(--text-muted); margin-top: 9px; }

.banner {
  display: none; align-items: center; gap: 8px; margin-top: 10px;
  padding: 8px 11px; border-radius: 9px; font-size: 13px;
  border: 1px solid var(--border);
}
.banner.show { display: flex; animation: panelIn .22s var(--ease); }
.banner.ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.banner.err { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 35%, transparent); }
.banner.warn { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }

/* ---------- Gießplan-Editor ---------- */
#planrows { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.planrow {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 5px 7px; background: var(--plane);
  font-size: 13px; color: var(--text-secondary);
  animation: panelIn .2s var(--ease);
}
.planrow input[type=time] { padding: 4px 6px; border-radius: 7px; background: var(--surface-1); }
.planrow input[type=number] { width: 62px; padding: 4px 6px; border-radius: 7px; background: var(--surface-1); }
.pl-u { color: var(--text-muted); font-size: 12px; }
.pl-x {
  border: 0; background: transparent; color: var(--text-muted);
  font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px;
  transition: color .15s var(--ease);
}
.pl-x:hover { color: var(--critical); }

/* ---------- Geräteeinstellungen ---------- */
.cfggroup { margin-bottom: 14px; }
.cfggroup h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); margin-bottom: 6px; font-weight: 600;
}
.cfgrow { display: flex; flex-wrap: wrap; gap: 10px; }
.cfgrow > span { flex: 1 1 190px; min-width: 170px; }
.cfgrow select, .cfgrow input { width: 100%; }
#cfgfields input.touched, #cfgfields select.touched {
  border-color: var(--s-tank);
  box-shadow: 0 0 0 1px var(--s-tank);
}

.foot { margin-top: 26px; text-align: center; font-size: 11.5px; color: var(--text-muted); }
.foot a { color: var(--text-secondary); }

/* ---------- Login ---------- */
.login { min-height: 82vh; display: flex; align-items: center; justify-content: center; }
.loginbox {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 18px; padding: 30px 28px; width: min(360px, 92vw);
  box-shadow: var(--shadow); text-align: center;
  animation: panelIn .4s var(--ease);
}
.loginbox svg { width: 46px; height: 46px; margin-bottom: 10px; }
.loginbox h1 { font-size: 20px; margin-bottom: 4px; }
.loginbox p { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.loginbox input {
  width: 100%; background: var(--plane); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: 10px; padding: 11px 13px;
  font: inherit; margin-bottom: 12px;
}
.loginbox .btn { width: 100%; padding: 11px; }
.loginerr { color: var(--critical); font-size: 13px; margin-bottom: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
