/* ============================================================
   ToDo-Board – Styles im Look von steve-mueller.com (hell/dunkel)
   ============================================================ */
:root {
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --r-xl: 22px; --r-lg: 18px; --r-md: 12px; --r-sm: 9px;
  --acc: #f7931a;
  --danger: #e5484d; --ok: #22c55e;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root, :root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff; --board-bg: #ffffff;
  --surface: #ffffff; --surface-2: #f7f6f3; --surface-3: #eeede9;
  --text: #11140f; --muted: #5d6459; --muted-2: #8a9187;
  --line: #e9e8e3; --line-2: #dcdbd5;
  --acc-ink: #c9790a; --acc-soft: rgba(247, 147, 26, .12);
  --warm-bg: #fdf6ec; --warm-line: #f4e3c8;
  --cta-bg: #11140f; --cta-fg: #ffffff;
  --col-bg: #f8f7f4;
  --shadow: 0 1px 2px rgba(17, 20, 15, .04), 0 2px 8px rgba(17, 20, 15, .04);
  --shadow-hover: 0 4px 10px rgba(17, 20, 15, .07), 0 12px 28px rgba(17, 20, 15, .08);
  --shadow-lg: 0 30px 80px rgba(17, 20, 15, .22);
  --overlay: rgba(17, 20, 15, .38);
  --toast-bg: #11140f; --toast-fg: #fff;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1211; --board-bg: #0f1211;
  --surface: #171b18; --surface-2: #1d221e; --surface-3: #262c27;
  --text: #eef1ec; --muted: #aab2a6; --muted-2: #868e84;
  --line: #282e29; --line-2: #343b35;
  --acc-ink: #f3a63c; --acc-soft: rgba(247, 147, 26, .16);
  --warm-bg: #241d10; --warm-line: #4a3a1c;
  --cta-bg: #eef1ec; --cta-fg: #11140f;
  --col-bg: #141816;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-hover: 0 6px 22px rgba(0, 0, 0, .45);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, .65);
  --overlay: rgba(4, 6, 5, .7);
  --toast-bg: #eef1ec; --toast-fg: #11140f;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--acc-ink); }
svg.i { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::selection { background: var(--acc-soft); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--acc-ink); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.grow { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s var(--ease), box-shadow .15s, opacity .15s;
}
.btn:hover { border-color: var(--muted-2); }
.btn:active { transform: scale(.97); }
.btn-cta { background: var(--cta-bg); color: var(--cta-fg); border-color: transparent; box-shadow: 0 6px 18px rgba(17, 20, 15, .18); }
.btn-cta:hover { border-color: transparent; opacity: .9; }
.btn-acc { background: var(--acc); color: #fff; border-color: transparent; font-weight: 700; box-shadow: 0 8px 22px rgba(247, 147, 26, .35); }
.btn-acc:hover { border-color: transparent; filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: transparent; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { height: 32px; padding: 0 13px; font-size: 13px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); transition: background .15s, color .15s, transform .15s var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm svg.i { width: 16px; height: 16px; }
.icon-btn.round { border: 1px solid var(--line-2); }

/* ---------- Eingaben ---------- */
.input {
  width: 100%; min-height: 40px; padding: 9px 13px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:hover { border-color: var(--line-2); }
.input:focus { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
textarea.input { resize: vertical; min-height: 44px; line-height: 1.5; }
.input::placeholder { color: var(--muted-2); }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23868e84' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
}
label.lbl { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.check {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px; flex-shrink: 0; margin: 0; border-radius: 7px;
  border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; display: inline-grid; place-items: center; transition: all .15s;
}
.check:hover { border-color: var(--acc); }
.check:checked { background: var(--ok); border-color: var(--ok); }
.check:checked::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translate(0, -1px) rotate(45deg); }

/* ---------- Logo (Schalter wie auf der Webseite) ---------- */
.logo-toggle { position: relative; width: 58px; height: 34px; border-radius: 999px; background: var(--acc); flex-shrink: 0; box-shadow: 0 6px 16px rgba(247, 147, 26, .35); }
.logo-toggle .knob { position: absolute; right: 4px; top: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--acc); }
.logo-toggle .knob svg.i { width: 15px; height: 15px; stroke-width: 3.2; }
.brand { display: flex; align-items: center; gap: 12px; margin-right: 12px; }
.brand-name { font-size: 22px; font-weight: 400; letter-spacing: -.02em; line-height: 1; }
.brand-sub { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 36px 32px; border-radius: 26px; background: var(--warm-bg); border: 1px solid var(--warm-line); }
.auth-card h1 { margin: 20px 0 6px; font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.auth-card p { margin: 0 0 24px; color: var(--muted); }
.auth-card form { display: grid; gap: 14px; }
.auth-card .btn { height: 48px; font-size: 15px; margin-top: 4px; }
.auth-theme { position: fixed; top: 16px; right: 16px; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 26px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.search { position: relative; flex: 1; max-width: 340px; margin-left: auto; }
.search svg.i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.search .input { padding-left: 40px; border-radius: 999px; height: 42px; }
.topbar select.input { width: auto; border-radius: 999px; height: 42px; min-width: 150px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px;
  background: var(--acc); color: #fff; text-transform: uppercase; flex-shrink: 0;
}
.user-btn { border: 0; background: transparent; padding: 3px; border-radius: 50%; }
.user-btn:hover { background: var(--surface-3); }

/* ---------- Board ---------- */
.board { display: flex; align-items: flex-start; gap: 16px; padding: 24px 26px; overflow-x: auto; min-height: calc(100vh - 71px); scroll-snap-type: x proximity; background: var(--board-bg); }
.col {
  --accent: var(--acc);
  position: relative; flex: 0 0 320px; max-width: 320px; display: flex; flex-direction: column;
  max-height: calc(100vh - 120px); border-radius: var(--r-xl); background: var(--col-bg); border: 1px solid var(--line);
  scroll-snap-align: start; overflow: hidden; transition: box-shadow .2s, border-color .2s;
}
.col::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--accent); }
.col.drop-target { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.col-head { display: flex; align-items: center; gap: 10px; padding: 16px 10px 10px 18px; }
.col-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.col-title { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-role { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); margin-top: 1px; }
.col-count { margin-left: auto; min-width: 26px; height: 24px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent); color: var(--on-accent, #fff); }
.col-cards { flex: 1; overflow-y: auto; padding: 4px 10px 6px; display: flex; flex-direction: column; gap: 9px; min-height: 34px; }
.col-empty { padding: 18px 10px; text-align: center; color: var(--muted-2); font-size: 13px; border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); }
.col-foot { padding: 6px 10px 12px; }
.add-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--muted); font-weight: 500; text-align: left; transition: background .15s, color .15s;
}
.add-btn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); }
.add-form { display: grid; gap: 8px; padding: 10px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.add-form textarea { min-height: 62px; }

.col.collapsed { flex: 0 0 60px; max-width: 60px; cursor: pointer; align-items: center; padding: 18px 0; gap: 12px; }
.col.collapsed:hover { border-color: var(--accent); }
.col.collapsed .col-count { margin: 0; }
.col.collapsed .vert { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 700; color: var(--muted); white-space: nowrap; }
.col-new {
  flex: 0 0 260px; min-height: 64px; border-radius: var(--r-xl); border: 1.5px dashed var(--line-2); background: transparent;
  color: var(--muted); font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all .15s;
}
.col-new:hover { border-color: var(--acc); color: var(--acc-ink); background: var(--acc-soft); }

/* ---------- Karten ---------- */
.card {
  position: relative; padding: 13px 15px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); cursor: pointer; user-select: none;
  transition: transform .18s var(--ease), box-shadow .18s, border-color .18s, opacity .18s;
}
:root[data-theme="dark"] .card { background: var(--surface-2); }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.card.dragging { opacity: .35; transform: rotate(2deg) scale(.98); }
.card.flash { animation: flash 1.4s var(--ease); }
.card.is-done .card-title { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ok) 60%, transparent); }
.card-cover { margin: -13px -15px 10px; height: 120px; border-radius: 15px 15px 0 0; background: var(--surface-3) center / cover no-repeat; }
.card-labels { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; color: var(--on, #fff); background: var(--c, var(--acc)); white-space: nowrap;
}
.chip button { border: 0; background: transparent; color: inherit; padding: 0; display: grid; place-items: center; opacity: .75; }
.chip button:hover { opacity: 1; }
.chip svg.i { width: 12px; height: 12px; stroke-width: 3; }
.card-title { font-weight: 600; font-size: 14.5px; word-wrap: break-word; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 9px; color: var(--muted); }
.card-meta:empty { display: none; }
.meta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.meta svg.i { width: 14px; height: 14px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 8px;
  font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text); white-space: nowrap;
}
.badge svg.i { width: 13px; height: 13px; }
.badge.overdue { background: var(--danger); color: #fff; }
.badge.today { background: var(--ok); color: #fff; }
.badge.soon { background: #fbbf24; color: #3a2500; }
.badge.future { background: var(--acc-soft); color: var(--acc-ink); }
.badge.done { background: var(--ok); color: #fff; }
.badge.appt { background: var(--surface-3); color: var(--text); }
.badge.timer { font-variant-numeric: tabular-nums; }
.badge.timer.running { background: var(--acc-soft); color: var(--acc-ink); }
.badge.timer.running svg.i { animation: pulse 1.2s infinite; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; flex: 1; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--acc); transition: width .3s var(--ease); }
.progress.complete > span { background: var(--ok); }
.card-progress { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.drop-indicator { height: 4px; margin: -2px 4px; border-radius: 4px; background: var(--accent); }

/* ---------- Popover ---------- */
#pop-root { position: fixed; z-index: 80; }
.pop {
  position: fixed; min-width: 230px; max-width: 320px; max-height: min(70vh, 520px); overflow-y: auto; padding: 6px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.pop-title { padding: 8px 10px 6px; }
.pop-item {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 10px;
  background: transparent; text-align: left; color: var(--text);
}
.pop-item:hover { background: var(--surface-2); }
.pop-item.on { font-weight: 700; }
.pop-item .tick { margin-left: auto; color: var(--acc-ink); }
.pop-item.danger { color: var(--danger); }
.pop-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.pop-pad { padding: 8px 10px; display: grid; gap: 10px; }
.pop .hint { margin: 0; padding: 0 10px 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 24px; height: 24px; border-radius: 8px; border: 2px solid transparent; background: var(--c); cursor: pointer; padding: 0; }
.swatch.on { border-color: var(--text); transform: scale(1.12); }

/* ---------- Karten-Detail ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: var(--overlay); backdrop-filter: blur(3px);
  display: flex; justify-content: center; align-items: flex-start; padding: 40px 16px; overflow-y: auto;
}
.sheet {
  --accent: var(--acc);
  position: relative; width: 100%; max-width: 860px; border-radius: 26px; background: var(--surface); box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); overflow: clip;
}
.sheet-top { background: var(--warm-bg); border-bottom: 1px solid var(--warm-line); padding: 24px 28px 18px; }
.sheet-head { display: flex; gap: 10px; align-items: flex-start; }
.title-input {
  flex: 1; font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; border: 1px solid transparent; background: transparent;
  padding: 4px 8px; margin: -4px -8px; border-radius: var(--r-sm); resize: none; outline: none; min-height: 0; overflow: hidden;
}
.title-input:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.title-input:focus { background: var(--surface); border-color: var(--acc); }
.meta-row { display: flex; flex-wrap: wrap; gap: 18px 28px; margin-top: 16px; align-items: flex-start; }
.meta-row .lbl { margin-bottom: 7px; }
.status-btn {
  display: inline-flex; align-items: center; gap: 9px; height: 36px; padding: 0 12px 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); font-weight: 600;
}
.status-btn:hover { border-color: var(--accent); }
.status-btn .dot, .pop-item .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.label-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 36px; }
.label-list .chip { height: 28px; font-size: 12.5px; padding: 0 8px 0 11px; }
.chip-add { height: 28px; padding: 0 11px; border-radius: 999px; border: 1px dashed var(--line-2); background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.chip-add:hover { border-color: var(--acc); color: var(--acc-ink); }
.chip-add svg.i { width: 13px; height: 13px; }
.add-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; padding: 14px; align-items: center; border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); }
.add-bar .lbl { margin: 0 6px 0 0; }
.add-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text); transition: all .15s;
}
.add-pill:hover { border-color: var(--acc); background: var(--acc-soft); }
.add-pill svg.i { width: 14px; height: 14px; color: var(--acc-ink); }

.sheet-body { padding: 8px 28px 28px; }
.section { padding: 20px 0 6px; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-height: 30px; }
.section-head > svg.i { color: var(--acc-ink); }
.section-head .eyebrow { flex: 1; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.field-link { position: relative; }
.field-link a { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted-2); display: grid; }
.field-link a:hover { color: var(--acc-ink); }
.field-link .input { padding-right: 34px; }
.date-grid { display: grid; grid-template-columns: 230px 1fr; gap: 10px; align-items: start; margin-bottom: 10px; }
.date-grid .del { margin-top: 5px; }
.appt-row { display: grid; grid-template-columns: 230px 1fr auto; gap: 10px; align-items: start; margin-bottom: 10px; }
.timer-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.timer-box .time { min-width: 130px; height: 44px; display: flex; align-items: center; padding: 0 16px; border-radius: var(--r-md); background: var(--surface-2); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer-box .time.running { color: var(--acc-ink); background: var(--acc-soft); }

/* Sortierbare Blöcke: Details & Checklisten */
.blocks { display: grid; gap: 12px; padding-top: 18px; }
.block { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 12px 14px 14px; transition: box-shadow .15s, opacity .15s; }
.block.done { background: var(--surface-2); }
.block.done .block-title, .block.done textarea { color: var(--muted); }
.block.sorting, .item.sorting { box-shadow: var(--shadow-hover); border-color: var(--acc); position: relative; z-index: 2; opacity: .95; }
.block-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.block-head > svg.i { color: var(--acc-ink); }
.grip { display: grid; place-items: center; width: 22px; height: 30px; color: var(--muted-2); cursor: grab; touch-action: none; border-radius: 6px; flex-shrink: 0; }
.grip:hover { color: var(--text); background: var(--surface-3); }
.grip:active { cursor: grabbing; }
.grip svg.i { width: 16px; height: 16px; }
.block-title { flex: 1; min-width: 0; border: 1px solid transparent; background: transparent; font-weight: 700; font-size: 15px; padding: 4px 7px; border-radius: var(--r-sm); outline: none; }
.block-title:hover { background: var(--surface-2); }
.block-title:focus { border-color: var(--acc); background: var(--surface); }
.done-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap; padding: 0 4px; }
.block textarea.input { min-height: 70px; }
.progress-row { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.items { display: grid; gap: 2px; }
.item { display: flex; align-items: center; gap: 8px; padding: 2px 4px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid transparent; }
.item:hover { background: var(--surface-2); }
.item .grip { height: 26px; opacity: 0; }
.item:hover .grip, .item.sorting .grip { opacity: 1; }
.item .del { opacity: 0; }
.item:hover .del { opacity: 1; }
.item input[type="text"] { flex: 1; min-width: 0; border: 1px solid transparent; background: transparent; padding: 5px 6px; border-radius: 7px; outline: none; }
.item input[type="text"]:focus { border-color: var(--acc); background: var(--surface); }
.item.done input[type="text"] { text-decoration: line-through; color: var(--muted); }
.add-item { margin: 6px 0 0 30px; }

/* Anhänge */
.attachments { display: grid; gap: 10px; }
.att { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: var(--r-md); background: var(--surface-2); }
.att-thumb { width: 72px; height: 54px; border-radius: 9px; background: var(--surface-3) center / cover no-repeat; display: grid; place-items: center; color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; text-decoration: none; flex-shrink: 0; }
.att-info { flex: 1; min-width: 0; }
.att-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-meta { font-size: 12px; color: var(--muted); }
.att-actions { display: flex; gap: 2px; }
.att-actions .on { color: var(--acc-ink); }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); padding: 14px; text-align: center; color: var(--muted); transition: all .15s; cursor: pointer; display: flex; justify-content: center; gap: 8px; }
.dropzone:hover, .dropzone.over { border-color: var(--acc); color: var(--acc-ink); background: var(--acc-soft); }

/* Tabs: Kommentare / Aktivität / Zeiten */
.tabs-wrap { padding-top: 26px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { padding: 10px 14px; border: 0; background: transparent; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-color: var(--acc); }
.tabs .count { font-size: 11px; font-weight: 700; padding: 1px 7px; margin-left: 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.comment { display: flex; gap: 10px; margin-top: 14px; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.comment-meta b { color: var(--text); }
.comment-text { margin-top: 4px; padding: 10px 13px; border-radius: 4px var(--r-md) var(--r-md) var(--r-md); background: var(--surface-2); white-space: pre-wrap; word-wrap: break-word; }
.activity { font-size: 13px; color: var(--muted); padding: 8px 0; border-bottom: 1px dashed var(--line); }
.activity b { color: var(--text); font-weight: 600; }

.time-sum { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.sum { padding: 8px 13px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.sum b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.sum span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sum.acc { background: var(--warm-bg); border-color: var(--warm-line); }
.sum.acc span { color: var(--acc-ink); }
.time-entry { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; margin-top: 10px; display: grid; gap: 8px; border-left: 4px solid var(--kind, var(--acc)); }
.time-entry.billed { background: var(--surface-2); }
.time-entry[data-kind="nonbillable"] { --kind: #94a3b8; }
.time-entry[data-kind="internal"] { --kind: #3b82f6; }
.te-row { display: grid; grid-template-columns: 150px 108px 14px 108px 84px minmax(140px, 1fr) auto auto; gap: 8px; align-items: center; }
.te-row .sep { text-align: center; color: var(--muted); }
.te-row .input { min-height: 38px; padding: 7px 10px; min-width: 0; }
.te-dur { font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.billed-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.te-meta { font-size: 12px; color: var(--muted-2); }

/* ---------- Dialoge & Toasts ---------- */
.dialog { width: 100%; max-width: 440px; margin-top: 12vh; padding: 26px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.dialog.wide { max-width: 520px; }
.dialog h3 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.02em; }
.dialog p { margin: 0 0 16px; color: var(--muted); }
.dialog form { display: grid; gap: 12px; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.lm-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.lm-row .swatch { flex-shrink: 0; }
.lm-palette { margin: -2px 0 12px 32px; }
#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 540px; padding: 11px 12px 11px 16px; border-radius: 16px;
  background: var(--toast-bg); color: var(--toast-fg); box-shadow: var(--shadow-lg); font-weight: 500; animation: rise .25s var(--ease);
}
.toast.error { background: var(--danger); color: #fff; }
.toast .t-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--acc)); flex-shrink: 0; }
.toast button { border: 0; background: color-mix(in srgb, currentColor 14%, transparent); color: inherit; font-weight: 700; padding: 6px 11px; border-radius: 999px; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .25s; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
@keyframes pulse { 50% { opacity: .3; } }
@keyframes flash {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); transform: scale(1.03); }
  100% { box-shadow: 0 0 0 14px transparent; }
}

/* ---------- Responsiv ---------- */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .te-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .te-row .sep { display: none; }
  .te-row select { grid-column: span 2; }
  .te-row .icon-btn { justify-self: end; }
}
@media (max-width: 520px) {
  .te-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .te-row [data-te="date"] { grid-column: 1 / -1; }
  .te-row select { grid-column: auto; }
}
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .brand { margin-right: auto; }
  .brand-sub { display: none; }
  .search { order: 5; flex-basis: 100%; max-width: none; margin: 0; }
  .topbar select.input { order: 6; flex: 1; }
  .board { padding: 16px; gap: 12px; scroll-snap-type: x mandatory; }
  .col { flex-basis: calc(100vw - 48px); max-width: calc(100vw - 48px); max-height: none; }
  .col.collapsed { flex-basis: 56px; }
  .overlay { padding: 0; }
  .sheet { border-radius: 0; min-height: 100%; }
  .sheet-top, .sheet-body { padding-left: 16px; padding-right: 16px; }
  .date-grid, .appt-row { grid-template-columns: 1fr; }
  .appt-row .del { justify-self: end; }
  .title-input { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ============================================================ Version 3 */
/* Animationen nur beim Öffnen – kein Flackern beim Speichern */
.overlay.anim { animation: fade .18s ease; }
.overlay.anim .sheet, .overlay.anim .dialog { animation: rise .25s var(--ease); }
.pop.anim { animation: pop .15s var(--ease); }

/* Karten leuchten: heute fällig = grün, überfällig = rot */
.card.glow-green { border-color: rgba(34, 197, 94, .7); box-shadow: 0 0 0 1px rgba(34, 197, 94, .35), 0 0 22px rgba(34, 197, 94, .35); }
.card.glow-red { border-color: rgba(239, 68, 68, .75); box-shadow: 0 0 0 1px rgba(239, 68, 68, .35), 0 0 22px rgba(239, 68, 68, .4); animation: glowpulse 2.4s ease-in-out infinite; }
.card.glow-green:hover, .card.glow-red:hover { box-shadow: var(--shadow-hover), 0 0 26px currentColor; }
@keyframes glowpulse { 50% { box-shadow: 0 0 0 1px rgba(239, 68, 68, .5), 0 0 30px rgba(239, 68, 68, .55); } }
.badge small { font-size: 10.5px; opacity: .8; }

/* Spaltenbreite ziehen */
.col-resize { position: absolute; top: 0; right: 0; bottom: 0; width: 9px; cursor: col-resize; z-index: 3; }
.col-resize::after { content: ""; position: absolute; top: 50%; right: 3px; width: 3px; height: 38px; transform: translateY(-50%); border-radius: 3px; background: var(--line-2); opacity: 0; transition: opacity .15s, background .15s; }
.col:hover .col-resize::after { opacity: 1; }
.col.resizing .col-resize::after, .col-resize:hover::after { opacity: 1; background: var(--accent); }
.col.resizing { transition: none; user-select: none; }

/* Fußzeile mit Speichern */
.sheet-foot {
  position: sticky; bottom: -40px; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 14px 28px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.sheet-foot .hint { margin: 0 auto; }

/* Datums-Buttons */
.date-btn {
  display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; text-align: left; transition: border-color .15s, background .15s; white-space: nowrap;
}
.date-btn:hover { border-color: var(--acc); background: var(--acc-soft); }
.date-btn > svg.i { color: var(--acc-ink); }
.date-btn em { font-style: normal; margin-left: 4px; height: 22px; font-size: 11.5px; }
.date-row { display: grid; grid-template-columns: 22px 330px minmax(0, 1fr) auto; gap: 10px; align-items: start; margin-bottom: 10px; }
.date-row > .check { margin-top: 10px; }
.date-row .date-btn { width: 100%; }
.date-btn em { margin-left: auto; }
.add-form .date-btn { width: 100%; font-size: 13px; }

/* ---------- Kalender ---------- */
.pop-date { min-width: 312px; max-width: 340px; max-height: calc(100vh - 16px); overflow-x: hidden; padding: 14px; border-radius: 22px; }
.dp-title { font-weight: 700; margin: 0 4px 10px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-head b { font-size: 15px; letter-spacing: -.01em; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-wd { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted-2); padding: 4px 0 6px; text-transform: uppercase; }
.dp-day {
  aspect-ratio: 1; border: 0; border-radius: 50%; background: transparent; font-size: 13.5px; font-weight: 500; color: var(--text);
  display: grid; place-items: center; transition: background .12s, color .12s, transform .12s var(--ease);
}
.dp-day:hover { background: var(--acc-soft); }
.dp-day.we { color: var(--muted); }
.dp-day.out { color: var(--muted-2); opacity: .45; }
.dp-day.today { box-shadow: inset 0 0 0 1.5px var(--acc); color: var(--acc-ink); font-weight: 700; }
.dp-day.sel { background: var(--acc); color: #fff; font-weight: 700; box-shadow: 0 6px 16px rgba(247, 147, 26, .4); transform: scale(1.04); }
.dp-quick, .dp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dp-chip { height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 12.5px; font-weight: 600; color: var(--text); }
.dp-chip:hover { border-color: var(--acc); }
.dp-chip.on { background: var(--acc-soft); border-color: var(--acc); color: var(--acc-ink); }
.dp-time { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.dp-times { display: flex; gap: 10px; margin-top: 10px; }
.dp-times label { flex: 1; display: grid; gap: 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.dp-t { text-align: center; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.dp-foot { display: flex; gap: 6px; align-items: center; margin-top: 14px; }
.dp-remove { color: var(--danger); padding: 0 8px; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; width: 42px; height: 25px; border-radius: 999px; background: var(--surface-3); transition: background .2s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .22s var(--ease); }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--acc-soft); }

/* ---------- Kontakt ---------- */

.contact-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.act-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  text-decoration: none; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2); transition: all .15s;
}
.act-btn svg.i { width: 14px; height: 14px; color: var(--acc-ink); }
.act-btn:hover { border-color: var(--acc); background: var(--acc-soft); }
.act-btn.off { opacity: .4; pointer-events: none; }

/* ---------- Details mit Editor ---------- */
.detail-list { display: grid; gap: 10px; }
.detail { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 8px 12px 12px; transition: border-color .15s, box-shadow .15s; }
.detail:focus-within { border-color: color-mix(in srgb, var(--acc) 55%, var(--line)); box-shadow: 0 0 0 4px var(--acc-soft); }
.detail.done { background: var(--surface-2); }
.detail.done .rte { color: var(--muted); }
.detail.sorting { box-shadow: var(--shadow-hover); border-color: var(--acc); position: relative; z-index: 2; }
.detail-head { display: flex; align-items: center; gap: 6px; min-height: 34px; flex-wrap: wrap; }
.num {
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 800;
  background: var(--acc-soft); color: var(--acc-ink);
}
.detail.done .num { background: var(--ok); color: #fff; }
.rte-bar { display: none; align-items: center; gap: 2px; flex-wrap: wrap; margin-left: 4px; }
.detail:focus-within .rte-bar { display: flex; }
.rte-btn {
  height: 30px; min-width: 30px; padding: 0 7px; border: 0; border-radius: 8px; background: transparent; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 3px; font-size: 14px;
}
.rte-btn:hover { background: var(--surface-3); }
.rte-btn svg.i { width: 16px; height: 16px; }
.rte-btn.wide { padding: 0 8px; font-weight: 600; font-size: 13px; }
.rte-btn.wide svg.i:last-child { width: 12px; height: 12px; opacity: .6; }
.rte-sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 4px; }
.rte-menu-wrap { position: relative; display: inline-flex; }
.rte-menu {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; min-width: 190px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
}
.rte-menu-wrap.open .rte-menu { display: block; animation: pop .14s var(--ease); }
.rte-menu .s-h1 { font-size: 19px; }
.rte-menu .s-h2 { font-size: 16px; }
.rte-menu .s-h3 { font-size: 14px; }
.rte-menu .s-mono { font-family: Menlo, Consolas, monospace; font-size: 13px; }
.rte-menu .s-quote { font-style: italic; border-left: 3px solid var(--acc); padding-left: 8px; }
.rte {
  min-height: 60px; padding: 8px 4px 2px; outline: none; line-height: 1.6; word-wrap: break-word; overflow-wrap: anywhere;
}
.rte:empty::before { content: attr(data-placeholder); color: var(--muted-2); pointer-events: none; }
.rte > :first-child { margin-top: 0; }
.rte p, .rte div { margin: 0; }
.rte h1 { font-size: 24px; letter-spacing: -.02em; margin: 10px 0 6px; line-height: 1.25; }
.rte h2 { font-size: 19px; letter-spacing: -.01em; margin: 10px 0 4px; line-height: 1.3; }
.rte h3 { font-size: 15.5px; margin: 8px 0 4px; }
.rte ul, .rte ol { margin: 4px 0; padding-left: 24px; }
.rte hr { border: 0; height: 1px; background: var(--line-2); margin: 14px 0; }
.rte img { display: block; max-width: 100%; height: auto; border-radius: 12px; margin: 8px 0; border: 1px solid var(--line); }
.rte pre { font-family: Menlo, Consolas, monospace; font-size: 13px; background: var(--surface-2); padding: 10px 12px; border-radius: 10px; white-space: pre-wrap; margin: 6px 0; }
.rte blockquote { margin: 6px 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--acc); color: var(--muted); }
.rte a { color: var(--acc-ink); }
.rte table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 14px; }
.rte td, .rte th { border: 1px solid var(--line-2); padding: 6px 9px; vertical-align: top; min-width: 40px; }
.rte tr:first-child td { background: var(--surface-2); font-weight: 600; }

/* ---------- Zeiten mit Schloss ---------- */
.time-entry { border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 12px; margin-top: 10px; display: grid; gap: 8px; transition: border-color .2s, box-shadow .2s, background .2s; }
.time-entry.editing { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
.time-entry.locked.billed, .time-entry.locked:has(.check:checked) { background: var(--surface-2); }
.te-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.te-date { font-weight: 700; }
.te-range, .te-kind { color: var(--muted); font-size: 13px; }
.te-dur-v { font-weight: 700; font-variant-numeric: tabular-nums; padding: 2px 9px; border-radius: 8px; background: var(--surface-2); }
.te-text { white-space: pre-wrap; color: var(--text); padding-left: 44px; }
.te-meta { font-size: 12px; color: var(--muted-2); padding-left: 44px; }
.te-edit { display: grid; grid-template-columns: 190px 100px 100px 100px; gap: 10px; align-items: end; justify-content: start; padding-left: 44px; }
.te-edit .lbl { margin-bottom: 4px; }
.time-entry.editing > textarea { margin-left: 44px; width: calc(100% - 44px); }
.te-edit .input { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.te-edit .date-btn { width: 100%; }
.kind-btn { display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; }
.kind-btn:hover { border-color: var(--acc); }
.kind-btn svg.i { width: 14px; height: 14px; opacity: .6; }

.kdot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.kdot.billable { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18), 0 0 10px 1px rgba(34, 197, 94, .75); }
.kdot.nonbillable { background: #9ca3af; }
.kdot.internal { background: #fff; box-shadow: 0 0 0 1.5px #cfd3cc, 0 0 9px 1px rgba(17, 20, 15, .18); }
:root[data-theme="dark"] .kdot.internal { box-shadow: 0 0 0 3px rgba(255, 255, 255, .12), 0 0 12px 2px rgba(255, 255, 255, .7); }

.lock {
  position: relative; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface);
  display: grid; place-items: center; color: var(--muted); flex-shrink: 0; transition: color .25s, background .25s, border-color .25s;
}
.lock:hover { color: var(--text); border-color: var(--muted-2); }
.lock-svg { width: 18px; height: 18px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lock-svg .shackle { transform-box: view-box; transform-origin: 16px 11px; transition: transform .38s cubic-bezier(.34, 1.56, .64, 1); }
.lock-svg .body { fill: currentColor; fill-opacity: .14; transform-box: fill-box; transform-origin: center; transition: fill-opacity .25s; }
.lock-svg .hole { fill: currentColor; stroke: none; }
.lock.open { color: var(--acc-ink); border-color: var(--acc); background: var(--acc-soft); }
.lock.open .shackle { transform: translateY(-2.5px) rotate(32deg); }
.lock.open .body { fill-opacity: .25; }
.lock.bump .body { animation: lockbump .38s var(--ease); }
@keyframes lockbump { 30% { transform: scale(.86); } 70% { transform: scale(1.06); } }

@media (max-width: 900px) {
  .te-edit { grid-template-columns: 1fr 1fr; padding-left: 0; }
  .te-edit > div:first-child { grid-column: 1 / -1; }
  .te-edit .date-btn { width: 100%; }
}
@media (max-width: 720px) {
  .col { flex-basis: calc(100vw - 48px) !important; max-width: calc(100vw - 48px) !important; }
  .col.collapsed { flex-basis: 56px !important; max-width: 56px !important; }
  .col-resize { display: none; }
  .date-row { grid-template-columns: 1fr auto; }
  .date-row textarea { grid-column: 1 / -1; grid-row: 2; }
  .date-btn { white-space: normal; }
  .sheet-foot { padding: 12px 16px; bottom: 0; }
  .sheet-foot .hint { display: none; }
  .te-text, .te-meta { padding-left: 0; }
  .time-entry.editing > textarea { margin-left: 0; width: 100%; }
  .pop-date { min-width: 0; width: calc(100vw - 32px); }
}

/* ============================================================ Version 4 */
.badge.neutral, .badge.future, .badge.soon, .badge.appt { background: var(--surface-3); color: var(--muted); }

/* Kontakt: Symbol-Buttons vorne im Feld */
.input-wrap { position: relative; }
.input-wrap .contact-acts { position: absolute; left: 5px; top: 50%; transform: translateY(-50%); display: flex; gap: 3px; z-index: 1; }
.input-wrap.n1 .input { padding-left: 44px; }
.input-wrap.n2 .input { padding-left: 76px; }
.act-ic {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--acc-ink);
  background: var(--acc-soft); transition: background .15s, transform .15s var(--ease);
}
.act-ic svg.i { width: 16px; height: 16px; }
.act-ic:hover { background: var(--acc); color: #fff; }
.act-ic:active { transform: scale(.92); }
.act-ic.off { opacity: .35; pointer-events: none; background: transparent; color: var(--muted-2); }

/* Zeiten: Summe abrechenbar grün */
.sum.ok { background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .35); }
.sum.ok span { color: #16a34a; }
:root[data-theme="dark"] .sum.ok span { color: #4ade80; }

/* Bildgröße ändern */
.detail { position: relative; }
.rte img { cursor: pointer; }
.img-sel { position: absolute; z-index: 4; border: 2px solid var(--acc); border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 4px var(--acc-soft); }
.img-sel span { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--acc); pointer-events: auto; touch-action: none; }
.img-sel [data-h="nw"] { left: -8px; top: -8px; cursor: nwse-resize; }
.img-sel [data-h="ne"] { right: -8px; top: -8px; cursor: nesw-resize; }
.img-sel [data-h="sw"] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.img-sel [data-h="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }
.img-size { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 11px; font-weight: 600; }

/* Karte fliegt nach dem Schließen an ihren Platz und blinkt */
.fly { position: fixed; z-index: 60; background: var(--surface); border: 2px solid var(--acc); transform-origin: 0 0; pointer-events: none; box-shadow: var(--shadow-lg); }
.card.blink, .cev.blink, .cchip.blink { animation: blink3 1.2s ease !important; }
@keyframes blink3 {
  0%, 33%, 67%, 100% { box-shadow: var(--shadow); }
  16%, 50%, 84% { box-shadow: 0 0 0 3px var(--acc), 0 0 26px rgba(247, 147, 26, .65); }
}
.lv-row.blink td { animation: rowblink 1.2s ease; }
@keyframes rowblink { 16%, 50%, 84% { background: var(--acc-soft); } }

/* Ansichten in der Kopfzeile */
.views { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.views button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; transition: all .15s; }
.views button:hover { color: var(--text); }
.views button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
:root[data-theme="dark"] .views button.on { background: var(--surface-3); }
.views svg.i { width: 16px; height: 16px; }
#main { min-height: calc(100vh - 71px); }

/* Listenansicht */
.listview { padding: 22px 26px; }
.lv-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.lv-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }
.lv { width: 100%; border-collapse: collapse; min-width: 900px; }
.lv th { text-align: left; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 13px 14px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none; }
.lv th:hover, .lv th.on { color: var(--acc-ink); }
.lv th svg.i { width: 13px; height: 13px; vertical-align: -2px; margin-left: 4px; }
.lv td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.lv tr:last-child td { border-bottom: 0; }
.lv-row { cursor: pointer; transition: background .12s; }
.lv-row:hover { background: var(--surface-2); }
.lv-title { font-weight: 600; }
.lv-row.done .lv-title { color: var(--muted); text-decoration: line-through; }
.lv-row.glow-red .lv-title::before, .lv-row.glow-green .lv-title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 9px; vertical-align: 1px; }
.lv-row.glow-red .lv-title::before { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.lv-row.glow-green .lv-title::before { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.lv-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.lv-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.lv-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lv-empty { text-align: center; color: var(--muted); padding: 34px !important; }
.lv .card-labels { margin: 0; }
.lv .card-progress { margin: 0; min-width: 110px; }

/* Kalender */
.cal { padding: 18px 26px 22px; display: flex; flex-direction: column; height: calc(100vh - 71px); }
.cal-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-bar h2 { margin: 0; flex: 1; min-width: 220px; font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.cal-bar h2 small { margin-left: 8px; font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.seg-mini { display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.seg-mini button { height: 30px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg-mini button:hover { color: var(--text); }
.seg-mini button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
:root[data-theme="dark"] .seg-mini button.on { background: var(--surface-3); }

.cal-week, .cal-month { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); overflow: hidden; }
.cw-row { display: grid; grid-template-columns: 58px repeat(var(--days), minmax(0, 1fr)); }
.cw-head { border-bottom: 1px solid var(--line); }
.cw-dh { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; font-size: 13px; color: var(--muted); border-left: 1px solid var(--line); }
.cw-dh b { min-width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 50%; font-size: 19px; font-weight: 600; color: var(--text); cursor: pointer; }
.cw-dh b:hover { background: var(--surface-2); }
.cw-dh.we { color: var(--muted-2); }
.cw-dh.today span { color: var(--acc-ink); font-weight: 700; }
.cw-dh.today b { background: var(--acc); color: #fff; }
.cw-allday { border-bottom: 1px solid var(--line); }
.cw-gut { padding: 8px 8px 0 0; text-align: right; font-size: 10.5px; color: var(--muted-2); }
.cw-ad { min-height: 36px; padding: 4px; display: grid; gap: 3px; align-content: start; border-left: 1px solid var(--line); cursor: cell; }
.cw-scroll { flex: 1; overflow-y: auto; position: relative; }
.cw-grid { position: relative; }
.cw-hours { position: relative; padding: 0; }
.cw-hours span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.cw-col {
  position: relative; border-left: 1px solid var(--line); cursor: cell;
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, transparent 23.5px, color-mix(in srgb, var(--line) 55%, transparent) 23.5px, color-mix(in srgb, var(--line) 55%, transparent) 24.5px, transparent 24.5px);
  background-size: 100% 48px;
}
.cw-col.today { background-color: color-mix(in srgb, var(--acc) 4%, transparent); }
.cw-now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--acc); z-index: 3; pointer-events: none; }
.cw-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--acc); }

.cev {
  position: absolute; z-index: 2; padding: 3px 7px 3px 8px; border-radius: 7px; overflow: hidden; cursor: grab; user-select: none; touch-action: none;
  font-size: 12px; line-height: 1.3; border-left: 3px solid var(--c);
  background: color-mix(in srgb, var(--c) 20%, var(--surface)); color: color-mix(in srgb, var(--c) 60%, var(--text));
  transition: background .12s, box-shadow .15s;
}
.cev:hover { background: color-mix(in srgb, var(--c) 30%, var(--surface)); }
.cev.moving { cursor: grabbing; z-index: 10; box-shadow: var(--shadow-hover); opacity: .93; transition: none; }
.cev.due { background-image: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--c) 14%, transparent) 7px 14px); }
.cev-time { display: flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cev-time svg.i { width: 11px; height: 11px; }
.cev-title { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.cev.short { display: flex; align-items: center; gap: 6px; padding-top: 1px; padding-bottom: 1px; }
.cev.short .cev-title { white-space: nowrap; }
.cev.done .cev-title, .cchip.done .cn { text-decoration: line-through; opacity: .6; }
.cev-rz { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.cev-rz::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 18px; height: 3px; margin-left: -9px; border-radius: 2px; background: var(--c); opacity: 0; transition: opacity .15s; }
.cev:hover .cev-rz::after { opacity: .8; }

.cchip { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 2px 7px; border-radius: 6px; font-size: 12px; line-height: 1.4; white-space: nowrap; overflow: hidden; cursor: grab; user-select: none; touch-action: none; color: var(--text); }
.cchip:hover { background: color-mix(in srgb, var(--c) 14%, transparent); }
.cchip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.cchip .ct { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.cchip .cn { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.cchip svg.i { width: 11px; height: 11px; color: var(--c); flex-shrink: 0; }
.cchip.ad { background: color-mix(in srgb, var(--c) 22%, var(--surface)); font-weight: 600; }
.cchip.ad .cn { font-weight: 600; }
.cchip.moving { position: relative; z-index: 20; background: var(--surface); box-shadow: var(--shadow-hover); }
.drop-day { background: var(--acc-soft) !important; box-shadow: inset 0 0 0 2px var(--acc); }

.cm-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.cm-head span { padding: 8px 10px; text-align: right; font-size: 12px; font-weight: 600; color: var(--muted); }
.cm-grid { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(var(--weeks), minmax(96px, 1fr)); }
.cm-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 4px 4px 6px; overflow: hidden; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: cell; }
.cm-cell:nth-child(7n) { border-right: 0; }
.cm-cell.we { background: color-mix(in srgb, var(--surface-2) 65%, transparent); }
.cm-cell.out .cm-num { color: var(--muted-2); }
.cm-num { align-self: flex-end; min-width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; font-size: 13px; font-weight: 600; color: var(--text); }
.cm-num:hover { background: var(--surface-3); }
.cm-cell.today .cm-num { background: var(--acc); color: #fff; }
.cm-more { padding: 1px 7px; border: 0; background: transparent; text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.cm-more:hover { color: var(--acc-ink); }

.cal-year { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px 30px; padding: 6px 2px; align-content: start; }
.cy-title { padding: 0 0 8px; border: 0; background: transparent; font-size: 16px; font-weight: 700; color: var(--acc-ink); }
.cy-title:hover { text-decoration: underline; }
.cy-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cy-wd { padding-bottom: 3px; font-size: 10.5px; font-weight: 700; color: var(--muted-2); }
.cy-d { position: relative; aspect-ratio: 1; border: 0; border-radius: 50%; background: transparent; font-size: 12px; color: var(--text); }
.cy-d:hover { background: var(--surface-2); }
.cy-d.has::after { content: ""; position: absolute; bottom: 2px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--acc); }
.cy-d.today { background: var(--acc); color: #fff; font-weight: 700; }
.cy-d.today::after { background: #fff; }

@media (max-width: 900px) {
  .views span { display: none; }
  .views button { padding: 0 11px; }
}
@media (max-width: 720px) {
  .date-row { grid-template-columns: 1fr auto; }
  .views { order: 4; }
  .cal, .listview { padding: 14px 12px; }
  .cal { height: calc(100vh - 120px); }
  .cal-bar h2 { font-size: 20px; min-width: 0; flex-basis: 100%; }
  .cw-row { grid-template-columns: 40px repeat(var(--days), minmax(0, 1fr)); }
  .cw-dh { flex-direction: column; gap: 0; padding: 6px 2px; font-size: 11px; }
  .cw-dh b { font-size: 15px; min-width: 28px; height: 28px; }
  .cm-grid { grid-template-rows: repeat(var(--weeks), minmax(64px, 1fr)); }
  .cchip .ct, .cchip .dot { display: none; }
  .cchip { padding: 1px 3px; font-size: 10.5px; }
}

/* ============================================================ Version 5 */
/* Erledigte Termine/Fälligkeiten */
.date-row.done .date-btn { background: var(--surface-2); }
.date-row.done .date-btn span { text-decoration: line-through; color: var(--muted); }
.date-row.done .date-btn > svg.i { color: var(--ok); }
.cev.checked, .cchip.checked { opacity: .5; }
.cev.checked .cev-title, .cchip.checked .cn { text-decoration: line-through; }

/* Termine links, Fälligkeiten rechts */
.dates-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; border-bottom: 1px solid var(--line); }
.dates-split > .section { border-bottom: 0; }
.dates-split .date-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
.dates-split .date-row .date-btn { white-space: normal; }
.dates-split .date-row > .check { grid-column: 1; grid-row: 1; }
.dates-split .date-row > .date-btn { grid-column: 2; grid-row: 1; }
.dates-split .date-row > .icon-btn { grid-column: 3; grid-row: 1; margin-top: 5px; }
.dates-split .date-row textarea { grid-column: 2 / 4; grid-row: 2; margin-top: -4px; }

/* Stoppuhr oben rechts in der Karte */
.hd-timer {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; flex-shrink: 0; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px; transition: border-color .15s;
}
button.hd-timer:hover { border-color: var(--acc); }
.hd-timer svg.i { width: 15px; height: 15px; }
.hd-timer > svg.i:last-child { color: var(--acc-ink); }
.hd-timer.running { gap: 8px; padding: 0 4px 0 13px; border-color: var(--acc); background: var(--acc-soft); color: var(--acc-ink); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hd-timer.running .icon-btn { width: 30px; height: 30px; }
.rec { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); flex-shrink: 0; animation: recblink 1.1s ease-in-out infinite; }
@keyframes recblink { 50% { opacity: .2; } }
.stop-btn { width: 30px; height: 30px; flex-shrink: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--danger); color: #fff; transition: transform .15s var(--ease), filter .15s; }
.stop-btn:hover { filter: brightness(1.1); transform: scale(1.06); }
.stop-btn svg.i, .badge-stop svg.i { fill: currentColor; stroke: none; }
.stop-btn svg.i { width: 12px; height: 12px; }

/* Laufende Stoppuhren in der Navigationsleiste */
#timers { display: flex; gap: 6px; }
#timers:empty { display: none; }
.timer-pill { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 4px 0 4px; border-radius: 999px; border: 1px solid var(--acc); background: var(--acc-soft); animation: pillpulse 2s ease-in-out infinite; }
.tp-open { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--acc-ink); font-weight: 600; font-size: 13px; }
.tp-open .tt { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.tp-open .tm { font-variant-numeric: tabular-nums; font-weight: 700; }
@keyframes pillpulse { 50% { box-shadow: 0 0 0 4px var(--acc-soft); } }

/* Laufende Stoppuhr auf der Board-Karte */
.badge.timer.running { gap: 6px; padding-right: 3px; animation: recblink 1.6s ease-in-out infinite; }
.badge-stop { width: 19px; height: 19px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--danger); color: #fff; }
.badge-stop svg.i { width: 9px; height: 9px; }

.comment-body textarea { margin-top: 4px; }

@media (max-width: 860px) {
  .dates-split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sheet-head { flex-wrap: wrap; }
  .sheet-head .title-input { flex-basis: 100%; order: -1; }
  .tp-open .tt { display: none; }
  #timers { order: 3; }
  .date-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .date-row > .check { grid-column: 1; grid-row: 1; }
  .date-row > .date-btn { grid-column: 2; grid-row: 1; }
  .date-row > .icon-btn { grid-column: 3; grid-row: 1; }
  .date-row textarea { grid-column: 2 / 4; grid-row: 2; }
}

@media (max-width: 1100px) {
  .brand-sub { display: none; }
  .brand-name { font-size: 18px; white-space: nowrap; }
  .tp-open .tt { display: none; }
  .views span { display: none; }
  .views button { padding: 0 11px; }
}

/* ============================================================ Version 6 */
/* Kalender: Kopf und Raster exakt übereinander (Scrollbalken-Ausgleich) */
.cw-head, .cw-allday { padding-right: var(--sb, 0px); }
/* Termin-Kacheln ohne farbigen Rand – Farbstreifen innen */
.cev { border-left: 0; padding-left: 12px; }
.cev::before { content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 3px; border-radius: 3px; background: var(--c); }
.cev.short::before { top: 3px; bottom: 3px; }

/* Kartenfarbe */
.card.tinted { background: color-mix(in srgb, var(--cc) 17%, var(--surface)); border-color: color-mix(in srgb, var(--cc) 42%, var(--line)); }
:root[data-theme="dark"] .card.tinted { background: color-mix(in srgb, var(--cc) 20%, var(--surface-2)); }
.sheet.tinted .sheet-top { background: color-mix(in srgb, var(--cc) 16%, var(--surface)); border-bottom-color: color-mix(in srgb, var(--cc) 38%, var(--line)); }

/* Stoppuhr auf Höhe Status/Labels */
.meta-row { align-items: flex-end; }
.meta-timer { margin-left: auto; }

/* Termin/Fälligkeit als ein Kasten: [✓] Datum | Notiz [Farbe] [🗑] */
.date-list { display: grid; gap: 8px; }
.date-box {
  display: grid; grid-template-columns: 22px 300px minmax(0, 1fr) auto auto; align-items: center; gap: 0 8px;
  padding: 4px 6px 4px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.date-box:hover { border-color: var(--line-2); }
.date-box:focus-within { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
.db-date {
  display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 10px;
  background: transparent; font-weight: 600; text-align: left; color: var(--text); min-width: 0;
}
.db-date:hover { background: var(--acc-soft); }
.db-date > svg.i { color: var(--ac, var(--acc-ink)); flex-shrink: 0; }
.db-date span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-date em { margin-left: auto; font-style: normal; height: 22px; font-size: 11.5px; }
.db-note {
  min-width: 0; min-height: 40px; padding: 10px 12px; border: 0; border-left: 1px solid var(--line); border-radius: 0;
  background: transparent; outline: none; resize: none; line-height: 1.45; overflow: hidden;
}
.db-note::placeholder { color: var(--muted-2); }
.db-color { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); background: var(--ac); padding: 0; cursor: pointer; flex-shrink: 0; }
.db-color:hover { transform: scale(1.12); }
.pop .btn .db-color { width: 14px; height: 14px; }
.date-box.done { background: var(--surface-2); }
.date-box.done .db-date span { text-decoration: line-through; color: var(--muted); }
.date-box.done .db-date > svg.i { color: var(--muted-2); }
.date-box .check:checked { background: var(--muted-2); border-color: var(--muted-2); }
.dates-split .date-box, .date-box.stack { grid-template-columns: 22px minmax(0, 1fr) auto auto; padding-bottom: 0; }
.dates-split .db-note { grid-column: 1 / -1; grid-row: 2; border-left: 0; border-top: 1px solid var(--line); margin: 2px -6px 0 -12px; padding-left: 46px; width: calc(100% + 18px); }

/* Anhänge: Vorschaubilder für Bild / Video / PDF */
.att-thumb { position: relative; border: 0; padding: 0; overflow: hidden; cursor: pointer; }
.att-thumb video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.att-thumb .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, .25); }
.att-thumb .play svg.i { width: 20px; height: 20px; fill: #fff; stroke: none; }
.att-thumb.pdf { display: grid; place-items: center; align-content: center; gap: 2px; color: #ef4444; background: color-mix(in srgb, #ef4444 12%, var(--surface-3)); }
.att-thumb.pdf b { font-size: 10px; }
.att-thumb:hover { box-shadow: 0 0 0 2px var(--acc); }

/* Upload-Fortschritt */
.tp-bar { width: 120px; height: 6px; border-radius: 99px; background: color-mix(in srgb, currentColor 20%, transparent); overflow: hidden; }
.tp-bar span { display: block; height: 100%; width: 0; background: var(--acc); transition: width .2s; }
.tp-pct { font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }

/* Videos im Detailtext */
.rte video { display: block; max-width: 100%; border-radius: 12px; margin: 8px 0; background: #000; }

/* Vorschau (Lightbox) */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(5, 7, 6, .88); backdrop-filter: blur(6px); display: flex; flex-direction: column; animation: fade .18s ease; }
.lb-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; color: #eef1ec; }
.lb-bar b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar .icon-btn { color: #eef1ec; }
.lb-bar .icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.lb-count { font-size: 13px; color: #aab2a6; margin-right: 6px; }
.lb-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 64px 24px; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lb-stage.pdf { padding: 0 24px 24px; }
.lb-stage iframe { width: min(1000px, 100%); height: 100%; border: 0; border-radius: 12px; background: #fff; }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .12); color: #fff; }
.lb-nav:hover { background: rgba(255, 255, 255, .24); }
.lb-nav.prev { left: 12px; }
.lb-nav.next { right: 12px; }

@media (max-width: 860px) {
  .date-box { grid-template-columns: 22px minmax(0, 1fr) auto auto; padding-bottom: 0; }
  .date-box .db-note { grid-column: 1 / -1; grid-row: 2; border-left: 0; border-top: 1px solid var(--line); margin: 2px -6px 0 -12px; padding-left: 46px; width: calc(100% + 18px); }
  .meta-timer { margin-left: 0; }
}
@media (max-width: 720px) {
  .lb-stage { padding: 0 8px 16px; }
  .lb-nav { display: none; }
}

/* ============================================================ Version 7 */
/* Überschriften im Kartenkopf an den Pillen ausrichten */
.meta-row .lbl { padding-left: 13px; }

/* Liste: Kartenfarbe als Zeilenhintergrund, laufende Stoppuhr */
.lv-row.tinted td { background-color: color-mix(in srgb, var(--cc) 15%, transparent); }
.lv-row.tinted:hover td { background-color: color-mix(in srgb, var(--cc) 24%, transparent); }
.lv-title .badge.timer { margin-left: 8px; vertical-align: 1px; }

/* Systeminfo */
.sysinfo { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sysinfo td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; word-break: break-word; }
.sysinfo td:first-child { color: var(--muted); width: 45%; }

/* Vorschau-Editor */
.lb-tools { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }
.lb-tool { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #eef1ec; font-weight: 600; font-size: 13px; }
.lb-tool:hover { background: rgba(255, 255, 255, .2); }
.lb-tool.on { background: var(--acc); color: #fff; }
.lb-tool:disabled { opacity: .35; pointer-events: none; }
.lb-tool svg.i { width: 17px; height: 17px; }
.tt-ic { font-family: Georgia, serif; font-size: 16px; }
.lb-sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .2); margin: 0 4px; }
.lb-color { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); background: var(--c); padding: 0; }
.lb-color.on { border-color: #fff; transform: scale(1.15); box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.lb-tools .btn:disabled { opacity: .4; }
.lb-stage.ed { display: block; overflow: auto; padding: 0 24px 24px; place-items: unset; }
.ed-pdf { display: grid; justify-content: center; gap: 18px; }
.ed-img { display: grid; justify-content: center; }
.ed-page { position: relative; margin: 0 auto; box-shadow: 0 16px 50px rgba(0, 0, 0, .5); border-radius: 4px; background: #fff; }
.ed-img.ed-page { background: transparent; box-shadow: none; }
.ed-img canvas { border-radius: 10px; box-shadow: 0 16px 50px rgba(0, 0, 0, .5); }
.ed-page canvas { display: block; }
.ed-page .ed-c { position: absolute; inset: 0; }
.ed-img .ed-c { position: static; }
.lb-stage.drawing .ed-c { cursor: crosshair; touch-action: none; }
.ed-input { position: absolute; z-index: 3; min-width: 160px; padding: 2px 6px; border: 1.5px dashed currentColor; border-radius: 6px; background: rgba(255, 255, 255, .92); font-family: Helvetica, Arial, sans-serif; outline: none; }
.ed-loading { color: #aab2a6; text-align: center; padding: 60px 0; }

/* PDF im Detailtext */
.rte [data-pdf] { margin: 10px 0; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; background: var(--surface-2); user-select: none; }
.pe-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.pe-bar > svg.i { color: #ef4444; width: 16px; height: 16px; }
.pe-n { color: var(--muted); }
.pe-pages { max-height: 560px; overflow-y: auto; padding: 12px; display: grid; gap: 12px; justify-items: center; background: color-mix(in srgb, var(--surface-3) 60%, transparent); }
.pe-pages img { width: 100%; max-width: 760px; margin: 0; border-radius: 4px; border: 0; box-shadow: 0 4px 18px rgba(0, 0, 0, .18); cursor: default; }

/* ============================================================ Version 8 */
/* Karte: runde Buttons oben rechts */
.head-btn { background: var(--surface); color: var(--text); flex-shrink: 0; }
.head-btn:hover { border-color: var(--acc); background: var(--surface); }

/* Kommentare wie im Chat (neueste unten) */
.comments { margin-bottom: 14px; }
.comments:empty { display: none; }

/* Liste: abhaken & neue Karte */
.lv .lv-check { width: 44px; padding-right: 0; }
.lv-circle {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); background: transparent; padding: 0;
  display: grid; place-items: center; color: transparent; transition: all .2s var(--ease);
}
.lv-circle svg.i { width: 13px; height: 13px; stroke-width: 3; }
.lv-circle:hover { border-color: var(--ok); color: var(--ok); }
.lv-circle.on { background: var(--ok); border-color: var(--ok); color: #fff; transform: scale(1.05); }
/* ganze Zeile durchstreichen */
.lv-row.done td:not(.lv-check) {
  color: var(--muted);
  background-image: linear-gradient(var(--muted-2), var(--muted-2)); background-size: 100% 1.5px; background-position: 0 50%; background-repeat: no-repeat;
}
.lv-row.done td:not(.lv-check) > * { opacity: .7; }
.lv-row.done .lv-title { text-decoration: none; }
.lv-add td { background: var(--surface-2); }
.lv-add-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lv-add-form input { flex: 1 1 240px; }
.lv-add-form select { flex: 0 0 auto; width: auto; min-width: 160px; }

@media (max-width: 720px) {
  /* Kein Zoom beim Tippen (iOS zoomt bei Schrift < 16 px) */
  input, textarea, select, .input, .rte, .db-note { font-size: 16px; }
  .title-input { font-size: 22px; }

  /* Kopfzeile: oben Logo · Ansichten · Menü, darunter Suche + Filter */
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .brand { order: 1; margin: 0; }
  .brand > div { display: none; }
  .logo-toggle { width: 50px; height: 30px; }
  .logo-toggle .knob { width: 22px; height: 22px; }
  .views { order: 2; margin: 0 auto; }
  #timers { order: 3; }
  .topbar [data-act="theme"] { display: none; }
  .user-btn { order: 4; }
  .search { order: 5; flex: 1 1 55%; max-width: none; margin: 0; min-width: 0; }
  .topbar select.input { order: 6; flex: 1 1 35%; width: auto; min-width: 0; }
  .search .input, .topbar select.input { height: 40px; }

  /* Kalender: „Heute“ und Tag/Woche/Monat/Jahr in einer Zeile */
  .cal-bar { gap: 8px; }
  .cal-nav { flex: 0 0 auto; }
  .seg-mini { flex: 1 1 auto; min-width: 0; }
  .seg-mini button { flex: 1; padding: 0 6px; }

  .lv-add-form select { min-width: 0; flex: 1 1 auto; }
  .sheet-foot .btn { padding: 0 14px; }
}
.sheet-foot > .btn[data-act="close-modal"] { margin-right: auto; }
@media (max-width: 720px) {
  .sheet-head { flex-wrap: nowrap; align-items: flex-start; }
  .sheet-head .title-input { flex: 1 1 auto; order: 0; min-width: 0; }
  .head-btn { width: 36px; height: 36px; }
}
