/* Officer hub: Assignments (the executive board tracker). Tokens and shared pieces come from app.css
   and hub.css; everything here is prefixed tk- so it cannot reach another section. */

.tk { --tk-cols: 148px minmax(0, 1fr) 150px 146px 62px 50px; }
.tk .hub-head { margin-bottom: 14px; }

/* ---------- the counts (quick filters) ---------- */

.tk-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.tk-metric {
  display: grid; align-content: start; gap: 2px; min-width: 0;
  padding: 12px 16px; text-align: left; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; transition: border-color 0.15s, background 0.15s;
}
.tk-metric:hover { border-color: var(--line-strong); background: var(--surface-2); }
.tk-metric[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--surface-2); }
.tk-metric-num { font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tk-metric-label { color: var(--muted); font-size: 13px; font-weight: 650; }
.tk-metric-detail { color: var(--muted); font-size: 12px; font-weight: 600; }
.tk-metric-detail:empty { display: none; }
.tk-metric.is-alert .tk-metric-num { color: var(--danger); }
.tk-metric.is-alert { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }

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

.tk-qa { position: relative; margin: 0 0 6px; }
.tk-qa-label { font-size: 12px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.tk-qa-row { display: flex; gap: 8px; align-items: stretch; }
.tk-qa-field { position: relative; flex: 1 1 auto; min-width: 0; }
.tk-qa-plus {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--accent); font-weight: 800; font-size: 17px; line-height: 1;
  pointer-events: none;
}
input[type="text"].tk-qa-input {
  min-height: 52px; padding-left: 46px; border-radius: 12px;
  background: var(--surface); border-color: var(--line-strong);
}
input[type="text"].tk-qa-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); outline: none; }
.tk-qa-add, .tk-qa-helpbtn { min-height: 52px; flex: none; border-radius: 12px; }
.tk-qa-add { padding: 0 22px; }
.tk-qa-helpbtn[aria-expanded="true"] { border-color: var(--accent); }

.tk-qa-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; }
.tk-chip {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 13px; font-weight: 650; line-height: 1.2;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong);
  max-width: 100%; overflow-wrap: anywhere;
}
.tk-chip.is-title { background: transparent; border-color: transparent; padding-left: 2px; font-weight: 700; }
.tk-chip.is-title::before { content: "\201C"; }
.tk-chip.is-title::after { content: "\201D"; }
.tk-chip.is-owner { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tk-chip.is-due { border-color: color-mix(in srgb, var(--free) 45%, transparent); background: color-mix(in srgb, var(--free) 10%, transparent); }
.tk-chip.is-priority { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.tk-chip.is-hours { font-variant-numeric: tabular-nums; }
.tk-chip.is-warn { color: var(--warn); border-style: dashed; border-color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); }

.tk-qa-note { margin: 6px 0 0; font-size: 14px; font-weight: 600; }
.tk-qa-note:empty { margin: 0; }
.tk-qa-note.is-ok { color: var(--ok); }
.tk-qa-note.is-warn { color: var(--warn); }
.tk-qa-note.is-error { color: var(--danger); }

.tk-qa-help {
  position: absolute; z-index: 8; right: 0; top: calc(100% + 6px);
  width: min(560px, 100%); padding: 16px 18px;
  border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface);
  box-shadow: var(--shadow);
}
.tk-qa-help-title { font-weight: 700; margin: 0 0 8px; }
.tk-qa-tips { display: grid; gap: 6px; margin: 0 0 14px; }
.tk-qa-tip { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.tk-qa-tip dt { margin: 0; }
.tk-qa-tip dd { margin: 0; color: var(--muted); font-size: 14px; }
.tk-qa-help code, .tk-qa-example code {
  font: 600 13px/1.4 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent); background: var(--surface-2); padding: 1px 6px; border-radius: 6px;
}
.tk-qa-examples { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.tk-qa-example {
  width: 100%; display: grid; gap: 3px; justify-items: start; text-align: left; cursor: pointer;
  padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit;
}
.tk-qa-example:hover { border-color: var(--accent); }
.tk-qa-example code { background: transparent; padding: 0; overflow-wrap: anywhere; }
.tk-qa-example-says { color: var(--muted); font-size: 13px; }
.tk-qa-help-foot { margin: 0; font-size: 13px; }

/* ---------- toolbar: views, search, owner, select ---------- */

.tk-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; margin: 22px 0 10px; }
.tk-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); max-width: 100%; }
.tk-seg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font: inherit; font-weight: 650; font-size: 14px; white-space: nowrap; cursor: pointer;
}
.tk-seg-btn:hover { color: var(--text); }
.tk-seg-btn[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.tk-seg-btn:focus-visible { outline-offset: -2px; }
.tk-seg-count {
  min-width: 22px; padding: 0 6px; border-radius: 999px; text-align: center;
  background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 700; line-height: 20px; font-variant-numeric: tabular-nums;
}
.tk-seg-btn[aria-pressed="true"] .tk-seg-count { color: var(--text); }

.tk-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk-search { position: relative; width: 250px; }
.tk .tk-search input[type="search"] { min-height: 40px; padding-left: 34px; font-size: 15px; }
.tk-search-icon {
  position: absolute; left: 12px; top: 50%; width: 13px; height: 13px; margin-top: -8px;
  border: 2px solid var(--muted); border-radius: 50%; pointer-events: none;
}
.tk-search-icon::after {
  content: ""; position: absolute; right: -5px; bottom: -5px; width: 2px; height: 6px;
  background: var(--muted); border-radius: 1px; transform: rotate(-45deg);
}
.tk .tk-owner-select { width: 170px; min-height: 40px; font-size: 15px; }
.tk-select-btn { min-height: 40px; }
.tk-select-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.tk-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 14px; }
.tk-filter-note { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 14px; font-weight: 650; color: var(--accent); }
.tk-archive-done { margin-left: auto; }

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

.tk-body:focus { outline: none; }
.tk-list.is-selecting .tk-row { grid-template-columns: 30px var(--tk-cols); }

.tk-group + .tk-group { margin-top: 18px; }
.tk-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 0 4px 8px; }
.tk-group-title { margin: 0; font-size: 15px; font-weight: 750; }
.tk-group.is-late .tk-group-title { color: var(--danger); }
.tk-group.is-done .tk-group-title { color: var(--ok); }
.tk-group-count { color: var(--muted); font-size: 13px; font-weight: 600; }
.tk-group-sub { color: var(--muted); font-size: 13px; margin-left: auto; }

.tk-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.tk-row {
  position: relative;
  display: grid; grid-template-columns: var(--tk-cols); align-items: center; gap: 12px;
  min-height: 54px; padding: 7px 16px;
  border-top: 1px solid var(--line); cursor: pointer;
  transition: background 0.2s;
}
.tk-row:first-child { border-top: 0; }
.tk-row:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.tk-row.is-late { box-shadow: inset 3px 0 0 var(--danger); }
.tk-row.is-pending { opacity: 0.6; cursor: progress; }
.tk-row.is-settling { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.tk-row.is-selected { background: color-mix(in srgb, var(--accent) 11%, transparent); }
.tk-row.is-new { animation: tk-flash 2.4s ease-out; }
@keyframes tk-flash { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } }

.tk-main { min-width: 0; }
.tk-title {
  display: block; width: 100%; padding: 4px 0; margin: 0;
  border: 0; background: none; color: var(--text); font: inherit; font-weight: 650; font-size: 15px; line-height: 1.35;
  text-align: left; cursor: pointer; overflow-wrap: anywhere;
}
.tk-title:hover { color: var(--accent); }
/* Select mode: the title is the checkbox's label, so it must not pick up the form label spacing. */
.tk label.tk-title { margin: 0; -webkit-user-select: none; user-select: none; }
.tk-title:disabled { cursor: progress; color: var(--muted); }
.tk-row.is-done .tk-title { color: var(--muted); font-weight: 600; }
.tk-hints { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: -1px; font-size: 12px; color: var(--muted); }
.tk-has-notes { display: inline-flex; align-items: center; gap: 5px; }
.tk-has-notes::before {
  content: ""; width: 10px; height: 8px; flex: none;
  border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; opacity: 0.8;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
}
.tk-adding { color: var(--accent); font-weight: 650; }

.tk-meta { display: contents; }
.tk-owner { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.tk-owner .hub-avatar.size-sm { width: 26px; height: 26px; font-size: 11px; }
.tk-owner-name { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.tk-owner.is-none { color: var(--muted); }
.tk-owner.is-none .hub-avatar { font-size: 15px; }
.tk-due { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-due.is-overdue { color: var(--danger); font-weight: 750; }
.tk-due.is-today { color: var(--warn); font-weight: 750; }
.tk-due.is-soon { color: var(--text); }
.tk-due.is-later, .tk-due.is-none { color: var(--muted); }
.tk-due.is-done { color: var(--ok); font-weight: 600; }
.tk-prio { min-width: 0; }
.tk-prio-badge { padding: 1px 8px; }
.tk-hours { text-align: right; color: var(--muted); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- the status control ---------- */

.tk-status, .tk-status-icon { --c: var(--muted); }
.tk-status.is-doing, .tk-status-icon.is-doing { --c: var(--accent); }
.tk-status.is-blocked, .tk-status-icon.is-blocked { --c: var(--danger); }
.tk-status.is-done, .tk-status-icon.is-done { --c: var(--ok); }
.tk-status { position: relative; display: flex; align-items: center; min-width: 0; }
.tk-status > .tk-status-icon { position: absolute; left: 11px; top: 50%; margin-top: -7px; }
.tk-status-icon {
  position: relative; flex: none; display: inline-block;
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--c);
  pointer-events: none;
}
.tk-status.is-doing .tk-status-icon, .tk-status-icon.is-doing { background: conic-gradient(var(--c) 0 50%, transparent 50% 100%); }
.tk-status.is-blocked .tk-status-icon::after, .tk-status-icon.is-blocked::after {
  content: ""; position: absolute; left: 1px; right: 1px; top: 50%; height: 2px; margin-top: -1px; background: var(--c); border-radius: 1px;
}
.tk-status.is-done .tk-status-icon, .tk-status-icon.is-done { background: var(--c); }
.tk-status.is-done .tk-status-icon::after, .tk-status-icon.is-done::after {
  content: ""; position: absolute; left: 3px; top: 0; width: 3px; height: 6px;
  border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.tk select.tk-status-select {
  width: 100%; min-height: 34px; padding: 0 26px 0 32px;
  border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--text);
  border-color: color-mix(in srgb, var(--c) 45%, var(--line));
  background-color: color-mix(in srgb, var(--c) 11%, var(--surface));
  background-position: right 10px center;
}
.tk select.tk-status-select:hover { border-color: var(--c); }
.tk select.tk-status-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tk-status.is-blocked select.tk-status-select { color: var(--danger); }

.tk-check { display: grid; place-items: center; min-width: 30px; min-height: 30px; margin: 0; cursor: pointer; }
.tk .tk-check input[type="checkbox"] { width: 19px; height: 19px; margin: 0; cursor: pointer; }

/* ---------- select mode: the bulk bar ---------- */

.tk-bulk-slot { position: sticky; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 5; }
.tk-bulk {
  display: grid; gap: 10px; margin-top: 14px; padding: 12px 14px;
  border-radius: 14px; border: 1px solid var(--accent); background: var(--surface);
  box-shadow: var(--shadow);
}
.tk-bulk-top { display: flex; align-items: center; gap: 8px 12px; }
.tk-bulk-count { flex: 1 1 auto; min-width: 0; margin: 0; font-weight: 750; }
.tk-bulk-top .btn { flex: none; }
.tk-bulk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tk .tk-bulk-select { width: auto; min-width: 150px; min-height: 38px; font-size: 14px; }
.tk-bulk-due { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); }
.tk-bulk-due-label { margin: 0; font-weight: 650; font-size: 14px; }
.tk .tk-bulk-due input[type="date"] { width: 160px; min-height: 38px; font-size: 14px; }
.tk-bulk .btn.small { min-height: 38px; }

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

.tk-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin: 2px 0 8px; }
.tk-cal-title { margin: 0; font-size: 21px; letter-spacing: -0.01em; }
.tk-cal-count { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.tk-cal-nav { display: flex; gap: 6px; }
.tk-cal-arrow { width: 42px; padding: 0; font-size: 22px; line-height: 1; }
.tk-cal-key { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 12px; font-size: 13px; }
.tk-key-item { display: inline-flex; align-items: center; gap: 6px; }
.tk-key-swatch { display: inline-grid; place-items: center; width: 20px; height: 18px; border-radius: 4px; }
.tk-key-swatch.is-open { background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.tk-key-swatch.is-late { background: color-mix(in srgb, var(--danger) 22%, transparent); box-shadow: inset 3px 0 0 var(--danger); padding-left: 3px; }
.tk-key-swatch.is-done { border: 1.5px solid var(--ok); }
.tk-key-swatch .tk-status-icon { width: 12px; height: 12px; }
.tk-key-add { color: var(--muted); }

.tk-cal-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.tk-cal-grid { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.tk-cal-grid th {
  padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.tk-cal-grid abbr { text-decoration: none; }
.tk-cal-cell {
  position: relative; vertical-align: top; height: 108px; padding: 34px 6px 6px;
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.tk-cal-grid tbody tr:first-child .tk-cal-cell { border-top: 0; }
.tk-cal-cell:first-child { border-left: 0; }
.tk-cal-cell.is-outside { background: color-mix(in srgb, var(--bg) 60%, transparent); }
.tk-cal-day {
  position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: flex-start;
  padding: 6px 8px; border: 0; border-radius: 0; background: transparent; color: var(--text); font: inherit; cursor: copy;
}
.tk-cal-day:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.tk-cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.tk-cal-num { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 999px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tk-cal-cell.is-outside .tk-cal-num { color: var(--muted); font-weight: 500; }
.tk-cal-cell.is-today .tk-cal-num { background: var(--accent); color: var(--accent-ink); }
.tk-cal-entries { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; pointer-events: none; }
.tk-cal-entries li { min-width: 0; }
.tk-cal-entry {
  pointer-events: auto;
  display: flex; align-items: center; gap: 4px; width: 100%; min-height: 24px; padding: 2px 6px;
  border: 0; border-left: 3px solid var(--accent); border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 13%, var(--surface)); color: var(--text);
  font: inherit; font-size: 12px; line-height: 1.3; text-align: left; cursor: pointer;
}
.tk-cal-entry:hover { background: color-mix(in srgb, var(--accent) 24%, var(--surface)); }
.tk-cal-entry-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tk-cal-entry .hub-avatar.size-sm { width: 18px; height: 18px; font-size: 8.5px; letter-spacing: 0; margin-left: auto; }
.tk-cal-entry.is-high .tk-cal-entry-title { font-weight: 800; }
.tk-cal-entry.is-blocked, .tk-cal-entry.is-late { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.tk-cal-entry.is-done { border-left-color: var(--ok); background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 35%, transparent); }
.tk-cal-entry.is-done .tk-cal-entry-title { color: var(--muted); font-weight: 500; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.tk-cal-check { color: var(--ok); font-weight: 800; font-size: 11px; }
/* Overdue and blocked are never shown by color alone: "!" marks overdue work, and blocked work
   carries the Blocked status icon (a ring with a bar), as in the list. */
.tk-late-mark {
  flex: none; display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%;
  background: var(--danger); color: var(--bg); font-size: 10px; font-weight: 900; line-height: 1;
}
.tk-cal-entry .tk-status-icon { width: 12px; height: 12px; }
.tk-agenda-entry .tk-late-mark { margin-left: auto; width: 18px; height: 18px; font-size: 12px; }
.tk-cal-more {
  position: relative; z-index: 1; margin-top: 3px; padding: 2px 6px; border: 0; border-radius: 5px;
  background: transparent; color: var(--accent); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.tk-cal-more:hover { background: var(--surface-2); }

.tk-cal-undated { margin-top: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.tk-cal-undated summary { cursor: pointer; font-weight: 700; }
.tk-cal-undated .hint { margin: 8px 0 10px; }
.tk-count-pill { display: inline-block; min-width: 22px; padding: 0 7px; margin-left: 4px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; text-align: center; line-height: 20px; }

/* Phones read the month as an agenda, not a grid. */
.tk-agenda { display: none; }
.tk-agenda-day { padding: 10px 12px 12px; margin-bottom: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.tk-agenda-day.is-today { border-color: var(--accent); }
.tk-agenda-day.is-past { opacity: 0.85; }
.tk-agenda-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tk-agenda-date { display: flex; align-items: baseline; gap: 6px; margin: 0; font-size: 15px; }
.tk-agenda-dow { font-weight: 800; }
.tk-today-tag { padding: 0 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; line-height: 18px; }
.tk-agenda-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.tk-agenda-entry {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.tk-agenda-entry:hover { border-color: var(--accent); }
.tk-agenda-entry.is-late, .tk-agenda-entry.is-blocked { box-shadow: inset 3px 0 0 var(--danger); }
.tk-agenda-text { display: grid; min-width: 0; }
.tk-agenda-title { font-weight: 650; overflow-wrap: anywhere; }
.tk-agenda-entry.is-done .tk-agenda-title { color: var(--muted); text-decoration: line-through; }
.tk-agenda-meta { color: var(--muted); font-size: 13px; }
.tk-agenda-none { margin: 6px 0 0; font-size: 14px; }
.tk-agenda-empty { padding: 24px 16px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); }

/* ---------- workload ---------- */

.tk-wl-intro { margin: 0 0 12px; }
.tk-wl-lede { margin: 0 0 4px; font-size: 15px; }
.tk-wl-where { margin: 0; }
.tk-wl-alert {
  margin: 0 0 12px; padding: 10px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--danger) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  font-size: 14px;
}
.tk-wl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tk-wl-row {
  width: 100%; display: grid; grid-template-columns: minmax(170px, 1.05fr) minmax(200px, 1.4fr) minmax(160px, 1fr) minmax(150px, 1fr);
  align-items: center; gap: 12px 20px; padding: 12px 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.tk-wl-row:hover { border-color: var(--accent); }
.tk-wl-row.is-over { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.tk-wl-row.is-pool { border-style: dashed; background: transparent; }
.tk-wl-row.is-seat { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.tk-wl-alert.is-seat {
  background: color-mix(in srgb, var(--warn) 9%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}
.tk-wl-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tk-wl-name { display: grid; min-width: 0; }
.tk-wl-name strong { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.tk-wl-role { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.tk-you { padding: 0 6px; border-radius: 5px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; line-height: 16px; }
.tk-wl-load { display: grid; gap: 6px; min-width: 0; }
.tk-wl-hours { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tk-wl-hours strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.tk-wl-level { font-size: 13px; font-weight: 650; color: var(--muted); }
.tk-wl-level.is-ok { color: var(--ok); }
.tk-wl-level.is-near { color: var(--warn); }
.tk-wl-level.is-over { color: var(--danger); }
.tk-bar { display: block; height: 8px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.tk-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.tk-bar-fill.is-near { background: var(--warn); }
.tk-bar-fill.is-over { background: var(--danger); }
.tk-bar-fill.is-none { background: transparent; }
.tk-wl-stats { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; color: var(--muted); }
.tk-wl-stat.is-unknown { color: var(--warn); }
.tk-wl-stat.is-late { color: var(--danger); font-weight: 700; }
.tk-wl-note { font-size: 14px; overflow-wrap: anywhere; }
.tk-wl-note:not(.is-empty)::before { content: "\201C"; color: var(--muted); }
.tk-wl-note:not(.is-empty)::after { content: "\201D"; color: var(--muted); }
.tk-wl-note.is-empty { color: var(--muted); font-size: 13px; }

/* ---------- foot ---------- */

.tk-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.tk-foot p { margin: 0; }
.tk-bulk-slot:empty { display: none; }

/* ---------- the editor dialog ---------- */

.tk-editor .hub-dialog-actions .tk-ed-left-last { margin-right: auto; }
.tk-editor .hub-dialog-head h2:focus { outline: none; }
.tk-ed { padding-top: 4px; }
.tk-ed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.tk-ed-due { grid-column: 1 / -1; }
.tk-ed-due-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tk-editor .tk-ed-due-row input[type="date"] { width: 190px; flex: none; }
.tk-ed-quickdue { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-ed-chip {
  min-height: 36px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 650;
}
.tk-ed-chip:hover { border-color: var(--accent); }
.tk-ed-chip[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.tk-ed-load { margin: -6px 0 16px; }
.tk-ed-load.is-over { color: var(--warn); font-weight: 650; }
.tk-editor [aria-invalid="true"] { border-color: var(--danger) !important; }
.tk-ed-notes textarea { min-height: 110px; }
.tk-ed-record { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.tk-ed-record-title { margin: 0 0 6px; font-size: 11px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tk-ed-record ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 14px; color: var(--muted); }
.tk-ed-notice { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--accent); font-size: 14px; }
.tk-ed-notice p { margin: 0; }
.tk-ed-conflict {
  margin: 0 0 16px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent); border-left: 4px solid var(--warn);
  background: color-mix(in srgb, var(--warn) 8%, var(--surface));
}
.tk-ed-conflict h3 { margin: 0 0 4px; font-size: 17px; }
.tk-ed-conflict > p { margin: 0 0 10px; }
.tk-ed-conflict-scroll { overflow-x: auto; }
.tk-ed-compare { width: 100%; border-collapse: collapse; font-size: 14px; }
.tk-ed-compare th, .tk-ed-compare td { padding: 6px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.tk-ed-compare thead th { font-size: 12px; color: var(--muted); font-weight: 700; }
.tk-ed-compare th[scope="row"], .tk-ed-compare thead th:first-child { width: 92px; white-space: nowrap; overflow-wrap: normal; }
.tk-ed-compare td { width: 45%; }
.tk-ed-compare tr.is-clash th, .tk-ed-compare tr.is-clash td { background: color-mix(in srgb, var(--warn) 14%, transparent); }
.tk-ed-conflict .hint { margin: 10px 0 0; }
.tk-ed-conflict-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- tablets and phones ---------- */

@media (max-width: 1020px) {
  .tk { --tk-cols: 132px minmax(0, 1fr) 130px 130px 58px 44px; }
  .tk-wl-row { grid-template-columns: minmax(170px, 1fr) minmax(200px, 1.3fr); }
  .tk-wl-stats { grid-column: 1; }
  .tk-wl-note { grid-column: 2; }
}

@media (max-width: 859px) {
  .tk-toolbar { align-items: stretch; }
  .tk-views { width: 100%; }
  .tk-views .tk-seg-btn { flex: 1 1 0; }
  .tk-tools { width: 100%; }
  .tk-search { flex: 1 1 200px; width: auto; }
}

@media (max-width: 759px) {
  .tk-metrics { gap: 6px; margin-bottom: 14px; }
  .tk-metric { padding: 9px 10px; min-height: 64px; border-radius: 10px; }
  .tk-metric-num { font-size: 22px; }
  .tk-metric-label { font-size: 12px; line-height: 1.25; }
  .tk-metric-detail { display: none; }

  .tk-qa-row { flex-wrap: wrap; }
  .tk-qa-field { flex: 1 1 100%; }
  .tk-qa-add, .tk-qa-helpbtn { flex: 1 1 0; min-height: 46px; }
  input[type="text"].tk-qa-input { min-height: 50px; }
  .tk-qa-help { position: static; width: auto; margin-top: 10px; box-shadow: none; padding: 14px; }
  .tk-qa-tip { grid-template-columns: 70px minmax(0, 1fr); }

  .tk-toolbar { margin: 18px 0 10px; }
  .tk-seg-btn { min-height: 44px; }
  .tk .tk-search input[type="search"], .tk .tk-owner-select, .tk-select-btn { min-height: 44px; }
  .tk-search { flex: 1 1 100%; }
  .tk-owner-filter { flex: 1 1 0; min-width: 0; }
  .tk .tk-owner-select { width: 100%; }
  .tk-select-btn { flex: none; }

  .tk-filterbar { gap: 8px; }
  .tk-filters { width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
  .tk-filters .tk-seg-btn { flex-direction: column; gap: 1px; min-height: 50px; padding: 4px 2px; font-size: 13px; line-height: 1.15; }
  .tk-filters .tk-seg-count { min-width: 0; padding: 0; background: none; font-size: 12px; line-height: 16px; }
  .btn.small.tk-archive-done { margin-left: 0; min-height: 44px; }
  .tk-filter-note .btn { min-height: 44px; }

  .tk-row, .tk-list.is-selecting .tk-row {
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas: "status main" "status meta";
    gap: 0 10px; padding: 8px 12px 10px 8px; align-items: start;
  }
  .tk-list.is-selecting .tk-row { grid-template-areas: "check main" "check meta"; }
  .tk-list.is-selecting .tk-status { display: none; }
  .tk-check { grid-area: check; min-width: 44px; min-height: 44px; }
  .tk-status { grid-area: status; }
  .tk-main { grid-area: main; }
  .tk-title { min-height: 40px; padding: 10px 0 2px; }
  .tk-hints { margin-top: 0; }
  .tk-meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-top: 4px; }
  .tk-owner, .tk-due, .tk-hours { font-size: 13px; }
  .tk-owner .hub-avatar.size-sm { width: 22px; height: 22px; font-size: 10px; }
  .tk-hours:empty, .tk-prio:empty { display: none; }
  .tk-hours .sr-only { position: absolute; }

  /* The status control shrinks to its icon: 44 by 44, the name stays in its label. */
  .tk select.tk-status-select {
    width: 44px; min-height: 44px; padding: 0; color: transparent; background-image: none; text-indent: -999px;
  }
  .tk-status > .tk-status-icon { left: 15px; }
  .tk-status-icon { width: 15px; height: 15px; }

  .tk-group-sub { margin-left: 0; width: 100%; }
  .tk-bulk-slot { bottom: max(8px, env(safe-area-inset-bottom)); }
  .tk-bulk { padding: 10px 12px; }
  .tk-bulk { gap: 8px; }
  .tk-bulk-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .tk .tk-bulk-select { min-width: 0; width: 100%; min-height: 44px; }
  .tk-bulk-due-label { width: 100%; }
  .tk .tk-bulk-due input[type="date"] { flex: 1 1 130px; width: auto; min-height: 44px; }
  .tk-bulk-top .btn.linkish { padding: 0 4px; }
  .tk-bulk .btn.small { min-height: 44px; }

  .tk-cal-wrap { display: none; }
  .tk-agenda { display: block; }
  .tk-cal-arrow, .tk-cal-today { min-height: 44px; }
  .tk-cal-arrow { width: 44px; }
  .tk-key-add { display: none; }
  .btn.small.tk-agenda-add { min-height: 44px; min-width: 64px; }
  .tk-cal-undated { padding-top: 4px; padding-bottom: 4px; }
  .tk-cal-undated summary { min-height: 44px; padding: 10px 0; box-sizing: border-box; }

  .tk-wl-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px 14px; }
  .tk-wl-stats, .tk-wl-note { grid-column: auto; }
  .tk-wl-note.is-empty { display: none; }

  .tk-ed-grid { gap: 0 10px; }
  .tk-ed-owner { grid-column: 1 / -1; }
  .tk-editor .tk-ed-due-row input[type="date"] { width: 100%; flex: 1 1 100%; }
  .tk-ed-chip { min-height: 44px; }
  .tk-editor .hub-dialog-actions .tk-ed-left-last { margin-right: 0; }
  .tk-foot { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .tk-row.is-new { animation: none; }
  .tk-metric, .tk-row { transition: none; }
}
