/* ==========================================================================
   Pinnwand – Styles
   Alle Farben laufen über CSS-Variablen. Die Designs (ganz unten) setzen
   nur diese Variablen. Standard = LearningView.
   ========================================================================== */

:root {
  --hand: "Segoe Print", "Bradley Hand", "Chalkboard SE", "Comic Neue", "Comic Sans MS", casual, cursive;
  --ui: Lexend, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

/* --------------- Design: LearningView (Standard + Basis für alle Designs) */
:root,
[data-theme] {
  --bg: #eef7fd;
  --bg-image:
    radial-gradient(circle, #c9e2f3 1.3px, transparent 1.8px),
    radial-gradient(ellipse at 12% 0%, #ffffff 0%, transparent 55%),
    radial-gradient(ellipse at 100% 100%, #d8ecf9 0%, transparent 60%);
  --bg-size: 24px 24px, auto, auto;
  --bg-pos: 0 0;
  --vignette: none;
  --frame: 0px;
  --frame-color: transparent;
  --frame-image: none;
  --frame-shadow: none;

  --ink: #102f46;
  --muted: #587386;
  --on-bg: #102f46;
  --on-bg-muted: #587386;
  --on-bg-shadow: none;
  --surface: #ffffff;
  --surface-line: #d5e8f3;
  --soft: #e3f3fc;
  --field: #ffffff;
  --radius: 18px;

  --accent: #0072b8;
  --accent-hover: #0069ad;
  --on-accent: #ffffff;
  --dock-btn: #0072b8;
  --dock-btn-hover: #0069ad;
  --on-dock-btn: #ffffff;
  --plus: #102f46;

  --title-font: var(--ui);
  --title-weight: 800;
  --title-bg: #ffffff;
  --title-ink: #102f46;
  --title-rotate: 0deg;
  --title-radius: 16px;
  --title-border: 1px solid #d5e8f3;
  --title-shadow: 0 14px 30px -18px rgba(16, 47, 70, 0.45);
  --title-glow: none;
  --tape-opacity: 0;
  --tape: rgba(176, 214, 240, 0.75);

  --overlay: rgba(8, 47, 71, 0.5);
  --shadow: rgba(16, 47, 70, 0.4);
  --toast: #102f46;
  --note-radius: 6px;
  --note-ink: #102f46;
  --photo-paper: #ffffff;
  --heart: #e5484d;
  --lane: color-mix(in srgb, var(--surface) 70%, transparent);
  --lane-line: color-mix(in srgb, var(--surface-line) 80%, transparent);
  --lane-dash: color-mix(in srgb, var(--ink) 22%, transparent);

  --c-yellow: #fff3b5;
  --c-pink: #ffdcd6;
  --c-mint: #cdefe9;
  --c-blue: #d3eafa;
  --c-orange: #ffe4c4;
  --c-lilac: #e1e4fb;
  --p1: #0072b8;
  --p2: #e5534b;
  --p3: #1fa39a;
  --p4: #f2b824;
  --p5: #4b55c8;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--ui);
  color: var(--ink);
  background: transparent;
}

/* Hintergrund (fest, damit Verläufe nicht mit der Seite mitwachsen) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-size: var(--bg-size);
  background-position: var(--bg-pos);
  box-shadow: var(--vignette);
}

/* Rahmen (nur bei Designs mit --frame > 0) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  border: var(--frame) solid var(--frame-color);
  border-image: var(--frame-image);
  box-shadow: var(--frame-shadow);
}

body.no-scroll { overflow: hidden; }

/* ------------------------------------------------------------- Kopfzeile */

.topbar {
  position: relative;
  z-index: 60;
  display: flex;
  justify-content: center;
  padding: calc(30px + env(safe-area-inset-top)) 128px 4px;
}

.title-wrap {
  position: relative;
  max-width: 100%;
  padding: 12px 30px 10px;
  border: var(--title-border);
  border-radius: var(--title-radius);
  background: var(--title-bg);
  transform: rotate(var(--title-rotate));
  box-shadow: var(--title-shadow);
}
.title-wrap::before,
.title-wrap::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 64px;
  height: 22px;
  background: var(--tape);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  opacity: var(--tape-opacity);
}
.title-wrap::before { left: -18px; transform: rotate(-32deg); }
.title-wrap::after { right: -18px; transform: rotate(28deg); }

.title,
.title-input {
  margin: 0;
  font: var(--title-weight) clamp(25px, 5vw, 42px) / 1.12 var(--title-font);
  color: var(--title-ink);
  text-align: center;
  text-shadow: var(--title-glow);
  overflow-wrap: anywhere;
}
.title-input {
  display: block;
  width: min(60vw, 620px);
  padding: 0;
  border: 0;
  border-bottom: 2px dashed currentColor;
  background: transparent;
  outline: none;
}
.is-admin .title { cursor: text; }
.is-admin .title::after {
  content: "✎";
  margin-left: 0.3em;
  font-size: 0.5em;
  vertical-align: middle;
  opacity: 0;
  transition: opacity 0.2s;
}
.is-admin .title-wrap:hover .title::after { opacity: 0.45; }

.top-actions {
  position: absolute;
  top: calc(28px + env(safe-area-inset-top));
  right: calc(var(--frame) + 14px);
  display: flex;
  gap: 10px;
}

.round-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--surface-line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 18px -8px var(--shadow);
  cursor: pointer;
  transition: transform 0.15s;
}
.round-btn:hover { transform: rotate(-8deg) scale(1.06); }
.round-btn:active { transform: scale(0.94); }
.round-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--accent); }
.round-btn--danger:hover { color: #d92d20; }
/* Ersteller:in hat drei Knöpfe oben rechts → Titel bekommt beidseitig mehr Abstand */
.is-admin .topbar { padding-left: 184px; padding-right: 184px; }
.round-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.round-btn svg circle { fill: currentColor; stroke: none; }

/* -------------------------------------------------------- Design-Auswahl */

.theme-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(390px, calc(100vw - 24px));
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  border: 1px solid var(--surface-line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 26px 50px -18px rgba(0, 0, 0, 0.55);
  animation: menuIn 0.22s ease-out;
}
.theme-menu-head { margin: 2px 4px 10px; font-weight: 700; font-size: 15px; }
.theme-menu-head ~ .theme-menu-head { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--surface-line); }
.theme-menu-head span { font-weight: 400; color: var(--muted); }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.theme-opt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 6px 8px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.theme-opt:hover { background: rgba(127, 127, 127, 0.1); }
.theme-opt[aria-checked="true"] { border-color: var(--accent); }
.theme-name { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-weight: 700; font-size: 14px; }
.theme-opt[aria-checked="true"] .theme-name::after { content: "✓"; color: var(--accent); }
.theme-desc { font-size: 12px; color: var(--muted); }

/* Mini-Vorschau: nutzt die Variablen des jeweiligen Designs */
.tp {
  position: relative;
  display: block;
  height: 92px;
  overflow: hidden;
  border-radius: 10px;
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-size: var(--bg-size);
  background-position: var(--bg-pos);
  box-shadow: inset 0 0 0 calc(var(--frame) / 2.4) var(--frame-color), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.tp-title {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 52%;
  height: 15px;
  margin-left: -26%;
  border-radius: calc(var(--title-radius) / 3);
  background: var(--title-bg);
  transform: rotate(var(--title-rotate));
  box-shadow: 0 2px 4px -2px var(--shadow);
}
.tp-title::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 6px;
  height: 3px;
  border-radius: 2px;
  background: var(--title-ink);
}
.tp-note {
  position: absolute;
  top: 34px;
  width: 30%;
  height: 34px;
  border-radius: calc(var(--note-radius) / 2);
  background: var(--c-yellow);
  box-shadow: 1px 3px 4px -2px var(--shadow);
}
.tp-note::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--p1);
}
.tp-note::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 22%;
  top: 12px;
  height: 2px;
  border-radius: 1px;
  background: var(--note-ink);
  opacity: 0.45;
  box-shadow: 0 6px 0 var(--note-ink);
}
.tp-note--1 { left: 9%; transform: rotate(-4deg); }
.tp-note--2 { left: 36%; top: 38px; background: var(--c-blue); transform: rotate(3deg); }
.tp-note--2::before { background: var(--p2); }
.tp-note--3 { left: 63%; top: 33px; background: var(--photo-paper); transform: rotate(-2deg); }
.tp-note--3::before { display: none; }
.tp-note--3::after { left: 10%; right: 10%; top: 4px; height: 20px; border-radius: 0; background: var(--c-mint); opacity: 1; box-shadow: none; }
.tp-dock {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 44%;
  height: 12px;
  margin-left: -22%;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 2px 4px -1px var(--shadow);
}
.tp-dock::before,
.tp-dock::after {
  content: "";
  position: absolute;
  top: 3px;
  width: 30%;
  height: 6px;
  border-radius: 3px;
  background: var(--dock-btn);
}
.tp-dock::before { left: 28%; }
.tp-dock::after { right: 6%; }

/* --------------------------------------------------------------- Board */

.board-wrap {
  position: relative;
  max-width: 1560px;
  margin: 0 auto;
  padding: 34px clamp(18px, 3.4vw, 48px) calc(130px + env(safe-area-inset-bottom));
  overflow-x: clip; /* Animationen dürfen die Seite nicht verbreitern */
}

.board {
  position: relative;
  min-height: 40vh;
}

.empty {
  position: absolute;
  top: 70px;
  left: 0;
  right: 0;
  padding: 0 24px;
  text-align: center;
  font-family: var(--hand);
  font-size: 22px;
  color: var(--on-bg);
  text-shadow: var(--on-bg-shadow);
  pointer-events: none;
  animation: fadeIn 0.6s 0.2s both;
}
.empty p { margin: 0 0 6px; }
.empty-big { font-size: clamp(28px, 6vw, 44px); font-weight: 700; }
.empty-small { margin-top: 18px !important; font-size: 17px; color: var(--on-bg-muted); }

.status {
  margin: 40px auto;
  max-width: 420px;
  padding: 14px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  font-weight: 600;
  box-shadow: 0 10px 24px -10px var(--shadow);
}

/* --------------------------------------------------------------- Zettel */

.note {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  transition: transform 0.65s cubic-bezier(0.2, 0.85, 0.25, 1.08);
  will-change: transform;
  --fs: 19px;
}
.note.is-flying { z-index: 300; transition: none; }

.note-inner {
  position: relative;
  transform: rotate(var(--r, 0deg));
  transform-origin: 50% 8px;
  background: var(--paper, #fff);
  border-radius: var(--note-radius);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.14),
    3px 12px 16px -8px var(--shadow);
  transition: box-shadow 0.25s, transform 0.2s;
}
.note:hover .note-inner {
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.14),
    5px 18px 22px -8px var(--shadow);
}

.note-inner[data-color="yellow"], .paper[data-color="yellow"], .swatch[data-color="yellow"] { --paper: var(--c-yellow); }
.note-inner[data-color="pink"],   .paper[data-color="pink"],   .swatch[data-color="pink"]   { --paper: var(--c-pink); }
.note-inner[data-color="mint"],   .paper[data-color="mint"],   .swatch[data-color="mint"]   { --paper: var(--c-mint); }
.note-inner[data-color="blue"],   .paper[data-color="blue"],   .swatch[data-color="blue"]   { --paper: var(--c-blue); }
.note-inner[data-color="orange"], .paper[data-color="orange"], .swatch[data-color="orange"] { --paper: var(--c-orange); }
.note-inner[data-color="lilac"],  .paper[data-color="lilac"],  .swatch[data-color="lilac"]  { --paper: var(--c-lilac); }

.note--text .note-inner {
  padding: 24px 14px 9px;
  background-image:
    linear-gradient(172deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 38%),
    linear-gradient(to top left, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0) 22%);
}

.note-text {
  min-height: 2.6em;
  font-family: var(--hand);
  font-size: var(--fs);
  line-height: 1.3;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--note-ink);
}
.note-text.is-xl { font-size: calc(var(--fs) * 1.6); line-height: 1.15; text-align: center; padding: 0.35em 0 0.45em; }
.note-text.is-l  { font-size: calc(var(--fs) * 1.22); }
.note-text.is-s  { font-size: calc(var(--fs) * 0.88); }

/* Polaroid */
.note--photo .note-inner {
  --paper: var(--photo-paper);
  padding: 9px 9px 7px;
  border-radius: calc(var(--note-radius) / 2);
}
.note-photo {
  display: block;
  width: 100%;
  height: auto;
  background: rgba(0, 0, 0, 0.12);
  cursor: zoom-in;
  -webkit-user-drag: none;
}
.note-caption {
  padding: 8px 2px 0;
  font-family: var(--hand);
  font-size: calc(var(--fs) * 0.95);
  line-height: 1.25;
  color: var(--note-ink);
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Weblinks auf Zetteln, Bildunterschriften und Mini-Zetteln (öffnen in neuem Tab) */
.note-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.16em;
  text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);
  border-radius: 3px;
  cursor: pointer !important;
  overflow-wrap: anywhere;
  -webkit-user-drag: none;
  transition: background 0.15s, text-decoration-color 0.15s;
}
.note-link::after {
  content: "↗";
  display: inline-block; /* ohne Unterstrich */
  margin-left: 0.12em;
  font-family: var(--ui);
  font-size: 0.72em;
  font-weight: 700;
  opacity: 0.65;
}
.note-link:hover {
  text-decoration-color: currentColor;
  background: color-mix(in srgb, currentColor 10%, transparent);
}
.note-link:hover::after { opacity: 1; }
.note-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lightbox .note-link { color: inherit; }

/* Fußzeile mit Name, Kommentar + Herz */
.note-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 30px;
  margin-top: 8px;
}
.note-meta {
  min-width: 0;
  overflow: hidden;
  font-size: 11.5px;
  line-height: 1.25;
  color: var(--note-ink);
  opacity: 0.6;
}
.note-meta b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 calc(var(--fs) * 0.78) / 1.2 var(--hand);
}
.note-actions { display: flex; flex-shrink: 0; gap: 4px; }

.act {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--note-ink);
  font: 800 13px var(--ui);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}
.act:not(.is-liked) { opacity: 0.62; }
.act:hover { opacity: 1; }
.note--photo .act { background: rgba(0, 0, 0, 0.05); }
.act svg {
  width: 18px;
  height: 18px;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: transform 0.2s, fill 0.2s;
}
.act:hover svg { transform: scale(1.12); }
.act-count:empty { display: none; }
.heart:hover,
.heart.is-liked { color: var(--heart); opacity: 1; }
.heart.is-liked svg { fill: currentColor; }
.heart.pop svg { animation: heartPop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
.cmt:hover { color: var(--accent); }

.spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  color: var(--heart);
  pointer-events: none;
  animation: spark 0.75s ease-out forwards;
}
.spark svg { width: 100%; height: 100%; fill: currentColor; stroke: none; }

/* Bearbeiten ✎ und Abnehmen × oben rechts am Zettel */
.note-tools {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 4;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.note--photo .note-tools { top: 14px; right: 14px; }
.note:hover .note-tools,
.note-tools:focus-within { opacity: 1; }
.is-touch .note-tools { opacity: 0.7; }
.note-tool {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.55);
  font: 700 17px/1 var(--ui);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.note--photo .note-tool { background: rgba(255, 255, 255, 0.88); }
.note-tool svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.note-edit:hover { background: var(--accent); color: var(--on-accent); }
.note-move {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 4;
  display: none;
  cursor: grab;
  touch-action: none; /* am Handy: Ziehen statt Scrollen */
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}
.note--photo .note-move { top: 14px; left: 14px; }
.is-admin .note-move { display: grid; }
.note:hover .note-move,
.note-move:focus-visible,
.note.is-dragging .note-move { opacity: 1; }
.is-touch .note-move { opacity: 0.7; }
.note-move:hover,
.note.is-dragging .note-move { background: var(--dock-btn); color: var(--on-dock-btn); }

/* Verschieben durch die Ersteller:in */
.is-admin:not(.is-touch) .note { cursor: grab; }
.is-admin .note-photo { cursor: zoom-in; }
.note.is-dragging { z-index: 250; transition: none; cursor: grabbing; }
.note.is-dragging .note-inner {
  transform: rotate(calc(var(--r) + 2.5deg)) scale(1.05);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.12), 8px 26px 34px -10px var(--shadow);
}
.note.is-dragging .note-tools { opacity: 1; }
body.is-dragging-note,
body.is-dragging-note * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.note-del:hover { background: var(--heart); color: #fff; }
.note-edited { font-style: italic; }

/* Editor im Bearbeiten-Modus: Foto bleibt, wie es ist */
.paper.is-editing .photo-slot img { cursor: default; }

/* Mini-Zettel (Kommentare) */
.note-comments {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 12px -3px 2px;
}
.mini {
  position: relative;
  padding: 9px 26px 6px 10px;
  border-radius: 2px;
  background: #fffef9;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12), 1px 6px 9px -5px var(--shadow);
  transform: rotate(var(--mr, 0deg));
  color: var(--note-ink);
  font-family: var(--hand);
  font-size: calc(var(--fs) * 0.8);
  line-height: 1.25;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.note--photo .mini { background: var(--c-yellow); }
.mini::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 14px;
  width: 30px;
  height: 11px;
  background: var(--tape);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transform: rotate(-7deg);
  opacity: 0.9;
}
.mini-meta {
  display: block;
  margin-top: 3px;
  font: 10.5px / 1.25 var(--ui);
  opacity: 0.6;
  white-space: normal;
}
.mini-meta b { font-weight: 700; }
.mini-del {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(0, 0, 0, 0.45);
  font: 700 14px/1 var(--ui);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}
.mini:hover .mini-del,
.mini-del:focus-visible { opacity: 1; }
.is-touch .mini-del { opacity: 0.6; }
.mini-del:hover { background: var(--heart); color: #fff; }
.mini.is-new { animation: miniIn 0.55s cubic-bezier(0.3, 0.7, 0.4, 1.4) both; }
.mini.is-leaving { animation: miniOut 0.35s ease-in forwards; }
.comments-more {
  align-self: center;
  padding: 3px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--note-ink);
  font: 700 12px var(--ui);
  cursor: pointer;
}

/* Pin */
.pin {
  --pin-c: var(--p1);
  position: absolute;
  top: -9px;
  left: 50%;
  z-index: 3;
  width: 21px;
  height: 21px;
  margin-left: -10px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.9) 0 2.4px, rgba(255, 255, 255, 0) 3.6px),
    radial-gradient(circle at 40% 36%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, 0.3) 100%),
    var(--pin-c);
  box-shadow: 1px 4px 3px rgba(20, 10, 0, 0.4);
}
.pin::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 17px;
  width: 3px;
  height: 9px;
  border-radius: 2px;
  background: rgba(20, 10, 0, 0.28);
  transform: rotate(-35deg);
  filter: blur(0.8px);
}
.pin--red    { --pin-c: var(--p1); }
.pin--blue   { --pin-c: var(--p2); }
.pin--green  { --pin-c: var(--p3); }
.pin--yellow { --pin-c: var(--p4); }
.pin--purple { --pin-c: var(--p5); }

/* Klebeband */
.tape {
  position: absolute;
  top: -13px;
  left: 50%;
  z-index: 3;
  width: 46%;
  max-width: 120px;
  height: 26px;
  transform: translateX(-50%) rotate(-3.5deg);
  background: var(--tape);
  clip-path: polygon(3% 0, 97% 0, 100% 18%, 97% 36%, 100% 54%, 97% 72%, 100% 90%, 97% 100%, 3% 100%, 0 82%, 3% 64%, 0 46%, 3% 28%, 0 10%);
}

/* Animationszustände */
.note.is-unpinned .pin,
.note.is-unpinned .tape { opacity: 0; }
.note.is-landing .note-inner { animation: thump 0.5s cubic-bezier(0.3, 0.7, 0.4, 1.3); }
.note.is-landing .pin { animation: pinIn 0.45s cubic-bezier(0.3, 0.7, 0.4, 1.5) both; }
.note.is-landing .tape { animation: tapeIn 0.4s ease-out both; }
.note.is-dropping .note-inner { animation: drop 0.7s cubic-bezier(0.25, 0.8, 0.3, 1.1) both; }
.note.is-leaving { pointer-events: none; z-index: 2; }
.note.is-leaving .note-inner { animation: fall 0.75s cubic-bezier(0.5, 0, 0.75, 0.4) forwards; }

@keyframes drop {
  0%   { opacity: 0; transform: translateY(-46px) rotate(calc(var(--r) - 14deg)) scale(1.25); }
  55%  { opacity: 1; transform: translateY(4px) rotate(calc(var(--r) + 1deg)) scale(0.97); }
  100% { transform: rotate(var(--r)) scale(1); }
}
@keyframes thump {
  0%   { transform: rotate(var(--r)) scale(1); }
  30%  { transform: rotate(calc(var(--r) * -1.6)) scale(0.95); }
  65%  { transform: rotate(calc(var(--r) * 1.3)) scale(1.02); }
  100% { transform: rotate(var(--r)) scale(1); }
}
@keyframes pinIn {
  0%   { opacity: 0; transform: translateY(-26px) scale(2.2); }
  60%  { opacity: 1; transform: translateY(2px) scale(0.85); }
  100% { opacity: 1; transform: none; }
}
@keyframes tapeIn {
  0%   { opacity: 0; transform: translateX(-50%) rotate(-12deg) scale(1.4); }
  100% { opacity: 1; transform: translateX(-50%) rotate(-3.5deg) scale(1); }
}
@keyframes fall {
  0%   { opacity: 1; transform: rotate(var(--r)); }
  20%  { transform: translateY(-8px) rotate(calc(var(--r) + 7deg)); }
  100% { opacity: 0; transform: translateY(220px) rotate(calc(var(--r) + 38deg)); }
}
@keyframes miniIn {
  0%   { opacity: 0; transform: translateY(-18px) rotate(calc(var(--mr) - 12deg)) scale(1.35); }
  60%  { opacity: 1; transform: translateY(2px) rotate(var(--mr)) scale(0.97); }
  100% { opacity: 1; transform: rotate(var(--mr)) scale(1); }
}
@keyframes miniOut {
  to { opacity: 0; transform: translateY(30px) rotate(calc(var(--mr) + 20deg)); }
}
@keyframes heartPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.55); }
  60%  { transform: scale(0.88); }
  100% { transform: scale(1); }
}
@keyframes spark {
  0%   { opacity: 1; transform: translate(0, 0) scale(0.4); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(var(--rot)); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes menuIn { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes shake {
  0%, 100% { transform: rotate(-1.2deg) translateX(0); }
  20% { transform: rotate(-2deg) translateX(-10px); }
  40% { transform: rotate(0deg) translateX(9px); }
  60% { transform: rotate(-2deg) translateX(-6px); }
  80% { transform: rotate(-1deg) translateX(4px); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- Dock */

.dock {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 7px 7px 10px;
  transform: translateX(-50%);
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 14px 32px -12px var(--shadow);
}
.dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--dock-btn);
  color: var(--on-dock-btn);
  font: 700 16px var(--ui);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s, background 0.2s;
}
.dock-btn:hover { background: var(--dock-btn-hover); }
.dock-btn:active { transform: scale(0.94); }

/* großes „+“ vorne: zeigt, dass die Buttons etwas hinzufügen */
.dock-plus {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  font-size: 0;
  pointer-events: none;
}
.dock-plus::before,
.dock-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 6px;
  margin: -3px 0 0 -14px;
  border-radius: 3px;
  background: var(--plus);
}
.dock-plus::after { transform: rotate(90deg); }

.touch-only { display: none !important; }
.is-touch .touch-only { display: inline-flex !important; }
.is-touch .mouse-only { display: none !important; }

/* -------------------------------------------------------------- QR-Code */

.qr-mini {
  position: fixed;
  right: calc(var(--frame) + 16px);
  bottom: calc(var(--frame) + 16px + env(safe-area-inset-bottom));
  z-index: 50;
  width: 88px;
  height: 88px;
  padding: 5px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15), 0 12px 24px -10px var(--shadow);
  transform: rotate(3deg);
  cursor: zoom-in;
  transition: transform 0.2s;
}
.qr-mini:hover { transform: rotate(0deg) scale(1.07); }
.qr-mini::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 46px;
  height: 16px;
  margin-left: -23px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transform: rotate(-5deg);
}
.qr-mini svg,
.qr-big-code svg { display: block; width: 100%; height: 100%; }

.qr-big { margin: auto; text-align: center; color: #fff; cursor: zoom-out; }
.qr-big-code {
  width: min(80vw, 62vh, 520px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
  transform: scale(0.92);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.overlay.is-open .qr-big-code { transform: none; }
.qr-big figcaption { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 18px; }
.qr-big strong { font: 700 clamp(22px, 4vw, 32px) / 1.2 var(--title-font); }
.qr-big span { font-size: 18px; opacity: 0.9; }
.qr-big small { max-width: 90vw; font: 13px var(--mono); opacity: 0.65; word-break: break-all; }

/* -------------------------------------------------------------- Overlays */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.overlay.is-open { opacity: 1; }
.overlay--dark { background: rgba(10, 12, 18, 0.9); cursor: zoom-out; }

/* Composer */
.composer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(440px, 100%);
  margin: auto;
  transform: translateY(40px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.overlay.is-open .composer { transform: none; }

.paper {
  position: relative;
  padding: 30px 20px 14px;
  border-radius: var(--note-radius);
  background: var(--paper, var(--c-yellow));
  background-image: linear-gradient(172deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 40%);
  transform: rotate(-1.2deg);
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.12), 0 24px 44px -14px rgba(0, 0, 0, 0.6);
  transition: background-color 0.25s;
}
.paper.is-shaking { animation: shake 0.45s; }
.paper[data-mode="photo"] { --paper: var(--photo-paper); padding: 12px 12px 10px; border-radius: calc(var(--note-radius) / 2); }
.paper[data-mode="photo"] .pin,
.paper[data-mode="text"] .tape,
.paper[data-mode="text"] .photo-slot { display: none; }
.paper--mini { --paper: #fffef9; padding: 24px 16px 10px; }
.paper.paper--mini .tape.tape--mini { display: block; width: 70px; top: -11px; height: 22px; }

.paper textarea,
.paper input {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--note-ink);
  outline: none;
  font-family: var(--hand);
}
.paper textarea {
  min-height: 7.4em;
  padding: 0;
  resize: none;
  font-size: 24px;
  line-height: 1.3;
}
.paper--mini textarea { min-height: 4.2em; font-size: 21px; }
.paper[data-mode="photo"] textarea {
  height: 2.7em;
  min-height: 0;
  margin-top: 10px;
  font-size: 20px;
  text-align: center;
}
.paper input {
  margin-top: 6px;
  padding: 10px 0 2px;
  border-top: 1.5px dashed rgba(0, 0, 0, 0.18);
  font-size: 18px;
}
.paper[data-mode="photo"] input { text-align: center; }
.paper textarea::placeholder,
.paper input::placeholder { color: var(--note-ink); opacity: 0.45; }

.photo-slot { position: relative; }
.photo-slot img {
  display: none;
  width: 100%;
  max-height: 52vh;
  object-fit: contain;
  background: transparent;
  cursor: pointer;
}
.paper.has-photo .photo-slot img { display: block; }
.paper.has-photo .photo-pick,
.paper.has-raw .photo-pick { display: none; }
/* HEIC-Foto, das der Browser nicht anzeigen kann – der Server wandelt es beim Anheften um */
.photo-raw {
  display: none;
  width: 100%;
  aspect-ratio: 4 / 3;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px;
  border: 0;
  background: linear-gradient(160deg, #e9eef3, #d3dde6);
  color: #33465a;
  font: 13px / 1.35 var(--ui);
  text-align: center;
  cursor: pointer;
}
.photo-raw strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-raw-icon { font-size: 40px; line-height: 1; }
.paper.has-raw .photo-raw { display: flex; }
.photo-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  aspect-ratio: 4 / 3;
  padding: 16px;
  border: 2px dashed rgba(0, 0, 0, 0.16);
  background: repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.03) 0 12px, rgba(0, 0, 0, 0.06) 12px 24px);
}
.pick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--dock-btn);
  color: var(--on-dock-btn);
  font: 700 16px var(--ui);
  cursor: pointer;
}
.pick-btn:active { transform: scale(0.96); }
.pick-hint { font-size: 13px; color: rgba(0, 0, 0, 0.45); }
.photo-busy {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.88);
  color: #222;
  font-weight: 600;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 0, 0, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.composer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.composer[data-mode="photo"] .composer-bar { justify-content: flex-end; }
.composer[data-mode="photo"] .swatches { display: none; }

.composer--mini { width: min(360px, 100%); }
.comment-to {
  margin: 0;
  color: #fff;
  font-size: 14px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.comment-to span { font-family: var(--hand); font-size: 16px; }
.comment-count { color: rgba(255, 255, 255, 0.85); font-size: 13px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }

.swatches { display: flex; gap: 8px; }
.swatch {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s;
}
.swatch:hover { transform: scale(1.1); }
.swatch[aria-checked="true"] { transform: scale(1.2); box-shadow: 0 0 0 2.5px var(--accent), 0 3px 8px rgba(0, 0, 0, 0.35); }

.composer-actions { display: flex; gap: 10px; margin-left: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  font: 700 16px var(--ui);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s, opacity 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.65; cursor: progress; }
.btn--pin { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 18px -8px var(--accent); }
.btn--pin:hover { background: var(--accent-hover); }
.btn--ghost { background: var(--surface); color: var(--ink); }
.btn--ghost:hover { filter: brightness(0.97); }
.btn--dark { background: var(--dock-btn); color: var(--on-dock-btn); }
.btn--dark:hover { background: var(--dock-btn-hover); }
.btn--danger { background: #d92d20; color: #fff; box-shadow: 0 8px 18px -8px rgba(217, 45, 32, 0.8); }
.btn--danger:hover { background: #b42318; }
.btn--wide { width: 100%; margin-top: 12px; }

/* Teilen */
.sheet {
  position: relative;
  width: min(470px, 100%);
  margin: auto;
  padding: 28px 22px 22px;
  border: 1px solid var(--surface-line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  transform: translateY(30px) rotate(1deg);
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.overlay.is-open .sheet { transform: none; }
.sheet h2 { margin: 0 0 4px; font: var(--title-weight) 28px / 1.15 var(--title-font); }
.sheet h3 { margin: 0 0 4px; font-size: 16px; }
.muted { margin: 0 0 12px; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  font: 400 24px/1 var(--ui);
  color: var(--ink);
  cursor: pointer;
}
.copy-row { display: flex; gap: 8px; }
.copy-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--surface-line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  font: 14px var(--mono);
}
.admin-box { margin-top: 18px; padding: 14px; border-radius: 14px; background: var(--soft); }
.recent { margin-top: 18px; }
.recent ul { margin: 6px 0 0; padding: 0; list-style: none; }
.recent li a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px dashed var(--surface-line);
  color: var(--ink);
  text-decoration: none;
}
.recent li a:hover b { text-decoration: underline; }
.recent li span { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* Bestätigung „Alle Zettel löschen“ */
.sheet--confirm { width: min(420px, 100%); text-align: center; }
.confirm-icon { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.sheet--confirm .muted { margin: 8px 0 20px; }
.confirm-quote {
  display: -webkit-box;
  margin: 10px 0 0;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--c-yellow);
  color: var(--note-ink);
  font: 19px / 1.3 var(--hand);
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  transform: rotate(-1deg);
}
.confirm-quote + .muted { margin-top: 14px; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; }
.sheet .btn--ghost { background: var(--soft); }

/* Lightbox */
.lightbox { margin: auto; max-width: 94vw; text-align: center; }
.lightbox img {
  display: block;
  max-width: min(94vw, 1400px);
  max-height: 80vh;
  margin: 0 auto;
  border: 10px solid var(--photo-paper);
  border-bottom-width: 16px;
  background: var(--photo-paper);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
  transform: scale(0.94);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.overlay.is-open .lightbox img { transform: none; }
.lightbox figcaption {
  margin-top: 14px;
  color: #fff;
  font: 22px / 1.3 var(--hand);
  white-space: pre-wrap;
}
.lightbox figcaption small { display: block; margin-top: 4px; font: 14px var(--ui); opacity: 0.7; }

/* Drag & Drop */
.drop-hint {
  position: fixed;
  inset: 24px;
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  border: 4px dashed var(--accent);
  border-radius: 28px;
  background: var(--overlay);
  color: #fff;
  font: 700 34px var(--hand);
  pointer-events: none;
}
.is-dragging .drop-hint { display: flex; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 200;
  max-width: calc(100vw - 40px);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--toast);
  color: #fff;
  font: 600 14.5px var(--ui);
  text-align: center;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s, transform 0.3s;
  pointer-events: none;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: #b3261e; }


/* -------------------------------------------- Kipp-Schalter im Menü */

.switch-list { display: flex; flex-direction: column; gap: 2px; }
.switch-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.switch-opt:hover { background: rgba(127, 127, 127, 0.1); }
.switch-ico {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 42px;
  height: 34px;
  border-radius: 9px;
  background: var(--soft);
  color: var(--accent);
}
.switch-ico svg { width: 30px; height: 22px; fill: currentColor; }
.switch-ico svg .o { fill: none; stroke: currentColor; stroke-width: 1.4; }
.feature-opt .switch-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linejoin: round; stroke-linecap: round; }
.feature-opt[data-feature="likes"] .switch-ico { color: var(--heart); }
.feature-opt[data-feature="likes"][aria-checked="true"] .switch-ico svg { fill: currentColor; }
.switch-opt[aria-checked="false"] .switch-ico { opacity: 0.55; }
.switch-text { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.25; }
.switch-text b { font-size: 14.5px; }
.switch-text small { font-size: 12px; color: var(--muted); }
.switch-state { min-width: 24px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: right; }
.switch-opt[aria-checked="true"] .switch-state { color: var(--accent); }
.switch {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.32);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s cubic-bezier(0.3, 0.7, 0.4, 1.3);
}
.switch-opt[aria-checked="true"] .switch { background: var(--accent); }
.switch-opt[aria-checked="true"] .switch::after { transform: translateX(18px); }

/* Herzen / Mini-Zettel ausgeschaltet → auf den Zetteln ausblenden */
.no-likes .act.heart,
.no-comments .act.cmt,
.no-comments .note-comments { display: none !important; }

/* ------------------------------------------------ Darstellung: Spalten */

.mode-columns .board-wrap,
.mode-free .board-wrap { max-width: none; }
.mode-columns .board-wrap { padding-bottom: 0; }

.lanes {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 18px;
  height: 70vh; /* genaue Höhe setzt app.js: bis zum unteren Fensterrand (dort sitzt der Scrollbalken) */
  margin: 0 calc(-1 * clamp(18px, 3.4vw, 48px));
  padding: 4px clamp(18px, 3.4vw, 48px) calc(108px + env(safe-area-inset-bottom)); /* Spalten enden über dem Dock */
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding: 0 clamp(18px, 3.4vw, 48px);
}
.lane {
  position: relative;
  display: flex;
  flex: 1 0 280px;
  flex-direction: column;
  min-width: 0;
  max-width: 440px;
  border: 1px solid var(--lane-line);
  border-radius: var(--radius);
  background: var(--lane);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  box-shadow: 0 14px 30px -22px var(--shadow);
  scroll-snap-align: start;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
/* angeklickte Spalte: hier landen neue Zettel aus dem Dock */
.lane:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.lane.is-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 14px 30px -20px var(--shadow);
}
.lane.is-target .lane-count { background: var(--accent); color: var(--on-accent); }
.mode-columns .lane .note { cursor: default; }
/* In Spalten stehen Zettel und Mini-Zettel gerade – die Spalte gibt die Ordnung vor */
.mode-columns .note-inner { --r: 0deg !important; }
.mode-columns .mini { --mr: 0deg !important; }
.is-admin.mode-columns:not(.is-touch) .lane .note { cursor: grab; }
.lane-head { display: flex; align-items: flex-start; gap: 8px; padding: 14px 12px 6px 16px; }
.lane-title,
.lane-title-input {
  flex: 1;
  min-width: 0;
  margin: 0;
  font: var(--title-weight) 20px / 1.2 var(--title-font);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.lane-title-input {
  padding: 0;
  border: 0;
  border-bottom: 2px dashed currentColor;
  background: transparent;
  outline: none;
}
.is-admin .lane-title { cursor: text; }
.lane-count {
  flex-shrink: 0;
  min-width: 28px;
  margin-top: 1px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font: 700 13px / 1.5 var(--ui);
  text-align: center;
}
.lane-tools { display: none; flex-shrink: 0; gap: 1px; opacity: 0.55; transition: opacity 0.2s; }
.is-admin .lane-tools { display: flex; }
.lane:hover .lane-tools,
.lane-tools:focus-within,
.is-touch .lane-tools { opacity: 1; }
.lane-tool {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: 700 18px / 1 var(--ui);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.lane-tool:hover { background: var(--soft); color: var(--ink); }
.lane-del:hover { background: var(--heart); color: #fff; }
.lane:first-of-type .lane-left,
.lane:last-of-type .lane-right { visibility: hidden; }

.lane-empty { margin: 14px 16px 0; font: 17px / 1.3 var(--hand); color: var(--muted); text-align: center; }
.lane:not(.is-empty) .lane-empty { display: none; }
.lane-body {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 18px 16px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain; /* nur senkrecht – seitliches Wischen geht an die Spaltenleiste weiter */
}
.mode-columns .note {
  position: relative;
  margin: 0 0 26px;
  transform: none;
  transition: none;
  will-change: auto;
}
/* Beim Ziehen bleibt an der Zielstelle eine gestrichelte Lücke, eine Kopie folgt dem Zeiger */
.note.is-drag-source > * { visibility: hidden; }
.note.is-drag-source::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px dashed var(--lane-dash);
  border-radius: var(--note-radius);
  background: rgba(127, 127, 127, 0.1);
}
.note--ghost { pointer-events: none; }
.lane-new {
  flex: 0 0 170px;
  align-self: flex-start;
  height: 110px;
  border: 2px dashed var(--on-bg-muted);
  border-radius: var(--radius);
  background: transparent;
  color: var(--on-bg);
  text-shadow: var(--on-bg-shadow);
  font: 700 16px var(--ui);
  cursor: pointer;
  transition: background 0.15s, border-style 0.15s;
}
.lane-new span { font-size: 22px; }
.lane-new:hover { border-style: solid; background: var(--lane); }

@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .lane { background: rgba(255, 255, 255, 0.62); border-color: rgba(0, 0, 0, 0.08); }
  .note.is-drag-source::before { border-color: rgba(0, 0, 0, 0.2); }
}

/* -------------------------------------------------- Darstellung: Frei */

/* Die Fläche scrollt in sich und reicht bis an die Fensterränder – dort sitzen die Scrollbalken */
.mode-free .board-wrap { padding-bottom: 0; }
.free-wrap {
  position: relative;
  height: 70vh; /* genaue Höhe setzt app.js: bis zum unteren Fensterrand */
  margin: -30px calc(-1 * clamp(18px, 3.4vw, 48px)) 0;
  padding: 30px clamp(18px, 3.4vw, 48px) 0; /* oben Platz für Pins */
  overflow: auto;
  overscroll-behavior: contain;
}
.free-sizer {
  position: relative;
  margin: 0 auto;
  overflow: clip; /* fallende/gedrehte Zettel verbreitern die Seite nicht */
  overflow-clip-margin: 40px;
}
.free-canvas {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  border-radius: 16px;
  transition: box-shadow 0.25s;
}
/* beim Verschieben: Fläche sichtbar machen */
.is-dragging-note .free-canvas { box-shadow: inset 0 0 0 calc(2 * var(--px, 1px)) var(--lane-dash); }
.guide {
  position: absolute;
  z-index: 100000;
  display: none;
  pointer-events: none;
  background: var(--accent);
  opacity: 0.85;
}
.guide.is-on { display: block; }
.guide--v { top: 0; bottom: 0; width: calc(2 * var(--px, 1px)); margin-left: calc(-1 * var(--px, 1px)); }
.guide--h { left: 0; right: 0; height: calc(2 * var(--px, 1px)); margin-top: calc(-1 * var(--px, 1px)); }

/* Spalte im Editor wählen */
.col-pick {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: -4px 0 -2px;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.col-pick select {
  max-width: 62%;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 700 15px var(--ui);
  text-shadow: none;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

/* ---------------------------------------------------------------- Handy */

@media (max-width: 600px) {
  .topbar { padding: calc(24px + env(safe-area-inset-top)) 64px 4px; }
  .title-wrap { padding: 9px 18px 7px; }
  .top-actions { top: calc(22px + env(safe-area-inset-top)); right: calc(var(--frame) + 10px); flex-direction: column; }
  /* Ersteller:in: Knöpfe in einer Reihe über dem Titel */
  .is-admin .topbar { padding: calc(68px + env(safe-area-inset-top)) 16px 4px; }
  .is-admin .top-actions { top: calc(14px + env(safe-area-inset-top)); flex-direction: row; gap: 8px; }
  .round-btn { width: 42px; height: 42px; }
  .theme-menu {
    position: fixed;
    top: calc(66px + env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100dvh - 86px);
  }
  .board-wrap { padding-top: 26px; }
  .lanes { gap: 12px; scroll-snap-type: x mandatory; }
  .lane { flex: 0 0 84%; max-width: none; }
  .lane-new { flex-basis: 130px; }
  .lane-body { padding: 16px 12px 8px; }
  .dock-btn { padding: 12px 18px; }
  .paper textarea { font-size: 22px; min-height: 6.5em; }
  .paper--mini textarea { min-height: 4em; font-size: 20px; }
  .composer-bar { justify-content: center; }
  .composer-actions { margin-left: 0; width: 100%; }
  .composer-actions .btn { flex: 1; }
  .qr-mini {
    right: calc(var(--frame) + 10px);
    bottom: calc(92px + env(safe-area-inset-bottom));
    width: 58px;
    height: 58px;
    padding: 3px;
  }
  .qr-mini::before { width: 32px; height: 12px; margin-left: -16px; top: -7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Designs – jeweils nur Variablen
   ========================================================================== */

/* 2 · Korkwand: klassisch mit Holzrahmen */
[data-theme="cork"] {
  --bg: #c39667;
  --bg-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.3' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .96 0 0 0 0 .84 0 0 0 0 .62 0 0 0 3.2 -1.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='9' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .19 0 0 0 0 .08 0 0 0 2.4 -1.05'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23b)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 30% 20%, #cfa274 0%, transparent 60%),
    radial-gradient(ellipse at 80% 90%, #b5875a 0%, transparent 55%);
  --bg-size: auto;
  --vignette: inset 0 0 160px rgba(70, 35, 5, 0.45);
  --frame: 12px;
  --frame-color: #8d5a2c;
  --frame-image: linear-gradient(135deg, #a26a36, #7d4b22 30%, #9b6533 55%, #74441d 80%, #a06836) 1;
  --frame-shadow: inset 0 0 0 1px rgba(255, 220, 170, 0.25), inset 0 4px 14px rgba(40, 18, 0, 0.55);
  --ink: #2c2833;
  --muted: #6e6676;
  --on-bg: #fffaee;
  --on-bg-muted: rgba(255, 250, 238, 0.85);
  --on-bg-shadow: 0 2px 6px rgba(50, 25, 0, 0.55);
  --surface: #fffdf6;
  --surface-line: rgba(60, 40, 20, 0.1);
  --soft: #fff3cf;
  --radius: 20px;
  --accent: #e0393b;
  --accent-hover: #c92f31;
  --dock-btn: #2c2833;
  --dock-btn-hover: #423c4b;
  --plus: #e0393b;
  --title-font: var(--hand);
  --title-weight: 700;
  --title-bg: #fffdf6;
  --title-ink: #2c2833;
  --title-rotate: -1.4deg;
  --title-radius: 0;
  --title-border: 0;
  --title-shadow: 0 2px 2px rgba(0, 0, 0, 0.12), 0 12px 22px -10px rgba(40, 20, 0, 0.6);
  --tape-opacity: 1;
  --tape: rgba(250, 244, 214, 0.72);
  --overlay: rgba(40, 24, 10, 0.5);
  --shadow: rgba(45, 20, 0, 0.6);
  --toast: #2c2833;
  --note-radius: 2px;
  --note-ink: #2b2733;
  --photo-paper: #fbfaf5;
  --heart: #e0393b;
  --c-yellow: #fff1a1;
  --c-pink: #ffcfe0;
  --c-mint: #c8f1d6;
  --c-blue: #cbe4ff;
  --c-orange: #ffd8ad;
  --c-lilac: #e3d8ff;
  --p1: #e0393b;
  --p2: #2f6fe0;
  --p3: #2fa25a;
  --p4: #f3b81c;
  --p5: #8d4fd6;
}

/* 3 · Kreidetafel: dunkelgrün mit Kreide und Holzrahmen */
[data-theme="chalk"] {
  --bg: #2f4b3e;
  --bg-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' seed='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.25 -.68'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 25% 15%, rgba(255, 255, 255, 0.09), transparent 60%),
    radial-gradient(ellipse at 85% 95%, rgba(0, 0, 0, 0.25), transparent 60%);
  --bg-size: auto;
  --vignette: inset 0 0 170px rgba(0, 0, 0, 0.5);
  --frame: 14px;
  --frame-color: #7a4f2a;
  --frame-image: linear-gradient(135deg, #9a6a3c, #6e4422 40%, #8f5f33 70%, #5f3a1c) 1;
  --frame-shadow: inset 0 4px 14px rgba(0, 0, 0, 0.55);
  --ink: #22302a;
  --muted: #5d6b63;
  --on-bg: #f3f0e4;
  --on-bg-muted: rgba(243, 240, 228, 0.75);
  --on-bg-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
  --surface: #fbfaf4;
  --surface-line: rgba(0, 0, 0, 0.08);
  --soft: #eef3e6;
  --radius: 14px;
  --accent: #e9b949;
  --accent-hover: #ddab35;
  --on-accent: #22302a;
  --dock-btn: #2f4b3e;
  --dock-btn-hover: #3c5d4d;
  --plus: #e9b949;
  --title-font: var(--hand);
  --title-weight: 700;
  --title-bg: transparent;
  --title-ink: #f6f3e8;
  --title-rotate: -1deg;
  --title-radius: 0;
  --title-border: 0;
  --title-shadow: none;
  --title-glow: 0 0 6px rgba(255, 255, 255, 0.35);
  --tape-opacity: 0;
  --tape: rgba(233, 185, 73, 0.6);
  --overlay: rgba(10, 20, 15, 0.6);
  --shadow: rgba(0, 0, 0, 0.65);
  --toast: #22302a;
  --note-radius: 2px;
  --note-ink: #23302a;
  --photo-paper: #fbfaf4;
  --c-yellow: #fff3a6;
  --c-pink: #ffd3dc;
  --c-mint: #d0f2dc;
  --c-blue: #d1e7fb;
  --c-orange: #ffdcb5;
  --c-lilac: #e5dcfb;
  --p1: #e9b949;
  --p2: #e5534b;
  --p3: #6fb3e0;
  --p4: #f2f0e6;
  --p5: #b48ad8;
}

/* 4 · Whiteboard: weiß mit Raster und Alurahmen */
[data-theme="whiteboard"] {
  --bg: #fbfcfd;
  --bg-image:
    linear-gradient(#e3e9ef 1px, transparent 1px),
    linear-gradient(90deg, #e3e9ef 1px, transparent 1px),
    radial-gradient(ellipse at 20% 10%, #ffffff, transparent 60%);
  --bg-size: 28px 28px, 28px 28px, auto;
  --vignette: inset 0 0 120px rgba(120, 135, 150, 0.2);
  --frame: 12px;
  --frame-color: #c5ccd3;
  --frame-image: linear-gradient(180deg, #eef1f4, #b6bec7 50%, #e2e6ea) 1;
  --frame-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.18);
  --ink: #1f2933;
  --muted: #64707d;
  --on-bg: #1f2933;
  --on-bg-muted: #64707d;
  --surface: #ffffff;
  --surface-line: #e1e6eb;
  --soft: #eef3f8;
  --radius: 12px;
  --accent: #1f6feb;
  --accent-hover: #195fcf;
  --dock-btn: #1f2933;
  --dock-btn-hover: #34404c;
  --plus: #1f6feb;
  --title-font: var(--hand);
  --title-weight: 700;
  --title-bg: transparent;
  --title-ink: #1f6feb;
  --title-rotate: -1deg;
  --title-radius: 0;
  --title-border: 0;
  --title-shadow: none;
  --overlay: rgba(20, 30, 40, 0.45);
  --shadow: rgba(30, 40, 55, 0.35);
  --toast: #1f2933;
  --tape: rgba(255, 242, 122, 0.7);
  --note-radius: 1px;
  --note-ink: #1f2933;
  --c-yellow: #fff27a;
  --c-pink: #ffbcd8;
  --c-mint: #b9f2cb;
  --c-blue: #b3dcff;
  --c-orange: #ffcb8f;
  --c-lilac: #d9c8ff;
  --p1: #e53935;
  --p2: #1e88e5;
  --p3: #43a047;
  --p4: #fdd835;
  --p5: #8e24aa;
}

/* 5 · Nachtmodus: dunkel mit Sternen und Leuchtfarben */
[data-theme="night"] {
  --bg: #12162a;
  --bg-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.55) 0.9px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.3) 0.7px, transparent 1.3px),
    radial-gradient(ellipse at 15% 0%, #2a3063 0%, transparent 60%),
    radial-gradient(ellipse at 95% 100%, #33205a 0%, transparent 55%);
  --bg-size: 97px 97px, 41px 41px, auto, auto;
  --bg-pos: 0 0, 17px 23px, 0 0, 0 0;
  --vignette: inset 0 0 180px rgba(0, 0, 0, 0.6);
  --ink: #e9ebff;
  --muted: #a5aacb;
  --on-bg: #e9ebff;
  --on-bg-muted: #a5aacb;
  --on-bg-shadow: 0 0 12px rgba(139, 124, 246, 0.5);
  --surface: #1f2440;
  --surface-line: rgba(255, 255, 255, 0.1);
  --soft: #2a3058;
  --field: #151a33;
  --radius: 18px;
  --accent: #8b7cf6;
  --accent-hover: #7a6af0;
  --dock-btn: #8b7cf6;
  --dock-btn-hover: #7a6af0;
  --plus: #ffd166;
  --title-font: var(--ui);
  --title-weight: 800;
  --title-bg: #1f2440;
  --title-ink: #ffffff;
  --title-border: 1px solid rgba(255, 255, 255, 0.1);
  --title-shadow: 0 0 30px -6px rgba(139, 124, 246, 0.55);
  --overlay: rgba(5, 6, 15, 0.7);
  --shadow: rgba(0, 0, 0, 0.75);
  --toast: #2a3058;
  --note-radius: 8px;
  --note-ink: #1d1b2f;
  --photo-paper: #f4f4ff;
  --heart: #ff6b8b;
  --tape: rgba(177, 151, 252, 0.6);
  --c-yellow: #fff59d;
  --c-pink: #ffb8dc;
  --c-mint: #b9f6ca;
  --c-blue: #b3e5fc;
  --c-orange: #ffcc80;
  --c-lilac: #d4c7ff;
  --p1: #ffd166;
  --p2: #ff6b8b;
  --p3: #4dd4ac;
  --p4: #4dabf7;
  --p5: #b197fc;
}

/* 6 · Bonbon: Pastell mit Punkten */
[data-theme="candy"] {
  --bg: #fde7f1;
  --bg-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 2.2px, transparent 2.8px),
    radial-gradient(ellipse at 0% 0%, #fff2f8 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, #e8dcff 0%, transparent 60%),
    linear-gradient(135deg, #ffe1ef, #efe4ff);
  --bg-size: 28px 28px, auto, auto, auto;
  --ink: #4a2140;
  --muted: #8a5f7f;
  --on-bg: #a0306f;
  --on-bg-muted: #a0688f;
  --surface: #ffffff;
  --surface-line: #f6d3e6;
  --soft: #fde7f1;
  --radius: 24px;
  --accent: #e0559b;
  --accent-hover: #cf438a;
  --dock-btn: #e0559b;
  --dock-btn-hover: #cf438a;
  --plus: #8b5cf6;
  --title-font: var(--hand);
  --title-weight: 700;
  --title-bg: #ffffff;
  --title-ink: #c2357f;
  --title-rotate: -2deg;
  --title-radius: 26px;
  --title-border: 2px dashed #f6c1dc;
  --title-shadow: 0 14px 30px -16px rgba(194, 53, 127, 0.55);
  --overlay: rgba(90, 30, 70, 0.4);
  --shadow: rgba(150, 60, 110, 0.4);
  --toast: #7a2a5f;
  --note-radius: 12px;
  --note-ink: #4a2140;
  --tape: rgba(255, 179, 214, 0.75);
  --heart: #ff3d8b;
  --c-yellow: #fff4b3;
  --c-pink: #ffd1e8;
  --c-mint: #c9f5e3;
  --c-blue: #d3e8ff;
  --c-orange: #ffe0c7;
  --c-lilac: #e7d9ff;
  --p1: #ff5fa2;
  --p2: #7c6cff;
  --p3: #2ec4b6;
  --p4: #ffbf3c;
  --p5: #ff8a5c;
}

/* 7 · Blaupause: technisch mit Linienraster */
[data-theme="blueprint"] {
  --bg: #1d4f91;
  --bg-image:
    linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  --bg-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  --vignette: inset 0 0 160px rgba(5, 20, 50, 0.5);
  --ink: #0f2747;
  --muted: #4d6a8f;
  --on-bg: #ffffff;
  --on-bg-muted: rgba(255, 255, 255, 0.78);
  --surface: #f4f8ff;
  --surface-line: #c9d9f0;
  --soft: #e3edfb;
  --radius: 6px;
  --accent: #ffb703;
  --accent-hover: #f0a800;
  --on-accent: #0f2747;
  --dock-btn: #0f2747;
  --dock-btn-hover: #1b3a63;
  --plus: #ffb703;
  --title-font: var(--mono);
  --title-weight: 700;
  --title-bg: transparent;
  --title-ink: #ffffff;
  --title-rotate: 0deg;
  --title-radius: 4px;
  --title-border: 2px solid rgba(255, 255, 255, 0.75);
  --title-shadow: none;
  --overlay: rgba(5, 20, 50, 0.6);
  --shadow: rgba(5, 15, 40, 0.6);
  --toast: #0f2747;
  --tape: rgba(255, 255, 255, 0.55);
  --note-radius: 3px;
  --note-ink: #0f2747;
  --photo-paper: #f4f8ff;
  --c-yellow: #fff6bf;
  --c-pink: #ffd9d9;
  --c-mint: #d4f5e6;
  --c-blue: #dbeaff;
  --c-orange: #ffe2bf;
  --c-lilac: #e6e0ff;
  --p1: #ffb703;
  --p2: #ff595e;
  --p3: #8ac926;
  --p4: #ffffff;
  --p5: #6a4c93;
}

/* 8 · Wald: natürlich und grün */
[data-theme="forest"] {
  --bg: #dce7d3;
  --bg-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='5' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .25 0 0 0 0 .4 0 0 0 0 .22 0 0 0 1.6 -.85'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 10% 5%, #eef4e8 0%, transparent 55%),
    radial-gradient(ellipse at 95% 95%, #c3d6b5 0%, transparent 60%);
  --bg-size: auto;
  --vignette: inset 0 0 140px rgba(40, 70, 40, 0.25);
  --ink: #213326;
  --muted: #5c6f60;
  --on-bg: #2f4a35;
  --on-bg-muted: #5c6f60;
  --surface: #fbfcf8;
  --surface-line: #d6e2cc;
  --soft: #e9f1e2;
  --radius: 16px;
  --accent: #3f7d4e;
  --accent-hover: #356b42;
  --dock-btn: #2f5d3a;
  --dock-btn-hover: #3b7049;
  --plus: #c8553d;
  --title-font: var(--hand);
  --title-weight: 700;
  --title-bg: #fbfcf8;
  --title-ink: #2f4a35;
  --title-rotate: -1deg;
  --title-radius: 6px;
  --title-border: 0;
  --title-shadow: 0 2px 2px rgba(0, 0, 0, 0.08), 0 14px 24px -12px rgba(40, 60, 40, 0.5);
  --tape-opacity: 1;
  --tape: rgba(178, 205, 150, 0.65);
  --overlay: rgba(25, 40, 28, 0.5);
  --shadow: rgba(40, 60, 40, 0.45);
  --toast: #2f4a35;
  --note-radius: 4px;
  --note-ink: #263a2b;
  --photo-paper: #fbfcf8;
  --c-yellow: #faf0c2;
  --c-pink: #f6d8cd;
  --c-mint: #d3e9cd;
  --c-blue: #d2e5e7;
  --c-orange: #f5dcb5;
  --c-lilac: #e2dcec;
  --p1: #c8553d;
  --p2: #3f7d4e;
  --p3: #e0a83a;
  --p4: #4a7c8c;
  --p5: #8c6a4f;
}

/* 9 · Packpapier: warm und handgemacht */
[data-theme="kraft"] {
  --bg: #c9a77c;
  --bg-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='k'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.06 .9' numOctaves='3' seed='8' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .29 0 0 0 0 .15 0 0 0 1.4 -.62'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23k)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 30% 20%, #d6b78d 0%, transparent 60%),
    radial-gradient(ellipse at 85% 90%, #b8946a 0%, transparent 55%);
  --bg-size: auto;
  --vignette: inset 0 0 150px rgba(80, 50, 20, 0.35);
  --ink: #3b2a1a;
  --muted: #7a6450;
  --on-bg: #3b2a1a;
  --on-bg-muted: rgba(59, 42, 26, 0.72);
  --surface: #f7f0e3;
  --surface-line: #e2d4bd;
  --soft: #efe3cd;
  --radius: 8px;
  --accent: #c2410c;
  --accent-hover: #a8380a;
  --dock-btn: #3b2a1a;
  --dock-btn-hover: #523b25;
  --plus: #c2410c;
  --title-font: var(--hand);
  --title-weight: 700;
  --title-bg: #f7f0e3;
  --title-ink: #3b2a1a;
  --title-rotate: 1deg;
  --title-radius: 2px;
  --title-border: 0;
  --title-shadow: 0 2px 2px rgba(0, 0, 0, 0.1), 0 12px 20px -10px rgba(60, 35, 10, 0.6);
  --tape-opacity: 1;
  --tape: rgba(225, 200, 150, 0.7);
  --overlay: rgba(50, 30, 10, 0.5);
  --shadow: rgba(60, 35, 10, 0.55);
  --toast: #3b2a1a;
  --note-radius: 2px;
  --note-ink: #3b2a1a;
  --photo-paper: #f7f0e3;
  --c-yellow: #f7e9a8;
  --c-pink: #f3cfc4;
  --c-mint: #d8e4c6;
  --c-blue: #cfdde3;
  --c-orange: #f2d3a6;
  --c-lilac: #ddd3e3;
  --p1: #b23a2b;
  --p2: #2d5d7b;
  --p3: #4f7a3a;
  --p4: #d49a2a;
  --p5: #5b3f6b;
}

/* 10 · Sonnenuntergang: warme Verläufe */
[data-theme="sunset"] {
  --bg: #ffc2a1;
  --bg-image:
    radial-gradient(circle at 80% 18%, rgba(255, 244, 214, 0.9) 0%, rgba(255, 244, 214, 0) 22%),
    linear-gradient(165deg, #ffe0b2 0%, #ffb4a2 42%, #e5989b 70%, #b5838d 100%);
  --bg-size: auto;
  --ink: #3a1f2b;
  --muted: #7d5866;
  --on-bg: #4a1f33;
  --on-bg-muted: rgba(74, 31, 51, 0.72);
  --surface: #fff8f3;
  --surface-line: #f6d8cc;
  --soft: #ffe9dd;
  --radius: 22px;
  --accent: #e8590c;
  --accent-hover: #d24f08;
  --dock-btn: #4a1f33;
  --dock-btn-hover: #5f2a43;
  --plus: #e8590c;
  --title-font: var(--ui);
  --title-weight: 800;
  --title-bg: rgba(255, 248, 243, 0.9);
  --title-ink: #4a1f33;
  --title-radius: 22px;
  --title-border: 0;
  --title-shadow: 0 16px 30px -16px rgba(120, 40, 50, 0.55);
  --overlay: rgba(70, 25, 40, 0.45);
  --shadow: rgba(110, 40, 50, 0.45);
  --toast: #4a1f33;
  --tape: rgba(255, 196, 160, 0.75);
  --note-radius: 6px;
  --note-ink: #3a1f2b;
  --photo-paper: #fffaf6;
  --c-yellow: #fff1b8;
  --c-pink: #ffd3d8;
  --c-mint: #d6f2e3;
  --c-blue: #d7e6ff;
  --c-orange: #ffdcb8;
  --c-lilac: #ead9ff;
  --p1: #e8590c;
  --p2: #e84a7f;
  --p3: #2ec4b6;
  --p4: #f7c548;
  --p5: #7b5ea7;
}
