/* Uni-Cockpit – Filament-Linie: warm, flach, ein Bernstein-Akzent. Hell/Dunkel per prefers-color-scheme. */

:root {
  color-scheme: light dark;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f6f3ee;
  --surface: #fffdf9;
  --surface-2: #f0ebe2;
  --line: #e5dfd3;
  --line-strong: #d2c9b9;
  --text: #1d1a16;
  --muted: #6b645a;
  --faint: #9b9384;

  --accent: #eda13a;
  --accent-ink: #1d1304;
  --accent-text: #9c5d08;
  --accent-soft: #fbecd2;

  --red: #c4452d;
  --red-soft: #fae5df;
  --green: #357f70;
  --green-soft: #def0ea;
  --info: #576f8a;
  --info-soft: #e5ecf3;

  --mL: 0.57;
  --mC: 0.13;

  --radius: 10px;
  --nav-h: 58px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #100f0d;
    --surface: #181613;
    --surface-2: #211e19;
    --line: #2b2722;
    --line-strong: #3b362e;
    --text: #ece7de;
    --muted: #a39b8d;
    --faint: #766f63;

    --accent-ink: #1d1304;
    --accent-text: #f0b45d;
    --accent-soft: rgba(237, 161, 58, 0.13);

    --red: #ef7b63;
    --red-soft: rgba(239, 123, 99, 0.13);
    --green: #5cc2af;
    --green-soft: rgba(92, 194, 175, 0.13);
    --info: #8fa9c4;
    --info-soft: rgba(143, 169, 196, 0.12);

    --mL: 0.76;
    --mC: 0.105;
  }
}

/* Modulfarben: feste Farbtoene, gleiche Helligkeit/Saettigung */
[data-m="HM1"]   { --mc: oklch(var(--mL) var(--mC) 28); }
[data-m="EmF"]   { --mc: oklch(var(--mL) var(--mC) 355); }
[data-m="PO"]    { --mc: oklch(var(--mL) var(--mC) 322); }
[data-m="SysTh"] { --mc: oklch(var(--mL) var(--mC) 293); }
[data-m="GDTW"]  { --mc: oklch(var(--mL) var(--mC) 258); }
[data-m="DA"]    { --mc: oklch(var(--mL) var(--mC) 228); }
[data-m="GWN"]   { --mc: oklch(var(--mL) var(--mC) 198); }
[data-m="GMMW"]  { --mc: oklch(var(--mL) var(--mC) 167); }
[data-m="EM"]    { --mc: oklch(var(--mL) var(--mC) 138); }
[data-m="GLabW"] { --mc: oklch(var(--mL) var(--mC) 108); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.sm { width: 16px; height: 16px; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } * { scroll-behavior: auto !important; } }

.boot { padding: 80px 16px; text-align: center; color: var(--muted); }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  padding-top: env(safe-area-inset-top);
  isolation: isolate;
  border-bottom: 1px solid var(--line);
}
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  backdrop-filter: saturate(1.3) blur(14px);
}
.topbar-in {
  max-width: 1200px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; gap: 12px; min-height: 56px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; }
.stamp { font-size: 12px; color: var(--muted); white-space: nowrap; }
.stamp.stale { color: var(--accent-text); }
.spacer { flex: 1; }
.top-actions { display: flex; align-items: center; gap: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 560; cursor: pointer; white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--accent); }
.btn[disabled] { opacity: 0.6; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.icon { width: 38px; padding: 0; }
.btn-refresh .lbl { display: none; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.nav a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: var(--nav-h); font-size: 11px; font-weight: 560; color: var(--muted);
  -webkit-tap-highlight-color: transparent;
}
.nav a[aria-current="page"] { color: var(--accent-text); }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; background: var(--accent); border-radius: 0 0 2px 2px;
}
.nav .ico { width: 23px; height: 23px; }
.nav .badge {
  position: absolute; top: 7px; left: calc(50% + 6px);
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}

main { max-width: 1200px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + 40px + env(safe-area-inset-bottom)); }

@media (min-width: 900px) {
  .nav {
    position: static; display: flex; gap: 2px; padding: 0; background: none; border: 0; margin-left: 18px;
  }
  .nav a { flex-direction: row; min-height: 36px; padding: 0 13px; border-radius: 8px; font-size: 14.5px; gap: 8px; }
  .nav a:hover { background: var(--surface-2); color: var(--text); }
  .nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
  .nav a[aria-current="page"]::before { display: none; }
  .nav .ico { display: none; }
  .nav .badge { position: static; }
  .btn-refresh .lbl { display: inline; }
  .btn-refresh { padding: 0 14px; }
  .btn.icon.btn-refresh { width: auto; padding: 0 14px; }
  main { padding: 28px 24px 64px; }
  .topbar-in { padding: 8px 24px; }
}

/* ---------- Banner / Toast ---------- */
.banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; margin-bottom: 18px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); background: var(--red-soft); color: var(--text);
}
.banner .ico { color: var(--red); margin-top: 1px; }
.banner b { display: block; font-weight: 650; }
.banner p { font-size: 14px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.banner.amber { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.banner.amber .ico { color: var(--accent-text); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 460px); padding: 10px 16px; border-radius: 10px;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 520; text-align: center;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 28px; } }

/* ---------- Seitenkopf / Abschnitte ---------- */
.page-h { margin-bottom: 4px; }
.page-h h1 { font-size: 27px; line-height: 1.15; font-weight: 680; letter-spacing: -0.02em; }
.page-h .sub { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; margin-bottom: 10px; padding: 4px 0; }
.back:hover { color: var(--text); }

.sec { margin-top: 28px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sec-h h2 { font-size: 12.5px; font-weight: 680; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.sec-h .aside { font-size: 13px; color: var(--muted); }
.sec-h .aside a:hover { color: var(--text); }

.cols { display: block; }
@media (min-width: 1000px) {
  .cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
  .cols > aside .sec:first-child { margin-top: 28px; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.empty {
  padding: 18px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
  color: var(--muted); font-size: 14.5px; text-align: center; background: transparent;
}
.empty b { color: var(--text); font-weight: 600; }
.empty .btn { margin-top: 12px; }

/* Tags / Badges */
.tag {
  display: inline-flex; align-items: center; flex: none; max-width: 100%;
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.02em; line-height: 1.4;
  padding: 1px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--mc, var(--muted));
  background: color-mix(in oklab, var(--mc, var(--muted)) 15%, transparent);
}
.badge-new {
  display: inline-block; font-size: 10.5px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap;
}
.prio { font-size: 11.5px; font-weight: 750; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--muted); }
.prio.p-Aplus { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.prio.p-A { border-color: var(--accent); color: var(--accent-text); }

/* ---------- Hinweise ---------- */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert {
  --lv: var(--info);
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 6px 11px 14px; background: var(--surface);
  border: 1px solid var(--line); border-left: 3px solid var(--lv); border-radius: var(--radius);
}
.alert.lv-red { --lv: var(--red); background: color-mix(in srgb, var(--red-soft) 70%, var(--surface)); }
.alert.lv-amber { --lv: var(--accent); }
.alert.lv-ok { --lv: var(--green); }
.alert.lv-info { --lv: var(--info); }
.alert-main { flex: 1; min-width: 0; }
.alert h3 { font-size: 15px; line-height: 1.3; font-weight: 640; overflow-wrap: anywhere; }
.alert-text {
  margin-top: 4px; font-size: 13.5px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.alert-text.open { display: block; -webkit-line-clamp: unset; }
.alert-more { margin-top: 1px; padding: 2px 0; border: 0; background: none; font-size: 12.5px; color: var(--accent-text); cursor: pointer; }
.alert-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 8px; font-size: 12.5px; }
.due { font-weight: 640; color: var(--muted); font-variant-numeric: tabular-nums; }
.due.soon { color: var(--accent-text); }
.due.late { color: var(--red); }
.due small { font-weight: 450; color: var(--faint); margin-left: 4px; }
.check {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 0; background: transparent; color: var(--faint); position: relative;
}
.check::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 1.5px solid var(--line-strong); transition: all 0.15s; }
.check .ico { position: relative; width: 16px; height: 16px; opacity: 0; }
.check:hover::before { border-color: var(--accent); }
.check:hover .ico { opacity: 0.5; color: var(--accent-text); }
.alert.done { opacity: 0.7; }
.alert.done h3 { text-decoration: line-through; text-decoration-color: var(--faint); }
.alert.done .check::before { background: var(--green); border-color: var(--green); }
.alert.done .check .ico { opacity: 1; color: #fff; }

details.fold { margin-top: 10px; }
details.fold > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; color: var(--muted); padding: 6px 2px;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .ico { transition: transform 0.15s; width: 16px; height: 16px; }
details.fold[open] > summary .ico { transform: rotate(180deg); }
details.fold > summary:hover { color: var(--text); }
details.fold > .alerts { margin-top: 6px; }

/* ---------- Termine ---------- */
.day-h { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 8px; }
.day-h:first-child { margin-top: 0; }
.day-h h3 { font-size: 16px; font-weight: 650; }
.day-h span { font-size: 13.5px; color: var(--muted); }
.agenda { display: flex; flex-direction: column; gap: 8px; }
.ev {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--mc, var(--line-strong));
  border-radius: var(--radius); padding: 10px 12px;
}
.ev-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: start; }
.ev-time { font-variant-numeric: tabular-nums; line-height: 1.25; }
.ev-time b { display: block; font-size: 15px; font-weight: 650; }
.ev-time span { font-size: 12.5px; color: var(--muted); }
.ev-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 15.5px; font-weight: 630; line-height: 1.3; }
.ev-meta { margin-top: 2px; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.ev-state { font-size: 12px; font-weight: 650; color: var(--accent-text); }
.ev.wahl { background: transparent; border: 1px dashed var(--line-strong); }
.ev.wahl .ev-title { font-weight: 560; font-size: 15px; color: var(--text); }
.ev.past { opacity: 0.5; }
.ev.now { border-color: var(--accent); border-left-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.ev.cancelled .ev-title > span:first-child { text-decoration: line-through; }
.ev.cancelled .ev-state { color: var(--red); }
details.ev > summary { list-style: none; cursor: pointer; }
details.ev > summary::-webkit-details-marker { display: none; }
details.ev > summary .chev { margin-left: auto; color: var(--faint); transition: transform 0.15s; }
details.ev[open] > summary .chev { transform: rotate(180deg); }
details.ev > summary .ev-title { flex-wrap: nowrap; }
.grp-list { margin: 8px 0 0 64px; display: flex; flex-direction: column; gap: 6px; border-top: 1px dashed var(--line); padding-top: 8px; }
.grp-list li { display: flex; gap: 12px; font-size: 13.5px; color: var(--muted); }
.grp-list li b { font-weight: 620; color: var(--text); font-variant-numeric: tabular-nums; min-width: 96px; }

/* ---------- Neu ---------- */
.new-list { display: flex; flex-direction: column; }
.new-item {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 10px 6px; border-top: 1px solid var(--line); border-radius: 0;
}
.new-item:first-child { border-top: 0; }
.new-item:hover { background: var(--surface-2); }
.new-item .ico { color: var(--faint); margin-top: 1px; width: 18px; height: 18px; }
.new-name { font-size: 14.5px; font-weight: 560; overflow-wrap: anywhere; line-height: 1.3; }
.new-sub { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.new-wrap { padding: 4px 10px; }

/* ---------- CP ---------- */
.cp { padding: 14px 16px 16px; }
.cp-big { display: flex; align-items: baseline; gap: 8px; }
.cp-big b { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cp-big span { color: var(--muted); font-size: 14px; }
.bar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); margin: 12px 0 8px; }
.bar > i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; }
.bar .b-have { background: var(--accent); z-index: 2; }
.bar .b-plan { background: color-mix(in srgb, var(--accent) 30%, transparent); z-index: 1; }
.bar .b-tick { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); opacity: 0.55; border-radius: 1px; z-index: 3; }
.cp p { font-size: 13px; color: var(--muted); }
.cp p + p { margin-top: 3px; }

/* ---------- Woche ---------- */
.wk-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--muted); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { width: 38px; height: 22px; border-radius: 11px; background: var(--line-strong); position: relative; transition: background 0.15s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: transform 0.15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

.days { display: grid; grid-template-columns: repeat(var(--n, 5), 1fr); gap: 6px; margin: 14px 0 12px; }
.day-chip {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0 7px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 560;
}
.day-chip b { font-size: 17px; font-weight: 680; color: var(--text); font-variant-numeric: tabular-nums; }
.day-chip.today { border-color: var(--accent); }
.day-chip.today b { color: var(--accent-text); }
.day-chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.day-chip[aria-pressed="true"] b { color: var(--bg); }

.wk { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; --hour: 58px; }
.wk-head, .wk-body { display: grid; grid-template-columns: 54px repeat(var(--cols, 5), minmax(0, 1fr)); }
.wk-head { border-bottom: 1px solid var(--line); }
.wk-hd { padding: 10px 6px 9px; text-align: center; font-size: 12.5px; color: var(--muted); border-left: 1px solid var(--line); }
.wk-hd:first-child { border-left: 0; }
.wk-hd b { display: block; font-size: 15px; font-weight: 650; color: var(--text); }
.wk-hd.today b { color: var(--accent-text); }
.wk-hd.today { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.wk-axis { position: relative; }
.wk-axis span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.wk-col {
  position: relative; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--line) calc(var(--hour) - 1px), var(--line) var(--hour));
}
.wk-col.today { background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.wk-ev {
  position: absolute; padding: 5px 7px 4px; border-radius: 7px; overflow: hidden; font-size: 12px; line-height: 1.28;
  background: color-mix(in oklab, var(--mc) 17%, var(--surface)); border-left: 3px solid var(--mc);
}
.wk-ev b { font-weight: 700; font-size: 12.5px; }
.wk-ev .k { color: var(--muted); }
.wk-ev .r { color: var(--muted); margin-top: 1px; overflow-wrap: anywhere; }
.wk-ev .t { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.wk-ev.wahl { background: transparent; border: 1px dashed color-mix(in oklab, var(--mc) 65%, var(--line-strong)); padding-left: 6px; }
.wk-ev.wahl b { color: var(--mc); }
.wk-ev.narrow .r, .wk-ev.narrow .t { display: none; }
.wk-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--accent); z-index: 4; pointer-events: none; }
.wk-now::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 22px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }
.legend .l-main { background: color-mix(in oklab, var(--muted) 22%, var(--surface)); border-left: 3px solid var(--muted); }
.legend .l-wahl { border: 1px dashed var(--line-strong); }

/* ---------- Faecher ---------- */
.search { position: relative; margin: 16px 0 6px; }
.search .ico { position: absolute; left: 12px; top: 12px; color: var(--faint); }
.search input {
  width: 100%; height: 44px; padding: 0 14px 0 40px; border-radius: 10px; font: inherit; font-size: 15.5px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.search input::placeholder { color: var(--faint); }
.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-top: 16px; }
.mod-card {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 14px; background: var(--surface);
  border: 1px solid var(--line); border-top: 3px solid var(--mc, var(--line-strong)); border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.15s;
}
.mod-card:hover { border-color: var(--line-strong); border-top-color: var(--mc); }
.mod-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mod-key { font-size: 13px; font-weight: 750; letter-spacing: 0.03em; color: var(--mc); }
.mod-card h3 { font-size: 17px; font-weight: 650; line-height: 1.25; letter-spacing: -0.01em; }
.mod-exam { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mod-next { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13.5px; }
.mod-next small { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); font-weight: 650; margin-bottom: 1px; }
.mod-next span { color: var(--muted); }
.mod-foot { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); margin-top: auto; padding-top: 6px; font-variant-numeric: tabular-nums; }
.mod-foot .sp { flex: 1; }
.note-wdh { font-size: 12.5px; color: var(--accent-text); }

.mod-head { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border: 1px solid var(--line); border-top: 3px solid var(--mc); border-radius: var(--radius); background: var(--surface); }
.mod-head h1 { font-size: 24px; line-height: 1.2; font-weight: 680; letter-spacing: -0.02em; }
.mod-head .meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 13.5px; color: var(--muted); }
.mod-head .meta .k { font-weight: 750; letter-spacing: 0.03em; color: var(--mc); }
.hint {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); font-size: 14px;
}
.hint .ico { color: var(--accent-text); margin-top: 1px; }
.hint b { font-weight: 650; }

.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); min-width: 0;
}
.row:first-child { border-top: 0; }
a.row:hover { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 580; font-size: 15px; overflow-wrap: anywhere; line-height: 1.3; }
.row .s { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.row .ico { color: var(--faint); }

.fgroup { margin-top: 18px; }
.fgroup > h3 { font-size: 15px; font-weight: 650; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.fgroup > h3 small { font-weight: 450; color: var(--muted); font-size: 13px; }
details.folder { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 8px; overflow: hidden; }
details.folder > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 14px; font-size: 14.5px; font-weight: 600;
}
details.folder > summary::-webkit-details-marker { display: none; }
details.folder > summary .cnt { margin-left: auto; font-weight: 450; font-size: 13px; color: var(--muted); }
details.folder > summary .chev { transition: transform 0.15s; color: var(--faint); width: 16px; height: 16px; }
details.folder[open] > summary .chev { transform: rotate(90deg); }
details.folder > summary > span:first-of-type { min-width: 0; overflow-wrap: anywhere; }
.file {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 10px 14px; border-top: 1px solid var(--line);
}
.file:hover { background: var(--surface-2); }
.ext { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; text-align: center; padding: 4px 0; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.file-name { font-size: 14.5px; font-weight: 540; overflow-wrap: anywhere; line-height: 1.3; }
.file-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin-top: 2px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.file-sub .path { overflow-wrap: anywhere; }

.news-item { border-top: 1px solid var(--line); }
.news-item:first-child { border-top: 0; }
.news-item > summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; }
.news-item > summary::-webkit-details-marker { display: none; }
.news-item > summary .chev { margin-top: 3px; transition: transform 0.15s; color: var(--faint); width: 16px; height: 16px; }
.news-item[open] > summary .chev { transform: rotate(90deg); }
.news-body { padding: 0 14px 14px 40px; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }

/* ---------- Nachrichten ---------- */
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 14px; }
.seg button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 13px; border-radius: 18px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 560;
}
.seg button .n { font-size: 12px; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; }
.seg button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.seg button[aria-pressed="true"] .n { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.msgs { display: block; }
@media (min-width: 900px) {
  .msgs { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
  .msgs .list { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow-y: auto; }
}
.msg {
  display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 10px; width: 100%; text-align: left; cursor: pointer;
  padding: 12px 14px; background: none; border: 0; border-top: 1px solid var(--line); border-left: 3px solid transparent; color: inherit;
}
.msg:first-child { border-top: 0; }
.msg:hover { background: var(--surface-2); }
.msg.active { background: var(--surface-2); border-left-color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; }
.msg.unread .dot { background: var(--accent); }
.msg-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.msg-from { font-size: 14px; color: var(--muted); font-weight: 520; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.unread .msg-from { color: var(--text); font-weight: 680; }
.msg-time { font-size: 12px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.msg-subj { font-size: 15px; font-weight: 600; line-height: 1.3; margin-top: 1px; overflow-wrap: anywhere; }
.msg-prev { font-size: 13px; color: var(--muted); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.msg-tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.sys-list { padding: 4px 14px 12px 36px; border-top: 1px solid var(--line); background: var(--surface-2); }
.sys-list li { display: flex; gap: 10px; padding: 5px 0; font-size: 13.5px; color: var(--muted); }
.sys-list li time { min-width: 86px; font-variant-numeric: tabular-nums; color: var(--faint); }
.sys-list li span { color: var(--text); overflow-wrap: anywhere; }

.reader { padding: 18px 18px 22px; }
.reader h2 { font-size: 21px; line-height: 1.25; font-weight: 680; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.reader-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.reader-meta b { color: var(--text); font-weight: 620; }
.reader-course { margin-top: 6px; font-size: 12.5px; color: var(--faint); overflow-wrap: anywhere; }
.reader-body { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.reader-body a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.reader-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.placeholder { display: none; }
@media (min-width: 900px) {
  .placeholder { display: grid; place-items: center; min-height: 260px; text-align: center; color: var(--faint); font-size: 14.5px; }
}

/* ---------- Plan ---------- */
.road { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 760px) { .road { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sem { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.sem.current { border-color: var(--accent); }
.sem-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sem-top b { font-size: 16px; font-weight: 700; }
.sem-top .cur { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-text); }
.sem .cpn { font-size: 13px; color: var(--muted); }
.sem .cpn b { font-size: 22px; color: var(--text); font-weight: 700; margin-right: 4px; }
.sem .goal { font-size: 13.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); background: var(--surface-2); }
.chip[data-m] { color: var(--mc); background: color-mix(in oklab, var(--mc) 14%, transparent); border-color: transparent; font-weight: 600; }

.tl { position: relative; margin-left: 5px; padding-left: 26px; }
.tl::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before { content: ""; position: absolute; left: -26px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--dot, var(--info)); }
.tl-item.amber { --dot: var(--accent); }
.tl-item.red { --dot: var(--red); }
.tl-item.ok { --dot: var(--green); }
.tl-item.info { --dot: var(--info); }
.tl-item.mile { --dot: var(--line-strong); }
.tl-item.mile::before { background: var(--line-strong); width: 10px; height: 10px; left: -25px; }
.tl-item.done { opacity: 0.55; }
.tl-item.done .tl-t { text-decoration: line-through; }
.tl-item.past:not(.done) { opacity: 0.7; }
.tl-d { font-size: 12.5px; font-weight: 640; color: var(--muted); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.tl-t { font-size: 15px; font-weight: 600; line-height: 1.3; margin-top: 1px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.tl-x { font-size: 13px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.tl-item.today { padding-bottom: 20px; }
.tl-item.today::before { background: var(--accent); border-color: var(--accent); width: 14px; height: 14px; left: -27px; top: 4px; }
.tl-item.today .tl-t { color: var(--accent-text); }

.calc { padding: 6px 16px 14px; }
.calc table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.calc th, .calc td { padding-left: 18px; }
.calc th:first-child, .calc td:first-child { padding-left: 0; }
.calc th { text-align: right; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); font-weight: 650; padding: 10px 0 8px; }
.calc th:first-child { text-align: left; }
.calc td { padding: 9px 0; border-top: 1px solid var(--line); text-align: right; }
.calc td:first-child { text-align: left; color: var(--text); }
.calc td small { display: block; color: var(--muted); font-size: 12px; }
.calc td.ok { color: var(--green); font-weight: 650; }
.calc td b { font-weight: 680; }
.calc .bar { margin: 16px 0 6px; }
.calc .scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); }
.calc p.fn { margin-top: 10px; font-size: 12.5px; color: var(--muted); }

/* ---------- Login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login { width: 100%; max-width: 340px; text-align: center; }
.login-mark { border-radius: 12px; }
.login h1 { margin-top: 14px; font-size: 24px; font-weight: 680; letter-spacing: -0.02em; }
.login-sub { color: var(--muted); margin: 4px 0 22px; font-size: 14.5px; }
.login input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 10px; font: inherit; font-size: 16px; margin-bottom: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); outline: none;
}
.login input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.login .btn { width: 100%; min-height: 46px; font-size: 15.5px; }
.login-msg { margin-top: 12px; font-size: 14px; color: var(--red); }

/* ---------- Kleinigkeiten ---------- */
.skeleton { height: 64px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sk 1.4s ease-in-out infinite; margin-bottom: 8px; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media print { .nav, .topbar, .toast { display: none; } }

/* ---------- Fach-Detail ---------- */
.course-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.course-links .btn { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.trows { padding: 4px 14px; }
.trow { display: grid; grid-template-columns: 94px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.trow:first-child { border-top: 0; }
.trow .td { color: var(--muted); font-variant-numeric: tabular-nums; }
.trow b { font-weight: 640; font-variant-numeric: tabular-nums; }
.trow .s { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.trow.wahl { color: var(--muted); }
.trow.wahl b { color: var(--text); font-weight: 560; }
.mod-cols { margin-top: 0; }
@media (min-width: 1000px) { .mod-cols aside .sec:first-child { margin-top: 28px; } }
@media (max-width: 480px) {
  .seg { gap: 5px; }
  .seg button { padding: 0 10px; gap: 5px; font-size: 13.5px; }
}

.hint-unread { font-size: 12.5px; color: var(--accent-text); }
details.fold > .agenda { margin-top: 6px; }
