/* Nunito (SIL Open Font License), lateinischer Ausschnitt, selbst gehostet */
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/static/nunito.woff2") format("woff2"); }
:root {
  --ground: #F3EEE6;
  --ground-2: #E9E2D6;
  --panel: #FFFFFF;
  --card: #FBF9F5;
  --hair: #EFE8DC;
  --hair-2: #E2D9CB;
  --ink: #2B2622;
  --ink-2: #6E645B;
  --ink-3: #74695E;
  --act: #FF5A36;
  --act-ink: #C23A1A;
  --act-fill: #D63F1D; /* Knopffläche: weißer Text erreicht 4.5:1 */
  --act-soft: #FFE6DE;
  --late: #B3392A;
  --late-soft: #F8E1DC;
  --soon: #74540F;
  --soon-soft: #F6E6C8;
  --done: #3F6B35;
  --done-soft: #E1EDD9;
  --r-panel: 16px;
  --r-card: 14px;
  --r-pill: 999px;
  --shadow-lift: 0 18px 40px -12px rgba(70, 50, 25, .28), 0 4px 10px rgba(70, 50, 25, .08);
  --shadow-pop: 0 12px 32px -8px rgba(70, 50, 25, .22), 0 2px 6px rgba(70, 50, 25, .06);
  --font: "Nunito", ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --board-tint: var(--ground);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--board-tint); color: var(--ink); font: 15px/1.4 var(--font); -webkit-font-smoothing: antialiased; transition: background-color .4s var(--ease); }
::selection { background: var(--act-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--act); outline-offset: 2px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea { caret-color: var(--act); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 16px; height: 16px; stroke-width: 2.1; } /* kleine Icons brauchen kräftigere Linien, sonst wirken sie unscharf */
* { scrollbar-width: thin; scrollbar-color: var(--hair-2) transparent; }
[hidden] { display: none !important; } /* Komponenten-Regeln mit display dürfen „hidden“ nie überstimmen */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --- Bedienelemente --- */
.btn { height: 40px; padding: 0 18px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 8px; font-weight: 650; background: var(--ground-2); transition: background-color .15s, transform .15s var(--ease); white-space: nowrap; }
.btn:hover { background: var(--hair-2); }
.btn:active { transform: scale(.97); }
.btn.act { background: var(--act-fill); color: #fff; }
.btn.act:hover { background: #B8341A; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--ground-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 14px; }
.btn.on { background: var(--act-soft); color: var(--act-ink); }
.btn.danger { color: var(--late); }
.btn.danger:hover { background: var(--late-soft); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--ink-2); transition: background-color .15s; }
.icon-btn:hover { background: var(--ground-2); color: var(--ink); }
.field { width: 100%; border: 1.5px solid var(--hair-2); background: var(--panel); border-radius: 12px; padding: 9px 12px; outline: none; transition: border-color .15s; }
.field:focus { border-color: var(--act); }
textarea.field { resize: none; overflow: hidden; min-height: 64px; line-height: 1.5; }
.av { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 750; color: var(--ink); background: color-mix(in srgb, var(--c) 32%, #fff); border: 2px solid var(--ring, var(--ground)); flex: none; letter-spacing: .02em; }
.av.sm { width: 26px; height: 26px; font-size: 11.5px; letter-spacing: 0; }
.avs { display: flex; }
.avs .av + .av { margin-left: -4px; } /* wenig Überlappung, damit Initialen lesbar bleiben */
.pill { --c: #888; display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 650; background: color-mix(in srgb, var(--c) 20%, #fff); color: color-mix(in srgb, var(--c) 72%, #000); }
.pill.bar { width: 40px; height: 8px; padding: 0; background: var(--c); cursor: pointer; }
.empty { color: var(--ink-3); font-size: 14px; padding: 6px 2px; }

/* --- Login --- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login form { width: min(380px, 100%); background: var(--panel); border-radius: 24px; padding: 36px 32px 32px; box-shadow: var(--shadow-pop); display: grid; gap: 14px; }
.login h1 { font-size: 26px; letter-spacing: -.02em; }
.login p { margin: -6px 0 6px; color: var(--ink-2); }
.login label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.login .btn { justify-content: center; height: 46px; margin-top: 6px; }
.err { color: var(--late); font-size: 14px; min-height: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.logo i { width: 28px; height: 28px; border-radius: 9px; background: var(--ink); position: relative; flex: none; }
.logo i::before, .logo i::after { content: ""; position: absolute; top: 7px; width: 5px; border-radius: 2px; }
.logo i::before { left: 7px; height: 14px; background: var(--ground); }
.logo i::after { left: 16px; height: 9px; background: var(--act); }

/* --- Kopfleiste --- */
.top { height: 72px; display: flex; align-items: center; gap: 12px; padding: 0 24px; position: relative; z-index: 20; }
.top .sp { flex: 1; }
.search { position: relative; width: min(340px, 30vw); margin-left: 16px; }
.search input { width: 100%; height: 42px; border-radius: var(--r-pill); border: 1.5px solid transparent; background: var(--panel); padding: 0 16px 0 42px; outline: none; transition: border-color .15s; }
.search input:focus { border-color: var(--act); box-shadow: 0 0 0 3px var(--act-soft); }
.search input::placeholder { color: var(--ink-3); }
.search > svg { position: absolute; left: 15px; top: 12px; color: var(--ink-3); pointer-events: none; }
.results { position: absolute; top: 48px; left: 0; width: max(100%, 380px); background: var(--panel); border-radius: var(--r-panel); box-shadow: var(--shadow-pop); padding: 8px; max-height: 60vh; overflow: auto; }
.results a { display: grid; grid-template-columns: 10px 1fr; gap: 2px 10px; padding: 9px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.results a:hover, .results a.sel { background: var(--ground); }
.results a i { width: 10px; height: 10px; border-radius: 3px; margin-top: 5px; background: var(--c); }
.results small { grid-column: 2; color: var(--ink-3); }
.me { position: relative; }

/* --- Popover --- */
.pop { position: fixed; z-index: 60; width: 300px; background: var(--panel); border-radius: var(--r-panel); box-shadow: var(--shadow-pop); padding: 14px; animation: pop .16s var(--ease); max-height: 80vh; overflow: auto; }
.pop h4 { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); font-weight: 650; display: flex; justify-content: space-between; align-items: center; }
.pop .row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 10px; text-align: left; }
.pop .row:hover { background: var(--ground); }
.pop .row .tick { margin-left: auto; color: var(--act); visibility: hidden; }
.pop .row.on .tick { visibility: visible; }
.pop .row .pill { flex: 1; height: 28px; font-size: 13px; }
.pop hr { border: 0; border-top: 1px solid var(--hair); margin: 10px 0; }
.pop .sect { font-size: 12px; font-weight: 700; color: var(--ink-3); margin: 12px 0 6px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* --- Übersicht --- */
.home { padding: 8px 24px 48px; } /* volle Breite: Inhalte nutzen den ganzen Bildschirm */
.home h1 { font-size: 30px; letter-spacing: -.02em; margin: 8px 0 20px; }
.home h2 { font-size: 15px; color: var(--ink-2); margin: 32px 0 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tile { height: 124px; border-radius: var(--r-panel); padding: 16px 18px; background: var(--panel); color: var(--ink); text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s var(--ease); text-align: left; }
.tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 44px; background: var(--c); opacity: .9; }
.tile b { position: relative; font-size: 16px; margin-top: 46px; line-height: 1.25; }
.tile small { color: var(--ink-3); }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.tile.new { background: transparent; border: 2px dashed var(--hair-2); color: var(--ink-2); align-items: center; justify-content: center; flex-direction: row; gap: 8px; font-weight: 650; }
.tile.new::before { display: none; }
.tile.new:hover { border-color: var(--act); color: var(--act-ink); box-shadow: none; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 10px; background: var(--c); display: grid; place-items: center; color: #fff; }

/* --- Board --- */
.bhead { display: flex; align-items: center; gap: 12px; padding: 4px 24px 18px; flex-wrap: wrap; }
.bhead h1 { font-size: 28px; letter-spacing: -.02em; padding: 2px 8px; margin-left: -8px; border-radius: 10px; cursor: text; }
.bhead h1:hover { background: rgba(255, 255, 255, .55); }
.bhead input.title { font-size: 28px; font-weight: 700; letter-spacing: -.02em; border: 0; border-radius: 10px; padding: 2px 8px; margin-left: -8px; outline: 2px solid var(--act); width: min(600px, 80vw); }
.bhead .sub { color: var(--ink-2); }
.bhead .sp { flex: 1; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--act); }
.board { display: flex; gap: 16px; padding: 0 24px 24px; align-items: flex-start; overflow-x: auto; height: calc(100vh - 72px - 66px); height: calc(100dvh - 72px - 66px); scroll-padding: 24px; }
.list { width: 300px; flex: none; background: var(--panel); border-radius: var(--r-panel); box-shadow: 0 1px 2px rgba(80, 60, 30, .06); display: flex; flex-direction: column; max-height: 100%; }
.list.ph { background: rgba(255, 255, 255, .45); box-shadow: none; outline: 2px dashed var(--hair-2); }
.lh { display: flex; align-items: center; gap: 6px; padding: 14px 10px 8px 18px; cursor: grab; }
.lh b { font-size: 15.5px; flex: 1; padding: 3px 6px; margin-left: -6px; border-radius: 8px; overflow-wrap: anywhere; }
.lh input { flex: 1; font-weight: 700; font-size: 15.5px; border: 0; outline: 2px solid var(--act); border-radius: 8px; padding: 3px 6px; margin-left: -6px; }
.cnt { background: var(--ground); border-radius: var(--r-pill); padding: 1px 9px; font-size: 12.5px; color: var(--ink-2); font-weight: 650; }
.cards { padding: 4px 12px 2px; overflow-y: auto; min-height: 8px; flex: 1 1 auto; }
.card { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-card); padding: 12px 14px; margin-bottom: 10px; cursor: pointer; position: relative; transition: border-color .15s, box-shadow .15s; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.card:hover { border-color: var(--hair-2); box-shadow: 0 2px 8px -2px rgba(80, 60, 30, .12); }
.card.ph { background: var(--ground); border: 0; box-shadow: none; }
.card.ph > * { visibility: hidden; }
.card .lbls { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.card .t { font-size: 15px; font-weight: 640; line-height: 1.35; overflow-wrap: anywhere; color: var(--ink); }
.card .meta { display: flex; align-items: center; gap: 6px 12px; margin-top: 10px; font-size: 13px; line-height: 1; color: var(--ink-2); flex-wrap: wrap; min-height: 26px; }
.card .meta:empty { display: none; }
.card .meta > span { display: inline-flex; align-items: center; gap: 5px; } /* nur direkte Elemente: die Avatar-Kreise behalten ihre Zentrierung */
.card .meta > .avs { margin-left: auto; gap: 0; }
.card .av { --ring: var(--card); }
.due { border-radius: var(--r-pill); padding: 1px 8px 1px 6px; }
.due.late { background: var(--late-soft); color: var(--late); font-weight: 650; }
.due.soon { background: var(--soon-soft); color: var(--soon); font-weight: 650; }
.due.done, .meta .done { background: var(--done-soft); color: var(--done); font-weight: 650; }
.meta .done { border-radius: var(--r-pill); padding: 1px 8px 1px 6px; }
.card .fresh { position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--act); border: 2.5px solid var(--panel); }
.add { display: flex; align-items: center; gap: 6px; margin: 2px 12px 12px; padding: 8px 6px; border-radius: 10px; color: var(--act-ink); font-weight: 700; }
.add:hover { background: var(--act-soft); }
.composer { padding: 0 12px 12px; display: grid; gap: 8px; }
.composer .acts { display: flex; gap: 6px; align-items: center; }
.addl { width: 300px; flex: none; height: 54px; border-radius: var(--r-panel); border: 2px dashed var(--hair-2); color: var(--ink-2); display: flex; align-items: center; gap: 8px; padding-left: 18px; font-weight: 650; }
.addl:hover { border-color: var(--act); color: var(--act-ink); }
.newlist { width: 300px; flex: none; background: var(--panel); border-radius: var(--r-panel); padding: 12px; display: grid; gap: 8px; }
.drag { position: fixed; z-index: 100; pointer-events: none; box-shadow: var(--shadow-lift); transform-origin: 30% 20%; transition: transform .18s var(--ease); margin: 0; }
.drag.card { transform: rotate(3.5deg) scale(1.03); border-color: var(--hair-2); }
.drag.list { transform: rotate(2deg); }
body.dragging, body.dragging * { cursor: grabbing !important; }
.filtered .card.hide { display: none; }

/* --- Seitenleiste (Board-Menü) --- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 100vw); background: var(--panel); z-index: 50; box-shadow: -20px 0 40px -20px rgba(70, 50, 25, .25); padding: 18px 20px; overflow: auto; animation: slide .22s var(--ease); }
.drawer h3 { font-size: 17px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer .nav { display: grid; gap: 2px; margin-bottom: 8px; }
.drawer .nav button { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; font-weight: 600; text-align: left; }
.drawer .nav button:hover { background: var(--ground); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.feed { display: grid; gap: 14px; }
.ev { display: grid; grid-template-columns: 30px 1fr; gap: 10px; font-size: 14px; }
.ev b { font-weight: 700; }
.ev small { display: block; color: var(--ink-3); margin-top: 2px; }
.ev .bubble { background: var(--card); border: 1px solid var(--hair); border-radius: 12px; padding: 8px 12px; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.arch { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--hair); margin-bottom: 8px; }
.arch span { flex: 1; font-weight: 600; overflow-wrap: anywhere; }

/* --- Karten-Detail --- */
.modal-bg { position: fixed; inset: 0; z-index: 40; background: rgba(43, 38, 34, .32); display: flex; justify-content: center; align-items: flex-start; padding: 48px 16px; overflow: auto; animation: fade .18s ease-out; }
.modal-bg.still, .modal-bg.still .modal { animation: none; }
.modal { position: relative; width: min(820px, 100%); background: var(--panel); border-radius: 22px; padding: 28px 28px 32px; box-shadow: var(--shadow-lift); animation: rise .24s var(--ease); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.mclose { position: absolute; top: 18px; right: 18px; }
.banner { display: flex; gap: 8px; align-items: center; background: var(--soon-soft); color: var(--soon); font-weight: 650; border-radius: 12px; padding: 10px 14px; margin: 0 40px 16px 0; }
.mtitle { width: 100%; font-size: 22px; font-weight: 750; letter-spacing: -.01em; line-height: 1.3; border: 0; resize: none; overflow: hidden; padding: 4px 8px; margin-left: -8px; border-radius: 10px; outline: none; }
.mtitle:hover { background: var(--card); }
.mtitle:focus { box-shadow: 0 0 0 2px var(--act); background: var(--panel); }
.link { color: var(--ink); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hair-2); }
.link:hover { text-decoration-color: var(--act); }
.mlab { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 7px; }
.mside .mlab:not(:first-child) { margin-top: 18px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--act); cursor: pointer; margin: 0; flex: none; }
.msec { margin-top: 28px; }
.msec h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; margin-bottom: 12px; }
.msec h3 .i { color: var(--ink-2); }
.desc { display: block; width: 100%; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; padding: 10px 12px; margin-left: -12px; border-radius: 12px; cursor: text; max-width: 70ch; }
.desc:hover { background: var(--card); }
.desc a { color: var(--act-ink); text-underline-offset: 3px; }
.desc.ph { background: var(--card); border: 1px solid var(--hair); color: var(--ink-3); min-height: 64px; margin-left: 0; display: flex; align-items: flex-start; }
.acts { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.hint { color: var(--ink-3); font-size: 12px; }
.prog { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-2); font-weight: 650; margin-bottom: 8px; }
.prog .num { width: 38px; }
.track { flex: 1; height: 8px; border-radius: 99px; background: var(--ground); overflow: hidden; }
.track i { display: block; height: 100%; background: var(--ink-2); border-radius: 99px; transition: width .35s var(--ease), background-color .3s; }
.track i.full { background: var(--done); }
.item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin-left: -8px; border-radius: 10px; cursor: pointer; }
.item:hover { background: var(--card); }
.item span { flex: 1; overflow-wrap: anywhere; }
.item.done span { color: var(--ink-3); text-decoration: line-through; }
.item .icon-btn { visibility: hidden; width: 26px; height: 26px; }
.item:hover .icon-btn, .item:focus-within .icon-btn { visibility: visible; }
.msec > input.field { margin-top: 6px; }
.cform { display: flex; gap: 10px; margin-bottom: 20px; }
.cform .av { --ring: var(--panel); }
.cacts { display: flex; gap: 12px; margin-top: 4px; font-size: 13px; }
.cacts .link { font-weight: 600; color: var(--ink-2); }
.mside { display: flex; flex-direction: column; gap: 6px; }
.btn.side { justify-content: flex-start; width: 100%; height: 36px; }
@media (max-width: 720px) {
  .modal-bg { padding: 0; }
  .modal { border-radius: 0; min-height: 100%; padding: 20px 16px 28px; }
    .mside { flex-direction: row; flex-wrap: wrap; }
  .mside .mlab { width: 100%; margin: 0; }
  .btn.side { width: auto; }
  .icon-btn { width: 44px; height: 44px; }
  .btn.sm, .btn.side { height: 44px; }
  .lh { padding-top: 8px; padding-bottom: 4px; }
}

/* --- Toast --- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; border-radius: var(--r-pill); padding: 10px 10px 10px 18px; display: flex; gap: 12px; align-items: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); z-index: 90; font-weight: 600; font-size: 14px; }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { color: #FFB49F; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); }
#toast button:hover { background: rgba(255, 255, 255, .1); }

@media (max-width: 720px) {
  .top { padding: 0 16px; gap: 6px; height: 64px; }
  .top .logo span, .hide-sm { display: none; }
  .bhead { gap: 8px; }
  .bhead .sub { display: none; }
  .search { margin-left: 4px; width: auto; flex: 1; }
  .top .sp { display: none; }
  .results { width: calc(100vw - 32px); }
  .bhead { padding: 4px 16px 12px; }
  .bhead h1, .bhead input.title { font-size: 22px; }
  .board { padding: 0 16px 16px; scroll-snap-type: x mandatory; height: calc(100dvh - 64px - 58px); }
  .list, .addl, .newlist { width: calc(100vw - 48px); scroll-snap-align: start; }
  .home { padding: 8px 16px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .drag.card, .drag.list { transform: none; }
}
.modal:focus { outline: none; }
