/* RC Films Studio – Grundlayout, Boards, Karten. Systemschriften, keine externen Schriften. */
:root {
  --bg: #ecedef;
  --dot: #c9cbd0;
  --panel: #ffffff;
  --panel-2: #f2f0ec;
  --card: #ffffff;
  --ink: #1f1e1c;
  --ink-2: #44413c;
  --muted: #77726a;
  --line: #dcd8d0;
  --line-2: #e9e6e0;
  --accent: #e8542f;
  --accent-ink: #fff;
  --accent-soft: #fbe5dc;
  --sel: #2f7cf6;
  --sel-soft: rgba(47, 124, 246, .12);
  --ok: #2e8b57;
  --warn: #c98a00;
  --danger: #c93a32;
  --shadow: 0 1px 2px rgba(30, 25, 20, .10), 0 2px 8px rgba(30, 25, 20, .06);
  --shadow-lift: 0 10px 30px rgba(30, 25, 20, .20), 0 2px 6px rgba(30, 25, 20, .10);
  --radius: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace;
  --top: 52px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #18181a; --dot: #38383c; --panel: #222225; --panel-2: #2a2a2e; --card: #2b2b2f; --ink: #ecebe8; --ink-2: #cfcdc8;
    --muted: #9b978f; --line: #3c3c42; --line-2: #313136; --accent: #f06a3d; --accent-soft: #3d2519; --sel: #5b9bff;
    --sel-soft: rgba(91, 155, 255, .16); --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .3);
    --shadow-lift: 0 12px 30px rgba(0, 0, 0, .6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #18181a; --dot: #38383c; --panel: #222225; --panel-2: #2a2a2e; --card: #2b2b2f; --ink: #ecebe8; --ink-2: #cfcdc8;
  --muted: #9b978f; --line: #3c3c42; --line-2: #313136; --accent: #f06a3d; --accent-soft: #3d2519; --sel: #5b9bff;
  --sel-soft: rgba(91, 155, 255, .16); --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .3);
  --shadow-lift: 0 12px 30px rgba(0, 0, 0, .6); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow: hidden; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
a { color: inherit; }
.muted { color: var(--muted); }
.ic { width: 18px; height: 18px; flex: none; display: block; }
kbd { font: 11px var(--mono); color: var(--muted); }

/* ---------- Bedienelemente ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.small { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.big { height: 42px; font-size: 15px; justify-content: center; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; border: 0; background: transparent; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--panel-2); color: var(--ink); }
.icon-btn.on { background: var(--accent-soft); color: var(--accent); }
.icon-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.input, select.input, textarea.input { width: 100%; height: 36px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; }
textarea.input { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; }
.input:focus, .btn:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--sel); outline-offset: 1px; }
label.field { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
label.field > .input { font-size: 14px; color: var(--ink); }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }

/* ---------- Zugang ---------- */
.gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 1.2px) 0 0 / 22px 22px, var(--bg); }
.gate-card { width: min(380px, 100%); background: var(--card); border-radius: 12px; box-shadow: var(--shadow-lift); padding: 32px 28px 28px; display: grid; gap: 10px; }
.gate-card h1 { margin: 6px 0 0; font: 600 24px/1.2 var(--serif); }
.gate-card p { margin: 0 0 8px; }
.gate-card label { font-weight: 600; font-size: 13px; }
.gate-logo { width: 52px; height: 52px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; }
.gate-logo span { color: var(--bg); font: 700 16px var(--font); letter-spacing: .5px; }
.gate-error { color: var(--danger); min-height: 18px; font-size: 13px; margin: 0 !important; }

/* ---------- Kopfleiste ---------- */
.topbar { height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 10px 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); position: relative; z-index: 30; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 650; flex: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--panel); display: grid; place-items: center; font-size: 11px; letter-spacing: .4px; }
.brand-name { font-family: var(--serif); font-size: 16px; }
.tabs { display: flex; gap: 2px; background: var(--panel-2); border-radius: 8px; padding: 3px; flex: none; }
.tabs a { text-decoration: none; padding: 5px 12px; border-radius: 6px; font-weight: 500; color: var(--muted); font-size: 13px; }
.tabs a.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1; overflow: hidden; }
.crumbs a, .crumbs span { white-space: nowrap; text-decoration: none; padding: 4px 6px; border-radius: 5px; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.crumbs a:hover { background: var(--panel-2); color: var(--ink); }
.crumbs .cur { color: var(--ink); font-weight: 600; cursor: text; }
.crumbs .ic { width: 14px; height: 14px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.save-state { font-size: 12px; color: var(--muted); padding: 0 8px; white-space: nowrap; }
.save-state.err { color: var(--danger); }
#view { position: absolute; top: var(--top); left: 0; right: 0; bottom: 0; }

/* ---------- Board-Ansicht ---------- */
.board-head { position: absolute; left: 0; right: 0; top: 0; height: 48px; display: flex; align-items: center; justify-content: center; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 21; padding: 0 12px; }
.board-head h1 { margin: 0; font: 700 22px/1 var(--serif); outline: none; padding: 4px 8px; border-radius: 5px; max-width: 50%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: text; }
.board-head h1:hover { background: var(--panel-2); }
.board-head .head-right { position: absolute; right: 10px; top: 0; bottom: 0; display: flex; align-items: center; gap: 2px; }
.menu-btn { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 9px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.menu-btn:hover { background: var(--panel-2); color: var(--ink); }
.menu-btn .ic { width: 15px; height: 15px; }
.unsorted-pill { position: absolute; right: 14px; top: 14px; z-index: 22; height: 30px; padding: 0 11px; border-radius: 5px; border: 0; background: var(--card); box-shadow: var(--shadow); font-size: 13px; cursor: pointer; color: var(--ink-2); }
.unsorted-pill b { color: var(--ink); }
.unsorted-pill.drop { background: var(--accent); color: #fff; }
.board-view { position: absolute; inset: 48px 0 0 0; display: flex; }
.toolbar { width: 84px; flex: none; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; overflow-x: hidden; padding: 8px 6px; display: flex; flex-direction: column; gap: 2px; z-index: 20; scrollbar-width: thin; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 2px 4px; border-radius: 8px; border: 0; background: transparent; cursor: grab; color: var(--ink-2); font-size: 11px; touch-action: none; user-select: none; }
.tool .tile { width: 40px; height: 34px; border-radius: 5px; background: var(--card); box-shadow: 0 1px 3px rgba(30, 30, 40, .16), 0 0 0 1px rgba(30, 30, 40, .04); display: grid; place-items: center; transition: transform .12s; }
.tool .ic { width: 22px; height: 22px; }
.tool:hover .tile { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(30, 30, 40, .18); }
.tool.on .tile { background: var(--accent); color: #fff; }
.tool.t-board .tile { background: #3d7ff5; color: #fff; }
.tool.t-trash { margin-top: auto; cursor: pointer; }
.tool.t-trash.drop .tile { background: var(--danger); color: #fff; transform: scale(1.12); }
.tool-sep { height: 1px; background: var(--line); margin: 6px 8px; flex: none; }

.canvas { position: relative; flex: 1; overflow: hidden; background-color: var(--bg); touch-action: none; outline: none;
  background-image: radial-gradient(circle at center, var(--dot) 1px, transparent 1.3px); }
.canvas.nogrid { background-image: none; }
.canvas.panning, .canvas.space { cursor: grab; }
.canvas.panning { cursor: grabbing; }
.canvas.mode-line, .canvas.mode-draw { cursor: crosshair; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.lines-svg { position: absolute; left: 0; top: 0; overflow: visible; width: 1px; height: 1px; pointer-events: none; }
.lines-svg .hit { pointer-events: stroke; cursor: pointer; stroke: transparent; stroke-width: 14; fill: none; }
.lines-svg .ln { fill: none; stroke-linecap: round; }
.lines-svg .ln.sel { filter: drop-shadow(0 0 3px var(--sel)); }
.lines-svg text { font: 13px var(--font); fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 5px; pointer-events: all; cursor: pointer; }
.line-handle { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--card); border: 2px solid var(--sel); cursor: move; z-index: 9999; touch-action: none; }
.line-handle.mid { background: var(--sel); width: 12px; height: 12px; margin: -6px 0 0 -6px; }
.marquee { position: absolute; border: 1px solid var(--sel); background: var(--sel-soft); pointer-events: none; z-index: 9998; }
.empty-hint { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; color: var(--muted); pointer-events: none; max-width: 420px; padding: 0 16px; }
.empty-hint h3 { font: 600 20px var(--serif); color: var(--ink-2); margin: 0 0 6px; }

.zoombar { position: absolute; right: 14px; bottom: 14px; display: flex; align-items: center; background: var(--panel); border-radius: 8px; box-shadow: var(--shadow); z-index: 25; padding: 2px; }
.zoombar .z { min-width: 52px; text-align: center; font-size: 12px; border: 0; background: transparent; cursor: pointer; color: var(--ink-2); }
.drawbar { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; background: var(--panel); border-radius: 10px; box-shadow: var(--shadow-lift); padding: 6px 10px; z-index: 40; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; flex: none; }
.swatch.on { box-shadow: 0 0 0 2px var(--sel); }
.width-dot { width: 26px; height: 26px; border-radius: 6px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.width-dot i { background: var(--ink); border-radius: 50%; display: block; }
.width-dot.on { background: var(--panel-2); }

/* ---------- Karten ---------- */
.el { position: absolute; border-radius: var(--radius); user-select: none; -webkit-user-select: none; }
.el.editing, .el.editing * { user-select: text; -webkit-user-select: text; }
.card { background: var(--card); box-shadow: var(--shadow); color: var(--ink); }
.el.sel > .sel-ring, .el.sel.card, .el.sel .card-sel { outline: 2px solid var(--sel); outline-offset: 1px; }
.el.dragging { box-shadow: var(--shadow-lift); opacity: .96; z-index: 99999 !important; transition: none; transform-origin: center; }
.el.dragging.tilt { rotate: 1.2deg; }
.el.drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; }
.el.locked::after { content: ''; position: absolute; right: -6px; top: -6px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4'%3E%3Crect x='6' y='11' width='12' height='9' rx='2'/%3E%3Cpath d='M9 11V8a3 3 0 0 1 6 0v3'/%3E%3C/svg%3E") center/10px no-repeat; }
.el .resize { position: absolute; right: -5px; bottom: -5px; width: 14px; height: 14px; cursor: nwse-resize; display: none; touch-action: none; z-index: 3; }
.el .resize::after { content: ''; position: absolute; right: 3px; bottom: 3px; width: 8px; height: 8px; border-right: 2px solid var(--sel); border-bottom: 2px solid var(--sel); }
.el .resize.w { top: 0; bottom: 0; height: auto; right: -6px; width: 10px; cursor: ew-resize; }
.el .resize.w::after { right: 3px; top: 50%; bottom: auto; width: 4px; height: 26px; margin-top: -13px; border: 0; background: var(--sel); border-radius: 2px; }
.el.sel:not(.locked) > .resize { display: block; }
.el .connector { position: absolute; right: -24px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; border: 2px solid var(--sel); background: var(--card); cursor: crosshair; display: none; touch-action: none; z-index: 3; }
.el.sel.single > .connector { display: block; }
.el .lbls { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 10px; }
.lbl { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; color: #fff; }
.card-bar { height: 5px; border-radius: var(--radius) var(--radius) 0 0; }

.rt { outline: none; padding: 12px 14px; min-height: 22px; word-wrap: break-word; overflow-wrap: anywhere; cursor: default; }
.el.editing .rt[contenteditable="true"] { cursor: text; }
.rt:empty::before { content: attr(data-ph); color: var(--muted); }
.rt h1 { font: 650 22px/1.25 var(--serif); margin: 4px 0 6px; }
.rt h2 { font: 650 17px/1.3 var(--font); margin: 4px 0 4px; }
.rt h3 { font-size: 15px; margin: 2px 0; }
.rt p, .rt div { margin: 0; }
.rt ul, .rt ol { margin: 2px 0; padding-left: 22px; }
.rt blockquote { margin: 4px 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--line); color: var(--ink-2); }
.rt pre, .rt code { font: 12.5px/1.5 var(--mono); background: var(--panel-2); border-radius: 4px; }
.rt pre { padding: 8px 10px; white-space: pre-wrap; margin: 4px 0; }
.rt code { padding: 1px 4px; }
.rt a { color: var(--sel); }
.rt hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }

/* Notiz-Farben (Hintergrund wie in Milanote) */
.card.c-yellow { background: #fff4c2; } .card.c-orange { background: #ffe1c7; } .card.c-red { background: #ffd6d2; }
.card.c-pink { background: #fbd8ec; } .card.c-purple { background: #e6dcfb; } .card.c-blue { background: #d6e6fd; }
.card.c-teal { background: #cdeee8; } .card.c-green { background: #d9f0d1; } .card.c-gray { background: #e7e5e1; }
.card.c-dark { background: #2c2b29; color: #f2f0ec; }
:root[data-theme="dark"] .card[class*=" c-"]:not(.c-dark), :root:not([data-theme="light"]) .card[class*=" c-"]:not(.c-dark) { color: #1f1e1c; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .card[class*=" c-"]:not(.c-dark) { color: #1f1e1c; } }

/* Überschrift */
.el-heading { padding: 4px 6px; }
.el-heading .rt { padding: 2px 4px; font: 700 24px/1.2 var(--serif); text-align: center; }
.el-heading.size-s .rt { font-size: 18px; }
.el-heading.size-l .rt { font-size: 38px; }

/* To-do */
.todo-title { font-weight: 650; padding: 12px 14px 4px; outline: none; }
.todo-list { list-style: none; margin: 0; padding: 4px 8px 6px; }
.todo-item { display: flex; align-items: flex-start; gap: 8px; padding: 4px 6px; border-radius: 4px; }
.todo-item:hover { background: var(--panel-2); }
.todo-item input[type="checkbox"] { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; flex: none; }
.todo-item .tx { flex: 1; outline: none; min-height: 20px; word-break: break-word; }
.todo-item.done .tx { text-decoration: line-through; color: var(--muted); }
.todo-item .due { font-size: 11px; color: var(--muted); white-space: nowrap; border: 0; background: transparent; padding: 0; cursor: pointer; }
.todo-item .due.late { color: var(--danger); font-weight: 600; }
.todo-item .x { opacity: 0; border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 0; }
.todo-item:hover .x { opacity: 1; }
.todo-add { display: block; width: calc(100% - 16px); margin: 0 8px 8px; text-align: left; border: 0; background: transparent; color: var(--muted); padding: 5px 6px; cursor: pointer; border-radius: 4px; }
.todo-add:hover { background: var(--panel-2); }
.todo-progress { height: 3px; background: var(--line-2); margin: 0 14px 4px; border-radius: 2px; overflow: hidden; }
.todo-progress i { display: block; height: 100%; background: var(--ok); }

/* Spalte */
.el-column { background: var(--panel-2); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); padding: 0 0 8px; }
.col-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 8px 12px; }
.col-title { flex: 1; font-weight: 650; outline: none; min-width: 20px; }
.col-title:empty::before { content: 'Spalte'; color: var(--muted); }
.col-count { font-size: 12px; color: var(--muted); }
.col-toggle { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 2px; border-radius: 4px; }
.col-body { display: flex; flex-direction: column; gap: 8px; padding: 0 8px; min-height: 50px; }
.col-body > .el { position: relative; left: auto !important; top: auto !important; width: auto !important; }
.el-column.collapsed .col-body { display: none; }
.col-drop { height: 4px; border-radius: 2px; background: var(--accent); margin: -2px 0; }
.col-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 14px 6px; border: 1px dashed var(--line); border-radius: 6px; }

/* Board-Karte (wie Milanote: Titel in Serifenschrift, Kartenzahl, Vorschau) */
.el-board { display: flex; flex-direction: column; align-items: center; padding: 18px 10px 10px; text-align: center; cursor: pointer; }
.board-title { font: 650 19px/1.25 var(--serif); outline: none; word-break: break-word; }
.board-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.board-prev { position: relative; width: 100%; height: 78px; margin-top: 12px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.board-prev i { position: absolute; background: var(--card); box-shadow: 0 0 0 1px var(--line); border-radius: 1px; }
.board-prev i.dark { background: var(--line); box-shadow: none; }
.board-dot { position: absolute; left: 10px; top: 10px; width: 10px; height: 10px; border-radius: 3px; }

/* Link */
.el-link { overflow: hidden; }
.link-img { width: 100%; aspect-ratio: 1.91; object-fit: cover; display: block; background: var(--panel-2); }
.link-body { padding: 10px 12px 12px; }
.link-title { font-weight: 650; line-height: 1.3; }
.link-desc { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.link-site { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.link-site a { color: var(--sel); text-decoration: none; }
.link-edit { padding: 10px; display: grid; gap: 6px; }

/* Bild */
.el-image { overflow: hidden; background: var(--card); }
.img-wrap { overflow: hidden; display: grid; place-items: center; background: var(--panel-2); border-radius: var(--radius) var(--radius) 0 0; }
.img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.el-image .caption { padding: 7px 10px 8px; font-size: 13px; outline: none; min-height: 20px; color: var(--ink-2); }
.el-image .caption:empty::before { content: 'Bildunterschrift'; color: var(--muted); }
.el-image .caption.hide-empty:empty { display: none; }
.el-image.no-caption .img-wrap { border-radius: var(--radius); }
.uploading { display: grid; place-items: center; min-height: 120px; color: var(--muted); font-size: 13px; }

/* Datei */
.el-file { display: flex; gap: 10px; padding: 12px; align-items: center; }
.file-badge { width: 42px; height: 52px; border-radius: 4px; background: var(--accent); color: #fff; font: 700 10px var(--font); display: grid; place-items: end center; padding-bottom: 6px; flex: none; text-transform: uppercase; }
.file-info { min-width: 0; }
.file-name { font-weight: 600; word-break: break-all; }
.file-meta { font-size: 12px; color: var(--muted); }
.file-meta a { color: var(--sel); }

/* Farbe */
.el-color { overflow: hidden; }
.color-chip { height: 90px; border-radius: var(--radius) var(--radius) 0 0; cursor: pointer; position: relative; }
.color-chip input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.color-info { padding: 8px 10px 10px; }
.color-name { font-weight: 600; outline: none; }
.color-name:empty::before { content: 'Farbname'; color: var(--muted); }
.color-codes { font: 11px var(--mono); color: var(--muted); }

/* Skizze + Zeichnung */
.el-sketch { overflow: hidden; }
.sketch-svg { display: block; width: 100%; height: 100%; background: var(--card); border-radius: var(--radius); }
.sketch-hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; pointer-events: none; }
.el-drawing svg { display: block; overflow: visible; width: 100%; height: 100%; }
.el-drawing.sel { outline: 1px dashed var(--sel); outline-offset: 4px; }

/* Kommentar */
.el-comment { border-radius: 10px; }
.cm-list { padding: 10px 12px 2px; display: grid; gap: 10px; }
.cm { display: grid; grid-template-columns: 26px 1fr; gap: 8px; }
.cm-av { width: 26px; height: 26px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.cm-who { font-size: 12px; font-weight: 650; }
.cm-who span { color: var(--muted); font-weight: 400; margin-left: 6px; }
.cm-text { white-space: pre-wrap; word-break: break-word; }
.cm-reply { display: flex; gap: 6px; padding: 8px 10px 10px; }
.cm-reply textarea { flex: 1; min-height: 34px; height: 34px; resize: none; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: inherit; background: var(--card); color: var(--ink); }
.cm-head { display: flex; align-items: center; gap: 6px; padding: 8px 12px 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.cm-head .ic { width: 14px; height: 14px; }
.cm-resolved { opacity: .6; }

/* Tabelle */
.el-table { overflow: hidden; }
.tbl-title { font-weight: 650; padding: 10px 12px 6px; outline: none; }
.tbl-wrap { overflow-x: auto; padding: 0 0 4px; }
.tbl { border-collapse: collapse; width: 100%; font-size: 13px; }
.tbl td { border: 1px solid var(--line); padding: 5px 8px; min-width: 60px; outline: none; vertical-align: top; word-break: break-word; }
.tbl tr:first-child td { font-weight: 650; background: var(--panel-2); }
.tbl tr.sum td { font-weight: 650; background: var(--panel-2); color: var(--ink-2); }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-actions { display: flex; gap: 4px; padding: 6px 8px 8px; }

/* Dokument: Datei-Symbol mit Titel und Wortzahl, ohne Kartenhintergrund */
.el-document { background: transparent !important; box-shadow: none !important; padding: 4px; cursor: pointer; text-align: center; }
.doc-icon { width: 62px; height: 74px; margin: 0 auto 8px; background: var(--card); box-shadow: var(--shadow); clip-path: polygon(0 0, 78% 0, 100% 16%, 100% 100%, 0 100%); display: grid; place-items: center; font: 700 17px var(--serif); color: var(--ink); }
.doc-title { font-weight: 600; font-size: 15px; word-break: break-word; }
.doc-snippet { font-size: 12.5px; color: var(--muted); }

/* Video/Audio/Karte */
.el-embed { overflow: hidden; }
.embed-box { position: relative; background: #111; color: #ddd; display: grid; place-items: center; text-align: center; overflow: hidden; }
.embed-box iframe, .embed-box video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-load { display: grid; gap: 6px; justify-items: center; padding: 12px; font-size: 12.5px; }
.embed-load .btn { height: 30px; }
.embed-cap { padding: 8px 10px; font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.embed-cap a { color: var(--sel); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed-cap .ic { width: 15px; height: 15px; color: var(--muted); }
.el-embed audio { width: 100%; display: block; }
.el-embed .shield { position: absolute; inset: 0; }
.el.sel .shield, .el:not(.sel) .shield { display: block; }
.el.sel.activated .shield { display: none; }

/* Shot-Karte */
.el-shot { overflow: hidden; }
.shot-frame { aspect-ratio: 16 / 9; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.shot-frame img, .shot-frame svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-frame svg.ic { width: 34px; height: 34px; }
.shot-no .scn { font: 600 12px var(--font); color: var(--ink-2); }
.shot-info { padding: 8px 10px 10px; }
.shot-no { font: 700 13px var(--mono); color: var(--accent); }
.shot-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.shot-tags span { font-size: 11px; background: var(--panel-2); border-radius: 4px; padding: 1px 6px; color: var(--ink-2); }
.shot-desc { font-size: 12.5px; color: var(--ink-2); }

/* ---------- Schwebende Werkzeugleiste ---------- */
.floatbar { position: absolute; z-index: 50; display: flex; align-items: center; gap: 1px; background: var(--panel); border-radius: 8px; box-shadow: var(--shadow-lift); padding: 3px; transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; }
.floatbar .icon-btn { width: 30px; height: 30px; }
.floatbar .icon-btn .ic { width: 17px; height: 17px; }
.floatbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 3px; }
.floatbar select { height: 28px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 12px; }
.pop { position: absolute; z-index: 60; background: var(--panel); border-radius: 10px; box-shadow: var(--shadow-lift); padding: 10px; }
.pop-colors { display: grid; grid-template-columns: repeat(6, 24px); gap: 8px; }
.pop h4 { margin: 0 0 8px; font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- Kontextmenü ---------- */
.ctx-menu { position: fixed; z-index: 1000; min-width: 210px; background: var(--panel); border-radius: 8px; box-shadow: var(--shadow-lift); padding: 4px; border: 1px solid var(--line-2); }
.ctx-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; border: 0; background: transparent; border-radius: 5px; cursor: pointer; text-align: left; font-size: 13px; }
.ctx-menu button span { flex: 1; }
.ctx-menu button:hover:not(:disabled) { background: var(--panel-2); }
.ctx-menu button.danger { color: var(--danger); }
.ctx-menu button:disabled { opacity: .45; }
.ctx-menu .ic { width: 16px; height: 16px; color: var(--muted); }
.ic-space { width: 16px; flex: none; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* ---------- Unsortiert-Leiste ---------- */
.drawer { width: 260px; flex: none; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; z-index: 20; }
.drawer-head { display: flex; align-items: center; gap: 6px; padding: 10px 8px 8px 14px; font-weight: 650; }
.drawer-head span { flex: 1; }
.drawer-list { flex: 1; overflow-y: auto; padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.drawer-list.drop { background: var(--accent-soft); }
.unsorted-item { background: var(--card); border-radius: 6px; box-shadow: var(--shadow); padding: 10px 12px; cursor: grab; font-size: 13px; position: relative; touch-action: none; }
.unsorted-item .x { position: absolute; right: 4px; top: 4px; opacity: 0; }
.unsorted-item:hover .x { opacity: 1; }
.unsorted-item .ty { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.unsorted-item .ty .ic { width: 13px; height: 13px; }
.drawer-add { margin: 0 10px 12px; }
.drawer-add textarea { width: 100%; min-height: 60px; }

/* ---------- Modale ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(20, 18, 15, .42); display: grid; place-items: center; z-index: 500; padding: 16px; }
.modal { width: min(460px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-lift); overflow: hidden; }
.modal.wide { width: min(900px, 100%); }
.modal.full { width: min(1200px, 100%); height: calc(100vh - 32px); }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { margin: 0; font: 650 18px var(--serif); flex: 1; }
.modal-body { padding: 16px 20px; overflow: auto; flex: 1; }
.modal-body p { margin: 0 0 10px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line-2); }

.list { display: grid; gap: 4px; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; background: var(--card); border: 1px solid var(--line-2); }
.list-item .grow { min-width: 0; }
.list-item .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .s { font-size: 12px; color: var(--muted); }
button.list-item { cursor: pointer; text-align: left; width: 100%; }
button.list-item:hover { border-color: var(--sel); }

.search-box { position: relative; }
.search-box .ic { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.search-box .input { padding-left: 36px; height: 40px; font-size: 15px; }
.search-results { margin-top: 12px; display: grid; gap: 4px; }
.search-results mark { background: var(--accent-soft); color: inherit; border-radius: 2px; }
.search-group { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 10px 0 2px; font-weight: 600; }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tpl { border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 0; text-align: left; cursor: pointer; overflow: hidden; }
.tpl:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.tpl-prev { height: 96px; background: var(--panel-2); display: grid; place-items: center; color: var(--muted); }
.tpl-prev .ic { width: 34px; height: 34px; }
.tpl-body { padding: 10px 12px 12px; }
.tpl-body b { display: block; }
.tpl-body span { font-size: 12px; color: var(--muted); }

.label-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.label-row .lbl { cursor: pointer; }
.label-row input[type="checkbox"] { width: 16px; height: 16px; }

/* Rich-Text-Leiste */
.rtbar { position: absolute; z-index: 60; display: flex; gap: 1px; background: var(--ink); color: var(--panel); border-radius: 8px; padding: 3px; box-shadow: var(--shadow-lift); transform: translate(-50%, calc(-100% - 8px)); }
.rtbar button { width: 28px; height: 28px; border: 0; background: transparent; color: inherit; border-radius: 5px; cursor: pointer; display: grid; place-items: center; }
.rtbar button:hover, .rtbar button.on { background: rgba(255, 255, 255, .16); }
.rtbar .ic { width: 16px; height: 16px; }
.rtbar .sep { width: 1px; background: rgba(255, 255, 255, .2); margin: 4px 2px; }
.rtbar .col { width: 14px; height: 14px; border-radius: 50%; display: block; border: 1px solid rgba(255, 255, 255, .5); }

/* Dokument-Editor */
.doc-editor { display: flex; flex-direction: column; height: 100%; }
.doc-editor .doc-tools { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px 20px; border-bottom: 1px solid var(--line-2); }
.doc-editor .doc-scroll { flex: 1; overflow: auto; background: var(--panel-2); padding: 24px 12px; }
.doc-editor .doc-paper { max-width: 760px; margin: 0 auto; background: var(--card); box-shadow: var(--shadow); border-radius: 4px; padding: 40px 48px; min-height: 100%; }
.doc-editor .doc-paper .doc-h { font: 650 28px var(--serif); outline: none; margin-bottom: 14px; }
.doc-editor .doc-paper .rt { padding: 0; font-size: 15px; line-height: 1.65; min-height: 400px; cursor: text; }
.modal.full .modal-body { padding: 0; }

/* Skizzen-Editor */
.sk-editor { display: flex; flex-direction: column; gap: 10px; }
.sk-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sk-stage { background: var(--card); border: 1px solid var(--line); border-radius: 8px; touch-action: none; cursor: crosshair; width: 100%; display: block; }

/* Zuschneiden */
.crop-stage { position: relative; display: inline-block; max-width: 100%; user-select: none; touch-action: none; }
.crop-stage img { display: block; max-width: 100%; max-height: 60vh; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .5); cursor: move; }
.crop-box i { position: absolute; width: 14px; height: 14px; background: #fff; border-radius: 2px; }
.crop-box i[data-h="nw"] { left: -7px; top: -7px; cursor: nwse-resize; } .crop-box i[data-h="ne"] { right: -7px; top: -7px; cursor: nesw-resize; }
.crop-box i[data-h="sw"] { left: -7px; bottom: -7px; cursor: nesw-resize; } .crop-box i[data-h="se"] { right: -7px; bottom: -7px; cursor: nwse-resize; }

/* Präsentation */
body.presenting .topbar, body.presenting .toolbar, body.presenting .drawer, body.presenting .zoombar, body.presenting .floatbar { display: none !important; }
body.presenting #view { top: 0; }
body.presenting .canvas { background-image: none; }
.present-exit { position: fixed; right: 14px; top: 14px; z-index: 100; opacity: .4; }
.present-exit:hover { opacity: 1; }
body.presenting.hide-comments .el-comment { display: none; }

/* Toasts */
#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 2000; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--panel); padding: 9px 14px; border-radius: 8px; box-shadow: var(--shadow-lift); font-size: 13px; transition: opacity .3s, transform .3s; max-width: calc(100vw - 32px); }
.toast.err { background: var(--danger); color: #fff; }
.toast button { border: 0; background: transparent; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0; }
.toast.err button { color: #fff; text-decoration: underline; }
.toast.out { opacity: 0; transform: translateY(8px); }

#print-root { display: none; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 760px) {
  :root { --top: 50px; }
  .brand-name, .crumbs { display: none; }
  .topbar { gap: 6px; padding: 0 6px 0 8px; }
  .tabs a { padding: 5px 8px; }
  .top-actions { margin-left: auto; overflow-x: auto; }
  .board-view { flex-direction: column-reverse; }
  .toolbar { width: auto; height: 64px; flex-direction: row; border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; padding: 4px 6px; }
  .tool { min-width: 58px; }
  .tool-sep { width: 1px; height: auto; margin: 8px 4px; }
  .drawer { position: absolute; right: 0; top: 0; bottom: 64px; width: min(300px, 86vw); box-shadow: var(--shadow-lift); }
  .zoombar { bottom: 76px; right: 10px; }
  .save-state { display: none; }
}
