/* Agentic Traffic Control. Dark-first radar look; light mode follows the system. */
:root {
  --bg: #0a0e13;
  --bg-2: #0e141b;
  --panel: #121a23;
  --panel-2: #17212c;
  --line: #223040;
  --text: #dbe4ec;
  --muted: #8a9bad;
  --faint: #5d6e80;
  --accent: #f5b301;
  --accent-ink: #1a1300;
  --go: #3ddc84;
  --info: #4cc3ff;
  --warn: #f59e0b;
  --bad: #ff5a5f;
  --glow: rgba(61, 220, 132, 0.18);
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --bg-2: #eef1f4;
    --panel: #ffffff;
    --panel-2: #f3f5f8;
    --line: #dde3ea;
    --text: #0f1822;
    --muted: #536273;
    --faint: #8494a5;
    --accent: #b97f00;
    --accent-ink: #ffffff;
    --go: #138a4d;
    --info: #0b72b3;
    --warn: #b45309;
    --bad: #c62828;
    --glow: rgba(19, 138, 77, 0.12);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
code, pre, .mono { font-family: var(--mono); font-size: .9em; }
pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; line-height: 1.45; }
:not(pre) > code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 9px 16px; border-radius: 8px; font: 600 .95rem var(--sans); cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 4px 10px; font-size: .82rem; }
.btn.danger { color: var(--bad); }
input[type=email], input[type=text], select, textarea {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; min-width: 0; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Public site */
.site-head { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.site-head nav { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.site-head nav a:not(.btn) { color: var(--muted); font-size: .95rem; }
@media (max-width: 640px) {
  .site-head nav a.hide-sm { display: none; }
  .site-head .wrap { gap: 10px; }
  .site-head nav { gap: 12px; }
  .brand span.long { display: none; }
}
@media (min-width: 641px) { .brand span.short { display: none; } }
.hero .wrap > *, .grid > *, .pricing > *, .agents > * { min-width: 0; }

.hero { padding: 72px 0 56px; position: relative; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } .hero { padding-top: 40px; } }
.eyebrow { display: inline-block; font: 600 .78rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--go);
  border: 1px solid color-mix(in srgb, var(--go) 40%, transparent); border-radius: 999px; padding: 3px 10px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: 1.18rem; color: var(--muted); max-width: 36em; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

.radar { aspect-ratio: 1; width: 100%; max-width: 440px; margin: 0 auto; border-radius: 50%; position: relative;
  background: radial-gradient(circle, var(--glow) 0%, transparent 70%), var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.radar svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.radar .sweep { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 300deg, color-mix(in srgb, var(--go) 35%, transparent) 360deg);
  animation: sweep 6s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .radar .sweep { animation: none; opacity: .4; } }

section.band { padding: 64px 0; border-top: 1px solid var(--line); }
section.band.alt { background: var(--bg-2); }
.section-head { max-width: 46em; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { font-size: 1.08rem; display: flex; align-items: center; gap: 10px; }
.card .q { color: var(--accent); font-size: .92rem; margin-bottom: .6em; }
.card p:last-child { margin-bottom: 0; }
.icon { width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); font-size: 15px; }
.steps { counter-reset: step; }
.steps .card { position: relative; padding-top: 48px; }
.steps .card::before { counter-increment: step; content: "0" counter(step); position: absolute; top: 16px; left: 20px; font: 700 .9rem var(--mono); color: var(--go); }

.pricing { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tier { display: flex; flex-direction: column; }
.tier.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tier .price { font: 700 1.5rem var(--sans); margin: 4px 0 2px; }
.tier ul { list-style: none; padding: 0; margin: 16px 0 20px; flex: 1; }
.tier li { padding: 5px 0 5px 24px; position: relative; color: var(--muted); }
.tier li::before { content: "✓"; position: absolute; left: 0; color: var(--go); font-weight: 700; }
.badge-soon { font: 600 .72rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }

.waitlist { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.waitlist input[type=email] { flex: 1 1 260px; }
.waitlist select { flex: 0 1 180px; }
.notice { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 28px; max-width: 560px; margin: 64px auto; }
.notice h1 { font-size: 1.7rem; }
.site-foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--faint); font-size: .9rem; }
.site-foot .wrap { display: flex; gap: 18px; flex-wrap: wrap; }
.site-foot a { color: var(--muted); }
.doc { max-width: 820px; padding-top: 40px; padding-bottom: 64px; }
.doc h2 { margin-top: 1.8em; padding-top: .4em; border-top: 1px solid var(--line); }
.doc h3 { margin-top: 1.4em; }
.doc table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }

/* The app */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 4px 8px 16px; font-size: .95rem; }
.side nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; color: var(--muted); font-size: .93rem; }
.side nav a:hover { background: var(--panel); text-decoration: none; color: var(--text); }
.side nav a.on { background: var(--panel-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.side .group { font: 600 .7rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; }
.count { font: 600 .72rem var(--mono); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; color: var(--text); }
.count.hot { background: var(--bad); border-color: var(--bad); color: #fff; }
.side form { padding: 16px 10px 0; }
.main { padding: 22px 28px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.page-head .sub { color: var(--muted); font-size: .93rem; }
.page-head .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font: 600 .75rem var(--mono); color: var(--muted); }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live-dot.on::before { background: var(--go); box-shadow: 0 0 0 3px var(--glow); }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; display: block; }
  .side nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .side .group { display: none; }
  .main { padding: 16px; }
}

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .n { font: 700 1.6rem var(--sans); }
.stat .l { color: var(--muted); font-size: .82rem; }
.stat.bad .n { color: var(--bad); } .stat.warn .n { color: var(--warn); } .stat.go .n { color: var(--go); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.panel > h2 { font-size: .95rem; padding: 12px 16px; margin: 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.panel > .body { padding: 14px 16px; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th { text-align: left; font: 600 .72rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr:hover td { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }

.pill { display: inline-flex; align-items: center; gap: 6px; font: 600 .74rem var(--mono); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; background: var(--panel-2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-under_way { color: var(--go); } .s-standing_by { color: var(--muted); } .s-waiting { color: var(--accent); }
.s-blocked, .s-failed, .s-stalled { color: var(--bad); } .s-complete { color: var(--info); } .s-ended { color: var(--faint); } .s-in_review { color: var(--info); }
.u-critical, .r-high { color: var(--bad); } .u-high, .r-medium { color: var(--warn); } .u-normal { color: var(--info); } .u-low, .r-low { color: var(--muted); }
.ci-pass { color: var(--go); } .ci-fail { color: var(--bad); } .ci-cancelled, .ci-running { color: var(--muted); }
.tag { font: .74rem var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; white-space: nowrap; }

.items { display: flex; flex-direction: column; }
.item { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; }
.item:last-child { border-bottom: 0; }
.item .title { font-weight: 600; }
.item .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--muted); margin-top: 4px; }
.item .acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; }
.item .acts form { display: inline-flex; gap: 6px; }
.item .reply { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.item .reply input[type=text] { flex: 1 1 240px; }
.item .detail { grid-column: 1 / -1; font-size: .88rem; color: var(--muted); }
@media (max-width: 640px) { .item { grid-template-columns: 1fr; } .item .acts { justify-content: flex-start; } }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 74px 150px 1fr; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: .9rem; align-items: baseline; }
.feed li:last-child { border-bottom: 0; }
.feed .when { color: var(--faint); font: .78rem var(--mono); }
.feed .type { font: .78rem var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .type.unknown { color: var(--accent); }
@media (max-width: 640px) { .feed li { grid-template-columns: 1fr; gap: 2px; } }

.agents { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-bottom: 18px; }
.agent { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.agent.attn { border-color: color-mix(in srgb, var(--bad) 60%, var(--line)); }
.agent .top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.agent .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent .doing { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.agent .links { display: flex; gap: 10px; flex-wrap: wrap; font-size: .82rem; }

.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 170px 1fr 48px; gap: 10px; align-items: center; font-size: .88rem; }
.bar .track { background: var(--panel-2); border-radius: 4px; height: 12px; overflow: hidden; }
.bar .fill { background: var(--accent); height: 100%; border-radius: 4px; }
.bar .v { font: .8rem var(--mono); text-align: right; }
.spark { display: flex; gap: 3px; align-items: flex-end; height: 64px; padding-top: 6px; }
.spark span { flex: 1; background: var(--info); border-radius: 2px 2px 0 0; min-height: 1px; opacity: .85; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters a { font-size: .85rem; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.filters a.on { border-color: var(--accent); color: var(--text); }
.secret { background: var(--bg-2); border: 1px dashed var(--accent); border-radius: 8px; padding: 12px; font: .9rem var(--mono); word-break: break-all; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: .9rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.flash { background: color-mix(in srgb, var(--go) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--go) 50%, var(--line)); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }
