/* ============================================================
   DBW PM. Tokens shared with the DBW OS (docs/DESIGN.md there):
   white cards on paper, ink trio, brand gradient only as accent.
   No dark mode (agency-wide decision).
   ============================================================ */

@font-face {
  font-family: 'Aspekta';
  src: url('/assets/fonts/AspektaVF.woff2?v=1') format('woff2');
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('/assets/fonts/instrument.woff2?v=1') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --c-red: #ea2b1f;
  --c-pink: #ff3c6f;
  --c-magenta: #ff4fdd;
  --c-violet: #7e56ff;
  --c-blue: #00b2ff;
  --grad: linear-gradient(135deg, var(--c-red), var(--c-pink), var(--c-magenta), var(--c-violet), var(--c-blue));

  --ink: #131118;
  --ink-2: #4d4a55;
  --ink-3: #8d8a96;
  --paper: #f7f6f3;
  --card: #ffffff;
  --line: #e9e6df;
  --line-soft: #f1efea;
  --hover: #faf9f6;
  --ok: #0d9f6e;
  --warn: #d97706;
  --crit: #dc2626;
  --accent: #7e56ff;
  --accent-soft: #f1edff;

  --display: 'Aspekta', 'Avenir Next', sans-serif;
  --body: 'Instrument Sans', 'Helvetica Neue', sans-serif;

  --r: 14px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(19, 17, 24, .04), 0 8px 24px -12px rgba(19, 17, 24, .10);
  --shadow-lg: 0 24px 48px -20px rgba(19, 17, 24, .28);
  --side-w: 248px;
  --panel-w: 540px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; overflow-x: clip; }
body {
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
::selection { background: var(--c-pink); color: #fff; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--card);
  font-weight: 600; font-size: 13px; white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #2a2731; }
.btn-ghost { border-color: transparent; background: none; }
.btn-ghost:hover { background: var(--line-soft); }
.btn-danger { color: var(--crit); }
.icon-btn {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  display: inline-grid; place-items: center; color: var(--ink-2);
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }

/* ------------------------------------------------------------ login */
.login-page { display: grid; place-items: center; padding: 16px; }
.login {
  width: 100%; max-width: 360px; background: var(--card); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 14px;
}
.login label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
.login input { height: 40px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 12px; }
.login .btn { height: 40px; justify-content: center; }
.login-error { color: var(--crit); font-size: 13px; }

/* ------------------------------------------------------------ shell */
.shell { display: flex; min-height: 100vh; }
.side {
  width: var(--side-w); flex: none; background: var(--card); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 14px 10px 10px;
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 16px; padding: 4px 8px 12px; }
.brand-badge {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  background: var(--grad); color: #fff; font-size: 11px; letter-spacing: .02em;
}
.side-search { position: relative; margin: 0 4px 10px; }
.side-search input {
  width: 100%; height: 32px; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 0 10px; background: var(--paper);
}
.search-results {
  position: absolute; left: 0; right: -120px; top: 36px; z-index: 30; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); max-height: 60vh; overflow: auto;
}
.search-results a { display: block; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.search-results a:hover { background: var(--hover); }
.search-results small { color: var(--ink-3); display: block; }

.nav-group { margin-top: 14px; }
.nav-head {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--ink-3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 0 8px 4px;
}
.nav-head .icon-btn { width: 22px; height: 22px; font-size: 15px; }
.nav-link {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-sm);
  color: var(--ink-2); position: relative; width: 100%; text-align: left; min-width: 0;
}
.nav-link:hover { background: var(--line-soft); color: var(--ink); }
.nav-link.active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.nav-link.active::before {
  content: ''; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: var(--grad);
}
.nav-link .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link .count { font-size: 12px; color: var(--ink-3); }
.nav-link .chev { width: 14px; color: var(--ink-3); font-size: 10px; flex: none; }
.nav-sub { padding-left: 14px; }
.nav-folder { color: var(--ink-3); font-size: 12px; padding: 6px 8px 2px; }
.nav-more { color: var(--ink-3); font-size: 12px; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.side-foot .who { flex: 1; min-width: 0; font-size: 13px; }
.side-foot .who small { display: block; color: var(--ink-3); }

.avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff;
  background: var(--ink-3);
}
.avatar.lg { width: 30px; height: 30px; font-size: 12px; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10; height: 52px; display: flex; align-items: center; gap: 12px;
  padding: 0 20px; background: rgba(247, 246, 243, .92); backdrop-filter: blur(8px);
}
.burger { display: none; }
.topbar-title { flex: 1; min-width: 0; color: var(--ink-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title a:hover { color: var(--ink); }

.timer-pill {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 6px 0 12px; border-radius: 999px;
  background: var(--ink); color: #fff; max-width: 460px; min-width: 0; box-shadow: var(--shadow);
}
.timer-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-pink); flex: none; animation: pulse 1.6s infinite; }
.timer-pill .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.timer-pill .what small { color: #b9b6c2; }
.timer-pill .clock { font-variant-numeric: tabular-nums; font-weight: 700; }
.timer-pill .stop { width: 26px; height: 26px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.timer-pill .stop i, .play i.sq { width: 9px; height: 9px; border-radius: 2px; background: currentColor; display: block; }
.timer-pill .stop i { background: var(--ink); }
.play i.tri { width: 0; height: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; margin-left: 2px; display: block; }
@keyframes pulse { 50% { opacity: .35; } }

.main { padding: 8px 28px 60px; display: flex; flex-direction: column; gap: 18px; width: 100%; min-width: 0; }

/* ------------------------------------------------------------ page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.page-sub { color: var(--ink-3); font-size: 13px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--line-soft); border-radius: var(--r-sm); padding: 3px; }
.seg button { height: 26px; padding: 0 12px; border-radius: 6px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ------------------------------------------------------------ task list */
.tlist { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.tgroup + .tgroup { border-top: 1px solid var(--line); }
.tgroup-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px 6px; font-weight: 700; font-size: 13px;
}
.tgroup-head .pill { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; color: #fff; }
.tgroup-head .n { color: var(--ink-3); font-weight: 500; }
.tgroup-head .toggle { color: var(--ink-3); font-size: 11px; width: 16px; }
.tgroup-head.clickable { cursor: pointer; user-select: none; }
.tgroup-head.clickable:hover .pill { filter: brightness(1.08); }

.trow, .thead {
  display: grid; align-items: center; gap: 8px; padding: 0 12px 0 16px;
  grid-template-columns: 26px minmax(220px, 1fr) 124px 108px 96px 78px 78px 150px 34px;
}
.trow.no-bill, .thead.no-bill { grid-template-columns: 26px minmax(220px, 1fr) 124px 108px 96px 78px 78px 34px; }
.trow.my, .thead.my { grid-template-columns: 26px minmax(220px, 1fr) 190px 108px 96px 78px 34px; }
.thead { height: 30px; color: var(--ink-3); font-size: 12px; border-bottom: 1px solid var(--line-soft); }
.trow { min-height: 40px; border-bottom: 1px solid var(--line-soft); cursor: default; }
.trow:hover { background: var(--hover); }
.trow.selected { background: var(--accent-soft); }
.trow.done .ttitle { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line); }
.trow.saving { opacity: .6; }

.check {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--ink-3);
  display: grid; place-items: center; color: transparent; font-size: 11px; transition: all .12s;
}
.check:hover { border-color: var(--ok); color: var(--ok); }
.check.on { background: var(--ok); border-color: var(--ok); color: #fff; }

.ttitle { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px 0; cursor: pointer; }
.ttitle .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ttitle .meta { display: inline-flex; gap: 8px; color: var(--ink-3); font-size: 12px; flex: none; }
.ttitle:hover .t { color: var(--accent); }

.cell { min-width: 0; font-size: 13px; color: var(--ink-2); }
.cell select, .cell input {
  width: 100%; height: 28px; border: 1px solid transparent; border-radius: 6px; background: transparent;
  padding: 0 6px; font-size: 13px; color: var(--ink-2); appearance: none; -webkit-appearance: none;
  text-overflow: ellipsis;
}
.cell select:hover, .cell input:hover { border-color: var(--line); background: var(--card); }
.cell select:focus, .cell input:focus { outline: none; border-color: var(--accent); background: var(--card); }
.cell .empty, .cell select.empty, .cell input.empty { color: var(--ink-3); }
.cell input[type=checkbox] { appearance: auto; -webkit-appearance: checkbox; width: 16px; height: 16px; padding: 0; border: 0; }
.due { position: relative; display: flex; align-items: center; }
.due-btn {
  flex: 1; min-width: 0; height: 28px; padding: 0 6px; border-radius: 6px; text-align: left; font-size: 13px;
  color: var(--ink-2); border: 1px solid transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.due-btn:hover { border-color: var(--line); background: var(--card); }
.due-btn.empty { color: var(--ink-3); }
.due-clear { position: absolute; right: 2px; width: 20px; height: 20px; border-radius: 50%; color: var(--ink-3); opacity: 0; }
.due:hover .due-clear { opacity: 1; }
.due-clear:hover { background: var(--line-soft); color: var(--ink); }
.cell input.due-native { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.cell.due-over .due-btn { color: var(--crit); }
.cell.due-today .due-btn { color: var(--warn); font-weight: 600; }
.fields .due-btn { height: 32px; }
.cell.time { font-variant-numeric: tabular-nums; }
.cell .chip { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--ink-3); }

.bill-sel { font-weight: 600; }
.bill-sel.v-offen { background: #fde7ec !important; color: #c81e4f !important; }
.bill-sel.v-versendet { background: #fff1e0 !important; color: #b45309 !important; }
.bill-sel.v-bezahlt { background: #e3f6ee !important; color: #087a54 !important; }
.bill-sel.v-geschenk { background: #def7f4 !important; color: #0f766e !important; }
.bill-sel.v-nicht_noetig { background: var(--line-soft) !important; color: var(--ink-2) !important; }

.play {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  color: var(--ink-3); font-size: 10px; opacity: 0; transition: opacity .1s;
}
.trow:hover .play, .play.running, .card:hover .play { opacity: 1; }
.play:hover { background: var(--ink); color: #fff; }
.play.running { background: var(--c-pink); color: #fff; opacity: 1; }

.addrow { display: flex; align-items: center; gap: 10px; padding: 0 16px 0 50px; height: 40px; color: var(--ink-3); }
.addrow input { flex: 1; border: 0; height: 100%; background: transparent; outline: none; color: var(--ink); }
.addrow input::placeholder { color: var(--ink-3); }

.askbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 16px 10px 50px;
  background: var(--accent-soft); border-bottom: 1px solid var(--line-soft); font-size: 13px;
}
.askbar strong { margin-right: 4px; }

.empty-state { padding: 28px; text-align: center; color: var(--ink-3); }

/* ------------------------------------------------------------ board */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.bcol { flex: 0 0 272px; background: var(--line-soft); border-radius: var(--r); padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.bcol.over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.bcol-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px; font-weight: 700; font-size: 12px; }
.bcol-head .pill { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; color: #fff; }
.bcol-head .n { color: var(--ink-3); }
.card {
  background: var(--card); border-radius: 10px; padding: 10px 12px; box-shadow: 0 1px 2px rgba(19,17,24,.06);
  cursor: grab; display: flex; flex-direction: column; gap: 8px; border: 1px solid transparent;
}
.card:hover { border-color: var(--line); }
.card.dragging { opacity: .4; }
.card .ct { font-weight: 600; line-height: 1.35; }
.card .ck { font-size: 12px; color: var(--ink-3); }
.card .cmeta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.card .cmeta .sp { flex: 1; }
.card .cmeta .over { color: var(--crit); }
.card .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.card .acts .btn { height: 26px; padding: 0 8px; font-size: 12px; }
.bcol .addrow { padding: 0 6px; height: 34px; }
.money { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }

.review { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.review h2 { font-size: 14px; font-weight: 700; }
.review p { color: var(--ink-3); font-size: 13px; }
.review-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.review-row .card { flex: 0 0 260px; cursor: default; border-color: var(--line); }

/* ------------------------------------------------------------ panel */
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--panel-w); max-width: 100vw; z-index: 20;
  background: var(--card); box-shadow: var(--shadow-lg); border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.panel-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.panel-bar .sp { flex: 1; }
.panel-bar .done-btn.on { background: #e3f6ee; color: #087a54; border-color: #bfe8d6; }
.panel-body { flex: 1; overflow-y: auto; padding: 18px 22px 40px; display: flex; flex-direction: column; gap: 22px; }
.crumb { color: var(--ink-3); font-size: 12px; }
.crumb a:hover { color: var(--ink); text-decoration: underline; }
.ptitle {
  font-family: var(--display); font-size: 21px; font-weight: 700; line-height: 1.25; width: 100%;
  border: 1px solid transparent; border-radius: var(--r-sm); padding: 4px 6px; margin: -4px -6px; resize: none; overflow: hidden; background: none;
}
.ptitle:hover { border-color: var(--line); }
.ptitle:focus { outline: none; border-color: var(--accent); }
.fields { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; align-items: center; }
.fields .k { color: var(--ink-3); font-size: 13px; }
.fields .cell select, .fields .cell input { height: 32px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--ink-2); padding: 0 6px; height: 32px; }
.switch input { accent-color: var(--ok); width: 16px; height: 16px; }
.psec h3 { font-size: 13px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.psec h3 .n { color: var(--ink-3); font-weight: 500; }
.desc {
  width: 100%; min-height: 80px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px;
  resize: vertical; line-height: 1.5; background: var(--card);
}
.desc:focus { outline: none; border-color: var(--accent); }
.subs { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.sub { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); }
.sub .t { flex: 1; min-width: 0; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub .t:hover { color: var(--accent); }
.sub.done .t { color: var(--ink-3); text-decoration: line-through; }
.sub .m { color: var(--ink-3); font-size: 12px; }
.subs .addrow { padding: 0 10px 0 38px; height: 36px; }

.tsum { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.tsum div { font-size: 12px; color: var(--ink-3); }
.tsum strong { display: block; font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.tentries { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.tentry { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.tentry:last-child { border-bottom: 0; }
.tentry .who small { color: var(--ink-3); display: block; }
.tentry .dur { font-variant-numeric: tabular-nums; font-weight: 600; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); white-space: nowrap; }
button.tag:hover { border-color: var(--ink-3); }
.tag.ok { background: #e3f6ee; border-color: #bfe8d6; color: #087a54; }
.tag.no { background: var(--line-soft); color: var(--ink-2); }
.tag.live { background: var(--c-pink); border-color: var(--c-pink); color: #fff; }
.tadd { display: grid; grid-template-columns: 90px 140px 1fr; gap: 8px; margin-top: 10px; }
.tadd input { height: 32px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 10px; min-width: 0; }
.tadd .row2 { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

.comments { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.comment .body { flex: 1; min-width: 0; }
.comment .head { font-size: 13px; display: flex; gap: 8px; align-items: baseline; }
.comment .head small { color: var(--ink-3); }
.comment .head button { margin-left: auto; color: var(--ink-3); font-size: 12px; opacity: 0; }
.comment:hover .head button { opacity: 1; }
.comment .text { white-space: pre-wrap; word-wrap: break-word; color: var(--ink-2); }
.cform { display: flex; flex-direction: column; gap: 8px; }
.cform textarea { width: 100%; min-height: 64px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; resize: vertical; }
.cform textarea:focus { outline: none; border-color: var(--accent); }
.cform .row { display: flex; justify-content: space-between; align-items: center; color: var(--ink-3); font-size: 12px; }
.activity { font-size: 12px; color: var(--ink-3); display: flex; flex-direction: column; gap: 4px; }
details.psec summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink-2); }

/* ------------------------------------------------------------ dialog + toast */
dialog.ask { border: 0; border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 22px; width: min(420px, calc(100vw - 32px)); margin: auto; }
dialog.ask::backdrop { background: rgba(19,17,24,.3); }
dialog.ask form { display: flex; flex-direction: column; gap: 12px; }
dialog.ask h2 { font-size: 17px; font-family: var(--display); }
dialog.ask label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
dialog.ask input, dialog.ask select { height: 36px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 10px; font-weight: 400; }
dialog.ask .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
dialog.ask .hint { color: var(--ink-3); font-size: 12px; font-weight: 400; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg);
  font-size: 13px; max-width: calc(100vw - 32px);
}
.toast.err { background: var(--crit); }


/* ------------------------------------------------------------ sidebar extras */
.nav-link .count.badge { background: var(--c-pink); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 700; line-height: 18px; }
.nav-head-acts { display: inline-flex; gap: 2px; }
.nav-warn { margin: 2px 8px 6px; font-size: 11px; color: var(--warn); }

/* ------------------------------------------------------------ my day */
.daystat { display: flex; gap: 28px; flex-wrap: wrap; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 18px; }
.daystat div { font-size: 12px; color: var(--ink-3); }
.daystat strong { display: block; font-size: 20px; color: var(--ink); font-family: var(--display); font-variant-numeric: tabular-nums; }
.sun { color: var(--line-strong, #d8d4cb); font-size: 14px; opacity: 0; flex: none; }
.trow:hover .sun, .sun.on { opacity: 1; }
.sun.on { color: var(--c-pink); }
.sun:hover { color: var(--c-pink); }
.btn.sun-on { background: #ffe9ef; border-color: #ffc6d4; color: #c81e4f; }
.empty-state.small { padding: 10px 16px 14px 50px; text-align: left; font-size: 13px; }

/* ------------------------------------------------------------ inbox */
.inbox-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.inbox-item:hover { background: var(--hover); }
.inbox-item .body { flex: 1; min-width: 0; }
.inbox-item .line { font-size: 14px; }
.inbox-item .task { color: var(--accent); }
.inbox-item .snippet { color: var(--ink-2); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item .meta { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.inbox-item.unread { background: #fbf9ff; }
.inbox-item.unread .line::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c-pink); margin-right: 8px; vertical-align: middle; }

/* ------------------------------------------------------------ billing extras */
.card .ck { display: flex; align-items: center; gap: 8px; }
.card .pick { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.card.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tag.beleg { font-weight: 600; }
.tag.beleg.draft { background: #fff1e0; border-color: #fcd9ad; color: #b45309; }
.tag.beleg.open { background: #e8f1ff; border-color: #c7dcff; color: #1d4ed8; }
.tag.beleg.paid { background: #e3f6ee; border-color: #bfe8d6; color: #087a54; }
.tag.beleg.geloescht, .tag.beleg.voided, .tag.beleg.migration { background: var(--line-soft); color: var(--ink-2); }
.actionbar {
  position: sticky; bottom: 16px; z-index: 12; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 12px 10px 16px; box-shadow: var(--shadow-lg);
}
.actionbar .sp { flex: 1; }
.actionbar .btn-ghost { color: #fff; }
.actionbar .btn-ghost:hover { background: rgba(255,255,255,.12); }
.actionbar .btn-primary { background: #fff; color: var(--ink); border-color: #fff; }
dialog.ask.wide { width: min(720px, calc(100vw - 32px)); }
.draft { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.draft-row { display: grid; grid-template-columns: 1fr 90px 110px; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.draft-row:last-child { border-bottom: 0; }
.draft-row.head { font-size: 12px; color: var(--ink-3); padding: 6px 12px; }
.draft-row .pt { font-weight: 600; margin-bottom: 4px; }
.draft-row input { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 8px; font-weight: 400; }
.draft-row .money { text-align: right; }
.draft-sum { text-align: right; font-size: 15px; }

/* ------------------------------------------------------------ customer header */
.khead { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 16px; display: flex; gap: 16px 28px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.khead-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.khead .k { font-weight: 700; }
.khead .links { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-link { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.chip-link:hover { border-color: var(--ink-3); color: var(--ink); }
.khead-facts { display: flex; gap: 8px; flex-wrap: wrap; }
.fact { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--line-soft); color: var(--ink-2); }
.fact em { font-style: normal; color: var(--accent); }
.fact.warn { background: #fff1e0; color: #b45309; }

/* ------------------------------------------------------------ sections & templates */
.tag.tpl { margin-left: 10px; vertical-align: middle; background: var(--accent-soft); border-color: #dcd2ff; color: var(--accent); font-family: var(--body); }
.sec-acts { display: inline-flex; gap: 2px; opacity: 0; margin-left: 4px; }
.tgroup-head:hover .sec-acts, .bcol-head:hover .sec-acts { opacity: 1; }
.sec-acts .icon-btn { width: 24px; height: 24px; font-size: 12px; }
.add-section { display: block; width: 100%; text-align: left; padding: 12px 16px; color: var(--ink-3); font-weight: 600; border-top: 1px solid var(--line); }
.add-section:hover { color: var(--ink); background: var(--hover); }
.bcol.add-col { flex: 0 0 180px; min-height: 52px; align-items: center; justify-content: center; color: var(--ink-3); font-weight: 600; border: 1px dashed var(--line); background: transparent; }
.bcol.add-col:hover { color: var(--ink); border-color: var(--ink-3); }
.invoices { display: flex; gap: 6px; flex-wrap: wrap; }

/* ------------------------------------------------------------ budget, follow-up, approvals */
.budget { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.budget.empty { flex-direction: row; align-items: center; justify-content: space-between; color: var(--ink-3); font-size: 13px; padding: 6px 8px 6px 16px; flex-wrap: wrap; }
.budget-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.budget-line .hint { color: var(--ink-3); font-size: 13px; flex: 1; }
.budget-track { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.budget-track i { display: block; height: 100%; border-radius: 999px; }
.budget-track i.ok { background: var(--ok); }
.budget-track i.warn { background: var(--warn); }
.budget-track i.crit { background: var(--crit); }
.chase { color: var(--ink-3); }
.chase.due { color: #ea580c; font-weight: 600; }
.approvals { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.approval { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.approval .what { flex: 1; min-width: 0; color: var(--ink-2); }
.approval .what small { color: var(--ink-3); }
.approval-new { display: flex; flex-direction: column; gap: 8px; }
.approval-new textarea, .approval-new input { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; width: 100%; }
.approval-new .btn { align-self: flex-start; }
.tag.fg.offen { background: #fff1e0; border-color: #fcd9ad; color: #b45309; }
.tag.fg.freigegeben { background: #e3f6ee; border-color: #bfe8d6; color: #087a54; }
.tag.fg.aenderung { background: #fde7ec; border-color: #f9c4d1; color: #c81e4f; }
.tag.fg.zurueckgezogen { background: var(--line-soft); color: var(--ink-3); }
.tag.guest { background: #fff1e0; border-color: #fcd9ad; color: #b45309; font-weight: 600; }
.avatar.guest { background: #ea580c; }
.comment.from-guest .text { background: #fffaf2; border-radius: var(--r-sm); padding: 8px 10px; }

/* ------------------------------------------------------------ approval page (public) */
.login.freigabe { max-width: 560px; }
.freigabe h1 { font-family: var(--display); font-size: 22px; line-height: 1.25; }
.freigabe .hint { color: var(--ink-3); font-size: 13px; font-weight: 400; }
.freigabe-text { color: var(--ink-2); white-space: normal; }
.freigabe .btn { align-self: flex-start; }
.freigabe-form { display: flex; flex-direction: column; gap: 12px; }
.freigabe-form textarea { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; font-weight: 400; resize: vertical; }
.freigabe-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.freigabe-done { background: #fff1e0; border-radius: var(--r-sm); padding: 12px 14px; }
.freigabe-done.ok { background: #e3f6ee; }
.freigabe-done p { margin-top: 6px; color: var(--ink-2); }

/* ------------------------------------------------------------ mobile */
@media (max-width: 960px) {
  .side { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .burger { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .main { padding: 8px 16px 90px; }
  .topbar { backdrop-filter: none; background: var(--paper); }
  .timer-pill { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: none; z-index: 15; height: 44px; }
  .trow, .thead, .trow.no-bill, .thead.no-bill, .trow.my, .thead.my { grid-template-columns: 26px minmax(0, 1fr) 96px 34px; }
  .trow > .cell:not(.keep), .thead > span:not(.keep) { display: none; }
  .play { opacity: 1; }
  .toast { bottom: 72px; }
  .ttitle .meta { display: none; }
  .sun { opacity: 1; }
  .draft-row { grid-template-columns: 1fr 70px 90px; }
  .panel { width: 100vw; }
  .fields { grid-template-columns: 110px 1fr; }
  .tadd { grid-template-columns: 1fr 1fr; }
  .tadd input:nth-child(3) { grid-column: 1 / -1; }
}

/* ============================================================
   UI v2 (best practice of Asana/Linear, brand head from the OS).
   White work surface, hairlines instead of floating cards, one
   accent. Later rules on purpose: they override the v1 look above.
   ============================================================ */
:root { --side-w: 260px; --row-h: 38px; --hair: #eceae4; }
body { background: #fff; font-size: 14px; }
.ic { width: 16px; height: 16px; flex: none; }

/* ---------- sidebar: OS brand head ---------- */
.side { background: #fbfaf8; border-right: 1px solid var(--hair); padding: 0 10px 10px; }
.side-head { display: flex; align-items: center; padding: 18px 8px 14px; }
.side .brand {
  display: inline-flex; flex-direction: column; font-family: var(--display); font-weight: 830; font-size: 19px;
  letter-spacing: -.035em; line-height: .82; color: var(--ink); padding: 0; gap: 0;
}
.side .brand .r1 { display: inline-flex; align-items: center; gap: .22em; }
.side .brand .dots { display: inline-flex; gap: .1em; }
.side .brand .dots i { width: .26em; height: .26em; border-radius: 50%; display: block; }
.side .brand .dots i:nth-child(1) { background: linear-gradient(135deg, var(--c-red), var(--c-pink)); }
.side .brand .dots i:nth-child(2) { background: linear-gradient(135deg, var(--c-pink), var(--c-violet)); }
.side .brand .dots i:nth-child(3) { background: linear-gradient(135deg, var(--c-violet), var(--c-blue)); }
.side .brand .r2 { margin-left: .95em; }
.brand-app {
  font-family: var(--display); font-weight: 830; font-size: 13px; letter-spacing: .08em; color: #fff;
  background: var(--grad); border-radius: 6px; padding: 2px 7px; margin-left: 10px;
}
.brand-ver { margin-left: 8px; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ink-3); }

.side-search, .side-new {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 10px; border-radius: 8px;
  font-size: 13.5px; text-align: left;
}
.side-search { border: 1px solid var(--hair); background: #fff; color: var(--ink-3); margin-bottom: 6px; }
.side-search:hover { border-color: var(--line-strong, #d8d4cb); color: var(--ink-2); }
.side-new { color: var(--ink); font-weight: 600; margin-bottom: 10px; }
.side-new .ic { color: var(--c-pink); }
.side-new:hover { background: #f1efea; }
.side-search span, .side-new span { flex: 1; }
kbd {
  font-family: var(--body); font-size: 11px; color: var(--ink-3); border: 1px solid var(--hair); background: #fff;
  border-radius: 5px; padding: 0 5px; line-height: 18px;
}
.side-search kbd { background: #fbfaf8; }

.nav-main { display: flex; flex-direction: column; gap: 1px; }
.nav-link { gap: 9px; padding: 0 8px; height: 30px; border-radius: 7px; color: var(--ink-2); font-size: 13.5px; }
.nav-link .ic { color: var(--ink-3); }
.nav-link:hover { background: #f1efea; }
.nav-link.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--hair), 0 1px 2px rgba(19,17,24,.04); }
.nav-link.active .ic { color: var(--ink); }
.nav-link.active::before { left: -10px; top: 7px; bottom: 7px; }
.nav-group { margin-top: 18px; }
.nav-head { padding: 0 8px 4px; font-size: 11px; letter-spacing: .07em; }
.nav-link.space .chev { width: 14px; display: inline-grid; place-items: center; transition: transform .12s; }
.nav-link.space .chev .ic { width: 12px; height: 12px; }
.nav-link.space .chev.open { transform: rotate(90deg); }
.nav-link .sq { width: 18px; height: 18px; border-radius: 5px; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none; }
.nav-sub { padding-left: 22px; }
.nav-sub .nav-link { height: 28px; }
.nav-folder { padding: 8px 8px 2px; font-size: 11.5px; }
.side-foot { border-top: 1px solid var(--hair); gap: 10px; padding: 12px 6px 2px; margin-top: 8px; }
.side-foot .who { font-weight: 600; }

/* ---------- top bar ---------- */
.topbar { background: rgba(255,255,255,.92); border-bottom: 1px solid var(--hair); height: 48px; }
.topbar-new { display: none; font-size: 20px; color: var(--ink); }
.timer-pill { height: 32px; }

/* ---------- page ---------- */
.main { padding: 22px 32px 80px; gap: 16px; }
.page-head h1 { font-size: 26px; }
.page-head.v2 { display: block; }
.ph-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 18px; margin-top: 12px; border-bottom: 1px solid var(--hair); }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 34px; color: var(--ink-3); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.btn { height: 30px; border-radius: 7px; border-color: var(--hair); }
.btn .ic { width: 15px; height: 15px; }
.btn.small { height: 28px; font-size: 12.5px; }
.btn-primary .ic { color: #fff; }

/* Customer head + budget: quiet info rows, not cards */
.khead { box-shadow: none; border: 1px solid var(--hair); border-radius: 10px; padding: 10px 14px; background: #fcfbf9; }
.budget { box-shadow: none; border: 1px solid var(--hair); border-radius: 10px; padding: 10px 14px; }
.budget.empty { border-style: dashed; background: transparent; }
.daystat { box-shadow: none; border: 1px solid var(--hair); border-radius: 10px; }
.review { box-shadow: none; border: 1px solid var(--hair); border-radius: 10px; }

/* ---------- task table ---------- */
.tlist { box-shadow: none; border-radius: 0; background: transparent; overflow: visible; }
.tgroup + .tgroup { border-top: 0; }
.tgroup { margin-bottom: 14px; }
.tgroup-head { padding: 8px 4px 6px; font-size: 14px; }
.tlist .tgroup-head .pill { background: transparent !important; color: var(--ink) !important; padding: 0; font-size: 14px; font-weight: 700; text-transform: none; letter-spacing: 0; }
.tgroup-head .n { font-size: 13px; }
.thead { height: 30px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); font-size: 12px; padding-left: 12px; }
.thead > span + span { border-left: 1px solid var(--hair); padding-left: 8px; height: 100%; display: flex; align-items: center; }
.trow { min-height: var(--row-h); border-bottom: 1px solid var(--hair); padding-left: 12px; }
.trow:hover { background: #faf9f7; }
.trow.selected { background: #f6f3ff; }
.trow > .cell { border-left: 1px solid transparent; padding-left: 2px; }
.check { width: 17px; height: 17px; border-width: 1.5px; border-color: #c9c6be; }
.ttitle { padding: 6px 0; }
.ttitle:hover .t { color: var(--ink); text-decoration: underline; text-decoration-color: var(--hair); }
.addrow { height: 36px; padding-left: 46px; border-bottom: 1px solid var(--hair); }
.addrow:focus-within { background: #faf9f7; }
.add-section { border-top: 0; padding: 8px 4px; font-size: 13.5px; }
.askbar { padding-left: 46px; border-bottom: 1px solid var(--hair); }

/* ---------- board ---------- */
.bcol { background: #f6f5f2; border-radius: 12px; padding: 8px; flex-basis: 280px; }
.bcol-head { padding: 4px 6px 6px; }
.card { border: 1px solid var(--hair); border-radius: 9px; box-shadow: 0 1px 1px rgba(19,17,24,.03); }
.card:hover { border-color: #d9d6ce; box-shadow: 0 2px 6px rgba(19,17,24,.06); }

/* ---------- panel ---------- */
.panel { width: 560px; box-shadow: -20px 0 48px -24px rgba(19,17,24,.25); border-left: 1px solid var(--hair); }
.panel-bar { border-bottom: 1px solid var(--hair); }
.panel-body { padding: 20px 26px 48px; }
.fields { grid-template-columns: 140px 1fr; gap: 2px 12px; }
.fields .k { font-size: 13px; }

/* ---------- quick create (N) ---------- */
dialog.qc { border: 0; border-radius: 14px; padding: 0; width: min(620px, calc(100vw - 24px)); margin: 12vh auto auto; box-shadow: 0 32px 64px -24px rgba(19,17,24,.45); }
dialog.qc::backdrop { background: rgba(19,17,24,.28); }
dialog.qc form { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 14px; }
.qc-head { display: flex; justify-content: space-between; align-items: center; color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.qc-title { font-family: var(--display); font-size: 20px; font-weight: 700; border: 0; outline: none; padding: 4px 0; }
.qc-title::placeholder { color: #c9c6be; }
.qc-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; }
.qc-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.qc-grid select, .qc-where { height: 36px; border: 1px solid var(--hair); border-radius: 8px; padding: 0 10px; font-size: 14px; color: var(--ink); background: #fff; width: 100%; }
.qc-where:focus, .qc-grid select:focus { outline: none; border-color: var(--accent); }
.qc-picker { position: relative; }
.qc-menu { position: absolute; left: 0; right: 0; top: 40px; z-index: 5; background: #fff; border: 1px solid var(--hair); border-radius: 10px;
  box-shadow: var(--shadow-lg); max-height: 280px; overflow: auto; padding: 4px; }
.qc-opt { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; padding: 7px 8px; border-radius: 7px; font-size: 13.5px; color: var(--ink); font-weight: 400; }
.qc-opt.on { background: #f1efea; }
.qc-opt.cur { font-weight: 600; }
.qc-kind { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); width: 44px; flex: none; }
.qc-kind.kunde { color: var(--accent); }
.qc-kind.persoenlich { color: var(--c-pink); }
.qc-none { padding: 10px; color: var(--ink-3); font-size: 13px; }
.qc-due { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; }
.qc-due .lbl { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.qc-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--hair); font-size: 13px; color: var(--ink-2); }
.chip:hover { border-color: #d9d6ce; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.qc-date { height: 28px; border: 1px solid var(--hair); border-radius: 999px; padding: 0 10px; font-size: 13px; color: var(--ink-2); }
dialog.qc textarea { border: 1px solid var(--hair); border-radius: 8px; padding: 8px 10px; resize: vertical; font-size: 14px; }
.qc-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--hair); padding-top: 12px; }
.qc-foot .sp { flex: 1; }

/* ---------- ⌘K palette ---------- */
dialog.pal { border: 0; border-radius: 14px; padding: 0; width: min(600px, calc(100vw - 24px)); margin: 12vh auto auto; box-shadow: 0 32px 64px -24px rgba(19,17,24,.45); overflow: hidden; }
dialog.pal::backdrop { background: rgba(19,17,24,.28); }
.pal-input { width: 100%; height: 52px; border: 0; border-bottom: 1px solid var(--hair); padding: 0 18px; font-size: 16px; outline: none; }
.pal-list { max-height: 360px; overflow: auto; padding: 6px; }
.pal-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.pal-item.on { background: #f1efea; }
.pal-kind { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); width: 58px; flex: none; }
.pal-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast a { color: #fff; text-decoration: underline; margin-left: 4px; }

@media (max-width: 960px) {
  .main { padding: 14px 16px 90px; }
  .topbar-new { display: inline-grid; }
  .qc-grid { grid-template-columns: 1fr; }
  dialog.qc, dialog.pal { margin-top: 4vh; }
  .side { padding-top: 0; }
  .panel { width: 100vw; }
}

/* ---------- login with OS ---------- */
.login-brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 17px; }
.login-brand .brand-app { margin-left: 0; }
.login .sso { height: 40px; justify-content: center; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12px; }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: var(--hair); }

/* ---------- installed app (PWA): respect the notch and home bar ---------- */
@media (max-width: 960px) {
  .topbar { padding-top: env(safe-area-inset-top); height: calc(48px + env(safe-area-inset-top)); }
  .timer-pill { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .main { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
}

/* ---------- files ---------- */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.file { border: 1px solid var(--hair); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; position: relative; background: #fff; }
.file .thumb { display: grid; place-items: center; height: 96px; background: #f6f5f2; }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file .ext { font-weight: 700; color: var(--ink-3); font-size: 13px; letter-spacing: .05em; }
.file .meta { padding: 6px 8px; min-width: 0; }
.file .fname { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .meta small { color: var(--ink-3); font-size: 11px; }
.file .icon-btn { position: absolute; top: 4px; right: 4px; background: rgba(255,255,255,.9); width: 24px; height: 24px; opacity: 0; }
.file:hover .icon-btn { opacity: 1; }
.dropzone { border: 1.5px dashed #d9d6ce; border-radius: 10px; padding: 14px; text-align: center; color: var(--ink-3); font-size: 13px; cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); color: var(--ink-2); background: #faf8ff; }

/* ---------- trash ---------- */
.nav-bottom { margin-top: auto; padding-top: 10px; }
.trash-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--hair); }
.trash-row .body { flex: 1; min-width: 0; }
.trash-row .t { font-weight: 600; }
.trash-row small { color: var(--ink-3); }
@media (max-width: 960px) { .file .icon-btn { opacity: 1; } }
