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

body.screen-mode { overflow: hidden; overscroll-behavior: none; }
.screen-root { position: fixed; inset: 0; }
.screen {
  position: absolute; inset: 0; overflow: hidden; 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; }
.screen-bg.bg-dark ~ .scr-top-left .scr-title { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
@keyframes bg-shift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.board { position: absolute; inset: 0; }
.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; }
.w.transparent { background: transparent; box-shadow: none; }
.w.transparent.selected { box-shadow: 0 0 0 2px rgba(37, 99, 235, .6); }
.w.maximized { border-radius: 0; }

.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:hover .w-bar, .w.selected .w-bar { opacity: 1; pointer-events: auto; }
.w.maximized .w-bar { bottom: auto; top: 8px; left: auto; right: 8px; width: auto; }
.w-grip { color: #9ca3af; 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);
}
.w-resize { position: absolute; z-index: 3; }
.w-resize-se { right: -6px; bottom: -6px; width: 22px; height: 22px; cursor: nwse-resize; }
.w-resize-se::after { content: ""; position: absolute; right: 8px; bottom: 8px; width: 10px; height: 10px; border-right: 3px solid rgba(37,99,235,.8); border-bottom: 3px solid rgba(37,99,235,.8); border-radius: 0 0 3px 0; opacity: 0; transition: opacity .15s; }
.w:hover .w-resize-se::after, .w.selected .w-resize-se::after { opacity: 1; }
.w-resize-e { right: -5px; top: 12px; bottom: 16px; width: 10px; cursor: ew-resize; }
.w-resize-s { bottom: -5px; left: 12px; right: 16px; height: 10px; cursor: ns-resize; }
.w.maximized .w-resize { display: none; }

/* Hilfsklassen für Widget-Inhalte */
.wc-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4cqmin; gap: 3cqmin; }
.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-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); }
.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; }

.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; }
.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: #e0e7ff; color: #3730a3; }
.tb-mode .icon { width: 17px; height: 17px; }
.tb-sep { width: 1px; align-self: stretch; background: #e5e7eb; margin: 4px 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: 76px; overflow: hidden; text-overflow: ellipsis; }
.tb-item.more .icon { color: #4f46e5; }
/* «Mehr» und Rückgängig bleiben sichtbar, auch wenn die Leiste seitlich scrollt */
.tb-item.more { position: sticky; right: 0; background: rgba(255,255,255,.97); }
.tb-hide { border: 0; background: none; color: #9ca3af; 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-group + .more-group { margin-top: 8px; }
.more-label { font: 700 11px/1 var(--font); text-transform: uppercase; letter-spacing: .07em; color: #9ca3af; 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 { background: #f3f4f6; }
.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; justify-content: flex-end; }

/* Kontextmenü (auch ausserhalb des Screens nutzbar) */
.popup-menu { position: fixed; z-index: 10050; min-width: 220px; max-height: 70vh; overflow-y: auto; background: var(--surface, #fff); color: var(--text, #111); border: 1px solid var(--border, #e5e7eb); border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.25); padding: 6px; font-family: var(--font); }
.popup-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; color: inherit; font-size: 14px; }
.popup-item:hover { background: var(--surface-3, #f3f4f6); }
.popup-item.active { font-weight: 650; }
.popup-item.danger { color: var(--danger, #b91c1c); }
.popup-sep { height: 1px; background: var(--border, #e5e7eb); margin: 5px 4px; }

/* 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;
}
@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: #9ca3af; 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%; accent-color: #2563eb; }
.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 #2563eb; }
.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; }

/* Hintergrund-Auswahl */
.bg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bg-grid.colors { grid-template-columns: repeat(7, 1fr); }
.bg-tile { 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: #2563eb; box-shadow: 0 0 0 2px #2563eb; }
.bg-color-input { width: 100%; aspect-ratio: 1; border: 0; padding: 0; background: none; cursor: pointer; }

/* 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 #2563eb; }
.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: #e0e7ff; }
.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: #e0e7ff; color: #3730a3; }
.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: #e0e7ff; color: #3730a3; }

/* 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); }

/* 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 über dem Seitenwähler, fast volle Breite (sonst bleiben nur wenige Hundert Pixel) */
@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; }
}

/* --------------------------------------------------------------- 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; }
.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; }
.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%); }
/* 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; }
/* 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; }

.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 #4f46e5; }
.ws-own { display: flex; flex-direction: column; gap: 10px; }

/* 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; }
