:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", sans-serif;
  color: #f0f3f7;
  background: #10141b;
  --panel: #171d27;
  --surface: #1d2633;
  --border: #303b4b;
  --muted: #aab7c9;
  --accent: #a8f1d9;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .22em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shell { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.top { border-bottom: 1px solid var(--border); background: #131923; }
.top-inner, .page-heading, .pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.top-inner { min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: inherit; text-decoration: none; font-size: 1.15rem; font-weight: 700; }
.mark { border-radius: .5rem; padding: .3rem .57rem; color: #10251e; background: var(--accent); }
main.shell { padding-block: clamp(1.5rem, 5vw, 3.5rem); }
h1 { margin: 0; font-size: clamp(1.9rem, 5vw, 2.6rem); letter-spacing: -.045em; overflow-wrap: anywhere; }
h2 { margin: 0 0 .65rem; font-size: 1.15rem; }
.button, button {
  min-height: 2.55rem; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: .5rem; padding: .55rem .9rem;
  background: var(--surface); color: inherit; text-decoration: none; font-weight: 600;
  font-size: .875rem;
}
.primary { background: var(--accent); color: #10251e; border-color: var(--accent); }
.danger { background: #ffbbb8; color: #401717; border-color: #ffbbb8; }
.button:hover, button:hover { filter: brightness(1.13); }
.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.clear { align-self: end; padding-block: .65rem; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: 1.5rem 0; }
.metrics div, .panel { min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: .75rem; }
.metrics div { padding: clamp(.7rem, 2.5vw, 1.2rem); }
dt, .muted, .pagination { color: var(--muted); }
dt { font-size: .85rem; }
dd { margin: .35rem 0 0; font-size: clamp(1.25rem, 4vw, 1.85rem); font-variant-numeric: tabular-nums; font-weight: 650; overflow-wrap: anywhere; }
.filter { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; padding: 1rem; }
.filter label:first-child { flex: 1 1 12rem; }
.visit-dispatch { border-top: 1px solid var(--border); }
.visit-dispatch label { flex: 1 1 18rem; }
.visit-dispatch p { flex-basis: 100%; margin: 0; font-size: .82rem; }
.row-check { width: 1rem; min-height: 1rem; margin: .2rem auto; accent-color: var(--accent); }
.visit-url { margin: .8rem 0 1.4rem; overflow-wrap: anywhere; }
.visit-results { margin-top: 1.5rem; }
.workflow-step { margin-block: 1rem; padding: 1rem; }
.workflow-step .stack, .workflow-step h2 { margin: 0; }
.step-fields { display: grid; grid-template-columns: minmax(9rem, 1fr) 3fr; gap: .8rem; }
.step-results { margin-top: .6rem; }
.step-results li { margin-block: .55rem; overflow-wrap: anywhere; }
.step-output { display: block; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 40rem; }
@media (max-width: 540px) { .step-fields { grid-template-columns: 1fr; } }
label { display: block; font-size: .875rem; font-weight: 600; }
input, select, textarea { display: block; width: 100%; margin-top: .35rem; padding: .55rem .7rem; color: inherit; background: #10151e; border: 1px solid var(--border); border-radius: .45rem; min-height: 2.55rem; }
input::placeholder { color: var(--muted); }
textarea { resize: vertical; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; text-align: left; }
th, td { padding: .85rem 1rem; border-top: 1px solid var(--border); }
thead th { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.agent-name { color: inherit; overflow-wrap: anywhere; }
code { font-family: "IBM Plex Mono", Consolas, monospace; color: #d2ddeb; white-space: nowrap; }
.status { display: inline-block; padding: .18rem .5rem; border-radius: .35rem; }
.guard-badge { display: table; margin-top: .3rem; padding: .18rem .45rem; border-radius: .35rem; color: var(--muted); background: var(--surface); white-space: nowrap; font-size: .75rem; }
.active { color: #a8f1d9; background: #214036; }
.paused { color: #ffdb9d; background: #463620; }
.agent-error { display: block; margin-top: .3rem; max-width: 24rem; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.actions { white-space: nowrap; }
.actions a + a, .pagination nav a + a { margin-left: .75rem; }
.pagination { border-top: 1px solid var(--border); padding: .8rem 1rem; font-size: .85rem; }
.empty { padding: 3rem 1rem; text-align: center; border-top: 1px solid var(--border); }
.form-panel { max-width: 36rem; padding: clamp(1rem, 4vw, 2rem); }
.login-panel { max-width: 26rem; margin: 2rem auto; }
.stack { display: grid; gap: 1rem; margin-top: 1.5rem; }
.checkbox { display: flex; align-items: flex-start; gap: .6rem; }
.checkbox input { width: 1rem; min-height: auto; height: 1rem; margin: .05rem 0 0; accent-color: var(--accent); flex: none; }
.form-actions { display: flex; gap: .65rem; flex-wrap: wrap; }
.identity { margin: .4rem 0 0; }
.back { display: inline-block; margin-bottom: 1rem; }
.notice, .error { border: 1px solid; border-radius: .45rem; padding: .65rem .85rem; }
.proxy-summary { margin: 0 0 1rem; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: .5rem; background: var(--panel); color: var(--muted); font-size: .875rem; }
.proxy-summary strong { color: #f0f3f7; }
.field-help { margin: -.55rem 0 0; color: var(--muted); font-size: .8rem; }
.exit-ip-detail { padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: .5rem; }
.exit-ip-detail dd { font-size: .95rem; font-weight: 600; }
.exit-ip-detail .exit-ip-example, .exit-ip-time { font-size: .75rem; font-weight: 400; }
.exit-ip-time { display: block; margin-top: .2rem; white-space: nowrap; }
.notice { background: #1a332a; color: var(--accent); }
.error { color: #ffbbb8; background: #382227; }
@media (max-width: 30rem) {
  .metrics { gap: .4rem; }
  .filter label:first-child { flex-basis: 100%; }
}
