/* Work view styles (docs/PHASE-5-DESIGN.md section 6). The tokens these read
   live in index.html's :root, next to the ones the other tabs use. */

/* ---------- icons (app/tasks/icons.js) ---------- */
.st-icon, .pri-icon { flex: 0 0 auto; vertical-align: middle; }
.st-icon.st-backlog   { color: var(--st-backlog); }
.st-icon.st-unstarted { color: var(--st-unstarted); }
.st-icon.st-started   { color: var(--st-started); }
.st-icon.st-completed { color: var(--st-completed); }
.st-icon.st-canceled  { color: var(--st-canceled); }
.pri-icon { color: var(--muted); }
.pri-icon.pri-none { opacity: .5; }

/* ---------- shell (6.1) ---------- */
/* The tab fills main edge to edge: the sidebar and the list scroll on their own. */
.panel.tasks.active { margin: -22px; height: calc(100% + 44px); }
body[data-tab="tasks"] #projectSwitcher { display: none; } /* the sidebar has it */
.tk-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); height: 100%; font: var(--fs)/1.45 var(--font-ui); }
.tk-scrim { display: none; }
.tk-btn { font: inherit; font-size: var(--fs); color: var(--text); background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px 10px; cursor: pointer; white-space: nowrap; }
.tk-btn.ghost { background: transparent; }
.tk-btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.tk-btn:hover { background: var(--panel-2); }
.tk-btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.tk-btn:focus-visible, .tk-nav:focus-visible, .tk-group:focus-visible, .tk-search:focus-visible,
.tk-ws:focus-visible, .tk-menu-item:focus-visible, .tk-chip button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }

/* ---------- sidebar (6.2) ---------- */
.tk-side { border-right: 1px solid var(--border); background: var(--panel); overflow-y: auto; padding: 10px 8px 24px; }
.tk-ws { width: 100%; margin-bottom: 10px; font: inherit; font-weight: 600; padding: 5px 8px; border-radius: var(--radius); }
.tk-side-sec { display: flex; flex-direction: column; gap: 1px; margin-bottom: 14px; }
.tk-side-h { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 4px 8px; }
.tk-side-empty { color: var(--muted); font-size: var(--fs-sm); padding: 4px 8px; }
.tk-nav { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: transparent; border: 0;
  color: var(--text); border-radius: var(--radius); padding: 5px 8px; font: inherit; cursor: pointer; }
.tk-nav:hover { background: var(--panel-2); }
.tk-nav.active { background: var(--panel-2); font-weight: 600; }
.tk-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-nav-count { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.tk-nav-del { color: var(--muted); font-size: var(--fs-sm); padding: 0 4px; border-radius: 4px; visibility: hidden; }
.tk-nav:hover .tk-nav-del, .tk-nav-del.armed, .tk-nav-del:focus { visibility: visible; }
.tk-nav-del:hover, .tk-nav-del.armed { color: var(--bad); }
.tk-nav.dragging { opacity: .45; }
.tk-nav.drop-above { box-shadow: inset 0 2px 0 var(--accent); }
.tk-nav.drop-below { box-shadow: inset 0 -2px 0 var(--accent); }
.tk-archived { color: var(--muted); }
.tk-caret { display: inline-block; width: 8px; font-size: 10px; transition: transform var(--motion); }
.tk-caret.open { transform: rotate(90deg); }

/* ---------- main: header and filter row ---------- */
.tk-main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--bg); }
.tk-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--panel); }
.tk-menu-btn { display: none; }
.tk-crumb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tk-crumb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-crumb-meta, .tk-crumb-sep, .tk-count { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.tk-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 16px; border-bottom: 1px solid var(--border); background: var(--panel); }
.tk-search { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 10px; width: 220px; max-width: 100%; }
.tk-chip { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); overflow: hidden; }
.tk-chip button { font: inherit; font-size: var(--fs-sm); color: var(--text); background: transparent; border: 0; padding: 3px 8px; cursor: pointer; }
.tk-chip button:hover { background: var(--border); }
.tk-chip-k { color: var(--muted); }
.tk-chip-x { border-left: 1px solid var(--border) !important; padding: 3px 7px !important; color: var(--muted) !important; }

/* ---------- list (6.4) ---------- */
.tk-list { flex: 1; overflow-y: auto; container-type: inline-size; }
.tk-group { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; background: var(--panel-2);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; cursor: pointer; user-select: none; }
.tk-group-name { font-weight: 600; }
.tk-group-count, .tk-group-status { color: var(--muted); font-size: var(--fs-sm); }
.tk-group-status.s-blocked { color: var(--bad); }
.tk-chev { color: var(--muted); transform: rotate(90deg); transition: transform var(--motion); flex: 0 0 auto; }
.tk-group.collapsed .tk-chev { transform: none; }
.tk-row { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px 0 12px; border-bottom: 1px solid var(--border);
  background: var(--panel); cursor: pointer; min-width: 0; }
.tk-row:hover { background: var(--panel-2); }
.tk-row.sub { padding-left: 40px; }
.tk-handle { font: var(--fs-sm) var(--font-mono); color: var(--muted); min-width: 52px; white-space: nowrap; }
.tk-code { font: var(--fs-sm) var(--font-mono); color: var(--muted); white-space: nowrap; }
.tk-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-subcount { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.tk-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; margin-left: auto; }
.tk-r { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.tk-r-project { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.tk-tag { border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; font-size: 11px; color: var(--muted); }
.tk-sig { display: inline-flex; align-items: center; gap: 2px; }
.tk-blocked { color: var(--bad); border: 1px solid currentColor; border-radius: 999px; padding: 0 6px; font-size: 11px; }
.tk-r-est { min-width: 14px; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.tk-avatar { width: 20px; height: 20px; border-radius: 50%; justify-content: center; font-size: 9.5px; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.tk-avatar.none { border-style: dashed; background: transparent; }
.tk-r-updated { min-width: 34px; justify-content: flex-end; }
.tk-empty { color: var(--muted); padding: 48px 16px; text-align: center; }
/* Properties drop out right to left as the list narrows. */
@container (max-width: 900px) { .tk-r-updated, .tk-r-tags { display: none; } }
@container (max-width: 720px) { .tk-r-project, .tk-r-est { display: none; } }
@container (max-width: 560px) { .tk-r-signals, .tk-row .tk-handle { display: none; } }

/* ---------- menus (pickers.js) ---------- */
.tk-menu { position: fixed; z-index: 50; min-width: 200px; max-width: 320px; max-height: min(70vh, 520px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 4px; font: var(--fs)/1.4 var(--font-ui); }
.tk-menu-search { width: 100%; font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px 8px; margin-bottom: 4px; }
.tk-menu-h { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 6px 8px 2px; }
.tk-menu-sep { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.tk-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: transparent; border: 0;
  color: var(--text); font: inherit; padding: 5px 8px; border-radius: 4px; cursor: pointer; }
.tk-menu-item:hover:not(:disabled) { background: var(--panel-2); }
.tk-menu-item:disabled { color: var(--muted); cursor: default; opacity: .6; }
.tk-mi-icon { display: inline-flex; width: 16px; justify-content: center; }
.tk-mi-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-mi-hint { color: var(--muted); font-size: var(--fs-sm); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-mi-check { width: 12px; color: var(--accent); }
.tk-menu-empty { color: var(--muted); padding: 6px 8px; }
.tk-save-form { display: flex; flex-direction: column; gap: 6px; padding: 6px; min-width: 240px; }
.tk-save-form label { font-size: var(--fs-sm); color: var(--muted); }
.tk-save-form input { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 5px 8px; }
.tk-save-err { color: var(--bad); font-size: var(--fs-sm); min-height: 0; }
.tk-save-err:empty { display: none; }

/* ---------- list additions for the peek and create (6.4, 6.8) ---------- */
.tk-row.open { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--accent); }
.tk-group-add { margin-left: auto; font: inherit; font-size: 15px; line-height: 1; color: var(--muted); background: transparent;
  border: 0; border-radius: 4px; padding: 2px 6px; cursor: pointer; visibility: hidden; }
.tk-group:hover .tk-group-add, .tk-group-add:focus-visible { visibility: visible; }
.tk-group-add:hover { color: var(--text); background: var(--border); }
.tk-empty .tk-btn { margin-top: 12px; }

/* ---------- peek panel and task page (6.7) ---------- */
.tk-layout { grid-template-columns: 232px minmax(0, 1fr) auto; position: relative; }
.tk-peek { width: var(--peek-w, 480px); min-width: 0; border-left: 1px solid var(--border); background: var(--panel);
  overflow-y: auto; position: relative; container-type: inline-size; box-shadow: -8px 0 24px rgba(0,0,0,.08); }
.tk-peek[hidden] { display: none; }
/* The task page gives the panel the main area: the list steps aside. */
.tk-layout.page-open { grid-template-columns: 232px minmax(0, 1fr); }
.tk-layout.page-open .tk-main { display: none; }
.tk-peek.full { width: auto; border-left: 0; box-shadow: none; }
.pk-resize { position: absolute; top: 0; bottom: 0; left: -3px; width: 6px; cursor: col-resize; z-index: 2; }
.tk-peek.full .pk-resize { display: none; }
body.pk-resizing { cursor: col-resize; user-select: none; }
.pk-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--panel); z-index: 1; }
.pk-icon-btn { padding: 4px 6px; display: inline-flex; color: var(--muted); }
.pk-icon-btn:hover { color: var(--text); }
.pk-notice { margin: 10px 16px 0; padding: 8px 10px; border: 1px solid var(--warn); border-radius: var(--radius);
  background: color-mix(in srgb, var(--warn) 10%, transparent); font-size: var(--fs-sm); }
.pk-body { display: flex; flex-direction: column; }
.pk-main { padding: 14px 16px 24px; min-width: 0; order: 2; }
.pk-props { padding: 12px 16px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 92px minmax(0, 1fr);
  gap: 2px 8px; align-content: start; order: 1; }
/* Wide enough (the task page, or a widened peek): properties take the right. */
@container (min-width: 720px) {
  .pk-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; }
  .pk-main { order: 0; padding: 20px 28px 32px; }
  .pk-props { order: 0; border-bottom: 0; border-left: 1px solid var(--border); padding: 16px; min-height: 100%; }
}
.pk-parent { font: inherit; font-size: var(--fs-sm); color: var(--muted); background: transparent; border: 0; padding: 0;
  margin-bottom: 6px; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.pk-parent:hover { color: var(--text); text-decoration: underline; }
.pk-title { font-size: 18px; font-weight: 600; line-height: 1.35; margin: 0 0 10px; overflow-wrap: anywhere; border-radius: 4px; }
.pk-title.editable, .pk-desc.editable { cursor: text; }
.pk-title.editable:hover, .pk-desc.editable:hover { background: var(--panel-2); }
.pk-title-input, .pk-desc-input { width: 100%; font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px 6px; resize: none; overflow: hidden; }
.pk-title-input { font-size: 18px; font-weight: 600; line-height: 1.35; margin: 0 0 10px; }
.pk-desc-input { min-height: 96px; resize: vertical; overflow: auto; }
.pk-title-input:focus, .pk-desc-input:focus, .pk-add:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.pk-desc { padding: 2px 4px; margin: 0 -4px; border-radius: 4px; overflow-wrap: anywhere; }
.pk-desc-bar { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.pk-add-desc { font: inherit; color: var(--muted); background: transparent; border: 0; padding: 2px 0; cursor: text; }
.pk-add-desc:hover { color: var(--text); }
.pk-sec { margin-top: 20px; }
.pk-sec-h { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.pk-subrow { display: flex; align-items: center; gap: 8px; width: 100%; font: inherit; color: var(--text); background: transparent; border: 0;
  border-bottom: 1px solid var(--border); padding: 6px 2px; text-align: left; cursor: pointer; min-width: 0; }
.pk-subrow:hover { background: var(--panel-2); }
.pk-add { width: 100%; font: inherit; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid transparent;
  padding: 6px 2px; border-radius: 4px; }
.pk-add::placeholder { color: var(--muted); }
.pk-check { display: flex; align-items: center; gap: 8px; padding: 4px 2px; }
.pk-check > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pk-check.done > span { color: var(--muted); text-decoration: line-through; }
.pk-check input { margin: 0; accent-color: var(--accent); }
.pk-x { display: inline-flex; color: var(--muted); background: transparent; border: 0; padding: 2px; border-radius: 4px; cursor: pointer; visibility: hidden; }
.pk-check:hover .pk-x, .pk-x:focus-visible { visibility: visible; }
.pk-x:hover { color: var(--bad); }
.pk-link { display: flex; align-items: center; gap: 6px; padding: 3px 0; color: var(--muted); min-width: 0; }
.pk-link a, .pk-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-link a { color: var(--accent); text-decoration: none; }
.pk-link a:hover { text-decoration: underline; }
.pk-act { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; font-size: var(--fs-sm); }
.pk-act .tk-avatar { display: inline-flex; align-items: center; flex: 0 0 auto; }
.pk-act-text { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--muted); }
.pk-act-text b { color: var(--text); font-weight: 600; }
.pk-act-time { color: var(--muted); white-space: nowrap; }
.pk-muted, .pk-empty { color: var(--muted); }
.pk-muted { font-size: var(--fs-sm); }
.pk-prop { display: contents; }
.pk-prop-k { color: var(--muted); font-size: var(--fs-sm); padding: 6px 0; }
.pk-prop-v { font-size: var(--fs-sm); padding: 6px 4px; }
.pk-rels { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px 0; }

/* ---------- property pills (props.js) ---------- */
.pk-pill { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; max-width: 100%; min-height: 28px;
  font: inherit; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: var(--radius);
  padding: 3px 6px; text-align: left; cursor: pointer; justify-self: start; }
.pk-pill:hover:not(:disabled) { background: var(--panel-2); border-color: var(--border); }
.pk-pill:disabled { cursor: default; }
.pk-pill:focus-visible, .pk-subrow:focus-visible, .pk-rel:focus-visible, .tk-group-add:focus-visible,
.pk-title.editable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pk-pill > span:not(.tk-tag):not(.tk-avatar):not(.pk-rel) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-pill .tk-avatar { display: inline-flex; align-items: center; }
.pk-hint { color: var(--muted); font-size: 11px; border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; }
.pk-rel { display: inline-flex; align-items: center; gap: 4px; font: var(--fs-sm) var(--font-mono); color: var(--text);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; }
button.pk-rel { cursor: pointer; }
.pk-wide-menu { max-width: 420px; min-width: 300px; }

/* ---------- create modal (6.8) ---------- */
.tk-create { width: min(640px, calc(100vw - 32px)); padding: 0; font: var(--fs)/1.45 var(--font-ui); box-shadow: 0 16px 48px rgba(0,0,0,.3); }
.tkc-form { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.tkc-head { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--muted); }
.tkc-ws { font-weight: 600; color: var(--text); }
.tkc-title, .tkc-desc { width: 100%; font: inherit; color: var(--text); background: transparent; border: 0; resize: none; padding: 2px 0; }
.tkc-title { font-size: 17px; font-weight: 600; overflow: hidden; }
.tkc-desc { min-height: 60px; resize: vertical; }
.tkc-title:focus, .tkc-desc:focus { outline: none; }
.tkc-pills { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.tkc-pills .pk-pill { border-color: var(--border); background: var(--panel-2); font-size: var(--fs-sm); min-height: 26px; }
.tkc-err { color: var(--bad); font-size: var(--fs-sm); }
.tkc-err:empty { display: none; }
.tkc-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); margin: 6px -16px -14px; padding: 10px 16px; }
.tkc-more { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--muted); cursor: pointer; }

/* ---------- project page (6.3, project.js) ---------- */
.tk-proj { border-bottom: 1px solid var(--border); background: var(--panel); padding: 10px 16px; max-height: 45vh; overflow-y: auto;
  box-shadow: inset 3px 0 0 var(--pj-color, var(--accent)); }
.tk-proj[hidden] { display: none; }
.pj-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.pj-toggle, .pj-color { display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0;
  border-radius: 4px; padding: 4px; cursor: pointer; color: var(--muted); }
.pj-toggle:hover, .pj-color:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.pj-color:disabled { cursor: default; }
.pj-color .tk-dot { width: 12px; height: 12px; }
.pj-toggle.collapsed .tk-chev { transform: none; }
.pj-name { font-size: 16px; font-weight: 600; margin: 0; min-width: 0; overflow-wrap: anywhere; border-radius: 4px; padding: 1px 4px; }
.pj-name.editable { cursor: text; }
.pj-name.editable:hover { background: var(--panel-2); }
.pj-input { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 3px 6px; min-width: 0; }
.pj-name-input { font-size: 16px; font-weight: 600; width: min(420px, 100%); }
.pj-meta .pj-input { width: 100%; }
.pj-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
/* The status the server sent; the colours only mark what it said. */
.pj-status { font: inherit; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 9px; border: 1px solid var(--border);
  color: var(--muted); background: var(--panel); white-space: nowrap; cursor: pointer; }
.pj-status:disabled { cursor: default; }
.pj-status.s-done { color: var(--ok); border-color: var(--ok); }
.pj-status.s-in_progress { color: var(--warn); border-color: var(--warn); }
.pj-status.s-blocked { color: var(--bad); border-color: var(--bad); }
.pj-status.s-parked { border-style: dashed; }
.pj-status.ovr::after, .tk-group-status.ovr::after { content: "\2732"; font-size: 9px; margin-left: 3px; vertical-align: super; }
.pj-prog { display: inline-flex; align-items: center; gap: 8px; }
.pj-bar { width: 120px; height: 6px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); overflow: hidden; }
.pj-bar > span { display: block; height: 100%; background: var(--pj-color, var(--accent)); transition: width var(--motion); }
.pj-body { padding: 8px 0 2px 30px; display: flex; flex-direction: column; gap: 8px; }
.pj-desc { white-space: pre-wrap; }
.pj-meta { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 0 8px; align-items: center; }
.pj-meta-v { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--fs-sm); }
.pj-ref { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-ref a { color: var(--accent); text-decoration: none; }
.pj-ref a:hover { text-decoration: underline; }
.pj-small { font-size: var(--fs-sm); padding: 1px 8px; }
.pj-phase-form textarea { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 5px 8px; resize: vertical; min-height: 64px; }
/* The phase menu's `...` sits right, before the `+`. */
.tk-group-more { display: inline-flex; align-items: center; }
.tk-group-more + .tk-group-add { margin-left: 0; }
.pj-toggle:focus-visible, .pj-color:focus-visible, .pj-status:focus-visible, .pj-name.editable:focus-visible
  { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 767px) {
  .pj-body { padding-left: 0; }
  .pj-bar { width: 72px; }
}

/* The peek overlays the list where both would not fit side by side. */
@media (max-width: 1099px) {
  .tk-layout.peek-open { grid-template-columns: 232px minmax(0, 1fr); }
  .tk-layout.peek-open .tk-peek { position: absolute; top: 0; right: 0; bottom: 0; z-index: 15;
    max-width: calc(100% - 48px); box-shadow: -12px 0 32px rgba(0,0,0,.22); }
}

/* ---------- narrow screens: the sidebar is a drawer ---------- */
@media (max-width: 767px) {
  .panel.tasks.active { margin: -22px; }
  .tk-layout, .tk-layout.peek-open, .tk-layout.page-open { grid-template-columns: minmax(0, 1fr); position: relative; }
  .tk-layout.peek-open .tk-peek { width: 100%; max-width: none; }
  .pk-resize { display: none; }
  .tk-side { position: absolute; z-index: 20; top: 0; bottom: 0; left: 0; width: 260px; transform: translateX(-100%);
    transition: transform var(--motion); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
  .tk-layout.drawer-open .tk-side { transform: none; }
  .tk-layout.drawer-open .tk-scrim { display: block; position: absolute; inset: 0; z-index: 10; background: rgba(0,0,0,.3); }
  .tk-menu-btn { display: inline-block; }
  .tk-head { flex-wrap: wrap; }
  .tk-search { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --motion: 0s; }
}
