/* Agents. Ported from eng-agents' dashboard.template.html (Dashboard 1.6.1). The colors come from
   shared/themes.css, which this page loads directly; nothing is copied in.
   Editorial, like tools.alexisdavidson.org: serif titles, mono labels, work items on hairlines under an
   ink rule, and boxes only where something needs you (a question, a command to run). */
:root {
  /* State names the page uses: go = moving or approved, gate = needs you, stop = failed, hold = paused. */
  --go: var(--accent); --go-soft: var(--accent-soft); --on-go: var(--on-accent);
  --gate: var(--warn); --gate-soft: var(--warn-soft);
  --stop: var(--danger); --stop-soft: var(--danger-soft);
  --hold: var(--muted); --hold-soft: var(--hover);
  --focus: var(--accent);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14.5px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
code, .mono { font-family: var(--mono); font-size: 0.9em; font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 28px 28px 72px; }

/* ---------- top bar */
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 22px; height: 22px; border-radius: var(--r-sm); background: var(--accent); display: grid; place-items: center; flex: none; }
.logo i { display: block; width: 12px; height: 2px; border-radius: 2px; background: var(--on-accent); box-shadow: 0 4px 0 color-mix(in srgb, var(--on-accent) 75%, transparent), 0 -4px 0 var(--on-accent); }
.top h1 { font: 600 24px/1.1 var(--serif); font-variation-settings: "opsz" 48; margin: 0; letter-spacing: -0.02em; white-space: nowrap; }
.top .ver { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.top .ws { color: var(--eyebrow); font-family: var(--mono); font-size: 12px; letter-spacing: .02em; word-break: break-all; }
.top .fresh { margin-left: auto; color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- layout */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 44px; align-items: start; }
@media (max-width: 1020px) { .grid { grid-template-columns: minmax(0, 1fr); } }
aside { display: grid; gap: 32px; }

/* ---------- pick up here is a card with an ink rule on top; items are rows on hairlines. Both carry a
   3px state bar on the left. */
.pickup, .item { position: relative; }
.pickup::before, .item::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 2px;
  background: var(--state, transparent);
}

/* ---------- pick up here */
.pickup { background: var(--surface); border: 1px solid var(--line); border-top-color: var(--rule); border-radius: 2px 2px var(--r-md) var(--r-md); padding: 22px 24px 20px 26px; margin-bottom: 24px; animation: rise .6s ease-out both; }
.pickup::before { top: 22px; bottom: 22px; left: -1px; }
.pick-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pickup .eyebrow { margin: 0 0 10px; font: 500 11px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--eyebrow); }
.pickup h2 { margin: 0 0 14px; font: 600 clamp(26px, 3vw, 32px)/1.15 var(--serif); font-variation-settings: "opsz" 72; letter-spacing: -0.02em; }
.pickup h2 a { text-decoration: none; }
.pickup h2 .num { color: var(--muted); font-weight: 400; margin-right: 8px; font-family: var(--mono); font-size: .55em; vertical-align: .25em; }
.pickup .track { margin: 6px 0 18px; }
.do {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px;
}
.do .cmd { font-family: var(--mono); font-size: 19px; font-weight: 500; letter-spacing: -0.01em; word-break: break-all; }
.do .act { font-size: 16px; font-weight: 600; }
.do .then { color: var(--muted); font-size: 13.5px; }
.pickup .why { margin: 12px 0 0; color: var(--muted); }
.pickup .why strong { color: var(--ink); font-weight: 600; }

/* ---------- counts */
.counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 34px; padding: 0; list-style: none; }
.counts a {
  display: inline-flex; gap: 8px; align-items: baseline; text-decoration: none; font-weight: 500;
  border: 1px solid var(--line); background: transparent; border-radius: var(--r-sm); padding: 4px 12px; font-size: 13px; color: var(--muted); transition: background-color .2s, color .2s;
}
.counts a:hover { background: var(--surface); color: var(--ink); }
.counts a b { font-family: var(--serif); font-weight: 600; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.counts a[data-b="needs"] b { color: var(--gate); }
.counts a[data-b="ship"] b { color: var(--go); }
.counts a.zero { opacity: .55; }

/* ---------- groups and items */
section.group { margin-bottom: 40px; }
section.group > h3, aside h3 {
  font: 500 11.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--eyebrow);
  margin: 0 0 12px; display: flex; gap: 10px; align-items: center;
}
section.group > h3::after, aside h3::after { content: ""; flex: 1; height: 1px; background: var(--line); order: 9; }
section.group > h3 .n, aside h3 .n { font-family: var(--mono); font-weight: 500; letter-spacing: 0; }
section.group > p.hint { margin: -4px 0 12px; color: var(--muted); font-size: 13px; }
.items { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--rule); }
.item { padding: 18px 8px 16px 20px; border-bottom: 1px solid var(--line); transition: background-color .25s; }
.item:hover { background: var(--surface); }
.item-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.item-head .t { font: 600 20px/1.25 var(--serif); font-variation-settings: "opsz" 32; margin: 0; flex: 1 1 320px; min-width: 0; letter-spacing: -0.012em; }
.item-head .t .num { color: var(--muted); font-weight: 400; margin-right: 8px; font-family: var(--mono); font-size: .62em; vertical-align: .15em; }
.item-head .t a { text-decoration: none; transition: color .2s; }
.item-head .t a:hover { color: var(--accent); }
.meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tag {
  display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 500; padding: 1px 8px; border-radius: 4px;
  background: var(--panel); color: var(--muted); line-height: 1.5;
}
.tag.bug { background: var(--stop-soft); color: var(--stop); }
.tag.feature { background: var(--go-soft); color: var(--ink); }

.next-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0 0; }
.next-line .lbl, .left-off .lbl { font: 500 10.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--eyebrow); min-width: 64px; }
.next-line .cmd { font-family: var(--mono); font-weight: 500; }
.next-line .act { font-weight: 600; }
.next-line .then { color: var(--muted); font-size: 13px; }
.left-off { margin: 8px 0 0; display: flex; gap: 12px; }
.left-off .lbl { padding-top: 3px; }
.left-off .body { min-width: 0; }
.left-off .when { color: var(--muted); font-size: 13px; }
.alert { color: var(--stop); font-weight: 600; }
.held { color: var(--hold); font-weight: 600; }

details { margin-top: 10px; }
details > summary {
  cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 500; list-style: none; display: inline-flex; gap: 6px; align-items: center;
  border-radius: 4px; padding: 1px 4px; margin-left: -4px;
}
details > summary:hover { color: var(--ink); background: var(--panel); }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: 0; height: 0; border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .15s; }
details[open] > summary::before { transform: rotate(90deg); }
.detail-body { margin-top: 8px; display: grid; gap: 12px; }

/* ---------- the track: done stages are checked, the current one is a filled label in the item's
   state color with what is happening under it, later stages are faint with a dashed line */
.track { display: flex; align-items: flex-start; margin: 14px 0 2px; overflow-x: auto; padding: 4px 2px 2px; }
.stop { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 50px; flex: 0 0 auto; }
.stop .dot {
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px dashed color-mix(in srgb, var(--muted) 55%, var(--surface)); background: var(--surface);
}
.stop .dot svg { width: 11px; height: 11px; display: block; }
.stop .name { font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 4px; white-space: nowrap; color: color-mix(in srgb, var(--muted) 75%, var(--surface)); }
.stop .sub { font: 400 10.5px/14px var(--mono); min-height: 14px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stop.done .dot { background: var(--go); border: 0; color: var(--on-go); }
.stop.done .name { color: var(--ink); }
.stop.here .dot { width: 22px; height: 22px; margin: -2px 0; border: 0; background: var(--state); box-shadow: 0 0 0 4px color-mix(in srgb, var(--state) 22%, transparent); }
.stop.here .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--surface); }
.stop.here .name { background: var(--state); color: var(--bg); font-weight: 600; }
.stop.here .sub { color: var(--ink); font-weight: 600; }
.rail { flex: 1 1 24px; min-width: 14px; height: 0; margin-top: 8px; border-top: 2px dashed color-mix(in srgb, var(--muted) 40%, var(--surface)); }
.rail.done { border-top-style: solid; border-color: var(--go); }
.pickup .stop { min-width: 58px; }
.pickup .stop .name { font-size: 12.5px; }

/* ---------- tables */
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th { text-align: left; font: 500 10.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 4px 10px 6px 0; border-bottom: 1px solid var(--line); }
td { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; }
.links { display: flex; gap: 10px; flex-wrap: wrap; white-space: nowrap; }
.flag { display: inline-flex; font-size: 11.5px; font-weight: 500; padding: 0 7px; border-radius: 4px; margin: 1px 4px 1px 0; white-space: nowrap; line-height: 1.6; }
.flag.warn { background: var(--gate-soft); color: var(--gate); }
.flag.bad { background: var(--stop-soft); color: var(--stop); }
.flag.info { background: var(--panel); color: var(--muted); }
.flag.ok { color: var(--muted); padding-left: 0; }
.branch { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.dim { color: var(--muted); }

.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13.5px; }
.tasks li { display: flex; gap: 8px; align-items: baseline; }
.tasks .box { width: 15px; height: 15px; border: 1.5px solid var(--muted); border-radius: 50%; flex: 0 0 15px; position: relative; top: 3px; }
.tasks li.done .box { background: var(--muted); border-color: var(--muted); }
.tasks li.done .box::after { content: ""; position: absolute; left: 4px; top: 1.5px; width: 3.5px; height: 7px; border: solid var(--surface); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
.tasks li.done .tt { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.tasks li.first .tt { font-weight: 600; }
.tasks .rp { color: var(--muted); font-size: 12px; }
.bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; width: 120px; display: inline-block; vertical-align: middle; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

.kit { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; display: grid; gap: 2px; }
.kit-line { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.kit-line code { font-size: 12.5px; word-break: break-all; }
.kit-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.kit-head span { color: var(--muted); font-size: 13px; }
.pre { white-space: pre-wrap; font-size: 13.5px; margin: 0; }
.files { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; font-family: var(--mono); }
.sub-h { font: 500 10.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--eyebrow); margin: 0 0 6px; }

.copy {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 2px 9px; font-size: 12.5px; font-weight: 500; cursor: pointer; color: var(--muted); flex: 0 0 auto; min-height: 26px;
}
.copy:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); }
.copy.ok { color: var(--ink); background: var(--accent-soft); border-color: transparent; }
.do .copy { font-size: 13px; padding: 4px 12px; margin-left: auto; min-height: 32px; }

/* ---------- sidebar */
.panel { background: transparent; border: 0; padding: 0; }
.repo-list { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--rule); }
.repo-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.repo-list .rn { font: 600 16px/1.3 var(--serif); font-variation-settings: "opsz" 24; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.repo-list .rn a { font: 500 12.5px/1.4 var(--sans); color: var(--accent); text-decoration: none; }
.repo-list .rn a:hover { text-decoration: underline; }
.repo-list .lc { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clean-list { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

.timeline { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--rule); }
.day { font: 500 10.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--eyebrow); margin: 14px 0 6px; }
.day:first-child { margin-top: 0; }
.ev { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; padding: 4px 0; font-size: 13.5px; }
.ev .pip { width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin-top: 7px; }
.ev.fail .pip { background: var(--stop); }
.ev.pass .pip { background: var(--go); }
.ev .it { display: block; font-weight: 500; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev a.it:hover { text-decoration: underline; }
.ev .it .num { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-right: 5px; }
.ev .w { display: block; color: var(--muted); font-size: 12.5px; }

/* ---------- PR text (ready to ship) */
.prbox { margin-top: 12px; display: grid; gap: 10px; }
.prbox > .sub-h { margin: 0; }
.pr { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); padding: 10px 12px; display: grid; gap: 10px; min-width: 0; }
.pr-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.pr-head .rn { font-weight: 600; }
.pr-head .row { margin-left: auto; }
.pr-push { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.pr-push code { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1px 7px; word-break: break-all; }
.pr-field { display: grid; gap: 4px; min-width: 0; }
.pr-field .fh { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pr-field .fh .sub-h { margin: 0; }
.pr-title { font-weight: 600; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 10px; overflow-wrap: anywhere; }
.pr-desc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; margin: 0; font: 12.5px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 280px; overflow: auto; }
a.btn { text-decoration: none; }

/* ---------- remove an item */
.btn.remove { min-height: 24px; padding: 0 9px; font-size: 12px; color: var(--muted); border-color: transparent; background: transparent; }
.btn.remove:hover { color: var(--stop); background: var(--stop-soft); }
.btn.destroy { background: var(--stop); border-color: var(--stop); color: var(--surface); }
.btn.destroy:hover { background: color-mix(in srgb, var(--stop) 88%, var(--ink)); }
.btn.destroy:disabled:hover { background: var(--stop); }
.sheet .confirm { display: grid; gap: 6px; margin-top: 14px; font-size: 13.5px; }
.sheet .confirm input { font: inherit; font-family: var(--mono); font-size: 14px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); outline: none; width: min(260px, 100%); }
.sheet .confirm input:focus { border-color: var(--stop); }
.sheet ul.gone { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--ink); }
.sheet ul.gone li { margin: 2px 0; }

.empty { background: transparent; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--line); padding: 40px 22px; text-align: center; color: var(--muted); }
.empty h2 { margin: 0 0 8px; font: 600 26px/1.2 var(--serif); font-variation-settings: "opsz" 48; letter-spacing: -0.015em; color: var(--ink); }
.empty p { margin: 0 0 12px; }
.empty .do { display: inline-flex; }
.note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

/* ---------- buttons, pills, menus (live mode and header) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 3px 12px;
  font-size: 13px; font-weight: 500; cursor: pointer; flex: 0 0 auto; line-height: 1.4; color: var(--ink); white-space: nowrap; transition: background-color .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--hover); border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn.warn { background: var(--gate); border-color: var(--gate); color: var(--surface); }
.btn.warn:hover { background: color-mix(in srgb, var(--gate) 88%, var(--ink)); }
.btn.danger { color: var(--stop); border-color: transparent; background: transparent; }
.btn.danger:hover { background: var(--stop-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:disabled:hover { background: var(--surface); }
.btn.primary:disabled:hover { background: var(--accent); }
.do .btn.primary { font-size: 14px; padding: 5px 16px; min-height: 34px; }
.top .btn { min-height: 28px; padding: 1px 10px; }
.ibtn { width: 30px; height: 30px; border-radius: var(--r-sm); display: inline-grid; place-items: center; color: var(--muted); border: 0; background: transparent; cursor: pointer; flex: none; position: relative; }
.ibtn:hover { background: var(--hover); color: var(--ink); }
.ibtn svg { width: 17px; height: 17px; display: block; }
.pill {
  display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 500; padding: 2px 10px; min-height: 26px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: transparent; color: var(--muted);
}
.pill .led { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.on .led { background: var(--go); }
.pill.off .led { background: var(--stop); }
button.pill { cursor: pointer; }
button.pill:hover { color: var(--ink); background: var(--surface); }
.pill.new { background: var(--accent-soft); border-color: transparent; color: var(--ink); }
.pill.new .led { background: var(--accent); animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .35; } to { opacity: 1; } }
.banner { border: 1px solid color-mix(in srgb, var(--stop) 40%, var(--surface)); border-left: 3px solid var(--stop); background: var(--stop-soft); color: var(--ink); border-radius: 2px var(--r-sm) var(--r-sm) 2px; padding: 10px 14px; margin: 0 0 18px; font-size: 14px; }
.banner code { word-break: break-all; }

.menu {
  position: fixed; z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 4px; min-width: 176px; animation: pop .12s ease;
}
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 6px 10px; border-radius: var(--r-sm); font-size: 13.5px; min-height: 30px; border: 0; background: transparent; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--hover); outline: none; }
.menu button.on { font-weight: 600; }
.menu button.copy { border: 0; background: transparent; color: var(--ink); min-height: 30px; padding: 6px 10px; font-size: 13.5px; font-weight: 400; border-radius: 7px; }
.menu button.copy:hover { background: var(--hover); }
.menu button.copy.ok { background: var(--accent-soft); }
.menu button:disabled { color: var(--muted); cursor: default; }
.menu button:disabled:hover { background: transparent; }
.menu .sep { height: 1px; background: var(--line); margin: 4px 3px; }
.sw { width: 16px; height: 16px; border-radius: 50%; flex: none; border: 1px solid var(--line); position: relative; overflow: hidden; }
.sw i { position: absolute; right: 0; bottom: 0; width: 50%; height: 50%; border-top-left-radius: 100%; }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal .backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 30%, transparent); animation: fade .15s ease; }
.sheet {
  position: relative; width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface);
  border: 1px solid var(--line); border-top-color: var(--rule); border-radius: 2px 2px var(--r-md) var(--r-md); box-shadow: var(--shadow-lg); padding: 20px 22px 18px; animation: pop .16s ease;
}
.sheet h3 { margin: 0; font: 600 22px/1.2 var(--serif); font-variation-settings: "opsz" 48; letter-spacing: -0.015em; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.sheet-head .ibtn { margin-left: auto; }
.sheet p { margin: 6px 0; color: var(--muted); font-size: 13.5px; }
.sheet footer { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.sheet footer .grow { flex: 1; }
.ovr { border: 1px solid color-mix(in srgb, var(--gate) 45%, var(--surface)); background: var(--gate-soft); border-radius: var(--r-sm); padding: 10px 12px; margin-top: 10px; font-size: 13.5px; }
.ovr > p { margin: 0 0 4px; color: var(--ink); }
.ovr details { margin-top: 4px; }
@keyframes pop { from { opacity: 0; transform: scale(.98) translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }

.agent { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); padding: 10px 12px; display: grid; gap: 8px; min-width: 0; }
.agent.busy { border-color: color-mix(in srgb, var(--go) 50%, var(--line)); }
.agent.asking { border-color: var(--gate); }
.auto { margin-top: 10px; border: 1px dashed var(--muted); border-radius: var(--r-sm); padding: 8px 12px; display: grid; gap: 6px; font-size: 13px; min-width: 0; }
.auto.run { border-style: solid; border-width: 1px; border-color: color-mix(in srgb, var(--go) 50%, var(--line)); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.auto.wait { border-style: solid; border-width: 1px; border-color: var(--gate); background: var(--gate-soft); }
.auto-head { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; }
.auto-head .state { font-weight: 600; display: inline-flex; gap: 7px; align-items: center; }
.auto-head .cmdname { font-family: var(--mono); font-size: 12.5px; }
.auto-head .row { margin-left: auto; }
.auto .msg { margin: 0; }
.auto .hist { margin: 4px 0 0; }
.agent-head { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.agent-head .state { font-weight: 600; display: inline-flex; gap: 7px; align-items: center; }
.agent-head .cmdname { font-family: var(--mono); font-size: 12.5px; }
.agent-head .row { margin-left: auto; }
.spin {
  width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px;
  border: 2px solid color-mix(in srgb, var(--go) 30%, transparent); border-top-color: var(--go);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.activity { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.say {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px;
  font: 13.5px/1.5 var(--sans); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow-y: auto; margin: 0;
}
.say-h { font-size: 12px; color: var(--muted); margin: 0 0 -4px; }
.ask { border: 1px solid var(--gate); border-left-width: 3px; background: var(--gate-soft); border-radius: 2px var(--r-sm) var(--r-sm) 2px; padding: 10px 12px; display: grid; gap: 8px; }
.ask .q { font: 600 17px/1.35 var(--serif); font-variation-settings: "opsz" 24; margin: 0; }
.ask .q-h { font: 500 10.5px/1.4 var(--mono); color: var(--gate); text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.ask code { background: var(--surface); padding: 1px 6px; border-radius: 4px; word-break: break-all; }
.ask .opts { display: grid; gap: 4px; }
.ask label { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; cursor: pointer; }
.ask label .d { color: var(--muted); font-size: 12.5px; }
.ask input[type="text"] { font: inherit; font-size: 13.5px; padding: 5px 9px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); width: 100%; outline: none; }
.ask input[type="text"]:focus { border-color: var(--accent); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.reply { display: flex; gap: 8px; align-items: flex-end; }
.reply textarea {
  flex: 1; min-width: 0; min-height: 38px; height: 38px; resize: vertical; font: inherit; font-size: 13.5px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); outline: none;
}
.reply textarea:focus { border-color: var(--accent); }
.err { color: var(--stop); font-size: 13px; margin: 0; }
.waiting { display: grid; gap: 10px; margin: 0 0 18px; }
.waiting .ask { background: var(--surface); }
.hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.hist li { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.hist .ht { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(560px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--r-sm); font-size: 13.5px; box-shadow: var(--shadow-lg); animation: pop .16s ease; }
.toast.bad { background: var(--danger); color: var(--surface); }

@media (max-width: 600px) {
  .wrap { padding: 14px 16px 48px; }
  .top .fresh { margin-left: 0; }
  .agent-head .row { margin-left: 0; }
  .reply { flex-direction: column; align-items: stretch; }
  .do .cmd { font-size: 16px; }
  .pickup { padding: 18px 16px 16px 20px; }
  .pickup h2 { font-size: 23px; }
  .item { padding-left: 16px; }
  .item-head .t { font-size: 18px; }
  .next-line .lbl, .left-off .lbl { min-width: 0; }
  .left-off { flex-direction: column; gap: 0; }
  .stop, .pickup .stop { min-width: 30px; }
  .stop .name, .pickup .stop .name { font-size: 11px; padding: 0 6px; }
  .rail, .pickup .rail { min-width: 8px; }
  .pr-head .row { margin-left: 0; }
  .sheet { padding: 16px; }
}
/* ---------- embedded in a shell: the shell shows the name and owns the theme */
.embed .brand, .standalone .brand { display: none; }
.embed .wrap { padding-top: 28px; }
.picked {
  display: flex; gap: 10px; align-items: baseline; text-decoration: none; min-width: 0;
  border: 1px dashed var(--muted); border-left: 3px solid var(--state); border-radius: 2px var(--r-sm) var(--r-sm) 2px; padding: 10px 14px; font-size: 13.5px; color: var(--ink);
}
.picked:hover { background: var(--surface); }
.picked .num { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.picked .pt { font: 600 16px/1.3 var(--serif); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked .dim { font-size: 12.5px; white-space: nowrap; }
.pickup.flash, .item.flash { box-shadow: 0 0 0 2px var(--accent); transition: box-shadow .3s; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .copy, .btn, .ibtn, .reply { display: none; } body { background: #fff; } }

/* ---------- the setup guide: shown while this page can't reach Workshop (view.js guideHtml) */
.guide { max-width: 720px; margin: 8px auto 48px; animation: rise .6s ease-out both; }
.guide .eyebrow { margin: 0 0 12px; font: 500 11.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--eyebrow); }
.guide > h2 { margin: 0; font: 600 clamp(32px, 4.4vw, 46px)/1.06 var(--serif); font-variation-settings: "opsz" 144; letter-spacing: -0.03em; }
.guide > h2::after { content: "."; color: var(--eyebrow); }
.guide .lede { margin: 14px 0 28px; max-width: 36rem; font: 400 18px/1.55 var(--serif); font-variation-settings: "opsz" 24; color: var(--muted); }
.guide .banner { margin-bottom: 22px; }
.gsteps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.gstep { border-bottom: 1px solid var(--line); }
.ghead { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 4px; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--ink); }
.ghead:hover .gt { color: var(--accent); }
.gnum { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); font: 500 12px/1 var(--mono); color: var(--muted); }
.gnum svg { width: 13px; height: 13px; }
.gstep.open .gnum { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.gstep.done .gnum { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.gt { flex: 1; min-width: 0; font: 600 20px/1.25 var(--serif); font-variation-settings: "opsz" 32; letter-spacing: -0.012em; transition: color .2s; }
.gstep.done:not(.open) .gt { color: var(--muted); }
.gstate { font: 500 10.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.gbody { padding: 0 4px 22px 46px; display: grid; gap: 12px; color: var(--ink); }
.gbody p { margin: 0; }
.gbody a { color: var(--accent); }
.gbody .note { margin: 0; }
.gneed { color: var(--muted); }
.gcmd { padding: 6px 10px; }
.gcmd code { font-size: 12.5px; }
.gos { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); justify-self: start; }
.gos button { border: 0; background: transparent; padding: 4px 12px; border-radius: 4px; font: 500 12.5px var(--sans); color: var(--muted); cursor: pointer; }
.gos button:hover { color: var(--ink); }
.gos button.on { background: var(--ink); color: var(--bg); }
.gsub { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.gsub .gcmd { margin-top: 8px; }
.gcheck { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gcheck label { display: inline-flex; align-items: center; gap: 8px; font: 500 10.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--eyebrow); }
.gcheck input { width: 6.5rem; min-height: 32px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: 13px var(--mono); letter-spacing: 0; }
.gacts { display: flex; gap: 8px; flex-wrap: wrap; }
.gmsg { font-size: 13.5px; color: var(--muted); }
.gmsg:empty { display: none; }
.gmsg.ok { color: var(--accent); font-weight: 500; }
.gmsg.bad { color: var(--stop); }
@media (max-width: 600px) { .gbody { padding-left: 4px; } .guide > h2 { font-size: 30px; } .guide .lede { font-size: 16.5px; } }

/* ---------- Workshop additions */
.lnk { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 2px; }
.lnk:hover { text-decoration-color: currentColor; }
.lnk.plain { text-transform: none; letter-spacing: 0; font-weight: 500; }
.files .lnk { font-family: var(--mono); }
.sheet.wide { width: min(860px, 100%); }
.sheet h3 code { font-size: 14px; word-break: break-all; }
.filetext { margin: 10px 0 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; font: 12.5px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: calc(100vh - 220px); overflow: auto; }
.setup { max-width: 620px; margin: 48px auto; background: var(--surface); border: 1px solid var(--line); border-top-color: var(--rule); border-radius: 2px 2px var(--r-md) var(--r-md); padding: 24px 26px; }
.setup h2 { margin: 0 0 8px; font: 600 26px/1.2 var(--serif); font-variation-settings: "opsz" 48; letter-spacing: -0.015em; }
.setup p { margin: 6px 0; color: var(--muted); }
.setup .acts { margin-top: 14px; display: flex; justify-content: flex-end; }
.menu .hint { color: var(--muted); font-size: 12px; }
