/* StarLINE operator panel — design system
   Sections: tokens · base · rail · header · layout utilities · cards · kpi ·
   pills · buttons · inputs · tables · dialogs · stepper · tabs · toolbar ·
   empty/loading · toasts · code · kv · progress · map · overview legacy ·
   responsive · motion
   Page agents append only inside their own "=== <page> ===" section at the end. */

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #0c1117;
  --rail-bg: #0f151c;
  --panel: #141b24;
  --panel-2: #192230;
  --panel-3: #1f2a38;
  --input-bg: #0e141b;
  --line: #243040;
  --line-2: #2f3d4e;

  --ink: #e9eef4;
  --muted: #a4b2c1;
  --dim: #7a8a9c;

  --teal: #50d8ae;
  --amber: #f5be64;
  --red: #fa837a;
  --violet: #b39bff;
  --blue: #82bafa;
  --grey: #93a3b4;

  --accent: var(--teal);
  --accent-ink: #06261d;
  --focus: #9cc8ff;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 14px;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;

  --rail-w: 228px;
  --shadow-pop: 0 20px 50px -20px rgb(0 0 0 / 0.7), 0 0 0 1px rgb(255 255 255 / 0.03) inset;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 140ms;
}

/* ---------- base ---------- */
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  font: 14px/1.45 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 520px at 18% -10%, rgb(80 216 174 / 0.05), transparent 60%),
    var(--bg);
}
h1, h2, h3, h4, p, dl, dd, figure, ol, ul {
  margin: 0;
}
ol, ul {
  padding: 0;
  list-style: none;
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
code, kbd, pre, .mono {
  font-family: var(--mono);
  font-size: 0.93em;
}
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
svg.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  flex: none;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.num, .tabular {
  font-variant-numeric: tabular-nums;
}
.dim, .muted {
  color: var(--muted);
}
.faint {
  color: var(--dim);
}
.small {
  font-size: 12px;
}
.nowrap {
  white-space: nowrap;
}
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- rail ---------- */
.rail {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: var(--rail-w);
  background: var(--rail-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(145deg, #7ee7c6, #3fbf98);
  color: #06261d;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06) inset;
}
.brand-mark svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
.brand-tag {
  display: block;
  font-size: 11px;
  font-weight: 450;
  color: var(--dim);
  letter-spacing: 0;
  margin-top: 1px;
}
.rail nav {
  display: grid;
  gap: 2px;
  align-content: start;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-item:hover {
  background: var(--panel-2);
  color: var(--ink);
  text-decoration: none;
}
.nav-item[aria-current="page"] {
  background: rgb(80 216 174 / 0.1);
  color: #a9f0d8;
}
.nav-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 10px;
  width: 3px;
  height: 16px;
  border-radius: 0 3px 3px 0;
  background: var(--teal);
}
.nav-item svg {
  width: 17px;
  height: 17px;
  opacity: 0.85;
}
.nav-item[aria-current="page"] svg {
  opacity: 1;
}
.rail-foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
}
.identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 6px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.identity > div {
  min-width: 0;
  flex: 1;
}
.identity strong, .identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.identity strong {
  font-size: 12.5px;
  font-weight: 600;
}
.identity small {
  font-size: 11px;
  color: var(--dim);
  margin-top: 1px;
}
.avatar {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #4a3e74, #2d2744);
  color: #d9c8ff;
  font-size: 12px;
  font-weight: 650;
}

/* ---------- main + header ---------- */
main {
  margin-left: var(--rail-w);
  padding: 26px clamp(20px, 2.6vw, 40px) 56px;
  max-width: 1720px;
  min-width: 0;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 22px;
}
.page-head > div:first-child {
  flex: 1 1 280px;
  min-width: 0;
}
.page-head h1 {
  font-size: 26px;
  line-height: 1.15;
  font-weight: 620;
  letter-spacing: -0.022em;
}
.subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  max-width: 70ch;
}
.page-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  margin-left: auto;
  padding-top: 2px;
}
#page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
#page-actions:empty {
  display: none;
}
#preview {
  font-size: 11px;
  font-weight: 550;
  color: var(--amber);
  border: 1px solid rgb(245 190 100 / 0.35);
  background: rgb(245 190 100 / 0.08);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
#page {
  min-width: 0;
}
.page-root {
  display: block;
  min-width: 0;
}

/* sign-in */
#auth:empty {
  display: none;
}
#auth {
  margin: 48px auto 0;
  max-width: 420px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  display: grid;
  justify-items: center;
  gap: 12px;
}
.auth-lead {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}
.auth-lead p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 34ch;
}
.auth-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--teal);
  background: rgb(80 216 174 / 0.1);
  border: 1px solid rgb(80 216 174 / 0.25);
}
.auth-mark svg {
  width: 22px;
  height: 22px;
}
.auth-slot {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding-top: 4px;
  min-height: 44px;
}
.auth-slot:empty {
  display: none;
}
.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgb(245 190 100 / 0.09);
  color: #f8dbad;
  border: 1px solid rgb(245 190 100 / 0.3);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin: 0 auto 16px;
  max-width: 640px;
  font-size: 13px;
}
.notice:empty {
  display: none;
}

/* ---------- layout utilities ---------- */
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.stack.tight {
  gap: 8px;
}
.stack.loose {
  gap: 20px;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.row.between {
  justify-content: space-between;
}
.row.end {
  justify-content: flex-end;
}
.row.start {
  align-items: flex-start;
}
.wrap {
  flex-wrap: wrap;
}
.gap-sm {
  gap: 4px;
}
.gap-lg {
  gap: 16px;
}
.spacer {
  flex: 1 1 auto;
}
.grid-2, .grid-3, .grid-4 {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 30%);
  gap: 16px;
  align-items: start;
}
.split.wide-aside {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 38%);
}
.section + .section, .page-section + .page-section {
  margin-top: 24px;
}
.section-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.divider {
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

/* ---------- cards ---------- */
.card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  min-width: 0;
  overflow: hidden;
}
.card.raised {
  background: linear-gradient(180deg, rgb(255 255 255 / 0.015), transparent 40%), var(--panel);
}
.card-head, .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
}
.card-head h2, .panel-head h2, .card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.card-head p, .card-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}
.card-head > div:first-child {
  min-width: 0;
}
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.card-body {
  padding: 16px 18px;
  min-width: 0;
}
.card-body.flush, .card.flush > .card-body {
  padding: 0;
}
.card-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.card.tone-bad {
  border-color: rgb(250 131 122 / 0.4);
}
.card.tone-warn {
  border-color: rgb(245 190 100 / 0.4);
}
.card.tone-ok {
  border-color: rgb(80 216 174 / 0.4);
}
.card.selected {
  border-color: rgb(80 216 174 / 0.5);
  box-shadow: 0 0 0 1px rgb(80 216 174 / 0.25);
}
.error-card .card-body {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.error-card .icon {
  color: var(--red);
  width: 20px;
  height: 20px;
  margin-top: 1px;
}
.error-card h3 {
  font-size: 14px;
  font-weight: 600;
}
.error-card p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.error-card .row {
  margin-top: 12px;
}

/* ---------- KPI tiles ---------- */
.kpis, .metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi, .metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px 13px;
  min-width: 0;
  position: relative;
}
.kpi-top, .metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}
.kpi-top svg, .metric-top svg {
  width: 16px;
  height: 16px;
  color: var(--dim);
}
.kpi-value, .metric-value {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.kpi-foot, .metric-foot {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi.tone-bad .kpi-value {
  color: #ffb3ac;
}
.kpi.tone-warn .kpi-value {
  color: #ffd999;
}
.kpi.tone-ok .kpi-value {
  color: #a9f0d8;
}

/* ---------- pills ---------- */
.pill {
  --pin: var(--grey);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px 0 7px;
  font-size: 11px;
  font-weight: 580;
  line-height: 1;
  white-space: nowrap;
  border-radius: 999px;
  color: var(--pin);
  background: color-mix(in srgb, var(--pin) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--pin) 32%, transparent);
  vertical-align: middle;
}
.pill.no-dot {
  padding-left: 9px;
}
.pill .dot {
  width: 6px;
  height: 6px;
}
.pill.sm {
  height: 18px;
  font-size: 10px;
  padding: 0 7px 0 6px;
}
.tone-ok {
  --pin: var(--teal);
}
.tone-warn {
  --pin: var(--amber);
}
.tone-bad {
  --pin: var(--red);
}
.tone-info {
  --pin: var(--blue);
}
.tone-violet {
  --pin: var(--violet);
}
.tone-muted {
  --pin: var(--grey);
}
.dot {
  display: inline-block;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pin, var(--teal));
}
.pill .dot, .swatch {
  background: var(--pin);
}
.swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}

/* ---------- buttons ---------- */
.soft, .primary, .ghost, .danger, .action, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 540;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
  user-select: none;
}
.soft, .action {
  background: var(--panel-2);
  border-color: var(--line-2);
  color: var(--ink);
}
.soft:hover, .action:hover {
  background: var(--panel-3);
  border-color: #3b4b5e;
}
.primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 620;
  border-color: rgb(255 255 255 / 0.08);
}
.primary:hover {
  background: #6ae3bd;
}
.primary:active {
  background: #46caa0;
}
.ghost {
  background: transparent;
  color: var(--muted);
}
.ghost:hover {
  background: var(--panel-2);
  color: var(--ink);
}
.danger {
  background: rgb(250 131 122 / 0.1);
  color: #ffb0a8;
  border-color: rgb(250 131 122 / 0.35);
}
.danger:hover {
  background: var(--red);
  color: #3a0d09;
  border-color: var(--red);
}
.icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--panel-2);
  border-color: var(--line-2);
  color: var(--muted);
}
.icon-button:hover {
  background: var(--panel-3);
  color: var(--ink);
}
.icon-button.ghost {
  background: transparent;
  border-color: transparent;
}
.icon-button.ghost:hover {
  background: var(--panel-2);
}
.icon-button.danger {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.icon-button.danger:hover {
  background: rgb(250 131 122 / 0.12);
  color: #ffb0a8;
  border-color: rgb(250 131 122 / 0.35);
}
.sm.soft, .sm.primary, .sm.ghost, .sm.danger, .sm.action {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  gap: 6px;
}
.sm.icon-button {
  width: 26px;
  height: 26px;
}
.lg.soft, .lg.primary, .lg.ghost, .lg.danger {
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
}
.sm svg.icon {
  width: 14px;
  height: 14px;
}
.soft svg.icon, .primary svg.icon, .ghost svg.icon, .danger svg.icon {
  width: 16px;
  height: 16px;
}
.icon-button svg.icon {
  width: 16px;
  height: 16px;
}
.busy {
  pointer-events: none;
  opacity: 0.7;
}
.link-button {
  color: var(--blue);
  font: inherit;
  font-size: 13px;
  padding: 0;
  border-radius: 4px;
}
.link-button:hover {
  text-decoration: underline;
}
.node-btn {
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 560;
  padding: 2px 0;
  font-family: var(--mono);
  font-size: 12.5px;
  border-radius: 4px;
}

/* ---------- inputs ---------- */
.input, :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"])), select, textarea {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--input-bg);
  color: var(--ink);
  font-size: 13px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
textarea {
  height: auto;
  min-height: 88px;
  padding: 8px 10px;
  line-height: 1.45;
  resize: vertical;
}
textarea.mono, input.mono, .input.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}
input::placeholder, textarea::placeholder {
  color: var(--dim);
}
input:hover, select:hover, textarea:hover {
  border-color: #3b4b5e;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 0;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgb(80 216 174 / 0.22);
}
input:disabled, select:disabled, textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: rgb(250 131 122 / 0.7);
}
input[aria-invalid="true"]:focus-visible {
  box-shadow: 0 0 0 3px rgb(250 131 122 / 0.22);
}
select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a4b2c1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 14px;
  cursor: pointer;
}
select.sm, input.sm, .input.sm {
  height: 28px;
  font-size: 12px;
  padding: 0 8px;
}
select.sm {
  padding-right: 26px;
  background-position: right 7px center;
  background-size: 13px;
}
input[type="number"] {
  font-variant-numeric: tabular-nums;
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--teal);
  cursor: pointer;
  flex: none;
}
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  align-content: start;
}
.field-label {
  font-size: 12.5px;
  font-weight: 540;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-label .req {
  color: var(--amber);
}
.field-help {
  font-size: 12px;
  color: var(--dim);
  line-height: 1.4;
}
.field-error {
  font-size: 12px;
  color: #ffb0a8;
  line-height: 1.4;
}
.field-error:empty, .field-help:empty {
  display: none;
}
.field.inline {
  grid-template-columns: minmax(120px, 160px) 1fr;
  align-items: center;
}
.field.inline .field-help, .field.inline .field-error {
  grid-column: 2;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.form-grid .full {
  grid-column: 1 / -1;
}
.form-error {
  color: #ffb0a8;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.form-error:empty {
  display: none;
}
.form-error .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  cursor: pointer;
  min-height: 24px;
}
.check .check-text {
  min-width: 0;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 520;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  flex: none;
  border-radius: 999px;
  background: var(--line-2);
  transition: background var(--dur) var(--ease);
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e9eef4;
  transition: transform var(--dur) var(--ease);
}
.switch input:checked + .switch-track {
  background: var(--teal);
}
.switch input:checked + .switch-track::after {
  transform: translateX(16px);
  background: var(--accent-ink);
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.switch input:disabled + .switch-track {
  opacity: 0.5;
}
.searchbox {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--input-bg);
  min-width: 0;
}
.searchbox:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgb(80 216 174 / 0.22);
}
.searchbox svg {
  width: 15px;
  height: 15px;
  color: var(--dim);
}
.searchbox input, .searchbox input:focus-visible {
  background: none;
  border: 0;
  height: 100%;
  padding: 0;
  width: 170px;
  box-shadow: none;
  font-size: 13px;
}
.searchbox.sm {
  height: 28px;
}
.searchbox.sm input {
  font-size: 12px;
}
.filters {
  display: flex;
  gap: 8px;
  align-items: center;
}
.filters select {
  width: auto;
}

/* ---------- tables ---------- */
.table-wrap {
  overflow: auto;
  max-height: var(--table-max, none);
  min-width: 0;
  border-radius: inherit;
}
.table-wrap:focus {
  outline: 0;
}
.table-wrap:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 13px;
  text-align: left;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
  letter-spacing: 0.01em;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
thead th:first-child {
  padding-left: 18px;
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
td:first-child {
  padding-left: 18px;
}
th:last-child, td:last-child {
  padding-right: 18px;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: rgb(255 255 255 / 0.025);
}
tbody tr.selected td {
  background: rgb(80 216 174 / 0.07);
}
tbody tr.selected td:first-child {
  box-shadow: inset 2px 0 0 var(--teal);
}
tbody tr.clickable {
  cursor: pointer;
}
tbody tr.dimmed td {
  color: var(--dim);
}
th.num, td.num {
  text-align: right;
}
td.wrap, th.wrap {
  white-space: normal;
}
td.id, .id {
  font-family: var(--mono);
  font-size: 12px;
}
td.actions-cell {
  text-align: right;
  width: 1%;
}
td.actions-cell .row {
  justify-content: flex-end;
}
table.compact th {
  padding: 7px 10px;
}
table.compact td {
  padding: 6px 10px;
  font-size: 12px;
}
table.compact th:first-child, table.compact td:first-child {
  padding-left: 14px;
}
table.compact th:last-child, table.compact td:last-child {
  padding-right: 14px;
}
.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.pager {
  display: flex;
  align-items: center;
  gap: 6px;
}
.empty {
  padding: 22px 18px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- dialogs ---------- */
dialog.dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(var(--dialog-w, 560px), calc(100vw - 32px));
  max-height: min(88vh, 900px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
dialog.dialog:not([open]) {
  display: none;
}
dialog.dialog.size-sm {
  --dialog-w: 420px;
}
dialog.dialog.size-md {
  --dialog-w: 560px;
}
dialog.dialog.size-lg {
  --dialog-w: 780px;
}
dialog.dialog.size-xl {
  --dialog-w: 980px;
}
dialog.dialog::backdrop {
  background: rgb(4 8 12 / 0.7);
  backdrop-filter: blur(2px);
}
dialog.dialog[open] {
  animation: dialog-in 160ms var(--ease);
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
}
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 {
  font-size: 16px;
  font-weight: 620;
  letter-spacing: -0.012em;
  line-height: 1.3;
}
.dialog-head p {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}
.dialog-body {
  padding: 18px 20px;
  overflow: auto;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dialog-body > p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}
.dialog-body > p strong, .dialog-body > p b {
  color: var(--ink);
}
.dialog-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: rgb(0 0 0 / 0.12);
}
.dialog-foot .spacer {
  flex: 1;
}
.dialog-foot .dialog-note {
  margin-right: auto;
  font-size: 12px;
  color: var(--dim);
}

/* ---------- stepper ---------- */
.steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 8px;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 520;
  color: var(--dim);
  white-space: nowrap;
  flex: 0 0 auto;
}
.step-index {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--panel-2);
}
.step-index svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}
.step.current {
  color: var(--ink);
}
.step.current .step-index {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--accent-ink);
}
.step.done {
  color: var(--muted);
}
.step.done .step-index {
  border-color: rgb(80 216 174 / 0.6);
  color: var(--teal);
  background: rgb(80 216 174 / 0.1);
}
.step + .step::before {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  margin: 0 10px;
  background: var(--line-2);
}
.step.done + .step::before, .step.done + .step.current::before {
  background: rgb(80 216 174 / 0.6);
}
.steps.grow .step {
  flex: 1 1 0;
}
.steps.grow .step + .step::before {
  flex: 1;
  width: auto;
}
.steps.grow .step-label {
  flex: none;
}

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
}
.tab {
  position: relative;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 540;
  color: var(--muted);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.tab:hover {
  color: var(--ink);
  background: rgb(255 255 255 / 0.03);
}
.tab[aria-selected="true"] {
  color: var(--ink);
}
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--teal);
}
.tab .count {
  margin-left: 6px;
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.segmented {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  background: var(--input-bg);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
}
.segmented button {
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 540;
  color: var(--muted);
}
.segmented button[aria-pressed="true"] {
  background: var(--panel-3);
  color: var(--ink);
}

/* ---------- toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.toolbar .spacer {
  flex: 1 1 auto;
}
.toolbar select, .toolbar input:not([type="checkbox"]):not([type="search"]), .toolbar .input, .card-actions select, .card-actions input:not([type="search"]), .row > select, .row > input:not([type="search"]) {
  width: auto;
}
.toolbar-note {
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
}

/* ---------- empty / loading ---------- */
.empty-state {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  padding: 40px 24px;
  color: var(--muted);
}
.empty-state .empty-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--dim);
  margin-bottom: 6px;
}
.empty-state .empty-icon svg {
  width: 18px;
  height: 18px;
}
.empty-state h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.empty-state p {
  font-size: 13px;
  max-width: 44ch;
  line-height: 1.5;
}
.empty-state .empty-action {
  margin-top: 10px;
}
.empty-state.compact {
  padding: 22px 18px;
}
.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  padding: 18px;
}
.spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgb(255 255 255 / 0.12);
  border-top-color: var(--teal);
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
.spinner.sm {
  width: 12px;
  height: 12px;
  border-width: 2px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.skeleton {
  display: grid;
  gap: 10px;
  padding: 4px 0;
}
.skeleton i {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--panel-2) 0%, var(--panel-3) 50%, var(--panel-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skeleton i:nth-child(2n) {
  width: 78%;
}
.skeleton i:nth-child(3n) {
  width: 60%;
}
@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}
.page-loading {
  display: grid;
  gap: 16px;
}
.page-loading .kpis .kpi {
  min-height: 92px;
}

/* ---------- toasts ---------- */
#toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  --pin: var(--teal);
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 240px;
  max-width: 380px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--pin);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
  box-shadow: var(--shadow-pop);
  animation: toast-in 180ms var(--ease);
}
.toast .icon {
  width: 16px;
  height: 16px;
  color: var(--pin);
  margin-top: 1px;
}
.toast .toast-text {
  flex: 1;
  overflow-wrap: anywhere;
}
.toast .icon-button {
  width: 24px;
  height: 24px;
  margin: -3px -3px -3px 0;
}
.toast.leaving {
  animation: toast-out 160ms var(--ease) forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ---------- code ---------- */
.code {
  position: relative;
  min-width: 0;
}
.code pre {
  margin: 0;
  padding: 12px 44px 12px 14px;
  background: #0a0f15;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: #d7e0ea;
  overflow: auto;
  white-space: pre;
  tab-size: 2;
}
.code.wrap pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.code .code-copy {
  position: absolute;
  top: 7px;
  right: 7px;
}
.code-label {
  font-size: 11.5px;
  color: var(--dim);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.copied {
  color: var(--teal);
}

/* ---------- kv ---------- */
.kv {
  display: grid;
  gap: 0;
  font-size: 12.5px;
}
.kv > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px solid rgb(255 255 255 / 0.04);
}
.kv > div:last-child {
  border-bottom: 0;
}
.kv dt {
  color: var(--muted);
  flex: none;
}
.kv dd {
  text-align: right;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.kv.stacked > div {
  display: grid;
  gap: 2px;
}
.kv.stacked dd {
  text-align: left;
}
.kv.columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
}
.metadata > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 4px 0;
}
.metadata dt {
  color: var(--muted);
}
.metadata dd {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  text-align: right;
}

/* ---------- progress ---------- */
.progress, .bar {
  --pin: var(--teal);
  position: relative;
  height: 6px;
  border-radius: 6px;
  background: var(--panel-3);
  overflow: hidden;
  min-width: 48px;
}
.progress i, .bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--pin);
  transition: width 240ms var(--ease);
}
.progress.thin {
  height: 4px;
}
.progress.thick {
  height: 8px;
}
.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.progress-row .progress {
  flex: 1;
}
.progress-row .progress-value {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex: none;
  min-width: 3.5ch;
  text-align: right;
}
.bar {
  margin: 7px 0 10px;
  height: 5px;
}

/* ---------- timeline ---------- */
.timeline {
  display: grid;
  gap: 0;
}
.timeline > li {
  position: relative;
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  padding: 0 0 14px;
  font-size: 12.5px;
}
.timeline > li::before {
  content: "";
  grid-column: 1;
  justify-self: center;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--pin, var(--grey));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pin, var(--grey)) 18%, transparent);
}
.timeline > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 6.5px;
  top: 16px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.timeline time, .timeline .when {
  color: var(--dim);
  font-size: 11.5px;
  display: block;
  margin-top: 1px;
}

/* ---------- map (FleetMap) ---------- */
.map {
  position: relative;
  width: 100%;
  height: clamp(305px, 28vw, 440px);
  overflow: hidden;
  background: radial-gradient(ellipse at 48% 38%, #182a38 0%, #132130 58%, #111b26 100%);
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.map:active {
  cursor: grabbing;
}
.map canvas, .pin-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.pin-layer {
  pointer-events: none;
}
.map-message {
  position: absolute;
  bottom: 52px;
  left: 14px;
  font-size: 12px;
  color: #d0dbe6;
  background: rgb(14 22 32 / 0.92);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 5px 8px;
}
.map-controls {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  gap: 4px;
  z-index: 2;
}
.map-controls .icon-button {
  background: rgb(14 22 32 / 0.92);
  color: #d9e3ed;
  width: 30px;
  height: 30px;
}
.map-controls svg {
  width: 15px;
  height: 15px;
}
.map-scale {
  position: absolute;
  right: 12px;
  bottom: 14px;
  color: #9dadb9;
  font: 10px var(--mono);
}
.legend {
  min-height: 38px;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  color: #b1bdca;
  font-size: 11px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.legend strong {
  color: #d9e3ed;
  font-weight: 570;
}
.map-credit {
  margin-left: auto;
  font-size: 10px;
  color: var(--dim);
}
.pin {
  pointer-events: auto;
  position: absolute;
  transform: translate(-50%, -50%);
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  padding: 0;
  touch-action: manipulation;
  z-index: 1;
}
.pin::before {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pin);
  border: 1px solid color-mix(in srgb, var(--pin), white 22%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pin) 20%, transparent), 0 0 7px #0d1721;
}
.pin.selected {
  z-index: 3;
  outline: 1px solid #eef5ff;
  outline-offset: 0;
}
.pin:focus-visible {
  z-index: 4;
}
.pin.offline::before {
  background: #17232d;
  border: 2px solid var(--pin);
  border-radius: 2px;
  transform: rotate(45deg);
}
.pin.cluster {
  background: #243a45;
  border: 1px solid var(--pin);
  color: white;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 0 0 3px rgb(24 38 44 / 0.6);
}
.pin.cluster::before {
  display: none;
}
.pin-label {
  position: absolute;
  pointer-events: none;
  padding: 4px 7px;
  background: rgb(14 22 32 / 0.96);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  color: #ecf1f8;
  font: 10.5px var(--mono);
  white-space: nowrap;
  z-index: 4;
}
.cluster-menu {
  position: absolute;
  z-index: 6;
  max-height: 170px;
  overflow: auto;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 4px;
  min-width: 150px;
  box-shadow: var(--shadow-pop);
}
.cluster-menu button {
  display: block;
  text-align: left;
  color: #e1e8f0;
  width: 100%;
  padding: 7px 8px;
  border-radius: 5px;
  font-size: 12.5px;
}
.cluster-menu button:hover {
  background: var(--panel-3);
}

/* ---------- overview building blocks (used by fleet-view) ---------- */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 27%);
  gap: 14px;
  align-items: stretch;
}
.update {
  font-size: 11.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.details {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.caption {
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 540;
}
.detail-title {
  font-size: 20px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 10px;
  font-weight: 620;
  overflow-wrap: anywhere;
}
.detail-id {
  color: var(--muted);
  margin-top: 4px;
  font: 11.5px var(--mono);
}
.detail-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}
.detail-section strong {
  font-variant-numeric: tabular-nums;
}
.stats-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stats-pair small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}
.stats-pair b {
  font-size: 20px;
  display: block;
  margin-top: 2px;
  font-weight: 620;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.details .actions, .actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.details .actions {
  margin-top: auto;
  padding-top: 14px;
}
.directory {
  margin-top: 16px;
}
.directory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 18px;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
}
.directory-head h2 {
  font-size: 15px;
  font-weight: 600;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  :root {
    --rail-w: 64px;
  }
  .rail {
    padding: 14px 8px 12px;
    gap: 14px;
  }
  .brand {
    justify-content: center;
    padding: 0;
  }
  .brand > span, .brand-tag {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 0;
    height: 40px;
  }
  .nav-item span {
    display: none;
  }
  .nav-item[aria-current="page"]::before {
    left: -8px;
  }
  .nav-item svg {
    width: 19px;
    height: 19px;
  }
  .identity {
    flex-direction: column;
    padding: 10px 0 0;
    gap: 8px;
  }
  .identity > div {
    display: none;
  }
  main {
    padding: 20px 20px 48px;
  }
  .page-head h1 {
    font-size: 23px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
  .map-credit {
    display: none;
  }
  .split, .split.wide-aside {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 36%);
  }
}
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4, .split, .split.wide-aside, .workspace, .form-grid, .kv.columns {
    grid-template-columns: minmax(0, 1fr);
  }
  .kpis, .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .page-head {
    flex-direction: column;
    align-items: stretch;
  }
  .page-head-right {
    justify-content: flex-end;
  }
  .field.inline {
    grid-template-columns: 1fr;
  }
  .searchbox input {
    width: 130px;
  }
  .map {
    height: clamp(240px, 45vw, 360px);
  }
  #toasts {
    left: 16px;
    right: 16px;
    align-items: stretch;
  }
  .toast {
    max-width: none;
  }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .spinner {
    animation: none;
    border-top-color: var(--teal);
    opacity: 0.8;
  }
}

/* === proxies === */
.proxies-host {
  font-family: var(--mono);
  font-size: 12.5px;
}
.proxies-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  margin-top: 2px;
}
.proxies-occupancy {
  min-width: 170px;
}
.proxies-secret {
  display: flex;
  gap: 6px;
  min-width: 0;
}
.proxies-secret input {
  flex: 1 1 auto;
  min-width: 0;
}
.proxies-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
}
.proxies-banner .icon {
  flex: none;
  color: var(--pin);
  margin-top: 1px;
}

/* === releases === */
.rel-name { font-size: 13px; }
.rel-guide-summary { font-size: 13px; }
.rel-guide-name { max-width: 320px; }
.rel-guide { display: grid; gap: 16px; counter-reset: rel; }
.rel-guide > li { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 12px; row-gap: 6px; }
.rel-guide > li::before {
  counter-increment: rel; content: counter(rel); grid-row: 1 / span 3; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--line-2);
}
.rel-guide > li > * { grid-column: 2; }
.rel-step-head { font-weight: 600; line-height: 26px; }
.rel-callout {
  display: flex; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--amber);
  border-radius: var(--r-sm); background: var(--panel-2); color: var(--muted); font-size: 13px; line-height: 1.5;
}
.rel-callout svg { flex: none; width: 18px; height: 18px; color: var(--amber); margin-top: 1px; }
.rel-job-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rel-job-name { font-family: var(--mono); font-size: 15px; font-weight: 620; letter-spacing: -0.01em; }
.rel-job-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 5px; font-size: 12px; color: var(--dim); }
.rel-job-summary { font-size: 13.5px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.rel-job-summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.rel-failed { color: var(--red); }
.rel-bar { display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: hidden; background: var(--panel-3); }
.rel-bar i { display: block; background: var(--pin, var(--grey)); min-width: 3px; }
.rel-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.rel-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rel-hosts { margin: 14px -18px -16px; border-top: 1px solid var(--line); }
.rel-mismatch { color: var(--amber); }
.rel-check { width: 1%; }
.rel-check .check { gap: 0; }
.rel-order { display: grid; gap: 6px; }
.rel-order li {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 10px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--panel-2); min-width: 0;
}
.rel-order li.dragging { opacity: 0.45; }
.rel-order li.over { border-color: var(--teal); }
.rel-handle { display: inline-flex; color: var(--dim); cursor: grab; }
.rel-handle svg { width: 16px; height: 16px; }
.rel-idx { width: 18px; color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.rel-order-id { min-width: 64px; }
.rel-batch { max-width: 180px; flex: none; }
.rel-summary { flex: 1 1 280px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.rel-summary strong { color: var(--ink); font-family: var(--mono); font-size: 13px; }

/* === battles === */
.battle-search { display: contents; }
.placement-switch { padding: 0 10px 0 4px; height: 34px; }
.traffic-table th { white-space: normal; line-height: 1.25; vertical-align: bottom; max-width: 120px; }
.hint-label { text-decoration: underline dotted; text-decoration-color: var(--dim); text-underline-offset: 3px; cursor: help; }
.bad-count { color: #ffb0a8; font-weight: 600; }
.leg { display: inline-grid; line-height: 1.25; }
.leg-note { font-size: 11px; color: var(--dim); }
.decision-notes p { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 0; }
.battle-detail .kv dd a { font-size: 12px; }
.admission-banner .card-body { padding: 12px 18px; color: #f8dbad; font-size: 13px; }
.admission-banner .card-body svg { color: var(--amber); }

/* === operators-audit === */
.role-tile { display: grid; gap: 8px; justify-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel-2); }
.role-tile p { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
td.role-cell select { width: auto; min-width: 150px; }
td.audit-when { color: var(--muted); width: 1%; }
.audit-action { display: grid; line-height: 1.3; }
.action-op { font: 11px var(--mono); color: var(--dim); margin-top: 2px; }
tbody tr.audit-day td { position: sticky; top: 36px; z-index: 1; padding: 6px 18px; background: var(--panel); color: var(--dim); font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em; border-bottom: 1px solid var(--line); }
tbody tr.audit-day:hover td { background: var(--panel); }

/* === overview === */
.ov-detail {
  display: flex;
  flex-direction: column;
}
.ov-detail > .card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 18px;
}
.ov-detail .kv {
  margin-top: 2px;
}
.ov-detail .kv > div {
  padding: 5px 0;
}
.ov-workspace {
  grid-template-rows: auto auto;
  align-items: start;
}
.ov-workspace > .ov-detail {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: sticky;
  top: 16px;
}
.ov-workspace > .directory {
  grid-column: 1;
  margin-top: 0;
}
.ov-workspace > .directory > .card-head {
  flex-wrap: wrap;
}
.ov-workspace > .directory .card-actions {
  flex-wrap: wrap;
}
.ov-region {
  display: block;
  margin-top: 1px;
}
@media (max-width: 900px) {
  .ov-workspace > .ov-detail {
    grid-column: auto;
    grid-row: auto;
    position: static;
  }
}
.ov-detail .actions {
  margin-top: auto;
  padding-top: 16px;
}
.ov-detail .progress {
  margin: 4px 0 10px;
}
.ov-detail .progress.faint {
  opacity: 0.35;
}
.ov-detail .empty-state.compact {
  padding-top: 36px;
}
.ov-mismatch {
  color: var(--amber);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.ov-callout {
  --pin: var(--blue);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--pin) 35%, transparent);
  background: color-mix(in srgb, var(--pin) 7%, transparent);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.ov-callout > .icon {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--pin);
}
.ov-callout h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}
.ov-callout ul {
  list-style: disc;
  padding-left: 16px;
  display: grid;
  gap: 3px;
}
.ov-watch h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 10px;
}
.ov-watch .timeline strong {
  font-weight: 600;
}
.wizard .form-error button {
  margin-left: auto;
}

/* === map-picker === */
.map-picker {
  position: relative;
  width: 100%;
  height: clamp(300px, 46vh, 460px);
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: radial-gradient(ellipse at 48% 38%, #182a38 0%, #132130 58%, #111b26 100%);
  touch-action: none;
  user-select: none;
  cursor: crosshair;
  outline: none;
}
.map-picker:focus-visible {
  box-shadow: 0 0 0 2px var(--focus);
}
.map-picker.panning, .map-picker.dragging-pin {
  cursor: grabbing;
}
.map-picker.readonly {
  height: 120px;
  cursor: default;
  border-radius: var(--r-sm);
}
.map-picker.readonly.activatable {
  cursor: pointer;
}
.map-picker.readonly.activatable:hover {
  border-color: var(--line-2);
}
.map-picker canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.mp-pin {
  position: absolute;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: none;
  transform: translate(-50%, -93%);
  cursor: grab;
  z-index: 2;
  filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.55));
}
.mp-pin:active {
  cursor: grabbing;
}
.mp-pin:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 50%;
}
.mp-pin svg {
  display: block;
  width: 100%;
  height: 100%;
}
.mp-pin-body {
  fill: var(--teal);
  stroke: #06261d;
  stroke-width: 1;
}
.mp-pin-eye {
  fill: #06261d;
}
.map-picker.readonly .mp-pin {
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.mp-pin.dropped {
  animation: mp-drop 0.32s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}
@keyframes mp-drop {
  from {
    transform: translate(-50%, -93%) translateY(-14px) scale(1.1);
  }
  to {
    transform: translate(-50%, -93%);
  }
}
.mp-readout {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  background: rgb(14 22 32 / 0.92);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: #ecf1f8;
  font: 11.5px var(--mono);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  z-index: 3;
}
.mp-readout.hint {
  font-family: var(--font);
  color: #c3cfdb;
}
.map-picker.readonly .mp-readout {
  top: 8px;
  left: 8px;
  padding: 3px 6px;
  font-size: 10.5px;
}
.mp-tip {
  position: absolute;
  z-index: 3;
  padding: 3px 6px;
  background: rgb(14 22 32 / 0.96);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  color: #ecf1f8;
  font: 10.5px var(--mono);
  white-space: nowrap;
  pointer-events: none;
}
.mp-controls {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  gap: 4px;
  z-index: 3;
}
.mp-controls .icon-button {
  width: 30px;
  height: 30px;
  background: rgb(14 22 32 / 0.92);
  color: #d9e3ed;
}
.mp-controls svg {
  width: 15px;
  height: 15px;
}
.mp-scale {
  position: absolute;
  right: 10px;
  bottom: 12px;
  color: #9dadb9;
  font: 10px var(--mono);
  pointer-events: none;
}
.mp-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
  margin-top: 12px;
}
.mp-fields .field {
  width: 150px;
}
.mp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-self: flex-end;
  margin: 0;
  padding: 0 0 10px;
  list-style: none;
  font-size: 12px;
  color: var(--muted);
}
.mp-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mp-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pin);
}
.mp-swatch.ring {
  background: none;
  border: 1.5px solid var(--pin);
}
.mp-strip {
  position: relative;
}
.mp-strip > .soft {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  background: rgb(14 22 32 / 0.92);
}
@media (prefers-reduced-motion: reduce) {
  .mp-pin.dropped {
    animation: none;
  }
}
