/* Tasks (js/tasks): a Linear-style list and board. Dense rows, quiet lines, keyboard first, in the colours of
   styles.css. No uppercase anywhere: the brand stays lowercase. */

:root { --tk-high: #B07A00; --tk-hover: rgba(43, 53, 198, .05); --tk-side: 236px; }
:root[data-theme="dark"] { --tk-high: #FCCE21; --tk-hover: rgba(162, 169, 255, .08); }

.view.tk-page { max-width: none; padding: 0; }
.tk { display: grid; grid-template-columns: var(--tk-side) minmax(0, 1fr); min-height: calc(100vh - 60px); }
svg.tk-si, svg.tk-pi, svg.tk-ti { display: block; flex: none; }

/* ---------- side menu */

.tk-side {
  position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; display: grid; gap: 18px; align-content: start;
  padding: 16px 10px 32px; border-right: 2px solid var(--keyline); background: var(--surface);
}
.tk-side-sec { display: grid; gap: 2px; }
.tk-side-head { font-size: 11.5px; font-weight: 800; color: var(--faint); padding: 0 8px 4px; }
.tk-side-link {
  display: flex; align-items: center; gap: 9px; min-width: 0; padding: 5px 8px; border-radius: var(--radius-s);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 13px; border: 1.5px solid transparent;
}
.tk-side-link:hover { background: var(--sunk); color: var(--ink); }
/* The view you're on: a lavender plastic chip, so the gold chip in the header stays the one "you are here". */
.tk-side-link[aria-current="page"] { background: var(--face-lav); color: var(--face-ink); font-weight: 800; border-color: var(--keyline); box-shadow: inset 0 -2px 0 rgba(5, 8, 60, .14), 0 2px 0 var(--keyline); }
.tk-side-icon { display: inline-flex; width: 16px; justify-content: center; color: var(--muted); flex: none; }
.tk-side-link[aria-current="page"] .tk-side-icon { color: var(--face-ink); }
.tk-side-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-side-row { display: flex; align-items: center; min-width: 0; }
.tk-side-row .tk-side-link { flex: 1; }
.tk-side-x { width: 24px; height: 24px; opacity: 0; }
.tk-side-row:hover .tk-side-x, .tk-side-x:focus-visible { opacity: 1; }
.tk-side-hint { font-size: 12px; color: var(--muted); padding: 0 8px; line-height: 1.4; }
.tk-proj-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--accent); flex: none; }
.tk-proj-dot.is-paused { background: var(--line-strong); }

/* ---------- head, filters, selection */

.tk-main { min-width: 0; padding: 14px 20px 40px; }
.tk-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 10px; }
.tk-title-row { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.tk-title-row h1 { font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-count { color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.tk-view-select { display: none; width: auto; max-width: 100%; font-weight: 700; }
.tk-head-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tk-tool { display: inline-flex; align-items: center; gap: 6px; }
.tk-tool[hidden] { display: none; }

.tk-seg { display: inline-flex; border: 1.5px solid var(--keyline); border-radius: 9px; overflow: hidden; background: var(--raised); box-shadow: 0 2px 0 var(--keyline); }
.tk-seg-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 10px; border: 0; background: none;
  color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.tk-seg-btn + .tk-seg-btn { border-left: 1.5px solid var(--line); }
.tk-seg-btn:hover { color: var(--ink); }
.tk-seg-btn[aria-pressed="true"] { background: var(--cobalt); color: #FFFFFF; box-shadow: inset 0 -2px 0 #1D26A3, inset 0 2px 0 rgba(255, 255, 255, .2); }
.tk-seg-wide { display: flex; }
.tk-seg-wide .tk-seg-btn { flex: 1; justify-content: center; min-height: 32px; }

kbd.tk-kbd {
  display: inline-block; padding: 2px 5px; border: 1.5px solid var(--line-strong); border-bottom-width: 3px; border-radius: 5px;
  background: var(--raised); color: var(--muted); font: 700 11px/1.1 var(--mono); white-space: nowrap; vertical-align: middle;
}
.btn kbd.tk-kbd { margin-left: 2px; }

.tk-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 10px; }
.tk-search-wrap { position: relative; display: flex; align-items: center; flex: 0 1 300px; min-width: 180px; }
.tk-search-wrap .tk-ti { position: absolute; left: 10px; color: var(--faint); pointer-events: none; }
input.tk-search { min-height: 30px; padding: 4px 10px 4px 31px; font-size: 13px; }
.tk-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.tk-chip { display: inline-flex; align-items: stretch; max-width: 100%; border: 1.5px solid var(--keyline); border-radius: 999px; background: var(--face-lav); font-size: 12.5px; font-weight: 700; overflow: hidden; box-shadow: inset 0 -2px 0 rgba(5, 8, 60, .14), 0 2px 0 var(--keyline); }
.tk-chip .tk-chip-main, .tk-chip .tk-chip-x { color: var(--face-ink); }
.tk-chip-main { display: inline-flex; align-items: center; gap: 6px; min-width: 0; padding: 3px 4px 3px 9px; border: 0; background: none; color: var(--ink); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-chip-x { display: inline-flex; align-items: center; padding: 0 9px 0 4px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.tk-chip-main:hover, .tk-chip-x:hover { color: var(--accent); }
.tk-clear { padding: 2px 4px; border: 0; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.tk-clear:hover { color: var(--accent); }

.tk-bulk {
  position: sticky; top: 8px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; padding: 8px 10px;
  border-radius: 14px; background: var(--hud); color: var(--paper); border: 2px solid #000000;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), 0 3px 0 #000000, 0 12px 28px rgba(5, 8, 60, .25);
}
.tk-bulk[hidden] { display: none; }
.tk-bulk-n { margin-right: 6px; font-size: 13px; font-weight: 800; }
.tk-bulk .btn { --keyline: #000000; --btn-face: rgba(255, 255, 255, .1); --btn-shade: rgba(0, 0, 0, .3); --btn-tint: rgba(255, 255, 255, .12); color: var(--paper); }
.tk-bulk .btn:hover { color: #FFFFFF; }
.tk-bulk kbd.tk-kbd { background: transparent; border-color: rgba(236, 237, 255, .3); color: var(--top-muted); }

/* ---------- icons and faces */

.tk-si-todo { color: var(--todo-dot); } .tk-si-doing { color: var(--doing-dot); } .tk-si-blocked { color: var(--blocked-dot); }
.tk-si-done { color: var(--done-dot); } .tk-si-dropped { color: var(--dropped-dot); }
.tk-si .tk-cut { stroke: var(--surface); }
.tk-pi { color: var(--muted); }
.tk-pi .on { fill: currentColor; } .tk-pi .off { fill: var(--line-strong); }
.tk-pi-high { color: var(--tk-high); } .tk-pi-low { color: var(--faint); }
.tk-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; color: #FFFFFF; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.tk-avatar-none { border: 1.5px dashed var(--line-strong); background: transparent; }

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

.tk-list { border: 2px solid var(--keyline); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 0 var(--keyline); overflow: clip; }
.tk-group + .tk-group { border-top: 1.5px solid var(--line-strong); }
.tk-group-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 4px; min-height: 38px; padding: 0 8px 0 4px;
  background: var(--tray); border-bottom: 1.5px solid var(--line-strong);
}
.tk-group-toggle {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 6px; border: 0; border-radius: var(--radius-s);
  background: none; color: var(--ink); font-size: 13px; font-weight: 700; text-align: left; cursor: pointer;
}
.tk-group-toggle:hover { background: var(--tk-hover); }
.tk-caret { width: 0; height: 0; border-left: 5px solid var(--muted); border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .12s ease; flex: none; }
.tk-group-toggle[aria-expanded="true"] .tk-caret { transform: rotate(90deg); }
.tk-group-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-group-count { color: var(--muted); font-size: 12px; font-weight: 600; }
.tk-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: var(--radius-s); background: none; color: var(--muted); text-decoration: none; cursor: pointer;
}
.tk-icon-btn:hover { background: var(--tk-hover); color: var(--ink); }

.tk-row {
  position: relative; display: grid; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px 0 10px;
  grid-template-columns: 16px 22px 74px 22px minmax(0, 1fr) fit-content(30%) minmax(0, 150px) 84px 24px;
  border-bottom: 1px solid var(--line);
}
.no-project .tk-row { grid-template-columns: 16px 22px 74px 22px minmax(0, 1fr) fit-content(30%) 84px 24px; }
.no-project .tk-proj { display: none; }
.tk-rows .tk-row:last-child { border-bottom: 0; }
.tk-row:hover { background: var(--tk-hover); }
.tk-row.is-focus { background: var(--tk-hover); box-shadow: inset 2px 0 0 var(--accent); }
.tk-row.is-selected, .tk-row.is-selected.is-focus { background: var(--accent-soft); }
.tk-row:focus, .tk-card:focus { outline: none; }
.tk-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.tk-check { opacity: 0; transition: opacity .1s ease; }
.tk-row:hover .tk-check, .tk-row.is-focus .tk-check, .tk-card:hover .tk-check, .is-selected .tk-check, .has-selection .tk-check, .tk-check:focus-visible { opacity: 1; }
.tk-cell { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: none; color: inherit; cursor: pointer; flex: none; }
.tk-cell:hover { background: var(--line); }
.tk-key { overflow: hidden; text-overflow: ellipsis; }
.tk-title { min-width: 0; overflow: hidden; color: var(--ink); font-size: 13.5px; font-weight: 600; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.tk-title:hover { color: var(--accent); }
.s-done .tk-title, .s-dropped .tk-title { color: var(--muted); }
.s-dropped .tk-title { text-decoration: line-through; }
.tk-flags { display: flex; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; max-width: 340px; overflow: hidden; }
.tk-flag { display: inline-flex; align-items: center; gap: 3px; min-width: 0; overflow: hidden; color: var(--muted); font-size: 11.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.tk-flag-warn { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); }
.tk-flag-blocked { display: inline-block; max-width: 220px; padding: 1px 8px; border-radius: 999px; background: var(--blocked-bg); color: var(--blocked-ink); }
.tk-flag-bad { color: var(--blocked-ink); }
.tk-flag-quiet { font-style: italic; }
.tk-flag-count { flex: none; color: var(--faint); }
.tk-flag-art { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--face-sky); color: var(--face-ink); }
.tk-proj { min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.tk-due { color: var(--muted); font-size: 12px; font-weight: 600; text-align: right; white-space: nowrap; }
.tk-due-overdue { color: var(--blocked-ink); }
/* Late is said with a mark as well as colour, so it reads the same without colour. */
.tk-due-mark { display: inline-grid; place-items: center; width: 14px; height: 14px; margin-right: 4px; border-radius: 50%; background: var(--blocked-ink); color: var(--navy, #0b0f4a); font-size: 10px; font-weight: 800; line-height: 1; vertical-align: 1px; }
.tk-due-soon { color: var(--warn-ink); }
.tk-more { display: block; width: 100%; padding: 8px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--accent); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.tk-more:hover { background: var(--tk-hover); }
.tk-empty { margin-top: 4px; }
.tk-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 14px; color: var(--muted); font-size: 12px; }

/* ---------- board (position: relative keeps screen-reader text inside the scroller) */

.tk-board { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(272px, 1fr); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; overscroll-behavior-x: contain; }
.tk-col { display: grid; gap: 8px; align-content: start; min-width: 0; min-height: 200px; padding: 10px; border: 1.5px solid var(--line-strong); border-radius: 18px; background: var(--tray); box-shadow: inset 0 3px 0 rgba(5, 8, 60, .06); }
.tk-col.is-over { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.tk-col-head { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 2px 4px; }
.tk-col-head h2 { overflow: hidden; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.tk-col-head .tk-group-add { margin-left: auto; }
.tk-cards { display: grid; gap: 10px; }
.tk-card { display: grid; gap: 5px; min-width: 0; padding: 9px 11px 11px; border: 1.5px solid var(--keyline); border-radius: 12px; background: var(--surface); box-shadow: var(--slab-s); cursor: grab; transition: transform 80ms ease, box-shadow 80ms ease; }
.tk-card:hover { transform: translateY(-1px); box-shadow: inset 0 -3px 0 var(--shade), 0 3px 0 var(--keyline); }
.tk-card.is-focus { box-shadow: 0 0 0 2px var(--accent), var(--slab-s); }
.tk-card.is-selected { background: var(--accent-soft); }
.tk-card.is-dragging { opacity: .5; }
.tk-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tk-card-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tk-grow { flex: 1; }
.tk-card-title { display: flex; align-items: flex-start; gap: 4px; min-width: 0; }
.tk-card-title .tk-cell { margin-top: -1px; }
.tk-card .tk-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.tk-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.tk-card-meta:empty { display: none; }
.tk-card-meta .tk-proj { text-align: left; }
.tk-col-empty { padding: 20px 8px; border: 2px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: 12.5px; text-align: center; }
.tk-col .tk-more { border: 0; border-radius: var(--radius-s); }

/* ---------- menus (js/tasks/menu.js) */

.tk-menu {
  position: fixed; margin: 0; padding: 0; max-height: min(440px, calc(100vh - 16px)); overflow: hidden;
  border: 2px solid var(--keyline); border-radius: 14px; background: var(--raised); color: var(--ink); box-shadow: var(--shadow-lift);
}
.tk-menu::backdrop { background: transparent; }
.tk-menu-inner { display: flex; flex-direction: column; max-height: inherit; }
input.tk-menu-input { min-height: 40px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; font-size: 13.5px; }
input.tk-menu-input:focus-visible { outline: none; border-color: var(--line); }
.tk-menu-list { max-height: 340px; padding: 4px; overflow-y: auto; }
.tk-menu-item { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.tk-menu-item.is-active { background: var(--accent-soft); }
.tk-menu-icon { display: inline-flex; justify-content: center; width: 18px; flex: none; color: var(--muted); }
.tk-menu-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-menu-hint { max-width: 45%; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.tk-menu-num { width: 12px; color: var(--faint); font: 600 11px var(--mono); text-align: right; }
.tk-menu-now { color: var(--accent); font-weight: 800; }
.tk-tick { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px; border: 1.5px solid var(--line-strong); border-radius: 4px; font-size: 11px; }
.tk-tick.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.tk-menu-section { padding: 8px 8px 4px; color: var(--faint); font-size: 11.5px; font-weight: 700; }
.tk-menu-empty { padding: 12px; color: var(--muted); font-size: 13px; }
.tk-pop-inner { display: grid; gap: 12px; padding: 14px; }
.tk-pop-title { font-size: 14px; }

.tk-keys { width: min(520px, calc(100% - 32px)); }
.tk-keys-list { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 14px; max-height: 60vh; margin: 0; overflow-y: auto; }
.tk-keys-list dt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.tk-keys-list dd { margin: 0; font-size: 13px; }

/* ---------- new task box */

.tk-new { width: min(640px, calc(100% - 32px)); }
.tk-new-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tk-new select.tk-new-project { width: auto; max-width: 60%; min-height: 30px; font-size: 12.5px; font-weight: 600; }
.tk-new input.tk-new-title { padding: 4px 0; border: 0; background: transparent; font-size: 19px; font-weight: 700; }
.tk-new textarea.tk-new-detail { min-height: 64px; padding: 2px 0; border: 0; background: transparent; }
.tk-new input.tk-new-title, .tk-new textarea.tk-new-detail { border-bottom: 2px solid transparent; border-radius: 0; }
.tk-new input.tk-new-title:focus-visible, .tk-new textarea.tk-new-detail:focus-visible { outline: none; border-bottom-color: var(--focus); }
.tk-new-props { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.tk-new-pill { display: grid; flex: 1 1 128px; gap: 3px; }
.tk-new-pill select, .tk-new-pill input { min-height: 32px; color: var(--ink); font-size: 13px; font-weight: 600; }
.tk-new-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.dialog .tk-new-more { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; color: var(--ink); font-size: 13px; }
.tk-new-keys { font-size: 12px; }

/* ---------- peek panel */

.tk-peek {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; display: flex; flex-direction: column; width: min(500px, 100vw);
  border-left: 2px solid var(--keyline); background: var(--surface); box-shadow: -12px 0 32px rgba(5, 8, 60, .16); animation: tk-slide .16s ease-out;
}
.tk-peek[hidden] { display: none; }
.tk-peek:focus { outline: none; }
@keyframes tk-slide { from { transform: translateX(16px); opacity: 0; } }
/* On a wide screen the list makes room for the panel instead of sitting under it. */
@media (min-width: 1700px) { body.tk-peeking .tk-main { padding-right: 520px; } }
.tk-peek-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 2px solid var(--keyline); background: var(--hud); color: var(--top-ink); }
.tk-peek-bar .tk-peek-project { color: var(--top-muted); }
.tk-peek-bar .tk-icon-btn { color: var(--top-muted); }
.tk-peek-bar .tk-icon-btn:hover { background: var(--top-field); color: #FFFFFF; }
.tk-peek-bar :focus-visible { outline-color: var(--gold); }
.tk-peek-project { flex: 1; min-width: 0; overflow: hidden; color: var(--muted); font-size: 12.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.tk-peek-tools { display: flex; gap: 2px; }
.tk-peek-body { flex: 1; display: grid; align-content: start; gap: 14px; padding: 14px 18px 28px; overflow-y: auto; }
textarea.tk-peek-title, .tk-peek-title { min-height: 0; padding: 2px 0; border: 0; background: transparent; font-size: 19px; font-weight: 800; line-height: 1.3; resize: none; overflow: hidden; overflow-wrap: anywhere; }
textarea.tk-peek-title:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.tk-peek-note { display: grid; gap: 8px; padding: 8px 12px; border-radius: var(--radius-s); font-size: 13px; }
.tk-peek-warn { background: var(--warn-bg); color: var(--warn-ink); }
.tk-peek-blocked { display: block; background: var(--blocked-bg); color: var(--blocked-ink); overflow-wrap: anywhere; }
.tk-peek-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.tk-props { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 2px 8px; margin: 0; }
.tk-prop { display: contents; }
.tk-prop dt { align-self: center; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tk-prop dd { min-width: 0; margin: 0; }
.tk-prop-btn {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin-left: -8px; padding: 5px 8px; border: 0; border-radius: var(--radius-s);
  background: none; color: var(--ink); font-size: 13px; font-weight: 600; text-align: left; cursor: pointer;
}
.tk-prop-btn:hover { background: var(--sunk); }
.tk-peek-facts { color: var(--muted); font-size: 12px; }
.tk-peek-part { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.tk-peek-part h3 { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.tk-peek-detail { min-height: 84px; }
.tk-peek-comment { display: grid; gap: 8px; }
.tk-peek-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 11.5px; }

/* ---------- narrower screens */

@media (max-width: 899px) {
  .tk { grid-template-columns: minmax(0, 1fr); }
  .tk-side { display: none; }
  .tk-view-select { display: block; }
  .tk-title-row { flex-wrap: wrap; align-items: center; }
  .tk-title-row h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tk-main { padding: 12px 12px 32px; }
  .tk-foot, .tk-palette-btn, .tk-peek-keys { display: none; }
}
@media (max-width: 720px) {
  .tk-seg-label { display: none; }
  .tk-search-wrap { flex: 1 1 100%; }
  .tk-row, .no-project .tk-row { grid-template-columns: 22px minmax(0, 1fr) auto 24px; gap: 8px; min-height: 44px; padding: 0 10px; }
  .tk-row .tk-check, .tk-row .tk-priority, .tk-row .tk-key, .tk-row .tk-flags, .tk-row .tk-proj { display: none; }
  .tk-board { grid-auto-columns: minmax(260px, 86vw); scroll-snap-type: x proximity; }
  .tk-col { scroll-snap-align: start; }
  .tk-props { grid-template-columns: 76px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .tk-peek { animation: none; } .tk-caret, .tk-check { transition: none; } }

/* ---------- sorting tasks into a type (#/sort/art-output, js/tasks/views/sort-types.js) */
.st-bar { position: sticky; top: 8px; z-index: 5; margin-bottom: 18px; }
.st-bar-row { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: end; }
.st-bar-row .field { flex: 0 1 260px; margin: 0; }
.st-closed { display: flex; align-items: center; gap: 8px; font-weight: 700; min-height: 40px; }
.st-closed input { width: 18px; height: 18px; accent-color: var(--accent); }
.st-summary { flex: 1 1 220px; margin: 0; color: var(--muted); }
.st-hint { margin: 0 0 8px; }
.st-aside { margin: 8px 0 0; }
.st-list { list-style: none; margin: 0; padding: 0; }
.st-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 4px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.st-row:first-child { border-top: 0; }
.st-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.st-title { cursor: pointer; min-width: 0; }
.st-meta { font-size: 13px; text-align: right; }
.st-open { font-size: 13px; font-weight: 700; }
@media (max-width: 640px) {
  .st-bar { position: static; }
  .st-row { grid-template-columns: auto 1fr auto; }
  .st-meta { grid-column: 2 / -1; text-align: left; }
}
