/* Life/School-Dashboard – Stil nach VBS-Richtwerten (Marineblau, Gelb, viel Weißraum, dünne Ränder). */

:root {
  --navy: #1F2D4D;
  --navy-deep: #15203A;
  --yellow: #FFC629;
  --bg: #FFFFFF;
  --bg-alt: #F4F5F8;
  --surface: #FFFFFF;
  --text: #1F2D4D;
  --muted: #5E6A85;
  --line: #D9DDE6;
  --line-strong: #1F2D4D;
  --red: #C8102E;
  --red-bg: #FBE9EC;
  --amber: #B07A00;
  --amber-bg: #FFF4D1;
  --green: #1E7F4F;
  --focus: #FFC629;
  --radius: 4px;
  --nav-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1727;
    --bg-alt: #0B111E;
    --surface: #141E33;
    --text: #EEF1F7;
    --muted: #A2ACC2;
    --line: #2A3650;
    --line-strong: #FFC629;
    --red: #FF6B7F;
    --red-bg: #3A1A22;
    --amber: #FFD35C;
    --amber-bg: #3A2F10;
    --green: #5BD095;
  }
}
:root[data-theme="dark"] {
    --bg: #0F1727;
    --bg-alt: #0B111E;
    --surface: #141E33;
    --text: #EEF1F7;
    --muted: #A2ACC2;
    --line: #2A3650;
    --line-strong: #FFC629;
    --red: #FF6B7F;
    --red-bg: #3A1A22;
    --amber: #FFD35C;
    --amber-bg: #3A2F10;
    --green: #5BD095;
  }


* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-alt);
  color: var(--text);
  font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  min-height: 100dvh;
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

/* Typografie */
.display, .section-title, .eyebrow, .nav a, .tab, .btn, .brand, .now .big {
  font-family: "Montserrat", "Segoe UI", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.display { font-size: clamp(1.6rem, 2.5vw + 1rem, 2.4rem); font-weight: 800; margin: 0 0 .5rem; letter-spacing: .14em; }
.section-title { font-size: .85rem; font-weight: 700; margin: 1.5rem 0 .6rem; letter-spacing: .18em; color: var(--muted); }
.eyebrow { font-size: .75rem; font-weight: 700; color: var(--muted); margin: 0 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Layout */
#main { max-width: 1240px; overflow-x: clip; margin: 0 auto; padding: 1.25rem 16px calc(var(--nav-h) + 24px); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 2rem; }
@media (min-width: 820px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 120px; }

/* Kopfleiste (PC) */
.topbar {
  overflow: hidden;
  display: flex; align-items: center; gap: 2rem;
  padding: 0 16px; height: var(--nav-h);
  background: var(--navy); color: #fff;
  border-bottom: 4px solid var(--yellow);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 800; text-decoration: none; display: flex; align-items: center; gap: .6rem; font-size: .95rem; }
.brand-mark { width: 14px; height: 14px; background: var(--yellow); display: inline-block; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .8rem; }
.topbar .muted { color: #C9D0E0; }
.topbar .btn { border-color: #fff; color: #fff; }

/* Navigation */
.nav { display: flex; gap: .2rem; }
.nav a { text-decoration: none; font-size: .78rem; font-weight: 700; padding: .55rem .8rem; border-bottom: 3px solid transparent; }
.nav-top a.active { border-bottom-color: var(--yellow); }
.nav-top a:hover { border-bottom-color: #ffffff66; }
.nav-bottom {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--navy); color: #fff; border-top: 3px solid var(--yellow);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-bottom a { flex: 1; text-align: center; padding: .9rem .2rem; font-size: .68rem; border-bottom: 0; border-top: 3px solid transparent; margin-top: -3px; }
.nav-bottom a.active { border-top-color: var(--yellow); }
@media (max-width: 819px) {
  .nav-top, .topbar-right { display: none; }
  .nav-bottom { display: flex; }
  .topbar { height: 48px; --nav-h: 48px; }
}

/* Karten */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.card.now { border: 2px solid var(--line-strong); padding: 1.3rem 1.3rem 1.1rem; display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; }
.now .big { font-size: clamp(2.4rem, 8vw, 4.4rem); font-weight: 800; letter-spacing: .04em; line-height: 1; font-variant-numeric: tabular-nums; }
.now .label { font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; font-family: "Montserrat", sans-serif; font-weight: 700; color: var(--muted); }
.now .subject { font-size: 1.3rem; font-weight: 600; margin-top: .3rem; }
.now .subject::before { content: ""; display: inline-block; width: .8em; height: .8em; background: var(--c, var(--navy)); margin-right: .5rem; vertical-align: -1px; }
.now .meta { color: var(--muted); }
@media (max-width: 500px) { .card.now { grid-template-columns: 1fr; } }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li { display: flex; align-items: center; gap: .8rem; padding: .7rem .2rem; border-bottom: 1px solid var(--line); }
.list li.clickable { cursor: pointer; }
.list li.clickable:hover { background: var(--surface); }
.list .time { font-family: "Montserrat", sans-serif; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 6.4em; font-size: .95rem; }
.list .dot { width: 10px; height: 10px; flex: 0 0 10px; background: var(--c, var(--navy)); }
.list .title { flex: 1; min-width: 0; }
.list .sub { color: var(--muted); font-size: .9rem; }
.list .empty, .empty { color: var(--muted); padding: .8rem .2rem; font-style: italic; }
.list li.past { opacity: .55; }
.list li.current { background: var(--surface); border-left: 4px solid var(--yellow); padding-left: .6rem; }

/* Aufgaben */
.task .check { width: 22px; height: 22px; flex: 0 0 22px; border: 2px solid var(--line-strong); background: var(--surface); cursor: pointer; display: grid; place-items: center; padding: 0; }
.task .check[aria-checked="true"]::after { content: ""; width: 12px; height: 12px; background: var(--navy); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .task .check[aria-checked="true"]::after { background: var(--yellow); } }
:root[data-theme="dark"] .task .check[aria-checked="true"]::after { background: var(--yellow); }
.task.done .title { text-decoration: line-through; color: var(--muted); }
.badge { font-family: "Montserrat", sans-serif; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; padding: .2rem .5rem; border: 1px solid var(--line); white-space: nowrap; }
.badge.red { color: var(--red); border-color: var(--red); background: var(--red-bg); }
.badge.amber { color: var(--amber); border-color: var(--amber); background: var(--amber-bg); }
.badge.green { color: var(--green); border-color: var(--green); }
.task.red .title { color: var(--red); font-weight: 600; }

/* Wochenplan */
.week { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .week { grid-template-columns: 52px repeat(5, minmax(0, 1fr)); } .week.has-weekend { grid-template-columns: 52px repeat(7, minmax(0, 1fr)); } }
.day { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }
.day.today { border-color: var(--line-strong); border-width: 2px; }
.day h3 { margin: 0; padding: .6rem .8rem; font-family: "Montserrat", sans-serif; text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.day .lesson { padding: .55rem .8rem; border-left: 4px solid var(--c, var(--navy)); border-bottom: 1px solid var(--line); cursor: pointer; }
.day .lesson:last-child { border-bottom: 0; }
.day .lesson:hover { background: var(--bg-alt); }
.day .lesson .t { font-family: "Montserrat", sans-serif; font-weight: 700; font-size: .8rem; font-variant-numeric: tabular-nums; }
.day .lesson .n { font-weight: 600; }
.day .lesson .r { color: var(--muted); font-size: .85rem; }

/* Fächer */
.subject-row .name { flex: 1; font-weight: 600; }
.subject-row .count { color: var(--muted); font-size: .85rem; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: .3rem; }
.field > span { font-size: .78rem; font-family: "Montserrat", sans-serif; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="time"], input[type="date"], select {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-height: 44px;
}
input:focus-visible, select:focus-visible, button:focus-visible, .check:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
input[type="color"] { width: 56px; height: 44px; padding: 2px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }
.swatches { display: flex; gap: .4rem; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border: 1px solid #00000022; padding: 0; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1rem; min-height: 40px; border: 2px solid var(--line-strong); border-radius: var(--radius);
  background: transparent; color: var(--text); font-size: .74rem; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--bg-alt); }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.primary:hover { background: var(--navy-deep); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { background: var(--yellow); color: var(--navy); border-color: var(--yellow); } :root:not([data-theme="light"]) .btn.primary:hover { background: #FFD35C; } }
:root[data-theme="dark"] .btn.primary { background: var(--yellow); color: var(--navy); border-color: var(--yellow); } :root[data-theme="dark"] .btn.primary:hover { background: #FFD35C; }
.btn.small { padding: .3rem .7rem; min-height: 32px; font-size: .68rem; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.link { border: 0; text-transform: none; letter-spacing: 0; font-family: inherit; font-weight: 400; text-decoration: underline; color: var(--muted); min-height: 0; padding: 0; }
.btn[disabled] { opacity: .5; cursor: wait; }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: .2rem; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: .6rem .9rem; font-size: .75rem; font-weight: 700; cursor: pointer; color: var(--muted); }
.tab.active { color: var(--text); border-bottom-color: var(--yellow); }

.msg { min-height: 1.2em; margin: 0; font-size: .92rem; color: var(--muted); }
.msg.error { color: var(--red); }
.msg.ok { color: var(--green); }

/* Login */
.screen.login { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem 16px; background: linear-gradient(180deg, var(--navy) 0 46%, var(--bg-alt) 46%); }
.login-box { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--yellow); padding: 1.6rem 1.5rem 1.4rem; }
.login-box .display { margin-top: 0; }

/* Dialoge */
dialog { border: 1px solid var(--line); border-top: 6px solid var(--yellow); border-radius: var(--radius); padding: 1.2rem 1.3rem; width: min(480px, calc(100% - 32px)); background: var(--surface); color: var(--text); }
dialog::backdrop { background: #0F1727AA; }
dialog .section-title { margin-top: 0; color: var(--text); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px); background: var(--navy); color: #fff; border-left: 5px solid var(--yellow); padding: .6rem 1rem; z-index: 20; font-size: .95rem; max-width: calc(100% - 32px); }
@media (min-width: 820px) { .toast { bottom: 24px; } }

/* ===== Version 2 ===== */
textarea { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font: inherit; color: inherit; resize: vertical; }
textarea:focus-visible, input[type="number"]:focus-visible, input[type="url"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
input[type="number"], input[type="url"] { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-height: 44px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; background: var(--bg-alt); padding: 0 .3em; }
dialog.wide { width: min(720px, calc(100% - 32px)); }
.check-line { display: flex; align-items: center; gap: .5rem; }
.check-line input { width: 20px; height: 20px; }
.nav-top a { font-size: .68rem; padding: .55rem .55rem; }
@media (max-width: 1100px) { .nav-top { gap: 0; } .nav-top a { padding: .55rem .4rem; font-size: .62rem; letter-spacing: .08em; } }

.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin: -.4rem 0 1rem; }
.chip { font-family: "Montserrat", sans-serif; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; padding: .35rem .65rem; border: 1px solid var(--line-strong); background: var(--surface); display: inline-flex; gap: .5rem; align-items: center; text-decoration: none; }
.chip b { font-size: .95rem; }
.chip.red { border-color: var(--red); color: var(--red); }
.chip.amber { border-color: var(--amber); color: var(--amber); }

.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; margin-bottom: 1.2rem; }
.more-grid a { display: block; text-align: center; padding: 1rem .5rem; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-family: "Montserrat", sans-serif; text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 700; }
.more-grid a:hover { border-color: var(--line-strong); }
@media (min-width: 820px) { .nav-more { display: none; } }

/* Prüfungen */
.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.exam { border: 1px solid var(--line); border-left: 5px solid var(--c, var(--navy)); background: var(--surface); padding: .9rem 1rem; cursor: pointer; }
.exam:hover { border-color: var(--line-strong); border-left-color: var(--c, var(--navy)); }
.exam .days { font-family: "Montserrat", sans-serif; font-weight: 800; font-size: 2.2rem; line-height: 1; letter-spacing: 0; }
.exam .days small { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; margin-left: .3rem; font-weight: 700; color: var(--muted); }
.exam.red .days { color: var(--red); } .exam.amber .days { color: var(--amber); }
.exam .t { font-weight: 600; margin-top: .4rem; }
.exam .m { color: var(--muted); font-size: .88rem; }

/* Noten */
.grade-subject { border: 1px solid var(--line); background: var(--surface); margin-bottom: .8rem; }
.grade-subject h3 { margin: 0; padding: .6rem .9rem; border-bottom: 1px solid var(--line); border-left: 5px solid var(--c, var(--navy)); display: flex; justify-content: space-between; align-items: center; font-family: "Montserrat", sans-serif; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; }
.grade-subject .avg { font-size: 1.3rem; letter-spacing: 0; }
.grade-subject .list { border-top: 0; }
.grade-subject .list li { padding-left: .9rem; padding-right: .9rem; }
.grade-pill { font-family: "Montserrat", sans-serif; font-weight: 800; min-width: 2.4em; text-align: center; padding: .2rem .4rem; background: var(--navy); color: #fff; }
.grade-pill.g4, .grade-pill.g5 { background: var(--red); }
.grade-pill.g1 { background: var(--green); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; margin: .8rem 0; }
.stat { border: 1px solid var(--line); background: var(--surface); padding: .7rem .9rem; }
.stat .v { font-family: "Montserrat", sans-serif; font-weight: 800; font-size: 1.6rem; line-height: 1.1; }
.stat .l { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-family: "Montserrat", sans-serif; font-weight: 700; }

/* Notizen */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; margin-top: .8rem; }
.note { border: 1px solid var(--line); border-top: 4px solid var(--c, var(--line)); background: var(--surface); padding: .8rem .9rem; cursor: pointer; min-height: 120px; display: flex; flex-direction: column; }
.note:hover { border-color: var(--line-strong); border-top-color: var(--c, var(--line)); }
.note h3 { margin: 0 0 .3rem; font-size: 1rem; }
.note p { margin: 0; color: var(--muted); font-size: .9rem; white-space: pre-line; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; flex: 1; }
.note .f { font-size: .72rem; margin-top: .6rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-family: "Montserrat", sans-serif; font-weight: 700; }

/* Lernzeit */
.study-mini { display: flex; align-items: center; gap: 1rem; justify-content: space-between; margin-top: 1.5rem; }
.study-mini .big { font-family: "Montserrat", sans-serif; font-weight: 800; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.bars { display: flex; gap: 4px; align-items: flex-end; height: 70px; margin-top: .6rem; }
.bars div { flex: 1; background: var(--navy); min-height: 2px; position: relative; }
.bars div.today { background: var(--yellow); }
.bars div span { position: absolute; bottom: -1.2rem; left: 0; right: 0; text-align: center; font-size: .62rem; color: var(--muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bars div { background: #4B5F8F; } }
:root[data-theme="dark"] .bars div { background: #4B5F8F; }

/* Gewohnheiten */
.habit-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.habit-btn { border: 2px solid var(--c, var(--navy)); background: transparent; padding: .45rem .8rem; font-family: "Montserrat", sans-serif; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; }
.habit-btn::before { content: ""; width: 12px; height: 12px; border: 2px solid var(--c, var(--navy)); display: inline-block; }
.habit-btn.on { background: var(--c, var(--navy)); color: #fff; }
.habit-btn.on::before { background: #fff; border-color: #fff; }
.habit-table { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
.habit-table table { border-collapse: collapse; width: 100%; min-width: 560px; }
.habit-table th, .habit-table td { border-bottom: 1px solid var(--line); padding: .5rem .6rem; text-align: center; font-size: .85rem; }
.habit-table th { font-family: "Montserrat", sans-serif; text-transform: uppercase; letter-spacing: .1em; font-size: .66rem; color: var(--muted); }
.habit-table th.today, .habit-table td.today { background: var(--bg-alt); }
.habit-table td.name { text-align: left; font-weight: 600; cursor: pointer; white-space: nowrap; border-left: 5px solid var(--c, var(--navy)); }
.habit-table .cell { width: 26px; height: 26px; border: 2px solid var(--line); background: transparent; cursor: pointer; padding: 0; }
.habit-table .cell.on { background: var(--c, var(--navy)); border-color: var(--c, var(--navy)); }
.habit-table .streak { font-family: "Montserrat", sans-serif; font-weight: 800; }

/* Kalender */
.cal-day { margin-bottom: .6rem; }
.cal-day h3 { margin: .8rem 0 .2rem; font-family: "Montserrat", sans-serif; text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; color: var(--muted); }
.cal-day h3.today { color: var(--text); }
.list li .cal-dot { width: 10px; height: 10px; flex: 0 0 10px; background: var(--c, var(--muted)); border-radius: 50%; }
@media (max-width: 1320px) { #user-email, #logout { display: none; } }

/* ===== Theme-Umschalter, Palette, Kalenderansicht ===== */
.seg { display: inline-flex; border: 1px solid var(--line); }
.seg button { background: transparent; border: 0; padding: .35rem .7rem; font-family: "Montserrat", sans-serif; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; cursor: pointer; color: var(--muted); }
.seg button.active { background: var(--navy); color: #fff; }
:root[data-theme="dark"] .seg button.active { background: var(--yellow); color: var(--navy); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.active { background: var(--yellow); color: var(--navy); } }
.topbar .theme-btn { border-color: #fff; color: #fff; min-width: 40px; padding: .3rem .5rem; }
.swatches { gap: .3rem; max-width: 340px; }
.swatches button { width: 26px; height: 26px; }
.swatches button.sel { outline: 3px solid var(--focus); outline-offset: 1px; }
.cal-chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: .6rem 0; }
.cal-chip { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); padding: .3rem .6rem; font-size: .8rem; cursor: pointer; background: var(--surface); }
.cal-chip.off { opacity: .45; text-decoration: line-through; }
.cal-chip .cal-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.cal-chip input[type="color"] { width: 22px; height: 22px; min-height: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.cal-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .6rem 0; }
.cal-head h2 { margin: 0; font-family: "Montserrat", sans-serif; text-transform: uppercase; letter-spacing: .14em; font-size: .9rem; flex: 1; min-width: 160px; }
.cal-grid { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cal-row { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: 1px; position: relative; }
.cal-row .span { position: absolute; height: 16px; line-height: 16px; font-size: .68rem; padding: 0 6px; background: var(--c, var(--muted)); color: #fff; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 1; pointer-events: auto; }
.cal-row .span.cs { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-row .span.ce { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-grid .lanes { flex: 0 0 auto; }
.cal-grid .dh { background: var(--bg-alt); padding: .4rem .3rem; text-align: center; font-family: "Montserrat", sans-serif; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.cal-grid .dc { background: var(--surface); min-width: 0; min-height: 110px; padding: .3rem; display: flex; flex-direction: column; gap: 2px; }
.cal-grid.month .dc { min-height: 92px; }
.cal-grid .dc.other { background: var(--bg-alt); opacity: .6; }
.cal-grid .dc.today { outline: 2px solid var(--yellow); outline-offset: -2px; }
.cal-grid .dc.free { background: repeating-linear-gradient(135deg, var(--surface) 0 8px, var(--bg-alt) 8px 10px); }
.cal-grid .dn { font-family: "Montserrat", sans-serif; font-weight: 700; font-size: .72rem; margin-bottom: 2px; display: flex; justify-content: space-between; }
.cal-grid .dn .fr { color: var(--muted); font-weight: 600; letter-spacing: .05em; font-size: .6rem; }
.ci { font-size: .72rem; line-height: 1.25; padding: 1px 4px; border-left: 3px solid var(--c, var(--line)); background: color-mix(in srgb, var(--c, var(--line)) 12%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ci.ev { border-left-style: solid; border-radius: 0 3px 3px 0; }
.ci.ex { font-weight: 700; border-left-width: 5px; }
.ci.ta { border-left-style: dotted; }
.ci.ta.done { opacity: .5; text-decoration: line-through; }
.ci b { font-variant-numeric: tabular-nums; font-weight: 600; margin-right: .2rem; }
.ci.more { background: none; border: 0; color: var(--muted); cursor: default; }
@media (max-width: 700px) {
  .cal-grid.week .cal-row { grid-template-columns: 1fr; }
  .cal-grid.week .span { display: none; }
  .cal-grid.week .lanes { display: none; }
  .cal-grid.week .dh { display: none; }
  .cal-grid.week .dc { min-height: 0; }
  .cal-grid.week .dc.hidden-empty { display: none; }
  .cal-grid.month .dc { min-height: 54px; padding: 2px; }
  .cal-grid.month .ci { font-size: 0; height: 6px; padding: 0; border-left: 0; background: var(--c, var(--line)); border-radius: 2px; }
  .cal-grid.month .span { font-size: 0; height: 6px; top: calc(20px + var(--lane, 0) * 8px) !important; }
  .cal-grid.month .ci.more { display: none; }
}
.cal-legend { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .75rem; color: var(--muted); margin: .5rem 0; }
.cal-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: .3rem; border-left: 3px solid var(--navy); background: var(--bg-alt); vertical-align: -1px; }
.cal-legend .l-ex::before { border-left-width: 5px; }
.cal-legend .l-ta::before { border-left-style: dotted; }
.cal-legend .l-ev::before { border-left-style: solid; border-left-color: var(--muted); }

/* ===== Stundenplan als Zeitraster ===== */
.week { gap: .4rem; }
.day .col { position: relative; height: var(--plan-h, 600px); }
.day .hl { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.day.axis { border: 0; background: transparent; }
.day.axis h3 { border: 0; }
.day.axis .hl { border-top: 0; }
.day.axis .hl span { position: absolute; top: -.55em; right: 4px; font-size: .62rem; color: var(--muted); font-family: "Montserrat", sans-serif; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.day.axis .hl span.lo { top: .2em; }
.day .hl { border-top-style: solid; border-top-color: color-mix(in srgb, var(--line) 60%, transparent); }
.day .lesson { position: absolute; left: 3px; right: 3px; padding: .3rem .5rem; border: 1px solid var(--line); border-left: 4px solid var(--c, var(--navy)); background: color-mix(in srgb, var(--c, var(--navy)) 10%, var(--surface)); overflow: hidden; border-radius: 3px; display: flex; flex-direction: column; justify-content: flex-start; gap: 1px; }
.day .lesson:hover { background: color-mix(in srgb, var(--c, var(--navy)) 20%, var(--surface)); }
.day .lesson .t { font-size: .7rem; }
.day .lesson .n { font-size: .95rem; line-height: 1.15; }
.day .lesson .r { font-size: .75rem; }
.day .lesson.dbl .n { font-size: 1.1rem; }
.day .lesson .ab { display: inline-block; background: var(--yellow); color: var(--navy); font-weight: 800; padding: 0 .3em; margin-left: .3em; border-radius: 2px; font-size: .62rem; }
.day .col .empty { position: absolute; top: .5rem; left: .6rem; }
@media (max-width: 999px) {
  .week { grid-template-columns: 1fr; }
  .day.axis { display: none; }
  .day .col { height: auto; }
  .day .hl { display: none; }
  .day .lesson { position: static; margin: .35rem .4rem; height: auto !important; }
  .day .lesson.dbl { padding-top: .8rem; padding-bottom: .8rem; }
  .day .col .empty { position: static; }
}
.day .gap { position: absolute; left: 3px; right: 3px; border: 1px dashed var(--line); border-radius: 3px; background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--muted) 12%, transparent) 6px 8px); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.day .gap span { font-size: .68rem; color: var(--muted); font-family: "Montserrat", sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; background: var(--surface); padding: 0 .4rem; }
@media (max-width: 999px) { .day .gap { position: static; margin: .2rem .4rem; height: auto !important; padding: .3rem; } }

/* ===== Schnelleingabe, Suche, Fach-Seite, Teilschritte ===== */
.quick { display: flex; gap: .5rem; margin: .2rem 0 .2rem; }
.quick input { flex: 1; min-width: 0; }
.quick-preview { min-height: 1.2em; margin: 0 0 .8rem; }
.quick-preview b { color: var(--text); }
.search-dlg input { font-size: 1.1rem; padding: .8rem .9rem; }
.search-results { max-height: 60vh; overflow: auto; }
.search-results .hit { display: flex; gap: .7rem; align-items: center; padding: .55rem .4rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.search-results .hit:hover, .search-results .hit.sel { background: var(--bg-alt); }
.search-results .kind { font-family: "Montserrat", sans-serif; font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--muted); min-width: 5.5em; }
.search-results .hit .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .hit .s { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.steps { margin: .2rem 0 0 2.6rem; padding: 0; list-style: none; }
.steps li { display: flex; gap: .5rem; align-items: center; font-size: .9rem; padding: .15rem 0; border: 0; }
.steps li.done { color: var(--muted); text-decoration: line-through; }
.steps .check { width: 16px; height: 16px; flex: 0 0 16px; }
.steps .check[aria-checked="true"]::after { width: 8px; height: 8px; }
.list li.task { flex-wrap: wrap; }
.list li.task .steps { flex-basis: 100%; }
.task .prog { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.fach-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 900px) { .fach-grid { grid-template-columns: 1fr 1fr; } }
.fach-grid .card { margin: 0; }
.fach-grid .card h2 { margin-top: 0; }
#view-fach .eyebrow a { text-decoration: none; }

/* ===== Matura ===== */
.ampel { width: 14px; height: 14px; border-radius: 50%; background: var(--line); flex: 0 0 14px; }
.ampel.gruen { background: #1E7F4F; } .ampel.gelb { background: #FFC629; } .ampel.rot { background: #C8102E; }
.exam.matura .days { font-size: 1.8rem; }
.exam.matura.rot { border-left-color: #C8102E; } .exam.matura.gelb { border-left-color: #FFC629; } .exam.matura.gruen { border-left-color: #1E7F4F; }
.exam.matura .m.small { font-size: .8rem; }
.list li.done .title { text-decoration: line-through; color: var(--muted); }

/* ===== Noten als Kacheln ===== */
.grade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.gcard { border: 1px solid var(--line); border-top: 5px solid var(--c, var(--navy)); background: var(--surface); padding: .8rem .9rem; display: flex; flex-direction: column; gap: .4rem; }
.gcard .gh { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.gcard .gh a { font-family: "Montserrat", sans-serif; text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; font-weight: 700; text-decoration: none; }
.gcard .big { font-family: "Montserrat", sans-serif; font-weight: 800; font-size: 2rem; line-height: 1; display: flex; align-items: baseline; gap: .5rem; }
.gcard .big small { font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.gcard .ab { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.gcard .ab div { background: var(--bg-alt); padding: .35rem .5rem; font-size: .85rem; }
.gcard .ab b { font-family: "Montserrat", sans-serif; }
.gcard details summary { cursor: pointer; font-size: .8rem; color: var(--muted); list-style: none; display: flex; justify-content: space-between; }
.gcard details summary::after { content: "▾"; }
.gcard details[open] summary::after { content: "▴"; }
.gcard .list li { padding: .35rem 0; font-size: .9rem; }
.gcard .list .grade-pill { font-size: .8rem; min-width: 2em; }
.gcard .prog { font-size: .78rem; color: var(--muted); }
.gcard.gef { border-top-color: var(--red); }
