/* ==========================================================================
   Superhub · Stylesheet
   Alle Farben, Radien und Schriften kommen als CSS-Variablen aus der
   Design-Engine (design-engine.js). Hier nur Struktur und Verhalten.
   ========================================================================== */

:root {
  /* Startwerte, bis die Engine läuft (Abenddämmerung, dunkel) */
  --text: #f1f3f8; --muted: #b9c0cf; --accent: #9fb8ff; --accent-ink: #111;
  --accent-soft: rgba(159,184,255,.16); --tile: rgba(18,22,34,.62); --tile-solid: #1d2333;
  --tile-border: rgba(255,255,255,.09); --line: rgba(255,255,255,.12);
  --shadow: 0 10px 30px rgba(0,0,0,.35); --radius: 16px; --blur: 16px;
  --font-head: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --head-weight: 600; --head-spacing: -0.01em;
  --danger: #ff8f8f; --ok: #8fe0a4;
  --sky-top: #141a33; --sky-mid: #2e3563; --sky-horizon: #8d7ba8;
  --row: 172px; --gap: 16px; --cols: 4;
  --ease: cubic-bezier(.2,.7,.2,1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: linear-gradient(var(--sky-top), var(--sky-mid) 55%, var(--sky-horizon));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: color 1.2s var(--ease);
  overflow-x: hidden;
}
#sky { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------------------------------------------------------------- Kachel-Grundform */
.tile {
  position: relative;
  background: var(--tile);
  border: 1px solid var(--tile-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.2);
  backdrop-filter: blur(var(--blur)) saturate(1.2);
  transition: background-color 1.2s var(--ease), border-radius .6s var(--ease), box-shadow .3s, transform .25s var(--ease);
}

/* ---------------------------------------------------------------- Kopfzeile */
.topbar {
  position: relative; z-index: 5;
  display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; align-items: center; gap: 16px;
  max-width: 1680px; margin: 0 auto; padding: 22px 24px 8px;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-right { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.clock { display: flex; flex-direction: column; line-height: 1.05; text-shadow: 0 1px 12px rgba(0,0,0,.18); }
.clock-time { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-spacing); font-size: 44px; font-variant-numeric: tabular-nums; }
.clock-date { font-size: 13px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
[data-scheme="light"] .clock { text-shadow: 0 1px 10px rgba(255,255,255,.35); }

.search { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px;
  background: var(--tile); border: 1px solid var(--tile-border); border-radius: 999px;
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); box-shadow: var(--shadow); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; height: 100%; font-size: 15px; }
.search input::placeholder { color: var(--muted); }
.search .ico { color: var(--muted); }
.search-suggest { position: absolute; left: 0; right: 0; top: 52px; padding: 6px; background: var(--tile-solid);
  border: 1px solid var(--tile-border); border-radius: 14px; box-shadow: var(--shadow); z-index: 20; }
.search-suggest a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.search-suggest a[aria-selected="true"], .search-suggest a:hover { background: var(--accent-soft); text-decoration: none; }
.search-suggest small { color: var(--muted); margin-left: auto; }

.mode-switch { display: inline-flex; padding: 4px; gap: 2px; background: var(--tile); border: 1px solid var(--tile-border);
  border-radius: 999px; -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); }
.mode-switch button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 550; font-size: 14px; color: var(--muted); transition: background .3s, color .3s; }
.mode-switch button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }

.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--tile-border);
  background: var(--tile); cursor: pointer; -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); transition: background .2s; }
.icon-btn:hover { background: var(--accent-soft); }
.icon-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.icon-btn.small { width: 28px; height: 28px; border-radius: 8px; background: transparent; border-color: transparent; }
.icon-btn.small .ico { width: 15px; height: 15px; }

.statusline { position: relative; z-index: 4; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  max-width: 1680px; margin: 0 auto; padding: 6px 24px 14px; }
.design-state { border: 1px solid var(--tile-border); background: var(--tile); border-radius: 999px; padding: 5px 12px;
  font-size: 12.5px; color: var(--text); cursor: pointer; -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.design-state::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; }
.design-state.preview::before { background: var(--danger); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.now-playing { display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 12px; border-radius: 999px; font-size: 13px;
  background: var(--accent); color: var(--accent-ink); }
.now-playing .icon-btn { color: inherit; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.eq i { width: 3px; background: currentColor; border-radius: 1px; animation: eq 1s infinite ease-in-out; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%,100% { height: 3px; } 50% { height: 12px; } }

/* ---------------------------------------------------------------- Layout: Raster + Seitenleiste */
.layout { position: relative; display: flex; align-items: flex-start; gap: var(--gap);
  max-width: 1680px; margin: 0 auto; padding: 4px 24px 120px; }
.main-wrap { flex: 1; min-width: 0; container-type: inline-size; }
.grid {
  --cols: 4;
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: var(--row);
  grid-auto-flow: dense; gap: var(--gap);
}
/* Spaltenzahl richtet sich nach dem verfügbaren Platz (mit/ohne Seitenleiste) */
@container (max-width: 1060px) { .grid { --cols: 3; } }
@container (max-width: 780px)  { .grid { --cols: 2; } }
@container (max-width: 500px)  { .grid { --cols: 1; } .widget[data-w="2"] { grid-column: span 1 !important; } }
@media (max-width: 939px)  { .topbar { grid-template-columns: 1fr auto; } .search { grid-column: 1 / -1; grid-row: 2; } }
@media (max-width: 619px)  {
  :root { --row: 168px; --gap: 12px; }
  .topbar { padding: 14px 14px 6px; } .layout { padding: 4px 14px 100px; } .statusline { padding: 4px 14px 10px; }
  .clock-time { font-size: 34px; }
  .mode-switch button { padding: 6px 10px; font-size: 13px; }
  .chip-text, .pomo-menu { display: none; }
  .topbar { grid-template-columns: 1fr; gap: 10px; }
  .search { grid-row: auto; }
  .topbar-right { justify-content: space-between; flex-wrap: nowrap; gap: 6px; }
  #btn-edit { display: none; }
  .topbar-right .icon-btn { width: 36px; height: 36px; }
  .clock-date { max-width: 60vw; }
}

.widget { display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  grid-column: span 1; grid-row: span 1; animation: tile-in .45s var(--ease) both; }
.widget[data-w="2"] { grid-column: span 2; }
.widget[data-h="2"] { grid-row: span 2; }
.widget[data-h="3"] { grid-row: span 3; }
@keyframes tile-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.widget-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 6px 16px; min-height: 44px; }
.widget-head h2 { margin: 0; font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-spacing);
  font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget-head h2 .ico { vertical-align: -3px; margin-right: 6px; color: var(--accent); }
.widget-actions { display: flex; gap: 2px; }
.widget-body { flex: 1; min-height: 0; overflow: auto; padding: 4px 16px 14px; scrollbar-width: thin; container-type: inline-size; }
.widget-body::-webkit-scrollbar { width: 6px; } .widget-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* Bearbeiten-Modus */
.edit-tools { display: none; gap: 4px; align-items: center; }
body.editing .edit-tools { display: flex; }
body.editing .widget { outline: 2px dashed var(--accent); outline-offset: -2px; cursor: grab; }
body.editing .widget .widget-body { pointer-events: none; opacity: .55; }
body.editing .widget.dragging { opacity: .4; }
body.editing .widget.drop-target { transform: scale(.97); box-shadow: 0 0 0 3px var(--accent); }
body.editing .widget.is-hidden { opacity: .45; }
.size-select { background: var(--tile-solid); border: 1px solid var(--line); border-radius: 8px; padding: 2px 4px; font-size: 12px; }
.edit-banner { position: fixed; z-index: 30; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 10px 14px; display: flex; gap: 12px; align-items: center; }

/* ---------------------------------------------------------------- Formular-Elemente */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; cursor: pointer; font-weight: 550; font-size: 14px; transition: background .2s, transform .1s; }
.btn:hover { background: var(--accent-soft); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.small { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--danger); }
input[type="text"], input[type="url"], input[type="password"], input[type="number"], input[type="date"],
input[type="datetime-local"], input[type="search"]:not(#search-input), select, textarea {
  background: color-mix(in srgb, var(--tile-solid) 85%, transparent); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; outline: none; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }
input[type="range"] { accent-color: var(--accent); }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.field > input, .field > select, .field > textarea { color: var(--text); font-size: 15px; }
.check { display: flex; gap: 8px; align-items: center; margin: 6px 0 12px; font-size: 14px; cursor: pointer; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
.notice { font-size: 12.5px; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); margin: 0 0 10px; }
.error { color: var(--danger); font-size: 13px; }
.empty { color: var(--muted); font-size: 13.5px; padding: 8px 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px;
  background: var(--accent-soft); color: var(--text); white-space: nowrap; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 0 8px; }
.tabs button { border: 0; background: none; padding: 4px 10px; border-radius: 999px; cursor: pointer; font-size: 13px; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.badge { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: inline-block; text-align: center; margin-left: 4px; }

/* ---------------------------------------------------------------- Widgets: Wetter */
.wx { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center; }
.wx-icon { width: 54px; height: 54px; color: var(--accent); }
.wx-temp { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 36px; line-height: 1; letter-spacing: var(--head-spacing); }
.wx-desc { font-size: 13px; color: var(--muted); }
.wx-hours { display: flex; gap: 12px; margin-top: 10px; overflow-x: auto; font-size: 12px; text-align: center; }
.wx-hours div { min-width: 34px; } .wx-hours b { display: block; font-size: 13px; }
.wx-days { margin-top: 10px; display: grid; gap: 4px; font-size: 13px; }
.wx-days div { display: grid; grid-template-columns: 70px 24px 1fr auto; gap: 8px; align-items: center; }
.wx-days .ico { width: 18px; height: 18px; color: var(--accent); }
.wx-sun { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

/* Kalender */
.cal-day { margin: 0 0 10px; }
.cal-day h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 4px; font-weight: 650; }
.cal-ev { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 5px 0 5px 10px; border-left: 3px solid var(--accent); margin-bottom: 4px; }
.cal-ev time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.cal-ev .t { font-size: 14px; line-height: 1.3; }
.cal-ev .l { font-size: 12px; color: var(--muted); }
.cal-ev.now { background: var(--accent-soft); border-radius: 0 8px 8px 0; }

/* Nachrichten */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { border-bottom: 1px solid var(--line); }
.news-list a { display: block; padding: 8px 0; color: var(--text); }
.news-list a:hover { text-decoration: none; color: var(--accent); }
.news-list .meta { font-size: 11.5px; color: var(--muted); display: block; margin-top: 2px; }
.news-list li.read a { opacity: .5; }
.news-list .sum { font-size: 12.5px; color: var(--muted); display: block; margin-top: 2px; }
.feed-errors { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* Links */
.link-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.link-group h3 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.link-group ul { list-style: none; margin: 0; padding: 0; }
.link-group a { display: flex; align-items: center; gap: 8px; padding: 5px 6px; margin: 0 -6px; border-radius: 8px; color: var(--text); }
.link-group a:hover { background: var(--accent-soft); text-decoration: none; }
.fav { width: 18px; height: 18px; border-radius: 5px; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--accent); color: var(--accent-ink); overflow: hidden; }
.fav img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* To-dos */
.todo-add { display: flex; gap: 6px; margin-bottom: 8px; }
.todo-add input[type="text"] { flex: 1; }
.todo-add input[type="date"] { width: 132px; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { display: grid; grid-template-columns: 20px 1fr auto auto; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.todo-list li.done .txt { text-decoration: line-through; color: var(--muted); }
.todo-list .due { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.todo-list .due.over { color: var(--danger); font-weight: 600; }
.todo-list .due.today { color: var(--accent); font-weight: 600; }
.todo-list .txt { word-break: break-word; }
.todo-list .del { opacity: 0; } .todo-list li:hover .del, .todo-list li:focus-within .del { opacity: 1; }

/* Notizen */
.notes-tabs { display: flex; gap: 4px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.notes-editor { width: 100%; height: calc(100% - 40px); min-height: 120px; font-family: var(--font-mono); font-size: 13px; line-height: 1.5; resize: none; }
.md { font-size: 14px; }
.md h1, .md h2, .md h3 { font-family: var(--font-head); font-weight: var(--head-weight); margin: .4em 0 .3em; line-height: 1.2; }
.md h1 { font-size: 18px; } .md h2 { font-size: 16px; } .md h3 { font-size: 15px; }
.md p, .md ul, .md ol { margin: .3em 0 .6em; } .md ul, .md ol { padding-left: 1.3em; }
.md code { font-family: var(--font-mono); font-size: 12.5px; background: var(--accent-soft); padding: 1px 4px; border-radius: 4px; }
.md pre { background: var(--accent-soft); padding: 8px; border-radius: 8px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: .4em 0; padding-left: 10px; border-left: 3px solid var(--accent); color: var(--muted); }
.md li.task { list-style: none; margin-left: -1.2em; }
.saved-hint { font-size: 11px; color: var(--muted); }

/* Pomodoro */
.pomo { display: flex; align-items: center; gap: 14px; height: 100%; }
.pomo-ring { width: 92px; height: 92px; flex: none; }
.pomo-ring circle { fill: none; stroke-width: 7; }
.pomo-ring .bg { stroke: var(--line); }
.pomo-ring .fg { stroke: var(--accent); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .5s linear; }
.pomo-ring text { fill: var(--text); font-family: var(--font-head); font-size: 20px; font-weight: 600; text-anchor: middle; dominant-baseline: central; font-variant-numeric: tabular-nums; }
.pomo-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pomo-phase { font-weight: 600; } .pomo-rounds { font-size: 12px; color: var(--muted); }

/* Radio */
.station-list { list-style: none; margin: 0; padding: 0; }
.station-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.station-list button.play { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: none; cursor: pointer; display: grid; place-items: center; flex: none; }
.station-list li.playing button.play { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.station-list li.playing .name { color: var(--accent); font-weight: 600; }
.station-list li.loading button.play { animation: pulse 1s infinite; }
.station-list .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.station-cat { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 2px; font-weight: 650; }
.volume { display: flex; align-items: center; gap: 8px; margin-top: 8px; } .volume input { flex: 1; }

/* YouTube */
.yt-list { list-style: none; margin: 0; padding: 0; }
.yt-list li { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.yt-list .name { flex: 1; font-size: 14px; }
.yt-dock { position: fixed; z-index: 40; right: 20px; bottom: 20px; width: min(420px, calc(100vw - 28px)); border-radius: 14px; overflow: hidden;
  background: #000; box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.yt-dock-bar { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; font-size: 13px; color: #fff; background: #111; }
.yt-dock-bar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-dock-bar .icon-btn { color: #fff; }
.yt-dock-frame { aspect-ratio: 16 / 9; } .yt-dock-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Rechner */
.calc { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.calc-display { text-align: right; font-family: var(--font-mono); padding: 6px 10px; border-radius: 10px; background: var(--accent-soft); }
.calc-display input { width: 100%; text-align: right; background: none; border: 0; font-size: 18px; padding: 0; }
.calc-display .res { font-size: 22px; font-weight: 600; min-height: 1.3em; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; flex: 1; }
.calc-keys button { border: 1px solid var(--line); background: none; border-radius: 10px; cursor: pointer; font-size: 16px; min-height: 34px; }
.calc-keys button:hover { background: var(--accent-soft); }
.calc-keys .op { color: var(--accent); font-weight: 700; } .calc-keys .eq { background: var(--accent); color: var(--accent-ink); }

/* ---------------------------------------------------------------- Einstellungen (Dialog) */
.sheet { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--tile-border);
  border-radius: calc(var(--radius) + 4px); background: var(--tile-solid); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.sheet::backdrop { background: rgba(5,8,15,.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet-layout { display: grid; grid-template-columns: 190px 1fr; height: min(680px, calc(100vh - 42px)); }
.sheet-nav { border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.sheet-nav h2 { font-family: var(--font-head); font-size: 18px; margin: 0 8px 12px; }
.sheet-nav button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.sheet-nav button[aria-selected="true"] { background: var(--accent-soft); font-weight: 600; }
.sheet-nav .spacer { flex: 1; }
.sheet-main { overflow: auto; padding: 20px 24px; }
.sheet-main h3 { font-family: var(--font-head); font-weight: var(--head-weight); margin: 0 0 12px; font-size: 18px; }
.sheet-main h4 { margin: 18px 0 8px; font-size: 14px; }
.sheet-close { position: absolute; top: 10px; right: 10px; }
.list-edit { display: flex; flex-direction: column; gap: 6px; }
.list-edit .item { display: grid; gap: 6px; grid-template-columns: 1fr 2fr auto; align-items: center; }
.list-edit .item.feed { grid-template-columns: 120px 1fr 2fr auto; }
.list-edit .item.station { grid-template-columns: 90px 1fr 2fr auto; }
.list-edit .item.occ { grid-template-columns: 90px 1fr 80px auto; }
.list-edit .item.widget-row { grid-template-columns: 24px 1fr 110px; }
.list-edit .group { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.status-dot.bad { background: var(--danger); }
@media (max-width: 700px) {
  .sheet-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sheet-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .sheet-nav h2, .sheet-nav .spacer { display: none; }
  .list-edit .item, .list-edit .item.feed, .list-edit .item.station, .list-edit .item.occ { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- Vorschau-Panel */
.preview-panel { position: fixed; z-index: 35; right: 20px; top: 90px; width: 320px; max-width: calc(100vw - 28px); padding: 14px 16px; background: var(--tile-solid); }
.preview-panel h3 { margin: 0 0 10px; font-family: var(--font-head); font-size: 16px; display: flex; align-items: center; justify-content: space-between; }
.preview-panel .field { margin-bottom: 8px; }
.preview-panel .row .btn { flex: 1; }
.preview-panel output { font-size: 12px; color: var(--muted); display: block; margin-top: 8px; }

/* ---------------------------------------------------------------- Toast */
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 16px; border-radius: 12px;
  background: var(--tile-solid); border: 1px solid var(--tile-border); box-shadow: var(--shadow); font-size: 14px; max-width: calc(100vw - 32px); }

/* ---------------------------------------------------------------- Login */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-card { position: relative; z-index: 2; width: min(380px, 100%); padding: 28px; }
.login-card .brand { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-spacing); margin: 0 0 4px; font-size: 30px; }
.login-card .btn { width: 100%; padding: 11px; margin-top: 4px; }

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

/* ==========================================================================
   Version 1.1 – Kopfzeilen-Chips, Seitenleiste, Befehle, Heute lernen, Musik
   ========================================================================== */
.chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--tile-border); background: var(--tile); font-size: 14px; white-space: nowrap;
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); transition: background .2s; }
.chip-btn:hover { background: var(--accent-soft); }
.chip-btn b { font-weight: 650; font-variant-numeric: tabular-nums; }
.chip-btn .chip-text { color: var(--muted); font-size: 13px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.chip-btn .ico { color: var(--accent); }
.mono { font-variant-numeric: tabular-nums; font-weight: 600; }
.pomo-group { display: inline-flex; }
.pomo-group .pomo-chip { border-radius: 999px 0 0 999px; position: relative; overflow: hidden; }
.pomo-group .pomo-menu { border-radius: 0 999px 999px 0; border-left: 0; padding: 0 8px; }
.pomo-chip::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--p, 0) * 100%); background: var(--accent); transition: width 1s linear; }
.pomo-chip.active { background: var(--accent-soft); }
.pomo-chip.break::after { background: var(--ok); }

.popover { position: absolute; z-index: 60; padding: 14px 16px; background: var(--tile-solid); }
.pop-title { margin: 0 0 4px; font-family: var(--font-head); font-size: 15px; }
.popover .wx-hours { margin-top: 12px; }

/* Seitenleiste */
.sidebar { flex: none; width: 340px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto;
  padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; }
body.sidebar-closed .sidebar { display: none; }
.side-top { display: flex; align-items: center; justify-content: space-between; }
.side-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.side-sec { padding: 6px 0 10px; border-bottom: 1px solid var(--line); }
.side-sec:last-child { border-bottom: 0; }
.side-h { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; font-family: var(--font-head); font-weight: var(--head-weight); font-size: 15px; }
.side-h .ico { color: var(--accent); }
.sidebar .todo-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.sidebar .todo-add .due-input { grid-column: 1; font-size: 12px; padding: 4px 8px; color: var(--muted); width: auto !important; }
.sidebar .todo-add .due-wrap { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.todo-foot { margin-top: 6px; font-size: 12px; }
.todo-list li.empty-row { display: block; border: 0; }
.notes-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.notes-head .side-h { margin-bottom: 4px; }
.note-select { padding: 3px 6px; font-size: 13px; max-width: 140px; }
.notes-area { min-height: 160px; }
.notes-area .md { cursor: text; min-height: 140px; padding: 4px 0; }
.sidebar .notes-editor { height: 340px; }
#btn-sidebar { position: relative; }
#btn-sidebar .badge { position: absolute; top: -4px; right: -4px; margin: 0; }
@media (max-width: 939px) {
  .sidebar { position: fixed; z-index: 45; top: 0; right: 0; bottom: 0; width: min(360px, 92vw); max-height: none; border-radius: 0;
    background: var(--tile-solid);
    transform: translateX(105%); transition: transform .3s var(--ease); display: flex !important; }
  body.sidebar-open .sidebar { transform: none; box-shadow: -20px 0 50px rgba(0,0,0,.35); }
}

/* Befehle */
.cmd-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; position: sticky; top: -4px; z-index: 1; padding: 2px 0 8px;
  background: linear-gradient(var(--tile-solid) 70%, transparent); margin: 0 -2px; }
.cmd-top .tabs { padding: 0; }
.cmd-search { flex: 1; min-width: 140px; padding: 5px 10px !important; font-size: 13px; }
.cmd-group h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 4px; font-weight: 650; }
.cmd-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); }
.cmd-row code { font-family: var(--font-mono); font-size: 12.5px; background: var(--accent-soft); padding: 3px 6px; border-radius: 6px; cursor: copy;
  overflow-wrap: anywhere; line-height: 1.35; }
.cmd-row code:hover { outline: 1px solid var(--accent); }
.cmd-desc { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.cmd-actions { display: flex; }
.cmd-copy.copied { background: var(--ok); color: #111; }
@container (max-width: 520px) { .cmd-row { grid-template-columns: 1fr auto; } .cmd-desc { grid-column: 1; grid-row: 2; } .cmd-actions { grid-row: 1 / 3; grid-column: 2; } }

/* Heute lernen */
.learn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; height: 100%; }
.learn-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 0; overflow: auto; padding: 10px 12px;
  border-radius: calc(var(--radius) - 6px); background: var(--accent-soft); scrollbar-width: thin; }
.learn-card header { display: flex; align-items: center; gap: 6px; }
.learn-card header b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.learn-card .chip { font-size: 11px; }
.learn-nav { margin-left: auto; display: flex; align-items: center; }
.learn-nav .btn.small { padding: 1px 6px; font-size: 11px; }
.learn-card h4 { margin: 2px 0 0; font-size: 14px; line-height: 1.3; font-family: var(--font-head); font-weight: var(--head-weight); }
.learn-code { display: block; font-family: var(--font-mono); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; padding: 4px 6px;
  border-radius: 6px; background: color-mix(in srgb, var(--tile-solid) 70%, transparent); cursor: copy; }
.learn-card p { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.rot-left { transform: rotate(-90deg); }
@container (max-width: 560px) { .learn-grid { grid-template-columns: 1fr; height: auto; } }

/* Musik */
.music-radios { display: flex; flex-wrap: wrap; gap: 6px; }
.music-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: transparent; cursor: pointer; font-size: 13.5px; font-weight: 550; transition: background .2s; }
.music-btn:hover { background: var(--accent-soft); }
.music-btn.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.music-focus { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.music-ico { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.music-ico:hover { background: var(--accent-soft); }
.music-ico .ico { width: 18px; height: 18px; }
.music-ico.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.music-btn.loading, .music-ico.loading { animation: pulse 1s infinite; }
.music-ico.yt.on { background: #c4302b; color: #fff; }
.widget[data-id="music"] .widget-body { overflow: hidden; padding-top: 0; }
.widget[data-id="music"] .volume { margin-top: 8px; }

/* Einstellungen: Senderliste */
.list-edit .item.station { grid-template-columns: 22px 78px 120px minmax(0, 1fr) minmax(0, 1.4fr) auto; }
.list-edit .item.station.head { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.list-edit .item.playlist { grid-template-columns: 22px 110px minmax(0, 1fr) minmax(0, 1.6fr) auto; }
@media (max-width: 700px) { .list-edit .item.station, .list-edit .item.playlist { grid-template-columns: 1fr 1fr; } .list-edit .item.station.head { display: none; } }
