/* ===== Farben: hell (Papier) & dunkel ===== */
:root {
  --bg: #f6f1e7; --surface: #fffdf8; --surface2: #efe8da; --line: #e2d8c5;
  --text: #2b2620; --muted: #847a6b; --accent: #a0522d; --accent-soft: #f3e2d6;
  --danger: #b3261e; --ok: #4f7a3a;
  --s-idee: #9aa0a6; --s-entwurf: #d29a2b; --s-ueberarbeitung: #3d7fc1; --s-fertig: #4f9a52;
  --shadow: 0 1px 2px rgba(60,40,10,.06), 0 6px 20px rgba(60,40,10,.06);
  --serif: 'Literata', Georgia, serif; --sans: 'Inter', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a; --surface: #1d2024; --surface2: #262a30; --line: #30353c;
    --text: #e8e4dc; --muted: #9a958c; --accent: #e0915f; --accent-soft: #3a2a20;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171a; --surface: #1d2024; --surface2: #262a30; --line: #30353c;
  --text: #e8e4dc; --muted: #9a958c; --accent: #e0915f; --accent-soft: #3a2a20;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); overflow-x: hidden; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; }
h2 { font-size: 1.25rem; } h3 { font-size: 1rem; }
.muted { color: var(--muted); } .pad { padding: 0 16px; }
.spacer { flex: 1; }
.err { color: var(--danger); min-height: 1.2em; margin: 0; font-size: .9rem; }

/* Buttons & Felder */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 500; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--accent); }
.btn.small { padding: 6px 11px; font-size: .88rem; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.ghost[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.icon { width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; font-size: 1.15rem; display: inline-grid; place-items: center; }
.icon:hover { background: var(--surface2); }
input, select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
label > input, label > textarea, label > select { margin-top: 4px; color: var(--text); font-size: .95rem; }
textarea { resize: vertical; }

/* Login */
.auth { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px 24px; box-shadow: var(--shadow); text-align: center; display: grid; gap: 12px; }
.auth-card h1 { font-size: 1.6rem; }
.auth-card p { margin: 0; }
.logo { font-size: 2.2rem; color: var(--accent); font-family: var(--serif); }

/* Layout */
#app { min-height: 100%; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 8px 16px; flex-wrap: wrap; }
.book-title { flex: 1 1 160px; border: none; background: transparent; font: 600 1.15rem var(--serif); padding: 6px 4px; }
.book-title:hover { background: var(--surface2); }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: none; background: transparent; padding: 8px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; color: var(--muted); font-weight: 500; }
.tabs button.on { background: var(--accent-soft); color: var(--accent); }
.top-actions { display: flex; gap: 2px; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 230px; padding: 6px; z-index: 30; }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: none; background: none; border-radius: 8px; color: var(--text); text-decoration: none; cursor: pointer; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface2); }

.view { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px 16px 80px; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 12px; }
.view-head:not(:first-child) { margin-top: 28px; }
.hint { margin: -4px 0 14px; font-size: .88rem; }

/* Schreiben */
.view.write { max-width: none; padding: 0; display: flex; min-height: 0; }
.chapters { width: 280px; flex-shrink: 0; border-right: 1px solid var(--line); background: var(--surface); padding: 16px 0; position: sticky; top: 55px; height: calc(100vh - 55px - 41px); overflow-y: auto; }
.side-head { display: flex; justify-content: space-between; align-items: center; padding: 0 16px 10px; }
.search { padding: 0 12px 10px; }
.search input { padding: 8px 11px; font-size: .9rem; }
.search-results { padding: 0 8px 10px; }
.search-results .info { padding: 4px 10px 8px; font-size: .8rem; color: var(--muted); }
.hit { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.hit:hover { background: var(--surface2); }
.hit small { display: block; color: var(--accent); font-size: .76rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit span { display: block; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.hit mark { background: var(--accent-soft); color: var(--text); border-radius: 3px; padding: 0 1px; }
.chapter-list { list-style: none; margin: 0; padding: 0 8px; }
.chapter-list li { display: flex; align-items: center; gap: 8px; padding: 9px 8px 9px 10px; border-radius: 10px; cursor: pointer; }
.chapter-list li:hover { background: var(--surface2); }
.chapter-list li.on { background: var(--accent-soft); }
.chapter-list .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.chapter-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-list .wc { font-size: .78rem; color: var(--muted); }
.chapter-list .mv { display: flex; flex-direction: column; opacity: 0; }
.chapter-list li:hover .mv, .chapter-list li.on .mv { opacity: 1; }
.chapter-list .mv button { border: none; background: none; cursor: pointer; padding: 0 4px; line-height: 1; font-size: .7rem; color: var(--muted); }
.chapter-list .mv button:hover { color: var(--accent); }
.dot.idee { background: var(--s-idee); } .dot.entwurf { background: var(--s-entwurf); }
.dot.ueberarbeitung { background: var(--s-ueberarbeitung); } .dot.fertig { background: var(--s-fertig); }

.editor-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.empty { margin: auto; text-align: center; padding: 60px 16px; color: var(--muted); }
.editor { flex: 1; display: flex; flex-direction: column; }
.ed-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ed-bar select { width: auto; padding: 6px 10px; font-size: .88rem; }
.ed-body { flex: 1; display: flex; }
.paper { flex: 1; min-width: 0; max-width: 760px; margin: 0 auto; padding: 36px 24px 60px; }
.ch-title { border: none; background: transparent; font: 600 1.9rem/1.25 var(--serif); padding: 4px 0; margin-bottom: 18px; }
.ch-title:focus, .ch-text:focus { outline: none; }
.ch-text { border: none; background: transparent; resize: none; font: 1.13rem/1.85 var(--serif); padding: 0; min-height: 60vh; overflow: hidden; }
.notes { width: 300px; flex-shrink: 0; border-left: 1px solid var(--line); padding: 20px 16px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.notes-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notes textarea { flex: 1; min-height: 260px; font-size: .92rem; }

.foot { position: sticky; bottom: 0; z-index: 10; display: flex; gap: 14px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface); font-size: .82rem; color: var(--muted); }
.save-state.dirty { color: var(--accent); }
.save-state.error { color: var(--danger); }
.goal-mini.done { color: var(--ok); font-weight: 600; }

/* Fokusmodus */
body.focus .top, body.focus .chapters, body.focus .notes, body.focus .ed-bar > *:not(#focusBtn), body.focus .foot { display: none !important; }
body.focus .ed-bar { border: none; justify-content: flex-end; opacity: .25; position: fixed; top: 0; right: 0; z-index: 5; }
body.focus .ed-bar:hover { opacity: 1; }
body.focus .paper { padding-top: 12vh; }

/* Plot-Board */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.col { background: var(--surface2); border-radius: 14px; padding: 12px; min-height: 120px; }
.col.over { outline: 2px dashed var(--accent); }
.col h3 { font-size: .95rem; display: flex; justify-content: space-between; margin-bottom: 10px; }
.col h3 small { color: var(--muted); font-family: var(--sans); font-weight: 400; }
.scene { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow); }
.scene.dragging { opacity: .4; }
.scene b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.scene p { margin: 4px 0 0; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tag { display: inline-block; margin-top: 6px; font-size: .74rem; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Figuren & Orte */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; cursor: pointer; box-shadow: var(--shadow); min-width: 0; }
.card:hover { border-color: var(--accent); }
.card .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 600 1.1rem var(--serif); margin-bottom: 10px; }
.card b { font-family: var(--serif); font-size: 1.05rem; overflow-wrap: anywhere; }
.card .role { color: var(--accent); font-size: .85rem; }
.card p { margin: 8px 0 0; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card.add { border-style: dashed; box-shadow: none; display: grid; place-items: center; color: var(--muted); min-height: 100px; background: transparent; }

/* Statistik */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.kpi span { display: block; font: 600 1.8rem var(--serif); }
.kpi small { color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 14px; }
.panel h3 { margin-bottom: 12px; }
.goal-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.goal-row label { margin: 0; flex: 1; color: var(--text); font-size: .95rem; }
.goal-row input { width: 120px; }
.progress { height: 10px; background: var(--surface2); border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; background: var(--accent); width: 0; transition: width .4s; }
.goal-done .progress div { background: var(--ok); }
.panel > p { margin: 8px 0 0; }
.hist { display: flex; align-items: flex-end; gap: 3px; height: 140px; }
.hist .bar { flex: 1; min-width: 0; background: var(--accent); opacity: .85; border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.hist .bar.zero { background: var(--line); }
.hist .bar:hover { opacity: 1; }
.status-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface2); margin-bottom: 8px; }
.status-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .82rem; color: var(--muted); margin-bottom: 12px; }
.status-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ch-stats { list-style: none; margin: 0; padding: 0; }
.ch-stats li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.ch-stats .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dialoge */
.dlg { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); padding: 20px; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: var(--shadow); }
.dlg.wide { width: min(860px, calc(100vw - 24px)); }
.dlg::backdrop { background: rgba(0,0,0,.4); }
.dlg h3 { margin-bottom: 14px; font-size: 1.2rem; }
.dlg-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.versions { display: grid; grid-template-columns: 220px 1fr; gap: 12px; margin: 12px 0; }
.versions ul { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.versions li { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: .88rem; }
.versions li small { display: block; color: var(--muted); }
.versions li:hover { background: var(--surface2); }
.versions li.on { background: var(--accent-soft); }
.v-preview { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: .92rem/1.6 var(--serif); background: var(--bg); border-radius: 10px; padding: 14px; max-height: 50vh; overflow-y: auto; }

.toast { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 100; font-size: .9rem; max-width: calc(100vw - 32px); }
.only-mobile { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 39; }
.print-area { display: none; }

/* ===== Tablet / Handy ===== */
@media (max-width: 1000px) {
  .notes { position: fixed; right: 0; top: 0; bottom: 0; z-index: 40; width: min(340px, 90vw); box-shadow: var(--shadow); }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .top { gap: 6px 8px; padding: 6px 12px; }
  .book-title { order: 1; flex: 1 1 0; font-size: 1.05rem; }
  .top-actions { order: 2; }
  .tabs { order: 3; width: 100%; }
  .only-mobile { display: inline-block; }
  .ed-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  .ed-bar::-webkit-scrollbar { display: none; }
  .ed-bar > * { flex-shrink: 0; }
  .ed-bar .spacer { display: none; }
  .ed-bar select { width: 108px; }
  .chapters { position: fixed; left: 0; top: 0; bottom: 0; height: 100%; z-index: 40; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .2s; }
  .chapters.open { transform: none; box-shadow: var(--shadow); }
  .chapter-list .mv { opacity: 1; }
  .paper { padding: 22px 16px 60px; }
  .ch-title { font-size: 1.5rem; }
  .ch-text { font-size: 1.05rem; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-template-columns: minmax(0, 1fr); }
  .versions { grid-template-columns: minmax(0, 1fr); }
  .versions ul { max-height: 160px; }
  .foot { gap: 10px; }
}
@media (max-width: 380px) {
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .kpi span { font-size: 1.45rem; }
  .ed-bar .btn.small { padding: 6px 8px; }
  #wcChapter { display: none; }
}


/* ===== Neu: Plan, Werkzeuge, Ideen, Timer, Prüfen ===== */
.head-btns { display: flex; gap: 8px; }
.view.narrow { max-width: 760px; }
.ed-bar .menu-list { top: 40px; min-width: 210px; }
.plan { margin: 0 0 18px; border: 1px dashed var(--line); border-radius: 12px; padding: 0 14px; background: var(--surface); }
.plan[open] { padding-bottom: 12px; }
.plan summary { cursor: pointer; padding: 10px 0; font-size: .85rem; color: var(--muted); font-weight: 500; list-style: none; }
.plan summary::-webkit-details-marker { display: none; }
.plan summary::before { content: '▸ '; }
.plan[open] summary::before { content: '▾ '; }
.plan.filled summary { color: var(--accent); }
.plan textarea { font-size: .92rem; resize: vertical; }

.small-cap { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; margin: 0 0 8px; }
.prompt-text { font: 1.25rem/1.5 var(--serif); margin: 0 0 18px; }

.tpl-list { display: grid; gap: 10px; margin: 14px 0 6px; }
.tpl { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.tpl:hover { border-color: var(--accent); }
.tpl b { display: block; font-family: var(--serif); }
.tpl span { font-size: .85rem; color: var(--muted); }

.timer-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin: 14px 0 6px; }
.timer-pill { position: fixed; left: 50%; transform: translateX(-50%); bottom: 54px; z-index: 50; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--accent); border-radius: 999px; padding: 4px 6px 4px 16px; box-shadow: var(--shadow); font-size: .9rem; white-space: nowrap; }
.timer-pill #timerTime { font: 600 1.05rem var(--sans); font-variant-numeric: tabular-nums; color: var(--accent); }
.timer-pill .icon { width: 30px; height: 30px; font-size: .85rem; }
body.focus .timer-pill { bottom: 16px; }

.check-sum { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.check-sum span { background: var(--surface2); border-radius: 99px; padding: 4px 12px; font-size: .85rem; }
.check-list { max-height: 55vh; overflow-y: auto; }
.check-list h4 { margin: 14px 0 6px; font: 600 .9rem var(--sans); }
.check-item { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: .9rem; overflow-wrap: anywhere; }
.check-item:hover { background: var(--surface2); }
.check-item mark { background: var(--accent-soft); color: var(--text); border-radius: 3px; padding: 0 2px; }
.check-item small { color: var(--muted); }

.idea-new { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 16px; }
.idea-new textarea { flex: 1; }
.ideas { display: grid; gap: 10px; }
.idea { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.idea p { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; }
.idea .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }

.e-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.e-fields label { margin-bottom: 10px; }
.e-fields textarea { min-height: 62px; }
.card .fill { margin-top: 10px; height: 4px; border-radius: 99px; background: var(--surface2); overflow: hidden; }
.card .fill i { display: block; height: 100%; background: var(--accent); }
.dlg { overflow-y: auto; }
@media (max-width: 760px) {
  .ed-bar .menu-list { position: fixed; top: auto; bottom: 50px; right: 12px; left: 12px; min-width: 0; }
  .e-fields { grid-template-columns: minmax(0, 1fr); }
  .idea-new { flex-direction: column; align-items: stretch; }
}


/* ===== Neu: Szenen, Kommentare, Zeitleiste, Beziehungen, Notizbuch, Statistik ===== */
.seg { display: inline-flex; background: var(--surface2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: none; background: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: .88rem; color: var(--muted); font-weight: 500; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff; font-size: .72rem; line-height: 18px; text-align: center; }
.count:empty { display: none; }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.sub-head .hint { margin: 0; flex: 1 1 240px; }
.sub-head select { width: auto; max-width: 100%; }
.quote { border-left: 3px solid var(--accent); padding: 4px 10px; margin: 0 0 12px; font: italic .95rem/1.5 var(--serif); color: var(--muted); overflow-wrap: anywhere; }

/* Szenen in der Kapitelliste */
.scenes { list-style: none; margin: 0 0 6px 26px; padding: 0; border-left: 1px solid var(--line); }
.scenes li { display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; font-size: .82rem; color: var(--muted); border-radius: 8px; cursor: pointer; }
.scenes li:hover { background: var(--surface2); color: var(--text); }
.scenes .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scenes .mv { opacity: 1; display: flex; flex-direction: row; }
.scenes .mv button { border: none; background: none; cursor: pointer; color: var(--muted); font-size: .7rem; padding: 2px 4px; }
.scenes .mv button:disabled { opacity: .3; cursor: default; }

/* Schreibmaschine */
body.typewriter .paper { padding-bottom: 55vh; }
.menu-list button.active::after { content: ' ✓'; color: var(--accent); }

/* Kommentare */
.comment-list { flex: 1; overflow-y: auto; display: grid; gap: 8px; align-content: start; }
.cm { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--bg); cursor: pointer; }
.cm:hover { border-color: var(--accent); }
.cm.done { opacity: .55; }
.cm .quote { margin-bottom: 6px; font-size: .85rem; }
.cm p { margin: 0; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.cm .row { display: flex; gap: 6px; align-items: center; margin-top: 8px; font-size: .78rem; color: var(--muted); flex-wrap: wrap; }
.cm .who { color: var(--accent); font-weight: 600; }

/* Zeitleiste */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-day { margin-bottom: 18px; }
.tl-day h3 { font-size: 1rem; margin-bottom: 8px; position: relative; }
.tl-day h3::before { content: ''; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.tl-ev { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.tl-ev:hover { border-color: var(--accent); }
.tl-ev time { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; font-size: .9rem; }
.tl-ev b { display: block; overflow-wrap: anywhere; }
.tl-ev p { margin: 2px 0 0; font-size: .87rem; color: var(--muted); overflow-wrap: anywhere; }

/* Beziehungen */
.net-panel { padding: 12px; }
.rel-net svg { width: 100%; height: auto; display: block; }
.rel-net .node circle { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.rel-net .node text { fill: var(--text); font: 600 13px var(--sans); }
.rel-net .edge { stroke-width: 2.5; cursor: pointer; }
.rel-net .edge.pos, .ln.pos { stroke: var(--ok); background: var(--ok); }
.rel-net .edge.neg, .ln.neg { stroke: var(--danger); background: var(--danger); }
.rel-net .edge.neu, .ln.neu { stroke: var(--muted); background: var(--muted); }
.rel-net .elabel { fill: var(--muted); font: 11px var(--sans); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.net-legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); margin: 8px 4px; flex-wrap: wrap; }
.net-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ln { display: inline-block; width: 18px; height: 3px; border-radius: 2px; }
.rel-list { list-style: none; margin: 0; padding: 0; }
.rel-list li { display: flex; gap: 8px; align-items: center; padding: 8px 4px; border-top: 1px solid var(--line); cursor: pointer; font-size: .92rem; min-width: 0; }
.rel-list li span { min-width: 0; overflow-wrap: anywhere; }
.rel-list li:hover { color: var(--accent); }
.tones { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.tones label { display: inline-flex; gap: 6px; align-items: center; margin: 0; color: var(--text); font-size: .92rem; }
.tones input { width: auto; }
.mentions { font-size: .88rem; color: var(--muted); margin: 0 0 12px; }
.mentions b { color: var(--text); font-weight: 600; }
.card .seen { margin-top: 6px; font-size: .78rem; color: var(--muted); }

/* Recherche */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.res { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; min-width: 0; }
.res:hover { border-color: var(--accent); }
.res img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface2); }
.res .body { padding: 10px 12px; min-width: 0; }
.res b { display: block; overflow-wrap: anywhere; }
.res p { margin: 4px 0 0; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.res a { font-size: .82rem; color: var(--accent); overflow-wrap: anywhere; }
.res .kind { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.res-big { max-width: 100%; max-height: 50vh; border-radius: 10px; display: block; margin: 0 auto 12px; }

/* Tagebuch */
.j-form { display: grid; gap: 10px; }
.j-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.j-row input[type=date] { width: auto; }
.moods { display: flex; gap: 4px; }
.moods button { font-size: 1.3rem; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; filter: grayscale(1); opacity: .55; }
.moods button.on { filter: none; opacity: 1; border-color: var(--accent); background: var(--accent-soft); }
.j-list { display: grid; gap: 10px; }
.j-entry { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.j-entry .head { display: flex; gap: 8px; align-items: center; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.j-entry .head b { color: var(--text); }
.j-entry .head .mood { font-size: 1.2rem; }
.j-entry p { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Statistik: Buch-Ziel, Kalender, Meilensteine */
.bg-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cal-wrap { overflow-x: auto; padding-bottom: 4px; }
.calendar { display: grid; grid-template-rows: repeat(7, 12px); grid-auto-flow: column; grid-auto-columns: 12px; gap: 3px; width: max-content; }
.calendar i, .cal-legend i { width: 12px; height: 12px; border-radius: 3px; display: block; }
.c0 { background: var(--surface2); } .c1 { background: color-mix(in srgb, var(--accent) 30%, var(--surface2)); }
.c2 { background: color-mix(in srgb, var(--accent) 55%, var(--surface2)); } .c3 { background: color-mix(in srgb, var(--accent) 80%, var(--surface2)); }
.c4 { background: var(--accent); }
.calendar i.empty { background: transparent; }
.cal-legend { display: flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--muted); margin-top: 8px; justify-content: flex-end; }
.milestones { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.ms { border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; font-size: .82rem; color: var(--muted); }
.ms .ic { font-size: 1.4rem; display: block; filter: grayscale(1); opacity: .4; }
.ms b { display: block; color: var(--text); font-size: .9rem; }
.ms.got { border-color: var(--accent); background: var(--accent-soft); }
.ms.got .ic { filter: none; opacity: 1; }

/* Testleser */
.share-list { display: grid; gap: 10px; margin: 12px 0; }
.share { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.share .top-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.share .top-row b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.share .url { display: flex; gap: 6px; margin: 8px 0; }
.share .url input { font-size: .82rem; }
.share small { color: var(--muted); }
.share-new h4 { margin: 0 0 10px; font: 600 .95rem var(--sans); }
.share-chs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; margin-bottom: 8px; }
.share-chs label { display: flex; gap: 8px; align-items: center; margin: 0; color: var(--text); font-size: .9rem; min-width: 0; }
.share-chs label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-chs input { width: auto; flex-shrink: 0; }
@media (max-width: 760px) {
  .bg-row { grid-template-columns: minmax(0, 1fr); }
  .view-head { flex-wrap: wrap; }
  .tl-ev { grid-template-columns: 46px minmax(0, 1fr); }
}

.kind-list { display: grid; gap: 10px; margin: 14px 0 6px; }
.tpl.on { border-color: var(--accent); background: var(--accent-soft); }
.col h3 .col-name { outline: none; border-radius: 6px; padding: 0 4px; margin-left: -4px; cursor: text; min-width: 30px; overflow-wrap: anywhere; }
.col h3 .col-name:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--accent); }
.tpl-group { font: 600 .78rem var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 -4px; }

/* ===== Spiele, Interviews, Fakten, Werkstatt, Export, Lesemodus ===== */
.match-list, .iv-list, .fact-list { display: grid; gap: 10px; }
.match { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
.match:hover { border-color: var(--accent); }
.match .when { text-align: center; font-size: .78rem; color: var(--muted); line-height: 1.25; }
.match .when b { display: block; font: 600 1.25rem var(--serif); color: var(--text); }
.match .teams { font-weight: 600; overflow-wrap: anywhere; }
.match .score { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-variant-numeric: tabular-nums; }
.match .meta { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.match p { margin: 6px 0 0; font-size: .9rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.match .row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pick-list { display: grid; gap: 6px; margin: 12px 0; max-height: 50vh; overflow-y: auto; }
.pick-list button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; cursor: pointer; overflow-wrap: anywhere; }
.pick-list button:hover { border-color: var(--accent); }
.iv { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.iv:hover { border-color: var(--accent); }
.iv b { font-family: var(--serif); font-size: 1.05rem; }
.iv .meta { font-size: .82rem; color: var(--muted); }
.iv-head { display: flex; gap: 8px; align-items: center; margin: 4px 0 8px; flex-wrap: wrap; }
.iv-qa { display: grid; gap: 10px; margin-bottom: 12px; }
.qa { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--bg); display: grid; gap: 6px; }
.qa .qrow { display: flex; gap: 6px; }
.qa .qrow input { font-weight: 600; }
.qa textarea { min-height: 60px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.fact.done { opacity: .6; }
.fact .quote { margin-bottom: 6px; }
.fact .meta { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.fact .meta a { color: var(--accent); }
.fact .row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.badge { display: inline-block; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 1px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pitch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pitch-col { background: var(--surface2); border-radius: 14px; padding: 12px; min-width: 0; }
.pitch-col.wide { grid-column: 1 / -1; }
.pitch-col h3 { margin-bottom: 10px; }
.pitch-new { display: flex; gap: 6px; margin-bottom: 10px; align-items: flex-end; }
.pitch-col.wide .pitch-new { flex-direction: column; align-items: stretch; }
.pitch-items { display: grid; gap: 8px; }
.pitch { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pitch.fav { border-color: var(--accent); }
.pitch p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pitch .t { font: 600 1.05rem var(--serif); }
.pitch .row { display: flex; gap: 4px; align-items: center; margin-top: 6px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.star { border: none; background: none; cursor: pointer; font-size: 1.1rem; color: var(--muted); padding: 0 4px; }
.star.on { color: var(--accent); }
.img-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; max-height: 45vh; overflow-y: auto; }
.img-pick button { border: 2px solid transparent; border-radius: 10px; padding: 0; background: var(--surface2); cursor: pointer; overflow: hidden; text-align: left; }
.img-pick button.on { border-color: var(--accent); }
.img-pick img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.img-pick span { display: block; font-size: .78rem; padding: 4px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-pdf { display: grid; gap: 4px; }
.exp-pdf > p { margin: 0 0 8px; }
.exp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.exp-grid .btn { text-align: center; text-decoration: none; color: var(--text); }
.set-h { margin: 16px 0 4px; font: 600 .95rem var(--sans); }
.dict-pill { bottom: 104px; max-width: calc(100vw - 32px); }
.dict-pill #dictInterim { overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.dictating #dictBtn { background: var(--accent); color: #fff; border-color: var(--accent); }
.read-mode { position: fixed; inset: 0; z-index: 80; background: var(--bg); overflow-y: auto; }
.rm-bar { position: sticky; top: 0; display: flex; gap: 8px; align-items: center; padding: max(10px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); z-index: 2; }
.rm-bar select { width: auto; max-width: 55vw; }
.rm-body { --rm: 1.12rem; max-width: 680px; margin: 0 auto; padding: 32px 16px 120px; }
.rm-body .rm-title { text-align: center; padding: 10vh 0 14vh; }
.rm-body .rm-title h1 { font-size: 2.2rem; text-wrap: balance; }
.rm-body .rm-title p { color: var(--muted); font-style: italic; }
.rm-body h2 { font-size: 1.6rem; margin: 18vh 0 28px; text-wrap: balance; }
.rm-body p { font: var(--rm)/1.85 var(--serif); margin: 0; text-indent: 1.4em; }
.rm-body p.first { text-indent: 0; }
.rm-body p.brk { text-align: center; text-indent: 0; color: var(--muted); margin: 18px 0; letter-spacing: .5em; }
.rm-body figure, .reader figure { margin: 22px 0; text-align: center; }
.rm-body figure img, .reader figure img { max-width: 100%; border-radius: 6px; }
.rm-body figcaption, .reader figcaption { font: italic .9rem var(--serif); color: var(--muted); margin-top: 6px; }
.img-line { color: var(--accent); }
@media (max-width: 760px) {
  .pitch-grid { grid-template-columns: minmax(0, 1fr); }
  .match { grid-template-columns: 52px minmax(0, 1fr); }
}


/* ===== Bücher, Rechtschreibung, Synonyme, Saisons, Cover, Offline ===== */
.book-list { display: grid; gap: 8px; margin: 12px 0; }
.book-item { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
.book-item.on { border-color: var(--accent); background: var(--accent-soft); }
.book-item .t { flex: 1; min-width: 0; }
.book-item b { display: block; font-family: var(--serif); overflow-wrap: anywhere; }
.book-item small { color: var(--muted); }
.book-new { display: grid; gap: 4px; }
.sp-item { border-bottom: 1px solid var(--line); padding: 10px 4px; }
.sp-item.done { opacity: .45; }
.sp-item .ctx { font-size: .92rem; overflow-wrap: anywhere; }
.sp-item .ctx mark { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--text); border-radius: 3px; padding: 0 2px; }
.sp-item .msg { font-size: .84rem; color: var(--muted); margin: 4px 0 6px; }
.sp-item .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sp-item .repl { border: 1px solid var(--accent); color: var(--accent); background: var(--surface); border-radius: 8px; padding: 3px 10px; cursor: pointer; font-size: .88rem; }
.sp-item .repl:hover { background: var(--accent-soft); }
.syn-list { display: grid; gap: 10px; margin: 12px 0; max-height: 55vh; overflow-y: auto; }
.syn-group small { display: block; color: var(--muted); font-size: .76rem; margin-bottom: 4px; }
.syn-group .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.syn-group button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 12px; cursor: pointer; font-size: .9rem; }
.syn-group button:hover { border-color: var(--accent); color: var(--accent); }
.syn-group button i { color: var(--muted); font-size: .75rem; font-style: normal; }
.lookup-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.lookup-row .muted { font-size: .85rem; }
.season-list { display: grid; gap: 12px; }
.season { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.season summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.season summary::-webkit-details-marker { display: none; }
.season summary b { font: 600 1.1rem var(--serif); min-width: 72px; }
.season .rec { display: flex; gap: 6px; flex-wrap: wrap; font-size: .82rem; }
.season .rec span { padding: 2px 8px; border-radius: 99px; background: var(--surface2); font-variant-numeric: tabular-nums; }
.season .rec .w { background: color-mix(in srgb, var(--ok) 20%, var(--surface2)); }
.season .rec .l { background: color-mix(in srgb, var(--danger) 16%, var(--surface2)); }
.season .games { padding: 0 14px 12px; display: grid; gap: 6px; }
.season .g { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px; font-size: .9rem; align-items: center; cursor: pointer; padding: 4px 0; border-top: 1px solid var(--line); }
.season .g span:nth-child(2) { overflow-wrap: anywhere; }
.season .g .res { font-variant-numeric: tabular-nums; font-weight: 600; padding: 0 6px; border-radius: 6px; }
.res.w { color: var(--ok); } .res.l { color: var(--danger); } .res.d { color: var(--muted); }
.cover-mode .cover-wrap { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; padding: 20px max(16px, env(safe-area-inset-right, 0px)) 60px max(16px, env(safe-area-inset-left, 0px)); max-width: 1300px; margin: 0 auto; }
.cover-ctrl { display: grid; gap: 0; align-content: start; }
.cover-ctrl input[type=color] { height: 40px; padding: 4px; }
.cv-sec { border-bottom: 1px solid var(--line); padding: 4px 0 10px; }
.cv-sec > summary { cursor: pointer; font: 600 .95rem var(--sans); padding: 8px 0; list-style: none; display: flex; justify-content: space-between; }
.cv-sec > summary::-webkit-details-marker { display: none; }
.cv-sec > summary::after { content: '▾'; color: var(--muted); }
.cv-sec:not([open]) > summary::after { content: '▸'; }
.cv-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; margin-bottom: 8px; }
.cv-tpl-grid button, .cv-img-grid button { border: 2px solid transparent; border-radius: 8px; padding: 0; background: var(--surface2); cursor: pointer; overflow: hidden; display: grid; text-align: center; }
.cv-tpl-grid button.on, .cv-img-grid button.on, .cv-pal-grid button.on { border-color: var(--accent); }
.cv-tpl-grid canvas { width: 100%; height: auto; display: block; }
.cv-tpl-grid span, .cv-img-grid span { font-size: .7rem; padding: 3px 2px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin-bottom: 10px; }
.cv-img-grid canvas, .cv-img-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.cv-img-grid .none { aspect-ratio: 1; display: grid; place-items: center; font-size: 1.2rem; color: var(--muted); }
.cv-pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin-bottom: 10px; }
.cv-pal-grid button { border: 2px solid transparent; border-radius: 8px; padding: 3px; background: var(--surface); cursor: pointer; display: flex; height: 34px; }
.cv-pal-grid button i { flex: 1; display: block; }
.cv-pal-grid button i:first-child { flex: 2; border-radius: 4px 0 0 4px; }
.cv-pal-grid button i:last-child { border-radius: 0 4px 4px 0; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: .9rem; }
label.check input { width: auto; margin: 0; }
.cover-ctrl input[type=range] { padding: 0; accent-color: var(--accent); }
.small-note { font-size: .8rem; margin: -4px 0 12px; }
.cv-btns { display: grid; gap: 8px; }
.cover-view { display: grid; gap: 12px; justify-items: center; align-content: start; min-width: 0; position: sticky; top: 72px; align-self: start; z-index: 1; }
.cover-view canvas { touch-action: none; cursor: grab; max-width: 100%; max-height: 78vh; height: auto; box-shadow: 0 4px 30px rgba(0,0,0,.25); border-radius: 2px; background: #fff; }
@media (max-width: 860px) {
  .cover-mode .cover-wrap { grid-template-columns: minmax(0, 1fr); }
  .cover-view { order: -1; top: 56px; background: var(--bg); padding: 8px 0 10px; margin: -8px 0 0; box-shadow: 0 8px 12px -10px rgba(0,0,0,.35); gap: 8px; }
  .cover-view canvas { max-height: 34vh; width: auto; }
  .cover-view .seg button { padding: 4px 10px; }
}

/* ===== Drucken / PDF ===== */
@media print {
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block; color: #000; font: 12pt/1.7 'Literata', Georgia, serif; }
  .print-area h1 { font-size: 26pt; text-align: center; margin: 35vh 0 0; page-break-after: always; }
  .print-area h2 { font-size: 16pt; margin: 0 0 1.2em; page-break-before: always; }
  .print-area p { margin: 0; text-indent: 1.5em; text-align: justify; }
  .print-area p.first { text-indent: 0; }
  .print-area p.brk { text-align: center; text-indent: 0; margin: 1em 0; }
  .print-area figure { margin: 1em 0; text-align: center; page-break-inside: avoid; }
  .print-area figure img { max-width: 100%; max-height: 60vh; }
  .print-area figcaption { font-style: italic; font-size: 10pt; }
  @page { margin: 2.5cm 2.2cm; }
}

.cover-view canvas.dragging { cursor: grabbing; }
#cvReset { margin: 10px 0; }
.cv-save-row { display: flex; gap: 6px; margin-top: 6px; }
.cv-save-row input { flex: 1; min-width: 0; padding: 6px 10px; font-size: .88rem; }
.cv-tpl-grid button.my { position: relative; }
.cv-tpl-grid button.my .del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; line-height: 20px; padding: 0; }
#cvMyGrid:empty::before { content: 'Noch keine eigenen Vorlagen.'; color: var(--muted); font-size: .82rem; grid-column: 1 / -1; }
