/* =========================================================
   CloudGains Funnels — Stylesheet
   ========================================================= */

@font-face { font-family:'Syne'; font-style:normal; font-weight:400 800; font-display:swap; src:url(assets/fonts/syne-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family:'Syne'; font-style:normal; font-weight:400 800; font-display:swap; src:url(assets/fonts/syne-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family:'DM Sans'; font-style:normal; font-weight:300 700; font-display:swap; src:url(assets/fonts/dmsans-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family:'DM Sans'; font-style:normal; font-weight:300 700; font-display:swap; src:url(assets/fonts/dmsans-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #f3f4f6; --bg2: #ffffff; --card: #ffffff; --card2: #fafafb;
  --border: #e5e7eb; --border2: #d7dae0;
  --aqua: #7FFFD4; --aqua-dim: rgba(127,255,212,0.18); --violet: #a78bfa;
  --text: #1f2937; --muted: #6b7280; --faint: rgba(31,41,55,0.62);
  --fd: 'Syne', system-ui, sans-serif; --fb: 'DM Sans', system-ui, sans-serif;
  --radius: 1.5rem;
  --glass-bg: rgba(15,23,42,0.03); --glass-border: rgba(15,23,42,0.08);

  /* app-specific tokens (derived from the tokens above) */
  --accent-line: #0d9488;
  --node-border: rgba(13,148,136,0.55);
  --danger: #f87171;
  --wf-bg: #ffffff;
  --wf-header: #374151;
  --wf-line: #e5e7eb;
  --wf-video: #cdeee4;
  --wf-input-bg: #ffffff;
  --wf-box-bg: #f9fafb;
  --node-shadow: 0 4px 16px rgba(15,23,42,0.08);
}

:root[data-theme="dark"] {
  --bg: #06060a; --bg2: #09090f; --card: #0d0d1a; --card2: #10101f;
  --border: rgba(255,255,255,0.07); --border2: rgba(255,255,255,0.12);
  --text: #e0e3ef; --muted: #8a8a9e; --faint: rgba(224,227,239,0.62);
  --glass-bg: rgba(255,255,255,0.03); --glass-border: rgba(255,255,255,0.08);

  --accent-line: var(--aqua);
  --node-border: rgba(127,255,212,0.42);
  --wf-bg: var(--card2);
  --wf-header: var(--faint);
  --wf-line: rgba(255,255,255,0.16);
  --wf-video: rgba(127,255,212,0.28);
  --wf-input-bg: rgba(255,255,255,0.06);
  --wf-box-bg: rgba(255,255,255,0.045);
  --node-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; padding: 0; font-family: var(--fb); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input { font-family: var(--fb); }
h1, h2, h3, .fd { font-family: var(--fd); }
a { color: inherit; }

/* ---------- Header logo mark (brand signature) ---------- */
.header-logo-mark {
  width: 48px; height: 48px; border-radius: 26%;
  background: radial-gradient(circle at 50% 35%, #1c1c28 0%, #0a0a10 100%);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.06), inset 0 1px 0 rgba(255,255,255,0.08);
  padding: 3px; flex-shrink: 0;
}
.header-logo-mark img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  filter: drop-shadow(0 0 6px rgba(127,255,212,0.75)) drop-shadow(0 0 14px rgba(167,139,250,0.55));
}

/* ---------- Buttons (brand) ---------- */
.btn-glow {
  font-family: var(--fd); background: var(--aqua); color: #000; font-weight: 800; font-size: 0.95rem;
  padding: 1rem 2rem; border-radius: 0.75rem; border: none; cursor: pointer;
  box-shadow: 0 8px 25px rgba(127,255,212,0.3), 0 0 15px rgba(167,139,250,0.2);
  transition: all 0.3s ease; text-decoration: none; display: inline-flex; align-items: center;
}
.btn-glow:hover { transform: translateY(-2px); box-shadow: 0 12px 35px rgba(127,255,212,0.5), 0 0 25px rgba(167,139,250,0.4); }
.btn-glow.btn-small { padding: 0.6rem 1.25rem; font-size: 0.85rem; }

.btn-outline {
  font-family: var(--fd); background: rgba(255,255,255,0.03); color: #fff; font-weight: 700; font-size: 0.95rem;
  padding: 1rem 2rem; border-radius: 0.75rem; border: 1px solid rgba(255,255,255,0.1); cursor: pointer;
  transition: all 0.3s ease; text-decoration: none; display: inline-block;
}
.btn-outline:hover { background: rgba(255,255,255,0.08); box-shadow: 0 0 15px rgba(255,255,255,0.05); }

/* ---------- Site header ---------- */
.site-header {
  height: 68px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; background: var(--bg2); border-bottom: 1px solid var(--border);
}
.site-header-brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.site-header-word { font-family: var(--fd); font-weight: 600; font-size: 1.05rem; color: var(--text); letter-spacing: -0.01em; }
.site-header-word strong { font-weight: 800; color: var(--aqua); }
.site-header-right { display: flex; align-items: center; gap: 1rem; }
.site-header-back { font-family: var(--fb); font-size: 0.85rem; color: var(--faint); text-decoration: none; white-space: nowrap; }
.site-header-back:hover { color: var(--text); }
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border2); background: var(--glass-bg);
  color: var(--text); font-family: var(--fd); font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.icon-btn:hover { border-color: var(--accent-line); color: var(--accent-line); }

/* ---------- App shell / layout ---------- */
.app-shell { display: flex; flex-direction: column; height: 100vh; }
.app { display: flex; flex: 1; min-height: 0; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 260px; flex-shrink: 0; background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 20;
}
.sidebar-heading { padding: 1.1rem 1.1rem 0.5rem; font-family: var(--fd); font-weight: 800; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sidebar-content { padding: 0.5rem 0.85rem 0.85rem; overflow-y: auto; flex: 1; }
.sidebar-footer { padding: 0.85rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-start; }
.theme-toggle {
  background: transparent; border: 1px solid var(--border2); color: var(--muted);
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: all 0.2s ease;
}
.theme-toggle:hover { border-color: var(--accent-line); color: var(--text); }

.draggable-item {
  display: flex; align-items: flex-start; gap: 0.65rem;
  padding: 0.65rem 0.7rem; margin-bottom: 0.5rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 0.75rem; cursor: grab; color: var(--text);
  transition: all 0.15s ease;
}
.draggable-item:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.draggable-item:active { cursor: grabbing; }
.icon-box {
  width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--aqua-dim); color: var(--accent-line); border-radius: 0.5rem;
}
.icon-box svg { width: 18px; height: 18px; }
.draggable-copy { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.draggable-label { font-family: var(--fd); font-weight: 700; font-size: 0.85rem; }
.draggable-caption { font-size: 0.72rem; line-height: 1.3; color: var(--muted); }

/* ---------- Workspace ---------- */
.workspace {
  flex: 1; position: relative; background-color: var(--bg);
  background-image: radial-gradient(var(--border2) 1px, transparent 1px);
  background-size: 22px 22px;
  overflow: hidden; cursor: grab;
  touch-action: none; /* wir steuern Pan/Zoom selbst per Touch */
}
.workspace.panning { cursor: grabbing; }

.empty-hint {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  border: 2px dashed var(--border2); border-radius: var(--radius);
  padding: 2rem 2.5rem; max-width: 360px; text-align: center; color: var(--muted);
  pointer-events: none; z-index: 2; font-size: 0.9rem;
}
.empty-hint.hidden { display: none; }

/* ---------- Toolbar ---------- */
.toolbar {
  position: absolute; top: 1.1rem; left: 50%; transform: translateX(-50%);
  max-width: calc(100% - 2.5rem);
  background: var(--glass-bg); backdrop-filter: blur(10px); padding: 0.5rem 0.75rem; border-radius: 1.25rem;
  box-shadow: var(--node-shadow); display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap;
  z-index: 100; border: 1px solid var(--glass-border);
}
.btn.toolbar-btn {
  border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--faint);
  font-family: var(--fd); font-weight: 700; font-size: 0.8rem; padding: 0.45rem 0.75rem; border-radius: 0.65rem;
  transition: all 0.2s ease; white-space: nowrap;
}
.btn.toolbar-btn:hover { background: var(--glass-bg); color: var(--text); border-color: var(--border2); }
.toolbar-btn-accent { color: var(--accent-line); }
.stat-badge {
  background: var(--aqua-dim); color: var(--accent-line); padding: 0.45rem 0.85rem; border-radius: 0.65rem;
  font-size: 0.8rem; font-weight: 700; font-family: var(--fd); white-space: nowrap;
}
.toolbar-divider { width: 1px; align-self: stretch; background: var(--border2); }

/* ---------- Zoom controls ---------- */
.zoom-controls { display: flex; align-items: center; gap: 0.1rem; }
.zoom-btn { font-size: 1.1rem; line-height: 1; padding: 0.3rem 0.6rem; min-width: 2rem; }
.zoom-label { font-family: var(--fd); font-weight: 700; font-size: 0.75rem; color: var(--faint); min-width: 3rem; text-align: center; }

/* ---------- My funnels panel ---------- */
.my-funnels { position: relative; }
.my-funnels-panel {
  position: absolute; top: calc(100% + 0.5rem); right: 0; width: 260px;
  background: var(--card); border: 1px solid var(--border2); border-radius: 0.85rem;
  box-shadow: var(--node-shadow); padding: 0.6rem; z-index: 200;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.panel-action {
  text-align: left; background: transparent; border: 1px solid var(--border); color: var(--text);
  font-family: var(--fb); font-size: 0.82rem; padding: 0.5rem 0.6rem; border-radius: 0.55rem; cursor: pointer;
  transition: all 0.15s ease;
}
.panel-action:hover { border-color: var(--accent-line); background: var(--aqua-dim); }
.panel-list { display: flex; flex-direction: column; gap: 0.3rem; max-height: 180px; overflow-y: auto; }
.panel-empty { font-size: 0.75rem; color: var(--muted); padding: 0.2rem 0.2rem; }
.panel-divider { height: 1px; background: var(--border); margin: 0.15rem 0; }
.snapshot-row { display: flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.4rem; border-radius: 0.5rem; border: 1px solid var(--border); }
.snapshot-name { flex: 1; font-size: 0.78rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snapshot-btn {
  background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 0.72rem;
  font-family: var(--fb); padding: 0.15rem 0.35rem; border-radius: 0.35rem;
}
.snapshot-btn:hover { color: var(--accent-line); background: var(--aqua-dim); }
.snapshot-btn.danger:hover { color: var(--danger); background: rgba(248,113,113,0.12); }

/* ---------- Layers ---------- */
.connections-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.connections-layer marker polygon { fill: var(--muted); }
.nodes-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none; transform-origin: 0 0; }

/* ---------- Nodes ---------- */
.node {
  position: absolute; width: 230px;
  background: var(--card); border-radius: 0.9rem; box-shadow: var(--node-shadow);
  border: 2px solid var(--node-border); pointer-events: auto;
  display: flex; flex-direction: column; overflow: hidden;
}
.node.selected { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--aqua-dim), var(--node-shadow); }

.node-header {
  padding: 0.55rem 0.4rem 0.55rem 0.75rem; display: flex; align-items: center; gap: 0.5rem;
  background: var(--card2); border-bottom: 1px solid var(--border);
  font-family: var(--fd); font-size: 0.82rem; font-weight: 700; color: var(--text); cursor: move;
}
.node-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-delete {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: none; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.node-delete:hover { background: rgba(248,113,113,0.15); color: var(--danger); }

.node-preview { padding: 0.6rem; background: var(--card); display: flex; justify-content: center; align-items: center; min-height: 70px; pointer-events: none; }

.node-body { padding: 0.55rem 0.75rem 0.7rem; background: var(--card2); display: flex; flex-direction: column; gap: 0.4rem; }
.metric-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.74rem; color: var(--muted); }
.metric-row.computed .metric-value { font-family: var(--fd); font-weight: 800; font-size: 0.95rem; color: var(--text); }
.metric-row.computed.revenue .metric-value { color: var(--accent-line); }
.metric-row.own label { flex-shrink: 0; }
.metric-input {
  width: 84px; text-align: right; background: var(--wf-input-bg); border: 1px solid var(--border2); color: var(--text);
  border-radius: 0.4rem; padding: 0.2rem 0.4rem; font-size: 0.8rem; font-family: var(--fb);
}
.metric-input:focus { outline: none; border-color: var(--accent-line); }
.metric-note { font-size: 0.65rem; color: var(--muted); font-style: italic; }

/* ---------- Wireframe previews ---------- */
.mini-page {
  width: 100%; height: 68px; background: var(--wf-bg); border: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 4px; gap: 3px; border-radius: 4px; position: relative;
}
.mp-header { height: 6px; background: var(--wf-header); width: 80%; margin: 0 auto 2px auto; border-radius: 2px; opacity: 0.8; }
.mp-header.red { background: var(--danger); width: 100%; }
.mp-row { display: flex; gap: 4px; flex: 1; }
.mp-col { display: flex; flex-direction: column; gap: 3px; }
.mp-flex-1 { flex: 1; }
.mp-flex-2 { flex: 2; }
.mp-video { background: var(--wf-video); border-radius: 2px; display: flex; align-items: center; justify-content: center; position: relative; width: 100%; height: 100%; }
.mp-video::after { content: '▶'; font-size: 9px; color: var(--wf-bg); }
.mp-line { height: 4px; background: var(--wf-line); width: 100%; border-radius: 1px; }
.mp-line.short { width: 60%; }
.mp-btn { height: 8px; background: #fca5a5; width: 100%; border-radius: 2px; margin-top: auto; }
.mp-btn.green { background: #86efac; }
.mp-btn.blue { background: #93c5fd; }
.mp-input { height: 6px; border: 1px solid var(--border); background: var(--wf-input-bg); border-radius: 1px; width: 100%; }
.mp-box { border: 1px solid var(--border); background: var(--wf-box-bg); border-radius: 2px; }

/* Preview-only layout helpers (kept as classes, never inline styles — CSP style-src is 'self' with no 'unsafe-inline') */
.mp-col-center { justify-content: center; }
.mp-live-badge {
  position: absolute; top: 2px; right: 2px; background: #ef4444; color: #fff;
  font-size: 6px; padding: 1px 2px; border-radius: 1px; font-weight: bold;
}
.mp-video-lg { height: 36px; }
.mp-video-grow { flex: 1; }
.mp-gap-top-sm { margin-top: 4px; }
.mp-line-center-gap { margin: 2px auto 0 auto; }
.mp-header-abs { position: absolute; top: 4px; }
.mp-btn-half { width: 50%; }
.email-row { display: flex; gap: 4px; align-items: center; }
.email-dot { width: 12px; height: 12px; background: var(--wf-line); border-radius: 50%; }

.ad-card { width: 100%; height: 100%; border: 1px solid var(--border); display: flex; gap: 4px; padding: 4px; align-items: center; background: var(--wf-bg); }
.ad-img { width: 20px; height: 20px; background: var(--wf-video); border-radius: 50%; flex-shrink: 0; }

.email-card { width: 100%; height: 100%; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; padding: 6px; justify-content: center; background: var(--wf-bg); }
.email-subject { height: 6px; width: 80%; background: var(--wf-header); border-radius: 2px; }

.booking-card { width: 100%; height: 100%; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; padding: 5px; background: var(--wf-bg); }
.cal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; flex: 1; }
.cal-cell { background: var(--wf-box-bg); border-radius: 1px; }
.cal-cell.on { background: var(--wf-video); }

.thankyou-card { align-items: center; justify-content: center; gap: 6px; }
.thankyou-emoji { font-size: 16px; }

/* ---------- Connection handles ---------- */
.handle {
  width: 13px; height: 13px; background: var(--card); border: 2px solid var(--muted);
  border-radius: 50%; position: absolute; top: 50%; margin-top: -6.5px;
  cursor: crosshair; transition: all 0.15s ease; z-index: 20;
}
.handle:hover { background: var(--accent-line); border-color: var(--accent-line); transform: scale(1.25); }
.handle-in { left: -7px; }
.handle-out { right: -7px; }

/* ---------- SVG connections ---------- */
.connection-hit { fill: none; stroke: transparent; stroke-width: 16px; cursor: pointer; pointer-events: stroke; }
.connection-line { fill: none; stroke: var(--muted); stroke-width: 2px; pointer-events: none; transition: stroke 0.15s; }
.connection-group:hover .connection-line { stroke: var(--accent-line); stroke-width: 3px; }
.connection-group.selected .connection-line { stroke: var(--accent-line); stroke-width: 3px; stroke-dasharray: 6,4; }
.connection-line.new-connection { stroke: var(--accent-line); stroke-dasharray: 5,5; animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -10; } }

.connection-delete { opacity: 0; transition: opacity 0.15s ease; cursor: pointer; pointer-events: auto; }
.connection-group:hover .connection-delete, .connection-group.selected .connection-delete { opacity: 1; }
.connection-delete circle { fill: var(--danger); }
.connection-delete line { stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.55); z-index: 500; display: flex; justify-content: center; align-items: center;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--card); padding: 1.5rem; border-radius: 1rem; width: 320px; max-width: calc(100vw - 2rem);
  box-shadow: var(--node-shadow); border: 1px solid var(--border2); position: relative;
}
.modal h3 { margin: 0 0 1rem; color: var(--text); font-size: 1.1rem; }
.input-group { margin-bottom: 0.9rem; }
.input-group label { display: block; margin-bottom: 0.3rem; font-size: 0.82rem; color: var(--muted); }
.input-group input {
  width: 100%; padding: 0.55rem 0.65rem; border: 1px solid var(--border2); border-radius: 0.5rem;
  background: var(--bg); color: var(--text); font-size: 0.9rem;
}
.input-group input:focus { outline: none; border-color: var(--accent-line); }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.5rem; }
.btn-primary {
  background: var(--aqua); color: #000; border: none; padding: 0.55rem 1.1rem; border-radius: 0.55rem;
  cursor: pointer; font-family: var(--fd); font-weight: 800; font-size: 0.85rem;
}
.btn-secondary {
  background: transparent; color: var(--text); border: 1px solid var(--border2); padding: 0.55rem 1.1rem;
  border-radius: 0.55rem; cursor: pointer; font-family: var(--fd); font-weight: 700; font-size: 0.85rem;
}

/* ---------- Onboarding ---------- */
.onboarding-modal { width: 460px; max-width: calc(100vw - 2rem); }
.onboarding-x { position: absolute; top: 0.9rem; right: 0.9rem; background: transparent; border: none; color: var(--muted); font-size: 1.3rem; cursor: pointer; line-height: 1; }
.onboarding-x:hover { color: var(--text); }
.onboarding-steps { list-style: none; counter-reset: step; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.85rem; }
.onboarding-steps li { counter-increment: step; padding-left: 2.1rem; position: relative; }
.onboarding-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--aqua-dim); color: var(--accent-line); font-family: var(--fd); font-weight: 800; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
}
.onboarding-steps strong { display: block; font-family: var(--fd); font-size: 0.92rem; margin-bottom: 0.15rem; }
.onboarding-steps p { margin: 0; font-size: 0.82rem; color: var(--faint); line-height: 1.45; }

/* ---------- Touch / mobile layout ----------
   Statt die App zu verstecken: Sidebar wandert als horizontale Leiste nach unten,
   der Canvas nimmt den Rest. Bausteine per Tipp hinzufügen (Drag&Drop-Fallback),
   Pan/Zoom per Ein-/Zwei-Finger-Gesten. */
@media (max-width: 820px) {
  .app { flex-direction: column-reverse; }
  .sidebar {
    width: 100%; height: auto; flex-direction: column;
    border-right: none; border-top: 1px solid var(--border);
  }
  .sidebar-heading { padding: 0.6rem 1rem 0.15rem; font-size: 0.7rem; }
  .sidebar-content {
    display: flex; flex: 0 0 auto;
    flex-direction: row; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
    padding: 0.5rem 0.75rem 0.7rem; gap: 0.5rem; -webkit-overflow-scrolling: touch;
  }
  .draggable-item { flex: 0 0 auto; width: 200px; margin-bottom: 0; }
  .sidebar-footer { display: none; }
  .toolbar { top: 0.6rem; padding: 0.4rem 0.55rem; gap: 0.4rem; }
  .stat-badge { order: 99; width: 100%; text-align: center; white-space: normal; }
  .empty-hint { max-width: 280px; padding: 1.5rem; font-size: 0.85rem; }
}
