:root {
  --bg: #f6f5f1; --panel: #ffffff; --ink: #16161a; --muted: #6b6a66; --line: #e3e1da;
  --accent: #16a34a; --accent-ink: #ffffff; --warn: #d97706; --bad: #dc2626; --code: #f1f0ea;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f0f11; --panel: #17171a; --ink: #ececea; --muted: #94938e; --line: #2a2a2e; --code: #1f1f23; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 22px; } h2 { font-size: 15px; font-weight: 650; }
a { color: inherit; }
.muted { color: var(--muted); font-size: 13px; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 24px 8px; max-width: 1280px; margin: 0 auto; }
.brand { display: flex; gap: 14px; align-items: flex-start; }
.logo { width: 30px; height: 38px; border-radius: 3px; background: var(--ink); position: relative; flex: none; margin-top: 2px; }
.logo::after { content: ""; position: absolute; right: 4px; top: 8px; width: 9px; height: 22px; background: var(--accent); }
.tag { margin: 2px 0 0; color: var(--muted); max-width: 680px; }
.mode { font-size: 12px; padding: 6px 10px; border-radius: 6px; background: #fef3c7; color: #78350f; max-width: 360px; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 8px 24px 0; max-width: 1280px; margin: 0 auto; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12px; }
.grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; padding: 16px 24px; max-width: 1280px; margin: 0 auto; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; padding: 16px; } .top, .totals { padding-left: 16px; padding-right: 16px; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; gap: 8px; }
.endpoints { display: grid; gap: 10px; }
.ep { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 6px; }
.ep-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ep-name { font-family: var(--mono); font-weight: 650; }
.pill { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 99px; border: 1px solid currentColor; }
.pill.healthy { color: var(--accent); } .pill.repairing { color: var(--warn); } .pill.broken { color: var(--bad); } .pill.new { color: var(--muted); }
.pill.kind { color: var(--muted); }
.ep-sentence { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.ep-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ep-last { font-family: var(--mono); font-size: 12px; background: var(--code); border-radius: 6px; padding: 6px 8px; overflow-wrap: anywhere; }
.ep-actions { display: flex; gap: 8px; }
button { font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 8px 14px; background: var(--ink); color: var(--bg); cursor: pointer; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); padding: 4px 10px; font-size: 13px; }
button:disabled { opacity: .55; cursor: progress; }
.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.form label.check { display: flex; align-items: center; gap: 8px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
input[type=checkbox] { width: auto; }
.json { font-family: var(--mono); font-size: 12.5px; background: var(--code); border-radius: 8px; padding: 12px; overflow: auto; max-height: 360px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0 0; }
.json.small { max-height: 220px; }
.curl { margin-top: 10px; font-size: 12px; overflow-wrap: anywhere; } .curl code { font-family: var(--mono); color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 620px; overflow: auto; }
.trace { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.trace.repair { border-color: var(--warn); }
.trace.fixed { border-color: var(--accent); }
.trace-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.trace-head b { font-family: var(--mono); }
.steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.steps li { display: grid; grid-template-columns: 92px 1fr; gap: 8px; font-size: 12.5px; }
.steps .k { font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--muted); padding-top: 1px; }
.steps .k.bad { color: var(--bad); } .steps .k.good { color: var(--accent); } .steps .k.warn { color: var(--warn); }
.steps .remark { color: var(--muted); white-space: pre-wrap; }
.shots { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.shots a { display: block; } .shots img { height: 84px; border-radius: 6px; border: 1px solid var(--line); }
.live { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.live.off { color: var(--muted); }
.foot { display: flex; justify-content: space-between; gap: 16px; padding: 8px 24px 32px; max-width: 1280px; margin: 0 auto; color: var(--muted); font-size: 13px; flex-wrap: wrap; }

/* TODO(remove-kane-switch): temporary Kane CLI master switch */
.top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.kane-switch { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 12px; font-weight: 600; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.kane-switch .knob { width: 28px; height: 16px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.kane-switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--panel); box-shadow: 0 0 0 1px var(--line); transition: transform .15s; }
.kane-switch[data-on="true"] { color: var(--ink); border-color: var(--accent); }
.kane-switch[data-on="true"] .knob { background: var(--accent); }
.kane-switch[data-on="true"] .knob::after { transform: translateX(12px); }
.kane-switch:disabled { cursor: not-allowed; }
.kane-note { max-width: 1280px; margin: 0 auto; padding: 0 24px 8px; font-size: 12px; color: var(--muted); }
