:root {
  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --line: #e2ded4;
  --line-strong: #cfc9bb;
  --ink: #1d1f23;
  --ink-2: #4a4e57;
  --muted: #6c6f78;
  --primary: #1d1f23;
  --primary-ink: #ffffff;
  --accent: #c2410c;
  --accent-soft: #fff1e8;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #0f7b4f;
  --new: #6d28d9;
  --new-soft: #f3edff;
  --doing: #0e6ba8;
  --doing-soft: #e6f2fb;
  --p1: #d97706;
  --p2: #ea580c;
  --p3: #dc2626;
  --shadow: 0 1px 2px rgba(29, 31, 35, .06), 0 2px 8px rgba(29, 31, 35, .04);
  --shadow-lift: 0 10px 40px rgba(29, 31, 35, .18);
  --radius: 14px;
  --radius-sm: 9px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Georgia, "PT Serif", "Times New Roman", serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sidebar: 248px;
  --bottom: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --surface: #202226;
    --surface-2: #1b1d20;
    --line: #2f3238;
    --line-strong: #3d4149;
    --ink: #eceae4;
    --ink-2: #c4c2bb;
    --muted: #9a9ca3;
    --primary: #eceae4;
    --primary-ink: #16171a;
    --accent: #fb8a4c;
    --accent-soft: #3a2518;
    --danger: #ff7b6e;
    --danger-soft: #3b1f1d;
    --new: #b79cff;
    --new-soft: #2a2340;
    --doing: #6cbcf2;
    --doing-soft: #19303f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lift: 0 10px 40px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.boot { padding: 40vh 0; text-align: center; color: var(--muted); }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.error { color: var(--danger); min-height: 1em; margin: 0; }
.danger-text { color: var(--danger); }
.spacer { flex: 1; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.main { padding: 20px 16px calc(var(--bottom) + 32px + env(safe-area-inset-bottom)); }
.page { max-width: 760px; margin: 0 auto; }
.page.narrow { max-width: 620px; }
.sidebar { display: none; }

.bottom-nav {
  position: fixed; inset: auto 0 0 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  height: calc(var(--bottom) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.bottom-nav a { display: grid; justify-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 6px 0; }
.bottom-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav-icon { position: relative; display: grid; }
.nav-icon .icon { width: 22px; height: 22px; }
.nav-icon .badge { position: absolute; top: -6px; right: -12px; }
.fab {
  justify-self: center; width: 52px; height: 52px; margin-top: -18px; border: 0; border-radius: 50%;
  background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-lift); display: grid; place-items: center; cursor: pointer;
  transition: transform .15s var(--ease);
}
.fab:active { transform: scale(.94); }
.fab .icon { width: 26px; height: 26px; stroke-width: 2.4; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--new); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: var(--sidebar) 1fr; }
  .bottom-nav { display: none; }
  .main { padding: 36px 40px 80px; }
  .sidebar {
    display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 22px 14px; border-right: 1px solid var(--line); background: var(--surface-2);
  }
  .side-nav, .side-projects { display: grid; gap: 2px; }
  .side-nav a, .side-projects a, .side-me {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink-2);
  }
  .side-nav a:hover, .side-projects a:hover, .side-me:hover { background: var(--line); color: var(--ink); }
  .side-nav a[aria-current="page"], .side-me[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
  .side-nav .badge { margin-left: auto; }
  .side-label { padding: 0 10px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  .side-me { margin-top: auto; }
  .side-me .icon { margin-left: auto; color: var(--muted); }
}

.brand { display: flex; align-items: center; gap: 10px; font: 600 20px/1 var(--font-display); padding: 4px 10px; }
.brand.big { font-size: 28px; padding: 0; justify-content: center; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--primary); color: var(--primary-ink); font: 700 13px/1 var(--font); letter-spacing: -.02em; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font: 600 32px/1.1 var(--font-display); letter-spacing: -.01em; }
.page-head p { margin: 6px 0 0; }
.page-actions { display: flex; gap: 6px; }
.title-with-dot { display: inline-flex; align-items: center; gap: 12px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.big { width: 14px; height: 14px; }
.block-title { font: 600 20px/1.2 var(--font-display); margin: 30px 0 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-weight: 600;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.primary:hover { opacity: .9; }
.btn.wide { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink-2); cursor: pointer; list-style: none;
}
.icon-btn:hover { background: var(--line); color: var(--ink); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.icon-btn[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.icon-btn::-webkit-details-marker { display: none; }
.pill { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 14px; cursor: pointer; }
.pill:hover { border-color: var(--ink-2); }

/* ---------- quick add ---------- */
.quick { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 8px 10px; margin-bottom: 18px; }
.quick:focus-within { border-color: var(--ink-2); }
.quick-row { display: flex; align-items: center; gap: 6px; }
.quick-plus { display: grid; place-items: center; width: 34px; color: var(--muted); }
.quick-input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 2px; font-size: 17px; outline: none; }
.quick-send { min-height: 38px; }
.quick-preview { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 6px 0 40px; }
.quick-preview:empty { display: none; }
.quick-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 6px 0 40px; font-size: 14px; }
.who {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 999px; padding: 3px 10px 3px 4px; cursor: pointer; color: var(--ink-2);
}
.who[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.quick-hint { padding: 8px 6px 0 40px; font-size: 13px; color: var(--muted); }
.extra-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--line-strong); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 14px; }
.extra-toggle:hover { border-color: var(--ink-2); color: var(--ink); }
.extra-toggle[aria-expanded="true"] { border-style: solid; color: var(--ink); }
.extra-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.chev { display: inline-block; transition: transform .15s; }
.quick-extra { display: grid; gap: 16px; margin: 12px 6px 4px 40px; padding-top: 14px; border-top: 1px solid var(--line); }
.quick-extra select { min-height: 42px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); width: 100%; }
.quick-extra .due-row input { min-height: 42px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); width: 100%; }
@media (max-width: 520px) { .quick-extra { margin-left: 6px; } .quick-who, .quick-preview, .quick-hint { padding-left: 6px; } .extra-toggle { margin-left: 0; } }

/* ---------- summary ---------- */
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
@media (max-width: 520px) { .stat { padding: 10px 11px; } .stat b { font-size: 24px; } .stat span { font-size: 12px; line-height: 1.25; } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 2px; }
.stat b { font: 600 28px/1 var(--font-display); }
.stat span { font-size: 13px; color: var(--muted); }
.stat.danger b { color: var(--danger); }
.stat.accent b { color: var(--accent); }
.stat:hover { border-color: var(--line-strong); }

/* ---------- task list ---------- */
.group { margin-top: 22px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 0 0 8px 4px; }
.section-title .count { font-weight: 600; color: var(--muted); }
.section-title.danger { color: var(--danger); }
.section-title.new { color: var(--new); }
.tasks { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.task { display: flex; align-items: flex-start; gap: 4px; padding: 4px 10px 4px 4px; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.task:hover { background: var(--surface-2); }
.task.unread { background: var(--new-soft); }
.task.done .task-title { color: var(--muted); text-decoration: line-through; }
.task .avatar { margin-top: 12px; }
.check { flex: none; display: grid; place-items: center; width: 40px; height: 44px; border: 0; background: transparent; cursor: pointer; }
.check::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); transition: background .15s, border-color .15s; grid-area: 1/1; }
.check .icon { grid-area: 1/1; width: 12px; height: 12px; stroke-width: 3.2; color: transparent; }
.check:hover .icon { color: var(--muted); }
.check.p1::before { border-color: var(--p1); }
.check.p2::before { border-color: var(--p2); }
.check.p3::before { border-color: var(--p3); background: color-mix(in srgb, var(--p3) 10%, transparent); }
.check[aria-pressed="true"]::before { background: var(--ok); border-color: var(--ok); }
.check[aria-pressed="true"] .icon { color: #fff; }
.task-body { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; padding: 10px 0; cursor: pointer; display: grid; gap: 5px; }
.task-title { display: flex; align-items: baseline; gap: 8px; word-break: break-word; }
.new-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--new); transform: translateY(-1px); }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.prio { flex: none; padding-top: 11px; font-weight: 800; font-size: 14px; letter-spacing: -.05em; }
.prio.p1 { color: var(--p1); }
.prio.p2 { color: var(--p2); }
.prio.p3 { color: var(--p3); }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; line-height: 1; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; }
.chip .icon { width: 13px; height: 13px; }
.chip.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; font-weight: 600; }
.chip.danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; font-weight: 600; }
.chip.doing { color: var(--doing); background: var(--doing-soft); border-color: transparent; font-weight: 600; }
.chip.from { color: var(--new); background: var(--new-soft); border-color: transparent; }
.chip.to { color: var(--ink); font-weight: 600; }
.chip.prio-chip { color: var(--p2); }
.empty-line { margin: 0; padding: 14px 16px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); }
.empty { text-align: center; padding: 40px 16px; }
.empty-title { font: 600 22px/1.2 var(--font-display); margin: 0 0 6px; }

.avatar { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 13px; }
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }
.avatar.xs { width: 20px; height: 20px; font-size: 10px; }
.avatar.both { background: var(--ink-2); color: var(--surface); }

/* ---------- chips nav ---------- */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px 4px; scrollbar-width: none; }
.chip-link { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; color: var(--ink-2); }
.chip-link:hover { border-color: var(--ink-2); }
.chip-link[aria-current="page"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); font-weight: 600; }

/* ---------- projects ---------- */
.inline-add { display: flex; gap: 8px; margin-bottom: 18px; }
.inline-add input, .search { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.search { width: 100%; margin-bottom: 14px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.project-card { position: relative; display: grid; gap: 6px; padding: 16px 16px 14px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .15s var(--ease), box-shadow .15s; }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.project-color { position: absolute; inset: 0 auto 0 0; width: 6px; }
.project-name { font-weight: 650; font-size: 17px; }
.progress { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 4px; }
.progress i { display: block; height: 100%; background: var(--ok); }
.archive { margin-top: 26px; }
.archive summary { cursor: pointer; color: var(--muted); margin-bottom: 12px; }
.menu { position: relative; }
.menu-body { position: absolute; right: 0; top: 42px; z-index: 10; display: grid; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lift); }
.menu-body > button { text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.menu-body > button:hover { background: var(--surface-2); }
.colors { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; }
.color { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; }

/* ---------- notes ---------- */
.new-note { margin-bottom: 14px; }
.notes-grid { columns: 2 260px; column-gap: 12px; }
.note-card { break-inside: avoid; display: grid; gap: 8px; margin-bottom: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.note-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.note-title { display: flex; align-items: center; gap: 6px; font-weight: 650; }
.note-title .icon { width: 14px; height: 14px; color: var(--accent); }
.note-snippet { color: var(--ink-2); font-size: 14px; white-space: pre-line; }
.note-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.note-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.note-toolbar select { max-width: 45%; min-height: 36px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 0 8px; }
.note-title-input { width: 100%; border: 0; background: transparent; font: 600 28px/1.2 var(--font-display); padding: 4px 0 10px; outline: none; }
.note-body { width: 100%; min-height: 50vh; border: 0; background: transparent; resize: none; outline: none; font-size: 17px; line-height: 1.6; }

/* ---------- cards & forms ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.card p { margin: 0 0 10px; }
.card-title { font: 600 19px/1.2 var(--font-display); margin: 0 0 12px; }
.card-title:not(:first-child) { margin-top: 18px; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.form input { min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: 16px; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: 14px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); text-align: center; padding: 28px 24px; }
.login-card label { text-align: left; }

.tg-card { border-color: var(--line-strong); }
.tg-hint { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: -6px 0 14px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--new-soft); color: var(--ink); font-size: 14px; }
.tg-hint b { color: var(--new); white-space: nowrap; }
.ok-text { color: var(--ok); font-weight: 650; }
.inline-field { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.inline-field select { min-height: 42px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); max-width: 240px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- segmented ---------- */
.segmented { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; }
.segmented button { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 14px; }
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: var(--shadow); }
.segmented.status button[aria-checked="true"] { background: var(--primary); color: var(--primary-ink); }
.segmented.swatches { background: transparent; border: 0; padding: 0; }
.segmented.swatches button { flex: none; width: 40px; padding: 0; }
.segmented.swatches button[aria-checked="true"] { box-shadow: 0 0 0 2px var(--ink); }
.swatch { width: 22px; height: 22px; border-radius: 50%; }
.who-inner { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- task sheet ---------- */
dialog { color: var(--ink); }
.sheet, .quick-sheet {
  border: 0; padding: 0; background: var(--surface); box-shadow: var(--shadow-lift);
  width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92vh;
}
.sheet[open] { display: flex; flex-direction: column; animation: rise .22s var(--ease); }
.quick-sheet[open] { animation: rise .22s var(--ease); padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); overflow-y: auto; }
.quick-sheet .quick { margin: 0; box-shadow: none; border-color: var(--ink-2); }
.quick-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 8px 6px; }
dialog::backdrop { background: rgba(15, 16, 18, .45); backdrop-filter: blur(2px); }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 900px) {
  .sheet { width: 560px; max-width: 560px; height: 100vh; max-height: 100vh; margin: 0 0 0 auto; border-radius: 0; }
  .sheet[open] { animation: slide .22s var(--ease); }
  .quick-sheet { width: 600px; max-width: 600px; margin: 15vh auto auto; border-radius: 18px; }
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sheet-head .muted { flex: 1; text-align: center; }
.sheet-body { overflow-y: auto; padding: 16px 18px calc(28px + env(safe-area-inset-bottom)); display: grid; gap: 18px; }
.sheet-body.loading { padding: 40px; color: var(--muted); text-align: center; }
.title-input { width: 100%; border: 0; resize: none; background: transparent; font: 600 24px/1.25 var(--font-display); padding: 0; outline: none; overflow: hidden; }
.field { display: grid; gap: 8px; }
.field-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.field select, .due-row input, .inline select {
  min-height: 42px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); width: 100%;
}
.due-row { display: grid; grid-template-columns: 1fr 130px; gap: 8px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.inline { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.two-col { display: grid; gap: 18px; }
@media (min-width: 520px) { .two-col { grid-template-columns: 1fr 1fr; } }
.notes-input { width: 100%; min-height: 64px; resize: none; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); line-height: 1.5; overflow: hidden; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checklist li { display: flex; align-items: center; gap: 4px; border-radius: 8px; }
.checklist li:hover { background: var(--surface-2); }
.checklist label { flex: 1; display: flex; align-items: center; gap: 10px; padding: 7px 6px; cursor: pointer; }
.checklist input { width: 18px; height: 18px; accent-color: var(--ok); }
.checklist li.done span { color: var(--muted); text-decoration: line-through; }
.checklist .icon-btn { width: 30px; height: 30px; opacity: .5; }
.check-add { display: flex; align-items: center; gap: 10px; padding: 4px 6px; color: var(--muted); }
.check-add input { flex: 1; border: 0; border-bottom: 1px dashed var(--line-strong); background: transparent; padding: 8px 0; outline: none; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.event { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); padding-left: 10px; border-left: 2px solid var(--line); }
.event .muted { flex: none; }
.comment { display: flex; gap: 8px; align-items: flex-start; }
.comment.mine { flex-direction: row-reverse; }
.bubble { max-width: 85%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; }
.comment.mine .bubble { background: var(--accent-soft); border-color: transparent; }
.bubble-head { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.bubble-text { white-space: pre-wrap; word-break: break-word; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; margin-top: -8px; }
@media (max-width: 520px) { .comment-form .btn-label { display: none; } .comment-form .btn { padding: 0 14px; } }
.comment-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 160px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); overflow-y: auto; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px;
  background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-lift); font-size: 15px; animation: rise .2s var(--ease);
}
.toast-action { border: 0; background: transparent; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }
@media (min-width: 900px) { .toast { bottom: 28px; } }

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