/* Admin task stream (/admin/tasks). Dark-only (tesote-dark). Ported verbatim
   from the approved sketch. The whole palette lives here; the helper picks
   semantic classes and data- values, continuous geometry (ribbon flex, row
   density) arrives as data. Nothing in the views inlines a colour. */

.tk-root {
  /* lifecycle spectrum — cold at the queue, hot at the failure */
  --tk-queued: #7c8aa6;
  --tk-running: #2fc2f0;
  --tk-pr: #8b6bf0;
  --tk-merged: #3fd69a;
  --tk-escalated: #ffb020;
  --tk-failed: #ff5a5a;
  --tk-cancelled: #5c5952;

  --tk-ink: #131211;
  --tk-slab: #1b1a18;
  --tk-slab2: #211f1d;
  --tk-raise: #26241f;
  --tk-edge: #302e29;
  --tk-edge2: #3d3a33;
  /* Four text tiers, all measured against --tk-ink. The sketch's original
     faint (#6b665d, 3.3:1) and ghost (#4a463f, 2.0:1) failed WCAG AA at the
     9.5px these labels render at, so both are lifted: faint clears AA (4.5:1)
     because it carries real labels, ghost clears 3:1 and is reserved for
     placeholder marks and disabled affordances. */
  --tk-bone: #ede9e1;   /* 13.6:1 */
  --tk-mute: #9a948a;   /*  6.2:1 */
  --tk-faint: #857f74;  /*  4.7:1 */
  --tk-ghost: #6f6a61;  /*  3.5:1 */

  --tk-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --tk-row-h: 44px;
  --tk-row-pad: 10px;

  /* bleed into <main>'s padding so the head is flush and full-width */
  margin: -1rem -1rem 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--tk-bone);
  background: var(--tk-ink);
  min-height: calc(100% + 1rem);
}
@media (min-width: 640px) { .tk-root { margin: -1.5rem -1.5rem 0; min-height: calc(100% + 1.5rem); } }
.tk-root[data-density="compact"] { --tk-row-h: 32px; --tk-row-pad: 5px; }

.tk-root a { color: inherit; text-decoration: none; }
.tk-num { font-variant-numeric: tabular-nums; }
.tk-mono { font-family: var(--tk-mono); font-variant-numeric: tabular-nums; }
.tk-lbl { font-family: var(--tk-mono); font-size: 9.5px; letter-spacing: .11em;
  text-transform: uppercase; color: var(--tk-faint); }

/* ---- state colour tokens: the row carries the state, the CSS the hue ---- */
.tk-root [data-state="pending"] { --tk-sc: var(--tk-queued); }
.tk-root [data-state="assigned"],
.tk-root [data-state="in_progress"] { --tk-sc: var(--tk-running); }
.tk-root [data-state="completed"],
.tk-root [data-state="pr_created"] { --tk-sc: var(--tk-pr); }
.tk-root [data-state="merged"] { --tk-sc: var(--tk-merged); }
.tk-root [data-state="escalated"] { --tk-sc: var(--tk-escalated); }
.tk-root [data-state="failed"] { --tk-sc: var(--tk-failed); }
.tk-root [data-state="cancelled"] { --tk-sc: var(--tk-cancelled); }

/* ---- family hues: the same four skill groups the categories dashboard uses -- */
.tk-f-bank { --tk-fc: #2fa872; }
.tk-f-rails { --tk-fc: #3a7eff; }
.tk-f-platform { --tk-fc: #c965a8; }
.tk-f-process { --tk-fc: #8e949e; }
.tk-f-none { --tk-fc: var(--tk-ghost); }

/* ---- repo hues, off the lifecycle spectrum so a dot never reads as a state -- */
.tk-r-0 { --tk-rc: #5b9bf8; } .tk-r-1 { --tk-rc: #e86ba0; } .tk-r-2 { --tk-rc: #9fd356; }
.tk-r-3 { --tk-rc: #e8874a; } .tk-r-4 { --tk-rc: #5bd8e8; } .tk-r-5 { --tk-rc: #c9a227; }
.tk-r-6 { --tk-rc: #b9a6e8; } .tk-r-7 { --tk-rc: #4ed9b0; } .tk-r-8 { --tk-rc: #f07f7f; }
.tk-r-none { --tk-rc: var(--tk-ghost); }

/* ---- source + Linear team tokens ---- */
.tk-src-manual { --tk-tc: #9a948a; }
.tk-src-linear, .tk-src-linear_spawner { --tk-tc: #8b6bf0; }
.tk-src-sentry { --tk-tc: #ff5a5a; }
.tk-src-worker_report { --tk-tc: #2fc2f0; }
/* the daily sweep raises its own work; off the worker-report hue so the two
   are not read as the same origin */
.tk-src-conflict_sweep { --tk-tc: #4ed9b0; }
.tk-team-eng { --tk-tc: #5b9bf8; }
.tk-team-ban { --tk-tc: #3fd69a; }
.tk-team-pro { --tk-tc: #c965a8; }
.tk-team-sup { --tk-tc: #ffb020; }
.tk-team-bkpipe { --tk-tc: #8b6bf0; }
.tk-team-fr { --tk-tc: #5bd8e8; }
.tk-team-api { --tk-tc: #e8874a; }

/* ═══ command head ═══════════════════════════════════════════════════════ */
.tk-head { position: relative;
  background:
    radial-gradient(80% 130% at 8% -30%, #2fc2f014, transparent 62%),
    radial-gradient(70% 120% at 58% -40%, #8b6bf014, transparent 60%),
    radial-gradient(60% 120% at 96% -30%, #3fd69a10, transparent 58%),
    var(--tk-slab);
  box-shadow: 0 8px 24px -14px #000c; }
.tk-headtop { display: flex; align-items: baseline; gap: 14px; padding: 12px 18px 0; flex-wrap: wrap; }
.tk-headtop h1 { font-size: 19px; font-weight: 750; letter-spacing: -.025em; }
.tk-headtop .tk-sub { font-size: 11.5px; color: var(--tk-faint); font-family: var(--tk-mono); }
.tk-spacer { flex: 1; }

.tk-pulse { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--tk-mute);
  background: var(--tk-ink); border: 1px solid var(--tk-edge); border-radius: 999px; padding: 3px 11px 3px 9px; }
.tk-pulse b { color: var(--tk-bone); font-weight: 650; font-family: var(--tk-mono); }
.tk-pulse b.is-stalled { color: var(--tk-failed); }
.tk-pulse .tk-dim { color: var(--tk-ghost); }
.tk-beacon { width: 7px; height: 7px; border-radius: 50%; background: var(--tk-running);
  animation: tk-beacon 2s ease-out infinite; }
@keyframes tk-beacon {
  0% { box-shadow: 0 0 0 0 #2fc2f066; }
  70% { box-shadow: 0 0 0 6px #2fc2f000; }
  100% { box-shadow: 0 0 0 0 #2fc2f000; }
}

.tk-btn { background: var(--tk-slab2); border: 1px solid var(--tk-edge2); border-radius: 7px;
  padding: 5px 11px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center;
  gap: 6px; transition: .12s; color: var(--tk-bone); }
.tk-btn:hover { background: var(--tk-raise); border-color: #4d493f; }
.tk-btn:focus-visible { outline: 2px solid var(--tk-running); outline-offset: 2px; }
.tk-btn.is-primary { background: linear-gradient(180deg, #8b6bf0, #7355e0); border-color: #9d81f5;
  color: #fff; font-weight: 600; }
.tk-btn.is-primary:hover { filter: brightness(1.1); }
.tk-btn.is-danger:hover { border-color: #ff5a5a66; color: #ff8f8f; }
.tk-btn.is-go { border-color: #8b6bf04d; color: #b39cf8; }
.tk-btn.is-go:hover { background: #8b6bf01a; }

/* ---- state rail: the summary IS the filter ---- */
.tk-rail { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; padding: 12px 18px 0; }
.tk-st { position: relative; background: var(--tk-ink); border: 1px solid var(--tk-edge);
  border-radius: 8px; padding: 7px 10px 8px; cursor: pointer; text-align: left;
  overflow: hidden; transition: .14s; display: block; }
.tk-st:hover { border-color: var(--tk-sc); transform: translateY(-1px); }
.tk-st:focus-visible { outline: 2px solid var(--tk-sc); outline-offset: 1px; }
.tk-st .tk-k { display: flex; align-items: center; gap: 6px; font-family: var(--tk-mono);
  font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--tk-faint); }
.tk-st .tk-k i { width: 6px; height: 6px; border-radius: 2px; background: var(--tk-sc); flex: none; }
.tk-st .tk-v { font-size: 20px; font-weight: 700; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 1px; display: block; }
.tk-st .tk-v em { font-style: normal; font-size: 10px; color: var(--tk-faint); font-weight: 500;
  margin-left: 4px; letter-spacing: 0; }
.tk-st .tk-d { font-size: 10px; color: var(--tk-faint); font-family: var(--tk-mono); display: block; }
.tk-st[aria-pressed="true"] { background: color-mix(in srgb, var(--tk-sc) 13%, var(--tk-ink));
  border-color: var(--tk-sc); }
.tk-st[aria-pressed="true"] .tk-v,
.tk-st[aria-pressed="true"] .tk-k { color: var(--tk-sc); }
.tk-st.is-zero { opacity: .42; }
.tk-st.is-zero:hover { opacity: .75; }

/* ---- the distribution ribbon: the head's own bottom edge is the data ---- */
.tk-ribbon { display: flex; height: 3px; width: 100%; }
.tk-ribbon a { background: var(--tk-sc); flex: var(--tk-f, 1) 1 0; min-width: 2px; transition: .2s; }
.tk-ribbon a:hover { filter: brightness(1.45); }
.tk-ribbon.is-filtered a { opacity: .22; }
.tk-ribbon.is-filtered a.is-on { opacity: 1; }

/* ---- legend ---- */
.tk-legend { display: flex; align-items: center; gap: 14px; padding: 6px 18px 0; flex-wrap: wrap; }
.tk-lg { display: flex; align-items: center; gap: 6px; font-family: var(--tk-mono); font-size: 9.5px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--tk-faint); }
.tk-lg .tk-mini { display: flex; align-items: center; }
.tk-lg .tk-mini i { width: 6px; height: 6px; border-radius: 50%; background: var(--tk-gc); }
.tk-lg .tk-mini u { width: 9px; height: 1.5px; background: var(--tk-gc); text-decoration: none; }
.tk-lg-q { --tk-gc: var(--tk-queued); }
.tk-lg-a { --tk-gc: var(--tk-running); }
.tk-lg-p { --tk-gc: var(--tk-pr); }
.tk-lg-m { --tk-gc: var(--tk-merged); }
.tk-lg-f { --tk-gc: var(--tk-failed); }
.tk-lg-e { --tk-gc: var(--tk-escalated); }
.tk-legend .tk-sep { color: var(--tk-ghost); }
.tk-ramp { position: relative; }
.tk-ramp > summary { display: flex; align-items: center; gap: 6px; cursor: help; list-style: none; }
.tk-ramp > summary::-webkit-details-marker { display: none; }
.tk-ramp > summary:focus-visible { outline: 2px solid var(--tk-running); outline-offset: 2px; }
.tk-rampnote { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; width: 460px;
  max-width: 70vw; background: var(--tk-slab2); border: 1px solid var(--tk-edge2); border-radius: 9px;
  padding: 9px 11px; font-family: var(--tk-sans); font-size: 11.5px; line-height: 1.5;
  letter-spacing: 0; text-transform: none; color: var(--tk-mute);
  box-shadow: 0 18px 40px -12px #000e; }
.tk-rampbar { display: inline-flex; height: 5px; border-radius: 3px; overflow: hidden; margin: 0 3px; }
.tk-rampbar i { width: 13px; height: 100%; }
.tk-rampbar i:nth-child(1) { background: #2fd48e; }
.tk-rampbar i:nth-child(2) { background: #8ad3ae; }
.tk-rampbar i:nth-child(3) { background: #9a948a; }
.tk-rampbar i:nth-child(4) { background: #ffb020; }
.tk-rampbar i:nth-child(5) { background: #ff6b6b; }

/* ═══ filter bar ═════════════════════════════════════════════════════════ */
.tk-fbar { display: flex; align-items: center; gap: 7px; padding: 11px 18px; flex-wrap: wrap; }
.tk-search { position: relative; flex: 1; min-width: 230px; max-width: 420px; }
.tk-search input { width: 100%; background: var(--tk-ink); border: 1px solid var(--tk-edge);
  border-radius: 7px; padding: 6px 30px; font-size: 12.5px; outline: none; transition: .14s;
  color: var(--tk-bone); }
.tk-search input:focus { border-color: var(--tk-running); box-shadow: 0 0 0 3px #2fc2f022; }
.tk-search .tk-mag { position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--tk-faint); font-size: 12px; pointer-events: none; }
.tk-search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--tk-mono); font-size: 9.5px; color: var(--tk-faint); border: 1px solid var(--tk-edge2);
  border-radius: 4px; padding: 1px 4px; background: var(--tk-slab2); }
.tk-search input:focus ~ kbd, .tk-search input:not(:placeholder-shown) ~ kbd { opacity: 0; }

/* native <details>: the menus open, close and keyboard-navigate with no
   JavaScript at all, and every option inside is a plain link */
.tk-drop { position: relative; }
.tk-drop > summary { background: var(--tk-ink); border: 1px solid var(--tk-edge); border-radius: 7px;
  padding: 5px 9px; font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 6px;
  white-space: nowrap; transition: .12s; color: var(--tk-bone); list-style: none; }
.tk-drop > summary::-webkit-details-marker { display: none; }
.tk-drop > summary:hover { border-color: var(--tk-edge2); background: var(--tk-slab2); }
.tk-drop > summary:focus-visible { outline: 2px solid var(--tk-running); outline-offset: 1px; }
.tk-drop > summary .tk-cnt { background: var(--tk-pr); color: #fff; border-radius: 999px; padding: 0 5px;
  font-size: 9.5px; font-family: var(--tk-mono); font-weight: 700; line-height: 15px; }
.tk-drop > summary .tk-caret { color: var(--tk-faint); font-size: 8px; }
.tk-drop[open] > summary, .tk-drop.is-active > summary { border-color: var(--tk-pr); background: var(--tk-slab2); }

.tk-menu { position: absolute; top: calc(100% + 5px); left: 0; z-index: 60; min-width: 220px;
  max-height: 320px; overflow: auto; background: var(--tk-slab2); border: 1px solid var(--tk-edge2);
  border-radius: 9px; padding: 5px; box-shadow: 0 18px 40px -12px #000e; }
.tk-menu.is-wide { min-width: 290px; }
.tk-menu.is-right { left: auto; right: 0; }
.tk-msearch { width: 100%; background: var(--tk-ink); border: 1px solid var(--tk-edge);
  border-radius: 6px; padding: 5px 8px; font-size: 12px; outline: none; margin-bottom: 4px;
  color: var(--tk-bone); }
.tk-msearch:focus { border-color: var(--tk-running); }
.tk-opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 7px; border: 0;
  background: none; border-radius: 6px; cursor: pointer; font-size: 12.5px; text-align: left; }
.tk-opt[hidden] { display: none; }
.tk-opt:hover { background: #ffffff0d; }
.tk-opt .tk-box { width: 13px; height: 13px; border-radius: 4px; border: 1.5px solid var(--tk-edge2);
  flex: none; display: grid; place-items: center; font-size: 9px; color: transparent; }
.tk-opt[aria-pressed="true"] .tk-box,
.tk-opt[aria-current] .tk-box { background: var(--tk-pr); border-color: var(--tk-pr); color: #fff; }
.tk-opt .tk-n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-opt .tk-c { font-family: var(--tk-mono); font-size: 10.5px; color: var(--tk-faint); }
.tk-opt .tk-swatch { width: 7px; height: 7px; border-radius: 2px; flex: none;
  background: var(--tk-fc, var(--tk-tc, var(--tk-rc, var(--tk-ghost)))); }
.tk-opt.is-zero { opacity: .38; }
.tk-opt.is-zero:hover { opacity: .7; }
.tk-mdiv { height: 1px; background: var(--tk-edge2); margin: 5px 2px; }
.tk-mnote { font-family: var(--tk-mono); font-size: 9.5px; color: var(--tk-faint);
  padding: 3px 7px 2px; letter-spacing: .03em; }
/* the category menu is two levels: family, then its subtypes indented under it */
.tk-opt.is-family { margin-top: 2px; }
.tk-opt.is-family .tk-n { font-weight: 650; }
.tk-opt.is-subtype { padding-left: 22px; position: relative; }
.tk-opt.is-subtype .tk-n { color: var(--tk-mute); font-size: 11.5px; }
.tk-opt.is-subtype::before { content: ""; position: absolute; left: 12px; top: 0; bottom: 0;
  width: 1px; background: var(--tk-edge2); }

.tk-dates { display: flex; gap: 7px; padding: 2px 7px 4px; }
.tk-dates label { flex: 1; display: flex; flex-direction: column; gap: 3px; font-family: var(--tk-mono);
  font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--tk-faint); }
.tk-dates input { background: var(--tk-ink); border: 1px solid var(--tk-edge2); border-radius: 6px;
  padding: 4px 6px; font-family: var(--tk-mono); font-size: 11px; color-scheme: dark; outline: none;
  width: 100%; color: var(--tk-bone); }
.tk-dates input:focus { border-color: var(--tk-running); }

.tk-seg { display: flex; background: var(--tk-ink); border: 1px solid var(--tk-edge);
  border-radius: 7px; overflow: hidden; }
.tk-seg a { padding: 5px 9px; font-size: 11.5px; color: var(--tk-mute); }
.tk-seg a[aria-pressed="true"] { background: var(--tk-slab2); color: var(--tk-bone); }
.tk-seg a:hover { color: var(--tk-bone); }

.tk-chips { display: flex; align-items: center; gap: 6px; padding: 0 18px 10px; flex-wrap: wrap; }
.tk-chips:empty { display: none; }
.tk-chip { display: inline-flex; align-items: center; gap: 6px;
  background: color-mix(in srgb, var(--tk-sc, var(--tk-pr)) 15%, var(--tk-ink));
  border: 1px solid color-mix(in srgb, var(--tk-sc, var(--tk-pr)) 45%, transparent);
  color: var(--tk-bone); border-radius: 999px; padding: 2px 6px 2px 9px; font-size: 11px; }
.tk-chip[class*="tk-f-"] { --tk-sc: var(--tk-fc); }
.tk-chip .tk-lb { font-family: var(--tk-mono); font-size: 9px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--tk-mute); }
.tk-chip .tk-x { color: var(--tk-mute); font-size: 12px; line-height: 1; padding: 0 2px; }
.tk-chip .tk-x:hover { color: var(--tk-bone); }
.tk-clearall { color: var(--tk-faint); font-size: 11px; text-decoration: underline; }
.tk-clearall:hover { color: var(--tk-bone); }

/* ═══ stream ═════════════════════════════════════════════════════════════ */
.tk-zhead { display: flex; align-items: center; gap: 9px; padding: 9px 18px 7px; }
.tk-zhead .tk-t { font-family: var(--tk-mono); font-size: 10px; letter-spacing: .13em;
  text-transform: uppercase; font-weight: 700; display: flex; align-items: center; gap: 6px;
  color: var(--tk-zc); }
.tk-zhead .tk-r { margin-left: auto; font-family: var(--tk-mono); font-size: 10.5px; color: var(--tk-faint); }
.tk-zhead .tk-r b { color: var(--tk-failed); font-weight: 700; }
.tk-zhead .tk-bar { height: 1px; flex: 1; background: linear-gradient(90deg, var(--tk-zc, var(--tk-edge)), transparent);
  opacity: .5; max-width: 180px; }
.tk-z-live { --tk-zc: var(--tk-running); }
.tk-z-attn { --tk-zc: var(--tk-escalated); }

/* ---- LIVE ---- */
.tk-live { display: block; margin: 0 18px 8px; position: relative; overflow: hidden;
  background: radial-gradient(120% 190% at 0% 0%, #2fc2f01c, transparent 58%), var(--tk-slab);
  border: 1px solid #2fc2f040; border-radius: 10px; padding: 9px 13px 8px; }
.tk-live::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--tk-running); }
.tk-live:hover { border-color: #2fc2f075; }
.tk-live .tk-l1 { display: flex; align-items: center; gap: 9px; }
.tk-live .tk-l1 .tk-id { font-family: var(--tk-mono); font-size: 11.5px; color: var(--tk-running);
  font-weight: 700; flex: none; }
.tk-live .tk-l1 .tk-ti { font-size: 13px; font-weight: 600; letter-spacing: -.01em; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.tk-live .tk-el { margin-left: auto; font-family: var(--tk-mono); font-size: 14px; font-weight: 700;
  color: var(--tk-running); font-variant-numeric: tabular-nums; letter-spacing: -.02em; flex: none; }
.tk-live .tk-l2 { display: flex; align-items: center; gap: 11px; margin-top: 5px;
  font-family: var(--tk-mono); font-size: 10.5px; color: var(--tk-mute); flex-wrap: wrap; }
.tk-live .tk-l2 .tk-sep { color: var(--tk-ghost); }
.tk-live .tk-l2 .tk-push { margin-left: auto; }
.tk-prog { height: 2px; background: var(--tk-edge); border-radius: 2px; margin-top: 7px;
  overflow: hidden; position: relative; }
.tk-prog i { position: absolute; inset: 0; width: 34%; border-radius: 2px;
  background: linear-gradient(90deg, #2fc2f0, #8b6bf0); animation: tk-crawl 2.6s cubic-bezier(.5, 0, .5, 1) infinite; }
@keyframes tk-crawl { 0% { transform: translateX(-105%); } 100% { transform: translateX(265%); } }
/* a run with no heartbeat is not live — it is stuck, and the card says so */
.tk-live.is-stalled { border-color: #ff5a5a4d;
  background: radial-gradient(120% 190% at 0% 0%, #ff5a5a16, transparent 58%), var(--tk-slab); }
.tk-live.is-stalled::before { background: var(--tk-failed); }
.tk-live.is-stalled .tk-id, .tk-live.is-stalled .tk-el { color: var(--tk-failed); }
.tk-live.is-stalled .tk-prog i { animation: none; width: 100%;
  background: repeating-linear-gradient(90deg, #ff5a5a55 0 5px, transparent 5px 10px); }
.tk-live .tk-warn { color: #ff8f8f; }
.tk-stall { font-family: var(--tk-mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase;
  font-weight: 700; color: #ff8f8f; background: #ff5a5a1c; border: 1px solid #ff5a5a3d;
  border-radius: 4px; padding: 0 5px; line-height: 15px; flex: none; }

/* ---- NEEDS A HUMAN ---- */
.tk-attn { margin: 0 18px 12px; border: 1px solid #ffb0203d; border-radius: 11px; overflow: hidden;
  background: radial-gradient(110% 200% at 0% 0%, #ffb02014, transparent 60%), var(--tk-slab); }
.tk-arow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 11px;
  align-items: center; padding: 8px 13px; border-top: 1px solid #ffffff09; }
.tk-arow:first-child { border-top: 0; }
.tk-arow:hover { background: #ffffff08; }
.tk-arow .tk-id { font-family: var(--tk-mono); font-size: 11px; color: var(--tk-escalated); font-weight: 700; }
.tk-arow .tk-ti { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.tk-arow .tk-why { font-family: var(--tk-mono); font-size: 10.5px; color: #ffc963; background: #ffb0201a;
  border: 1px solid #ffb02033; border-radius: 5px; padding: 1px 7px; white-space: nowrap;
  max-width: 270px; overflow: hidden; text-overflow: ellipsis; }
.tk-arow .tk-age { font-family: var(--tk-mono); font-size: 10.5px; color: var(--tk-faint); white-space: nowrap; }
.tk-more { display: block; width: 100%; border-top: 1px solid #ffffff09; color: var(--tk-mute);
  font-family: var(--tk-mono); font-size: 10.5px; padding: 6px; letter-spacing: .05em; text-align: center; }
.tk-more:hover { background: #ffffff08; color: var(--tk-bone); }

/* ---- day divider ---- */
.tk-day { display: flex; align-items: center; gap: 10px; padding: 14px 18px 6px; }
.tk-day .tk-d { font-family: var(--tk-mono); font-size: 10px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--tk-mute); font-weight: 700; }
.tk-day .tk-rule { flex: 1; height: 1px; background: var(--tk-edge); }
.tk-day .tk-count { font-family: var(--tk-mono); font-size: 10px; color: var(--tk-faint); }
.tk-spark { display: flex; gap: 2px; align-items: center; }
.tk-spark i { width: 4px; height: 4px; border-radius: 1px; background: var(--tk-sc, var(--tk-ghost)); }

/* ═══ task row ═══════════════════════════════════════════════════════════
   Two grid rows: the headline (state, id, title, lifecycle, PR, timing) and a
   meta caption strip. Compact folds the meta line back onto the headline. */
.tk-rows { padding: 0 18px; }
/* each row is a native <details>: expands, collapses and takes the keyboard
   with no JavaScript, and the links inside it still navigate */
.tk-row { list-style: none; display: grid;
  grid-template-columns: 16px 46px minmax(200px, 1fr) 88px 54px 108px 18px;
  grid-template-areas: "dot id title track pr time chev" ". meta meta meta meta meta chev2";
  gap: 3px 11px; align-items: center; min-height: var(--tk-row-h); padding: var(--tk-row-pad) 9px;
  border-radius: 8px; cursor: pointer; position: relative; border: 1px solid transparent; }
.tk-row > .tk-vd { grid-area: dot; }
.tk-row > .tk-rid { grid-area: id; }
.tk-row > .tk-title { grid-area: title; }
.tk-row > .tk-track { grid-area: track; }
.tk-row > .tk-pr { grid-area: pr; }
.tk-row > .tk-tcol { grid-area: time; }
.tk-row > .tk-chev { grid-area: chev; }
.tk-row > .tk-meta { grid-area: meta; }
.tk-row > .tk-chev2 { grid-area: chev2; }
.tk-row:hover { background: #ffffff0a; }
.tk-row:focus-visible { outline: 2px solid var(--tk-running); outline-offset: -2px; }
.tk-row.is-cursor { background: #ffffff0e; border-color: var(--tk-edge2); }
.tk-row.is-cursor::before { content: ""; position: absolute; left: -1px; top: 6px; bottom: 6px;
  width: 2px; border-radius: 2px; background: var(--tk-sc); }
.tk-row::-webkit-details-marker { display: none; }
.tk-item + .tk-item > .tk-row { box-shadow: inset 0 1px 0 #ffffff07; }

/* a caption strip, not a second table: left-packed and tight, with spend
   pushed to the right edge so the numbers still form a scannable column */
.tk-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tk-meta > .tk-cat { flex: 0 1 auto; min-width: 0; }
.tk-meta > .tk-spend { margin-left: auto; flex: none; }
.tk-meta > .tk-repo, .tk-meta > .tk-wk, .tk-meta > .tk-tmpl, .tk-meta > .tk-org { flex: none; }
.tk-srcgrp { display: flex; align-items: center; gap: 4px; flex: none; }
.tk-src, .tk-team { font-family: var(--tk-mono); font-size: 9px; font-weight: 700; letter-spacing: .07em;
  color: var(--tk-tc); border: 1px solid color-mix(in srgb, var(--tk-tc) 42%, transparent);
  background: color-mix(in srgb, var(--tk-tc) 13%, transparent); border-radius: 4px; padding: 0 4px;
  line-height: 14px; text-align: center; flex: none; }
/* a task the spawner picked up on its own, rather than one a human filed */
.tk-src.is-auto { border-style: dashed; }
.tk-src.is-auto::after { content: "·"; margin-left: 2px; opacity: .7; }

.tk-cat { font-family: var(--tk-mono); font-size: 10px; color: var(--tk-mute); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.tk-cat::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 1.5px;
  background: var(--tk-fc, var(--tk-ghost)); margin-right: 5px; vertical-align: 1px; }
.tk-cat b { font-weight: 400; color: var(--tk-faint); }
.tk-cat b::before { content: " / "; color: var(--tk-ghost); }
.tk-tmpl, .tk-org { font-family: var(--tk-mono); font-size: 10px; color: var(--tk-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-repo { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--tk-mute); min-width: 0; }
.tk-repo i { width: 6px; height: 6px; border-radius: 2px; background: var(--tk-rc); flex: none; }
.tk-repo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--tk-mono); }
.tk-wk { font-family: var(--tk-mono); font-size: 10.5px; color: var(--tk-mute); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.tk-wk.is-none { color: var(--tk-faint); }

/* spend: the colour carries the comparison, so no bar competes with it */
.tk-spend { display: flex; align-items: baseline; gap: 10px; justify-content: flex-end; }
.tk-spend > .tk-dv:first-child { min-width: 44px; text-align: right; }
.tk-spend > .tk-dv:last-child { min-width: 48px; text-align: right; font-size: 10px; }

/* ---- verdict: the did-it-work answer, readable without reading anything ---- */
.tk-vd { width: 15px; height: 15px; border-radius: 5px; display: grid; place-items: center;
  font-size: 9px; font-weight: 800; line-height: 1; flex: none; justify-self: center; }
.tk-row[data-verdict="ok"] .tk-vd { background: #3fd69a26; color: #4ee3a8; box-shadow: inset 0 0 0 1px #3fd69a5c; }
.tk-row[data-verdict="bad"] .tk-vd { background: #ff5a5a2e; color: #ff8a8a; box-shadow: inset 0 0 0 1px #ff5a5a80; }
.tk-row[data-verdict="soft"] .tk-vd { background: #ffb02021; color: #ffc251; box-shadow: inset 0 0 0 1px #ffb02052; }
.tk-row[data-verdict="idle"] .tk-vd { background: #ffffff08; color: var(--tk-ghost); box-shadow: inset 0 0 0 1px var(--tk-edge2); }
.tk-row[data-verdict="live"] .tk-vd { background: #2fc2f024; color: #57d2f5;
  box-shadow: inset 0 0 0 1px #2fc2f05c; animation: tk-beacon 2s ease-out infinite; }

/* ---- failed rows pop: tinted ground, red edge, the failure class inline ---- */
.tk-row[data-state="failed"] { background: linear-gradient(90deg, #ff5a5a14, #ff5a5a07 42%, transparent 78%);
  border-color: #ff5a5a33; }
.tk-row[data-state="failed"]:hover { background: linear-gradient(90deg, #ff5a5a1f, #ff5a5a0c 42%, #ffffff06 78%);
  border-color: #ff5a5a55; }
.tk-row[data-state="failed"]::before { content: ""; position: absolute; left: -1px; top: 5px; bottom: 5px;
  width: 2px; border-radius: 2px; background: var(--tk-failed); }
.tk-eclass { font-family: var(--tk-mono); font-size: 9px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #ff9d9d; background: #ff5a5a24; border: 1px solid #ff5a5a4d;
  border-radius: 4px; padding: 0 5px; line-height: 15px; flex: none; max-width: 340px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* a raw message standing in for a missing failure_kind (pre-cutover rows,
   ENG-4985): dotted edge and sentence case, so it never reads as a taxonomy value */
.tk-eclass.is-untyped { border-style: dotted; text-transform: none; font-weight: 600; letter-spacing: 0;
  color: #e8a0a0; background: #ff5a5a17; }
.tk-errline { font-family: var(--tk-mono); font-size: 10px; color: #e88c8c; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---- escalation is a correct hand-off, not a breakage: present, not loud ---- */
.tk-row[data-state="escalated"] { border-left: 2px solid #ffb02066; }
.tk-row[data-state="escalated"]:hover { background: #ffb0200f; }
.tk-escl { font-family: var(--tk-mono); font-size: 9px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #e0a94f; border: 1px solid #ffb02040; border-radius: 4px;
  padding: 0 5px; line-height: 15px; flex: none; }

/* ---- deviation bands: green under typical, red over, plain when unjudgeable ---- */
.tk-dv { font-family: var(--tk-mono); font-variant-numeric: tabular-nums; font-size: 10.5px;
  color: var(--tk-bone); white-space: nowrap; cursor: help; }
.tk-dv.tk-dv-g2 { color: #2fd48e; }
.tk-dv.tk-dv-g1 { color: #8ad3ae; }
.tk-dv.tk-dv-n { color: var(--tk-mute); }
.tk-dv.tk-dv-r1 { color: #ffb020; }
.tk-dv.tk-dv-r2 { color: #ff6b6b; }
.tk-dv.tk-dv-none { color: var(--tk-bone); }
.tk-dv.tk-dv-empty { color: var(--tk-ghost); }
.tk-dv.is-bold { font-weight: 800; letter-spacing: -.01em; }
.tk-dv.is-bold::after { content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%;
  background: currentcolor; vertical-align: 3px; margin-left: 3px; }

.tk-rid { font-family: var(--tk-mono); font-size: 11px; color: var(--tk-faint); }
.tk-row:hover .tk-rid { color: var(--tk-pr); }

.tk-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tk-title .tk-tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px;
  letter-spacing: -.005em; }
.tk-title .tk-tx:hover { text-decoration: underline; }
.tk-row[data-state="failed"] .tk-tx, .tk-row[data-state="cancelled"] .tk-tx { color: var(--tk-mute); }
.tk-flag { font-family: var(--tk-mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase;
  border-radius: 4px; padding: 0 4px; line-height: 14px; flex: none; font-weight: 700; }
.tk-flag.is-crit { background: #ff5a5a22; color: #ff8080; border: 1px solid #ff5a5a44; }
.tk-flag.is-group { background: #8b6bf01c; color: #b39cf8; border: 1px solid #8b6bf03d; }
.tk-flag.is-auto { background: #3fd69a1c; color: #6fe0b5; border: 1px solid #3fd69a3d; }

/* ---- the lifecycle track ---- */
.tk-track { display: flex; align-items: center; flex: none; }
.tk-node { width: 8px; height: 8px; border-radius: 50%; flex: none; position: relative;
  box-shadow: inset 0 0 0 1.5px #504b43; }
.tk-node.is-done { background: var(--tk-sc); box-shadow: none; }
.tk-node.is-now { background: var(--tk-sc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tk-sc) 30%, transparent); }
.tk-node.is-broken { background: none; box-shadow: inset 0 0 0 1.5px var(--tk-failed); }
.tk-node.is-broken::after, .tk-node.is-broken::before { content: ""; position: absolute; left: 1.4px;
  right: 1.4px; top: 3.2px; height: 1.5px; background: var(--tk-failed); border-radius: 1px; }
.tk-node.is-broken::after { transform: rotate(45deg); }
.tk-node.is-broken::before { transform: rotate(-45deg); }
.tk-node.is-hand { background: var(--tk-escalated); box-shadow: 0 0 0 3px #ffb0203d; }
.tk-link { width: 13px; height: 2px; background: #3b3830; flex: none; border-radius: 1px; }
.tk-link.is-done { background: var(--tk-sc); }
.tk-link.is-waiting { background: repeating-linear-gradient(90deg, #504b43 0 2px, transparent 2px 4.5px); }

.tk-pr { font-family: var(--tk-mono); font-size: 11px; color: var(--tk-pr); white-space: nowrap; }
.tk-pr:hover { text-decoration: underline; }
.tk-pr.is-none { color: var(--tk-ghost); }
.tk-pr .tk-ext { font-size: 8px; opacity: .6; vertical-align: 1px; }

/* one time column: when it started, then how long the agent actually ran */
.tk-tcol { display: flex; align-items: baseline; justify-content: flex-end; gap: 7px;
  font-family: var(--tk-mono); white-space: nowrap; }
.tk-tcol .tk-at { font-size: 10.5px; color: var(--tk-faint); }
.tk-tcol > .tk-dv, .tk-tcol .tk-ran { font-size: 10.5px; min-width: 46px; text-align: right; }
.tk-tcol .tk-ran { font-family: var(--tk-mono); color: var(--tk-mute); }
.tk-tcol .tk-ran.is-none { color: var(--tk-faint); }
.tk-chev { color: var(--tk-ghost); font-size: 9px; transition: transform .16s; }
.tk-item[open] > .tk-row .tk-chev { transform: rotate(90deg); color: var(--tk-mute); }

/* ═══ expanded detail ════════════════════════════════════════════════════ */
.tk-detail { margin: 2px 9px 10px; border: 1px solid var(--tk-edge); border-left: 2px solid var(--tk-sc);
  border-radius: 9px; background: var(--tk-slab); padding: 12px 14px;
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
.tk-dlbl { font-family: var(--tk-mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--tk-faint); margin-bottom: 5px; }
.tk-dlbl.is-spaced { margin-top: 12px; }
.tk-desc { font-size: 12px; color: var(--tk-mute); line-height: 1.6; margin-bottom: 11px; }
/* tinted by the row's own verdict: red when it broke, amber when the agent
   handed a live PR to a human on purpose */
.tk-err { background: color-mix(in srgb, var(--tk-sc) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--tk-sc) 28%, transparent); border-radius: 7px;
  padding: 8px 10px; font-family: var(--tk-mono); font-size: 11px;
  color: color-mix(in srgb, var(--tk-sc) 62%, var(--tk-bone)); white-space: pre-wrap;
  overflow-wrap: anywhere; line-height: 1.55; max-height: 110px; overflow: auto; }
.tk-kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 11.5px; }
.tk-kv dt { font-family: var(--tk-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--tk-faint); white-space: nowrap; }
.tk-kv dd { font-family: var(--tk-mono); font-size: 11px; color: var(--tk-bone); overflow: hidden;
  text-overflow: ellipsis; }
.tk-kv dd.is-empty { color: var(--tk-ghost); }
.tk-kv dd.is-state { color: var(--tk-sc); }
.tk-tl { display: flex; flex-direction: column; margin-top: 10px; }
.tk-tl .tk-e { display: grid; grid-template-columns: 11px 1fr auto; gap: 9px; align-items: start;
  position: relative; padding-bottom: 9px; }
.tk-tl .tk-e:last-child { padding-bottom: 0; }
.tk-tl .tk-e::before { content: ""; position: absolute; left: 5px; top: 11px; bottom: -1px; width: 1px;
  background: var(--tk-edge2); }
.tk-tl .tk-e:last-child::before { display: none; }
.tk-tl .tk-e i { width: 9px; height: 9px; border-radius: 50%; background: var(--tk-ec, var(--tk-ghost));
  margin-top: 3px; z-index: 1; box-shadow: 0 0 0 3px var(--tk-slab); }
.tk-tl .tk-e .tk-ev { font-size: 11.5px; }
.tk-tl .tk-e .tk-t { font-family: var(--tk-mono); font-size: 10px; color: var(--tk-faint); white-space: nowrap; }
.tk-ec-queued { --tk-ec: var(--tk-queued); }
.tk-ec-running { --tk-ec: var(--tk-running); }
.tk-ec-pr { --tk-ec: var(--tk-pr); }
.tk-ec-state { --tk-ec: var(--tk-sc); }

/* conflict-resolution block: everything needed to pick the rebase up by hand */
.tk-cbox { border: 1px solid #8b6bf033; background: #8b6bf00d; border-radius: 8px; padding: 9px 11px;
  display: flex; flex-direction: column; gap: 5px; }
.tk-crow { display: grid; grid-template-columns: 104px 1fr; gap: 10px; align-items: baseline; font-size: 11.5px; }
.tk-crow.is-top { align-items: start; }
.tk-ck { font-family: var(--tk-mono); font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--tk-faint); }
.tk-cv { font-family: var(--tk-mono); font-size: 11px; min-width: 0; }
.tk-cv.is-link { color: #b39cf8; }
.tk-cv.is-link:hover { text-decoration: underline; }
.tk-files { display: flex; flex-direction: column; gap: 2px; }
.tk-files code { font-family: var(--tk-mono); font-size: 10.5px; color: #ff9d9d; background: #ff5a5a14;
  border: 1px solid #ff5a5a29; border-radius: 4px; padding: 1px 5px; width: fit-content; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-spendbox { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; }
.tk-sb { display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  border-bottom: 1px dotted var(--tk-edge2); padding-bottom: 2px; }
.tk-sk { font-family: var(--tk-mono); font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--tk-faint); }
.tk-sv { font-family: var(--tk-mono); font-size: 11.5px; font-weight: 600; }
.tk-detail code { font-family: var(--tk-mono); font-size: 11px; color: var(--tk-mute);
  background: var(--tk-ink); border: 1px solid var(--tk-edge); border-radius: 4px; padding: 0 4px; }
.tk-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; grid-column: 1 / -1;
  border-top: 1px solid var(--tk-edge); padding-top: 11px; }
.tk-acts .tk-btn { font-size: 11.5px; padding: 4px 10px; }

/* ═══ footer / empty ═════════════════════════════════════════════════════ */
.tk-foot { display: flex; align-items: center; gap: 12px; padding: 14px 18px 26px; flex-wrap: wrap; }
.tk-foot .tk-info { font-family: var(--tk-mono); font-size: 11px; color: var(--tk-faint); }
.tk-empty { text-align: center; padding: 64px 20px; }
.tk-empty .tk-big { font-size: 15px; font-weight: 650; margin-bottom: 6px; }
.tk-empty p { color: var(--tk-mute); font-size: 12.5px; max-width: 380px; margin: 0 auto 14px; }
.tk-empty .tk-ring { width: 44px; height: 44px; border-radius: 50%; border: 1.5px dashed var(--tk-edge2);
  margin: 0 auto 14px; display: grid; place-items: center; color: var(--tk-ghost); font-size: 16px; }
.tk-alert { margin: 18px; border: 1px solid #ff5a5a4d; background: #ff5a5a14; border-radius: 9px;
  padding: 12px 14px; color: #ff9d9d; font-size: 12.5px; }

/* compact: one line. The meta strip keeps source, category and spend — the
   three the operator filters on — and drops repo/worker/template to the panel. */
.tk-root[data-density="compact"] .tk-row {
  grid-template-columns: 16px 44px minmax(170px, 1fr) 410px 88px 54px 104px 18px;
  grid-template-areas: "dot id title meta track pr time chev"; gap: 11px; }
.tk-root[data-density="compact"] .tk-meta { display: grid;
  grid-template-columns: 64px minmax(120px, 1fr) 118px; gap: 10px; }
.tk-root[data-density="compact"] .tk-meta > .tk-spend { margin-left: 0; }
.tk-root[data-density="compact"] .tk-row > .tk-chev2 { display: none; }
.tk-root[data-density="compact"] .tk-meta > .tk-repo,
.tk-root[data-density="compact"] .tk-meta > .tk-wk,
.tk-root[data-density="compact"] .tk-meta > .tk-org,
.tk-root[data-density="compact"] .tk-meta > .tk-tmpl,
.tk-root[data-density="compact"] .tk-meta > .tk-errline { display: none; }

@media (max-width: 1400px) {
  .tk-meta > .tk-tmpl { display: none; }
  .tk-root[data-density="compact"] .tk-row {
    grid-template-columns: 10px 44px minmax(150px, 1fr) 240px 88px 54px 88px 18px; }
}
@media (max-width: 1150px) {
  .tk-rail { grid-template-columns: repeat(4, 1fr); }
  .tk-row { grid-template-columns: 10px 42px minmax(150px, 1fr) 88px 54px 56px 18px;
    grid-template-areas: "dot id title track pr time chev" ". meta meta meta meta meta chev2"; }
  .tk-meta > .tk-wk, .tk-meta > .tk-tmpl { display: none; }
  .tk-tcol .tk-ran { display: none; }
  .tk-detail { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .tk-root *, .tk-root *::before, .tk-root *::after { animation: none !important; transition: none !important; }
}
