/* WorkshopBoard – Gestaltung. Farben kommen aus der Vorlage (theme) als CSS-Variablen. */
:root {
  --bar: #AE0E16; --bar-on: #fff; --primary: #183B56; --primary-on: #fff; --accent: #00A5A8; --accent-t: #E6F6F6; --text: #575756;
  --muted: #66737D; --bg: #EEF2F5; --line: #D5DDE3; --soft: #F4F7F9; --card: #fff;
  --g: #2E9E5B; --y: #E8B100; --r: #C62828; --n: #9AA5AE;
  --tb-h: 56px; --radius: 10px;
  --shadow: 0 4px 16px rgba(24, 59, 86, .13);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; color: var(--text); background: var(--bg); overflow: hidden; overscroll-behavior: none; }
button { font-family: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.sp { flex: 1; }
.b { font-weight: 700; }

/* ================= Kopfzeile ================= */
#tb { position: fixed; top: 0; left: 0; right: 0; height: var(--tb-h); background: var(--bar); color: var(--bar-on); display: flex; align-items: center; gap: 8px; padding: 0 10px; padding-left: max(10px, env(safe-area-inset-left)); z-index: 50; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
#logos { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
#logos .logo { background: #fff; border-radius: 6px; height: 40px; padding: 4px 9px; display: flex; align-items: center; color: var(--bar); font-weight: 800; font-size: 17px; }
#logos .logo img { max-height: 30px; max-width: 130px; display: block; }
#logos .x { opacity: .8; font-size: 14px; }
.ttl { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ttl b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttl span { font-size: 11.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agstat { flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .35); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 13.5px; margin-left: 8px; }
.agstat:hover { background: rgba(255, 255, 255, .24); }
.agstat .agn { font-size: 11px; font-weight: 700; background: #fff; color: var(--bar); border-radius: 9px; padding: 1px 7px; flex-shrink: 0; }
.agstat .agt { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.agstat .agr { white-space: nowrap; opacity: .92; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.agstat .agr.over { background: #fff; color: var(--r); border-radius: 4px; padding: 0 5px; font-weight: 700; }
.clock { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.tbox { font-weight: 700; font-variant-numeric: tabular-nums; background: #fff; color: var(--primary); border-radius: 6px; padding: 3px 8px; cursor: pointer; flex-shrink: 0; }
.tbox.over { background: var(--y); color: #000; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .55; } }
.tb-r { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.tbtn { background: rgba(255, 255, 255, .12); color: var(--bar-on); border: 1px solid rgba(255, 255, 255, .4); border-radius: 6px; height: 34px; min-width: 34px; padding: 0 9px; font-size: 14px; white-space: nowrap; position: relative; }
.tbtn:hover { background: rgba(255, 255, 255, .25); }
.tbtn.zl { font-size: 12px; min-width: 52px; }
#goto { height: 34px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .12); color: var(--bar-on); max-width: 170px; padding: 0 6px; }
#goto option { color: #222; }
#bNext { background: #fff; color: var(--bar); font-weight: 700; }
#saved { position: fixed; right: 12px; bottom: 10px; font-size: 11.5px; color: var(--muted); z-index: 40; pointer-events: none; }
#saved.err { color: var(--r); font-weight: 700; background: #fff; padding: 4px 8px; border-radius: 6px; }
#bComments[data-n]:not([data-n="0"])::after, .cbtn[data-n]:not([data-n="0"])::after { content: attr(data-n); position: absolute; top: -6px; right: -6px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; min-width: 16px; height: 16px; line-height: 16px; text-align: center; padding: 0 3px; }

/* ================= Palette ================= */
#pal { position: fixed; left: 10px; top: calc(var(--tb-h) + 12px); bottom: 12px; z-index: 45; display: flex; flex-direction: column; gap: 3px; align-items: center; background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 6px; overflow-y: auto; scrollbar-width: none; width: 56px; }
#pal::-webkit-scrollbar { display: none; }
#pal .pb { width: 42px; height: 40px; flex-shrink: 0; border: 1px solid transparent; border-radius: 8px; background: none; font-size: 18px; color: var(--primary); display: flex; align-items: center; justify-content: center; }
#pal .pb:hover { background: var(--soft); border-color: var(--line); }
#pal .pb.on { background: var(--primary); color: var(--primary-on); }
#pal .pb.lib { background: var(--accent); color: #fff; font-weight: 700; }
#pal .nt { width: 22px; height: 22px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .15); box-shadow: 1px 1px 2px rgba(0, 0, 0, .18); display: block; }
#pal .hr { width: 30px; height: 1px; background: var(--line); margin: 3px 0; flex-shrink: 0; }
#pal small { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; margin-top: 2px; }
#swatches { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sws { display: grid; grid-template-columns: 20px 20px; gap: 5px; }
.sw { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); padding: 0; flex-shrink: 0; }
.sw.on { box-shadow: 0 0 0 2px var(--text); }
.sw.none { background: #fff; font-size: 11px; line-height: 14px; }
#pal [data-w] { height: 26px; }
#pal [data-w] i { display: block; width: 22px; background: currentColor; border-radius: 3px; }
#pop { position: fixed; z-index: 60; background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; gap: 2px; min-width: 170px; }
#pop button { display: flex; align-items: center; gap: 10px; border: none; background: none; padding: 8px 10px; border-radius: 6px; font-size: 14px; text-align: left; }
#pop button:hover { background: var(--soft); }
.sk { width: 22px; height: 15px; border: 2px solid var(--primary); display: inline-block; }
.sk.k-round { border-radius: 5px; } .sk.k-ellipse { border-radius: 50%; } .sk.k-diamond { width: 14px; height: 14px; transform: rotate(45deg); margin: 0 4px; } .sk.k-text { border: none; border-bottom: 3px solid var(--primary); }

/* ================= Board ================= */
#wrap { position: fixed; top: var(--tb-h); left: 0; right: 0; bottom: 0; overflow: hidden; background-color: var(--bg); background-image: radial-gradient(#C9D3DA 1.2px, transparent 1.2px); background-size: 24px 24px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
#wrap.panning { cursor: grabbing; }
#board { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
#areas, #items { position: absolute; left: 0; top: 0; }
#draw { position: absolute; left: -10000px; top: -10000px; width: 30000px; height: 30000px; z-index: 5; pointer-events: none; overflow: visible; }
#strokes .hit { pointer-events: stroke; cursor: move; }
#strokes g.sel .vis { filter: drop-shadow(0 0 4px var(--accent)); }
#wrap.drawmode { cursor: crosshair; }
#wrap.drawmode .it { pointer-events: none; }
#wrap.erasemode { cursor: cell; }
#wrap.erasemode #strokes g:hover .vis { opacity: .35; }
.ed, input, textarea, [contenteditable="true"] { user-select: text; -webkit-user-select: text; }

/* ================= Objekte allgemein ================= */
.it { position: absolute; cursor: default; }
.it.sel:not(.frame) { outline: 2px solid var(--accent); outline-offset: 3px; }
.it.dragging { opacity: .93; }
.it.locked [data-rs] { display: none; }
.it.locked [data-drag] { cursor: not-allowed; }
.rs { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize; z-index: 3; touch-action: none; background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, .18) 50%, rgba(0, 0, 0, .18) 60%, transparent 60%, transparent 70%, rgba(0, 0, 0, .18) 70%, rgba(0, 0, 0, .18) 80%, transparent 80%); border-bottom-right-radius: var(--radius); opacity: .6; }
.rs:hover { opacity: 1; }
.flash { animation: fl 1.2s; }
@keyframes fl { 30% { box-shadow: 0 0 0 8px var(--accent); } }
.err { background: #FBE7E7; color: var(--r); padding: 12px; border-radius: 8px; }

/* ================= Rahmen (Vorlage-Objekte) ================= */
.frame { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border-top: 6px solid var(--acc, var(--primary)); min-width: 300px; }
.frame.sel { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
.frame.now { box-shadow: 0 0 0 5px var(--bar), 0 10px 28px rgba(0, 0, 0, .2); }
.frame.now .fh { background: var(--acc-t, var(--accent-t)); }
.fh { display: flex; align-items: center; gap: 7px; padding: 9px 12px; background: var(--soft); border-bottom: 1px solid var(--line); cursor: move; border-radius: 4px 4px 0 0; min-height: 50px; touch-action: none; }
.grip { color: var(--muted); font-size: 15px; letter-spacing: -2px; padding: 0 2px; }
.ficon { font-size: 17px; }
.ftime { font-size: 12.5px; font-weight: 700; color: var(--bar); white-space: nowrap; }
.ftime:empty { display: none; }
.ed.ft { font-weight: 700; color: var(--primary); font-size: 17px; min-width: 80px; max-width: 75%; padding: 3px 6px; }
.fh-sp { flex: 1; min-width: 24px; align-self: stretch; }
.fb { padding: 14px 16px 18px; }
.fh .cbtn { flex-shrink: 0; }

/* ---------- Editierbare Felder ---------- */
.ed { min-height: 26px; padding: 5px 8px; border: 1px dashed transparent; border-radius: 6px; outline: none; line-height: 1.4; font-size: 14px; cursor: text; word-break: break-word; white-space: pre-wrap; }
.ed:hover { border-color: var(--line); background: #FBFCFD; }
.ed:focus { border: 1px solid var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-t); }
.ed:empty::before { content: attr(data-ph); color: #A0AAB2; font-style: italic; pointer-events: none; }
.ed.small { font-size: 13.5px; }
.ed.big { font-size: 20px; font-weight: 700; color: var(--primary); }
.ed.box { border-color: var(--line); background: #fff; min-height: 34px; }
.ed.leit { font-style: italic; color: var(--muted); font-size: 13.5px; margin-bottom: 8px; background: var(--soft); border-left: 3px solid var(--acc, var(--accent)); border-radius: 0 6px 6px 0; }
.ed.done { text-decoration: line-through; color: #A0AAB2; }
.ed.grow, .grow { flex: 1; min-width: 0; }
.lbl { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 6px 0 3px; }
.lbl .ed.lbl-ed { font-size: 11px; padding: 1px 4px; min-height: 0; text-transform: uppercase; }
.fld { margin-bottom: 8px; }
h4 { margin: 16px 0 8px; color: var(--primary); font-size: 14px; }
h5 { margin: 6px 0 8px; color: var(--primary); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }

/* ---------- Knöpfe in Objekten ---------- */
.addb { border: 1px dashed var(--accent); background: #fff; color: var(--accent); border-radius: 6px; padding: 5px 11px; font-size: 13px; font-weight: 600; margin-top: 6px; }
.addb:hover { background: var(--accent-t); }
.addb.sm { font-size: 12px; padding: 3px 9px; margin: 3px 0 4px 6px; align-self: flex-start; }
.btnrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.btnrow .addb { margin-top: 0; }
.xb { background: none; border: none; color: var(--muted); font-size: 13px; opacity: .55; padding: 3px 5px; border-radius: 4px; flex-shrink: 0; }
.xb:hover { opacity: 1; color: var(--r); background: rgba(0, 0, 0, .04); }
.xb.light { color: inherit; }
.chk { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--line); background: #fff; color: #fff; font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }
.chk:hover { border-color: var(--g); }
.chk.on { background: var(--g); border-color: var(--g); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 5px 11px; font-size: 12.5px; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--primary-on); }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 4px 10px; font-size: 12.5px; white-space: nowrap; }
.pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--pc, var(--n)); }
.pill.st-laeuft i { background: var(--accent); } .pill.st-erledigt i { background: var(--g); }
.tb2 { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 11px; font-size: 13px; }
.tb2.pri { background: var(--primary); color: var(--primary-on); border-color: var(--primary); font-weight: 600; }
.num-in { width: 58px; border: 1px solid var(--line); border-radius: 4px; padding: 2px 4px; text-align: right; }
.cbtn { position: relative; background: none; border: 1px solid transparent; border-radius: 6px; font-size: 14px; padding: 2px 6px; opacity: .5; line-height: 1.2; }
.cbtn:hover { opacity: 1; border-color: var(--line); background: #fff; }
.cbtn[data-n]:not([data-n="0"]) { opacity: 1; }
.prog { height: 8px; border-radius: 4px; background: #E3E8EC; overflow: hidden; margin: 2px 0 4px; }
.prog i { display: block; height: 100%; background: var(--g); transition: width .3s; }
.scroll-x { overflow-x: auto; touch-action: pan-x; }

/* ---------- Raster-Tabellen ---------- */
.grid-t { display: grid; gap: 4px 6px; align-items: center; margin: 6px 0; }
.grid-t .gh { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 0 8px; }
.grid-t input[type="date"] { border: 1px solid var(--line); border-radius: 5px; padding: 4px; font-size: 13px; }
.rows { display: flex; flex-direction: column; gap: 3px; }
.row { display: flex; align-items: center; gap: 6px; }
.bul { color: var(--muted); width: 24px; text-align: center; }
.tbl { display: grid; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tbl .th { background: var(--primary); color: var(--primary-on); display: flex; align-items: center; padding: 3px; }
.tbl .th .ed { color: inherit; font-weight: 700; flex: 1; }
.tbl .th .ed:focus { color: var(--text); }
.tbl .th .xb { color: inherit; }
.tbl .td { border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 2px; }
.tbl .td.x { display: flex; align-items: center; justify-content: center; }

/* ---------- Rich-Text ---------- */
.rtb { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px 8px 0 0; border-bottom: none; }
.rtb button { min-width: 30px; height: 30px; border: 1px solid transparent; background: none; border-radius: 5px; font-size: 13.5px; color: var(--primary); padding: 0 6px; }
.rtb button:hover { background: var(--soft); border-color: var(--line); }
.rtb .s { width: 1px; background: var(--line); margin: 3px 2px; }
.ed.rich { min-height: 220px; border: 1px solid var(--line); border-radius: 0 0 8px 8px; padding: 12px 14px; font-size: 14.5px; line-height: 1.5; background: #fff; white-space: normal; }
.ed.rich h3 { margin: 8px 0 4px; color: var(--primary); font-size: 16px; }
.ed.rich ul, .ed.rich ol { margin: 4px 0; padding-left: 22px; }
.ed.rich a { color: var(--accent); }

/* ---------- Agenda ---------- */
.ag-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.agenda { display: flex; flex-direction: column; gap: 2px; }
.ag-h { display: flex; align-items: center; gap: 8px; background: var(--primary); color: var(--primary-on); font-weight: 700; padding: 4px 8px; border-radius: 6px; margin-top: 8px; font-size: 13.5px; }
.ag-h input[type="time"] { border: none; border-radius: 4px; padding: 3px 4px; font-size: 13px; color: var(--primary); width: 92px; }
.ag-h .ed { color: inherit; flex: 1; padding: 2px 6px; min-height: 0; border: none; }
.ag-h .ed:focus { color: var(--text); }
.ag-h .tot { font-size: 12px; font-weight: 600; white-space: nowrap; }
.ag-h .bad { background: #fff; color: var(--r); border-radius: 4px; padding: 1px 6px; font-size: 11.5px; white-space: nowrap; }
.ph { display: grid; grid-template-columns: 26px 92px minmax(120px, 1fr) 58px auto; gap: 6px; align-items: center; padding: 2px 6px; border-radius: 6px; }
.ph .tm { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.ph .ed { padding: 3px 6px; min-height: 0; }
.ph input { width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 3px 4px; font-size: 12.5px; text-align: right; }
.ph-b { display: flex; gap: 1px; white-space: nowrap; }
.ph-b button { background: none; border: none; color: var(--muted); font-size: 13px; padding: 3px 5px; border-radius: 4px; opacity: .6; }
.ph-b button:hover { opacity: 1; background: rgba(0, 0, 0, .05); color: var(--primary); }
.ph-b button.play { opacity: 1; color: var(--bar); font-size: 14px; }
.ph.cur { background: var(--bar); color: var(--bar-on); font-weight: 600; }
.ph.cur .tm, .ph.cur .ph-b button { color: inherit; opacity: .95; }
.ph.cur .ed:not(:focus) { color: inherit; }
.ph.done .tm, .ph.done .ed:not(:focus) { color: #A7B1B9; text-decoration: line-through; }
.ag-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: 13px; }
.timer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.timer .clock { font-size: 22px; color: var(--primary); min-width: 76px; }

/* ---------- Check-in / Check-out ---------- */
.spk { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--soft); font-size: 12px; font-weight: 700; color: var(--muted); padding: 0; }
.spk.on { background: var(--bar); color: #fff; border-color: var(--bar); font-size: 14px; }
.moods { display: flex; gap: 1px; }
.moods button { border: none; background: none; font-size: 19px; padding: 1px 2px; filter: grayscale(1); opacity: .35; border-radius: 6px; }
.moods button:hover { opacity: .8; }
.moods button.on { filter: none; opacity: 1; background: var(--accent-t); }

/* ---------- Roadmap ---------- */
.tl { position: relative; height: 150px; margin: 4px 6px 14px; }
.tl.empty { height: auto; padding: 18px; text-align: center; background: var(--soft); border-radius: 8px; }
.tl-line { position: absolute; left: 0; right: 0; top: 74px; height: 4px; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 2px; }
.tl-today { position: absolute; top: 14px; bottom: 10px; width: 0; border-left: 2px dashed var(--bar); }
.tl-today span { position: absolute; top: -12px; left: -18px; font-size: 10.5px; font-weight: 700; color: var(--bar); background: #fff; padding: 0 3px; }
.tl-it { position: absolute; top: 62px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; width: 130px; }
.tl-m { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 17px; color: var(--pc); background: #fff; border-radius: 50%; border: 3px solid var(--pc); line-height: 1; }
.tl-it.k-deadline .tl-m { background: var(--pc); color: #fff; }
.tl-l { position: absolute; font-size: 12px; text-align: center; line-height: 1.25; width: 130px; color: var(--text); }
.tl-l b { display: block; color: var(--primary); font-size: 11.5px; }
.tl-it.up .tl-l { bottom: 34px; }
.tl-it.dn .tl-l { top: 34px; }

/* ---------- Karten & Spalten ---------- */
.colsN { display: grid; gap: 12px; }
.col { border: 1px solid var(--line); border-top: 5px solid var(--acc, var(--accent)); border-radius: 8px; padding: 8px 10px 10px; background: var(--acc-t, #fff); }
.col-h { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.col-h .ed.col-t { font-weight: 700; color: var(--primary); font-size: 15px; flex: 1; padding: 2px 4px; }
.cnt { font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, .07); border-radius: 9px; padding: 1px 7px; color: var(--muted); }
.cards { display: flex; flex-direction: column; gap: 6px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.card-b .ed { border: none; }
.card-f { display: flex; align-items: center; gap: 2px; padding: 0 4px 2px; }
.vt { border: none; background: none; font-size: 12.5px; color: var(--muted); padding: 2px 5px; border-radius: 10px; }
.vt.on { color: var(--primary); font-weight: 700; background: var(--accent-t); }
.vt:hover { background: rgba(0, 0, 0, .05); }
.leit { font-size: 13px; color: var(--muted); font-style: italic; margin: 0 0 10px; }

/* ---------- Abstimmung ---------- */
.vlist { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.vrow { display: flex; align-items: center; gap: 6px; }
.vbtn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 17px; font-weight: 700; color: var(--primary); padding: 0; }
.vbtn.plus { background: var(--primary); color: var(--primary-on); border-color: var(--primary); }
.vn { min-width: 30px; text-align: center; font-size: 18px; color: var(--primary); }
.vbar { height: 8px; border-radius: 4px; background: #E3E8EC; overflow: hidden; margin: 3px 0 0 8px; }
.vbar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }

/* ---------- Feedback ---------- */
.scale { display: flex; align-items: flex-end; gap: 8px; margin: 10px 0 14px; flex-wrap: wrap; }
.scale > button { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 8px; min-width: 64px; }
.scale > button:hover { border-color: var(--y); background: #FFFBEA; }
.scale .st { color: var(--y); font-size: 11px; letter-spacing: -1px; }
.scale .sb { height: 44px; width: 14px; background: #EEF1F3; border-radius: 3px; display: flex; align-items: flex-end; overflow: hidden; }
.scale .sb i { display: block; width: 100%; background: var(--y); }
.avg { display: flex; flex-direction: column; align-items: center; margin-left: 10px; }
.avg b { font-size: 28px; color: var(--primary); }
.avg span { font-size: 11.5px; color: var(--muted); }

/* ---------- Bewertungsmatrix ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: 12.5px; padding: 7px 10px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 13px; height: 13px; border-radius: 50%; display: inline-block; }
.d-g { background: var(--g); } .d-y { background: var(--y); } .d-r { background: var(--r); } .d-n { background: var(--n); }
.mx { display: grid; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; min-width: min-content; }
.mh { background: var(--primary); color: var(--primary-on); font-weight: 700; padding: 6px 8px; font-size: 14px; border-bottom: 4px solid var(--accent); display: flex; align-items: center; gap: 4px; }
.mh .ed { color: inherit; flex: 1; border: none; }
.mh .ed:focus { color: var(--text); }
.mh .xb { color: inherit; }
.mh.focus { background: var(--accent); }
.fstar { background: none; border: 1px solid rgba(255, 255, 255, .5); color: inherit; border-radius: 12px; font-size: 13px; padding: 1px 7px; }
.fstar.on { background: #fff; color: var(--accent); }
.mc { padding: 6px 8px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.mc.crit { background: var(--soft); border-left: none; }
.crit-f { display: flex; align-items: center; gap: 4px; }
.mc.cell[data-v="g"] { background: #E9F6EE; } .mc.cell[data-v="y"] { background: #FFF7DB; } .mc.cell[data-v="r"] { background: #FBE7E7; } .mc.cell[data-v="n"] { background: #F0F2F4; }
.mc.cell[data-v="1"] { background: #FBE7E7; } .mc.cell[data-v="2"] { background: #FDF0E2; } .mc.cell[data-v="3"] { background: #FFF7DB; } .mc.cell[data-v="4"] { background: #EEF7E6; } .mc.cell[data-v="5"] { background: #E2F3E8; }
.dots { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.dot { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); opacity: .33; padding: 0; transition: .12s; }
.dot:hover { opacity: .8; transform: scale(1.08); }
.dot.on { opacity: 1; box-shadow: 0 0 0 2px var(--primary); }
.sc { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 13px; color: var(--primary); padding: 0; }
.sc.on { background: var(--primary); color: var(--primary-on); border-color: var(--primary); }
.mc.sum { background: var(--soft); font-size: 12.5px; }
.bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #E3E8EC; margin: 3px 0 5px; }
.bar i { display: block; height: 100%; }
.warn { color: var(--r); font-size: 12px; font-weight: 600; margin-top: 3px; }

/* ---------- Portfolio ---------- */
.pf { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: 1fr auto; gap: 4px; margin-bottom: 10px; }
.pf-y { writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--primary); font-size: 13px; }
.pf-y .ed { padding: 2px; }
.pf-x { grid-column: 2; text-align: center; font-weight: 700; color: var(--primary); font-size: 13px; display: flex; justify-content: center; align-items: center; gap: 4px; }
.pf-c { position: relative; aspect-ratio: 4 / 3; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; border-left: 3px solid var(--primary); border-bottom: 3px solid var(--primary); touch-action: none; }
.pf-q { padding: 6px; font-weight: 700; color: var(--muted); }
.pf-q.q0 { background: #E9F6EE; } .pf-q.q1 { background: #EAF2FA; } .pf-q.q2 { background: #F4F5F6; } .pf-q.q3 { background: #FBEFEF; }
.pf-q .ed { display: inline-block; }
.pt { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 4px; background: #fff; border: 2px solid var(--pc); border-radius: 14px; padding: 2px 8px 2px 2px; font-size: 12px; cursor: grab; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); max-width: 190px; white-space: nowrap; touch-action: none; z-index: 2; }
.pt b, .ptn { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--pc); color: #fff; align-items: center; justify-content: center; font-size: 11.5px; flex-shrink: 0; }
.pt span { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Prozesslandkarte ---------- */
.pm { display: grid; gap: 8px; align-items: start; min-width: min-content; }
.phase { background: var(--acc, var(--bar)); color: var(--acc-on, #fff); font-weight: 600; font-size: 15px; text-align: center; padding: 10px 18px 10px 26px; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%); display: flex; align-items: center; }
.phase.first { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); padding-left: 12px; }
.phase .ed { color: inherit; flex: 1; border: none; padding: 0 4px; min-height: 0; }
.phase .ed:focus { color: var(--text); }
.pcol { display: flex; flex-direction: column; gap: 7px; }
.pcard { position: relative; background: #F0F0F0; border: 2px solid transparent; border-radius: 6px; padding: 4px 4px 24px; }
.pcard.f { background: var(--accent-t); border-color: var(--accent); }
.pcard .pn { font-size: 14px; font-weight: 500; padding: 2px 4px; min-height: 0; }
.pcard .pv { font-size: 12px; color: #8A8A8A; padding: 1px 4px; min-height: 0; }
.pact { position: absolute; left: 4px; right: 4px; bottom: 1px; display: flex; justify-content: space-between; }
.pact button { background: none; border: none; font-size: 13px; color: var(--muted); padding: 1px 4px; }
.qs { background: var(--text); color: #fff; border-radius: 8px; padding: 8px 14px; margin-top: 12px; display: flex; align-items: center; gap: 8px; }
.qs .ed { color: inherit; border: none; }
.qs .ed:focus { color: var(--text); }
.lg-f { display: inline-block; width: 16px; height: 12px; border: 2px solid var(--accent); background: var(--accent-t); border-radius: 3px; vertical-align: middle; }

/* ================= Freie Elemente ================= */
.t-note { min-height: 150px; }
.note { position: relative; height: 100%; min-height: inherit; border-radius: 3px; box-shadow: 0 4px 12px rgba(0, 0, 0, .16); display: flex; flex-direction: column; border-top: 4px solid var(--nc); }
.nh { height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 0 4px 0 8px; cursor: move; font-size: 11px; color: rgba(0, 0, 0, .55); touch-action: none; }
.note .ed.nt { flex: 1; font-size: 15.5px; min-height: 80px; color: #1d252c; }
.note .ed.nt:focus { background: rgba(255, 255, 255, .45); }
.nf { display: flex; gap: 2px; padding: 0 4px 4px; }
.t-shape .shp { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; background: var(--fill); border: 2px solid var(--bc); border-radius: 4px; cursor: move; touch-action: none; }
.shp.k-round { border-radius: 18px; } .shp.k-ellipse { border-radius: 50%; }
.shp.k-diamond, .shp.k-text { background: none; border: none; }
.shp.k-text { border: 1px dashed transparent; }
.it.sel .shp.k-text { border-color: var(--line); }
.shp .dia { position: absolute; inset: 0; width: 100%; height: 100%; }
.shp .slbl { position: relative; max-width: 86%; font-size: 15px; font-weight: 600; border: none; background: none; cursor: inherit; color: inherit; }
.shp .slbl[contenteditable="true"] { cursor: text; background: rgba(255, 255, 255, .5); color: #1d252c; }
.shp .slbl.big-t { font-size: 22px; max-width: 100%; }
.shp .slbl:empty::before { content: ''; }
.t-image { display: flex; flex-direction: column; background: #fff; box-shadow: var(--shadow); border-radius: 6px; padding: 4px; }
.imgw { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; cursor: move; overflow: hidden; touch-action: none; }
.imgw img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.t-image .cap { font-size: 12.5px; text-align: center; min-height: 0; padding: 3px; }
.t-area { pointer-events: none; }
.area { position: absolute; inset: 0; border: 2px dashed var(--ac); border-radius: 14px; }
.area-h, .t-area .rs { pointer-events: auto; }
.area-h { position: absolute; left: -2px; top: -2px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 12px 0 12px 0; font-weight: 700; cursor: move; max-width: 80%; touch-action: none; }
.area-h .ed { color: inherit; border: none; font-size: 16px; padding: 2px 4px; min-height: 0; }
.area-h .ed:focus { color: var(--text); }
.area-h .cbtn { opacity: .8; }
.area-b { position: absolute; inset: 0; pointer-events: auto; border-radius: 12px; }
.area-h { z-index: 1; }
.it.t-area.sel { outline: none; }
.it.t-area.sel .area { box-shadow: 0 0 0 3px var(--accent); }

/* ================= Kontextleiste ================= */
#ctx { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 46; background: #fff; border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .2); padding: 6px 8px; display: flex; align-items: center; gap: 4px; max-width: calc(100vw - 90px); overflow-x: auto; scrollbar-width: none; }
#ctx::-webkit-scrollbar { display: none; }
#ctx .ctx-l { font-size: 12.5px; font-weight: 700; color: var(--primary); white-space: nowrap; padding: 0 6px; }
#ctx .ctx-sw { display: flex; gap: 4px; padding: 0 6px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
#ctx > button { min-width: 34px; height: 34px; border: 1px solid transparent; border-radius: 7px; background: none; font-size: 15px; flex-shrink: 0; }
#ctx > button:hover, #ctx > button.on { background: var(--soft); border-color: var(--line); }
#ctx > button.danger:hover { background: #FBE7E7; }
#ctx .lw { display: block; width: 18px; background: var(--text); border-radius: 2px; margin: auto; }

/* ================= Seitenleisten: Menü, Kommentare ================= */
.side { position: fixed; top: var(--tb-h); right: 0; bottom: 0; width: 340px; max-width: 100vw; background: #fff; box-shadow: -4px 0 16px rgba(0, 0, 0, .15); z-index: 55; display: flex; flex-direction: column; transform: translateX(105%); transition: transform .2s; }
.side.open { transform: none; }
.side-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--primary); color: var(--primary-on); }
.side-h b { flex: 1; font-size: 14.5px; }
.side-h button { background: none; border: none; color: inherit; font-size: 17px; }
#menu .mlist { overflow-y: auto; padding: 8px 10px 20px; }
#menu .mlist h6 { margin: 14px 6px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
#menu .mlist button { display: flex; width: 100%; align-items: center; gap: 10px; border: none; background: none; padding: 9px 8px; border-radius: 7px; font-size: 14.5px; text-align: left; }
#menu .mlist button:hover { background: var(--soft); }
#menu .mlist button small { color: var(--muted); font-size: 11.5px; display: block; }
#menu .mlist button > span:first-child { width: 24px; text-align: center; font-size: 17px; flex-shrink: 0; }
#menu label { display: block; padding: 6px 8px; font-size: 12px; color: var(--muted); }
#menu label input { display: block; width: 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
#cp-list { flex: 1; overflow: auto; padding: 12px 14px; }
.cm { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 7px 10px; margin-bottom: 8px; font-size: 13.5px; }
.cm .meta { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 3px; }
.cm .meta button { background: none; border: none; color: var(--muted); }
.cm .txt { white-space: pre-wrap; }
.cgrp { font-size: 12.5px; font-weight: 700; color: var(--primary); margin: 12px 0 6px; cursor: pointer; text-decoration: underline; }
.cp-new { border-top: 1px solid var(--line); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.cp-new textarea { width: 100%; min-height: 70px; border: 1px solid var(--line); border-radius: 6px; padding: 8px; font-size: 14px; resize: vertical; }
.cp-new button, .pri { background: var(--accent); color: #fff; border: none; border-radius: 6px; padding: 9px 14px; font-weight: 600; }
.empty { color: var(--muted); font-style: italic; font-size: 13px; }

/* ================= Modal ================= */
#modal { position: fixed; inset: 0; background: rgba(20, 30, 40, .45); z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; }
.mbox { background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .3); width: 520px; max-width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; }
#modal.wide .mbox { width: 820px; }
.mbox > header { display: flex; align-items: center; padding: 12px 16px; background: var(--primary); color: var(--primary-on); }
.mbox > header b { flex: 1; }
.mbox > header button { background: none; border: none; color: inherit; font-size: 18px; }
#mBody { padding: 12px 18px 18px; overflow-y: auto; font-size: 14px; }
#mBody h4:first-child { margin-top: 4px; }
#mBody .btnrow button:not(.pri) { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 8px 12px; }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.lib button { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 10px; font-size: 13.5px; text-align: left; }
.lib button:hover { border-color: var(--accent); background: var(--accent-t); }
.lib button span { font-size: 20px; }
.form2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.form4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.form2 label, .form4 label, .frow { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form2 input, .frow input, #mBody textarea { border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; width: 100%; }
.form4 input[type="color"], .prow input[type="color"] { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: #fff; }
.lrow { display: flex; gap: 4px; }
.lrow button { border: 1px solid var(--line); background: #fff; border-radius: 6px; }
.prow { display: grid; grid-template-columns: 50px 1fr 1fr 30px; gap: 6px; margin-bottom: 5px; align-items: center; }
.prow input { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.prow button { border: none; background: none; color: var(--muted); }
.help p { line-height: 1.5; margin: 0 0 10px; }
code { background: var(--soft); padding: 1px 5px; border-radius: 4px; }

/* ================= Toast ================= */
#toast { position: fixed; left: 50%; bottom: 80px; transform: translate(-50%, 20px); background: var(--primary); color: var(--primary-on); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 80; opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100vw - 32px); box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--r); color: #fff; }

/* ================= Großer Monitor ================= */
@media (min-width: 1800px) {
  :root { --tb-h: 64px; }
  .ttl b { font-size: 17px; } .agstat { font-size: 15.5px; } .clock { font-size: 18px; }
}
/* ================= Mittlere Breiten ================= */
@media (max-width: 1200px) {
  .ttl span { display: none; }
  #goto { max-width: 120px; }
}
@media (max-width: 1000px) {
  .ttl { display: none; }
  .hide-m { display: none !important; }
}
/* ================= Smartphone ================= */
@media (max-width: 760px) {
  :root { --tb-h: 52px; }
  #tb { gap: 6px; padding: 0 6px; }
  #logos .logo { height: 34px; padding: 3px 6px; font-size: 14px; }
  #logos .logo img { max-height: 26px; max-width: 70px; }
  #logos .x, #logos .x + .logo { display: none; }
  .agstat { margin-left: 2px; padding: 4px 7px; font-size: 12.5px; flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.2; }
  .agstat .agn { display: none; }
  .agstat .agr { font-size: 11px; }
  .agstat .agt, .agstat .agr { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  #bNext { padding: 0 8px; font-size: 13px; }
  #zFit { display: none; }
  .clock, .hide-s, #goto { display: none !important; }
  .tbtn { height: 36px; min-width: 36px; padding: 0 8px; }
  #pal { top: auto; left: 0; right: 0; bottom: 0; width: auto; flex-direction: row; border-radius: 12px 12px 0 0; overflow-x: auto; overflow-y: hidden; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 4px; }
  #pal .hr { width: 1px; height: 30px; margin: 0 3px; }
  #pal small { display: none; }
  #swatches { flex-direction: row; gap: 6px; }
  .sws { display: flex; gap: 6px; }
  .sw { width: 24px; height: 24px; }
  #pal .pb { width: 40px; }
  #ctx { bottom: calc(66px + env(safe-area-inset-bottom)); max-width: calc(100vw - 16px); }
  #saved { bottom: auto; top: calc(var(--tb-h) + 4px); font-size: 11px; }
  #toast { bottom: calc(130px + env(safe-area-inset-bottom)); }
  .side { width: 100vw; }
  .form2, .form4 { grid-template-columns: 1fr 1fr; }
}

/* ================= Druck ================= */
@media print {
  #tb, #pal, #ctx, .side, #toast, #saved, .rs { display: none !important; }
  #wrap { position: static; overflow: visible; background: none; }
}

/* ================= Präsentationen ================= */
.sl-img { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0f1418; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.sl-img img { max-width: 100%; max-height: 100%; display: block; }
.sl-img iframe { width: 100%; height: 100%; border: 0; background: #fff; pointer-events: none; }
.sl-img.load::before { content: 'Folie wird geladen …'; position: absolute; color: #8b98a3; font-size: 13px; }
.sl-img.load img[src] + *, .sl-img img:not([src]) { visibility: hidden; }
.sl-img.err::before { content: '⚠ ' attr(data-msg); position: absolute; color: #f3a0a0; font-size: 13px; padding: 12px; text-align: center; }
.sl-prev { position: relative; cursor: pointer; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.sl-prev .sl-go { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 6px; opacity: 0; transition: .15s; pointer-events: none; }
.sl-prev:hover .sl-go { opacity: 1; }
.sl-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 0 4px; }
.sl-n { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.sl-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.lnk { background: none; border: none; color: var(--accent); font-size: 12.5px; padding: 2px 4px; text-decoration: underline; }
.sl-notes { min-height: 60px; }
.mark { display: inline-flex; align-items: center; }
.ph-b button.has { opacity: 1; color: var(--accent); }
.ph-notes { padding: 2px 6px 6px 38px; }
.ph-notes .ed { min-height: 48px; font-size: 13px; }

#show { position: fixed; inset: 0; z-index: 90; background: #000; display: flex; align-items: center; justify-content: center; user-select: none; touch-action: none; }
.sh-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.sh-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sh-stage iframe { width: 100%; height: 100%; border: 0; background: #000; }
.sh-msg { position: absolute; color: #f3a0a0; font-size: 16px; }
.sh-black { position: absolute; inset: 0; background: #000; display: none; }
#show.black .sh-black { display: block; }
.sh-bar { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; background: rgba(20, 26, 32, .85); border-radius: 12px; padding: 6px 8px; opacity: 0; transition: opacity .25s; z-index: 2; }
#show:hover .sh-bar, #show.bar-on .sh-bar { opacity: 1; }
.sh-bar button { background: none; border: none; color: #fff; font-size: 18px; min-width: 40px; height: 40px; border-radius: 8px; }
.sh-bar button:hover { background: rgba(255, 255, 255, .15); }
.sh-n { color: #fff; font-variant-numeric: tabular-nums; font-size: 15px; min-width: 70px; text-align: center; }
.sh-sep { width: 1px; height: 26px; background: rgba(255, 255, 255, .3); margin: 0 4px; }
.sh-panel { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); width: min(1100px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; background: rgba(20, 26, 32, .96); color: #fff; border-radius: 12px; padding: 12px 16px; z-index: 3; }
.sh-panel h4 { color: #fff; margin: 4px 0 10px; }
.sh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.sh-grid button { background: none; border: 2px solid transparent; border-radius: 8px; padding: 3px; color: #cfd8de; font-size: 12px; text-align: left; }
.sh-grid button.on, .sh-grid button:hover { border-color: var(--accent); }
.sh-grid i { font-style: normal; display: block; padding: 3px 2px 0; }
.sh-hn { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; background: #2a343d; border-radius: 6px; padding: 6px; font-size: 12.5px; text-align: center; color: #fff; }
.sh-mk { display: flex; width: 100%; gap: 12px; align-items: center; background: none; border: none; color: #fff; padding: 8px 10px; border-radius: 6px; font-size: 15px; text-align: left; }
.sh-mk b { min-width: 34px; color: var(--accent); }
.sh-mk:hover, .sh-mk.on { background: rgba(255, 255, 255, .12); }
@media (max-width: 760px) { .sh-bar button[data-sh="mod"], .sh-bar button[data-sh="fs"] { display: none; } .sh-bar { opacity: 1; } }
/* Steuerung bleibt beim Board (Tasten, Wischen), die eingebettete HTML-Folie bekommt keinen Fokus */
.sh-stage::after { content: ''; position: absolute; inset: 0; }

/* ================= Mehrfachauswahl & Verbinder ================= */
#marq { position: absolute; border: 2px dashed var(--accent); background: rgba(0, 165, 168, .08); border-radius: 4px; pointer-events: none; z-index: 20; }
#wrap.lassomode { cursor: crosshair; }
.it.snap { outline: 3px solid var(--accent) !important; outline-offset: 4px; }
body.multisel .it.sel { outline: 2px dashed var(--accent); outline-offset: 4px; }
body.multisel .frame.sel { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
#strokes .slab { font: 600 14px "Segoe UI", system-ui, sans-serif; paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; pointer-events: none; }

/* ================= Karten ziehen ================= */
.cgrip { cursor: grab; color: var(--muted); font-size: 14px; padding: 2px 6px; border-radius: 4px; touch-action: none; user-select: none; opacity: .55; }
.cgrip:hover { opacity: 1; background: rgba(0, 0, 0, .05); }
.card.ghost { position: fixed; z-index: 95; pointer-events: none; box-shadow: 0 12px 28px rgba(0, 0, 0, .25); transform: rotate(1.5deg); opacity: .95; }
.card.dragsrc { opacity: .35; }
.cards.drop { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 6px; min-height: 36px; }
.card.drop-before { box-shadow: 0 -4px 0 var(--accent); }

/* ================= Link-Karte ================= */
.t-link { min-height: 120px; }
.lk { position: relative; background: #fff; border-radius: 10px; box-shadow: var(--shadow); border-left: 6px solid var(--lc); height: 100%; min-height: inherit; display: flex; flex-direction: column; padding-bottom: 6px; }
.lk-h { display: flex; align-items: center; gap: 8px; padding: 6px 8px 2px 10px; cursor: move; touch-action: none; min-height: 36px; }
.lk-i { font-size: 20px; }
.lk-k { flex: 1; font-size: 11.5px; font-weight: 700; color: var(--lc); text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk .ed.lk-t { font-weight: 700; color: var(--primary); font-size: 15px; margin: 0 4px; }
.lk .ed.lk-d { margin: 0 4px; color: var(--muted); }
.lk-f { display: flex; align-items: center; gap: 6px; padding: 4px 10px 0; margin-top: auto; }
.lk-open { background: var(--lc); color: #fff; text-decoration: none; font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: 6px; }
.lk-open:hover { filter: brightness(1.1); }

/* ================= Präsentationsmodus ================= */
body.touring #pal, body.touring #ctx, body.touring #saved, body.touring .rs { display: none !important; }
body.touring .it:not(.tour-cur):not(.t-area) { opacity: .25; transition: opacity .3s; }
body.touring .frame.tour-cur { box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
#tourbar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 4px; background: rgba(20, 30, 40, .9); color: #fff; border-radius: 12px; padding: 6px 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); max-width: calc(100vw - 16px); }
#tourbar button { background: none; border: none; color: #fff; font-size: 17px; min-width: 40px; height: 40px; border-radius: 8px; }
#tourbar button:hover { background: rgba(255, 255, 255, .15); }
#tourbar .tr-t { font-size: 14px; min-width: 120px; max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px; }
#tourbar .tr-t b { color: var(--accent); margin-right: 6px; }
.tr-sep { width: 1px; height: 26px; background: rgba(255, 255, 255, .3); margin: 0 4px; }
.tr-list { position: absolute; left: 0; right: 0; bottom: 56px; max-height: 60vh; overflow: auto; background: rgba(20, 30, 40, .96); border-radius: 10px; padding: 6px; }
.tr-list button { display: flex !important; width: 100%; align-items: center; gap: 10px; text-align: left; font-size: 14px !important; padding: 0 10px; }
.tr-list button b { color: var(--accent); min-width: 24px; }
.tr-list button.on { background: rgba(255, 255, 255, .14); }
@media (max-width: 760px) { #tourbar [data-tr="mod"], #tourbar [data-tr="fs"], #tourbar .tr-sep { display: none; } #tourbar .tr-t { min-width: 0; max-width: 46vw; } }

/* ================= Galerie & Bildschirme ================= */
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.gal-c { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; border-top: 4px solid var(--accent); }
.gal-l { display: flex; flex-direction: column; gap: 6px; }
.gal-r { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.gal-r.cur { border-color: var(--accent); background: var(--accent-t); }
.chip.sm { font-size: 11px; padding: 2px 8px; }
.scrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 10px 0; }
.scr { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 10px; text-align: left; }
.scr span { font-size: 12px; color: var(--muted); }
.scr.on { border-color: var(--accent); background: var(--accent-t); }

/* ================= Online-Board (js/sync.js) ================= */
.syncstat { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.syncstat i { width: 9px; height: 9px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.syncstat.off i { background: #ffb020; }
.olinks { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.olinks label, #mBody > label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin: 8px 0; }
.olinks input, #mBody > label input { border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; width: 100%; font-size: 12.5px; }
.olinks .lrow button, #mBody > label .lrow button { padding: 0 12px; white-space: nowrap; }
.ok-box { border: 1px solid #2E9E5B; background: #EAF7EF; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.err-box { border: 1px solid #C0392B; background: #FBE7E7; border-radius: 8px; padding: 8px 12px; }
#mBody a.btn { display: inline-block; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 8px 12px; color: inherit; text-decoration: none; }
#mBody a.btn.pri { background: var(--accent); color: #fff; border-color: var(--accent); }
#mBody .btnrow button.danger { color: #C0392B; }
/* Teilnehmende ohne Moderationsrechte: Einstellungen, Laden und Zurücksetzen ausblenden (Server prüft zusätzlich) */
.rolle-edit [data-m="settings"], .rolle-edit [data-m="reset"], .rolle-edit [data-m="clear"], .rolle-edit [data-m="load"], .rolle-edit [data-m="gallery"] { display: none; }

/* ================= Rechte, Urheberschaft, gemeinsames Bearbeiten (js/perm.js, js/sync.js) ================= */
.it.ro [data-rs] { display: none; }
.it.ro [data-drag] { cursor: default; }
.it.ro .ed[contenteditable="false"]:hover, .ro-f:hover { border-color: transparent; background: none; cursor: default; }
.noperm { pointer-events: none; cursor: default; }
.addb.noperm, .xb.noperm, .lnk.noperm, .tb2.noperm, .rtb.noperm, .ph-b .noperm, .cgrip.noperm, .fstar.noperm, .chip.noperm:not(.on), button.vbtn.noperm { display: none !important; }
.dot.noperm:not(.on), .sc.noperm:not(.on), .moods .noperm:not(.on) { opacity: .18; }
.fguard { font-size: 14px; opacity: .75; cursor: help; }
.fguard:empty { display: none; }
.it.by-guest .note { border-top-style: dashed; }
.it.by-guest .na { font-weight: 700; color: rgba(0, 0, 0, .7); }
.cby { display: inline-block; margin: 0 8px 4px; font-size: 11px; color: var(--muted); background: var(--soft); border-radius: 8px; padding: 0 6px; }
.vt.rep { margin-left: auto; }
.it.remote-edit { outline: 3px solid var(--rc, #7B4CC4) !important; outline-offset: 3px; }
.it.remote-edit::after { content: attr(data-who); position: absolute; left: 0; top: -26px; background: var(--rc, #7B4CC4); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px 6px 6px 0; white-space: nowrap; pointer-events: none; z-index: 5; }
#ctx .ctx-info { font-size: 12.5px; color: var(--muted); padding: 0 8px; white-space: nowrap; }
#ctx > button[data-cx="guard"].on { background: var(--accent-t); border-color: var(--accent); }
.cm.reply { margin-left: 22px; border-left-color: var(--line); }
.cm.guest { border-left-color: #E07B00; }
.cm.modc { border-left-color: var(--primary); }
.cm .cm-b { display: inline-flex; gap: 2px; }
.cm .cm-b button { background: none; border: none; color: var(--muted); font-size: 13px; padding: 0 4px; }
.cm .cm-b button:hover { color: var(--primary); }
.cp-re { display: flex; align-items: center; gap: 6px; font-size: 12.5px; background: var(--accent-t); border-radius: 6px; padding: 5px 8px; }
.cp-re span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-re button { background: none; border: none; color: var(--muted); }
.rlist { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.rlist .rrow { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
/* Teilnehmende: Werkzeuge der Moderation ausblenden */
.rolle-edit #bLib, .rolle-edit [data-m="lib"], .rolle-edit [data-m="layout"], .rolle-edit [data-m="rights"], .rolle-edit [data-m="timebox"], .rolle-edit #bNext { display: none !important; }
.note .nf { padding-right: 26px; align-items: center; }

/* ================= Ausrichten, Verbinder-Verlauf ================= */
#pop .pop-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 6px 10px 2px; }
#pop .al-i { display: inline-block; width: 22px; text-align: center; font-size: 16px; color: var(--primary); }
#ctx .ctx-sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 3px; flex-shrink: 0; }
#strokes .hdl { display: none; fill: #fff; stroke: var(--accent); stroke-width: 3; cursor: grab; pointer-events: all; }
#strokes g.sel .hdl { display: block; }
#wrap.drawmode #strokes .hdl { pointer-events: none; }
