/* Stundenplan – ruhiges, helles Design: Inter, feine Linien, ein Akzent (Indigo), Fächer in Pastell.
   Uhrzeiten immer mit gleich breiten Ziffern (tabular-nums), damit sie exakt untereinander stehen. */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --ink: #0f1218;
  --ink-2: #4a505c;
  --ink-3: #868c98;
  --line: #e7e9ee;
  --line-2: #d6d9e0;
  --accent: #4f46e5;
  --accent-2: #4338ca;
  --accent-ink: #ffffff;
  --accent-soft: #eef0ff;
  --accent-line: #c7cbfb;
  --live: #4f46e5;
  --ok: #15803d;
  --warn: #c2410c;
  --danger: #dc2626;
  --focus: #4f46e5;
  /* Fachfarben: Hintergrund (Pastell) und Kennlinie */
  --ev-bg-s: 85%;
  --ev-bg-l: 95%;
  --ev-line-s: 62%;
  --ev-line-l: 52%;
  --ev-ink-l: 30%;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow: 0 1px 2px rgb(16 24 40 / 0.04), 0 4px 14px rgb(16 24 40 / 0.05);
  --shadow-lg: 0 12px 40px -12px rgb(16 24 40 / 0.22);
  --radius: 16px;
  --font-ui: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c10;
    --surface: #14161c;
    --surface-2: #1b1e25;
    --ink: #f1f2f5;
    --ink-2: #b2b7c2;
    --ink-3: #7b818e;
    --line: #23262e;
    --line-2: #30343e;
    --accent: #8b8ff8;
    --accent-2: #a5a8fb;
    --accent-ink: #0b0c10;
    --accent-soft: #1d1f3a;
    --accent-line: #3b3f80;
    --live: #8b8ff8;
    --ok: #4ade80;
    --warn: #fb923c;
    --danger: #f87171;
    --focus: #a5a8fb;
    --ev-bg-s: 28%;
    --ev-bg-l: 17%;
    --ev-line-s: 70%;
    --ev-line-l: 66%;
    --ev-ink-l: 82%;
    --shadow-sm: none;
    --shadow: none;
    --shadow-lg: 0 12px 40px -12px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0c10;
  --surface: #14161c;
  --surface-2: #1b1e25;
  --ink: #f1f2f5;
  --ink-2: #b2b7c2;
  --ink-3: #7b818e;
  --line: #23262e;
  --line-2: #30343e;
  --accent: #8b8ff8;
  --accent-2: #a5a8fb;
  --accent-ink: #0b0c10;
  --accent-soft: #1d1f3a;
  --accent-line: #3b3f80;
  --live: #8b8ff8;
  --ok: #4ade80;
  --warn: #fb923c;
  --danger: #f87171;
  --focus: #a5a8fb;
  --ev-bg-s: 28%;
  --ev-bg-l: 17%;
  --ev-line-s: 70%;
  --ev-line-l: 66%;
  --ev-ink-l: 82%;
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: 0 12px 40px -12px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- Grundlagen */

* { box-sizing: border-box; }
/* "hidden" muss immer gewinnen – sonst überschreibt z. B. display:flex es und unsichtbare Ebenen schlucken Klicks */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-ui);
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  overscroll-behavior-y: contain;
}
body.focus-mode { padding-bottom: 24px; }
body.sheet-open { overflow: hidden; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--ink-3); }
.small { font-size: 0.85rem; }
.warn { color: var(--warn); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.02em; }

main { max-width: 760px; margin: 0 auto; outline: none; padding: 0 16px; }
.page { padding: 8px 0 24px; }
.page-title {
  font: 700 1.75rem/1.15 var(--font-ui);
  letter-spacing: -0.025em;
  margin: 12px 0 8px;
}
.page-lead { color: var(--ink-2); margin: 0 0 18px; font-size: 1rem; }
.page-foot { text-align: center; color: var(--ink-3); margin: 20px 0 0; font-size: 0.9rem; }
.page-foot a, .page-lead a { color: var(--accent); font-weight: 600; text-decoration: none; }
.empty-state { text-align: center; padding-top: 48px; }
.empty-state .btn { margin-top: 16px; }

/* ---------------------------------------------------------------- Kopf, Banner, Tabs */

.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  max-width: 760px; margin: 0 auto;
  padding: calc(6px + env(safe-area-inset-top)) 8px 6px 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
}
.appbar-title {
  font: 600 0.8rem/1.2 var(--font-ui);
  letter-spacing: 0.02em; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.focus-mode .appbar { visibility: hidden; height: calc(12px + env(safe-area-inset-top)); padding: 0; }

.icon-btn {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 12px;
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.spinning svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.banner {
  max-width: 728px; margin: 0 auto 8px; padding: 10px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--warn) 9%, var(--surface)); color: var(--ink);
  font-size: 0.9rem; border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent);
}
@media (max-width: 760px) { .banner { margin: 0 16px 8px; } }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.focus-mode .tabbar { display: none; }
.tabbar a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 10px; color: var(--ink-3); text-decoration: none;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.01em;
}
.tabbar svg { width: 23px; height: 23px; }
.tabbar a[aria-current] { color: var(--accent); }
.badge {
  position: absolute; top: 4px; left: calc(50% + 7px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font: 700 11px/18px var(--font-ui); font-style: normal; text-align: center;
}

.pull {
  position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; z-index: 40;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-lg);
  transform: translate(-50%, -48px); opacity: 0;
  transition: transform 0.2s var(--ease), opacity 0.2s, background 0.15s, color 0.15s;
}
.pull svg { width: 21px; height: 21px; }
.pull.ready { background: var(--accent); color: var(--accent-ink); }
.pull.spinning svg { animation: spin 0.8s linear infinite; }

/* ---------------------------------------------------------------- Bausteine */

.card {
  display: block; margin: 0 0 14px; padding: 18px;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.card-title { font: 650 1.05rem/1.25 var(--font-ui); letter-spacing: -0.01em; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card-accent { background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); border-color: var(--accent-line); }
.card > p + p { margin-top: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 20px; border: 0; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; letter-spacing: -0.005em; text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.08), inset 0 1px 0 rgb(255 255 255 / 0.12);
  transition: transform 0.1s var(--ease), background 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: scale(0.97); }
.btn-block { width: 100%; margin-top: 6px; }
.btn-quiet { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-sm); }
.btn-quiet:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--ink-2); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-quiet { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger-quiet:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.btn-lg { min-height: 52px; padding: 13px 24px; font-size: 1.02rem; border-radius: 14px; }
.btn:disabled { opacity: 0.55; cursor: progress; transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 0.74rem; font-weight: 600; vertical-align: 1px; white-space: nowrap;
}
.chip-warn, .chip-removed { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); box-shadow: none; }
.chip-added { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--ok); box-shadow: none; }
.chip-changed { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.chip-live { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.chip-btn { cursor: pointer; border: 0; font-size: 0.9rem; padding: 6px 12px; }

.segmented { display: flex; gap: 2px; padding: 3px; margin: 0 0 14px; background: var(--surface-2); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.segmented button {
  flex: 1; min-height: 34px; padding: 6px 8px; border: 0; border-radius: 9px; background: transparent;
  color: var(--ink-3); font-weight: 600; font-size: 0.92rem; cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }

.form { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 600; font-size: 0.9rem; margin-top: 6px; display: block; }
.field-label:first-child { margin-top: 0; }
.field-hint { color: var(--ink-3); font-size: 0.8rem; margin: -2px 0 2px; }
.field-row { display: flex; gap: 8px; }
input[type="text"], input[type="password"], input[type="search"] {
  width: 100%; min-width: 0; min-height: 48px; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
input:disabled { opacity: 0.6; }
input::placeholder { color: var(--ink-3); }
.form-error {
  margin-top: 6px; padding: 10px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--danger) 8%, var(--surface)); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); font-size: 0.92rem;
}
.form-error a { color: var(--accent); font-weight: 650; }
.spinner {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; vertical-align: -3px;
}
.route-empty .spinner { margin-right: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.check { display: flex; gap: 10px; align-items: center; margin: 14px 0 4px; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }

.help summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.help summary::-webkit-details-marker { display: none; }
.help summary::after { content: "+"; font: 300 1.5rem/1 var(--font-ui); color: var(--ink-3); transition: transform 0.2s var(--ease); }
.help[open] summary::after { transform: rotate(45deg); }
.help ul { padding-left: 18px; margin: 10px 0; }
.help li { margin-bottom: 8px; color: var(--ink-2); }
.help p { margin-top: 10px; color: var(--ink-2); }

.icon { width: 1em; height: 1em; flex-shrink: 0; vertical-align: -0.12em; }

/* ---------------------------------------------------------------- Kopf einer Ansicht + Wochenleiste */

.dayhead { display: flex; align-items: center; gap: 4px; margin: 4px -8px 12px; }
.dayhead-text { flex: 1; text-align: center; min-width: 0; }
.dayhead-title { font: 700 1.6rem/1.15 var(--font-ui); letter-spacing: -0.025em; }
.dayhead-sub { color: var(--ink-3); font-size: 0.9rem; margin-top: 2px; font-variant-numeric: tabular-nums; }
.dayhead-sub a { color: var(--accent); font-weight: 600; text-decoration: none; }
.nav-arrow {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  color: var(--ink-2); text-decoration: none;
}
.nav-arrow svg { width: 22px; height: 22px; }
.nav-arrow:hover { background: var(--surface); color: var(--ink); }

.weekstrip {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin: 0 0 18px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.ws-day {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 6px; border-radius: 12px; text-decoration: none; color: var(--ink-2);
}
.ws-day.weekend { color: var(--ink-3); }
.ws-wd { font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.ws-num { font: 650 1.05rem/1.2 var(--font-ui); font-variant-numeric: tabular-nums; }
.ws-dots { display: flex; gap: 2px; height: 5px; }
.ws-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.45; }
.ws-day.today .ws-num { color: var(--accent); }
.ws-day.today .ws-dots i { background: var(--accent); opacity: 0.8; }
.ws-day.sel { background: var(--accent); color: var(--accent-ink); }
.ws-day.sel .ws-num { color: var(--accent-ink); }
.ws-day.sel .ws-dots i { background: var(--accent-ink); opacity: 0.85; }

/* ---------------------------------------------------------------- Jetzt / Als Nächstes */

.hero {
  position: relative; display: block; margin: 0 0 12px; padding: 16px 18px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  text-decoration: none; color: inherit; overflow: hidden;
}
.hero::before {
  /* Kennlinie in Fachfarbe */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: hsl(var(--h, 240) var(--ev-line-s) var(--ev-line-l));
}
.hero-now { background: linear-gradient(160deg, var(--accent-soft), var(--surface) 75%); border-color: var(--accent-line); }
.hero-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.hero-label {
  display: inline-flex; align-items: center; gap: 7px;
  font: 650 0.74rem/1.2 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
}
.hero-now .hero-label { color: var(--accent); }
.hero-count {
  font: 650 0.92rem/1.2 var(--font-ui); font-variant-numeric: tabular-nums; white-space: nowrap;
  padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink);
}
.hero-now .hero-count, .hero-soon .hero-count { background: var(--accent); color: var(--accent-ink); }
.hero-title { font: 700 1.3rem/1.25 var(--font-ui); letter-spacing: -0.02em; }
.hero-meta { color: var(--ink-3); font-size: 0.88rem; margin-top: 2px; }
.hero-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 14px; }
.hero-room {
  display: inline-flex; align-items: center; gap: 6px;
  font: 700 1.6rem/1 var(--font-ui); letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.hero-room .icon { width: 20px; height: 20px; color: hsl(var(--h, 240) var(--ev-line-s) var(--ev-line-l)); }
.hero-time { font: 600 1.05rem/1.2 var(--font-ui); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.hero-time b { color: var(--ink); font-weight: 700; }
.hero-progress { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 0.78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.hero-bar { flex: 1; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); overflow: hidden; }
.hero-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.6s var(--ease); }
.hero-entry { display: block; text-decoration: none; color: inherit; }
.hero-entry + .hero-entry { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.hero-foot { margin-top: 12px; color: var(--ink-3); font-size: 0.86rem; display: flex; align-items: center; gap: 6px; }
.hero-quiet { padding: 18px; }
.hero-quiet .hero-title { font-size: 1.05rem; font-weight: 600; color: var(--ink-2); }
.hero-quiet::before { display: none; }
a.hero:active, .hero-entry:active { transform: scale(0.995); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: live 1.8s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }

/* ---------------------------------------------------------------- Der Tag als Zeitleiste */

.route { margin: 20px 0 8px; }
.route-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 10px; }
.eyebrow { font: 650 0.74rem/1.3 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow.is-today { color: var(--accent); }
.eyebrow-count { font-size: 0.84rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.route-empty { color: var(--ink-3); padding: 18px 0; text-align: center; }
.route-empty.small { padding: 4px 0 8px; text-align: left; }

.route-list { list-style: none; margin: 0; padding: 0; position: relative; }
.stop a {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: start; column-gap: 12px;
  padding: 12px 14px 12px 12px; margin: 0 0 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm);
  text-decoration: none; color: inherit; position: relative; overflow: hidden;
}
.stop a::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: hsl(var(--h) var(--ev-line-s) var(--ev-line-l));
}
.stop-time { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; padding-top: 1px; }
.stop-time b { font: 700 1rem/1.25 var(--font-ui); letter-spacing: -0.01em; }
.stop-time span { font-size: 0.82rem; color: var(--ink-3); }
.stop-allday { font-size: 0.72rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; padding-top: 3px; }
.stop-dot { display: none; }
.stop-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.stop-title { font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.stop-meta { font-size: 0.84rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stop-room {
  align-self: center; display: inline-flex; align-items: center; gap: 4px;
  font: 650 0.92rem/1 var(--font-ui); font-variant-numeric: tabular-nums;
  padding: 7px 9px; border-radius: 9px; white-space: nowrap;
  background: hsl(var(--h) var(--ev-bg-s) var(--ev-bg-l)); color: hsl(var(--h) 45% var(--ev-ink-l));
}
.stop-room .icon { width: 14px; height: 14px; }
.stop-progress { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.stop-progress span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.stop.past a { opacity: 0.5; box-shadow: none; }
.stop.current a { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line), var(--shadow); }
.stop.cancelled .stop-title { text-decoration: line-through; text-decoration-thickness: 2px; }
.stop.cancelled a { opacity: 0.7; }
.stop a:hover { border-color: var(--line-2); }
.stop-gap {
  display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; padding: 0 4px 0 12px;
  color: var(--ink-3); font-size: 0.82rem; font-variant-numeric: tabular-nums;
}
.stop-gap::after { content: ""; flex: 1; border-top: 1px dashed var(--line-2); }
.now-marker {
  display: flex; align-items: center; gap: 8px; margin: 2px 0 10px;
  color: var(--accent); font: 650 0.8rem/1 var(--font-ui); font-variant-numeric: tabular-nums;
}
.now-marker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.now-marker::after { content: ""; flex: 1; height: 2px; border-radius: 1px; background: var(--accent); opacity: 0.6; }
.day-stamp { margin: 18px 0 0; text-align: center; color: var(--ink-3); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Wochenraster */

.grid {
  margin: 0 -8px 16px; padding: 0 0 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm);
  overflow: clip;
}
.grid-head, .grid-body, .grid-allday { display: grid; grid-template-columns: 38px repeat(var(--days), 1fr); }
.grid-head {
  position: sticky; top: calc(52px + env(safe-area-inset-top)); z-index: 5;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.grid-head a {
  display: flex; flex-direction: column; align-items: center; margin: 0 2px;
  color: var(--ink-3); text-decoration: none; padding: 4px 0; border-radius: 10px;
  font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
}
.grid-head a b { font: 650 1.05rem/1.2 var(--font-ui); color: var(--ink); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.grid-head a.today { background: var(--accent); color: var(--accent-ink); }
.grid-head a.today b { color: var(--accent-ink); }
.grid-gutter { font-size: 0.6rem; color: var(--ink-3); text-align: right; padding: 4px 6px 0 0; }
.grid-allday { align-items: start; padding: 4px 0; border-bottom: 1px solid var(--line); }
.grid-allday > div { display: flex; flex-direction: column; gap: 2px; padding: 0 1px; min-width: 0; }
.ad {
  display: block; padding: 3px 5px; border-radius: 6px; font-size: 0.68rem; font-weight: 600;
  background: hsl(var(--h) var(--ev-bg-s) var(--ev-bg-l)); color: hsl(var(--h) 45% var(--ev-ink-l)); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ad.cancelled { text-decoration: line-through; opacity: 0.6; }
.grid-body { padding-top: 10px; }
.hours { position: relative; }
.hours span {
  position: absolute; right: 6px; transform: translateY(-50%);
  font: 500 0.62rem/1 var(--font-ui); color: var(--ink-3); font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
}
.hours .now-label {
  right: 2px; z-index: 3; padding: 2px 4px; border-radius: 5px;
  background: var(--accent); color: var(--accent-ink); font-weight: 650;
}
.col {
  position: relative; border-left: 1px solid var(--line);
  /* Volle Stunden durchgezogen, halbe Stunden fein gestrichelt */
  background-image:
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--hour) / 2), color-mix(in srgb, var(--line) 55%, transparent) calc(var(--hour) / 2) calc(var(--hour) / 2 + 1px), transparent calc(var(--hour) / 2 + 1px) var(--hour));
}
.col.today { background-color: color-mix(in srgb, var(--accent) 4%, transparent); }
.block {
  position: absolute; overflow: hidden; padding: 3px 3px 3px 6px; border-radius: 7px;
  background: hsl(var(--h) var(--ev-bg-s) var(--ev-bg-l));
  color: hsl(var(--h) 45% var(--ev-ink-l)); text-decoration: none; font-size: 0.7rem; line-height: 1.22;
  container-type: inline-size;
  display: flex; flex-direction: column; gap: 1px;
}
.block::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: hsl(var(--h) var(--ev-line-s) var(--ev-line-l));
}
.block:active { filter: brightness(0.97); }
.b-title { font-weight: 650; overflow-wrap: break-word; hyphens: auto; letter-spacing: -0.01em; }
.b-short, .b-tiny { display: none; }
.b-time { font-size: 0.62rem; font-weight: 500; opacity: 0.85; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.b-room { font: 650 0.68rem/1.15 var(--font-ui); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-sub { font-size: 0.64rem; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block.is-short { flex-direction: row; gap: 4px; align-items: baseline; }
.block.is-short .b-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block.is-short .b-time { display: none; }
.block.is-mid .b-time { display: none; }
@container (max-width: 96px) {
  .b-full { display: none; }
  .b-short { display: inline; }
}
/* Schmale Spalte: nur die Anfangszeit */
@container (max-width: 64px) {
  .b-end { display: none; }
  .b-title { font-size: 0.94em; letter-spacing: -0.02em; }
}
/* Sehr schmal (zwei Termine nebeneinander): nur der Anfang des Kürzels, Rest per Antippen */
@container (max-width: 32px) {
  .b-short, .b-room, .b-sub, .b-time { display: none; }
  .b-tiny { display: inline; }
}
.block.past { opacity: 0.62; }
.block.current { box-shadow: inset 0 0 0 2px var(--accent); }
.block.cancelled .b-title { text-decoration: line-through; }
.block.cancelled { opacity: 0.55; }
.nowline { position: absolute; left: -1px; right: 0; height: 2px; background: var(--accent); z-index: 2; pointer-events: none; }
.nowline::before { content: ""; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.week-day { margin-top: 14px; }

/* ---------------------------------------------------------------- Blatt (Details) */

.sheet-root {
  position: fixed; inset: 0; z-index: 50;
  background: rgb(8 10 14 / 0); transition: background 0.26s var(--ease);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-root.open { background: rgb(8 10 14 / 0.4); }
.sheet {
  width: 100%; max-width: 620px; max-height: 90vh; max-height: 90dvh;
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink);
  border-radius: 24px 24px 0 0; box-shadow: 0 -12px 40px rgb(0 0 0 / 0.18);
  transform: translateY(105%); transition: transform 0.3s var(--ease);
  outline: none; padding-bottom: env(safe-area-inset-bottom);
}
.sheet-root.open .sheet { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet-grip { display: grid; place-items: center; padding: 10px 0 4px; cursor: grab; touch-action: none; }
.sheet-grip span { width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); }
.sheet-body { overflow-y: auto; padding: 0 20px 24px; position: relative; overscroll-behavior: contain; }
.sheet-x {
  position: absolute; right: 14px; top: 0; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: var(--surface-2); color: var(--ink-2); font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.sheet-missing { padding: 24px 0; color: var(--ink-3); }
@media (min-width: 700px) {
  .sheet-root { align-items: center; }
  .sheet { border-radius: 24px; max-height: 84vh; }
  .sheet-grip { display: none; }
  .sheet-body { padding-top: 20px; }
  .sheet-x { top: 14px; }
}

.event { padding-top: 2px; }
.ev-status {
  display: inline-flex; align-items: center; gap: 7px; margin: 4px 48px 10px 0;
  font: 650 0.74rem/1.2 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
}
.ev-status.is-now { color: var(--accent); }
.ev-status.is-cancelled { color: var(--danger); }
.event-title { font: 700 1.45rem/1.22 var(--font-ui); letter-spacing: -0.025em; margin-right: 40px; }
.event-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ev-key { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 4px; }
.ev-key > div {
  padding: 12px 14px; border-radius: 14px; background: var(--surface-2); min-width: 0;
}
.ev-key small { display: block; font-size: 0.74rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.ev-key b { display: block; font: 700 1.25rem/1.25 var(--font-ui); letter-spacing: -0.015em; font-variant-numeric: tabular-nums; margin-top: 2px; overflow-wrap: anywhere; }
.ev-key span { display: block; font-size: 0.84rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ev-key .ev-room { background: hsl(var(--h) var(--ev-bg-s) var(--ev-bg-l)); }
.ev-key .ev-room b { color: hsl(var(--h) 45% var(--ev-ink-l)); }
.facts { margin: 12px 0; padding: 2px 14px; background: var(--surface-2); border-radius: 14px; }
.fact { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact dt { width: 104px; flex-shrink: 0; color: var(--ink-3); font-size: 0.9rem; }
.fact dd { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.facts-plain { background: none; padding: 0; margin: 0 0 8px; }
.notes { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; color: var(--ink-2); font-size: 0.94rem; }
.notes p { margin: 0 0 6px; overflow-wrap: anywhere; }
.notes p:last-child { margin: 0; }
.notes a { color: var(--accent); font-weight: 600; }
.event-next { margin: 22px 0 6px; }
.event-series { list-style: none; padding: 0; margin: 0; }
.event-series button {
  width: 100%; display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  padding: 11px 2px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.event-series-room { font-weight: 650; color: var(--ink-2); min-width: 3.5em; text-align: right; }

/* ---------------------------------------------------------------- Hinweis unten */

.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 60;
  max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px;
  background: var(--ink); color: var(--bg); font-size: 0.92rem; font-weight: 550;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 16px); opacity: 0; transition: transform 0.22s var(--ease), opacity 0.22s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: var(--danger); color: #fff; }
.focus-mode .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

/* ---------------------------------------------------------------- Landingpage */

body.landing-mode main { max-width: 1080px; padding: 0 20px; }
.landing { padding-bottom: 24px; }
.lp-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.lp-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; font-size: 1.05rem; text-decoration: none; }
.lp-logo { width: 32px; height: 32px; border-radius: 9px; }
.lp-nav .btn { min-height: 40px; padding: 8px 14px; }

.lp-hero { display: grid; gap: 36px; align-items: center; padding: 28px 0 40px; }
.lp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 0.82rem; font-weight: 600; color: var(--ink-2);
}
.lp-eyebrow i { font-style: normal; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.74rem; }
.lp-title { font: 750 clamp(2.2rem, 7vw, 3.6rem)/1.05 var(--font-ui); letter-spacing: -0.04em; margin: 18px 0 16px; }
.lp-title em { font-style: normal; color: var(--accent); }
.lp-lead { font-size: 1.1rem; line-height: 1.55; color: var(--ink-2); max-width: 34em; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.lp-cta .btn { flex: 1 1 auto; }
@media (min-width: 560px) { .lp-cta .btn { flex: 0 0 auto; } }
.lp-trust { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 18px; color: var(--ink-3); font-size: 0.86rem; }
.lp-trust span { display: inline-flex; align-items: center; gap: 6px; }
.lp-trust .icon { color: var(--ok); }

/* Beispielansicht im Telefonrahmen */
.lp-demo { position: relative; justify-self: center; width: 100%; max-width: 360px; }
.lp-phone {
  padding: 14px 12px 16px; border-radius: 30px; background: var(--bg);
  border: 1px solid var(--line-2); box-shadow: var(--shadow-lg), 0 0 0 7px var(--surface), 0 0 0 8px var(--line);
}
.lp-demo-tag {
  position: absolute; top: -12px; right: 18px; z-index: 2; padding: 4px 10px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 0.72rem; font-weight: 650; letter-spacing: 0.04em;
}
.lp-phone .hero { margin-bottom: 10px; }
.lp-phone .stop a { margin-bottom: 6px; }
.lp-phone .dayhead-title { font-size: 1.2rem; }
.lp-phone .dayhead { margin: 2px 0 10px; }
.lp-phone .dayhead-sub { font-size: 0.8rem; }

.lp-section { padding: 36px 0; }
.lp-h2 { font: 700 clamp(1.5rem, 4.5vw, 2rem)/1.15 var(--font-ui); letter-spacing: -0.03em; margin-bottom: 8px; }
.lp-sub { color: var(--ink-2); margin-bottom: 22px; max-width: 40em; }
.lp-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; counter-reset: step; }
.lp-steps li {
  counter-increment: step; position: relative; padding: 18px 18px 18px 64px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.lp-steps li::before {
  content: counter(step); position: absolute; left: 18px; top: 18px; width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700;
}
.lp-steps b { display: block; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 2px; }
.lp-steps span { color: var(--ink-2); font-size: 0.94rem; }
.lp-features { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.lp-feature { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); }
.lp-feature-icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 14px;
  background: var(--accent-soft); color: var(--accent);
}
.lp-feature-icon svg { width: 22px; height: 22px; }
.lp-feature b { display: block; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 4px; }
.lp-feature p { color: var(--ink-2); font-size: 0.86rem; line-height: 1.45; }
.lp-faq { display: grid; gap: 8px; }
.lp-faq .card { margin: 0; }
.lp-final {
  text-align: center; padding: 36px 22px; margin: 20px 0 8px; border-radius: 24px;
  background: linear-gradient(160deg, var(--accent-soft), var(--surface) 80%); border: 1px solid var(--accent-line);
}
.lp-final .lp-sub { margin: 0 auto 20px; }
.lp-final .lp-cta { justify-content: center; margin-top: 0; }
.lp-foot { text-align: center; color: var(--ink-3); font-size: 0.84rem; padding: 18px 0 8px; }

@media (min-width: 860px) {
  .lp-feature { padding: 20px; }
  .lp-feature p { font-size: 0.93rem; }
  .lp-features { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .lp-hero { grid-template-columns: 1.1fr 0.9fr; padding: 48px 0 56px; }
  .lp-steps { grid-template-columns: repeat(3, 1fr); }
  .lp-section { padding: 48px 0; }
}

/* ---------------------------------------------------------------- Link eingeben & Assistent */

.welcome { padding-top: 4px; }
.welcome .page-title { font-size: 2rem; }

.wizard { padding-top: 4px; }
.wiz-progress { display: flex; gap: 6px; margin: 4px 0 12px; }
.wiz-progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background 0.3s; }
.wiz-progress span.on { background: var(--accent); }
.wiz-subject {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 5px 12px 5px 10px; border-radius: 999px;
  font: 650 0.9rem/1.2 var(--font-ui);
  background: hsl(var(--h) var(--ev-bg-s) var(--ev-bg-l)); color: hsl(var(--h) 45% var(--ev-ink-l));
}
.wiz-subject::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--h) var(--ev-line-s) var(--ev-line-l)); }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s var(--ease);
}
.choice:active { transform: scale(0.985); }
.choice-badge {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font: 700 1.4rem/1 var(--font-ui); background: var(--surface-2); color: var(--ink);
}
.choice-text { display: flex; flex-direction: column; min-width: 0; }
.choice-text b { font-size: 1rem; font-weight: 650; }
.choice-text small { color: var(--ink-3); font-size: 0.84rem; font-variant-numeric: tabular-nums; }
.choice.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.choice.on .choice-badge { background: var(--accent); color: var(--accent-ink); }
.choice-all .choice-badge { font-size: 1.2rem; color: var(--ink-3); }

.courses { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.course-family { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 10px 6px 4px; }
.course-family-title { font: 650 0.98rem/1.2 var(--font-ui); padding: 2px 10px 6px; }
.course-family .course { box-shadow: none; border: 0; background: transparent; border-top: 1px solid var(--line); border-radius: 0; }
.course {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; cursor: pointer; box-shadow: var(--shadow-sm);
}
.course-check {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px; position: relative;
  box-shadow: inset 0 0 0 2px var(--line-2); transition: background 0.15s, box-shadow 0.15s;
}
.course.on .course-check { background: hsl(var(--h) var(--ev-line-s) var(--ev-line-l)); box-shadow: none; }
.course.on .course-check::after {
  content: ""; position: absolute; left: 8px; top: 4px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.course-text { display: flex; flex-direction: column; min-width: 0; }
.course-text b { font-weight: 600; }
.course-text small { color: var(--ink-3); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.course:not(.on) .course-text b { text-decoration: line-through; color: var(--ink-3); text-decoration-thickness: 2px; }
.courses-sep { margin: 22px 0 8px; }

.names { display: flex; flex-direction: column; gap: 8px; }
.name-row {
  display: grid; grid-template-columns: 1fr 74px; grid-template-areas: "full full" "input preview";
  gap: 6px 10px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.name-full { grid-area: full; font-size: 0.86rem; color: var(--ink-2); font-weight: 600; }
.name-row input { grid-area: input; min-height: 42px; font-weight: 600; }
.name-preview {
  grid-area: preview; align-self: stretch; position: relative; padding: 5px 6px 5px 9px; border-radius: 8px; font-size: 0.72rem; font-weight: 650; line-height: 1.2;
  background: hsl(var(--h) var(--ev-bg-s) var(--ev-bg-l)); color: hsl(var(--h) 45% var(--ev-ink-l));
  overflow-wrap: anywhere; overflow: hidden; max-height: 58px;
}
.name-preview::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: hsl(var(--h) var(--ev-line-s) var(--ev-line-l)); }

.wiz-nav {
  position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 10px;
  margin: 18px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.wiz-nav .btn { min-width: 120px; }

.done { text-align: center; min-height: 72vh; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.done .btn-block { max-width: 420px; }
.done .page-lead { margin: 6px auto 8px; max-width: 30ch; }
.done .btn { margin-top: 22px; }
.done-check { width: 80px; height: 80px; }
.done-check circle { fill: var(--accent); }
.done-check path {
  fill: none; stroke: var(--accent-ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw 0.5s var(--ease) 0.15s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------------------------------------------------------------- Mehr & Konto */

.cal-list { list-style: none; padding: 0; margin: 0 0 4px; }
.cal-list li { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); }
.cal-list li:last-child { border-bottom: 0; }
.cal-pick {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border: 0; background: none; text-align: left; cursor: pointer;
}
.cal-text { min-width: 0; display: flex; flex-direction: column; }
.cal-text b, .cal-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-text b { font-weight: 600; }
.cal-text small { color: var(--ink-3); }
.radio { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-2); }
.cal-list li.active .radio { box-shadow: inset 0 0 0 7px var(--accent); }
.account-line { display: flex; align-items: center; gap: 12px; }
.account-line > span:last-child { display: flex; flex-direction: column; }
.avatar {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  font: 700 1.2rem/1 var(--font-ui); background: var(--accent-soft); color: var(--accent);
}
.changes { list-style: none; padding: 0; margin: 0 0 8px; }
.changes li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.changes li a { font-weight: 600; text-decoration: none; }
.changes li small { flex-basis: 100%; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.changes li.new { background: linear-gradient(90deg, var(--accent-soft), transparent 60%); }
.advanced summary { cursor: pointer; font-weight: 600; }
.advanced[open] summary { margin-bottom: 8px; }
.advanced .btn-danger-quiet { margin-top: 16px; }
.more .segmented { margin-bottom: 4px; }
.more .field-label { margin: 8px 0 6px; }

.recovery { text-align: center; }
.recovery-code {
  font-size: 1.35rem; font-weight: 700; padding: 18px 10px; margin-bottom: 12px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent); border: 1px dashed var(--accent-line); user-select: all; overflow-wrap: anywhere;
}
.recovery .check { justify-content: center; }

/* ---------------------------------------------------------------- Suche */

.search-bar {
  position: sticky; top: calc(52px + env(safe-area-inset-top)); z-index: 5;
  display: flex; align-items: center; gap: 8px; margin: 8px 0 16px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.search-bar svg { width: 21px; height: 21px; color: var(--ink-3); flex-shrink: 0; }
.search-bar input { border: 0; background: transparent; padding-left: 0; min-height: 50px; font-size: 1.02rem; }
.search-bar input:focus-visible { outline: none; background: transparent; box-shadow: none; }
.search-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px; }
.search-hint { margin-top: 8px; }
.results { margin-bottom: 18px; }
.results .eyebrow { margin-bottom: 8px; }
.result-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.result {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
}
.result-bar { width: 4px; align-self: stretch; border-radius: 2px; background: hsl(var(--h, 240) var(--ev-line-s) var(--ev-line-l)); }
.result-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.result-text b { font-weight: 600; }
.result-text small { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.result-jump { background: var(--accent-soft); border-color: var(--accent-line); }
.result-jump b { font-size: 1.05rem; }
.result-arrow { color: var(--accent); font: 700 1.2rem/1 var(--font-ui); }

/* ---------------------------------------------------------------- Fristen & Prüfungen */

.chip-exam { background: var(--ink); color: var(--bg); box-shadow: none; }
.chip-deadline { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); color: var(--warn); box-shadow: none; }
.chip-talk { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.chip-task { background: var(--surface-2); color: var(--ink-2); }
.link-btn { border: 0; background: none; padding: 4px 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.due { margin: 18px 0 8px; }
.due-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.due-item {
  display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.due-link {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px;
  border: 0; background: none; text-align: left; text-decoration: none; color: inherit; cursor: pointer;
}
.due-days {
  flex-shrink: 0; width: 54px; min-height: 48px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink); font-variant-numeric: tabular-nums;
}
.due-days b { font: 700 1.4rem/1 var(--font-ui); letter-spacing: -0.02em; }
.due-days small { font-size: 0.6rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-top: 2px; }
.due-soon, .due-today { background: var(--accent-soft); }
.due-soon b, .due-today b { color: var(--accent); }
.due-today b { font-size: 1rem; }
.due-over { background: var(--danger); }
.due-over b, .due-over small { color: #fff; }
.due-none { background: var(--surface-2); color: var(--ink-3); }
.due-none small { color: var(--ink-3); }
.due-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.due-text b { font-weight: 600; line-height: 1.3; }
.due-text small { color: var(--ink-3); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.due-check {
  flex-shrink: 0; width: 52px; border: 0; background: none; cursor: pointer; position: relative;
  border-left: 1px solid var(--line);
}
.due-check::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%);
  border-radius: 50%; box-shadow: inset 0 0 0 2px hsl(var(--h, 240) var(--ev-line-s) var(--ev-line-l));
}
.due-check[aria-pressed="true"]::before { background: hsl(var(--h, 240) var(--ev-line-s) var(--ev-line-l)); }
.due-check[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 11px; transform: translate(-50%, -62%) rotate(45deg);
  border: solid #fff; border-width: 0 2.5px 2.5px 0;
}
.due-item.is-done .due-text b { text-decoration: line-through; color: var(--ink-3); }
.due-more { display: inline-block; margin-top: 8px; color: var(--accent); font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.due-list-page { margin-top: 16px; }
.due-done-title { margin: 22px 0 8px; }

.stop-note {
  font-size: 0.82rem; color: var(--ink-2); padding: 3px 8px; margin-top: 3px; border-radius: 6px;
  background: var(--accent-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.personal { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.personal .eyebrow { display: block; margin-bottom: 6px; }
.note-input {
  width: 100%; min-height: 64px; padding: 10px 12px; border-radius: 12px; resize: vertical;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit;
}
.note-input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.personal-tasks { margin-top: 14px; }
.personal .due-list { margin-top: 6px; }
.personal-locked { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-size: 0.92rem; }

.task-form select, .task-form input[type="date"] {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit;
}
.task-form .event-title { margin: 6px 44px 10px 0; }

.week-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.week-stats span {
  font-size: 0.8rem; font-weight: 600; color: var(--ink-2); padding: 4px 10px; border-radius: 999px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-variant-numeric: tabular-nums;
}
.week-stats span:first-child { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.block.is-exam { box-shadow: inset 0 0 0 2px var(--ink); }
.block.is-exam::after {
  content: "!"; position: absolute; right: 3px; top: 3px; width: 14px; height: 14px; border-radius: 4px;
  background: var(--ink); color: var(--bg); font: 700 0.62rem/14px var(--font-ui); text-align: center;
}
.block.has-note::after {
  content: ""; position: absolute; right: 4px; bottom: 4px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.block.is-exam.has-note::after {
  content: "!"; right: 3px; top: 3px; bottom: auto; width: 14px; height: 14px; border-radius: 4px; background: var(--ink);
}

.sub-url {
  margin: 8px 0 4px; padding: 10px 12px; border-radius: 10px; font-size: 0.8rem;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow-wrap: anywhere; user-select: all;
}
.sub-hint { margin-top: 10px; }

.push-state { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-top: 8px; }
.push-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); }
.push-dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.push-devices { margin-top: 10px; }

/* ---------------------------------------------------------------- Überwachung (#/admin) */

.adm-link { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.adm-link .lp-feature-icon { margin: 0; flex-shrink: 0; }
.adm-link b { display: block; font-weight: 650; }
.adm-link small { display: block; color: var(--ink-3); font-size: 0.86rem; }
.adm-arrow { margin-left: auto; font-size: 1.6rem; line-height: 1; color: var(--ink-3); }
.adm-status { display: flex; gap: 14px; align-items: flex-start; }
.adm-status b { display: block; font-size: 1.05rem; font-weight: 650; }
.adm-status small { display: block; color: var(--ink-2); font-size: 0.88rem; margin-top: 2px; }
.adm-status ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 0.92rem; }
.adm-status li { margin-bottom: 4px; }
.adm-status li.error { color: var(--danger); }
.adm-dot { flex-shrink: 0; width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }
.adm-status.ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.adm-status.warn .adm-dot { background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 20%, transparent); }
.adm-status.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.adm-status.error .adm-dot { background: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 20%, transparent); }
.adm-status.error { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.kpi { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; }
.kpi b { font: 700 1.6rem/1.1 var(--font-ui); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi span { font-weight: 600; font-size: 0.88rem; }
.kpi small { color: var(--ink-3); font-size: 0.76rem; }
.adm-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.adm-row:last-of-type { border-bottom: 0; }
.adm-row-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.adm-row-text b { font: 700 1.25rem/1.15 var(--font-ui); font-variant-numeric: tabular-nums; }
.adm-row-text span { font-weight: 600; font-size: 0.9rem; }
.adm-row-text small { color: var(--ink-3); font-size: 0.8rem; }
.spark { flex: 0 0 46%; height: 40px; display: flex; align-items: flex-end; gap: 2px; }
.spark i { flex: 1; min-height: 2px; border-radius: 2px 2px 0 0; background: color-mix(in srgb, var(--ink-3) 45%, transparent); }
.spark i:last-child { background: var(--ink-2); }
.spark.accent i { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.spark.accent i:last-child { background: var(--accent); }
.adm-feeds { list-style: none; padding: 0; margin: 0; }
.adm-feeds li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.adm-feeds li:last-child { border-bottom: 0; }
.adm-feeds .adm-dot { width: 10px; height: 10px; margin-top: 7px; box-shadow: none; }
.adm-feeds li.has-error .adm-dot { background: var(--danger); }
.adm-feeds b { font-weight: 650; }
.adm-feeds small { display: block; color: var(--ink-3); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.adm-feeds small.warn { color: var(--warn); }
.meter { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); vertical-align: middle; margin-left: 6px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); }
.admin .facts-plain .fact dt { width: 120px; }
.admin code { font-size: 0.9em; }

/* ---------------------------------------------------------------- Bewegung */

#view.enter-next { animation: enter-next 0.24s var(--ease); }
#view.enter-prev { animation: enter-prev 0.24s var(--ease); }
@keyframes enter-next { from { transform: translateX(28px); opacity: 0; } }
@keyframes enter-prev { from { transform: translateX(-28px); opacity: 0; } }
#view { touch-action: pan-y; }
.landing .lp-hero > *, .landing .lp-demo { animation: rise 0.6s var(--ease) both; }
.landing .lp-demo { animation-delay: 0.12s; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

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

/* ---------------------------------------------------------------- Größere Bildschirme */

@media (min-width: 700px) {
  .grid { margin: 0 0 16px; }
  .grid-head, .grid-body, .grid-allday { grid-template-columns: 50px repeat(var(--days), 1fr); }
  .block { font-size: 0.78rem; }
  .b-time { font-size: 0.7rem; }
  .hours span { font-size: 0.68rem; }
  .hero-room { font-size: 1.9rem; }
}
