:root {
  /* surfaces */
  --bg: #f1f5f3;
  --bg-2: #e9efec;
  --card: #ffffff;
  --ink: #16232e;
  --ink-soft: #2c3a44;
  --muted: #66747f;
  --muted-2: #8a97a1;
  --line: #e6ecea;
  --line-strong: #d4ddd9;

  /* brand – Smaragd/Teal (aus den Screenshots, harmoniert mit dem ASV-Teal) */
  --brand: #16937c;
  --brand-strong: #0f7a67;
  --brand-ink: #0b6453;
  --brand-soft: #e7f3ef;
  --brand-soft-2: #d6ebe3;
  --brand-line: #bfe0d6;

  /* Rollen-Akzente für die Orientierung (wer ist wo) */
  --role-parent: #16937c;        --role-parent-soft: #e7f3ef;
  --role-teacher: #2f6f96;       --role-teacher-soft: #e8f0f5;
  --role-admin: #384a59;         --role-admin-soft: #eef1f3;

  /* status */
  --danger: #c0392b; --danger-soft: #fbe9e6; --danger-line: #f0cdc6;
  --warn: #b3760f;   --warn-soft: #fbf1da;   --warn-line: #f0dcae;
  --ok: #1f8a5b;     --ok-soft: #e4f3ea;     --ok-line: #c3e4d0;

  --shadow: 0 1px 2px rgba(18,52,42,.05), 0 6px 22px rgba(18,52,42,.06);
  --shadow-md: 0 10px 30px rgba(18,52,42,.10);
  --shadow-lg: 0 22px 56px rgba(18,52,42,.16);

  --r: 18px;
  --r-md: 13px;
  --r-sm: 10px;

  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15.5px; line-height: 1.55;
}

h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; }
h1, h2 { font-family: var(--serif); letter-spacing: -.005em; font-weight: 600; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 16px; font-family: var(--sans); letter-spacing: -.01em; }

a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.spacer { flex: 1; }
.hide { display: none !important; }

.eyebrow {
  font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted-2); font-weight: 700;
}
code {
  background: var(--bg-2); padding: 2px 7px; border-radius: 7px;
  font-size: 12.5px; word-break: break-all; color: var(--ink-soft);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

/* ============================== Topbar / Wayfinding ====================== */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .inner {
  max-width: 880px; margin: 0 auto; padding: 13px 20px;
  display: flex; align-items: center; gap: 13px;
}
.topbar .logo {
  height: 38px; width: 38px; object-fit: contain; display: block; flex: none;
}
.topbar .brandwrap { line-height: 1.1; display: flex; flex-direction: column; }
.topbar .brand {
  font-family: var(--serif); font-weight: 600; font-size: 19px;
  letter-spacing: -.01em; color: var(--ink);
}
.topbar .brand .dot { color: var(--brand); }
.topbar .brandsub { font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 1px; }
.topbar .right { margin-left: auto; display: flex; gap: 9px; align-items: center; }

/* Rollen-Chip: zeigt unmissverständlich, in welchem Bereich man ist */
.rolechip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 7px 13px; border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent;
}
.rolechip .led { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.rolechip.parent  { background: var(--role-parent-soft);  color: var(--role-parent);  border-color: var(--brand-line); }
.rolechip.teacher { background: var(--role-teacher-soft); color: var(--role-teacher); border-color: #cfe0eb; }
.rolechip.admin   { background: var(--role-admin-soft);   color: var(--role-admin);   border-color: #d8dee2; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--role-admin-soft); color: var(--role-admin); letter-spacing: .04em;
}

/* ============================== Layout ================================== */
.wrap { max-width: 880px; margin: 0 auto; padding: 26px 20px 72px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
  padding: 26px 28px; margin-bottom: 18px;
}
.card.tight { padding: 20px 22px; }
.card h2 { font-size: 21px; }
.card h2 + .sub { margin-top: 5px; }
.card .sub { color: var(--muted); margin: 0 0 18px; font-size: 14.5px; }
.row { display: flex; gap: 11px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--ink-soft); }
.field .hint { font-weight: 400; color: var(--muted); }

/* page intro – große Serif-Überschrift wie in den Screenshots */
.pagehead { margin-bottom: 8px; }
.pagehead .eyebrow { margin-bottom: 9px; }
.pagehead h1 { font-size: 32px; }
.pagehead .org { color: var(--brand-strong); font-size: 17px; font-weight: 500; margin-top: 6px; }

/* ============================== Buttons / Inputs ======================== */
.btn {
  font-family: var(--sans); font-weight: 600; font-size: 14.5px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--card); color: var(--ink-soft); cursor: pointer; white-space: nowrap;
  transition: transform .05s ease, box-shadow .16s, background .16s, border-color .16s, color .16s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { border-color: var(--brand); color: var(--brand-strong); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(15,122,103,.22); }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { color: var(--danger); border-color: var(--danger-line); background: #fff; }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn.small { padding: 8px 13px; font-size: 13px; }
.btn.big { padding: 15px 22px; font-size: 15.5px; }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; transform: none; }
.btn.topbtn { background: var(--bg-2); border-color: var(--line); color: var(--ink-soft); }
.btn.topbtn:hover { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-strong); }

input, select, textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  padding: 12px 14px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
textarea { resize: vertical; min-height: 76px; line-height: 1.5; }

/* ============================== Meta / Pills ============================ */
.meta { display: flex; flex-wrap: wrap; gap: 9px 22px; color: var(--ink-soft); margin-top: 16px; font-size: 15px; }
.meta .mi { display: inline-flex; align-items: center; gap: 9px; }
.meta .mi svg { width: 17px; height: 17px; color: var(--brand); flex: none; }
.meta b { font-weight: 600; }

.statbar {
  display: flex; align-items: center; gap: 11px; margin-top: 20px;
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  border-radius: var(--r-md); padding: 13px 18px; color: var(--brand-ink); font-size: 14.5px;
}
.statbar .num { font-size: 22px; font-weight: 700; font-family: var(--serif); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.blue, .pill.teal { background: var(--brand-soft); color: var(--brand-ink); }
.pill.green { background: var(--ok-soft); color: var(--ok); }
.pill.amber { background: var(--warn-soft); color: var(--warn); }

/* Hinweis-Box der Lehrkraft auf der Buchungsseite */
.notebox { border-left: 3px solid var(--brand); background: var(--brand-soft); }
.notebox .eyebrow { color: var(--brand-strong); }

/* ============================== Slot-Grid (Signatur) ==================== */
.slotgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 11px; margin-top: 6px; }
.slot {
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
  border: 1px solid var(--brand-line); background: var(--brand-soft); color: var(--brand-ink);
  border-radius: var(--r-md); padding: 15px 10px; text-align: center; position: relative;
  transition: border-color .12s, background .12s, transform .05s, box-shadow .12s;
}
.slot .t2 { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 3px; letter-spacing: .02em; }
.slot:hover:not(:disabled) { background: var(--brand-soft-2); border-color: var(--brand); box-shadow: var(--shadow); }
.slot:active:not(:disabled) { transform: translateY(1px); }
.slot.selected { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(15,122,103,.25); }
.slot.selected .t2 { color: rgba(255,255,255,.85); }
.slot.taken { cursor: default; background: var(--bg-2); color: var(--muted-2); border-color: var(--line); border-style: dashed; }
.slot.taken .t2 { color: var(--muted-2); }
.slot.blocked { cursor: default; background: repeating-linear-gradient(135deg,#f3f6f5,#f3f6f5 6px,#e9efec 6px,#e9efec 12px); color: var(--muted); border-color: var(--line-strong); border-style: dashed; text-align: left; padding: 12px 14px; }
.slot.blocked .t2 { margin-top: 2px; }
.slot.blocked .bnote { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-top: 6px; white-space: pre-line; line-height: 1.35; }
.slot.blocked .blkact { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.blkbtn { font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--line-strong); background: rgba(255,255,255,.72); color: var(--muted); border-radius: 8px; padding: 4px 9px; transition: background .12s, color .12s, border-color .12s; }
.blkbtn:hover { background: #fff; color: var(--ink); border-color: var(--brand); }
.slot.booked { cursor: default; background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); text-align: left; padding: 12px 14px; }
.slot.booked .who { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); margin-top: 4px; }
.slot.booked .det { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 14px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; }
.legend i { width: 13px; height: 13px; border-radius: 4px; display: inline-block; margin-right: 6px; border: 1px solid var(--line-strong); }
.legend .l-free { background: var(--brand-soft); border-color: var(--brand-line); }
.legend .l-booked { background: var(--ok-soft); border-color: var(--ok-line); }
.legend .l-blocked { background: repeating-linear-gradient(135deg,#f3f6f5,#f3f6f5 4px,#e9efec 4px,#e9efec 8px); }

/* ============================== Admin: Listen ========================== */
.linkrow {
  display: flex; align-items: center; gap: 9px; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 12px; margin-top: 8px;
}
.linkrow .lab { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); min-width: 104px; }
.linkrow code { background: transparent; flex: 1; padding: 0; font-size: 12px; }
.teacher-item {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 17px 18px; margin-bottom: 13px;
  background: var(--card); transition: border-color .15s, box-shadow .15s;
}
.teacher-item:hover { box-shadow: var(--shadow); }
.teacher-item .head { display: flex; align-items: flex-start; gap: 11px; }
.teacher-item .head .name { font-weight: 700; font-size: 16.5px; }

/* --- Zusammenklappbare Listeneinträge (Einzel- und Sammellinks) --- */
.listitem { padding: 0; overflow: hidden; }
.ti-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  font: inherit; background: none; border: 0; cursor: pointer; padding: 15px 18px;
  border-radius: var(--r-md); transition: background .13s;
}
.ti-toggle:hover { background: var(--brand-soft); }
.ti-toggle:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--brand); }
.ti-caret { flex: none; display: grid; place-items: center; color: var(--muted-2); transition: transform .16s, color .16s; }
.ti-caret svg { width: 18px; height: 18px; display: block; }
.listitem:not(.collapsed) .ti-caret { transform: rotate(90deg); color: var(--brand); }
.ti-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ti-main .name { font-weight: 700; font-size: 16.5px; color: var(--ink); }
/* darf umbrechen: hier stehen ggf. mehrere Fächer */
.ti-main .small { line-height: 1.4; }
.ti-pills { flex: none; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.ti-body { padding: 0 18px 17px; border-top: 1px solid var(--line); margin-top: -1px; padding-top: 14px; }
.listitem.collapsed .ti-body { display: none; }
.ti-names { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }

/* Suchfeld über einer Liste */
.listsearch { display: flex; align-items: center; gap: 12px; margin: 0 0 13px; }
.listsearch input { flex: 1; }
.listcount { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

@media (max-width: 580px) {
  .ti-toggle { flex-wrap: wrap; padding: 13px 14px; }
  .ti-pills { flex-direction: row; width: 100%; justify-content: flex-start; }
  .ti-body { padding-left: 14px; padding-right: 14px; }
}

/* ============================== Login-Gate ============================= */
.gate { min-height: 72vh; display: grid; place-items: center; }
.gate-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 36px 32px; max-width: 400px; width: 100%; box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--role-admin);
}
.gate-card h1 { font-size: 28px; margin-bottom: 6px; }

/* ============================== Toast / Banner ========================= */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; font-size: 14.5px; z-index: 60; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }
.banner { padding: 13px 16px; border-radius: var(--r-md); font-size: 14.5px; margin-bottom: 16px; line-height: 1.5; }
.banner.err { background: var(--danger-soft); color: #8a2018; border: 1px solid var(--danger-line); }
.banner.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }
.banner.info { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid var(--brand-line); }

/* Datenschutz-Fußnote mit Icon (wie Screenshot) */
.footnote { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 13px; max-width: 640px; margin: 8px auto 0; }
.footnote svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--muted-2); }

/* ============================== Bestätigung ============================ */
.confirm-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); display: grid; place-items: center; margin: 0 auto 16px; }
.confirm-icon svg { width: 34px; height: 34px; stroke: var(--ok); }
.detail-list { list-style: none; padding: 0; margin: 18px 0; }
.detail-list li { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-list li:last-child { border-bottom: 0; }
.detail-list .k { color: var(--muted); }
.detail-list .v { font-weight: 600; text-align: right; }

@media (max-width: 580px) {
  body { font-size: 15px; }
  .wrap { padding: 18px 14px 56px; }
  .card { padding: 20px 18px; }
  .grid2 { grid-template-columns: 1fr; }
  .topbar .brandsub { display: none; }
  h1, .pagehead h1 { font-size: 26px; }
  .slotgrid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .rolechip { padding: 6px 10px; letter-spacing: .06em; }
}

/* ============================== Flyer / Einladung ====================== */
.overlay {
  position: fixed; inset: 0; z-index: 70; background: rgba(18,40,32,.42);
  backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center;
  overflow: auto; padding: 32px 18px;
}
.sheet {
  background: var(--card); border-radius: 20px; width: 100%; max-width: 620px;
  box-shadow: var(--shadow-lg); overflow: hidden; margin: auto;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 19px; }
.sheet-x { font: inherit; font-size: 26px; line-height: 1; border: 0; background: transparent; color: var(--muted-2); cursor: pointer; padding: 2px 8px; border-radius: 8px; }
.sheet-x:hover { background: var(--bg-2); color: var(--ink); }
.sheet-body { padding: 22px; background: var(--bg); }
.sheet-foot { display: flex; gap: 12px; padding: 18px 22px; border-top: 1px solid var(--line); }
.sheet-foot .btn { flex: 1; }

.flyer { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.fl-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: linear-gradient(180deg, var(--brand), #2f7d8a); }
.fl-pad { padding: 26px 28px 24px 32px; }
.fl-top { display: flex; align-items: center; justify-content: space-between; }
.fl-brand { display: flex; align-items: center; gap: 10px; }
.fl-brand img { height: 30px; width: 30px; object-fit: contain; }
.fl-brand span { font-family: var(--serif); font-weight: 600; font-size: 18px; color: var(--ink); }
.fl-brand.sm img { height: 22px; width: 22px; }
.fl-brand.sm span { font-size: 15px; }
.fl-title { font-size: 30px; margin-top: 4px; }
.fl-sub { color: var(--muted); font-size: 15.5px; margin-top: 6px; }
.fl-divider { height: 1px; background: var(--line); margin: 22px 0; }
.fl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fl-cell { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 15px; }
.fl-cell-ic { width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand); }
.fl-cell-ic svg { width: 20px; height: 20px; }
.fl-cell-v { font-size: 16px; font-weight: 600; color: var(--ink); margin-top: 2px; }
.fl-book { display: flex; gap: 20px; align-items: center; }
.fl-qr { flex: none; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.fl-qr canvas { display: block; width: 132px; height: 132px; image-rendering: pixelated; }
.fl-book-txt h2 { font-size: 21px; }
.fl-book-txt p { margin: 6px 0 12px; font-size: 14.5px; }
.fl-link { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: var(--brand-strong); background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 9px; padding: 9px 12px; word-break: break-all; }
.fl-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.fl-step { text-align: center; }
.fl-step-num { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; margin: 0 auto 8px; }
.fl-step-lab { font-size: 12.5px; color: var(--ink-soft); }
.fl-cut { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; padding-top: 16px; border-top: 1.5px dashed var(--line-strong); }
.fl-cut-lab { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; }
.fl-cut-url { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--brand-strong); word-break: break-all; text-align: right; }
.fl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px 14px 32px; background: var(--brand-soft); border-top: 1px solid var(--brand-line); font-size: 13px; }

@media (max-width: 560px) {
  .fl-grid { grid-template-columns: 1fr; }
  .fl-book { flex-direction: column; align-items: flex-start; }
  .fl-steps { grid-template-columns: repeat(2, 1fr); }
  .fl-pad { padding: 22px 18px 20px 24px; }
  .sheet-foot { flex-direction: column; }
}

/* ============================== Druckansicht =========================== */
.printonly { display: none; }
.print-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.print-table th, .print-table td { border: 1px solid #999; padding: 6px 9px; text-align: left; font-size: 13px; vertical-align: top; }
.print-table th { background: #eee; }
.print-time { white-space: nowrap; font-weight: 700; width: 70px; }
@media print {
  /* Flyer drucken, falls geöffnet — sonst die Lehrkraft-Terminliste */
  body:has(#flyeroverlay) * { visibility: hidden; }
  body:has(#flyeroverlay) #flyercard, body:has(#flyeroverlay) #flyercard * { visibility: visible; }
  body:has(#flyeroverlay) #flyercard { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; border: 0; }
  body:not(:has(#flyeroverlay)) * { visibility: hidden; }
  body:not(:has(#flyeroverlay)) #printlist, body:not(:has(#flyeroverlay)) #printlist * { visibility: visible; }
  body:not(:has(#flyeroverlay)) #printlist { display: block; position: absolute; left: 0; top: 0; width: 100%; padding: 0; }
  @page { margin: 14mm; }
}

/* ==========================================================================
   SAMMELLINKS  —  Eltern-Auswahlseite (#g=) + Admin-UI
   ========================================================================== */
/* Eltern: Lehrkraft-Auswahl */
.gpick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.teacher-item.gpick { cursor: pointer; }
.teacher-item.gpick:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.teacher-item.gpick:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.gpick-cta { margin-top: 11px; display: inline-flex; align-items: center; gap: 5px; color: var(--brand-strong); font-weight: 600; font-size: 14px; }
.gpick-cta svg { width: 17px; height: 17px; }

/* Admin: Lehrkraft-Auswahl im Gruppen-Editor */
.gchecklist { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px; }
.gcheck { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 9px; cursor: pointer; }
.gcheck:hover { background: var(--brand-soft); }
.gcheck input { width: 17px; height: 17px; flex: none; accent-color: var(--brand); }
.gcheck .pill { vertical-align: middle; }

/* ==========================================================================
   Admin: Reiter der Veranstaltungs-Oberflaeche
   ========================================================================== */
.tabbar { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 18px; border-bottom: 1px solid var(--line); }
.tabbtn { appearance: none; border: none; background: none; font: inherit; font-weight: 600; font-size: 14.5px; color: var(--muted); padding: 9px 15px; border-radius: 9px 9px 0 0; cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; transition: color .15s, background .15s; }
.tabbtn:hover { color: var(--ink); background: var(--brand-soft); }
.tabbtn.active { color: var(--brand-strong); border-bottom-color: var(--brand); }

/* Fächer für Eltern (An/Aus je Fach) */
.fachlist { display: flex; flex-direction: column; gap: 6px; }
.fachrow { display: flex; align-items: center; gap: 12px; padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; transition: border-color .15s, background .15s; }
.fachrow:hover { border-color: var(--brand-line); }
.fachrow.off { background: #f6f8fb; }
.fachrow input { width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
.fachrow .fachname { font-weight: 600; flex: 1; }
.fachrow.off .fachname { color: var(--muted); text-decoration: line-through; }
.fachrow .fachname { cursor: pointer; }
.fachrow .fachcount {
  font: inherit; font-size: 12.5px; color: var(--muted); white-space: nowrap; cursor: pointer;
  background: none; border: 1px solid transparent; border-radius: 999px; padding: 3px 9px;
  transition: background .13s, color .13s, border-color .13s;
}
.fachrow .fachcount:hover { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
.fachrow .fachstate { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); white-space: nowrap; }
.fachrow.off .fachstate { background: var(--warn-soft); color: var(--warn); }
/* Namen der Lehrkräfte eines Fachs (aufklappbar) */
.fachnames { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px 13px 12px; margin-top: -4px; }
.fachnames[hidden] { display: none; }

/* ==========================================================================
   Eltern: Differenzierung (Kurse) auf der Sammellink-Seite
   ========================================================================== */
.blocklabel { font-size: 12.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); margin: 22px 2px 11px; }
.blocklabel:first-child { margin-top: 2px; }
.kurshint { display: flex; align-items: flex-start; gap: 10px; background: var(--warn-soft); border: 1px solid var(--warn-line); color: #6a521b; border-radius: var(--r-md); padding: 11px 14px; font-size: 14px; line-height: 1.5; margin: 0 2px 16px; }
.kurshint svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--warn); }
.fachgrp { margin: 0 0 18px; }
.fachgrp-t { font-size: 16px; font-weight: 650; margin: 0 2px 10px; color: var(--ink); }

/* Kurs-Abzeichen (Differenzierung A/B/C) auf der Eltern-Sammellink-Seite */
.pill.kursbadge { background: var(--brand); color: #fff; font-weight: 700; letter-spacing: .2px; }
