/* The control plane. The workspace's tokens and components (/app.css: ink, white, one blue, Geist) with a top bar
   instead of the sidebar, and a few pieces of its own. Works down to a phone: 16px gutters, tables scroll in place. */
body.adm { background: #fff; }
.adm-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px 22px; flex-wrap: wrap; padding: 12px 28px; background: #fff; border-bottom: 1px solid var(--line-soft); }
.adm-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.adm-brand img { height: 20px; width: auto; display: block; }
.adm-brand span { font-size: 13px; color: var(--blue-text); font-weight: 500; padding: 1px 8px; border-radius: 999px; background: var(--blue-tint); }
.adm-nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.adm-nav::-webkit-scrollbar { display: none; }
.adm-nav a { padding: 7px 12px; border-radius: 9px; text-decoration: none; color: var(--text-2); font-size: 14px; white-space: nowrap; }
.adm-nav a:hover { background: var(--paper); color: var(--ink); }
.adm-nav a.on { background: var(--grey-tint); color: var(--ink); font-weight: 500; }
.adm-me { display: flex; align-items: center; gap: 10px; }
.adm-main { padding: 26px 28px 80px; max-width: 1280px; margin: 0 auto; }
.adm-main h1 { margin-bottom: 4px; }
.adm-main section { margin-top: 28px; }
.adm-main section > h2 { margin-bottom: 12px; }
.adm-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.adm-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.scroll .table { min-width: 640px; }
.table td.r, .table th.r { text-align: right; }
.table td small { display: block; color: var(--muted); font-size: 12.5px; }
.table .mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

.meter { display: grid; gap: 4px; min-width: 120px; }
.meter .bar { width: 100%; height: 6px; }
.meter .bar i { width: 0; }
.meter .bar i.low { background: var(--amber); } .meter .bar i.out { background: var(--red); }
.meter span { font-size: 12.5px; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.cards > * { min-width: 0; }
.card h3 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card .hint { font-size: 13px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.form-grid .field, .form-row .field { align-content: start; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.form-row .field { flex: 1; min-width: 140px; }
form .btn { align-self: end; }
.field .help { font-size: 12.5px; color: var(--muted); }

.switches { display: grid; gap: 2px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.switch:last-child { border-bottom: 0; }
.switch input { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; border-radius: 10px; background: var(--grey-tint); border: 1px solid var(--line); position: relative; cursor: pointer; flex: none; margin: 0; transition: background 0.15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15, 26, 38, 0.2); transition: left 0.15s; }
.switch input:checked { background: var(--blue); border-color: var(--blue); }
.switch input:checked::after { left: 18px; }
.switch code { font-size: 12.5px; color: var(--muted); }

.steps { display: grid; gap: 0; counter-reset: s; }
.step { display: grid; grid-template-columns: 22px 1fr; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); align-items: start; }
.step:last-child { border-bottom: 0; }
.step .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); margin-top: 2px; }
.step.done .dot { background: var(--green); border-color: var(--green); }
.step.running .dot { border-color: var(--blue); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.step.failed .dot { background: var(--red); border-color: var(--red); }
.step b { font-weight: 500; }
.step p { grid-column: 2; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.step.failed p { color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .step.running .dot { animation: none; border-top-color: var(--blue); } }

.chart { width: 100%; height: 160px; display: block; }
.chart rect.ws { fill: var(--blue); } .chart rect.iv { fill: var(--wf-2); } .chart rect.cr { fill: var(--blue); }
.chart line { stroke: var(--line-soft); }
.chart-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--blue); }
.legend i.iv { background: var(--wf-2); }

.banner { overflow-wrap: anywhere; padding: 12px 16px; border-radius: 12px; background: var(--red-tint); color: var(--red); font-size: 14px; margin-bottom: 16px; }
.banner.amber { background: var(--amber-tint); color: var(--amber); }
.banner.blue { background: var(--blue-tint); color: var(--blue-text); }
.rule { font-size: 13px; color: var(--text-2); background: var(--paper); border-radius: 10px; padding: 10px 14px; }
.kv.tight { grid-template-columns: minmax(110px, 150px) 1fr; gap: 6px 14px; font-size: 13.5px; }
.change { font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.change del { color: var(--muted); }
.change ins { text-decoration: none; color: var(--ink); }
.err-line { font-size: 12.5px; overflow-wrap: anywhere; }
.signin-card { max-width: 420px; margin: 12vh auto 0; display: grid; gap: 16px; text-align: center; justify-items: center; }
.signin-card img { height: 26px; width: auto; }
.signin-card .btn { justify-content: center; }
.dl-inline { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.dl-inline b { color: var(--ink); font-weight: 500; }
details.revs summary { cursor: pointer; color: var(--blue-text); font-size: 13px; }
.stats b small { font-size: 14px; color: var(--muted); font-weight: 400; }

@media (max-width: 720px) {
  .adm-top { padding: 10px 16px; }
  .adm-nav { order: 3; flex-basis: 100%; }
  .adm-me { margin-left: auto; }
  .adm-me #me { display: none; }
  .adm-main { padding: 18px 16px 64px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .stats { gap: 6px 24px; }
}
