/**
 * Hakban mock desk — mission control layout and theme.
 *
 * Purpose
 *   One-screen ops grid. Tokens live here; the board only marks structure.
 *   Home `/` is the agent start page (curl for /api/llms.txt then claim).
 *   `/sources` is a Sources inbox plus a
 *   short empty main pane. Selecting a source fills the main pane
 *   with metadata (/sources/:name).
 *   /settings/prompt is Settings | variables | tab content. Rendered fills the right pane.
 *   Prompt Variables source headings collapse; the chevron matches listing rows.
 *   /api uses an API left nav (HTTP, MCP), not the Sources list.
 *   HTTP is a playable catalogue: expand a row for params and live curl.
 *   MCP is install, highlighted mcp.json, connect fields, and tools.
 *   API curl, mcp.json, Send bodies, and home-page commands are
 *   shared `.desk-code` blocks: square, no border, centred content,
 *   Copy in the block, read-only Ace.
 *   /settings uses a Settings left nav (Defaults, Inference, Prompt).
 *   /settings/inference is the inference provider form, including
 *   Ailised-style Sign in / Disconnect for Grok and Codex.
 *   A selected source metadata pane defaults to view; Edit sits at the
 *   top-right of that pane title row. New Source and Admin defaults stay
 *   the live editor.
 *   /api uses that same left-nav row language as Settings.
 *   /settings/prompt drops Sources. Prompt is always variables | tab content.
 *   Column rows drag to reorder from a quiet six-dot grip.
 *   Neighbours slide into the vacated slot while the pointer moves.
 *   The global left rail is Tasks, Claimed, and Completed as three
 *   equal-height panes, plus the Agent diary. Source pages focus it;
 *   all other pages aggregate Sources.
 *   Source desk crumbs: Hakban 黑板 > Sources dropdown > title.
 *   All three lists use one row: status-coloured leading dot, title left,
 *   status right, on the same column background. No item fill, box
 *   border, inner tray, or outline. The empty "None" line has no dot.
 *   Rows use the Agent diary dashed --line underline. Selected is a
 *   left edge, not a filled chip. Hover uses the same quiet fill as
 *   a focused public field. Click opens a read-only task modal.
 *   No DOM node may show an outline. A global *, ::before, ::after
 *   rule sets outline: none. Focus uses fill, never a ring.
 *   Empty panes stay a quiet line, not a fake card. The three stacks
 *   share leftover column height as 1fr / 1fr / 1fr. Long lists
 *   scroll inside that pane. Empty Completed still owns its third.
 *   The agent diary sits under the trio and does not steal those
 *   thirds.
 *   Listing rows expand into thumbnail | copy, with full-width history below,
 *   then collapse.
 *   Data tables sort from the header.
 *   Hover tips are 12px sentences. Cell and compose tips sit above
 *   the control. Sort-header tips sit just under the header so the
 *   listings scroll pane does not clip them. Sort carets use
 *   ::before so they do not collapse the tip box.
 *   Global chat is a right sidebar that pushes `.desk-stage` left.
 *   The FAB is a 48px black circle, 25px from the right and 24px
 *   from the bottom. It hides while the sidebar is open.
 *   New Source is a form-only modal (Metadata + Columns).
 *   Type is always source; chat send posts the new source.
 *   The chat composer is a 43px pill: plus, one-line field, voice, send.
 *   Metadata is Location (and Title/Brief on a live source). Admin
 *   defaults still show Task type. Then a compact column schema.
 *   Column instructions sit on the same row as name, type, and On table.
 *   Page pane heads (.col__head) are --page-head-gap (35px) between
 *   the breadcrumb/bar divider and the head's own border. --col-head
 *   is that gap plus the 1px border (border-box height). Header icon
 *   and text buttons shrink to --enter-btn-size so they fit the row.
 *   Adjacent header icon buttons sit in .col__head-icons at
 *   --page-head-icon-gap (0). Delete and other text actions stay
 *   outside that cluster so they keep the ordinary head gap.
 *   Section heads use .compose-section__head for a full-width
 *   --line border-bottom. Space above a head is --section-block-gap
 *   (pane top or the previous block). Space below a head to first
 *   content is --section-head-gap. Status shares that class.
 *   Field labels (Location and the like) stay unruled.
 *   Status keys share --source-meta-label so Desk path stays
 *   on one line and on the same left edge as Status.
 *   Column-row remove controls use --danger.
 *   Text, select, and textarea controls share one public chrome rule:
 *   no border or focus ring. Focus uses a lighter fill.
 *   Public fields are 26px tall with 5px vertical padding.
 *
 * Usage
 *   Linked from demo HTML. Toggle html[data-theme].
 */

:root {
  --font: Inter, "SF Pro Text", ui-sans-serif, system-ui, sans-serif;
  --text: 0.8125rem;
  --lead: 18px;
  --title: 0.9375rem;
  --pad: 8px;
  --gap: 8px;
  --radius: 8px;
  --bronze: #c48a4a;
  --danger: #e23;
  --good: #7dcea0;
  --conf-high: #5aa87a;
  --conf-medium: #d7a05c;
  --conf-low: #e08a3a;
  --conf-unknown: #c46b72;
  --fg: #101117;
  --bg: #f3f1ea;
  --muted: color-mix(in srgb, var(--fg) 58%, transparent);
  --line: color-mix(in srgb, var(--fg) 12%, transparent);
  --panel: color-mix(in srgb, var(--fg) 4%, var(--bg));
  --focus-ring: none;
  --page-head-gap: 35px;
  --page-head-icon-gap: 0;
  --col-head: calc(var(--page-head-gap) + 1px);
  --field-height: 26px;
  --icon-btn-size: 26px;
  --field-pad-y: 5px;
  --field-pad-x: 10px;
  --field-line: 16px;
  --lbl-control-gap: 3px;
  --section-block-gap: 20px;
  --section-head-gap: 12px;
  --source-meta-label: 9rem;
  --field-focus-fill: color-mix(in srgb, var(--fg) 8%, var(--panel));
  --detail-thumb: 168px;
  --rail: 268px;
  --prompt-vars: 20rem;
  --prompt-body: 0.875rem;
  --prompt-article-pad-x: 32px;
  --prompt-article-pad-top: 32px;
  --prompt-article-pad-bottom: 40px;
  --enter-btn-size: 26px;
  --enter-btn-pad: 5px;
  --global-chat: 360px;
  --chat-fab-size: 48px;
  --chat-fab-right: 25px;
  --chat-fab-bottom: 24px;
  --chat-fab-z: 35;
  --tip-font: 11px;
  --tip-pad-y: 4px;
  --tip-pad-x: 6px;
  --tip-min: 0;
  --tip-max: 14rem;
  --tip-z: 24;
  --tip-gap: 6px;
  --tip-lead: 14px;
  --prompt-tab-height: 35px;
  --prompt-tab-width: 72px;
  --task-row-gap: 0;
  --task-row-pad-y: 5px;
  --task-row-pad-x: 10px;
  --task-row-rule: 1px dashed var(--line);
  --task-row-dot: 5px;
  --task-row-dot-gap: 8px;
  --task-row-dot-fill: color-mix(in srgb, var(--muted) 55%, var(--line));
  --task-row-dot-idle: var(--task-row-dot-fill);
  --task-row-dot-waiting: var(--conf-medium);
  --task-row-dot-active: var(--bronze);
  --task-row-dot-done: var(--good);
  --task-row-status-idle: var(--muted);
  --task-row-status-waiting: var(--conf-medium);
  --task-row-status-active: var(--conf-low);
  --task-row-status-done: var(--good);
  --listing-lock-fill: color-mix(in srgb, var(--conf-medium) 16%, var(--panel));
  --listing-lock-hover-fill: color-mix(in srgb, var(--conf-medium) 22%, var(--panel));
  --task-stacks-min: min(70vh, 36rem);
  color-scheme: light;
  font-family: var(--font);
}

html[data-theme='dark'] {
  --fg: #f3f1ea;
  --bg: #0b0c10;
  --bronze: #d7a05c;
  --good: #8ed4ad;
  --conf-high: #7dcea0;
  --conf-medium: #d7a05c;
  --conf-low: #e08a3a;
  --conf-unknown: #c46b72;
  --panel: #12141a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

*,
*::before,
*::after {
  outline: none !important;
}

* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--fg) 24%, transparent) transparent;
}

html,
body.desk {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-size: var(--text);
  line-height: var(--lead);
  overflow: hidden;
}

body.desk {
  display: flex;
  flex-direction: column;
}

.desk-shell {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.desk-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.global-chat {
  display: flex;
  flex-direction: column;
  flex: 0 0 var(--global-chat);
  width: var(--global-chat);
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.global-chat[hidden] {
  display: none;
}

.global-chat__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 44px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
}

.global-chat__head h2 {
  margin: 0;
  font-size: var(--title);
  letter-spacing: -0.03em;
}

.global-chat .compose-chat {
  flex: 1;
  border-right: 0;
}

.chat-fab {
  position: fixed;
  right: var(--chat-fab-right);
  bottom: var(--chat-fab-bottom);
  z-index: var(--chat-fab-z);
  box-sizing: border-box;
  width: var(--chat-fab-size);
  height: var(--chat-fab-size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #000;
  color: #fff;
  display: grid;
  place-items: center;
  line-height: 0;
  overflow: visible;
}

.chat-fab:hover,
.chat-fab:focus-visible {
  background: #000;
}

.chat-fab[hidden],
body.is-chat-open .chat-fab {
  display: none;
}

.chat-fab svg {
  display: block;
  width: 22px;
  height: 22px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Public: text controls have no chrome. Focus is fill, not a ring. */
input,
select,
textarea,
.field,
.area {
  border: none;
  outline: var(--focus-ring);
  box-shadow: none;
}

input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible,
.field:focus,
.field:focus-visible,
.area:focus,
.area:focus-visible {
  border: none;
  outline: var(--focus-ring);
  box-shadow: none;
}

.field:focus,
.field:focus-visible,
.area:focus,
.area:focus-visible {
  background-color: var(--field-focus-fill);
}

button { cursor: pointer; }

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--bronze) 70%, transparent);
}

#chrome {
  position: relative;
  z-index: 8;
}

.bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
}

.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--fg); }
.crumbs .now { color: var(--fg); font-weight: 600; }
.crumbs .sep { color: var(--muted); padding: 0 1px; }

.crumb-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.crumb-menu__btn {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0 0 0 2px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.crumb-menu__btn:hover,
.crumb-menu__btn:focus-visible,
.crumb-menu__btn[aria-expanded='true'] {
  color: var(--fg);
}

.crumb-menu__chevron {
  display: block;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: center;
  transform-box: fill-box;
  transform: rotate(90deg);
}

.crumb-menu__btn[aria-expanded='true'] .crumb-menu__chevron {
  transform: rotate(-90deg);
}

.crumb-menu__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  width: max-content;
  min-width: 100%;
  max-width: 18rem;
  max-height: min(20rem, calc(100vh - 4rem));
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
}

.crumb-menu__list[hidden] {
  display: none;
}

.crumb-menu__item {
  display: block;
  padding: 5px 10px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crumb-menu__item:hover,
.crumb-menu__item:focus-visible {
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 6%, transparent);
}

.crumb-menu__item.is-on {
  color: var(--fg);
  font-weight: 600;
}

.crumb-menu__empty {
  display: block;
  padding: 5px 10px;
  color: var(--muted);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--fg);
}

.crumb-home {
  font-weight: 500;
  letter-spacing: 0;
  color: var(--fg);
}

.crumb-home__mark {
  text-decoration: underline;
  text-decoration-color: var(--bronze);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.crumbs a.brand:hover .crumb-home { color: var(--fg); }

.compose,
.block,
.pane--diary,
.col__head {
  flex-shrink: 0;
}

.pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.pane--fit {
  flex: 0 0 auto;
  min-height: auto;
}

.pane--fit .scroll {
  flex: none;
  min-height: auto;
  overflow: visible;
}

.pane + .pane {
  border-top: 1px solid var(--line);
}

.col--source {
  gap: 0;
  padding: 0;
  background: var(--panel);
}

.col--source__stacks {
  display: grid;
  grid-template-rows: 1fr 1fr 1fr;
  flex: 1 1 auto;
  min-height: 0;
}

.col--source__stacks > .pane {
  min-height: 0;
  overflow: hidden;
}

.col--source .pane {
  background: transparent;
  border: 0;
}

.col--source__stacks > .pane + .pane,
.col--source__stacks + .pane--diary {
  border-top: 1px solid var(--line);
}

.pane--diary {
  flex: 0 0 auto;
  min-height: auto;
}

.pane--diary .scroll {
  flex: none;
  max-height: 132px;
}

.pane__empty {
  margin: 0;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 16px;
}

.pane--agent .pane__empty {
  border: 0;
  padding: var(--task-row-pad-y) var(--task-row-pad-x);
  background: none;
  border-radius: 0;
}

.spacer { flex: 1; }

.bar-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bar-nav__pipe {
  color: var(--muted);
  font-weight: 400;
  user-select: none;
}

.bar-link {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.bar-link:hover {
  color: var(--fg);
}

.bar-link--action {
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.bar-link.is-on,
.bar-link[aria-current='page'] {
  color: var(--fg);
}

.bar-link--admin,
.bar-link--admin:hover,
.bar-link--admin:focus-visible,
.bar-link--admin.is-on,
.bar-link--admin[aria-current='page'] {
  color: var(--danger);
}

.icon-btn {
  width: var(--icon-btn-size);
  height: var(--icon-btn-size);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  line-height: 0;
  text-indent: 0;
  letter-spacing: 0;
}

.icon-btn:hover,
.icon-btn.is-on,
.icon-btn[aria-pressed='true'] {
  background: color-mix(in srgb, var(--fg) 8%, transparent);
}

.icon-btn svg {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn.is-ok svg { stroke: var(--good); }

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 8px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
}

.text-btn:hover,
.text-btn:focus-visible {
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  color: var(--fg);
}

.text-btn[data-inbox-delete],
.text-btn--danger {
  color: var(--danger);
}

.text-btn[data-inbox-delete]:hover,
.text-btn[data-inbox-delete]:focus-visible,
.text-btn--danger:hover,
.text-btn--danger:focus-visible {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
}

.text-btn svg {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-tip] { position: relative; }

.chat-fab[data-tip] {
  position: fixed;
}

[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + var(--tip-gap));
  right: 0;
  z-index: var(--tip-z);
  box-sizing: border-box;
  width: max-content;
  min-width: var(--tip-min);
  max-width: var(--tip-max);
  height: auto;
  margin: 0;
  padding: var(--tip-pad-y) var(--tip-pad-x);
  border: 0;
  border-radius: 6px;
  background: var(--fg);
  color: var(--bg);
  font-size: var(--tip-font);
  font-weight: 500;
  letter-spacing: 0;
  line-height: var(--tip-lead);
  text-transform: none;
  white-space: normal;
  pointer-events: none;
}

/* Sit the tip above so overflow ancestors and table cells do not clip it. */
[data-tip-pos="top"]:hover::after,
[data-tip-pos="top"]:focus-visible::after,
.compose-form__actions [data-tip]:hover::after,
.compose-form__actions [data-tip]:focus-visible::after,
.compose-cols [data-tip]:hover::after,
.compose-cols [data-tip]:focus-visible::after,
.compose-chat__in [data-tip]:hover::after,
.compose-chat__in [data-tip]:focus-visible::after,
.chat-fab[data-tip]:hover::after,
.chat-fab[data-tip]:focus-visible::after,
.global-chat [data-tip]:hover::after,
.global-chat [data-tip]:focus-visible::after,
.cols td [data-tip]:hover::after,
.cols td [data-tip]:focus-visible::after {
  top: auto;
  bottom: calc(100% + var(--tip-gap));
}

.board {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}

.board--home {
  grid-template-columns: var(--rail) var(--rail) minmax(0, 1fr);
}

.board--page {
  grid-template-columns: var(--rail) minmax(0, 1fr);
}

.board--prompt {
  grid-template-columns: var(--rail) var(--rail) minmax(16rem, var(--prompt-vars)) minmax(0, 1fr);
}

.board--tasks-collapsed {
  grid-template-columns: 44px minmax(0, 1fr);
}

.board--home.board--tasks-collapsed {
  grid-template-columns: 44px var(--rail) minmax(0, 1fr);
}

.board--prompt.board--tasks-collapsed {
  grid-template-columns: 44px var(--rail) minmax(16rem, var(--prompt-vars)) minmax(0, 1fr);
}

[data-toggle-task-sidebar] svg {
  transform: rotate(180deg);
}

.board--tasks-collapsed [data-toggle-task-sidebar] svg {
  transform: none;
}

.board--tasks-collapsed .col--source__stacks {
  display: block;
  flex: 0 0 auto;
}

.board--tasks-collapsed .col--source__stacks > .pane:first-child .col__head {
  justify-content: center;
  padding-right: 5px;
  padding-left: 5px;
}

.board--tasks-collapsed .col--source__stacks > .pane:first-child .col__head > .icon-btn[data-toggle-task-sidebar] {
  margin-left: 0;
}

.board--tasks-collapsed [data-toggle-task-sidebar]:hover::after,
.board--tasks-collapsed [data-toggle-task-sidebar]:focus-visible::after {
  top: 50%;
  right: auto;
  bottom: auto;
  left: calc(100% + var(--tip-gap));
  transform: translateY(-50%);
}

.task-sidebar-summary {
  display: none;
}

.board--tasks-collapsed .col--source__stacks > .pane:first-child {
  position: relative;
  overflow: visible;
}

.board--tasks-collapsed .task-sidebar-summary {
  display: flex;
  position: absolute;
  z-index: 1;
  top: 2px;
  left: calc(50% - 3px);
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0;
  pointer-events: none;
}

.task-sidebar-summary__count {
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bg);
  border-radius: 50%;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}

.task-sidebar-summary__count.is-queued {
  background: color-mix(in srgb, var(--task-row-status-waiting) 20%, transparent);
  color: var(--task-row-status-waiting);
}

.task-sidebar-summary__count.is-working {
  background: color-mix(in srgb, var(--task-row-status-active) 20%, transparent);
  color: var(--task-row-status-active);
}

.board--tasks-collapsed .col--source__stacks > .pane:not(:first-child),
.board--tasks-collapsed .col--source__stacks > .pane:first-child .scroll,
.board--tasks-collapsed .col--source > .pane--diary,
.board--tasks-collapsed .col--source__stacks > .pane:first-child .col__head > :not([data-toggle-task-sidebar]) {
  display: none;
}

.col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}

.col:last-child { border-right: 0; }

.col__head,
.block__head {
  display: flex;
  align-items: center;
  gap: var(--gap);
  height: var(--col-head);
  min-height: var(--col-head);
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
}

.col__head-icons {
  display: inline-flex;
  align-items: center;
  gap: var(--page-head-icon-gap);
}

.col__head .icon-btn,
.block__head .icon-btn {
  width: var(--icon-btn-size);
  height: var(--icon-btn-size);
}

.col__head > .icon-btn + .icon-btn,
.block__head > .icon-btn + .icon-btn {
  margin-left: calc(var(--gap) * -1);
}

.col__head .text-btn,
.block__head .text-btn {
  height: var(--enter-btn-size);
}

.col__head h2,
.block__head h2 {
  margin: 0;
  font-size: var(--title);
  letter-spacing: -0.02em;
  font-weight: 650;
}

.col__head .muted,
.meta,
.note {
  color: var(--muted);
}

.inbox-edit-hint {
  margin: 0;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.col .write-error {
  margin: 0;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
}

.scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

.scroll--table,
.scroll--list {
  padding: 0;
}

.pane--agent .scroll--list {
  display: flex;
  flex-direction: column;
  gap: var(--task-row-gap);
  padding: 0;
}

.block {
  border-top: 1px solid var(--line);
}

.block .scroll { flex: none; max-height: 132px; }

.mission {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  padding: 4px 8px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-size: 0.75rem;
  line-height: 16px;
}

.mission--task {
  grid-template-columns: var(--task-row-dot) minmax(0, 1fr) auto auto;
  column-gap: var(--task-row-dot-gap);
  width: 100%;
  margin: 0;
  padding: var(--task-row-pad-y) var(--task-row-pad-x);
  border: 0;
  border-bottom: var(--task-row-rule);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.75rem;
  line-height: 16px;
  cursor: pointer;
}

.mission-task-row {
  position: relative;
}

.mission-task-row > .icon-btn[data-delete-agent-task] {
  position: absolute;
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  background: transparent;
}

.mission-task-row:hover > .icon-btn[data-delete-agent-task],
.mission-task-row:focus-within > .icon-btn[data-delete-agent-task] {
  opacity: 0.5;
  pointer-events: auto;
}

.mission-task-row:hover .mission__status,
.mission-task-row:focus-within .mission__status {
  visibility: hidden;
}

.mission-task-row > .icon-btn[data-delete-agent-task]:hover,
.mission-task-row > .icon-btn[data-delete-agent-task]:focus-visible {
  background: transparent;
  color: var(--danger);
  opacity: 1;
}

.mission__dot {
  width: var(--task-row-dot);
  height: var(--task-row-dot);
  align-self: center;
  border-radius: 50%;
  background: var(--task-row-dot-idle);
}

.mission__dot[data-status='waiting'] {
  background: var(--task-row-dot-waiting);
}

.mission__dot[data-status='active'] {
  background: var(--task-row-dot-active);
}

.mission__dot[data-status='done'] {
  background: var(--task-row-dot-done);
}

.mission__posted {
  font-variant-numeric: tabular-nums;
}

.mission__status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--task-row-status-idle);
}

.mission__status[data-status='waiting'] {
  color: var(--task-row-status-waiting);
}

.mission__status[data-status='active'] {
  color: var(--task-row-status-active);
}

.mission__status[data-status='done'] {
  color: var(--task-row-status-done);
}

.mission__spinner {
  width: 1ch;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

.mission__spinner::before {
  content: '⠋';
  animation: mission-braille-spin 800ms step-end infinite;
}

@keyframes mission-braille-spin {
  0% { content: '⠋'; }
  10% { content: '⠙'; }
  20% { content: '⠹'; }
  30% { content: '⠸'; }
  40% { content: '⠼'; }
  50% { content: '⠴'; }
  60% { content: '⠦'; }
  70% { content: '⠧'; }
  80% { content: '⠇'; }
  90%, 100% { content: '⠏'; }
}

@media (prefers-reduced-motion: reduce) {
  .mission__spinner::before {
    content: '⠿';
    animation: none;
  }
}

.mission--inbox {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 4px 0 0;
}

.mission__pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 4px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.75rem;
  line-height: 16px;
  text-align: left;
  cursor: pointer;
}

.mission--source .mission__pick {
  grid-template-columns: var(--task-row-dot) minmax(0, 1fr) auto;
  column-gap: var(--task-row-dot-gap);
}

.source-status-dot {
  width: var(--task-row-dot);
  height: var(--task-row-dot);
  border-radius: 50%;
  background: var(--good);
}

.source-status-dot[data-status='inactive'] {
  background: var(--conf-medium);
}

.mission--inbox .icon-btn,
.icon-btn[data-enter-source] {
  align-self: center;
  flex: none;
  width: var(--icon-btn-size);
  height: var(--icon-btn-size);
  padding: var(--enter-btn-pad);
}

.task-spawner-row {
  position: relative;
}

.task-spawner-row > .icon-btn[data-delete-task-type] {
  position: absolute;
  top: calc(50% + 0.5px);
  right: 3px;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  background: transparent;
}

.task-spawner-row:hover > .icon-btn[data-delete-task-type],
.task-spawner-row:focus-within > .icon-btn[data-delete-task-type] {
  opacity: 0.5;
  pointer-events: auto;
}

.task-spawner-row:hover .mission__pick > span,
.task-spawner-row:focus-within .mission__pick > span {
  visibility: hidden;
}

.task-spawner-row > .icon-btn[data-delete-task-type]:hover,
.task-spawner-row > .icon-btn[data-delete-task-type]:focus-visible {
  background: transparent;
  color: var(--danger);
  opacity: 1;
}

.mission:hover {
  background: color-mix(in srgb, var(--fg) 5%, transparent);
}

.mission.is-on {
  background: color-mix(in srgb, var(--bronze) 14%, transparent);
  box-shadow: inset 2px 0 0 var(--bronze);
}

.mission.is-picked {
  background: color-mix(in srgb, var(--bronze) 22%, transparent);
  box-shadow: inset 2px 0 0 var(--bronze);
}

.mission.is-on.is-picked {
  background: color-mix(in srgb, var(--bronze) 28%, transparent);
  box-shadow: inset 2px 0 0 var(--bronze);
}

.mission--task:hover,
.mission--task:focus-visible {
  background: var(--field-focus-fill);
}

.mission--task.is-on {
  background: transparent;
  box-shadow: inset 2px 0 0 var(--bronze);
}

.mission--task.is-on:hover,
.mission--task.is-on:focus-visible {
  background: var(--field-focus-fill);
}

.mission--task.is-on strong {
  font-weight: 700;
}

.mission.is-child {
  padding-left: 18px;
}

.mission strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.mission span {
  color: var(--muted);
  font-size: 0.6875rem;
  white-space: nowrap;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
}

.compose {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--line);
}

.area,
.field {
  width: 100%;
  border: none;
  border-radius: var(--radius);
  background: var(--panel);
  padding: var(--field-pad-y) var(--field-pad-x);
}

.field {
  height: var(--field-height);
  min-height: var(--field-height);
  max-height: var(--field-height);
  line-height: var(--field-line);
}

.area {
  height: auto;
  min-height: 72px;
  max-height: none;
  line-height: var(--lead);
  resize: vertical;
}

.row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.row .field { flex: 1; }

select.field {
  appearance: none;
  padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.log {
  margin: 0;
  padding: 0;
  list-style: none;
}

.log li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px;
  padding: 5px 0;
  border-bottom: var(--task-row-rule);
}

.log time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.thumbs {
  display: flex;
  gap: 6px;
}

.photo {
  width: 56px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: color-mix(in srgb, var(--fg) 70%, transparent);
  font-size: 0.625rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: default;
  pointer-events: none;
}

.photo--cell {
  width: 36px;
  height: 24px;
  display: inline-grid;
  vertical-align: middle;
}

.cols .is-desc {
  max-width: 200px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cols .is-image {
  white-space: nowrap;
}

.pre {
  margin: 8px 0 0;
  padding: 8px;
  overflow: auto;
  max-height: 160px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--fg) 4%, var(--panel));
  font-size: 0.6875rem;
  line-height: 16px;
  white-space: pre-wrap;
}

.scroll--prompt {
  position: relative;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.col--main {
  position: relative;
}

.board--prompt .col--main .col__head {
  padding-left: 0;
}

.prompt-view {
  display: flex;
  align-self: stretch;
  flex-shrink: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.prompt-view__btn {
  display: flex;
  flex: 0 0 var(--prompt-tab-width);
  align-items: center;
  justify-content: center;
  width: var(--prompt-tab-width);
  height: var(--prompt-tab-height);
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1;
}

.prompt-view__btn:hover {
  color: var(--fg);
}

.prompt-view__btn.is-on {
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 8%, transparent);
}

.scroll--prompt[hidden],
.scroll--prompt-article[hidden] {
  display: none;
}

.col--prompt-vars[hidden] {
  display: none;
}

.scroll--prompt-article {
  flex: 1;
  width: 100%;
  max-width: none;
  min-height: 0;
  padding: var(--prompt-article-pad-top) var(--prompt-article-pad-x) var(--prompt-article-pad-bottom);
}

.prompt-editor,
#home-prompt,
#home-prompt-llms {
  flex: 1;
  width: 100%;
  min-height: 0;
}

#home-prompt.ace_editor,
#home-prompt-llms.ace_editor {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: var(--prompt-body);
  line-height: 1.5;
  background-color: var(--panel);
  color: var(--fg);
}

#home-prompt .ace_gutter,
#home-prompt .ace_scroller,
#home-prompt-llms .ace_gutter,
#home-prompt-llms .ace_scroller {
  background-color: var(--panel);
}

#home-prompt .ace_gutter,
#home-prompt-llms .ace_gutter {
  color: var(--muted);
}

#home-prompt.ace_focus,
#home-prompt-llms.ace_focus {
  outline: none;
}

#home-prompt .ace_paren {
  color: color-mix(in srgb, var(--bronze) 72%, var(--muted));
}

#home-prompt .ace_keyword {
  color: #7a5bb5;
}

#home-prompt .ace_variable {
  color: var(--bronze);
}

html[data-theme='dark'] #home-prompt .ace_keyword {
  color: #b294bb;
}

.scroll--prompt-vars {
  padding: 0;
}

.prompt-vars {
  margin: 0;
}

.prompt-vars__row {
  display: grid;
  grid-template-columns: minmax(8rem, 12.5rem) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 4px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
  line-height: 16px;
}

.prompt-vars__row dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 650;
}

.prompt-vars__row dt code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: inherit;
  letter-spacing: 0.02em;
}

.prompt-vars__row dd {
  margin: 0;
  word-break: break-word;
}

.prompt-vars__head {
  margin: 0;
  padding: 8px 10px 4px;
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prompt-vars__toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  box-sizing: border-box;
  min-height: 28px;
  margin: 0;
  padding: 6px 10px 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 16px;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.prompt-vars__toggle:hover {
  background: color-mix(in srgb, var(--fg) 5%, transparent);
  color: var(--fg);
}

.prompt-vars__chevron {
  display: block;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s ease;
  transform-origin: center;
  transform-box: fill-box;
}

.prompt-vars__toggle[aria-expanded='true'] .prompt-vars__chevron {
  transform: rotate(90deg);
}

.prompt-vars__source {
  border-top: 1px solid var(--line);
}

.prompt-vars__source-body[hidden] {
  display: none;
}

.prompt-vars__columns {
  margin: 0;
}

.prompt-vars__task {
  margin: 0 0 0 8px;
  border-left: 1px solid var(--line);
}

.prompt-article {
  width: 100%;
  max-width: none;
  margin: 0;
  color: var(--fg);
  font-size: var(--prompt-body);
  line-height: 1.55;
}

.prompt-article h1 {
  margin: 0 0 14px;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.prompt-article h2 {
  margin: 28px 0 10px;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.prompt-article h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 650;
}

.prompt-article h4 {
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prompt-article p {
  margin: 0 0 12px;
}

.prompt-article ol,
.prompt-article ul {
  margin: 0 0 16px;
  padding-left: 1.25rem;
}

.prompt-article li {
  margin: 0 0 10px;
}

.prompt-article li p {
  margin: 0 0 6px;
}

.prompt-article__source {
  margin: 0 0 20px;
  padding: 0 0 4px;
}

.prompt-article__dl {
  margin: 0 0 8px;
}

.prompt-article__row {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 10px;
  padding: 3px 0;
}

.prompt-article__row dt {
  margin: 0;
  color: var(--muted);
}

.prompt-article__row dd {
  margin: 0;
}

.prompt-article__note {
  color: var(--muted);
  font-size: 0.8125rem;
}

.prompt-article__note p {
  margin: 0 0 6px;
}

.home-agent {
  padding-bottom: 24px;
}

.home-agent__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.desk-code {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin: 0;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background: color-mix(in srgb, var(--fg) 6%, var(--panel));
  color: var(--fg);
}

.desk-code,
.desk-code *,
.desk-code *::before,
.desk-code *::after {
  border-radius: 0;
}

.api-mcp .desk-code {
  margin: 0 0 4px;
}

.desk-code__pre {
  margin: 0;
  padding: 10px 12px;
  overflow: auto;
  max-height: none;
  border: none;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.6875rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-all;
}

.desk-code > .icon-btn {
  width: var(--icon-btn-size);
  height: var(--icon-btn-size);
  margin: 0 4px;
  border-radius: 0;
}

.desk-code__pre.ace_editor {
  width: 100%;
  min-height: 24px;
  padding: 0;
  overflow: hidden;
  background: transparent;
  white-space: normal;
  word-break: normal;
}

.desk-code__pre .ace_gutter,
.desk-code__pre .ace_scroller {
  background-color: transparent;
}

.desk-code__pre .ace_cursor {
  opacity: 0;
}

.desk-code__pre.ace_focus {
  outline: none;
}

.empty {
  padding: 12px;
  color: var(--muted);
}

.scroll--meta {
  padding: 0;
}

/** Selected Source workspace. */
.source-detail-columns {
  min-height: 100%;
}

.source-detail-columns__main {
  min-width: 0;
}

.source-detail-columns__main .compose-form {
  max-width: none;
}

.source-compose-columns__artifact .source-prompt-toolbar,
.task-config-columns__artifact .source-prompt-toolbar {
  width: calc(100% + 28px);
  margin: -14px -14px 0;
}

.source-meta {
  margin: 0;
  display: grid;
  grid-template-columns: var(--source-meta-label) minmax(0, 1fr);
}

.source-meta__row {
  display: grid;
  grid-template-columns: var(--source-meta-label) minmax(0, 1fr);
  grid-column: 1 / -1;
  gap: 12px;
  align-items: baseline;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

@supports (grid-template-columns: subgrid) {
  .source-meta__row {
    grid-template-columns: subgrid;
  }
}

.source-meta__row dt {
  margin: 0;
  min-width: 0;
  justify-self: start;
  text-align: left;
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.source-meta__row dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}

.source-meta__block h3 {
  margin: 16px 0 0;
  padding: 8px 12px 0;
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.source-meta__brief {
  margin: 0;
  padding: 8px 12px 16px;
  white-space: pre-wrap;
}

.source-schema {
  list-style: none;
  margin: 0;
  padding: 0 0 16px;
}

.source-schema li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
  line-height: 16px;
}

.api-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  font-size: 0.75rem;
  line-height: 16px;
}

.api-table th,
.api-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.api-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  overflow: visible;
  background: color-mix(in srgb, var(--fg) 6%, var(--panel));
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}

.api-table thead th:is(:hover, :focus-visible) {
  z-index: 6;
}

.api-table tbody tr:not(.detail) > td {
  height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  vertical-align: middle;
}

table thead th.is-sort {
  cursor: pointer;
  user-select: none;
}

table thead th.is-sort:hover {
  color: var(--fg);
}

table thead th.is-sort--asc::before,
table thead th.is-sort--desc::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.4em;
  vertical-align: 0.12em;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
}

table thead th.is-sort--asc::before {
  border-bottom: 4px solid color-mix(in srgb, var(--fg) 55%, transparent);
}

table thead th.is-sort--desc::before {
  border-top: 4px solid color-mix(in srgb, var(--fg) 55%, transparent);
}

.api-table tbody tr:last-child td {
  border-bottom: 0;
}

.api-table code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.6875rem;
}

.api-method {
  display: inline-block;
  min-width: 3.2rem;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.6875rem;
  font-weight: 650;
}

.api-method--get { color: var(--conf-high); }
.api-method--post { color: var(--conf-medium); }
.api-method--put,
.api-method--patch,
.api-method--delete { color: var(--muted); }

.api-table .is-toggle {
  width: 28px;
  padding-left: 4px;
  padding-right: 2px;
}

.api-table .is-toggle .icon-btn {
  width: var(--icon-btn-size);
  height: var(--icon-btn-size);
  padding: 3px;
}

.api-table .is-toggle .icon-btn svg {
  transition: transform 0.15s ease;
  transform-origin: center;
  transform-box: fill-box;
}

.api-table tr.is-on .is-toggle .icon-btn svg {
  transform: rotate(90deg);
}

.api-table tbody tr[data-open-op] {
  cursor: pointer;
}

.api-table tbody tr[data-open-op]:hover {
  background: color-mix(in srgb, var(--fg) 5%, transparent);
}

.api-table tbody tr.is-on {
  background: color-mix(in srgb, var(--bronze) 14%, transparent);
}

.api-table tbody tr.is-on td:first-child {
  box-shadow: inset 2px 0 0 var(--bronze);
}

.api-table tr.detail,
.api-table tr.detail:hover {
  cursor: default;
  background: color-mix(in srgb, var(--fg) 3%, var(--panel));
}

.api-table tr.detail td {
  padding: 10px 12px 14px;
  box-shadow: none;
}

.api-play {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(20rem, 1.25fr);
  gap: 16px;
  align-items: start;
}

.api-play h3 {
  margin: 0 0 8px;
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.api-play__field {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}

.api-play__field label {
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 16px;
}

.api-play__type,
.api-play__opt {
  margin-left: 6px;
  font-size: 0.625rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}

.api-play__field .note {
  margin: 0;
  font-size: 0.6875rem;
  line-height: 1.35;
}

.api-play__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.api-play__head h3 {
  margin: 0;
  flex: 1;
}

.api-play__send {
  height: var(--field-height);
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: color-mix(in srgb, var(--fg) 8%, var(--panel));
  color: inherit;
  font-size: 0.6875rem;
  font-weight: 650;
  cursor: pointer;
}

.api-play__send:hover,
.api-play__send:focus-visible {
  background: color-mix(in srgb, var(--fg) 14%, var(--panel));
}

.api-play__send:disabled {
  opacity: 0.55;
  cursor: default;
}

.api-play .desk-code {
  margin: 0;
}

.api-play__status {
  margin: 10px 0 4px;
  font-size: 0.6875rem;
  font-weight: 650;
  color: var(--muted);
}

.api-play__result[hidden] {
  display: none;
}

.scroll--api {
  padding: 0;
}

.api-mcp {
  margin: 0;
  padding: 12px 14px 18px;
  background: var(--panel);
}

.api-mcp h2 {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.api-mcp h3 {
  margin: 12px 0 6px;
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.api-mcp__lede {
  margin: 0 0 10px;
  max-width: 42rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.api-mcp__install {
  margin: 0 0 4px;
}

.api-mcp__steps {
  margin: 0 0 10px;
  padding: 0 0 0 1.15rem;
  max-width: 42rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.api-mcp__steps li {
  margin: 0 0 6px;
}

.api-mcp__steps li:last-child {
  margin-bottom: 0;
}

.api-mcp__steps code {
  color: var(--fg);
}

.api-mcp__snippet-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 6px;
}

.api-mcp__snippet-head h3 {
  margin: 0;
  flex: 1;
}

.api-mcp__connect {
  margin: 0;
}

.api-mcp__connect > div {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 3px 0;
}

.api-mcp__connect dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.6875rem;
}

.api-mcp__connect dd {
  margin: 0;
}

.api-mcp__tool {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr);
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
  line-height: 16px;
}

.api-mcp__tool:last-child {
  border-bottom: 0;
}

.api-mcp__tool span {
  color: var(--muted);
}

@media (max-width: 860px) {
  .api-play {
    grid-template-columns: minmax(0, 1fr);
  }

  .api-mcp__tool {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

.context-line { margin: 0 0 8px; padding: 0; border: 0; color: var(--fg); }

.cols {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: visible;
  background: var(--panel);
  font-size: 0.75rem;
  line-height: 16px;
}

.cols th,
.cols td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.cols .is-toggle {
  width: 28px;
  padding-left: 3px;
  padding-right: 3px;
}

.cols .is-star,
.cols .is-lock {
  width: 28px;
  padding-right: 2px;
  padding-left: 2px;
}

.cols .is-star .icon-btn,
.cols .is-lock .icon-btn {
  width: var(--icon-btn-size);
  height: var(--icon-btn-size);
  padding: 3px;
}

.cols .is-star .icon-btn[aria-pressed='true'] {
  background: transparent;
  color: var(--bronze);
}

.cols .is-star .icon-btn[aria-pressed='true'] svg {
  fill: currentColor;
}

.cols .is-lock .icon-btn[aria-pressed='true'] {
  background: transparent;
  color: var(--conf-medium);
}

.cols .is-toggle .icon-btn {
  width: var(--icon-btn-size);
  height: var(--icon-btn-size);
  padding: 3px;
}

.cols .is-toggle .icon-btn svg {
  transition: transform 0.15s ease;
  transform-origin: center;
  transform-box: fill-box;
}

.cols tr.is-on .is-toggle .icon-btn svg {
  transform: rotate(90deg);
}

.cols .is-toggle [data-tip]:hover::after,
.cols .is-toggle [data-tip]:focus-visible::after {
  right: auto;
  left: 0;
}

.cols thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  overflow: visible;
  background: color-mix(in srgb, var(--fg) 6%, var(--panel));
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cols thead th:is(:hover, :focus-visible) {
  z-index: 6;
}

.cols tbody tr {
  cursor: pointer;
}

.cols tbody tr:hover {
  background: color-mix(in srgb, var(--fg) 5%, transparent);
}

.cols tbody tr.is-on {
  background: color-mix(in srgb, var(--bronze) 14%, transparent);
}

.cols tbody tr.is-on td:first-child {
  box-shadow: inset 2px 0 0 var(--bronze);
}

.cols tbody tr.is-locked {
  background: var(--listing-lock-fill);
}

.cols tbody tr.is-locked:hover {
  background: var(--listing-lock-hover-fill);
}

.cols .is-source,
.cols .is-checked {
  color: var(--muted);
  white-space: nowrap;
}

.cols .is-checked {
  font-variant-numeric: tabular-nums;
}

.cols .is-price {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}

.cols .is-price.is-unverified {
  color: var(--muted);
  font-weight: 500;
}

.cols .is-percentage-off {
  color: var(--muted);
}

.cols .is-percentage-off.is-discount {
  color: var(--conf-high);
}

.cols tr.detail,
.cols tr.detail:hover {
  cursor: default;
  background: color-mix(in srgb, var(--fg) 3%, var(--panel));
}

.cols tr.detail td {
  padding: 18px 12px 12px;
  box-shadow: none;
}

.listing-detail {
  display: grid;
  grid-template-columns: var(--detail-thumb) minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 18px;
  align-items: start;
}

.listing-detail__thumb {
  width: var(--detail-thumb);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
  background: color-mix(in srgb, var(--fg) 8%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 10%, transparent);
}

.listing-detail__thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-carousel {
  position: relative;
}

.listing-carousel__stage {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.listing-carousel__stage:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: -2px;
}

.listing-carousel__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 3px;
  transform: translateY(-50%);
  border: 1px solid color-mix(in srgb, var(--fg) 24%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, #000 68%, transparent);
  color: #fff;
  opacity: 0.22;
  transition: opacity 0.15s ease;
}

.listing-carousel__nav svg,
.listing-gallery__nav svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.listing-carousel__nav--prev {
  left: 5px;
}

.listing-carousel__nav--prev svg,
.listing-gallery__nav--prev svg {
  transform: rotate(180deg);
}

.listing-carousel__nav--next {
  right: 5px;
}

.listing-carousel__thumbs {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 3px;
  padding: 3px;
  overflow-x: auto;
  border-radius: 3px;
  background: color-mix(in srgb, #000 62%, transparent);
  opacity: 0.22;
  transition: opacity 0.15s ease;
}

.listing-carousel:hover .listing-carousel__nav,
.listing-carousel:hover .listing-carousel__thumbs,
.listing-carousel:focus-within .listing-carousel__nav,
.listing-carousel:focus-within .listing-carousel__thumbs {
  opacity: 1;
}

.listing-carousel__thumb {
  flex: 0 0 auto;
  width: 30px;
  height: 22px;
  padding: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  opacity: 0.68;
}

.listing-carousel__thumb.is-on {
  border-color: #fff;
  opacity: 1;
}

.listing-carousel__thumb img,
.listing-gallery__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-detail__body {
  min-width: 0;
}

.detail p,
.listing-detail p {
  margin: 0 0 6px;
}

.listing-detail__body > :last-child {
  margin-bottom: 0;
}

.listing-detail__evidence {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--fg) 10%, transparent);
}

.listing-detail__evidence-item + .listing-detail__evidence-item {
  margin-top: 8px;
}

.detail .thumbs .photo,
.listing-detail .thumbs .photo {
  width: 72px;
  height: 52px;
}

.cols .listing-column-evidence {
  margin-left: 3px;
  color: var(--conf-high);
  font-weight: 700;
  text-decoration: none;
  text-transform: none;
}

.cols thead th[data-tip]:hover::after,
.cols thead th[data-tip]:focus-visible::after,
.api-table thead th[data-tip]:hover::after,
.api-table thead th[data-tip]:focus-visible::after {
  right: auto;
  left: 0;
  z-index: var(--tip-z);
}

.cols thead th[data-tip]:hover::after,
.cols thead th[data-tip]:focus-visible::after,
.api-table thead th[data-tip]:hover::after,
.api-table thead th[data-tip]:focus-visible::after {
  white-space: nowrap;
}

.modal[hidden] { display: none; }

.modal {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
}

.modal--confirm {
  position: fixed;
  z-index: 40;
}

.modal__scrim {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #000 52%, transparent);
}

.modal__box {
  position: relative;
  width: min(520px, calc(100% - 32px));
  max-height: min(80vh, 640px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.modal__box--confirm {
  width: min(420px, calc(100% - 32px));
}

.modal__box--task-create {
  padding: 0;
  overflow: hidden;
}

.task-create-form .write-error {
  margin-bottom: var(--section-head-gap);
}

.task-create-form .area {
  min-height: 112px;
  resize: vertical;
}

.modal__box--gallery {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  width: min(920px, calc(100% - 32px));
  height: min(84vh, 720px);
  max-height: none;
  overflow: hidden;
  padding: 12px;
}

.listing-gallery__head {
  min-height: 22px;
}

.listing-gallery__head h2 {
  margin: 0;
}

.listing-gallery__count {
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.listing-gallery__stage {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  border-radius: 5px;
  background: color-mix(in srgb, #000 78%, var(--panel));
}

.listing-gallery__image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.listing-gallery__nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 7px;
  transform: translateY(-50%);
  border: 1px solid color-mix(in srgb, #fff 28%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, #000 64%, transparent);
  color: #fff;
}

.listing-gallery__nav--prev {
  left: 10px;
}

.listing-gallery__nav--next {
  right: 10px;
}

.listing-gallery__thumbs {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
}

.listing-gallery__thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 46px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  opacity: 0.62;
}

.listing-gallery__thumb.is-on {
  border-color: var(--bronze);
  opacity: 1;
}

.confirm__actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.confirm__btn {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--fg) 6%, var(--panel));
  color: var(--fg);
  font-size: 0.75rem;
}

.confirm__btn--danger {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
  color: var(--danger);
}

.confirm__btn:hover,
.confirm__btn:focus-visible {
  background: color-mix(in srgb, var(--fg) 12%, var(--panel));
}

.modal__box--form {
  width: min(800px, calc(100% - 32px));
  height: min(80vh, 700px);
  max-height: min(88vh, 780px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal__box--source {
  width: min(1200px, calc(100% - 32px));
}

/* New Source metadata stays visibly editable when its fields are not focused. */
.modal__box--source:not(.modal__box--task-create)
  .source-compose-columns__config
  .compose-meta
  :is(.field, .area) {
  background-color: var(--field-focus-fill);
}

.modal__head {
  flex-shrink: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  gap: 8px;
}

.modal__form {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.modal__form--source {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/** Split configuration and generated artefact layout for compose dialogs. */
.source-compose-columns {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(22rem, 2fr);
  flex: 1;
  min-height: 0;
}

.source-compose-columns--config-only {
  grid-template-columns: minmax(0, 1fr);
}

.source-compose-columns__config,
.source-compose-columns__artifact {
  min-width: 0;
  min-height: 0;
}

.source-compose-columns__config {
  overflow: auto;
}

.source-compose-columns__artifact {
  display: flex;
  flex-direction: column;
  padding: 14px;
  overflow: hidden;
  border-left: 1px solid var(--line);
}

.source-compose-columns__artifact .source-merged-prompt__head {
  margin-top: 0;
}

.source-compose-columns__artifact .source-merged-prompt {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.source-compose-columns__artifact .source-merged-prompt__body {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.modal__box--add-listing .field,
.modal__box--add-listing .area {
  background-color: #202126;
}

.modal__box--add-listing .compose-meta {
  row-gap: 4px;
}

.modal__box--add-listing .compose-meta__row {
  grid-template-columns: 7rem minmax(0, 1fr);
}

.modal__box--add-listing .compose-meta__row > label {
  white-space: nowrap;
}

.listing-image-input {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.listing-image-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 4px;
  min-width: 0;
}

.listing-image-previews:empty {
  display: none;
}

.listing-image-preview {
  min-width: 0;
  margin: 0;
}

.listing-image-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  background: color-mix(in srgb, var(--fg) 8%, var(--panel));
  object-fit: cover;
}

.listing-image-preview figcaption {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.625rem;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-image-preview.is-failed figcaption {
  color: var(--danger);
}

.listing-image-owned-urls {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.listing-image-owned-urls:empty {
  display: none;
}

.listing-image-owned-urls a {
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.6875rem;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compose-chat {
  display: flex;
  flex-direction: row;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
}

.compose-chat__main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.thread {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.bubble {
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 8px;
  white-space: pre-wrap;
}

.bubble--note {
  align-self: flex-start;
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  color: var(--muted);
}

.bubble--user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--bronze) 18%, transparent);
}

.compose-chat__in {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 8px;
  overflow: visible;
}

.compose-bar {
  --compose-bar-height: 43px;
  --compose-bar-max: 832px;
  --compose-bar-btn: var(--icon-btn-size);
  --compose-bar-inset-x: 8px;
  --compose-bar-inset-top: 7px;
  --compose-bar-inset-bottom: 8px;
  --compose-bar-gap: 8px;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--compose-bar-max);
  height: var(--compose-bar-height);
  display: flex;
  align-items: center;
  gap: var(--compose-bar-gap);
  padding: var(--compose-bar-inset-top) var(--compose-bar-inset-x) var(--compose-bar-inset-bottom);
  border: none;
  outline: var(--focus-ring);
  border-radius: 999px;
  background: color-mix(in srgb, var(--fg) 12%, var(--bg));
  box-shadow: none;
}

.compose-bar:focus-within {
  outline: var(--focus-ring);
  box-shadow: none;
  background: color-mix(in srgb, var(--fg) 16%, var(--bg));
}

.compose-bar .icon-btn {
  width: var(--compose-bar-btn);
  height: var(--compose-bar-btn);
  flex-shrink: 0;
  border-radius: 50%;
}

.compose-bar .icon-btn:disabled,
.compose-bar .icon-btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: default;
}

.compose-bar__field {
  flex: 1;
  min-width: 0;
  height: var(--compose-bar-btn);
  margin: 0;
  padding: 0 4px;
  border: none;
  outline: var(--focus-ring);
  box-shadow: none;
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  line-height: var(--compose-bar-btn);
  resize: none;
}

.compose-bar__field::placeholder {
  color: var(--muted);
}

.compose-bar__end {
  display: flex;
  align-items: center;
  gap: var(--compose-bar-gap);
  flex-shrink: 0;
}

.compose-bar__mic {
  display: grid;
  place-items: center;
}

.compose-bar__mic .icon-btn:disabled {
  pointer-events: none;
}

.compose-bar__send .icon-btn {
  background: #fff;
  color: #101117;
}

.compose-bar__send .icon-btn:hover,
.compose-bar__send .icon-btn.is-on {
  background: #fff;
}

.compose-bar__send .icon-btn:disabled,
.compose-bar__send .icon-btn[aria-busy='true'] {
  opacity: 0.55;
  cursor: default;
}

.compose-form {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--lbl-control-gap);
  padding: 14px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.compose-form .lbl:not(:first-child):not(.compose-section__head) {
  margin-top: 6px;
}

.compose-form:has(.compose-section__head) {
  gap: 0;
  padding-top: var(--section-block-gap);
}

.compose-form:has(.source-meta) .compose-cols {
  flex: none;
}

/**
 * Full-width rule under Metadata, Columns, and Status heads.
 * Do not put this on .lbl — Location and other field labels share
 * the form and must stay unruled.
 * padding-bottom + border + margin-bottom = --section-head-gap
 * from the label text to the next sibling.
 */
.compose-section__head {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding-bottom: 6px;
  margin-bottom: calc(var(--section-head-gap) - 6px - 1px);
  border-bottom: 1px solid var(--line);
}

.compose-section__head:not(:first-child) {
  margin-top: var(--section-block-gap);
}

.compose-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compose-meta__row {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.source-merged-prompt {
  min-width: 0;
}

.source-capabilities {
  min-width: 0;
}

.source-capabilities__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  color: var(--muted);
  font-size: 0.75rem;
}

.source-capabilities__summary strong {
  color: var(--fg);
}

.source-capabilities__loading {
  margin: 0;
  padding: 5px 0;
}

.modal__box--capability-picker {
  display: flex;
  flex-direction: column;
  width: min(1100px, calc(100% - 32px));
  height: min(80vh, 720px);
  max-height: min(88vh, 780px);
  padding: 0;
  overflow: hidden;
}

.capability-picker__count {
  color: var(--muted);
  font-size: 0.75rem;
}

.capability-picker__search {
  flex: none;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.capability-picker__search .field {
  width: 100%;
}

.capability-picker__list {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.capability-picker__row {
  display: grid;
  grid-template-columns: auto minmax(11rem, 0.9fr) minmax(15rem, 1fr) minmax(16rem, 1.4fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.capability-picker__row:hover {
  background: color-mix(in srgb, var(--fg) 4%, transparent);
}

.capability-picker__row > input {
  margin: 0;
}

.capability-picker__identity,
.capability-picker__http {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.capability-picker__identity {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.capability-picker__identity code,
.capability-picker__http code {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.6875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capability-picker__http .api-method {
  flex: none;
}

.capability-picker__summary {
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1.35;
}

.source-merged-prompt__head {
  display: flex;
  align-items: center;
}

.source-prompt-toolbar {
  width: 100%;
  padding-left: 0;
}

.source-merged-prompt__task {
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 650;
}

.source-merged-prompt__body {
  max-height: 24rem;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--fg) 3%, var(--panel));
  color: var(--fg);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.compose-meta__row--area {
  align-items: start;
}

.compose-meta__row--area > label {
  padding-top: 6px;
}

.compose-meta__row > label {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: var(--field-line);
}

.compose-meta__control {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.compose-form .field {
  flex: none;
  width: 100%;
  text-align: left;
}

.compose-form .field:disabled {
  opacity: 0.55;
}

.compose-form select.field {
  padding-right: 28px;
}

.compose-form .note {
  margin: 0;
  font-size: 0.6875rem;
  line-height: 1.35;
}

.inference-auth {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.inference-auth__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.inference-auth__state {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: var(--field-line);
  min-width: 0;
}

.inference-auth__btn {
  height: var(--field-height);
  padding: 0 var(--field-pad-x);
  border: 0;
  border-radius: 6px;
  background: color-mix(in srgb, var(--fg) 8%, var(--panel));
  color: inherit;
  font-size: 0.6875rem;
  font-weight: 650;
  cursor: pointer;
}

.inference-auth__btn:hover,
.inference-auth__btn:focus,
.inference-auth__btn:focus-visible {
  outline: none;
  box-shadow: none;
  background: var(--field-focus-fill);
}

/* Dialog and listing-review focus is visible without changing compact sizing. */
.modal__box :is(.icon-btn, .inference-auth__btn):focus-visible,
.modal--confirm .confirm__btn:focus-visible,
.col--main > .col__head .inference-auth__btn:focus-visible {
  box-shadow: inset 0 0 0 1px var(--bronze);
  background: color-mix(in srgb, var(--fg) 18%, var(--panel));
}

.inference-auth__btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.inference-auth__btn--danger {
  color: var(--danger);
}

.inference-auth__pending {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inference-auth__meta {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.inference-auth__meta > span:first-child {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: var(--field-line);
}

.inference-auth__code {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.75rem;
  cursor: pointer;
  text-align: left;
}

.inference-auth__error {
  color: var(--danger);
}

.env-form .lbl {
  margin-top: 10px;
}

.env-form .lbl:first-child {
  margin-top: 0;
}

.env-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.env-row:last-of-type {
  border-bottom: 0;
}

.env-row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.env-row__head code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.env-row__status {
  color: var(--muted);
  font-size: 0.6875rem;
  flex: none;
}

.env-row__label {
  margin: 0;
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1.35;
}

.env-row__value {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.env-row__value .field {
  flex: 1 1 auto;
  min-width: 0;
}

.env-row__value .icon-btn {
  width: var(--icon-btn-size);
  height: var(--icon-btn-size);
  flex: none;
  border-radius: 6px;
}

.compose-form--view .compose-meta__row > span {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: var(--field-line);
}

.compose-form--view .compose-meta__value {
  margin: 0;
  min-width: 0;
  font-size: inherit;
  line-height: var(--field-line);
  word-break: break-word;
}

.compose-form--view .compose-meta__value--area {
  white-space: pre-wrap;
  padding-top: 6px;
}

.compose-form .source-meta__row {
  padding-left: 0;
  padding-right: 0;
}

.compose-form .source-meta__row:first-child {
  padding-top: 0;
}

.compose-form__actions {
  margin-top: auto;
}

.compose-cols {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.compose-cols__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.compose-cols__head,
.compose-cols__row {
  display: grid;
  grid-template-columns: 18px minmax(6.5rem, 0.42fr) 92px 52px 72px minmax(8rem, 1fr) var(--field-height);
  gap: 4px;
  align-items: center;
}

.compose-cols--view .compose-cols__head,
.compose-cols--view .compose-cols__row {
  grid-template-columns: minmax(6.5rem, 0.42fr) 92px 52px 72px minmax(8rem, 1fr);
}

.compose-cols--view .compose-cols__row {
  min-height: var(--field-height);
  padding: 5px 2px;
  font-size: 0.75rem;
  align-items: start;
}

.compose-cols__block {
  display: flex;
  flex-direction: column;
  border-radius: 6px;
}

.compose-cols__block.is-flip {
  transition: transform 180ms ease;
  will-change: transform;
}

.compose-cols__block.is-drag {
  position: relative;
  z-index: 1;
  opacity: 0.5;
  background: color-mix(in srgb, var(--bronze) 14%, transparent);
  box-shadow: inset 2px 0 0 var(--bronze);
}

.compose-cols__row {
  border-radius: 6px;
}

.compose-cols__row.is-flip {
  transition: transform 180ms ease;
  will-change: transform;
}

.compose-cols__row.is-drag {
  position: relative;
  z-index: 1;
  opacity: 0.5;
  background: color-mix(in srgb, var(--bronze) 14%, transparent);
  box-shadow: inset 2px 0 0 var(--bronze);
}

.compose-cols__row.is-drop {
  background: color-mix(in srgb, var(--bronze) 14%, transparent);
  box-shadow: inset 2px 0 0 var(--bronze);
}

.compose-cols__grip {
  display: grid;
  place-items: center;
  width: 18px;
  height: var(--field-height);
  color: color-mix(in srgb, var(--fg) 28%, transparent);
  cursor: grab;
  user-select: none;
  -webkit-user-drag: element;
}

.compose-cols__grip:hover,
.compose-cols__grip:focus-visible {
  color: var(--muted);
}

.compose-cols__grip:active,
.compose-cols__row.is-drag .compose-cols__grip {
  cursor: grabbing;
}

.compose-cols__grip svg {
  display: block;
  width: 10px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}

.compose-cols__row .field,
.compose-cols__row .icon-btn,
.compose-cols__table {
  -webkit-user-drag: none;
}

.compose-cols__table {
  display: grid;
  place-items: center;
}

.compose-cols__table input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--fg);
}

.compose-cols__head {
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0 2px;
}

.compose-form .compose-cols .field {
  padding-left: 8px;
  padding-right: 8px;
}

.compose-form .compose-cols select.field {
  padding-right: 22px;
}

.compose-cols .icon-btn {
  width: var(--icon-btn-size);
  height: var(--icon-btn-size);
  color: var(--danger);
}

.compose-cols .icon-btn:hover,
.compose-cols .icon-btn:focus-visible {
  color: var(--danger);
}

.compose-cols__hint {
  min-width: 0;
  margin: 0;
}

.compose-cols__hint--view {
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: var(--field-line);
  white-space: normal;
  overflow-wrap: break-word;
}

.source-lifecycle {
  min-width: 0;
  overflow-x: auto;
}

.source-lifecycle__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.source-lifecycle__head,
.source-lifecycle__row {
  display: grid;
  grid-template-columns: minmax(7rem, 0.7fr) minmax(6rem, 0.55fr) 7rem 6.5rem minmax(12rem, 1.5fr) var(--field-height);
  gap: 4px;
  align-items: center;
  min-width: 46rem;
}

.source-lifecycle__head {
  padding: 0 2px 4px;
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.source-lifecycle__row--view {
  grid-template-columns: minmax(7rem, 0.7fr) minmax(6rem, 0.55fr) 7rem 6.5rem minmax(12rem, 1.5fr);
  min-height: var(--field-height);
  padding: 5px 2px;
  font-size: 0.75rem;
  align-items: start;
}

.source-lifecycle__row--view code,
.source-lifecycle__key {
  font-family: var(--mono);
}

.source-lifecycle__terminal {
  display: flex;
  gap: 5px;
  align-items: center;
  min-height: var(--field-height);
  font-size: 0.75rem;
}

.source-lifecycle__terminal input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--fg);
}

.source-lifecycle .icon-btn {
  width: var(--icon-btn-size);
  height: var(--icon-btn-size);
  color: var(--danger);
}

.source-lifecycle__foot {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-width: 46rem;
  margin-top: 4px;
}

.source-lifecycle__foot .compose-cols__add {
  width: auto;
  margin: 0;
}

.source-lifecycle__foot label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.75rem;
}

.source-lifecycle > .note {
  margin: 6px 0 0;
}

.listing-history {
  display: flex;
  grid-column: 1 / -1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  margin: 0;
}

.listing-detail .listing-history__head-row,
.listing-detail .listing-history__empty {
  margin: 0 0 4px;
}

.listing-history__head-row {
  position: sticky;
  top: 0;
  z-index: 1;
  align-items: center;
  background: color-mix(in srgb, var(--fg) 3%, var(--panel));
}

.listing-history__head {
  margin: 0;
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.listing-history__empty,
.listing-history__table {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
}

.listing-history__table {
  width: auto;
  border-collapse: collapse;
  align-self: flex-start;
}

.listing-history__table th,
.listing-history__table td {
  padding: 2px 18px 2px 0;
  border: 0;
  background: transparent;
  text-align: left;
  white-space: nowrap;
}

.listing-history__table th {
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.listing-history__table th:last-child,
.listing-history__table td:last-child {
  padding-right: 0;
}

.listing-history__table time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.listing-history__price,
.listing-history__diff {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.listing-history__diff,
.listing-history__status {
  color: var(--muted);
}

.listing-history__status.is-sold {
  color: var(--fg);
  font-weight: 650;
}

.listing-row-status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 16px;
  text-transform: capitalize;
}

.listing-row-status.is-available {
  background: color-mix(in srgb, var(--good) 16%, transparent);
  color: color-mix(in srgb, var(--good) 72%, var(--fg));
}

.listing-row-status.is-sold {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

.cols td.is-duration {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.listing-section--pending,
.listing-section--completed {
  margin-top: var(--section-block-gap);
}

.listing-section__head {
  display: flex;
  align-items: center;
  height: var(--col-head);
  min-height: var(--col-head);
  padding: 0 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.listing-section__head h2 {
  margin: 0;
  font-size: var(--title);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.task-prompt {
  margin: 0;
  padding: 8px 12px 16px;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.4;
}

.task-prompt__url {
  color: #8ecbff;
  text-decoration: none;
}

.task-prompt__url:hover,
.task-prompt__url:focus-visible {
  color: #b8ddff;
}

.modal__box--task {
  width: min(1200px, calc(100% - 32px));
  max-width: none;
}

.modal__form--task {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/** Task modal: task configuration on the left, generated artefact on the right. */
.task-work-columns {
  display: grid;
  grid-template-columns: minmax(18rem, 2fr) minmax(0, 3fr);
  flex: 1;
  min-height: 0;
}

.task-work-columns__config,
.task-work-columns__artifact {
  min-width: 0;
  min-height: 0;
}

.task-work-columns__config {
  padding: 14px;
  overflow: auto;
}

.task-work-columns__artifact {
  display: flex;
  flex-direction: column;
  padding: 14px;
  overflow: hidden;
  border-left: 1px solid var(--line);
}

.task-work-columns__artifact .task-prompt-output {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.task-work-columns__artifact .task-prompt {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.task-work-columns .source-meta__block h3 {
  margin-top: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.task-prompt-inputs {
  min-width: 0;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.task-prompt-inputs__group {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.task-prompt-inputs__group:last-child {
  border-bottom: 0;
}

.task-prompt-inputs__group h4 {
  margin: 0;
  padding: 8px 10px 4px;
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.task-prompt-inputs__group dl {
  margin: 0;
}

.task-prompt-inputs__row {
  display: grid;
  grid-template-columns: minmax(5.5rem, 7rem) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 4px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
  line-height: 16px;
}

.task-prompt-inputs__row:last-child {
  border-bottom: 0;
}

.task-prompt-inputs__row dt,
.task-prompt-inputs__row dd {
  min-width: 0;
  margin: 0;
}

.task-prompt-inputs__row dt {
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 650;
}

.task-prompt-inputs__row dt code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: inherit;
  letter-spacing: 0.02em;
}

.task-prompt-inputs__row dd {
  overflow-wrap: anywhere;
}

.task-prompt-output {
  min-width: 0;
}

.task-config {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: none;
  padding: 12px 14px 18px;
}

.task-config-columns {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(20rem, 2fr);
  flex: 1;
  height: 100%;
  min-height: 0;
}

.task-config-tabs {
  border-bottom: 1px solid var(--line);
}

.task-config-tabs .prompt-view__btn {
  flex: 0 1 auto;
  width: auto;
  min-width: 15rem;
}

.task-config-workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.task-config-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.task-config-panel[hidden] {
  display: none;
}

.task-config-columns__variables,
.task-config-columns__artifact {
  min-width: 0;
  min-height: 0;
}

.task-config-columns__artifact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  overflow: hidden;
  border-left: 1px solid var(--line);
}

.task-config-state-preview {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.task-config-state-preview__toolbar {
  width: calc(100% + 28px);
  margin: -14px -14px 0;
  padding: 0;
}

.task-config-state-preview__toolbar .prompt-view,
.task-config-state-preview__toolbar .prompt-view__btn {
  height: 100%;
}

.task-config-state-view .prompt-view__btn {
  flex-basis: 7rem;
  width: 7rem;
}

.task-config-state-preview__body {
  flex: 1;
  min-height: 0;
  padding-top: 10px;
  overflow: auto;
}

.task-config-dry-run__toolbar {
  flex-wrap: wrap;
  height: auto;
  gap: 10px;
  margin: -14px -14px 0;
  padding: 8px 14px;
}

.task-config-dry-run__toolbar > div {
  display: grid;
  flex: 1 0 100%;
  gap: 2px;
  min-width: 0;
}

.task-config-dry-run__toolbar time {
  color: var(--fg);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.625rem;
  overflow-wrap: anywhere;
}

.task-config-spawn-hint {
  flex: 1 0 100%;
  text-align: right;
}

.task-config-dry-run__summary,
.task-config-dry-run__source {
  display: grid;
  gap: 7px;
}

.task-config-dry-run__summary {
  margin-bottom: 14px;
}

.task-config-dry-run__summary p,
.task-config-dry-run__source p,
.task-config-agent-test p {
  margin: 0;
  font-size: 0.6875rem;
}

.task-config-dry-run__source + .task-config-dry-run__source {
  margin-top: 16px;
}

.task-config-dry-run__condition {
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.task-config-dry-run__condition > p {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
}

.task-config-dry-run__mark {
  width: 12px;
  font-weight: 700;
  text-align: center;
}

.task-config-dry-run__condition.is-pass .task-config-dry-run__mark,
.task-config-dry-run__condition li.is-pass {
  color: var(--good);
}

.task-config-dry-run__condition.is-fail .task-config-dry-run__mark,
.task-config-dry-run__condition li.is-fail,
.task-config-dry-run__suppressed {
  color: var(--bronze);
}

.task-config-dry-run__condition ul {
  display: grid;
  gap: 3px;
  margin: 6px 0 0 16px;
  padding: 0;
  list-style: none;
  font-size: 0.625rem;
}

.task-config-dry-run__ids {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.task-config-state-preview__section + .task-config-state-preview__section {
  margin-top: 14px;
}

.task-config-state-preview__head {
  display: flex;
  align-items: center;
  min-height: 26px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.task-config-state-preview__head h3 {
  margin: 0;
  font-size: 0.75rem;
}

.task-config-state-preview__head span {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.625rem;
}

.task-config-state-preview pre {
  margin: 0;
  padding: 10px 0 0;
  color: var(--fg);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.6875rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-config-state-table-wrap {
  overflow-x: auto;
}

.task-config-state-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.6875rem;
}

.task-config-state-table th,
.task-config-state-table td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.task-config-state-table th {
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 650;
}

.task-config-columns__artifact .source-merged-prompt {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.task-config-columns__artifact .source-merged-prompt__body {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.task-config-columns__artifact [data-toggle-task-config-prompt-variables][aria-pressed='true'] {
  background: color-mix(in srgb, var(--bronze) 14%, transparent);
  color: var(--bronze);
}

.task-config-prompt-variable {
  padding: 0 1px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--bronze) 28%, transparent);
  color: color-mix(in srgb, var(--bronze) 76%, var(--fg));
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.task-config__policy {
  width: min(19rem, 40%);
}

.task-config__policy .lbl,
.task-config-fields .lbl {
  display: block;
  margin-bottom: 3px;
}

.task-config-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--fg) 2%, var(--panel));
}

.task-config-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.task-config-card__head h3 {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.2;
}

.task-config-definition {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr);
  gap: 7px;
  align-items: end;
}

.task-config-definition .lbl {
  display: block;
  margin-bottom: 3px;
}

.task-config-definition__description {
  grid-column: 1 / -1;
}

.task-config-card__step {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bronze) 16%, transparent);
  color: var(--bronze);
  font-size: 0.625rem;
  font-weight: 700;
}

.task-config-readers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.task-config-reader {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
}

.task-config-reader > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.task-config-reader:has(input:checked) {
  border-color: color-mix(in srgb, var(--bronze) 42%, var(--line));
  background: color-mix(in srgb, var(--bronze) 5%, transparent);
}

.task-config-reader__entity {
  font-size: 0.75rem;
  font-weight: 650;
}

.task-config-reader__fields,
.task-config-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.task-config-reader__fields code,
.task-config-capabilities code {
  padding: 1px 4px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  font-size: 0.625rem;
}

.task-config__logic {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.task-config__logic > .task-config-card:first-child {
  grid-column: 1 / -1;
}

.task-config-rule {
  display: grid;
  gap: 8px;
}

.task-config-condition {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1.2fr 1fr 26px;
  gap: 4px;
  align-items: end;
}

.task-config-condition + .task-config-condition {
  position: relative;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.task-config-condition + .task-config-condition::before {
  content: 'AND';
  position: absolute;
  top: 4px;
  left: 0;
  color: var(--muted);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.task-config-rule .field {
  min-width: 0;
  padding-left: 6px;
  padding-right: 20px;
  font-size: 0.6875rem;
}

.task-config-rule .lbl {
  display: block;
  margin-bottom: 3px;
}

.task-config-card__add {
  width: 24px;
  height: 24px;
  padding: 4px;
}

.task-config-condition__remove {
  grid-column: 5;
  grid-row: 1;
  width: 26px;
  height: 28px;
}

.task-config-condition__remove {
  opacity: 0;
  pointer-events: none;
}

.task-config-condition:hover .task-config-condition__remove,
.task-config-condition:focus-within .task-config-condition__remove {
  opacity: 1;
  pointer-events: auto;
}

.task-config-condition__remove:disabled {
  opacity: 0.28;
  pointer-events: auto;
}

.task-config-condition-semantics {
  font-size: 0.625rem;
}

.task-config-condition__hint {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 0.625rem;
  line-height: 1.35;
}

.task-config-condition__hint.is-error {
  color: var(--danger);
}

.task-config-condition [data-task-config-value][aria-invalid='true'] {
  border-color: color-mix(in srgb, var(--danger) 58%, var(--line));
}

.task-config-select {
  position: relative;
}

.task-config-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.task-config-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  text-align: left;
}

.task-config-select__trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-config-select__trigger svg {
  width: 14px;
  height: 14px;
  flex: none;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(90deg);
}

.task-config-select__menu {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  z-index: 30;
  min-width: 100%;
  width: max-content;
  max-width: min(22rem, 80vw);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: 0 8px 24px color-mix(in srgb, #000 28%, transparent);
}

.task-config-select__menu[hidden] {
  display: none;
}

.task-config-field--value .task-config-select__menu {
  right: 0;
  left: auto;
  max-height: min(18rem, 60vh);
  overflow-y: auto;
}

.task-config-select__option {
  display: block;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 0.6875rem;
  text-align: left;
  white-space: nowrap;
}

.task-config-select__option:hover,
.task-config-select__option:focus-visible,
.task-config-select__option.is-on {
  background: var(--field-focus-fill);
}

.task-config-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.task-config-fields--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-config-webhook {
  display: grid;
  gap: 4px;
  margin-top: 7px;
}

.task-config-capabilities {
  align-items: center;
  margin-top: 9px;
}

.task-config-capabilities [data-task-config-capabilities] {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.task-config-capabilities .lbl {
  margin-right: 3px;
}

.task-config-tool-access {
  display: grid;
  gap: 9px;
}

.task-config-tool-access__group {
  display: grid;
  gap: 4px;
}

.task-config-tool-access__group > span:last-child,
.task-config-agent-test [data-task-config-tools-used] {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.task-config-tool-access code,
.task-config-agent-test code,
.task-config-dry-run code {
  padding: 1px 4px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  font-size: 0.625rem;
}

.task-config-agent-test {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  max-height: 18rem;
  overflow: auto;
}

.task-config-agent-test__proposals {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 17px;
  font-size: 0.6875rem;
}

.task-config-definition textarea.field {
  min-height: 5rem;
  height: auto;
  resize: vertical;
  white-space: pre-wrap;
}

.task-config-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

@media (max-width: 1380px) {
  .task-config__logic {
    grid-template-columns: 1fr;
  }

  .task-config__logic > .task-config-card:first-child {
    grid-column: auto;
  }

  .task-config-readers {
    grid-template-columns: 1fr;
  }

  .task-config-definition {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 1050px) {
  .task-config-columns {
    display: block;
    overflow: auto;
  }

  .task-config-columns__variables {
    overflow: visible;
  }

  .task-config-columns__artifact {
    display: block;
    overflow: visible;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .task-config-state-preview {
    overflow: visible;
  }

  .task-config-state-preview__body {
    overflow: visible;
  }

  .task-config-columns__artifact .source-merged-prompt__body {
    max-height: 28rem;
  }
}

@media (max-width: 700px) {
  .task-config__policy {
    width: 100%;
  }

  .task-config-reader {
    grid-template-columns: 1fr;
  }

  .task-config-reader__fields {
    grid-column: 1 / -1;
  }

  .task-config-rule {
    overflow-x: auto;
  }

  .task-config-condition {
    min-width: 40rem;
    grid-template-columns: 0.8fr 1fr 1.2fr 1fr 26px;
  }

  .task-config-condition__remove {
    position: static;
    grid-column: 5;
    grid-row: 1;
    align-self: end;
  }

  .task-config-condition__hint {
    grid-row: 2;
  }

  .task-config-definition {
    grid-template-columns: 1fr;
  }

  .task-config-definition__description {
    grid-column: auto;
  }
}

.compose-cols__add {
  flex-shrink: 0;
  margin-top: 4px;
  width: 100%;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 20px;
  text-align: left;
}

.compose-cols__add:hover,
.compose-cols__add:focus-visible {
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  color: var(--fg);
}

.write-error {
  margin: 0 0 8px;
}

.write-saved {
  margin: 0 0 8px;
}

.col__head .inference-auth__btn {
  flex: none;
}

.modal__box--task .inference-auth__btn {
  flex: none;
}

.scroll--admin,
.scroll--meta {
  padding: 0;
}

.scroll--admin .compose-form,
.scroll--meta .compose-form {
  max-width: 68rem;
  overflow: visible;
}

.scroll--admin .env-form {
  max-width: 44rem;
}

.scroll--admin .compose-cols,
.scroll--admin .compose-cols__list,
.scroll--meta .compose-cols,
.scroll--meta .compose-cols__list {
  flex: none;
  overflow: visible;
}

.scroll--meta .compose-form .area {
  min-height: 72px;
}

.lbl {
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.modal__box h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.mission-brief {
  margin: 0 0 12px;
  white-space: pre-wrap;
}

.source-meta-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.source-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.source-status-badge.is-approved {
  background: color-mix(in srgb, var(--good) 20%, transparent);
  color: color-mix(in srgb, var(--good) 72%, var(--fg));
}

.desk-status,
.write-saved {
  margin: 0;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bronze) 10%, transparent);
  color: var(--fg);
  font-size: 0.8125rem;
  font-weight: 600;
}

.desk-status.is-approved {
  background: color-mix(in srgb, var(--good) 14%, transparent);
}

.follow-up__label {
  display: block;
  margin-top: 14px;
  margin-bottom: 5px;
}

.follow-up__actions {
  margin-top: 10px;
}

.confirm__btn--primary {
  border-color: color-mix(in srgb, var(--good) 48%, var(--line));
  background: color-mix(in srgb, var(--good) 16%, var(--panel));
  font-weight: 700;
}

.task-result-summary {
  display: grid;
  gap: 4px;
  margin: 14px 0;
  padding: 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--good) 12%, var(--panel));
}

.task-result-summary > strong {
  font-size: 1rem;
}

.task-result-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.technical-details {
  margin: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

/* Mobile icon preview: a single home-screen context for judging the app mark. */
.mobile-preview {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  padding: 18px 24px 24px;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 105%, rgba(45, 91, 224, 0.42), transparent 42%),
    linear-gradient(145deg, #170024, #09000f 58%, #12001c);
  color: #fff;
}

.mobile-preview[hidden] {
  display: none;
}

.mobile-preview__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 560px);
  margin: 0 auto;
}

.mobile-preview__eyebrow,
.mobile-preview__bar h1 {
  margin: 0;
}

.mobile-preview__eyebrow {
  color: rgba(255, 255, 255, 0.54);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-preview__bar h1 {
  color: #fff;
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.mobile-preview__close {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.mobile-preview__close:hover,
.mobile-preview__close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

.mobile-device {
  align-self: start;
  justify-self: center;
  width: min(390px, calc(100vw - 40px));
  aspect-ratio: 390 / 844;
  margin-top: 20px;
  padding: 7px;
  border: 2px solid #66696e;
  border-radius: 54px;
  background: #111214;
  box-shadow:
    0 0 0 4px #050506,
    0 24px 70px rgba(0, 0, 0, 0.58);
}

.mobile-device__screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 46px;
  background:
    radial-gradient(ellipse at 102% 5%, rgba(18, 59, 154, 0.95) 0 26%, transparent 26.5%),
    radial-gradient(ellipse at -8% 62%, rgba(93, 230, 208, 0.9) 0 38%, transparent 38.5%),
    radial-gradient(ellipse at 75% 40%, rgba(56, 107, 237, 0.92) 0 31%, transparent 31.5%),
    linear-gradient(150deg, #d7f3f3 0 38%, #dce9ef 38% 63%, #1db7ca 63% 78%, #2338ab 78%);
  box-shadow: inset 0 0 40px rgba(4, 14, 55, 0.22);
}

.mobile-status {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 58px;
  padding: 10px 20px 0;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
}

.mobile-island {
  width: 122px;
  height: 34px;
  border-radius: 999px;
  background: #020204;
}

.mobile-status__signals {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 6px;
}

.mobile-signal {
  width: 14px;
  height: 10px;
  border-bottom: 5px double #fff;
}

.mobile-wifi {
  width: 14px;
  height: 10px;
  border-top: 3px solid #fff;
  border-radius: 50%;
}

.mobile-battery {
  width: 21px;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px transparent;
}

.mobile-battery::after {
  content: "";
  display: block;
  width: 15px;
  height: 6px;
  margin: 1px;
  border-radius: 1px;
  background: #fff;
}

.mobile-apps {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px 13px;
  padding: 42px 21px 0;
}

.mobile-app {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
}

.mobile-app > span {
  max-width: 100%;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-app__icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(7, 18, 55, 0.2);
}

img.mobile-app__icon {
  object-fit: cover;
}

.mobile-app--hakban .mobile-app__icon {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.2),
    0 6px 16px rgba(7, 18, 55, 0.34);
}

.mobile-app__icon--calendar {
  background: linear-gradient(#f25555 0 24%, #fff 24%);
  color: #1a1b20;
}

.mobile-app__icon--calendar strong {
  padding-top: 11px;
  font-size: 1.35rem;
}

.mobile-app__icon--photos {
  background:
    radial-gradient(circle at 50% 50%, #fff 0 11%, transparent 12%),
    conic-gradient(#ff5656, #ffcf4a, #70d96f, #54cfdf, #5a76ec, #bc61d4, #ff5656);
  border: 5px solid #fff;
}

.mobile-app__icon--mail {
  background: linear-gradient(145deg, #65bfff, #087bdf);
}

.mobile-app__icon--mail svg {
  width: 38px;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linejoin: round;
}

.mobile-app__icon--notes {
  gap: 5px;
  padding: 13px 11px;
  background: linear-gradient(#f5d44f 0 21%, #fff 21%);
}

.mobile-app__icon--notes i {
  display: block;
  width: 34px;
  height: 2px;
  background: #c7c7c7;
}

.mobile-app__icon--clock {
  position: relative;
  border: 4px solid #fff;
  background: #15161a;
}

.mobile-app__icon--clock span {
  width: 2px;
  height: 19px;
  transform: translateY(-5px) rotate(18deg);
  transform-origin: bottom;
  background: #fff;
}

.mobile-app__icon--files {
  background:
    linear-gradient(180deg, transparent 0 32%, #2f9df3 32% 82%, #1676d3 82%),
    #eef8ff;
}

.mobile-app__icon--settings {
  background: linear-gradient(145deg, #b3b6ba, #666c74);
  color: #fff;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
}

.mobile-search {
  position: absolute;
  left: 50%;
  bottom: 116px;
  z-index: 1;
  transform: translateX(-50%);
  padding: 4px 11px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.6875rem;
  line-height: 18px;
  backdrop-filter: blur(12px);
}

.mobile-dock {
  position: absolute;
  right: 17px;
  bottom: 20px;
  left: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  height: 84px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 29px;
  background: rgba(160, 221, 239, 0.3);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(18px);
}

.mobile-dock__icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
}

.mobile-dock__icon--browser {
  background:
    radial-gradient(circle, #fff 0 35%, transparent 36%),
    conic-gradient(#f35555, #f5d04b, #51c579, #3b98ed, #f35555);
  border: 3px solid #fff;
}

.mobile-dock__icon--messages {
  background: radial-gradient(ellipse at 50% 42%, #fff 0 31%, transparent 32%), #28cf5b;
}

.mobile-home-indicator {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 124px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
}

@media (max-width: 980px) {
  html,
  body.desk {
    height: auto;
    min-height: 100%;
  }

  .board,
  .board--home.board--tasks-collapsed,
  .board--prompt.board--tasks-collapsed {
    grid-template-columns: 1fr;
    height: auto;
  }

  body.desk { overflow: auto; }

  .desk-shell,
  .board {
    flex: none;
    min-height: 0;
  }

  .col {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .col > .scroll {
    flex: none;
    overflow: visible;
  }

  .col--source__stacks {
    grid-template-rows: repeat(3, auto);
    flex: none;
    min-height: 0;
  }

  .col--source__stacks > .pane {
    overflow: visible;
  }

  .board--prompt .col--prompt-vars {
    max-height: 42vh;
  }
}

@media (max-width: 900px) {
  /* Keep the source editor within the viewport when the mobile page is shorter than its form. */
  #modal:has(> .modal__box--source) {
    position: fixed;
  }
  .modal__form--source {
    overflow: auto;
  }

  .source-compose-columns {
    display: block;
  }

  .source-compose-columns__config {
    overflow: visible;
  }

  .source-compose-columns__artifact {
    display: block;
    overflow: visible;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .source-compose-columns__artifact .source-merged-prompt__body {
    max-height: 24rem;
  }

  .capability-picker__row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .capability-picker__http,
  .capability-picker__summary {
    grid-column: 2;
  }
}

@media (max-width: 720px) {
  .mobile-preview {
    display: block;
    padding: 0;
    background: #050506;
  }

  .mobile-preview[hidden] {
    display: none;
  }

  .mobile-preview__bar {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: 14px;
    z-index: 3;
    width: auto;
  }

  .mobile-preview__bar > div {
    display: none;
  }

  .mobile-preview__close {
    min-height: 34px;
    padding: 0 12px;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(11, 12, 16, 0.56);
    backdrop-filter: blur(12px);
  }

  .mobile-device {
    width: 100%;
    height: 100dvh;
    margin-top: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .mobile-device__screen {
    border-radius: 0;
  }

  .listing-detail {
    grid-template-columns: var(--detail-thumb) minmax(0, 1fr);
  }

  .listing-history {
    grid-column: 1 / -1;
  }

  .modal__box--form {
    height: min(88vh, 720px);
  }

  .global-chat {
    flex-basis: min(var(--global-chat), 86vw);
    width: min(var(--global-chat), 86vw);
  }
}

/* Source composer only: keep disabled draft fields within the existing compact layout. */
.source-draft-fields { border: 0; padding: 0; margin: 0; min-width: 0; }

.source-draft-chooser { padding: 8px 16px 0; }
.source-draft-chooser .source-draft-chooser__controls { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
.source-draft-chooser select { flex: 1; min-width: 150px; padding: 5px 8px; background: var(--panel); }
.source-draft-fields [data-draft-status] { margin: 6px 16px; }
.source-draft-fields :focus-visible, .modal__box--source [data-save-source-draft]:focus-visible { box-shadow: inset 0 0 0 2px var(--bronze); }

/* Daily review controls; preserve existing desk row and header density. */
.review-controls { display:flex; gap:8px; align-items:center; flex-wrap:wrap; padding:6px 12px; border-bottom:1px solid var(--line); }
.review-controls input { width:200px; min-width:100px; max-width:100%; }
.review-controls select.field { width:auto; max-width:100%; }
.review-controls .field { padding:4px 6px; background:var(--panel); color:var(--fg); border:1px solid var(--line); border-radius:4px; }
.review-controls :focus-visible { box-shadow:inset 0 0 0 2px var(--bronze); }

/* Keep the requested mobile listing return readable inside the expanded row. */
@media (max-width: 520px) {
  .cols tr.detail .listing-detail { grid-template-columns:1fr; }
  .cols tr.detail .listing-detail__body,
  .cols tr.detail .listing-history { width:calc(100vw - 24px); max-width:100%; }
  .cols tr.detail .listing-detail__body p { white-space:normal; overflow-wrap:anywhere; }
  .cols tr.detail .listing-history { overflow-x:auto; }
}
