:root {
  --ink: #e9f0f2;
  --muted: #8fa1a7;
  --bg: #071014;
  --panel: #0c171c;
  --panel-2: #101e24;
  --line: #203139;
  --cyan: #28cae5;
  --lime: #b8ed39;
  --amber: #ffbd52;
  --danger: #ff765f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0; }
button, input { font: inherit; }
button { color: inherit; }
.topbar { height: 68px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(7,16,20,.96); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--cyan); color: var(--cyan); font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.top-status { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 12px; }
.environment, .health { display: inline-flex; align-items: center; gap: 7px; }
.environment { color: var(--amber); }
.environment svg, .icon-button svg { width: 16px; height: 16px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.shell { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { padding: 24px 14px; border-right: 1px solid var(--line); background: #091318; position: sticky; top: 68px; height: calc(100vh - 68px); }
.sidebar-label { margin: 0 10px 10px; color: #62767e; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.agent-label { margin-top: 30px; }
.nav-item, .agent-item { width: 100%; min-height: 42px; border: 0; background: transparent; display: flex; align-items: center; text-align: left; cursor: pointer; }
.nav-item { gap: 10px; padding: 0 10px; color: var(--muted); border-left: 2px solid transparent; }
.nav-item svg { width: 17px; }
.nav-item b { margin-left: auto; font-size: 11px; }
.nav-item:hover, .nav-item.active { color: var(--ink); background: var(--panel-2); border-left-color: var(--cyan); }
.agent-item { gap: 10px; padding: 7px 10px; }
.agent-item > span { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid currentColor; font-size: 12px; font-weight: 800; }
.agent-item div { min-width: 0; }
.agent-item strong, .agent-item small { display: block; }
.agent-item strong { font-size: 12px; }
.agent-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.cyan { color: var(--cyan); }.lime { color: var(--lime); }.amber { color: var(--amber); }
.adapter-state { position: absolute; left: 14px; right: 14px; bottom: 18px; padding: 12px; border: 1px solid var(--line); background: var(--panel); }
.adapter-state div { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 10px; }
.adapter-state svg { width: 15px; }
.adapter-state strong { display: block; margin-top: 9px; color: var(--amber); font-size: 11px; }
.workspace { min-width: 0; padding: 28px clamp(20px, 3vw, 48px) 56px; }
.hero-band { min-height: 440px; display: grid; grid-template-columns: minmax(360px, .78fr) minmax(560px, 1.35fr); align-items: center; gap: 28px; border-bottom: 1px solid var(--line); }
.hero-copy { max-width: 610px; padding: 28px 0 44px; }
.eyebrow { margin: 0 0 10px; color: var(--cyan); font-size: 10px; font-weight: 800; }
h1 { margin: 0; font-size: clamp(39px, 4.1vw, 68px); line-height: 1.02; letter-spacing: 0; }
.hero-copy > p:not(.eyebrow) { max-width: 570px; margin: 24px 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.hero-actions { display: flex; gap: 10px; }
.primary, .secondary { min-height: 40px; padding: 0 15px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 750; font-size: 12px; }
.primary { background: var(--cyan); color: #031014; }
.primary:hover { background: #70e7f7; }
.secondary { background: transparent; border-color: #39505a; color: var(--ink); }
.secondary:hover { border-color: var(--muted); }
.primary svg, .secondary svg { width: 15px; }
.topology { min-width: 0; position: relative; }
.topology img { display: block; width: 100%; max-height: 430px; object-fit: contain; object-position: center; }
.topology-key { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 7px; align-items: center; padding: 7px 9px; color: var(--muted); background: rgba(7,16,20,.92); border: 1px solid var(--line); font-size: 10px; }
.cyan-dot,.lime-dot,.amber-dot { width: 7px; height: 7px; border-radius: 50%; }
.cyan-dot { background: var(--cyan); }.lime-dot { background: var(--lime); }.amber-dot { background: var(--amber); }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.metrics > div { padding: 23px 20px; border-right: 1px solid var(--line); }
.metrics > div:last-child { border-right: 0; }
.metrics span, .metrics small { display: block; color: var(--muted); font-size: 10px; }
.metrics strong { display: block; margin: 6px 0; font-size: 26px; }
.operations-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, .65fr); gap: 22px; padding-top: 28px; }
.queue-panel, .control-panel, .trace-panel { border: 1px solid var(--line); background: var(--panel); }
.panel-heading { min-height: 72px; padding: 17px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-heading .eyebrow { margin-bottom: 4px; }
h2 { margin: 0; font-size: 17px; }
.filters { display: flex; gap: 4px; }
.filter { min-height: 30px; padding: 0 10px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; }
.filter:hover, .filter.active { color: var(--ink); border-color: #39505a; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { padding: 14px 16px; border-bottom: 1px solid #19282f; text-align: left; font-size: 11px; overflow-wrap: anywhere; }
th { color: #6f838b; font-size: 9px; text-transform: uppercase; }
th:first-child { width: 39%; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); }
.state { display: inline-flex; align-items: center; gap: 6px; }
.state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.state.running { color: var(--lime); }.state.ready { color: var(--cyan); }.state.blocked { color: var(--amber); }.state.pending { color: var(--muted); }.state.succeeded { color: #74d5a0; }
.risk-low { color: var(--muted); }.risk-medium { color: var(--amber); }.risk-high { color: var(--danger); }
.control-panel { padding-bottom: 16px; }
.control-panel > label { padding: 18px 18px 6px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.control-panel output { color: var(--ink); font-weight: 800; }
input[type="range"] { width: calc(100% - 36px); margin: 8px 18px 18px; accent-color: var(--lime); }
.limit-row { min-height: 39px; margin: 0 18px; border-top: 1px solid #19282f; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.limit-row strong { color: var(--ink); }
.limit-row .gated { color: var(--amber); }
.approval-box { margin: 16px 18px 0; padding: 14px; border: 1px solid #5a4727; background: #17150e; }
.approval-box > div { display: flex; align-items: center; gap: 9px; }
.approval-box > div:last-child { justify-content: flex-end; }
.approval-box strong, .approval-box small { display: block; }
.approval-box small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.approval-box p { color: #b9aa8c; line-height: 1.5; font-size: 10px; }
.risk-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--amber); border: 1px solid #5a4727; }
.risk-icon svg { width: 16px; }
.compact { min-height: 31px; padding: 0 11px; font-size: 10px; }
.approval-box.resolved { opacity: .55; pointer-events: none; }
.trace-panel { margin-top: 22px; }
.icon-button { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.icon-button:hover { color: var(--ink); border-color: #45616c; }
#trace-list { min-height: 124px; max-height: 240px; overflow: auto; margin: 0; padding: 12px 18px 17px 45px; font-family: "Cascadia Code", Consolas, monospace; }
#trace-list li { padding: 5px 0; color: #9fb0b5; font-size: 10px; line-height: 1.45; }
#trace-list time { margin-right: 11px; color: #536970; }

@media (max-width: 1080px) {
  .shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding-left: 9px; padding-right: 9px; }
  .sidebar-label, .nav-item span, .agent-item div, .adapter-state span, .adapter-state strong { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item b { position: absolute; margin: -25px 0 0 29px; }
  .agent-item { justify-content: center; padding: 7px 0; }
  .adapter-state { left: 9px; right: 9px; padding: 10px; }
  .adapter-state div { justify-content: center; }
  .hero-band { grid-template-columns: 1fr; }
  .topology { order: -1; max-height: 340px; overflow: hidden; }
}

@media (max-width: 760px) {
  .topbar { height: auto; min-height: 68px; padding: 10px 14px; gap: 10px; }
  .brand small, .health { display: none; }
  .top-status { gap: 7px; }
  .environment { font-size: 9px; }
  .shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 8px; display: flex; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .nav-item, .agent-item { flex: 0 0 46px; }
  .agent-label, .adapter-state { display: none; }
  .workspace { padding: 18px 14px 40px; }
  .hero-band { min-height: 0; gap: 6px; }
  .topology { max-height: 230px; }
  .hero-copy { padding: 20px 0 32px; }
  h1 { font-size: 39px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics > div:nth-child(2) { border-right: 0; }
  .metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .operations-grid { grid-template-columns: 1fr; }
  th:nth-child(3), td:nth-child(3) { display: none; }
  th:first-child { width: 45%; }
}

