/* Panel stylesheet. Servers are drawn as rack units: faceplate, mounting ears, status LED, segmented meters. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(../fonts/archivo-latin-ext.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(../fonts/archivo-latin.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #E8ECEF;
  --rail: #DCE2E7;
  --panel: #F9FAFB;
  --white: #FFFFFF;
  --line: #C9D2D9;
  --line-strong: #B6C1CA;
  --line-soft: #DCE2E7;
  --ear: #D3DAE0;
  --screw: #8E9AA4;
  --ink: #142533;
  --ink-2: #2A3B48;
  --ink-3: #3C4C59;
  --muted: #52626F;
  --accent: #006B75;
  --accent-ink: #004E56;
  --accent-tint: #E6F0F1;
  --ok: #1FA35B;
  --ok-ink: #17663C;
  --warn: #E89B17;
  --warn-ink: #8A5A00;
  --warn-bg: #FBF0C9;
  --warn-line: #E3C254;
  --bad: #C4372B;
  --bad-ink: #A12A20;
  --bad-line: #E2B4AF;
  --bad-bg: #FBEDEB;
  --idle: #8995A0;
  --seg-off: #D3DAE0;
  --admin: #142533;
  --admin-2: #2B4557;
  --admin-text: #C9D4DC;
  --admin-muted: #8FA0AD;
  --radius: 6px;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 3px solid #3B8EEA; outline-offset: 2px; }
img, svg { max-width: 100%; }
h1, h2, h3 { margin: 0; color: var(--ink); }
p { margin: 0; }
code, .mono { font-family: var(--mono); }
.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.strong { font-weight: 650; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.wrap-any { overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- layout */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: stretch; }
.rail {
  flex: 1 1 232px;
  display: flex; flex-direction: column; gap: 26px;
  padding: 24px 16px;
  background: var(--rail);
  border-right: 1px solid #C6CFD6;
}
.main { flex: 999 1 560px; min-width: 0; padding: 32px 40px 72px; }
.wrap { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.wrap.narrow { max-width: 760px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.title { font-size: 32px; font-weight: 720; font-stretch: 114%; letter-spacing: -0.015em; line-height: 1.1; }
.sub { margin-top: 6px; font-size: 15px; color: var(--muted); }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { font-weight: 600; }
.crumbs .sep { margin: 0 8px; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-main { flex: 3 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.col-side { flex: 2 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row.gap-l { gap: 16px; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.gap-l { gap: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 16px; }
.grid.narrow { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid .full { grid-column: 1 / -1; }

/* ------------------------------------------------------------------ rail */
.brand {
  display: flex; align-items: center; gap: 10px; padding: 4px 8px;
  color: var(--ink); text-decoration: none;
  font-size: 22px; font-weight: 750; font-stretch: 122%; letter-spacing: -0.01em;
}
.brand svg { color: var(--accent); flex: 0 0 auto; }
.brand .tag {
  margin-left: 2px; padding: 1px 7px; border: 1px solid #4A6273; border-radius: 4px;
  font-size: 12px; font-weight: 650; font-stretch: 100%; color: var(--admin-text);
}
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  border-radius: var(--radius); color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, 0.55); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--panel); box-shadow: inset 0 0 0 1px #C6CFD6; color: var(--ink); font-weight: 650; }
.nav a .grow { flex: 1 1 auto; }
.nav .count { font-size: 13px; font-weight: 600; color: var(--muted); }
.badge { padding: 2px 8px; border-radius: 999px; background: #F2C230; color: var(--ink); font-size: 12px; font-weight: 700; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 14px 12px 0; border-top: 1px solid #C6CFD6; }
.rail-foot .who { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.rail-foot .mail { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.rail-foot form { margin: 0; }
.linkbtn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0;
  border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.linkbtn:hover { color: var(--ink); text-decoration: underline; }

.rail.admin { background: var(--admin); border-right-color: var(--admin); color: var(--admin-text); gap: 20px; padding: 22px 14px; }
.rail.admin .brand { color: var(--white); }
.rail.admin .brand svg { color: #5FD0DA; }
.rail.admin .group-title { padding: 0 10px 4px; font-size: 13px; font-weight: 600; color: var(--admin-muted); }
.rail.admin .nav a { min-height: 40px; padding: 0 10px; color: var(--admin-text); }
.rail.admin .nav a:hover { background: #1D3446; color: var(--white); }
.rail.admin .nav a[aria-current="page"] { background: var(--admin-2); box-shadow: none; color: var(--white); }
.rail.admin .groups { display: flex; flex-direction: column; gap: 16px; }
.rail.admin .rail-foot { border-top-color: var(--admin-2); }
.rail.admin .rail-foot .who { color: var(--white); }
.rail.admin .rail-foot .mail { color: var(--admin-muted); }
.rail.admin .linkbtn { color: var(--admin-text); }
.rail.admin .linkbtn:hover { color: var(--white); }

/* ------------------------------------------------------------- rack units */
.units { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.unit {
  display: flex; align-items: stretch; min-height: 96px;
  background: var(--panel); border: 1px solid #C2CBD3; border-radius: 4px;
  box-shadow: inset 0 1px 0 var(--white), 0 1px 2px rgba(20, 37, 51, 0.08);
  overflow: hidden;
}
.ear {
  flex: 0 0 18px; display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  padding: 14px 0; background: var(--ear); border-right: 1px solid #C2CBD3;
}
.ear:last-child { border-right: 0; border-left: 1px solid #C2CBD3; }
.ear span { width: 6px; height: 10px; border-radius: 3px; background: var(--screw); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.35); }
.unit.big .ear { flex-basis: 22px; padding: 16px 0; }
.unit.big .ear span { width: 7px; height: 12px; border-radius: 4px; }
.face {
  flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center;
  gap: 16px 28px; padding: 18px 22px;
}
.unit.big .face { padding: 22px 26px; gap: 18px 32px; justify-content: space-between; }
.ident { flex: 2 1 260px; min-width: 0; display: flex; gap: 14px; align-items: flex-start; }
.ident .host {
  display: block; color: var(--ink); text-decoration: none;
  font-size: 19px; font-weight: 720; font-stretch: 118%; letter-spacing: -0.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ident a.host:hover { text-decoration: underline; }
.unit.big .ident .host { font-size: 30px; font-weight: 740; font-stretch: 120%; letter-spacing: -0.012em; line-height: 1.15; white-space: normal; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 6px; font-size: 14px; color: var(--muted); }
.addr { flex: 1 1 170px; min-width: 0; font-variant-numeric: tabular-nums; line-height: 1.55; }
.addr .v4 { font-size: 15px; font-weight: 600; }
.addr .v6 { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spec { flex: 1 1 120px; font-size: 14px; color: var(--ink-3); line-height: 1.55; }
.gauges { flex: 1.6 1 240px; min-width: 0; }
.actions { flex: 0 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill {
  display: inline-block; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 3px;
  font-size: 12px; font-weight: 650; letter-spacing: 0.03em; color: var(--ink-3);
}

.led { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: var(--idle); }
.unit.big .led { width: 12px; height: 12px; margin-top: 12px; }
.led.run { background: var(--ok); box-shadow: 0 0 0 3px rgba(31, 163, 91, 0.16), 0 0 10px rgba(31, 163, 91, 0.55); }
.led.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(232, 155, 23, 0.18), 0 0 10px rgba(232, 155, 23, 0.5); }
.led.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(196, 55, 43, 0.16), 0 0 10px rgba(196, 55, 43, 0.5); }
.led.inline { display: inline-block; margin: 0 6px 0 0; width: 8px; height: 8px; vertical-align: 1px; }
@keyframes ledpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.pulse { animation: ledpulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

.st-ok { color: var(--ok-ink); font-weight: 650; }
.st-warn { color: var(--warn-ink); font-weight: 650; }
.st-bad { color: var(--bad-ink); font-weight: 650; }
.st-idle { color: var(--muted); font-weight: 650; }

/* segmented meters */
.meters { display: grid; gap: 7px; }
.meter-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) 46px; align-items: center; gap: 10px; font-size: 13px; }
.meter-row.wide { grid-template-columns: 92px minmax(0, 1fr) 46px; }
.meter-row .k { color: var(--muted); }
.meter-row .v { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.segs { display: flex; gap: 2px; }
.segs i { flex: 1 1 0; height: 10px; border-radius: 1px; background: var(--seg-off); }
.segs.tall i { height: 14px; }
.segs i.on { background: var(--accent); }
.segs i.warn { background: #D08A0E; }
.segs i.hot { background: var(--bad); }
.segs i.step { background: var(--accent); }
.segs i.now { background: var(--warn); }
.usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px 32px; }
.usage .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.usage .head .k { font-size: 15px; font-weight: 600; }
.usage .head .v { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- panels */
.panel { padding: 22px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.panel.raised { border-color: #C2CBD3; box-shadow: inset 0 1px 0 var(--white), 0 1px 2px rgba(20, 37, 51, 0.08); }
.panel.danger { background: var(--white); border-color: var(--bad-line); }
.panel.danger > h2 { color: var(--bad-ink); }
.panel > h2, .panel-head h2 { font-size: 19px; font-weight: 700; font-stretch: 110%; }
.panel > h2 { margin-bottom: 12px; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.panel .intro { margin: -4px 0 14px; font-size: 14px; color: var(--ink-3); }
.section-title { font-size: 21px; font-weight: 720; font-stretch: 112%; }

dl.kv { margin: 0; }
dl.kv > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
dl.kv > div:first-child { border-top: 0; }
dl.kv dt { font-size: 14px; color: var(--muted); }
dl.kv dd { margin: 0; font-size: 15px; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
dl.kv.copyable > div { align-items: center; padding: 4px 0; flex-wrap: nowrap; }
dl.kv.copyable dt { flex: 0 0 104px; }
dl.kv.copyable dd { flex: 1 1 auto; min-width: 0; text-align: left; font-variant-numeric: tabular-nums; }

.lines { list-style: none; margin: 0; padding: 0; }
.lines > li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.lines > li:first-child { border-top: 0; }
.lines .grow { flex: 1 1 260px; min-width: 0; }
.lines .when { flex: 0 0 130px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.lines .t { font-size: 15px; font-weight: 650; }
.lines .d { font-size: 14px; color: var(--ink-3); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--idle); flex: 0 0 auto; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }

.readouts { display: flex; flex-wrap: wrap; background: var(--panel); border: 1px solid #C2CBD3; border-radius: var(--radius); box-shadow: inset 0 1px 0 var(--white), 0 1px 2px rgba(20, 37, 51, 0.08); }
.readout { flex: 1 1 190px; padding: 18px 22px; border-right: 1px solid var(--line-soft); }
.readout:last-child { border-right: 0; }
.readout .k { font-size: 14px; color: var(--muted); }
.readout .v { margin-top: 4px; font-size: 30px; font-weight: 720; font-stretch: 112%; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.readout .v.warn { color: var(--warn-ink); }
.readout .v.bad { color: var(--bad-ink); }
.readout .s { margin-top: 2px; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- banners */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 14px 18px; border-radius: var(--radius); border: 1px solid; font-size: 15px; }
.banner p { flex: 1 1 360px; }
.banner.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.banner.bad { background: var(--bad-bg); border-color: var(--bad-line); }
.banner.info { background: var(--accent-tint); border-color: #A8CBCF; }
.banner.ok { background: #E7F4EC; border-color: #9CCBB0; }
.flash { display: flex; flex-direction: column; gap: 8px; }
.flash .msg { padding: 12px 16px; border-radius: var(--radius); border: 1px solid #9CCBB0; background: #E7F4EC; font-size: 15px; }
.flash .msg.bad { border-color: var(--bad-line); background: var(--bad-bg); }
.flash .msg.warn { border-color: var(--warn-line); background: var(--warn-bg); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--white); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #8E9CA8; color: var(--ink); background: #FDFEFE; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--white); font-weight: 650; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--white); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--white); }
.btn.dark:hover { background: #22394B; color: var(--white); }
.btn.danger { border-color: var(--bad-line); color: var(--bad-ink); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad-ink); }
.btn.danger.solid { background: #B3261E; border-color: #B3261E; color: var(--white); }
.btn.danger.solid:disabled { background: #D9A9A4; border-color: #D9A9A4; cursor: not-allowed; }
.btn.warn { border-color: #C98A0B; background: #FFF7E5; color: #6E4700; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost.danger { color: var(--bad-ink); }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn.big { min-height: 48px; font-size: 16px; font-weight: 700; }
.btn.block { display: flex; width: 100%; }
.btn.icon { width: 44px; padding: 0; flex: 0 0 44px; border-color: transparent; background: transparent; color: var(--ink-3); }
.btn.icon:hover { background: var(--line-soft); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn svg { flex: 0 0 auto; }
form.inline { display: inline; margin: 0; }

/* ------------------------------------------------------------------ forms */
label, .label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 650; }
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="url"], input[type="date"], select, textarea {
  width: 100%; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--white);
  color: var(--ink); font: inherit; font-size: 15px;
}
textarea { padding: 10px 12px; min-height: 96px; resize: vertical; }
textarea.code-input { font-family: var(--mono); font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); outline: none; }
input[aria-invalid="true"] { border-color: var(--bad); }
.hint { margin-top: 4px; font-size: 13px; color: var(--muted); }
.error-text { margin-top: 4px; font-size: 13px; color: var(--bad-ink); font-weight: 600; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 40px; margin: 0; font-size: 15px; font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.check .t { font-weight: 650; }
.check .d { display: block; font-size: 14px; color: var(--ink-3); }
.inline-input { display: flex; gap: 8px; }
.inline-input input { flex: 1 1 auto; min-width: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { display: flex; align-items: center; gap: 12px; padding: 0; margin-bottom: 14px; font-size: 19px; font-weight: 700; font-stretch: 110%; }
legend .step {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 5px; border: 1px solid #9FADB8; font-size: 14px; font-weight: 700; color: var(--ink-3);
}
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choices.list { flex-direction: column; gap: 8px; }
.choices.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.choice {
  display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px 18px; min-height: 52px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: 0 0 auto; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-tint); }
.choice:has(input:disabled) { opacity: 0.62; cursor: not-allowed; }
.choice.wide { flex: 1 1 260px; align-items: flex-start; }
.choice .t { display: block; font-size: 17px; font-weight: 700; font-stretch: 108%; }
.choice .d { display: block; margin-top: 3px; font-size: 14px; font-weight: 400; color: var(--ink-3); }
.choice.plan { flex-wrap: wrap; gap: 10px 20px; padding: 14px 18px; }
.choice.plan .name { flex: 0 0 96px; font-size: 17px; font-weight: 720; font-stretch: 116%; }
.choice.plan .specs { flex: 3 1 300px; display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 15px; font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.choice.plan .price { margin-left: auto; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.choice.plan .price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.tabs-inline { display: flex; flex-wrap: wrap; gap: 10px; }
.tab-choice {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--white); color: var(--ink); text-decoration: none; font-weight: 600;
}
.tab-choice[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-tint); }
.tab-choice.wide { flex: 1 1 280px; flex-direction: column; align-items: flex-start; justify-content: center; padding: 16px 20px; }
.tab-choice.wide .t { font-size: 17px; font-weight: 700; font-stretch: 108%; }
.tab-choice.wide .d { margin-top: 3px; font-size: 14px; font-weight: 400; color: var(--ink-3); }

.switch {
  position: relative; flex: 0 0 auto; width: 52px; height: 30px; margin: 7px 0; padding: 0;
  border: 0; border-radius: 999px; background: #9AA7B2; cursor: pointer;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(20, 37, 51, 0.35); transition: left 0.15s;
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { left: 25px; }
@media (prefers-reduced-motion: reduce) { .switch::after { transition: none; } }
.setting { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.setting:first-of-type { border-top: 0; }
.setting .grow { flex: 1 1 auto; min-width: 0; }
.setting .t { font-size: 15px; font-weight: 650; }
.setting .d { font-size: 14px; color: var(--ink-3); }
.setting.flow { flex-wrap: wrap; }

/* ------------------------------------------------------------------ tables */
.table { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { padding: 8px 12px; text-align: left; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.data td { padding: 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
table.data th:first-child, table.data td:first-child { padding-left: 0; }
table.data th:last-child, table.data td:last-child { padding-right: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .strong { font-weight: 650; }
table.data .sub-line { display: block; font-size: 13px; color: var(--muted); }
table.data a.rowlink { color: var(--ink); font-weight: 650; text-decoration: none; }
table.data a.rowlink:hover { text-decoration: underline; }
.state { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; white-space: nowrap; }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--idle); }
.state.ok { color: var(--ok-ink); } .state.ok::before { background: var(--ok); }
.state.warn { color: var(--warn-ink); } .state.warn::before { background: var(--warn); }
.state.bad { color: var(--bad-ink); } .state.bad::before { background: var(--bad); }
.state.idle { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.filters input, .filters select { min-height: 40px; width: auto; }
.filters input[type="search"] { width: 260px; }
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* ----------------------------------------------------------------- tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid #C6CFD6; }
.tabs a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; margin-bottom: -1px;
  color: var(--ink-3); text-decoration: none; font-size: 15px; font-weight: 500; border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 650; border-bottom-color: var(--accent); }
.tabs a .n { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------------ code */
.cmd { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 14px; border-radius: var(--radius); background: var(--ink); color: #E3EAEF; }
.cmd code { flex: 1 1 auto; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.cmd .btn.icon { color: #E3EAEF; background: #233849; }
.cmd .btn.icon:hover { background: #2E4659; }
pre.code { margin: 0; padding: 14px 16px; border-radius: var(--radius); background: var(--ink); color: #D7E1E8; font-family: var(--mono); font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.secret-box { padding: 16px; border: 1px dashed var(--accent); border-radius: var(--radius); background: var(--white); }
.secret-box code { font-size: 20px; font-weight: 600; letter-spacing: 0.04em; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ chart */
.chart { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; }
.chart .yaxis { display: flex; flex-direction: column; justify-content: space-between; height: 200px; font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.chart svg { display: block; width: 100%; height: 200px; }
.chart .xaxis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart .grid-line { stroke: var(--line-soft); }
.chart .base-line { stroke: var(--line-strong); }
.chart .area { fill: rgba(0, 107, 117, 0.14); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.chart .line.second { stroke: #B4610F; }
.seg-switch { display: inline-flex; padding: 3px; border-radius: 7px; background: #E3E8EC; }
.seg-switch a { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 5px; color: var(--ink-3); text-decoration: none; font-size: 14px; font-weight: 500; }
.seg-switch a[aria-current="true"] { background: var(--white); box-shadow: 0 1px 2px rgba(20, 37, 51, 0.12); color: var(--ink); font-weight: 650; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; margin-right: 6px; vertical-align: 3px; background: var(--accent); }
.legend i.second { background: #B4610F; }

/* ------------------------------------------------------------------ order */
.summary { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; }
.summary .plan-name { font-size: 21px; font-weight: 740; font-stretch: 118%; }
.summary .total { font-size: 26px; font-weight: 750; font-stretch: 110%; font-variant-numeric: tabular-nums; }
.summary dl.kv > div { padding: 9px 0; }
.summary dl.kv > div.total-row { border-top-color: var(--line-strong); padding-top: 12px; align-items: baseline; }

/* --------------------------------------------------------------- auth */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 20px; }
.auth-card .brand { justify-content: center; }
.auth-card .panel { padding: 28px; }
.auth-card h1 { font-size: 26px; font-weight: 720; font-stretch: 112%; margin-bottom: 6px; }
.auth-card .foot { text-align: center; font-size: 15px; }
.qr { display: flex; justify-content: center; padding: 8px; }
.qr svg { width: 200px; height: 200px; }

/* ---------------------------------------------------------- printable */
.invoice-doc { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; }
.invoice-doc .top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.invoice-doc h1 { font-size: 28px; font-weight: 740; font-stretch: 116%; }
.invoice-doc .parties { display: flex; flex-wrap: wrap; gap: 32px; margin: 28px 0; font-size: 14px; }
.invoice-doc .parties div { flex: 1 1 220px; white-space: pre-line; }
.invoice-doc .totals { margin-left: auto; max-width: 360px; }
.invoice-doc .foot { margin-top: 28px; font-size: 13px; color: var(--muted); white-space: pre-line; }
@media print {
  body { background: var(--white); }
  .no-print, .rail { display: none !important; }
  .main { padding: 0; }
  .invoice-doc { border: 0; padding: 0; }
}

/* ----------------------------------------------------------- console */
.console-page { min-height: 100vh; display: flex; flex-direction: column; background: #0E1A24; color: #D7E1E8; }
.console-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 16px; background: var(--ink); border-bottom: 1px solid #22394B; }
.console-bar .host { font-weight: 700; font-stretch: 112%; }
.console-bar .status { font-size: 14px; color: #A9B8C3; }
.console-bar .grow { flex: 1 1 auto; }
.console-bar .btn { background: #22394B; border-color: #2E4659; color: #E3EAEF; }
.console-screen { flex: 1 1 auto; position: relative; min-height: 400px; }
.console-screen > div { position: absolute; inset: 0; }

.empty { padding: 40px 24px; text-align: center; background: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty h2 { font-size: 21px; font-weight: 720; font-stretch: 112%; margin-bottom: 6px; }
.empty p { color: var(--ink-3); margin-bottom: 16px; }

@media (max-width: 720px) {
  .main { padding: 20px 16px 56px; }
  .title { font-size: 26px; }
  .rail { flex-basis: 100%; padding: 12px 16px; gap: 12px; border-right: 0; border-bottom: 1px solid #C6CFD6; }
  .rail .nav { flex-direction: row; flex-wrap: wrap; }
  .rail .nav a { min-height: 40px; }
  .rail-foot { display: none; }
  .rail.admin .groups { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .rail.admin .group-title { display: none; }
  .unit.big .ident .host { font-size: 22px; }
  .face { padding: 14px 16px; }
  .readout .v { font-size: 24px; }
  .invoice-doc { padding: 20px; }
}

/* ---------------------------------------------------------------- dialog */
.dialog { max-width: 440px; width: calc(100% - 32px); padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); box-shadow: 0 12px 40px rgba(20, 37, 51, 0.25); }
.dialog::backdrop { background: rgba(20, 37, 51, 0.45); }
.btn.copied { color: var(--ok-ink); }
.cf-turnstile { min-height: 65px; }
.ident > div { min-width: 0; }
.progress-note { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--ink-3); }
.progress-note .segs i { height: 6px; }
.progress-note .segs i.now { animation: ledpulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .progress-note .segs i.now { animation: none; } }
.snap-list .when { flex-basis: 170px; }
.key-line { font-family: var(--mono); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.panel .cmd + p { margin: 12px 0; }
.panel form + form { margin-top: 12px; }
.panel > .stack > h3, .panel h3 { font-size: 16px; font-weight: 700; }
.split { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; }
.split > div { flex: 1 1 220px; }
.readout-v { font-size: 30px; font-weight: 720; font-stretch: 112%; margin: -4px 0 8px; }
.console-bar input[type="text"] { min-height: 38px; width: 240px; background: #0E1A24; color: #E3EAEF; border-color: #2E4659; }
details.panel > summary { cursor: pointer; list-style-position: outside; margin-left: 18px; }
details.panel[open] > summary { margin-bottom: 18px; }
details.panel h3 { margin-bottom: 8px; }
.check.tiny { min-height: 28px; font-size: 13px; }

.filters input:not([type]) { width: auto; }
@media (max-width: 720px) { dl.kv.copyable dt { flex-basis: 84px; } }
form.inline { display: inline-flex; flex-wrap: wrap; gap: 8px; }
