/* The task tracker — every rule for it, in one file.
 *
 * It used to be split between here and styles.css, with this file winning by
 * load order, so changing a row meant finding which of two rules was the live
 * one. Everything `.tk-*` now lives here.
 *
 * Colour comes from the tokens in styles.css and from nowhere else: a status
 * or a tag takes one of the data hues (or an avatar hue) and derives its tint
 * with color-mix, so both themes follow without a second set of rules.
 *
 * Layout answers to the width of the tracker itself, not of the window
 * (`@container tracker`): the same pane is narrow on a phone, and narrow on a
 * laptop with the rail open and a task's panel beside it.
 */

:root {
  --tk-backlog: var(--data-grey);
  --tk-todo: var(--data-amber);
  --tk-in_progress: var(--data-blue);
  --tk-blocked: var(--data-red);
  /* Done by agent: the colour of done, drawn half-full — finished, not yet
     confirmed. No fifth hue: the label says the rest. */
  --tk-agent_done: var(--data-green);
  --tk-done: var(--data-green);
  --tk-backlog-ink: var(--text-quiet);
  --tk-todo-ink: var(--data-amber-ink);
  --tk-in_progress-ink: var(--data-blue-ink);
  --tk-blocked-ink: var(--data-red-ink);
  --tk-agent_done-ink: var(--data-green-ink);
  --tk-done-ink: var(--data-green-ink);
  --tk-row-h: 38px;
  --tk-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  /* Surfaces and lines derived from the few tokens every palette defines
     (--bg-soft, --card, --text, --border). The workspace stylesheet re-tints
     those and leaves the rest of the scale warm, so anything taken from the
     wider scale would sit a shade off the page it is on. */
  --tk-sunken: var(--bg-soft);
  --tk-foot: color-mix(in srgb, var(--bg-soft) 55%, var(--card));
  --tk-hover: color-mix(in srgb, var(--text) 7%, transparent);
  --tk-hover-soft: color-mix(in srgb, var(--text) 3.5%, transparent);
  --tk-line: color-mix(in srgb, var(--text-soft) 42%, var(--border));
}

/* ---------- the pane ---------- */

/* The tracker takes the centre like analytics does. */
.tracker-view #doc-pane, .tracker-view #comments-pane, .tracker-view #needs-pane { display: none; }
.tracker-view { grid-template-columns: var(--rail-w) minmax(0, 1fr) !important; overflow: hidden; }
@media (max-width: 1023px) and (min-width: 769px) { .tracker-view { grid-template-columns: minmax(0, 1fr) !important; } }

#tracker-pane {
  container: tracker / inline-size;
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 var(--font-ui);
}
/* Everything but the panel: the header, the tools and the view. Its own
   container, because it is what narrows when a task opens beside it. */
.tk-main {
  container: tkmain / inline-size;
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0 clamp(14px, 2cqw, 28px);
}
#tracker-pane button, .tk-menu button, .tk-help button { font-family: inherit; }
#tracker-pane :focus-visible, .tk-menu :focus-visible, .tk-help :focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#tracker-pane .ic, .tk-menu .ic, .tk-drag-ghost .ic, .tk-help .ic { width: 14px; height: 14px; flex: none; }

.tk-icon-btn {
  display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 8px; background: none; color: var(--text-quiet); cursor: pointer;
}
.tk-icon-btn:hover { background: var(--tk-hover); color: var(--text); }
.tk-icon-btn[aria-pressed="true"] { background: var(--accent-tint); color: var(--accent); }
.tk-quiet { color: var(--text-faint); font-size: 12px; }

/* ---------- header ---------- */

.tk-top { flex: none; display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.tk-title-block { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; }
#tracker-pane h1 { margin: 0; font: 650 19px/1.2 var(--font-ui); letter-spacing: -0.02em; white-space: nowrap; }
.tracker-repo-box { min-width: 0; }
.tk-project-btn {
  display: inline-flex; align-items: center; gap: 6px; max-width: 240px; padding: 5px 8px 5px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text-mid);
  font-size: 12.5px; font-weight: 550; cursor: pointer;
}
.tk-project-btn > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-project-btn:hover { border-color: var(--tk-line); color: var(--text); }
.tk-project-btn .ic:last-child { color: var(--text-faint); }

.tk-overview { flex: 1 1 auto; display: flex; align-items: center; justify-content: safe center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tk-overview::-webkit-scrollbar { display: none; }
.tk-stat {
  display: inline-flex; align-items: baseline; gap: 6px; flex: none; padding: 6px 10px;
  border: 0; border-radius: 8px; background: none; color: var(--text-quiet); font-size: 12px; cursor: pointer; white-space: nowrap;
}
.tk-stat strong { font-size: 15px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.tk-stat:hover:not(:disabled) { background: var(--tk-hover); color: var(--text); }
.tk-stat[aria-pressed="true"] { background: var(--accent-tint); color: var(--accent); }
.tk-stat[aria-pressed="true"] strong { color: var(--accent); }
.tk-stat.bad strong { color: var(--data-red-ink); }
.tk-stat.warn strong { color: var(--data-amber-ink); }
.tk-stat.good strong { color: var(--data-green-ink); }
.tk-stat.s-agent_done strong { color: var(--tk-agent_done-ink); }
.tk-stat:disabled { cursor: default; opacity: 0.7; }
.tk-meter { display: inline-flex; align-items: center; gap: 7px; flex: none; margin-left: 8px; padding-left: 14px; border-left: 1px solid var(--border); color: var(--text-faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tk-meter-bar { width: 72px; height: 6px; border-radius: 3px; background: var(--tk-sunken); overflow: hidden; }
.tk-meter-bar > span { display: block; height: 100%; border-radius: 3px; background: var(--data-green); transition: width 0.4s var(--tk-ease); }

.tk-top-actions { display: flex; align-items: center; gap: 4px; flex: none; margin-left: auto; }
#tk-add-focus { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding: 7px 13px; font-size: 12.5px; white-space: nowrap; }
#tk-add-focus .ic { width: 13px; height: 13px; }
.tk-btn-icon { display: inline-flex; }

.tk-intro { flex: none; margin: 8px 0 0; padding: 7px 11px; border-radius: 8px; background: var(--tk-sunken); color: var(--text-quiet); font-size: 12px; }

/* ---------- toolbar ---------- */

.tk-toolbar { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 0 0; min-width: 0; }
.tk-views { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.tk-views::-webkit-scrollbar { display: none; }
.tk-tab {
  display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 11px; border: 0; border-radius: 8px;
  background: none; color: var(--text-quiet); font-size: 12.5px; font-weight: 550; cursor: pointer; white-space: nowrap;
}
.tk-tab:hover { background: var(--tk-hover); color: var(--text); }
.tk-tab.active { background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--border), var(--e1); }
.tk-tab.active .ic { color: var(--accent); }
.tk-saved-views { display: inline-flex; align-items: center; gap: 2px; }
.tk-saved-views:not(:empty) { margin-left: 6px; padding-left: 8px; border-left: 1px solid var(--border); }
.tk-tab.tk-saved > span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.tk-tab.tk-saved .ic { width: 12px; height: 12px; }
.tk-saved-menu { padding: 6px; }
.tk-tab.tk-saved.changed::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--data-amber); }

.tk-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; }
.tk-search-box { display: flex; align-items: center; gap: 7px; flex: 0 1 250px; min-width: 110px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text-faint); }
.tk-search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.tk-search-icon { display: inline-flex; }
#tk-search { flex: 1; min-width: 0; margin: 0; padding: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; }
#tk-search::placeholder { color: var(--text-faint); }
.tk-tool-buttons { display: flex; align-items: center; gap: 4px; }
.tk-tool {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 32px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px;
  background: none; color: var(--text-quiet); font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.tk-tool:hover, .tk-tool[aria-expanded="true"] { background: var(--tk-hover); color: var(--text); }
.tk-tool b { font-weight: 600; color: var(--text); }

/* ---------- filters ---------- */

.tk-filters { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 9px 0 0; }
.tk-presets, .tk-fchips, .tk-view-save { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.tk-view-save { margin-left: auto; }
.tk-preset, .tk-add-filter, .tk-clear-filters, .tk-save-view {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px;
  border: 1px solid var(--border); background: var(--card); color: var(--text-quiet); font-size: 12px; cursor: pointer; white-space: nowrap;
}
.tk-preset:hover, .tk-add-filter:hover, .tk-save-view:hover { border-color: var(--tk-line); color: var(--text); }
.tk-preset.active { border-color: transparent; background: var(--text); color: var(--bg); font-weight: 550; }
.tk-add-filter { border-style: dashed; }
.tk-clear-filters { border-color: transparent; background: none; text-decoration: underline; text-underline-offset: 2px; }
.tk-save-view { border-color: transparent; background: none; }
.tk-save-view .ic, .tk-add-filter .ic { width: 12px; height: 12px; }
.tk-fchip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 4px 0 10px; border-radius: 13px; background: var(--accent-tint); color: var(--accent); font-size: 12px; white-space: nowrap; max-width: 100%; }
.tk-fchip-k { opacity: 0.75; }
.tk-fchip-v { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.tk-fchip button { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.tk-fchip button:hover { background: var(--accent-tint); }
.tk-fchip button .ic { width: 11px; height: 11px; }

/* ---------- quick add ---------- */

.tk-composer { flex: none; display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; padding: 7px 8px 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.tk-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.tk-composer-plus { display: grid; place-items: center; flex: none; width: 24px; height: 24px; margin-top: 2px; border-radius: 6px; background: var(--accent-tint); color: var(--accent); }
.tk-composer-field { flex: 1; min-width: 0; }
#tk-new-title { display: block; width: 100%; margin: 0; padding: 4px 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 13.5px; }
#tk-new-title::placeholder { color: var(--text-faint); }
.tk-new-preview { display: flex; flex-wrap: wrap; gap: 5px; }
.tk-new-preview:not(:empty) { padding: 3px 0 2px; }
.tk-qchip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--tk-sunken); color: var(--text-mid); font-size: 11.5px; white-space: nowrap; }
.tk-qchip .ic { width: 11px; height: 11px; }
.tk-qchip.person { padding-left: 3px; }
.tk-qchip.person .avatar { width: 16px; height: 16px; font-size: 7.5px; }
.tk-qchip.unknown { background: var(--attn-bg); color: var(--attn-text); }
.tk-qchip.p-urgent { color: var(--data-red-ink); }
.tk-qchip.p-high { color: var(--data-amber-ink); }
.tk-qchip.p-low { color: var(--data-blue-ink); }
#tk-add-task { flex: none; padding: 5px 10px; font-size: 12px; }
#tk-add-task kbd { margin-left: 5px; color: var(--text-faint); font: inherit; }

.tk-result-info { flex: none; padding: 8px 2px 6px; color: var(--text-faint); font-size: 11.5px; }

/* ---------- body ---------- */

.tk-body { flex: 1 1 auto; min-height: 0; display: flex; }
/* The views answer to the width they are actually given (`tkview`), which is
   the pane's less the panel docked beside them. */
.tk-scroll { container: tkview / inline-size; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: auto; padding-bottom: 28px; scrollbar-gutter: stable; }
#tracker-pane[data-view="board"] .tk-scroll, #tracker-pane[data-view="timeline"] .tk-scroll { overflow: hidden; padding-bottom: 12px; scrollbar-gutter: auto; }

.tk-empty { padding: 6px 0; }
.tk-none { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 520px; margin: 7vh auto 0; padding: 30px 24px; text-align: center; color: var(--text-quiet); font-size: 13px; line-height: 1.6; }
.tk-none strong { color: var(--text); font-size: 16px; font-weight: 650; }
.tk-none p { margin: 0 0 8px; }
.tk-none code { padding: 1px 5px; border-radius: 4px; background: var(--tk-sunken); font: 12px var(--font-mono); }
.tk-none-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 4px; border-radius: 12px; background: var(--accent-tint); color: var(--accent); }
.tk-none-icon .ic { width: 18px !important; height: 18px !important; }
.tk-none-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tk-skeleton { display: grid; border: 1px solid var(--border); border-radius: 10px; background: var(--card); overflow: hidden; }
.tk-skel-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) 90px 70px; align-items: center; gap: 14px; height: var(--tk-row-h); padding: 0 14px; border-bottom: 1px solid var(--border-soft); }
.tk-skel-row:last-child { border-bottom: 0; }
.tk-skel-row > span { display: block; height: 9px; border-radius: 4px; background: linear-gradient(100deg, var(--bg-soft) 20%, var(--border) 48%, var(--bg-soft) 76%); background-size: 250% 100%; animation: ui-shimmer 1.7s ease-in-out infinite; }
.tk-skel-row > span:first-child { width: 16px; height: 16px; border-radius: 50%; }

/* ---------- chips every view draws ---------- */

.tk-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--data-grey)); }
.s-backlog { --c: var(--tk-backlog); --ink: var(--tk-backlog-ink); }
.s-todo { --c: var(--tk-todo); --ink: var(--tk-todo-ink); }
.s-in_progress { --c: var(--tk-in_progress); --ink: var(--tk-in_progress-ink); }
.s-blocked { --c: var(--tk-blocked); --ink: var(--tk-blocked-ink); }
.s-agent_done { --c: var(--tk-agent_done); --ink: var(--tk-agent_done-ink); }
.s-done { --c: var(--tk-done); --ink: var(--tk-done-ink); }
/* Drawn from --c, so a project's own colour (set inline) shapes these the same way. */
.tk-dot.s-backlog { background: none; box-shadow: inset 0 0 0 1.5px var(--c); }
.tk-dot.s-agent_done { background: linear-gradient(90deg, var(--c) 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px var(--c); }

/* The dialog a project's own statuses are managed in (tracker-menus.js):
   the New-task dialog's shape — small heading, the project as the title,
   sections, a footer — and a small table for the project's own rows. */
/* .tk-help's own width rule comes later in this file; the class pair outranks it. */
.tk-help.tk-statuses { width: min(640px, calc(100vw - 32px)); }
.tk-statuses-form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.tk-statuses-body { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 18px; padding: 0 20px 18px; }
.tk-statuses-project { margin: 0; font: 650 21px/1.3 var(--font-ui); letter-spacing: -0.02em; color: var(--text); }
.tk-statuses-section h3 { margin: 0 0 8px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-quiet); }
.tk-statuses-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-statuses-chips .tk-status { white-space: nowrap; }
.tk-statuses-note { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--text-quiet); }
.tk-statuses-note em { font-style: normal; color: var(--text-mid); font-weight: 600; }
.tk-statuses-grid { display: flex; flex-direction: column; gap: 6px; }
.tk-statuses-cols, .tk-statuses-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) 160px 36px 30px; align-items: center; gap: 10px; }
.tk-statuses-cols { padding: 0 0 2px; font-size: 11px; font-weight: 600; color: var(--text-faint); letter-spacing: 0.02em; }
.tk-statuses-row input[type="text"], .tk-statuses-row select { font: 13px/1.4 var(--font-ui); padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); min-width: 0; }
.tk-statuses-row input[type="text"]:focus, .tk-statuses-row select:focus { outline: none; border-color: var(--accent); }
.tk-statuses-color { position: relative; display: block; width: 36px; height: 32px; }
.tk-statuses-color input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.tk-statuses-swatch { display: block; width: 100%; height: 100%; border-radius: 8px; border: 1px solid var(--border); background: var(--c); pointer-events: none; }
.tk-statuses-empty { margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; color: var(--text-quiet); }
.tk-statuses-add { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; }
.tk-statuses-add svg { width: 14px; height: 14px; }
.tk-statuses-warn { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--tk-sunken, var(--bg-soft)); font-size: 12.5px; line-height: 1.6; color: var(--text-mid); }
.tk-statuses-warn .tk-status { margin: 0 2px; }
.tk-statuses-error { margin: 0; font-size: 12.5px; color: var(--danger, #e06c5a); }
@media (max-width: 560px) {
  /* Two lines per status: the name with its colour and remove button, then
     what it behaves as — placed by hand, or the grid's auto-flow puts the
     colour under the dot a line later. */
  .tk-statuses-cols { display: none; }
  .tk-statuses-row { grid-template-columns: 14px minmax(0, 1fr) 36px 30px; grid-template-rows: auto auto; row-gap: 6px; }
  .tk-statuses-row .tk-dot { grid-area: 1 / 1; }
  .tk-statuses-row input[type="text"] { grid-area: 1 / 2; }
  .tk-statuses-row .tk-statuses-color { grid-area: 1 / 3; }
  .tk-statuses-row .tk-icon-btn { grid-area: 1 / 4; }
  .tk-statuses-row select { grid-area: 2 / 2 / 3 / -1; }
}

.tk-status {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 24px; padding: 0 9px 0 8px; border: 0; border-radius: 12px;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--ink); font-size: 12px; font-weight: 550; white-space: nowrap; cursor: pointer;
}
.tk-status > span:last-child { overflow: hidden; text-overflow: ellipsis; }
button.tk-status:hover { background: color-mix(in srgb, var(--c) 26%, transparent); }
.tk-status.bare { padding: 0; background: none; cursor: default; }
.assigned-row .tk-status { cursor: default; }

.tk-priority { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--text-mid); font-size: 12px; cursor: pointer; white-space: nowrap; }
button.tk-priority:hover { background: var(--tk-hover); }
.tk-priority .ic { color: var(--pc, var(--text-faint)); }
.tk-priority.p-urgent { --pc: var(--data-red-ink); }
.tk-priority.p-urgent .ic, .tk-priority.p-high .ic { fill: color-mix(in srgb, var(--pc) 28%, transparent); }
.tk-priority.p-high { --pc: var(--data-amber-ink); }
.tk-priority.p-normal { --pc: var(--text-faint); color: var(--text-quiet); }
.tk-priority.p-low { --pc: var(--data-blue-ink); color: var(--text-quiet); }
.tk-priority.bare { padding: 0 3px; }
.tk-priority.bare > span { display: none; }

.tk-avatars { display: inline-flex; align-items: center; }
.tk-avatars > * { margin-left: -6px; box-shadow: 0 0 0 2px var(--card); }
.tk-avatars > *:first-child { margin-left: 0; }
#tracker-pane .avatar.sm, .tk-menu .avatar.sm, .tk-drag-ghost .avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.tk-people-more { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--tk-sunken); color: var(--text-quiet); font-size: 10px; font-weight: 650; }
.tk-assign { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 26px; padding: 0 6px 0 2px; border: 0; border-radius: 13px; background: none; color: var(--text-mid); font-size: 12px; cursor: pointer; }
.tk-assign:hover { background: var(--tk-hover); }
.tk-assign-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-assign-none { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border: 1px dashed var(--tk-line); border-radius: 50%; color: var(--text-faint); }
.tk-assign-none .ic { width: 11px !important; height: 11px !important; }
.tk-assign.empty { color: var(--text-faint); }

.tk-date { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 7px; border: 0; border-radius: 7px; background: none; color: var(--text-mid); font-size: 12px; cursor: pointer; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tk-date:hover { background: var(--tk-hover); }
.tk-date .ic { width: 12px; height: 12px; color: var(--text-faint); }
.tk-date.d-overdue { background: color-mix(in srgb, var(--data-red) 14%, transparent); color: var(--data-red-ink); font-weight: 600; }
.tk-date.d-overdue .ic { color: inherit; }
.tk-date.d-today { background: color-mix(in srgb, var(--data-amber) 20%, transparent); color: var(--data-amber-ink); font-weight: 600; }
.tk-date.d-today .ic { color: inherit; }
.tk-date.d-soon { color: var(--data-amber-ink); }
.tk-date.d-done { color: var(--text-faint); }
.tk-date-none { display: inline-flex; align-items: center; gap: 5px; color: var(--text-faint); }

.tk-tags { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.tk-tag { display: inline-block; flex: none; max-width: 110px; padding: 1px 7px; border-radius: 5px; background: color-mix(in srgb, var(--h) 15%, transparent); color: color-mix(in srgb, var(--h) 70%, var(--text)); font-size: 11px; font-weight: 550; line-height: 1.55; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-0 { --h: var(--av-1); } .h-1 { --h: var(--av-2); } .h-2 { --h: var(--av-3); } .h-3 { --h: var(--av-4); } .h-4 { --h: var(--av-5); } .h-5 { --h: var(--av-6); }
.tk-tag.more { --h: var(--data-grey); }
.tk-tag-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--h); }
.tk-due-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--data-grey); }
.tk-due-dot.d-overdue { background: var(--data-red); } .tk-due-dot.d-today { background: var(--data-amber); } .tk-due-dot.d-week { background: var(--data-blue); }
.tk-tags-cell { display: inline-flex; align-items: center; max-width: 100%; min-height: 24px; padding: 0 4px; border: 0; border-radius: 7px; background: none; cursor: pointer; }
.tk-tags-cell:hover { background: var(--tk-hover); }

.tk-mark, .tk-progress { display: inline-flex; align-items: center; gap: 3px; flex: none; color: var(--text-faint); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tk-mark .ic { width: 12px; height: 12px; }
.tk-mark.blocked { color: var(--data-red-ink); }
.tk-mark.warn { color: var(--data-amber-ink); }
.tk-mark.source { color: var(--accent); }
.tk-mark.remind { color: var(--accent); }
.tk-progress.complete { color: var(--data-green-ink); }
.tk-ring { width: 12px; height: 12px; border-radius: 50%; background: conic-gradient(var(--data-green) calc(var(--pct) * 1%), var(--border-strong) 0); -webkit-mask: radial-gradient(circle, transparent 3.2px, var(--text) 3.6px); mask: radial-gradient(circle, transparent 3.2px, var(--text) 3.6px); }

.tk-done-btn { display: inline-grid; place-items: center; flex: none; width: 17px; height: 17px; padding: 0; border: 1.5px solid var(--tk-line); border-radius: 50%; background: none; color: var(--on-data-green); cursor: pointer; }
.tk-done-btn:hover { border-color: var(--data-green); background: color-mix(in srgb, var(--data-green) 18%, transparent); }
.tk-done-btn.s-in_progress { border-color: var(--tk-in_progress); }
.tk-done-btn.s-blocked { border-color: var(--tk-blocked); }
.tk-done-btn.s-agent_done { border-color: var(--data-green); border-style: dashed; }
.tk-done-btn.s-done { border-color: var(--data-green); background: var(--data-green); }
.tk-done-btn .ic { width: 10px !important; height: 10px !important; stroke-width: 3.2; }
.tk-done-btn.lg { width: 22px; height: 22px; }
.tk-done-btn.lg .ic { width: 13px !important; height: 13px !important; }

.tk-row-btn { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text-faint); cursor: pointer; }
.tk-row-btn:hover { background: var(--tk-hover); color: var(--text); }
.tk-row-btn .ic { width: 13px; height: 13px; }
.tk-check { flex: none; width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; }

/* ---------- list ---------- */

.tk-list { min-width: var(--tk-min, 0); }
.tk-head-row, .tk-row { display: grid; grid-template-columns: var(--tk-grid); align-items: center; column-gap: 8px; padding: 0 10px 0 4px; }
.tk-head-row { position: sticky; top: 0; z-index: 4; height: 30px; background: var(--bg); border-bottom: 1px solid var(--border); }
.tk-head-btn { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 6px; margin-left: -6px; border: 0; border-radius: 6px; background: none; color: var(--text-faint); font-size: 11.5px; font-weight: 600; cursor: pointer; }
button.tk-head-btn:hover, .tk-head-btn.on { color: var(--text); background: var(--tk-hover); }
.tk-head-btn.static { cursor: default; }
.tk-c { display: flex; align-items: center; min-width: 0; }
.tk-c-lead { gap: 4px; justify-content: flex-end; }
.tk-c-more { justify-content: flex-end; }
.tk-c-title { gap: 7px; }
.tk-head-row .tk-c-title { padding-left: 49px; }

.tk-group { margin-top: 14px; }
.tk-group-head { position: sticky; top: 30px; z-index: 3; display: flex; align-items: center; gap: 4px; height: 34px; background: var(--bg); }
.tk-group-toggle { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px 0 4px; border: 0; border-radius: 7px; background: none; color: var(--text); cursor: pointer; }
.tk-group-toggle:hover { background: var(--tk-hover); }
.tk-chevron { display: inline-flex; color: var(--text-faint); transition: transform 0.15s var(--tk-ease); }
[aria-expanded="true"] > .tk-chevron { transform: rotate(90deg); }
.tk-chevron .ic { width: 12px; height: 12px; }
.tk-group-lead { display: inline-flex; align-items: center; }
.tk-group-lead:empty { display: none; }
.tk-group-label { font-size: 13px; font-weight: 650; }
.tk-group-count { color: var(--text-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.tk-group-add-btn { opacity: 0; }
.tk-group-head:hover .tk-group-add-btn, .tk-group-add-btn:focus-visible { opacity: 1; }
.tk-group-rows { border: 1px solid var(--border); border-radius: 10px; background: var(--card); overflow: clip; }

.tk-row { position: relative; min-height: var(--tk-row-h); border-bottom: 1px solid var(--border-soft); cursor: pointer; outline-offset: -2px; }
.tk-row:hover { background: var(--tk-hover-soft); }
.tk-row.selected { background: var(--accent-wash); }
.tk-row.is-open { background: var(--accent-wash); box-shadow: inset 2px 0 0 var(--accent); }
.tk-row.cursor { box-shadow: inset 2px 0 0 var(--tk-line); }
.tk-row.done .tk-title { color: var(--text-faint); text-decoration: line-through; text-decoration-color: var(--tk-line); }
.tk-row.tk-sub { background: var(--tk-foot); }
.tk-row.tk-sub .tk-c-title { padding-left: 26px; }
.tk-row.tk-sub .tk-title { font-weight: 400; }
.tk-grip, .tk-grip-space { display: inline-grid; place-items: center; width: 16px; height: 24px; flex: none; }
.tk-grip { color: var(--text-faint); cursor: grab; opacity: 0; touch-action: none; }
.tk-grip .ic { width: 12px; height: 12px; }
.tk-row:hover .tk-grip, .tk-row:focus-within .tk-grip { opacity: 0.7; }
.tk-row .tk-check, .tk-head-row .tk-check, .tk-card .tk-check { opacity: 0; }
.tk-row:hover .tk-check, .tk-row.selected .tk-check, .tk-row:focus-within .tk-check, .tk-head-row:hover .tk-check, .tk-check:checked, .tk-check:focus-visible,
.tk-selecting .tk-check, .tk-card:hover .tk-check, .tk-card:focus-within .tk-check { opacity: 1; }
@media (hover: none) { .tk-row .tk-check, .tk-head-row .tk-check, .tk-card .tk-check { opacity: 1; } .tk-grip { opacity: 0.55; } }
.tk-expander, .tk-expander-space { display: inline-grid; place-items: center; flex: none; width: 18px; height: 22px; }
.tk-expander { padding: 0; border: 0; border-radius: 5px; background: none; color: var(--text-faint); cursor: pointer; transition: transform 0.15s var(--tk-ease); }
.tk-expander:hover { background: var(--tk-hover); color: var(--text); }
.tk-expander.open { transform: rotate(90deg); }
.tk-expander .ic { width: 12px; height: 12px; }
.tk-title { flex: 0 1 auto; min-width: 0; padding: 4px 0; border: 0; background: none; color: var(--text); font-size: 13.5px; font-weight: 500; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.tk-title:hover { color: var(--accent); }
.tk-title-input { flex: 1; min-width: 80px; height: 28px; margin: 0; padding: 0 7px; border: 1px solid var(--accent); border-radius: 6px; background: var(--card); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 500; box-shadow: 0 0 0 3px var(--accent-tint); outline: 0; }
.tk-title-marks { display: inline-flex; align-items: center; gap: 8px; flex: none; min-width: 0; }
.tk-rename-btn { opacity: 0; }
.tk-row:hover .tk-rename-btn, .tk-rename-btn:focus-visible { opacity: 1; }
.tk-c-more .tk-row-btn { opacity: 0.35; }
.tk-row:hover .tk-c-more .tk-row-btn, .tk-c-more .tk-row-btn:focus-visible { opacity: 1; }

/* A long list or a big board: the browser is told it need not lay out or paint
   what is off screen. Without this every redraw paid for every row — three
   quarters of the cost of ticking one box in a list of five hundred. Only
   past a size where that cost is felt, because containment also clips
   anything a row draws outside its own box. */
#tk-list.tk-long .tk-row { content-visibility: auto; contain-intrinsic-size: auto 38px; }
#tk-board.tk-long .tk-card { content-visibility: auto; contain-intrinsic-size: auto 104px; }
.tk-group-more { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px 8px 46px; border-top: 1px solid var(--border-soft); color: var(--text-quiet); font-size: 12.5px; }
/* Which project a task is in, on a list that shows several. Quiet: it is
   where the task lives, not something about it. */
.tk-home { display: inline-block; max-width: 100%; padding: 1px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-quiet); font-size: 11.5px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.tk-home.none { border-style: dashed; color: var(--text-faint); }
.tk-card-top .tk-home { margin-right: 2px; }
.tk-project-k { color: var(--text-faint); font-weight: 500; }
.tkd-home { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 2px 6px 2px 2px; border: 0; border-radius: 7px; background: none; font: inherit; cursor: pointer; }
.tkd-home:hover { background: var(--tk-hover); }
.tkd-home-move { color: var(--accent); font-size: 12px; font-weight: 600; opacity: 0; }
.tkd-home:hover .tkd-home-move, .tkd-home:focus-visible .tkd-home-move { opacity: 1; }
@media (hover: none) { .tkd-home-move { opacity: 1; } }
.tk-project-btn { max-width: 300px; }
@container tracker (max-width: 620px) { .tk-project-btn .tk-project-k { display: none; } .tk-project-btn { max-width: 190px; } }
.tk-project-v { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-more-btn { padding: 4px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--card); color: var(--text-mid); font: inherit; font-weight: 550; cursor: pointer; }
.tk-more-btn:hover { border-color: var(--tk-line); color: var(--text); }
.tk-group-add { display: flex; align-items: center; min-height: 34px; padding: 0 10px 0 56px; }
.tk-group-add input, .tk-col-add-box input, .tkd-step-add input { width: 100%; margin: 0; padding: 6px 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; }
.tk-group-add input::placeholder, .tk-col-add-box input::placeholder, .tkd-step-add input::placeholder { color: var(--text-faint); }
.tk-group-add:focus-within { background: var(--accent-wash); }
.tk-sub-add { padding-left: 100px; background: var(--tk-foot); border-bottom: 1px solid var(--border-soft); }

/* ---------- board ---------- */

.tk-board { display: flex; align-items: stretch; gap: 12px; height: 100%; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
.tk-col { flex: 1 1 208px; min-width: 208px; max-width: 340px; display: flex; flex-direction: column; min-height: 0; max-height: 100%; padding: 6px; border-radius: 12px; background: var(--tk-sunken); }
.tk-col.collapsed { flex: 0 0 44px; min-width: 44px; align-items: center; }
.tk-col-head { flex: none; }
.tk-col-toggle { display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; }
.tk-col-toggle:hover { background: var(--tk-hover); }
.tk-col-toggle h3 { margin: 0; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.tk-col-toggle b { color: var(--text-faint); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.tk-col.collapsed .tk-col-toggle { flex-direction: column; height: auto; padding: 10px 0; writing-mode: vertical-rl; }
.tk-col.collapsed .tk-col-toggle .tk-dot { margin-bottom: 4px; }
/* `min-height` keeps an empty column a real drop target rather than a stub. */
.tk-col-cards { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; min-height: 72px; padding: 2px; overflow-y: auto; scrollbar-width: thin; border-radius: 8px; }
.tk-col-cards:empty::before { content: 'Nothing here'; display: grid; place-items: center; flex: 1; min-height: 64px; border: 1.5px dashed var(--tk-line); border-radius: 9px; color: var(--text-faint); font-size: 12px; }
.tk-col-cards.tk-drop-over { background: var(--accent-tint); }
.tk-col-more, .tk-col-add { display: flex; align-items: center; gap: 6px; flex: none; width: 100%; margin-top: 4px; padding: 7px 8px; border: 0; border-radius: 8px; background: none; color: var(--text-faint); font-size: 12.5px; text-align: left; cursor: pointer; }
.tk-col-more:hover, .tk-col-add:hover { background: var(--tk-hover); color: var(--text); }
.tk-col-more { color: var(--accent); }
.tk-col-add-box { flex: none; margin-top: 4px; padding: 3px 10px; border: 1px solid var(--accent); border-radius: 9px; background: var(--card); box-shadow: 0 0 0 3px var(--accent-tint); }

/* `touch-action` leaves both pans to the browser: cards fill their column, so
   `none` here would mean a finger on the board could neither scroll a column
   nor swipe between them. A touch drag is gated on a long press instead. */
.tk-card { display: flex; flex-direction: column; gap: 7px; flex: none; padding: 10px 11px 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); box-shadow: var(--e1); cursor: grab; touch-action: pan-x pan-y; }
.tk-card:hover { border-color: var(--tk-line); }
.tk-card.selected, .tk-card.is-open { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tk-card.is-blocked { border-left: 3px solid var(--tk-blocked); padding-left: 9px; }
.tk-card.done .tk-card-title { color: var(--text-faint); }
.tk-card-top { display: flex; align-items: flex-start; gap: 6px; min-height: 0; }
.tk-card-top .tk-tags { flex: 1; flex-wrap: wrap; }
.tk-card-top .tk-check { margin-left: auto; }
.tk-card-top:has(.tk-tags):not(:has(.tk-tag)) { display: none; }
.tk-card-title { padding: 0; border: 0; background: none; color: var(--text); font-size: 13.5px; font-weight: 500; line-height: 1.4; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.tk-card-title:hover { color: var(--accent); }
.tk-card-waiting { display: flex; align-items: center; gap: 5px; margin: 0; color: var(--data-red-ink); font-size: 11.5px; }
.tk-card-waiting span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 24px; }
.tk-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; margin-left: -3px; }
.tk-card .tk-date { height: 22px; padding: 0 6px; font-size: 11.5px; }
.tk-card .tk-date.empty { padding: 0 3px; }
.tk-card .tk-assign { height: 24px; padding: 0 2px; }

.tk-board.lanes { display: block; overflow: auto; }
.tk-lane-heads, .tk-lane-cols { display: grid; grid-template-columns: repeat(var(--tk-lane-cols, 5), minmax(200px, 1fr)); gap: 10px; min-width: calc(var(--tk-lane-cols, 5) * 210px); }
.tk-lane-heads { position: sticky; top: 0; z-index: 4; padding-bottom: 4px; background: var(--bg); }
.tk-lane-hidden { display: flex; align-items: center; gap: 6px; padding: 4px 2px; color: var(--text-faint); font-size: 12px; }
.tk-lane { margin-top: 6px; }
.tk-lane-head { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 4px; border: 0; border-radius: 7px; background: none; color: var(--text); cursor: pointer; position: sticky; left: 0; }
.tk-lane-head:hover { background: var(--tk-hover); }
.tk-col.in-lane { flex: none; min-width: 0; max-width: none; max-height: none; }
.tk-col.in-lane .tk-col-cards { overflow: visible; min-height: 44px; }
/* A lane is a grid of cells, most of them empty; an outlined box in each one
   would be louder than the cards. The cell is still there to drop into. */
.tk-col.in-lane .tk-col-cards:empty::before { content: ''; min-height: 36px; border: 0; }
.tk-col.in-lane .tk-col-add { opacity: 0; }
.tk-col.in-lane:hover .tk-col-add, .tk-col.in-lane .tk-col-add:focus-visible { opacity: 1; }
@media (hover: none) { .tk-col.in-lane .tk-col-add { opacity: 1; } }

/* ---------- dragging ---------- */

body.tk-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.tk-held { box-shadow: var(--e3); transform: scale(1.02); transition: transform 0.12s ease, box-shadow 0.12s ease; }
.tk-drag-hiding { display: none !important; }
.tk-drag-ghost { position: fixed; z-index: 1250; margin: 0 !important; pointer-events: none; cursor: grabbing; opacity: 0.96; box-shadow: var(--e3) !important; transform: rotate(1.2deg); font: 13px/1.45 var(--font-ui); color: var(--text); }
.tk-drag-ghost.tk-row { border: 1px solid var(--border); border-radius: 9px; background: var(--card); transform: none; }
.tk-drag-ghost[data-tip]:not([data-tip=""])::after, .tkt-bar[data-tip]:not([data-tip=""])::after { content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 6px); padding: 3px 8px; border-radius: 6px; background: var(--text); color: var(--bg); font-size: 11.5px; font-weight: 550; white-space: nowrap; z-index: 9; }
.tk-drop-slot { flex: none; border: 1.5px dashed var(--accent); border-radius: 9px; background: var(--accent-tint); }
.tk-drop-slot.row { border-radius: 0; border-width: 0; box-shadow: inset 0 2px 0 var(--accent); background: var(--accent-wash); }
.tk-drop-slot.chip { height: 22px !important; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  .tk-held, .tk-drag-ghost { transform: none; transition: none; }
  .tk-chevron, .tk-expander, .tk-meter-bar > span { transition: none; }
}

/* ---------- selection bar ---------- */

.tk-bulk { position: absolute; left: 50%; bottom: 74px; z-index: 40; display: flex; align-items: center; gap: 2px; max-width: calc(100% - 24px); padding: 6px; transform: translateX(-50%); border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--e3); overflow-x: auto; scrollbar-width: none; }
.tk-bulk-count { flex: none; padding: 0 12px 0 10px; font-size: 12.5px; white-space: nowrap; }
.tk-bulk-btn, .tk-bulk-close { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.tk-bulk-btn:hover, .tk-bulk-close:hover, .tk-bulk-btn[aria-expanded="true"] { background: color-mix(in srgb, var(--bg) 16%, transparent); }
/* Mixed toward the bar's own ink so it reads on a dark bar and on a light one. */
.tk-bulk-btn.danger { color: color-mix(in srgb, var(--data-red) 78%, var(--bg)); }
.tk-bulk-close { padding: 0 8px; margin-left: 4px; }
#tracker-pane .tk-bulk :focus-visible { outline-color: var(--bg); }

/* ---------- timeline ---------- */

.tk-timeline { --tkt-label: 250px; display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; }
.tkt-tools, .tkcal-tools { flex: none; display: flex; align-items: center; gap: 8px; }
.tkt-tools .tk-tool, .tkcal-tools .tk-tool { border-color: var(--border); background: var(--card); }
.tkt-hint { margin-left: auto; color: var(--text-faint); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-seg { display: inline-flex; flex: none; padding: 2px; border-radius: 8px; background: var(--tk-sunken); }
.tk-seg button { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--text-quiet); font-size: 12px; cursor: pointer; white-space: nowrap; }
.tk-seg button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: var(--e1); }
.tkt-scroll { flex: 1 1 auto; min-height: 140px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.tkt-canvas { position: relative; min-height: 100%; }
.tkt-head { position: sticky; top: 0; z-index: 6; display: flex; height: 52px; background: var(--card); border-bottom: 1px solid var(--border); }
.tkt-corner { position: sticky; left: 0; z-index: 7; flex: none; display: flex; align-items: flex-end; width: var(--tkt-label); padding: 0 12px 8px; border-right: 1px solid var(--border); background: var(--card); color: var(--text-faint); font-size: 11.5px; }
.tkt-scale { position: relative; flex: none; height: 52px; }
.tkt-months, .tkt-days { position: absolute; left: 0; right: 0; }
.tkt-months { top: 0; height: 24px; }
.tkt-days { top: 24px; height: 28px; }
.tkt-month { position: absolute; top: 0; height: 24px; padding: 5px 0 0 8px; border-left: 1px solid var(--border); color: var(--text-mid); font-size: 11.5px; overflow: hidden; white-space: nowrap; }
.tkt-month b { position: sticky; left: calc(var(--tkt-label) + 8px); font-weight: 650; }
.tkt-daycell { position: absolute; top: 0; height: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-faint); font-size: 10.5px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tkt-daycell i { font-style: normal; font-size: 9px; opacity: 0.8; }
.tkt-daycell.wkend { color: var(--text-faint); opacity: 0.6; }
.tkt-daycell.today { color: var(--on-accent); opacity: 1; font-weight: 700; }
.tkt-daycell.today::before { content: ''; position: absolute; inset: 3px 1px; z-index: -1; border-radius: 6px; background: var(--accent); }
.tkt-daycell.week { align-items: flex-start; padding-left: 4px; border-left: 1px solid var(--border-soft); }
.tkt-body { position: relative; }
.tkt-row { display: flex; height: 38px; border-bottom: 1px solid var(--border-soft); }
.tkt-row.cursor .tkt-label { box-shadow: inset 2px 0 0 var(--tk-line); }
.tkt-label { position: sticky; left: 0; z-index: 4; flex: none; display: flex; align-items: center; gap: 8px; width: var(--tkt-label); padding: 0 10px 0 12px; border-right: 1px solid var(--border); background: var(--card); }
.tkt-label-btn { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; height: 28px; padding: 0; border: 0; background: none; color: var(--text); font-size: 13px; text-align: left; cursor: pointer; }
.tkt-label-btn > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tkt-label-btn:hover { color: var(--accent); }
.tkt-row.group { background: var(--tk-foot); }
.tkt-row.group .tkt-label { background: var(--tk-foot); font-size: 12.5px; }
.tkt-track {
  position: relative; flex: none; width: var(--tkt-w);
  background-image:
    linear-gradient(90deg, transparent calc(var(--day) * 5), var(--tk-foot) calc(var(--day) * 5)),
    repeating-linear-gradient(90deg, transparent 0, transparent calc(var(--day) - 1px), var(--border-soft) calc(var(--day) - 1px), var(--border-soft) var(--day));
  background-size: calc(var(--day) * 7) 100%, var(--day) 100%;
}
.tk-timeline[data-zoom="quarter"] .tkt-track { background-image: linear-gradient(90deg, var(--border-soft) 1px, transparent 1px); background-size: calc(var(--day) * 7) 100%; }
.tkt-bar { position: absolute; top: 7px; z-index: 3; display: flex; align-items: center; height: 24px; min-width: 8px; border-radius: 7px; background: color-mix(in srgb, var(--c) 82%, var(--card)); color: var(--on-bar, var(--text)); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.tkt-bar.s-backlog { --on-bar: var(--on-data-grey); } .tkt-bar.s-todo { --on-bar: var(--on-data-amber); } .tkt-bar.s-in_progress { --on-bar: var(--on-data-blue); }
.tkt-bar.s-blocked { --on-bar: var(--on-data-red); } .tkt-bar.s-done { --on-bar: var(--on-data-green); opacity: 0.55; }
.tkt-bar.s-agent_done { --on-bar: var(--on-data-green); }
.tkt-bar:hover, .tkt-bar.dragging, .tkt-bar.is-open { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px color-mix(in srgb, var(--c) 60%, transparent); }
.tkt-bar.dragging { z-index: 8; cursor: grabbing; opacity: 0.95; }
.tkt-bar.overdue { box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--data-red); }
.tkt-bar.single { border-radius: 12px; }
.tkt-bar-text { flex: 1; min-width: 0; padding: 0 4px; font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.tkt-bar-side { position: absolute; top: 10px; z-index: 2; color: var(--text-quiet); font-size: 11.5px; white-space: nowrap; pointer-events: none; }
.tkt-handle { flex: none; align-self: stretch; width: 8px; cursor: ew-resize; }
.tkt-handle::after { content: ''; display: block; width: 2px; height: 10px; margin: 7px 3px; border-radius: 1px; background: currentColor; opacity: 0; }
.tkt-bar:hover .tkt-handle::after, .tkt-bar:focus-visible .tkt-handle::after { opacity: 0.45; }
.tkt-off { position: sticky; top: 7px; z-index: 3; display: inline-flex; align-items: center; gap: 3px; height: 24px; margin-top: 7px; padding: 0 8px; border: 1px dashed var(--tk-line); border-radius: 12px; background: var(--card); color: var(--text-quiet); font-size: 11.5px; cursor: pointer; white-space: nowrap; }
.tkt-off.before { left: calc(var(--tkt-label) + 8px); }
.tkt-off.after { left: calc(100% - 110px); }
.tkt-off:hover { border-color: var(--accent); color: var(--accent); }
.tkt-links { position: absolute; left: var(--tkt-label); z-index: 2; overflow: visible; pointer-events: none; }
.tkt-link { fill: none; stroke: var(--tk-line); stroke-width: 1.5; }
.tkt-link.bad { stroke: var(--data-red); stroke-dasharray: 4 3; }
.tkt-link.done { opacity: 0.45; }
#tkt-arrow path { fill: var(--tk-line); }
#tkt-arrow-bad path { fill: var(--data-red); }
.tkt-today { position: absolute; top: 0; bottom: 0; z-index: 2; width: 2px; margin-left: -1px; background: var(--accent); opacity: 0.55; pointer-events: none; }
.tkt-dropday { display: none; position: absolute; top: 0; bottom: 0; z-index: 2; width: var(--day); background: var(--accent-tint); box-shadow: inset 0 0 0 1.5px var(--accent); pointer-events: none; }
.tkt-unscheduled { flex: 0 1 auto; max-height: 30%; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.tkt-unscheduled h3 { flex: none; display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 10px 14px 6px; font-size: 12.5px; font-weight: 650; }
.tkt-unscheduled h3 b { color: var(--text-faint); font-weight: 500; }
.tkt-unscheduled h3 span { color: var(--text-faint); font-size: 11.5px; font-weight: 400; }
.tkt-un-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 12px 12px; overflow-y: auto; }
.tkt-un { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 30px; padding: 0 4px 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); cursor: grab; touch-action: none; }
.tkt-un:hover { border-color: var(--tk-line); }
.tkt-un-title { min-width: 0; max-width: 260px; padding: 0; border: 0; background: none; color: var(--text); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.tkt-un-title:hover { color: var(--accent); }

/* ---------- calendar ---------- */

.tk-calendar { display: flex; flex-direction: column; gap: 8px; min-height: 100%; }
.tkcal-title { margin: 0 0 0 4px; font-size: 15px; font-weight: 650; }
.tkcal-grid { flex: 1 1 auto; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; background: var(--card); overflow: hidden; }
.tkcal-week { flex: 1 1 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border-soft); }
.tkcal-week:last-child { border-bottom: 0; }
.tkcal-week.head { flex: none; border-bottom: 1px solid var(--border); background: var(--tk-foot); }
.tkcal-week.head span { padding: 7px 10px; color: var(--text-faint); font-size: 11.5px; font-weight: 600; }
.tkcal-day { display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 108px; padding: 4px 5px 6px; border-right: 1px solid var(--border-soft); }
.tkcal-day:last-child { border-right: 0; }
.tkcal-day.wkend { background: var(--tk-foot); }
.tkcal-day.out .tkcal-num { color: var(--text-faint); opacity: 0.55; }
.tkcal-day-head { display: flex; align-items: center; justify-content: space-between; }
.tkcal-num { min-width: 24px; height: 24px; padding: 0 5px; border: 0; border-radius: 12px; background: none; color: var(--text-mid); font-size: 12px; font-variant-numeric: tabular-nums; cursor: default; }
.tkcal-day.today .tkcal-num { background: var(--accent); color: var(--on-accent); font-weight: 700; opacity: 1; }
.tkcal-add { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text-faint); cursor: pointer; opacity: 0; }
.tkcal-day:hover .tkcal-add, .tkcal-add:focus-visible { opacity: 1; }
.tkcal-add:hover { background: var(--tk-hover); color: var(--text); }
.tkcal-day-tasks { flex: 1; display: flex; flex-direction: column; gap: 3px; min-height: 22px; border-radius: 6px; }
.tkcal-day-tasks.tk-drop-over { background: var(--accent-tint); }
.tkcal-chip { display: flex; align-items: center; gap: 6px; flex: none; height: 22px; padding: 0 6px; border-radius: 6px; background: color-mix(in srgb, var(--c) 15%, transparent); cursor: grab; touch-action: pan-y; }
.tkcal-chip.overdue { box-shadow: inset 0 0 0 1px var(--data-red); }
.tkcal-chip.done { opacity: 0.55; }
.tkcal-chip-title { flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: var(--text); font-size: 12px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.tkcal-more { align-self: flex-start; padding: 1px 6px; border: 0; border-radius: 5px; background: none; color: var(--text-quiet); font-size: 11.5px; cursor: pointer; }
.tkcal-more:hover { background: var(--tk-hover); color: var(--text); }
.tkcal-count { align-self: center; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent-tint); color: var(--accent); font-size: 11px; font-weight: 650; }
.tkcal-count.overdue { background: color-mix(in srgb, var(--data-red) 16%, transparent); color: var(--data-red-ink); }
.tkcal-agenda { padding: 4px 2px 0; }
.tkcal-agenda h3 { margin: 6px 0 8px; font-size: 13px; font-weight: 650; }
.tkcal-agenda .tkcal-chip { height: 44px; padding: 0 4px 0 12px; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.tkcal-agenda .tkcal-chip-title { align-self: stretch; font-size: 13.5px; }
.tkcal-agenda .tkcal-day-tasks { gap: 6px; }
.tkcal-moveto { flex: none; display: grid; place-items: center; width: 40px; height: 40px; opacity: 1; color: var(--text-quiet); }
.tkcal-how { margin: 10px 2px 0; }
/* A task in hand over the phone's month: every day says "here", the one under
   the finger says it loudest, and the month stays on screen however far down
   the day's list the task was picked up from. */
.tk-drag-source { opacity: 0.35; }
body.tk-dragging-target .tkcal-grid { position: sticky; top: 0; z-index: 6; box-shadow: var(--e3); }
body.tk-dragging-target .tkcal-day { box-shadow: inset 0 0 0 0.5px var(--tk-line); }
body.tk-dragging-target .tkcal-day.tk-drop-over { background: var(--accent-tint); box-shadow: inset 0 0 0 2px var(--accent); }
body.tk-dragging-target .tkcal-day.tk-drop-over .tkcal-num { color: var(--accent); font-weight: 700; }
body.tk-dragging-target .tkcal-day.picked:not(.tk-drop-over) { box-shadow: inset 0 0 0 0.5px var(--tk-line); }
body.tk-dragging-target .tkcal-tools [data-tk-cal-move] { background: var(--accent-tint); color: var(--accent); }
.tk-drag-ghost.tkcal-chip { height: 40px; padding: 0 12px; border: 1px solid var(--border); background: var(--card); transform: none; }
.tk-drag-ghost.tkcal-chip .tkcal-moveto { display: none; }
.tkcal-edge { position: fixed; z-index: 1240; display: grid; place-items: center; width: 30px; color: var(--accent); background: linear-gradient(to right, var(--accent-tint), transparent); pointer-events: none; opacity: 0.75; transition: opacity 0.15s ease; }
.tkcal-edge.prev { left: 0; border-radius: 0 10px 10px 0; }
.tkcal-edge.next { right: 0; border-radius: 10px 0 0 10px; background: linear-gradient(to left, var(--accent-tint), transparent); }
.tkcal-edge.on { opacity: 1; background: var(--accent-tint); box-shadow: inset 0 0 0 1.5px var(--accent); }
.tkcal-edge .ic { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) { .tkcal-edge { transition: none; } }

/* ---------- menus ---------- */

.tk-menu { position: fixed; z-index: 1300; display: flex; flex-direction: column; min-width: 212px; max-width: min(340px, calc(100vw - 16px)); padding: 5px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); box-shadow: var(--e3); font: 13px/1.4 var(--font-ui); overflow: hidden; }
.tk-menu.wide { min-width: 280px; }
.tk-menu-title { display: none; }
.tk-menu-search { flex: none; height: 32px; margin: 2px 2px 5px; padding: 0 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; outline: 0; }
.tk-menu-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.tk-menu-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.tk-menu-item { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 32px; padding: 5px 9px; border: 0; border-radius: 7px; background: none; color: var(--text); font-size: 13px; text-align: left; cursor: pointer; }
.tk-menu-item.sel { background: var(--tk-hover); }
.tk-menu-item:focus-visible { outline: 0; background: var(--tk-hover); }
.tk-menu-item.checked { color: var(--accent); font-weight: 550; }
.tk-menu-item.danger { color: var(--danger); }
.tk-menu-item:disabled { color: var(--text-faint); cursor: default; }
.tk-menu-icon { display: inline-grid; place-items: center; flex: none; width: 18px; color: var(--text-quiet); }
.tk-menu-item.danger .tk-menu-icon, .tk-menu-item.checked .tk-menu-icon { color: inherit; }
.tk-menu-label { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; overflow: hidden; }
.tk-menu-label small { flex: none; color: var(--text-faint); font-size: 11.5px; font-weight: 400; }
.tk-menu-check { display: inline-flex; flex: none; color: var(--accent); }
.tk-menu-sep { height: 1px; margin: 5px 4px; background: var(--border-soft); }
.tk-menu-heading { padding: 6px 9px 3px; color: var(--text-faint); font-size: 11px; font-weight: 600; }
.tk-menu-empty { padding: 12px 9px; color: var(--text-faint); font-size: 12.5px; }
.tk-menu-foot { flex: none; margin: 5px -5px -5px; padding: 8px 12px; border-top: 1px solid var(--border-soft); background: var(--tk-foot); color: var(--text-faint); font-size: 11.5px; line-height: 1.45; }
.tk-menu-person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tk-menu-person > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.tk-menu-person b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-menu-person small { color: var(--text-faint); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-menu-label:has(.tk-menu-person) { display: block; }
.tk-menu-backdrop { position: fixed; inset: 0; z-index: 1290; background: var(--veil); }
.tk-menu.sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; max-width: none; max-height: 82dvh !important; padding: 8px 10px max(12px, env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; border-width: 1px 0 0; }
.tk-menu.sheet .tk-menu-title { display: block; padding: 8px 8px 10px; font-size: 14px; font-weight: 650; }
.tk-menu.sheet .tk-menu-item { min-height: 44px; font-size: 14.5px; }
.tk-menu.sheet .tk-menu-search { height: 42px; font-size: 16px; }

.tk-dp { display: flex; flex-direction: column; gap: 8px; width: 276px; padding: 6px; }
.tk-menu.sheet .tk-dp { width: auto; }
.tk-dp-input { height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; outline: 0; }
.tk-dp-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.tk-dp-read { min-height: 16px; margin-top: -4px; padding: 0 2px; color: var(--accent); font-size: 11.5px; }
.tk-dp-read.bad { color: var(--text-faint); }
.tk-dp-read:empty { display: none; }
.tk-dp-quick { display: flex; flex-wrap: wrap; gap: 5px; }
.tk-dp-quick button { height: 26px; padding: 0 9px; border: 1px solid var(--border); border-radius: 13px; background: var(--card); color: var(--text-mid); font-size: 12px; cursor: pointer; }
.tk-dp-quick button:hover { border-color: var(--accent); color: var(--accent); }
.tk-dp-quick button.clear { margin-left: auto; border-color: transparent; color: var(--text-faint); }
.tk-dp-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.tk-dp-month { font-size: 13px; font-weight: 650; }
.tk-dp-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.tk-dp-row [role="columnheader"] { padding: 4px 0; color: var(--text-faint); font-size: 10.5px; text-align: center; }
.tk-dp-day { height: 32px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 12.5px; font-variant-numeric: tabular-nums; cursor: pointer; }
.tk-dp-day:hover { background: var(--tk-hover); }
.tk-dp-day.out { color: var(--text-faint); opacity: 0.6; }
.tk-dp-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); font-weight: 650; }
.tk-dp-day.on { background: var(--accent); color: var(--on-accent); font-weight: 650; opacity: 1; }
.tk-menu.sheet .tk-dp-day { height: 42px; font-size: 14px; }

.tk-name-prompt { display: flex; flex-direction: column; gap: 8px; width: 280px; padding: 8px; }
.tk-menu.sheet .tk-name-prompt { width: auto; }
.tk-name-label { color: var(--text-quiet); font-size: 12px; font-weight: 550; }
.tk-name-prompt input { height: 34px; margin: 0; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; outline: 0; }
.tk-name-prompt input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.tk-name-actions { display: flex; justify-content: flex-end; gap: 6px; }
.tk-name-actions button { padding: 6px 12px; font-size: 12.5px; }
.tk-note-prompt { width: 320px; }
.tk-note-hint { margin: 0; color: var(--text-quiet); font-size: 12px; line-height: 1.4; }
.tk-note-prompt textarea { min-height: 72px; margin: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; resize: vertical; outline: 0; }
.tk-note-prompt textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }

.tk-help { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--text); box-shadow: var(--e4); font: 13px/1.5 var(--font-ui); }
.tk-help::backdrop { background: var(--veil); }
.tk-help-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px 20px; }
.tk-help h2 { margin: 0; font-size: 15px; font-weight: 650; }
.tk-help dl { display: grid; gap: 0; margin: 0; padding: 4px 20px 8px; }
.tk-help dl > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.tk-help dl > div:last-child { border-bottom: 0; }
.tk-help dt { flex: none; }
.tk-help dd { margin: 0; color: var(--text-quiet); text-align: right; }
.tk-help kbd { display: inline-block; min-width: 22px; padding: 2px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; background: var(--bg); color: var(--text-mid); font: 600 11.5px var(--font-ui); text-align: center; }
.tk-help-foot { margin: 0; padding: 12px 20px 16px; border-top: 1px solid var(--border-soft); background: var(--tk-foot); border-radius: 0 0 14px 14px; color: var(--text-quiet); font-size: 12px; }
.tk-help code { padding: 1px 5px; border-radius: 4px; background: var(--tk-sunken); font: 11.5px var(--font-mono); }

/* ---------- the panel a task is worked in ---------- */

.tk-panel { flex: none; display: flex; flex-direction: column; width: clamp(420px, 38cqw, 560px); min-height: 0; border-left: 1px solid var(--border); background: var(--card); outline: 0; }
.tkd { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; }
.tkd-bar { flex: none; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 10px 0 18px; border-bottom: 1px solid var(--border-soft); }
.tkd-crumbs { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-faint); font-size: 12px; }
.tkd-crumb { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tkd-crumb .ic { width: 11px; height: 11px; }
button.tkd-crumb { padding: 2px 5px; border: 0; border-radius: 5px; background: none; color: var(--text-quiet); font-size: 12px; cursor: pointer; }
button.tkd-crumb:hover { background: var(--tk-hover); color: var(--accent); }
.tkd-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.tkd-follow { display: inline-flex; align-items: center; gap: 6px; height: 28px; margin-right: 4px; padding: 0 10px; border: 1px solid var(--border); border-radius: 14px; background: none; color: var(--text-quiet); font-size: 12px; cursor: pointer; }
.tkd-follow:hover { border-color: var(--tk-line); color: var(--text); }
.tkd-follow.on { border-color: transparent; background: var(--accent-tint); color: var(--accent); font-weight: 550; }
.tkd-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 20px 20px; }
.tkd-head { display: flex; align-items: flex-start; gap: 10px; }
.tkd-head .tk-done-btn { margin-top: 5px; }
.tkd-title { flex: 1; min-width: 0; margin: 0 0 0 -6px; padding: 2px 6px; border-radius: 7px; font: 650 20px/1.3 var(--font-ui); letter-spacing: -0.02em; overflow-wrap: anywhere; outline: 0; cursor: text; }
.tkd-title:hover { background: var(--tk-hover-soft); }
.tkd-title:focus { background: var(--card); box-shadow: 0 0 0 2px var(--accent); }
.tkd.done .tkd-title { color: var(--text-quiet); }

.tkd-alert { display: flex; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.5; }
.tkd-alert > .ic { margin-top: 2px; }
.tkd-alert.blocked { background: color-mix(in srgb, var(--data-red) 10%, transparent); }
.tkd-alert.blocked > .ic, .tkd-alert.blocked > div > b { color: var(--data-red-ink); }
.tkd-alert.warn { background: var(--attn-bg); color: var(--attn-text); }
.tkd-alert.clear { background: var(--success-bg); }
.tkd-alert.clear > .ic { color: var(--ok); }
.tkd-alert.review { background: color-mix(in srgb, var(--tk-agent_done) 12%, transparent); }
.tkd-alert.review > .ic, .tkd-alert.review > div > b { color: var(--tk-agent_done-ink); }
.tkd-review-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tkd-alert ul { margin: 4px 0 0; padding: 0; list-style: none; }
.tkd-alert li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 1px 0; color: var(--text-quiet); }
.tkd-inline-link { padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 550; text-align: left; text-decoration: underline; text-decoration-color: var(--tk-line); text-underline-offset: 2px; cursor: pointer; }
.tkd-inline-link:hover { color: var(--accent); }
.tkd-fix { display: inline-block; margin: 4px 0 0; padding: 3px 9px; border: 1px solid currentColor; border-radius: 12px; background: none; color: inherit; font-size: 12px; font-weight: 550; cursor: pointer; }

.tkd-props { display: grid; gap: 3px; margin-top: 14px; }
.tkd-prop { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; min-height: 30px; }
.tkd-prop-k { color: var(--text-faint); font-size: 12px; }
.tkd-prop-v { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; margin-left: -6px; }
.tkd-prop-v > .tk-quiet, .tkd-prop-v > .tkd-watchers { margin-left: 6px; }
.tkd-prop-v .tk-status { margin-left: 4px; }
.tkd-arrow { color: var(--text-faint); }
.tkd-remind { display: inline-flex; align-items: center; gap: 6px; height: 26px; margin-left: 6px; padding: 0 4px 0 9px; border-radius: 13px; background: var(--accent-tint); color: var(--accent); font-size: 12px; font-weight: 550; }
.tkd-remind.sent { background: var(--tk-sunken); color: var(--text-quiet); }
.tkd-remind button { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.tkd-remind button .ic { width: 11px; height: 11px; }
.tkd-watchers { display: inline-flex; align-items: center; gap: 8px; }

.tkd-source { display: flex; gap: 11px; margin-top: 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border)); border-radius: 12px; background: var(--accent-wash); }
.tkd-source-icon { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--accent-tint); color: var(--accent); }
.tkd-source-body { min-width: 0; }
.tkd-source-kind { margin: 3px 0 0; color: var(--text-quiet); font-size: 12px; }
.tkd-source-kind code { font: 11.5px var(--font-mono); color: var(--text-mid); overflow-wrap: anywhere; }
.tkd-source blockquote { margin: 7px 0 0; padding: 0 0 0 10px; border-left: 2px solid var(--accent); color: var(--text-body); font: 14px/1.55 var(--font-doc); overflow-wrap: anywhere; }
.tkd-source-open { display: inline-flex; align-items: center; gap: 3px; margin-top: 8px; padding: 0; border: 0; background: none; color: var(--accent); font: 600 12px var(--font-ui); text-decoration: none; cursor: pointer; }
.tkd-source-open:hover { text-decoration: underline; }
.tkd-source-kind b { color: var(--text-mid); font-weight: 600; }
.tkd-source-cite { margin: 7px 0 0; color: var(--text-quiet); font-size: 12px; }
.tkd-source-cite code { font: 11.5px var(--font-mono); color: var(--text-mid); overflow-wrap: anywhere; }
.tkd-source-note { margin: 6px 0 0; color: var(--text-quiet); font-size: 12.5px; line-height: 1.5; }
.tkd-source-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; }
.tkd-source-open .ic { width: 12px; height: 12px; }
.tkd-led { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; }
.tkd-led .msg-tickets { margin: 0; }

.tkd-sec { margin-top: 22px; }
.tkd-sec:empty { display: none; }
.tkd-sec-head { display: flex; align-items: center; gap: 10px; min-height: 28px; margin-bottom: 6px; }
.tkd-sec-head h3, .tkd-sec h3 { margin: 0; font-size: 12.5px; font-weight: 650; color: var(--text-mid); }
.tkd-sec-head > :last-child:not(h3):not(.tkd-count) { margin-left: auto; }
.tkd-count { margin-left: 4px; color: var(--text-faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.tkd-saved { margin-left: auto; color: var(--text-faint); font-size: 11.5px; }
.tkd-saved.ok { color: var(--ok); }
.tkd-saved.bad { color: var(--danger); }
.tkd-bar-meter { flex: 1; max-width: 140px; height: 5px; border-radius: 3px; background: var(--tk-sunken); overflow: hidden; }
.tkd-bar-meter > span { display: block; height: 100%; border-radius: 3px; background: var(--data-green); transition: width 0.3s var(--tk-ease); }
.tk-ai-btn { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 13px; background: none; color: var(--accent); font-size: 12px; font-weight: 550; cursor: pointer; white-space: nowrap; }
.tk-ai-btn:hover:not(:disabled) { background: var(--accent-tint); }
.tk-ai-btn:disabled { opacity: 0.65; cursor: default; }

.tkd-format { display: flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--border); border-bottom: 0; border-radius: 9px 9px 0 0; background: var(--tk-foot); }
.tkd-format > button:not(.tk-ai-btn) { display: inline-grid; place-items: center; min-width: 28px; height: 26px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: var(--text-quiet); font-size: 12.5px; cursor: pointer; }
.tkd-format > button:not(.tk-ai-btn):hover { background: var(--tk-hover); color: var(--text); }
.tk-tb-div { width: 1px; height: 16px; margin: 0 4px; background: var(--border); }
.tk-tb-spacer { flex: 1; }
.tk-rich { min-height: 96px; max-height: 420px; overflow-y: auto; padding: 11px 13px; border: 1px solid var(--border); border-radius: 0 0 9px 9px; background: var(--card); color: var(--text-body); font-size: 13.5px; line-height: 1.6; outline: 0; overflow-wrap: anywhere; }
.tk-rich:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.tk-rich:empty::before { content: attr(data-placeholder); color: var(--text-faint); }
.tk-rich > :first-child, .tkc-text > :first-child { margin-top: 0; }
.tk-rich > :last-child, .tkc-text > :last-child { margin-bottom: 0; }
.tk-rich p, .tkc-text p { margin: 0.45em 0; }
.tk-rich ul, .tk-rich ol, .tkc-text ul, .tkc-text ol { margin: 0.4em 0; padding-left: 1.4em; }
.tk-rich h1, .tk-rich h2, .tk-rich h3, .tkc-text h1, .tkc-text h2, .tkc-text h3 { margin: 0.9em 0 0.3em; font: 650 14px/1.35 var(--font-ui); color: var(--text); }
.tk-rich a, .tkc-text a { color: var(--accent); }
.tk-rich code, .tkc-text code { padding: 1px 4px; border-radius: 4px; background: var(--tk-sunken); font: 12px var(--font-mono); }
.tk-rich pre, .tkc-text pre { padding: 9px 11px; border-radius: 8px; background: var(--tk-sunken); overflow-x: auto; }
.tk-rich blockquote, .tkc-text blockquote { margin: 0.5em 0; padding-left: 10px; border-left: 2px solid var(--border-strong); color: var(--text-quiet); }

.tkd-steps, .tkd-dep-group [role="list"] { display: grid; }
.tkd-step, .tkd-dep { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 2px 0 4px; border-radius: 8px; }
.tkd-step:hover, .tkd-dep:hover { background: var(--tk-hover-soft); }
.tkd-step-title { flex: 1; min-width: 0; padding: 4px 0; border: 0; background: none; color: var(--text); font-size: 13.5px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.tkd-step-title:hover { color: var(--accent); }
.tkd-step.done .tkd-step-title, .tkd-dep.done .tkd-step-title { color: var(--text-faint); text-decoration: line-through; text-decoration-color: var(--tk-line); }
.tkd-step .tk-row-btn, .tkd-dep .tk-row-btn { opacity: 0; }
.tkd-step:hover .tk-row-btn, .tkd-dep:hover .tk-row-btn, .tkd-step .tk-row-btn:focus-visible, .tkd-dep .tk-row-btn:focus-visible { opacity: 1; }
@media (hover: none) { .tkd-step .tk-row-btn, .tkd-dep .tk-row-btn, .tkc-tools, .tk-rename-btn, .tk-group-add-btn, .tkcal-add { opacity: 1 !important; } }
.tkd-step-add { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 4px; border-radius: 8px; color: var(--text-faint); }
.tkd-step-add:focus-within { background: var(--accent-wash); }
.tkd-step-add > span { display: inline-grid; place-items: center; width: 17px; }
.tkd-suggest { margin-top: 8px; padding: 12px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius: 11px; background: var(--accent-wash); }
.tkd-suggest-lead { display: flex; gap: 7px; margin: 0 0 8px; color: var(--text-quiet); font-size: 12px; line-height: 1.45; }
.tkd-suggest-lead .ic { color: var(--accent); margin-top: 1px; }
.tkd-suggest-item { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.tkd-suggest-item input[type="checkbox"] { flex: none; margin: 0; accent-color: var(--accent); }
.tkd-suggest-item input[type="text"] { flex: 1; min-width: 0; height: 30px; margin: 0; padding: 0 8px; border: 1px solid transparent; border-radius: 7px; background: var(--card); color: var(--text); font: inherit; }
.tkd-suggest-item input[type="text"]:focus { border-color: var(--accent); outline: 0; }
.tkd-suggest-actions { display: flex; gap: 6px; margin-top: 10px; }
.tkd-suggest-actions button { padding: 6px 12px; font-size: 12.5px; }

.tkd-dep-group { margin-top: 2px; }
.tkd-dep-group + .tkd-dep-group { margin-top: 10px; }
.tkd-dep-group h4 { margin: 0 0 2px; color: var(--text-quiet); font-size: 12px; font-weight: 600; }
.tkd-dep-group h4 .tk-quiet { font-weight: 400; }
.tkd-dep > .tk-quiet { flex: none; white-space: nowrap; }
.tkd-add-link { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 8px 0 4px; border: 0; border-radius: 7px; background: none; color: var(--text-quiet); font-size: 12.5px; cursor: pointer; }
.tkd-add-link:hover { background: var(--tk-hover); color: var(--accent); }

.tkd-files, .tkc-atts { display: flex; flex-wrap: wrap; gap: 8px; }
.tkc-atts { margin-top: 6px; }
.tkd-file { position: relative; display: inline-flex; max-width: 100%; }
.tkd-file-x { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--card); color: var(--text-quiet); cursor: pointer; opacity: 0; }
.tkd-file:hover .tkd-file-x, .tkd-file-x:focus-visible { opacity: 1; }
.tkd-file-x:hover { color: var(--danger); }
.tkd-file-x .ic { width: 10px; height: 10px; }
.tkc-img { display: block; max-width: 200px; max-height: 120px; border: 1px solid var(--border); border-radius: 8px; object-fit: cover; }
.tkc-audio { display: flex; flex-direction: column; gap: 3px; }
.tkc-audio audio { height: 32px; max-width: 260px; }
.tkc-transcript { max-width: 280px; color: var(--text-faint); font-size: 11.5px; }
.tkc-file { display: inline-flex; align-items: center; gap: 7px; max-width: 260px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--text-mid); font-size: 12.5px; text-decoration: none; }
.tkc-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tkc-file:hover { border-color: var(--accent); color: var(--accent); }

.tkd-feed { display: grid; gap: 2px; }
.tkd-feed-empty { padding: 8px 0; }
.tkc-msg { display: flex; gap: 10px; padding: 8px 6px; border-radius: 9px; }
.tkc-msg:hover { background: var(--tk-hover-soft); }
.tkc-msg > .avatar { margin-top: 1px; flex: none; }
.tkc-main { flex: 1; min-width: 0; }
.tkc-head { display: flex; align-items: baseline; gap: 8px; min-height: 22px; }
.tkc-author { font-size: 13px; font-weight: 600; }
.tkc-age { flex: none; color: var(--text-faint); font-size: 11.5px; white-space: nowrap; }
.tkc-tools { display: inline-flex; gap: 1px; margin-left: auto; opacity: 0; align-self: center; }
.tkc-msg:hover .tkc-tools, .tkc-tools:focus-within { opacity: 1; }
.tkc-tools .tk-row-btn { width: 22px; height: 22px; }
.tkc-text { color: var(--text-body); font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.tkc-edit textarea { display: block; width: 100%; min-height: 70px; margin: 4px 0 0; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; resize: vertical; outline: 0; box-shadow: 0 0 0 3px var(--accent-tint); }
.tkc-edit-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.tkc-edit-actions button { padding: 5px 11px; font-size: 12px; }
.tkd-event { display: flex; align-items: baseline; gap: 9px; padding: 4px 6px 4px 13px; color: var(--text-quiet); font-size: 12.5px; line-height: 1.45; }
.tkd-event > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tkd-event b { color: var(--text-mid); font-weight: 600; }
.tkd-event-dot { flex: none; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--tk-line); transform: translateY(-1px); }
.tkd-summary { margin-bottom: 10px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius: 11px; background: var(--accent-wash); }
.tkd-summary-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 6px; font-size: 12.5px; }
.tkd-summary-head > .ic { color: var(--accent); align-self: center; }
.tkd-summary-head .tk-row-btn { margin-left: auto; align-self: center; }
#tkd-draft .tkd-summary { margin: 8px 0 0; }

.tkd-compose { flex: none; position: relative; padding: 10px 16px 14px; border-top: 1px solid var(--border-soft); background: var(--card); }
.tkd-compose-box { border: 1px solid var(--border); border-radius: 11px; background: var(--bg); }
.tkd-compose-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
#tkd-comment { display: block; width: 100%; min-height: 38px; max-height: 180px; margin: 0; padding: 9px 12px 2px; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 13.5px; line-height: 1.5; resize: none; }
#tkd-comment::placeholder { color: var(--text-faint); }
.tkd-compose-bar { display: flex; align-items: center; gap: 8px; padding: 2px 6px 6px; }
.tkd-hint { flex: 1; min-width: 0; color: var(--text-faint); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tkd-compose-bar .primary { padding: 5px 13px; font-size: 12.5px; }
.tkc-pending { display: flex; flex-wrap: wrap; gap: 5px; }
.tkc-pending:not(:empty) { margin-bottom: 7px; }
.tkc-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; height: 24px; padding: 0 4px 0 8px; border: 1px solid var(--border); border-radius: 12px; color: var(--text-quiet); font-size: 11.5px; }
.tkc-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tkc-chip button { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.tkc-chip .ic { width: 11px; height: 11px; }
.tkd-mention { position: absolute; left: 16px; right: 16px; bottom: calc(100% - 4px); z-index: 5; max-height: 240px; padding: 5px; border: 1px solid var(--border); border-radius: 11px; background: var(--card); box-shadow: var(--e3); overflow-y: auto; }

/* Full page: the same panel across the whole tracker, notes and conversation
   in a reading column with the properties beside them. */
.tk-panel-full .tk-panel { position: absolute; inset: 0; z-index: 30; width: auto; margin: 0; border-left: 0; }
.tk-panel-full .tkd-scroll { padding: 22px clamp(18px, 4cqw, 56px) 28px; }
.tk-panel-full .tkd-head, .tk-panel-full #tkd-alerts, .tk-panel-full .tkd-cols { max-width: 1120px; margin-inline: auto; }
.tk-panel-full .tkd-title { font-size: 24px; }
.tk-panel-full .tkd-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 8px 44px; }
.tk-panel-full .tkd-side { grid-column: 2; grid-row: 1; position: sticky; top: 0; }
.tk-panel-full .tkd-main { grid-column: 1; grid-row: 1; min-width: 0; }
.tk-panel-full .tkd-main > .tkd-sec:first-child { margin-top: 14px; }
.tk-panel-full .tkd-compose { padding-inline: clamp(18px, 4cqw, 56px); }
.tk-panel-full .tkd-compose-box, .tk-panel-full .tkc-pending { max-width: 1120px; margin-inline: auto; }
.tk-panel-full .tk-rich { max-height: none; min-height: 150px; }

::highlight(tk-passage) { background-color: var(--hl-strong); color: var(--text); }

/* ---------- when there is less room ---------- */

/* Not enough room for a view and the panel side by side: the panel floats
   over the view instead of squeezing it to nothing. */
@container tracker (max-width: 1000px) {
  .tk-panel { position: absolute; top: 0; right: 0; bottom: 0; z-index: 30; width: min(520px, 100%); margin: 0; box-shadow: var(--e4); }
}
@container tkmain (max-width: 1040px) {
  .tk-top { flex-wrap: wrap; row-gap: 4px; }
  .tk-overview { order: 3; flex-basis: 100%; justify-content: flex-start; margin: 0 -6px; }
}
/* The tools lose their words before they lose their row; the quick filters
   become one line that scrolls rather than three that push the list down. */
@container tkmain (max-width: 920px) {
  .tk-tool-label { display: none; }
  .tk-tool { padding: 0 9px; }
  .tk-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding-inline: 14px; }
  .tk-filters::-webkit-scrollbar { display: none; }
  .tk-presets, .tk-fchips, .tk-view-save { flex-wrap: nowrap; flex: none; }
  .tk-view-save { margin-left: 0; }
}
@container tkmain (max-width: 760px) {
  .tk-meter { display: none; }
}
@container tkmain (max-width: 640px) {
  .tk-toolbar { flex-wrap: wrap; row-gap: 8px; }
}
@container tracker (max-width: 920px) {
  .tk-panel-full .tkd-cols { display: block; }
  .tk-panel-full .tkd-side { position: static; }
}

/* A narrow view — a phone, or a list with a task open beside it. Rows fold
   to two lines: the title, then what the columns held. */
@container tkview (max-width: 740px) {
  .tk-list { min-width: 0 !important; }
  .tk-head-row { display: none; }
  .tk-group-head { top: 0; }
  .tk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; min-height: 0; padding: 8px 6px 8px 8px; }
  .tk-row > .tk-c-lead { order: 0; flex: none; align-self: flex-start; padding-top: 3px; }
  .tk-row > .tk-c-title { order: 1; flex: 1 1 calc(100% - 70px); min-width: 0; display: grid; grid-template-columns: 18px auto minmax(0, 1fr); align-items: start; gap: 2px 7px; }
  .tk-row > .tk-c-title > .tk-expander, .tk-row > .tk-c-title > .tk-done-btn { margin-top: 3px; }
  .tk-row > .tk-c-title > .tk-done-btn { grid-column: 2; }
  .tk-row > .tk-c-title > .tk-title, .tk-row > .tk-c-title > .tk-title-input { grid-column: 3; }
  .tk-row > .tk-c-title > .tk-title-marks { grid-column: 3; flex-wrap: wrap; }
  .tk-row > .tk-c-more { order: 2; flex: none; align-self: flex-start; }
  .tk-row > .tk-c[data-col] { order: 3; flex: none; }
  .tk-row > .tk-c-title + .tk-c[data-col] { margin-left: 68px; }
  .tk-row > .tk-c[data-col="created"], .tk-row > .tk-c[data-col="updated"], .tk-row > .tk-c[data-col="tags"], .tk-row > .tk-c[data-col="start"] { display: none; }
  .tk-row .tk-grip, .tk-row .tk-grip-space, .tk-rename-btn { display: none; }
  .tk-row .tk-check { opacity: 1; }
  .tk-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; padding: 1px 0; }
  .tk-title-marks:empty { display: none; }
  .tk-row.tk-sub .tk-c-title { padding-left: 14px; }
  .tk-row .tk-assign-name, .tk-row .tk-priority > span { display: none; }
  .tk-row .tk-priority { padding: 0 4px; }
  .tk-group-add { padding-left: 34px; }
  .tk-sub-add { padding-left: 48px; }
  .tk-timeline { --tkt-label: 128px; }
  .tkt-label .tk-avatars, .tkt-hint { display: none; }
  .tkcal-day { min-height: 64px; }
  .tkcal-chip-title { font-size: 11.5px; }
}
@container tkview (max-width: 520px) {
  .tk-group-more { padding-left: 14px; }
  .tkcal-day { align-items: center; }
  .tkcal-day.picked { box-shadow: inset 0 0 0 2px var(--accent); }
  .tkcal-add { display: none; }
  .tkcal-num { cursor: pointer; }
  .tkcal-week.head span { padding: 6px 0; text-align: center; }
}
@container tkmain (max-width: 620px) {
  #tracker-pane h1 { font-size: 17px; }
  .tk-top { gap: 8px; min-height: 52px; }
  .tk-project-btn { max-width: 150px; }
  #tk-help-btn { display: none; }
  #tk-add-focus { padding: 7px 10px; }
  .tk-stat { padding: 5px 8px; }
  .tk-meter { display: none; }
  .tk-tools { flex: 1 1 100%; margin-left: 0; }
  .tk-search-box { flex: 1; height: 36px; }
  #tk-search { font-size: 16px; }
  .tk-views { flex: 1 1 100%; }
  #tk-new-title { font-size: 16px; }
  #tk-add-task kbd { display: none; }
  .tk-title { font-size: 14.5px; }
  .tk-col { flex: 0 0 min(84cqw, 320px); max-width: none; scroll-snap-align: start; }
  .tk-board { scroll-snap-type: x proximity; }
  .tk-title-input, .tk-group-add input, .tk-col-add-box input { font-size: 16px; }
  .tk-bulk { bottom: 16px; }
  .tk-bulk-btn span { display: none; }
  .tk-bulk-btn { padding: 0 11px; height: 36px; }
}
@container tracker (max-width: 620px) {
  .tk-panel, .tk-panel-full .tk-panel { width: 100%; box-shadow: none; }
  .tkd-scroll { padding: 14px 16px 18px; }
  .tkd-title { font-size: 19px; }
  .tkd-hint { visibility: hidden; }
  #tkd-comment, .tk-rich, .tkc-edit textarea, .tkd-step-add input { font-size: 16px; }
  .tkd-follow span { display: none; }
  .tkd-follow { padding: 0 8px; }
}
@media (pointer: coarse) {
  .tk-tab, .tk-tool, .tk-preset, .tk-add-filter, .tk-save-view { min-height: 34px; }
  .tk-status, .tk-date, .tk-priority, .tk-assign { min-height: 30px; }
  .tk-row-btn { width: 30px; height: 30px; }
  .tk-icon-btn { width: 36px; height: 36px; }
}

/* ---------------- the create-task dialog (task-dialog.js) ----------------
   One place to say everything about a new task. Centred and roomy on a
   laptop, the whole screen on a phone; the tracker's own menus open over it,
   so it sits beneath them and above everything else. */
.tkn { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: start center; padding: 7vh 16px 16px; font: 13px/1.45 var(--font-ui); color: var(--text); }
.tkn[hidden] { display: none; }
.tkn-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--text) 34%, transparent); }
.tkn-box { position: relative; display: flex; flex-direction: column; width: min(720px, 100%); max-height: min(84vh, 860px); border: 1px solid var(--border); border-radius: 16px; background: var(--card); box-shadow: var(--e3); outline: none; overflow: hidden; }
.tkn.tkn-full { padding: 0; }
.tkn.tkn-full .tkn-box { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; }
.tkn.tkn-full .tkn-body { width: min(860px, 100%); margin: 0 auto; }
.tkn-head { flex: none; display: flex; align-items: center; gap: 6px; padding: 12px 12px 4px 20px; }
.tkn-head h2 { margin: 0; color: var(--text-quiet); font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; }
.tkn-head-space, .tkn-foot-space { flex: 1; }
.tkn-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 20px 16px; }
.tkn-title { width: 100%; padding: 6px 0 4px; border: 0; border-bottom: 1px solid transparent; background: none; color: var(--text); font: 650 21px/1.3 var(--font-ui); letter-spacing: -0.02em; outline: none; }
.tkn-title::placeholder { color: var(--text-faint); font-weight: 550; }
.tkn-title:focus { border-bottom-color: var(--border); }
.tkn-typed { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 22px; margin: 4px 0 10px; color: var(--text-quiet); font-size: 12px; }
.tkn-typed-hint { color: var(--text-faint); }
.tkn-typed-v { padding: 1px 7px; border-radius: 999px; background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.tkn-typed-miss { color: var(--data-red-ink, var(--data-red)); }
.tkn-restored { margin: 0 0 6px; padding: 6px 10px; border-radius: 8px; background: var(--accent-wash); color: var(--text-mid); font-size: 12.5px; }
.tkn-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px; margin: 4px 0 6px; padding: 8px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.tkn-field { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 34px; }
.tkn-k { flex: none; width: 76px; color: var(--text-quiet); font-size: 12.5px; }
.tkn-v { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; padding: 5px 9px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text); font: inherit; font-weight: 550; text-align: left; cursor: pointer; }
.tkn-v > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tkn-v:hover:not(:disabled), .tkn-v[aria-expanded="true"] { border-color: var(--border); background: var(--tk-hover-soft, var(--bg-soft)); }
.tkn-v.empty { color: var(--text-faint); font-weight: 500; }
.tkn-v:disabled { cursor: default; color: var(--text-mid); }
.tkn-v .ic { width: 14px; height: 14px; flex: none; color: var(--text-faint); }
.tkn-sec { margin-top: 14px; }
.tkn-sec h3 { margin: 0 0 6px; color: var(--text-quiet); font-size: 12px; font-weight: 600; }
.tkn-editor { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.tkn-editor .tkd-format { border-bottom: 1px solid var(--border-soft); }
.tkn-editor .tk-rich { min-height: 96px; max-height: 40vh; overflow-y: auto; padding: 10px 12px; outline: none; }
.tkn-steps { display: flex; flex-direction: column; gap: 2px; margin: 0 0 4px; padding: 0; list-style: none; }
.tkn-steps li { display: flex; align-items: center; gap: 9px; min-height: 30px; }
.tkn-steps li > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tkn-step-dot { flex: none; width: 14px; height: 14px; border: 1.5px solid var(--tk-line); border-radius: 50%; }
.tkn-step-input { width: 100%; padding: 7px 10px; border: 1px dashed var(--border); border-radius: 8px; background: none; color: var(--text); font: inherit; outline: none; }
.tkn-step-input:focus { border-style: solid; border-color: var(--accent); }
.tkn-files { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tkn-error { flex: none; margin: 0; padding: 8px 20px; background: color-mix(in srgb, var(--data-red) 12%, transparent); color: var(--data-red-ink, var(--data-red)); font-size: 12.5px; }
.tkn-ask { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--border); background: var(--accent-wash); }
.tkn-ask[hidden], .tkn-error[hidden] { display: none; }
.tkn-ask > span { flex: 1 1 180px; font-weight: 600; }
.tkn-foot { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--tk-foot, var(--bg-soft)); }
.tkn-more-box { display: inline-flex; align-items: center; gap: 7px; color: var(--text-mid); font-size: 12.5px; cursor: pointer; }
.tkn-foot kbd { margin-left: 6px; padding: 0 4px; border-radius: 4px; background: color-mix(in srgb, var(--on-accent, #fff) 18%, transparent); font: 11px var(--font-ui); opacity: 0.85; }
body.tkn-open { overflow: hidden; }
@media (max-width: 640px) {
  .tkn { padding: 0; place-items: stretch; }
  .tkn-box { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; }
  .tkn-fields { grid-template-columns: minmax(0, 1fr); }
  .tkn-head { padding: 10px 8px 2px 16px; }
  .tkn-body { padding: 2px 16px 14px; }
  .tkn-foot, .tkn-ask, .tkn-error { padding-left: 16px; padding-right: 16px; }
  .tkn-foot kbd, [data-tkn="expand"] { display: none; }
  .tkn-title { font-size: 19px; }
}
@media (prefers-reduced-motion: no-preference) {
  .tkn-box { animation: tkn-in 0.14s ease-out; }
  @keyframes tkn-in { from { opacity: 0; transform: translateY(6px) scale(0.99); } }
}

/* Naming somebody in a description: the list under the caret, and — in the
   dialog — the line that says who was taken off when the project changed. */
.tk-rich-mention { min-width: 220px; max-width: min(320px, calc(100vw - 16px)); z-index: 1310; }
.tk-rich-mention[hidden] { display: none; }
.tk-rich-mention .tk-menu-item.sel { background: var(--tk-hover); }
.tkn-dropped { margin: 0 0 8px; padding: 7px 10px; border-radius: 8px; background: color-mix(in srgb, var(--data-amber) 14%, transparent); color: var(--text-mid); font-size: 12.5px; }
.tkn-dropped[hidden] { display: none; }

/* The project of a timeline row or a calendar entry, on All projects. */
/* The title is what the row is for: the project gets the smaller share. */
.tkt-label .tk-home { flex: none; max-width: 30%; margin-left: 6px; font-size: 10.5px; }
.tkcal-chip .tk-home { flex: none; max-width: 38%; padding: 0 5px; font-size: 10.5px; line-height: 1.45; background: var(--card); }
