/* Noten – Gestaltung nach der Apple-Designsprache (Regeln wie im Bewerbungstool, dort DESIGN.md; hier apps/noten/README.md,
   „Gestaltung“). Eine Akzentfarbe (Blau), Systemschrift mit Dynamic Type, flache Inhaltsflächen ohne Schatten, Liquid Glass nur
   auf der schwebenden Bedienebene (Tab-Leiste, Knöpfe oben, Meldung). Punktfarben kommen als --c aus logic.js (Text darauf dunkel).
   Bewusst nicht: Farbverläufe als Schmuck, Lila als Akzent, Leuchtränder, Schatten unter Karten, Großbuchstaben-Etiketten, Emojis. */

:root {
	--bg: #f2f2f7; --card: #ffffff; --fill: rgba(118, 118, 128, .12); --fill2: rgba(118, 118, 128, .2);
	--text: #1d1d1f; --sub: #5c5c63; --sub2: #aeaeb2; --line: rgba(60, 60, 67, .16);
	--accent: #005cb8; --accent-tint: rgba(0, 92, 184, .1); --on-accent: #ffffff;
	--danger: #d70015; --good: #1a7f37; --bad: #d70015; --switch: #34c759;
	--glass: rgba(250, 250, 252, .66); --glass-rand: rgba(255, 255, 255, .7); --glass-schatten: 0 6px 24px rgba(0, 0, 0, .1), 0 1px 3px rgba(0, 0, 0, .06);
	--blatt: #f2f2f7; --blatt-karte: #ffffff;
	--dark: #141414;
	--r-karte: 22px; --r-innen: 14px; --r-feld: 12px; --r-blatt: 30px;
	--dauer: .2s; --kurve: cubic-bezier(.2, .8, .2, 1);
	--safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
	/* Textstile wie iOS (1rem = Body; folgt auf dem iPhone der eingestellten Textgröße) */
	--t-large: 2rem; --t-title2: 1.294rem; --t-title3: 1.176rem; --t-callout: .941rem; --t-sub: .882rem; --t-foot: .765rem; --t-cap: .706rem; --t-cap2: .647rem;
	color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #000000; --card: #1c1c1e; --fill: rgba(118, 118, 128, .24); --fill2: rgba(118, 118, 128, .36);
		--text: #f5f5f7; --sub: #a1a1a6; --sub2: #636366; --line: rgba(84, 84, 88, .65);
		--accent: #5aabff; --accent-tint: rgba(90, 171, 255, .16); --on-accent: #001a33;
		--danger: #ff6961; --good: #30d158; --bad: #ff6961; --switch: #30d158;
		--glass: rgba(44, 44, 48, .62); --glass-rand: rgba(255, 255, 255, .14); --glass-schatten: 0 6px 24px rgba(0, 0, 0, .45);
		--blatt: #1c1c1e; --blatt-karte: #2c2c2e;
	}
}
@media (prefers-contrast: more) {
	:root { --sub: #3a3a3f; --line: rgba(60, 60, 67, .5); --glass: rgba(250, 250, 252, .94); --glass-rand: rgba(0, 0, 0, .35); }
	@media (prefers-color-scheme: dark) { :root { --sub: #d1d1d6; --line: rgba(170, 170, 178, .7); --glass: rgba(36, 36, 40, .96); --glass-rand: rgba(255, 255, 255, .45); } }
}

html { font-size: 17px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* iPhone/iPad: Grundgröße folgt Einstellungen → Anzeige & Helligkeit → Textgröße (Dynamic Type) */
@supports (font: -apple-system-body) { html { font: -apple-system-body; } }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
	font-size: 1rem; line-height: 1.35; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
body.has-sheet { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; opacity: .35; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ic { width: 1.3em; height: 1.3em; flex: none; }
.ic.gross { width: 3.2rem; height: 3.2rem; color: var(--sub2); stroke-width: 1.4; }
.ic.leise { color: var(--sub2); width: 1em; height: 1em; }
.sub { color: var(--sub); }
.klein { font-size: var(--t-foot); }
.pad { padding: 16px; }
.gut { color: var(--good); }
.schlecht { color: var(--bad); }
h1, h2, h3, p { margin: 0; }
.bubble, .chip, .note-kachel, .hero-wert, .block-wert, .kt-zelle, .p-erg, .anteil, .stepper b { font-variant-numeric: tabular-nums; }

/* ---------- Gerüst ---------- */

#app { min-height: 100vh; min-height: 100dvh; }
.bar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
	min-height: 52px; padding: calc(var(--safe-t) + 6px) 16px 8px; pointer-events: none;
	background: linear-gradient(var(--bg) 60%, transparent); }
.bar > * { pointer-events: auto; }
.bar-t { font-weight: 600; font-size: 1rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 54vw; opacity: 0; }
.bar-t.small { opacity: 1; }
.bar-r { display: flex; justify-content: flex-end; gap: 8px; }
/* Runde Glasknöpfe oben (Zurück, Bearbeiten, Hinzufügen) wie in iOS 26 */
.back, .icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--text); flex: none; }
.bar .back, .bar .icon-btn { background: var(--glass); -webkit-backdrop-filter: blur(28px) saturate(1.7); backdrop-filter: blur(28px) saturate(1.7);
	box-shadow: var(--glass-schatten), inset 0 0 0 .5px var(--glass-rand); }
.back .ic, .icon-btn .ic { width: 22px; height: 22px; }
.back span { display: none; }
.icon-btn:active, .back:active { transform: scale(.94); }
.icon-btn.klein { width: 36px; height: 36px; color: var(--sub); }
.icon-btn.klein .ic { width: 18px; height: 18px; }
.main { padding: 0 16px calc(110px + var(--safe-b)); max-width: 680px; margin: 0 auto; }
.page { animation-duration: .3s; animation-timing-function: var(--kurve); }
.anim-push { animation-name: rein; }
.anim-pop { animation-name: raus; }
@keyframes rein { from { transform: translateX(24px); opacity: 0; } }
@keyframes raus { from { transform: translateX(-24px); opacity: 0; } }
.large { font-size: var(--t-large); font-weight: 700; letter-spacing: -.01em; line-height: 1.15; margin: 2px 4px 16px; }

/* Schwebende Tab-Leiste aus Glas */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b) * .6); z-index: 30; display: flex; gap: 2px;
	padding: 5px; border-radius: 999px; width: min(calc(100% - 32px), 420px);
	background: var(--glass); -webkit-backdrop-filter: blur(28px) saturate(1.7); backdrop-filter: blur(28px) saturate(1.7);
	box-shadow: var(--glass-schatten), inset 0 0 0 .5px var(--glass-rand), inset .5px .5px 0 var(--glass-rand); }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px;
	border-radius: 999px; color: var(--text); font-size: var(--t-cap2); font-weight: 600; transition: background var(--dauer) var(--kurve), color var(--dauer); }
.tabbar button.on { color: var(--accent); background: var(--fill); }
.tabbar .ic { width: 24px; height: 24px; }
@media (prefers-reduced-transparency: reduce) { .tabbar, .bar .back, .bar .icon-btn, .toast { background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none; } }

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

.karte, .hero, .leer-karte, .liste.gruppe, .vorschlaege, .faecher { background: var(--card); border-radius: var(--r-karte); }
@media (prefers-color-scheme: light) { .karte, .hero, .liste.gruppe, .vorschlaege, .faecher, .leer-karte { box-shadow: 0 0 0 .5px var(--line); } }
.karte { padding: 14px 16px 16px; margin: 0 0 12px; }
.k-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; width: 100%; }
.k-kopf h2 { font-size: 1rem; font-weight: 600; }
.k-kopf .ic { color: var(--sub); width: 1.15em; height: 1.15em; }
.k-rechts { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.anteil { font-size: var(--t-sub); font-weight: 600; color: var(--sub); padding: 2px 9px; border-radius: 999px; background: var(--fill); }
.anteil:empty { display: none; }
.klapp { cursor: pointer; }
.eyebrow { font-size: var(--t-foot); font-weight: 500; color: var(--sub); }
.marke { display: inline-block; font-size: var(--t-cap2); font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--fill); color: var(--sub); vertical-align: .12em; }
.marke.leise { font-weight: 500; }
.abschnitt { font-size: var(--t-title3); font-weight: 700; margin: 26px 4px 10px; display: flex; align-items: center; gap: 6px; }
button.abschnitt { color: var(--text); }
button.abschnitt .ic { width: 1em; height: 1em; color: var(--sub); }
.abschnitt.klein-titel { font-size: var(--t-foot); font-weight: 400; color: var(--sub); margin: 24px 16px 7px; }
.quelle { font-size: var(--t-foot); color: var(--sub); margin: 14px 16px 20px; line-height: 1.4; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px; border-radius: 999px;
	background: var(--accent-tint); color: var(--accent); font-weight: 600; font-size: 1rem; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.danger { background: transparent; color: var(--danger); }
.btn.wide { width: 100%; margin-top: 16px; }
.btn.klein { min-height: 40px; padding: 0 16px; font-size: var(--t-sub); }
.btn:active { opacity: .8; }
.btn .ic { width: 1.1em; height: 1.1em; }
.txt-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 1rem; min-height: 44px; padding: 0 12px; font-weight: 500; }
.txt-btn .ic { width: 1.1em; height: 1.1em; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 13px; min-height: 36px; border-radius: 999px; background: var(--accent-tint); color: var(--accent); font-weight: 600; font-size: var(--t-sub); flex: none; }
.pill .ic { width: 1em; height: 1em; }
.pill.fertig { color: var(--good); background: transparent; padding: 0; }

/* Segmente: Kapsel mit hellem Schieber */
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--fill); margin: 0 0 12px; }
.seg.wrap { flex-wrap: wrap; border-radius: 22px; }
.seg button { flex: 1; min-height: 38px; padding: 0 10px; border-radius: 999px; font-weight: 500; font-size: var(--t-sub); text-align: center; color: var(--text);
	white-space: nowrap; transition: background var(--dauer) var(--kurve); }
.seg.wrap button { flex: 1 0 28%; }
.seg button.on { background: var(--card); font-weight: 600; box-shadow: 0 2px 6px rgba(0, 0, 0, .1), 0 0 0 .5px rgba(0, 0, 0, .04); }
@media (prefers-color-scheme: dark) { .seg button.on { background: #636366; } }
.hj-seg { margin: 0 0 16px; }

.switch { position: relative; width: 51px; height: 31px; border-radius: 16px; background: var(--fill2); flex: none; transition: background var(--dauer); }
.switch span { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .22); transition: transform var(--dauer) var(--kurve); }
.switch.on { background: var(--switch); }
.switch.on span { transform: translateX(20px); }

/* Punkte: Kreis bzw. Kachel in der Punktfarbe, Text dunkel; kein Leuchten */
.bubble { display: inline-grid; place-items: center; min-width: 2.7em; height: 2.7em; padding: 0 .45em; border-radius: 999px; background: var(--c); color: var(--dark);
	font-weight: 600; font-size: var(--t-callout); }
.bubble.gross { min-width: 4.2rem; height: 4.2rem; font-size: var(--t-title2); }
.bubble.leer { background: var(--fill); color: var(--sub); }
.bubble.fest { box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.chip { display: inline-grid; place-items: center; min-width: 1.55rem; height: 1.3rem; padding: 0 4px; border-radius: 6px; background: var(--c); color: var(--dark); font-size: var(--t-foot); font-weight: 600; }
.chip.g-neben { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--c); }

/* Fach-Symbol: getönte Kachel (wie Listen in „Erinnerungen“) */
.kachel { display: grid; place-items: center; width: 2.35rem; height: 2.35rem; border-radius: 10px; flex: none; --t: #8e8e93;
	background: color-mix(in srgb, var(--t) 15%, var(--card)); color: var(--t); }
.kachel .ic { width: 1.35rem; height: 1.35rem; }
.kachel.gross { width: 3.3rem; height: 3.3rem; border-radius: 14px; }
.kachel.gross .ic { width: 1.9rem; height: 1.9rem; }
.kachel.klein { width: 1.65rem; height: 1.65rem; border-radius: 7px; display: inline-grid; vertical-align: middle; }
.kachel.klein .ic { width: 1rem; height: 1rem; }
.kachel.mini { width: 1.3rem; height: 1.3rem; border-radius: 6px; }
.kachel.mini .ic { width: .82rem; height: .82rem; }
.ton-violett { --t: #7a5bd6; } .ton-blau { --t: #1a73d9; } .ton-tuerkis { --t: #0d8f86; } .ton-gruen { --t: #2f9a46; } .ton-gelb { --t: #a87a00; }
.ton-orange { --t: #d4690a; } .ton-rot { --t: #d63a31; } .ton-rosa { --t: #d23b7a; } .ton-grau { --t: #6e6e73; }
@media (prefers-color-scheme: dark) {
	.ton-violett { --t: #a48cff; } .ton-blau { --t: #5aabff; } .ton-tuerkis { --t: #3fd0c4; } .ton-gruen { --t: #4cd964; } .ton-gelb { --t: #ffd60a; }
	.ton-orange { --t: #ff9f0a; } .ton-rot { --t: #ff6961; } .ton-rosa { --t: #ff6fa8; } .ton-grau { --t: #aeaeb2; }
}

/* ---------- Listen (iOS: eingesetzt gruppiert, Trennlinie ab dem Text) ---------- */

.liste { list-style: none; margin: 0; padding: 0; }
.liste.gruppe, .vorschlaege, .faecher { overflow: hidden; }
.zeile { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 9px 16px; }
.liste.gruppe li + li .zeile::before, .vorschlaege li + li .zeile::before, .faecher li + li .zeile::before {
	content: ""; position: absolute; top: 0; right: 0; left: var(--einzug, 58px); border-top: .5px solid var(--line); }
button.zeile:active, .zeile button.z-mitte:active { background: var(--fill); }
.z-ic { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 8px; background: var(--accent); color: var(--on-accent); flex: none; }
.z-ic .ic { width: 1.05rem; height: 1.05rem; stroke-width: 2; }
.z-ic.rot { background: var(--danger); }
.z-mitte { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
.z-titel { overflow: hidden; text-overflow: ellipsis; }
.z-mitte .sub { font-size: var(--t-sub); }
.z-rechts { flex: none; }
.zeile.rot .z-titel { color: var(--danger); }
.liste.gruppe { --einzug: 60px; }
.faecher { --einzug: 68px; }
.fach-zeile { min-height: 72px; padding: 11px 14px 11px 16px; }
.fach-zeile .z-titel { font-weight: 600; }
.fach-zeile.still .z-mitte, .fach-zeile.still .kachel { opacity: .55; }
.leer-karte { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 34px 24px 26px; margin-top: 4px; }
.leer-karte h2 { font-size: var(--t-title3); font-weight: 700; margin-top: 4px; }
.leer-karte p { color: var(--sub); max-width: 32ch; margin-bottom: 8px; }
.leer-karte .btn { width: 100%; max-width: 320px; }
.hinweis { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; margin-bottom: 14px; border-radius: var(--r-karte); background: var(--accent-tint); }
.hinweis > .ic { color: var(--accent); }
.hinweis p { flex: 1; font-size: var(--t-sub); }

/* ---------- Halbjahr ---------- */

.hero { display: flex; align-items: center; gap: 20px; padding: 20px; margin-bottom: 18px; }
.ring { position: relative; display: grid; place-items: center; flex: none; width: 7.2rem; height: 7.2rem; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .spur { stroke: var(--fill); }
.ring .bogen { stroke: var(--c); transition: stroke-dashoffset .6s var(--kurve); }
.ring-text { position: relative; display: flex; flex-direction: column; align-items: center; }
.hero-wert { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.hero-sub { font-size: var(--t-cap); color: var(--sub); margin-top: 3px; }
.hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hero-note { font-size: var(--t-title2); font-weight: 700; }
.hero-note small { font-size: var(--t-sub); font-weight: 500; color: var(--sub); }
.trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: var(--t-sub); margin-top: 2px; }
.trend .ic { width: 1em; height: 1em; }
.trend.auf { color: var(--good); } .trend.ab { color: var(--bad); }
.mini-balken { display: flex; gap: 5px; height: 2.6rem; align-items: flex-end; margin-top: 8px; }
.mini-balken span { display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; width: 12px; }
.mini-balken i { display: block; width: 8px; border-radius: 4px; background: var(--c); opacity: .4; }
.mini-balken span.on i { opacity: 1; }
.mini-balken b { font-size: var(--t-cap2); color: var(--sub); font-weight: 600; line-height: 1; }

/* ---------- Fach ---------- */

.fach-kopf { display: flex; align-items: center; gap: 14px; margin: 4px 4px 16px; }
.fk-text { flex: 1; min-width: 0; }
.fk-name { font-size: var(--t-large); font-weight: 700; letter-spacing: -.01em; line-height: 1.12; overflow-wrap: anywhere; }
.hj-streifen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 3px; margin-bottom: 14px; border-radius: 20px; background: var(--fill); }
.hj-streifen button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 8px; border-radius: 17px; }
.hj-streifen button.on { background: var(--card); box-shadow: 0 2px 6px rgba(0, 0, 0, .1); }
@media (prefers-color-scheme: dark) { .hj-streifen button.on { background: #48484a; } }
.hj-streifen small { font-size: var(--t-cap); color: var(--sub); }
.hj-streifen b { font-size: var(--t-callout); display: flex; align-items: center; gap: 5px; }
.hj-streifen b::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.hj-streifen button:disabled b::before { display: none; }
.noten-reihe { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.note-kachel { position: relative; display: grid; place-items: center; align-content: center; min-width: 3.7rem; min-height: 3.2rem; padding: 4px 10px; border-radius: var(--r-innen); background: var(--c);
	color: var(--dark); font-size: var(--t-title3); font-weight: 600; line-height: 1.05; }
.note-kachel small { display: block; font-size: var(--t-cap2); font-weight: 500; max-width: 5.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .8; margin-top: 2px; }
.note-kachel .faktor { position: absolute; top: -7px; right: -5px; font-style: normal; font-size: var(--t-cap2); font-weight: 700; padding: 1px 6px; border-radius: 999px;
	background: var(--text); color: var(--card); }
.note-kachel.offen { background: var(--fill); color: var(--text); box-shadow: inset 0 0 0 2px var(--c); }
.plus-rund { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--accent-tint); color: var(--accent); }
.plus-rund .ic { width: 1.4rem; height: 1.4rem; stroke-width: 2; }
.zeugnis { display: flex; align-items: center; gap: 14px; }
.zeugnis p { flex: 1; font-size: var(--t-sub); }
.ziel { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.stepper { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--fill); }
.stepper button { display: grid; place-items: center; width: 40px; height: 36px; border-radius: 999px; color: var(--text); }
.stepper button:active { background: var(--fill2); }
.stepper b { min-width: 2.6rem; height: 36px; display: grid; place-items: center; border-radius: 999px; background: var(--c); color: var(--dark); font-size: var(--t-callout); }
.brauche { list-style: none; padding: 0; margin: 0 0 8px; }
.brauche li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: .5px solid var(--line); }
.note-mini { padding: 3px 11px; border-radius: 999px; background: var(--c); color: var(--dark); font-size: var(--t-sub); }
.verlauf { width: 100%; height: auto; display: block; }
.verlauf .raster { stroke: var(--line); stroke-width: 1; }
.verlauf .achse { fill: var(--sub); font-size: 9px; }
.verlauf .noten-linie { fill: none; stroke: var(--sub2); stroke-width: 1.5; }
.verlauf .schnitt-linie { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.verlauf circle { stroke: var(--card); stroke-width: 2; }
.verlauf circle.neben { stroke: var(--text); stroke-width: 1.5; }
.legende { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.l-noten, .l-schnitt { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--sub2); }
.l-schnitt { border-top: 2.5px solid var(--accent); margin-left: 10px; border-radius: 2px; }

/* ---------- Termine ---------- */

.liste.termine { display: flex; flex-direction: column; gap: 8px; }
.termin { background: var(--card); border-radius: 18px; padding: 8px 12px 8px 8px; gap: 12px; }
@media (prefers-color-scheme: light) { .termin { box-shadow: 0 0 0 .5px var(--line); } }
.termin .z-mitte { padding: 4px 0; }
.t-datum { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 3.1rem; height: 3.1rem; border-radius: 12px; background: var(--fill); flex: none; line-height: 1.05; }
.t-datum small { font-size: var(--t-cap2); color: var(--danger); font-weight: 600; order: -1; }
.t-datum b { font-size: var(--t-title3); font-weight: 600; }
.termin.bald .t-datum { background: var(--accent); color: var(--on-accent); }
.termin.bald .t-datum small { color: inherit; }
.termin.vorbei .z-mitte, .termin.vorbei .t-datum { opacity: .6; }

/* ---------- Abi ---------- */

.abi-hero .hero-wert { font-size: 2.1rem; }
.bloecke { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.block { padding: 14px 16px; }
.block-wert { font-size: var(--t-title2); font-weight: 700; margin: 2px 0 8px; }
.block-wert small { font-size: var(--t-sub); color: var(--sub); font-weight: 500; }
.balken { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; margin-bottom: 8px; }
.balken i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.pruef-liste { list-style: none; margin: 0 0 8px; padding: 0; }
.pruef-liste li { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: .5px solid var(--line); }
.p-name { flex: 1; min-width: 0; font-weight: 500; }
.pruef-knopf { display: flex; flex-direction: column; align-items: center; min-width: 3.1rem; padding: 4px 6px; border-radius: 12px; background: var(--c); color: var(--dark); line-height: 1.1; }
.pruef-knopf small { font-size: var(--t-cap2); font-weight: 600; opacity: .8; }
.pruef-knopf b { font-size: var(--t-callout); }
.pruef-knopf.offen { background: var(--fill); color: var(--text); }
.p-erg { min-width: 2.4rem; text-align: right; font-size: var(--t-title3); font-weight: 600; }
.p-erg.geschaetzt { font-style: italic; color: var(--sub); font-weight: 500; }
.bedingungen { list-style: none; margin: 0; padding: 0; }
.bedingungen li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: .5px solid var(--line); font-size: var(--t-sub); }
.bedingungen li span { flex: 1; }
.bedingungen .ok .ic { color: var(--good); }
.bedingungen .nein .ic { color: var(--bad); }
.bedingungen .nein span { font-weight: 600; }
.kurs-tabelle { display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; }
.kt-kopf, .kt-zeile { display: grid; grid-template-columns: 1fr repeat(4, 2.4rem); gap: 4px; align-items: center; padding: 3px 6px; border-radius: 12px; width: 100%; }
.kt-kopf { font-size: var(--t-cap); font-weight: 600; color: var(--sub); text-align: center; }
.kt-kopf span:first-child { text-align: left; }
.kt-zeile:active { background: var(--fill); }
.kt-fach { display: flex; align-items: center; gap: 8px; font-size: var(--t-sub); min-width: 0; }
.kt-fach > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.kt-zelle { display: grid; place-items: center; height: 2rem; border-radius: 9px; font-weight: 600; font-size: var(--t-sub); }
.kt-zelle.drin { background: var(--c); color: var(--dark); }
.kt-zelle.raus { box-shadow: inset 0 0 0 1.5px var(--line); color: var(--sub); }
.kt-zelle.geschaetzt { font-style: italic; font-weight: 500; }
.kt-zelle.drin.geschaetzt { background: transparent; color: var(--text); border: 2px dashed var(--c); }
.kt-zelle.unter.drin { box-shadow: inset 0 0 0 2.5px var(--bad); }
.legende-kurse { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.lk { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.lk.drin { background: #74cf5f; }
.lk.raus { box-shadow: inset 0 0 0 1.5px var(--sub); margin-left: 6px; }
.lk.geschaetzt { border: 2px dashed #74cf5f; margin-left: 6px; }
.hinweise { list-style: none; padding: 0; margin: 0 0 8px; }
.hinweise li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; font-size: var(--t-sub); color: var(--sub); }
.hinweise li.fehler { color: var(--bad); font-weight: 600; }
.hinweise .ic { width: 1.1em; height: 1.1em; margin-top: 1px; }

/* ---------- Mehr ---------- */

.tage-wahl { display: flex; gap: 6px; padding: 2px 16px 14px 60px; flex-wrap: wrap; }
.tage-wahl button { padding: 6px 13px; min-height: 36px; border-radius: 999px; background: var(--fill); font-size: var(--t-sub); font-weight: 500; }
.tage-wahl button.on { background: var(--accent); color: var(--on-accent); }
.nv { font-size: var(--t-title3); margin: 16px 0 4px; }
.nv-liste { margin: 0; padding-left: 20px; }
.nv-liste li { margin: 5px 0; }
.reihenfolge .zeile { padding: 6px 4px; }

/* ---------- Blätter (von unten wie iOS 26: Griff, ✕ links, ✓ rechts) ---------- */

.sheet { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .32); }
.sheet-panel { position: relative; max-height: calc(100% - var(--safe-t) - 16px); display: flex; flex-direction: column; background: var(--blatt);
	border-radius: var(--r-blatt) var(--r-blatt) 0 0; width: 100%; max-width: 680px; margin: 0 auto; outline: none; box-shadow: 0 -10px 40px rgba(0, 0, 0, .18); }
.sheet-panel::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--fill2); }
.sheet-panel { --card: var(--blatt-karte); }
.sheet.neu .sheet-panel { animation: hoch .38s var(--kurve); }
.sheet.neu .sheet-bg { animation: blende .25s; }
@keyframes hoch { from { transform: translateY(100%); } }
@keyframes blende { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .page, .sheet.neu .sheet-panel, .sheet.neu .sheet-bg { animation: none !important; } .ring .bogen { transition: none; } }
.sheet-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; padding: 18px 14px 8px; }
.sheet-title { font-weight: 600; font-size: 1rem; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rund { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--fill); color: var(--text); }
.rund .ic { width: 20px; height: 20px; stroke-width: 2.2; }
.rund.haupt { background: var(--accent); color: var(--on-accent); }
.rund:active { transform: scale(.94); }
.sheet-body { overflow-y: auto; padding: 8px 16px calc(28px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.sheet-info { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--sub); margin-bottom: 16px; font-size: var(--t-sub); }
.frage-text { font-size: 1rem; margin: 4px 4px 8px; color: var(--sub); text-align: center; }
.feld-titel { display: block; font-size: var(--t-foot); font-weight: 400; color: var(--sub); margin: 20px 16px 7px; }
.feld-reihe { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 18px; }
@media (min-width: 520px) { .feld-reihe { grid-template-columns: 1fr 1fr; } }
.feld { display: flex; flex-direction: column; gap: 6px; }
.feld > span { font-size: var(--t-foot); color: var(--sub); margin-left: 16px; }
.feld input, .such-feld input, .gross-input, .gruppen-liste input[type=text] { width: 100%; min-height: 50px; padding: 0 16px; border-radius: var(--r-feld); border: 0;
	background: var(--card); font-size: 1rem; outline: none; box-shadow: inset 0 0 0 1px var(--line); }
.feld input:focus, .such-feld input:focus, .gross-input:focus, .gruppen-liste input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.feld input[type=date] { -webkit-appearance: none; appearance: none; display: flex; align-items: center; }
.such-feld { position: relative; margin-bottom: 4px; }
.such-feld .ic { position: absolute; left: 14px; top: 50%; margin-top: -.65em; color: var(--sub); }
.such-feld input { padding-left: 44px; border-radius: 999px; background: var(--fill); box-shadow: none; }
.formular { display: flex; flex-direction: column; gap: 14px; }
.fehler { color: var(--danger); font-weight: 600; font-size: var(--t-sub); }
.punkte-raster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.punkte-raster button { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 3.5rem; border-radius: var(--r-innen);
	background: var(--c); color: var(--dark); font-size: var(--t-title2); font-weight: 700; line-height: 1.05; transition: transform .15s var(--kurve); }
.punkte-raster small { font-size: var(--t-cap2); font-weight: 600; opacity: .72; }
.punkte-raster button.on { box-shadow: 0 0 0 3px var(--blatt), 0 0 0 5.5px var(--text); }
.punkte-raster button:active { transform: scale(.96); }
.fach-wahl { display: flex; flex-wrap: wrap; gap: 8px; }
.fach-wahl button { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; min-height: 44px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; }
.fach-wahl button.on { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-tint); font-weight: 600; }
.fach-wahl .kachel.klein { border-radius: 50%; }
.untis-zeile { background: var(--card); border-radius: var(--r-karte); margin-top: 16px; }
.untis-zeile > .ic:first-child { color: var(--accent); }
.haken { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--sub2); color: transparent; flex: none; }
.haken.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.haken .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.fach-vorschau { display: flex; align-items: center; gap: 12px; }
.toene { display: flex; flex-wrap: wrap; gap: 12px; padding: 0 4px; }
.ton { width: 36px; height: 36px; border-radius: 50%; background: var(--t); }
.ton.on { box-shadow: 0 0 0 3px var(--blatt), 0 0 0 5px var(--text); }
.symbole { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; padding: 8px; border-radius: var(--r-karte); background: var(--card); }
.symbole button { display: grid; place-items: center; height: 46px; border-radius: 12px; color: var(--text); }
.symbole button.on { background: var(--accent); color: var(--on-accent); }
.schalter-zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; margin-top: 14px; padding: 6px 16px; border-radius: var(--r-karte); background: var(--card); }
.karte .schalter-zeile { padding: 0; margin-top: 0; background: none; }
.schalter-zeile > span { display: flex; flex-direction: column; }
.schalter-zeile small { font-size: var(--t-foot); }
.gruppen-liste { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gruppen-liste li { display: grid; grid-template-columns: 1fr auto; gap: 8px 6px; align-items: center; background: var(--card); padding: 10px; border-radius: 18px; }
.gruppen-liste input[type=text] { background: var(--fill); box-shadow: none; }
.gruppen-liste li .gewicht { grid-column: 1; display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.gruppen-liste li .gewicht input { flex: 1; accent-color: var(--accent); height: 30px; }
.gruppen-liste li .gewicht b { min-width: 3.2rem; text-align: right; }
.gruppen-liste li > button { grid-column: 2; grid-row: 1; }

/* ---------- Anmelden ---------- */

.login { max-width: 400px; margin: 0 auto; padding: calc(var(--safe-t) + 72px) 24px 40px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.login .logo { width: 88px; height: 88px; margin-bottom: 14px; }
.login .logo svg { width: 100%; height: 100%; display: block; }
.login h1 { font-size: var(--t-large); font-weight: 700; letter-spacing: -.01em; }
.login .formular { width: 100%; text-align: left; margin-top: 22px; }
.name-schild { margin-top: 12px; padding: 10px 16px; border-radius: 999px; background: var(--fill); font-size: var(--t-sub); }

/* ---------- Meldung (Glas, schwebt über der Tab-Leiste) ---------- */

.toast { position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translate(-50%, 12px); z-index: 60; max-width: calc(100% - 40px);
	padding: 12px 20px; border-radius: 22px; color: var(--text); font-weight: 500; font-size: var(--t-sub); opacity: 0; pointer-events: none;
	transition: opacity var(--dauer), transform var(--dauer) var(--kurve); display: flex; align-items: center; gap: 12px;
	background: var(--glass); -webkit-backdrop-filter: blur(28px) saturate(1.7); backdrop-filter: blur(28px) saturate(1.7);
	box-shadow: var(--glass-schatten), inset 0 0 0 .5px var(--glass-rand); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-btn { color: var(--accent); font-weight: 600; min-height: 32px; }

/* ---------- Drucken ---------- */

#druck { display: none; }
@media print {
	body { background: #fff; color: #000; }
	#app, .toast { display: none !important; }
	#druck { display: block; font: 11pt/1.4 system-ui, -apple-system, sans-serif; color: #000; }
	#druck h1 { font-size: 18pt; margin-bottom: 2pt; }
	#druck .d-sub { color: #555; font-size: 9pt; margin: 4pt 0 12pt; }
	#druck table { width: 100%; border-collapse: collapse; }
	#druck th, #druck td { border-bottom: .5pt solid #bbb; padding: 5pt 6pt; text-align: center; }
	#druck th:first-child, #druck td:first-child { text-align: left; }
	#druck td b { display: inline-block; min-width: 26pt; padding: 1pt 4pt; border-radius: 4pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	#druck .d-schnitt td { font-weight: 700; border-top: 1pt solid #000; }
	#druck .d-abi { margin-top: 12pt; font-weight: 600; }
	#druck .d-leer { color: #aaa; }
}

/* ---------- Große Schrift (Dynamic Type): umbrechen statt quetschen ---------- */
.hero { flex-wrap: wrap; }
.hero-text { flex: 1 1 9rem; }
.seg.faktoren { flex-wrap: wrap; border-radius: 22px; }
.seg.faktoren button { flex: 1 0 3.2rem; }
.bloecke { grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }
.pruef-liste li { flex-wrap: wrap; }
.p-name { flex: 1 1 8rem; }

/* Mehrfachauswahl (Halbjahre eines Fachs): Kapseln mit Haken */
.mehrfach { display: flex; flex-wrap: wrap; gap: 8px; }
.mehrfach button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 11px; border-radius: 999px; background: var(--fill); font-weight: 500; font-size: var(--t-sub); }
.mehrfach button .ic { width: 1em; height: 1em; color: var(--sub); stroke-width: 2.2; }
.mehrfach button.on { background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.mehrfach button.on .ic { color: var(--accent); }
