/* VPN Control: the owner's proxy layout in the pinned Bahnhof palette.
   No external fonts, visual effects, CDN assets, or hidden interactive controls. */
:root {
  color-scheme: dark;
  --ground: #13171C;
  --ground-deep: #0E1115;
  --surface-1: #171C22;
  --surface-2: #1B2128;
  --surface-3: #222933;
  --well: #0E1115;
  --well-rx: #0C0F13;
  --border-hair: #1E242B;
  --border-steel: #272F38;
  --border-steel-bright: #333D48;
  --text-hi: #ECE7DA;
  --text-mid: #9AA3AE;
  --text-low: #88939F;
  --text-on-accent: #15110A;
  --accent: #F7A41D;
  --accent-dim: #C97E12;
  --accent-well: rgba(247, 164, 29, .10);
  --rx: #5C82C9;
  --tx: #F7A41D;
  --signal-go: #6FB58A;
  --signal-go-fill: rgba(111, 181, 138, .12);
  --signal-caution: #C9A24B;
  --signal-caution-fill: rgba(201, 162, 75, .12);
  --signal-stop: #D06A5B;
  --signal-stop-fill: rgba(208, 106, 91, .12);
  --signal-idle: #8B9BAA;
  --radius-chip: 2px;
  --radius-ctl: 3px;
  --radius-surface: 4px;
  --radius-hero: 6px;
  --font-text: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --gutter: 18px;
  --sidebar-width: 230px;
  --section-gap: 32px;
}

* { box-sizing: border-box; }
html { background: var(--ground); scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text-hi);
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--accent-well); color: var(--text-hi); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--text-hi); }
button, input, select, textarea { font: inherit; }
input, textarea { caret-color: var(--accent); }
button, a, select, summary { touch-action: manipulation; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
[hidden] { display: none !important; }
.js-only { display: none !important; }
.js .js-only { display: flex !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link { position: fixed; z-index: 100; top: -60px; left: 18px; padding: 10px 16px; background: var(--accent); color: var(--text-on-accent); }
.skip-link:focus { top: 12px; }
.icon { width: 16px; height: 16px; display: block; flex-shrink: 0; }
.mono { font-family: var(--font-mono); font-size: 12px; }
.go { color: var(--signal-go); }
.warn { color: var(--signal-caution); }
.bad { color: var(--signal-stop); }
.idle { color: var(--signal-idle); }
.accent { color: var(--accent); }

/* Mobile starts with the same route navigation as a horizontally scrollable bar. */
.app { width: 100%; min-width: 0; }
.workspace { min-width: 0; }
.control-sidebar { background: var(--surface-1); border-bottom: 1px solid var(--border-steel); padding: 14px var(--gutter) 0; }
.side-brand, .login-brand { display: flex; align-items: center; gap: 11px; color: var(--text-hi); text-decoration: none; font-size: 15px; font-weight: 650; letter-spacing: .04em; }
.side-brand > .icon, .login-brand > .icon { width: 28px; height: 28px; color: var(--accent); }
.side-brand b, .login-brand b { color: var(--accent); font-weight: 650; }
.control-nav { display: flex; gap: 2px; overflow-x: auto; margin: 10px calc(var(--gutter) * -1) 0; padding-inline: var(--gutter); scrollbar-width: thin; scrollbar-color: var(--border-steel-bright) var(--surface-1); }
.control-nav a { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 12px; border-bottom: 2px solid transparent; color: var(--text-mid); text-decoration: none; font-weight: 550; font-size: 13px; white-space: nowrap; transition: background 130ms ease, color 130ms ease; }
.control-nav .icon { width: 15px; height: 15px; }
.control-nav a.active { color: var(--accent); background: var(--accent-well); border-bottom-color: var(--accent); }
.control-nav a:hover { color: var(--text-hi); background: var(--surface-2); }
.legacy-nav { margin: 8px 0; font-size: 12px; color: var(--text-low); }
.legacy-nav summary { cursor: pointer; min-height: 32px; padding-block: 6px; }
.legacy-nav a { display: inline-block; margin: 0 12px 8px 0; color: var(--text-mid); }
.side-spacer, .side-session { display: none; }
.logout-form { position: absolute; top: 12px; right: var(--gutter); }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 12px var(--gutter); border-bottom: 1px solid var(--border-steel); background: var(--ground); }
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.wm { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.version-chip { padding: 2px 6px; border: 1px solid var(--border-steel); border-radius: var(--radius-chip); background: var(--surface-2); color: var(--text-low); font-family: var(--font-mono); font-size: 10px; }
.topbar-right { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.topbar-right > .badge { font-size: 12px; }
.poll-controls { display: inline-flex; align-items: center; gap: 8px; }
.poll-controls label { color: var(--text-low); font-size: 12px; }
main { padding: 28px var(--gutter) 0; min-width: 0; }
.page-heading { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; margin-bottom: 28px; }
.page-heading h1 { font-size: 24px; font-weight: 650; line-height: 1.22; letter-spacing: -.02em; text-wrap: balance; }
.page-heading p { color: var(--text-mid); margin-top: 8px; max-width: 72ch; }
.page-heading time { display: block; color: var(--text-low); font-family: var(--font-mono); font-size: 11px; margin-top: 10px; }
.page-heading > .ui-btn { flex-shrink: 0; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 20px 0 max(24px, env(safe-area-inset-bottom)); margin: 40px var(--gutter) 0; border-top: 1px solid var(--border-hair); font-size: 12px; color: var(--text-low); }

/* Native controls follow the proxy panel's thin steel edges and near-square shape. */
.ui-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 7px 12px; border: 1px solid var(--border-steel); border-radius: var(--radius-ctl); background: transparent; color: var(--text-mid); font-size: 13px; font-weight: 550; text-decoration: none; line-height: 1.35; transition: border-color 130ms ease, color 130ms ease, background 130ms ease; }
.ui-btn:hover { border-color: var(--border-steel-bright); background: var(--surface-2); color: var(--text-hi); }
.ui-btn:active { background: var(--surface-3); }
.ui-btn.primary { color: var(--text-on-accent); background: var(--accent); border-color: var(--accent); font-weight: 650; }
.ui-btn.primary:hover { background: #FFB43C; border-color: #FFB43C; }
.ui-btn.primary:active { background: var(--accent-dim); }
.ui-btn.active { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-well); }
.ui-btn.danger { color: var(--signal-stop); border-color: rgba(208, 106, 91, .45); }
.ui-btn.danger:hover { background: var(--signal-stop-fill); border-color: var(--signal-stop); }
.ui-btn:disabled, fieldset:disabled .ui-btn { opacity: .48; cursor: not-allowed; }
.ui-btn[aria-busy="true"] { opacity: .65; cursor: wait; }
.icon-btn { width: 36px; padding: 7px; }
.ui-input, .ui-select { min-height: 38px; padding: 8px 10px; border: 1px solid var(--border-steel); border-radius: var(--radius-ctl); background: var(--well); color: var(--text-hi); max-width: 100%; }
.ui-input::placeholder { color: var(--text-low); opacity: 1; }
.ui-input:hover, .ui-select:hover { border-color: var(--border-steel-bright); }
.ui-input:focus, .ui-select:focus { border-color: var(--accent-dim); }
.ui-input:disabled, .ui-select:disabled { opacity: .55; cursor: not-allowed; }
.poll-select { min-height: 34px; padding-block: 5px; }
.badge { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 550; line-height: 1.5; }
.sig-sq { width: 8px; height: 8px; background: currentColor; border-radius: var(--radius-chip); flex-shrink: 0; }
.notice { padding: 14px 18px; margin-bottom: 24px; border: 1px solid var(--border-steel); border-radius: var(--radius-surface); background: var(--surface-1); overflow-wrap: anywhere; }
.notice.warn { border-color: rgba(201, 162, 75, .45); }
.notice.bad { border-color: rgba(208, 106, 91, .5); }
.notice b { font-weight: 650; }

/* Compact verdict board; process reachability never masquerades as LTE proof. */
.status-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding: 20px; background: var(--surface-1); border: 1px solid var(--border-steel); border-radius: var(--radius-hero); margin-bottom: 24px; }
.hero-verdict { flex: 1 1 auto; min-width: 0; }
.hero-verdict-top { display: flex; align-items: center; gap: 14px; }
.hero-signal { width: 12px; height: 12px; background: currentColor; flex-shrink: 0; border-radius: var(--radius-chip); }
.status-hero h2 { font-size: 22px; line-height: 1.25; font-weight: 620; letter-spacing: -.018em; }
.hero-sub { padding-left: 26px; margin-top: 10px; color: var(--text-mid); font-size: 13px; max-width: 66ch; }
.hero-figures { display: flex; align-items: center; width: 100%; }
.hero-fig { display: flex; flex-direction: column; gap: 5px; flex: 1; padding-inline: 14px; }
.hero-fig:first-child { padding-left: 0; }
.hero-fig-div { border-left: 1px solid var(--border-steel); }
.hero-fig-label { color: var(--text-low); font-size: 10px; letter-spacing: .10em; text-transform: uppercase; }
.hero-fig-val { font-size: 28px; font-weight: 620; letter-spacing: -.018em; line-height: 1.2; color: var(--text-hi); }
.hero-fig-val span { font-size: 16px; font-weight: 450; color: var(--text-mid); }
.stat-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--surface-1); border: 1px solid var(--border-hair); border-radius: var(--radius-surface); margin-bottom: var(--section-gap); }
.stat-cell { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 16px 18px; }
.stat-cell:nth-child(even) { border-left: 1px solid var(--border-steel); }
.stat-cell:nth-child(n+3) { border-top: 1px solid var(--border-steel); }
.stat-val-line { display: flex; align-items: baseline; gap: 8px; }
.stat-cell .val { font-size: 24px; font-weight: 600; letter-spacing: -.018em; line-height: 1.25; }
.stat-val-sub { font-family: var(--font-mono); font-size: 12px; color: var(--text-mid); }
.lbl { color: var(--text-low); font-size: 10px; font-weight: 620; letter-spacing: .12em; text-transform: uppercase; }

/* Sections are open board areas, not cards nested inside cards. */
.section-masthead { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.section-masthead h2 { font-size: 12px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; line-height: 1.4; }
.masthead-rule { height: 1px; flex: 1 1 24px; background: var(--border-steel); }
.masthead-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-low); }
.section-masthead .ui-btn { min-height: 30px; padding: 5px 9px; font-size: 11px; }
.nodes-section, .telemetry-section, .profiles-section, .form-section, .original-profile, .settings-section { margin-bottom: var(--section-gap); min-width: 0; }
.section-note, .form-hint { font-size: 12px; line-height: 1.6; color: var(--text-mid); margin-top: 12px; max-width: 75ch; }
.table-wrap { overflow-x: auto; background: var(--surface-1); border: 1px solid var(--border-hair); border-top-color: var(--border-steel); border-radius: var(--radius-surface); scrollbar-width: thin; scrollbar-color: var(--border-steel-bright) var(--surface-1); }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl thead th { text-align: left; font-size: 10px; color: var(--text-low); text-transform: uppercase; letter-spacing: .1em; font-weight: 620; padding: 11px 14px; border-bottom: 1px solid var(--border-steel); background: var(--surface-2); }
.tbl tbody th, .tbl td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border-hair); vertical-align: middle; }
.tbl tbody th { font-weight: 550; }
.tbl tr:last-child > * { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.node-table { min-width: 850px; table-layout: fixed; }
.node-table th:first-child { width: 19%; }
.node-table th:nth-child(2) { width: 23%; }
.node-table th:nth-child(3), .node-table th:nth-child(4), .node-table th:nth-child(5) { width: 8%; }
.node-table th:nth-child(6) { width: 19%; }
.node-table th:nth-child(7) { width: 15%; }
.node-name { display: flex; align-items: center; gap: 8px; color: var(--text-hi); text-decoration: none; font-size: 13px; overflow-wrap: anywhere; }
.node-name:hover { color: var(--accent); }
.country-code { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; padding: 1px 4px; font-size: 10px; font-family: var(--font-mono); color: var(--text-mid); background: var(--surface-2); border: 1px solid var(--border-steel); border-radius: var(--radius-chip); line-height: 16px; flex-shrink: 0; }
.node-ip { display: block; margin-top: 5px; color: var(--text-low); font-size: 10px; }
.service-summary { display: block; margin-top: 5px; font-size: 10px; }
.metric-val { font-family: var(--font-mono); font-size: 12px; }
.metric-unknown { color: var(--text-low); }
.metric-track { display: block; margin-top: 6px; width: 36px; height: 3px; background: var(--surface-3); }
.metric-track > span { display: block; height: 100%; background: var(--signal-go); }
.metric-track > .warn { background: var(--signal-caution); }
.metric-track > .bad { background: var(--signal-stop); }
.traffic-cell > span { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-family: var(--font-mono); font-size: 11px; }
.traffic-cell > span + span { margin-top: 4px; }
.traffic-cell .icon { width: 12px; height: 12px; }
.rx-text { color: var(--rx); }
.tx-text { color: var(--tx); }
.stamp-cell { color: var(--text-low); font-family: var(--font-mono); font-size: 10px; }
.node-table tr.is-stale { background: var(--signal-caution-fill); }

/* Three honest gauges share one board; network graph is the darker sunk well. */
.tab-bar { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 8px; }
.tab-link { padding: 9px 12px; border: 1px solid transparent; color: var(--text-mid); white-space: nowrap; text-decoration: none; border-radius: var(--radius-ctl); font-size: 13px; }
.tab-link.active { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-well); }
.tab-link:hover { background: var(--surface-2); color: var(--text-hi); }
.window-controls { align-items: center; gap: 8px; margin-left: auto; font-size: 12px; color: var(--text-mid); }
.window-controls .ui-select { min-height: 32px; padding: 5px 8px; }
.node-panel { margin-bottom: 24px; scroll-margin-top: 24px; }
.node-panel-header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-bottom: 14px; }
.node-panel-header h3 { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.node-panel-header h3 .mono { margin-left: 8px; color: var(--text-low); font-size: 11px; font-weight: 450; }
.node-panel-header time { font-family: var(--font-mono); font-size: 10px; color: var(--text-low); }
.kpi-band { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
.kpi-gauges { display: flex; background: var(--surface-1); border: 1px solid var(--border-hair); border-radius: var(--radius-surface); min-width: 0; }
.instrument { flex: 1 1 0; min-width: 0; padding: 14px 10px; display: flex; flex-direction: column; gap: 8px; }
.instrument + .instrument { border-left: 1px solid var(--border-hair); }
.instrument-masthead { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border-steel); }
.card-label { font-size: 10px; font-weight: 620; color: var(--text-low); letter-spacing: .12em; text-transform: uppercase; }
.instrument-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-mid); text-align: center; min-height: 30px; overflow-wrap: anywhere; }
.gauge-container { display: flex; align-items: center; justify-content: center; padding-block: 4px; }
.gauge { position: relative; width: 88px; height: 88px; flex-shrink: 0; }
.gauge-arc, .gauge-ticks { position: absolute; inset: 0; width: 100%; height: 100%; }
.gauge-arc { transform: rotate(135deg); }
.gauge circle { fill: none; stroke-linecap: butt; stroke-width: 2.3; }
.gauge .track { stroke: var(--border-steel-bright); stroke-dasharray: 70.69 94.25; }
.gauge .fill { stroke: var(--signal-go); }
.gauge .fill.memory { stroke: var(--signal-caution); }
.gauge .fill.disk { stroke: var(--rx); }
.gauge .fill.warn { stroke: var(--signal-caution); }
.gauge .fill.bad { stroke: var(--signal-stop); }
.gauge-ticks path { fill: none; stroke: var(--border-steel-bright); stroke-width: 1; }
.gauge-readout { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.gauge-readout .pct { font-size: 25px; font-weight: 620; letter-spacing: -.018em; line-height: 1.2; color: var(--text-hi); }
.gauge-unit { font-size: 10px; color: var(--text-low); }
.spark-wrap { min-height: 34px; height: 34px; margin-top: auto; border-top: 1px solid var(--border-hair); }
.instrument-foot { color: var(--text-mid); font-size: 10px; margin-top: 8px; text-align: center; }
.kpi-network { background: var(--well-rx); border: 1px solid var(--border-hair); border-top-color: var(--border-steel); border-radius: var(--radius-surface); min-width: 0; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.net-window { color: var(--text-low); font-family: var(--font-mono); font-size: 10px; }
.net-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; }
.net-legend-item { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--text-mid); }
.net-legend-item b { font-family: var(--font-mono); font-size: 12px; color: var(--text-hi); font-weight: 500; }
.ldot { width: 8px; height: 8px; display: inline-block; flex-shrink: 0; }
.ldot.rx { background: var(--rx); }
.ldot.tx { background: var(--tx); }
.chart-wrap { height: 150px; }
.history-chart { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-grid { fill: none; stroke: var(--border-steel); stroke-width: .6; }
.chart-line { fill: none; stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.chart-line.rx { stroke: var(--rx); }
.chart-line.tx { stroke: var(--tx); }
.chart-line.cpu { stroke: var(--signal-go); }
.chart-line.memory { stroke: var(--signal-caution); }
.chart-point.rx { fill: var(--rx); }
.chart-point.tx { fill: var(--tx); }
.chart-point.cpu { fill: var(--signal-go); }
.chart-point.memory { fill: var(--signal-caution); }
.chart-axis { fill: var(--text-mid); font-size: 8px; font-family: var(--font-mono); }
.chart-empty { fill: var(--text-low); font-size: 12px; font-family: var(--font-text); }
.small .chart-empty { font-size: 15px; }
.net-totals { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--text-low); font-family: var(--font-mono); font-size: 10px; }
.net-totals > span { display: inline-flex; align-items: center; gap: 4px; }
.net-totals .icon { width: 12px; height: 12px; }
.node-foot { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-block: 12px; border-bottom: 1px solid var(--border-hair); color: var(--text-low); font-size: 11px; }
.node-foot b { font-family: var(--font-mono); color: var(--text-mid); font-size: 11px; font-weight: 500; margin-left: 8px; }
.service-strip { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 12px; }
.service-item { display: flex; align-items: center; gap: 10px; font-size: 11px; }
.service-item .badge { font-size: 11px; }
.service-strip .section-note { margin-top: 0; }

/* Proxy-style asymmetric body and open route inspector. */
.body-grid { display: flex; flex-direction: column; align-items: stretch; gap: var(--section-gap); }
.body-grid > * { min-width: 0; }
.body-rail { display: flex; flex-direction: column; gap: 32px; }
.rail-section { min-width: 0; margin-bottom: 32px; }
.body-rail .rail-section { margin: 0; }
.routing-row { display: flex; flex-direction: column; gap: 7px; padding: 13px 2px; border-bottom: 1px solid var(--border-hair); }
.routing-row:first-child { padding-top: 0; }
.routing-row:last-child { border-bottom: 0; }
.routing-row-top, .routing-row-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.routing-iface { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.routing-row .badge { font-size: 11px; }
.routing-row-bottom .mono { font-size: 11px; color: var(--text-mid); }
.routing-meta { color: var(--text-low); font-size: 11px; }
.detail-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 11px 2px; border-bottom: 1px solid var(--border-hair); }
.detail-row:last-child { border-bottom: 0; }
.detail-label { color: var(--text-low); font-size: 11px; flex-shrink: 0; }
.detail-val { font-family: var(--font-mono); font-size: 12px; color: var(--text-hi); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.route-chain { list-style: none; margin: 0; padding: 0; }
.route-chain li { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 0 0 18px 24px; }
.route-chain li:last-child { padding-bottom: 0; }
.route-chain li::before { content: ""; position: absolute; top: 7px; left: 0; width: 8px; height: 8px; background: var(--signal-idle); border-radius: var(--radius-chip); }
.route-chain li:not(:last-child)::after { content: ""; position: absolute; top: 17px; bottom: 0; left: 3px; width: 1px; background: var(--border-steel-bright); }
.route-chain b { font-size: 12px; font-weight: 600; }
.route-chain span { color: var(--text-mid); font-size: 12px; }
.rail-section > .ui-btn { margin-top: 16px; }

/* Plain POST forms are always reachable without client-side code. */
.create-form { padding: 18px 0; border-block: 1px solid var(--border-hair); }
.form-row { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.form-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; flex: 1 1 auto; }
.form-field > span, .copy-field > label { font-size: 12px; font-weight: 600; color: var(--text-mid); }
.form-field .ui-input, .form-field .ui-select { width: 100%; }
.form-hint { margin-top: 12px; }
.create-submit { flex-shrink: 0; }
.empty-state { padding: 24px 0; color: var(--text-mid); font-size: 13px; }
.empty-state h3 { color: var(--text-hi); font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.empty-state p { max-width: 66ch; }
.empty-state .ui-btn { margin-top: 14px; }
.profile-list { border-top: 1px solid var(--border-steel); }
.profile-row { padding: 20px 2px; border-bottom: 1px solid var(--border-steel); min-width: 0; }
.profile-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.profile-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.profile-name h3 { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.protocol-tag { color: var(--text-low); font-size: 11px; font-family: var(--font-mono); }
.profile-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 16px; font-size: 11px; color: var(--text-mid); }
.profile-meta b { font-weight: 500; font-size: 11px; }
.profile-meta > span { overflow-wrap: anywhere; }
.copy-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; margin-top: 12px; }
.copy-field > label { overflow-wrap: anywhere; }
.copy-row { display: flex; align-items: stretch; flex-direction: column; gap: 8px; min-width: 0; }
.key-field { width: 100%; font-family: var(--font-mono); font-size: 11px; line-height: 1.6; color: var(--text-mid); resize: vertical; min-height: 58px; overflow-wrap: anywhere; }
.key-field.multiline { min-height: 76px; }
.copy-row .ui-btn { flex-shrink: 0; }
.profile-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 16px; }
.delete-disclosure { display: block; max-width: 100%; margin-left: auto; }
.delete-summary { color: var(--signal-stop); font-size: 12px; padding: 8px 10px; min-height: 36px; border: 1px solid rgba(208, 106, 91, .45); border-radius: var(--radius-ctl); cursor: pointer; }
.delete-summary:hover { background: var(--signal-stop-fill); }
.delete-form { padding: 12px 0 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.confirm-label { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--text-mid); max-width: 30ch; }
.confirm-label input { accent-color: var(--accent); margin-top: 3px; flex-shrink: 0; }
.client-traffic { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; font-size: 10px; color: var(--text-low); }
.client-traffic > span { display: inline-flex; align-items: center; gap: 4px; }
.client-traffic .icon { width: 12px; height: 12px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.grid-2 > * { min-width: 0; }
.grid-2 h3, .original-profile h3 { font-size: 14px; font-weight: 600; }
.original-profile .ui-btn { margin-top: 16px; }
.compatibility-table, .safety-table { min-width: 640px; }

/* Native settings and an escaped, read-only event journal. */
.preference-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--border-hair); }
.preference-row label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.preference-row label b { font-size: 13px; font-weight: 600; }
.preference-row label span { color: var(--text-mid); font-size: 12px; max-width: 60ch; }
.preference-row .ui-select { flex-shrink: 0; max-width: 150px; }
.native-check { accent-color: var(--accent); width: 18px; height: 18px; margin: 4px 0; flex-shrink: 0; }
.preference-actions { align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.preference-actions > span { font-size: 12px; color: var(--text-mid); }
.logs-card { min-width: 0; }
.logs-controls { align-items: stretch; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.log-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.log-filter { font-size: 11px; }
.log-filter.active[data-event-filter="bad"] { color: var(--signal-stop); background: var(--signal-stop-fill); border-color: rgba(208, 106, 91, .45); }
.log-filter.active[data-event-filter="warn"] { color: var(--signal-caution); background: var(--signal-caution-fill); border-color: rgba(201, 162, 75, .45); }
.log-filter.active[data-event-filter="go"] { color: var(--signal-go); background: var(--signal-go-fill); border-color: rgba(111, 181, 138, .45); }
.log-search-box { display: flex; align-items: center; gap: 7px; flex: 1 1 200px; min-width: 0; }
.log-search { width: 100%; min-width: 0; }
.logs-body { list-style: none; margin: 0; padding: 8px 0; background: var(--well); border: 1px solid var(--border-hair); border-top-color: var(--border-steel); max-height: 390px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border-steel-bright) var(--well); }
.event-log { max-height: 680px; }
.log-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 14px; border-bottom: 1px solid var(--border-hair); align-items: baseline; }
.log-line:last-child { border-bottom: 0; }
.log-line:hover { background: var(--surface-1); }
.log-ts { color: var(--text-low); font-family: var(--font-mono); font-size: 10px; }
.log-level { font-size: 10px; font-weight: 620; padding: 2px 5px; border-radius: var(--radius-chip); }
.log-level.go { background: var(--signal-go-fill); }
.log-level.warn { background: var(--signal-caution-fill); }
.log-level.bad { background: var(--signal-stop-fill); }
.log-level.idle { background: var(--surface-2); }
.log-msg { grid-column: 1 / -1; color: var(--text-mid); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.logs-body .empty-state { padding: 20px 14px; }
.feedback { position: fixed; z-index: 100; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); max-width: calc(100vw - 36px); padding: 12px 16px; border: 1px solid var(--border-steel-bright); border-radius: var(--radius-ctl); background: var(--surface-2); color: var(--text-hi); font-size: 13px; }

/* Authentication has its own document, never a secret dashboard under a veil. */
.login-page main { padding: 24px; }
.login-gate { min-height: calc(100vh - 48px); display: grid; place-items: center; }
.login-card { width: min(430px, 100%); padding: 28px 24px; border: 1px solid var(--border-steel); border-radius: var(--radius-hero); background: var(--surface-1); }
.login-brand { margin-bottom: 26px; }
.login-card h1 { font-size: 28px; font-weight: 650; line-height: 1.3; letter-spacing: -.02em; }
.login-card > p { font-size: 13px; color: var(--text-mid); margin-top: 8px; margin-bottom: 24px; }
.login-card .ui-input { min-height: 46px; }
.login-error { min-height: 28px; margin: 12px 0; color: var(--signal-stop); font-size: 12px; overflow-wrap: anywhere; }
.login-submit { width: 100%; justify-content: space-between; min-height: 44px; }
.login-foot { display: flex; align-items: center; gap: 8px; color: var(--text-low); font-size: 11px; margin-top: 20px; }

@media (max-width: 620px) {
  body { font-size: 16px; }
  .page-heading p, .section-note { font-size: 14px; }
  .ui-btn, .tab-link, .delete-summary { min-height: 44px; }
  .ui-input, .ui-select { font-size: 16px; min-height: 44px; }
  .icon-btn { width: 44px; }
  .topbar-right { gap: 8px; }
  .poll-controls label { display: none; }
  .key-field { font-size: 16px; }
  .profile-actions .ui-btn { flex: 1 1 auto; }
  .delete-disclosure { margin-left: 0; width: 100%; }
  .preference-row { flex-direction: column; gap: 12px; }
  .preference-row .ui-select { width: 100%; max-width: none; }
  .preference-row:has(.native-check) { flex-direction: row; }
  .section-masthead { gap: 8px; }
  .section-masthead .ui-btn { min-height: 44px; }
  .gauge { width: 80px; height: 80px; }
  .chart-axis { font-size: 9px; }
}

@media (min-width: 700px) {
  :root { --gutter: 28px; }
  .page-heading { flex-direction: row; align-items: center; justify-content: space-between; }
  .page-heading h1 { font-size: 26px; }
  .topbar-right { width: auto; justify-content: flex-end; }
  .status-hero { flex-direction: row; align-items: center; padding: 24px 28px; }
  .status-hero h2 { font-size: 26px; }
  .hero-figures { width: auto; flex-shrink: 0; }
  .hero-fig { flex: 0 1 auto; padding-inline: 20px; }
  .hero-fig:first-child { padding-left: 0; }
  .stat-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-cell:nth-child(n+2) { border-left: 1px solid var(--border-steel); }
  .stat-cell:nth-child(n+3) { border-top: 0; }
  .form-row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
  .form-field { flex: 1 1 200px; }
  .country-field { flex: 0 1 160px; }
  .create-submit { min-height: 38px; }
  .copy-row { flex-direction: row; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gauge { width: 104px; height: 104px; }
  .gauge-readout .pct { font-size: 30px; }
  .instrument { padding: 16px 22px; }
  .instrument-meta { min-height: 16px; }
  .instrument-foot { font-size: 11px; }
  .node-panel-header time { margin-left: auto; }
}

@media (min-width: 1050px) {
  :root { --gutter: 32px; --section-gap: 40px; }
  .app { max-width: 1680px; margin-inline: auto; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .control-sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 22px 14px 18px; border-right: 1px solid var(--border-steel); border-bottom: 0; }
  .side-brand { padding: 4px 7px 22px; border-bottom: 1px solid var(--border-hair); }
  .control-nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; overflow-x: visible; margin: 0; padding: 20px 0 10px; }
  .control-nav a { min-height: 42px; border-bottom: 0; border-left: 2px solid transparent; font-size: 13px; padding: 10px; }
  .control-nav a.active { border-left-color: var(--accent); }
  .legacy-nav { padding-inline: 10px; }
  .legacy-nav a { display: block; margin: 0; padding: 7px 0; }
  .side-spacer { display: block; flex: 1; min-height: 18px; }
  .side-session { display: block; padding: 14px 8px; border-top: 1px solid var(--border-hair); }
  .side-session-row { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; color: var(--text-low); }
  .side-session-row + .side-session-row { margin-top: 10px; }
  .side-session-row b, .side-session-row .badge { font-size: 10px; font-weight: 550; }
  .logout-form { position: static; margin-inline: 8px; }
  .side-logout { width: 100%; }
  .topbar { height: 56px; padding-block: 0; flex-wrap: nowrap; }
  .topbar-right { gap: 20px; }
  main { padding-top: 32px; }
  .page-heading { margin-bottom: 30px; }
  .kpi-band { flex-direction: row; gap: 24px; }
  .kpi-gauges { flex: 1.45 1 0; }
  .kpi-network { flex: 1 1 0; }
  .instrument { padding: 16px 12px; }
  .body-grid { display: grid; grid-template-columns: minmax(0, 1fr) 271px; gap: 36px; }
  .body-rail { gap: 40px; }
}

@media (min-width: 1400px) {
  :root { --gutter: 48px; }
  .instrument { padding-inline: 20px; }
}

@media (pointer: coarse) {
  .ui-btn, .tab-link, .control-nav a, .legacy-nav summary, .legacy-nav a, .delete-summary { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .gauge .track, .chart-grid { stroke: GrayText; }
  .gauge .fill, .chart-line { stroke: CanvasText; }
  .chart-axis, .chart-empty { fill: CanvasText; }
  .sig-sq, .hero-signal, .ldot { border: 1px solid CanvasText; }
  .badge { color: CanvasText; }
}

.usage-row { display:flex; flex-wrap:wrap; gap:20px; align-items:center; justify-content:space-between; padding:16px 0; border-top:1px solid var(--border-steel); }
.usage-row .section-note { display:block; margin-top:6px; }
.quota-form { display:flex; flex-wrap:wrap; align-items:end; gap:10px; }
.quota-form label { display:flex; flex-direction:column; gap:6px; font-size:12px; }
.quota-form input { width:120px; }

.mobile-bottom-nav { display:none; }
.install-steps { padding-left:24px; line-height:1.8; color:var(--text-mid); }
.password-toggle { margin-top:10px; }
@media(max-width:699px){
  :root{--gutter:16px;}
  html{scroll-padding-bottom:100px;}
  body{padding-bottom:calc(72px + env(safe-area-inset-bottom));}
  .control-sidebar{padding-top:max(12px,env(safe-area-inset-top));}
  .control-sidebar .control-nav,.control-sidebar .legacy-nav{display:none;}
  .side-brand{padding-bottom:14px;font-size:15px;}
  .side-brand>.icon{width:26px;height:26px;}
  .logout-form{top:max(8px,env(safe-area-inset-top));}
  .logout-form .ui-btn{min-width:64px;font-size:12px;}
  .topbar{min-height:0;padding-top:10px;padding-bottom:10px;}
  .topbar-brand{display:none;}
  main{padding-top:22px;}
  .page-heading h1{font-size:25px;}
  .page-heading p,.section-note,.form-hint{font-size:14px;line-height:1.55;}
  .mobile-bottom-nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));position:fixed;z-index:20;left:0;right:0;bottom:0;
    padding:6px max(6px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));
    background:var(--surface-1);border-top:1px solid var(--border-steel);}
  .mobile-bottom-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-height:52px;
    font-size:11px;color:var(--text-mid);text-decoration:none;}
  .mobile-bottom-nav .icon{width:21px;height:21px;}
  .mobile-bottom-nav a.active{color:var(--accent);background:var(--accent-well);}
  .node-table{min-width:0;width:100%;table-layout:auto;}
  .node-table thead{display:none;}
  .node-table tbody{display:grid;gap:16px;}
  .node-table tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border:1px solid var(--border-steel);background:var(--surface-1);}
  .node-table tbody th,.node-table tbody th:first-child{grid-column:1/3;width:auto;min-width:0;border:0;padding:14px 12px;}
  .node-table tbody td{min-width:0;border:0;padding:10px 12px;}
  .node-table tbody td:nth-child(2){grid-column:3/4;grid-row:1;align-self:center;padding-left:0;}
  .node-table tbody td:nth-child(2) .badge{font-size:11px;gap:5px;}
  .node-table .service-summary{font-size:10px;}
  .node-table tbody td:nth-child(3)::before{content:'CPU';}
  .node-table tbody td:nth-child(4)::before{content:'RAM';}
  .node-table tbody td:nth-child(5)::before{content:'Диск';}
  .node-table tbody td:nth-child(n+3):nth-child(-n+5)::before{display:block;font-size:11px;color:var(--text-low);margin-bottom:6px;}
  .node-table .metric-val{font-size:16px;}
  .node-table tbody td:nth-child(6){grid-column:1/3;display:flex;flex-wrap:wrap;gap:12px;border-top:1px solid var(--border-hair);}
  .node-table tbody td:nth-child(7){grid-column:3/4;font-size:10px;border-top:1px solid var(--border-hair);align-self:stretch;display:flex;align-items:center;padding-left:0;}
  .node-name{font-size:14px;}
  .node-ip{font-size:11px;}
  .status-hero{padding:16px;}
  .hero-sub{font-size:14px;}
  .key-field.multiline{font-size:13px;min-height:90px;line-height:1.5;}
  .copy-row .ui-btn{width:100%;min-height:44px;}
  .usage-row{gap:14px;}
  .usage-row>b,.usage-row b{font-size:14px;}
  .quota-form{width:100%;}
  .quota-form label{flex:1;font-size:13px;}
  .quota-form input{width:100%;}
  .quota-form button{flex:1;}
  .feedback{bottom:calc(80px + env(safe-area-inset-bottom));}
  .login-page{padding-bottom:0;}
}
