/* Schulpost – Farben aus dem Schullogo (Himbeerrot der Schrift, bunte Hände) */
:root {
  --brand: #c32756; --brand-dark: #9e1c44; --brand-soft: #fbe9ef; --on-brand: #ffffff;
  --bg: #f4f3f6; --card: #ffffff; --text: #1b1b21; --muted: #6b6a75; --border: #e6e4ea; --field: #f7f6f9;
  --post: #2e5fa8; --sick: #e8711a; --care: #4f9a2a; --cal: #6a4893; --req: #1f9bc4;
  --ok: #2f8a3c; --ok-soft: #e7f4e8; --warn: #b26200; --warn-soft: #fdf0e1; --danger: #c0352b;
  --radius: 14px; --shadow: 0 1px 2px rgba(20, 16, 30, .06), 0 4px 14px rgba(20, 16, 30, .05);
  --sidebar: 248px; --tabbar: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #e5577f; --brand-dark: #f07d9c; --brand-soft: #3a1a25; --on-brand: #1b0a10;
    --bg: #131217; --card: #1d1c22; --text: #ecebf0; --muted: #a09fab; --border: #2e2c35; --field: #25232b;
    --post: #6f9be0; --sick: #f39a52; --care: #7cc456; --cal: #a689cf; --req: #5cc3e4;
    --ok: #6cc77a; --ok-soft: #1c2e1f; --warn: #f0b060; --warn-soft: #33260f; --danger: #ef6b5f;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); }
img { max-width: 100%; }
.icon { width: 22px; height: 22px; flex: none; }

/* Bereichsfarben, wie die farbigen Kacheln bei Untis */
.c-post { --c: var(--post); } .c-sick { --c: var(--sick); } .c-care { --c: var(--care); }
.c-cal { --c: var(--cal); } .c-req { --c: var(--req); } .c-brand { --c: var(--brand); } .c-lib { --c: #a0522d; }
.sec-letters { --sec: var(--post); } .sec-absences { --sec: var(--sick); } .sec-care { --sec: var(--care); }
.sec-events { --sec: var(--cal); } .sec-antraege { --sec: var(--req); } .sec-intern { --sec: var(--brand); } .sec-library { --sec: #a0522d; }
body { --sec: var(--brand); }

/* App-Leiste oben (Handy) */
.appbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .65rem;
  padding: calc(.55rem + env(safe-area-inset-top)) 1rem .55rem; background: var(--card); border-bottom: 3px solid var(--sec); }
.appbar img { border-radius: 50%; }
.appbar-title, .sidebar-brand span { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.appbar-title small, .sidebar-brand small { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tab-Leiste unten (Handy) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; background: var(--card);
  border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .45rem;
  font-size: .72rem; color: var(--muted); text-decoration: none; position: relative; }
.tabbar a.active { color: var(--c, var(--brand)); font-weight: 600; }
.tabbar a.active::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; border-radius: 0 0 3px 3px; background: var(--c, var(--brand)); }

/* Seitenleiste (Computer) */
.sidebar { display: none; }
@media (min-width: 900px) {
  .appbar, .tabbar { display: none; }
  .sidebar { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
    background: var(--card); border-right: 1px solid var(--border); padding: 1rem .75rem; overflow-y: auto; }
  body:not(.guest) main { margin-left: calc(var(--sidebar) + max(0px, (100vw - var(--sidebar) - 900px) / 2)); }
}
.sidebar-brand { display: flex; align-items: center; gap: .65rem; padding: .25rem .5rem 1rem; margin-bottom: .5rem;
  border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.sidebar-brand img { border-radius: 50%; }
.side-nav, .side-foot { display: flex; flex-direction: column; gap: 2px; }
.side-foot { margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--border); }
.side-nav a, .side-foot a, .nav-btn { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: 10px;
  color: var(--text); text-decoration: none; font: inherit; border: 0; background: none; width: 100%; cursor: pointer; text-align: left; }
.side-nav a .icon { color: var(--c, var(--muted)); }
.side-nav a:hover, .side-foot a:hover, .nav-btn:hover { background: var(--field); }
.side-nav a.active { background: color-mix(in srgb, var(--c, var(--brand)) 13%, transparent); color: var(--c, var(--brand)); font-weight: 600; }
.side-foot a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.side-foot form { margin: 0; }

/* Inhalt */
main { max-width: 900px; margin: 0 auto; padding: 1rem 1rem calc(var(--tabbar) + 1.5rem + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { main { padding: 1.75rem 1.5rem 2rem; } }
footer { text-align: center; padding: 1.5rem 0 .5rem; font-size: .85rem; }
footer a { color: var(--muted); }

.guest-head { text-align: center; padding: 2rem 1rem 0; }
.guest-head img { width: min(260px, 70vw); height: auto; }
.guest main { padding-bottom: 2rem; }
@media (prefers-color-scheme: dark) { .guest-head img { background: #fff; border-radius: 20px; padding: 12px; } }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem;
  margin-bottom: 1rem; box-shadow: var(--shadow); }
.card.narrow { max-width: 440px; margin: 1.5rem auto; }
h1 { font-size: 1.45rem; line-height: 1.25; margin: .15rem 0 .8rem; letter-spacing: -.01em; }
h2 { font-size: 1.08rem; margin: 1.2rem 0 .5rem; }
.card > h1:first-child, .card > .row:first-child h1 { position: relative; padding-left: .8rem; }
.card > h1:first-child::before, .card > .row:first-child h1::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .2em;
  width: 4px; border-radius: 4px; background: var(--sec); }
.muted { color: var(--muted); font-size: .92rem; }
.row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; }
.row h1 { margin-bottom: .5rem; }
.body { overflow-wrap: anywhere; }

/* Listen im Untis-Stil: Zeilen mit Farbstreifen */
ul.plain, ul.letters, ul.rows { list-style: none; padding: 0; margin: 0; }
ul.letters { display: flex; flex-direction: column; gap: .5rem; }
ul.letters li a { display: flex; flex-direction: column; gap: .1rem; padding: .75rem .9rem .75rem 1rem; border-radius: 12px;
  border: 1px solid var(--border); border-left: 4px solid var(--border); text-decoration: none; color: var(--text); background: var(--card); }
ul.letters li a:hover { border-color: var(--post); }
ul.letters li.unread a { border-left-color: var(--post); background: color-mix(in srgb, var(--post) 6%, var(--card)); }
ul.letters li.unread strong::before { content: ""; display: inline-block; width: .55rem; height: .55rem; margin-right: .45rem;
  border-radius: 50%; background: var(--post); vertical-align: .1em; }
ul.letters li.muted { padding: .5rem 0; }
ul.rows li { display: flex; flex-direction: column; padding: .55rem 0; border-bottom: 1px solid var(--border); }
ul.rows li:last-child { border-bottom: 0; }
ul.plain li { padding: .25rem 0; }
.news { border-top: 4px solid #f2c81e; }
.news h2 { margin-top: 0; }

.badge { display: inline-block; align-self: flex-start; margin-top: .3rem; font-size: .78rem; font-weight: 600; padding: .1rem .55rem;
  border-radius: 99px; background: var(--warn-soft); color: var(--warn); }
.status-pending { background: var(--warn-soft); color: var(--warn); }
.status-approved, .status-done { background: var(--ok-soft); color: var(--ok); }
.status-rejected { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.tag { display: inline-block; font-size: .75rem; padding: .05rem .5rem; border-radius: 99px; background: var(--field);
  border: 1px solid var(--border); color: var(--muted); margin-left: .25rem; }

/* Formulare */
form div { margin-bottom: .9rem; }
label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date],
input[type=time], input[type=datetime-local], input[type=url], textarea, select {
  width: 100%; padding: .65rem .75rem; font: inherit; color: var(--text); background: var(--field);
  border: 1px solid var(--border); border-radius: 10px; }
input[type=date], input[type=time] { width: auto; min-width: 10rem; }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; border-color: var(--brand); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 1.1rem; height: 1.1rem; margin: 0 .45rem 0 0; vertical-align: -.15em; }
.helptext { display: block; color: var(--muted); font-size: .85rem; margin-top: .15rem; }
.errorlist { color: var(--danger); padding-left: 1rem; margin: .2rem 0; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: .25rem; }
form div > div { margin-bottom: .2rem; }
form ul, form div[id^="id_"] { list-style: none; padding-left: 0; }
form div[id^="id_"] > div { display: inline-block; margin-right: 1rem; }
form div[id^="id_"] label { font-weight: 400; display: inline; }
ul#id_reason, #id_reason { list-style: none; padding: 0; display: flex; gap: .5rem; flex-wrap: wrap; }
#id_reason label { font-weight: 500; display: inline-flex; align-items: center; padding: .45rem .8rem; border: 1px solid var(--border);
  border-radius: 99px; background: var(--field); cursor: pointer; }
#id_reason label:has(input:checked) { border-color: var(--sick); background: color-mix(in srgb, var(--sick) 12%, var(--card)); }
.filters { display: flex; flex-wrap: wrap; gap: 0 1rem; align-items: flex-end; }
.filters > div { min-width: 10rem; }
form.search { display: flex; gap: .4rem; align-items: center; }
.search input { min-width: 12rem; }
form.inline { display: inline; margin: 0; }
form.answer { margin-bottom: 1rem; }

/* Knöpfe */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600;
  padding: .6rem 1.05rem; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text);
  cursor: pointer; text-decoration: none; line-height: 1.3; }
button:hover, .button:hover { border-color: var(--brand); }
button.primary, .button.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
button.primary:hover, .button.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
button.link { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 500; text-decoration: underline; }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.big { padding: .85rem 1.3rem; font-size: 1.05rem; min-width: 7.5rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.actions.tight { margin: 0; }
.card.narrow button.primary { width: 100%; padding: .75rem; }

/* Meldungen */
.msg { padding: .7rem .9rem; border-radius: 12px; margin-bottom: 1rem; border: 1px solid var(--border); background: var(--card); border-left: 4px solid var(--brand); }
.msg-success { border-left-color: var(--ok); background: var(--ok-soft); }
.msg-warning { border-left-color: var(--warn); background: var(--warn-soft); }
.msg-error { border-left-color: var(--danger); }

/* Reiter */
.tabs { display: flex; gap: .35rem; margin: .25rem 0 .9rem; overflow-x: auto; }
.tabs a { text-decoration: none; padding: .35rem .85rem; border-radius: 99px; color: var(--muted); background: var(--field); white-space: nowrap; font-size: .92rem; }
.tabs a.active { color: var(--on-brand); background: var(--sec); font-weight: 600; }
.tabs.wrap { flex-wrap: wrap; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--border); }
.table-scroll { overflow-x: auto; }

/* Rückfragen am Brief */
.questions { border-top: 1px solid var(--border); margin-top: 1.25rem; padding-top: .5rem; }
.question-preview { padding: .5rem 0; border-bottom: 1px solid var(--border); }
details summary { cursor: pointer; color: var(--brand); font-weight: 600; margin: .75rem 0; }
.translate { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.translate label { display: inline; font-weight: 400; }
.translate select { width: auto; }

/* Kalender: Termine wie Stunden im Stundenplan */
ul.events { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .5rem; }
ul.events li { display: grid; grid-template-columns: 9.5rem 1fr; gap: .75rem; padding: .7rem .9rem; border-radius: 12px;
  background: color-mix(in srgb, var(--cal) 7%, var(--card)); border: 1px solid var(--border); border-left: 4px solid var(--cal); }
ul.events .date { color: var(--muted); font-size: .9rem; font-weight: 600; }
@media (max-width: 520px) { ul.events li { grid-template-columns: 1fr; gap: .1rem; } }

/* Betreuung */
ul.care-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
ul.care-list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .75rem .9rem;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
ul.care-list li:has(.hint-alone) { border-left: 4px solid var(--ok); }
ul.care-list li:has(.hint-pickup) { border-left: 4px solid var(--warn); }
ul.care-list .who { flex: 1; min-width: 0; }
ul.care-list.gone li { opacity: .7; }
ul.care-list li.muted { border: 0; padding: .25rem 0; }
.hint { margin-top: .15rem; font-weight: 600; }
.hint-alone { color: var(--ok); }
.hint-pickup { color: var(--warn); }
.offer { padding: .8rem 0; border-bottom: 1px solid var(--border); }
.offer-child { margin-top: .35rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.slots { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }

/* Mehr / Profil */
.profile-head { display: flex; align-items: center; gap: 1rem; }
.profile-head h1 { margin: 0; padding: 0; }
.profile-head h1::before { display: none; }
.profile-head p { margin: .1rem 0 0; }
.avatar { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; font-weight: 700;
  background: var(--brand-soft); color: var(--brand); }
.menu { padding: .35rem .5rem; display: flex; flex-direction: column; }
.menu a, .menu-btn { display: flex; align-items: center; gap: .85rem; padding: .75rem .6rem; color: var(--text); text-decoration: none;
  border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: none; font: inherit; font-weight: 400; width: 100%; cursor: pointer; text-align: left; }
.menu form { margin: 0; }
.menu > :last-child, .menu > form:last-child .menu-btn { border-bottom: 0; }
.menu a > .icon:first-child, .menu-btn .icon { color: var(--c, var(--muted)); padding: 6px; width: 34px; height: 34px; border-radius: 10px;
  background: color-mix(in srgb, var(--c, var(--muted)) 13%, transparent); }
.menu a span, .menu-btn span { flex: 1; }
.menu a > .icon:last-child { color: var(--muted); width: 18px; height: 18px; }
.menu-btn { color: var(--danger); }
.menu-btn .icon { --c: var(--danger); }

/* Zwei-Faktor */
.qr svg { width: 220px; height: auto; display: block; margin: .5rem 0; background: #fff; padding: 8px; border-radius: 10px; }
code { font-size: 1rem; letter-spacing: .05em; }
.nav-btn, .menu-btn { justify-content: flex-start; font-weight: 400; }
.nav-btn:hover, .menu-btn:hover { border-color: transparent; }
@media (max-width: 640px) { .tabs.wrap { flex-wrap: nowrap; margin-right: -1.25rem; padding-right: 1.25rem; } }

/* Abweichung melden: Auswahl untereinander als große Tipp-Flächen */
form div[id$="-kind"] > div, .stack-kind #id_kind > div { display: block; margin: 0 0 .4rem; }
form div[id$="-kind"] label, .stack-kind #id_kind label { display: flex; align-items: center; gap: .2rem; padding: .7rem .85rem; border: 1px solid var(--border);
  border-radius: 12px; background: var(--field); cursor: pointer; font-weight: 500; }
form div[id$="-kind"] label:has(input:checked), .stack-kind #id_kind label:has(input:checked) { border-color: var(--care); background: color-mix(in srgb, var(--care) 12%, var(--card)); }

/* Betreuung Eltern: links der Tag, rechts die Abholzeiten */
.day-plan { margin: 0; }
.day-row { display: grid; grid-template-columns: 4.6rem 1fr; gap: .6rem; align-items: start; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.day-row.changed .day-label strong { color: var(--care); }
.day-label { padding: .35rem 0 0; margin: 0; font-weight: 400; line-height: 1.2; }
.day-label small { display: block; color: var(--muted); font-size: .75rem; margin-top: .15rem; }
.pills { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; }
.pills label { margin: 0; font-weight: 500; font-size: .9rem; }
.pills input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pills span { display: inline-block; padding: .4rem .7rem; border-radius: 99px; border: 1px solid var(--border); background: var(--field); cursor: pointer; white-space: nowrap; }
.pills input:checked + span { background: var(--care); border-color: var(--care); color: #fff; font-weight: 600; }
.pills .pill-off input:checked + span { background: var(--danger); border-color: var(--danger); }
.pills input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.save-plan { margin-top: 1rem; width: 100%; }
@media (min-width: 640px) { .save-plan { width: auto; } }
.day-plan .day-row, .day-plan .day-label, .day-plan .pills { margin-bottom: 0; }

/* Kalender: Monatsansicht */
.cat-holiday { --ec: #e0a800; } .cat-event { --ec: var(--brand); } .cat-parents { --ec: var(--cal); } .cat-trip { --ec: var(--req); }
.cat-conference { --ec: var(--post); } .cat-care { --ec: var(--care); } .cat-other { --ec: var(--muted); }
.cal-filters { margin: .25rem 0 .5rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 99px; border: 1px solid var(--border);
  background: var(--field); color: var(--text); text-decoration: none; font-size: .85rem; }
.chip i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--ec, var(--muted)); }
.chip.on { background: var(--cal); border-color: var(--cal); color: #fff; font-weight: 600; }
.chip.on i { background: #fff; }
.cal-head { display: flex; align-items: center; gap: .4rem; margin: .5rem 0; }
.cal-head h2 { flex: 1; text-align: center; margin: 0; font-size: 1.2rem; }
.cal-head .button { padding: .35rem .8rem; font-size: 1.1rem; }
.cal-head .today-btn { font-size: .85rem; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.month .wd { padding: .3rem; text-align: center; font-size: .75rem; font-weight: 600; color: var(--muted); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.month .day { display: flex; flex-direction: column; min-height: 6.2rem; padding: .25rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  color: var(--text); text-decoration: none; overflow: hidden; }
.month .day:hover { background: var(--field); }
.month .day.out { color: var(--muted); background: color-mix(in srgb, var(--field) 60%, transparent); }
.month .day.weekend { background: color-mix(in srgb, var(--field) 80%, transparent); }
.month .num { font-size: .85rem; font-weight: 600; width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border-radius: 50%; }
.month .today .num { background: var(--brand); color: #fff; }
.month .sel { box-shadow: inset 0 0 0 2px var(--cal); }
.month .evs { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.month .ev { font-size: .72rem; line-height: 1.25; padding: 1px 4px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--ec) 18%, transparent); border-left: 3px solid var(--ec); }
.month .more { font-size: .7rem; color: var(--muted); }
.month .dots { display: none; gap: 3px; justify-content: center; margin-top: auto; padding-bottom: 2px; }
.month .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ec); }
@media (max-width: 700px) {
  .month .day { min-height: 3.4rem; align-items: center; }
  .month .evs { display: none; }
  .month .dots { display: flex; }
  .card.cal { padding-left: .75rem; padding-right: .75rem; }
}
.sel-title { margin-top: 1rem; }
ul.events li { border-left-color: var(--ec, var(--cal)); background: color-mix(in srgb, var(--ec, var(--cal)) 7%, var(--card)); }
ul.events li.empty { display: block; border: 0; background: none; padding: .25rem 0; }

/* Wer fehlt: Stundenraster */
.legend { display: flex; flex-wrap: wrap; gap: .8rem; margin: .5rem 0; font-size: .85rem; font-weight: 400; }
.legend span::before { content: ""; display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; background: var(--rc); }
.r-sick { --rc: var(--sick); }
.r-doctor { --rc: var(--post); }
.r-other { --rc: #8a8f98; }
.timetable { display: grid; grid-template-columns: minmax(8rem, 1.6fr) repeat(var(--lessons), minmax(1.6rem, 1fr)) auto; gap: 3px; align-items: stretch; overflow-x: auto; }
.timetable > div { min-height: 2.4rem; display: flex; align-items: center; }
.tt-head { justify-content: center; font-size: .8rem; color: var(--muted); font-weight: 600; min-height: 1.6rem !important; }
.tt-head.tt-name { justify-content: flex-start; }
.tt-class { grid-column: 1 / -1; font-weight: 700; font-size: .85rem; color: var(--sec, var(--brand)); border-bottom: 1px solid var(--border); min-height: 1.8rem !important; padding-top: .4rem; }
.tt-name { flex-direction: column; align-items: flex-start !important; justify-content: center; line-height: 1.2; padding-right: .4rem; }
.tt-name small { color: var(--muted); font-size: .75rem; }
.tt-cell { background: var(--field); border-radius: 4px; }
.tt-cell.on { background: var(--rc); }
.tt-seen { justify-content: center; padding-left: .3rem; }
.tt-seen form { margin: 0; }
.tt-seen button { padding: .25rem .55rem; font-size: .8rem; }
.tt-seen .seen { color: var(--care); font-weight: 700; }

/* Betreuung: Zeitleiste */
.go-pickup { --rc: var(--warn); }
.go-alone { --rc: var(--care); }
.care-tt .tt-cell.on { opacity: .45; }
.care-tt .tt-cell.on.end { opacity: 1; justify-content: center; font-size: 1rem; }
.care-tt .is-gone { opacity: .35; }
.care-tt .tt-name.is-gone { opacity: .55; text-decoration: line-through; }
.care-tt .tt-seen { flex-direction: column; gap: .15rem; }
.care-tt details { font-size: .8rem; }

/* News Intern */
.menu a span small { display: block; font-size: .8rem; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat { display: flex; flex-direction: column; gap: .5rem; margin: .75rem 0; }
.chat-day { align-self: center; font-size: .75rem; color: var(--muted); background: var(--field); padding: .15rem .6rem; border-radius: 99px; margin-top: .4rem; }
.bubble { align-self: flex-start; max-width: min(36rem, 88%); background: var(--field); border-radius: 14px 14px 14px 4px; padding: .5rem .75rem; }
.bubble.mine { align-self: flex-end; background: color-mix(in srgb, var(--brand) 12%, var(--card)); border-radius: 14px 14px 4px 14px; }
.bubble-head { font-size: .8rem; margin-bottom: .15rem; }
.bubble form { margin: 0; }
.bubble .link { font-size: .75rem; padding: 0; }
.chat-form { display: flex; gap: .5rem; align-items: flex-end; padding-top: .5rem; }
.chat-form textarea { flex: 1; min-height: 2.6rem; }
ul.docs li { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .3rem .75rem; }
ul.docs li > a { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 12rem; color: var(--text); text-decoration: none; }
ul.docs li > a .icon { color: var(--cal); }
ul.docs form { margin: 0; }
@media (max-width: 700px) {
  .timetable { grid-template-columns: repeat(var(--lessons), minmax(0, 1fr)) auto; overflow: visible; }
  .timetable .tt-name { grid-column: 1 / -1; min-height: 0 !important; padding-top: .5rem; }
  .timetable .tt-head.tt-name { display: none; }
  .timetable .tt-head { font-size: .62rem; }
  .timetable > .tt-cell { min-height: 2rem; }
}

/* Bücherei */
.search-big input { width: 100%; font-size: 1.05rem; padding: .7rem .9rem; }
.search-big label, .scan-form label { display: block; font-weight: 600; margin-bottom: .3rem; }
.scan-form { margin: 1rem 0; padding: .9rem; background: var(--field); border-radius: 12px; }
.scan-row { display: flex; gap: .5rem; }
.scan-row input { flex: 1; font-size: 1.2rem; letter-spacing: .08em; text-transform: uppercase; }
.borrower { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .75rem .9rem; border-left: 4px solid var(--sec); background: var(--field); border-radius: 10px; }
.borrower span { display: block; }
ul.pick li a { display: block; padding: .3rem 0; color: var(--text); text-decoration: none; }
.st-lent { color: var(--danger); } .st-free { color: var(--ok); }
tr.overdue td, li.overdue { color: var(--danger); }
li.overdue { border-left: 3px solid var(--danger); padding-left: .6rem; }
/* News Intern: Empfänger auswählen */
.row h2 { margin: .3rem 0; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .4rem; margin: .3rem 0 1rem;
  max-height: 22rem; overflow-y: auto; }
.pick-list label { display: flex; align-items: center; gap: .1rem; margin: 0; padding: .55rem .7rem; font-weight: 500;
  border: 1px solid var(--border); border-radius: 10px; background: var(--field); cursor: pointer; }
.pick-list label:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--card)); }
.pick-list label span { overflow: hidden; text-overflow: ellipsis; }

/* Kalender in eigene Kalender-App übernehmen */
.sub-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .6rem; margin: 1rem 0; }
.sub-buttons .button { justify-content: flex-start; gap: .75rem; padding: .9rem 1.1rem; font-size: 1.02rem; text-align: left; }
.sub-buttons .button .icon { width: 26px; height: 26px; }
.sub-buttons .button small { display: block; font-weight: 400; font-size: .8rem; opacity: .85; }
.copy-field { display: flex; gap: .5rem; align-items: stretch; }
.copy-field input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: .85rem; }
details.steps { border-bottom: 1px solid var(--border); }
details.steps:last-of-type { border-bottom: 0; }
details.steps ol { margin: 0 0 1rem; padding-left: 1.3rem; }
details.steps li { margin-bottom: .3rem; }
/* Umfrage: Auswahl und Frage wie bei EduPage */
.survey-tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--brand); background: var(--field); border: 1px solid var(--border); border-radius: 99px; padding: .05rem .5rem; margin-right: .35rem; }
details.survey-add, details.survey-settings { border: 1px solid var(--border); border-radius: 12px; background: var(--card); margin: .6rem 0; padding: 0 .9rem; }
details.survey-add > summary, details.survey-settings > summary { margin: 0; padding: .65rem 0; }
details.survey-add[open], details.survey-settings[open] { padding-bottom: .9rem; background: var(--field); }
.survey-form { margin: 0; }
.survey-rule { border: 1px dashed var(--border); border-radius: 10px; padding: .5rem .75rem; margin: .5rem 0; }
.survey-rule[hidden] { display: none; }
.survey-rule-fields { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.survey-rule-fields > div { flex: 1; min-width: 9rem; }
.survey-settings div[id$="anonymity"] > div { display: block; }
.survey-note { color: var(--muted); font-size: .9rem; border-left: 3px solid var(--post); padding-left: .6rem; }
form.answer .helptext { font-style: italic; }

/* Schulanmeldung */
.adm-state { display: flex; gap: .3rem; flex-wrap: wrap; }
.adm-state span { font-size: .75rem; padding: .1rem .45rem; border-radius: 99px; background: var(--field); color: var(--muted); }
.adm-state span.ok { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
ul.adm-day { list-style: none; padding: 0; margin: .5rem 0; display: flex; flex-direction: column; gap: .4rem; }
ul.adm-day li { display: grid; grid-template-columns: 3.4rem 1fr auto; gap: .6rem; align-items: center; padding: .6rem .75rem; border-radius: 12px; background: var(--field); }
ul.adm-day li.done { opacity: .65; }
ul.adm-day .time { font-weight: 700; color: var(--sec); }
ul.adm-day a { color: var(--text); text-decoration: none; }
@media (max-width: 560px) { ul.adm-day li { grid-template-columns: 3.4rem 1fr; } ul.adm-day .adm-state { grid-column: 2; } }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .4rem; }
.slot { padding: .5rem .65rem; border-radius: 10px; background: var(--field); display: flex; flex-direction: column; gap: .1rem; font-size: .9rem; }
.slot.taken { background: color-mix(in srgb, var(--sec) 12%, var(--card)); }
.slot form { margin: 0; }
.obs { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.obs-text { font-weight: 500; margin-bottom: .35rem; }
.obs .pills { display: flex; flex-wrap: wrap; gap: .35rem; }
.checklist label { display: flex; gap: .6rem; align-items: center; padding: .55rem .2rem; border-bottom: 1px solid var(--border); font-weight: 400; }
.checklist input { width: 1.3rem; height: 1.3rem; }
.extra dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; font-size: .9rem; }
.extra dt { color: var(--muted); }
.appointment .big-date { font-size: 1.3rem; line-height: 1.4; }
.sheet-steps a.active { background: var(--ok-soft); color: var(--ok); }
.obs-note { margin-top: .4rem; width: 100%; }
dl.summary { display: grid; grid-template-columns: minmax(10rem, 1fr) 2fr; gap: .45rem 1rem; margin: 0; }
dl.summary dt { color: var(--muted); }
dl.summary dd { margin: 0; }
@media (max-width: 560px) { dl.summary { grid-template-columns: 1fr; } dl.summary dd { margin-bottom: .4rem; } }

/* Eltern mit mehreren Kindern: Umschalter */
.kid-switch { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 .75rem; }
.kid-switch a { display: flex; align-items: center; gap: .4rem; padding: .3rem .8rem .3rem .3rem; border-radius: 99px; background: var(--field);
  color: var(--text); text-decoration: none; white-space: nowrap; border: 2px solid transparent; }
.kid-switch a:first-child { padding-left: .8rem; }
.kid-switch a b { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--sec); color: #fff; font-size: .85rem; }
.kid-switch a small { color: var(--muted); }
.kid-switch a.on { border-color: var(--sec); font-weight: 600; }
.table-scroll { overflow-x: auto; margin: .5rem 0; }
.import-preview { font-size: .85rem; white-space: nowrap; }
.import-preview .map-row select { font-size: .8rem; padding: .25rem .4rem; min-width: 9rem; }
.import-preview .map-row select.mapped { border-color: var(--ok); background: var(--ok-soft); }
.teacher-pick { border: 1px solid var(--border); border-radius: 12px; padding: .5rem .8rem; margin: .5rem 0; }
.teacher-pick > div { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.teacher-pick label { font-weight: 400; display: flex; gap: .35rem; align-items: center; }
.slot-staff { color: var(--muted); }
.warn-text { color: var(--warn); }
.sign-pad { border: 2px dashed var(--border); border-radius: 12px; background: #fff; margin: .3rem 0 .8rem; }
.sign-pad canvas { width: 100%; height: auto; aspect-ratio: 3 / 1; touch-action: none; display: block; cursor: crosshair; }
.sign-pad .link { margin: .2rem .6rem .4rem; }
.sign-form #id_agreed > div { margin-bottom: .3rem; }
.consent-text { background: var(--field); border-radius: 12px; padding: .2rem 1rem; max-height: 50vh; overflow-y: auto; }
.signed { display: flex; flex-direction: column; gap: .15rem; padding: .55rem .2rem; border-bottom: 1px solid var(--border); }
.signed span { color: var(--ok); font-size: .9rem; }
.signed.declined span { color: var(--danger); }
.signed img { max-width: 220px; background: #fff; border-radius: 6px; }

/* Betreuung: Wochenplan mit Frist und Freischaltung */
.week-head { font-size: 1rem; margin: 1.1rem 0 .2rem; }
.week-head small { font-weight: 400; color: var(--muted); margin-left: .4rem; }
.day-row.locked { opacity: .75; }
.pill-static { display: inline-block; padding: .4rem .7rem; border-radius: 99px; border: 1px dashed var(--border); font-size: .9rem; }
.pill-static.on { border-color: var(--care); color: var(--care); font-weight: 600; }
.pill-static.off { border-color: var(--danger); color: var(--danger); font-weight: 600; }
.care-days { display: grid; gap: .5rem; margin: .5rem 0 1rem; }
.care-days .care-day { display: grid; grid-template-columns: 9rem 13rem; gap: .6rem; align-items: center; }
.care-days label { margin: 0; }
@media (max-width: 600px) { .care-days .care-day { grid-template-columns: 1fr 1fr; } }
/* Briefe: Umschalter zu den Nachrichten zwischen Eltern und Schule */
.letter-switch .count { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding: 0 .3rem; margin-left: .2rem;
  border-radius: 99px; background: var(--post); color: #fff; font-size: .75rem; font-weight: 700; }
.letter-switch a.active .count { background: #fff; color: var(--post); }
