/* ---------- Tokens ---------- */
:root {
  --bg: #060a08;
  --surface: #0e1612;
  --surface-2: #16231c;
  --line: #1f3329;
  --text: #dcefe4;
  --muted: #7d968a;
  --accent: #34e08a;
  --up: #34e08a;
  --down: #ff5f5f;
  --warn: #f5b83d;
  --unknown: #4c5f55;
  --radius-lg: 14px;
  --radius-sm: 8px;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* sonst überschreibt z. B. display:grid das hidden-Attribut */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Scrollbar: schmal und dunkel, Griff wird beim Drüberfahren grün */
/* Nur Firefox: Chrome/Edge würden sonst die ::-webkit-Regeln unten ignorieren */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
  border: 3px solid transparent; /* Abstand zum Rand, wirkt dadurch schmaler */
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--accent); }
::-webkit-scrollbar-corner { background: transparent; }
/* Im Fenster läuft die Scrollbar nicht über die abgerundeten Ecken */
dialog::-webkit-scrollbar-track { margin: 14px 0; }

/* ---------- Kopfzeile & Navigation ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 20px;
}
.brand { font-weight: 600; font-size: 17px; text-decoration: none; letter-spacing: -0.01em; }
#nav { display: flex; align-items: center; flex: 1; gap: 24px; }
.tabs { display: flex; gap: 4px; }
.tabs a .icon { display: none; } /* Icons nur am Handy */
.tabs a {
  text-decoration: none;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); background: var(--surface-2); }
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }

main { max-width: 1180px; margin: 0 auto; padding: 0 20px 48px; }

/* ---------- Gesamtstatus (Hero) ---------- */
.summary { padding: 28px 0 8px; }
.summary-title {
  margin: 0;
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.summary.is-ok .summary-title { color: var(--up); }
.summary.is-warn .summary-title { color: var(--warn); }
.summary.is-down .summary-title { color: var(--down); }
.summary-sub { margin: 10px 0 0; color: var(--muted); }
.summary-sub strong { color: var(--text); font-weight: 500; }
.live { display: inline-flex; align-items: center; gap: 6px; }
.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--unknown); }
.live.on::before { background: var(--up); }

/* ---------- Kategorien ---------- */
.category { margin-top: 36px; }
.category-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.category-head h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.category-head span { color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }

/* ---------- Kachel ---------- */
.tile {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px 16px 14px;
  overflow: hidden;
}
.tile.down { background: color-mix(in srgb, var(--down) 12%, var(--surface)); }
.tile.warn { background: color-mix(in srgb, var(--warn) 9%, var(--surface)); }

.tile-head { display: flex; align-items: center; gap: 12px; }
.tile-title { flex: 1; min-width: 0; }
.tile-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Icon der Prüfungsart, eingefärbt nach Status */
.type-badge {
  --c: var(--unknown);
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
}
.type-badge .icon { width: 20px; height: 20px; }
.up .type-badge, .type-badge.up { --c: var(--up); }
.warn .type-badge { --c: var(--warn); }
.down .type-badge { --c: var(--down); }
.type-badge.neutral, .type-card .type-badge, .chosen-type .type-badge { --c: var(--accent); }
.down > .tile-head .type-badge::after, dialog.down .d-head .type-badge::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  animation: ring 1.8s infinite;
}
@keyframes ring {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--down) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 10px transparent; }
}

/* Kurzer "Herzschlag", wenn ein neues Live-Ergebnis reinkommt */
.tile.beat .type-badge { animation: beat .7s ease-out; }
@keyframes beat {
  0% { transform: scale(1); }
  30% { transform: scale(1.14); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 transparent; }
}

/* Zusatzinfos (Spieler, Health-Felder, Zertifikat) */
.tile-info { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.kv, .players {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}
.kv span { color: var(--muted); }
.players { background: color-mix(in srgb, var(--up) 14%, transparent); }
.players strong { font-weight: 600; color: var(--up); }

/* Einmalige Einblendung beim Laden */
.intro .tile { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 45ms); }
.intro .spark path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s ease-out forwards; animation-delay: calc(var(--i) * 45ms + .2s); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.summary-title { animation: fade .5s ease-out both; }
@keyframes fade { from { opacity: 0; } }
.lat { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; }
.lat small { font-size: 13px; color: var(--muted); margin-left: 2px; font-weight: 400; }

.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--unknown); }
.up .status-dot { background: var(--up); }
.warn .status-dot { background: var(--warn); }
.down .status-dot { background: var(--down); box-shadow: 0 0 0 0 var(--down); animation: pulse 1.8s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--down) 60%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .down .status-dot { animation: none; } }

.msg { margin: 1px 0 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.spark { display: block; width: 100%; height: 34px; margin: 12px 0 6px; }
.spark path { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.up .spark path { stroke: var(--up); }
.warn .spark path { stroke: var(--warn); }
.down .spark path, .unknown .spark path { stroke: var(--muted); }
.spark .gap { fill: color-mix(in srgb, var(--down) 35%, transparent); }

.since { margin: 0; font-size: 12px; color: var(--muted); }

.tile { cursor: pointer; transition: background .15s; }
.tile:hover { background: var(--surface-2); }
.tile.down:hover { background: color-mix(in srgb, var(--down) 17%, var(--surface)); }

/* ---------- Detailansicht ---------- */
dialog {
  width: min(720px, calc(100% - 32px));
  max-height: calc(100% - 48px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  overflow-y: auto;
}
dialog::backdrop { background: rgba(0, 0, 0, .65); }
dialog h3 { margin: 24px 0 10px; font-size: 15px; font-weight: 600; }

.d-head { display: flex; align-items: flex-start; gap: 12px; }
.d-head .status-dot { margin-top: 10px; width: 11px; height: 11px; }
.d-title { flex: 1; min-width: 0; }
.d-title h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.d-title p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
dialog.down .d-title p { color: var(--down); }
.close { font-size: 18px; line-height: 1; padding: 8px 10px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; }
.stats > div { background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.stat-value { display: block; font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.stat-label { font-size: 13px; color: var(--muted); }

.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chart-box { position: relative; height: 200px; }
.segmented { display: flex; background: var(--bg); border-radius: 999px; padding: 3px; margin-top: 14px; }
.segmented button { background: transparent; color: var(--muted); padding: 5px 12px; border-radius: 999px; font-size: 13px; }
.segmented button.on { background: var(--surface-2); color: var(--text); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 24px 0 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.events { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.events li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.events li:last-child { border-bottom: 0; }
.events time { margin-left: auto; color: var(--muted); font-size: 13px; }
.events .down .status-dot { animation: none; }

a.button {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
}
a.button.secondary { background: var(--surface-2); }

.empty { padding: 40px 0; color: var(--muted); }

/* ---------- Formulare & Verwaltung ---------- */
.page-title { margin: 28px 0 4px; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.page-sub { margin: 0 0 24px; color: var(--muted); }
h2.section-title { margin: 36px 0 12px; font-size: 19px; font-weight: 600; }

.card { background: var(--surface); border-radius: var(--radius-lg); padding: 20px; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 16px; }
.form .wide { grid-column: 1 / -1; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }

/* Passwortfeld mit Auge-Button */
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; padding-right: 44px; }
.pw-toggle {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
}
.pw-toggle:hover { color: var(--text); filter: none; }
.pw-toggle svg { width: 19px; height: 19px; }
input[readonly] { color: var(--muted); }
textarea { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 13px; resize: vertical; }

button {
  background: var(--accent);
  color: #060a08;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button.small { padding: 6px 12px; font-size: 14px; }
button.secondary { background: var(--surface-2); color: var(--text); }
button.ghost { background: transparent; color: var(--muted); padding: 6px 8px; }
button.ghost:hover { color: var(--text); }
button.danger { background: transparent; color: var(--down); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--down) 50%, transparent); }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small-text { font-size: 13px; }
.error { color: var(--down); font-size: 14px; }

.form-sub { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 16px; }
.form-sub:empty { display: none; }
details.advanced { margin: 0; border: 0; padding: 0; }
details.advanced summary { margin-bottom: 10px; }
details.advanced label { max-width: 220px; }

/* Schalter (für Rechte) */
.switch-row { display: flex; flex-wrap: wrap; gap: 10px 28px; }
label.toggle { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 14px; cursor: pointer; }
input.switch {
  appearance: none;
  width: 36px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  flex: none;
  transition: background .15s;
}
input.switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text);
  transition: transform .15s;
}
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(16px); background: #060a08; }
input.switch:disabled { opacity: .45; cursor: not-allowed; }

/* Checkboxen (Server-Freigaben) */
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 14px; cursor: pointer; }
input[type=checkbox]:not(.switch) { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }

/* Seitenkopf mit Aktion rechts */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .page-sub { margin-bottom: 0; }
.add-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; font-weight: 600; }
.add-btn span { font-size: 20px; line-height: 0; margin-top: -1px; }

/* Server-Liste */
.list { display: grid; gap: 8px; }
.list-item, .event-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
}
.list-text { flex: 1; min-width: 0; }
.list-item h3, .event-row h3 { margin: 0; font-size: 15px; font-weight: 500; }
.list-item .meta, .event-row .meta { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .actions { display: flex; gap: 6px; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.empty-state { background: var(--surface); border-radius: var(--radius-lg); padding: 32px 20px; text-align: center; color: var(--muted); }
.empty-state p { margin: 0 0 16px; }

/* Ereignisse */
h2.day { font-size: 14px; font-weight: 500; color: var(--muted); margin: 28px 0 10px; }
h2.day:first-child { margin-top: 0; }
#events { display: grid; gap: 8px; }
#events h2.day { margin-bottom: 2px; }
.event-what { font-weight: 400; color: var(--muted); }
.event-row.down .event-what { color: var(--down); }
.event-row.up .event-what { color: var(--up); }
.event-row.warn .event-what { color: var(--warn); }
.event-time { text-align: right; display: grid; gap: 2px; flex: none; }
.event-time time { font-weight: 500; }
.ongoing { color: var(--down); }
.page-head .segmented { margin-top: 0; }

/* Dialog: Prüfungsart wählen */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 20px; }
.type-card {
  display: grid;
  gap: 6px;
  justify-items: start;
  text-align: left;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 400;
  transition: box-shadow .15s, transform .15s;
}
.type-card strong { font-weight: 600; margin-top: 4px; }
.type-card:hover { filter: none; box-shadow: inset 0 0 0 1px var(--accent); transform: translateY(-2px); }

.chosen-type { display: flex; align-items: center; gap: 12px; margin: 20px 0 4px; padding: 12px; border-radius: var(--radius-lg); background: var(--bg); }
.chosen-type > div { flex: 1; min-width: 0; }
.chosen-type p { margin: 0; }
#check-form .form { margin-top: 16px; }
.dialog-actions { margin-top: 24px; }

/* ?-Hilfe */
.help-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 22px;
  flex: none;
}
.help-btn:hover, .help-btn[aria-expanded="true"] { background: var(--accent); color: var(--bg); filter: none; }
.help-box {
  margin: 8px 0 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  border-left: 3px solid var(--accent);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  animation: fade .2s ease-out;
}
.help-box ul { margin: 6px 0 0; padding-left: 18px; }
.help-box code { font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.field-label label { display: inline; }

/* Kleine Icon-Knöpfe (Glocke, Kopieren, Pin, …) */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); filter: none; }
.icon-btn .icon { width: 19px; height: 19px; }
.icon-btn.on { color: var(--accent); }
.icon-btn.done { color: var(--up); }
.icon-btn.del:hover { color: var(--down); }

/* ---------- Ablage ---------- */
.composer {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 12px;
  margin-bottom: 20px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.composer:focus-within { box-shadow: inset 0 0 0 1px var(--accent); }
.composer textarea {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: var(--font);
  font-size: 15px;
  resize: vertical;
  min-height: 52px;
  padding: 6px 6px;
}
.composer textarea:focus { border: 0; }
.composer-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.composer-actions #status { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-btn {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.file-btn .icon { width: 17px; height: 17px; }
.file-btn:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.drop-hint {
  position: fixed;
  inset: 12px;
  z-index: 50;
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: 20px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  color: var(--accent);
  font-size: 20px;
  font-weight: 600;
  pointer-events: none;
}

.clips { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.clip { background: var(--surface); border-radius: var(--radius-lg); padding: 14px 14px 8px; min-width: 0; }
.clip.pinned { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.clip.new { animation: rise .4s cubic-bezier(.2, .7, .2, 1); }
.clip-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow-y: auto; font-size: 15px; }
.clip-text a { color: var(--accent); }
.clip-img { display: block; border-radius: 10px; overflow: hidden; background: var(--bg); }
.clip-img img { display: block; width: 100%; max-height: 320px; object-fit: contain; }
.clip-file-meta { margin-top: 8px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-file { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 6px 0; overflow-wrap: anywhere; }
.clip-file > .icon { width: 34px; height: 34px; flex: none; color: var(--accent); }
.clip-foot { display: flex; align-items: center; gap: 2px; margin-top: 8px; }
.keep-hint { margin-top: 20px; }

/* Dialoge gleiten auf */
dialog[open] { animation: pop .22s cubic-bezier(.2, .8, .2, 1); }
dialog[open]::backdrop { animation: fade .2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
dialog h3 { margin: 24px 0 10px; }
label.check .icon { width: 16px; height: 16px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .intro .spark path { stroke-dashoffset: 0; }
}

/* Benutzer */
.user-list { display: grid; gap: 12px; }
.user-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.user-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge.admin { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
details summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details[open] summary { margin-bottom: 12px; }
.access { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 20px; margin-bottom: 14px; }
.access .cat { grid-column: 1 / -1; color: var(--muted); font-size: 13px; margin-top: 4px; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { margin: 0 0 6px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.login p.muted { margin: -8px 0 6px; }

/* ---------- Handy ---------- */
@media (max-width: 680px) {
  .topbar { padding: 14px 16px; }
  main { padding: 0 16px calc(120px + env(safe-area-inset-bottom)); }
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .summary { padding-top: 12px; }

  /* Navigation wird zur schwebenden Leiste mit Icons unten */
  .tabs {
    position: fixed;
    left: 14px; right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 10;
    gap: 4px;
    padding: 6px;
    border-radius: 24px;
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .4);
  }
  .tabs a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 2px 7px;
    border-radius: 18px;
    font-size: 11px;
    font-weight: 500;
    transition: background .2s, color .2s;
  }
  .tabs a .icon { display: block; width: 22px; height: 22px; transition: transform .2s; }
  .tabs a.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); }
  .tabs a:active .icon { transform: scale(.88); } /* kurzes Feedback beim Antippen */
  .account .name { display: none; }

  /* Dialoge kommen am Handy als Blatt von unten */
  dialog {
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    margin: auto 0 0;
    border: 0;
    border-radius: 20px 20px 0 0;
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  }
  dialog[open] { animation: sheet .28s cubic-bezier(.2, .8, .2, 1); }
  @keyframes sheet { from { transform: translateY(40%); opacity: .4; } }
  .type-grid { grid-template-columns: 1fr 1fr; }
  .type-card { padding: 12px; }
  .page-head { align-items: stretch; }
  .add-btn { justify-content: center; width: 100%; }
  .event-row .meta { white-space: normal; }
  .clips { grid-template-columns: 1fr; }
  .tabs a { font-size: 10.5px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div:first-child { grid-column: 1 / -1; }
  .chart-box { height: 180px; }

  .list-item { flex-wrap: wrap; }
  .list-item .chip { display: none; }
  .list-item .actions { width: 100%; padding-left: 52px; }
}
