/* Pinnwand */
:root {
  --bg: #f4f2ed;
  --dots: rgba(60, 50, 30, .16);
  --surface: #ffffff;
  --surface-2: #f7f6f2;
  --surface-3: #efede7;
  --border: rgba(40, 34, 20, .09);
  --border-strong: rgba(40, 34, 20, .17);
  --text: #1d1c1a;
  --text-2: #5e5b55;
  --text-3: #95918a;
  --accent: #ff6b4a;
  --accent-hover: #f25a38;
  --accent-ink: #ffffff;
  --p1: #e5484d;
  --p2: #e8960c;
  --p3: #8c94a3;
  --p1-soft: rgba(229, 72, 77, .12);
  --p2-soft: rgba(232, 150, 12, .13);
  --p3-soft: rgba(140, 148, 163, .16);
  --topbar: rgba(244, 242, 237, .84);
  --shadow: 0 1px 2px rgba(40, 30, 10, .05), 0 4px 16px -6px rgba(40, 30, 10, .12);
  --shadow-lift: 0 2px 6px rgba(40, 30, 10, .08), 0 22px 44px -14px rgba(40, 30, 10, .28);
  --shadow-pop: 0 4px 12px rgba(20, 16, 8, .10), 0 18px 48px -12px rgba(20, 16, 8, .25);
  --radius: 16px;
  --top: calc(58px + env(safe-area-inset-top));
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131417;
    --dots: rgba(255, 255, 255, .075);
    --surface: #1d1f23;
    --surface-2: #24262b;
    --surface-3: #2c2f35;
    --border: rgba(255, 255, 255, .07);
    --border-strong: rgba(255, 255, 255, .14);
    --text: #ecebe8;
    --text-2: #a9a7a1;
    --text-3: #6f6e6a;
    --accent: #ff7a5c;
    --accent-hover: #ff8d73;
    --accent-ink: #1a0f0b;
    --p1: #ff6369;
    --p2: #ffb224;
    --p3: #8d95a4;
    --p1-soft: rgba(255, 99, 105, .15);
    --p2-soft: rgba(255, 178, 36, .14);
    --p3-soft: rgba(141, 149, 164, .16);
    --topbar: rgba(19, 20, 23, .82);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px -8px rgba(0, 0, 0, .5);
    --shadow-lift: 0 2px 8px rgba(0, 0, 0, .35), 0 24px 48px -16px rgba(0, 0, 0, .7);
    --shadow-pop: 0 6px 16px rgba(0, 0, 0, .4), 0 22px 56px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.45 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
a { color: inherit; text-decoration-color: var(--text-3); text-underline-offset: 2px; }

.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 10px; font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn .i { width: 16px; height: 16px; stroke-width: 2.4; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 4px 12px -4px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.wide { width: 100%; height: 44px; font-size: 15px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--text-2);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.danger:hover { background: var(--p1-soft); color: var(--p1); }

/* ---------- Topbar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20; height: var(--top);
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 8px;
  background: var(--topbar); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; margin-right: 10px; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.views { display: flex; background: var(--surface-3); border-radius: 11px; padding: 3px; gap: 2px; }
.views button {
  display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 8px;
  color: var(--text-2); font-size: 13.5px; font-weight: 600; transition: background .15s, color .15s, box-shadow .15s;
}
.views button .i { width: 16px; height: 16px; }
.views button:hover { color: var(--text); }
.views button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 0 0 1px var(--border); }
.spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px; border-radius: 10px;
  background: var(--surface-3); color: var(--text-3); cursor: text; transition: box-shadow .15s, background .15s;
}
.search:focus-within { background: var(--surface); box-shadow: 0 0 0 1.5px var(--accent); color: var(--text-2); }
.search input { border: 0; outline: 0; background: none; width: 170px; color: var(--text); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.stats {
  height: 32px; padding: 0 10px; border-radius: 9px; font-size: 13px; color: var(--text-2); white-space: nowrap;
}
.stats:hover { background: var(--surface-3); }
.stats b { color: var(--text); font-weight: 650; }
.stats .hot { color: var(--p1); font-weight: 650; }
.sync { width: 8px; height: 8px; border-radius: 50%; background: #2fb36b; box-shadow: 0 0 0 3px rgba(47,179,107,.18); flex: none; margin: 0 4px; transition: background .3s, box-shadow .3s; }
.sync.off { background: var(--p3); box-shadow: 0 0 0 3px var(--p3-soft); }
.sync.pending { background: var(--p2); box-shadow: 0 0 0 3px var(--p2-soft); }

/* ---------- Board (Whiteboard) ---------- */
.board {
  position: fixed; inset: var(--top) 0 0 0; overflow: hidden;
  background-image: radial-gradient(var(--dots) 1.15px, transparent 1.35px);
  background-size: 24px 24px;
  touch-action: none; cursor: grab;
}
.board.panning { cursor: grabbing; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.world.glide { transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.board.glide { transition: background-position .35s cubic-bezier(.2, .8, .2, 1), background-size .35s cubic-bezier(.2, .8, .2, 1); }
#focus, #summary { display: none; }

body[data-view="list"] .board, body[data-view="focus"] .board {
  overflow-y: auto; overflow-x: hidden; touch-action: pan-y; cursor: default;
  background-position: 0 0 !important; background-size: 24px 24px !important;
  -webkit-overflow-scrolling: touch;
}
body[data-view="list"] .world {
  position: static; transform: none !important;
  display: flex; flex-direction: column; gap: 12px;
  max-width: 720px; margin: 0 auto; padding: 4px 16px calc(110px + env(safe-area-inset-bottom));
}
body[data-view="list"] #summary { display: block; }
body[data-view="focus"] .world { display: none; }
body[data-view="focus"] #focus { display: grid; }
body:not([data-view="board"]) .board-tools { display: none; }

.summary { max-width: 720px; margin: 0 auto; padding: 18px 20px 10px; color: var(--text-2); font-size: 13.5px; }
.summary b { color: var(--text); }
.summary .hot { color: var(--p1); font-weight: 650; }

/* ---------- Karte ---------- */
.card {
  --c: var(--accent);
  position: absolute; left: var(--x, 0px); top: var(--y, 0px); width: var(--w, 320px);
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 0 1px var(--border);
  cursor: default; touch-action: manipulation;
  transition: box-shadow .2s, opacity .2s, top .25s cubic-bezier(.2, .8, .2, 1), left .25s cubic-bezier(.2, .8, .2, 1);
  animation: card-in .3s cubic-bezier(.2, .8, .2, 1) backwards;
  scroll-margin-top: 12px;
}
.card::before {
  content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--c); opacity: .9;
}
.card.dragging { transition: none; box-shadow: var(--shadow-lift), 0 0 0 1px var(--border-strong); z-index: 10; cursor: grabbing; transform: rotate(.6deg) scale(1.015); }
.card.resizing { transition: none; }
.card.dim { opacity: .35; }
.card.flash { animation: flash 1.1s ease-out; }
body[data-view="board"] .card { touch-action: none; user-select: none; -webkit-user-select: none; }
body[data-view="board"] .card :is(input, textarea) { user-select: text; -webkit-user-select: text; }
body[data-view="list"] .card { position: relative; left: auto; top: auto; width: auto; transition: box-shadow .2s; }
@keyframes card-in { from { opacity: 0; transform: translateY(6px) scale(.985); } }
@keyframes flash { 0%, 40% { box-shadow: var(--shadow), 0 0 0 3px var(--c); } 100% { box-shadow: var(--shadow), 0 0 0 1px var(--border); } }

.card-h {
  display: flex; align-items: center; gap: 6px; padding: 13px 8px 9px 10px; min-height: 50px;
  cursor: grab; user-select: none; -webkit-user-select: none;
}
body:not([data-view="board"]) .card-h { cursor: pointer; }
.card-toggle { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: var(--text-3); flex: none; }
.card-toggle:hover { background: var(--surface-3); color: var(--text); }
.card-toggle .i { width: 16px; height: 16px; transition: transform .2s; }
.card.collapsed .card-toggle .i { transform: rotate(-90deg); }
.card-title { margin: 0; font-size: 15.5px; font-weight: 680; letter-spacing: -.01em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title-input { width: 100%; min-width: 0; font-size: 15.5px; font-weight: 680; border: 0; outline: 0; background: var(--surface-2); border-radius: 8px; padding: 3px 8px; box-shadow: 0 0 0 1.5px var(--c); }
.badges { display: flex; gap: 5px; align-items: center; flex: none; }
.badge { font-size: 12px; font-weight: 650; height: 21px; min-width: 21px; padding: 0 7px; border-radius: 99px; display: inline-grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.badge.hot { background: var(--p1-soft); color: var(--p1); }
.badge.zero { background: none; color: var(--text-3); padding: 0 2px; }
.card-h .icon-btn { width: 30px; height: 30px; opacity: .55; }
.card:hover .card-h .icon-btn, .card-h .icon-btn:focus-visible { opacity: 1; }
@media (hover: none) { .card-h .icon-btn { opacity: .8; } }

.progress { height: 3px; margin: 0 14px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; width: var(--p, 0%); background: var(--c); border-radius: 3px; transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.card.collapsed .progress { margin-bottom: 12px; }
.card.collapsed .card-body { display: none; }
.card-body { padding: 6px 6px 8px; }

/* ---------- To-dos ---------- */
.todos { list-style: none; margin: 0; padding: 0; }
.todo {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: start; gap: 10px;
  padding: 7px 8px; border-radius: 10px; position: relative;
  animation: todo-in .22s ease-out backwards;
}
.todo:hover { background: var(--surface-2); }
@keyframes todo-in { from { opacity: 0; transform: translateY(-3px); } }
.check {
  --pc: var(--p3);
  width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  border: 2px solid var(--pc); display: grid; place-items: center; color: transparent;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.check .i { width: 12px; height: 12px; stroke-width: 3.4; }
.todo.p1 .check { --pc: var(--p1); background: var(--p1-soft); }
.todo.p2 .check { --pc: var(--p2); }
.todo.p3 .check { --pc: var(--p3); }
.check:hover { color: var(--pc); }
.todo.done .check, .todo.checking .check { background: var(--c, var(--pc)); border-color: var(--c, var(--pc)); color: #fff; }
.todo.checking .check { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.todo.checking .text { text-decoration: line-through; color: var(--text-3); transition: color .2s; }
.todo.checking { animation: fade-out .38s .24s ease-in forwards; }
@keyframes pop { 50% { transform: scale(1.25); } }
@keyframes fade-out { to { opacity: 0; transform: translateX(8px); } }
.body { min-width: 0; }
.text { display: block; font-size: 14.5px; line-height: 1.42; word-break: break-word; cursor: text; padding-top: 1px; }
.todo.done .text { color: var(--text-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-3) 60%, transparent); }
.prio {
  font-size: 11.5px; font-weight: 650; height: 21px; padding: 0 8px; border-radius: 99px; margin-top: 1px;
  color: var(--text-3); opacity: 0; transition: opacity .15s, background .15s;
}
.todo:hover .prio, .prio:focus-visible { opacity: 1; }
.todo .prio:hover { background: var(--surface-3); }
.todo.p1 .prio { opacity: 1; background: var(--p1-soft); color: var(--p1); }
.todo.done .prio { display: none; }
@media (hover: none) { .todo.p2 .prio, .todo.p3 .prio { display: none; } }
.chip {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; height: 22px; padding: 0 9px 0 7px; border-radius: 99px;
  font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-3); max-width: 100%;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover { color: var(--text); }
.empty { list-style: none; padding: 8px 10px 4px 40px; color: var(--text-3); font-size: 13.5px; }

/* Bearbeiten */
.todo.editing { animation: none; background: var(--surface-2); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--c, var(--accent)) 70%, transparent); }
.edit-text {
  display: block; width: 100%; resize: none; border: 0; outline: 0; background: none; padding: 1px 0 0;
  font-size: 14.5px; line-height: 1.42; overflow: hidden;
}
.edit-tools { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.move { position: relative; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border-radius: 8px; background: var(--surface-3); color: var(--text-2); font-size: 12.5px; max-width: 150px; }
.move .i { width: 14px; height: 14px; }
.move select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.move span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-tools .icon-btn { width: 28px; height: 28px; margin-left: auto; }
.edit-tools .icon-btn .i { width: 16px; height: 16px; }

.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.seg-prio button.p1.on { background: var(--p1); color: #fff; }
.seg-prio button.p2.on { background: var(--p2); color: #fff; }
.seg-prio button.p3.on { background: var(--p3); color: #fff; }

/* Neues To-do in der Karte */
.add { display: flex; align-items: center; gap: 10px; padding: 3px 8px; margin-top: 2px; border-radius: 10px; }
.add:focus-within { background: var(--surface-2); }
.add .i { width: 18px; height: 18px; color: var(--text-3); margin: 0 2px; stroke-width: 2.2; }
.add:focus-within .i { color: var(--c); }
.add input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; height: 32px; font-size: 14.5px; }
.add input::placeholder { color: var(--text-3); }

/* Erledigt */
.done-sec { margin-top: 4px; padding: 4px 4px 0; border-top: 1px dashed var(--border-strong); }
.done-toggle { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.done-toggle:hover { color: var(--text-2); background: var(--surface-2); }
.done-toggle .i { width: 14px; height: 14px; transition: transform .2s; transform: rotate(-90deg); }
.done-sec.open .done-toggle .i { transform: none; }
.done-sec:not(.open) .todos, .done-sec:not(.open) .link { display: none; }
.link { font-size: 12.5px; color: var(--text-3); padding: 4px 8px 2px 40px; }
.link:hover { color: var(--p1); text-decoration: underline; }

.card-resize {
  position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: ew-resize; border-radius: 0 0 var(--radius) 0;
  background: linear-gradient(135deg, transparent 50%, var(--border-strong) 50%, var(--border-strong) 56%, transparent 56%, transparent 68%, var(--border-strong) 68%, var(--border-strong) 74%, transparent 74%);
  opacity: 0; transition: opacity .15s;
}
.card:hover .card-resize { opacity: 1; }
body:not([data-view="board"]) .card-resize { display: none; }

/* ---------- Fokus ---------- */
.focus {
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start;
  max-width: 1280px; margin: 0 auto; padding: 22px 20px calc(110px + env(safe-area-inset-bottom));
}
.lane { background: color-mix(in srgb, var(--surface) 70%, transparent); border-radius: 18px; box-shadow: 0 0 0 1px var(--border); padding: 6px 6px 10px; }
.lane > header { display: flex; align-items: center; gap: 9px; padding: 10px 10px 8px; }
.lane h2 { margin: 0; font-size: 15px; font-weight: 700; }
.lane-dot { width: 10px; height: 10px; border-radius: 50%; }
.lane.p1 .lane-dot { background: var(--p1); box-shadow: 0 0 0 4px var(--p1-soft); }
.lane.p2 .lane-dot { background: var(--p2); box-shadow: 0 0 0 4px var(--p2-soft); }
.lane.p3 .lane-dot { background: var(--p3); box-shadow: 0 0 0 4px var(--p3-soft); }
.lane .count { margin-left: auto; font-size: 12.5px; font-weight: 650; color: var(--text-3); }
.lane .todo { background: var(--surface); box-shadow: 0 0 0 1px var(--border); margin-top: 6px; padding: 9px 10px; }
.lane .todo:hover { background: var(--surface); box-shadow: 0 0 0 1px var(--border-strong); }
.lane .todo .prio { opacity: 1; }
.lane .empty { padding: 6px 12px; }

.empty-state { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--text-2); text-align: center; }

/* ---------- Werkzeugleiste, FAB ---------- */
.board-tools {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 15;
  display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow-pop), 0 0 0 1px var(--border);
}
.board-tools .sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 4px; }
.zoom-label { min-width: 50px; height: 34px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.zoom-label:hover { background: var(--surface-3); }
.fab {
  display: none; position: fixed; z-index: 16; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, calc(env(safe-area-inset-bottom) + 8px));
  width: 58px; height: 58px; border-radius: 19px; place-items: center;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px -6px color-mix(in srgb, var(--accent) 70%, transparent), 0 2px 6px rgba(0,0,0,.15);
  transition: transform .15s;
}
.fab:active { transform: scale(.94); }
.fab .i { width: 26px; height: 26px; stroke-width: 2.4; }

/* ---------- Menü, Toast, Dialoge ---------- */
.menu {
  position: fixed; z-index: 40; min-width: 220px; max-width: calc(100vw - 24px); padding: 6px; border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow-pop), 0 0 0 1px var(--border);
  animation: menu-in .14s ease-out;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu > button { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border-radius: 9px; font-size: 14px; text-align: left; }
.menu > button .i { width: 17px; height: 17px; color: var(--text-2); }
.menu > button:hover:not(:disabled) { background: var(--surface-3); }
.menu > button.danger { color: var(--p1); }
.menu > button.danger .i { color: var(--p1); }
.menu > button.danger.armed { background: var(--p1); color: #fff; }
.menu > button.danger.armed .i { color: #fff; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 4px; }
.menu .menu-label { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 8px 10px 4px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 10px 8px; }
.swatches button { width: 24px; height: 24px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); transition: transform .12s; }
.swatches button:hover { transform: scale(1.12); }
.swatches button.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }

.toast {
  position: fixed; left: 50%; bottom: max(24px, calc(env(safe-area-inset-bottom) + 14px)); z-index: 50;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 16px; border-radius: 13px; background: #24252a; color: #f2f1ee; font-size: 14px;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.45);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: transform .25s cubic-bezier(.2, .8, .2, 1), opacity .2s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast button { color: #ffb3a3; font-weight: 650; padding: 4px 8px; border-radius: 8px; }
.toast button:hover { background: rgba(255,255,255,.08); }
.toast:not(:has(button)) { padding-right: 16px; }

dialog.sheet {
  border: 0; padding: 0; width: min(480px, calc(100vw - 32px)); border-radius: 20px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop), 0 0 0 1px var(--border);
}
dialog.sheet::backdrop { background: rgba(15, 12, 8, .35); backdrop-filter: blur(2px); }
dialog.sheet[open] { animation: sheet-in .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.sheet form { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.sheet h3 { margin: 0; font-size: 17px; font-weight: 700; }
.sheet input[type="text"], .sheet input[type="password"], .sheet textarea {
  width: 100%; border: 0; outline: 0; border-radius: 12px; padding: 11px 13px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border); font-size: 16px; resize: none;
}
.sheet input:focus, .sheet textarea:focus { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--surface); }
.hint { margin: -2px 2px 2px; font-size: 12.5px; color: var(--text-3); }
kbd { font: inherit; font-weight: 700; color: var(--text-2); background: var(--surface-3); border-radius: 4px; padding: 0 5px; }
.field-label { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow-y: auto; }
.chips button {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 10px; border-radius: 99px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); font-size: 13.5px; font-weight: 600; color: var(--text-2);
}
.chips button::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chips button.on { background: color-mix(in srgb, var(--c) 16%, var(--surface)); box-shadow: inset 0 0 0 1.5px var(--c); color: var(--text); }
.sheet .seg { align-self: flex-start; }
.sheet .seg button { height: 30px; padding: 0 14px; font-size: 13.5px; }
.sheet .btn.wide { margin-top: 8px; }
.sheet .swatches { padding: 2px 0 4px; gap: 10px; }
.sheet .swatches button { width: 30px; height: 30px; }

/* ---------- Login ---------- */
.login {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 20px;
  background-image: radial-gradient(var(--dots) 1.15px, transparent 1.35px); background-size: 24px 24px;
}
.login-card {
  width: min(360px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px 26px 22px;
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-pop), 0 0 0 1px var(--border); text-align: center;
}
.login-logo { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 6px 18px -6px rgba(0,0,0,.35); }
.login h1 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.02em; }
.login p { margin: 0 0 8px; color: var(--text-2); font-size: 14px; }
.login input[type="password"] {
  width: 100%; border: 0; outline: 0; border-radius: 12px; padding: 12px 14px; font-size: 16px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border);
}
.login input:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.login-error { min-height: 20px; color: var(--p1) !important; font-size: 13.5px; margin: 0 !important; }

/* ---------- Schmal (Handy) ---------- */
@media (max-width: 760px) {
  .hide-narrow, .stats, .views button span { display: none; }
  .brand { margin-right: 4px; }
  .brand span { display: none; }
  .views button { padding: 0 11px; }
  .search { padding: 0; width: 36px; justify-content: center; background: none; }
  .search input { width: 0; padding: 0; }
  .search:focus-within, .search.has-value { position: absolute; left: 12px; right: 12px; width: auto; padding: 0 10px; justify-content: flex-start; z-index: 2; background: var(--surface); }
  .search:focus-within input, .search.has-value input { width: 100%; }
  .fab { display: grid; }
  .board-tools { right: auto; left: max(14px, env(safe-area-inset-left)); bottom: max(22px, calc(env(safe-area-inset-bottom) + 12px)); }
  .focus { grid-template-columns: 1fr; padding: 12px 12px calc(110px + env(safe-area-inset-bottom)); gap: 12px; }
  .lane > header { position: sticky; top: 0; z-index: 1; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 14px; }
  body[data-view="list"] .world { padding-left: 10px; padding-right: 10px; gap: 10px; }
  .summary { padding: 14px 16px 8px; }
  dialog.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  dialog.sheet[open] { animation: sheet-up .24s cubic-bezier(.2, .8, .2, 1); }
  .text, .edit-text, .add input { font-size: 16px; }
  .chips { max-height: 30vh; }
  .toast { bottom: max(92px, calc(env(safe-area-inset-bottom) + 86px)); }
  .todo { padding: 8px 8px; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } }

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