/* ---- Delivery Hub Pipeline control surface — portfolio polish of the real worklist dashboard
   (delivery-pipeline/dashboard/index.html). Same layout and components; neutral greys and hairlines,
   colour reserved for status: green pass · red fail · blue running · amber needs-clarification. */
:root {
  color-scheme: light;
  --bg:       #f6f7f9;
  --surface:  #ffffff;
  --sunk:     #f3f4f6;
  --line:     #e4e6eb;
  --line-2:   #d3d6dd;
  --ink:      #14161a;
  --ink-2:    #3d424b;
  --ink-3:    #6b7280;
  --ink-4:    #9aa0aa;

  --ok:       #15803d;  --ok-bg:   #ecfdf3;  --ok-line:   #b7e4c7;
  --fail:     #c81e3a;  --fail-bg: #fff1f2;  --fail-line: #fbc4cc;
  --run:      #2563eb;  --run-bg:  #eef4ff;  --run-line:  #bfd3fe;
  --warn:     #b45309;  --warn-bg: #fffbeb;  --warn-line: #f8d79a;

  --log-bg:   #0f1218;
  --log-ink:  #d7dbe2;

  --r-sm: 5px; --r: 8px; --r-lg: 12px;
  --sh-1: 0 1px 2px rgba(16,24,40,.05);
  --sh-2: 0 1px 2px rgba(16,24,40,.05), 0 4px 14px rgba(16,24,40,.07);
  --sh-3: 0 12px 40px rgba(16,24,40,.18);

  --sans: Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 14.5px/1.55 var(--sans); margin: 0;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 22px 24px 96px; }
a { color: var(--ink); }
.sub { color: var(--ink-3); font-size: 13px; }
.muted { color: var(--ink-4); font-weight: 500; }
.small { font-size: 12.5px; color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code { font: 500 12px var(--mono); background: var(--sunk); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
:focus-visible { outline: 2px solid var(--run); outline-offset: 2px; border-radius: 4px; }

/* ---- portfolio demo bar ---- */
.demobar { position: fixed; top: 0; left: 0; right: 0; height: 32px; z-index: 50; display: flex; align-items: center; gap: 8px;
  padding: 0 12px; background: #fbfbfa; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.demobar a { color: var(--ink); text-decoration: none; font-weight: 600; }
.demobar a:hover { text-decoration: underline; }
.db-sep { color: var(--ink-4); } .db-spacer { flex: 1; }
.db-title { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.db-note { color: var(--ink-3); }
.db-btn { font: inherit; font-size: 12px; font-weight: 500; border: 1px solid var(--line-2); background: #fff; border-radius: 6px;
  padding: 2px 10px; cursor: pointer; color: var(--ink-2); }
.db-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.tour { position: fixed; top: 42px; right: 12px; z-index: 60; width: 350px; max-width: calc(100vw - 24px); background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); padding: 14px 16px; font-size: 13.5px; }
.tour-step b { display: block; margin-bottom: 4px; }
.tour-step > b:first-child { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.tour-nav { display: flex; gap: 6px; align-items: center; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.tour-nav span { flex: 1; }

/* ---- app header ---- */
.apphead { background: var(--surface); border-bottom: 1px solid var(--line); padding-top: 32px; }
.apphead-in, .apphead .tabs { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.apphead-in { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 28px; padding-top: 22px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { flex: none; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, #23262d, #0d0f13); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), var(--sh-1); }
h1 { font-size: 19px; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; margin: 0 0 2px; }
.h1-sub { font-weight: 500; color: var(--ink-3); }
.brand .sub code { font-size: 11.5px; padding: 0 3px; }

/* stats line (#kpi, rendered by app.js) */
.toc { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--ink-3); }
.stats { display: flex; flex-wrap: wrap; gap: 6px; }
.stat { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); white-space: nowrap; }
.stat b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.stat.attn { border-color: var(--run-line); background: var(--run-bg); color: var(--run); } .stat.attn b { color: var(--run); }
.stat.okk b { color: var(--ok); }
.nowrun { display: flex; gap: 4px 12px; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 12.5px; color: var(--run); font-weight: 500; }
.nowrun .q { color: var(--ink-3); font-family: var(--mono); font-size: 12px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--run); display: inline-block; margin-right: 6px; animation: ring 1.4s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(37,99,235,.45); } 100% { box-shadow: 0 0 0 7px rgba(37,99,235,0); } }

/* ---- tabs ---- */
.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 22px; }
.tab { font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink-3); border: none; background: none; padding: 10px 0 11px;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.tabs-hint { margin-left: auto; font-size: 12.5px; color: var(--ink-3); padding: 8px 0; }
.tabs-hint b { color: var(--ink-2); font-weight: 600; }

/* ---- docker / idea panels ---- */
.panels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin: 0 0 16px; align-items: stretch; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 14px 16px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; min-height: 26px; }
.panel h2 { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin: 0; }
.svcs { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; }
.svc { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; transition: background .2s, box-shadow .2s; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.dot.off { background: var(--ink-4); box-shadow: 0 0 0 3px var(--sunk); }
.port { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.btnrow { display: flex; gap: 6px; flex-wrap: wrap; }
.speed { display: inline-flex; gap: 0; align-items: center; font-size: 11px; color: var(--ink-3); }
.speed-l { text-transform: uppercase; letter-spacing: .06em; margin-right: 8px; font-weight: 500; }
.speed .sp { border-radius: 0; margin-left: -1px; padding: 1px 9px; font-size: 12px; }
.speed .sp:first-of-type { border-radius: 6px 0 0 6px; } .speed .sp:last-of-type { border-radius: 0 6px 6px 0; }
.speed .sp[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; position: relative; z-index: 1; }

/* buttons */
.btn { font: inherit; font-size: 12.5px; font-weight: 500; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  cursor: pointer; padding: 4px 11px; border-radius: 6px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
  line-height: 1.45; box-shadow: var(--sh-1); transition: background .12s, border-color .12s, color .12s, box-shadow .12s; }
.btn:hover { background: var(--sunk); border-color: var(--ink-4); }
.btn:active { box-shadow: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn:disabled:hover { background: var(--surface); border-color: var(--line-2); }
.btn-strong, .btn-go { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.btn-strong:hover, .btn-go:hover { background: #2b2f37; border-color: #2b2f37; }
.btn-ship { border-color: var(--ok); background: var(--ok); color: #fff; font-weight: 600; }
.btn-ship:hover { background: #116632; border-color: #116632; }
.btn-fail { border-color: var(--fail-line); color: var(--fail); font-weight: 600; }
.btn-fail:hover { background: var(--fail-bg); border-color: var(--fail); }
.btn-fail.btn-solid { background: var(--fail); border-color: var(--fail); color: #fff; }
.btn-fail.btn-solid:hover { background: #a8172f; }
.btn-icon { width: 30px; height: 30px; padding: 0; justify-content: center; font-size: 14px; color: var(--ink-3); box-shadow: none; border-color: transparent; background: transparent; }
.btn-icon:hover { color: var(--ink); background: var(--sunk); border-color: var(--line); }
.actions .btn:disabled { color: var(--run); border-color: var(--run-line); background: var(--run-bg); opacity: 1; }
.actions .btn:disabled:hover { background: var(--run-bg); border-color: var(--run-line); }

/* log panel */
pre.log { white-space: pre-wrap; word-break: break-word; background: var(--log-bg); color: var(--log-ink); border: 1px solid #1d222b;
  border-radius: var(--r); padding: 10px 12px; margin: 10px 0 0; max-height: 240px; overflow: auto; font: 11.5px/1.6 var(--mono);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03); scrollbar-color: #39404c transparent; }
pre.log:empty { display: none; }
.l-ts { color: #6c7584; }
.l-ok, .l-ok .l-ts { color: #7ee2a0; } .l-ok .l-ts { opacity: .55; }
.l-fail { color: #ff9aa9; } .l-fail .l-ts { color: #ff9aa9; opacity: .55; }
.l-head { color: #8fb3ff; }
.l-hook, .l-fb { color: #f5c76a; }
.l-add { color: #7ee2a0; } .l-del { color: #ff9aa9; } .l-hunk { color: #8fb3ff; }
.tok { display: inline-block; padding: 0 5px; border-radius: 3px; font-weight: 600; font-size: 10.5px; line-height: 1.5; letter-spacing: .03em; }
.tok-pass { background: rgba(34,197,94,.18); color: #86efac; }
.tok-fail { background: rgba(244,63,94,.2); color: #fda4af; }

#idea textarea, #fail-comment { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 8px 10px; resize: vertical; transition: border-color .12s, box-shadow .12s; }
#idea textarea:focus, #fail-comment:focus { outline: none; border-color: var(--run); box-shadow: 0 0 0 3px var(--run-bg); }
.idea-row { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.idea-row .sub { margin: 0; font-size: 12px; }
.idea-row code { font-size: 11px; }

/* ---- filter bar ---- */
.ctl { position: sticky; top: 32px; background: rgba(246,247,249,.92); -webkit-backdrop-filter: saturate(1.4) blur(8px); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line); padding: 10px 0; margin: 0 0 6px; font-size: 13px; color: var(--ink-2); z-index: 5;
  display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.ctl input[type=search], .ctl select { font: inherit; font-size: 13px; color: var(--ink); border: 1px solid var(--line-2); padding: 5px 9px;
  border-radius: 6px; background: var(--surface); box-shadow: var(--sh-1); }
.ctl input[type=search] { width: 240px; max-width: 100%; }
.ctl label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
input[type=checkbox] { accent-color: var(--ink); width: 14px; height: 14px; margin: 0; }

.group-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-3); margin: 26px 0 10px; }
.group-h .n { font-weight: 600; font-size: 11px; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 7px; letter-spacing: 0; }
.group-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#g-evidence_ready { color: var(--run); }
#g-failed { color: var(--fail); }
.empty { color: var(--ink-3); text-align: center; padding: 40px 0; }

/* ---- ticket card ---- */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1);
  padding: 14px 18px 12px; margin: 0 0 12px; transition: box-shadow .18s, border-color .18s; }
.card:hover { box-shadow: var(--sh-2); border-color: var(--line-2); }
.card.closed { opacity: .62; }
.card.shipped { background: #fcfcfd; }
.card.failed { border-color: var(--fail-line); }
.card.failed::before, .card.running::before { content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--fail); }
.card.done { opacity: .6; background: #fcfcfd; box-shadow: none; }
.card.done .subj { text-decoration: line-through; }
.card.running { border-color: var(--run-line); box-shadow: 0 0 0 3px var(--run-bg), var(--sh-1); }
.card.running::before { background: var(--run); }
.card.arrive { animation: arrive .7s ease-out both; }
@keyframes arrive { from { opacity: 0; transform: translateY(-8px); box-shadow: 0 0 0 3px var(--warn-line); } 60% { box-shadow: 0 0 0 3px var(--warn-line); } to { opacity: 1; transform: none; } }
.doneck { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; color: var(--ink-3); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 7px 1px 5px; cursor: pointer; user-select: none; text-transform: lowercase; }
.doneck:hover { border-color: var(--line-2); color: var(--ink-2); }
.doneck input { margin: 0; }
.chead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 2px; }
.tid { font: 600 13px var(--mono); color: var(--ink-3); }
.subj { font-weight: 600; font-size: 15px; letter-spacing: -.005em; line-height: 1.35; }
.gloss { font-size: 12.5px; color: var(--ink-3); margin: 0 0 8px; }
.meta { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.badge { display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--sunk); color: var(--ink-2); border-radius: 5px;
  padding: 0 7px; font-size: 11px; font-weight: 500; line-height: 19px; white-space: nowrap; }
.badge.b { background: var(--ink); border-color: var(--ink); color: #fff; }
.meta .badge.b { background: var(--surface); border-color: var(--line-2); color: var(--ink); font-weight: 600; }
.badge.ready { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); font-weight: 600; }
.badge.clar { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); font-weight: 600; }
.badge.big { background: var(--fail-bg); border-color: var(--fail-line); color: var(--fail); font-weight: 600; }
.badge.pl { font-family: var(--mono); font-size: 11px; background: var(--surface); }

/* phase strip */
.phase { margin: 10px 0 8px; font: 500 12px var(--sans); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; }
.ph { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 2px 10px 2px 9px; color: var(--ink-4); }
.ph .g { font-size: 11px; line-height: 1; }
.ph.done    { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }
.ph.fail    { border-color: var(--fail-line); background: var(--fail-bg); color: var(--fail); font-weight: 600; }
.ph.running { border-color: var(--run-line); background: var(--run-bg); color: var(--run); font-weight: 600; }
.ph.running .g { font-size: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--run); animation: ring 1.4s ease-out infinite; }
.phsep { width: 14px; height: 1px; background: var(--line-2); font-size: 0; margin: 0 1px; }

.failnote, .infonote { border: 1px solid var(--fail-line); background: var(--fail-bg); border-radius: var(--r); padding: 8px 12px; margin: 8px 0; font-size: 13px; color: #6b1020; }
.failnote b { color: var(--fail); }
.failnote img { display: block; max-width: 220px; border: 1px solid var(--line-2); border-radius: 6px; margin-top: 6px; }
.infonote { border-color: var(--warn-line); background: var(--warn-bg); color: #6b3a06; }

/* gate chips */
.gates { margin: 6px 0; font: 500 11.5px var(--mono); display: flex; flex-wrap: wrap; gap: 4px; }
.gchip { display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; line-height: 19px;
  background: var(--surface); color: var(--ink-4); }
.gchip.pass { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.gchip.fail { color: var(--fail); border-color: var(--fail-line); background: var(--fail-bg); font-weight: 600; }
.gchip.skip { color: var(--ink-4); }
.gchip.run  { color: var(--run); border-color: var(--run-line); background: var(--run-bg); animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 50% { background: #dbe7ff; } }

.lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; margin: 12px 0 5px; font-weight: 600; color: var(--ink-3); }
pre.prompt { white-space: pre-wrap; word-break: break-word; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 12px; margin: 6px 0 0; font: 12.5px/1.55 var(--mono); color: var(--ink-2); max-height: 160px; overflow: auto; }
ol.test { margin: 4px 0 0; padding-left: 20px; } ol.test li { margin: 3px 0; font-size: 13px; color: var(--ink-2); }
.actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
details.fold { margin-top: 8px; border-top: 1px solid var(--line); }
details.fold > summary { cursor: pointer; font-size: 11.5px; font-weight: 500; color: var(--ink-3); padding: 8px 0 0; list-style: none; display: flex; align-items: center; gap: 6px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "›"; font-size: 15px; line-height: 1; transition: transform .15s; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary:hover { color: var(--ink); }

/* ---- modals ---- */
.modal { position: fixed; inset: 0; background: rgba(15,18,24,.45); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); z-index: 70; overflow: auto;
  display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px 24px; animation: fade .15s ease-out; }
.modal .sheet { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3);
  width: 100%; max-width: 860px; max-height: calc(100vh - 96px); overflow: auto; padding: 20px 22px; animation: pop .18s ease-out; }
#fail-modal .sheet { max-width: 560px; }
#modal-close { position: absolute; top: 12px; right: 12px; }
#modal-body h2 { margin: 0 40px 12px 0; font-size: 16px; }
.modal pre { white-space: pre-wrap; word-break: break-word; font: 12.5px/1.6 var(--mono); color: var(--ink-2); background: var(--sunk);
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 0; }
.fail-h { margin: 0; font-size: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fail-ic { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--fail-bg); color: var(--fail); font-size: 13px; }
.failc { color: var(--fail); }
.fail-lead { margin: 4px 0 14px; font-size: 13px; color: var(--ink-3); }
.drop { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 12px; margin: 10px 0; font-size: 12.5px; color: var(--ink-3); text-align: center; background: #fbfbfc; }
.drop input[type=file] { font: inherit; font-size: 12px; max-width: 100%; margin-top: 4px; }
.drop.over { border-color: var(--run); background: var(--run-bg); color: var(--run); }
#fail-preview { max-width: 100%; max-height: 240px; border: 1px solid var(--line-2); border-radius: var(--r); margin-bottom: 10px; display: block; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }

/* ---- evidence drawer ---- */
.scrim { position: fixed; inset: 32px 0 0 0; background: rgba(15,18,24,.32); z-index: 39; animation: fade .15s ease-out; }
.drawer { position: fixed; top: 32px; right: 0; bottom: 0; width: min(780px, 100vw); background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--sh-3); z-index: 40; display: flex; flex-direction: column; animation: slidein .22s cubic-bezier(.2,.8,.2,1); }
@keyframes slidein { from { transform: translateX(40px); opacity: .3; } to { transform: none; opacity: 1; } }
.dr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 10px; }
.dr-head h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.dr-tabs { flex: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 18px 12px; border-bottom: 1px solid var(--line); }
.dr-tabs .btn { box-shadow: none; background: var(--surface); color: var(--ink-2); font-family: var(--mono); font-size: 11.5px; padding: 2px 9px;
  border-radius: 999px; border-color: var(--line); }
.dr-tabs .btn:first-child { font-family: var(--sans); font-weight: 600; font-size: 12px; }
.dr-tabs .btn:hover { color: var(--ink); background: var(--sunk); border-color: var(--line-2); }
.dr-tabs .btn[aria-selected="true"] { color: #fff; background: var(--ink); border-color: var(--ink); }
.dr-tabs .btn .cnt { font-size: 10px; font-weight: 600; color: var(--ink-3); background: var(--sunk); border-radius: 999px; padding: 0 5px; line-height: 15px; font-family: var(--sans); }
.dr-tabs .btn[aria-selected="true"] .cnt { background: rgba(255,255,255,.18); color: #fff; }
.dr-body { flex: 1; overflow: auto; padding: 16px 18px 24px; }
.dr-body pre { white-space: pre-wrap; word-break: break-word; font: 11.5px/1.6 var(--mono); background: var(--log-bg); color: var(--log-ink);
  border-radius: var(--r); padding: 12px 14px; margin: 0; min-height: 120px; }
.dr-body pre.light { background: var(--sunk); color: var(--ink-2); border: 1px solid var(--line); }
.dr-body .small { margin: 0 0 10px; }
.dr-body mark { background: #fff1b8; color: var(--ink); border-radius: 2px; }
pre.card-report { font: 12.5px/1.7 var(--mono); }
.dr-body pre.card-report + .small { margin: 12px 0 0; }
.runs { margin-top: 16px; font-size: 13px; border-collapse: collapse; width: 100%; }
.runs td, .runs th { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
.runs th { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.runs .gchip { font: 500 11px var(--mono); }

/* ---- architecture view ---- */
#view-arch { padding-top: 6px; }
.lead { font-size: 15px; line-height: 1.6; color: var(--ink-2); max-width: 800px; margin: 8px 0 18px; }
.lead b { color: var(--ink); }
.arch-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1);
  padding: 14px; margin: 0 0 8px; }
.arch-hint { display: none; margin: 0 0 18px; text-align: center; font-size: 12px; color: var(--ink-3); }
#arch { width: 100%; min-width: 760px; height: auto; display: block; font-family: var(--mono); }
#arch .an rect { fill: #fff; stroke: var(--line-2); stroke-width: 1.2; transition: stroke .2s, fill .2s; }
#arch .an.human rect { fill: #1b1e24; stroke: #1b1e24; }
#arch .an.human text { fill: #fff; } #arch .an.human .t2 { fill: #b9bec8; }
#arch .an.dashed rect { stroke-dasharray: 5 4; fill: #fbfbfc; }
#arch .an.on rect { stroke: var(--run); stroke-width: 2; }
#arch .an.human.on rect { fill: var(--run); stroke: var(--run); }
#arch .an.human.on .t2 { fill: #dbe7ff; }
#arch #n-gates > rect { fill: #fafbfc; }
#arch .gn rect { fill: #fff; stroke: var(--line); }
#arch .gn.run rect { stroke: var(--run); fill: var(--run-bg); stroke-width: 1.5; }
#arch .gn.pass rect { stroke: var(--ok-line); fill: var(--ok-bg); }
#arch .gn.pass text { fill: var(--ok); }
#arch .gn.fail rect { stroke: var(--fail); fill: var(--fail-bg); stroke-width: 1.5; }
#arch .gn.fail text { fill: var(--fail); }
#arch .an.on:not(.human) > rect { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { fill: var(--run-bg); } }
#arch .host { fill: #fafbfc; stroke: var(--line-2); stroke-dasharray: 3 4; }
#arch .t1 { font: 600 13.5px var(--sans); fill: var(--ink); letter-spacing: -.005em; }
#arch .t2 { font-size: 10.5px; fill: var(--ink-3); }
#arch .t3 { font-size: 10.5px; font-weight: 500; fill: var(--ink-2); }
#arch .t4 { font-size: 10.5px; fill: var(--ink-3); paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
#arch .t5 { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; fill: var(--ink-3); }
#arch .redt { fill: var(--fail); }
#arch .edge { fill: none; stroke: #9aa0aa; stroke-width: 1.3; }
#arch .edge.dash { stroke-dasharray: 4 3; }
#arch .edge.red { stroke: var(--fail); opacity: .8; }
#arch .ah { fill: #9aa0aa; } #arch .ahr { fill: var(--fail); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 18px; }
.h3 { font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; margin: 0 0 8px; }
.tbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; color: var(--ink-2); }
.tbl tr:last-child td { border-bottom: none; }
.tbl td:first-child { font: 500 12px var(--mono); color: var(--ink-3); white-space: nowrap; }
.tbl td:last-child:not(:nth-child(2)) { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.tbl th { white-space: nowrap; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); background: #fafbfc; }
.tbl code { font-size: 11px; }
.cols .small { margin-top: 10px; }

/* ---- toast: bottom-right, auto-dismissed by app.js ---- */
.toast { position: fixed; right: 20px; bottom: 20px; max-width: min(420px, calc(100vw - 32px)); background: #1b1e24; color: #f3f4f6;
  padding: 10px 14px 10px 36px; font-size: 13px; line-height: 1.45; z-index: 80; border-radius: 10px; box-shadow: var(--sh-3);
  animation: toastin .22s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.toast::before { content: ""; position: absolute; left: 14px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: #8fb3ff; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }

/* ---- small screens ---- */
@media (max-width: 900px) {
  .panels { grid-template-columns: 1fr; }
  .apphead-in { align-items: flex-start; }
}
@media (max-width: 760px) {
  .wrap { padding: 16px 16px 72px; }
  .apphead-in, .apphead .tabs { padding-left: 16px; padding-right: 16px; }
  .apphead-in { padding-top: 16px; padding-bottom: 12px; gap: 12px; }
  h1 { font-size: 17px; }
  .h1-sub { display: block; font-size: 13px; }
  .brand { align-items: flex-start; }
  .stat { padding: 2px 8px; font-size: 12px; }
  .db-hide { display: none; }
  .tabs-hint { margin-left: 0; width: 100%; padding: 0 0 10px; }
  .cols { grid-template-columns: 1fr; }
  .panel-h { flex-wrap: wrap; }
  .ctl { position: static; display: grid; grid-template-columns: 1fr 1fr; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .ctl input[type=search] { width: 100%; grid-column: 1 / -1; }
  .ctl select { width: 100%; min-width: 0; }
  .card { padding: 12px 14px 10px; }
  .phase { gap: 4px; font-size: 11.5px; }
  .ph { padding: 1px 7px; gap: 4px; }
  .phsep { display: none; }
  pre.log { font-size: 10.5px; padding: 8px 10px; }
  .runs td, .runs th { padding: 6px 4px; }
  .runs code { font-size: 10.5px; }
  .subj { flex-basis: 100%; }
  .modal { padding: 44px 8px 8px; }
  .modal .sheet { padding: 16px; max-height: calc(100vh - 56px); }
  .dr-head { padding: 12px 14px 8px; }
  .dr-tabs { padding: 2px 14px 10px; }
  .dr-body { padding: 12px 14px 20px; }
  .runs { font-size: 12px; }
  .arch-scroll { padding: 10px; }
  .arch-hint { display: block; }
  .tbl td:last-child:not(:nth-child(2)) { white-space: normal; }
  .toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
