/* Lehrerpult: Screen (Beamer-Dashboard) */

/* Schriften für den Screen (screen/fonts.js), erst geladen, wenn ein Screen sie verwendet */
@font-face { font-family: "Andika"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/screen/andika-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Andika"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/screen/andika-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Playwrite DE Grund"; font-style: normal; font-weight: 100 400; font-display: swap; src: url("../fonts/screen/playwrite-de-grund-wght-normal.woff2") format("woff2-variations"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/screen/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/screen/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/screen/lexend-latin-wght-normal.woff2") format("woff2-variations"); }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/screen/fredoka-latin-wght-normal.woff2") format("woff2-variations"); }
@font-face { font-family: "Patrick Hand"; font-style: normal; font-weight: 400; font-display: swap; size-adjust: 110%; src: url("../fonts/screen/patrick-hand-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Schoolbell"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/screen/schoolbell-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Comic Neue"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/screen/comic-neue-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Comic Neue"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/screen/comic-neue-latin-700-normal.woff2") format("woff2"); }
/* Ersatz für Schriften, die nicht frei sind (installiert verwendet sie der Screen direkt, siehe screen/fonts.js):
   Berner Basisschrift (Peter Wiegel, OFL) für die Deutschschweizer Basisschrift, Didact Gothic für Century Gothic. Etwas
   grösser, damit sie gleich gross wirken wie die übrigen Schriften */
@font-face { font-family: "Berner Basisschrift Screen"; font-style: normal; font-weight: 400 700; font-display: swap; size-adjust: 118%; src: url("../fonts/screen/berner-basisschrift-1.woff2") format("woff2"); }
@font-face { font-family: "Didact Gothic Screen"; font-style: normal; font-weight: 400 700; font-display: swap; size-adjust: 108%; src: url("../fonts/screen/didact-gothic-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("../fonts/screen/literata-latin-wght-normal.woff2") format("woff2-variations"); }

/* «Gewählt» überall im Screen gleich, in der Akzentfarbe der App wie Schalter und Knöpfe im Panel der Einstellungen:
   Knöpfe und Chips als helle Fläche mit dunkler Schrift, Farben und Kacheln mit einem Ring. Leisten und Panel des Screens
   sind immer hell, darum die Werte des hellen Designs (app.css: --accent-soft, --accent-strong, --accent) */
:root { --scr-on: #e2eef1; --scr-on-text: #174a59; --scr-ring: #1f5f73; }
body.screen-mode { overflow: hidden; overscroll-behavior: none; }
.screen-root { position: fixed; inset: 0; }
.screen {
  position: absolute; inset: 0; overflow: clip; user-select: none; -webkit-user-select: none;
  font-family: var(--font); color: #1f2937; background: #222; touch-action: none;
  --w-radius: 16px;
  color-scheme: light;
}
/* Farbthema eines Widgets: alle Widgets verwenden diese Variablen */
.w {
  --w-bg: #ffffff;        /* Hintergrund */
  --w-text: #1f2937;      /* Haupttext */
  --w-muted: #6b7280;     /* Nebentext */
  --w-accent: #4f46e5;    /* Knöpfe, Fortschritt, Hervorhebung */
  --w-accent-text: #ffffff;
  --w-soft: #eef2ff;      /* helle Akzentfläche */
  --w-line: #e5e7eb;      /* Linien, Rahmen, inaktive Flächen */
  --w-surface: #f3f4f6;   /* Knöpfe, Kacheln */
}
.screen-bg { position: absolute; inset: 0; }
.screen-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, var(--bg-dim, 0)); pointer-events: none; }
@keyframes bg-shift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
/* bewegte Hintergründe: jede Ebene rückt um ein Vielfaches ihrer Kachel weiter (nahtlos), die letzte (Verlauf) bleibt */
@keyframes bg-snow { from { background-position: 0 0, 0 0, 0 0, 0 0; } to { background-position: 0 840px, 0 900px, 0 960px, 0 0; } }
@keyframes bg-bubbles { from { background-position: 0 0, 0 0, 0 0; } to { background-position: 0 -1040px, 0 -1080px, 0 0; } }
@keyframes bg-clouds { from { background-position: 0 12%, 0 42%, 0 0; } to { background-position: 900px 12%, 1200px 42%, 0 0; } }
@keyframes bg-stars { from { background-position: 0 0, 0 0, 0 0; } to { background-position: -500px 0, -640px 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .screen-bg, .screen-bg .bg-fade { animation: none !important; } }
/* Diashow: der bisherige Hintergrund blendet aus */
.bg-fade { position: absolute; inset: 0; transition: opacity 1.4s ease; }
.bg-fade.out { opacity: 0; }
/* Schrift des Screens: --font gilt im Board (alle Widgets) und für den Namen oben links */
.board { position: absolute; inset: 0; font-family: var(--font); }
.board-widgets { position: absolute; inset: 0; }

/* Zeichenebene */
.draw-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4000; touch-action: none; }
.screen.drawing .draw-layer { pointer-events: auto; cursor: crosshair; }
.screen.drawing .w { pointer-events: none; }

/* --------------------------------------------------------------- Widgets */

.w {
  position: absolute; display: flex; flex-direction: column; border-radius: var(--w-radius);
  background: var(--w-bg); box-shadow: 0 2px 6px rgba(0,0,0,.12), 0 12px 32px rgba(0,0,0,.16);
  transition: box-shadow .15s;
}
.w.selected { box-shadow: 0 0 0 3px rgba(37, 99, 235, .75), 0 12px 32px rgba(0,0,0,.2); }
.w.dragging { box-shadow: 0 0 0 3px rgba(37, 99, 235, .75), 0 22px 50px rgba(0,0,0,.3); cursor: grabbing; }
.w.dragging, .w.resizing { transition: none; }
.lp-snapshot .w { transition: none; } /* Bild herunterladen: keine halbe Auswahl-Kante */
.w.transparent { background: transparent; box-shadow: none; }
.w.transparent.selected { box-shadow: 0 0 0 2px rgba(37, 99, 235, .6); }

.w-bar {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); height: 34px;
  display: flex; align-items: center; gap: 2px; padding: 0 4px 0 6px;
  background: rgba(255,255,255,.96); border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.18);
  opacity: 0; pointer-events: none; transition: opacity .15s; cursor: grab; z-index: 2;
  font: 600 13px/1 var(--font); color: #374151; min-width: 150px;
}
.w.bar-below .w-bar { bottom: auto; top: calc(100% + 6px); }
.w.bar-right .w-bar { left: auto; right: 0; }
.w.bar-inside .w-bar { bottom: auto; top: 8px; left: auto; right: 8px; width: auto; }
.w.bar-inside .w-bar::before { display: none; }
/* mit der Tastatur: sichtbar, sobald der Fokus auf einem ihrer Knöpfe steht */
.w:hover .w-bar, .w.selected .w-bar, .w-bar:focus-within { opacity: 1; pointer-events: auto; }
.w-grip { color: #8b94a0; display: flex; }
.w-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-spacer { flex: 1; }
.w-btn { border: 0; background: none; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: #4b5563; cursor: pointer; }
.w-btn:hover { background: #f3f4f6; color: #111827; }
.w-body {
  position: relative; flex: 1; min-height: 0; overflow: hidden; border-radius: inherit;
  container-type: size; font-family: var(--font-kids); color: var(--w-text);
}
/* Griffe an allen Kanten und Ecken: aussen breiter als innen (Knöpfe am Rand bleiben klickbar);
   oben und unten reichen sie höchstens 6 px hinaus, dort liegt die Leiste. --rx: wie weit die Ecken seitlich hinausragen */
.w-resize { position: absolute; z-index: 3; --rx: 6px; touch-action: none; }
.w-resize-n, .w-resize-s { left: 0; right: 0; height: 10px; cursor: ns-resize; }
.w-resize-e, .w-resize-w { top: 0; bottom: 0; width: 10px; cursor: ew-resize; }
.w-resize-n { top: -6px; } .w-resize-s { bottom: -6px; } .w-resize-e { right: -6px; } .w-resize-w { left: -6px; }
.w-resize-nw, .w-resize-ne, .w-resize-se, .w-resize-sw { width: calc(var(--rx) + 10px); height: 16px; }
.w-resize-nw { left: calc(-1 * var(--rx)); top: -6px; cursor: nwse-resize; }
.w-resize-ne { right: calc(-1 * var(--rx)); top: -6px; cursor: nesw-resize; }
.w-resize-se { right: calc(-1 * var(--rx)); bottom: -6px; cursor: nwse-resize; }
.w-resize-sw { left: calc(-1 * var(--rx)); bottom: -6px; cursor: nesw-resize; }
/* Markierung nur am ausgewählten Widget: Punkte auf den runden Ecken, Striche in der Mitte der Kanten */
.w-resize::after {
  content: ""; position: absolute; box-sizing: border-box; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2px solid rgba(37,99,235,.9); box-shadow: 0 1px 3px rgba(0,0,0,.25);
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
.w.selected .w-resize::after { opacity: 1; }
.w.dragging .w-resize::after { opacity: 0; }
.w-resize-nw::after { left: calc(var(--rx) - 3px); top: 3px; }
.w-resize-ne::after { right: calc(var(--rx) - 3px); top: 3px; }
.w-resize-se::after { right: calc(var(--rx) - 3px); bottom: 3px; }
.w-resize-sw::after { left: calc(var(--rx) - 3px); bottom: 3px; }
.w-resize-n::after, .w-resize-s::after { width: 22px; height: 7px; border-radius: 4px; left: calc(50% - 11px); }
.w-resize-e::after, .w-resize-w::after { width: 7px; height: 22px; border-radius: 4px; top: calc(50% - 11px); }
.w-resize-n::after { top: 1px; } .w-resize-s::after { bottom: 1px; } .w-resize-e::after { right: 1px; } .w-resize-w::after { left: 1px; }
/* Finger: grössere Griffe */
@media (pointer: coarse) {
  .w-resize { --rx: 14px; }
  .w-resize-n, .w-resize-s { height: 16px; }
  .w-resize-e, .w-resize-w { width: 20px; } .w-resize-e { right: -10px; } .w-resize-w { left: -10px; }
  .w-resize-e::after { right: 5px; } .w-resize-w::after { left: 5px; }
  .w-resize-nw, .w-resize-ne, .w-resize-se, .w-resize-sw { height: 28px; }
}

/* Hilfsklassen für Widget-Inhalte */
.wc-fill { position: absolute; inset: 0; display: flex; flex-direction: column; }
.wc-big { font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.wc-controls { display: flex; gap: 2cqmin; flex-wrap: wrap; justify-content: center; align-items: center; }
.wc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  border: 0; border-radius: 999px; padding: .45em 1em; cursor: pointer; font: 600 clamp(13px, 6cqmin, 34px)/1.1 var(--font);
  background: var(--w-surface); color: var(--w-text); transition: background .12s, transform .08s, filter .12s;
}
.wc-btn:hover { filter: brightness(.95); }
.wc-btn:active { transform: scale(.97); }
.wc-btn.primary { background: var(--w-accent); color: var(--w-accent-text); }
.wc-btn.primary:hover { filter: brightness(1.08); }
.wc-btn.danger { background: #fee2e2; color: #b91c1c; }
.wc-btn.round { padding: .45em; aspect-ratio: 1; }
.wc-btn .icon { width: 1.15em; height: 1.15em; }
.wc-empty { color: var(--w-muted); font: 500 clamp(12px, 4cqmin, 22px)/1.4 var(--font); text-align: center; padding: 1em; }
.wc-input { border: 2px solid var(--w-line); border-radius: 12px; padding: .4em .7em; font: inherit; background: var(--w-bg); color: inherit; }
.wc-input:focus { outline: none; border-color: var(--w-accent); }

/* --------------------------------------------------------------- Bedienelemente des Screens */

.scr-top-left, .scr-top-right { position: absolute; top: 14px; display: flex; gap: 8px; align-items: center; z-index: 4500; }
.scr-top-left { left: 14px; }
.scr-top-right { right: 14px; }
.scr-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 0; display: grid; place-items: center;
  background: rgba(255,255,255,.92); color: #1f2937; box-shadow: 0 2px 8px rgba(0,0,0,.15); cursor: pointer; text-decoration: none;
}
.scr-btn:hover { background: #fff; }
.scr-btn:disabled { opacity: .4; cursor: default; }
.scr-btn.sm { width: 34px; height: 34px; border-radius: 10px; box-shadow: none; background: transparent; }
.scr-btn.sm:hover:not(:disabled) { background: #f3f4f6; }
.scr-guest { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.82); color: #1f2937; font: 600 12px/1.2 var(--font); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.scr-guest .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
/* Handy: nur das Symbol, damit Titel und Menü Platz haben */
@media (max-width: 480px) { .scr-guest { padding: 6px; } .scr-guest .lbl { display: none; } }
.scr-title { border: 0; background: none; font: 650 15px/1 var(--font); color: #1f2937; cursor: pointer; padding: 8px 10px; border-radius: 10px; text-shadow: 0 1px 2px rgba(255,255,255,.6); }
.scr-title:hover { background: rgba(255,255,255,.5); }
/* Titel als Pille wie die Knöpfe daneben: liegt er über einem Widget, bleibt er lesbar und sieht nicht aus wie dessen
   Text; lange Namen gekürzt, damit sie die Knöpfe rechts nicht erreichen */
.scr-top-left .scr-title {
  height: 42px; padding: 0 14px; border-radius: 12px; background: rgba(255,255,255,.92); box-shadow: 0 2px 8px rgba(0,0,0,.15);
  text-shadow: none; max-width: min(420px, calc(100vw - 200px)); overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.scr-top-left .scr-title:hover { background: #fff; }
.scr-top-left .scr-title:empty { display: none; }
.scr-pager {
  position: absolute; right: 14px; bottom: 14px; z-index: 4500; display: flex; align-items: center; gap: 2px; padding: 4px;
  background: rgba(255,255,255,.95); border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.scr-page { border: 0; background: none; font: 650 13px/1 var(--font); padding: 8px 8px; border-radius: 8px; cursor: pointer; color: #374151; min-width: 44px; }
.scr-page:hover { background: #f3f4f6; }
/* Ordner des offenen Screens in der Seitenzahl */
/* über der Seitenzahl, damit sie nicht breiter wird (und die Werkzeugleiste nicht überdeckt) */
.scr-folder { position: absolute; right: 0; bottom: calc(100% + 6px); display: inline-flex; align-items: center; gap: 6px; border: 0; background: rgba(255,255,255,.95); box-shadow: 0 2px 10px rgba(0,0,0,.18); padding: 6px 10px; border-radius: 10px; cursor: pointer; font: 650 12px/1 var(--font); color: #374151; max-width: 220px; }
.scr-folder:hover { background: #fff; }
.scr-folder-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.scr-folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* liegt der Screen in weiteren Ordnern: «+1» (antippen wählt, durch welchen die Pfeile blättern) */
.scr-folder-more { flex: none; padding: 2px 5px; border-radius: 6px; background: #eef0f3; color: #4b5563; font-weight: 650; }
/* Handy: nur der Farbpunkt in der Seitenzahl */
@media (max-width: 600px) { .scr-folder { position: static; box-shadow: none; background: none; padding: 8px 6px; } .scr-folder-name, .scr-folder-more { display: none; } }
/* Screens und Ordner */
.sm-wrap { display: flex; flex-direction: column; gap: 12px; }
.sm-folder { border: 1px solid var(--border, #e5e7eb); border-left: 5px solid var(--sm-color, #cbd5e1); border-radius: 12px; padding: 8px 10px; transition: background .15s; }
.sm-folder.loose { border-left-color: var(--border, #e5e7eb); }
.sm-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 34px; }
.sm-fname { overflow-wrap: anywhere; }
.sm-color { width: 24px; height: 24px; border: 0; padding: 0; background: none; cursor: pointer; flex: none; border-radius: 50%; overflow: hidden; }
.sm-color::-webkit-color-swatch-wrapper { padding: 0; }
.sm-color::-webkit-color-swatch { border: 0; border-radius: 50%; }
.sm-color::-moz-color-swatch { border: 0; border-radius: 50%; }
.sm-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.sm-row { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 2px; border-radius: 8px; background: var(--surface-2, #f9fafb); }
.sm-row.current { box-shadow: inset 0 0 0 2px var(--accent, #4f46e5); }
.sm-grip { color: #8b94a0; cursor: grab; display: grid; place-items: center; flex: none; width: 24px; height: 32px; touch-action: none; }
.sm-row.dragging { box-shadow: 0 4px 14px rgba(0,0,0,.14); position: relative; z-index: 1; }
.sm-row.dragging .sm-grip { cursor: grabbing; }
.sm-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 6px 4px; cursor: pointer; }
.sm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sm-folders { flex: 0 1 auto; min-width: 0; max-width: 200px; min-height: 32px; padding: 4px 8px; gap: 6px; font-weight: 500; }
.sm-folders-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sm-empty { padding: 8px 4px 2px; }
.sm-list:empty { margin-top: 0; }
.sm-list:not(:empty) + .sm-empty { display: none; }
/* Fächer (Screen zur Lektion) und Suche nach Name oder Fach; beim Suchen ruht das Ziehen */
.sm-subject { display: inline-flex; align-items: center; gap: 4px; flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.sm-search { max-width: 340px; }
.sm-wrap.filtering .sm-grip { visibility: hidden; }
.sm-wrap.filtering .sm-empty, .sm-folder.no-hits { display: none; }
@media (max-width: 560px) { .sm-row { flex-wrap: wrap; } .sm-open { flex: 1 1 calc(100% - 30px); flex-wrap: wrap; } .sm-folders { max-width: none; flex: 1; justify-content: flex-start; margin-left: 24px; } .sm-folders-text { flex: 1; text-align: left; } .sm-subject { max-width: none; } .sm-search { max-width: none; } }
/* Papierkorb */
.tr-list { display: flex; flex-direction: column; gap: 6px; }
.tr-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; }
.tr-row > .icon { flex: none; color: var(--text-2, #6b7280); }
.tr-text { flex: 1; min-width: 0; }
.tr-name { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 560px) { .tr-row { flex-wrap: wrap; } .tr-text { flex-basis: calc(100% - 40px); } }

.scr-toolbar-wrap { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 4500; display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: calc(100% - 400px); transition: transform .25s, opacity .25s; }
.scr-toolbar-wrap.hidden { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
/* Vollbild mit Maus (screen.js, updateAutoHide()): unsichtbar, bis die Maus in der Nähe ist oder der Fokus darin steht */
.screen.autohide :is(.scr-top-left, .scr-top-right, .scr-pager, .scr-showbar) { opacity: 0; transition: opacity .25s; }
.screen.autohide .scr-toolbar-wrap:not(.hidden) { opacity: 0; }
.screen.autohide :is(.scr-top-left, .scr-top-right, .scr-pager, .scr-showbar, .scr-toolbar-wrap:not(.hidden)):is(.near, :has(:focus-visible)) { opacity: 1; }
/* Maus ruht im Vollbild (screen.js, wake()): kein Mauszeiger, die Auswahl eines Widgets zeigt weder Rahmen noch Leiste */
.screen.idle, .screen.idle * { cursor: none !important; }
.screen.idle .w.selected { box-shadow: 0 2px 6px rgba(0,0,0,.12), 0 12px 32px rgba(0,0,0,.16); }
.screen.idle :is(.w-bar, .tx-tools, .zch-tools, .tb-tools) { opacity: 0 !important; pointer-events: none !important; }
.screen.idle .w-resize::after { opacity: 0 !important; }
/* Blättern: Widgets kurz aus- und wieder einblenden, der alte Hintergrund überblendet (screen.js, openBoard()) */
.stage { transition: opacity .2s ease; }
.screen.swapping .stage { opacity: 0; transition-duration: .15s; }
.screen-bg.bg-fading { transition: opacity .4s ease; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .stage, .screen-bg.bg-fading { transition: none; } }
.scr-toolbar {
  display: flex; align-items: center; gap: 2px; padding: 6px; background: rgba(255,255,255,.97);
  border-radius: 18px; box-shadow: 0 4px 20px rgba(0,0,0,.22); overflow-x: auto; max-width: 100%;
}
.tb-modes { display: flex; flex-direction: column; gap: 2px; padding-right: 2px; }
.tb-mode { width: 34px; height: 30px; border: 0; border-radius: 8px; background: none; color: #6b7280; cursor: pointer; display: grid; place-items: center; }
.tb-mode.active { background: var(--scr-on); color: var(--scr-on-text); }
.tb-mode .icon { width: 17px; height: 17px; }
.tb-sep { width: 1px; align-self: stretch; background: #e5e7eb; margin: 4px 4px; }
.tb-sep.light { background: #eef0f3; margin: 12px 2px; }
/* Leiste anpassen: Reihenfolge am Griff ziehen */
.bar-item .bar-grip { display: grid; place-items: center; width: 24px; height: 32px; margin-right: 2px; cursor: grab; touch-action: none; color: var(--text-3); }
.bar-item .nav-name .faint { margin-left: 2px; }
/* Handy: der Name bekommt den Platz, die Gruppe fällt weg */
.bar-item .nav-name > span:not(.faint) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .bar-item .nav-name .faint { display: none; } }
.bar-item.dragging { background: var(--surface-2); box-shadow: 0 4px 14px rgba(0,0,0,.12); position: relative; z-index: 1; }
.bar-item.dragging .bar-grip { cursor: grabbing; }
.bar-mode { gap: 4px 8px; align-items: center; flex-wrap: wrap; }
.bar-mode > span { flex: 1 0 auto; } /* lieber den Knopf umbrechen als den Text */
.bar-add { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tb-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 6px 6px; min-width: 66px;
  border: 0; border-radius: 12px; background: none; cursor: pointer; color: #374151;
}
.tb-item:hover { background: #f3f4f6; }
.tb-item .icon { width: 26px; height: 26px; color: #1f2937; stroke-width: 1.7; }
.tb-item span { font: 550 11px/1.1 var(--font); white-space: nowrap; max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
.tb-item.more .icon { color: #4f46e5; }
/* «Mehr», «Rückgängig» und «Leiste ausblenden» bleiben sichtbar, auch wenn die Leiste seitlich scrollt; der Schatten deckt
   rechts den Innenabstand ab */
.tb-end { display: flex; align-items: center; align-self: stretch; position: sticky; right: 0; background: #fff; box-shadow: 6px 0 0 #fff; }
.tb-hide { border: 0; background: none; color: #6b7280; cursor: pointer; padding: 6px; border-radius: 8px; align-self: flex-end; }
.tb-hide:hover { color: #374151; background: #f3f4f6; }
.scr-showbar { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 4500; border: 0; background: rgba(255,255,255,.9); border-radius: 12px 12px 0 0; padding: 4px 22px; cursor: pointer; box-shadow: 0 -2px 8px rgba(0,0,0,.15); }

.more-panel {
  position: absolute; z-index: 4600; width: min(560px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto;
  background: #fff; border-radius: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.3); padding: 12px 14px;
  animation: modal-in .15s ease-out;
}
.more-search { width: 100%; box-sizing: border-box; margin: 0 0 6px; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 10px; background: #f9fafb; color: #111827; font: 500 14px/1.3 var(--font); }
.more-search:focus { outline: 2px solid #2563eb; outline-offset: 0; background: #fff; }
.more-none { margin: 10px 4px; color: #6b7280; font: 500 13px/1.3 var(--font); }
.more-group + .more-group { margin-top: 8px; }
.more-label { font: 700 11px/1 var(--font); text-transform: uppercase; letter-spacing: .07em; color: #6b7280; padding: 6px 4px; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 4px; }
.more-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border: 0; background: none; border-radius: 12px; cursor: pointer; color: #374151; font: 550 12px/1.2 var(--font); }
.more-item:hover, .more-item:focus-visible { background: #f3f4f6; outline: none; }
.more-item .icon { width: 28px; height: 28px; stroke-width: 1.7; color: #1f2937; }
.more-foot { border-top: 1px solid #f3f4f6; margin-top: 8px; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* Kontextmenü (board.js → popupMenu(), auch ausserhalb des Screens nutzbar): sieht aus wie das Menü «…» der App
   (.sb-menu, .sb-action in app.css), kann dazu Häkchen umschalten und Zeilen ziehen */
.popup-menu { position: fixed; z-index: 10050; min-width: 220px; max-width: min(380px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow-y: auto; padding: 6px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); animation: sb-in .12s ease-out; scrollbar-width: thin; font-family: var(--font); }
.popup-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px 9px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; color: inherit; font: inherit; font-size: .93rem; font-weight: 520; }
.popup-item > .icon { color: var(--text-2); }
.popup-item[aria-checked="true"] > .icon { color: var(--accent); }
.popup-item:hover, .popup-item:focus-visible { outline: none; background: var(--surface-3); }
.popup-item.active { font-weight: 650; }
.popup-item.danger, .popup-item.danger > .icon { color: var(--danger); }
.popup-sep { height: 1px; background: var(--border); margin: 5px 8px; }
.popup-label { flex: 1; min-width: 0; }
.popup-grip { display: grid; place-items: center; width: 24px; height: 24px; margin: -4px -4px -4px 0; border-radius: 6px; color: var(--text-3); cursor: grab; touch-action: none; }
.popup-grip:hover { color: var(--text); background: var(--surface-2); }
.popup-item.dragging { background: var(--surface-3); box-shadow: 0 4px 14px rgba(0,0,0,.12); position: relative; z-index: 1; cursor: grabbing; }
.popup-item.dragging .popup-grip { cursor: grabbing; }

/* Einstellungs-Panel */
.ws-panel {
  /* über dem Spotlight (6000), damit die Einstellungen auch dort bedienbar sind; nicht über der Werkzeugleiste */
  position: absolute; z-index: 6100; top: 70px; right: 14px; bottom: 110px; width: min(360px, calc(100vw - 28px));
  background: #fff; border-radius: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.3); display: flex; flex-direction: column; color: #1f2937;
  animation: panel-in .18s ease-out;
  --range-track: #e5e7eb; /* das Panel ist auch im Dunkelmodus hell */
  /* darum auch die Farben der Seiten (Hinweise, Felder, Listen) hell, sonst stünde helle Schrift auf Weiss */
  --text: #1f2937; --text-2: #4b5563; --text-3: #616a76; --surface: #fff; --surface-2: #f9fafb; --surface-3: #f3f4f6;
  --border: #e5e7eb; --border-strong: #d1d5db; --accent: var(--scr-ring); --accent-soft: var(--scr-on); --accent-strong: var(--scr-on-text);
  --accent-text: #fff; --danger: #c0262d; --danger-soft: #fdeceb;
}
/* Handy quer: das Panel über die ganze Höhe */
@media (max-height: 500px) { .ws-panel { top: 8px; bottom: 8px; } }
@keyframes panel-in { from { transform: translateX(12px); opacity: 0; } }
.ws-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 10px 18px; border-bottom: 1px solid #f3f4f6; }
.ws-panel-head h3 { font: 650 16px/1.2 var(--font); }
.ws-panel-body { padding: 8px 18px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.ws-section { display: flex; flex-direction: column; gap: 8px; }
.ws-title { font: 700 11px/1 var(--font); text-transform: uppercase; letter-spacing: .07em; color: #6b7280; margin-top: 10px; }
.ws-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.ws-row > span { color: #374151; }
.ws-switch { font-size: 14px; }
.ws-range { width: 100%; }
/* Schieberegler mit Wert (ui.range mit show): in einer Zeile gleich breit, damit sie untereinander bündig stehen;
   die Bezeichnung bricht nicht um, solange der Regler noch schmaler werden kann */
.ws-range-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ws-range-wrap .ws-range { flex: 1; min-width: 60px; }
.ws-row > .ws-range-wrap { flex: 0 1 180px; min-width: 0; }
.ws-row:has(> .ws-range-wrap) > span:first-child { flex-shrink: 0; max-width: 60%; }
.ws-range-val { min-width: 3.4em; text-align: right; font: 600 13px/1 var(--font); font-variant-numeric: tabular-nums; color: #4b5563; }
.ws-colors { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ws-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(0,0,0,.1); cursor: pointer; padding: 0; }
.ws-color.active { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--scr-ring); }
.ws-color-input { width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.ws-seg { display: inline-flex; background: #f3f4f6; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.ws-seg-btn { border: 0; background: none; padding: 6px 10px; border-radius: 8px; font: 550 13px/1 var(--font); color: #4b5563; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.ws-seg-btn.active { background: #fff; color: #111827; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.ws-list { display: flex; flex-direction: column; gap: 6px; }
.ws-list-row { display: flex; gap: 6px; align-items: center; }
.ws-list-row .input { min-height: 34px; padding: 6px 10px; }
.ws-panel .input, .ws-panel .select, .ws-panel .textarea { background: #fff; color: #1f2937; border-color: #d1d5db; }
/* Knopf für ein Emoji oder Bild (Routine, Ämtliplan, Tagesplan, Material, Link …): in allen Widgets gleich */
.ws-emoji-btn { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; font-size: 22px; line-height: 1; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: inherit; cursor: pointer; }
.ws-emoji-btn:hover { background: var(--surface-3); }

/* Hintergrund-Auswahl */
.bg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bg-grid.colors { grid-template-columns: repeat(7, 1fr); }
.bg-tile { min-width: 0; aspect-ratio: 16 / 10; border-radius: 10px; border: 2px solid rgba(0,0,0,.08); cursor: pointer; position: relative; overflow: hidden; padding: 0; display: flex; align-items: flex-end; }
.bg-tile span { font: 600 11px/1 var(--font); color: #fff; background: rgba(0,0,0,.45); padding: 3px 6px; border-radius: 0 6px 0 0; }
.bg-tile.color { aspect-ratio: 1; border-radius: 50%; }
.bg-tile.active { border-color: var(--scr-ring); box-shadow: 0 0 0 2px var(--scr-ring); }
.bg-color-input { width: 100%; aspect-ratio: 1; border: 0; padding: 0; background: none; cursor: pointer; }
/* Favoriten-Stern auf den Kacheln */
.bg-tile-wrap { position: relative; display: flex; }
.bg-tile-wrap .bg-tile { width: 100%; }
.bg-fav { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; font: 14px/1 var(--font); cursor: pointer; padding: 0; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.bg-tile-wrap:hover .bg-fav, .bg-fav:focus-visible, .bg-fav.on { opacity: 1; }
.bg-fav.on { background: #f59e0b; }
@media (pointer: coarse) { .bg-fav { opacity: .85; } }
/* Diashow */
.bg-show { display: flex; flex-direction: column; gap: 6px; }
.bg-show-thumbs { display: flex; gap: 4px; flex-wrap: wrap; }
.bg-thumb { width: 44px; aspect-ratio: 16 / 10; border-radius: 6px; border: 1px solid rgba(0,0,0,.1); display: block; }
.bg-grid.lib { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.ss-slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ss-slide { border: 1px solid var(--border, #e5e7eb); border-radius: 12px; overflow: hidden; background: var(--surface, #fff); }
.ss-thumb { aspect-ratio: 16 / 10; position: relative; }
.ss-slide-bar { display: flex; align-items: center; gap: 2px; padding: 4px 4px 4px 8px; }
.ss-num { font: 700 12px/1 var(--font); color: var(--text-2, #6b7280); }
.ss-thumb .ss-name { position: absolute; left: 0; bottom: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 11px/1 var(--font); color: #fff; background: rgba(0,0,0,.45); padding: 3px 6px; border-radius: 0 6px 0 0; }
/* Schrift des Screens */
.font-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.font-opt { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; border: 2px solid #e5e7eb; border-radius: 10px; background: #fff; color: #1f2937; padding: 6px 8px; cursor: pointer; }
.font-opt.active { border-color: var(--scr-ring); background: var(--scr-on); }
.font-sample { grid-row: span 2; font-size: 24px; line-height: 1; font-weight: 600; }
.font-name { font-size: 14px; font-weight: 600; line-height: 1.2; overflow: hidden; overflow-wrap: anywhere; } /* «Schreib-maschine» trennen statt abschneiden */
.font-note { font: 500 11px/1.25 var(--font); color: #5b6370; }

/* Stift-Leiste */
.scr-penbar { display: flex; }
.pen-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: rgba(255,255,255,.97); border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,.22); flex-wrap: wrap; justify-content: center; }
.pen-bar.compact { padding: 5px 6px; gap: 4px; box-shadow: none; background: rgba(255,255,255,.9); border-radius: 12px; }
.pen-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.pen-color.active { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--scr-ring); }
.pen-color.saved { border-style: dashed; }
.pen-custom { width: 26px; height: 26px; border: 2px solid rgba(0,0,0,.15); border-radius: 50%; padding: 0; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); cursor: pointer; overflow: hidden; }
.pen-custom::-webkit-color-swatch-wrapper { padding: 0; }
.pen-custom::-webkit-color-swatch { border: 0; border-radius: 50%; opacity: 0; }
.pen-custom::-moz-color-swatch { border: 0; opacity: 0; }
.pen-size { width: 32px; height: 32px; border: 0; background: none; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.pen-size span { display: block; border-radius: 50%; background: #374151; }
.pen-size.active { background: var(--scr-on); }
.pen-tool { border: 0; background: none; height: 32px; min-width: 32px; padding: 0 8px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; color: #374151; font: 600 13px/1 var(--font); }
.pen-tool:hover { background: #f3f4f6; }
.pen-tool.active { background: #fee2e2; color: #b91c1c; }
.pen-tool.hl.active { background: #fef9c3; color: #a16207; }
.pen-tool.done { background: #2563eb; color: #fff; }
.pen-sep { width: 1px; height: 24px; background: #e5e7eb; }
.pen-shape-wrap { position: relative; display: inline-flex; }
.pen-tool.shape { padding: 0 4px 0 6px; gap: 0; }
.pen-tool.shape.active { background: var(--scr-on); color: var(--scr-on-text); }
.pen-tool.shape .icon.sm { width: 12px; height: 12px; opacity: .6; }
.pen-shapes { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); display: flex; gap: 2px; padding: 4px; background: #fff; border-radius: 12px; box-shadow: 0 4px 18px rgba(0,0,0,.22); z-index: 5; }
.pen-shapes[hidden] { display: none; }
.pen-shapes .pen-tool.active { background: var(--scr-on); color: var(--scr-on-text); }

/* Auswahl-Dialoge (Emoji, Bilder) */
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 4px; max-height: 50vh; overflow-y: auto; }
.emoji-btn { font-size: 28px; line-height: 1; padding: 8px 0; border: 0; background: none; border-radius: 10px; cursor: pointer; }
.emoji-btn:hover { background: var(--surface-3, #f3f4f6); }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 50vh; overflow-y: auto; }
.image-tile { aspect-ratio: 4 / 3; border: 2px solid var(--border, #e5e7eb); border-radius: 10px; padding: 0; overflow: hidden; cursor: pointer; background: var(--surface-2, #fafafa); }
.image-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-tile:hover { border-color: var(--accent, #2563eb); }
.image-tile-wrap { position: relative; }
/* Bilder hierher ziehen (Bild-Auswahl) */
.image-drop { border: 2px dashed transparent; border-radius: 12px; padding: 6px; margin: -6px; transition: border-color .15s, background .15s; }
.image-drop.drag { border-color: var(--accent, #2563eb); background: color-mix(in srgb, var(--accent, #2563eb) 7%, transparent); }
.image-tile-wrap .image-tile { width: 100%; }
.image-del { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px;
  background: rgba(255, 255, 255, .92); color: var(--danger, #dc2626); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); cursor: pointer; opacity: 0; transition: opacity .15s; }
.image-tile-wrap:hover .image-del, .image-del:focus-visible { opacity: 1; }
@media (hover: none) { .image-del { opacity: 1; } }
/* eigenes Bild statt Emoji (Checkliste, Routine): so gross wie ein Emoji in der gleichen Schrift */
.w-symbol { display: block; width: 1.2em; height: 1.2em; margin: auto; object-fit: contain; border-radius: .12em; }

/* schmalere Fenster: Leiste ohne Beschriftung, damit sie nicht unter die Seitenzahl rechts läuft */
@media (max-width: 1400px) {
  .tb-item { min-width: 50px; padding: 8px 5px; }
  .tb-item span { display: none; }
}
/* schmalere Bildschirme: Leiste fast volle Breite (sonst bleiben nur wenige Hundert Pixel); im Hochformat des Handys
   über dem Seitenwähler, weil daneben kein Platz ist */
@media (max-width: 1100px) {
  .scr-toolbar-wrap { max-width: calc(100% - 16px); bottom: 64px; }
  .scr-pager { bottom: 10px; right: 10px; }
  .tb-item { min-width: 54px; }
  .tb-item span { display: none; }
}
/* Handy quer und Tablet: Leiste links neben dem Seitenwähler, beide unten in einer Zeile (--pager-w aus screen.js);
   die Fläche neben der Leiste lässt Klicks zu den Widgets durch */
@media (min-width: 601px) and (max-width: 1100px) {
  .scr-toolbar-wrap { left: 8px; right: calc(var(--pager-w, 170px) + 18px); bottom: 10px; max-width: none; transform: none; pointer-events: none; }
  .scr-toolbar-wrap > * { pointer-events: auto; }
  .scr-toolbar-wrap.hidden { transform: translateY(140%); }
  .scr-folder { max-width: 100%; } /* Ordner über der Seitenzahl nicht breiter als sie, sonst über der Leiste */
}

/* --------------------------------------------------------------- Bühne, Spotlight, Fixieren, Themen */
.stage { position: absolute; inset: 0; }
.board { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.stage.fixed .board { box-shadow: 0 0 0 2px rgba(255,255,255,.55), 0 0 0 9999px rgba(0,0,0,.18); border-radius: 4px; }
/* Handy hochkant: Bitte, es quer zu halten, unter dem Streifen in Beamerform (Lage setzt screen.js) */
.scr-upright { position: absolute; left: 16px; right: 16px; z-index: 4400; display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 14px; border-radius: 14px;
  background: rgba(255,255,255,.94); color: #1f2937; font: 500 14px/1.35 var(--font); box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.scr-upright > .icon { flex: none; color: #4f46e5; animation: scr-turn 2.4s ease-in-out .6s 2; }
.scr-upright .grow { flex: 1; }
.scr-upright-x { flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: #6b7280; display: grid; place-items: center; cursor: pointer; }
.scr-upright-x:hover { background: #f3f4f6; color: #111827; }
@keyframes scr-turn { 0%, 35% { transform: rotate(0); } 60%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .scr-upright > .icon { animation: none; } }
.spot-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); z-index: 5900; backdrop-filter: blur(2px); }
.w.spotlight { box-shadow: 0 20px 80px rgba(0,0,0,.45); transition: left .2s, top .2s, width .2s, height .2s; }
/* Hilfslinien beim Verschieben und Vergrössern (Screen-Einstellungen → Hilfslinien) */
.snap-guides { position: absolute; inset: 0; pointer-events: none; z-index: 7000; }
.snap-line { position: absolute; background: #ec4899; box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); border-radius: 1px; }
.snap-line.v { width: 2px; margin-left: -1px; }
.snap-line.h { height: 2px; margin-top: -1px; }
/* «Widgets anordnen»: verschobene Widgets gleiten an ihren neuen Platz */
.board.arranging .w { transition: box-shadow .15s, left .35s ease, top .35s ease, width .35s ease, height .35s ease; }
.w.spotlight .w-resize { display: none; }
/* Werkzeugleisten von Text und Zeichnung im Spotlight innen (aussen ist kein Platz) */
.w.spotlight .tx-tools.show { top: 8px; left: 8px; transform: none; }
.w.spotlight .zch-tools, .w.spotlight .zch-tools.above { top: auto; bottom: 10px; transform: translateX(-50%); }
/* Meldungen im Screen oben in der Mitte (unten liegen Werkzeugleiste und Seitenzahl) */
.screen-mode .toasts { top: 18px; bottom: auto; right: auto; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(420px, calc(100vw - 32px)); }
/* Referentenansicht: Meldungen unten über der Leiste, damit Beamer-Status, «läuft seit» und Uhr oben frei bleiben */
.screen-mode:has(.pv) .toasts { top: auto; bottom: 96px; }
@media (max-width: 640px) { .screen-mode .toasts { top: 66px; } }
/* wenig Rand im Spotlight: die Titelleiste erscheint innen oben rechts */
.w.spotlight .w-bar { bottom: auto; top: 8px; left: auto; right: 8px; width: auto; }
/* Im Spotlight erscheint die Titelleiste nur beim Darüberfahren */
.w.spotlight:not(:hover) .w-bar { opacity: 0; pointer-events: none; }
.w.spotlight .w-bar:focus-within { opacity: 1; pointer-events: auto; }
/* Unsichtbare Brücke über den Spalt, damit die Leiste beim Hinfahren nicht verschwindet */
.w-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 6px; }
.w.bar-below .w-bar::before { top: auto; bottom: 100%; }
.w-lock, .w-pin { display: none; }
.w.locked .w-lock { display: grid; color: #b45309; }
.w.locked .w-resize { display: none; }
.w.locked .w-bar { cursor: default; }
.w.pinned .w-pin { display: flex; color: #4f46e5; margin-left: 4px; }
.w.glass { backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2); }
.w.theme-dark .w-body { color: var(--w-text); }
.tb-right { display: flex; flex-direction: column; justify-content: space-between; align-self: stretch; padding-left: 2px; }
/* Handy hochkant: Einstellungen eines Widgets enden über der Werkzeugleiste (die liegt dort über der Seitenzahl) */
@media (max-width: 600px) { .ws-panel { bottom: 170px; } }

.theme-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.theme-tile { aspect-ratio: 1; border-radius: 10px; border: 2px solid rgba(0,0,0,.08); cursor: pointer; position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; padding: 6px; }
.theme-tile.checker { background: repeating-conic-gradient(#e5e7eb 0 25%, #ffffff 0 50%) 0 0 / 10px 10px; }
.theme-tile .theme-line { width: 80%; height: 4px; border-radius: 4px; background: var(--tt-text); }
.theme-tile .theme-dot { width: 45%; height: 4px; border-radius: 4px; background: var(--tt-accent); }
.theme-tile.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--scr-ring); }
.ws-own { display: flex; flex-direction: column; gap: 10px; }
/* eigene Farbthemen */
.theme-own { position: relative; }
.theme-own .theme-tile { width: 100%; }
.theme-edit { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid #d1d5db; background: #fff; color: #374151; font: 600 12px/1 var(--font); cursor: pointer; padding: 0; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.theme-tile.theme-add { background: #f9fafb; border-style: dashed; border-color: #cbd5e1; color: #64748b; font: 600 22px/1 var(--font); align-items: center; justify-content: center; }
.te-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 18px; align-items: start; }
@media (max-width: 640px) { .te-grid { grid-template-columns: 1fr; } }
.te-row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 8px; }
.te-label { font-size: 14px; color: var(--text-2, #4b5563); }
.te-field { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.te-color { width: 40px; height: 36px; border: 1px solid var(--border, #d1d5db); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.te-hex { width: 96px !important; font-family: ui-monospace, monospace; text-transform: lowercase; }
.te-hex.invalid { border-color: #dc2626; }
.te-pick, .ws-color-pick { width: 32px; height: 32px; border-radius: 8px; border: 1px solid #d1d5db; background: #fff; color: #374151; cursor: pointer; display: grid; place-items: center; padding: 0; }
.ws-color-pick { width: 28px; height: 28px; border-radius: 50%; }
.te-saved { display: flex; gap: 4px; flex-wrap: wrap; }
.te-swatch { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.te-starts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.te-start { border: 2px solid; border-radius: 8px; padding: 6px 10px; font: 600 12px/1 var(--font); cursor: pointer; }
.te-preview-wrap { position: relative; }
.w.te-preview { position: relative; inset: auto; min-height: 170px; padding: 18px; gap: 8px; border-radius: 16px; color: var(--w-text); }
.te-prev-title { font: 700 22px/1.2 var(--font); color: var(--w-text); }
.te-prev-muted { font: 500 14px/1.3 var(--font); color: var(--w-muted); }
.te-prev-row { display: flex; gap: 8px; margin-top: auto; }
.te-prev-btn { background: var(--w-accent); color: var(--w-accent-text); border-radius: 10px; padding: 8px 14px; font: 650 14px/1 var(--font); }
.te-prev-chip { background: var(--w-soft); color: var(--w-text); border: 1px solid var(--w-line); border-radius: 10px; padding: 8px 14px; font: 600 14px/1 var(--font); }
.ws-color.saved { border-style: dashed; }
.ws-color-sep { width: 1px; height: 22px; background: #e5e7eb; margin: 0 2px; }

/* Verschwommen (Taste 1) */
.scr-blur { position: absolute; inset: 0; z-index: 9000; backdrop-filter: blur(28px) saturate(.9); -webkit-backdrop-filter: blur(28px); background: rgba(255,255,255,.18); display: flex; align-items: flex-end; justify-content: center; cursor: pointer; }
.scr-blur-hint { margin-bottom: 30px; font: 600 14px/1 var(--font); color: rgba(0,0,0,.45); background: rgba(255,255,255,.6); padding: 8px 14px; border-radius: 99px; }
.scr-drop { position: absolute; inset: 16px; z-index: 8000; border: 4px dashed rgba(255,255,255,.9); border-radius: 24px; background: rgba(79, 70, 229, .25); display: flex; align-items: center; justify-content: center; gap: 12px; font: 700 28px/1 var(--font); color: #fff; pointer-events: none; text-shadow: 0 2px 8px rgba(0,0,0,.3); }
.scr-drop .icon { width: 40px; height: 40px; }

/* Vorlagen für neue Screens */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tpl-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border: 2px solid var(--border, #e5e7eb); border-radius: 14px; background: var(--surface, #fff); color: inherit; cursor: pointer; text-align: left; font: inherit; }
.tpl-tile .icon { width: 26px; height: 26px; color: var(--accent, #4f46e5); }
.tpl-tile span { font-size: .82rem; color: var(--text-2, #6b7280); line-height: 1.35; }
.tpl-tile.active { border-color: var(--accent, #4f46e5); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #4f46e5) 20%, transparent); }
.tpl-own { position: relative; }
.tpl-own strong { overflow-wrap: anywhere; }
.tpl-own-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 2px; }

/* Beim Verschieben und Grössenändern dürfen eingebettete Seiten die Maus nicht abfangen */
.board-widgets:has(.w.dragging, .w.resizing) iframe { pointer-events: none; }

/* Screen zur Lektion: Fächer in den Screen-Einstellungen, Hinweis beim Lektionsbeginn */
.scr-subjects { display: flex; flex-wrap: wrap; gap: 6px; }
.scr-subject { border: 1px solid #e5e7eb; background: #fff; border-radius: 999px; padding: 4px 11px; font: 600 13px/1.3 var(--font); color: #374151; cursor: pointer; }
.scr-subject small { font-weight: 500; color: #6b7280; }
.scr-subject.on { background: var(--scr-on); border-color: var(--scr-ring); color: var(--scr-on-text); }
.scr-lesson-bar { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 6000; display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(420px, calc(100% - 32px));
  padding: 8px 8px 8px 14px; border-radius: 14px; background: rgba(255,255,255,.97); color: #1f2937; box-shadow: 0 10px 30px rgba(0,0,0,.25); font: 600 14px/1.3 var(--font); }
.scr-lesson-bar > span { min-width: 0; }
.pv > .scr-lesson-bar.pv-lesson-bar { position: fixed; top: 64px; border: 1px solid var(--border); }

/* Beispiel-Screen für neue Besucher (intro.js): Marke, «Zugang anfragen», Begrüssung, Hinweise; bewusst in den Farben der Startseite */
.scr-brand { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 7px; border-radius: 16px; background: rgba(255,255,255,.94);
  box-shadow: 0 6px 22px rgba(15,23,42,.14); font: 600 14px/1 var(--font); color: #1c2430; }
.scr-brand-logo { width: 32px; height: 32px; border-radius: 9px; }
.scr-brand-name { font-weight: 750; font-size: 16px; letter-spacing: -.01em; }
.scr-brand-tag { padding: 5px 10px; border-radius: 999px; background: #fdf0dc; color: #a35a06; font-size: 12px; font-weight: 700; }
.scr-brand-more { display: inline-flex; align-items: center; gap: 5px; padding: 8px 11px; border-radius: 11px; color: #1f5f73; text-decoration: none; font-size: 13.5px; }
.scr-brand-more:hover { background: #e2eef1; }
.scr-request { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 16px; border-radius: 12px; background: #f4a63d; color: #3b2203;
  font: 700 14px/1 var(--font); text-decoration: none; white-space: nowrap; box-shadow: 0 6px 18px rgba(244,166,61,.45); }
.scr-request:hover { background: #f09a24; }
@media (max-width: 900px), (max-height: 500px) {
  .scr-brand-more, .scr-brand-tag { display: none; }
  .scr-brand { padding: 5px 10px 5px 5px; } .scr-brand-logo { width: 28px; height: 28px; } .scr-brand-name { font-size: 14.5px; }
}
@media (max-width: 480px), (max-height: 500px) { .scr-request span { display: none; } .scr-request { width: 42px; padding: 0; justify-content: center; } }

.scr-intro { position: fixed; inset: 0; z-index: 7000; display: grid; place-items: center; padding: 16px; background: rgba(15,32,40,.42); backdrop-filter: blur(3px); }
.scr-intro-card { width: min(600px, 100%); max-height: 100%; overflow: auto; border-radius: 26px; background: #fff; box-shadow: 0 30px 80px rgba(8,24,32,.45);
  font-family: var(--font); color: #1c2430; }
.scr-intro-head { position: relative; overflow: hidden; padding: 26px 30px 24px; color: #fff; background: linear-gradient(150deg, #2a7a91 0%, #1d5a6c 55%, #163f4e 100%); }
.scr-intro-head::before { content: ""; position: absolute; top: -46px; right: -40px; width: 150px; height: 150px; border-radius: 50%; background: #f4a63d; box-shadow: 0 18px 60px rgba(244,166,61,.35); }
.scr-intro-logo { position: relative; display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-weight: 700; font-size: 17px; }
.scr-intro-logo-img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 6px 16px rgba(0,0,0,.22), 0 0 0 1px rgba(255,255,255,.18); }
.scr-intro-head h2 { position: relative; margin: 0 0 8px; color: #fff; font-size: 30px; line-height: 1.1; letter-spacing: -.02em; }
.scr-intro-head h2 span { color: #f6b85c; }
.scr-intro-head p { position: relative; margin: 0; max-width: 470px; font-size: 15.5px; line-height: 1.5; color: rgba(255,255,255,.88); }
.scr-intro-body { display: grid; gap: 16px; padding: 22px 30px 8px; }
.scr-intro-row { display: flex; gap: 14px; align-items: flex-start; }
.scr-intro-ic { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 13px; background: #e2eef1; color: #1f5f73; }
.scr-intro-ic .icon { width: 22px; height: 22px; }
.scr-intro-row h3 { margin: 2px 0 3px; font-size: 15.5px; }
.scr-intro-row p { margin: 0; color: #586371; font-size: 14px; line-height: 1.45; }
.scr-intro-note, .scr-intro-phone { display: flex; align-items: center; gap: 8px; margin: 6px 30px 0; padding: 10px 12px; border-radius: 12px; background: #f4f6f8; color: #586371; font-size: 13px; line-height: 1.4; }
.scr-intro-phone { display: none; background: #fdf0dc; color: #7a4204; }
.scr-intro-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 18px 30px 0; }
.scr-intro-go { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 22px; border: 0; border-radius: 13px; background: #f4a63d; color: #3b2203;
  font: 750 16px/1 var(--font); cursor: pointer; box-shadow: 0 8px 22px rgba(244,166,61,.45); }
.scr-intro-go:hover { background: #f09a24; }
.scr-intro-more { display: inline-flex; align-items: center; height: 48px; padding: 0 16px; border-radius: 13px; background: #e2eef1; color: #1f5f73; font: 650 14.5px/1 var(--font); text-decoration: none; }
.scr-intro-mail { margin: 0; padding: 14px 30px 22px; color: #616a76; font-size: 13px; white-space: nowrap; }
.scr-intro-mail a { color: #1f5f73; font-weight: 650; text-decoration: none; }
@media (max-width: 560px) {
  .scr-intro { place-items: end center; padding: 0; }
  .scr-intro-card { border-radius: 24px 24px 0 0; }
  .scr-intro-head { padding: 20px 22px 18px; } .scr-intro-head h2 { font-size: 25px; } .scr-intro-head p { font-size: 14.5px; }
  .scr-intro-head::before { top: -70px; right: -70px; width: 130px; height: 130px; }
  .scr-intro-logo { margin-bottom: 12px; }
  .scr-intro-body { gap: 12px; padding: 16px 22px 4px; } .scr-intro-ic { width: 38px; height: 38px; border-radius: 11px; }
  .scr-intro-row h3 { font-size: 14.5px; } .scr-intro-row p { font-size: 13.5px; }
  .scr-intro-note, .scr-intro-phone { margin: 6px 22px 0; }
  .scr-intro-phone { display: flex; margin-top: 10px; }
  .scr-intro-foot { flex-direction: column; align-items: stretch; padding: 14px 22px 0; } .scr-intro-go, .scr-intro-more { justify-content: center; height: 46px; }
  .scr-intro-mail { padding: 12px 22px 20px; text-align: center; white-space: normal; }
}
@media (max-height: 500px) and (min-width: 561px) {
  .scr-intro-head { padding: 16px 26px 14px; } .scr-intro-logo { display: none; } .scr-intro-head h2 { font-size: 24px; margin-bottom: 4px; } .scr-intro-head p { font-size: 14px; }
  .scr-intro-body { gap: 8px; padding: 12px 26px 0; } .scr-intro-row { align-items: center; } .scr-intro-row p { display: none; }
  .scr-intro-ic { width: 34px; height: 34px; border-radius: 10px; } .scr-intro-row h3 { margin: 0; font-size: 14.5px; }
  .scr-intro-note { margin: 10px 26px 0; padding: 8px 12px; } .scr-intro-foot { padding: 12px 26px 0; } .scr-intro-go, .scr-intro-more { height: 42px; }
  .scr-intro-mail { padding: 10px 26px 14px; }
}

.scr-tip { position: fixed; z-index: 4600; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: #1c2430; color: #fff;
  font: 600 14px/1.3 var(--font); white-space: nowrap; box-shadow: 0 10px 28px rgba(15,23,42,.28); pointer-events: none; }
.scr-tip b { color: #f6b85c; font-weight: 750; }
.scr-tip-n { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; background: #f4a63d; color: #3b2203; font-size: 13px; font-weight: 800; }
.scr-tip::after { content: ""; position: absolute; left: var(--ax, 50%); width: 14px; height: 14px; margin-left: -7px; background: #1c2430; transform: rotate(45deg); }
.scr-tip.down::after { bottom: -6px; }
.scr-tip.up::after { top: -6px; }
.scr-tip-ring { position: fixed; z-index: 4599; border-radius: 999px; box-shadow: 0 0 0 4px rgba(244,166,61,.95), 0 0 0 12px rgba(244,166,61,.28); pointer-events: none; }

/* --------------------------------------------------------------- Finger (Handy, Tablet) */
/* Bedienelemente des Screens gross genug zum Antippen (mindestens 44 px, die Leiste über dem Widget 40 px); am Schluss,
   damit es die Grössen weiter oben übersteuert */
@media (pointer: coarse) {
  .w-bar { height: 44px; min-width: 190px; }
  .w-btn { flex: none; width: 40px; height: 40px; border-radius: 9px; }
  .scr-btn, .scr-btn.sm { width: 44px; height: 44px; }
  .scr-title, .scr-page, .popup-item { min-height: 44px; }
  .scr-showbar { padding: 10px 26px; }
  .tb-mode { width: 40px; height: 36px; }
  .tb-hide { padding: 10px; }
  .ws-color, .pen-color, .pen-custom { width: 32px; height: 32px; }
}

/* ---------------------------------------------------------------- Präsentieren (present.js, beamer.js) */
/* Knopf «Präsentieren» oben rechts: nur Symbol; mit erkanntem zweitem Bildschirm gefüllt mit grünem Punkt, beim Präsentieren rot umrandet */
.scr-present-slot { display: contents; }
.scr-present-wrap { position: relative; display: inline-flex; }
.scr-present-wrap[hidden] { display: none; }
.scr-present { position: relative; }
.scr-present.ext { background: var(--accent, #1f5f73); color: #fff; }
.scr-present.ext:hover { background: var(--accent-strong, #174a59); }
.scr-present.on { box-shadow: 0 0 0 2.5px #dc2626, 0 2px 8px rgba(0,0,0,.15); color: #b91c1c; }
.scr-present-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 2px #fff; }
.scr-present-dot[hidden] { display: none; }
/* Frage «Zweiter Bildschirm erkannt» als Sprechblase unter dem Knopf */
.scr-present-ask {
  position: absolute; top: calc(100% + 12px); right: -50px; z-index: 6500; display: flex; align-items: center; gap: 8px;
  width: max-content; max-width: min(360px, calc(100vw - 32px)); padding: 8px 8px 8px 12px; border-radius: 12px;
  background: #fff; color: #1f2937; box-shadow: 0 8px 24px rgba(0,0,0,.2); font: 600 13px/1.35 var(--font);
}
.scr-present-ask[hidden] { display: none; }
.scr-present-ask::before { content: ""; position: absolute; top: -6px; right: 66px; width: 12px; height: 12px; background: #fff; transform: rotate(45deg); }
.scr-present-ask > .icon { color: var(--accent, #1f5f73); flex: none; }
.scr-present-ask-x { border: 0; background: none; padding: 4px; border-radius: 8px; color: #6b7280; cursor: pointer; display: grid; place-items: center; }
.scr-present-ask-x:hover { background: #f3f4f6; color: #1f2937; }
/* Handy und Tablet (nur Finger): kein Beamer am Kabel */
@media (hover: none) and (pointer: coarse) { .scr-present-wrap { display: none; } }

/* Referentenansicht im Steuer-Fenster */
.pv {
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow: auto; overscroll-behavior: contain;
  background: var(--bg); color: var(--text); font-family: var(--font); user-select: none;
}
.pv-top { display: flex; align-items: center; gap: 10px 14px; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; flex: none; }
.pv-logo { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.pv-title { min-width: 0; display: flex; flex-direction: column; }
.pv-title b { font-size: 1.02rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-title small { color: var(--text-2); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-top .grow, .pv .grow { flex: 1; }
.pv-lesson-chip[hidden] { display: none; }
/* Chip der Lektion: Balken unten, wie weit sie ist; ab 5 Minuten vor Schluss orange (nur am Laptop) */
.pv-lesson-chip { position: relative; overflow: hidden; padding-bottom: 6px; }
.pv-chip-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, currentColor 18%, transparent); }
.pv-chip-bar i { display: block; height: 100%; background: currentColor; border-radius: 0 2px 2px 0; transition: width .6s linear; }
.pv-lesson-chip.soon { background: var(--now-soft); color: var(--now); }
/* Zahl am Knopf «Wer fehlt?» */
.tb-item { position: relative; }
.pv-tb-badge { position: absolute; top: 3px; right: 5px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #dc2626; color: #fff; padding-top: 1px; font: 700 10px/1 var(--font); font-variant-numeric: tabular-nums; }
.pv-tb-badge[hidden] { display: none; }
.pv-tb-badge.lens { background: var(--accent, #0f766e); }
/* Zahl statt Tastenkürzel, solange jemand fehlt (die Taste steht im Titel und unter «?») */
.pv .tb-item:has(.pv-tb-badge:not([hidden])) kbd { visibility: hidden; }
.pv-beamer { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--text-2); }
.pv-status { width: 9px; height: 9px; border-radius: 50%; background: #9ca3af; flex: none; }
.pv-status.ok { background: #22c55e; }
.pv-status.wait { background: #f59e0b; }
.pv-elapsed { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: .86rem; white-space: nowrap; }
.pv-elapsed b { color: var(--text); font-variant-numeric: tabular-nums; }
.pv-clock { font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.pv-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); grid-template-rows: minmax(0, 1fr); gap: 16px; padding: 14px 18px 8px; }
.pv-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pv-stage-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-height: 30px; flex-wrap: wrap; }
.pv-stage-head h2 { margin: 0; font-size: .98rem; }
.pv-tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pv-tags .chip { display: inline-flex; align-items: center; gap: 4px; }
.pv-stage-wrap { position: relative; flex: 1; min-height: 160px; display: flex; align-items: flex-start; justify-content: center; }
/* eigene Ebene: Timer und «Dran ist» aus dem Beamer (z-index 9100+) bleiben unter Menüs, Leiste und Panel der Referentenansicht */
.pv-stage { position: relative; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--border), var(--shadow); container-type: size; isolation: isolate; }
.pv-stage > .bm-timer { pointer-events: none; }
.pv.held .pv-stage { box-shadow: 0 0 0 3px #f59e0b, var(--shadow); }
.pv-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.pv-side > .pv-card { flex: none; }
/* Griff zwischen «Screens» und «Heute/Notizen»: liegt im Abstand der beiden Karten, hoch und runter ziehen (nur am Computer) */
.pv-split { flex: none; position: relative; height: 14px; margin: -14px 0; cursor: row-resize; touch-action: none; border-radius: 6px; outline: none; }
.pv-split::before { content: ''; position: absolute; left: 50%; top: 50%; width: 40px; height: 4px; margin: -2px 0 0 -20px; border-radius: 2px; background: var(--border-strong); opacity: .55; transition: opacity .15s, background .15s; }
.pv-split:hover::before, .pv-split.dragging::before, .pv-split:focus-visible::before { opacity: 1; background: var(--accent); }
.pv-split:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
/* eigene Grösse: «Screens» hat die gezogene Höhe, Kacheln und Ordner scrollen darin, «Heute/Notizen» füllt den Rest */
.pv-side.pv-sized { overflow: hidden; }
.pv-side.pv-sized > .pv-card:first-child { display: flex; flex-direction: column; min-height: 0; }
.pv-side.pv-sized > .pv-card:first-child > .card-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.pv-side.pv-sized .card-body > .pv-deck, .pv-side.pv-sized .card-body > .pv-folders { flex: 1; min-height: 0; overflow-y: auto; align-content: start; }
.pv-side.pv-sized .pv-folder-list { max-height: none; }
.pv-side.pv-sized > .pv-card.pv-notes-card { min-height: 0; }
.pv-card { min-width: 0; }
.pv-card .card-head { padding: 10px 14px; }
.pv-card .card-head h2 { margin: 0; font-size: .95rem; }
.pv-card .card-body { padding: 12px 14px; }
.pv-next-row { display: flex; align-items: center; gap: 12px; }
.pv-next { flex: 0 0 132px; border-radius: 8px; outline: 2px solid transparent; transition: outline-color .15s; }
.pv-next.clickable { cursor: pointer; }
.pv-next.clickable:hover { outline-color: var(--accent); }
.pv-next-title { flex: 1; min-width: 0; font-weight: 600; font-size: .9rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.pv-next-end { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 16 / 9; border-radius: 8px; border: 1px dashed var(--border-strong); color: var(--text-2); font-size: .74rem; text-align: center; }
/* Vorschaubild: Hintergrund und Widgets als Flächen */
.pv-thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 7px; overflow: hidden; background: #e5e7eb; container-type: inline-size; }
.pv-thumb.loading { background: var(--surface-3); }
.pv-thumb-bg { position: absolute; inset: 0; }
.pv-thumb-w { position: absolute; border-radius: 1.2cqw; background: rgba(255,255,255,.9); box-shadow: 0 .3cqw 1cqw rgba(0,0,0,.18); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pv-thumb-w span { font: 600 clamp(6px, 3cqw, 12px)/1.1 var(--font); color: #4b5563; padding: 0 3%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Notizen und Lektion: füllen die Spalte unter «Als Nächstes», längere Inhalte scrollen */
.pv-notes-body { height: clamp(150px, 34vh, 300px); overflow-y: auto; overscroll-behavior: contain; user-select: text; }
@media (min-width: 1101px) {
  .pv-side > .pv-card.pv-notes-card { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 220px; }
  .pv-notes-card .pv-notes-body { flex: 1; height: auto; min-height: 0; }
}
.pv-notes { cursor: text; line-height: 1.55; }
.pv-notes p { margin: 0 0 6px; }
.pv-notes ul { margin: 0 0 6px; padding-left: 1.15em; }
.pv-notes li + li { margin-top: 3px; }
.pv-notes .pv-gap { height: 6px; }
.pv-notes-empty { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px; border: 1px dashed var(--border-strong); border-radius: 9px; background: none; color: var(--text-2); font: inherit; text-align: left; cursor: pointer; }
.pv-notes-empty:hover { background: var(--surface-2); color: var(--text); }
.pv-notes-edit { width: 100%; min-height: 200px; resize: vertical; }
.pv-notes-foot { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; }
.pv-lesson-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.pv-lesson-head b { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-lesson-head .chip.now { background: var(--now-soft, #fff1e8); color: var(--now, #c2410c); }
.pv-lesson-meta { color: var(--text-2); font-size: .84rem; margin: 0 0 10px; }
.pv-lesson-note { margin: 8px 0; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); font-size: .9rem; }
.pv-files-label { font: 700 11px/1 var(--font); text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin: 12px 0 6px; }
.pv-file { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.pv-file + .pv-file { margin-top: 6px; }
.pv-fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; font-weight: 560; color: var(--text); }
.pv-open-schedule { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; color: var(--accent); }
/* Reiter «Heute»: der Tag als Liste, die aktuelle Lektion aufgeklappt */
.pv-day { display: flex; flex-direction: column; gap: 2px; }
.pv-day-allday { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.pv-day-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 5px 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: .88rem; text-align: left; }
button.pv-day-row { cursor: pointer; }
button.pv-day-row:hover:not(:disabled) { background: var(--surface-2); }
.pv-day-row.past, .pv-day-break.past { opacity: .5; }
.pv-day-row.cancelled .pv-day-title { text-decoration: line-through; }
.pv-day-row.cancelled { opacity: .55; cursor: default; }
.pv-day-row.current { box-shadow: inset 3px 0 0 var(--now, #c2410c); }
.pv-day-row.pv-day-event { color: var(--text-2); }
.pv-day-row.pv-day-event.now { color: var(--text); font-weight: 600; }
.pv-day-time { flex: none; width: 3.1em; color: var(--text-2); font-variant-numeric: tabular-nums; font-size: .84rem; }
.pv-day-title { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-day-row.pv-day-event .pv-day-title { flex: 1; max-width: none; }
.pv-day-sub { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.pv-day-break { padding: 1px 8px 1px calc(3.1em + 16px); color: var(--text-3); font-size: .78rem; }
.pv-day-open { margin: 4px 0; padding: 8px 10px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.pv-day-open.now { border-color: var(--now, #c2410c); box-shadow: inset 3px 0 0 var(--now, #c2410c); }
.pv-day-open .pv-lesson-head .btn { flex: none; }
.pv-day-filter[hidden] { display: none; }
/* Reiter «Heute» und «Notizen»: Punkt, wenn sie etwas zeigen */
.pv-notes-card .seg-btn.has-dot { position: relative; }
.pv-notes-card .seg-btn.has-dot::after { content: ''; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.pv-day-filter[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
/* Reiter «Heute»: anderen Tag wählen (zweite Zeile im Kopf der Karte) */
.pv-daybar { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: -2px 0 -2px -5px; }
/* feste Breite wie der Titel der Woche im Stundenplan: ‹ und › bleiben beim Blättern stehen */
.pv-day-pick { width: 11.75em; justify-content: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.pv-day-pick > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Leiste mit den Momenten und dem Blättern */
.pv-bar-row { display: flex; justify-content: center; padding: 4px 18px 12px; flex: none; }
.pv .tbar { display: flex; align-items: center; gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); overflow-x: auto; max-width: 100%; }
.pv .tb-item { position: relative; flex: none; min-width: 78px; padding: 7px 6px 6px; color: var(--text); }
/* Laptop um 1366 px: alle Knöpfe in einer Zeile, ohne Scrollen */
@media (max-width: 1500px) and (min-width: 701px) { .pv .tb-item { min-width: 64px; padding: 7px 3px 6px; } .pv .tb-item > span { font-size: .74rem; } .pv .tb-sep { margin: 4px 1px; } }
.pv .tb-item span { display: block; max-width: none; }
.pv .tb-item .icon { color: currentColor; }
.pv .tb-item:hover:not(:disabled) { background: var(--surface-3); }
.pv .tb-item kbd { position: absolute; top: 4px; right: 6px; font: 600 9.5px/1 var(--font); color: var(--text-3); border: 1px solid var(--border-strong); border-radius: 4px; padding: 2px 4px; background: var(--surface); }
.pv .tb-item.on { background: var(--accent-soft); color: var(--accent-strong); }
.pv.held .tb-item.on { background: #fef3c7; color: #92400e; }
.pv .tb-item:disabled { opacity: .4; cursor: default; }
.pv .tb-sep { width: 1px; align-self: stretch; background: var(--border); margin: 4px; flex: none; }
/* alle Screens des Ordners als Kacheln in der Karte rechts oben (ab drei Screens), höchstens zwei Reihen (present.js) */
.pv-deck { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; overflow-y: auto; overscroll-behavior: contain; padding: 3px; margin: -3px; }
.pv-deck[hidden], .pv-next-row[hidden] { display: none; }
.pv-deck-item { min-width: 0; border: 0; background: none; padding: 0; text-align: left; color: var(--text-2); cursor: pointer; font: inherit; border-radius: 8px; }
.pv-deck-pic { position: relative; display: block; border-radius: 7px; }
.pv-deck-item .pv-thumb { box-shadow: 0 0 0 1px var(--border); transition: box-shadow .15s; }
.pv-deck-item:hover:not(.cur) .pv-thumb { box-shadow: 0 0 0 2px var(--border-strong); }
.pv-deck-item.cur { color: var(--text); cursor: default; }
.pv-deck-item.cur .pv-thumb { box-shadow: 0 0 0 2.5px var(--accent); }
.pv-deck-item.next { color: var(--text); }
.pv-deck-item.dragging { opacity: .55; }
.pv-deck-next { position: absolute; left: 4px; bottom: 4px; padding: 2px 6px; border-radius: 5px; background: var(--accent); color: #fff; font: 700 .64rem/1.3 var(--font); white-space: nowrap; pointer-events: none; }
.pv-deck-name { display: block; font-size: .76rem; font-weight: 600; padding: 4px 1px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-deck-name b { color: var(--text-3); font-weight: 600; margin-right: 5px; font-variant-numeric: tabular-nums; }
/* Reiter «Ordner»: Liste der Ordner, ein geöffneter Ordner mit seinen Screens als Kacheln */
.pv-card .seg[hidden], .pv-card h2[hidden], .pv-folders[hidden] { display: none; }
.pv-folder-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; overscroll-behavior: contain; margin: -4px -6px; }
.pv-folder { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 6px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pv-folder:hover { background: var(--surface-2); }
.pv-folder-dot { flex: none; width: 11px; height: 11px; border-radius: 50%; }
.pv-folder-name { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-folder .chip { flex: none; font-size: .7rem; }
.pv-folder-count { flex: none; color: var(--text-2); font-size: .78rem; }
.pv-folder > svg { flex: none; color: var(--text-3); }
.pv-folder-head { display: flex; align-items: center; gap: 8px; margin: -4px 0 8px -6px; min-width: 0; }
.pv-folder-head .pv-folder-name { flex: 1 1 auto; }
/* Kopf in einer Zeile: kurzer Knopf «Beenden», Titel kürzt sich */
.pv-end-short { display: none; }
@media (max-width: 1280px) {
  .pv-top { flex-wrap: nowrap; }
  .pv-title { flex: 0 1 auto; }
  .pv-lesson-chip { flex: none; white-space: nowrap; }
  .pv-end-lbl { display: none; }
  .pv-end-short { display: inline; }
}
/* kleiner Laptop (z. B. 1366 × 768 mit 125 % Zoom): zwei Spalten bleiben, Leiste nur mit Symbolen (Name im Titel) */
@media (max-width: 1180px) and (min-width: 861px) {
  .pv-main { grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 12px; padding: 10px 14px 6px; }
  .pv-elapsed { display: none; }
}
/* bis 1320 px passt die Leiste mit Namen nicht mehr: nur Symbole (Name und Taste im Titel) */
@media (max-width: 1320px) and (min-width: 701px) {
  .pv .tb-item { min-width: 48px; padding: 8px 4px; }
  .pv .tb-item > span { display: none; }
  .pv .tb-item kbd { top: 2px; right: 2px; }
}
/* schmal: «Als Nächstes» und Notizen unter den Screen, die Leiste bleibt unten stehen */
@media (max-width: 860px) {
  .pv-bar-row { position: sticky; bottom: 0; z-index: 5; background: var(--bg); padding-top: 6px; }
  /* Kopf auf einer Zeile: Titel kürzt, Status bleibt einzeilig */
  .pv-title { flex: 1 1 auto; }
  .pv-elapsed { display: none; }
  .pv-beamer { white-space: nowrap; }
  .pv .tb-item { min-width: 42px; }
  .pv .tb-sep { margin: 4px 0; }
  .pv-main { grid-template-columns: 1fr; grid-template-rows: none; flex: none; }
  .pv-side { overflow: visible; }
  .pv-split { display: none; }
  .pv-stage-wrap { flex: none; }
  .pv-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
  /* Kacheln in einer Reihe zum Wischen */
  .pv-deck { display: flex; overflow-x: auto; overflow-y: hidden; }
  .pv-deck-item { flex: 0 0 128px; }
}
@media (max-width: 700px) {
  .pv-side { grid-template-columns: 1fr; }
  .pv .tb-item { min-width: 62px; }
  .pv .tb-item kbd, .pv .tb-sep { display: none; }
  .pv .tbar { flex-wrap: wrap; justify-content: center; }
}
/* der Screen in der Referentenansicht: nur bedienen, ohne Knöpfe, Leiste, Seitenzahl und Rahmen der Widgets */
.screen.pv-screen :is(.scr-top-left, .scr-top-right, .scr-toolbar-wrap, .scr-pager, .scr-showbar, .scr-upright, .scr-lesson-bar) { display: none !important; }
.screen.pv-screen .w-bar .w-del { display: none; } /* Entfernen nur über «Bearbeiten» */
/* Einstellungen eines Widgets in der Referentenansicht: über der rechten Spalte */
.pv > .ws-panel { position: fixed; top: 74px; right: 18px; bottom: 96px; }
.screen.pv-screen .w.selected:not(.transparent) { box-shadow: 0 2px 6px rgba(0,0,0,.12), 0 12px 32px rgba(0,0,0,.16); }
.screen.pv-screen .w.transparent.selected { box-shadow: none; }
/* Video, Webseiten und Lernspiegel laufen und klingen nur am Beamer; am Laptop eine Fernbedienung bzw. eine Karte zum
   Bedienen (videoplayer.js, laptopview.js) */
.lv-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4cqmin; padding: 5cqmin; text-align: center;
  background: repeating-linear-gradient(135deg, var(--w-soft, #f3f4f6) 0 10px, transparent 10px 20px), var(--w-bg, #fff); color: var(--w-text, #1f2937); }
.lv-card > .icon { width: clamp(22px, 10cqmin, 56px); height: clamp(22px, 10cqmin, 56px); color: var(--w-accent, #0d6e6e); }
.lv-card b { font: 700 clamp(13px, 5cqmin, 26px)/1.2 var(--font); }
.lv-card-title { font: 500 clamp(11px, 3.6cqmin, 18px)/1.3 var(--font); color: var(--w-muted, #6b7280); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-card-hint { font: 500 clamp(11px, 3.4cqmin, 16px)/1.35 var(--font); color: var(--w-muted, #6b7280); max-width: 30em; }
.lv-card .wc-btn { font-size: clamp(12px, 3.8cqmin, 18px); }
@container (max-height: 150px) { .lv-card-title, .lv-card > .icon { display: none; } }
/* Fenster «Am Laptop bedienen»: Seite im Seitenverhältnis des Widgets am Beamer, möglichst gross */
.lv-modal { width: min(1200px, calc(100vw - 32px)); max-width: none; }
.lv-box { position: relative; width: min(100%, calc((100vh - 230px) * var(--lv-ratio, 1.78))); margin: 0 auto; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--border); }
.lv-frame { position: absolute; inset: 0; width: calc(100% / var(--lv-zoom, 1)); height: calc(100% / var(--lv-zoom, 1)); border: 0; transform: scale(var(--lv-zoom, 1)); transform-origin: 0 0; }
.lv-status { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--text-2); }
.lv-status.on { color: #b91c1c; font-weight: 600; }
.lv-dot { width: 9px; height: 9px; border-radius: 50%; background: #dc2626; animation: lv-pulse 1.4s ease-in-out infinite; }
@keyframes lv-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .lv-dot { animation: none; } }
/* Beamer: Bild der Seite vom Laptop über dem Widget */
.bm-stream { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; object-fit: contain; background: #000; }
/* Zeigestock: roter Punkt am Beamer, wo die Maus am Laptop steht */
.bm-pointer {
  --d: clamp(18px, 1.9vmin, 34px);
  position: absolute; left: 0; top: 0; z-index: 4100; width: var(--d); height: var(--d); margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
  border-radius: 50%; background: radial-gradient(circle, #fff 0 18%, #ef4444 30% 62%, rgba(239,68,68,0) 72%);
  box-shadow: 0 0 calc(var(--d) * .9) calc(var(--d) * .25) rgba(239,68,68,.55); pointer-events: none; transition: transform 40ms linear;
}
@media (prefers-reduced-motion: reduce) { .bm-pointer { transition: none; } }
.screen.pv-pointing .board, .screen.pv-pointing .board * { cursor: crosshair; }
/* Zeigestock und Lupe folgen der Maus auch über eingebetteten Seiten (z. B. ein PDF in der Anzeige des Browsers) */
.screen:is(.pv-pointing, .pv-lensing) iframe { pointer-events: none; }
/* Lupe: am Beamer Hintergrund und Screen um die Stelle der Maus vergrössert (beamer.js → showLens()); Timer, Signal und
   Uhr liegen darüber und bleiben gleich gross, der Punkt des Zeigestocks auch */
.bm-view { position: absolute; inset: 0; transform-origin: var(--lens-x, 50%) var(--lens-y, 50%); transition: transform .25s ease; }
.screen.beamer.lens .bm-view { transform: scale(var(--lens-z, 2)); }
.screen.beamer.lens .bm-pointer { --d: calc(clamp(18px, 1.9vmin, 34px) / var(--lens-z, 2)); }
@media (prefers-reduced-motion: reduce) { .bm-view { transition: none; } }
/* am Laptop: Rahmen um den Ausschnitt, den der Beamer gross zeigt, mit der Stärke in der Ecke (present.js → paintLens()) */
/* der Screen in der Vorschau bildet eine eigene Ebene, damit der Rahmen über allen Widgets liegt (ihr z-index zählt nur darin) */
.pv-stage > .screen { isolation: isolate; }
.pv-lens { position: absolute; z-index: 1; pointer-events: none; border: 2px solid #fff; border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(15,23,42,.55), 0 0 0 9999px rgba(15,23,42,.28); }
.pv-lens::after { content: attr(data-z); position: absolute; top: 4px; left: 4px; padding: 2px 6px; border-radius: 6px; background: rgba(15,23,42,.75); color: #fff;
  font: 700 11px/1.2 var(--font); font-variant-numeric: tabular-nums; }
.pv-lens[hidden] { display: none; }
/* Referentenansicht: Stift-Leiste beim Zeichnen über der Leiste der Präsentation */
.pv-penslot { display: flex; justify-content: center; padding: 0 18px; flex: none; }
.pv-penslot:empty { display: none; }
.pv-penslot .scr-penbar[hidden] { display: none; }
.pv-penslot .pen-bar { box-shadow: var(--shadow); border: 1px solid var(--border); }
/* Bearbeiten während der Präsentation: Leiste oben, Beamer angehalten */
.pv-editbar {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 6000; display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: calc(100% - 32px); padding: 6px 6px 6px 14px; border-radius: 999px; background: #fef3c7; color: #92400e;
  box-shadow: 0 4px 16px rgba(0,0,0,.18); font: 600 13px/1.3 var(--font);
}
.screen.autohide .pv-editbar { opacity: 1; }
/* Fenster «Welcher Bildschirm ist der Beamer?» und Erklärung zu «Erweitern» */
.pv-screens { position: relative; margin: 6px auto 0; }
.pv-screen-pick { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 2px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; font-size: .8rem; padding: 4px; overflow: hidden; }
.pv-screen-pick:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.pv-screen-pick.here { cursor: default; opacity: .6; }
.pv-screen-pick span { color: var(--text-2); font-size: .74rem; }
.pv-explain-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.pv-explain-list li { display: flex; gap: 8px; align-items: flex-start; }
.pv-explain-list .icon { margin-top: 3px; color: var(--text-3); flex: none; }

/* Beamer-Fenster: nur der Screen, ohne Auswahl, Knöpfe und Meldungen; Klicks tun nichts (ausser in Video und Webseiten) */
body.beamer-mode .toasts, body.beamer-mode .offline-pill { display: none !important; }
.screen.beamer .board { pointer-events: none; }
.screen.beamer .w-bar, .screen.beamer .w-resize, .screen.beamer .snap-guides { display: none !important; }
.screen.beamer .w.selected:not(.transparent) { box-shadow: 0 2px 6px rgba(0,0,0,.12), 0 12px 32px rgba(0,0,0,.16); }
.screen.beamer .w.transparent.selected { box-shadow: none; }
.screen.beamer .w:is([data-type="video"], [data-type="einbetten"], [data-type="lernspiegel"]) .w-body { pointer-events: auto; }
.screen.beamer.idle, .screen.beamer.idle * { cursor: none !important; }
/* Wechsel zu einem anderen Screen: Standbild des bisherigen blendet über dem neuen aus (beamer.js → snapshot()) */
.bm-snap { position: absolute; inset: 0; z-index: 50; pointer-events: none; opacity: 1; transition: opacity .45s ease; }
.bm-snap.out { opacity: 0; }
.bm-snap .board { pointer-events: none; }
.bm-blur { position: absolute; inset: 0; z-index: 9000; backdrop-filter: blur(28px) saturate(.9); -webkit-backdrop-filter: blur(28px); background: rgba(255,255,255,.18); }
.bm-black { position: absolute; inset: 0; z-index: 9500; background: #000; }
/* Timer und Signal aus der Referentenansicht: Timer gross unten rechts, Signal über dem ganzen Screen. Timer und «Dran ist»
   messen in Container-Einheiten (cqw, cqh): am Beamer ohne Container gilt das Fenster, in der Vorschau am Laptop die Vorschau */
.bm-timer { position: absolute; right: 2.5cqw; bottom: 3cqh; z-index: 9100; display: flex; align-items: center; gap: .3em; padding: .12em .45em; border-radius: .35em;
  background: rgba(15,23,42,.86); color: #fff; font: 800 min(9cqw, 15cqh)/1 var(--font); font-variant-numeric: tabular-nums; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.bm-timer .icon { width: .6em; height: .6em; opacity: .8; }
.bm-timer.paused { opacity: .75; }
.bm-timer.done { background: #dc2626; animation: bm-pulse 1s ease-in-out infinite; }
@keyframes bm-pulse { 50% { transform: scale(1.06); } }
.bm-signal { position: absolute; inset: 0; z-index: 9300; display: flex; align-items: center; justify-content: center; padding: 4vh 4vw; background: rgba(15,23,42,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.bm-signal-card { display: flex; flex-direction: column; align-items: center; gap: 3vh; max-width: 90%; padding: 6vh 6vw; border-radius: 4vh; background: #fff; color: #0f172a; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.bm-signal-card .icon { width: min(16vw, 22vh); height: min(16vw, 22vh); color: var(--accent, #0f766e); stroke-width: 1.8; }
.bm-signal-card strong { font: 800 min(9vw, 14vh)/1.1 var(--font); overflow-wrap: anywhere; }
.bm-timer[hidden], .bm-signal[hidden] { display: none; }
/* Uhr für die Kinder unten links (Uhrzeit oder Restzeit der Lektion) und «Wer ist dran?» (Karte unten Mitte) */
.bm-kidclock { position: absolute; left: 2.5vw; bottom: 3vh; z-index: 9100; padding: .15em .5em; border-radius: .35em; background: rgba(15,23,42,.78); color: #fff;
  font: 800 min(4.5vw, 7.5vh)/1 var(--font); font-variant-numeric: tabular-nums; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.bm-pick { position: absolute; left: 0; right: 0; bottom: 6cqh; z-index: 9250; display: flex; justify-content: center; pointer-events: none; }
.bm-pick-card { display: flex; flex-direction: column; align-items: center; gap: .6cqh; max-width: 80%; padding: 3cqh 5cqw 3.5cqh; border-radius: 3cqh; background: #fff; color: #0f172a;
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); border: .6cqh solid var(--accent, #0f766e); animation: bm-pick-in .35s ease-out; }
.bm-pick-card span { font: 700 min(2.6cqw, 4cqh)/1.2 var(--font); color: #475569; }
.bm-pick-card strong { font: 800 min(9cqw, 15cqh)/1.05 var(--font); overflow-wrap: anywhere; }
.bm-pick.rolling .bm-pick-card strong { opacity: .55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* lange Namen auf einer Zeile; mit Timer oder Uhr unten steht die Karte darüber statt darauf */
.bm-pick.long .bm-pick-card strong { font-size: min(6cqw, 10cqh); }
/* die Uhr der Kinder zeigt die Vorschau nicht (.clock setzt present.js), die Karte steht trotzdem gleich hoch wie am Beamer */
.screen.beamer:has(.bm-kidclock:not([hidden])) .bm-pick, .pv-stage.clock .bm-pick { bottom: 17cqh; }
:is(.screen.beamer, .pv-stage):has(> .bm-timer:not([hidden])) .bm-pick { bottom: 25cqh; }
@keyframes bm-pick-in { from { transform: translateY(30%) scale(.9); opacity: 0; } }
.bm-kidclock[hidden], .bm-pick[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .bm-pick-card { animation: none; } }
/* Chips mit × (Name, Uhr am Beamer) in der Referentenansicht */
.pv .pv-chip-btn { border: 0; cursor: pointer; font: inherit; }
.pv .pv-chip-btn:hover { filter: brightness(.95); }
@media (prefers-reduced-motion: reduce) { .bm-timer.done { animation: none; } }
/* Knopf «Timer» in der Leiste: Restzeit statt des Namens, am Ende rot */
.pv .tb-item.pv-timer-done { background: var(--danger-soft); color: var(--danger); }
.pv .tb-item span { font-variant-numeric: tabular-nums; }
.bm-calm { position: absolute; inset: 0; z-index: 9200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; background: rgba(0,0,0,.35); color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.bm-clock { font: 800 min(18vw, 30vh)/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.bm-calm-hint { font: 600 min(2.2vw, 3vh)/1.3 var(--font); opacity: .85; }
.bm-start, .bm-notice {
  position: absolute; inset: 0; z-index: 9800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px;
  border: 0; background: rgba(15,23,42,.82); color: #fff; font: 500 16px/1.4 var(--font); text-align: center; cursor: pointer;
}
.bm-notice { cursor: default; background: #0b0d10; }
.bm-start[hidden], .bm-notice[hidden], .bm-calm[hidden], .bm-black[hidden], .bm-blur[hidden] { display: none; }
.bm-start .icon, .bm-notice .icon { width: 56px; height: 56px; stroke-width: 1.6; }
.bm-start strong, .bm-notice strong { font-size: clamp(22px, 3.2vw, 40px); }
.bm-start span, .bm-notice span { opacity: .8; max-width: 560px; }
/* ruhiges Bild: nur Hintergrund und Uhr, auch ohne Name, Signal, Timer und Uhr unten (kommen mit dem Steuer-Fenster
   wieder); nach dem Neuladen statt der grossen Fläche ein kleiner Hinweis unten */
.screen.beamer.quiet .board { opacity: 0; }
.screen.beamer.quiet :is(.bm-pick, .bm-signal, .bm-timer, .bm-kidclock) { display: none; }
.bm-calm { background: rgba(0,0,0,.25); }
.bm-start.again { inset: auto 0 24px; margin: 0 auto; width: max-content; max-width: calc(100% - 32px); flex-direction: row; gap: 10px; padding: 10px 18px; border-radius: 999px; background: rgba(15,23,42,.82); font-size: 14px; }
.bm-start.again .icon { width: 22px; height: 22px; }
.bm-start.again strong { font-size: 15px; }
.bm-start.again span { display: none; }
/* Reiter «Heute»: Inhalt der Lektion, ein Klick bearbeitet ihn (wie die Notizen) */
.pv-lesson-content { cursor: text; }
.pv-lesson-empty { margin: 2px 0 8px; padding: 9px 12px; }
/* laufende bzw. aufgeklappte Lektion: Beginn und Ende im Kopf, in einer Zeile */
.pv-lesson-head .pv-day-span { width: auto; flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pv-review { margin: 4px 0 10px; }
/* ohne Notiz und ohne offenes Feld braucht der Block keinen Platz (display: flex übersteuert sonst hidden) */
.pv-review[hidden], .pv-review-add[hidden], .pv-review-lines[hidden] { display: none; }
.pv-review-toggle[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-strong); }
.pv-review-lines { margin: 0 0 8px; padding-left: 18px; font-size: 14px; color: var(--text-2); }
.pv-review-lines li + li { margin-top: 2px; }
.pv-review-lines li { position: relative; }
.pv-review-lines li:not(.pv-review-edit) { display: list-item; }
.pv-review-text { overflow-wrap: anywhere; }
.pv-review-tools { display: inline-flex; gap: 2px; margin-left: 6px; vertical-align: middle; opacity: 0; transition: opacity .12s; }
.pv-review-lines li:hover .pv-review-tools, .pv-review-tools:focus-within { opacity: 1; }
@media (hover: none) { .pv-review-tools { opacity: 1; } }
.pv-review-tools .btn.icon-only { width: 26px; height: 26px; min-height: 0; padding: 0; }
.pv-review-edit { display: flex; gap: 6px; align-items: center; list-style: none; padding: 2px 0; }
.pv-review-edit .input { flex: 1; min-width: 0; }
.pv-review-add { display: flex; gap: 8px; }
.pv-review-add .input { flex: 1; min-width: 0; }
.pv-lesson-actions { gap: 8px; margin-top: 4px; }
