@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-latin-ext.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin-ext.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Gabarito: classdesk's own type (landing, login, teacher area); boards and child pages keep Nunito/Fredoka. */
@font-face { font-family: "Gabarito"; src: url("../fonts/gabarito-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Gabarito"; src: url("../fonts/gabarito-semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Gabarito"; src: url("../fonts/gabarito-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Gabarito"; src: url("../fonts/gabarito-extrabold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Gabarito"; src: url("../fonts/gabarito-black.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --font: "Nunito", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* classdesk CI, as on the landing page: Tafelgrün, Kreide, Signalgelb, coral */
  --bg: #f6f2e9;
  --surface: #ffffff;
  --surface-2: #faf7f1;
  --ink: #0e1f19;
  --muted: #47574f;
  --line: #e3dccd;
  --field-border: #7f8b84; /* borders of inputs: ≥ 3:1 */
  --accent: #123f31;       /* fills only – text uses --accent-text */
  --accent-text: #17604a;
  --accent-ink: #f6f2e9;
  --accent-soft: #e4efe8;
  --sun: #ffcb2e;          /* primary buttons, with --sun-ink */
  --sun-ink: #0e1f19;
  --coral: #e8553b;
  --good: #15803d;         /* fill behind white text */
  --bad-fill: #c42b33;     /* fill behind white text */
  --talk-ink: #9c2a6b;
  --warn: #f2a516;
  --bad: #ec5f67;
  --hit: 44px;             /* minimum hit target (48 px on touch) */
  /* type scale – headings use these, nothing in between */
  --fs-display: 2.25rem; --fs-h1: 1.75rem; --fs-h2: 1.3rem; --fs-h3: 1.1rem; --fs-body: 1rem; --fs-small: .875rem;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(14, 31, 25, .06), 0 8px 24px rgba(14, 31, 25, .07);
  --shadow-lg: 0 2px 6px rgba(14, 31, 25, .08), 0 24px 60px rgba(14, 31, 25, .18);
  /* status colours – every coloured surface uses these, so light and dark both work */
  --ok-bg: #dcf5e8; --ok-ink: #157347; --ok-soft: #f2fbf6; --ok-line: #bfe8d2;
  --bad-bg: #fde3e4; --bad-ink: #b4232c;
  --warn-bg: #fff1d6; --warn-ink: #9a5b00;
  --info-bg: #e6f4ff; --info-ink: #1d6fb8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dash:not(.light-only) {
    --logo-edge: #f6f2e9;
  --bg: #0a1612;
    --surface: #11221c;
    --surface-2: #172c25;
    --ink: #eef3ef;
    --muted: #a9bab2;
    --line: #24392f;
    --field-border: #66847a;
    --accent: #1d6a51;
    --accent-text: #8fd3b4;
    --talk-ink: #f08fc0;
    --accent-soft: #183a2f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 24px 60px rgba(0, 0, 0, .45);
    --ok-bg: #133a2a; --ok-ink: #8de0bd; --ok-soft: #152c25; --ok-line: #23573f;
    --bad-bg: #4a1d24; --bad-ink: #ffb3ba;
    --warn-bg: #42320f; --warn-ink: #f5c26b;
    --info-bg: #13314d; --info-ink: #8cc8ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] .dash:not(.light-only) {
  --logo-edge: #f6f2e9;
  --bg: #0a1612;
  --surface: #11221c;
  --surface-2: #172c25;
  --ink: #eef3ef;
  --muted: #a9bab2;
  --line: #24392f;
  --field-border: #66847a;
  --accent: #1d6a51;
  --accent-text: #8fd3b4;
  --talk-ink: #f08fc0;
  --accent-soft: #183a2f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 24px 60px rgba(0, 0, 0, .45);
  --ok-bg: #133a2a; --ok-ink: #8de0bd; --ok-soft: #152c25; --ok-line: #23573f;
  --bad-bg: #4a1d24; --bad-ink: #ffb3ba;
  --warn-bg: #42320f; --warn-ink: #f5c26b;
  --info-bg: #13314d; --info-ink: #8cc8ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
/* One caret for every dropdown: native arrows sit flush against the rounded edge, so draw our own with room around it.
   !important because component rules set `background`/`padding` shorthands, which would drop the caret or let text run under it.
   Same rule in landing.css for the public pages. */
select:not([multiple]):not([size]) {
  -webkit-appearance: none; appearance: none; padding-right: 2.4em !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f8b84' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right .85em center !important; background-size: .95em !important;
}
.dash h1 { font-size: var(--fs-h1); line-height: 1.2; letter-spacing: -.02em; }
.dash h2 { font-size: var(--fs-h2); line-height: 1.25; }
.dash h3 { font-size: var(--fs-h3); }
.dash small, .muted.small { font-size: var(--fs-small); }
a { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
[hidden] { display: none !important; }
.i { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em; }
.h-ico { width: 1.1em; height: 1.1em; margin-right: .45em; color: var(--accent-text); vertical-align: -0.15em; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: .55em 1.05em; border-radius: 999px; font-weight: 700; cursor: pointer;
  text-decoration: none; transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--sun); border-color: var(--sun); color: var(--sun-ink); }
.btn.primary:hover { box-shadow: 0 0 0 3px rgba(255, 203, 46, .22), 0 8px 20px -10px rgba(255, 190, 0, .55); }
.btn.danger { color: var(--bad-ink); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: .35em .8em; font-size: .9em; }
.btn:disabled { opacity: .5; cursor: default; }

.field { display: grid; gap: .35em; margin-bottom: 1em; }
.field > span { font-weight: 700; font-size: .92em; }
.field small { color: var(--muted); }
.input, .field input, .field select, .field textarea {
  width: 100%; padding: .65em .85em; border-radius: var(--radius-sm);
  border: 1px solid var(--field-border); background: var(--surface-2);
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { min-height: 7em; resize: vertical; }
.toggle { display: flex; align-items: center; gap: .6em; cursor: pointer; font-weight: 600; margin-bottom: .9em; }
.toggle input { width: 1.15em; height: 1.15em; accent-color: var(--accent-text); }

.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.muted { color: var(--muted); }
.error-box { background: var(--bad-bg); color: var(--bad-ink); padding: .7em 1em; border-radius: var(--radius-sm); margin-bottom: 1em; }

/* ---------- dialog ---------- */
dialog {
  border: none; border-radius: 22px; padding: 0; width: min(560px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
dialog.wide { width: min(860px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 22, 18, .45); backdrop-filter: blur(3px); }
dialog form, .dialog-body { padding: 24px; }
dialog h2 { margin: 0 0 .8em; font-size: 1.35em; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6em; margin-top: 1.2em; }

/* ---------- dashboard pages ---------- */
.dash { min-height: 100vh; background: var(--bg); --font: "Gabarito", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", system-ui, -apple-system, "Segoe UI", sans-serif; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 14px clamp(16px, 4vw, 40px);
  position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
}
.brand-mark .i { width: 62%; height: 62%; }
.brand { display: flex; align-items: center; gap: .55em; font-weight: 700; font-size: 1.15em; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; flex: none;
  background: #123f31; color: #f6f2e9;
}
/* The classdesk logo (partials/logo-mark.php): chalkboard on an easel, wordmark with a coral dot. */
svg.brand-mark { background: none; border-radius: 0; }
.brand-word { letter-spacing: -.03em; }
.topbar .brand { font-size: 1.3em; }
.brand-dot { color: var(--coral); }
.main-nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.main-nav a { display: inline-flex; align-items: center; gap: .45em; min-height: 44px; text-decoration: none; color: var(--muted); font-weight: 700; padding: 0 .95em; border-radius: 999px; }
.main-nav a .i { width: 1.1em; height: 1.1em; }
.main-nav a.active, .main-nav a:hover { color: var(--ink); background: var(--surface); }
.main-nav a.active { box-shadow: inset 0 -3px 0 var(--accent); }
.account-menu { position: relative; }
.account-menu summary { list-style: none; display: inline-flex; align-items: center; gap: .45em; min-height: 44px; padding: 0 .8em; border-radius: 999px; cursor: pointer; font-weight: 700; color: var(--muted); }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover, .account-menu[open] summary { background: var(--surface); color: var(--ink); }
.account-menu summary .i:last-child { width: .9em; height: .9em; }
.account-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; display: grid; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 20; }
.account-pop a, .account-pop button { display: flex; align-items: center; gap: .6em; min-height: 44px; padding: 0 .8em; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 700; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; }
.account-pop a:hover, .account-pop button:hover, .account-pop a.active { background: var(--accent-soft); }
.account-pop .account-quiet { font-weight: 600; }
.account-pop .i { flex: none; }
.account-two { display: grid; gap: 1px; padding: 7px 0; line-height: 1.25; }
.account-two small { font-size: var(--fs-small); font-weight: 600; color: var(--muted); }
.account-pop form { margin: 0; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Narrow screens: main areas as a tab bar at the bottom. */
@media (max-width: 900px) {
  .topbar { gap: 8px; backdrop-filter: none; background: var(--bg); } /* backdrop-filter would trap the fixed tab bar */
  .account-menu { margin-left: auto; }
  .account-name { display: none; }
  .main-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; gap: 0; height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .06); }
  .main-nav a { flex: 1; flex-direction: column; justify-content: center; gap: 2px; border-radius: 0; padding: 0 4px; font-size: .75em; position: relative; min-height: 56px; }
  .main-nav a .i { width: 22px; height: 22px; }
  .main-nav a.active { background: none; color: var(--accent-text); box-shadow: inset 0 3px 0 var(--accent); }
  .main-nav .nav-badge { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; }
  .dash:has(.main-nav) main.page { padding-bottom: 96px; }
  .lv-bulk { bottom: calc(64px + env(safe-area-inset-bottom)) !important; }
}
@media (max-width: 420px) { .topbar .brand-name { display: none; } }

main.page { padding: 8px clamp(16px, 4vw, 40px) 64px; max-width: 1240px; margin: 0 auto; }
.hello { margin: 18px 0 28px; }
.hello h1 { font-size: clamp(var(--fs-h1), 4vw, var(--fs-display)); margin: 0; letter-spacing: -.02em; line-height: 1.15; }
.hello p { margin: .3em 0 0; color: var(--muted); font-size: 1.05em; }

.section { margin-bottom: 40px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.3em; }
.section-head .spacer { flex: 1; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.board-card { overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.board-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.board-thumb { aspect-ratio: 16 / 9; position: relative; overflow: hidden; background-size: cover; background-position: center; }
.board-thumb .mini {
  position: absolute; background: rgba(255, 255, 255, .92); border-radius: 6px; box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
  display: grid; place-items: center; overflow: hidden; color: #123f31;
}
.board-thumb .mini .i { width: min(18px, 60%); height: min(18px, 60%); }
.board-meta { padding: 12px 16px 14px; display: flex; align-items: center; gap: 8px; }
/* Names up to two lines (broken at words, hyphenated if needed), only then cut off – the full name is the tooltip. */
.board-meta strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; hyphens: auto; line-height: 1.25; }
.board-meta small { color: var(--muted); }
.board-meta .grow { flex: 1; min-width: 0; }
.icon-btn {
  border: none; background: transparent; width: var(--hit); height: var(--hit); border-radius: 12px; cursor: pointer;
  display: grid; place-items: center; color: var(--muted); font-size: 16px; flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.new-card {
  border: 2px dashed var(--line); background: transparent; box-shadow: none; min-height: 190px;
  display: grid; place-items: center; text-align: center; cursor: pointer; color: var(--muted); font-weight: 800;
  border-radius: var(--radius); transition: border-color .15s, color .15s, background .15s;
}
.new-card:hover { border-color: var(--accent-text); color: var(--accent-text); background: var(--accent-soft); }
.new-card .plus { font-size: 2em; line-height: 1; display: block; margin-bottom: .2em; }

.class-card { padding: 16px 18px; display: flex; gap: 14px; align-items: center; cursor: pointer; transition: box-shadow .15s; }
.class-card:hover { box-shadow: var(--shadow-lg); }
.grade-badge {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-weight: 900; font-size: 1.3em;
  background: var(--accent-soft); color: var(--accent-text); flex: none;
}
.class-card .grow { flex: 1; min-width: 0; }
.class-card strong { font-size: 1.1em; }

.soon-card { padding: 18px; display: flex; gap: 14px; align-items: flex-start; opacity: .85; }
.soon-card .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.soon-card .ico .i { width: 22px; height: 22px; }
.soon-card h3 { margin: 0 0 .2em; font-size: 1.05em; }
.soon-card p { margin: 0; color: var(--muted); font-size: .93em; }
.pill { display: inline-block; font-size: .72em; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: .2em .65em; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }

.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.template-option { position: relative; }
.template-option input { position: absolute; opacity: 0; }
.template-option span {
  display: block; border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; height: 100%;
}
.template-option span b { display: block; }
.template-option span small { color: var(--muted); line-height: 1.3; display: block; margin-top: 2px; }
.template-option input:checked + span { border-color: var(--accent-text); background: var(--accent-soft); }
.template-option input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- timetable editor ---------- */
.tt-editor { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.tt-editor table { border-collapse: collapse; width: 100%; min-width: 640px; }
.tt-editor th { font-size: .8em; color: var(--muted); font-weight: 800; padding: 6px 4px; background: var(--surface-2); }
.tt-editor td { padding: 2px; border-top: 1px solid var(--line); }
.tt-editor input { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 6px 6px; font-size: .9em; text-align: center; }
.tt-editor input:focus { border-color: var(--accent-text); background: var(--surface); }
.tt-editor .time { width: 66px; font-variant-numeric: tabular-nums; color: var(--muted); }
.tt-editor .n { font-weight: 800; color: var(--accent-text); text-align: center; width: 28px; }
.tt-editor .add { padding: 8px; text-align: left; }
.tt-editor td.tt-cell { padding: 3px; }
.tt-editor td.tt-cell input { font-weight: 800; border-radius: 10px; padding: 8px 6px; }
.tt-editor td.filled input {
  background: color-mix(in srgb, var(--sc) 22%, var(--surface)); color: color-mix(in srgb, var(--sc) 45%, var(--ink));
  box-shadow: inset 4px 0 0 var(--sc);
}
.tt-editor td.filled input:focus { border-color: var(--sc); background: color-mix(in srgb, var(--sc) 12%, var(--surface)); }
.tt-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tt-remove { color: var(--muted); }
.tt-remove:hover { color: var(--bad-ink); box-shadow: none; background: var(--surface-2); }
.tt-io { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.tt-io-label { font-size: .78em; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: 4px; }
.tt-io + .csv-box { margin-top: 12px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.csv-box > p { margin: 0 0 8px; }
.csv-box textarea { width: 100%; }
.tt-tip { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0 0; color: var(--muted); font-size: .92em; }
.tt-tip .i { color: var(--accent-text); margin-top: .1em; }
.save-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 18px 0 30px; padding: 10px 18px 10px 10px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); box-shadow: var(--shadow); }
@media (max-width: 900px) { .save-bar { border-radius: var(--radius); bottom: calc(68px + env(safe-area-inset-bottom)); } }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(rgba(246, 242, 233, .09) 1.4px, transparent 1.6px) 0 0 / 22px 22px, #123f31; } /* the board from the landing page */
.login-card { width: min(420px, 100%); padding: 36px 32px 32px; border: 0; border-radius: 28px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .55); }
.login-card .brand { font-size: 1.35em; }
.login-card h1 { margin: .7em 0 .2em; font-size: 1.75em; font-weight: 900; letter-spacing: -.03em; }
.login-card .btn.primary { font-size: 1.05em; }
.login-card .btn { width: 100%; margin-top: .4em; padding: .8em; }
.login-card .check-row, .kd-dialog .check-row { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 12px; font-size: var(--fs-small); color: var(--muted); }
.login-card .check-row input, .kd-dialog .check-row input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent); }

/* ---------- settings ---------- */
/* Einstellungen: Rubriken, darin Karten im Masonry-Stil (Spalten füllen sich lückenlos von oben). */
.settings-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 8px; }
.settings-jump a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: .92em; text-decoration: none; color: var(--ink); }
.settings-jump a:hover { border-color: var(--accent-text); color: var(--accent-text); }
/* Without script: plain grid. settings.js deals the groups into columns, always the shortest next (masonry). */
.settings-masonry { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 30px 26px; align-items: start; margin-top: 22px; }
.settings-masonry.js { display: flex; align-items: flex-start; }
.settings-col { flex: 1; min-width: 0; display: grid; gap: 30px; }
.settings-group { scroll-margin-top: 16px; min-width: 0; }
.settings-group-title { margin: 0; font-size: 1.3em; letter-spacing: -.01em; }
.settings-group-intro { margin: .2em 0 0; }
.settings-grid { display: grid; gap: 16px; margin-top: 12px; }
.settings-grid > .card { padding: 22px 24px; min-width: 0; }
.settings-grid h3 { margin-top: 0; font-size: 1.2em; display: flex; align-items: center; gap: 8px; }
.steps { padding-left: 1.2em; margin: .6em 0 1em; }
.steps li { margin-bottom: .45em; }
code, .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: .1em .4em;
}
.copy-row { display: flex; gap: 8px; align-items: stretch; margin: .6em 0; }
.copy-row input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; }
.notice { background: var(--ok-bg); color: var(--ok-ink); padding: .8em 1em; border-radius: var(--radius-sm); margin: .6em 0; font-size: .95em; }

/* ---------- toasts (stacked top right; own tokens, since they live outside .dash) ---------- */
.toast-stack {
  --t-bg: rgba(255, 255, 255, .86); --t-ink: #0e1f19; --t-muted: #56655d; --t-line: rgba(14, 31, 25, .08);
  --t-shadow: 0 1px 2px rgba(14, 31, 25, .06), 0 12px 32px rgba(14, 31, 25, .14);
  --t-success: #22b07d; --t-error: #e5484d; --t-info: #17604a;
  position: fixed; top: 16px; right: 16px; z-index: 10000; width: min(380px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 10px; pointer-events: none; font-family: var(--font);
  transition: right .25s cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .toast-stack {
    --t-bg: rgba(36, 38, 74, .88); --t-ink: #eceefe; --t-muted: #a3a7cc; --t-line: rgba(255, 255, 255, .08);
    --t-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .45);
    --t-success: #3ccf98; --t-error: #ff6b70; --t-info: #9d8fff;
  }
}
:root[data-theme="dark"] .toast-stack {
  --t-bg: rgba(36, 38, 74, .88); --t-ink: #eceefe; --t-muted: #a3a7cc; --t-line: rgba(255, 255, 255, .08);
  --t-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .45);
  --t-success: #3ccf98; --t-error: #ff6b70; --t-info: #9d8fff;
}
.toast {
  --t-accent: var(--t-info);
  position: relative; overflow: hidden; pointer-events: auto;
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px;
  background: var(--t-bg); color: var(--t-ink); border: 1px solid var(--t-line); border-radius: 16px;
  box-shadow: var(--t-shadow); -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6);
  font-weight: 600; font-size: .95rem; line-height: 1.35;
  animation: toast-in .32s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.success { --t-accent: var(--t-success); }
.toast.error { --t-accent: var(--t-error); }
.toast.out { animation: toast-out .18s ease-in forwards; }
.toast-icon {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  color: var(--t-accent); background: color-mix(in srgb, var(--t-accent) 14%, transparent);
}
.toast-icon .i { width: 18px; height: 18px; }
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-action {
  flex: none; border: 0; border-radius: 999px; padding: .4em .9em; cursor: pointer; font-weight: 800; font-size: .88rem;
  color: var(--t-accent); background: color-mix(in srgb, var(--t-accent) 14%, transparent); transition: background .12s;
}
.toast-action:hover { background: color-mix(in srgb, var(--t-accent) 24%, transparent); }
.toast-close {
  flex: none; display: grid; place-items: center; width: var(--hit); height: var(--hit); margin: -8px -8px -8px 0; border: 0; border-radius: 10px; padding: 0;
  background: none; color: var(--t-muted); cursor: pointer; opacity: .7; transition: opacity .12s, background .12s;
}
.toast-close:hover { opacity: 1; background: var(--t-line); }
.toast-close .i { width: 16px; height: 16px; }
.toast-bar {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left;
  background: var(--t-accent); opacity: .55; animation: toast-bar var(--toast-ms, 2600ms) linear forwards;
}
.toast:hover .toast-bar { animation-play-state: paused; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px) scale(.96); } }
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .toast, .toast.out { animation-name: toast-fade; animation-duration: .15s; }
  @keyframes toast-fade { from { opacity: 0; } }
  .toast.out { animation-name: toast-fade-out; }
  @keyframes toast-fade-out { to { opacity: 0; } }
}

/* ---------- image picker ---------- */
.media-dialog { width: min(900px, calc(100vw - 32px)); }
.media-dialog h2 { margin-bottom: .6em; }
.media-drop {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; cursor: pointer;
  display: grid; justify-items: center; gap: 4px; color: var(--muted); transition: border-color .15s, background .15s;
}
.media-drop .i.big { width: 34px; height: 34px; color: var(--accent-text); }
.media-drop b { color: var(--ink); }
.media-drop:hover, .media-drop.over { border-color: var(--accent-text); background: var(--accent-soft); }
.media-drop.busy { opacity: .6; pointer-events: none; }
.media-drop.busy b::after { content: " – lädt …"; }
.media-scope { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 18px; font-weight: 700; font-size: .92em; }
.media-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.media-head .seg { margin-left: auto; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; max-height: 46vh; overflow: auto; }
.media-empty { grid-column: 1 / -1; padding: 18px; text-align: center; }
.media-item { position: relative; border-radius: 12px; overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 3; }
.media-thumb { border: none; padding: 0; width: 100%; height: 100%; cursor: pointer; background: none; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .15s; }
.media-thumb:hover img { transform: scale(1.05); }
.media-badge { position: absolute; left: 6px; top: 6px; font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.9); color: #4b5072; pointer-events: none; }
.media-badge.lib { background: var(--accent); color: #fff; }
.media-actions { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.media-item:hover .media-actions, .media-item:focus-within .media-actions { opacity: 1; }
.media-actions button { border: none; border-radius: 999px; background: rgba(255,255,255,.95); font-size: 11px; font-weight: 800; padding: 4px 8px; cursor: pointer; display: grid; place-items: center; color: #0e1f19; }
.media-actions button .i { width: 14px; height: 14px; }
.seg button:disabled { opacity: .45; cursor: default; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch { width: var(--hit, 36px); height: var(--hit, 36px); border-radius: 50%; border: 2px solid var(--surface); background: var(--sw); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; position: relative; }
.color-swatch.auto { background: conic-gradient(#5b4bd6, #1a5bc4, #12703a, #b23a0a, #be185d, #5b4bd6); }
.color-swatch.on { box-shadow: 0 0 0 3px var(--accent-text); }
.color-swatch.on::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; color: #fff; text-shadow: 0 0 3px rgba(0,0,0,.6); }
.color-swatch:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.seg button { border: 2px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-weight: 700; cursor: pointer; color: var(--ink); }
.seg button.on { border-color: var(--accent-text); background: var(--accent-soft); color: var(--accent-text); }

/* ---------- board previews & stacks ---------- */
.board-thumb iframe {
  position: absolute; left: 0; top: 0; width: 1440px; height: 810px; border: 0; pointer-events: none;
  transform: scale(var(--k, .19)); transform-origin: 0 0; background: transparent;
}
.board-card { position: relative; }
.board-card.dragging { opacity: .4; }
.dnd .board-card { cursor: grabbing; }
.board-meta .pill { flex: none; }
.board-card a.stretch { color: inherit; text-decoration: none; }
.board-card a.stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.board-card a.stretch:focus-visible { outline: none; }
.board-card:has(a.stretch:focus-visible) { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.board-card .icon-btn, .board-card .lv-check, .board-card .pill { position: relative; z-index: 2; }
.stack { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 14px 16px 16px; margin-bottom: 18px; box-shadow: var(--shadow); }
.stack-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.stack-head .spacer { flex: 1; }
.stack-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.stack-name { font: inherit; font-weight: 800; font-size: 1.1em; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 3px 6px; min-width: 6ch; field-sizing: content; max-width: 50vw; color: var(--ink); }
.stack-name:hover, .stack-name:focus { border-color: var(--line); background: var(--surface-2); }
.stack-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 260px); gap: 14px; overflow-x: auto; padding: 4px 2px 6px; border-radius: 16px; min-height: 120px; }
.stack-row .board-card { box-shadow: none; }
.new-card.small { min-height: 0; }
.drop-over { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: 4px; }
.section-sub { font-weight: 800; color: var(--muted); margin: 6px 0 10px; font-size: .95em; }
.stack-hint { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; font-size: .92em; }
.btn .i { width: 1em; height: 1em; }

/* class cards with task entry */
.class-card { align-items: flex-start; cursor: default; }
.class-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.class-actions .btn .count { background: rgba(255,255,255,.25); border-radius: 999px; padding: 0 7px; font-size: .85em; }
.overdue-pill { font-size: .78em; font-weight: 800; color: var(--bad-ink); background: var(--bad-bg); border-radius: 999px; padding: 2px 9px; }

/* ---------- phone voting page ---------- */
.vote { min-height: 100vh; background: linear-gradient(160deg, #eef0ff 0%, #f5f3ff 50%, #eef7f4 100%); }
.vote-wrap { max-width: 480px; margin: 0 auto; padding: 24px 16px 40px; }
.vote-brand { display: flex; align-items: center; gap: 10px; font-weight: 900; margin-bottom: 18px; }
.vote-card { padding: 24px 20px; text-align: center; }
.vote-card h1 { font-size: 1.5em; margin: .2em 0 .8em; line-height: 1.25; }
.vote-opts { display: grid; gap: 10px; }
.vote-opt {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; font-size: 1.15em; cursor: pointer; text-align: left;
  transition: transform .1s, border-color .1s;
}
.vote-opt:active { transform: scale(.98); }
.vote-opt:hover { border-color: var(--accent-text); }
.vote-opt .emo { font-size: 1.6em; width: 1.4em; text-align: center; }
.vote-opt:disabled { opacity: .6; }
.vote-done { width: 72px; height: 72px; border-radius: 50%; background: var(--good); color: #fff; font-size: 40px; font-weight: 900; display: grid; place-items: center; margin: 0 auto 6px; animation: pop .4s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }
.vote-error { color: var(--bad-ink); font-weight: 700; }
.vote-note { text-align: center; font-size: .85em; margin-top: 16px; }
/* Buzzer on a child's device (/q/KEY): team colours as on the board (white on them ≥ 4.5:1), one huge button. */
.buzz-teams { display: grid; gap: 12px; }
.buzz-team { min-height: 72px; border: 0; border-radius: 16px; background: var(--tc); color: #fff; font: inherit; font-size: 1.4em; font-weight: 900; cursor: pointer; }
.buzz-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.buzz-head b { padding: .25em .9em; border-radius: 999px; background: var(--tc); color: #fff; font-size: 1.2em; }
.buzz-switch { min-height: 44px; border: 0; background: none; color: var(--accent-text); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.buzz-q { font-size: 1.3em; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.buzz-wait { font-size: 1.25em; font-weight: 800; margin: 1em 0; }
.buzz-btn { width: min(78vw, 300px); aspect-ratio: 1; margin: 12px auto; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--tc); color: #fff; font: inherit; font-size: 2.6em; font-weight: 900; letter-spacing: .04em; cursor: pointer; box-shadow: 0 10px 0 color-mix(in srgb, var(--tc) 60%, #000); touch-action: manipulation; }
.buzz-btn:active { transform: translateY(6px); box-shadow: 0 4px 0 color-mix(in srgb, var(--tc) 60%, #000); }
.buzz-btn:disabled { opacity: .7; }
.small { font-size: .85em; }

/* ---------- in-app confirm / prompt ---------- */
/* openDialog(): head with icon, title and close button; body; error; actions */
.kd-dialog { width: min(460px, calc(100vw - 32px)); }
.kd-dialog.wide { width: min(860px, calc(100vw - 32px)); }
.kd-dialog-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.kd-dialog-head h2 { margin: 0; flex: 1; font-size: 1.25em; }
.kd-dialog-x { margin: -8px -8px 0 0; align-self: flex-start; }
.kd-dialog-icon { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.kd-dialog-icon.danger { background: var(--bad-bg); color: var(--bad-ink); }
.kd-dialog-icon .i { width: 22px; height: 22px; }
.kd-dialog .error-box { margin: 12px 0 0; }
.ask-msg { margin: 0; font-size: 1.05em; font-weight: 600; line-height: 1.45; white-space: pre-line; }
.choices { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; max-height: 55vh; overflow: auto; }
.choices legend { font-weight: 700; margin-bottom: 6px; }
.choice { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.choice input { width: 20px; height: 20px; accent-color: var(--accent-text); flex: none; }
.choice span { display: grid; }
.choice small { color: var(--muted); }
.choice:has(input:checked) { border-color: var(--accent-text); background: var(--accent-soft); }
.btn.danger-fill { background: var(--bad-fill); border-color: var(--bad-fill); color: #fff; }
.ask .field { margin-bottom: 0; }

/* ---------- help page ---------- */
.help-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 22px; }
.help-steps .card { display: flex; gap: 14px; padding: 16px 18px; align-items: flex-start; }
.help-steps .card > b { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.help-steps h3 { margin: 0 0 .2em; font-size: 1.02em; }
.help-steps p { margin: 0; color: var(--muted); font-size: .93em; }
.help-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--field-border); border-radius: 12px; padding: 0 14px; color: var(--muted); margin-bottom: 12px; min-height: 48px; }
.help-search input { flex: 1; border: none; background: transparent; outline: none; padding: 11px 0; color: var(--ink); font-size: 1em; }
.help-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.help-toc a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: .9em; }
.help-toc a:hover { border-color: var(--accent-text); color: var(--accent-text); }
.help-section { padding: 20px 24px; margin-bottom: 18px; scroll-margin-top: 80px; }
.help-section h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 .3em; font-size: 1.25em; }
.help-ico { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.help-section h4 { font-size: .78em; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1em 0 .5em; }
.help-examples { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.help-example { width: 100%; text-align: left; display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 12px; padding: 10px 12px; font-weight: 600; cursor: pointer; line-height: 1.4; }
.help-example span { color: var(--muted); opacity: .5; }
.help-example:hover { border-color: var(--accent-text); background: var(--accent-soft); }
.help-example:hover span { opacity: 1; color: var(--accent-text); }
.help-tools { margin: 14px 0 0; font-size: .88em; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.help-tools a { text-decoration: none; }
.help-list { margin: .4em 0 0; padding-left: 1.2em; display: grid; gap: .5em; }
.help-ref { display: grid; gap: 8px; }
.help-tool { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--surface-2); scroll-margin-top: 80px; }
.help-tool summary { cursor: pointer; padding: 10px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 700; }
.help-tool summary span { color: var(--muted); font-weight: 600; }
.help-tool .pill.warn { background: var(--bad-bg); color: var(--bad-ink); }
.help-tool table { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-size: .9em; }
.help-tool td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.help-tool td:first-child { white-space: nowrap; }
.help-tool p { margin: 0 0 10px; }

/* ---------- history ---------- */
.hist-filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.hist-filters select { width: auto; }
.hist-day { font-size: .85em; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 8px; }
.hist-list { display: grid; gap: 8px; }
.hist-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.hist-row .grow { flex: 1; min-width: 0; }
.hist-row.restored { background: var(--surface-2); box-shadow: none; }
.hist-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.hist-label { font-weight: 700; overflow-wrap: anywhere; }
.hist-meta { font-size: .85em; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.hist-src { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; border-radius: 999px; padding: 1px 8px; background: var(--surface-2); }
.hist-src .i { width: 13px; height: 13px; }
.hist-src.src-claude { background: var(--accent-soft); color: var(--accent-text); }
.hist-src.src-beamer { background: var(--info-bg); color: var(--info-ink); }
.hist-info { font-size: .85em; }

/* ---------- class page ---------- */
.class-head { display: flex; align-items: center; gap: 14px; margin: 16px 0 14px; }
.class-back { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); text-decoration: none; }
.class-back:hover { background: var(--surface); color: var(--ink); }
.class-head .grade-badge { width: 56px; height: 56px; font-size: 1.45em; }
.class-head .grade-badge .i { width: 26px; height: 26px; }
.class-title h1 { margin: 0; font-size: clamp(1.5em, 3.5vw, 2.1em); letter-spacing: -.02em; line-height: 1.1; }
.class-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.class-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.class-tabs a:hover { color: var(--ink); }
.class-tabs a.on { color: var(--accent-text); border-bottom-color: var(--accent-text); }
.tab-content { min-height: 300px; }
.panel-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.panel-grid .card, .tab-card { padding: 20px 22px; }
.tab-card h2, .panel-grid h2 { margin: 0 0 .7em; font-size: 1.12em; display: flex; align-items: center; gap: 8px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { display: flex; gap: 12px; align-items: center; padding: 14px 16px; text-decoration: none; color: inherit; transition: box-shadow .15s; }
.stat:hover { box-shadow: var(--shadow-lg); }
.stat .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.stat b { font-size: 1.5em; display: block; line-height: 1; }
.stat span { color: var(--muted); font-size: .88em; font-weight: 700; }
.today-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.today-list li { display: grid; grid-template-columns: 2em 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.today-list li.now { background: var(--accent-soft); font-weight: 800; }
.today-list li.past { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.today-list .n { width: 1.8em; height: 1.8em; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: .85em; }
.today-list li.now .n { background: var(--accent); color: #fff; }
.today-list .t { color: var(--muted); font-size: .88em; font-variant-numeric: tabular-nums; }
.mini-hist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .92em; }
.mini-hist li { display: flex; gap: 8px; justify-content: space-between; }
.mini-hist time { color: var(--muted); white-space: nowrap; }
.danger-zone { border-color: color-mix(in srgb, var(--bad-ink) 35%, transparent); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.csv-box textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; min-height: 120px; }
/* files */
.file-drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; display: grid; justify-items: center; gap: 4px; margin-bottom: 16px; transition: .15s; }
.file-drop:hover, .file-drop.over { border-color: var(--accent-text); background: var(--accent-soft); color: var(--accent-text); }
.file-drop.busy { opacity: .6; pointer-events: none; }
.file-drop .i { width: 30px; height: 30px; }
.file-drop-overlay { position: fixed; inset: 0; z-index: 950; pointer-events: none; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--accent-soft) 75%, transparent); border: 3px dashed var(--accent-text); color: var(--accent-text); }
.file-drop-overlay > div { display: grid; justify-items: center; gap: 8px; padding: 24px 32px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); font-size: 1.15em; text-align: center; }
.file-drop-overlay .i { width: 40px; height: 40px; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.file-card { display: flex; flex-direction: column; overflow: hidden; }
.file-thumb { height: 120px; display: grid; place-items: center; background: var(--surface-2); text-decoration: none; color: var(--muted); font-weight: 900; font-size: 1.2em; letter-spacing: .05em; position: relative; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb .ext { position: absolute; left: 8px; top: 8px; font-size: .62em; background: var(--surface); border-radius: 6px; padding: 2px 6px; color: var(--ink); }
.file-thumb .big { font-size: 1.6em; }
.file-thumb.audio { display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.file-play { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--accent-text); color: var(--surface); cursor: pointer; transition: transform .15s; }
.file-play:hover { transform: scale(1.06); }
.file-play .i { width: 20px; height: 20px; }
.file-wave { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 3px; height: 64px; color: var(--accent-text); cursor: pointer; }
.file-wave.ready > span { flex: 1; min-width: 1px; border-radius: 2px; background: currentColor; opacity: .3; animation: wave-in .3s ease-out both; transition: opacity .15s; }
.file-thumb:not(.active) .file-wave.ready > span { opacity: .7; }
.file-thumb:not(.active):hover .file-wave.ready > span { opacity: .9; }
.file-wave.ready > span.played { opacity: 1; }
@keyframes wave-in { from { transform: scaleY(0); } }
.file-wave:not(.ready) ~ .ext { display: none; }
.file-line { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent-text); transform-origin: left; transform: scaleX(0); }
.file-wave.ready ~ .file-line { display: none; }
.file-time { position: absolute; right: 10px; bottom: 6px; font-size: .62em; font-weight: 700; letter-spacing: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .file-wave.ready > span { animation: none; } }
.ext-pdf { color: var(--bad-ink); } .ext-doc, .ext-docx, .ext-odt { color: #2b5fd9; } .ext-xls, .ext-xlsx, .ext-ods, .ext-csv { color: #1a8a4a; } .ext-ppt, .ext-pptx, .ext-odp { color: #d9682b; }
.file-meta { padding: 10px 12px; display: grid; gap: 4px; }
.file-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta small { color: var(--muted); }
.file-meta .grow { display: grid; }
.file-meta .file-used { justify-self: start; margin-top: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72em; }
.file-actions { display: flex; gap: 4px; padding: 0 8px 8px; }
.file-actions .icon-btn.on { color: var(--accent-text); background: var(--accent-soft); }
.file-thumb .file-shared { position: absolute; right: 8px; top: 8px; font-size: .62em; }
.share-body { display: grid; gap: 12px; justify-items: center; text-align: center; }
.share-body p { margin: 0; }
.share-qr { width: min(240px, 70vw); height: auto; aspect-ratio: 1; image-rendering: pixelated; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.share-link { display: flex; gap: 8px; width: 100%; }
.share-link input { flex: 1; min-width: 0; }
.share-body .form-actions { justify-content: center; flex-wrap: wrap; }

/* ---------- start page ---------- */
.class-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.class-tile { padding: 18px 20px; display: grid; gap: 12px; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.class-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.class-tile-top { display: flex; align-items: center; gap: 14px; }
.class-tile-top strong { font-size: 1.2em; }
.class-tile .go { color: var(--muted); }
.class-tile:hover .go { color: var(--accent-text); }
.class-now { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .92em; border-radius: 10px; padding: 6px 10px; background: var(--surface-2); color: var(--muted); justify-self: start; }
.class-now.now { background: var(--accent-soft); color: var(--accent-text); }
.class-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.class-chips span { display: inline-flex; align-items: center; gap: 5px; font-size: .82em; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 3px 10px; }
.class-chips span.warn { background: var(--bad-bg); color: var(--bad-ink); }
.class-chips .i { width: 14px; height: 14px; }
.class-new { min-height: 150px; }
.collection-tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.collection-tile { display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-decoration: none; color: inherit; transition: box-shadow .15s; }
.collection-tile:hover { box-shadow: var(--shadow-lg); }
.collection-tile .ico { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.collection-tile .count { font-size: 1.4em; color: var(--accent-text); }
.tpl-manage { display: grid; gap: 8px; }
.tpl-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.tpl-row .grow { flex: 1 1 150px; min-width: 0; }
.file-thumb { overflow: hidden; }
.file-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.file-thumb .ext { z-index: 1; }

/* ---------- Förderung (teacher) ---------- */
.sp-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.sp-head h1, .sp-head h2 { margin: 0 0 .2em; display: flex; align-items: center; gap: 8px; }
.sp-head p { margin: 0; max-width: 680px; }
.sp-head .toggle { margin: 0; }
.sp-student { margin-bottom: 22px; }
.sp-student-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sp-student-head h3 { margin: 0; font-size: 1.15em; }
.sp-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 900; flex: none; }
.sp-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.sp-card { padding: 16px 18px; display: grid; gap: 10px; }
.sp-card.archived { background: var(--surface-2); box-shadow: none; }
.sp-card-top { display: flex; justify-content: space-between; gap: 8px; font-size: 1.05em; }
.sp-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-kind { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); position: relative; }
.sp-kind.done { background: var(--ok-bg); color: var(--ok-ink); }
.sp-kind.done::after { content: "✓"; position: absolute; right: -4px; bottom: -4px; width: 15px; height: 15px; border-radius: 50%; background: var(--good); color: #fff; font-size: 10px; display: grid; place-items: center; font-weight: 900; }
.sp-progress { display: flex; align-items: center; gap: 10px; font-size: .85em; font-weight: 700; color: var(--muted); }
.sp-progress .bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.sp-progress .bar i { display: block; height: 100%; background: linear-gradient(90deg, #17604a, #22b07d); border-radius: inherit; }
.sp-last { font-size: .85em; }
/* Actions: equal 2×2 grid at the bottom of the card, so cards side by side line up (odd count: the last one spans). */
.sp-card { display: flex; flex-direction: column; }
.sp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.sp-actions .btn { width: 100%; justify-content: center; margin: 0; }
.sp-actions > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.sp-empty { padding: 24px; }
.sp-share { width: min(520px, calc(100vw - 32px)); }
.sp-print { text-align: center; }
.sp-qr { width: 260px; height: 260px; image-rendering: pixelated; margin: 8px auto; display: block; }
.sp-link { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; word-break: break-all; }
@media print {
  body > *:not(dialog[open]) { display: none !important; }
  dialog.sp-share { position: static; box-shadow: none; width: 100%; }
  .sp-share .dialog-actions { display: none; }
}
.sp-editor { width: min(920px, calc(100vw - 24px)); max-height: calc(100vh - 32px); }
.sp-ed { padding: 20px 24px 22px; }
.sp-ed-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.sp-ed-head h2 { margin: 0; font-size: 1.3em; }
.sp-ed-head > .grow { flex: 1; min-width: 0; }
.sp-ed-head > .sp-ed-x { margin-left: auto; align-self: flex-start; }
/* Labels on top, fields from the same line – the taller textarea must not stretch the title field. */
.sp-ed-meta { display: grid; grid-template-columns: 1fr 2fr; gap: 14px; align-items: start; }
.sp-ed-meta .field textarea { min-height: 0; }
.sp-ed-meta .sp-notes { grid-column: 1 / -1; }
.sp-style { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; margin: 0 0 14px; }
.sp-style .seg button { display: inline-flex; align-items: center; gap: 6px; }
.sp-swatch { width: 14px; height: 14px; border-radius: 50%; background: var(--sw); flex: none; }
.sp-saved { font-size: .85em; color: var(--muted); }
.sp-saved.err { color: var(--bad-ink); font-weight: 700; }
@media (max-width: 700px) { .sp-ed-meta { grid-template-columns: 1fr; } }
.sp-items { list-style: none; padding: 0; margin: 4px 0 14px; display: grid; gap: 8px; }
.sp-item { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.sp-item.open { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.sp-item-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.sp-item-head .grow, .sp-prog .grow { flex: 1; min-width: 0; display: grid; }
.sp-step { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .8em; flex: none; }
.sp-item-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); }
.sp-item-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.sp-item-body .field { margin: 12px 0 0; }
.sp-item-body .copy-row select { flex: 1; min-width: 0; }
.sp-item-body audio, .sp-prev { width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; margin-top: 10px; }
.sp-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 12px; border: 2px dashed var(--line); border-radius: 14px; }
.sp-ed-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.sp-quiz { display: grid; gap: 12px; margin-top: 12px; }
.sp-q { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; background: var(--surface-2); }
.sp-q-head { display: flex; justify-content: space-between; align-items: center; }
.sp-opts { display: grid; gap: 6px; }
.sp-opt { display: flex; gap: 8px; align-items: center; }
.sp-opt input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: var(--surface); }
.sp-opt.ok input { border-color: #22b07d; background: var(--ok-soft); }
.sp-correct { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); cursor: pointer; color: #fff; font-weight: 900; flex: none; }
.sp-opt.ok .sp-correct { background: var(--good); border-color: var(--good); }
.sp-expl { font-size: .9em; }
.sp-prog { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.sp-prog.done { border-color: var(--ok-line); background: var(--ok-soft); }
.sp-prog-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.sp-prog-head p { margin: 0; }
.sp-attempts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sp-attempt { font-size: .8em; font-weight: 800; border-radius: 999px; padding: 2px 9px; background: var(--warn-bg); color: var(--warn-ink); }
.sp-attempt.full { background: var(--ok-bg); color: var(--ok-ink); }
.sp-qdetail { margin-top: 6px; font-size: .9em; }
.sp-qdetail li { margin: 4px 0; }
.sp-qdetail li.ok div { color: var(--ok-ink); } .sp-qdetail li.no div { color: var(--bad-ink); }
.sp-timeline ul { list-style: none; padding: 0; font-size: .88em; display: grid; gap: 4px; }
.sp-timeline time { color: var(--muted); }
.sp-filter { width: auto; }
.pair-input { width: 100%; font-size: 2.2em; font-weight: 900; letter-spacing: .25em; text-align: center; text-transform: uppercase; padding: .3em; border-radius: 16px; border: 2px solid var(--line); background: var(--surface-2); color: var(--ink); margin: .4em 0; font-family: ui-monospace, Menlo, Consolas, monospace; }
.pair-input:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------- quick start (review P1-3) ---------- */
.now-list { display: grid; gap: 10px; margin: -6px 0 26px; }
.now-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.now-banner.live { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.now-banner .grow { flex: 1; display: grid; }
.now-banner strong { font-size: 1.1em; }
.now-banner .grow span { color: var(--muted); font-weight: 700; }
.now-banner .btn { padding: .8em 1.3em; font-size: 1.05em; }
.now-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
.now-banner.live .now-dot { background: #22b07d; box-shadow: 0 0 0 5px color-mix(in srgb, #22b07d 25%, transparent); animation: blink 1.6s infinite; }
.class-tile { cursor: pointer; }
.class-link { text-decoration: none; color: inherit; flex: 1; min-width: 0; display: grid; }
.class-start { flex: none; min-height: 44px; }
@keyframes blink { 50% { opacity: .35; } }

/* ---------- list pattern: filter bar, selection, bulk bar ---------- */
.lv-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.lv-search-wrap { display: flex; align-items: center; gap: 6px; flex: 1 1 220px; min-width: 180px; background: var(--surface-2); border: 1px solid var(--field-border); border-radius: 12px; padding: 0 10px; color: var(--muted); }
.lv-search { flex: 1; min-width: 0; border: none; background: transparent; outline: none; padding: 10px 0; color: var(--ink); min-height: 44px; }
.lv-search-wrap:focus-within { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.lv-filter { display: grid; gap: 3px; font-size: .78em; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lv-select { font: inherit; font-size: 1.25em; text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; min-height: 44px; }
.lv-sort { display: flex; gap: 4px; }
.lv-dir { min-width: 44px; min-height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--field-border); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.lv-spacer { flex: 1; }
.lv-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 40px; margin: 0 2px 12px; }
.lv-all { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; min-height: 40px; }
.lv-all input, .lv-check input { width: 20px; height: 20px; accent-color: var(--accent-text); }
.lv-count { color: var(--muted); font-weight: 700; font-size: .9em; }
.lv-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lv-chip { display: inline-flex; align-items: center; gap: 4px; border: none; background: var(--accent-soft); color: var(--accent-text); border-radius: 999px; padding: 5px 10px 5px 14px; font-weight: 700; cursor: pointer; min-height: 44px; }
.lv-chip .i { width: 14px; height: 14px; }
.lv-reset { border: none; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-weight: 700; min-height: 44px; }
.lv-body { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.lv-body.rows { grid-template-columns: 1fr; gap: 8px; }
.lv-group { grid-column: 1 / -1; margin: 10px 0 0; font-size: 1.05em; }
.lv-item { position: relative; display: flex; min-width: 0; }
.lv-item > :not(.lv-check) { flex: 1; min-width: 0; }
.lv-item.selected > :not(.lv-check), .lv-item.selected > .card { outline: 3px solid var(--accent); outline-offset: -1px; border-radius: var(--radius); }
.lv-check { flex: none; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; border-radius: 12px; }
.lv-check:hover { background: var(--accent-soft); }
/* Rows: fixed column for the checkbox. Cards: the checkbox sits in the card's head row (.card-top). */
.lv-body.rows .lv-item { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 6px; }
.lv-body:not(.rows) .lv-item { flex-direction: column; }
.card-top { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.card-top .grow { flex: 1; min-width: 0; }
body.has-bulk main.page { padding-bottom: 130px; }
.lv-empty { grid-column: 1 / -1; text-align: center; padding: 30px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.lv-empty p { margin: 0 0 10px; font-weight: 700; }
.lv-bulk { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 900; display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; justify-content: flex-start;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 18px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 24px); animation: lv-in .18s ease-out; }
.lv-bulk strong { margin-right: 6px; }
.lv-bulk .btn { min-height: 44px; }
.lv-bulk .btn.ghost { color: var(--bg); }
@keyframes lv-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.sp-card-top { align-items: center; }
.sp-card-top .grow { flex: 1; min-width: 0; display: grid; }
.sp-card-top .pill .i { width: 1.1em; height: 1.1em; vertical-align: -.2em; margin-right: .25em; }
/* "Kind freigeben": who else works with this child. */
.sp-members { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.sp-members li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.sp-members .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sp-avatar.small { width: 30px; height: 30px; font-size: .85em; }
.sp-head { margin-bottom: 6px; }
.sp-share { width: min(720px, calc(100vw - 24px)); }
.sp-tabs { margin-bottom: 14px; }
.sp-embed { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.sp-embed h3 { margin: 0 0 8px; font-size: 1em; }
.sp-embed-grid { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.sp-embed-grid .field { margin-bottom: 8px; }
.sp-qr-small { width: 130px; height: 130px; image-rendering: pixelated; }
@media (max-width: 600px) { .sp-embed-grid { grid-template-columns: 1fr; } }

/* ---------- Feedback & Wünsche ---------- */
.fb-boxes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.fb-box { display: grid; gap: 8px; padding: 10px 16px 14px; }
.fb-box-main { display: flex; gap: 14px; align-items: center; }
.fb-box.closed { background: var(--surface-2); }
.fb-box.closed .fb-qr { filter: grayscale(1); }
.fb-box .grow { flex: 1; display: grid; gap: 6px; }
.fb-box .toggle { margin: 0; }
.fb-qr { width: 104px; height: 104px; image-rendering: pixelated; border-radius: 8px; background: #fff; }
.fb-entry { padding: 14px 16px 12px 56px; display: grid; gap: 8px; }
.fb-entry.unread { border-left: 4px solid var(--accent); }
.fb-entry.talk { border-color: color-mix(in srgb, #d6409f 50%, var(--line)); background: color-mix(in srgb, #d6409f 7%, var(--surface)); }
.fb-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-cat { font-weight: 800; font-size: .85em; border-radius: 999px; padding: 3px 10px; background: var(--accent-soft); color: var(--accent-text); }
.fb-cat.cat-liked { background: var(--ok-bg); color: var(--ok-ink); }
.fb-cat.cat-bother { background: var(--warn-bg); color: var(--warn-ink); }
.fb-cat.cat-talk { background: #d6409f; color: #fff; }
.fb-mood { font-size: 1.3em; }
.fb-text { margin: 0; font-size: 1.05em; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-name { margin: 0; display: flex; gap: 6px; align-items: center; font-weight: 700; color: var(--talk-ink); }
.fb-name .i { width: 16px; height: 16px; }
.fb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.fb-entry audio { width: min(360px, 100%); }
.nav-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #d6409f; color: #fff; font-size: .75em; font-weight: 900; margin-left: 4px; }

/* Search fields whose input has no own border: ring the wrapper. */
.lv-search-wrap:focus-within, .help-search:focus-within, .tb-search:focus-within { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.pill.soft { background: var(--surface-2); color: var(--muted); }
.tpl-ico { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.token-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.token-row .grow { flex: 1; min-width: 0; }

/* Hit targets: every control at least --hit (review P2-10). */
@media (pointer: coarse) { :root { --hit: 48px; } }
.btn { min-height: var(--hit); }
.btn.small { min-height: 40px; }
@media (pointer: coarse) { .btn.small { min-height: var(--hit); } }
.seg button { min-height: var(--hit); }
.toast-action { min-height: 40px; }
.media-actions button { min-height: 36px; min-width: 36px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 52px; }
.pw-toggle { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.pw-hint { display: block; min-height: 1.3em; margin-top: 4px; font-size: .85rem; }
.att-list { display: flex; flex-wrap: wrap; gap: 6px; }
.att-list p { flex-basis: 100%; margin: 6px 0 0; }
.att-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--field-border); background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; }
.att-chip.absent { background: var(--bad-bg); color: var(--bad-ink); border-color: transparent; text-decoration: line-through; }
.att-chip .i { width: 14px; height: 14px; }
.att-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.lvl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }
.lvl-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; border-bottom: 1px solid var(--line); }
.lvl-row select { min-height: 40px; border: 1px solid var(--field-border); border-radius: 10px; background: var(--surface-2); color: var(--ink); padding: 0 8px; }
.journal { display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.journal-row { display: flex; gap: 10px; align-items: flex-start; }
.journal-scale { font-size: 1.4em; line-height: 1; }
.tab-pin-table { border-collapse: collapse; margin: 8px 0; }
.tab-pin-table td { padding: 4px 12px; border-bottom: 1px solid var(--line); }
.tab-pin-table td.pin { font-size: 1.5em; letter-spacing: .2em; }
.notice-warn { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-bg); color: var(--warn-ink); padding: .8em 1em; border-radius: var(--radius-sm); margin: 0 0 16px; font-weight: 600; }
.notice-warn .i { flex: none; margin-top: 2px; }
.journal-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; }
/* Children's texts may be one 500-letter word: wrap anywhere, never widen the page (Delete stays in view). */
.journal-row .grow { min-width: 0; overflow-wrap: anywhere; }
.pill.tone-ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill.tone-warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.tone-bad { background: var(--bad-bg); color: var(--bad-ink); }
.now-banner { flex-wrap: wrap; }
.now-banner .btn.now-att { padding: .6em 1em; font-size: .95em; }

/* Remote control on the phone (/fernbedienung/{board}): one column, big targets. */
.remote { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; display: grid; gap: 14px; }
.remote-head { display: flex; align-items: center; gap: 12px; }
.remote-head h1 { margin: 0; font-size: 1.3em; }
.remote-card h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 1.05em; }
.remote-card.is-hidden { opacity: .7; }
.remote-now { margin: 0 0 6px; font-size: 1.25em; font-weight: 800; }
.remote-time { font-size: 2.2em; font-variant-numeric: tabular-nums; }
.remote-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.remote-row .grow { flex: 1; }
.remote-btn { min-height: 56px; padding: 0 18px; font-size: 1.05em; justify-content: center; }
.remote-btn.small { min-height: 44px; padding: 0 14px; font-size: .95em; }
.remote-queue { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.remote-queue li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.remote-foot { display: flex; justify-content: center; margin-top: 8px; }
.remote-light { gap: 8px; }
.remote-light.on { outline: 3px solid var(--ink); outline-offset: 1px; }
.remote-dot { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.remote-light[data-light="red"] .remote-dot { background: var(--bad); }
.remote-light[data-light="yellow"] .remote-dot { background: var(--warn); }
.remote-light[data-light="green"] .remote-dot { background: var(--good); }
.remote-select { flex: 1; min-height: 56px; font-size: 1.05em; }
.remote-tasks { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.remote-tasks li { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.remote-foot { text-align: center; }

/* ---------- Eltern (teacher page) ---------- */
.pa-classes { margin: 0 0 8px; }
.pa-kind { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .85em; font-weight: 700; background: var(--surface-2, var(--line)); white-space: nowrap; }
.pa-kind.k-letter { background: var(--accent-soft); color: var(--accent-text); }
.pa-kind.k-event { background: var(--warn-bg); color: var(--warn-ink); }
.pa-kind.k-topic { background: var(--ok-bg); color: var(--ok-ink); }
.pa-item { padding: 8px 10px 10px 16px; }
.pa-item.past { opacity: .65; }
.pa-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

/* Areas (Einstellungen → Bereiche, Klasse → Einstellungen) */
.feature-list { display: grid; gap: 4px; }
.feature-toggle { align-items: flex-start; font-weight: 400; margin-bottom: .6em; }
.feature-toggle input { margin-top: .2em; flex: none; }
.feature-toggle input:disabled + span { opacity: .6; }

/* Interessen pro Kind (Klasse → Einstellungen) */
.int-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 10px; }
.int-top:empty { display: none; }
.int-fav { background: var(--surface-2); border-radius: 999px; padding: 2px 10px; font-weight: 700; }
.int-list { display: grid; gap: 2px; }
.int-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.int-name { min-width: 8em; font-weight: 700; }
.int-chosen { flex: 1; display: flex; gap: 4px; font-size: 1.15em; }
.int-tiles { flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; padding: 4px 0 8px; }
.int-tile { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: .9em; font-weight: 600; padding: 6px 10px; cursor: pointer; text-align: left; }
.int-tile span { font-size: 1.25em; }
.int-tile:hover { border-color: var(--accent-text); }
.int-tile.on { background: var(--accent-soft); border-color: var(--accent-text); color: var(--accent-text); }

/* Class settings: cards of different heights in columns without gaps (masonry), reading order top to bottom. */
.card-masonry { columns: 320px 3; column-gap: 18px; margin-bottom: 18px; }
.card-masonry > .card { break-inside: avoid; margin: 0 0 18px; padding: 20px 22px; display: block; width: 100%; }
.card-masonry h2 { margin: 0 0 .7em; font-size: 1.12em; display: flex; align-items: center; gap: 8px; }

/* Subjects across classes (core/subjects.js) – at the timetable in class settings and in the timetable widget. */
.subj-head { display: flex; align-items: center; gap: 8px; font-size: 1em; margin: 22px 0 10px; }
.subj-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; margin-bottom: 8px; }
.subj-row { display: flex; align-items: center; gap: 10px; min-height: var(--hit); }
.subj-row input[type="color"] { width: 36px; height: 36px; padding: 2px; border-radius: 10px; border: 1px solid var(--line); flex: none; cursor: pointer; background: var(--surface); }
.subj-name { font-weight: 700; min-width: 0; flex: 0 1 auto; }
input.subj-name { width: 9em; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 6px; font: inherit; font-weight: 700; color: inherit; }
input.subj-name:hover, input.subj-name:focus { border-color: var(--line); background: var(--surface); }
.subj-label { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.subj-long { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.subj-where { flex: 0 1 auto; max-width: 7em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subj-row.off .subj-name, .subj-row.off .subj-long, .subj-row.off .subj-where { opacity: .5; text-decoration: line-through; }
.subj-row.off input[type="color"] { opacity: .35; }
.subj-row .icon-btn[aria-pressed="true"] { color: var(--muted); }
input.subj-hidden { color: var(--muted) !important; text-decoration: line-through; opacity: .7; }
.tt-plan-lessons { margin-top: 10px; }
.tt-plan-time { width: 3.4em; font-variant-numeric: tabular-nums; }
.tt-plan .subj-list { grid-template-columns: 1fr; }

/* Form checks (core/validate.js): own message under the field instead of the browser bubble */
.field-error { display: flex; gap: .45em; align-items: flex-start; color: var(--bad-ink); font-weight: 600; font-size: .88em; line-height: 1.35; margin-top: .4em; }
.field-error::before { content: "!"; flex: none; display: grid; place-items: center; width: 1.25em; height: 1.25em; border-radius: 50%; background: var(--bad-fill); color: #fff; font-size: .85em; font-weight: 800; margin-top: .05em; }
[aria-invalid="true"]:is(input, select, textarea) { border-color: var(--bad-ink) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad-ink) 22%, transparent); }
.field { align-content: start; }

/* ---------- help & feedback (chat button bottom right, every /app page with the top bar) ---------- */
.contact-fab {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 40;
  width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-lg);
  transition: transform .15s ease;
}
.contact-fab .i { width: 26px; height: 26px; }
.contact-fab:hover { transform: translateY(-2px); }
.contact-fab:active { transform: scale(.95); }
.contact-fab-tip {
  position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); white-space: nowrap; pointer-events: none;
  padding: .35em .75em; border-radius: 999px; background: var(--ink); color: var(--surface); font-size: var(--fs-small); font-weight: 700;
  opacity: 0; transition: opacity .15s ease;
}
.contact-fab:hover .contact-fab-tip, .contact-fab:focus-visible .contact-fab-tip { opacity: 1; }
@media (max-width: 900px) {
  .contact-fab { right: 14px; bottom: calc(68px + env(safe-area-inset-bottom)); width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) { .contact-fab, .contact-fab-tip { transition: none; } .contact-fab:hover { transform: none; } }
@media print { .contact-fab { display: none; } }

.kd-dialog.contact-dialog { width: min(720px, calc(100vw - 32px)); }
.contact-dialog .kd-dialog-head { margin-bottom: 4px; }
.contact-lead { margin: 0 0 16px; color: var(--muted); }
.contact-kinds { border: 0; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.contact-kind {
  position: relative; display: grid; align-content: start; gap: 4px; padding: 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.contact-kind:hover { background: var(--surface-2); }
.contact-kind:has(input:checked) { border-color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-text); }
.contact-kind:has(input:focus-visible) { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.contact-kind b { margin-top: 6px; }
.contact-kind small { color: var(--muted); font-size: var(--fs-small); line-height: 1.3; }
.contact-kind-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.contact-kind-icon .i { width: 20px; height: 20px; }
.k-bug .contact-kind-icon { background: var(--bad-bg); color: var(--bad-ink); }
.k-question .contact-kind-icon { background: var(--info-bg); color: var(--info-ink); }
.k-wish .contact-kind-icon { background: var(--warn-bg); color: var(--warn-ink); }
.k-other .contact-kind-icon { background: var(--ok-bg); color: var(--ok-ink); }
.contact-body { margin-bottom: .5em; }
.contact-meta { margin: 0 0 16px; font-size: var(--fs-small); color: var(--muted); }
.contact-meta summary { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; list-style: none; overflow-wrap: anywhere; }
.contact-meta summary::-webkit-details-marker { display: none; }
.contact-meta summary .i { width: 14px; height: 14px; transition: transform .15s ease; }
.contact-meta[open] summary .i { transform: rotate(90deg); }
.contact-meta p { margin: 4px 0 0 18px; }
.contact-attach { display: grid; justify-items: start; gap: 6px; }
.contact-file-error { margin: 8px 0 0; color: var(--bad-ink); font-size: var(--fs-small); font-weight: 700; }
.contact-files { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.contact-files li { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.contact-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-files small { color: var(--muted); }
.contact-dialog .dialog-actions { align-items: center; }
.contact-keys { margin-right: auto; }
@media (max-width: 640px) {
  .contact-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-keys { display: none; }
}

/* Image from another server (image widget, Lernpaket): who gets contacted, and "Bild in classdesk übernehmen". */
.ext-image-note { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); display: grid; gap: 8px; justify-items: start; }
.ext-image-note p { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-size: .9rem; }
.ext-image-note .i { flex: none; margin-top: 2px; }
