@layer tokens, base, components, responsive;

@font-face { font-family: Satoshi; src: url('/satoshi-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Satoshi; src: url('/satoshi-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }

@layer tokens {
  :root {
    --ink: #292929;
    --background: #fff;
    --surface: #fff;
    --stage: #f6f6f6;
    --foreground: var(--ink);
    --muted: color-mix(in oklab, var(--ink) 72%, white);
    --subtle: color-mix(in oklab, var(--ink) 68%, white);
    --border: color-mix(in oklab, var(--ink) 12%, transparent);
    --hover: color-mix(in oklab, var(--ink) 5%, transparent);
    --input: color-mix(in oklab, var(--ink) 14%, transparent);
    --primary: #202124;
    --focus: #305dde;
    --blue: #2f7ef7;
    --purple: #8b50ef;
    --orange: #f47721;
    --pink: #ef477c;
    --success: #28764f;
    --warning: #97691f;
    --destructive: #b7423c;
    --radius: .625rem;
    --radius-sm: calc(var(--radius) * 1.4);
    --radius-md: calc(var(--radius) * 1.8);
    --radius-lg: calc(var(--radius) * 2.2);
    --radius-xl: calc(var(--radius) * 2.6);
    --font-sans: Satoshi, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  }
}

@layer base {
  * { box-sizing: border-box; }
  html { min-width: 320px; overflow-x: clip; background: var(--background); }
  body { margin: 0; color: var(--foreground); font-family: var(--font-sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
  button, input, select { font: inherit; color: inherit; }
  button, select, input[type="checkbox"] { cursor: pointer; }
  button { font-weight: 500; }
  button, input, select { -webkit-tap-highlight-color: transparent; }
  button:disabled { cursor: default; opacity: .6; }
  button, a, input, select, summary { touch-action: manipulation; }
  :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
  input:focus, select:focus, textarea:focus { outline: none; }
  input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: inset 0 -2px 0 var(--focus); }
  button, select, a { transition: background-color .16s ease-out, color .16s ease-out, box-shadow .16s ease-out; }
  h1, h2, h3, h4, p { margin: 0; }
  h1, h2, h3, h4, strong { font-weight: 500; }
  h1 { font-size: 30px; letter-spacing: -1.15px; line-height: 1.3; }
  h2 { font-size: 14px; letter-spacing: -.2px; }
  h3 { font-size: 12px; }
  a { color: inherit; }
  input { min-width: 0; }
  input::placeholder { color: var(--subtle); }
  [hidden] { display: none !important; }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
  .icon { width: 17px; height: 17px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .mono { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
  .muted { color: var(--muted); font-size: 12px; }
  .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
  .skip-link { position: fixed; top: 10px; left: 10px; z-index: 5; transform: translateY(-180%); padding: 10px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
  .skip-link:focus { transform: translateY(0); }
}

@layer components {
  .app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); align-items: start; gap: 24px; width: calc(100% - 48px); max-width: 1440px; margin: 32px auto; min-height: calc(100dvh - 64px); }
  .sidebar { background: transparent; position: sticky; top: 32px; height: calc(100dvh - 64px); display: flex; flex-direction: column; padding: 24px 14px 20px; border: 0; border-right: 1px solid var(--border); border-radius: 0; min-width: 0; overflow-y: auto; scrollbar-width: thin; }
  .brand { display: flex; align-items: center; gap: 10px; margin: 0 10px 42px; text-decoration: none; font-size: 14px; font-weight: 500; letter-spacing: -.25px; }
  .brand-mark { display: grid; place-content: center; flex-shrink: 0; width: 36px; height: 36px; overflow: hidden; }
  .brand-mark img { display: block; width: 68px; height: 68px; max-width: none; }
  .brand-caption { display: block; color: var(--muted); font-weight: 400; font-size: 12px; letter-spacing: 0; margin-top: 1px; }
  .sidebar-title { display: flex; align-items: center; justify-content: space-between; padding: 0 10px; margin-bottom: 13px; font-size: 12px; font-weight: 500; color: var(--muted); }
  .count { font-size: 12px; background: var(--stage); min-width: 22px; height: 19px; display: grid; place-items: center; border-radius: 999px; font-variant-numeric: tabular-nums; }
  .agent-search { display: flex; align-items: center; gap: 7px; padding: 8px 10px; margin: 0 0 12px; color: var(--subtle); }
  .agent-search .icon { width: 14px; height: 14px; }
  .agent-search input { width: 100%; border: 0; background: transparent; font-size: 12px; }
  .agent-list { display: flex; flex-direction: column; gap: 5px; }
  .agent-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px; border-radius: var(--radius-md); corner-shape: squircle; }
  .agent-item:hover { background: var(--hover); }
  .agent-item.is-selected { background: color-mix(in oklab, var(--ink) 8%, transparent); box-shadow: inset 0 0 0 1px var(--border); }
  .agent-selection { display: grid; place-items: center; width: 15px; flex-shrink: 0; visibility: hidden; }
  .agent-selection .icon { width: 14px; height: 14px; }
  .agent-item.is-selected .agent-selection { visibility: visible; }
  .agent-avatar { width: 31px; height: 31px; display: grid; place-items: center; position: relative; flex-shrink: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; corner-shape: squircle; color: var(--muted); font-size: 12px; font-weight: 500; }
  .agent-avatar.has-image { border: 0; background: transparent; }
  .bot-avatar { display: block; flex-shrink: 0; }
  .fanout-identity { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; max-width: 100%; }
  .avatar-status { position: absolute; width: 7px; height: 7px; right: -1px; bottom: -1px; border-radius: 50%; border: 2px solid var(--background); box-sizing: content-box; background: var(--subtle); }
  .avatar-status.online { background: var(--success); }
  .agent-text { flex: 1; min-width: 0; }
  .agent-name { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; font-weight: 500; }
  .agent-caption { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 2px; }
  .sidebar-note { margin: 20px 10px 0; padding-top: 0; font-size: 12px; color: var(--muted); }
  .sidebar-note p { margin: 10px 0 8px; line-height: 1.7; }
  .sidebar-note .mono { font-size: 12px; color: var(--subtle); }
  .local-indicator { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--ink); }
  .workspace { padding: 8px 0 28px; min-width: 0; width: 100%; }
  .page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
  .eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
  .page-description { color: var(--muted); font-size: 12px; margin-top: 7px; }
  .header-actions { display: flex; align-items: center; gap: 16px; }
  .connection-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; color: var(--muted); }
  .connection-status.connected { color: var(--success); }
  .connection-status.disconnected { color: var(--warning); }
  .button { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 7px 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; white-space: nowrap; font-size: 12px; box-shadow: 0 1px 1px color-mix(in oklab, var(--ink) 3%, transparent); }
  .button:hover { background: var(--hover); }
  .button .icon { width: 14px; height: 14px; }
  .button.primary { color: white; background: var(--primary); border-color: transparent; }
  .button.primary:hover { background: color-mix(in oklab, var(--primary) 90%, var(--ink)); }
  .notice { padding: 11px 15px; background: var(--stage); border-radius: var(--radius-sm); font-size: 12px; margin-bottom: 18px; color: var(--muted); overflow-wrap: anywhere; }
  .metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
  .metric { min-width: 0; }
  .metric-label { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
  .metric-label .icon { width: 15px; height: 15px; opacity: .7; }
  .metric-value { font-size: 34px; font-weight: 400; line-height: 1.4; margin: 9px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
  .metric-caption { font-size: 12px; color: var(--muted); min-height: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .work-panel { min-width: 0; }
  .panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
  .view-tabs { display: inline-flex; gap: 2px; padding: 4px; background: var(--stage); border-radius: 999px; }
  .tab { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 999px; padding: 8px 13px; color: var(--muted); background: transparent; font-size: 12px; }
  .tab .icon { width: 14px; height: 14px; }
  .tab:hover { color: var(--ink); }
  .tab.is-selected { color: var(--ink); background: var(--surface); box-shadow: 0 1px 4px color-mix(in oklab, var(--ink) 8%, transparent); }
  .follow-control { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; cursor: pointer; }
  .follow-control input { accent-color: var(--primary); width: 13px; height: 13px; margin: 0; }
  .filters { display: flex; gap: 9px; margin-bottom: 19px; }
  .search-field { flex: 1; min-width: 90px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; color: var(--subtle); }
  .search-field .icon { width: 14px; height: 14px; }
  .search-field input { width: 100%; background: transparent; border: 0; font-size: 12px; }
  .select-field { display: inline-flex; align-items: center; min-width: 108px; }
  .select-field select { width: 100%; min-height: 40px; padding: 7px 26px 7px 12px; border: 1px solid var(--border); border-radius: 999px; background-color: var(--surface); font-size: 12px; }
  .content-grid { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(360px, 1.15fr); gap: 14px; align-items: start; }
  .activity-panel { min-width: 0; }
  .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 2px 15px; min-height: 37px; }
  .section-heading h2 { font-size: 12px; }
  .section-heading .muted { font-size: 12px; }
  .activity-list { display: flex; flex-direction: column; gap: 2px; max-height: min(67vh, 810px); min-height: 380px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 2px; }
  .activity-row { display: flex; align-items: center; gap: 8px; text-align: left; width: 100%; min-height: 40px; padding: 6px 9px; border: 1px solid transparent; border-radius: 12px; corner-shape: squircle; background: transparent; }
  .activity-row:hover { background: var(--hover); }
  .activity-row.is-selected { background: var(--surface); border-color: transparent; box-shadow: 0 1px 2px #00000006; }
  .event-icon { width: 27px; height: 27px; display: grid; place-items: center; flex-shrink: 0; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; corner-shape: squircle; }
  .event-icon .icon { width: 14px; height: 14px; }
  .event-body { min-width: 0; flex: 1; display: flex; align-items: center; gap: 7px; overflow: hidden; }
  .event-title { flex: 0 1 auto; max-width: 38%; font-size: 12px; font-weight: 500; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .event-description { flex: 1 1 auto; min-width: 24px; overflow: hidden; font-size: 11px; font-weight: 400; color: var(--muted); margin: 0; line-height: 1.35; white-space: nowrap; text-overflow: ellipsis; }
  .event-meta { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; flex-wrap: nowrap; gap: 5px; font-size: 11px; font-weight: 400; color: var(--muted); margin: 0; white-space: nowrap; overflow: hidden; }
  .event-meta > span:not(.badge) { max-width: 86px; overflow: hidden; text-overflow: ellipsis; }
  .event-meta .badge { font-size: 10px; padding: 1px 5px; }
  .event-time { font-size: 10px; color: var(--subtle); white-space: nowrap; font-weight: 400; font-family: var(--font-mono); margin: 0; }
  .badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
  .badge .dot { width: 4px; height: 4px; }
  .badge.active, .badge.completed, .badge.online { color: var(--success); }
  .badge.queued, .badge.demo, .badge.connecting, .badge.recovering, .demo-badge, .environment-badge { color: var(--warning); }
  .badge.failed, .badge.cancelled, .badge.blocked, .badge.timeout { color: var(--destructive); }
  .load-more { display: flex; margin: 15px auto 0; }
  .inspector { padding: 2px; border: 0; background: transparent; min-width: 0; min-height: 418px; max-height: min(77vh, 930px); overflow: auto; scrollbar-width: thin; overscroll-behavior: contain; }
  .inspector-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 0 0 15px; }
  .inspector-eyebrow { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
  .inspector-title { font-size: 16px; line-height: 1.4; letter-spacing: -.4px; overflow-wrap: anywhere; }
  .inspector-subtitle { font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
  .inspector-empty, .empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; padding: 40px 26px; min-height: 370px; }
  .inspector-empty h2, .empty-state h2 { font-size: 14px; margin: 15px 0 8px; }
  .inspector-empty p, .empty-state p { color: var(--muted); font-size: 12px; max-width: 280px; line-height: 1.8; }
  .empty-icon { display: grid; place-items: center; width: 42px; height: 42px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); corner-shape: squircle; color: var(--muted); }
  .empty-icon .icon { width: 21px; height: 21px; }
  .empty-state .command-copy { margin: 18px 0 11px; }
  .command-copy { display: flex; width: 100%; max-width: 320px; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); corner-shape: squircle; text-align: left; }
  .command-copy code { font-family: var(--font-mono); font-weight: 400; font-size: 12px; overflow-wrap: anywhere; }
  .command-copy .icon { width: 14px; height: 14px; color: var(--muted); }
  .detail-section { padding: 18px; background: var(--surface); border-radius: var(--radius-md); corner-shape: squircle; margin-top: 10px; min-width: 0; }
  .detail-section h3 { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; font-size: 15px; }
  .detail-section h3 .icon { width: 13px; height: 13px; color: var(--muted); }
  .detail-section h3 .count { margin-left: auto; }
  .detail-grid { display: grid; grid-template-columns: minmax(55px, auto) minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 12px; }
  .detail-grid dt { color: var(--muted); }
  .detail-grid dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
  .detail-grid dd.mono { font-size: 12px; }
  .detail-note { font-size: 12px; line-height: 1.7; color: var(--muted); }
  .plan-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
  .plan-step { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; line-height: 1.7; }
  .plan-marker { display: grid; place-items: center; flex-shrink: 0; width: 16px; height: 16px; border: 1px solid var(--border); color: var(--muted); border-radius: 50%; font-size: 12px; margin-top: 1px; }
  .plan-marker .icon { width: 10px; height: 10px; }
  .plan-step.completed { color: var(--muted); }
  .plan-step.completed .plan-marker { color: var(--success); }
  .plan-step.active .plan-marker { color: var(--primary); border-color: currentColor; }
  .plan-content { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  .plan-status { font-size: 12px; color: var(--subtle); white-space: nowrap; }
  .tools-list { display: flex; flex-direction: column; gap: 9px; }
  .tool-item { min-width: 0; padding: 9px 10px; background: var(--stage); border-radius: var(--radius-sm); corner-shape: squircle; }
  .tool-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .tool-name { min-width: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 500; }
  .tool-title { margin-top: 7px; font-family: var(--font-mono); font-size: 12px; line-height: 1.75; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 140px; overflow: auto; }
  .file-location { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; }
  .recorded-output { margin: 0; font-family: var(--font-mono); font-size: 12px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 310px; overflow: auto; scrollbar-width: thin; }
  .output-entry + .output-entry { margin-top: 13px; }
  .history-details summary { cursor: pointer; font-size: 12px; color: var(--muted); padding: 2px 0; }
  .history-details[open] summary { margin-bottom: 12px; }
  .mini-event { display: flex; gap: 11px; font-size: 12px; line-height: 1.8; color: var(--muted); padding: 5px 0; }
  .mini-event time { font-family: var(--font-mono); color: var(--subtle); white-space: nowrap; }
  .mini-event span { overflow-wrap: anywhere; }
  .page-footer { display: flex; justify-content: space-between; gap: 12px; color: var(--subtle); font-size: 12px; padding: 22px 2px 0; }
  .loading-state { display: flex; flex-direction: column; gap: 14px; padding: 21px 12px; font-size: 12px; color: var(--muted); }
  .skeleton { height: 14px; width: 55%; background: var(--stage); border-radius: 999px; }
  .skeleton-wide { width: 85%; }
  .toast { position: fixed; bottom: 23px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 11px 18px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); box-shadow: 0 8px 30px color-mix(in oklab, var(--ink) 12%, transparent); font-size: 12px; z-index: 10; }
  .task-activity-card { min-width: 0; }
  .fanout-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 2px 4px 18px; }
  .fanout-header h2 { font-size: 18px; letter-spacing: -.4px; }
  .fanout-count { font-family: var(--font-mono); gap: 10px; padding: 5px 10px; }
  .agent-dots { display: inline-flex; align-items: center; gap: 4px; }
  .agent-dots .dot { width: 6px; height: 6px; background: var(--agent-color); }
  .agent-color-0 { --agent-color: var(--blue); }
  .agent-color-1 { --agent-color: var(--purple); }
  .agent-color-2 { --agent-color: var(--orange); }
  .agent-color-3 { --agent-color: var(--pink); }
  .fanout-surface { background: var(--surface); border-radius: 22px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--ink) 4%, transparent); }
  .fanout-task { display: flex; align-items: baseline; gap: 14px; padding: 17px 20px; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
  .fanout-task .eyebrow { margin: 0; font-weight: 400; text-transform: uppercase; letter-spacing: 1.1px; }
  .fanout-graph { padding: 20px 18px 14px; display: flex; flex-direction: column; align-items: center; }
  .fanout-root { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: white; background: var(--ink); }
  .fanout-root .icon { width: 20px; height: 20px; }
  .fanout-lines { display: block; width: 100%; height: 65px; overflow: visible; }
  .fanout-lines path { fill: none; stroke: var(--border); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
  .fanout-branches { display: flex; width: 100%; }
  .fanout-branch { display: flex; flex: 1; flex-direction: column; align-items: center; min-width: 0; gap: 8px; padding: 3px 3px 7px; background: transparent; border: 0; border-radius: 12px; color: var(--muted); font-size: 12px; font-weight: 400; }
  .fanout-branch:hover { background: var(--hover); }
  .fanout-marker { display: grid; place-items: center; width: 38px; height: 38px; color: white; background: var(--agent-color); border-radius: 50%; box-shadow: 0 0 0 4px var(--stage); }
  .fanout-marker .icon { width: 19px; height: 19px; stroke-width: 2; }
  .fanout-marker.active .icon, .fanout-marker.recovering .icon { animation: working 1.8s linear infinite; }
  .fanout-marker.offline, .fanout-marker.observed { background: var(--muted); }
  .fanout-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fanout-branch.is-selected .fanout-name { color: var(--ink); font-weight: 500; }
  .fanout-result { display: grid; grid-template-columns: minmax(60px, .7fr) minmax(0, 1.7fr) auto; gap: 14px; align-items: center; padding: 15px 20px; font-size: 12px; }
  .fanout-result-name { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
  .fanout-result-summary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); overflow-wrap: anywhere; }
  .fanout-duration { font-family: var(--font-mono); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .fanout-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 4px 8px; color: var(--muted); font-size: 12px; }
  .detail-variants { display: flex; flex-wrap: wrap; gap: 7px; padding: 18px 2px 2px; }
  .variant { background: transparent; color: var(--muted); box-shadow: none; min-height: 38px; padding: 7px 13px; }
  .variant.is-selected { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px #00000008; }
  .cycle-detail-content > .detail-section { border: 1px solid var(--border); box-shadow: 0 1px 2px #00000004; }
  .cycle-detail-content .detail-section h3 > .icon { width: 24px; height: 24px; padding: 4px; box-sizing: content-box; border-radius: 10px; color: var(--blue); background: color-mix(in srgb, var(--blue) 9%, white); margin-right: 4px; }
  .cycle-detail-content .count { padding-inline: 8px; }
  .plan-list { gap: 8px; }
  .plan-step { gap: 12px; border: 1px solid color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 12px; padding: 11px 12px; align-items: center; }
  .plan-marker { width: 25px; height: 25px; border-radius: 7px; border: 0; background: var(--stage); font-size: 12px; }
  .plan-marker .icon { width: 15px; height: 15px; }
  .plan-step.completed .plan-marker { background: var(--ink); color: white; }
  .plan-step.active { border-color: var(--border); box-shadow: 0 2px 3px #00000005; color: var(--ink); }
  .plan-step.active .plan-marker { background: var(--ink); color: white; }
  .plan-status { font-size: 11px; }
  .tool-item { padding: 13px; }
  .tool-heading { align-items: start; }
  .tool-title { font-size: 12px; }
  .recorded-output { font-family: var(--font-sans); font-size: 14px; line-height: 1.8; }
  .runtime-details, .history-details { background: transparent; border: 1px solid var(--border); padding: 13px 16px; }
  .runtime-details summary { font-size: 12px; color: var(--muted); cursor: pointer; }
  .runtime-details[open] summary { margin-bottom: 16px; }
  .section-heading h2 { font-size: 14px; }
  .agent-item.is-selected { background: var(--surface); box-shadow: 0 1px 3px #00000006; }
  .event-icon:has(use[href="#i-list"]) { color: var(--purple); }
  .event-icon:has(use[href="#i-message"]) { color: var(--blue); }
  .event-icon:has(use[href="#i-tool"]) { color: var(--orange); }

  .oa-card, .oa-inset {
    --card-clip-radius: 14px;
    --card-clip-handle: 2.25px;
    --card-clip-path: shape(from var(--card-clip-radius) 0px, line to calc(100% - var(--card-clip-radius)) 0px, curve to 100% var(--card-clip-radius) with calc(100% - var(--card-clip-handle)) 0px / 100% var(--card-clip-handle), line to 100% calc(100% - var(--card-clip-radius)), curve to calc(100% - var(--card-clip-radius)) 100% with 100% calc(100% - var(--card-clip-handle)) / calc(100% - var(--card-clip-handle)) 100%, line to var(--card-clip-radius) 100%, curve to 0px calc(100% - var(--card-clip-radius)) with var(--card-clip-handle) 100% / 0px calc(100% - var(--card-clip-handle)), line to 0px var(--card-clip-radius), curve to var(--card-clip-radius) 0px with 0px var(--card-clip-handle) / var(--card-clip-handle) 0px, close);
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 26px;
    corner-shape: squircle;
    clip-path: var(--card-clip-path);
    box-shadow: 0 1px 2px rgb(0 0 0 / 6%);
  }
  .oa-card { padding: 4px; background: var(--surface); }
  .oa-inset { --card-clip-radius: 12px; border-radius: 22px; background: var(--stage); }
  .metric-label { padding: 10px 14px 12px; color: var(--ink); }
  .metric-inset { height: 112px; padding: 12px 16px; }
  .metric-value { margin: 0 0 5px; }
  .metric-caption { white-space: normal; }
  .activity-panel > .section-heading { padding: 12px 14px 14px; }
  .activity-list.oa-inset { padding: 6px; gap: 4px; height: min(67vh, 810px); }
  .activity-row:focus-visible { outline-offset: -3px; }
  .task-activity-card > .fanout-header { padding: 10px 14px 14px; }
  .fanout-header h2 { font-size: 15px; }
  .fanout-surface.oa-inset { height: 416px; overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain; }
  .fanout-surface.oa-inset .fanout-graph { padding-block: 14px 8px; }
  .fanout-surface.oa-inset .fanout-lines { height: 50px; }
  .fanout-surface.oa-inset .fanout-result { padding-block: 12px; }
  .fanout-task { padding-bottom: 0; }
  .fanout-result:hover { background: var(--hover); }
  .fanout-footer { padding: 12px 14px 10px; }
  .detail-section.oa-card { padding: 4px; }
  .detail-section.oa-card > h3 { padding: 10px 14px 12px; margin: 0; font-size: 14px; }
  .cycle-detail-content .detail-section h3 > .icon { width: 16px; height: 16px; padding: 0; background: transparent; color: var(--muted); border-radius: 0; }
  .detail-section.oa-card > :is(.plan-list, .tools-list, .recorded-output, .detail-grid, .detail-note) {
    padding: 14px;
    margin: 0;
    border: 1px solid var(--border);
    background: var(--stage);
    border-radius: 22px;
    corner-shape: squircle;
  }
  .detail-section.oa-card > .plan-list { height: 176px; overflow-y: auto; gap: 2px; }
  .plan-step { min-height: 36px; padding: 6px 4px; border: 0; border-radius: 8px; }
  .plan-step.active { box-shadow: none; }
  .plan-marker { width: 22px; height: 22px; background: var(--surface); }
  .detail-section.oa-card > .tools-list { max-height: 320px; overflow-y: auto; }
  .tools-list .tool-item { background: var(--surface); }
  .detail-section.oa-card > .recorded-output + .recorded-output { margin-top: 4px; }
  .sidebar-resources { margin-top: auto; padding-top: 32px; }
  .documentation-card { flex-shrink: 0; }
  .documentation-card h2 { display: flex; align-items: center; gap: 8px; padding: 10px 12px 12px; font-size: 13px; }
  .documentation-card h2 .icon { width: 16px; height: 16px; color: var(--muted); }
  .documentation-inset { padding: 14px 12px; }
  .documentation-inset p { color: var(--muted); font-size: 12px; line-height: 1.7; margin-bottom: 14px; }
  .documentation-link { width: 100%; justify-content: space-between; min-height: 44px; padding-inline: 12px; }
  .documentation-link:hover { color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / 8%); }
  .header-documentation { display: none; }
  @media (min-width: 641px) {
    .oa-card, .oa-inset { --card-clip-radius: 20px; --card-clip-handle: 3px; border-radius: 50px; }
    .oa-inset { --card-clip-radius: 17px; border-radius: 44px; }
  }

  @keyframes working { to { transform: rotate(360deg); } }

}

@layer responsive {
  .guide-shell { max-width: 1080px; margin: auto; padding: 32px 24px 64px; font-size: 16px; line-height: 1.75; }
  .guide-shell .button { font-size: 14px; min-height: 40px; text-decoration: none; }
  .guide-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
  .guide-header p { color: var(--muted); margin-top: 10px; max-width: 640px; }
  .guide-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 40px; align-items: start; }
  .guide-nav { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
  .guide-nav a { padding: 5px 0; text-underline-offset: 4px; }
  .guide-content { min-width: 0; }
  .guide-content section { margin-bottom: 40px; scroll-margin-top: 24px; }
  .guide-content h2 { font-size: 24px; margin-bottom: 14px; }
  .guide-content h3 { font-size: 18px; margin: 24px 0 10px; }
  .guide-content p, .guide-content ol, .guide-content ul, .guide-content dl { margin: 0 0 16px; }
  .guide-content li { margin: 8px 0; }
  .guide-content pre { margin: 12px 0 18px; padding: 16px; border-radius: var(--radius-md); background: var(--stage); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
  .guide-content code, .guide-content kbd { font-family: var(--font-mono); font-size: .9em; overflow-wrap: anywhere; }
  .guide-content dt { font-weight: 500; margin-top: 16px; }
  .guide-content dd { margin: 4px 0 16px; color: var(--muted); }
  .guide-content a { color: var(--primary); text-underline-offset: 3px; }
  .guide-callout { padding: 18px; border-radius: var(--radius-md); background: var(--stage); }
  @media print { .guide-nav, .guide-header .button, .skip-link { display: none; } .guide-layout { display: block; } .guide-shell { max-width: none; padding: 0; } .guide-content section { break-inside: avoid; } }
  @media (max-width: 640px) { .guide-shell { padding: 24px 20px; } .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; } .guide-nav { position: static; } .panel-toolbar { flex-wrap: wrap; } }
  @media (min-width: 1550px) { .workspace { padding-bottom: 28px; } .content-grid { grid-template-columns: minmax(280px, .85fr) minmax(360px, 1.15fr); gap: 24px; } .activity-row { padding: 6px 9px; } .inspector { padding: 2px; } }
  @media (max-width: 1120px) { .app-shell { grid-template-columns: 185px minmax(0, 1fr); gap: 20px; width: calc(100% - 40px); } .sidebar { padding-inline: 10px; } .workspace { padding: 8px 0 18px; } .content-grid { grid-template-columns: minmax(250px, 1fr) minmax(270px, 1fr); }  .metrics { gap: 8px; } .header-actions { gap: 10px; } .metric-caption { font-size: 12px; } }
  @media (max-width: 940px) { .content-grid { grid-template-columns: minmax(0, 1fr); } .inspector { max-height: none; min-height: 220px; } .inspector-empty { min-height: 200px; } .activity-list { min-height: 250px; max-height: 440px; } .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .page-header { align-items: flex-start; } .header-actions { flex-direction: column; align-items: flex-end; padding-top: 7px; gap: 13px; } .page-description { max-width: 230px; } }
  @media (max-width: 640px) { .app-shell { grid-template-columns: minmax(0, 1fr); width: 100%; margin: 0 auto; gap: 0; min-height: 100dvh; } .sidebar { position: static; height: auto; padding: 16px 18px 8px; border: 0; border-radius: 0; overflow-y: visible; } .brand { margin: 0 0 16px; font-size: 13px; } .brand-caption { display: none; } .brand-mark { width: 28px; height: 28px; } .brand-mark img { width: 56px; height: 56px; } .sidebar-title, .agent-search, .sidebar-note { display: none; } .agent-list { flex-direction: row; overflow-x: auto; padding: 2px 2px 7px; gap: 6px; } .agent-item { width: auto; min-width: 132px; max-width: 170px; padding: 8px; flex-shrink: 0; } .agent-avatar { width: 25px; height: 25px; font-size: 12px; } .agent-name { font-size: 12px; } .agent-caption { font-size: 12px; } .workspace { padding: 17px 18px 20px; } .page-header { margin-bottom: 22px; gap: 10px; } h1 { font-size: 27px; } .page-description { font-size: 12px; max-width: 210px; } .eyebrow { font-size: 12px; } .header-actions .button { min-height: 40px; font-size: 12px; padding: 6px 10px; } .connection-status { font-size: 12px; } .metrics { margin-bottom: 22px; } .metric-value { font-size: 27px; } .metric-label { font-size: 12px; } .panel-toolbar { gap: 8px; } .tab { padding: 7px 9px; font-size: 12px; gap: 5px; } .tab .icon { width: 12px; height: 12px; } .follow-control { font-size: 12px; gap: 4px; } .filters { flex-wrap: wrap; gap: 7px; } .search-field { flex-basis: 100%; } .select-field { flex: 1; } .select-field select { font-size: 12px; } .content-grid { gap: 20px; } .page-footer { flex-direction: column; gap: 4px; } .event-time { font-size: 10px; } .activity-row { gap: 6px; padding: 6px; } .event-description { display: none; } .inspector { padding: 2px; } }
  .model-settings-summary:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px; margin-bottom: 22px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface, white); }
  .model-settings-summary h2 { margin: 0 0 6px; font-size: 13px; font-weight: 500; }
  .model-settings-summary p { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
  .model-settings-actions-row { gap: 8px; }
  .studio-action .icon { transition: transform .16s ease-out, color .16s ease-out; }
  .studio-action:hover .icon { transform: translateY(-1px); }
  #toggle-watcher[data-action="start"] .icon { color: var(--success); }
  #toggle-watcher[data-action="stop"] .icon, .remove-action .icon { color: var(--destructive); }
  .restart-action .icon { color: var(--orange); }
  .settings-action .icon { color: var(--purple); }
  #agent-connect-dialog, #model-settings-dialog, #agent-removal-dialog, #connection-update-dialog { width: min(500px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 24px; overflow-y: auto; border: 1px solid var(--border); border-radius: 24px; color: var(--ink); background: var(--surface, white); box-shadow: 0 24px 80px #0002; }
  #agent-connect-dialog::backdrop, #model-settings-dialog::backdrop, #agent-removal-dialog::backdrop, #connection-update-dialog::backdrop { background: #0005; }
  .model-settings-form { display: grid; gap: 12px; }
  .model-settings-form h2 { font-size: 17px; font-weight: 500; }
  .model-settings-form p { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
  .model-settings-form label { display: grid; gap: 4px; font-size: 13px; margin-top: 8px; }
  .model-settings-form label span { font-size: 12px; color: var(--muted); }
  .model-settings-form input, .model-settings-form textarea, .model-settings-form select { width: 100%; min-width: 0; padding: 11px 14px; border: 1px solid var(--border); border-radius: 18px; background: transparent; color: var(--ink); font-size: 13px; }
  .model-settings-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 8px; }
  #agent-connect-error, #model-settings-error, #agent-removal-error, #connection-update-error { color: #9f3030; }
  #connect-name[readonly] { color: var(--muted); background: color-mix(in srgb, var(--surface, white) 92%, var(--border)); cursor: default; }
  /* Model picker (studio/model-picker.mjs): a /model-style searchable list that opens inline. */
  #model-settings-dialog { width: min(560px, calc(100vw - 32px)); }
  .mp-field { display: grid; gap: 6px; margin-top: 8px; }
  .mp-label { display: grid; gap: 2px; font-size: 13px; }
  .mp-label span { font-size: 12px; color: var(--muted); }
  .mp { display: grid; gap: 8px; min-width: 0; }
  .mp-trigger { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 9px 14px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; font-weight: 400; }
  .mp-trigger:hover { background: var(--hover); }
  .mp.is-open .mp-trigger { border-color: color-mix(in oklab, var(--ink) 30%, transparent); }
  .mp-trigger-text { display: grid; gap: 1px; flex: 1; min-width: 0; }
  .mp-trigger-main { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .mp-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mp-trigger.is-empty .mp-name { color: var(--subtle); font-weight: 400; }
  .mp-id, .mp-option-id { font-family: var(--font-mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .mp-desc { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mp-chevron { flex: none; color: var(--muted); font-size: 16px; line-height: 1; transform: translateY(-3px); transition: transform .16s ease-out; }
  .mp.is-open .mp-chevron { transform: translateY(2px) rotate(180deg); }
  .mp-efforts { display: flex; flex-wrap: wrap; gap: 6px; }
  .mp-effort { min-height: 30px; padding: 4px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 12px; font-weight: 400; color: var(--muted); }
  .mp-effort:hover { background: var(--hover); color: var(--ink); }
  .mp-effort[aria-checked="true"] { color: white; background: var(--primary); border-color: transparent; font-weight: 500; }
  .mp-panel { display: grid; gap: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 12px 32px #0000000f; overflow: hidden; }
  .mp-search { display: flex; align-items: center; gap: 8px; padding: 4px 12px; border-bottom: 1px solid var(--border); }
  .mp-slash { flex: none; font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding: 2px 7px; border-radius: 7px; background: var(--stage); }
  .model-settings-form .mp-search input { flex: 1; padding: 10px 0; border: 0; border-radius: 0; font-size: 13px; box-shadow: none; }
  .mp-list { max-height: min(340px, 46dvh); overflow-y: auto; overscroll-behavior: contain; padding: 4px; }
  .mp-group + .mp-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
  .mp-group-label { padding: 8px 10px 4px; font-size: 11.5px; color: var(--muted); }
  .mp-option { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
  .mp-option.is-active { background: var(--hover); }
  .mp-option[aria-selected="true"] .mp-option-name { font-weight: 500; }
  .mp-check { font-size: 12px; line-height: 20px; color: var(--success); }
  .mp-option-body { display: grid; gap: 2px; min-width: 0; }
  .mp-option-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .mp-option-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mp-option-desc { font-size: 12px; color: var(--muted); line-height: 1.45; }
  .mp-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
  .mp-badge { padding: 1px 7px; border-radius: 999px; font-size: 11px; color: var(--muted); background: var(--stage); border: 1px solid var(--border); }
  .mp-custom { margin: 0 4px 4px; padding: 9px 10px; text-align: left; border: 1px dashed var(--border); border-radius: 10px; background: transparent; font-size: 12.5px; font-weight: 400; overflow-wrap: anywhere; }
  .mp-custom:hover { background: var(--hover); }
  .model-settings-form .mp-status { padding: 10px 14px; }
  .model-settings-form .mp-hint { padding: 7px 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--subtle); }
  @media (hover: none), (max-width: 640px) { .model-settings-form .mp-hint { display: none; } .mp-option { padding: 11px 10px; } .mp-effort { min-height: 36px; } }
  @media (max-width: 640px) {
    .page-header { flex-direction: column; }
    .header-actions { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 0; gap: 8px; }
    .page-description { max-width: none; }
    .sidebar { background: transparent; }

    .metric-caption { white-space: normal; }
    .fanout-header h2 { font-size: 16px; }
    .fanout-result { padding: 12px; gap: 10px; grid-template-columns: minmax(50px, .7fr) minmax(0, 1.5fr) auto; }
    .fanout-graph { padding-inline: 6px; }
    .fanout-task { padding: 15px; }
    .fanout-duration { font-size: 10px; }
    .plan-status { display: none; }
    .detail-section { padding: 14px; }
    .variant { padding-inline: 10px; }
    .event-time { font-size: 10px; }
    .button, .tab, .variant, .select-field select { min-height: 44px; }
  }
  @media (max-width: 640px) {
    .sidebar-resources { display: none; }
    .header-documentation { display: inline-flex; }
    .activity-list.oa-inset { height: 440px; min-height: 250px; }
    .fanout-surface.oa-inset { height: 396px; }
    .metric-inset { height: 118px; padding: 12px; }
    .metric-label { padding-inline: 12px; }
  }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; } }
}

  #connection-update-preview { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; font-size: 12px; line-height: 1.6; }
