/* ==========================================================================
   TaskDesk — components  ·  requires tokens.css
   Class names follow the current app where sensible (.btn, .chip, .seg, .status,
   .tag, .card, .drawer, .modal, .toast, .bottomnav, .qa-*) so the migration is
   mostly a stylesheet swap + a few markup additions (glyphs, avatars).
   ========================================================================== */

/* ---------- Icons ---------- */
.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }
.i-xs { width: 14px; height: 14px; stroke-width: 2; }
.i-lg { width: 24px; height: 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--control-h); padding: 0 16px;
  border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-size: var(--fs-15); font-weight: var(--fw-semibold); white-space: nowrap;
  box-shadow: var(--shadow-1);
  transition: background var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); box-shadow: 0 1px 2px rgba(0,0,0,.08), var(--shadow-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.soft { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; box-shadow: none; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.ok { background: var(--st-done-bg); color: var(--st-done-fg); border-color: transparent; box-shadow: none; }
.btn.back { background: var(--surface); color: var(--text-2); }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: var(--fs-13); border-radius: var(--r-sm); }
.btn.lg { min-height: 48px; padding: 0 20px; font-size: var(--fs-16); border-radius: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-md);
  color: var(--text-2); position: relative;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1);
}
.icon-btn::after { content: ""; position: absolute; inset: -4px; }       /* 44px hit area */
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.filled { background: var(--surface-2); }
.icon-btn.round { border-radius: var(--r-pill); }
.send-btn { width: 36px; height: 36px; border-radius: var(--r-pill); display: inline-grid; place-items: center; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-accent); }
.send-btn.idle { background: var(--surface-3); color: var(--muted); box-shadow: none; }

/* ---------- Inputs ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: var(--fs-13); font-weight: var(--fw-medium); color: var(--muted); }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > .i { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.input-icon > input { padding-left: 38px; }
.kbd { font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 5px; }

/* Quick input — the «Задача или вопрос для Claude» bar */
.qa {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 6px 8px 6px 16px;
  background: var(--surface); border-radius: var(--r-pill);
  box-shadow: var(--shadow-2), var(--ring);
  transition: box-shadow var(--dur-2) var(--ease-out);
}
.qa:focus-within { box-shadow: 0 0 0 4px var(--focus), var(--shadow-2); }
.qa .spark { color: var(--accent); }
.qa-input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; min-height: 36px; font-size: var(--fs-16); }
.qa-input:hover, .qa-input:focus { background: transparent; box-shadow: none; border: 0; }
.qa-input.fake { display: flex; align-items: center; color: var(--muted); }
.qa.expanded { border-radius: var(--r-lg); flex-direction: column; align-items: stretch; padding: 14px 16px 12px; gap: 10px; }
.qa.expanded .qa-text { font-size: var(--fs-16); line-height: 1.45; color: var(--text); }
.qa.expanded .qa-bar { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-13); }

/* ---------- Chips & segmented control ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 36px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--surface); color: var(--text-2);
  font-size: var(--fs-13); font-weight: var(--fw-medium); white-space: nowrap;
  box-shadow: var(--shadow-1), var(--ring);
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2), transform var(--dur-1);
}
.chip:hover { color: var(--text); }
.chip:active { transform: scale(.96); }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip .n.hot { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--urgent-bg); color: var(--urgent-fg); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.chip.on { background: var(--text); color: var(--bg); box-shadow: none; }
.chip.on .n { color: inherit; opacity: .7; }
.chip.select { gap: 4px; padding-right: 10px; }
.chip.select .i-xs { color: var(--muted); }
@media (max-width: 640px) { .chip { min-height: 40px; font-size: 14px; } }

.seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-md);
  background: var(--surface-3);
}
.seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 14px; border-radius: 9px;
  color: var(--text-2); font-size: var(--fs-13); font-weight: var(--fw-semibold);
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2), box-shadow var(--dur-2);
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg.block { display: flex; }
.seg.block button { flex: 1; }
@media (max-width: 640px) { .seg button { min-height: 38px; font-size: 14px; } }

/* ---------- Status pill ----------
   Pastel bg + dark text + progress glyph (○ ◐ ◕ bubble ✓) → never colour-only. */
.status {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 26px; padding: 0 10px 0 8px; border-radius: var(--r-pill);
  font-size: var(--fs-12); font-weight: var(--fw-semibold); letter-spacing: .01em; white-space: nowrap;
  background: var(--st-bg); color: var(--st-fg);
  transition: transform var(--dur-2) var(--ease-spring), filter var(--dur-1);
}
.status .g { width: 13px; height: 13px; }
.status .caret { width: 12px; height: 12px; margin-left: -1px; opacity: .6; stroke: currentColor; fill: none; stroke-width: 2.2; }
button.status { position: relative; }
button.status::after { content: ""; position: absolute; inset: -9px -4px; }   /* 44px touch target */
button.status:hover { filter: saturate(1.25) brightness(.98); }
button.status:active { transform: scale(.94); }
.status.sm { height: 22px; padding: 0 8px 0 6px; font-size: 11.5px; gap: 5px; }
.st-not_started { --st-bg: var(--st-not_started-bg); --st-fg: var(--st-not_started-fg); --st-dot: var(--st-not_started-dot); }
.st-wip         { --st-bg: var(--st-wip-bg);         --st-fg: var(--st-wip-fg);         --st-dot: var(--st-wip-dot); }
.st-to_check    { --st-bg: var(--st-to_check-bg);    --st-fg: var(--st-to_check-fg);    --st-dot: var(--st-to_check-dot); }
.st-discuss     { --st-bg: var(--st-discuss-bg);     --st-fg: var(--st-discuss-fg);     --st-dot: var(--st-discuss-dot); }
.st-done        { --st-bg: var(--st-done-bg);        --st-fg: var(--st-done-fg);        --st-dot: var(--st-done-dot); }

/* ---------- Markers: срочно / без движения / повтор ---------- */
.marker {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px 0 6px;
  border-radius: var(--r-pill); font-size: var(--fs-12); font-weight: var(--fw-semibold); white-space: nowrap;
}
.marker .i { width: 13px; height: 13px; stroke-width: 2; }
.marker.urgent { background: var(--urgent-bg); color: var(--urgent-fg); }
.marker.stale  { background: var(--stale-bg);  color: var(--stale-fg); }
.marker.repeat { background: var(--surface-2); color: var(--text-2); }

/* ---------- Stream tag (neutral label + colour dot) ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-13); color: var(--text-2); white-space: nowrap; min-width: 0; }
.tag::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--dot, var(--faint)); flex: none; }
.tag.boxed { height: 24px; padding: 0 9px 0 8px; border-radius: var(--r-xs); background: var(--surface-2); font-size: var(--fs-12); font-weight: var(--fw-medium); }
.s1 { --dot: var(--stream-1); } .s2 { --dot: var(--stream-2); } .s3 { --dot: var(--stream-3); }
.s4 { --dot: var(--stream-4); } .s5 { --dot: var(--stream-5); } .s6 { --dot: var(--stream-6); }

/* ---------- Avatar ---------- */
.av {
  --size: 28px;
  width: var(--size); height: var(--size); flex: none; border-radius: var(--r-pill);
  display: inline-grid; place-items: center;
  background: var(--av-bg, var(--surface-3)); color: var(--av-fg, var(--text-2));
  font-size: calc(var(--size) * .4); font-weight: var(--fw-bold); letter-spacing: -.02em; line-height: 1;
  box-shadow: 0 0 0 2px var(--surface);
}
.av.xs { --size: 20px; } .av.sm { --size: 24px; } .av.lg { --size: 40px; } .av.xl { --size: 56px; }
.av.none { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.av.ai { background: var(--accent-soft); color: var(--accent); }
.p1 { --av-bg: var(--av-1-bg); --av-fg: var(--av-1-fg); } .p2 { --av-bg: var(--av-2-bg); --av-fg: var(--av-2-fg); }
.p3 { --av-bg: var(--av-3-bg); --av-fg: var(--av-3-fg); } .p4 { --av-bg: var(--av-4-bg); --av-fg: var(--av-4-fg); }
.p5 { --av-bg: var(--av-5-bg); --av-fg: var(--av-5-fg); } .p6 { --av-bg: var(--av-6-bg); --av-fg: var(--av-6-fg); }
.who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--fs-13); color: var(--text-2); }
.who.unassigned { color: var(--muted); font-style: normal; }

/* ---------- Due date ---------- */
.due { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-13); color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.due .i { width: 14px; height: 14px; color: var(--muted); }
.due-rel { color: var(--muted); }
.due.today .due-rel { color: var(--accent-text); font-weight: var(--fw-semibold); }
.due.overdue, .due.overdue .i { color: var(--urgent-fg); }
.due.overdue .due-rel { color: var(--urgent-fg); font-weight: var(--fw-semibold); }
.due.none { color: var(--faint); }

/* ---------- Task card (mobile list · board · people) ---------- */
.tcard {
  display: grid; gap: 10px; padding: 14px 16px 14px;
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1), var(--ring);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.tcard:hover { box-shadow: var(--shadow-2), var(--ring); }
.tcard:active { transform: scale(.985); }
.tcard-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tcard-top .num { margin-left: auto; font-size: var(--fs-12); color: var(--muted); font-variant-numeric: tabular-nums; }
.tcard-title { font-size: var(--fs-17); font-weight: var(--fw-semibold); line-height: 1.3; letter-spacing: -.01em; margin: 0; }
.tcard-meta { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.tcard-upd {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 8px 10px; border-radius: 12px; background: var(--surface-2);
  font-size: var(--fs-13); line-height: 1.4; color: var(--text-2);
}
.tcard-upd p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard-upd b { color: var(--text); font-weight: var(--fw-semibold); }
.tcard-upd time { color: var(--muted); white-space: nowrap; }

/* compact board card */
.bcard { gap: 8px; padding: 12px 12px 12px; border-radius: 14px; }
.bcard .tcard-title { font-size: 14px; font-weight: var(--fw-medium); line-height: 1.35; }
.bcard .row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bcard .row .spacer { flex: 1; }
.bcard .row.top { flex-wrap: nowrap; }
.bcard .row.top .tag { flex: 1 1 auto; }
.tag .tx { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcard .num { flex: none; }
.bcard .num { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bcard .cc { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
.bcard.done { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.bcard.done .tcard-title { color: var(--muted); }
.bcard.lifted { transform: rotate(-1.5deg) translateY(-2px); box-shadow: var(--shadow-3); }
.drop-slot { height: 64px; border-radius: 14px; border: 1.5px dashed var(--border-strong); background: color-mix(in srgb, var(--surface) 50%, transparent); }

/* ---------- Task row (desktop list) ---------- */
.tlist { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1), var(--ring); overflow: hidden; }
.thead, .trow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 132px 104px 124px; align-items: center; column-gap: 12px; padding: 0 16px 0 12px; }
.thead { height: 40px; font-size: var(--fs-12); font-weight: var(--fw-semibold); color: var(--muted); border-bottom: 1px solid var(--border); }
.thead .sort { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); }
.tgroup { display: flex; align-items: center; gap: 8px; padding: 16px 16px 6px 20px; font-size: var(--fs-13); font-weight: var(--fw-semibold); color: var(--text-2); }
.tgroup .n { color: var(--muted); font-weight: var(--fw-medium); }
.tgroup.hot { color: var(--urgent-fg); }
.trow {
  position: relative; min-height: 64px; padding-top: 10px; padding-bottom: 10px;
  transition: background var(--dur-1) var(--ease-out);
}
.trow + .trow::before { content: ""; position: absolute; top: 0; left: 56px; right: 16px; height: 1px; background: var(--border); }
.trow:hover { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.trow.sel { background: var(--accent-soft); }
.trow.sel::after { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.trow.sel + .trow::before, .trow.sel::before { opacity: 0; }
.trow .num { font-size: var(--fs-13); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; padding-right: 2px; }
.t-main { min-width: 0; display: grid; gap: 4px; }
.t-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--fs-15); font-weight: var(--fw-medium); color: var(--text); }
.t-title span.txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-sub { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: var(--fs-13); color: var(--muted); }
.t-sub .tag { flex: none; }
.t-sub .upd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.t-sub .upd b { color: var(--text-2); font-weight: var(--fw-medium); }
.t-due { display: grid; gap: 1px; font-size: var(--fs-13); font-variant-numeric: tabular-nums; }
.t-due .d { color: var(--text); }
.t-due .r { color: var(--muted); font-size: var(--fs-12); }
.t-due.today .r { color: var(--accent-text); font-weight: 600; }
.t-due.overdue .d, .t-due.overdue .r { color: var(--urgent-fg); font-weight: 600; }

/* ---------- Board columns ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.bcol { background: color-mix(in srgb, var(--surface-2) 70%, transparent); border-radius: 20px; padding: 8px; display: grid; gap: 8px; }
.bcol-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 4px 4px; min-height: 36px; }
.bcol-head .n { font-size: var(--fs-13); color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.bcol-head .icon-btn { margin-left: auto; width: 28px; height: 28px; }
.bcol-foot { font-size: var(--fs-12); color: var(--muted); padding: 2px 6px 4px; display: flex; align-items: center; gap: 6px; }

/* People column head */
.phead { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 6px 6px; }
.phead .name { font-weight: 700; font-size: var(--fs-15); line-height: 1.2; }
.phead .role { font-size: var(--fs-12); color: var(--muted); }
.phead .n { font-size: var(--fs-13); color: var(--muted); font-weight: 600; }
.load { display: flex; height: 6px; border-radius: 3px; overflow: hidden; gap: 2px; margin: 0 6px; }
.load span { background: var(--st-dot); border-radius: 3px; }
.pstats { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 2px 6px 4px; font-size: var(--fs-12); color: var(--muted); }
.pstats b { color: var(--text-2); font-weight: 600; }

/* ---------- Bottom tab bar (mobile) ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-tabbar);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: start;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px);
  box-shadow: 0 -1px 0 var(--border);
}
.bn-item {
  position: relative; display: grid; justify-items: center; gap: 3px;
  min-height: 52px; padding-top: 6px; color: var(--muted);
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
  transition: color var(--dur-2) var(--ease-out);
}
.bn-item .i { width: 24px; height: 24px; }
.bn-item.on { color: var(--accent-text); }
.bn-item.on .i { stroke-width: 2.1; }
.bn-badge {
  position: absolute; top: 1px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--urgent-fg); color: var(--surface);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.bn-add { display: grid; place-items: center; }
.bn-add span {
  width: 52px; height: 52px; margin-top: -2px; border-radius: 18px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-accent);
  transition: transform var(--dur-2) var(--ease-spring);
}
.bn-add span:active { transform: scale(.92) rotate(-8deg); }
.bn-add .i { width: 26px; height: 26px; stroke-width: 2.2; }

/* Action bar — replaces the tab bar while a draft / form is open (can be Telegram MainButton) */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-tabbar);
  display: grid; grid-template-columns: 1fr 2fr; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px);
  box-shadow: 0 -1px 0 var(--border);
}

/* ---------- Sheet (mobile) / side panel (desktop) ---------- */
.overlay { position: fixed; inset: 0; background: var(--scrim); z-index: var(--z-overlay); animation: fade var(--dur-3) var(--ease-out); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; top: 48px; z-index: var(--z-overlay);
  background: var(--elevated); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; overflow: hidden;
  animation: sheet-in var(--dur-3) var(--ease-sheet);
}
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 8px auto 2px; flex: none; }
.drawer {
  width: var(--panel-w); background: var(--elevated); border-radius: var(--r-xl);
  box-shadow: var(--shadow-3), var(--ring); display: flex; flex-direction: column; overflow: hidden;
  animation: panel-in var(--dur-3) var(--ease-out);
}
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px 20px; }
.drawer-head .num { font-size: var(--fs-13); color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.drawer-body { padding: 4px 20px 20px; display: grid; gap: 18px; align-content: start; grid-auto-rows: max-content; overflow: auto; }
.d-title { font-size: var(--fs-20); font-weight: var(--fw-bold); line-height: 1.25; letter-spacing: -.015em; }
.section-title { font-size: var(--fs-13); font-weight: var(--fw-semibold); color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* Review banner — «Ждёт твоей проверки» */
.reviewbar {
  display: grid; gap: 12px; padding: 14px; border-radius: var(--r-lg);
  background: var(--st-to_check-bg); color: var(--st-to_check-fg);
}
.reviewbar .rb-text { display: flex; gap: 10px; align-items: center; font-size: var(--fs-15); font-weight: var(--fw-semibold); }
.reviewbar .rb-text small { display: block; font-weight: 400; color: inherit; opacity: .85; font-size: var(--fs-13); }
.reviewbar .rb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reviewbar .btn { min-height: 40px; box-shadow: none; }
.reviewbar .btn.ok { background: var(--surface); color: var(--st-done-fg); }
.reviewbar .btn.back { background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 30%, transparent); }

/* Property list (grouped rows) */
.props { background: var(--surface-2); border-radius: var(--r-lg); overflow: hidden; }
.prop { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 14px; position: relative; }
.prop + .prop::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--border); }
.prop .k { width: 104px; flex: none; color: var(--muted); font-size: var(--fs-15); }
.prop .v { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: var(--fs-15); }
.prop .chev { color: var(--faint); }
.props.grid2 { display: grid; grid-template-columns: 1fr 1fr; background: none; gap: 8px; border-radius: 0; }
.props.grid2 .prop { background: var(--surface-2); border-radius: 14px; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; min-height: 0; }
.props.grid2 .prop::before { display: none; }
.props.grid2 .prop .k { width: auto; font-size: var(--fs-12); }
.props.grid2 .prop .v { font-size: 14px; }
.quick-due { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-due .chip { min-height: 30px; padding: 0 10px; font-size: var(--fs-12); background: var(--surface); }

/* Switch */
.switch { width: 44px; height: 26px; border-radius: 13px; background: var(--surface-3); position: relative; flex: none; transition: background var(--dur-2) var(--ease-out); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform var(--dur-2) var(--ease-spring); }
.switch.on { background: var(--urgent-fg); }
.switch.on::after { transform: translateX(18px); }

/* ---------- Comments ---------- */
.thread { display: grid; gap: 12px; }
.comment { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: end; max-width: 92%; }
.comment .bubble { padding: 9px 12px 8px; border-radius: 18px 18px 18px 6px; background: var(--surface-2); font-size: var(--fs-15); line-height: 1.45; }
.comment .meta { font-size: var(--fs-12); color: var(--muted); margin-bottom: 2px; }
.comment .meta b { color: var(--text-2); font-weight: 600; }
.comment.mine { justify-self: end; grid-template-columns: 1fr; }
.comment.mine .bubble { background: var(--accent-soft); border-radius: 18px 18px 6px 18px; }
.comment.mine .meta { text-align: right; }
.comment.system { justify-self: center; font-size: var(--fs-12); color: var(--muted); display: flex; gap: 6px; align-items: center; max-width: none; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; background: var(--elevated); border-top: 1px solid var(--border); }
.composer .box { flex: 1; min-height: 44px; border-radius: 22px; background: var(--surface-2); display: flex; align-items: center; padding: 0 16px; font-size: 16px; color: var(--muted); }
.history-toggle { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 14px; background: var(--surface-2); color: var(--text-2); font-size: 14px; font-weight: 500; }
.history-toggle .chev { margin-left: auto; color: var(--faint); }

/* ---------- Modal ---------- */
.modal {
  width: min(560px, calc(100vw - 32px)); background: var(--elevated); border-radius: var(--r-xl);
  box-shadow: var(--shadow-3); padding: 24px; display: grid; gap: 18px;
  animation: modal-in var(--dur-3) var(--ease-out);
}
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 640px) {
  .modal { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); animation-name: sheet-in; animation-timing-function: var(--ease-sheet); }
}

/* ---------- Toast ---------- */
.toast {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 8px 0 14px;
  border-radius: 16px; background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-3);
  animation: toast-in var(--dur-3) var(--ease-spring);
}
.toast .ok { width: 22px; height: 22px; border-radius: 50%; background: var(--st-done-dot); color: #fff; display: grid; place-items: center; }
.toast .undo { margin-left: 6px; min-height: 36px; padding: 0 12px; border-radius: 10px; color: var(--bg); font-weight: 700; opacity: .9; }
.toast .undo:hover { background: color-mix(in srgb, var(--bg) 14%, transparent); }
.toast.err { background: var(--danger); color: #fff; }

/* ---------- Empty state ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 28px 16px; color: var(--muted); font-size: var(--fs-13); }
.empty .art { width: 72px; height: 72px; border-radius: 24px; display: grid; place-items: center; background: var(--st-done-bg); color: var(--st-done-fg); margin-bottom: 4px; }
.empty b { color: var(--text); font-size: var(--fs-15); font-weight: 600; }

/* ---------- Claude drafts & answer ---------- */
.qa-note { display: flex; align-items: center; gap: 8px; font-size: var(--fs-13); color: var(--text-2); }
.qa-note .i { color: var(--accent); }
.qa-task { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px 14px 12px 12px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1), var(--ring); }
.qa-task.off { opacity: .5; }
.check { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); margin-top: 1px; }
.check.off { background: transparent; box-shadow: inset 0 0 0 1.8px var(--border-strong); color: transparent; }
.qa-fields { display: grid; gap: 10px; min-width: 0; }
.qa-title { font-size: var(--fs-16); font-weight: 600; line-height: 1.35; padding-bottom: 6px; border-bottom: 1px dashed var(--border-strong); }
.qa-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.pick {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px 0 6px; border-radius: var(--r-sm);
  background: var(--surface-2); font-size: var(--fs-13); color: var(--text-2); font-weight: 500; white-space: nowrap;
}
.pick.txt { padding-left: 10px; }
.pick .i-xs { color: var(--muted); }
.pick.empty-val { color: var(--muted); border: 1px dashed var(--border-strong); background: transparent; }
.pick.urgent { background: var(--urgent-bg); color: var(--urgent-fg); }
.pick.repeat { background: var(--stale-bg); color: var(--stale-fg); }
.qa-note-small { font-size: var(--fs-12); color: var(--muted); }
.answer { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-2), var(--ring); }
.answer-head { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.answer-head small { font-weight: 400; margin-left: auto; }
.answer p { font-size: var(--fs-15); line-height: 1.55; color: var(--text); }
.mini { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.mini .t { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.mini .m { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Motion ---------- */
@keyframes fade { from { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes panel-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes modal-in { from { transform: translateY(8px) scale(.98); opacity: 0; } }
@keyframes toast-in { from { transform: translateY(16px) scale(.96); opacity: 0; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.status.just-changed { animation: pop var(--dur-4) var(--ease-spring); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- App shell (desktop) ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; background: var(--bg); }
.shell.with-panel { grid-template-columns: 68px minmax(0, 1fr) var(--panel-w); }
.side { display: flex; flex-direction: column; gap: 2px; padding: 18px 12px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.logo { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-accent); flex: none; }
.logo .i { width: 18px; height: 18px; stroke-width: 2.4; }
.nav-item {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: 11px;
  color: var(--text-2); font-size: 14px; font-weight: 500;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1);
}
.nav-item .i { width: 19px; height: 19px; color: var(--muted); }
.nav-item:hover { background: var(--surface-2); }
.nav-item.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-1), var(--ring); }
.nav-item.on .i { color: var(--accent); }
.nav-item .n { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-item .n.hot { min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; display: grid; place-items: center; background: var(--urgent-bg); color: var(--urgent-fg); font-weight: 700; }
.nav-item .sdot { width: 10px; height: 10px; border-radius: 4px; background: var(--dot); margin: 0 4px 0 4px; }
.nav-label { font-size: 12px; font-weight: 600; color: var(--muted); padding: 18px 10px 6px; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; font-size: 14px; font-weight: 600; }
.side .me small { display: block; font-weight: 400; font-size: 12px; }
.side.rail { align-items: center; padding: 18px 0; gap: 6px; }
.side.rail .nav-item { width: 44px; height: 44px; padding: 0; justify-content: center; position: relative; }
.side.rail .nav-item .n.hot { position: absolute; top: 2px; right: 0; margin: 0; min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
.side.rail .brand { padding: 2px 0 14px; }

.main { min-width: 0; padding: 22px 28px 40px; display: grid; gap: 16px; align-content: start; grid-auto-rows: max-content; }
.page-head { display: flex; align-items: center; gap: 12px; }
.page-head h1 { font-size: var(--fs-24); }
.page-head .count { font-size: var(--fs-20); color: var(--muted); font-weight: 600; }
.page-head .spacer { flex: 1; }
.page-head .search { width: 240px; }
.page-head .search input { min-height: 38px; background: var(--surface); box-shadow: var(--shadow-1), var(--ring); border-radius: var(--r-pill); font-size: 14px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.toolbar .hint { font-size: var(--fs-12); color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1fr); }
.panel-wrap { padding: 12px 12px 12px 0; }
.panel-wrap .drawer { width: auto; height: 100%; }
