/* Tasks page (#/tasks), the task panel and the small task bits used on Home
   and the calendar. Colours only through the variables in app.css, so the
   light and dark themes both work. Project and label colours are data
   (inline style), like a person's avatar colour. */

/* ================================================================ shared bits */
.t-st { display: inline-flex; flex: none; }
.t-st svg { width: 16px; height: 16px; }
.t-st-backlog { color: var(--text-3); }
.t-st-todo { color: var(--text-2); }
.t-st-doing { color: var(--warn); }
.t-st-review { color: var(--teal); }
.t-st-done { color: var(--up); }
.t-st-canceled { color: var(--text-3); }

/* Priority: urgent = filled "!", high/medium/low = 3/2/1 bars, none = dashes */
.t-prio {
  display: inline-flex; align-items: flex-end; justify-content: center; gap: 1.5px;
  width: 14px; height: 14px; flex: none;
}
.t-prio i { display: block; width: 3px; border-radius: 1px; background: var(--line-2); }
.t-prio i:nth-child(1) { height: 5px; }
.t-prio i:nth-child(2) { height: 9px; }
.t-prio i:nth-child(3) { height: 13px; }
.t-prio i.on { background: var(--text-2); }
.t-prio-high i.on { background: var(--text); }
.t-prio-none { align-items: center; }
.t-prio-none i, .t-prio-none i:nth-child(n) { height: 2px; background: var(--text-3); opacity: .7; }
.t-prio-urgent {
  align-items: center; border-radius: 4px; background: var(--down); color: var(--bg);
  font: 800 11px/1 var(--font-ui);
}
.t-prio-urgent b { font-weight: 800; }

/* Deadline badge with countdown */
.t-due {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px;
  border-radius: var(--radius-pill); white-space: nowrap;
  font: 500 11.5px var(--font-mono); font-variant-numeric: tabular-nums;
  color: var(--text-3); background: var(--surface-2); border: 1px solid var(--line);
}
.t-due svg { width: 12px; height: 12px; flex: none; }
.t-due-late { color: var(--down); background: var(--down-soft); border-color: transparent; }
.t-due-soon { color: var(--lime-text); background: var(--lime-soft); border-color: transparent; }
.t-due-closed { background: transparent; border-color: transparent; padding: 0; }

.t-label, .t-proj {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; max-width: 170px;
  padding: 0 8px 0 6px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 11.5px; color: var(--text-2); white-space: nowrap; min-width: 0;
}
.t-label i, .t-proj i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.t-proj i { border-radius: 2px; }
.t-label span, .t-proj span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* A switched-off (inactive) project: still shown on its tasks, faint, with a small tag */
.t-proj.is-inactive { max-width: 260px; border-style: dashed; color: var(--text-3); }
.t-proj.is-inactive i { opacity: .45; }
.t-proj-off {
  flex: none; display: inline-flex; align-items: center; height: 16px; padding: 0 6px; margin-left: 2px;
  border-radius: var(--radius-pill); border: 1px dashed var(--line-2);
  font-size: 10.5px; font-weight: 500; line-height: 1; color: var(--text-3); white-space: nowrap;
}
.t-proj .t-proj-off { margin-left: 3px; }
.t-row-edge.is-inactive, .t-card-edge.is-inactive, .t-gdot.is-inactive { opacity: .35; }

.avatar.t-noone { background: transparent; border: 1px dashed var(--line-2); color: var(--text-3); }
.avatar.t-noone svg { width: 12px; height: 12px; }
.avatar.xs { width: 16px; height: 16px; font-size: 8px; }

/* Lead + helpers (v5): the lead's circle first, then up to 2 helpers and "+N", a little overlapped. */
.t-people { display: inline-flex; align-items: center; flex: none; }
.t-people > .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.avatar.t-more { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line-2); font-size: 9.5px; font-weight: 600; }
.t-helper-tag {
  display: inline-flex; align-items: center; flex: none; height: 18px; padding: 0 7px;
  border-radius: var(--radius-pill); border: 1px solid var(--teal); background: var(--teal-soft);
  color: var(--teal); font-size: 10.5px; font-weight: 600; line-height: 1; white-space: nowrap;
}
/* Task panel: the Helpers picker (chips with avatars). */
.t-helpers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.t-helper-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 32px;
  padding: 2px 4px 2px 3px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; color: var(--text);
}
.t-helper-chip > span.ellipsis { min-width: 0; }
.t-helper-chip .t-helper-x {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 0; background: transparent; color: var(--text-3); cursor: pointer;
}
.t-helper-chip .t-helper-x:hover { background: var(--surface); color: var(--down); }
.t-helper-chip.is-off { border-style: dashed; color: var(--text-3); }
.t-helper-add { max-width: 220px; }

.t-meta-bit { display: inline-flex; align-items: center; gap: 4px; font: 500 11.5px var(--font-mono); color: var(--text-3); white-space: nowrap; }
.t-meta-bit svg { width: 13px; height: 13px; }
.t-meta-bit.is-full { color: var(--up); }

/* Compact row (Home card, small lists) */
.t-row {
  position: relative; display: flex; align-items: center; gap: 10px; min-width: 0;
  min-height: 44px; padding: 8px 12px 8px 16px; border-radius: 10px;
  color: var(--text); transition: background .12s var(--ease);
}
.t-row:hover { background: var(--surface-2); text-decoration: none; }
.t-row-edge { position: absolute; left: 4px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; }
.t-row-title { flex: 1; font-weight: 500; font-size: 14px; }
.t-row.is-closed .t-row-title { color: var(--text-3); text-decoration: line-through; }

/* Pop-up menu (a sheet on phones) */
.t-menu {
  position: fixed; z-index: 150; left: 8px; top: 8px;
  min-width: 210px; max-width: min(300px, calc(100vw - 16px)); max-height: min(440px, calc(100dvh - 16px)); overflow-y: auto;
  padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: var(--shadow-pop); animation: pop-in .14s var(--ease);
}
.t-menu.is-sheet {
  left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-width: none; max-height: 82dvh;
  border-radius: 22px 22px 0 0; padding: 10px 10px calc(14px + env(safe-area-inset-bottom));
}
.t-menu-backdrop { position: fixed; inset: 0; z-index: 149; background: color-mix(in srgb, var(--bg) 62%, transparent); animation: fade-in .14s var(--ease); }
.t-menu-title { padding: 6px 10px 10px; font-weight: 600; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.t-menu-head { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.t-menu-note { margin: 4px 4px 6px; padding: 8px 10px; border-radius: 10px; background: var(--warn-soft); font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.t-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text);
  font-size: 14px; text-align: left; cursor: pointer;
}
.t-menu.is-sheet .t-menu-item { min-height: 44px; }
.t-menu-item svg { width: 15px; height: 15px; flex: none; color: var(--text-2); }
.t-menu-item:hover:not(:disabled), .t-menu-item:focus-visible { background: var(--surface-2); outline: none; }
.t-menu-item:disabled { color: var(--text-3); cursor: default; }
.t-menu-item.checked { font-weight: 600; }
.t-menu-item.checked > svg:last-child { color: var(--teal); }
.t-menu-item.danger, .t-menu-item.danger svg { color: var(--down); }
.t-menu-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.t-menu-noicon { width: 15px; flex: none; }
.t-menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* Colour swatches (projects, labels) */
.t-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.t-swatch { position: relative; width: 32px; height: 32px; cursor: pointer; }
.t-swatch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.t-swatch span { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow .12s var(--ease); }
.t-swatch input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.t-swatch input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 4px; }

/* ================================================================ page */
.t-page { min-width: 0; }
.t-page.t-kept { animation: none; }
.t-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; transition: opacity .2s var(--ease); }
.t-body.is-busy { opacity: .55; }

/* ---------- Quick add ---------- */
.t-qa-wrap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.t-qa {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  height: 54px; padding: 0 8px 0 16px; border-radius: 16px;
  border: 1px solid var(--line-2); background: var(--surface);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.t-qa:focus-within { border-color: var(--teal); box-shadow: var(--focus); }
.t-qa-wrap.is-pulse .t-qa { animation: t-pulse .7s var(--ease); }
.t-qa-icon { display: inline-flex; color: var(--teal); flex: none; }
.t-qa-input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent;
  font-size: 15.5px; color: var(--text);
}
.t-qa-input::placeholder { color: var(--text-3); }
.t-qa-kbd { flex: none; opacity: 0; transition: opacity .15s var(--ease); }
.t-qa:focus-within .t-qa-kbd { opacity: 1; }
.t-qa-help {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent; color: var(--text-2);
  font-weight: 700; font-size: 14px; cursor: pointer;
}
.t-qa-help:hover { color: var(--text); border-color: var(--text-3); }
.t-qa-save {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px;
  border: 0; border-radius: 12px; background: var(--teal); color: var(--teal-ink); cursor: pointer;
}
.t-qa-save:hover { background: var(--teal-strong); }
.t-qa-save.loading svg { display: none; }
.t-qa-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.t-qa-chips:empty { display: none; }
.t-qchip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; max-width: 100%; min-width: 0;
  padding: 0 10px; border-radius: var(--radius-pill);
  background: var(--teal-soft); border: 1px solid var(--teal-line); color: var(--text); font-size: 12.5px;
  animation: pop-in .16s var(--ease);
}
.t-qchip > svg { width: 13px; height: 13px; flex: none; color: var(--teal); }
.t-qchip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.t-qchip-title { background: var(--surface-2); border-color: var(--line); }
.t-qchip-title > svg { color: var(--text-3); }
.t-qchip-warn { background: var(--warn-soft); border-color: transparent; }
.t-qchip-warn > svg { color: var(--warn); }
/* A word HQ did not use (it stays in the name): grey, says why */
.t-qchip-skip { background: transparent; border: 1px dashed var(--line-2); color: var(--text-3); }
.t-qchip-skip > svg { color: var(--text-3); }
.t-qdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.t-qa-enter { margin-left: 4px; }

/* ---------- Toolbar ---------- */
.t-toolbar { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.t-bar-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.t-views .tab svg { width: 15px; height: 15px; }
.t-chipset { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.t-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: var(--radius-pill); border: 1px solid var(--line-2); background: transparent;
  color: var(--text-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background .12s var(--ease), border-color .12s var(--ease), color .12s var(--ease);
}
.t-chip:hover { color: var(--text); border-color: var(--text-3); }
.t-chip.active { background: var(--teal-soft); border-color: var(--teal-line); color: var(--text); }
.t-chip-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--down); color: var(--bg); font: 600 11px var(--font-mono);
}
.t-filters, .t-listopts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.t-fsel {
  width: auto; max-width: 200px; height: 34px; padding: 0 32px 0 12px;
  border-radius: var(--radius-pill); font-size: 13.5px;
  background-position: calc(100% - 17px) 14px, calc(100% - 12px) 14px;
}
.t-fsel.is-on { border-color: var(--teal-line); background-color: var(--teal-soft); }
.t-closed { font-size: 13.5px; color: var(--text-2); min-height: 32px; }
.t-filter-btn { display: none; }
.t-filter-btn.is-on { border-color: var(--teal-line); background: var(--teal-soft); }
.t-filter-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--teal); color: var(--teal-ink); font: 600 11px var(--font-mono);
}
.t-search {
  display: flex; align-items: center; gap: 8px; height: 34px; min-width: 210px; padding: 0 8px 0 12px;
  border-radius: var(--radius-pill); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-3);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.t-search:focus-within { border-color: var(--teal); box-shadow: var(--focus); }
.t-search svg { flex: none; }
.t-search-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--text); font-size: 13.5px; }
.t-search-input::placeholder { color: var(--text-3); }
.t-active { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.t-active-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; max-width: 100%; padding: 0 10px 0 12px;
  border-radius: var(--radius-pill); border: 1px solid var(--teal-line); background: var(--teal-soft);
  color: var(--text); font-size: 12.5px; cursor: pointer;
}
.t-active-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.t-active-chip svg { flex: none; color: var(--text-2); }
.t-active-clear { height: 32px; padding: 0 8px; border: 0; background: transparent; color: var(--teal); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.t-page[data-view="team"] .t-chipset,
.t-page[data-view="team"] .t-filters,
.t-page[data-view="team"] .t-filter-btn,
.t-page[data-view="team"] .t-search,
.t-page[data-view="team"] .t-active { display: none; }

.t-nomatch {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 8px 12px 8px 14px;
  border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--text-2); font-size: 14px;
}
.t-nomatch svg { color: var(--text-3); }

/* ---------- Board ---------- */
.t-colnav { display: none; }
.t-board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(252px, 1fr); gap: 12px;
  align-items: start; overflow-x: auto; min-width: 0; padding-bottom: 10px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.t-col {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.t-col.is-over { border-color: var(--teal-line); box-shadow: inset 0 0 0 1px var(--teal-line); }
.t-col-head { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 6px 2px 14px; }
.t-col-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.t-col-count { font: 500 11.5px var(--font-mono); color: var(--text-3); padding: 1px 7px; border-radius: var(--radius-pill); background: var(--surface-3); }
.t-col-add { color: var(--text-3); }
.t-col-list { display: flex; flex-direction: column; gap: 8px; min-height: 72px; padding: 6px 8px 10px; }
.t-col-empty {
  display: grid; place-items: center; min-height: 64px; padding: 12px; text-align: center;
  border: 1.5px dashed var(--line); border-radius: 12px; color: var(--text-3); font-size: 12.5px;
}
.t-col.is-over .t-col-empty { display: none; }
.t-col-more {
  height: 32px; margin: -4px 8px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-2); font-size: 13px; cursor: pointer;
}
.t-col-more:hover { background: var(--surface-2); color: var(--text); }
.t-skel-card { height: 86px; border-radius: 12px; }

.t-card {
  position: relative; display: flex; flex-direction: column; gap: 7px; min-width: 0;
  padding: 9px 10px 10px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .2s var(--ease), opacity .15s var(--ease);
}
.t-card:hover { border-color: var(--line-2); }
.t-card:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.t-card.is-selected { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.t-card.is-new { animation: t-flash 1.8s var(--ease); }
.t-card.is-pressing { transform: scale(.975); transition: transform .3s var(--ease); }
.t-card.is-source { display: none; }
.t-card.is-closed .t-card-title { color: var(--text-2); }
.t-card-edge { position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; }
.t-card-top { display: flex; align-items: center; gap: 6px; min-height: 20px; min-width: 0; font-size: 11.5px; color: var(--text-3); }
.t-card-id { font-size: 11px; flex: none; }
.t-card-proj { min-width: 0; }
.t-card-proj.is-inactive { color: var(--text-3); opacity: .8; }
.t-card-top .t-proj-off { height: 15px; padding: 0 5px; font-size: 10px; }
.t-card-lock { display: inline-flex; color: var(--text-3); }
.t-card-more {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; margin: -7px -6px -7px auto;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-3); cursor: pointer;
  transition: opacity .12s var(--ease), background .12s var(--ease);
}
.t-card-more:hover { background: var(--surface-3); color: var(--text); }
.t-card-title { font-size: 14px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.t-card-labels { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.t-card-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-height: 22px; min-width: 0; }
@media (hover: hover) {
  .t-card:not(.is-locked) { cursor: grab; }
  .t-card .t-card-more { opacity: 0; }
  .t-card:hover .t-card-more, .t-card:focus-within .t-card-more, .t-card-more:focus-visible { opacity: 1; }
}

/* The lifted card that follows the pointer, and the gap where it will land */
.t-card.t-ghost {
  position: fixed; left: 0; top: 0; z-index: 95; margin: 0; pointer-events: none;
  border-color: var(--teal-line); box-shadow: var(--shadow-pop), 0 0 0 1px var(--teal-line);
  cursor: grabbing; transition: none; will-change: transform; animation: none;
}
.t-card.t-ghost .t-card-more { opacity: 0; }
.t-card.t-ghost.is-settling { transition: transform .17s var(--ease), box-shadow .17s var(--ease); box-shadow: var(--shadow); }
.t-drop {
  flex: none; border-radius: 12px; border: 1.5px dashed var(--teal-line); background: var(--teal-soft);
  animation: t-grow .12s var(--ease);
}
.t-board.is-dragging { scroll-snap-type: none; }
body.t-dragging, body.t-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }

/* Column "+" */
.t-composer {
  display: flex; flex-direction: column; gap: 8px; margin: 4px 8px 2px; padding: 8px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--teal-line);
}
.t-composer-input { height: 38px; }
.t-composer-foot { display: flex; align-items: center; gap: 6px; }

/* ---------- List ---------- */
.t-list { overflow: hidden; }
.t-group + .t-group { border-top: 1px solid var(--line); }
.t-group-head {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 46px; padding: 8px 18px 8px 12px;
  border: 0; background: var(--surface-2); color: var(--text); font-size: 13.5px; font-weight: 600;
  text-align: left; cursor: pointer;
}
.t-group-head:hover { background: var(--surface-3); }
.t-group-chev { display: inline-flex; color: var(--text-3); }
.t-group-chev svg { transition: transform .15s var(--ease); }
.t-group:not(.is-collapsed) .t-group-chev svg { transform: rotate(90deg); }
.t-group-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-gdot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.t-gdot-none { border: 1px dashed var(--text-3); }
.t-glead { display: inline-flex; color: var(--text-3); }
.t-glead-late { color: var(--down); }
.t-glead-today, .t-glead-tomorrow { color: var(--lime-text); }
.t-glead-closed { color: var(--up); }
.t-rows { list-style: none; margin: 0; padding: 0; }
.t-lrow {
  display: grid; align-items: center; gap: 4px 10px; min-height: 48px; padding: 6px 18px 6px 10px;
  grid-template-columns: 32px 14px auto minmax(0, 1fr) auto auto minmax(22px, auto);
  grid-template-areas: "tick prio id title meta due who";
  border-top: 1px solid var(--line); cursor: pointer; transition: background .12s var(--ease);
}
.t-lrow:hover { background: var(--surface-2); }
.t-lrow:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.t-lrow.is-selected { background: var(--teal-soft); }
.t-lrow.is-new { animation: t-flash-row 2s var(--ease); }
.t-lrow > .t-tick { grid-area: tick; }
.t-lrow > .t-prio { grid-area: prio; }
.t-lrow-id { grid-area: id; font-size: 11.5px; color: var(--text-3); }
.t-lrow-title { grid-area: title; min-width: 0; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-lrow.is-closed .t-lrow-title { color: var(--text-3); }
.t-lrow-meta { grid-area: meta; display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; max-width: 340px; overflow: hidden; }
.t-lrow-due { grid-area: due; display: flex; justify-content: flex-end; }
.t-lrow > .avatar, .t-lrow > .t-people, .t-lrow-noav { grid-area: who; }
.t-lrow > .t-people { justify-self: end; }

.t-tick {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-3); cursor: pointer;
  transition: color .12s var(--ease), background .12s var(--ease);
}
.t-tick:hover:not(:disabled) { color: var(--up); background: var(--up-soft); }
.t-tick.is-on { color: var(--up); }
.t-tick:disabled { cursor: not-allowed; opacity: .5; }

/* ---------- Team ---------- */
.t-team-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.t-stat {
  display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.t-stat-n { font-family: var(--font-display); font-size: 38px; line-height: 1; }
.t-stat.is-bad { border-color: var(--down-soft); }
.t-stat.is-bad .t-stat-n { color: var(--down); }
.t-stat.is-good .t-stat-n { color: var(--up); }
.t-team-note { margin-top: -4px; }
.t-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.t-member {
  display: flex; flex-direction: column; gap: 12px; width: 100%; padding: 16px 18px;
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
  transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.t-member:hover { border-color: var(--teal-line); transform: translateY(-1px); }
.t-member:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.t-member.is-heavy { border-color: var(--warn-soft); }
.t-member-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.t-member-who { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.t-member-open { font-family: var(--font-display); font-size: 42px; line-height: 1; }
.t-bar { display: flex; height: 8px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; }
.t-bar i { display: block; height: 100%; transition: width .4s var(--ease); }
.t-bar-doing { background: var(--teal); }
.t-bar-open { background: var(--text-3); opacity: .55; }
.t-member-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 12.5px; }
.t-member-stats span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.t-member-stats svg { width: 12px; height: 12px; flex: none; }
.t-member-est { display: inline-flex; align-items: center; gap: 6px; margin-top: -4px; }

/* ---------- Dialogs ---------- */
.t-keys { display: flex; flex-direction: column; gap: 8px; }
.t-keys-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; font-size: 14px; }
.t-keys-row .kbd { justify-self: start; }
.t-words { display: flex; flex-direction: column; }
.t-words-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.t-words-row:last-child { border-bottom: 0; }
.t-words-row span { overflow-wrap: anywhere; color: var(--text-2); }
.t-pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; }
.form .t-pick-list { flex-direction: row; flex-wrap: wrap; gap: 4px 8px; max-height: none; }
.t-pick-row { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.t-pick-row:hover { background: var(--surface-2); }
.t-pick-row input { width: 18px; height: 18px; accent-color: var(--teal); }
.t-pick-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.t-manage-list { list-style: none; margin: 0; padding: 0; }
.t-manage-list li { display: flex; align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid var(--line); min-width: 0; }
.t-manage-list li:last-child { border-bottom: 0; }
.t-manage-list li.is-archived .t-manage-name, .t-manage-list li.is-archived .t-pick-dot,
.t-manage-list li.is-archived .t-manage-count { opacity: .55; }
.t-manage-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.t-manage-count { flex: none; white-space: nowrap; }

/* Active / Inactive switch (task projects) */
.t-switch {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 32px;
  padding: 0 4px; border-radius: 8px; cursor: pointer; font-size: 12.5px; color: var(--text-3); user-select: none;
}
.t-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.t-switch-track {
  position: relative; display: inline-block; width: 34px; height: 20px; flex: none;
  border-radius: var(--radius-pill); background: var(--surface-3); border: 1px solid var(--line-2);
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.t-switch-track i {
  position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-3); transition: transform .15s var(--ease), background .15s var(--ease);
}
.t-switch input:checked + .t-switch-track { background: var(--teal-soft); border-color: var(--teal-line); }
.t-switch input:checked + .t-switch-track i { transform: translateX(14px); background: var(--teal); }
.t-switch input:focus-visible + .t-switch-track { box-shadow: var(--focus); }
.t-switch input:disabled + .t-switch-track { opacity: .5; }
.t-switch.is-on .t-switch-text { color: var(--text-2); }
.t-switch-text { min-width: 52px; }
.t-quick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.t-quick-chip {
  height: 32px; padding: 0 11px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font-size: 12.5px; cursor: pointer;
}
.t-quick-chip:hover { color: var(--text); border-color: var(--text-3); }
.t-quick-chip.is-on { background: var(--teal-soft); border-color: var(--teal-line); color: var(--text); }

/* ================================================================ task panel */
.t-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; flex-direction: column; width: min(580px, 100vw);
  background: var(--surface); border-left: 1px solid var(--line-2); box-shadow: var(--shadow-pop);
  transform: translateX(104%); transition: transform .24s var(--ease); outline: none;
}
.t-drawer.is-open { transform: none; }
.t-drawer-head {
  display: flex; align-items: center; gap: 8px; min-height: 56px;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px 22px; border-bottom: 1px solid var(--line);
}
.t-drawer-crumbs { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.t-drawer-tools { display: flex; align-items: center; gap: 4px; }
.t-d-id { font-size: 12.5px; color: var(--text-3); }
.t-drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.t-d-pad { padding: 18px 22px 0; }
.t-d-top { padding-top: 20px; }
.t-d-title { font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.08; letter-spacing: -.01em; overflow-wrap: anywhere; }
.t-d-title-btn {
  display: block; width: calc(100% + 12px); margin: -3px -6px; padding: 3px 6px;
  border: 0; border-radius: 10px; background: transparent; color: inherit;
  font: inherit; letter-spacing: inherit; text-align: left; cursor: text;
}
.t-d-title-btn:hover { background: var(--surface-2); }
.t-d-title-btn.locked { pointer-events: none; }
.t-d-title-wrap { display: flex; flex-direction: column; gap: 4px; }
.t-d-title-input {
  width: calc(100% + 18px); resize: none; overflow: hidden; padding: 3px 8px; margin: -4px -9px 0;
  font-family: var(--font-display); font-size: 32px; line-height: 1.1; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--teal); border-radius: 10px; box-shadow: var(--focus); outline: none;
}
.t-d-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.t-d-status {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border-radius: var(--radius-pill); border: 1px solid var(--line-2); background: var(--surface-2);
  font-size: 13.5px; font-weight: 500;
}
.t-d-status > svg { color: var(--text-3); }
.t-d-status.is-select { cursor: pointer; padding-right: 10px; }
.t-d-status.is-select:focus-within { border-color: var(--teal); box-shadow: var(--focus); }
.t-d-status-select { appearance: none; border: 0; outline: none; background: transparent; color: inherit; font: inherit; cursor: pointer; padding-right: 2px; }
.t-d-status-select option, .t-sel option { background: var(--surface); color: var(--text); }
.t-d-lock { margin-bottom: 12px; }
.t-drawer .lock-only { display: none; }
.t-drawer .locked .lock-only { display: contents; }
.t-props { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 4px 14px; margin-top: 16px; }
.t-prop { display: contents; }
.t-prop-label { padding-top: 9px; font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.t-prop-val { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; min-height: 36px; font-size: 14px; }
.t-prop-ctl { display: contents; }
.t-ro { display: inline-flex; align-items: center; gap: 7px; min-width: 0; flex-wrap: wrap; }
.t-ctl-with-icon { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.t-sel {
  width: auto; max-width: 100%; height: 34px; padding: 0 32px 0 11px; font-size: 13.5px;
  background-position: calc(100% - 17px) 14px, calc(100% - 12px) 14px;
}
.t-chipline { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 0; }
.t-due-ctl, .t-repeat-ctl { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; max-width: 100%; padding: 2px 0; }
.t-due-inputs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.t-date { width: 158px; height: 34px; font-size: 13.5px; }
.t-time { width: 118px; height: 34px; font-size: 13.5px; }
.t-hint { max-width: 36ch; }
.t-ctl-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; max-width: 100%; }
.t-repeat-ctl .repeat-every { margin: 0; }

/* "Repeat every [N] months" + the next real dates (task panel, new-task dialog, payments form) */
.repeat-every { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 100%; margin: -4px 0 4px; }
.repeat-every[hidden] { display: none; }
.repeat-line { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; font-size: 14px; color: var(--text-2); cursor: default; }
.repeat-n { width: 70px; height: 34px; padding: 0 8px; font-size: 14px; text-align: center; }
.repeat-unit { min-width: 4ch; }
.repeat-dates {
  display: flex; align-items: flex-start; gap: 7px; min-width: 0; padding: 7px 10px;
  border-radius: 8px; background: var(--teal-soft); color: var(--text);
  font-size: 13px; line-height: 1.4; overflow-wrap: anywhere;
}
.repeat-dates svg { width: 13px; height: 13px; flex: none; margin-top: 2px; color: var(--teal); }
.repeat-dates.is-empty { background: var(--surface-2); color: var(--text-3); }
.repeat-dates.is-empty svg { color: var(--text-3); }

.t-d-sec { padding: 22px 22px 0; }
.t-d-sec-head { display: flex; align-items: center; gap: 8px; min-height: 32px; margin-bottom: 8px; }
.t-d-sec-title { font-size: 11.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--text-2); }
.t-d-count { font: 500 12px var(--font-mono); color: var(--text-3); }
.t-d-count.up { color: var(--up); }
.t-d-desc { padding-left: 0; padding-right: 0; }
.t-desc { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.6; }
.t-desc a, .t-comment-body a { overflow-wrap: anywhere; }
.t-desc-input { min-height: 140px; }
.t-add-line {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; margin-left: -10px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-3); font-size: 13.5px; cursor: pointer;
}
.t-add-line:hover { color: var(--text); background: var(--surface-2); }

.t-progress { height: 6px; margin-bottom: 8px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; }
.t-progress i { display: block; height: 100%; background: var(--teal); transition: width .3s var(--ease); }
.t-progress.full i { background: var(--up); }
.t-check-list { list-style: none; margin: 0; padding: 0; }
.t-check-item { display: flex; align-items: center; gap: 4px; min-height: 38px; padding-right: 2px; border-radius: 8px; }
.t-check-item:hover { background: var(--surface-2); }
.t-check-item .t-tick svg { width: 18px; height: 18px; }
.t-check-text {
  flex: 1; min-width: 0; padding: 6px 4px; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 14px; text-align: left; overflow-wrap: anywhere;
}
.t-check-text.is-editable { cursor: text; }
.t-check-item.is-done .t-check-text { color: var(--text-3); text-decoration: line-through; }
.t-check-edit { height: 34px; flex: 1; min-width: 0; }
.t-check-addrow { display: flex; align-items: center; gap: 8px; padding-left: 8px; margin-top: 2px; color: var(--text-3); }
.t-check-add { height: 38px; background: transparent; border-color: transparent; }
.t-check-add:hover { border-color: var(--line-2); }
@media (hover: hover) {
  .t-row-tool { opacity: 0; transition: opacity .12s var(--ease); }
  .t-check-item:hover .t-row-tool, .t-comment:hover .t-row-tool, .t-row-tool:focus-visible { opacity: 1; }
}

.t-comments { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.t-comment { display: flex; gap: 10px; min-width: 0; }
.t-comment > .avatar { margin-top: 5px; }
.t-comment-main { flex: 1; min-width: 0; }
.t-comment-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-height: 32px; font-size: 12.5px; }
.t-comment-meta b { font-size: 13.5px; font-weight: 600; }
.t-comment-body {
  padding: 9px 12px; border-radius: 4px 14px 14px 14px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
}
.t-comment-new { display: flex; align-items: flex-start; gap: 10px; }
.t-comment-new > .avatar { margin-top: 10px; }
.t-comment-box { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.t-comment-input { min-height: 64px; }
.t-comment-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.t-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.t-events li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 5px 0; font-size: 13px; color: var(--text-2); }
.t-ev-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-3); }
.t-ev-text { padding-top: 3px; overflow-wrap: anywhere; }
.t-ev-text b { color: var(--text); font-weight: 600; }
.t-events li > .tiny { padding-top: 5px; }

.t-d-foot {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin: 26px 22px 0; padding-top: 18px; border-top: 1px solid var(--line);
}

/* ================================================================ motion */
@keyframes t-flash {
  0% { box-shadow: 0 0 0 3px var(--teal); background: var(--teal-soft); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes t-flash-row { 0% { background: var(--teal-soft); } 100% { background: transparent; } }
@keyframes t-pulse { 0% { box-shadow: 0 0 0 0 var(--teal-line); } 100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes t-grow { from { opacity: 0; transform: scaleY(.6); } }

/* ================================================================ smaller screens */
@media (max-width: 1100px) {
  .t-team-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  /* The last column grows with the avatars (lead + helpers), as on wide screens: a fixed 22px let them cover the deadline. */
  .t-lrow { grid-template-columns: 32px 14px minmax(0, 1fr) auto auto minmax(22px, auto); grid-template-areas: "tick prio title meta due who"; }
  .t-lrow-id { display: none; }
  .t-lrow-meta { max-width: 200px; }
}

@media (max-width: 700px) {
  .t-qa { height: 50px; padding-left: 12px; }
  .t-qa-input { font-size: 16px; }   /* 16px stops phones from zooming in */
  .t-qa-kbd, .t-search-kbd { display: none; }
  .t-bar-row { gap: 8px; }
  .t-views { width: 100%; }
  .t-views .tab { flex: 1; justify-content: center; }
  .t-chipset { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; width: calc(100% + 32px); }
  .t-chipset::-webkit-scrollbar { display: none; }
  .t-filters { display: none; }
  .t-filter-btn { display: inline-flex; }
  .t-listopts .t-osel, .t-listopts .t-closed { display: none; }
  .t-search { flex: 1 1 160px; min-width: 0; }
  .t-search-input { font-size: 16px; }

  .t-colnav {
    display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
    margin: 0 -16px; padding: 0 16px;
  }
  .t-colnav::-webkit-scrollbar { display: none; }
  .t-colnav-btn {
    flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
    border-radius: var(--radius-pill); border: 1px solid var(--line-2); background: transparent;
    color: var(--text-2); font-size: 13px; white-space: nowrap; cursor: pointer;
  }
  .t-colnav-btn.active { background: var(--surface-3); border-color: var(--text-3); color: var(--text); }
  .t-colnav-n { font-size: 11.5px; color: var(--text-3); }
  .t-board {
    grid-auto-columns: 86%; gap: 10px; margin: 0 -16px; padding: 0 16px 10px;
    scroll-snap-type: x mandatory; scroll-padding: 0 16px; overscroll-behavior-x: contain; scrollbar-width: none;
  }
  .t-board::-webkit-scrollbar { display: none; }
  .t-col { scroll-snap-align: start; }

  .t-lrow {
    grid-template-columns: 32px 14px minmax(0, 1fr) auto;
    grid-template-areas: "tick title title who" "tick prio meta due";
    padding: 8px 12px 8px 6px;
  }
  .t-lrow-title { white-space: normal; overflow-wrap: anywhere; }
  .t-lrow-meta { justify-content: flex-start; max-width: none; }
  .t-group-head { padding-left: 8px; padding-right: 12px; }

  .t-team-sum { gap: 8px; }
  .t-stat { padding: 12px 14px; }
  .t-stat-n { font-size: 30px; }
  .t-team { grid-template-columns: minmax(0, 1fr); }

  /* The task panel becomes a full-screen sheet */
  .t-drawer { width: 100%; border-left: 0; transform: translateY(102%); }
  .t-drawer.is-open { transform: none; }
  .t-drawer-head { padding-left: 16px; padding-right: 8px; }
  .t-d-pad, .t-d-sec { padding-left: 16px; padding-right: 16px; }
  .t-d-foot { margin-left: 16px; margin-right: 16px; }
  .t-d-title, .t-d-title-input { font-size: 27px; }
  .t-props { grid-template-columns: 94px minmax(0, 1fr); gap: 4px 10px; }
  .t-date { width: 150px; }
  .t-time { width: 124px; }
  /* 16px in every box you can type in or pick from: phones (iOS Safari) zoom in on smaller text */
  .t-drawer .input, .t-drawer .textarea, .t-drawer .select,
  .t-sel, .t-date, .t-time, .repeat-n, .t-fsel, .t-d-status-select,
  .t-composer-input, .t-check-add, .t-check-edit, .t-comment-input { font-size: 16px; }
  /* Projects dialog: room for the name next to the switch and the buttons */
  .t-manage-list li { gap: 6px; }
  .t-manage-count, .t-switch-text { display: none; }
}

/* A small phone (375 px): the four views fit as words without their icons (Board, List, Timeline, Workload). */
@media (max-width: 420px) {
  .t-views .tab { padding: 0 8px; }
  .t-views .tab svg { display: none; }
}

@media (hover: none) {
  .t-keys-btn, .t-qa-kbd, .t-search-kbd { display: none; }
}
