:root {
  --ink: #23203a;
  --muted: #5d5878;
  --bg: #faf6ef;
  --card: #ffffff;
  --violet: #7b5cff;
  --violet-dark: #5a3ee0;
  --coral: #ff7a59;
  --mint: #3cbf8f;
  --sun: #ffd23f;
  --sky: #59a8ff;
  --line: #e7e1f3;
  --radius: 22px;
  --shadow: 0 2px 4px rgba(35, 32, 58, .06), 0 8px 24px rgba(35, 32, 58, .08);
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.45; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* organische Formen im Hintergrund */
.blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; width: 46vmax; opacity: .55; }
.b1 { top: -14vmax; left: -12vmax; fill: #d6ccff; }
.b2 { bottom: -18vmax; right: -10vmax; fill: #c8ecd9; }
.b3 { top: 30vh; right: 18vw; width: 26vmax; fill: #ffd9c7; opacity: .45; }

/* Buttons */
.btn { font: inherit; font-weight: 650; border: 2px solid var(--ink); background: #fff; color: var(--ink);
  border-radius: 999px; padding: .5em 1.1em; cursor: pointer; transition: transform .12s, background .12s; }
.btn:hover { transform: translateY(-1px); background: #f3efff; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.btn.primary { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn.primary:hover { background: var(--violet-dark); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(123, 92, 255, .1); }
.btn.danger { border-color: #c73b3b; color: #c73b3b; }
.btn.small { padding: .3em .8em; font-size: .85rem; }
.btn.big { font-size: 1.15rem; padding: .7em 1.4em; width: 100%; }
.icon-btn { border: 0; background: transparent; cursor: pointer; font-size: 1.15rem; line-height: 1; padding: .25em .4em; border-radius: 10px; color: var(--muted); }
.icon-btn:hover { background: rgba(0,0,0,.06); color: var(--ink); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { background: var(--card); border-radius: 36px 36px 36px 8px; padding: 40px 36px; max-width: 440px; width: 100%; box-shadow: var(--shadow); }
.login-card h1 { font-size: clamp(2rem, 6vw, 2.8rem); line-height: 1.05; margin: .2em 0 .4em; letter-spacing: -.02em; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 800; color: var(--violet); margin: 0; }
.muted { color: var(--muted); }
.tiny { font-size: .82rem; color: var(--muted); }
#pin { width: 100%; font: inherit; font-size: 2rem; text-align: center; letter-spacing: .5em; text-transform: uppercase;
  padding: .45em .2em .45em .7em; border: 2px solid var(--line); border-radius: 18px; margin: 10px 0 14px; background: #fcfbff; }
.error { color: #b42318; font-weight: 600; min-height: 1.2em; margin: .5em 0 0; }

/* Kopf */
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 28px 28px 10px; }
.top h1 { font-size: clamp(1.9rem, 4.5vw, 3.2rem); margin: 0; letter-spacing: -.025em; line-height: 1; }
.subtitle { margin: .45em 0 0; color: var(--muted); max-width: 70ch; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: .35em .8em; border-radius: 999px; background: var(--sun); }
.badge.read { background: #c8ecd9; }
.reminder { margin: 6px 28px 0; padding: 10px 16px; border-radius: 16px; background: rgba(255,255,255,.7); border: 2px dashed #cbbfff; font-size: .92rem; }
.footer-note { text-align: center; color: var(--muted); font-size: .9rem; padding: 10px 20px 30px; }
body:not(.is-admin) .admin-only { display: none !important; }

/* Pinnwand */
.board { display: flex; gap: 18px; align-items: flex-start; overflow-x: auto; padding: 20px 28px 24px; min-height: 60vh; scroll-snap-type: x proximity; }
.column { flex: 0 0 300px; max-width: 300px; scroll-snap-align: start; display: flex; flex-direction: column; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-radius: 20px 20px 20px 6px; margin-bottom: 12px; font-weight: 800; font-size: 1.1rem; }
.column-head h2 { font-size: 1.08rem; margin: 0; flex: 1; line-height: 1.2; }
.is-admin .column-head { cursor: grab; }
.column-cards { display: flex; flex-direction: column; gap: 14px; min-height: 60px; padding-bottom: 4px; border-radius: 16px; }
.add-card { margin-top: 12px; border: 2px dashed #bdb3e6; background: rgba(255,255,255,.55); border-radius: 18px; padding: .7em; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.add-card:hover { background: #fff; color: var(--ink); }

/* Karten */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.is-admin .card { cursor: grab; }
.card-band { height: 8px; }
.card-inner { padding: 12px 16px 14px; }
.card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.chip { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: .25em .65em; border-radius: 999px; background: #f1edff; color: var(--violet-dark); }
.cat-rows { display: flex; flex-direction: column; gap: 8px; }
.cat-row { display: flex; align-items: center; gap: 8px; }
.dialog .cat-row input[type=text] { flex: 1 1 auto; width: auto; min-width: 0; }
.dialog .cat-row input[type=color] { flex: 0 0 44px; width: 44px; height: 40px; border: 2px solid var(--line); border-radius: 12px; padding: 3px; background: #fff; cursor: pointer; }
.card-top .spacer { flex: 1; }
.card h3 { font-size: 1.12rem; line-height: 1.25; margin: .2em 0 .35em; overflow-wrap: anywhere; }
.card .body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem; }
.card .body a { color: var(--violet-dark); }
.attachment { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: #f7f5ff; text-decoration: none; color: var(--ink); font-weight: 650; font-size: .9rem; overflow-wrap: anywhere; }
.attachment:hover { background: #ece7ff; }
.attachment .ext { flex: 0 0 auto; font-size: .7rem; font-weight: 800; background: var(--ink); color: #fff; border-radius: 8px; padding: .3em .5em; }
.preview-img { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 14px; margin-top: 10px; }
.embed { position: relative; margin-top: 10px; border-radius: 14px; overflow: hidden; background: #23203a; aspect-ratio: 16 / 9; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-consent { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: #fff; padding: 12px; font-size: .82rem; background: linear-gradient(135deg, #5a3ee0, #ff7a59); }
.embed-consent .btn { border-color: #fff; }

/* Abstimmung */
.poll { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.poll-opt { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; font: inherit; font-weight: 650; font-size: .92rem;
  border: 2px solid var(--line); border-radius: 14px; padding: .55em .8em; background: #fff; cursor: pointer; overflow: hidden; color: var(--ink); }
.poll-opt:hover:not(:disabled) { border-color: var(--violet); }
.poll-opt:disabled { cursor: default; }
.poll-opt .bar { position: absolute; inset: 0 auto 0 0; background: #fff0a8; z-index: 0; transition: width .4s; }
.poll-opt span { position: relative; z-index: 1; }
.poll-meta { font-size: .8rem; color: var(--muted); }
.voters { font-size: .78rem; color: var(--muted); margin: 2px 0 0 4px; }

/* Kommentare */
.comments { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.comment { font-size: .86rem; background: #faf8ff; border-radius: 12px; padding: 6px 10px; display: flex; gap: 6px; align-items: flex-start; }
.comment p { margin: 0; flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment time { display: block; font-size: .72rem; color: var(--muted); }
.comment-form { display: flex; gap: 6px; margin-top: 4px; }
.comment-form input { flex: 1; font: inherit; font-size: .86rem; border: 2px solid var(--line); border-radius: 12px; padding: .35em .6em; min-width: 0; }

/* Menü */
.menu { position: absolute; right: 10px; top: 36px; z-index: 5; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; min-width: 170px; }
.menu button { font: inherit; text-align: left; border: 0; background: none; padding: .5em .7em; border-radius: 10px; cursor: pointer; }
.menu button:hover { background: #f3efff; }
.menu button.danger { color: #b42318; }

/* Drag & Drop */
.sortable-ghost { opacity: .35; }
.sortable-chosen { transform: rotate(1.5deg); }

/* Dialoge */
.dialog { border: 0; border-radius: 28px; padding: 0; width: min(560px, 94vw); box-shadow: 0 20px 60px rgba(35,32,58,.3); color: var(--ink); }
.dialog.small { width: min(440px, 94vw); }
.dialog::backdrop { background: rgba(35, 32, 58, .45); }
.dialog form { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.dialog h2 { margin: 0 0 4px; font-size: 1.6rem; letter-spacing: -.01em; }
.dialog label { display: flex; flex-direction: column; gap: 4px; font-weight: 650; font-size: .92rem; }
.dialog label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.dialog input:not([type=checkbox]):not([type=file]), .dialog textarea, .dialog select { font: inherit; font-weight: 400; border: 2px solid var(--line); border-radius: 14px; padding: .55em .75em; background: #fcfbff; width: 100%; }
.dialog hr { border: 0; border-top: 1px solid var(--line); width: 100%; }
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 650; font-size: .92rem; }
.file-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 6px; }
.dialog-actions .spacer { flex: 1; }
.type-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.type-picker button { font: inherit; font-weight: 700; font-size: .85rem; border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: .35em .85em; cursor: pointer; }
.type-picker button[aria-pressed=true] { border-color: var(--ink); outline: 2px solid var(--ink); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 32px; height: 32px; border-radius: 50% 45% 55% 50%; border: 2px solid rgba(0,0,0,.12); cursor: pointer; }
.swatches button[aria-pressed=true] { outline: 3px solid var(--ink); outline-offset: 2px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--ink); color: #fff; padding: .7em 1.2em; border-radius: 999px; font-weight: 650; transition: transform .25s; z-index: 50; max-width: 92vw; text-align: center; }
.toast.show { transform: translate(-50%, 0); }

.empty-col { font-size: .85rem; color: var(--muted); text-align: center; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.5); }

@media (max-width: 640px) {
  .top { padding: 20px 16px 6px; }
  .reminder { margin: 6px 16px 0; }
  .board { padding: 16px; }
  .column { flex-basis: 84vw; max-width: 84vw; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.cat-row input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.cat-row input[type=color]::-webkit-color-swatch { border: 0; border-radius: 8px; }
.cat-row input[type=color]::-moz-color-swatch { border: 0; border-radius: 8px; }
