/* Task page layout (founder 2026-11-09). Loaded after every other sheet.

   The DAG canvas is the page: it opens at 100 % on the running node and gets
   all the height that is left. Above it there are at most two rows:

     1. Task header — ☰ · title · status · goal (one line) · Overview ·
        Rounds · Usage and cost · Flow/Team/Results · ⋯ · run control.
     2. Run strip (task-runtime.mjs .runtime-head) — Workers · progress ·
        elapsed · cost · DAG layers (one scrolling line) · Locate · View ·
        Pause/Stop · ⋯.

   Overview, Rounds and Usage are header entries whose content opens as a
   popover; notices about the canvas (freshness, control receipts) float on
   the canvas instead of taking rows. The "Work / Task" title row and the
   page-wide Remote Hand activity row are gone (the latter lives under the
   selected Device). The Assistant floats over the page (assistant-drag.mjs). */

/* ---- 1. Task header: one line ------------------------------------------- */
.task-page--spa .task-detail__head {
  position: relative;
  z-index: 20;
  flex-wrap: nowrap;
  min-height: 40px;
  gap: 8px;
  padding: 4px 10px;
}
.task-page--spa .task-detail__head > * { flex-shrink: 0; }
.task-page--spa .task-detail__head .task-detail__title { flex: 0 1 auto; min-width: 48px; max-width: 26%; }
/* The title shrinks inside its 26% box: an unshrinkable h2 (vlc-skin's
   `flex: none`) painted a long title over the status and the entries after it. */
.task-page--spa .task-detail__head .task-detail__title h2 {
  flex: 0 1 auto; min-width: 0;
  max-width: none; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--mx-text-control); font-weight: 600;
}
.task-page--spa .task-detail__head > .task-detail__goal {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 6px;
  min-height: 0; margin: 0; padding: 0 0 0 10px;
  border: 0; border-left: 1px solid var(--mx-line, #30363d); border-radius: 0; background: transparent;
}
/* No "Goal" label: the one line after the status can only be the goal. */
.task-page--spa .task-detail__head > .task-detail__goal b { display: none; }
.task-page--spa .task-detail__head > .task-detail__goal span {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--mx-dim, #8b949e); font-size: var(--mx-text-caption); line-height: 1.4;
}
.task-page--spa .task-detail__head .task-detail__actions { margin-left: 0; flex-wrap: nowrap; }

/* ---- Header entries: Overview · Rounds · Usage and cost ------------------- */
.task-page--spa .task-detail__head > .task-detail__info { flex: 0 1 auto; min-width: 0; }
.task-detail__info { display: flex; align-items: center; gap: 4px; }
.task-detail__info > div { position: relative; flex: 0 1 auto; min-width: 0; margin: 0; padding: 0; border: 0; background: none; }
.task-detail__info > .task-detail__overview { max-width: 300px; }
.task-detail__info .task-overview,
.task-detail__info .task-iter,
.task-detail__info .task-iter__entry { display: block; min-width: 0; max-width: 100%; }
.task-detail__info > div:empty { display: none; }
.task-detail__info .task-overview,
.task-detail__info .task-iter { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; gap: 0; }
/* One chip look for the three entries. */
.task-detail__info .task-overview > summary,
.task-detail__info .task-iter__entry > summary,
.task-detail__info .task-detail__usage > button {
  display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; height: 26px; max-width: 100%; margin: 0;
  padding: 0 10px; border: 1px solid var(--mx-line, #30363d); border-radius: 999px;
  background: transparent; color: var(--mx-dim, #8b949e); font: 500 var(--mx-text-caption)/1 var(--font, system-ui);
  white-space: nowrap; overflow: hidden; cursor: pointer; list-style: none; box-shadow: none;
}
.task-detail__info .task-overview > summary::-webkit-details-marker,
.task-detail__info .task-iter__entry > summary::-webkit-details-marker { display: none; }
.task-detail__info .task-overview > summary:hover,
.task-detail__info .task-iter__entry > summary:hover,
.task-detail__info .task-detail__usage > button:hover,
.task-detail__info details[open] > summary,
.task-detail__info .task-detail__usage > button[aria-expanded="true"] { border-color: var(--vl-primary, #58a6ff); color: var(--mx-ink, #e6edf3); }
.task-detail__info .task-overview > summary b { color: var(--mx-ink, #e6edf3); font-weight: 600; }
.task-detail__info .task-overview > summary .task-overview__summary-action { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.task-detail__info .task-overview > summary .task-overview__summary-action b { font-weight: 500; color: inherit; }
.task-detail__info summary .mx-tag { padding: 0 6px; font-size: var(--mx-text-caption); line-height: 16px; }
.task-detail__info .task-detail__bill [data-bill-total] { color: var(--mx-ink, #e6edf3); }
.task-detail__bill-warn { display: inline-grid; place-items: center; width: 14px; height: 14px; margin-left: 2px; border-radius: 50%; background: var(--vl-warning, #d29922); color: #0d1117; font: 700 var(--mx-text-caption)/1 var(--font, system-ui); }
/* Their content opens as a popover over the canvas. */
.task-detail__info .task-overview[open] > :not(summary),
.task-detail__info .task-iter__entry[open] > :not(summary),
.task-detail__info .task-detail__usage > [data-bill-detail] {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0;
  box-sizing: border-box; width: 460px; max-width: calc(100vw - 32px); max-height: min(70vh, 640px); overflow: auto;
  margin: 0; padding: 12px; border: 1px solid var(--mx-line-strong, #3d444d); border-radius: 10px;
  background: var(--mx-panel, #161b22); box-shadow: 0 16px 40px rgba(1, 4, 9, .55);
  font-size: var(--mx-text-caption); line-height: 1.5; color: var(--mx-ink, #e6edf3);
}
/* The entries sit right of centre: the later ones open leftwards. */
.task-detail__info .task-iter__entry[open] > :not(summary),
.task-detail__info .task-detail__usage > [data-bill-detail] { left: auto; right: 0; }
.task-detail__info .task-iter__entry[open] > .task-iter__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.task-detail__info .task-iter__pop.mx-panel { display: flex; flex-direction: column; gap: 8px; width: 520px; }
.task-detail__info .task-iter__pop .task-iter__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.task-detail__info .task-detail__usage > [data-bill-detail] details.task-bill > summary { list-style: none; }

/* ---- 2. Run strip: one line — task-controls.css (".task-runtime--inline
   run strip"), so every host of the inline runtime gets it. -------------- */

/* ---- 3. The canvas takes the rest ---------------------------------------- */
.task-page--spa .task-detail__body { padding: 0; overflow: hidden; }
.task-page--spa .task-detail__runtime { position: relative; }
.task-page--spa .task-detail__dag { flex: 1 1 auto; min-height: 320px; }
/* Canvas notices float on the canvas, under the run strip. */
.task-page--spa .task-detail__notes {
  position: absolute; z-index: 7; top: 48px; left: 12px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  max-width: min(60%, 560px); pointer-events: none;
}
.task-page--spa .task-detail__notes > * {
  margin: 0; padding: 3px 9px; border: 1px solid var(--mx-line, #30363d); border-radius: 6px;
  background: rgba(13, 17, 23, .9); font-size: var(--mx-text-caption); line-height: 1.45; pointer-events: auto;
}
.task-page--spa .task-detail__notes > [hidden] { display: none; }
.task-page--spa .task-detail__notes > .task-detail__dag-note { border-color: #593037; }

/* ---- Page frame: no title row -------------------------------------------- */
/* The page is exactly the viewport under the top bar: the frame's own top
   padding moves into the Task page, so nothing scrolls off the bottom. */
.page:has(.task-page--spa) { padding-top: 0; padding-bottom: 0; }
.mx-next .mx-page.task-page--spa { box-sizing: border-box; padding-top: 8px; }
.task-page--spa .task-device-bar:empty { display: none; }

/* ---- Remote Hand activity: a compact entry under the selected Device ------ */
.task-tree__device-children .task-hand-activity { margin: 4px 0 6px; padding: 0; border-radius: 8px; }
.task-tree__device-children .task-hand-activity > summary { padding: 5px 9px; font-size: var(--mx-text-caption); color: var(--mx-dim, #8b949e); cursor: pointer; }
.task-tree__device-children .task-hand-activity__body { max-height: min(30vh, 260px); overflow-y: auto; font-size: var(--mx-text-caption); }

@media (max-width: 1100px) {
  .task-page--spa .task-detail__head > .task-detail__goal { display: none; }
  .task-page--spa .task-runtime--inline .runtime-head { flex-wrap: wrap; }
}

/* Narrow windows: the Overview chip gives up its text first, so Rounds and
   Usage and cost stay whole instead of being cut ("Rou", "用量与费") at 1024 px
   (multi-OS UI check, 2026-11-14: macOS fonts are wider than Linux). */
.task-detail__info > div:not(.task-detail__overview) { flex-shrink: 0; }
@media (max-width: 1100px) {
  .task-detail__info > .task-detail__overview { max-width: 180px; }
}

/* ---- Phone width: the Task header wraps, the canvas gets the screen ------- */
/* Hicode's phone check of a production Task (2026-11-14, 390 px): the header
   stayed on one line, the facts chips painted over the view tabs and
   「文件与预览」 sat past the right edge, so the files and the preview of the
   Task could not be reached. Here the header wraps: the facts and the view
   tabs each take a full row that scrolls sideways, and the canvas below them
   is tall enough to read a file or a preview. */
@media (max-width: 560px) {
  .task-page--spa .task-detail__head { flex-wrap: wrap; row-gap: 6px; }
  .task-page--spa .task-detail__head .task-detail__title { flex: 1 1 0; max-width: none; }
  .task-page--spa .task-detail__head > .task-detail__info,
  .task-page--spa .task-detail__head > .task-detail__views {
    order: 10; flex: 1 1 100%; min-width: 0; max-width: 100%;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  }
  .task-page--spa .task-detail__head > .task-detail__views { order: 11; }
  .task-page--spa .task-detail__head > .task-detail__info:empty { display: none; }
  .task-page--spa .task-detail__views .task-canvas-switch { flex: none; }
  .task-page--spa .task-detail { overflow: visible; }
  .task-page--spa .task-detail__dag { min-height: 72vh; }
  /* The canvas stays the screen's width: its run strip, layer path and plan
     line wrap or scroll inside it instead of widening the page, which then
     shifted sideways and cut off the left edge when a file was opened. */
  .task-page--spa .task-detail,
  .task-page--spa .task-detail__dag { min-width: 0; max-width: 100%; }
  .task-page--spa .task-detail__dag .runtime-head { flex-wrap: wrap; min-width: 0; }
  .task-page--spa .task-detail__dag .runtime-viewing { min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .task-page--spa .task-detail__dag .runtime-authority { flex-wrap: wrap; min-width: 0; }
  .task-page--spa .task-detail__dag .runtime-authority > * { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .task-page--spa .task-detail__dag .runtime-team { min-width: 0; max-width: 100%; flex-wrap: wrap; }
}

/* ==== Task page declutter (Hicode 2026-11-15) ==============================
   The canvas is the page. Above it there is the Task header only; everything
   about the run that is words (Workers, counts, elapsed, cost, what the graph
   is drawn from, the device binding) opens from the ⓘ of the canvas toolbar.
   The toolbar floats on the canvas, holds icons only, and shows a command only
   in the view where it acts and only while it can act. ---------------------- */

/* ---- 1. Task header: never cut, never overlapping -------------------------
   The header measures ITSELF (a container query), not the window: with the
   Task tree and a docked Assistant beside it, the column is far narrower than
   the viewport and the old `max-width` media rules never fired. Up to 1300 px
   it is two rows: ☰ · title · status · ⋯ · run control, then the view tabs
   (left) and the three facts chips (right). Wider, it is the one line.
   The second row starts at a fixed break, not where the first row runs out of
   room (Anna 2026-11-19): with the 停止 button of a running Task the tabs
   wrapped to the left of row two, and without it (a failed or finished Task)
   they stayed at the right of row one, so 团队 / 流程 / 文件与预览 / 结果
   jumped between two places as the Task's state changed. */
.task-page--spa .task-detail__head { flex-wrap: wrap; row-gap: 4px; container: taskhead / inline-size; }
.task-page--spa .task-detail__head .task-detail__title { min-width: 120px; max-width: 34%; }
.task-detail__info > div,
.task-page--spa .task-detail__head > .task-detail__info { flex-shrink: 0; }
@container taskhead (min-width: 561px) and (max-width: 1300px) {
  .task-page--spa .task-detail__head > .task-detail__goal { display: none; }
  .task-page--spa .task-detail__head .task-detail__title { flex: 1 1 60%; max-width: none; }
  .task-page--spa .task-detail__head > .task-detail__actions { order: 1; margin-left: auto; }
  .task-page--spa .task-detail__head::after { content: ''; order: 2; flex: 0 0 100%; height: 0; }
  .task-page--spa .task-detail__head > .task-detail__views { order: 3; }
  .task-page--spa .task-detail__head > .task-detail__info { order: 4; margin-left: auto; }
}

/* ---- 2. Canvas toolbar: icons, floating on the canvas ---------------------- */
.runtime-btn.runtime-btn--icon { display: inline-grid; place-items: center; width: 28px; padding: 0; }
.runtime-btn--icon .runtime-icon { display: block; }
.runtime-hand-buttons { display: inline-flex; align-items: center; gap: 2px; }
.runtime-hand-buttons[hidden] { display: none; }
.runtime-info-menu > .runtime-info-panel { width: min(520px, calc(100vw - 48px)); max-height: min(70vh, 640px); gap: 10px; padding: 12px; }
.runtime-info-panel .runtime-team { flex: none; flex-wrap: wrap; white-space: normal; overflow: visible; row-gap: 2px; }
.runtime-info-panel .runtime-info-note { margin: 0; }
.runtime-info-panel .runtime-info-note b { color: var(--mx-ink, #e6edf3); font-weight: 600; margin-right: 6px; }
.runtime-info-panel .runtime-adaptive,

.task-runtime--inline[data-header-views="1"] > .runtime-head {
  position: absolute; z-index: 8; top: 8px; left: 12px; right: 12px;
  min-height: 0; padding: 0; gap: 8px; border: 0; background: none;
  flex-wrap: nowrap; align-items: flex-start; pointer-events: none;
}
.task-runtime--inline[data-header-views="1"] > .runtime-head:has(.runtime-controls details[open]) { z-index: 96; }
.task-runtime--inline[data-header-views="1"] > .runtime-head > * { pointer-events: auto; }
.task-runtime--inline[data-header-views="1"] > .runtime-head > .runtime-viewing.task-layers,
.task-runtime--inline[data-header-views="1"] > .runtime-head > .runtime-controls {
  box-sizing: border-box; min-height: 32px; padding: 2px 3px;
  border: 1px solid var(--mx-line, #30363d); border-radius: 8px;
  background: rgba(13, 17, 23, .92); box-shadow: 0 4px 14px rgba(1, 4, 9, .35);
}
.task-runtime--inline[data-header-views="1"] > .runtime-head > .runtime-viewing.task-layers {
  flex: 0 1 auto; gap: 6px; padding: 2px 8px 2px 3px; overflow-x: auto; scrollbar-width: none;
}
.task-runtime--inline[data-header-views="1"] > .runtime-head > .runtime-viewing.task-layers[hidden] { display: none; }
.task-runtime--inline[data-header-views="1"] > .runtime-head > .runtime-controls { gap: 2px; margin-left: auto; }
.task-runtime--inline[data-header-views="1"] > .runtime-head .runtime-btn { border-color: transparent; background: transparent; }
.task-runtime--inline[data-header-views="1"] > .runtime-head .runtime-btn:hover:not(:disabled),
.task-runtime--inline[data-header-views="1"] > .runtime-head details[open] > summary.runtime-btn { background: color-mix(in srgb, var(--vl-primary, #1f6feb) 22%, transparent); }
.task-runtime--inline[data-header-views="1"] > .runtime-head .runtime-btn--primary { color: var(--vl-success, #3fb950); }
.task-runtime--inline[data-header-views="1"] > .runtime-head .runtime-btn--danger { color: var(--vl-danger, #f85149); }
.task-runtime--inline[data-header-views="1"] > .runtime-head .runtime-menu-panel .runtime-btn { border-color: var(--mx-line, #30363d); }
.task-layers__back { display: inline-grid; place-items: center; width: 26px; padding: 0; font-size: var(--mx-text-body); }
.task-layers__chip small { margin-left: 2px; }

/* A command shows only where it acts: Locate, View, the run's Pause / Continue /
   Stop / Run and Replan belong to the Flow graph. The Team view keeps ⓘ and ⋯. */
[data-canvas-shown]:not([data-canvas-shown="flow"]) .runtime-controls > [data-runtime-follow],
[data-canvas-shown]:not([data-canvas-shown="flow"]) .runtime-controls > .runtime-hand-buttons,
[data-canvas-shown]:not([data-canvas-shown="flow"]) .runtime-controls > [data-runtime-command],
[data-canvas-shown]:not([data-canvas-shown="flow"]) .runtime-controls > [data-runtime-plan],
[data-canvas-shown]:not([data-canvas-shown="flow"]) .runtime-head > .runtime-viewing.task-layers { display: none; }
/* Files and Results are not the graph: no toolbar, the whole canvas is theirs. */
.task-runtime--inline[data-header-views="1"][data-canvas-shown="files"] > .runtime-head,
.task-runtime--inline[data-header-views="1"][data-canvas-shown="results"] > .runtime-head { display: none; }
.task-runtime[data-header-views="1"][data-canvas-shown="files"] > .task-files-stage { inset: 0; }
.task-runtime[data-header-views="1"][data-canvas-shown="results"] > .task-canvas-layer { top: 12px; }

/* What the graph is drawn from (plan, live run, last observed) is said in the ⓘ
   panel; on the canvas the line stays for assistive technology only. */
.task-runtime--inline[data-header-views="1"] .runtime-authority--plan {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ---- 3. Team view: a Worker's DAGs ------------------------------------------ */
.task-canvas-dags { display: grid; gap: 4px; }
.task-canvas-dag {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 5px 8px 5px 18px; border: 1px solid #29364a; border-radius: 6px; font-size: var(--mx-text-caption); color: var(--mx-ink, #e6edf3);
}
.task-canvas-dag:hover, .task-canvas-dag:focus-visible { border-color: var(--vl-primary, #1f6feb); }
.task-canvas-dag > i { width: 7px; height: 7px; border-radius: 50%; background: var(--mx-dim, #8b949e); flex: none; }
.task-canvas-dag--active > i { background: var(--vl-primary, #58a6ff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--vl-primary, #58a6ff) 25%, transparent); }
.task-canvas-dag--done > i { background: var(--vl-success, #3fb950); }
.task-canvas-dag--failed > i { background: var(--vl-danger, #f85149); }
.task-canvas-dag--blocked > i { background: var(--vl-warning, #d29922); }
.task-canvas-dag > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-canvas-dag > small { color: var(--mx-dim, #8b949e); font-variant-numeric: tabular-nums; }
.task-detail__placement:empty { display: none; }
.task-detail__placement .task-dispatch__nodes { margin: 6px 0 0; }

/* The shared graph's own path line repeats the layer line above (path, Collapse,
   Back to parent, Expand, Open run): on the Task page the layer line is the one
   place for them. Its round and revision history stay, under the toolbar. */
.task-runtime--inline[data-header-views="1"] .vl-runtime-dag__nav { position: absolute; z-index: 5; top: 48px; left: 12px; padding: 0; border: 0; background: none; }
.task-runtime--inline[data-header-views="1"] .vl-runtime-dag__nav > .vl-runtime-dag__crumbs,
.task-runtime--inline[data-header-views="1"] .vl-runtime-dag__nav > [data-dag-expand],
.task-runtime--inline[data-header-views="1"] .vl-runtime-dag__nav > [data-dag-open-run],
.task-runtime--inline[data-header-views="1"] .vl-runtime-dag__nav > [data-dag-collapse],
.task-runtime--inline[data-header-views="1"] .vl-runtime-dag__nav > [data-dag-close-run] { display: none; }

/* ---- 4. Files and Preview ---------------------------------------------------- */
/* Large window: the workbench itself, fixed over the page (the editor inside is
   not reloaded). The page frame is lifted above the top bar and the Assistant
   while it is open; the dim surround is the popup's own shadow. */
.task-files-work { position: relative; }
.task-files-work__pop {
  position: absolute; z-index: 3; top: 3px; right: 8px; display: inline-grid; place-items: center;
  width: 28px; height: 26px; padding: 0; border: 1px solid transparent; border-radius: 6px;
  background: rgba(13, 17, 23, .85); color: var(--mx-dim, #a3a9cb); cursor: pointer;
}
.task-files-work__pop:hover, .task-files-work__pop[aria-pressed="true"] { color: var(--mx-ink, #f3f5ff); border-color: var(--mx-line-strong, #3a467c); }
.task-files-work__tabs { padding-right: 44px; }
.task-files-work.is-popped {
  position: fixed; z-index: 200; inset: 28px 32px; border: 1px solid var(--mx-line-strong, #3d444d); border-radius: 10px; overflow: hidden;
  background: var(--mx-bg, #0b0d18); box-shadow: 0 0 0 100vmax rgba(1, 4, 9, .62), 0 24px 60px rgba(1, 4, 9, .6);
}
.page:has(.task-files-work.is-popped) { z-index: 130; }

/* Read-only code view: syntax colours (code-highlight.mjs). */
.task-files-code__text .tk-comment { color: #8b949e; font-style: italic; }
.task-files-code__text .tk-string { color: #a5d6ff; }
.task-files-code__text .tk-number { color: #79c0ff; }
.task-files-code__text .tk-keyword { color: #ff7b72; }
.task-files-code__text .tk-call { color: #d2a8ff; }
.task-files-code__text .tk-key, .task-files-code__text .tk-attr { color: #7ee787; }
.task-files-code__text .tk-tag { color: #7ee787; }
.task-files-code__text .tk-heading { color: #79c0ff; font-weight: 600; }
/* The popup is above the Task header too. */
.task-detail:has(.task-files-work.is-popped) > .task-detail__head { z-index: auto; }
/* How far the run is, on the canvas toolbar: numbers, no label. */
.runtime-controls > .runtime-progress-pill { flex: none; padding: 0 8px; font-size: var(--mx-text-caption); line-height: 26px; color: var(--mx-ink, #e6edf3); font-variant-numeric: tabular-nums; }
/* Members panel: a card is as wide as the panel, never wider. A long step or flow
   name is cut with an ellipsis inside its row (the full name is the row's
   title), instead of pushing the card under the panel's edge. */
.task-canvas-agent, .task-canvas-agent__steps, .task-canvas-dags { grid-template-columns: minmax(0, 1fr); }
.task-canvas-agent, .task-canvas-agent > *, .task-canvas-step, .task-canvas-flowbar { min-width: 0; box-sizing: border-box; }
.task-canvas-flowbar { max-width: 100%; }
.task-canvas-step > .task-canvas-step__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-canvas-step > :not(.task-canvas-step__name) { flex: none; }
.task-canvas-agent__head { max-width: 100%; overflow-wrap: anywhere; }
/* A flow of dozens of steps: its progress bar stays inside the card. */
.task-canvas-flowbar__track { gap: 1px; overflow: hidden; }
.task-canvas-flowbar__track i { min-width: 0; }
/* The Hand Run's state beside its buttons: a word and a count. */
.runtime-hand-chip { padding: 0 8px; font-size: var(--mx-text-caption); line-height: 26px; white-space: nowrap; color: var(--mx-dim, #8b949e); font-variant-numeric: tabular-nums; }
.runtime-hand-chip[data-hand-run-state="delivered"] { color: var(--vl-primary, #58a6ff); }
.runtime-hand-chip[data-hand-run-state="completed"] { color: var(--vl-success, #3fb950); }
.runtime-hand-chip[data-hand-run-state="failed"] { color: var(--vl-danger, #f85149); }
.runtime-controls > .runtime-progress-pill[hidden] { display: none; }

/* Phone: the overview's next action is read whole, on as many lines as it needs
   (re-verify 2026-11-17, item 21: "已排队，尚无 …"). */
@media (max-width: 560px) {
  .task-detail__info .task-overview > summary { flex-wrap: wrap; }
  .task-detail__info .task-overview > summary .task-overview__summary-action { flex: 1 1 100%; overflow: visible; white-space: normal; text-overflow: clip; }
}

/* Several DAGs sent together: the toolbar menu that lists each DAG's plan and steps. */
.runtime-hand-bundle > summary { cursor: pointer; list-style: none; }
.runtime-hand-bundle > summary::-webkit-details-marker { display: none; }
.runtime-hand-bundle__panel { min-width: 360px; max-width: 520px; max-height: 70vh; overflow: auto; }
.runtime-hand-bundle__dags { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.runtime-hand-bundle__dag { padding: 8px 10px; border: 1px solid var(--mx-line, #30363d); border-radius: 8px; }
.runtime-hand-bundle__dag[data-used="0"] { opacity: .7; }
.runtime-hand-bundle__panel p { margin: 0; }
.runtime-hand-bundle__panel > p + p { margin-top: 4px; }
.runtime-hand-bundle__plan, .runtime-hand-bundle__planner { color: var(--mx-dim, #8b949e); font-size: var(--mx-text-caption); }
.runtime-hand-bundle__why { font-size: var(--mx-text-caption); margin-top: 2px; }
.runtime-hand-bundle__steps { margin: 6px 0 0; padding-left: 18px; font-size: var(--mx-text-caption); }
.runtime-hand-bundle__steps li[data-step-state="succeeded"] span { color: var(--vl-success, #3fb950); }
.runtime-hand-bundle__steps li[data-step-state="failed"] span { color: var(--vl-danger, #f85149); }

/* ---- Header beside a floating Assistant ----------------------------------
   assistant-drag.mjs clearTaskHeader(): an expanded floating window that overlaps
   the header's right part (its default place on a 1024px viewport) would cover the
   run controls; the header alone keeps clear of it. The page is not reserved. */
body.assistant-floating.assistant-clears-task-head .task-page--spa .task-detail__head {
  padding-right: var(--assistant-head-clear, 10px);
}
/* The canvas's floating run strip keeps clear the same way (its "more" menu holds Models). */
body.assistant-floating.assistant-clears-run-strip .task-runtime--inline[data-header-views="1"] > .runtime-head {
  right: var(--assistant-run-clear, 12px);
}

/* ==== Tight Task header (Irma 2026-11-22) ===================================
   One row from 900 px of header width (it was two rows below 1300 px):
     ☰ · icon · title over its goal · status · Flow › Process › Files | facts · ⋯ · run control
   The goal is the title's second line (it had its own boxed column and vanished
   first when space ran out); the three facts chips are smaller and the
   overview chip shows only its next action (its name is the tooltip). Below
   900 px the facts and tabs take a second row, as before. */
.task-page--spa .task-detail__head { min-height: 44px; gap: 8px; padding: 4px 10px; align-items: center; }
.task-page--spa .task-detail__head .task-detail__title {
  display: grid; flex: 1 1 auto; min-width: 140px; max-width: none; gap: 1px; align-content: center;
}
.task-page--spa .task-detail__head .task-detail__title h2 { line-height: 1.25; }
.task-page--spa .task-detail__head .task-detail__subtitle {
  margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--mx-dim, #8b949e); font-size: var(--mx-text-caption, 12px); line-height: 1.3;
}
.task-page--spa .task-detail__head > .mx-tag[data-task-status] { flex: none; }
.task-page--spa .task-detail__head > .task-detail__views { flex: none; }
.task-page--spa .task-detail__head > .task-detail__info { flex: none; gap: 4px; padding-left: 8px; border-left: 1px solid var(--mx-line, #30363d); }
.task-page--spa .task-detail__head > .task-detail__info:has(> div:not(:empty)) { display: flex; }
.task-detail__info .task-overview > summary,
.task-detail__info .task-iter__entry > summary,
.task-detail__info .task-detail__usage > button { height: 24px; padding: 0 8px; gap: 4px; }
.task-detail__info .task-overview > summary > b:first-child { display: none; }
.task-detail__info .task-overview > summary .task-overview__summary-action { max-width: 180px; }
.task-detail__info > .task-detail__overview { max-width: 220px; }
.task-page--spa .task-detail__head .task-detail__actions { gap: 6px; }
/* A container query cannot restyle the header itself, only its children: the
   title takes the room that is left (basis 0), so the row fits from 900 px. */
@container taskhead (min-width: 900px) {
  .task-page--spa .task-detail__head::after { display: none; }
  .task-page--spa .task-detail__head > .task-detail__actions,
  .task-page--spa .task-detail__head > .task-detail__views,
  .task-page--spa .task-detail__head > .task-detail__info { order: 0; margin-left: 0; }
  .task-page--spa .task-detail__head > .task-detail__title { flex: 1 1 0; min-width: 120px; max-width: none; }
}
@container taskhead (min-width: 561px) and (max-width: 899px) {
  .task-page--spa .task-detail__head > .task-detail__info { border-left: 0; padding-left: 0; }
}
