/* Vendored verbatim from the Chief design project.
   Do not hand-tune: re-sync from the design project instead, and keep page-specific
   corrections in landing.css so this stays diffable against the source. */
/* Chief revamp — shared structural restyle ("precise engineering tool").
   Direction files (revamp-a/b/c.css) set the tokens; this file is the chrome:
   IDE-style seams, text status badges, mono details, slightly rounded nodes. */

.shell {
  /* tokens are set by the direction file on .shell / .shell.dark */
  background: var(--bg); color: var(--ink);
  font-family: var(--font-ui); font-size: 14px; line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column;
}
.shell *, .shell *::before, .shell *::after { box-sizing: border-box; }
.shell h4 { font-family: var(--font-ui); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; line-height: 1.15; margin: 0; }
.shell a { color: var(--accent-ink); text-underline-offset: 3px; }
.shell a:hover { color: var(--accent); }
.shell .mono { font-family: var(--font-mono); }
.shell .text-muted { color: var(--muted); }
.shell ::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
@keyframes chiefpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* — status badge: uppercase mono text, tinted, replaces colored dots — */
.badge {
  display: inline-flex; align-items: center; flex: none;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; line-height: 1;
  padding: 3px 6px; border-radius: calc(var(--radius) - 2px);
  color: var(--badge-c, var(--muted));
  background: color-mix(in srgb, var(--badge-c, var(--muted)) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--badge-c, var(--muted)) 28%, transparent);
  white-space: nowrap;
}
.badge.pulse { animation: chiefpulse 1.6s infinite; }
.badge.b-ok { --badge-c: var(--ok); }
.badge.b-warn { --badge-c: var(--warn); }
.badge.b-bad { --badge-c: var(--bad); }
.badge.b-acc { --badge-c: var(--accent-ink); }
.badge.b-dim { --badge-c: var(--muted); }

/* — nav: a toolbar with a seam under it — */
.nav {
  display: flex; align-items: center; gap: 20px;
  padding: 10px 20px; position: sticky; top: 0; z-index: 15;
  background: var(--surface); border-bottom: 1px solid var(--seam);
}
.nav-brand {
  font-weight: 650; font-size: 14px; letter-spacing: 0.01em; margin-right: auto;
  display: inline-flex; align-items: center; gap: 8px;
}
.nav-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.nav a { color: var(--muted); text-decoration: none; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 0; border-bottom: 2px solid transparent; margin-bottom: -11px; padding-bottom: 11px; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tag-accent {
  font-family: var(--font-mono); font-size: 10px; padding: 1px 6px;
  border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink);
}

/* — layout — */
main { width: 100%; padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; }
main.narrow { max-width: 780px; }
main.wide { max-width: 1280px; padding-top: 16px; }
main.wide.graph { max-width: none; }
.screen-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.accent-note { font-size: 12px; color: var(--accent-ink); border-left: 2px solid var(--accent); padding-left: 10px; }

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none; font-family: var(--font-ui); font-weight: 550;
  font-size: 13px; line-height: 1.2; color: var(--ink);
  background: var(--surface); border: 1px solid var(--seam-strong);
  padding: 6px 12px; border-radius: var(--radius);
  box-shadow: var(--shadow-btn);
}
.btn-primary { color: var(--accent-contrast); background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--accent-ink); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-sm { font-size: 12px; padding: 4px 10px; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 8%, transparent); border-color: var(--bad); }
.row-del { flex: none; border: 0; background: none; cursor: pointer; padding: 2px 6px; border-radius: calc(var(--radius) - 2px); color: var(--muted); font-size: 12px; line-height: 1; opacity: 0; }
.run-row:hover .row-del { opacity: 1; }
.row-del:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.confirm-pop { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--seam-strong)); box-shadow: var(--shadow-card); max-width: 380px; }
.confirm-pop p { margin: 0; font-size: 13px; line-height: 1.45; }

/* — cards: kept shadows, seam ring — */
.card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--seam);
  box-shadow: var(--shadow-card);
}
.card-kicker {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent-ink);
}
.section-label {
  font-family: var(--font-mono); font-size: 10px; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.close-x { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 12px; padding: 2px 4px; }

/* — list: ruled rows on the surface, IDE table — */
.list-wrap { background: var(--surface); border: 1px solid var(--seam); border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden; }
.run-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 12px; border: 0; border-top: 1px solid var(--seam);
  background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.run-row:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.run-row .title { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 13.5px; }
.run-row .id { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.run-row .status { flex: none; width: 128px; }
.run-row .when { flex: none; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); width: 64px; text-align: right; }
.run-row .stamp, .run-row .dur { flex: none; text-align: right; white-space: nowrap; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.run-row .stamp { width: 112px; }
.run-row .dur { width: 64px; }
.list-head { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: color-mix(in srgb, var(--ink) 3%, transparent); }
.col-head {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap;
}
.col-head:hover { color: var(--ink); }
.col-head.on { color: var(--accent-ink); }
.col-head.title { flex: 1; min-width: 0; text-align: left; }
.col-head.status { flex: none; width: 128px; text-align: left; }
.col-head.when { flex: none; width: 64px; text-align: right; }
.col-head.stamp { flex: none; width: 112px; text-align: right; }
.col-head.dur { flex: none; width: 64px; text-align: right; }

/* — chips + search — */
.list-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  font: inherit; font-size: 12px; font-family: var(--font-mono); padding: 3px 10px; cursor: pointer;
  color: var(--muted); background: transparent; border: 1px solid var(--seam-strong); border-radius: var(--radius);
}
.chip:hover { color: var(--ink); }
.chip.on { color: var(--accent-ink); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.field-search {
  flex: 1; min-width: 180px; font: inherit; font-size: 13px; padding: 5px 10px;
  color: var(--ink); caret-color: var(--accent); background: var(--surface);
  border: 1px solid var(--seam-strong); border-radius: var(--radius);
}
.field-search:focus-visible { outline: none; border-color: var(--accent); }

/* — graph — */
.graph-split { display: flex; gap: 0; align-items: flex-start; }
.graph-viewport { flex: 1; min-width: 0; overflow: hidden; }
.graph-plane { position: relative; transform-origin: top left; }
.graph-plane svg { position: absolute; inset: 0; overflow: visible; }
.node {
  position: absolute; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border-radius: var(--radius);
  cursor: pointer; border: 1px solid var(--seam-strong);
  box-shadow: var(--shadow-card); box-sizing: border-box; overflow: hidden;
}
.node:hover { border-color: var(--muted); }
.node.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-card); }
.node.pend { border-style: dashed; border-color: var(--accent); }
.node.fail { border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.node.ghost { border: 1px dashed var(--accent); opacity: 0.93; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.node-head { display: flex; align-items: flex-start; gap: 7px; min-width: 0; }
.node-head .badge { margin-top: 1px; }
.node-goal { flex: 1; min-width: 0; font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.node-goal.dimmed { color: var(--muted); }
.node-goal.ghosted { color: var(--accent-ink); }
.node-cluster { display: inline-flex; align-items: center; gap: 3px; margin-left: 10px; }
.node-cluster i { width: 5px; height: 5px; border-radius: 1.5px; display: inline-block; }
.node-cluster .label { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-left: 4px; }
.node.gate {
  border-style: dashed; border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; padding: 0 10px;
  box-shadow: none;
}
.gate-label { font-family: var(--font-mono); font-size: 10px; color: var(--accent-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-arts { position: absolute; bottom: 6px; right: 9px; font-family: var(--font-mono); font-size: 10px; color: var(--muted); white-space: nowrap; }
.node-tag {
  position: absolute; top: -10px; right: 8px; background: var(--surface);
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 99px;
  white-space: nowrap; cursor: pointer; border: 1px dashed var(--accent); color: var(--accent-ink);
  animation: chiefpulse 1.8s infinite;
}
.node-tag.ghost { animation: none; cursor: default; }

/* — split handle: a visible gutter seam — */
.split-handle { flex: none; width: 17px; align-self: stretch; min-height: 120px; cursor: col-resize; position: relative; border: 0; background: none; padding: 0; }
.split-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 8px; width: 1px; background: var(--seam-strong); }
.split-handle:hover::before { background: var(--accent); width: 2px; left: 7px; }

/* — inspector — */
.inspector { flex: none; width: 360px; position: sticky; top: 64px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 96px); overflow-y: auto; padding-left: 16px; }

/* — amendment ops — */
.op { display: flex; gap: 8px; align-items: baseline; font-size: 12px; }
.op-badge { flex: none; font-family: var(--font-mono); font-size: 10.5px; border-radius: calc(var(--radius) - 2px); padding: 0 6px; }
.op-lines { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.op-text { color: var(--ink); }
.op-was { color: var(--muted); text-decoration: line-through; }
.op-now { color: var(--accent-ink); }
.op-note { color: var(--muted); font-size: 11px; }

/* — artifacts — */
.art-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.art-icon { flex: none; font-size: 12px; color: var(--accent-ink); }
.art-label { flex: 1; min-width: 0; font-size: 12px; color: var(--ink); line-height: 1.4; overflow-wrap: anywhere; }
.art-meta { flex: none; font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.art-md { display: flex; flex-direction: column; gap: 4px; border-left: 2px solid var(--seam-strong); padding-left: 10px; }
.md-block, .art-md { font-size: 12px; line-height: 1.5; color: color-mix(in srgb, var(--ink) 82%, transparent); }
.md-h { font-size: 12px; font-weight: 600; color: var(--ink); margin: 0 0 2px; }
.md-p { margin: 0 0 6px; }
.md-list { margin: 0; padding-left: 16px; }
.md-list li { margin: 2px 0; }
.art-path { display: flex; align-items: flex-start; gap: 4px; min-width: 0; }
.art-href { flex: 1; min-width: 0; font-size: 11px; font-family: var(--font-mono); color: var(--muted); word-break: break-all; }
.art-copy { flex: none; border: none; background: none; cursor: pointer; padding: 0 2px; font-size: 11px; color: var(--muted); }
.art-copy:hover { color: var(--accent-ink); }
.art-root { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 2px; }
.art-root-label { flex: 1; font-size: 11px; color: var(--muted); }
.cmt-add { align-self: flex-start; padding: 0; border: none; background: none; cursor: pointer; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.cmt-add:hover { color: var(--accent-ink); }

/* — file viewer drawer — */
.viewer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; display: flex; }
.viewer-grip { flex: none; width: 6px; cursor: col-resize; background: transparent; border-left: 1px solid var(--seam-strong); }
.viewer-grip:hover { border-left: 2px solid var(--accent); }
.viewer-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--surface); box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08); }
.viewer-head { display: flex; align-items: baseline; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--seam); }
.viewer-title { font-weight: 600; font-size: 13px; }
.viewer-ref { font-size: 11px; color: var(--muted); }
.viewer-body { flex: 1; overflow: auto; padding: 16px; }
.viewer-doc { max-width: 640px; }

/* — workflow header extras — */
.wf-project { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.wf-origin { font-family: var(--font-mono); font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
