/* Control panel styles. Light and dark are both first-class: every colour is a
   token on :root, redefined once under prefers-color-scheme.

   Dense on purpose: these are working pages people come back to every day, so
   spacing is kept tight and text short, and nothing is a card that a line would do. */

:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #f9fafb;
  --ink: #171a1f;
  --ink-2: #5b6472;
  --line: #e1e5ea;
  --line-2: #eef1f4;
  --accent: #3068d6;
  --accent-ink: #ffffff;
  --accent-soft: #e8effc;
  --ok: #0b7a48;
  --ok-bg: #e8f6ee;
  --warn: #92601c;
  --warn-bg: #fdf3e2;
  --bad: #c0341d;
  --bad-bg: #fdeeea;
  --code-bg: #14171b;
  --code-ink: #dfe4ea;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --r: 9px;
  --sidebar: 210px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --panel: #171b21;
    --panel-2: #1c2129;
    --ink: #e7ebf0;
    --ink-2: #97a1b0;
    --line: #262d36;
    --line-2: #1f252d;
    --accent: #5b8def;
    --accent-ink: #0b0e12;
    --accent-soft: #1a2639;
    --ok: #4ac07f;
    --ok-bg: #10241a;
    --warn: #d9a441;
    --warn-bg: #2a2113;
    --bad: #f0705a;
    --bad-bg: #2b1613;
    --code-bg: #0b0e12;
    --code-ink: #cdd5e0;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
/* Several components below set an explicit `display`, which outranks the user
   agent's rule for [hidden] and leaves elements the scripts hid still on the
   page. Say it once, forcefully, rather than remembering it per component. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 13.5px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ------------------------------------------------------------------ layout */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar);
  background: var(--panel); border-right: 1px solid var(--line);
  padding: 14px 10px; display: flex; flex-direction: column; gap: 1px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px 12px; }
.brand-mark {
  width: 24px; height: 24px; border-radius: 7px; flex: 0 0 24px;
  background: linear-gradient(135deg, #fb4c2f 0%, #8e63ce 50%, #3068d6 100%);
}
.brand strong { display: block; font-size: 13.5px; letter-spacing: -.01em; }
.brand small { display: block; color: var(--ink-2); font-size: 11px; }
.nav-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-2); padding: 12px 10px 3px;
}
.sidebar nav a {
  display: flex; align-items: center; gap: 8px;
  color: var(--ink); text-decoration: none; padding: 6px 10px;
  border-radius: 7px; font-size: 13px; min-width: 0;
}
.sidebar nav a:hover { background: var(--line-2); }
.sidebar nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.sidebar nav a[aria-current="page"] .dot { box-shadow: 0 0 0 2px var(--accent-ink); }
/* Your agents, listed under "Agents". The one you are in is marked, and its
   pages are tabs at the top of the page rather than a tree here. */
.sidebar nav a.nav-agent { padding-left: 14px; font-size: 12.5px; }
.sidebar nav a.nav-agent span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar nav a.nav-agent.here:not([aria-current]) { background: var(--accent-soft); }
.sidebar nav a.nav-new { padding-left: 14px; font-size: 12.5px; color: var(--ink-2); }
.sidebar nav a.nav-new:hover { color: var(--ink); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; background: var(--line); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.sidebar-foot { margin-top: auto; padding: 8px 4px 0; }
.sidebar-foot .muted { font-size: 11px; }

main { flex: 1; min-width: 0; padding: 20px 28px 56px; }
.page { max-width: 1120px; }
.page-head { margin-bottom: 14px; }
.page-head.with-actions { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.page-head.with-actions > :first-child { flex: 1; min-width: 240px; }
h1 { font-size: 19px; margin: 0 0 2px; letter-spacing: -.015em; }
h2 { font-size: 14.5px; margin: 20px 0 8px; }
h3 { font-size: 11.5px; margin: 0 0 8px; text-transform: uppercase;
     letter-spacing: .05em; color: var(--ink-2); }
.lede { color: var(--ink-2); margin: 0; max-width: 80ch; }
.muted { color: var(--ink-2); font-size: 12.5px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card.tight { padding: 10px 12px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-head h3 { margin: 0; flex: 1; }
.card-head a { font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .card, .grid-2 + .grid-2, .card + .grid-2 { margin-top: 12px; }
/* A long path or URL wraps inside its column instead of widening it. */
.grid-2 > * { min-width: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > .grow { flex: 1 1 220px; min-width: 0; }
.spacer { flex: 1 1 auto; }
hr.rule { border: 0; border-top: 1px solid var(--line-2); margin: 12px 0; }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  main { padding: 16px 16px 48px; }
  .sidebar { position: static; height: auto; }
}
@media (max-width: 700px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; border-right: 0; border-bottom: 1px solid var(--line);
             padding: 10px 12px; }
  .brand { padding-bottom: 8px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav-label, .sidebar-foot { display: none; }
  .sidebar nav a.nav-agent, .sidebar nav a.nav-new { padding-left: 10px; }
}

/* ------------------------------------------------------------ agent header */
/* Every page of one agent starts the same way: its name, how it stands, the
   quick actions, and its pages as tabs. */
.agent-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.agent-head-main { flex: 1; min-width: 220px; }
.agent-name-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.agent-name { font-size: 20px; font-weight: 650; letter-spacing: -.015em; margin: 0;
              line-height: 1.3; overflow-wrap: anywhere; }
.agent-sub { color: var(--ink-2); font-size: 12.5px; }
.agent-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agent-actions form { margin: 0; }
.tabs {
  display: flex; gap: 1px; border-bottom: 1px solid var(--line); margin: 0 0 16px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 7px 11px 8px; font-size: 13px; color: var(--ink-2); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .tab-gap { flex: 0 0 1px; background: var(--line); margin: 9px 5px; }
.tabs .count {
  font-size: 10.5px; font-weight: 600; padding: 0 6px; border-radius: 10px;
  background: var(--line-2); color: var(--ink-2);
}
/* On an agent's own pages, the page's title is a heading under the tabs. */
.in-agent .page-head { margin-bottom: 12px; }
.in-agent .page-head h1 { font-size: 15.5px; }
.in-agent .page-head .lede { font-size: 12.5px; }

/* ------------------------------------------------------------- agent list */
.agent-list { padding: 0; overflow: hidden; }
.agent-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px) auto;
  gap: 14px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line-2);
}
.agent-row:last-child { border-bottom: 0; }
.agent-row:hover { background: var(--panel-2); }
.agent-row-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agent-row-name a { font-weight: 600; font-size: 14px; color: var(--ink); text-decoration: none; }
.agent-row-name a:hover { color: var(--accent); }
.agent-row .meta { color: var(--ink-2); font-size: 12px; margin: 1px 0 0;
                   overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-row-last { font-size: 12px; color: var(--ink-2); min-width: 0; }
.agent-row-last .outcome { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-row-actions { display: flex; gap: 6px; }
.agent-row-actions form { margin: 0; }
@media (max-width: 700px) {
  .agent-row { grid-template-columns: 1fr; gap: 6px; }
}

/* ------------------------------------------------------------- kind picker */
.kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 10px; }
.kind {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel); color: var(--ink); font-size: 13px; font-weight: 400;
}
.kind:hover { border-color: var(--ink-2); }
.kind:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.kind input { width: auto; margin: 3px 0 0; accent-color: var(--accent); }
.kind strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.kind .kind-text { color: var(--ink-2); font-size: 12.5px; display: block; }
.kind .needs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }

/* ------------------------------------------------------------------ checks */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li {
  display: flex; align-items: baseline; gap: 9px;
  padding: 5px 0; border-bottom: 1px solid var(--line-2);
}
.checks li:last-child { border-bottom: 0; }
.checks .name { font-weight: 550; min-width: 120px; }
.checks .detail { color: var(--ink-2); font-size: 12.5px; min-width: 0; overflow-wrap: anywhere; }
.checks .dot { align-self: center; }
.stats { display: flex; gap: 22px; flex-wrap: wrap; }
.stat b { display: block; font-size: 20px; letter-spacing: -.02em; line-height: 1.25; }
.stat span { color: var(--ink-2); font-size: 11.5px; }

/* ---------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid transparent; border-radius: 7px;
  padding: 7px 13px; font: inherit; font-size: 13px; font-weight: 550; line-height: 1.3;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { background: var(--line-2); filter: none; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small-btn, .btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
label { display: block; font-size: 12px; color: var(--ink-2); font-weight: 550; }
input[type=text], input[type=number], input[type=password], input[type=email], select, textarea {
  width: 100%; padding: 7px 9px; margin-top: 3px;
  border: 1px solid var(--line); border-radius: 7px;
  font: inherit; font-size: 13px; background: var(--panel-2); color: var(--ink);
}
input:hover, select:hover { border-color: var(--ink-2); }
input.tiny { width: 62px; }
input.small { width: 96px; }
.check { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink); font-weight: 400; }
.check input { width: auto; margin: 0; accent-color: var(--accent); }
.field { margin-bottom: 12px; }
.field .hint { color: var(--ink-2); font-size: 11.5px; margin-top: 3px; font-weight: 400; }
fieldset { border: 0; margin: 0; padding: 0; }
details.fold { border-top: 1px solid var(--line-2); }
details.fold:first-of-type { border-top: 0; }
details.fold > summary {
  cursor: pointer; padding: 9px 0; list-style: none; display: flex; align-items: center; gap: 8px;
  font-weight: 550;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before {
  content: "▸"; color: var(--ink-2); font-size: 11px; width: 10px; transition: transform .1s;
}
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary .muted { font-weight: 400; }
details.fold > .fold-body { padding: 0 0 12px 18px; }

/* ------------------------------------------------------- schedule modes */
.modes { display: flex; flex-direction: column; gap: 4px; }
.mode {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px;
  cursor: pointer; font-size: 13px; color: var(--ink); font-weight: 400;
}
.mode:hover { border-color: var(--ink-2); }
.mode input { width: auto; margin: 2px 0 0; accent-color: var(--accent); }
.mode strong { display: block; font-weight: 550; }
.mode small { color: var(--ink-2); font-size: 11.5px; }
.mode:has(input:checked) { border-color: var(--accent); background: var(--panel-2); }
.mode-fields { padding: 2px 11px 8px 31px; }
.mode-fields:empty { display: none; }
.mode-fields[hidden] { display: none; }

/* ------------------------------------------------------------------- flash */
.flash {
  border-radius: var(--r); padding: 9px 13px; margin-bottom: 12px;
  border: 1px solid; font-size: 13px;
}
.flash.ok   { background: var(--ok-bg);   border-color: var(--ok);   color: var(--ok); }
.flash.warn { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.flash.bad  { background: var(--bad-bg);  border-color: var(--bad);  color: var(--bad); }
.flash a, .flash .linkbtn { color: inherit; font-weight: 600; }
.flash pre { margin: 6px 0 0; white-space: pre-wrap; font-size: 12px; }
.badge {
  display: inline-block; font-size: 10.5px; font-weight: 600; padding: 2px 7px;
  border-radius: 20px; letter-spacing: .02em; white-space: nowrap;
  background: var(--line-2); color: var(--ink-2);
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }

/* ------------------------------------------------------------------ tables */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-2); font-weight: 600;
  padding: 6px 8px; border-bottom: 1px solid var(--line);
}
td { padding: 6px 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td form { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
td code { color: var(--ink-2); }
code.secret {
  font-size: 13px; padding: 2px 7px; border-radius: 5px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); user-select: all;
}
.chip {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.scroll-x { overflow-x: auto; }

/* -------------------------------------------------------------- swatches */
.swatch-group { display: flex; gap: 4px; align-items: center; }
.swatch {
  width: 20px; height: 20px; border-radius: 5px; cursor: pointer;
  border: 2px solid transparent; padding: 0; flex: 0 0 20px;
}
.swatch[aria-pressed="true"] { border-color: var(--ink); }
.swatch-pop {
  display: none; position: absolute; z-index: 40; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r); padding: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.16); width: 268px;
}
.swatch-pop.open { display: block; }
.swatch-pop .swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.swatch-pop h4 { margin: 0 0 7px; font-size: 11px; color: var(--ink-2); font-weight: 600; }
.swatch-pop h4 + .swatches { margin-bottom: 10px; }
.color-cell { position: relative; }
.color-trigger {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 4px 8px; font: inherit; font-size: 11.5px; color: var(--ink);
}
.color-preview { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 14px; }

/* ---------------------------------------------------------------- ruleflow */
.rulelist { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rulelist li {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px; border-bottom: 1px solid var(--line-2); font-size: 13px;
}
.rulelist li:last-child { border-bottom: 0; }
.rulepos {
  color: var(--ink-2); font-size: 11px; min-width: 20px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.rulename { flex: 1; min-width: 0; }
.tagset { display: flex; gap: 4px; flex-wrap: wrap; }
.tag {
  font-size: 10px; padding: 1px 6px; border-radius: 4px;
  background: var(--line-2); color: var(--ink-2); font-weight: 600; white-space: nowrap;
}

/* -------------------------------------------------------------------- code */
.console, .brief-text, textarea.code {
  background: var(--code-bg); color: var(--code-ink); border-radius: 7px;
  padding: 12px 14px; margin: 0;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: auto; white-space: pre-wrap; word-break: break-word;
}
.console { max-height: 380px; min-height: 120px; }
.console.tall { max-height: 640px; }
.console:empty::before { content: "Nothing yet."; color: var(--ink-2); }
.brief-text { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line);
              max-height: 340px; }
textarea.code { height: 500px; white-space: pre; resize: vertical; width: 100%; }
.empty {
  text-align: center; padding: 20px 16px; color: var(--ink-2); font-size: 13px;
  border: 1px dashed var(--line); border-radius: var(--r);
}
.run-status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-2);
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: 0 0 8px;
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
kbd {
  font: 11px ui-monospace, Menlo, monospace; background: var(--line-2);
  border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 5px; color: var(--ink-2);
}

/* ------------------------------------------------------------------ ai mode */
.examples { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.examples li { padding: 2px 0; }
.thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.turn {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow);
}
.said + .said { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.said p { margin: 3px 0 0; white-space: pre-wrap; }
.said.agent p { color: var(--ink); }
.said p.err { color: var(--bad); }
.who {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-2);
}
.who.bot { color: var(--accent); }
.who small { font-weight: 400; letter-spacing: 0; text-transform: none; }
.change {
  margin-top: 10px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--panel-2); padding: 10px 12px;
}
.change.done { border-color: var(--ok); background: var(--ok-bg); }
.change.void { opacity: .6; }
.change-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.change-head strong { font-size: 12px; flex: 1; }
.change.done .change-head strong { color: var(--ok); }
.inline { display: inline; }
.ops { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); }
.ops li { padding: 1px 0; }
.change details { margin-top: 8px; }
.change summary, details > summary.small {
  cursor: pointer; font-size: 11px; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .05em;
}
pre.diff {
  margin: 8px 0 0; padding: 10px 12px; border-radius: 7px; max-height: 420px;
  background: var(--code-bg); color: var(--code-ink); overflow: auto;
  font: 11.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}
pre.diff span { display: block; white-space: pre; }
pre.diff .add { color: #6fd08c; }
pre.diff .del { color: #f0705a; }
pre.diff .hunk { color: #8aa0bd; }
.ask label { margin-bottom: 2px; }
.ask textarea { resize: vertical; min-height: 58px; }
.thinking .btn { pointer-events: none; opacity: .5; }

/* ===================================================================
   Platform pages: signed-out pages, run results,
   connections, and the operator's views. Everything below reuses the tokens above, so light and dark
   stay in step.
   =================================================================== */

/* ---------------------------------------------------------- signed out */
.centred {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 28px 16px; background: var(--bg);
}
.auth-card {
  width: 100%; max-width: 390px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 24px 24px 20px;
  box-shadow: var(--shadow);
}
.auth-card .brand { padding: 0 0 16px; }
.auth-card h1 { font-size: 18px; margin-bottom: 3px; }
.auth-card .lede { font-size: 13px; margin-bottom: 16px; }
.auth-card .field:last-of-type { margin-bottom: 16px; }
.auth-card .btn { width: 100%; }
.auth-foot {
  margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line-2);
  font-size: 12.5px; color: var(--ink-2); text-align: center;
}

.landing { max-width: 760px; margin: 0 auto; padding: 48px 20px 72px; }
.landing h1 { font-size: 28px; line-height: 1.2; margin-bottom: 10px; }
.landing .lede { font-size: 15px; margin-bottom: 22px; }
.landing .btn-row { margin-bottom: 36px; }
.landing .btn { padding: 9px 18px; font-size: 14px; }
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 22px; }
.feature h3 { margin-bottom: 4px; color: var(--ink); text-transform: none;
              font-size: 14px; letter-spacing: 0; }
.feature p { margin: 0; color: var(--ink-2); font-size: 13px; }
@media (max-width: 640px) { .feature-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ view switch */
/* Full or simple, on this machine only (core/modes.py). */
.view-switch {
  display: flex; align-items: center; gap: 2px; margin: 0 6px 10px; padding: 3px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2);
}
.view-switch-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-2); padding: 0 6px 0 5px;
}
.view-switch button {
  flex: 1; border: 1px solid transparent; background: none; font: inherit; font-size: 12px;
  padding: 2px 8px; border-radius: 6px; color: var(--ink-2); cursor: pointer;
}
.view-switch button:hover { color: var(--ink); }
.view-switch button[aria-pressed="true"] {
  background: var(--panel); border-color: var(--line); color: var(--ink); font-weight: 600;
}

.account-strip {
  display: flex; align-items: center; gap: 8px; padding: 10px 6px 0;
  border-top: 1px solid var(--line); margin-top: 8px; font-size: 12px;
}
.account-strip .who-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--ink-2);
}
.linkbtn {
  background: none; border: 0; padding: 0; font: inherit; font-size: 12px;
  color: var(--accent); cursor: pointer; text-decoration: underline;
}

/* ------------------------------------------------------------ agent cards */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.agent-card { display: flex; flex-direction: column; gap: 8px; }
.agent-card h3 { text-transform: none; letter-spacing: 0; font-size: 14.5px;
                 color: var(--ink); margin: 0; }
.agent-card .meta { color: var(--ink-2); font-size: 12.5px; margin: 0; }

/* --------------------------------------------------------------- progress */
.progress {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2);
}
.progress .phase { font-size: 13px; font-weight: 550; }
.progress .elapsed { margin-left: auto; color: var(--ink-2); font-size: 12px;
                     font-variant-numeric: tabular-nums; }
.bar { height: 4px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar span {
  display: block; height: 100%; width: 30%; border-radius: 3px;
  background: var(--accent); animation: slide 1.4s ease-in-out infinite;
}
@keyframes slide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .bar span { animation: none; width: 100%; } }

.result-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.result-head .stats { flex: 1; }
.note {
  border-left: 3px solid var(--warn); background: var(--warn-bg); color: var(--warn);
  padding: 8px 11px; border-radius: 0 7px 7px 0; font-size: 12.5px; margin-bottom: 8px;
}
.imp {
  display: inline-block; min-width: 20px; text-align: center; font-weight: 600;
  font-size: 11px; padding: 2px 6px; border-radius: 5px;
  background: var(--line-2); color: var(--ink-2);
}
.imp.high { background: var(--bad-bg); color: var(--bad); }
.imp.mid { background: var(--warn-bg); color: var(--warn); }
.subject { font-weight: 550; }
.from { color: var(--ink-2); font-size: 12px; }

.todos { list-style: none; margin: 0; padding: 0; }
.todo {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 8px 2px; border-bottom: 1px solid var(--line-2);
}
.todo:last-child { border-bottom: 0; }
.todo-body { flex: 1; min-width: 0; }
.todo-text { font-weight: 550; overflow-wrap: anywhere; }
.todo .from { overflow-wrap: anywhere; }
.todo-open { font-size: 12px; white-space: nowrap; color: var(--accent); }
.tick {
  width: 20px; height: 20px; flex: 0 0 20px; margin-top: 1px; padding: 0;
  border: 1.5px solid var(--ink-2); border-radius: 5px; background: var(--panel);
  color: var(--accent-ink); font-size: 13px; line-height: 1; cursor: pointer;
}
.tick:hover { border-color: var(--accent); }
.is-done .tick { background: var(--accent); border-color: var(--accent); }
.is-done .todo-text { text-decoration: line-through; color: var(--ink-2); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px;
  font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap;
  background: var(--line-2); color: var(--ink-2);
}
.status-pill.succeeded { background: var(--ok-bg); color: var(--ok); }
.status-pill.failed { background: var(--bad-bg); color: var(--bad); }
.status-pill.running, .status-pill.queued { background: var(--warn-bg); color: var(--warn); }

/* ------------------------------------------------------------- operator */
.admin main { padding-bottom: 80px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px 13px; box-shadow: var(--shadow);
}
.tile b { display: block; font-size: 22px; letter-spacing: -.02em; }
.tile span { color: var(--ink-2); font-size: 11.5px; }
.tile.alarm { border-color: var(--bad); }
.tile.alarm b { color: var(--bad); }
.verdict { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.verdict .badge { font-size: 12px; padding: 3px 10px; }
.problems { margin: 0; padding-left: 18px; color: var(--bad); font-size: 13px; }
.problems li { padding: 2px 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end;
           margin-bottom: 10px; }
.filters label { margin: 0; }
.filters select, .filters input { display: block; margin-top: 3px; }
.level { font-weight: 600; font-size: 11px; }
.level.ERROR, .level.CRITICAL { color: var(--bad); }
.level.WARNING { color: var(--warn); }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.logline {
  display: grid; grid-template-columns: 62px 62px 1fr; gap: 10px;
  padding: 2px 0; font: 11.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.logline .lvl { color: var(--ink-2); }
.logline .lvl.WARNING { color: #d9a441; }
.logline .lvl.ERROR, .logline .lvl.CRITICAL { color: #f0705a; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.danger-zone { border-color: var(--bad); }
.danger-zone h3 { color: var(--bad); }
.danger-zone p { margin-top: 0; }

/* ---------------------------------------------------------------- error */
.error-page { max-width: 460px; margin: 0 auto; text-align: center; padding: 72px 20px; }
.error-page .code { font-size: 44px; font-weight: 600; color: var(--ink-2);
                    letter-spacing: -.03em; }
.error-page h1 { margin: 6px 0 10px; }
.error-page .reference {
  display: inline-block; margin-top: 16px; padding: 7px 12px;
  border: 1px dashed var(--line); border-radius: 8px;
  font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--ink-2);
}
