:root {
  --ground: #0b0e13;
  --rail: #0e1117;
  --panel: #11151c;
  --panel-bar: #161b24;
  --panel-hi: #1c2330;
  --well: #090b10;
  --line: #222a36;
  --line-strong: #333e4f;

  --text: #f1e9dc;
  --text-2: #b6becc;
  --text-3: #8892a5;

  --sun: #ffa95e;
  --sun-soft: #ffcf8a;
  --rose: #ff5c8a;
  --rose-ink: #2a0716;
  --focus: #5b9dff;
  --ok: #7ee0a1;
  --warn: #ffc857;
  --bad: #ff7676;

  --f-pixel: 'DotGothic16', 'MS Gothic', monospace;
  --f-text: 'Atkinson Hyperlegible Next', 'Segoe UI', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', 'Cascadia Mono', ui-monospace, monospace;

  --gap: 16px;
  --rail-w: 232px;
  --bar-h: 44px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dither: none; /* wird per JS als gedithertes Verlaufsbild gesetzt */

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 15px/1.5 var(--f-text);
  -webkit-font-smoothing: antialiased;
  caret-color: var(--rose);
}

::selection { background: var(--rose); color: var(--rose-ink); }

* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { list-style: none; padding: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
kbd {
  font: 500 11px/1 var(--f-mono);
  padding: 3px 5px;
  border: 1px solid var(--line-strong);
  background: var(--well);
  color: var(--text-2);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.i { width: 18px; height: 18px; flex: none; display: block; }
i[data-icon] { display: contents; }

/* Shell */
.app {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 14px;
  background: var(--rail);
  border-right: 1px solid var(--line);
  overflow-x: hidden; /* nie seitlich scrollen, auch nicht um ein paar Pixel */
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 18px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.brand-mark { width: 40px; height: 40px; image-rendering: pixelated; }
.brand-text { display: grid; gap: 2px; }
.brand-name { font: 32px/1 var(--f-pixel); letter-spacing: 0.04em; }
.brand-jp { font: 16px/1 var(--f-pixel); color: var(--sun-soft); letter-spacing: 0.3em; }

.nav { display: grid; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  background: none;
  color: var(--text-2);
  font: 16px/1 var(--f-pixel);
  text-decoration: none;
  text-align: left;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.nav-item .i { color: var(--text-3); transition: color 0.2s var(--ease); }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item:hover .i { color: var(--focus); }
.nav-item.is-active { background: var(--panel-hi); border-color: var(--line-strong); color: var(--text); }
.nav-item.is-active .i { color: var(--sun); }
.nav-item.is-active::after {
  content: '';
  margin-left: auto;
  width: 6px;
  height: 10px;
  background: var(--sun);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.nav-item kbd { margin-left: auto; }
.nav-item.is-active kbd { display: none; }
.nav-label {
  margin: 16px 12px 6px;
  font: 500 12px/1 var(--f-text);
  color: var(--text-3);
}
.nav-item.is-soon { color: var(--text-3); }
.soon {
  margin-left: auto;
  font: 500 11px/1 var(--f-mono);
  padding: 3px 6px;
  border: 1px dashed var(--line-strong);
  color: var(--text-3);
}

/* Einstellungen ganz unten in der Leiste */
.rail-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.rail-foot .nav-item { width: 100%; }

/* Unten fest: Verbindungen (einklappbar), Einstellungen, Profil. Nur die Navigation darüber scrollt. */
.rail-bottom { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.rail-bottom .rail-foot { margin-top: 0; }
.rail-conns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.rail-conns-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 28px;
  padding: 0 10px 0 0;
  border: 0;
  background: none;
  color: var(--text-3);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.rail-conns-head:hover { color: var(--text-2); }
.rail .rail-conns-head .nav-label { margin: 0 auto 0 12px; color: inherit; }
.rail-conns-head .nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-conns-head .i { width: 14px; height: 14px; flex: none; transform: rotate(90deg); transition: transform 0.3s var(--ease); }
.rail-conns.is-collapsed .rail-conns-head .i { transform: rotate(0deg); }
/* Eingeklappt: ein Punkt je Verbindung unter der Überschrift, damit man den Zustand trotzdem sieht */
.rail-conns-sum { order: 3; display: none; flex: 0 0 100%; flex-wrap: wrap; gap: 6px; min-width: 0; padding: 2px 0 4px 12px; }
.rail-conns.is-collapsed .rail-conns-sum { display: flex; animation: sum-in 0.3s var(--ease) both; }
@keyframes sum-in { from { opacity: 0; transform: translateY(-3px); } }
.rail-conns-sum > span { display: flex; }
.rail-conns-sum .light-dot { display: block; width: 6px; height: 6px; }
.rail-conns-body { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr; transition: grid-template-rows 0.32s var(--ease); }
.rail-conns-body > ul { min-height: 0; overflow: hidden; list-style: none; margin: 0; padding: 0; }
.rail-conns.is-collapsed .rail-conns-body { grid-template-rows: 0fr; }
.conn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--text-2);
  font: 400 13px/1 var(--f-mono);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.conn-row:hover { background: var(--panel); color: var(--text); }
.conn-row > span:not(.light-dot) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.conn-row small { flex: none; margin-left: auto; color: var(--text-3); font-size: 11px; }
.conn-row.is-warn small { color: var(--warn); }
.conn-row.is-error small { color: var(--bad); }
.rail-user { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); }
.rail-user-text { display: grid; gap: 3px; min-width: 0; }
.rail-user-text b { font: 500 13px/1.1 var(--f-mono); color: var(--text); }
.rail-user-text small { font: 400 11.5px/1.1 var(--f-mono); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 961px) {
  .brand, .rail-bottom { flex: none; }
  .nav {
    flex: 1 1 auto;
    min-height: 0;
    align-content: start;
    margin: 0 -6px;
    padding: 2px 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
    /* Ausblenden am Rand, sobald es dort weitergeht (app.js setzt can-up/can-down) */
    --fade-top: 0px;
    --fade-bot: 0px;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--fade-top), #000 calc(100% - var(--fade-bot)), transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 var(--fade-top), #000 calc(100% - var(--fade-bot)), transparent);
  }
  .nav.can-up { --fade-top: 22px; }
  .nav.can-down { --fade-bot: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .rail-conns-body, .rail-conns-head .i { transition: none; }
  .rail-conns.is-collapsed .rail-conns-sum { animation: none; }
}
:root[data-motion='reduced'] .rail-conns-body,
:root[data-motion='reduced'] .rail-conns-head .i { transition: none; }
:root[data-motion='reduced'] .rail-conns.is-collapsed .rail-conns-sum { animation: none; }

/* Einstellungen offen: Dashboard bleibt abgedunkelt sichtbar, scrollt aber nicht mit */
html.is-modal { overflow: hidden; scrollbar-gutter: stable; }
dialog.settings { overscroll-behavior: contain; }

.dot { width: 8px; height: 8px; flex: none; background: currentColor; }
.dot-ok { color: var(--ok); }
.dot-bad { color: var(--bad); }
.dot-off { color: var(--text-3); }
.main {
  min-width: 0;
  padding: 20px;
  display: grid;
  gap: var(--gap);
  align-content: start;
}

/* Panels */
.panel {
  --bd: var(--line);
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--bd);
}
/* Pixel-gestufte Ecken: Ecke ausschneiden, ein Pixel Rahmen schließt die Stufe */
.panel::before {
  content: '';
  position: absolute;
  inset: -1px;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(var(--bd) 0 0) left 4px top 0px / 1px 2px no-repeat,
    linear-gradient(var(--bd) 0 0) left 2px top 2px / 2px 1px no-repeat,
    linear-gradient(var(--bd) 0 0) left 2px top 2px / 1px 2px no-repeat,
    linear-gradient(var(--bd) 0 0) left 0px top 4px / 2px 1px no-repeat,
    linear-gradient(var(--bd) 0 0) right 4px top 0px / 1px 2px no-repeat,
    linear-gradient(var(--bd) 0 0) right 2px top 2px / 2px 1px no-repeat,
    linear-gradient(var(--bd) 0 0) right 2px top 2px / 1px 2px no-repeat,
    linear-gradient(var(--bd) 0 0) right 0px top 4px / 2px 1px no-repeat,
    linear-gradient(var(--bd) 0 0) left 4px bottom 0px / 1px 2px no-repeat,
    linear-gradient(var(--bd) 0 0) left 2px bottom 2px / 2px 1px no-repeat,
    linear-gradient(var(--bd) 0 0) left 2px bottom 2px / 1px 2px no-repeat,
    linear-gradient(var(--bd) 0 0) left 0px bottom 4px / 2px 1px no-repeat,
    linear-gradient(var(--bd) 0 0) right 4px bottom 0px / 1px 2px no-repeat,
    linear-gradient(var(--bd) 0 0) right 2px bottom 2px / 2px 1px no-repeat,
    linear-gradient(var(--bd) 0 0) right 2px bottom 2px / 1px 2px no-repeat,
    linear-gradient(var(--bd) 0 0) right 0px bottom 4px / 2px 1px no-repeat,
    linear-gradient(var(--ground) 0 0) left 0px top 0px / 4px 2px no-repeat,
    linear-gradient(var(--ground) 0 0) left 0px top 0px / 2px 4px no-repeat,
    linear-gradient(var(--ground) 0 0) right 0px top 0px / 4px 2px no-repeat,
    linear-gradient(var(--ground) 0 0) right 0px top 0px / 2px 4px no-repeat,
    linear-gradient(var(--ground) 0 0) left 0px bottom 0px / 4px 2px no-repeat,
    linear-gradient(var(--ground) 0 0) left 0px bottom 0px / 2px 4px no-repeat,
    linear-gradient(var(--ground) 0 0) right 0px bottom 0px / 4px 2px no-repeat,
    linear-gradient(var(--ground) 0 0) right 0px bottom 0px / 2px 4px no-repeat;
}
.panel-bar { position: relative; }
.panel:focus-within > .panel-bar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--dither) center / 100% 100%;
  image-rendering: pixelated;
}
.panel:focus-within > .panel-bar h2 { color: var(--sun-soft); }
/* Titelleiste im Pixel-OS-Stil: feine Linien füllen die Leiste, Titel und Inhalte stanzen sie aus */
.panel-bar {
  --stripe: #1f2632;
  display: flex;
  align-items: center;
  gap: 0;
  min-height: var(--bar-h);
  padding: 0 8px;
  background:
    repeating-linear-gradient(to bottom, var(--stripe) 0 1px, transparent 1px 3px) center / 100% 13px no-repeat,
    var(--panel-bar);
  border-bottom: 1px solid var(--line);
}
.panel-bar > * { position: relative; background-color: var(--panel-bar); }
.panel-bar > .i { box-sizing: content-box; padding: 0 8px 0 6px; }
.panel-bar > h2 { padding: 4px 10px 4px 0; }
.panel-bar > .bar-meta { padding: 4px 6px 4px 10px; }
.panel-bar > .seg { margin-right: 6px; outline: 6px solid var(--panel-bar); }
.panel:focus-within { --bd: var(--focus); }
.panel:focus-within > .panel-bar { --stripe: #263450; }
.panel-bar .i { color: var(--focus); }
.panel-bar h2 { font: 16px/1 var(--f-pixel); letter-spacing: 0.04em; }
.bar-meta {
  margin-left: auto;
  font: 12px/1.2 var(--f-mono);
  color: var(--text-3);
  text-align: right;
}
.panel-foot {
  margin-top: auto;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  background: var(--panel-hi);
  color: var(--text);
  font: 500 14px/1 var(--f-text);
  white-space: nowrap;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { border-color: var(--focus); }
.btn:active { transform: translateY(1px); }
.btn .i { width: 16px; height: 16px; }
.btn-primary { background: var(--rose); border-color: var(--rose); color: var(--rose-ink); font-weight: 700; }
.btn-primary:hover { background: #ff7aa0; border-color: #ff7aa0; }
.btn-small { min-height: 28px; padding: 0 10px; font-size: 13px; }

/* Segmented control */
.seg { margin-left: auto; display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line-strong); }
.seg button {
  min-height: 26px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--text-3);
  font: 500 13px/1 var(--f-text);
}
.seg button[aria-selected='true'] { background: var(--panel-hi); color: var(--text); }
.seg button:hover { color: var(--text); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(248px, auto) 4px auto;
  overflow: visible;
  --bd: var(--line-strong);
}
.sky { grid-area: 1 / 1; position: relative; overflow: hidden; background: var(--ground); }
.sky canvas { position: absolute; left: 0; top: 0; image-rendering: pixelated; }
.hero-text {
  grid-area: 1 / 1;
  align-self: center;
  justify-self: start;
  position: relative;
  width: min(560px, 100%);
  padding: 18px 28px;
}
.greeting { font: 16px/1.2 var(--f-pixel); color: var(--sun-soft); letter-spacing: 0.04em; }
.clock { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; }
.clock time { font: 64px/0.95 var(--f-pixel); letter-spacing: 0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.clock-sec { margin-top: 6px; font: 500 13px/1 var(--f-mono); color: var(--text-3); font-variant-numeric: tabular-nums; }
.date { margin-top: 10px; font-size: 15px; color: var(--text-2); }
.digest { margin-top: 16px; display: grid; gap: 6px; }
.digest a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
}
.digest a:hover span { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--focus); }
.digest .i { width: 16px; height: 16px; color: var(--focus); }
.digest .is-warn .i { color: var(--warn); }
.digest b { font-weight: 700; color: var(--text); }

.preview-chip {
  grid-area: 1 / 1;
  position: relative;
  z-index: 1;
  align-self: start;
  justify-self: end;
  margin: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 12px;
  background: var(--panel);
  border: 1px solid var(--rose);
  font: 500 13px/1 var(--f-mono);
  color: var(--text);
}
.preview-chip[hidden] { display: none; }

.horizon { grid-row: 2; background: var(--dither) center / 100% 100%; image-rendering: pixelated; }

.weather {
  grid-row: 3;
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr) minmax(220px, 280px);
  gap: 28px;
  padding: 14px 24px 16px;
  align-items: start;
}
.w-now { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; }
.w-now .i { width: 40px; height: 40px; color: var(--sun-soft); grid-row: span 2; }
.w-temp { font: 32px/1 var(--f-pixel); }
.w-cond { font-size: 15px; color: var(--text-2); }
.w-facts { grid-column: 1 / -1; margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px 14px; font: 12px/1.5 var(--f-mono); color: var(--text-3); }
.w-place { grid-column: 1 / -1; margin-bottom: 10px; font: 16px/1 var(--f-pixel); color: var(--text-2); }

.w-hours {
  display: grid;
  grid-template-columns: repeat(8, minmax(44px, 1fr));
  border: 1px solid var(--line);
  background: var(--well);
}
.w-hour { display: grid; justify-items: center; gap: 6px; padding: 10px 4px; font: 12px/1 var(--f-mono); color: var(--text-3); font-variant-numeric: tabular-nums; }
.w-hour + .w-hour { border-left: 1px solid var(--line); }
.w-hour .i { width: 24px; height: 24px; color: var(--text-2); }
.w-hour .t { font-size: 14px; color: var(--text); }
.w-hour .r { color: var(--text-3); }
.w-hour .r.wet { color: var(--focus); }
.w-hour.is-now { background: var(--panel-hi); color: var(--sun-soft); }

.w-days { display: grid; gap: 2px; }
.w-day { display: grid; grid-template-columns: 28px 20px 30px minmax(0, 1fr) 30px; gap: 8px; align-items: center; min-height: 26px; font: 13px/1 var(--f-mono); font-variant-numeric: tabular-nums; }
.w-day .d { font: 16px/1 var(--f-pixel); color: var(--text-2); }
.w-day .i { width: 18px; height: 18px; color: var(--text-2); }
.w-day .lo { color: var(--text-3); text-align: right; }
.w-day .hi { color: var(--text); }
.w-range { position: relative; height: 6px; background: var(--well); border: 1px solid var(--line); }
.w-range span { position: absolute; top: 0; bottom: 0; background: var(--dither) center / 100% 100%; image-rendering: pixelated; }

/* Grid */
/* Zeilen-Raster: Kacheln einer Zeile sind gleich hoch; kleine Kacheln füllen freie Plätze (dense) */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: row dense; align-items: stretch; gap: var(--gap); }
.term { grid-column: span 8; }
.status { grid-column: span 8; }
.todos, .transit, .cal { grid-column: span 4; }
.home { grid-column: span 8; }
.mensa { grid-column: span 4; }

/* Termine */
.events { padding: 8px 0; }
.ev {
  display: grid;
  grid-template-columns: 56px 10px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 10px 14px;
}
.ev-time { font: 13px/1.35 var(--f-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.ev-time span { display: block; color: var(--text-3); }
.ev-dot { width: 10px; height: 10px; margin-top: 4px; background: var(--c); }
.ev-title { font-weight: 500; }
.ev-sub { font-size: 13px; color: var(--text-3); }
.ev-rel { font: 12px/1.6 var(--f-mono); color: var(--text-3); white-space: nowrap; }
.ev.is-next .ev-rel { color: var(--sun-soft); }
.ev.is-live { background: var(--panel-hi); }
.ev.is-live .ev-rel { color: var(--rose); }
.ev.is-past .ev-title,
.ev.is-past .ev-time { color: var(--text-3); }
.ev.is-past .ev-dot { opacity: 0.45; }
.now-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 14px;
  font: 500 12px/1 var(--f-mono);
  color: var(--rose);
}
.now-line::after { content: ''; flex: 1; height: 2px; background: var(--rose); }
.events-empty { padding: 24px 14px; color: var(--text-3); }

/* Aufgaben */
.todo-add { display: flex; gap: 8px; padding: 14px; border-bottom: 1px solid var(--line); }
.todo-add input,
.field {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  background: var(--well);
  color: var(--text);
}
.todo-add input::placeholder { color: var(--text-3); }
.todo-add input:focus { outline: none; border-color: var(--focus); }
.todo-add .btn span { display: none; }
@media (min-width: 1500px) { .todo-add .btn span { display: inline; } }
.todo-groups { padding: 6px 0 10px; }
.todo-group h3 {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px 6px;
  font: 500 12px/1 var(--f-text);
  color: var(--text-3);
}
.todo {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 7px 14px;
  cursor: pointer;
}
.todo:hover { background: var(--panel-hi); }
.todo input {
  appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  border: 2px solid var(--text-3);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.todo input::after {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--rose-ink);
  transform: scale(0);
  transition: transform 0.2s var(--ease);
}
.todo input:checked { background: var(--focus); border-color: var(--focus); }
.todo input:checked::after { transform: scale(1); }
.todo.is-done span { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.todo.is-new { animation: arrive 0.6s var(--ease); }
@keyframes arrive { from { background: rgba(255, 92, 138, 0.18); } to { background: transparent; } }
.todo-done summary {
  padding: 12px 14px 6px;
  font: 500 12px/1 var(--f-text);
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
}
.todo-done summary::-webkit-details-marker { display: none; }
.todo-done summary .i { width: 14px; height: 14px; transition: transform 0.2s var(--ease); }
.todo-done[open] summary .i { transform: rotate(90deg); }
.events-next { padding: 10px 14px 4px; font-size: 14px; color: var(--text-2); }
.events-next button { padding: 0; border: 0; background: none; color: var(--text); font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--rose); }
.todo-empty { padding: 8px 14px; font-size: 14px; color: var(--text-3); }

/* System */
.checks { padding: 6px 0; }
.check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 10px 14px;
}
.check + .check { border-top: 1px solid var(--line); }
.check .i { width: 18px; height: 18px; margin-top: 1px; color: var(--lv); }
.check-label { font-weight: 500; }
.check-value { grid-column: 2; font: 12px/1.4 var(--f-mono); color: var(--lv); }
.lv-ok { --lv: var(--ok); }
.lv-warn { --lv: var(--warn); }
.lv-info { --lv: var(--text-2); }
.check.lv-warn { background: rgba(255, 200, 87, 0.06); }

/* Zuhause */
.scenes { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; border-bottom: 1px solid var(--line); }
.scene { gap: 8px; }
.scene .i { color: var(--text-3); }
.scene[aria-pressed='true'] { border-color: var(--rose); background: rgba(255, 92, 138, 0.12); }
.scene[aria-pressed='true'] .i { color: var(--rose); }
.home { container-type: inline-size; }
.rooms { padding: 4px 0; }
.room {
  display: grid;
  grid-template-columns: minmax(118px, 180px) minmax(0, 1fr) 46px 44px;
  gap: 12px;
  gap: 16px;
  align-items: center;
  min-height: 56px;
  padding: 6px 14px;
}
.room + .room { border-top: 1px solid var(--line); }
.room-name { font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.room-sub { font: 12px/1.4 var(--f-mono); color: var(--text-3); font-variant-numeric: tabular-nums; }
.room-flag { font: 500 11px/1 var(--f-mono); padding: 3px 6px; color: var(--warn); border: 1px solid currentColor; }
.room-flag[hidden] { display: none; }
.room-bri { font: 13px/1 var(--f-mono); color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
.room.is-on .room-bri { color: var(--sun-soft); }
.room.is-hot { animation: hot 0.8s var(--ease); }
@keyframes hot { from { background: rgba(255, 169, 94, 0.16); } to { background: transparent; } }

input[type='range'] {
  appearance: none;
  width: 100%;
  height: 20px;
  background: none;
  cursor: pointer;
}
input[type='range']::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(90deg, var(--fill) var(--v, 50%), var(--well) var(--v, 50%)); border: 1px solid var(--line-strong); }
input[type='range']::-moz-range-track { height: 6px; background: var(--well); border: 1px solid var(--line-strong); }
input[type='range']::-moz-range-progress { height: 6px; background: var(--fill); }
input[type='range']::-webkit-slider-thumb { appearance: none; width: 12px; height: 18px; margin-top: -7px; background: var(--text); border: 0; }
input[type='range']::-moz-range-thumb { width: 12px; height: 18px; background: var(--text); border: 0; border-radius: 0; }
input[type='range']:disabled { cursor: default; }
input[type='range']:disabled::-webkit-slider-runnable-track { background: var(--well); }
input[type='range']:disabled::-webkit-slider-thumb { background: var(--line-strong); }
input[type='range']:disabled::-moz-range-thumb { background: var(--line-strong); }
input[type='range']:disabled::-moz-range-progress { background: transparent; }

.switch {
  position: relative;
  width: 40px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--well);
}
.is-ready .switch { transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease); }
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: var(--text-3);
}
.is-ready .switch::after { transition: transform 0.25s var(--ease), background-color 0.2s var(--ease); }
.switch[aria-checked='true'] { background: var(--sun); border-color: var(--sun); }
.switch[aria-checked='true']::after { transform: translateX(18px); background: var(--rose-ink); }

/* Terminal */
.term-body { flex: 1; display: flex; flex-direction: column; background: var(--well); min-height: 0; }
.term-log {
  flex: 1 1 auto;
  height: 440px;
  min-height: 0;
  overscroll-behavior: contain;
  overflow-y: auto;
  padding: 14px 16px 4px;
  font: 13px/1.6 var(--f-mono);
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
}
.t-line { min-height: 1.6em; }
.t-echo { color: var(--text); margin-top: 6px; }
.t-prompt { color: var(--rose); white-space: nowrap; }
.t-cmd { color: var(--focus); }
.t-ok { color: var(--ok); }
.t-err { color: var(--bad); }
.t-dim { color: var(--text-3); }
.t-warn { color: var(--warn); }
.t-sun { color: var(--sun-soft); }
.t-rose { color: var(--rose); }
.t-head { color: var(--text); font-weight: 500; }
.t-logo { color: var(--sun); }
.t-logo-2, .t-logo-3 { color: #ff7a6a; }
.t-logo-4, .t-logo-5 { color: var(--rose); }
.term-form { display: flex; gap: 10px; align-items: center; padding: 8px 14px 14px; font: 13px/1.6 var(--f-mono); }
.term-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  background: none;
  color: var(--text);
  font: inherit;
  outline: none;
}
.term-form:focus-within { box-shadow: inset 0 -2px 0 var(--focus); }
.term-input-wrap { position: relative; flex: 1; min-width: 0; display: flex; }
.term-input-wrap.is-empty input { caret-color: transparent; }
.t-cursor {
  position: absolute;
  left: 0;
  top: 50%;
  width: 0.62em;
  height: 1.25em;
  transform: translateY(-50%);
  background: var(--rose);
  pointer-events: none;
  animation: blink 1.1s steps(1) infinite;
}
.term-input-wrap:not(.is-empty) .t-cursor { display: none; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .t-cursor { animation: none; } }
.term-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); }
.chip {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  background: none;
  color: var(--text-2);
  font: 12px/1 var(--f-mono);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.chip:hover { border-color: var(--focus); color: var(--text); }

/* Tooltip über den Fenstern */
.sky-tip {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  font: 12px/1.45 var(--f-mono);
  color: var(--text-2);
  transform: translate(14px, 14px);
}
.sky-tip strong { display: block; font: 16px/1.2 var(--f-pixel); color: var(--text); }

/* Responsive */
@media (max-width: 1380px) {
  .weather { grid-template-columns: minmax(200px, auto) minmax(0, 1fr); }
  .w-days { grid-column: 1 / -1; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); }
  .w-day { grid-template-columns: auto auto; justify-content: center; padding: 10px; gap: 6px 10px; }
  .w-day + .w-day { border-left: 1px solid var(--line); }
  .w-day .w-range { display: none; }
  .w-day .lo { text-align: left; }
}

@media (max-width: 1100px) {
  .term, .status, .home { grid-column: span 12; }
  .todos, .mensa, .transit, .cal { grid-column: span 6; }
  .checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .check + .check { border-top: 0; }
}

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .rail { row-gap: 10px; }
  .brand { padding: 0; border: 0; }
  .brand-text { display: flex; align-items: baseline; gap: 10px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 16px; }
  .nav {
    grid-auto-flow: column;
    justify-content: start;
    overflow-x: auto;
    flex: 1 1 100%;
    order: 3;
    gap: 4px;
    margin: 0 -16px;
    padding: 0 16px;
    -webkit-mask-image: linear-gradient(90deg, var(--ground) calc(100% - 40px), transparent);
    mask-image: linear-gradient(90deg, var(--ground) calc(100% - 40px), transparent);
    scrollbar-width: none;
  }
  .nav-item { white-space: nowrap; min-height: 38px; }
  .nav-item kbd, .nav-label { display: none; }
  .rail-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .rail-foot .nav-item { width: auto; min-height: 36px; }
  /* Schmal: Leiste ist eine Kopfzeile; Verbindungen stehen dort oben als Leuchten */
  .rail-bottom { display: contents; }
  .rail-conns, .rail-user { display: none; }
  .main { padding: 16px; }
}

@media (max-width: 720px) {
  .grid > .panel { grid-column: 1 / -1; }
  .hero { grid-template-rows: 150px auto 4px auto; }
  .sky { grid-area: 1 / 1; }
  .hero-text { grid-area: 2 / 1; padding: 18px 16px 20px; max-width: none; }
  .horizon { grid-row: 3; }
  .weather { grid-row: 4; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 16px; }
  .clock time { font-size: 56px; }
  .w-hours { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .w-hour:nth-child(5) { border-left: 0; }
  .w-hour:nth-child(n + 5) { border-top: 1px solid var(--line); }
  .w-days { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .w-day { grid-template-columns: auto; justify-items: center; padding: 8px 4px; }
  .ev { grid-template-columns: 50px 10px minmax(0, 1fr); }
  .ev-rel { grid-column: 3; }
  .rail-foot .nav-item span { display: none; }
}

.room { --fill: transparent; }
.room.is-on { --fill: var(--sun); }
.room:not(.is-on) input[type='range']::-webkit-slider-thumb { background: var(--text-3); }
.room:not(.is-on) input[type='range']::-moz-range-thumb { background: var(--text-3); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  background: var(--panel-bar);
  border: 1px solid var(--line-strong);
  font-size: 14px;
  color: var(--text);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Terminal-Grafiken */
.t-block { margin: 4px 0 6px; white-space: normal; }
.t-head { letter-spacing: 0.06em; }
.t-bar { display: inline-flex; gap: 2px; vertical-align: -1px; }
.t-bar i { width: 9px; height: 10px; background: var(--line); }
.t-bar-ok i.on { background: var(--ok); }
.t-bar-sun i.on { background: var(--sun); }
.t-bar-warn i.on { background: var(--warn); }
.t-bar-dim i.on { background: var(--text-3); }
.t-bar-err i.on { background: var(--bad); }
.sys-empty { color: var(--text-3); font-size: 13px; line-height: 1.45; }
.room.no-light .switch, .room.no-light input[type=range], .room.no-light .lb { opacity: 0.35; cursor: not-allowed; }
.dish-price small { display: block; color: var(--text-3); font-size: 11px; line-height: 1.2; }
.t-fetch { display: flex; align-items: center; gap: 28px; padding: 6px 0 4px 4px; }
.t-art { flex: none; display: block; }
.t-facts p { margin: 0; line-height: 1.55; }
.t-swatch { display: flex; gap: 0; margin-top: 8px !important; }
.t-swatch i { width: 18px; height: 12px; }
.t-chart { display: flex; align-items: flex-end; gap: 10px; padding: 8px 0 2px 16px; }
.t-col { display: grid; justify-items: center; gap: 4px; font-size: 12px; }
.t-col b { font-weight: 400; color: var(--text); }
.t-col em { font-style: normal; color: var(--text-3); }
.t-colbar { width: 22px; background: var(--dither) center / 100% 100%; image-rendering: pixelated; }
.t-rain { width: 22px; background: #5b9dff; opacity: 0.85; }
.t-timeline { padding: 6px 0 4px 16px; max-width: 560px; }
.t-track { position: relative; height: 14px; background: var(--line); }
.t-ev { position: absolute; top: 2px; bottom: 2px; }
.t-now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--rose); }
.t-ticks { position: relative; height: 16px; margin-top: 4px; font-size: 11px; color: var(--text-3); }
.t-ticks span { position: absolute; transform: translateX(-50%); }
@media (max-width: 720px) {
  .t-fetch { flex-direction: column; align-items: flex-start; gap: 12px; }
  .t-chart { gap: 6px; padding-left: 0; }
  .t-colbar, .t-rain { width: 16px; }
  .t-bar i { width: 6px; }
  .term-log { height: 420px; }
}

/* Terminal: Haus, Klima, Sonne */
.t-house { display: inline-grid; gap: 0; margin: 2px 0 0 16px; }
.t-roof { display: flex; justify-content: center; padding-left: 52px; margin-bottom: -1px; }
.t-roof .t-art { width: 100%; max-width: 336px; height: auto; }
.t-floor { display: grid; grid-template-columns: 52px repeat(2, 168px); }
.t-fl { align-self: center; font-size: 11px; color: var(--text-3); }
.t-room {
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  margin: 0 -1px -1px 0;
  background: color-mix(in srgb, var(--sun) calc(var(--glow, 0) * 40%), var(--well));
}
.t-room p { margin: 0; line-height: 1.45; }
.t-room b { font-weight: 500; color: var(--text); }
.t-room.is-on b { color: var(--sun-soft); }
.t-groundline { height: 4px; margin-left: 52px; background: var(--dither) center / 100% 100%; image-rendering: pixelated; }
.t-spark { color: var(--sun-soft); letter-spacing: 1px; }
@media (max-width: 720px) {
  .t-house { margin-left: 0; }
  .t-floor { grid-template-columns: 34px repeat(2, minmax(0, 1fr)); }
  .t-roof, .t-groundline { padding-left: 34px; margin-left: 34px; }
  .t-roof { margin-left: 0; }
}

@container (max-width: 560px) {
  .room { grid-template-columns: minmax(0, 1fr) 46px; gap: 4px 12px; padding: 10px 14px; }
  .room input[type='range'] { grid-column: 1; grid-row: 2; }
  .room-bri { grid-column: 2; grid-row: 2; }
  .room .switch { grid-column: 2; grid-row: 1; justify-self: end; }
}

/* Hinweise im Himmel */
.hints { gap: 7px; max-width: 560px; }
.hint { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.4; }
.hint > .i { width: 16px; height: 16px; margin-top: 2px; color: var(--text-3); }
.hint.lv-now > .i { color: var(--rose); }
.hint.lv-warn > .i { color: var(--warn); }
.hint.lv-ok > .i { color: var(--ok); }
.hint b { font-weight: 700; color: var(--text); }
.hint.lv-now b { color: var(--rose); }
.hint-act {
  margin-left: 4px;
  padding: 1px 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font: 500 12px/1.5 var(--f-mono);
  vertical-align: 1px;
}
.hint-act:hover { border-color: var(--focus); }
.hint-more .hint-act { margin-left: 26px; background: none; color: var(--text-3); }


/* Abfahrten */
.trip { padding: 14px; border-bottom: 1px solid var(--line); }
.trip-for { font-size: 14px; color: var(--text-2); }
.trip-for b { font-weight: 500; color: var(--text); }
.trip-main { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.trip-leave { font: 32px/1 var(--f-pixel); color: var(--text); font-variant-numeric: tabular-nums; }
.trip-rel { font: 12px/1.35 var(--f-mono); color: var(--text-3); }
.trip-rel b { font-weight: 500; font-size: 14px; color: var(--sun-soft); }
.trip-main.is-urgent .trip-leave, .trip-main.is-urgent .trip-rel b { color: var(--rose); }
.trip-main.is-late .trip-rel b { color: var(--warn); }
.trip-route { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; font: 12px/1.3 var(--f-mono); color: var(--text-2); }
.trip-route li { display: inline-flex; align-items: center; gap: 6px; }
.trip-route .i { width: 16px; height: 16px; color: var(--text-3); }
.trip-route em, .dep-time em { font-style: normal; color: var(--warn); margin-left: 3px; }
.trip-sep { width: 14px; height: 2px; background: var(--dither) center / 100% 100%; image-rendering: pixelated; }
.trip-none { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; color: var(--text-3); }
.trip-none .i { width: 16px; height: 16px; color: var(--ok); }
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  background: var(--panel-hi);
  font: 16px/1 var(--f-pixel);
  color: var(--text);
}
.deps { padding: 6px 0; }
.dep { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 48px; gap: 10px; align-items: center; padding: 7px 14px; }
.dep.is-mine { background: var(--panel-hi); }
.dep.is-mine .badge { border-color: var(--rose); color: var(--rose); }
.dep-dest { min-width: 0; font-size: 14px; }
.dep-tag { margin-left: 8px; font: 500 11px/1 var(--f-mono); color: var(--rose); }
.dep-time { font: 13px/1 var(--f-mono); font-variant-numeric: tabular-nums; }
.dep-rel { font: 12px/1 var(--f-mono); color: var(--text-3); text-align: right; }

/* Mensa */
.mensa-state { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; font: 12px/1.4 var(--f-mono); color: var(--text-2); }
.dishes { padding: 4px 0 8px; }
/* Mensa-Treff: wer wann geht, über dem Speiseplan */
.treff { margin: 8px 14px 4px; padding: 10px 12px; border: 1px solid var(--line); background: var(--well); }
.treff[hidden], .treff-new[hidden] { display: none; }
.treff-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.treff-label { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1 var(--f-text); color: var(--text-2); }
.treff-label .i, .treff-head .sys-link .i { width: 14px; height: 14px; }
.treff-head .sys-link { flex: none; white-space: nowrap; }
.treff-rows { list-style: none; display: grid; gap: 6px; margin: 8px 0 0; padding: 0; }
.treff-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 32px; }
.treff-time { font: 500 14px/1 var(--f-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.treff-row.is-joined .treff-time { color: var(--ok); }
.treff-avas { display: flex; }
.treff-ava { display: grid; place-items: center; width: 22px; height: 22px; margin-left: -6px; border: 2px solid var(--well); background: var(--panel-hi); color: var(--text-2); font: 500 11px/1 var(--f-mono); }
.treff-ava:first-child { margin-left: 0; }
.treff-ava.is-me { background: var(--focus); color: #fff; }
.treff-names { overflow: hidden; color: var(--text-2); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.treff-none { margin: 6px 0 0; color: var(--text-3); font-size: 13px; line-height: 1.45; }
.treff-new { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.treff-new select { flex: none; width: auto; min-width: 92px; min-height: 28px; font-variant-numeric: tabular-nums; }

.dish { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 14px; }
.dish + .dish { border-top: 1px solid var(--line); }
.dish-cat { grid-column: 1 / -1; font: 500 12px/1 var(--f-text); color: var(--text-3); }
.dish-name { font-size: 14px; line-height: 1.4; }
.dish-price { align-self: start; font: 13px/1.5 var(--f-mono); color: var(--sun-soft); font-variant-numeric: tabular-nums; }
.tag { display: inline-block; margin-left: 4px; padding: 1px 5px; border: 1px solid currentColor; font: 500 11px/1.3 var(--f-mono); vertical-align: 1px; }
.tag-vegan, .tag-veg { color: var(--ok); }
.tag-fish { color: var(--text-2); }

/* Terminal-Ergänzungen */
.t-badge { display: inline-block; min-width: 2ch; padding: 0 4px; background: var(--panel-hi); color: var(--text); text-align: center; }
.t-line b { font-weight: 500; color: var(--text); }

/* Zuhause: Grundriss links, Räume rechts */
.home-body { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); align-items: start; }
.plan-wrap { min-width: 0; overflow: hidden; border-right: 1px solid var(--line); background: var(--well); }
.plan { display: block; image-rendering: pixelated; }
.plan polygon, .plan polyline, .plan rect { shape-rendering: crispEdges; }
.fp-room { cursor: pointer; outline: none; }
.fp-outline { stroke: transparent; stroke-width: 2; }
.fp-room:hover .fp-outline { stroke: var(--line-strong); }
.fp-room:focus-visible .fp-outline { stroke: var(--focus); }
.fp-room.is-on:hover .fp-outline { stroke: var(--sun); }
.fp-name { font: 16px var(--f-pixel); fill: var(--text); paint-order: stroke; stroke: var(--well); stroke-width: 4px; stroke-linejoin: round; }
.fp-small { font-size: 16px; }
.fp-data, .fp-light, .fp-warn { font: 500 11px var(--f-mono); paint-order: stroke; stroke: var(--well); stroke-width: 3px; stroke-linejoin: round; }
.fp-data { fill: var(--text-2); }
.fp-light { fill: var(--text-3); }
.fp-light.is-on { fill: var(--sun-soft); }
.fp-warn { fill: var(--warn); }
.fp-entry .fp-data { fill: var(--rose); }
@container (max-width: 860px) {
  .home-body { grid-template-columns: minmax(0, 1fr); }
  .plan-wrap { border-right: 0; border-bottom: 1px solid var(--line); }
}

.t-plan { display: block; width: 100%; max-width: 520px; height: auto; margin: 4px 0 6px 8px; image-rendering: pixelated; }

/* System im Stil einer Statusseite: Karten, Tabellen, Balken */
.sys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; padding: 4px 16px 16px; }
.sys-col { min-width: 0; display: grid; gap: 4px; align-content: start; }
.sys-sec h3 { margin: 14px 0 8px; font: 500 12px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.sys-card { border: 1px solid var(--line-strong); background: var(--well); }
.sys-state { padding: 14px 16px; }
.sys-head { display: flex; align-items: center; gap: 10px; font: 500 15px/1.3 var(--f-mono); color: var(--text); }
.sys-head .dot { width: 10px; height: 10px; }
.dot-warn { color: var(--warn); }
.sys-sub { margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.sys-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; font: 12px/1 var(--f-mono); color: var(--text-3); font-variant-numeric: tabular-nums; }
.sys-link { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--focus); font: 12px/1.4 var(--f-mono); }
.sys-link .i { width: 14px; height: 14px; }
.sys-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.sys-table li, .sys-bars li { display: grid; align-items: center; gap: 12px; padding: 0 14px; min-height: 40px; font: 13px/1.3 var(--f-mono); }
.sys-table li + li, .sys-bars li + li { border-top: 1px solid var(--line); }
.sys-table li { grid-template-columns: minmax(0, 1fr) auto 112px; }
.st-name { color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-state { text-align: right; }
.st-state.lv-ok { color: var(--ok); }
.st-state.lv-warn { color: var(--warn); }
.st-state.lv-bad { color: var(--bad); }
.st-state.lv-info { color: var(--text-2); }
.st-val { color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
.sys-more { display: flex !important; justify-content: space-between; color: var(--text-3); }
.sys-more .sys-link { color: var(--text-3); }
.sys-more .sys-link:hover { color: var(--text); }
.sys-bars li { grid-template-columns: 112px minmax(0, 1fr) 88px; min-height: 38px; }
.sys-air li { grid-template-columns: 96px 48px minmax(0, 1fr) 48px; }
.sb-label { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-label.tone-sun { color: var(--sun-soft); }
.sb-label.tone-rose { color: var(--rose); }
.sb-label.tone-focus { color: var(--focus); }
.sb-label.tone-ok { color: var(--ok); }
.sb-label.tone-warn { color: var(--warn); }
.sb-temp { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.sb-val { color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
.sb-val.lv-warn { color: var(--warn); }
.sbar { position: relative; height: 6px; background: var(--line); overflow: hidden; }
.sbar-fill { position: absolute; inset: 0; background: var(--text-3); transform-origin: left; transition: transform 0.6s var(--ease); }
.sbar-fill.tone-sun { background: var(--sun); }
.sbar-fill.tone-rose { background: var(--rose); }
.sbar-fill.tone-focus { background: var(--focus); }
.sbar-fill.tone-ok { background: var(--ok); }
.sbar-fill.tone-warn { background: var(--warn); }
@container (max-width: 700px) { .sys { grid-template-columns: minmax(0, 1fr); } }
.status { container-type: inline-size; }
.home .rooms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; padding: 4px 0; }
.home .room { border-bottom: 1px solid var(--line); }
.home .room + .room { border-top: 0; }
@container (max-width: 760px) { .home .rooms { grid-template-columns: minmax(0, 1fr); } }
.home-body { display: block; }

/* Zuhause: Räume als Statuszeilen, Helligkeit als breiter Balken darunter */
.home .room {
  grid-template-columns: minmax(0, 1fr) auto 44px;
  grid-template-areas: "name bri sw" "bar bar bar";
  gap: 6px 14px;
  padding: 10px 14px 12px;
}
.home .room > div { grid-area: name; }
.home .room-bri { grid-area: bri; }
.home .room .switch { grid-area: sw; justify-self: end; }
.home .room input[type='range'] { grid-area: bar; height: 14px; }
.home .room input[type='range']::-webkit-slider-runnable-track { height: 8px; border-color: var(--line); }
.home .room input[type='range']::-moz-range-track { height: 8px; }
.home .room input[type='range']::-moz-range-progress { height: 8px; }
.home .room input[type='range']::-webkit-slider-thumb { width: 6px; height: 14px; margin-top: -4px; }
.home .room input[type='range']::-moz-range-thumb { width: 6px; height: 14px; }

/* Tabs im Home-Assistant-Panel */
.tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button {
  position: relative;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--text-3);
  font: 500 13px/1 var(--f-mono);
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected='true'] { color: var(--text); }
.tabs button[aria-selected='true']::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--dither) center / 100% 100%; image-rendering: pixelated; }
.sys { display: block; min-height: 300px; }
.sys-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
@container (max-width: 700px) { .sys-grid { grid-template-columns: minmax(0, 1fr); } }
.sys-issues { margin-top: 10px; display: grid; gap: 6px; font: 13px/1.3 var(--f-mono); color: var(--text-2); }
.sys-issues .st-val { margin-left: 6px; }
.sys-note { margin-top: 10px; font-size: 13px; color: var(--text-3); }
.sys-air li { grid-template-columns: 170px 56px minmax(0, 1fr) 56px; }

/* Einstellungen */
.settings {
  width: min(880px, calc(100vw - 32px));
  height: min(86vh, 860px);
  margin: auto;
  padding: 0;
  color: var(--text);
  overflow: hidden;
}
.settings:not([open]) { display: none; }
.settings::backdrop { background: rgba(5, 7, 10, 0.72); }
.set-close {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  color: var(--text-3);
}
.set-close:hover { color: var(--text); border-color: var(--line-strong); }
.set-close .i { width: 18px; height: 18px; color: inherit; }
.set-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 200px minmax(0, 1fr); }
.set-nav { display: grid; align-content: start; gap: 4px; padding: 14px 10px; border-right: 1px solid var(--line); background: var(--rail); }
.set-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font: 15px/1 var(--f-pixel);
  text-align: left;
}
.set-nav { scrollbar-width: none; }
.set-pick, .set-close { background: transparent; }
.set-nav button .i { color: var(--text-3); }
.set-nav button .dot { margin-left: auto; }
.set-nav button:hover { background: var(--panel); color: var(--text); }
.set-nav button[aria-current] { background: var(--panel-hi); border-color: var(--line-strong); color: var(--text); }
.set-nav button[aria-current] .i { color: var(--sun); }
.settings-body { min-height: 0; overflow-y: auto; padding: 4px 24px 24px; outline: none; }
.set-sec { padding: 18px 0; }
.set-sec h3 { margin-bottom: 14px; font: 18px/1 var(--f-pixel); letter-spacing: 0.04em; }
.set-sub { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.set-sub h4 { margin-bottom: 6px; font: 600 14px/1.3 var(--f-text); }
.set-lead { max-width: 60ch; margin-bottom: 18px; color: var(--text-2); line-height: 1.55; }
.set-note { max-width: 62ch; color: var(--text-3); font-size: 13px; line-height: 1.5; }
.set-note b { color: var(--text-2); font-weight: 600; }
.set-note.is-ok { color: var(--ok); }
.set-note code { color: var(--sun-soft); font: 13px var(--f-mono); }
.set-msg { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 16px; padding: 10px 12px; border: 1px solid; font-size: 14px; line-height: 1.45; }
.set-msg .i { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.set-msg.is-ok { border-color: rgba(126, 224, 161, 0.35); background: rgba(126, 224, 161, 0.06); color: var(--ok); }
.set-msg.is-bad { border-color: rgba(255, 118, 118, 0.4); background: rgba(255, 118, 118, 0.06); color: var(--bad); }

/* Formular: Beschriftung links, Feld rechts */
.set-form { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 18px 16px; align-items: start; }
.set-label { padding-top: 9px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.set-control { display: grid; gap: 6px; min-width: 0; }
.set-row { display: flex; gap: 8px; width: 100%; }
.field:focus { outline: none; border-color: var(--focus); }
select.field { cursor: pointer; }
.set-picks { list-style: none; display: grid; gap: 4px; margin-top: 4px; }
.set-pick { display: flex; gap: 10px; align-items: baseline; width: 100%; padding: 8px 10px; border: 1px solid var(--line); color: var(--text); text-align: left; }
.set-pick span { color: var(--text-3); font-size: 13px; }
.set-pick:hover { border-color: var(--line-strong); background: var(--panel-hi); }
.set-pick.is-on { border-color: var(--focus); background: rgba(91, 157, 255, 0.08); }
.set-actions { display: flex; justify-content: flex-end; margin-top: 22px; }

/* Ein Knopf, der wie ein Knopf aussieht: erhaben, kühl, nicht alarmrot */
.btn-action {
  border-color: #3d6fc0;
  background: linear-gradient(#24365a, #1c2b48);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 0 #0a1222;
}
.btn-action .i { color: #9cc3ff; }
.btn-action:hover { border-color: var(--focus); background: linear-gradient(#2b416b, #213456); }
.btn-action:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 0 #0a1222; }
.btn-action:disabled { opacity: 0.55; cursor: progress; }
.btn-large { min-height: 44px; padding: 0 20px; font-size: 15px; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); }
.set-connect { display: grid; justify-items: start; gap: 10px; margin-top: 24px; padding-left: 136px; }
.set-adv { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }
/* AKARI-Brücke: Angebot, Schritte, Felder zum Kopieren */
.bridge-offer { display: grid; justify-items: start; gap: 10px; margin-bottom: 4px; padding: 14px 16px; border: 1px solid var(--line-strong); background: var(--well); }
.bridge-offer h4 { display: flex; align-items: center; gap: 8px; font: 600 15px/1.3 var(--f-text); }
.bridge-offer h4 .i { width: 18px; height: 18px; color: var(--sun); }
.set-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-3); font-size: 13px; }
.set-or::before, .set-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.bridge-steps { display: grid; gap: 12px; }
.bridge-steps .set-steps-plain { gap: 12px; list-style: decimal; }
.bridge-steps .set-steps-plain li::marker { color: var(--text-3); font: 12px var(--f-mono); }
.bridge-steps code { padding: 1px 5px; background: var(--well); font: 12px/1.5 var(--f-mono); overflow-wrap: anywhere; }
.bridge-wait { display: flex; align-items: center; gap: 8px; color: var(--warn); font: 13px/1.4 var(--f-mono); }
.bridge-wait .dot { animation: alarm 1.6s ease-in-out infinite; }
.bridge-field { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 8px 0; }
.bridge-field span { color: var(--text-3); font-size: 13px; }
.bridge-field code { padding: 6px 8px; border: 1px solid var(--line); }
@media (max-width: 720px) { .bridge-field { grid-template-columns: minmax(0, 1fr) auto; } .bridge-field span { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .bridge-wait .dot { animation: none; } }
.set-adv summary { color: var(--text-3); font-size: 14px; cursor: pointer; }
.set-adv summary:hover { color: var(--text-2); }
.set-adv[open] summary { margin-bottom: 10px; }
.set-adv .set-note { margin-bottom: 10px; }

/* Verbindung und Räume */
.set-conn { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); background: var(--well); font-size: 14px; }
.set-conn > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--text-2); }
.set-conn b { color: var(--text); font-weight: 600; }
.set-conn.is-ok b { color: var(--ok); }
.set-conn.is-bad b { color: var(--bad); }
.set-conn + .set-msg { margin-top: 12px; }
.set-rooms { list-style: none; display: grid; gap: 8px; margin-top: 12px; }
.set-room { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); }
.set-room.is-suggested { border-color: rgba(255, 207, 138, 0.35); }
.set-room-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 240px); gap: 12px; align-items: center; }
.set-room-name { font-weight: 700; }
.set-tag { margin-left: 8px; padding: 2px 5px; border: 1px dashed var(--line-strong); color: var(--text-3); font: 500 11px/1 var(--f-mono); vertical-align: 2px; }
.set-found { color: var(--text-3); font: 12px/1.5 var(--f-mono); }
.set-found em { color: var(--sun-soft); font-style: normal; }
.set-more summary { width: fit-content; color: var(--focus); font-size: 13px; cursor: pointer; }
.set-more[open] summary { margin-bottom: 8px; }
.set-more .set-note { margin-bottom: 8px; }
.set-devs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 12px; margin-bottom: 10px; padding: 0; border: 0; }
.set-devs legend { margin-bottom: 4px; color: var(--text-3); font: 500 11px/1 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.set-check { display: flex; align-items: center; gap: 8px; min-height: 30px; color: var(--text-2); font-size: 14px; cursor: pointer; }
.set-check input { width: 16px; height: 16px; flex: none; accent-color: var(--focus); }
.set-check:hover { color: var(--text); }
.set-extra b { color: var(--text); }
.set-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 12px; margin-top: 8px; }
.set-list { list-style: none; display: grid; }
.set-list li { display: grid; grid-template-columns: 130px 80px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.set-list li:first-child { border-top: 0; }
.set-list li span:nth-child(2) { color: var(--text-3); font: 500 12px/1.6 var(--f-mono); }
.set-list li span.lv-ok { color: var(--ok); }
.set-list li span.lv-bad { color: var(--bad); }
.set-list li span:last-child { color: var(--text-3); }
.rs-connect { width: 100%; margin-top: 12px; }
.rs-connect[hidden], .scenes[hidden] { display: none; }
.room-empty { padding: 18px 14px; color: var(--text-3); font-size: 14px; }

@media (max-width: 720px) {
  .settings { height: 92vh; }
  .set-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .set-nav { display: flex; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .set-nav button { flex: none; }
  .settings-body { padding: 4px 16px 16px; }
  .set-form { grid-template-columns: 1fr; gap: 6px; }
  .set-label { padding-top: 10px; }
  .set-connect { padding-left: 0; }
  .set-room-head { grid-template-columns: 1fr; }
  .set-list li { grid-template-columns: 96px 64px 1fr; }
  .rs-connect { display: none; }
}
/* ───────── Bewegung: alles gleitet dorthin, wo es hingehört ───────── */
/* Registrierte Eigenschaft, damit die Füllung eines Reglers gleiten kann */
@property --v { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
:root { interpolate-size: allow-keywords; }

/* Gleitende Auswahl-Markierung (motion.js setzt Position und Größe) */
.seg, .tabs, .nav, .set-nav { position: relative; }
.ind {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  pointer-events: none;
  transform-origin: 0 0;
  transition: transform 0.42s var(--ease), opacity 0.2s var(--ease);
}
.seg > :not(.ind), .tabs > :not(.ind), .nav > :not(.ind), .set-nav > :not(.ind) { position: relative; z-index: 1; }
.seg > .ind { background: var(--panel-hi); }
.seg:has(> .ind) button[aria-selected='true'],
.seg:has(> .ind) button[aria-checked='true'] { background: transparent; }
.seg button { transition: color 0.25s var(--ease); }
.seg button[aria-checked='true'] { color: var(--text); }
.tabs > .ind::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--dither) center / 100% 100%; image-rendering: pixelated; }
.tabs:has(> .ind) button[aria-selected='true']::after { display: none; }
.tabs button { transition: color 0.25s var(--ease); }
.nav > .ind, .set-nav > .ind { background: var(--panel-hi); box-shadow: inset 0 0 0 1px var(--line-strong); }
.nav > .ind::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 6px;
  height: 10px;
  margin-top: -5px;
  background: var(--sun);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.nav:has(> .ind) .nav-item.is-active { background: transparent; border-color: transparent; }
.nav:has(> .ind) .nav-item.is-active::after { visibility: hidden; }
.set-nav:has(> .ind) button[aria-current] { background: transparent; border-color: transparent; }
.nav-item:hover { background: rgba(255, 255, 255, 0.025); }

/* Schalter: der Knopf gleitet und streckt sich kurz in Laufrichtung */
.is-ready .switch::after { transform-origin: left center; transition: transform 0.38s var(--ease), background-color 0.25s var(--ease); }
.switch:active::after { transform: scaleX(1.3); }
.switch[aria-checked='true']:active::after { transform: translateX(14px) scaleX(1.3); }

/* Regler: die Füllung folgt dem Wert weich (beim Ziehen sofort) */
.home .room input[type='range'] { transition: --v 0.42s var(--ease); }
.home .room input[type='range']:active { transition: none; }

/* Balken wachsen beim Erscheinen von links auf */
@starting-style { .sbar-fill { transform: scaleX(0); } }

/* Aufklappen gleitet statt zu springen */
@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } }
details[open] > :not(summary) { animation: unfold 0.32s var(--ease) backwards; }

/* Einstellungsfenster: schwebt herein, Hintergrund blendet ein */
.settings {
  opacity: 1;
  transform: none;
  transition: opacity 0.3s var(--ease), transform 0.42s var(--ease), overlay 0.42s allow-discrete, display 0.42s allow-discrete;
}
.settings:not([open]) { opacity: 0; transform: translateY(8px) scale(0.99); transition-duration: 0.18s; }
@starting-style { .settings[open] { opacity: 0; transform: translateY(16px) scale(0.98); } }
.settings::backdrop { transition: background-color 0.35s var(--ease), overlay 0.35s allow-discrete, display 0.35s allow-discrete; }
.settings:not([open])::backdrop { background-color: rgba(5, 7, 10, 0); }
@starting-style { .settings[open]::backdrop { background-color: rgba(5, 7, 10, 0); } }

/* Beim Laden fahren Himmel und Panels nacheinander hoch (kurz, insgesamt unter einer Sekunde) */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.hero, .grid > * { animation: rise 0.6s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 50ms + 40ms); }
.hero { --i: 0; }

/* Neue Hinweise schieben sich von links herein */
@keyframes slide-in { from { opacity: 0; transform: translateX(-10px); } }
.hint.is-new { animation: slide-in 0.45s var(--ease) backwards; animation-delay: calc(var(--n, 0) * 60ms); }

/* Reduzierte Bewegung: nichts fährt, Farben und Zustände ändern sich weiter */
@media (prefers-reduced-motion: reduce) {
  .hero, .grid > *, .hint.is-new { animation: none; }
  .ind, .settings, .settings::backdrop { transition: none; }
  details[open] > :not(summary) { animation: none; }
}
:root[data-motion='reduced'] .hero,
:root[data-motion='reduced'] .grid > *,
:root[data-motion='reduced'] .hint.is-new,
:root[data-motion='reduced'] details[open] > :not(summary) { animation: none; }
:root[data-motion='reduced'] .ind,
:root[data-motion='reduced'] .settings,
:root[data-motion='reduced'] .settings::backdrop,
:root[data-motion='reduced'] .switch::after { transition: none; }

/* Ansicht: Panel-Breiten und Reihenfolge aus den Einstellungen (nur breite Bildschirme) */
.grid > [hidden], .nav-item[hidden] { display: none; }
/* Mauerwerk: Zeilen von 4 px, jedes Panel belegt so viele, wie es hoch ist (view.js) */
.grid.is-masonry { grid-auto-rows: 4px; row-gap: 0; align-items: start; grid-auto-flow: row dense; }
.grid.is-masonry > * { margin-bottom: var(--gap); }
@media (min-width: 721px) and (max-width: 1100px) {
  .grid > [data-size='narrow'] { grid-column: span 6; }
  .grid > [data-size='wide'], .grid > [data-size='full'] { grid-column: span 12; }
}
@media (min-width: 1101px) {
  .grid { grid-auto-flow: row dense; }
  .grid > [data-size='narrow'] { grid-column: span 4; }
  .grid > [data-size='wide'] { grid-column: span 8; }
  .grid > [data-size='full'] { grid-column: span 12; }
}
/* Einstellungen: Raum-Editor und Ansicht */
.set-room-head { grid-template-columns: minmax(0, 1fr) minmax(0, 220px) auto; }
.set-room-name { font-weight: 600; }
.set-order { display: inline-flex; gap: 2px; }
.set-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-3);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.set-icon:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); background: var(--panel-hi); }
.set-icon:disabled { opacity: 0.3; cursor: default; }
.set-icon.is-del:hover { color: var(--bad); }
.set-icon .i { width: 16px; height: 16px; }
.i-up { transform: rotate(-90deg); }
.i-down { transform: rotate(90deg); }
.set-room-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; }
.set-check small { color: var(--text-3); font-size: 12px; margin-left: 4px; }
.set-inline { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; }
.set-inline .field { min-height: 30px; width: auto; }
.set-head .btn-small .i { width: 14px; height: 14px; }
.set-hidden { margin-top: 8px; }
.set-chip { display: inline-flex; align-items: center; gap: 4px; margin: 2px 2px 0 0; padding: 3px 8px; border: 1px dashed var(--line-strong); background: transparent; color: var(--text-2); font-size: 13px; }
.set-chip .i { width: 12px; height: 12px; }
.set-chip:hover { border-style: solid; color: var(--text); }
.set-dirty { margin-right: auto; align-self: center; color: var(--warn); font: 12px/1 var(--f-mono); }
.set-actions { align-items: center; gap: 12px; }
.set-gap { margin-top: 14px; }
.set-panels { list-style: none; display: grid; gap: 6px; margin-top: 10px; }
.set-panel { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 12px; align-items: center; padding: 6px 6px 6px 12px; border: 1px solid var(--line); transition: opacity 0.25s var(--ease); }
.set-panel.is-off { opacity: 0.55; }
.set-panel-name { display: flex; flex-wrap: wrap; gap: 0 18px; }
.set-panel .field { min-height: 32px; }
.set-seg { margin: 10px 0 8px; width: fit-content; }
.set-seg button { min-height: 32px; padding: 0 16px; font-size: 14px; }
@media (max-width: 720px) {
  .set-room-head { grid-template-columns: minmax(0, 1fr) auto; }
  .set-room-head select { grid-column: 1 / -1; grid-row: 2; }
  .set-panel { grid-template-columns: minmax(0, 1fr) auto; }
  .set-panel select { grid-column: 1 / -1; }
}
.set-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.set-head h3 { margin: 0; }
.set-inline .field { max-width: 240px; }

/* ───────── Bearbeitungsmodus ───────── */
.edit-bar {
  position: sticky;
  top: 12px;
  z-index: 20;
  margin-bottom: var(--gap);
  border: 1px solid #3d6fc0;
  background: rgba(17, 21, 28, 0.94);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: rise 0.4s var(--ease) backwards;
}
.edit-bar[hidden] { display: none; }
.edit-bar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 10px 14px; }
.edit-title { display: flex; align-items: center; gap: 8px; font: 16px/1 var(--f-pixel); color: var(--text); }
.edit-title .i { color: var(--focus); }
.edit-hint { flex: 1 1 260px; color: var(--text-3); font-size: 13px; }
.edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.edit-actions .btn-small .i { width: 14px; height: 14px; }
.edit-catalog { border-top: 1px solid var(--line); max-height: min(52vh, 460px); overflow-y: auto; }
.edit-catalog[hidden] { display: none; }
.edit-mods { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.edit-mod { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.edit-mod > .i { width: 22px; height: 22px; color: var(--sun); }
.edit-mod.is-soon > .i { color: var(--text-3); }
.edit-mod-name { font-weight: 700; }
.edit-mod.is-soon .edit-mod-name { color: var(--text-2); }
.edit-mod-desc { color: var(--text-3); font-size: 13px; line-height: 1.4; }
.edit-on { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); font: 12px/1.3 var(--f-mono); text-align: right; white-space: nowrap; }
.edit-on .i { width: 14px; height: 14px; }
/* Katalogzeilen sind klickbar: bringen zum Modul oder fügen es hinzu */
.edit-mod[data-row]:not([data-row='']) { cursor: pointer; transition: background-color 0.15s var(--ease); }
.edit-mod[data-row]:not([data-row='']):hover { background: rgba(255, 255, 255, 0.03); }
.edit-mod.is-on > .i { color: var(--ok); }
/* Angesprungenes Panel leuchtet kurz im Fokus-Blau auf */
.is-arranging .grid > .is-found::after { animation: found 1.1s var(--ease); }
@keyframes found { 0%, 30% { background: rgba(91, 157, 255, 0.16); outline-color: var(--focus); } }
@media (prefers-reduced-motion: reduce) { .is-arranging .grid > .is-found::after { animation: none; } }
:root[data-motion='reduced'] .is-arranging .grid > .is-found::after { animation: none; }

/* Panels im Bearbeitungsmodus: Inhalt ruht, das ganze Panel ist greifbar */
.is-arranging .grid > * { cursor: grab; user-select: none; touch-action: none; }
.is-arranging .grid > * > :not(.edit-tools) { pointer-events: none; }
.is-arranging .grid > *::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  outline: 1px dashed rgba(91, 157, 255, 0.55);
  outline-offset: -1px;
  background: rgba(11, 14, 19, 0.28);
  transition: background-color 0.25s var(--ease);
}
.is-arranging .grid > *:hover::after { background: rgba(91, 157, 255, 0.05); }
.grid > .is-dragging {
  z-index: 30;
  cursor: grabbing;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--focus);
  transition: box-shadow 0.25s var(--ease);
}
.grid > .is-dragging::after { background: rgba(91, 157, 255, 0.06); }
.edit-tools {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  background: var(--panel-hi);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  animation: slide-in 0.35s var(--ease) backwards;
  cursor: default;
}
.edit-grip, .edit-hide {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
}
.edit-grip { cursor: grab; color: var(--focus); }
.edit-grip:hover, .edit-hide:hover { border-color: var(--line-strong); color: var(--text); }
.edit-hide:hover { color: var(--bad); }
.edit-grip .i, .edit-hide .i { width: 16px; height: 16px; }
.edit-size { margin: 0; }
.edit-size button { min-height: 26px; padding: 0 10px; font: 600 15px/1 var(--f-text); }
.set-arrange { display: grid; justify-items: start; gap: 8px; margin: 4px 0 6px; }

/* Notiz-Modul */
.note-text {
  display: block;
  width: 100%;
  min-height: 180px;
  padding: 14px 16px;
  border: 0;
  background: var(--well);
  color: var(--text);
  font: 15px/1.6 var(--f-text);
  resize: vertical;
}
.note-text::placeholder { color: var(--text-3); }
.note-text:focus { outline: none; box-shadow: inset 0 -2px 0 var(--focus); }

@media (max-width: 720px) {
  .edit-hint { display: none; }
  .edit-mods { grid-template-columns: 1fr; }
}
/* ───────── Kopfleiste: Statusleuchten und Anordnen ───────── */
.topbar { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; min-height: 28px; }
.lights { list-style: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.light {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-2);
  font: 500 12px/1 var(--f-mono);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.light:hover { border-color: var(--line-strong); background: var(--panel-hi); color: var(--text); }
.light.is-error { border-color: rgba(255, 118, 118, 0.45); color: var(--bad); }
.light-dot { width: 8px; height: 8px; flex: none; transition: background-color 0.4s var(--ease); }
.is-live > .light-dot, .is-ok > .light-dot { background: var(--ok); }
.is-warn > .light-dot { background: var(--warn); }
.light.is-warn { border-color: rgba(255, 200, 87, 0.45); color: var(--warn); }
.conn-state.is-ok { color: var(--ok); }
.conn-state.is-warn { color: var(--warn); }
.is-error > .light-dot { background: var(--bad); animation: alarm 1.6s ease-in-out infinite; }
.is-demo > .light-dot, .is-soon > .light-dot, .is-off > .light-dot { background: transparent; box-shadow: inset 0 0 0 1px var(--text-3); }
@keyframes alarm { 50% { opacity: 0.35; } }
.topbar-btn .i { width: 14px; height: 14px; }
.is-arranging .topbar-btn { border-color: var(--focus); color: var(--text); }
@media (prefers-reduced-motion: reduce) { .is-error > .light-dot { animation: none; } }
:root[data-motion='reduced'] .is-error > .light-dot { animation: none; }

/* Zahnrad an jeder Karte, unaufdringlich bis man drüber ist */
.card-gear {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid transparent;
  color: var(--text-3);
  opacity: 0;
  transition: opacity 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.card-gear .i { width: 14px; height: 14px; }
.panel:hover .card-gear, .panel:focus-within .card-gear, .card-gear:focus-visible { opacity: 1; }
.card-gear:hover { color: var(--text); border-color: var(--line-strong); }
@media (hover: none) { .card-gear { opacity: 1; } }
.is-arranging .card-gear { display: none; }
#rooms.no-sliders .lb { display: none; }

/* Einstellungen: Verbindungen */
.conns { list-style: none; display: grid; gap: 8px; margin-top: 14px; }
.conn { border: 1px solid var(--line); transition: border-color 0.25s var(--ease); }
.conn.is-open { border-color: var(--line-strong); }
.conn-head {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto 16px;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.conn-head:hover:not(:disabled) { background: rgba(255, 255, 255, 0.02); }
.conn-head:disabled { cursor: default; opacity: 0.65; }
.conn-head > .i:first-child { width: 20px; height: 20px; color: var(--sun); }
.conn-name { display: grid; gap: 2px; font-weight: 700; }
.conn-name small { color: var(--text-3); font-size: 13px; font-weight: 400; }
.conn-state { display: inline-flex; align-items: center; gap: 7px; color: var(--text-3); font: 500 12px/1 var(--f-mono); white-space: nowrap; }
.conn-state.is-live { color: var(--ok); }
.conn-state.is-error { color: var(--bad); }
.conn-chev { width: 16px; height: 16px; color: var(--text-3); transition: transform 0.35s var(--ease); }
.conn.is-open .conn-chev { transform: rotate(90deg); }
.conn-body { padding: 14px 14px 16px 48px; border-top: 1px solid var(--line); }
.conn-body > .set-conn:first-child { margin-top: 0; }
.cal-rows { list-style: none; display: grid; gap: 6px; }
.cal-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) 110px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.cal-row .field { min-height: 32px; }
.cal-swatch { display: inline-block; width: 10px; height: 10px; background: var(--c); }
.set-check .cal-swatch { margin-right: 7px; vertical-align: 0; }
.cal-host { overflow: hidden; color: var(--text-3); font: 12px/1.3 var(--f-mono); text-overflow: ellipsis; white-space: nowrap; }
.cal-host.is-bad { color: var(--bad); }
.set-howto, .set-steps-plain { display: grid; gap: 6px; padding-left: 20px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.set-steps-plain a, .set-howto a { color: var(--focus); }
.set-map { list-style: none; display: grid; gap: 4px; margin-top: 12px; font-size: 13px; }
.set-map li { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; }
.set-map span { color: var(--text-3); }
.set-map b { font-weight: 600; }

/* Einstellungen: Karten */
/* Aufbau wie die Verbindungen: Kopf zum Aufklappen, darunter die Optionen */
.card-set { transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.card-set.is-focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(91, 157, 255, 0.15); }
.card-set .conn-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-set .conn-head:disabled { opacity: 0.5; }
.card-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.card-opts .set-devs { flex: 1 1 100%; margin-bottom: 0; }
.set-link { display: inline-flex; align-items: center; gap: 2px; }
.set-link .i { width: 14px; height: 14px; }
.ev.is-allday .ev-time { font-size: 11px; color: var(--text-3); }

@media (max-width: 720px) {
  .light-name { display: none; }
  .light { padding: 0 8px; }
  .conn-head { grid-template-columns: 20px minmax(0, 1fr) 16px; }
  .conn-state { grid-column: 2; grid-row: 2; }
  .conn-chev { grid-column: 3; grid-row: 1; }
  .conn-body { padding-left: 14px; }
  .cal-row { grid-template-columns: 10px minmax(0, 1fr) auto; }
  .cal-row select, .cal-host { grid-column: 2 / -1; }
}
/* ───────── Kalender: Monatsraster wie ein Handy-Widget ───────── */
.cal { container-type: inline-size; }
.cal-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.cal-step, .cal-today {
  display: grid;
  place-items: center;
  height: 28px;
  border: 1px solid transparent;
  background: var(--panel-bar);
  color: var(--text-2);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.cal-step { width: 28px; padding: 0; }
.cal-step .i { width: 16px; height: 16px; }
.cal-step[data-cal-step='-1'] .i { transform: rotate(180deg); }
.cal-today { padding: 0 10px; border-color: var(--line-strong); font: 500 12px/1 var(--f-text); }
.cal-step:hover, .cal-today:hover { border-color: var(--line-strong); color: var(--text); }
.cal-body { padding: 12px 12px 10px; }
.cal-month { margin: 0 2px 10px; font: 20px/1 var(--f-pixel); color: var(--text); }
.cal-month span { color: var(--text-3); }
.cal-grid { display: grid; gap: 2px; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-wd span { padding: 0 4px 4px; color: var(--text-3); font: 500 11px/1 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.cal-wd span.is-we { color: rgba(255, 92, 138, 0.75); }
.cd {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  min-height: 64px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid transparent;
  background: var(--well);
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.cd:hover { border-color: var(--line-strong); }
.cd.is-out { background: transparent; color: var(--text-3); }
.cd.is-out .cd-evs { opacity: 0.5; }
.cd-num { align-self: flex-start; padding: 2px 4px; font: 500 12px/1 var(--f-mono); font-variant-numeric: tabular-nums; }
.cd.is-we:not(.is-today) .cd-num { color: rgba(255, 92, 138, 0.8); }
.cd.is-out.is-we .cd-num { color: var(--text-3); }
.cd.is-today .cd-num { background: var(--rose); color: var(--rose-ink); font-weight: 700; }
.cd.is-sel { border-color: var(--focus); background: rgba(91, 157, 255, 0.08); }
.cd:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.cd-evs { display: grid; gap: 2px; min-width: 0; }
.cd-ev {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 1px 2px;
  overflow: hidden;
  color: var(--text-2);
  font: 500 10px/1.35 var(--f-text);
  white-space: nowrap;
}
.cd-ev::before { content: ''; flex: none; width: 5px; height: 5px; background: var(--c); }
/* Ganztägig: voller Farbbalken mit dunkler Schrift, wie im Handy-Kalender */
.cd-ev.is-allday { padding: 1px 4px; background: var(--c); color: var(--ground); font-weight: 600; }
.cd-ev.is-allday::before { display: none; }
.cd-ev.is-done { opacity: 0.5; text-decoration: line-through; }
.cd-more { padding-left: 2px; color: var(--text-3); font: 500 10px/1.2 var(--f-mono); }
@container (min-width: 540px) {
  .cd { min-height: 92px; padding: 4px; }
  .cd-num { font-size: 13px; }
  .cd-ev { padding: 2px 3px; font-size: 11px; }
}
@container (max-width: 360px) {
  .cd { min-height: 52px; padding: 2px; }
  .cd-ev { font-size: 9px; }
  .cd-ev::before { display: none; }
  .cd-ev:not(.is-allday) { padding-left: 2px; box-shadow: inset 2px 0 0 var(--c); }
}
.cal-day { border-top: 1px solid var(--line); }
.cal-day[hidden] { display: none; }
.cal-day-head { padding: 12px 14px 0; color: var(--text-2); font-size: 13px; }
.cal-day-head b { color: var(--text); font-weight: 700; }
.ev.is-done .ev-title { opacity: 0.6; text-decoration: line-through; }
.events-empty { padding: 10px 14px 6px; color: var(--text-3); font-size: 14px; }

/* Aufgaben: Herkunft aus dem Kalender */
.todo-cal { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; color: var(--text-3); font: 11px/1 var(--f-mono); white-space: nowrap; }
.todo-cal::before { content: ''; width: 6px; height: 6px; background: var(--c); }
.cal-tasks { min-height: 0; font-size: 13px; }
@media (max-width: 720px) {
  .cal-row { grid-template-columns: 10px minmax(0, 1fr) auto; }
  .cal-row .cal-tasks { grid-column: 2 / -1; }
}
/* ───────── Aufgaben: schnell eintippen, gruppiert, mit Editor ───────── */
.todo-add .btn { min-width: 40px; padding: 0 10px; }
.todo-add:has(+ .todo-draft.is-open) { padding-bottom: 8px; border-bottom-color: transparent; }
.todo-draft.is-open { padding: 0 14px 12px; border-bottom: 1px solid var(--line); }
.tchips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; animation: unfold 0.25s var(--ease) backwards; }
.tchip { display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong); background: var(--panel-hi); }
.tchip-main { display: inline-flex; align-items: center; gap: 5px; padding: 3px 4px 3px 8px; border: 0; background: none; color: var(--text); font: 500 12px/1.3 var(--f-text); }
.tchip-main .i { width: 13px; height: 13px; color: var(--sun); }
.tchip-x { display: grid; place-items: center; width: 22px; padding: 0; border: 0; background: none; color: var(--text-3); }
.tchip-x .i { width: 12px; height: 12px; }
.tchip-x:hover { color: var(--text); }
.tchip.is-empty .tchip-main { padding-right: 8px; color: var(--text-3); }
.tchip.is-empty .tchip-x { display: none; }
.tchip.is-prio .tchip-main .i { color: var(--rose); }
.tmore { padding: 3px 9px; border: 1px dashed var(--line-strong); background: none; color: var(--text-2); font: 500 12px/1.3 var(--f-text); }
.tmore:hover { border-style: solid; color: var(--text); }
.thint { margin-top: 8px; color: var(--text-3); font: 12px/1.3 var(--f-mono); }
.tfields { display: grid; gap: 10px; margin-top: 12px; }
.tf { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 10px; align-items: start; }
.tf-l { padding-top: 6px; color: var(--text-3); font: 500 12px/1.2 var(--f-text); }
.tf-c { display: grid; gap: 6px; min-width: 0; justify-items: start; }
.tq-row { display: flex; flex-wrap: wrap; gap: 4px; }
.tq { padding: 4px 9px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); font: 500 12px/1.3 var(--f-text); transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease); }
.tq:hover { color: var(--text); }
.tq.is-on { border-color: var(--focus); background: rgba(91, 157, 255, 0.12); color: var(--text); }
.tq-day { min-width: 34px; padding: 4px 6px; }
.tf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tf .field { flex: none; width: auto; max-width: 100%; min-height: 32px; }
.tf input[type='date'], .tf input[type='time'] { color-scheme: dark; }
.tf .tf-num { width: 72px; }
.tf-custom span { color: var(--text-3); font-size: 13px; }
.tf .tf-note { width: 100%; min-height: 56px; padding: 8px 10px; font: 14px/1.4 var(--f-text); resize: vertical; }

.tg h3 { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px 4px; color: var(--text-2); font: 600 12px/1.2 var(--f-text); letter-spacing: 0.02em; }
.tg-date { margin-left: 8px; color: var(--text-3); font-weight: 400; }
.tg-n { color: var(--text-3); font: 12px/1 var(--f-mono); }
.tg-overdue h3 { color: var(--rose); }
.tg ul, .todo-done ul { list-style: none; }
.ti { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: start; padding: 0 10px 0 8px; transition: background-color 0.2s var(--ease); }
.ti:hover { background: rgba(255, 255, 255, 0.02); }
.ti.is-open { background: var(--panel-hi); }
.ti-check { position: relative; display: grid; place-items: center; width: 34px; height: 38px; cursor: pointer; }
.ti-check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ti-box { display: grid; place-items: center; width: 18px; height: 18px; border: 2px solid var(--line-strong); color: transparent; transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease); }
.ti-box .i { width: 14px; height: 14px; transform: scale(0.3); transition: transform 0.35s var(--ease); }
.ti-check:hover .ti-box { border-color: var(--ok); }
.ti-check input:focus-visible + .ti-box { outline: 2px solid var(--focus); outline-offset: 2px; }
.ti-check input:checked + .ti-box { border-color: var(--ok); background: var(--ok); color: var(--ground); }
.ti-check input:checked + .ti-box .i { transform: none; }
.ti.is-prio .ti-box { border-color: var(--rose); }
.ti-main { display: grid; gap: 3px; min-width: 0; padding: 9px 4px 9px 2px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.ti-text { font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.ti-flag .i { width: 13px; height: 13px; margin-right: 5px; color: var(--rose); vertical-align: -1px; }
.ti-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-3); font: 12px/1.3 var(--f-mono); }
.ti-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.ti-meta .i { width: 12px; height: 12px; }
.tm-due.is-overdue { color: var(--rose); }
.tm-cal::before { content: ''; width: 6px; height: 6px; background: var(--c); }
.ti.is-done .ti-text { color: var(--text-3); text-decoration: line-through; }
.ti.is-new { animation: arrive 1s var(--ease); }
.ti-edit { grid-column: 1 / -1; padding: 2px 4px 12px 36px; }
.ti-title { width: 100%; font-weight: 600; }
.ti-actions { display: flex; justify-content: space-between; margin-top: 12px; }
.ti-del:hover { border-color: rgba(255, 118, 118, 0.4); color: var(--bad); }
#todo-meta.is-warn { color: var(--rose); }
@media (max-width: 720px) {
  .tf { grid-template-columns: 1fr; gap: 4px; }
  .tf-l { padding-top: 0; }
  .ti-edit { padding-left: 4px; }
}
/* ── Verspielte Momente: wenige Stellen, jede erklärt, was gerade passiert ──
   Abhaken (Pixel-Funken), Licht an (Schein zieht durch den Raum), Kalender blättert,
   Statuslampen flackern beim Wechsel, gehaltene Panels neigen sich (motion.js, arrange.js) */

/* Abhaken: Kästchen federt, Pixel funken, der Text wird von links durchgestrichen */
.sparks { position: fixed; z-index: 200; width: 0; height: 0; pointer-events: none; }
.sparks i { display: block; position: absolute; left: -2px; top: -2px; width: 4px; height: 4px; }
.ti.is-ticking .ti-box { animation: tick-pop 0.42s var(--ease); }
@keyframes tick-pop {
  0% { transform: scale(1); }
  30% { transform: scale(0.78); }
  65% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.ti-words { box-decoration-break: clone; -webkit-box-decoration-break: clone; background: linear-gradient(currentColor, currentColor) no-repeat 0 58% / 0 1.5px; }
.ti.is-ticking .ti-words { animation: strike 0.36s 0.12s var(--ease) forwards; }
.ti.is-ticking .ti-text { color: var(--text-3); transition: color 0.4s 0.2s var(--ease); }
@keyframes strike { to { background-size: 100% 1.5px; } }

/* Licht an: ein warmer Schein zieht vom Schalter durch die Zeile, die Prozentzahl flackert
   kurz an wie eine Röhre. Licht aus: die Zeile dunkelt einen Moment ab. */
.room { position: relative; isolation: isolate; }
.room::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(to left, rgba(255, 169, 94, 0.2), rgba(255, 169, 94, 0.07) 45%, transparent 85%);
  transform-origin: right center;
}
.room.is-hot { animation: none; }
.room.is-hot.is-on::before { animation: lamp-on 1s var(--ease); }
.room.is-hot:not(.is-on)::before { background: rgba(5, 7, 10, 0.3); animation: lamp-off 0.55s ease-out; }
@keyframes lamp-on {
  0% { opacity: 1; transform: scaleX(0); }
  35% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1); }
}
@keyframes lamp-off { from { opacity: 1; } }
.room.is-hot.is-on .room-bri { animation: flicker 0.5s steps(1, end); }
@keyframes flicker {
  0% { opacity: 0.2; }
  18% { opacity: 1; }
  30% { opacity: 0.35; }
  48% { opacity: 1; }
}

/* Kontakt offen: ein offenes Fenster ist eine Warnung, eine offene Tür nur ein Hinweis.
   Das Fähnchen klappt dabei auf wie ein Flügel. */
.room-flag[data-kind='door'], .room-flag[data-kind='other'] { color: var(--text-2); border-color: var(--line-strong); }
.room-flag:not([hidden]) { transform-origin: left center; animation: swing-open 0.6s var(--ease); }
@keyframes swing-open { from { opacity: 0; transform: perspective(140px) rotateY(-75deg); } }

/* Kalender: der alte Monat gleitet als Abzug hinaus, der Auswahlrahmen wandert von Tag zu Tag */
.cal-body { position: relative; overflow: clip; }
.turn-ghost { position: absolute; margin: 0; pointer-events: none; transform-origin: 50% 0; }
.glide-frame { position: absolute; z-index: 2; border: 1px solid var(--focus); background: rgba(91, 157, 255, 0.08); transform-origin: 0 0; pointer-events: none; }
.cd.is-sel.is-arriving { border-color: transparent; background: var(--well); transition: none; }

/* Statuslampen: das Flackern läuft per Web Animations auf dem Punkt; die Hülle folgt der Farbe */
.light { transition: border-color 0.4s var(--ease), color 0.4s var(--ease); }

/* Bearbeitungsmodus: gehaltenes Panel neigt sich (arrange.js), Schatten fällt nach unten */
.grid > .is-dragging { transform-origin: 50% 20%; }

/* Kontaktsensoren in den Einstellungen: Art daneben wählen */
.set-opening { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.set-opening .set-check { flex: 1 1 auto; min-width: 0; }
.set-opening select { flex: none; width: auto; min-height: 28px; padding-block: 2px; font-size: 12px; }
.set-opening.is-unsure select { border-color: rgba(255, 200, 87, 0.5); color: var(--warn); }
.set-devs:has(.set-opening) { grid-template-columns: 1fr; }

@media (prefers-reduced-motion: reduce) {
  .ti.is-ticking .ti-box, .ti.is-ticking .ti-words, .room.is-hot.is-on::before, .room.is-hot:not(.is-on)::before, .room.is-hot.is-on .room-bri, .room-flag:not([hidden]) { animation: none; }
}
:root[data-motion='reduced'] .ti.is-ticking .ti-box,
:root[data-motion='reduced'] .ti.is-ticking .ti-words,
:root[data-motion='reduced'] .room.is-hot.is-on::before,
:root[data-motion='reduced'] .room.is-hot:not(.is-on)::before,
:root[data-motion='reduced'] .room.is-hot.is-on .room-bri,
:root[data-motion='reduced'] .room-flag:not([hidden]) { animation: none; }

/* ── Zuhause: Helligkeit als Lichtleiste (lightbar.js) ──
   Das echte Range-Input liegt unsichtbar darüber und bekommt alle Eingaben; die Leiste
   zeigt den Wert, der per Feder nachläuft (--p, 0 … 1). --m merkt sich die Helligkeit bei "aus". */
.lb, .home .room > .lb { position: relative; grid-area: bar; height: 30px; margin-bottom: -6px; touch-action: pan-y; }
.lb input, .home .room .lb input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
/* Unsichtbarer Griff ganz schmal, damit Klickstelle und Wert genau übereinstimmen */
.home .room .lb input::-webkit-slider-thumb { width: 2px; height: 30px; margin-top: 0; }
.home .room .lb input::-webkit-slider-runnable-track { height: 30px; border: 0; background: none; }
.home .room .lb input::-moz-range-thumb { width: 2px; height: 30px; }
.lb input:disabled { cursor: not-allowed; }
.lb-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 10px;
  height: 10px;
  border: 1px solid var(--line);
  background: var(--well);
  transition: border-color 0.2s var(--ease);
}
.lb:hover .lb-track, .lb.is-dragging .lb-track { border-color: var(--line-strong); }
.lb:has(input:focus-visible) .lb-track { outline: 2px solid var(--focus); outline-offset: 3px; }
/* Licht als Strahl: am Anfang gedämpft, zur Spitze hin voll */
.lb-fill {
  position: absolute;
  inset: 0;
  transform: scaleX(clamp(0, var(--p), 1));
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(255, 169, 94, 0.32), var(--sun));
  overflow: hidden;
}
.lb.is-off .lb-fill { background: linear-gradient(90deg, rgba(255, 169, 94, 0.12), rgba(255, 169, 94, 0.45)); }
.lb-rail { position: absolute; inset: 0; pointer-events: none; transform: translateX(calc(clamp(0, var(--m), 1) * 100%)); }
.lb-knob-rail { transform: translateX(calc(clamp(0, var(--p), 1) * 100%)); }
/* Marke: wo das Licht beim Einschalten wieder hinwill */
.lb-mark { position: absolute; top: 1px; bottom: 1px; left: -1px; width: 2px; background: var(--text-3); opacity: 0; transition: opacity 0.3s var(--ease); }
.lb.is-off .lb-mark { opacity: 0.8; }
.lb-knob {
  position: absolute;
  top: -6px;
  left: -2px;
  width: 4px;
  height: 20px;
  background: var(--text);
  transition: transform 0.2s var(--ease), background-color 0.25s var(--ease);
}
.lb.is-off .lb-knob { background: var(--text-3); }
.lb:hover .lb-knob { transform: scaleX(1.5); }
.lb.is-dragging .lb-knob { transform: scale(1.5, 1.15); background: var(--sun-soft); }
/* Wert über dem Griff, nur beim Ziehen */
.lb-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  background: var(--panel-hi);
  color: var(--text);
  font: 500 11px/1 var(--f-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px) scale(calc(1 / 1.15), calc(1 / 1.15));
  transition: opacity 0.15s var(--ease), transform 0.25s var(--ease);
}
.lb.is-dragging .lb-tip { opacity: 1; transform: translate(-50%, 0) scale(calc(1 / 1.5), calc(1 / 1.15)); }
.room-bri { min-width: 4.5ch; }

/* Szenen: drücken gibt nach, beim Auslösen zieht ein Lichtstreif über den Knopf */
.scene { position: relative; overflow: hidden; transition: transform 0.12s var(--ease), border-color 0.25s var(--ease), background-color 0.25s var(--ease); }
.scene:active { transform: scale(0.96); }
.scene::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 92, 138, 0.28) 50%, transparent 80%);
  transform: translateX(-110%);
  pointer-events: none;
}
.scene.is-fired::after { animation: scene-sweep 0.75s cubic-bezier(0.45, 0, 0.2, 1); }
@keyframes scene-sweep { to { transform: translateX(110%); } }
.scene.is-fired .i { animation: scene-pop 0.45s var(--ease); }
@keyframes scene-pop { 40% { transform: scale(1.3) rotate(-8deg); } }

/* Schalter: beim Drücken gibt der ganze Schalter etwas nach */
.is-ready .switch { transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.12s var(--ease); }
.switch:active:not(:disabled) { transform: scale(0.94); }

@media (prefers-reduced-motion: reduce) {
  .scene.is-fired::after, .scene.is-fired .i { animation: none; }
  .scene:active, .switch:active:not(:disabled) { transform: none; }
}
:root[data-motion='reduced'] .scene.is-fired::after,
:root[data-motion='reduced'] .scene.is-fired .i { animation: none; }
:root[data-motion='reduced'] .scene:active,
:root[data-motion='reduced'] .switch:active:not(:disabled) { transform: none; }

/* ── Lichtfarbe: Zuhause übernimmt Farbe und Helligkeit der echten Lampen ──
   --lc ist die Mischfarbe (nach Helligkeit gewichtet), --lc1…3 bis zu drei verschiedene
   Lampenfarben im Raum. Ohne Farbe (Beispieldaten) bleibt es beim warmen Sonnenton. */
@property --lc { syntax: '<color>'; inherits: true; initial-value: rgb(255 169 94); }
@property --lc1 { syntax: '<color>'; inherits: true; initial-value: rgb(255 169 94); }
@property --lc2 { syntax: '<color>'; inherits: true; initial-value: rgb(255 169 94); }
@property --lc3 { syntax: '<color>'; inherits: true; initial-value: rgb(255 169 94); }
.room { --lc-ink: var(--rose-ink); transition: --lc 0.8s var(--ease), --lc1 0.8s var(--ease), --lc2 0.8s var(--ease), --lc3 0.8s var(--ease); }
/* Strahl in den Farben der Lampen; je heller eingestellt, desto kräftiger leuchtet er */
.lb-fill {
  background: linear-gradient(90deg, color-mix(in srgb, var(--lc1) 28%, transparent), var(--lc1) 40%, var(--lc2) 72%, var(--lc3));
  opacity: calc(0.5 + clamp(0, var(--p), 1) * 0.5);
}
.lb.is-off .lb-fill { background: linear-gradient(90deg, color-mix(in srgb, var(--lc) 10%, transparent), color-mix(in srgb, var(--lc) 40%, transparent)); }
.lb.is-dragging .lb-knob { background: color-mix(in srgb, var(--lc) 70%, white); }
.lb.is-dragging .lb-tip { border-color: color-mix(in srgb, var(--lc) 55%, transparent); }
.room .switch[aria-checked='true'] { background: var(--lc); border-color: var(--lc); }
.room .switch[aria-checked='true']::after { background: var(--lc-ink); }
.room.is-on .room-bri { color: color-mix(in srgb, var(--lc) 75%, white); }
.room::before { background: linear-gradient(to left, color-mix(in srgb, var(--lc) 22%, transparent), color-mix(in srgb, var(--lc) 7%, transparent) 45%, transparent 85%); }
/* Ein Hauch der Lichtfarbe liegt auf der ganzen Zeile, stärker je heller */
.room.is-on { background: linear-gradient(to left, color-mix(in srgb, var(--lc) calc(2% + var(--rp, 0) * 6%), transparent), transparent 70%); }
:root[data-motion='reduced'] .room { transition: none; }
@media (prefers-reduced-motion: reduce) { .room { transition: none; } }

/* Räume speichern sich selbst: kurz "Gespeichert" neben der Überschrift, dann weg */
.set-saved { margin-left: auto; margin-right: 12px; color: var(--ok); font: 500 12px/1 var(--f-mono); opacity: 0; }
.set-saved.is-shown { animation: saved-flash 1.8s var(--ease); }
@keyframes saved-flash { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* ── Terminal: Ausgabe druckt sich ──
   Zeilen erscheinen kurz nacheinander (--d) und decken sich in groben Schritten von links auf,
   Balken-Segmente leuchten einzeln auf, Diagramm-Säulen wachsen, Bilder blenden ein. */
/* Noch nicht dran: Zeile bzw. Balken/Bild erscheint erst, wenn das Schreiben dort ankommt */
.t-queued, .t-wait { display: none !important; }
/* Neue Zeile leuchtet kurz auf wie auf einem Phosphor-Schirm, dann normale Farbe */
.t-line.t-flash { animation: t-phos 0.32s ease-out; }
@keyframes t-phos { from { opacity: 0.35; filter: brightness(1.9); } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .t-line.t-flash { animation: none; } }
:root[data-motion='reduced'] .t-line.t-flash { animation: none; }
/* Block-Cursor am Ende der Zeile, die gerade getippt wird */
.t-caret { display: inline-block; width: 0.6em; height: 1.15em; margin-left: 1px; vertical-align: -0.2em; background: var(--text-2); }
.t-line.t-block.t-in { animation: t-rise 0.36s var(--ease) var(--d, 0ms) backwards; }
@keyframes t-rise { from { opacity: 0; transform: translateY(6px); } }
.t-bar.t-in i.on, .t-in .t-bar i.on { animation: t-seg 0.12s steps(1, end) calc(var(--k, 0) * 30ms) backwards; }
@keyframes t-seg { from { background: var(--line); } }
.t-in .t-colbar, .t-in .t-rain { transform-origin: bottom; animation: t-grow 0.5s var(--ease) calc(var(--d, 0ms) + 80ms + var(--k, 0) * 40ms) backwards; }
@keyframes t-grow { from { transform: scaleY(0); } }
.t-in .t-ev { transform-origin: left; animation: t-grow-x 0.45s var(--ease) calc(var(--d, 0ms) + 100ms) backwards; }
@keyframes t-grow-x { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .t-line.t-in, .t-bar.t-in i.on, .t-in .t-bar i.on, .t-in .t-colbar, .t-in .t-rain, .t-in .t-ev { animation: none; }
}
:root[data-motion='reduced'] .t-line.t-in,
:root[data-motion='reduced'] .t-bar.t-in i.on,
:root[data-motion='reduced'] .t-in .t-bar i.on,
:root[data-motion='reduced'] .t-in .t-colbar,
:root[data-motion='reduced'] .t-in .t-rain,
:root[data-motion='reduced'] .t-in .t-ev { animation: none; }

/* ── Abfahrten: Orte als Tabs, Abfahrten mit "los in" ── */
.transit-places { max-width: 62%; overflow-x: auto; scrollbar-width: none; }
.transit-places::-webkit-scrollbar { display: none; }
.transit-places button { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.here-pin .i { width: 12px; height: 12px; color: var(--rose); }
.dep { grid-template-columns: 34px minmax(0, 1fr) auto 64px; }
.dep-dest { display: grid; gap: 2px; overflow-wrap: anywhere; }
.dep-dest small, .dep-rel small { color: var(--text-3); font: 11px/1.2 var(--f-mono); }
.dep-rel { display: grid; gap: 3px; justify-items: end; color: var(--text-2); }
.dep-rel small { color: var(--sun-soft); }
.badge { min-width: 30px; }
.badge.is-rail { border-color: rgba(91, 157, 255, 0.55); color: var(--focus); }
/* Gerade noch zu schaffen: "jetzt los" leuchtet; nicht mehr zu schaffen: blass */
.dep.is-go .dep-rel small { color: var(--warn); font-weight: 600; }
.dep.is-gone { opacity: 0.45; }
.dep.is-gone .dep-rel small { color: var(--text-3); }
.dep.is-cancel .dep-dest, .dep.is-cancel .dep-time { text-decoration: line-through; color: var(--text-3); }
.dep.is-cancel .dep-rel { color: var(--bad); }
.deps .trip-none { padding: 4px 14px; flex-wrap: wrap; }
.trip[hidden] { display: none; }

/* ── Einstellungen → Orte ── */
.here-mode { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; margin: 12px 0 4px; }
.here-mode .seg { margin-left: 0; justify-self: start; }
.here-mode > .set-note, .here-mode > .set-inline { grid-column: 1 / -1; }
.place-head { grid-template-columns: minmax(0, 1fr) auto auto; }
.place-toggle { gap: 6px; white-space: nowrap; }
.place-toggle .conn-chev { width: 14px; height: 14px; transition: transform 0.25s var(--ease); }
.place-toggle[aria-expanded='true'] .conn-chev { transform: rotate(90deg); }
.place-body { margin-top: 6px; }
.place-body .set-form { row-gap: 14px; }
.stop-list { list-style: none; display: grid; gap: 6px; margin: 0 0 8px; padding: 0; }
.stop-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); background: var(--well); }
.stop-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.stop-name .i { width: 16px; height: 16px; flex: none; color: var(--text-3); }
.stop-walk { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; }
.stop-walk .field, .set-control .stop-walk .field { flex: none; width: 60px; min-height: 30px; padding: 2px 6px; text-align: right; font-variant-numeric: tabular-nums; }
.stop-lines { grid-column: 1 / -1; }
.stop-lines summary { cursor: pointer; color: var(--focus); font-size: 13px; width: fit-content; }
.line-picks { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-top: 8px; }
.line-pick .badge { margin-right: 4px; font-size: 11px; }
.near-head { margin: 4px 0 6px; }
.near-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.near-chips small { color: var(--text-3); font: 11px/1 var(--f-mono); }
.stop-add .field { flex: 1 1 auto; }
@media (max-width: 560px) {
  .here-mode { grid-template-columns: 1fr; }
  .stop-row { grid-template-columns: minmax(0, 1fr) auto; }
  .stop-walk { grid-column: 1; }
}

/* ── Wetter als eigene Karte (beide Designs) ──
   Die Karte richtet sich nach ihrer eigenen Breite: ganz breit drei Spalten
   (jetzt, Stunden, Tage), schmaler untereinander. */
.wx { container-type: inline-size; }
.wx .weather { padding: 14px 18px 16px; }
@container (max-width: 1000px) {
  .wx .weather { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@container (max-width: 560px) {
  .wx .w-hours { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wx .w-hour:nth-child(5) { border-left: 0; }
  .wx .w-hour:nth-child(n + 5) { border-top: 1px solid var(--line); }
}

/* Mensa: Preise in einer festen, rechtsbündigen Spalte; "/100 g" steht darunter.
   Leertexte mit demselben Einzug wie die Statuszeile. */
.dish { grid-template-columns: minmax(0, 1fr) 7ch; }
.dish-price { justify-self: end; text-align: right; white-space: nowrap; }
.dishes .trip-none { padding: 6px 14px; }

/* ── Spotify-Karte (spotify-card.js) ── */
.spot-body { display: grid; gap: 12px; padding: 14px; }
.spot-empty { display: grid; justify-items: start; gap: 10px; color: var(--text-2); font-size: 14px; }
.spot-empty > .i { width: 28px; height: 28px; color: var(--text-3); }
.spot-main { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center; }
.spot-cover { display: grid; place-items: center; width: 96px; height: 96px; overflow: hidden; border: 1px solid var(--line); background: var(--well); }
.spot-cover img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; } /* 64-px-Cover gepixelt vergrößert */
.spot-cover > .i { width: 32px; height: 32px; color: var(--text-3); }
.spot-info { min-width: 0; display: grid; gap: 3px; }
.spot-label { font: 500 11px/1 var(--f-mono); color: var(--text-3); }
.spot-title { display: -webkit-box; overflow: hidden; font: 16px/1.25 var(--f-pixel); color: var(--text); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.spot-artist { overflow: hidden; font-size: 13px; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.spot-artist span { color: var(--text-3); }
.spot-progress { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.spot-bar { position: relative; flex: 1; height: 6px; overflow: hidden; background: var(--line); }
.spot-fill { position: absolute; inset: 0; background: var(--ok); transform: scaleX(0); transform-origin: left; transition: transform 1s linear; }
.spot-time { font: 11px/1 var(--f-mono); color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.spot-ctrl { display: flex; align-items: center; gap: 6px; }
.spot-btn { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line-strong); background: var(--panel-hi); color: var(--text); transition: transform 0.12s var(--ease), border-color 0.2s var(--ease); }
.spot-btn:hover { border-color: var(--focus); }
.spot-btn:active { transform: scale(0.94); }
.spot-btn .i { width: 18px; height: 18px; }
.spot-play { width: 44px; height: 44px; border-color: var(--ok); background: var(--ok); color: var(--ground); }
.i-flip { transform: rotate(180deg); }
.spot-vol { flex: 1; min-width: 70px; margin-left: 8px; }
.spot-vol input { --fill: var(--text-2); }
.spot-free { font: 12px/1.4 var(--f-mono); color: var(--text-3); }
.spot-msg { font: 12px/1.4 var(--f-mono); color: var(--warn); }
@media (prefers-reduced-motion: reduce) { .spot-fill { transition: none; } }
:root[data-motion='reduced'] .spot-fill { transition: none; }

/* Spotify: Spieler oben, Bibliothek füllt den Rest der Kachel und scrollt in sich */
.spot-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.spot-player { display: grid; gap: 12px; }
.spot-empty.is-inline { grid-template-columns: auto 1fr; align-items: center; }
.spot-progress.is-idle { opacity: 0.5; }
.spot-ctrl { flex-wrap: wrap; }
.spot-gap { flex: 1; }
.spot-vol input:disabled { opacity: 0.4; }
.spot-dev-wrap { position: relative; }
.spot-dev { max-width: 180px; }
.spot-dev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot-devs { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 20; display: grid; min-width: 220px; padding: 4px; border: 1px solid var(--line-strong); background: var(--panel-hi); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); }
.spot-devs button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 10px; border: 0; background: none; color: var(--text-2); font: 13px/1 var(--f-mono); text-align: left; }
.spot-devs button:hover, .spot-devs button[aria-selected='true'] { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.spot-devs small { margin-left: auto; color: var(--ok); }
.spot-devs-note { padding: 8px 10px; font-size: 12px; color: var(--text-3); }
.spot-lib { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.spot-lib[hidden] { display: none; }
.spot-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-left: 0; }
.spot-tabs button { padding: 0 4px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot-search .field { width: 100%; }
.spot-crumb { display: flex; align-items: center; gap: 10px; min-width: 0; }
.spot-crumb b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot-crumb .i { width: 14px; height: 14px; }
.spot-crumb .sys-link { display: inline-flex; align-items: center; gap: 4px; }
.spot-lib-body { flex: 1 1 0; min-height: 220px; display: flex; flex-direction: column; }
.spot-list { flex: 1 1 0; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.spot-row { display: flex; align-items: center; }
.spot-item { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border: 0; background: none; color: var(--text); text-align: left; transition: background-color 0.15s var(--ease); }
.spot-item:hover { background: rgba(255, 255, 255, 0.035); }
.spot-item.is-current b { color: var(--ok); }
.spot-item-cover { display: grid; place-items: center; width: 38px; height: 38px; flex: none; overflow: hidden; background: var(--well); }
.spot-item-cover img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.spot-item-cover .i { width: 18px; height: 18px; color: var(--text-3); }
.spot-item-text { display: grid; gap: 2px; min-width: 0; }
.spot-item-text b, .spot-item-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot-item-text b { font-weight: 500; font-size: 13.5px; }
.spot-item-text small { color: var(--text-3); font-size: 12px; }
.spot-dur { margin-left: auto; padding-left: 8px; font: 11px/1 var(--f-mono); color: var(--text-3); font-variant-numeric: tabular-nums; }
.spot-chev { width: 14px; height: 14px; margin-left: auto; color: var(--text-3); }
.spot-row-play { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid transparent; background: none; color: var(--text-3); }
.spot-row-play:hover { border-color: var(--line-strong); color: var(--ok); }
.spot-row-play .i { width: 14px; height: 14px; }
.spot-more { margin: 8px 6px; }
.spot-lib-note { display: grid; justify-items: start; gap: 10px; padding: 6px 0; font-size: 13px; color: var(--text-3); }

/* ── Anmeldung (boot.js): eine ruhige Karte in der Mitte, immer im Clean-Look ── */
body.is-auth { min-height: 100vh; }
.app[hidden] { display: none; } /* sonst gewinnt display: grid gegen hidden */
.auth { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; background: radial-gradient(80% 60% at 50% 110%, rgba(61, 130, 246, 0.1), transparent 70%), var(--ground); }
.auth-card { display: grid; gap: 14px; width: min(400px, 100%); padding: 28px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.auth-brand svg { width: 26px; height: 26px; color: var(--text); filter: drop-shadow(0 0 5px rgba(141, 180, 255, 0.45)); }
.auth-brand svg circle:last-child { fill: var(--accent-soft, #8db4ff); }
.auth-brand span { font: 600 16px/1 var(--f-mono); letter-spacing: 0.22em; }
.auth-brand small { font-size: 12px; letter-spacing: 0.2em; color: var(--text-3); }
.auth-card h1 { font: 500 22px/1.2 var(--f-mono); letter-spacing: -0.02em; }
.auth-lead { color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.auth-field { display: grid; gap: 6px; font: 500 11px/1 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
.auth-field .field { min-height: 40px; text-transform: none; letter-spacing: normal; font-size: 14px; }
.auth-msg { padding: 8px 10px; border: 1px solid rgba(242, 85, 90, 0.4); border-radius: 6px; color: var(--bad); font-size: 13px; }
.auth-msg[hidden] { display: none; }
.auth-msg.is-ok { border-color: rgba(63, 207, 127, 0.4); color: var(--ok); }
.auth-foot .sys-link { font: inherit; }
.acc-request { color: var(--warn) !important; }
.acc-request .sys-link { margin-left: 6px; font-size: inherit; }
.auth-go { min-height: 42px; margin-top: 4px; }
.auth-foot { color: var(--text-3); font-size: 12.5px; text-align: center; }

/* ── Einstellungen → Konto ── */
.acc-me, .acc-user { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); background: var(--well); }
.acc-me { margin: 12px 0 4px; }
.acc-me .btn { margin-left: auto; }
.acc-users { list-style: none; display: grid; gap: 6px; margin: 10px 0 0; padding: 0; }
.acc-user .set-icon { margin-left: auto; }
.acc-acts { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.acc-acts .set-icon { margin-left: 0; }
.acc-conns { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-reset { padding: 0 2px 6px; }
.acc-reset .acc-link { margin-top: 4px; }
.acc-reset .set-note { margin-top: 6px; }
@media (max-width: 560px) {
  .acc-user { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .acc-acts, .acc-confirm { grid-column: 2; justify-self: start; margin-left: 0; }
}
.acc-user-text { display: grid; gap: 3px; min-width: 0; }
.acc-user-text b { font-weight: 600; }
.acc-user-text small { color: var(--text-3); font-size: 12px; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border: 1px solid var(--line-strong); font: 500 13px/1 var(--f-mono); color: var(--text-2); }
.acc-confirm { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--warn); }
.acc-del-yes { border-color: rgba(255, 118, 118, 0.5); color: var(--bad); }
.acc-link { display: flex; gap: 8px; margin-top: 10px; }
.acc-link .field { flex: 1; font: 12.5px/1 var(--f-mono); }
.acc-invites { list-style: none; display: grid; gap: 4px; margin: 10px 0 0; padding: 0; font-size: 12.5px; color: var(--text-3); }
.acc-invites li { display: flex; justify-content: space-between; gap: 10px; }
.acc-pw { margin-top: 8px; }
/* Name unten in der Leiste ist ein Knopf zum Konto */
button.rail-user { width: 100%; color: inherit; font: inherit; text-align: left; cursor: pointer; background: none; }
button.rail-user:hover { border-color: var(--line-strong); }

/* Leere Karte: ein Satz und ein Knopf zum Einrichten (mit Server statt Beispieldaten) */
.card-empty { display: grid; justify-items: start; gap: 12px; padding: 16px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.room-empty .card-empty, .dishes .card-empty { padding: 4px 0; }
.dishes > li:has(.card-empty) { padding: 8px 14px; }

/* Gameserver (Pterodactyl): Serverwahl, Status mit Auslastung, Live-Konsole */
.gs-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.gs-top { display: grid; gap: 12px; padding: 14px; }
.gs-empty { display: grid; justify-items: start; gap: 10px; color: var(--text-2); font-size: 14px; }
.gs-empty > .i { width: 28px; height: 28px; color: var(--text-3); }
.gs-list { display: flex; flex-wrap: wrap; gap: 6px; }
.gs-srv { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 6px 12px 6px 10px; border: 1px solid var(--line-strong); background: none; text-align: left; }
.gs-srv:hover { border-color: var(--text-3); }
.gs-srv.is-sel { border-color: var(--sun); background: var(--panel-hi); }
.gs-srv-text { display: grid; gap: 1px; min-width: 0; }
.gs-srv-text b { font: 14px/1.2 var(--f-pixel); font-weight: 400; color: var(--text); }
.gs-srv-text small { font: 11px/1.2 var(--f-mono); color: var(--text-3); }
.gs-dot { width: 8px; height: 8px; flex: none; background: var(--text-3); }
.gs-dot.is-running { background: var(--ok); box-shadow: 0 0 8px -1px var(--ok); }
.gs-dot.is-starting, .gs-dot.is-stopping { background: var(--warn); animation: blink 0.9s steps(1) infinite; }
.gs-dot.is-suspended, .gs-dot.is-unknown { background: var(--bad); }
.gs-detail { display: grid; gap: 12px; }
.gs-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.gs-head > .gs-dot { width: 10px; height: 10px; }
.gs-id { display: grid; gap: 2px; min-width: 0; }
.gs-name { overflow: hidden; font: 18px/1.2 var(--f-pixel); font-weight: 400; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.gs-sub { font: 12px/1.4 var(--f-mono); color: var(--text-3); }
.gs-state { color: var(--text-2); }
.gs-state.is-running { color: var(--ok); }
.gs-state.is-starting, .gs-state.is-stopping { color: var(--warn); }
.gs-addr { padding: 0; border: 0; background: none; font: inherit; color: var(--text-2); text-decoration: underline dotted; text-underline-offset: 3px; }
.gs-addr:hover { color: var(--text); }
.gs-open { display: grid; place-items: center; width: 32px; height: 32px; color: var(--text-3); }
.gs-open:hover { color: var(--text); }
.gs-open .i { width: 16px; height: 16px; }
.gs-meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.gs-meter { display: grid; grid-template-columns: auto 1fr; gap: 5px 8px; align-items: baseline; font: 12px/1.2 var(--f-mono); }
.gs-meter-label { color: var(--text-3); }
.gs-meter-val { justify-self: end; color: var(--text); white-space: nowrap; }
.gs-meter-val small { color: var(--text-3); font-size: inherit; }
.gs-meter-bar { grid-column: 1 / -1; height: 8px; background: var(--well); border: 1px solid var(--line); overflow: hidden; }
.gs-meter-bar > span {
  display: block;
  height: 100%;
  clip-path: inset(0 calc(100% - var(--p) * 100%) 0 0);
  background: var(--ok);
  /* Pixel-Segmente */
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 7px);
  mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 7px);
  transition: clip-path 0.6s var(--ease), background-color 0.3s;
}
.gs-meter.is-warm .gs-meter-bar > span { background: var(--warn); }
.gs-meter.is-hot .gs-meter-bar > span { background: var(--bad); }
.gs-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 28px; }
.gs-actions:empty { display: none; }
.gs-stop:hover, .gs-kill:hover { border-color: var(--bad); color: var(--bad); }
.gs-msg { font: 12px/1.4 var(--f-mono); }
.gs-msg.is-ok { color: var(--ok); }
.gs-msg.is-bad { color: var(--bad); }
.gs-con { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line); background: var(--well); }
.gs-con[hidden] { display: none; }
.gs-con-bar { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px 4px; font: 11px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.gs-conn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0; text-transform: none; }
.gs-conn.is-live { color: var(--ok); }
.gs-conn.is-live::before { content: '● '; }
.gs-conn.is-connecting { color: var(--warn); }
.gs-conn.is-error { color: var(--bad); }
.gs-log {
  flex: 1 1 auto;
  height: 260px;
  min-height: 140px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 14px 8px;
  font: 12.5px/1.55 var(--f-mono);
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.gs-line.is-warn { color: var(--warn); }
.gs-line.is-err { color: var(--bad); }
.gs-line.is-sys { color: var(--text-3); }
.gs-line.is-cmd { color: var(--focus); }
.gs-line.is-new { animation: gs-in 0.32s var(--ease) both; }
@keyframes gs-in { from { opacity: 0; transform: translateY(3px); } }
.gs-jump { position: absolute; right: 14px; bottom: 54px; display: flex; align-items: center; gap: 4px; min-height: 26px; padding: 0 8px 0 10px; border: 1px solid var(--line-strong); background: var(--panel-hi); font: 12px/1 var(--f-mono); color: var(--text); }
.gs-jump[hidden] { display: none; }
.gs-jump .i { width: 14px; height: 14px; transform: rotate(90deg); }
.gs-form { display: flex; align-items: center; gap: 10px; padding: 8px 14px 12px; border-top: 1px solid var(--line); font: 13px/1.6 var(--f-mono); }
.gs-form:focus-within { box-shadow: inset 0 -2px 0 var(--focus); }
.gs-prompt { color: var(--rose); }
.gs-form input { flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: var(--text); font: inherit; outline: none; }
.gs-form input:disabled { cursor: not-allowed; }
.gs-form input:disabled::placeholder { color: var(--text-3); opacity: 0.7; }
@media (max-width: 720px) {
  .gs-meters { grid-template-columns: 1fr; gap: 10px; }
  .gs-log { height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  .gs-dot { animation: none !important; }
  .gs-line.is-new { animation: none; }
}
:root[data-motion='reduced'] .gs-dot,
:root[data-motion='reduced'] .gs-line.is-new { animation: none; }

/* Discord: Sprachkanäle mit Leuten, darunter wer sonst online ist */
.dc-body { flex: 1; display: grid; align-content: start; gap: 10px; padding: 14px; min-height: 0; }
.dc-empty { display: grid; justify-items: start; gap: 10px; color: var(--text-2); font-size: 14px; }
.dc-empty > .i { width: 28px; height: 28px; color: var(--text-3); }
.dc-tabs { justify-self: start; max-width: 100%; overflow-x: auto; }
.dc-warn { display: flex; gap: 8px; align-items: flex-start; font: 12px/1.4 var(--f-mono); color: var(--warn); }
.dc-warn .i { width: 14px; height: 14px; margin-top: 1px; }
.dc-h { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; font: 500 11px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.dc-h small { font-size: inherit; color: var(--text-3); opacity: 0.7; }
.dc-voice, .dc-people { display: grid; gap: 4px; }
.dc-ch { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); background: var(--well); }
.dc-ch-name { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.dc-ch-name .i { width: 15px; height: 15px; color: var(--ok); }
.dc-ch-name span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-ch-name small { font: 11px/1 var(--f-mono); color: var(--text-3); }
.dc-ch-name:hover span { text-decoration: underline; text-underline-offset: 3px; }
.dc-ch-people { display: grid; gap: 4px; padding-left: 23px; }
.dc-ch-people li, .dc-people li { display: flex; align-items: center; gap: 9px; min-width: 0; }
.dc-name { overflow: hidden; font-size: 13.5px; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.dc-who { display: grid; min-width: 0; }
.dc-who small { overflow: hidden; font: 11.5px/1.3 var(--f-mono); color: var(--text-3); text-overflow: ellipsis; white-space: nowrap; }
.dc-flag { margin-left: auto; font: 11px/1 var(--f-mono); color: var(--text-3); }
.dc-quiet { padding: 8px 10px; border: 1px dashed var(--line); font-size: 13px; color: var(--text-3); }
.dc-av { position: relative; display: grid; place-items: center; width: 28px; height: 28px; flex: none; background: var(--panel-hi); font: 12px/1 var(--f-mono); color: var(--text-2); }
.dc-av.is-sm { width: 22px; height: 22px; font-size: 11px; }
.dc-av img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.dc-st { position: absolute; right: -2px; bottom: -2px; width: 8px; height: 8px; border: 2px solid var(--panel); background: var(--ok); box-sizing: content-box; }
.dc-ch .dc-st { border-color: var(--well); }
.dc-st.is-idle { background: var(--warn); }
.dc-st.is-dnd { background: var(--bad); }
.dc-join { justify-self: start; margin-top: 4px; text-decoration: none; }
.dc-more { padding-left: 37px; font: 11.5px/1.3 var(--f-mono); color: var(--text-3); }

/* Study: Fokus-Timer, Klänge, Start-Optionen */
.st-body { flex: 1; display: grid; align-content: start; gap: 14px; padding: 14px; }
.st-dial { position: relative; display: grid; place-items: center; justify-self: center; width: 100%; padding: 6px 0 2px; }
.st-ring { display: none; }
.st-read { display: grid; justify-items: center; gap: 4px; text-align: center; }
.st-phase { font: 500 11px/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.st-time { font: 52px/1 var(--f-pixel); color: var(--text); font-variant-numeric: tabular-nums; }
.st-sub { font: 12px/1 var(--f-mono); color: var(--text-3); }
.st[data-phase='focus'].is-running .st-phase { color: var(--sun); }
.st[data-phase='break'] .st-phase { color: var(--ok); }
.st-segbar { height: 10px; border: 1px solid var(--line); background: var(--well); }
.st-segbar > span {
  display: block;
  height: 100%;
  clip-path: inset(0 calc(100% - var(--p, 0) * 100%) 0 0);
  background: var(--sun);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 8px);
  mask: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 8px);
  transition: clip-path 0.5s linear;
}
.st[data-phase='break'] .st-segbar > span { background: var(--ok); }
.st-ctrl { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.st-go { min-width: 150px; justify-content: center; }
.st-presets { justify-self: center; margin-left: 0; }
.st-presets button { display: grid; justify-items: center; gap: 2px; min-height: 38px; padding: 4px 14px; font: 500 13px/1 var(--f-mono); }
.st-presets button small { font: 10px/1 var(--f-mono); color: var(--text-3); }
.st-presets button:disabled { cursor: default; opacity: 0.45; }
.st-sounds { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.st-sounds-head { display: flex; align-items: center; justify-content: space-between; }
.st-sounds-head h3 { font: 500 11px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.st-sounds-head .btn[aria-pressed='true'] { border-color: var(--sun); color: var(--sun-soft); }
.st-mix { display: grid; gap: 8px; }
.st-mix li { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 10px; }
.st-mix label { font-size: 13.5px; color: var(--text-2); }
.st-mix input { --fill: var(--sun); width: 100%; }
.st-opts { padding-top: 10px; border-top: 1px solid var(--line); }
.st-opts summary { cursor: pointer; font: 500 11px/1.6 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.st-opts summary:hover { color: var(--text-2); }
.st-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; font-size: 13.5px; color: var(--text-2); }
.st-opt select { max-width: 60%; min-height: 32px; padding: 0 8px; font-size: 13px; }
.st-off { font: 12px/1.4 var(--f-mono); color: var(--text-3); }
.st-opt:empty { display: none; }

/* Board stumm: alles außer Study tritt zurück, Hinweise und Alarm-Blinken ruhen */
.grid > .panel, .hero, .rail .nav, .rail-conns { transition: opacity 0.8s var(--ease), filter 0.8s var(--ease); }
.study-quiet .grid > .panel:not(#study), .study-quiet .hero, .study-quiet .rail .nav, .study-quiet .rail-conns { opacity: 0.16; filter: grayscale(0.7); }
.study-quiet .grid > .panel:not(#study):hover, .study-quiet .grid > .panel:not(#study):focus-within { opacity: 0.85; filter: none; }
.study-quiet .hints { visibility: hidden; }
.study-quiet .light-dot { animation: none !important; }
.study-quiet #study { --bd: var(--line-strong); }
@media (prefers-reduced-motion: reduce) {
  .grid > .panel, .hero, .rail .nav, .rail-conns, .st-segbar > span { transition: none; }
}
:root[data-motion='reduced'] .st-segbar > span { transition: none; }
/* Study: nichts darf die Karte breiter machen (lange Playlist-Namen, Auswahlfelder) */
.st-body { grid-template-columns: minmax(0, 1fr); }
.st-sounds, .st-opts, .st-opt > span, .st-opt > label { min-width: 0; }
.st-opt select { flex: 0 1 58%; width: 58%; max-width: none; min-width: 0; text-overflow: ellipsis; }
.st-mix li[data-state='loading'] label::after { content: ' lädt …'; color: var(--text-3); font-size: 11px; }
.st-mix li[data-state='error'] label { color: var(--bad); }
.st-mix li[data-state='error'] label::after { content: ' Fehler'; font-size: 11px; }
.spot-hint { font: 12px/1.45 var(--f-mono); color: var(--text-3); }
.spot-hint a { color: var(--text-2); }
/* Klänge: einklappbar wie "Beim Start"; zugeklappt steht rechts, was läuft */
.st-sounds { display: block; padding-top: 10px; }
.st-sounds summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; cursor: pointer; font: 500 11px/1.6 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.st-sounds summary:hover { color: var(--text-2); }
.st-sounds-now { overflow: hidden; letter-spacing: 0; text-transform: none; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); }
.st-sounds-now.is-on { color: var(--sun-soft); }
.st-sounds-body { display: grid; gap: 10px; padding-top: 10px; }
.st-sounds-head span { font: 12px/1.3 var(--f-mono); color: var(--text-3); }
.st-sounds summary { list-style: none; }
.st-sounds summary::-webkit-details-marker { display: none; }
.st-sounds summary > span:first-child::before { content: '▸'; display: inline-block; width: 1.1em; }
.st-sounds[open] summary > span:first-child::before { content: '▾'; }

/* Heute: Bereiche in Spalten (breit) oder untereinander (schmal) */
.td-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); align-content: start; gap: 16px 24px; padding: 14px; }
.td-wx { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.td-wx > .i { width: 30px; height: 30px; color: var(--sun-soft); }
.td-wx > b { font: 30px/1 var(--f-pixel); font-weight: 400; color: var(--text); }
.td-wx > span { display: grid; gap: 2px; font-size: 14px; color: var(--text-2); }
.td-wx small { font: 12px/1.3 var(--f-mono); color: var(--text-3); }
.td-wx small.is-rain { color: var(--focus); }
.td-sec { display: grid; align-content: start; gap: 8px; min-width: 0; }
.td-sec h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font: 500 11px/1.4 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.td-sec h3 small { display: inline-flex; align-items: center; gap: 6px; overflow: hidden; font-size: 11px; letter-spacing: 0; text-transform: none; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); }
.td-sec h3 .dot { width: 6px; height: 6px; }
.td-list { display: grid; gap: 6px; }
.td-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 10px; font-size: 14px; color: var(--text); }
.td-list li.is-past { color: var(--text-3); }
.td-list li.is-past .td-time { color: var(--text-3); }
.td-list li.is-now .td-time { color: var(--ok); }
.td-list li.is-go .td-rel { color: var(--warn); }
.td-list li.is-late .td-what small { color: var(--bad); }
.td-time { font: 12.5px/1.3 var(--f-mono); color: var(--sun-soft); white-space: nowrap; }
.td-time em { margin-left: 3px; font-style: normal; color: var(--warn); }
.td-what { display: grid; min-width: 0; }
.td-what small { overflow: hidden; font: 12px/1.3 var(--f-mono); color: var(--text-3); text-overflow: ellipsis; white-space: nowrap; }
.td-what .badge { margin-right: 4px; }
.td-rel { font: 12px/1.3 var(--f-mono); color: var(--text-2); white-space: nowrap; }
.td-none, .td-line, .td-for { font-size: 14px; color: var(--text-2); }
.td-none { color: var(--text-3); }
.td-line .is-warn { color: var(--warn); }
.td-for b { color: var(--text); }
.td-trip { display: flex; align-items: center; gap: 12px; }
.td-trip > span:last-child { display: grid; gap: 2px; font-size: 13px; color: var(--text-2); }
.td-trip small { font: 12px/1.3 var(--f-mono); color: var(--text-3); }
.td-leave { font: 26px/1 var(--f-pixel); color: var(--text); }
.td-trip.is-urgent .td-leave, .td-trip.is-urgent b { color: var(--warn); }
.td-trip.is-late .td-leave, .td-trip.is-late b { color: var(--bad); }
.td-trip-note { font-size: 13px; color: var(--text-3); }
.td-todos li { grid-template-columns: minmax(0, 1fr); }
.td-todos label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.td-todos input { width: 16px; height: 16px; margin: 2px 0 0; flex: none; accent-color: var(--ok); }
.td-study { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font: 12.5px/1.3 var(--f-mono); color: var(--sun-soft); }
.td-study .i { width: 15px; height: 15px; }
.td-dep { display: flex; align-items: baseline; gap: 8px; }
.td-dep > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-what .badge { margin-right: 0; flex: none; }
.td-mensa .td-list li { grid-template-columns: minmax(0, 1fr) auto; }
/* Die verschobene Schiene des Lichtreglers darf nicht über die Karte hinausragen (sonst scrollt die Seite auf dem Handy seitlich) */
.lb-track { overflow-x: clip; overflow-clip-margin: 14px; }

/* Erste Schritte (Einstellungen → Allgemein) */
.start { display: grid; gap: 12px; margin: 0 0 22px; padding: 14px 16px; border: 1px solid var(--line); background: var(--well); }
.start-head { display: flex; align-items: baseline; gap: 12px; }
.start-head h4 { margin: 0; }
.start-count { font: 12px/1 var(--f-mono); color: var(--text-3); }
.start-head .sys-link { margin-left: auto; }
.start-steps { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.start-step { display: flex; align-items: center; gap: 12px; }
.start-mark { display: grid; place-items: center; width: 20px; height: 20px; flex: none; border: 1px solid var(--line-2, var(--line)); color: var(--ok); }
.start-mark .i { width: 13px; height: 13px; }
.start-step.is-done .start-mark { border-color: var(--ok); }
.start-text { display: grid; gap: 2px; min-width: 0; }
.start-text b { font-weight: 600; font-size: 14px; }
.start-text b small { margin-left: 6px; font: 11px/1 var(--f-mono); color: var(--text-3); font-weight: 400; }
.start-text > small { color: var(--text-3); font-size: 12.5px; line-height: 1.4; }
.start-step.is-done .start-text b { color: var(--text-2); }
.start-step .btn { margin-left: auto; flex: none; }
