/* Paper, ink and a restrained terracotta accent. No remote fonts or UI runtime. */
.workflow-callout { padding: 14px 18px; border-left: 3px solid var(--accent); border-radius: 6px; background: var(--surface-2); line-height: 1.65; overflow-wrap: anywhere; }
.path-hop { min-width: 0; margin: 18px 0; }
.path-hop .toolbar { justify-content: flex-end; margin-top: 12px; }
.path-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 12px; }
.path-picker .path-hop { margin: 0; padding: 14px; border-radius: 10px; }
.path-picker label { margin: 8px 0; }
.path-picker legend { font-size: 12px; padding: 0 6px; }
.path-picker details { padding: 0 10px; margin: 10px 0 0; }
.path-picker summary { font-size: 11px; }
.path-picker .form-grid { grid-template-columns: 1fr; gap: 0; }
.endpoint-summary { margin: 8px 0; padding: 10px; background: var(--surface-2); border-radius: 6px; font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.address-setup { padding: 10px; border: 1px solid var(--line-strong); border-radius: 8px; margin-top: 8px; }
.address-setup button { font-size: 11px; }
.path-picker .error:empty { display: none; }
.path-hop-placeholder { padding: 16px; border: 1px dashed var(--accent); border-radius: 10px; background: var(--surface-2); }
.path-hop-placeholder strong { font-size: 12px; color: var(--accent); }
.path-hop-placeholder p { font-size: 13px; }
.path-inspector { margin: 16px 0; border: 1px solid var(--accent); border-radius: 12px; background: var(--surface); scroll-margin: 80px; }
.path-inspector-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.path-inspector-head h3 { margin: 0; font-size: 14px; }
.path-inspector-body { padding: 0 18px 18px; }
.path-inspector .path-hop { margin-bottom: 0; }
.path-inspector .path-hop .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) {
  .path-inspector-body.with-service { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .path-inspector-body.with-service .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .path-inspector .path-hop .form-grid { grid-template-columns: 1fr; }
}
.setup-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 20px; }
.setup-card { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 24px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.setup-card h3 { margin: 16px 0 8px; font-size: 18px; }
.setup-card p { margin: 0 0 18px; color: var(--text-2); font-size: 13px; line-height: 1.7; }
.setup-card .setup-route { width: 100%; padding: 12px; border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
.setup-card button { margin-top: auto; }
.setup-step { margin: 24px 0 12px; font-size: 16px; }
.setup-step:first-child { margin-top: 0; }
dialog:has(.setup-cards) { width: min(960px, calc(100% - 32px)); }
dialog .setup-cards { padding: 0; margin: 20px 0; }
.path-summary { margin: 20px; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; }
.path-summary-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; }
.path-summary-head h3 { margin: 0 0 6px; font-size: 16px; }
.path-summary-head p { margin: 0; }
.path-summary .forwarding-diagram { margin: 0; border-width: 1px 0; border-radius: 0; }
.path-summary .flow-heading { display: none; }
.path-summary .flow-card > .fine { display: none; }
.path-summary .flow-terminal > .mono { font-size: 11px; }
.path-summary .flow-track { padding: 18px; }
.path-node-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 16px 20px; }
@media (min-width: 651px) {
  .path-summary .flow-card { flex-basis: 150px; width: 150px; }
  .path-summary .flow-terminal { flex-basis: 132px; width: 132px; }
  .path-summary .flow-edge { flex-basis: 64px; width: 64px; padding: 0 2px; overflow-wrap: normal; }
}
@media (max-width: 650px) {
  .setup-cards { grid-template-columns: 1fr; padding: 14px; }
  .setup-card { padding: 18px; }
  .path-summary { margin: 14px; }
  .path-summary-head { align-items: flex-start; padding: 16px; }
}

/* The live path is a routing explanation, never an animated health indicator. */
dialog:has(.forwarding-diagram) { width: min(1120px, calc(100% - 32px)); }
dialog:has(.forwarding-diagram) .dialog-head { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.forwarding-diagram { min-width: 0; margin: 20px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.flow-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.flow-heading h3 { font-size: 14px; margin: 0; }
.flow-figure { margin: 0; }
.flow-track { display: flex; align-items: center; overflow: auto; padding: 24px 18px; background: var(--surface-2); background-image: radial-gradient(var(--line-strong) .65px, transparent .65px); background-size: 14px 14px; }
.flow-route, .flow-branch { display: flex; align-items: center; flex: 0 0 auto; }
.flow-card { display: flex; flex-direction: column; align-items: flex-start; flex: 0 0 160px; width: 160px; padding: 12px; gap: 7px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); overflow-wrap: anywhere; }
.flow-card > strong { font-size: 13px; line-height: 1.5; }
.flow-card.flow-selectable { text-align: left; white-space: normal; color: var(--text); font-weight: 400; cursor: pointer; }
.flow-card.flow-selectable:hover { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 1px var(--accent); }
.flow-card.flow-selectable:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.flow-card.flow-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.flow-edit-hint { margin-top: 5px; font-size: 11px; color: var(--accent); font-weight: 600; }
.flow-card .fine { margin: 0; font-size: 11px; line-height: 1.6; }
.flow-role { font-size: 10px; color: var(--muted); letter-spacing: .04em; }
.flow-service { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.flow-service-label { font-size: 11px; color: var(--accent); }
.flow-terminal { flex-basis: 120px; width: 120px; border-style: dashed; }
.flow-addresses { margin: 2px 0; font-size: 10px; line-height: 1.5; width: 100%; }
.flow-addresses dt { color: var(--muted); margin-top: 6px; }
.flow-addresses dd { margin: 2px 0; font-size: 11px; }
.flow-edge { flex: 0 0 64px; width: 64px; padding: 0 4px; text-align: center; font-size: 9px; line-height: 1.5; color: var(--text-2); overflow-wrap: anywhere; }
.flow-edge > span { display: block; }
.flow-arrow { display: block; font-size: 25px; line-height: 1.2; color: var(--accent); }
.flow-branches { display: flex; flex-direction: column; gap: 12px; }
.flow-branch-label { margin: 0 0 0 64px; font-size: 11px; color: var(--muted); }
.flow-figure figcaption { font-size: 11px; color: var(--muted); padding: 12px 18px; border-top: 1px solid var(--line); line-height: 1.6; }
.flow-checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 14px 18px; list-style: none; border-top: 1px solid var(--line); counter-reset: flow-check; }
.flow-checks li { font-size: 11px; line-height: 1.65; color: var(--muted); }
.flow-checks strong { display: block; color: var(--text-2); margin-bottom: 4px; font-weight: 600; }
.flow-checks strong::before { counter-increment: flow-check; content: counter(flow-check) ". "; color: var(--accent); }
.forwarding-diagram > details { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: var(--surface); font-size: 12px; line-height: 1.65; padding: 0 18px; }
.forwarding-diagram > details p { margin: 0 0 14px; }
.flow-warnings summary { color: var(--amber); }
.flow-warnings ul { margin: 0 0 14px; padding-left: 20px; color: var(--text-2); }
.flow-warnings li + li { margin-top: 5px; }
@media (min-width: 900px) {
  .path-config-header { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 18px; }
  .path-config-header label { margin: 10px 0; }
}
@media (max-width: 650px) {
  .flow-track, .flow-route, .flow-branch { flex-direction: column; align-items: stretch; }
  .flow-track { padding: 16px; }
  .flow-card, .flow-terminal { width: 100%; flex: 0 0 auto; }
  .flow-edge { width: 100%; flex: 0 0 auto; padding: 7px; }
  .flow-arrow { transform: rotate(90deg); }
  .flow-branch-label { margin: 14px 0 0; }
  .flow-branches { gap: 8px; }
  .flow-checks { grid-template-columns: 1fr; gap: 10px; }
}
:root {
  color-scheme: light;
  --bg: #fbfaf7; --grid: rgba(75, 64, 50, .045);
  --surface: #ffffff; --surface-2: #f6f4ef; --surface-3: #eeebe4;
  --line: #e9e5dd; --line-strong: #d6d0c6; --control-line: #8e897e;
  --text: #292821; --text-2: #56544c; --muted: #6b685f;
  --accent: #ad4c2f; --accent-hover: #903b24; --accent-ink: #ffffff; --accent-soft: #f6eae2;
  --green: #27754f; --green-soft: #e9f3eb; --blue: #547ca4; --violet: #8c779e;
  --amber: #94631c; --amber-soft: #faf0da; --red: #b7433d; --red-soft: #f9e9e7;
  --shadow: 0 24px 80px rgba(44, 34, 20, .16);
  --sans: Inter, "SF Pro Text", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "Cascadia Mono", ui-monospace, Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-family: var(--sans); color: var(--text); background: var(--bg);
  font-synthesis: none; -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #191a18; --grid: rgba(218, 211, 193, .045);
  --surface: #20211e; --surface-2: #252622; --surface-3: #30312b;
  --line: #34352e; --line-strong: #494a40; --control-line: #858678;
  --text: #edeae1; --text-2: #c0bdb2; --muted: #a09d90;
  --accent: #eaa082; --accent-hover: #f2b59b; --accent-ink: #23170f; --accent-soft: #3a2b24;
  --green: #88c7a3; --green-soft: #24382b; --blue: #90b3d4; --violet: #b7a0c9;
  --amber: #d8b46c; --amber-soft: #3b3220; --red: #ee9890; --red-soft: #3d2826;
  --shadow: 0 24px 80px rgba(0, 0, 0, .4);
}
:root[data-accent="blue"] { --accent: #315f99; --accent-hover: #254b7c; --accent-soft: #eaf0f8; }
:root[data-accent="green"] { --accent: #32674c; --accent-hover: #25533a; --accent-soft: #eaf1eb; }
:root[data-accent="violet"] { --accent: #70558c; --accent-hover: #5c4375; --accent-soft: #f0ebf5; }
:root[data-theme="dark"][data-accent="blue"] { --accent: #9dbcf0; --accent-hover: #b3cbf5; --accent-soft: #27334a; --accent-ink: #111c2c; }
:root[data-theme="dark"][data-accent="green"] { --accent: #a1c7aa; --accent-hover: #b5d8bd; --accent-soft: #293a2f; --accent-ink: #152219; }
:root[data-theme="dark"][data-accent="violet"] { --accent: #c6addf; --accent-hover: #d6c1e9; --accent-soft: #382d43; --accent-ink: #25182f; }

* { box-sizing: border-box; }
.theme-switching * { transition: none !important; }
body {
  margin: 0;
  background-color: var(--bg);

}
body:has(dialog[open]) { overflow: hidden; }
::selection { background: var(--accent); color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
p { line-height: 1.65; }
h1 { font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 16px; font-weight: 650; margin: 0; letter-spacing: -.01em; }
code, .mono { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.hidden { display: none !important; }
.muted, .fine { color: var(--muted); line-height: 1.7; }
.fine { font-size: 12px; }
.error { color: var(--red); font-size: 13px; }
.danger { color: var(--red); }

/* Section labels: monospace caption with an accent square, as used across the console. */
.eyebrow {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 12px;
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .14em;
  color: var(--muted); text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; background: var(--accent); flex-shrink: 0; }

/* Buttons */
button { cursor: pointer; border-radius: 8px; transition: background .15s, border-color .15s, color .15s; }
button:disabled { opacity: .5; cursor: wait; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary {
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid var(--accent); padding: 10px 16px;
  font-weight: 650; font-size: 13px;
}
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.subtle {
  background: transparent; border: 1px solid var(--line-strong);
  padding: 8px 13px; color: var(--text-2); font-size: 13px; white-space: nowrap;
}
.subtle:hover { background: var(--surface-3); color: var(--text); border-color: var(--muted); }
.subtle.danger { color: var(--red); }
.subtle.danger:hover { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.icon-button { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); padding: 4px 8px; }
.icon-button:hover { color: var(--text); background: var(--surface-3); }
.table-action {
  border: 0; background: none; color: var(--accent);
  font-size: 12px; min-height: 32px; padding: 5px 8px; border-radius: 6px;
}
.table-action:hover { background: var(--accent-soft); }
/* Several row actions may wrap inside their cell; each label stays on one line. */
.table-action { white-space: nowrap; }
td > div:has(> .table-action), td > details { white-space: normal; }
.table-action.danger { color: var(--red); }
.table-action.danger:hover { background: var(--red-soft); }

/* Forms */
label {
  display: flex; flex-direction: column; gap: 7px;
  margin: 16px 0; font-size: 13px; font-weight: 550; color: var(--text-2);
}
input, select, textarea {
  width: 100%; min-width: 0;
  background: var(--surface-2); border: 1px solid var(--control-line); border-radius: 8px;
  padding: 10px 12px; color: var(--text); font-weight: 400; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
input:disabled, select:disabled, textarea:disabled { opacity: .55; }
input[readonly] { background: var(--surface-3); }
textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.inline-check { flex-direction: row; align-items: center; gap: 9px; }
.inline-check input { width: auto; }
.node-choice { width: auto; padding: 0; margin: 0; }
details { margin: 18px 0; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; background: var(--surface-2); }
details[open] { padding-bottom: 6px; }
summary { font-size: 12px; font-weight: 600; color: var(--text-2); cursor: pointer; padding: 12px 0; }
summary:hover { color: var(--accent); }
td details { margin: 0; padding: 0; border: 0; background: none; }
td summary { padding: 2px 0; color: var(--accent); font-weight: 550; }
td details[open] { white-space: normal; min-width: 260px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px 10px; margin: 14px 0; min-width: 0; }
legend { padding: 0 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.target-editor { background: var(--surface-2); margin: 16px 0; }
.target-editor legend { color: var(--accent); }
pre {
  white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px; font-family: var(--mono); font-size: 11.5px; line-height: 1.7; color: var(--text-2);
}
.secret-box {
  background: var(--surface-2); border: 1px dashed var(--accent); border-radius: 8px;
  padding: 16px; word-break: break-all; user-select: all;
  font-family: var(--mono); font-size: 12.5px; color: var(--text);
}
.qr-code { display: block; width: 200px; height: 200px; margin: 8px auto 16px; border-radius: 8px; background: #fff; padding: 8px; }
.recovery-codes { white-space: pre-line; line-height: 2; font-size: 14px; font-family: var(--mono); }

/* Brand */
.brand-mark {
  display: grid; place-items: center; flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--mono); font-size: 24px; font-weight: 800;
}
.brand-mark.small { width: 30px; height: 30px; font-size: 17px; border-radius: 7px; }

/* Login */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) 1.15fr; }
.login-card { width: min(380px, calc(100% - 48px)); justify-self: center; align-self: center; padding: 48px 0; }
.login-card > .eyebrow { margin-top: 30px; }
.login-card h1 { font-size: 38px; line-height: 1.3; letter-spacing: -.03em; }
.login-card > .muted { font-size: 14px; }
.login-card > .primary { width: 100%; margin-top: 8px; padding: 12px 16px; display: flex; justify-content: space-between; font-size: 14px; }
.login-card .fine code { color: var(--text-2); }
.login-art {
  position: relative; overflow: hidden;
  display: grid; place-items: center; padding: 48px;
  border-left: 1px solid var(--line);
  background: radial-gradient(ellipse at 70% 30%, var(--accent-soft), transparent 60%), var(--surface);
}
.route-card {
  width: min(560px, 100%);
  border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--surface-2); box-shadow: var(--shadow); overflow: hidden;
}
.route-head {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.route-head .dots { display: flex; gap: 6px; }
.route-head .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.route-head .route-state { margin-left: auto; color: var(--green); }
.route-head .route-state::before { content: "● "; }
.route { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; padding: 48px 26px 40px; }
.route::before {
  content: ""; position: absolute; left: 12%; right: 12%; top: 50%;
  height: 2px; margin-top: -11px; background: linear-gradient(90deg, var(--line-strong), var(--accent) 30%, var(--accent) 70%, var(--line-strong));
}
.hop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.hop b {
  display: grid; place-items: center; min-width: 64px; height: 38px; padding: 0 10px;
  border: 1px solid var(--accent); border-radius: 8px; background: var(--surface);
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--text);
}
.hop.end b { min-width: 0; width: 18px; height: 18px; padding: 0; border-radius: 50%; border-color: var(--line-strong); margin: 10px 0; }
.hop span { font-size: 11px; color: var(--muted); }
.route-log { border-top: 1px solid var(--line); padding: 14px 18px; font-family: var(--mono); font-size: 11.5px; line-height: 2; color: var(--muted); }
.route-log em { font-style: normal; color: var(--accent); }
.network-label { position: absolute; bottom: 34px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .3em; color: var(--muted); }

/* Workspace shell: persistent header, grouped navigation, generous content. */
.application { min-height: 100vh; }
.topbar { position: fixed; inset: 0 0 auto; height: 72px; z-index: 30; display: flex; align-items: center; gap: 26px; padding: 0 24px; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-brand { width: 204px; flex-shrink: 0; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--serif); font-size: 28px; font-weight: 600; letter-spacing: -.04em; }
.brand-sub { display: block; font-family: var(--mono); font-size: 8px; font-weight: 400; letter-spacing: .12em; color: var(--muted); margin-top: 1px; }
.brand-mark, .brand-mark.small { width: 34px; height: 37px; border: 1px solid var(--accent); border-radius: 10px 2px 10px 2px; background: var(--accent-soft); color: var(--accent); font-family: var(--serif); font-size: 25px; font-weight: 500; }
.topbar-tabs { display: flex; height: 100%; gap: 24px; }
.topbar-tab { position: relative; border: 0; background: none; color: var(--muted); padding: 0; font-size: 13px; white-space: nowrap; border-radius: 0; }
.topbar-tab.active { color: var(--text); font-weight: 600; }
.topbar-tab.active::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--accent); }
.topbar-tab span { margin-left: 4px; color: var(--muted); }
.search-trigger { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 340px; margin-left: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--muted); text-align: left; font-size: 12px; }
.search-trigger:hover { border-color: var(--line-strong); background: var(--surface); }
.search-trigger kbd { margin-left: auto; }
kbd { font-family: var(--sans); font-size: 10px; font-weight: 400; border: 1px solid var(--line-strong); border-radius: 4px; padding: 2px 4px; line-height: 1.2; white-space: nowrap; color: var(--muted); }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-icon] svg, .icon-control svg { width: 17px; height: 17px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.build-badge { font-family: var(--mono); font-size: 9px; letter-spacing: .02em; color: var(--muted); padding: 4px 7px; border: 1px solid var(--line); border-radius: 4px; white-space: nowrap; }
.icon-control { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 0; background: transparent; color: var(--muted); flex-shrink: 0; }
.icon-control:hover { background: var(--surface-3); color: var(--text); }
.identity { font-size: 11px; max-width: 260px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-2); padding-left: 14px; border-left: 1px solid var(--line-strong); }
.identity:empty { display: none; }
.mobile-only { display: none; }
.sidebar { position: fixed; inset: 72px auto 0 0; width: 248px; display: flex; flex-direction: column; background: var(--bg); border-right: 1px solid var(--line); z-index: 25; padding: 0 16px; }
.workspace-label { display: flex; align-items: center; gap: 10px; padding: 24px 8px 20px; }
.workspace-label strong { display: block; font-size: 12px; font-weight: 600; }
.workspace-label div > span { display: block; font-size: 10px; margin-top: 4px; color: var(--muted); }
.workspace-icon { width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text-2); background: var(--surface); }
.sidebar nav { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; padding: 0 0 20px; }
.nav-group + .nav-group { margin-top: 21px; }
.nav-label { display: flex; justify-content: space-between; margin: 0 10px 8px; font-size: 10px; line-height: 1.5; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.nav-button { position: relative; width: 100%; display: flex; align-items: center; gap: 11px; margin: 1px 0; padding: 9px 11px; border: 0; border-radius: 6px; background: none; text-align: left; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.nav-button span { width: 18px; color: var(--muted); }
/* Only the current page is filled. Hover is an outline, and touch screens skip it so a tapped item never looks selected. */
.nav-button:hover { color: var(--text); }
@media (hover: hover) { .nav-button:not(.active):hover { box-shadow: inset 0 0 0 1px var(--line-strong); } }
.nav-button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-button.active span { color: var(--accent); }
.nav-button.active::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: var(--accent); border-radius: 0 3px 3px 0; }
.sidebar-bottom { display: flex; align-items: center; justify-content: space-between; padding: 16px 6px; border-top: 1px solid var(--line); }
.sidebar-bottom > div { display: grid; gap: 4px; }
.sidebar-bottom .fine { font-size: 10px; }
.version { font-size: 10px; color: var(--text-2); }
main { margin-left: 248px; width: calc(100% - 248px); padding: 100px 36px 22px; max-width: 1960px; min-height: 100vh; outline: none; }
.page-breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); margin-bottom: 29px; }
.page-breadcrumb svg { width: 14px; height: 14px; }
#breadcrumb-current { color: var(--text-2); }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-header h1 { font-size: 28px; font-weight: 650; letter-spacing: -.04em; }
.page-header .eyebrow { font-size: 9px; letter-spacing: .13em; margin-bottom: 11px; }
.eyebrow::before { width: 5px; height: 5px; }
.view-description { color: var(--muted); font-size: 13px; margin: 10px 0 0; line-height: 1.8; }
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-right .subtle { display: inline-flex; align-items: center; gap: 7px; border-color: var(--line); font-size: 11px; padding: 8px 11px; background: var(--surface); }
.page-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 16px 0; margin-bottom: 4px; }
.data-note { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--muted); }
.live-dot { width: 5px; height: 5px; background: var(--muted); border-radius: 50%; }
.meta-separator { margin: 0 4px; opacity: .5; }
.nav-backdrop[hidden] { display: none; }
.nav-backdrop { display: none; }
.skip-link { position: fixed; top: -80px; left: 12px; z-index: 100; padding: 12px 20px; border-radius: 6px; background: var(--text); color: var(--bg); }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.loading-state { padding: 48px; color: var(--muted); text-align: center; font-size: 13px; }

/* Metrics: one strip of cells separated by hairlines */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin-bottom: 22px; overflow: hidden;
  background: var(--line); border: 1px solid var(--line); border-radius: 12px;
}
.metric { padding: 20px 22px 18px; background: var(--surface); }
.metric-label { font-size: 12px; color: var(--muted); }
.metric-value {
  margin-top: 12px; font-family: var(--mono); font-size: 30px; font-weight: 600;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text);
}
.metric:first-child .metric-value { color: var(--accent); }
.metric-foot { margin-top: 8px; font-size: 11px; color: var(--muted); }

/* Panels and tables */
.panel { margin-bottom: 22px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.panel-head > button { white-space: nowrap; flex-shrink: 0; }
.panel-head > div + div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex-shrink: 0; min-width: 0; max-width: 100%; }
.panel-body { padding: 22px; }
.panel > p.fine { margin: 0; padding: 14px 22px 18px; }
.node-panel > .panel-head { align-items: flex-start; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.toolbar select { max-width: 340px; }
.node-toolbar { flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.node-toolbar > label { margin: 0; min-width: min(100%, 240px); }
.node-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.node-toolbar-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex-basis: 100%; }
.health-summary { padding: 14px 22px; border-bottom: 1px solid var(--line); }
.health-summary p { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.node-tools { flex-wrap: wrap; margin-bottom: 0; min-width: 0; }
/* Wide tables scroll sideways: edge shadows show there is more, and the
   actions column stays pinned so row actions are always reachable. */
.table-wrap {
  width: 100%; overflow-x: auto;
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right / 32px 100% no-repeat local,
    linear-gradient(to right, rgba(0, 0, 0, .1), transparent) left / 12px 100% no-repeat scroll,
    linear-gradient(to left, rgba(0, 0, 0, .1), transparent) right / 12px 100% no-repeat scroll;
}
table { width: 100%; border-collapse: collapse; font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Phones scroll the whole row instead: a pinned column would cover most of the screen. */
@media (min-width: 641px) {
  td:last-child:has(> div > .table-action, > .table-action) { position: sticky; right: 0; z-index: 1; background: var(--surface); box-shadow: inset 1px 0 0 var(--line); }
  tbody tr:hover td:last-child:has(> div > .table-action, > .table-action) { background: var(--surface-2); }
  table:has(td:last-child > div > .table-action, td:last-child > .table-action) th:last-child { right: 0; z-index: 2; box-shadow: inset 1px 0 0 var(--line); }
}
th {
  position: sticky; top: 0; text-align: left; vertical-align: bottom;
  white-space: normal; word-break: keep-all;
  padding: 11px 16px; background: var(--surface-2);
  font-size: 11px; font-weight: 550; letter-spacing: .03em; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
td { padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--text-2); }
td strong { font-weight: 600; color: var(--text); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.subline { margin-top: 4px; font-size: 11px; color: var(--muted); }
.subline.mono { font-size: 11px; }

/* Status badges: tinted pill with a dot in the status color */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 550; line-height: 1.6;
  background: var(--surface-3); color: var(--muted); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.orange { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }

.empty { padding: 56px 24px; text-align: center; }
.empty .empty-symbol {
  display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 18px;
  border: 1px dashed var(--line-strong); border-radius: 12px; font-size: 20px; color: var(--accent);
}
.empty p { max-width: 440px; margin: 8px auto 20px; font-size: 13px; color: var(--muted); }

.notification {
  margin-bottom: 20px; padding: 12px 16px;
  border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 8px;
  background: var(--surface); font-size: 13px; line-height: 1.6; color: var(--text-2);
}
.notification.failure { border-left-color: var(--red); color: var(--text); background: var(--red-soft); }

.capabilities { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.capability { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }

footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 24px; font-family: var(--mono); font-size: 11px; line-height: 1.8; color: var(--muted); }

/* Dialog */
dialog {
  width: min(680px, calc(100% - 32px)); max-height: 90vh; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--surface); color: inherit; box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); }
#dialog-body { padding: 4px 24px 24px; }
.dialog-actions {
  position: sticky; bottom: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px;
  margin: 22px -24px -24px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface);
}

/* Overview */
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 999px; border: 1px solid currentColor;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); }
.status-pill:empty { display: none; }
.status-pill.green { color: var(--green); background: var(--green-soft); }
.status-pill.orange { color: var(--amber); background: var(--amber-soft); }
.status-pill.red { color: var(--red); background: var(--red-soft); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi {
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-width: 0;
  padding: 18px 20px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.kpi .metric-value { margin-top: 10px; font-size: 28px; white-space: nowrap; }
.kpi:first-child .metric-value { color: var(--accent); }
.kpi > .spark { width: 100%; height: 44px; }
.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke: var(--spark); stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark-area { fill: color-mix(in srgb, var(--spark) 16%, transparent); stroke: none; }
.spark-empty { stroke: var(--line-strong); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.spark.accent { --spark: var(--accent); }
.spark.blue { --spark: var(--blue); }
.spark.violet { --spark: var(--violet); }
.fleet-bar { display: flex; gap: 4px; height: 10px; }
.fleet-bar i { flex: 1; max-width: 42px; border-radius: 3px; background: var(--line-strong); }
.fleet-bar i.up { background: var(--green); }
.fleet-bar i.partial { background: var(--amber); }
.fleet-bar i.down { background: var(--red); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: stretch; margin-bottom: 18px; }
.overview-grid .panel { margin-bottom: 0; display: flex; flex-direction: column; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 2px; border-radius: 2px; background: var(--line-strong); }
.legend i.up { background: var(--green); }
.legend i.partial { background: var(--amber); }
.legend i.down { background: var(--red); }
.legend i.unknown { background: var(--muted); }
.chain-wrap { flex: 1; display: flex; flex-direction: column; align-items: stretch; padding: 12px 16px 18px; overflow-x: auto; background: radial-gradient(ellipse at 50% 45%, var(--accent-soft), transparent 68%); }
.chain-notice { margin: 6px 0 12px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.chain { flex: 1; width: 100%; min-width: 640px; height: auto; font-family: var(--sans); }
.edge { fill: none; stroke: var(--line-strong); stroke-width: 1.8; }
.edge.up { stroke: var(--green); stroke-dasharray: 6 5; animation: flow 1.2s linear infinite; }
.edge.partial { stroke: var(--amber); stroke-dasharray: 6 5; animation: flow 1.2s linear infinite; }
.edge.down { stroke: var(--red); stroke-dasharray: 2 5; }
.edge.unknown { stroke: var(--muted); stroke-dasharray: 4 4; }
.edge.client { stroke: var(--muted); stroke-dasharray: 2 5; opacity: .7; }
@keyframes flow { to { stroke-dashoffset: -22; } }
.edge-label { font-family: var(--mono); font-size: 11.5px; fill: var(--text-2); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.chain-node { cursor: pointer; }
.chain-node rect { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1; transition: stroke .15s, fill .15s; }
.chain-node:hover rect, .chain-node:focus-visible rect { fill: var(--surface-3); stroke: var(--accent); }
.chain-node:focus { outline: none; }
.chain-node .dot { fill: var(--muted); }
.chain-node.up .dot { fill: var(--green); }
.chain-node.partial .dot { fill: var(--amber); }
.chain-node.down .dot { fill: var(--red); }
.chain-node.down rect { stroke: color-mix(in srgb, var(--red) 55%, var(--line-strong)); }
.chain-node .name { font-size: 13px; font-weight: 650; fill: var(--text); }
.chain-node .sub { font-size: 11px; fill: var(--muted); }
.terminal rect { fill: none; stroke: var(--line-strong); stroke-dasharray: 4 4; }
.terminal text { font-size: 12.5px; fill: var(--muted); }
.incidents { list-style: none; margin: 0; padding: 4px 0; flex: 1; }
.incident { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.incident:last-child { border-bottom: 0; }
.incident > i { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--muted); }
.incident.recovered > i { background: var(--green); }
.incident.warning > i { background: var(--amber); }
.incident.critical > i { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.incident-message { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 12.5px; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; }
.incident time { font-size: 11px; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.incident-empty { padding: 28px 20px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.panel-head > input[type="search"] { max-width: 260px; }
.throughput { display: flex; align-items: center; gap: 12px; }
.throughput .spark { width: 72px; height: 26px; }
.throughput span { min-width: 82px; font-family: var(--mono); font-size: 12px; color: var(--text); }
.meter { display: grid; gap: 5px; min-width: 96px; }
.resource-meters { display: grid; gap: 10px; }
.meter-label { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
.meter svg { width: 96px; height: 5px; display: block; }
.meter-track { fill: var(--surface-3); }
.meter-fill { fill: var(--green); }
.meter-fill.mid { fill: var(--amber); }
.meter-fill.high { fill: var(--red); }
/* Alerts */
.alert-status { display: grid; grid-template-columns: repeat(3, minmax(110px, 160px)) 1fr; gap: 1px; background: var(--line); }
.alert-stat { padding: 18px 22px; background: var(--surface); }
.alert-stat .metric-value { margin: 0 0 6px; font-size: 26px; }
.alert-stat.green .metric-value { color: var(--green); }
.alert-stat.orange .metric-value { color: var(--amber); }
.alert-stat.red .metric-value { color: var(--red); }
.alert-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 18px 22px; background: var(--surface); }
.row-actions { display: flex; gap: 4px; white-space: nowrap; }
.node-actions { display: flex; flex-direction: column; align-items: flex-start; }
.node-actions .table-action { min-height: 28px; padding: 3px 8px; }
.alert-fields { display: contents; }
td .wrap { display: block; min-width: 280px; white-space: normal; line-height: 1.55; }
td .clip { display: block; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }


.subscription-preview {
  max-height: 42vh;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

.error-text {
  margin: 8px 0 0;
  color: var(--danger, #e5534b);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.version-list { display: grid; gap: 8px; }
.version-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }

/* Refined content surfaces; charts keep their existing data and semantics. */
.panel, .metrics, .kpi { border-radius: 9px; box-shadow: 0 2px 3px rgba(42, 34, 24, .015); }
.panel-head { padding: 18px 20px; }
.panel-head h2 { font-size: 14px; font-weight: 600; }
.panel-head p { font-size: 12px; line-height: 1.75; max-width: 64em; }
.kpis { gap: 14px; margin-bottom: 22px; }
.kpi { padding: 19px 20px 13px; gap: 12px; }
.kpi .metric-value { font-family: var(--sans); font-size: 29px; font-weight: 600; letter-spacing: -.045em; margin-top: 13px; }
.kpi:first-child .metric-value, .metric:first-child .metric-value { color: var(--text); }
.metric-label { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.metric-label::before { content: ""; width: 5px; height: 5px; border: 1px solid var(--muted); border-radius: 2px; }
.metric-foot { font-size: 10px; line-height: 1.7; }
.kpi > .spark { height: 38px; }
.overview-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; margin-bottom: 22px; }
.chain-wrap { min-height: 208px; background-color: var(--surface); background-image: radial-gradient(var(--line-strong) .7px, transparent .7px); background-size: 16px 16px; }
.chain { min-width: 640px; height: auto; flex-shrink: 0; }
.chain-node rect { fill: var(--surface); }
.incident { padding: 13px 16px; gap: 10px; }
.incident-message, .incident-empty { font-size: 11.5px; }
.incident time { font-size: 9px; }
.incident-empty { display: flex; align-items: center; min-height: 145px; line-height: 1.9; }
.status-pill { font-size: 10px; font-weight: 500; padding: 5px 9px; border: 1px solid var(--line); border-radius: 5px; }
.status-pill::before { width: 5px; height: 5px; box-shadow: none; }
.status-pill.neutral { color: var(--muted); background: var(--surface-2); }
th { font-size: 11px; font-weight: 550; background: var(--surface-2); padding: 12px; }
td { font-size: 13px; padding: 14px 12px; }
.badge { font-size: 11px; border-radius: 5px; padding: 3px 7px; gap: 5px; }
.badge::before { width: 4px; height: 4px; }
.panel-head > input[type="search"] { max-width: 215px; font-size: 11px; padding: 8px 10px; margin: 0; }
footer { font-family: var(--sans); font-size: 10px; border-top: 1px solid var(--line); padding-top: 17px; margin-top: 32px; }
footer > span:first-child { flex-shrink: 0; color: var(--text-2); }
button.primary { border-radius: 6px; font-size: 12px; font-weight: 550; }
input, select, textarea { border-radius: 6px; }
.empty { padding: 44px 24px; }
.empty h2 { font-size: 15px; }
.empty p { font-size: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Search is a real local command palette; no external service or request. */
.command-dialog { width: min(620px, calc(100% - 28px)); margin-top: min(18vh, 140px); overflow: hidden; border-radius: 12px; }
.command-input-row { display: flex; align-items: center; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line); color: var(--muted); }
.command-input-row input { flex: 1; min-width: 0; margin: 0; padding: 9px 0; border: 0; background: transparent; outline: none; box-shadow: none; font-size: 14px; color: var(--text); }
.command-escape { border: 1px solid var(--line-strong); color: var(--muted); background: var(--surface-2); font-size: 10px; padding: 3px 5px; border-radius: 4px; }
#command-results { max-height: min(48vh, 430px); overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
.command-result { display: flex; align-items: center; gap: 13px; padding: 11px 13px; border-radius: 7px; cursor: pointer; }
.command-result > svg { flex-shrink: 0; width: 18px; height: 18px; color: var(--muted); }
.command-result strong { display: block; font-size: 13px; font-weight: 500; }
.command-result div > span { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; }
.command-result.selected, .command-result:hover { background: var(--accent-soft); color: var(--accent); }
.result-enter { margin-left: auto; color: var(--muted); font-size: 13px; }
.command-footer { display: flex; justify-content: space-between; gap: 12px; padding: 13px 20px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); }
.command-footer kbd { margin-right: 3px; }
.search-empty { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 15px; }
.search-empty strong { color: var(--text-2); font-weight: 500; }

/* An integrated reading space: chapter navigation, article, table of contents. */
.guide-layout { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 32px; align-items: start; }
.guide-contents { position: sticky; top: 100px; padding: 5px 0; }
.guide-contents .nav-label { font-family: var(--mono); font-size: 8px; letter-spacing: .07em; margin: 0 8px 15px; }
.guide-link { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 10px 8px; margin-bottom: 3px; border: 0; border-radius: 5px; background: transparent; color: var(--text-2); font-size: 11px; line-height: 1.7; }
.guide-link svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--muted); }
.guide-link.active { color: var(--accent); background: var(--accent-soft); }
.guide-link.active svg { color: var(--accent); }
.guide-link:hover { background: var(--surface-3); }
.guide-paper { padding: 30px 34px; min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.guide-heading { padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.guide-read { font-size: 10px; color: var(--accent); }
.guide-heading h2 { font-size: 24px; line-height: 1.5; letter-spacing: -.035em; margin-top: 15px; font-weight: 600; }
.guide-lead { color: var(--muted); font-size: 12px; margin: 10px 0 0; line-height: 1.9; }
.guide-steps section { display: flex; align-items: flex-start; gap: 18px; padding: 24px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 95px; }
.guide-steps section:last-child { border: 0; }
.step-number { font-family: var(--serif); color: var(--accent); font-size: 20px; line-height: 1.4; font-style: italic; }
.guide-steps h2 { font-size: 14px; line-height: 1.9; font-weight: 600; }
.guide-steps p { margin: 9px 0 0; font-size: 14px; color: var(--text-2); line-height: 2; }
.guide-callout { display: flex; align-items: flex-start; gap: 12px; padding: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; margin: 5px 0 24px; }
.guide-callout svg { width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; margin-top: 3px; }
.guide-callout p { margin: 0; font-size: 11px; line-height: 1.9; color: var(--text-2); }
.guide-next { display: block; width: 100%; margin-top: 28px; padding: 18px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--accent); text-align: right; font-size: 11px; }
.guide-toc { display: none; position: sticky; top: 105px; padding-left: 16px; border-left: 1px solid var(--line); }
.guide-toc .nav-label { margin: 0 0 12px; }
.toc-link { display: block; width: 100%; padding: 8px 0; text-align: left; background: transparent; border: 0; color: var(--muted); font-size: 10px; line-height: 1.8; }
.toc-link:hover { color: var(--accent); }
.guide-toc .fine { font-size: 10px; margin-top: 20px; }

/* Login uses the same visual language, with a static, inexpensive network map. */
.login-screen { position: relative; grid-template-columns: minmax(400px, 46%) 1fr; background: var(--bg); }
.language-toggle { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 7px; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text-2); font-size: 11px; white-space: nowrap; cursor: pointer; }
.language-toggle:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--line-strong); }
.language-symbol { font-size: 10px; color: var(--muted); }
.login-language-toggle { position: absolute; top: 22px; right: 24px; z-index: 1; }
html[lang="en"] .nav-button { line-height: 1.5; }
html[lang="en"] .nav-label { letter-spacing: .02em; }
.login-card { width: min(420px, calc(100% - 64px)); padding: 50px 20px; }
.login-brand { margin-bottom: 70px; font-size: 33px; }
.login-brand .brand-mark { width: 40px; height: 44px; font-size: 29px; }
.login-card h1 { font-size: 32px; line-height: 1.5; font-weight: 600; }
.login-card .eyebrow { font-size: 9px; }
.login-card > .muted { font-size: 12px; margin: 16px 0 28px; }
.login-card label { font-size: 12px; }
.login-card > .primary { margin-top: 12px; }
.login-art { flex-direction: column; gap: 40px; padding: 60px 45px; background: var(--surface-2); background-image: radial-gradient(var(--line-strong) .65px, transparent .65px); background-size: 20px 20px; }
.login-note { width: min(100%, 520px); }
.login-note .eyebrow { font-size: 8px; }
.login-note > p { font-family: var(--serif); font-size: clamp(46px, 5.5vw, 76px); letter-spacing: -.05em; line-height: 1.02; margin: 22px 0; }
.login-note em { font-weight: 400; color: var(--accent); }
.login-note > span:last-child { color: var(--muted); font-size: 11px; }
.route-card { width: min(100%, 520px); transform: none; box-shadow: 0 12px 30px rgba(50, 38, 20, .06); border-radius: 9px; }
.route-head { font-size: 9px; }
.route-log { font-size: 10px; }
.route-log em { margin-right: 12px; }
.network-label { font-size: 9px; }

@media (min-width: 1500px) {
  main { padding-left: 46px; padding-right: 46px; }
  .guide-layout { grid-template-columns: 176px minmax(0, 1fr) 148px; }
  .guide-toc { display: block; }
}
@media (max-width: 1390px) {
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .incidents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .incident-empty { min-height: 65px; grid-column: 1 / -1; }
  .build-badge { display: none; }
  .topbar { gap: 22px; }
  .identity { max-width: 210px; }
  .kpi { padding: 18px 15px 12px; }
  .kpi .metric-value { font-size: 25px; }
}
@media (max-width: 1100px) {
  .topbar-tabs { gap: 16px; }
  .topbar { gap: 16px; }
  .identity { display: none; }
  main { padding-left: 24px; padding-right: 24px; }
  .kpis, .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-layout { grid-template-columns: 1fr; gap: 18px; }
  .guide-contents { position: static; display: flex; flex-wrap: wrap; gap: 5px; }
  .guide-contents .nav-label { width: 100%; }
  .guide-link { width: auto; padding: 7px 10px; }
}
@media (max-width: 920px) {
  .topbar { height: 64px; padding: 0 18px; gap: 18px; }
  .topbar-brand { width: auto; }
  .brand { font-size: 24px; }
  .brand-sub { font-size: 7px; }
  .topbar-tabs { display: none; }
  .mobile-only { display: inline-flex; }
  .sidebar { inset: 64px auto 0 0; width: 264px; transform: translateX(-100%); }
  .nav-open { overflow: hidden; }
  .nav-open .sidebar { transform: translateX(0); box-shadow: var(--shadow); }
  .nav-open .nav-backdrop { display: block; position: fixed; inset: 64px 0 0; background: rgba(20, 18, 12, .3); z-index: 24; border: 0; border-radius: 0; }
  main { margin-left: 0; width: 100%; padding: 88px 25px 22px; }
  .page-breadcrumb { margin-bottom: 25px; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .login-screen { grid-template-columns: 1fr 1fr; }
  .login-card { width: calc(100% - 40px); padding: 36px 10px; }
  .login-art { padding: 40px 25px; }
  .login-brand { margin-bottom: 50px; }
  .login-card h1 { font-size: 27px; }
  .route { gap: 5px; padding: 30px 10px; }
  .hop b { min-width: 48px; font-size: 9px; }
}
@media (max-width: 640px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .brand-sub { display: none; }
  .brand-mark.small { width: 28px; height: 30px; font-size: 22px; }
  .topbar-brand { gap: 5px; }
  .search-trigger { flex: 0 0 36px; height: 36px; width: 36px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
  .search-trigger > span:not([data-icon]), .search-trigger kbd { display: none; }
  .topbar-actions { gap: 0; }
  .language-toggle { min-height: 40px; padding: 7px 9px; margin-right: 3px; }
  .topbar .language-symbol { display: none; }
  .login-language-toggle { top: 18px; right: 18px; }
  main { padding: 86px 16px 20px; }
  .page-breadcrumb { font-size: 10px; gap: 7px; margin-bottom: 24px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 17px; }
  .page-header h1 { font-size: 25px; }
  .view-description { font-size: 11px; }
  .header-right { width: 100%; }
  #refresh { margin-left: auto; }
  .page-meta { flex-wrap: wrap; padding: 13px 0; }
  .data-note { font-size: 9px; }
  .data-note > .live-dot, .data-note > .meta-separator { display: none; }
  .kpis, .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metrics { gap: 1px; }
  .kpi { padding: 15px 13px 12px; }
  .kpi .metric-value { font-size: 22px; }
  .metric { padding: 16px; }
  .metric-value { font-size: 24px; }
  .metric-foot { font-size: 9px; }
  .incidents { grid-template-columns: 1fr; }
  .panel-head { padding: 15px; flex-wrap: wrap; }
  .panel-head > input[type="search"] { max-width: none; }
  .panel-head .legend { gap: 8px; font-size: 10px; }
  .chain-wrap { min-height: 175px; padding: 8px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar select { flex: 1 1 100%; max-width: none; }
  .capabilities, .form-grid { grid-template-columns: 1fr; }
  .alert-status { grid-template-columns: repeat(3, 1fr); }
  .alert-actions { grid-column: 1 / -1; justify-content: flex-start; padding: 14px 16px; }
  .alert-stat { padding: 14px 16px; }
  footer { flex-direction: column; gap: 6px; font-size: 9px; }
  .guide-paper { padding: 23px 20px; }
  .guide-heading h2 { font-size: 21px; }
  .guide-steps section { gap: 12px; padding: 20px 0; }
  .guide-steps p { font-size: 13px; }
  .command-footer { padding: 12px; gap: 8px; font-size: 9px; }
  .command-input-row { padding: 12px 15px; }
  .command-input-row input { font-size: 16px; }
  input, select, textarea { font-size: 16px; }
  .nav-button { min-height: 42px; }
  .header-right .subtle { min-height: 40px; }
  .login-screen { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-card { width: min(420px, calc(100% - 48px)); padding: 40px 10px; }
  .login-brand { margin-bottom: 55px; }
  .login-card h1 { font-size: 30px; }
  dialog { max-height: 88dvh; }
  .dialog-head { padding: 16px 20px; }
  #dialog-body { padding: 4px 20px 24px; }
  .dialog-actions { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Monitoring changes spacing and arrangement only. Both overview layouts
   inherit the workspace palette, typography and surface treatments. */
.overview-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 0 0 22px; }
.overview-controls > span { color: var(--muted); font-size: 11px; }
.overview-layout-picker { display: inline-flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.overview-layout-picker button { min-height: 36px; padding: 7px 15px; border: 1px solid transparent; border-radius: 6px; background: transparent; font-size: 12px; font-weight: 550; color: var(--muted); }
.overview-layout-picker button[aria-pressed="true"] { background: var(--surface); color: var(--text); border-color: var(--line-strong); box-shadow: 0 1px 3px #0000000a; }
.overview-layout-picker button:hover { color: var(--text); }
.overview-waiting { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; margin-bottom: 22px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 9px; background: var(--surface); }
.overview-waiting strong { font-size: 13px; }
.overview-waiting p { margin: 5px 0 0; font-size: 12px; color: var(--text-2); max-width: 70em; }
.overview-waiting button { flex-shrink: 0; }
.overview-grid > .panel { min-width: 0; }
.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.appearance-trigger { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 7px 10px; font-size: 11px; }
dialog:has(.appearance-settings) { width: min(580px, calc(100% - 28px)); }
.appearance-settings > p { font-size: 12px; margin: 8px 0; }
.appearance-settings fieldset { padding: 10px; margin: 14px 0 8px; border-radius: 8px; }
.appearance-settings legend { font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--text); }
.appearance-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.appearance-settings [data-preference="theme"] .appearance-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.appearance-choice { display: flex; flex-direction: row; align-items: center; gap: 9px; margin: 0; padding: 12px; min-height: 48px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); cursor: pointer; }
.appearance-choice:has(:checked) { border-color: var(--accent); background: var(--accent-soft); }
.appearance-choice:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.appearance-choice input { margin: 0; flex-shrink: 0; box-shadow: none; }
.appearance-choice strong { display: block; color: var(--text); font-size: 13px; font-weight: 550; }
.appearance-choice small { display: block; color: var(--text-2); font-size: 11px; line-height: 1.6; margin-top: 3px; }
.accent-swatch { display: block; width: 14px; height: 14px; flex-shrink: 0; border-radius: 50%; }
.accent-swatch[data-accent="terracotta"] { background: #ad4c2f; }
.accent-swatch[data-accent="blue"] { background: #315f99; }
.accent-swatch[data-accent="green"] { background: #32674c; }
.accent-swatch[data-accent="violet"] { background: #70558c; }
:root[data-theme="dark"] .accent-swatch[data-accent="terracotta"] { background: #eaa082; }
:root[data-theme="dark"] .accent-swatch[data-accent="blue"] { background: #9dbcf0; }
:root[data-theme="dark"] .accent-swatch[data-accent="green"] { background: #a1c7aa; }
:root[data-theme="dark"] .accent-swatch[data-accent="violet"] { background: #c6addf; }
body[data-overview-layout="monitoring"] main { max-width: none; }
body[data-overview-layout="monitoring"] .kpis { gap: 18px; margin-bottom: 24px; }
body[data-overview-layout="monitoring"] .kpi { container-type: inline-size; min-height: 186px; padding: 23px 24px 18px; gap: 18px; }
body[data-overview-layout="monitoring"] .kpi .metric-label { font-size: 12px; }
body[data-overview-layout="monitoring"] .kpi .metric-value { font-size: clamp(18px, 14cqw, 42px); line-height: 1.2; margin-top: 14px; }
body[data-overview-layout="monitoring"] .kpi .metric-foot { font-size: 11px; }
body[data-overview-layout="monitoring"] .kpi > .spark { height: 46px; }
body[data-overview-layout="monitoring"] .overview-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-bottom: 24px; }
body[data-overview-layout="monitoring"] .panel-head { padding: 22px 24px; }
body[data-overview-layout="monitoring"] .panel-head h2 { font-size: 16px; }
body[data-overview-layout="monitoring"] .panel-head p { font-size: 12px; }
body[data-overview-layout="monitoring"] .chain-wrap { min-height: 300px; padding: 22px 24px; }
body[data-overview-layout="monitoring"] .chain-node .name { font-size: 14px; }
body[data-overview-layout="monitoring"] .chain-node .sub { font-size: 12px; }
body[data-overview-layout="monitoring"] .incidents { display: block; }
body[data-overview-layout="monitoring"] .incident { padding: 16px 24px; }
body[data-overview-layout="monitoring"] .incident-message { font-size: 13px; -webkit-line-clamp: unset; }
body[data-overview-layout="monitoring"] .incident time { font-size: 11px; }
body[data-overview-layout="monitoring"] .incident-empty { min-height: 80px; font-size: 13px; }
body[data-overview-layout="monitoring"] th { font-size: 11px; padding: 14px 16px; }
body[data-overview-layout="monitoring"] td { font-size: 13px; padding: 18px 16px; }
@media (max-width: 1100px) {
  body[data-overview-layout="monitoring"] .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .appearance-trigger { min-height: 40px; min-width: 40px; justify-content: center; padding: 7px; }
  .appearance-label { display: none; }
  .appearance-options { grid-template-columns: 1fr; }
  .appearance-settings [data-preference="theme"] .appearance-options { grid-template-columns: 1fr; }
  .overview-controls { gap: 9px; }
  .overview-layout-picker { width: 100%; }
  .overview-layout-picker button { flex: 1; min-height: 42px; }
  .overview-waiting { flex-direction: column; align-items: flex-start; padding: 16px; }
  body[data-overview-layout="monitoring"] .kpis { gap: 10px; }
  body[data-overview-layout="monitoring"] .kpi { min-height: 170px; padding: 16px 13px; gap: 12px; }
  body[data-overview-layout="monitoring"] .kpi .metric-value { font-size: clamp(18px, 14cqw, 32px); }
  body[data-overview-layout="monitoring"] .panel-head { padding: 18px 16px; flex-wrap: wrap; }
  body[data-overview-layout="monitoring"] .chain-wrap { padding: 16px; }
  body[data-overview-layout="monitoring"] .incident { padding: 15px 16px; gap: 8px; }
}
