/* Relay console styles. Component rules (path picker, flow diagrams) come first; the theme tokens and shell follow. No remote fonts or UI runtime. */
.workflow-callout { padding: 14px 18px; border: 1px solid color-mix(in srgb, var(--blue) 28%, transparent); border-radius: 10px; background: var(--blue-soft); 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: 12px; }
.setup-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding: 18px 20px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); text-align: left; }
.setup-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.setup-scope { font-size: 11px; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
.setup-title { font-size: 16px; color: var(--text); }
.setup-text { color: var(--text-2); font-size: 13px; line-height: 1.6; }
.setup-card .setup-route { width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
.setup-group { margin: 20px 0 0; }
.setup-group h3 { margin: 0 0 10px; font-size: 13px; color: var(--text-2); }
.setup-more { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.setup-more p { margin: 4px 0 0; color: var(--muted); }
.setup-more .toolbar { margin: 0; flex-wrap: wrap; }
.setup-step { margin: 24px 0 12px; font-size: 16px; }
.setup-step:first-child { margin-top: 0; }
dialog:has(.setup-cards) { width: min(880px, calc(100% - 32px)); }
.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-card { padding: 16px; }
  .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; }
}
/* Inter (SIL OFL 1.1), Latin subset, served by the panel itself. Chinese text uses the system font. */
@font-face { font-family: "InterVariable"; src: url("/assets/inter.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
/* Two neutral themes: the sidebar and page sit on one quiet canvas, content lives on cards, and
   color is kept for meaning, with each hue family doing one job: the warm coral-orange accent marks
   actions and selection; a set of companion colors (teal, blue, violet and pink at matched lightness,
   plus gold) draws charts and tells card icons and sidebar sections apart; green, amber and red, as
   tinted labels and striped bars, report status. Red sits well apart from the accent and from pink
   so a problem never reads as a button or a chart series. Each companion color has a mid tone for
   chart fills and a deeper -ink tone for icons, readable at 4.5:1 or more on its own tint.
   Dark: graphite cards on a near-black canvas. Light: white cards on a near-white canvas with a
   faint mist of the companion colors, and near-black text. Status and data colors never follow the accent.
   --accent is for accent text and lines, --accent-fill for solid fills under --accent-ink,
   --accent-soft for tinted selections under --accent-soft-text. */
:root {
  color-scheme: light;
  --bg: #f6f6f9; --chrome: #f6f6f9; --pagebar: rgba(246, 246, 249, .9); --grid: rgba(24, 24, 27, .07);
  /* Light canvas: a near-white page with a faint mist of the companion colors (teal top left, violet top right,
     pink lower right). At 11% every sidebar and header text color keeps 4.5:1 or more where the mist is strongest. */
  --canvas:
    radial-gradient(48rem 32rem at 0% 0%, color-mix(in srgb, var(--teal) 11%, transparent), transparent 70%),
    radial-gradient(52rem 34rem at 100% 0%, color-mix(in srgb, var(--violet) 11%, transparent), transparent 70%),
    radial-gradient(56rem 36rem at 70% 100%, color-mix(in srgb, var(--pink) 11%, transparent), transparent 70%),
    var(--bg);
  --surface: #ffffff; --surface-2: #f5f5f6; --surface-3: #ebecee; --segment: #ffffff; --field: #ffffff;
  --line: #ececee; --line-strong: #dcdde0; --control-line: #a1a2a8;
  --text: #18181b; --text-2: #3a3a40; --muted: #5f6067;
  --accent: #b83b07; --accent-hover: #ac380a; --accent-fill: #d24201; --accent-ink: #ffffff; --accent-soft: #feeadf; --accent-soft-text: #9a3412;
  --green: #28713e; --green-soft: #e3f4e6; --blue: #3567ad; --blue-soft: #eaf3fb; --violet: #9084d2; --teal: #36a6b5;
  --teal-ink: #0f7480; --violet-ink: #5a4dbf; --pink: #df7aa6; --pink-ink: #b0336c;
  --amber: #876406; --amber-soft: #fcf1cb; --red: #be2d39; --red-soft: #ffe4e5;
  /* Striped bars: the status color with lighter stripes, as in a progress pill. */
  --stripes: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .32) 0 3px, transparent 3px 7px);
  --green-fill: #5cad6c; --amber-fill: #e3ae3c; --red-fill: #e2484f; --blue-fill: #6a98d2;
  --card-line: #e3e4ea; --track: #ebecf0; --nav-active: var(--accent-soft); --nav-active-bar: var(--accent-fill); --nav-hover: rgba(255, 255, 255, .7);
  --card-shadow: 0 1px 2px rgba(20, 20, 40, .04), 0 1px 3px rgba(20, 20, 40, .03);
  --segment-shadow: 0 1px 2px rgba(24, 24, 27, .12), 0 0 0 1px rgba(24, 24, 27, .06);
  --shadow: 0 24px 64px -12px rgba(24, 24, 27, .28);
  --radius: 12px; --radius-sm: 8px;
  --sans: InterVariable, Inter, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", ui-monospace, Menlo, Consolas, monospace;
  font-family: var(--sans); color: var(--text); background: var(--bg);
  font-synthesis: none; -webkit-font-smoothing: antialiased;
  scrollbar-color: var(--line-strong) transparent;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111214; --chrome: #111214; --pagebar: rgba(17, 18, 20, .88); --grid: rgba(237, 237, 239, .045);
  --surface: #1b1c20; --surface-2: #212226; --surface-3: #2a2b30; --segment: #1b1c20; --field: #1b1c20;
  --line: #26272b; --line-strong: #303136; --control-line: #4b4c52;
  --text: #ededef; --text-2: #c6c7cc; --muted: #909197;
  --accent: #f87029; --accent-hover: #fb9a63; --accent-fill: #ca4c03; --accent-ink: #ffffff; --accent-soft: #3f2314; --accent-soft-text: #ffd9c4;
  --green: #74c088; --green-soft: #15291b; --blue: #7aa7dc; --blue-soft: #14233a; --violet: #9f93e3; --teal: #4bb8c7;
  --teal-ink: #6fcfdc; --violet-ink: #b3a9f2; --pink: #e48bb3; --pink-ink: #f0a2c5;
  --amber: #e2b85a; --amber-soft: #322810; --red: #e8706f; --red-soft: #3a1a1c;
  --stripes: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .26) 0 3px, transparent 3px 7px);
  --green-fill: #6fb57e; --amber-fill: #e3b54f; --red-fill: #e75655; --blue-fill: #719fd3;
  --card-line: #26272b; --track: #26272c; --nav-active: color-mix(in srgb, var(--accent-fill) 14%, var(--bg)); --nav-active-bar: var(--accent); --nav-hover: #1b1c20;
  --card-shadow: none;
  --segment-shadow: 0 0 0 1px #303136, 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 24px 80px rgba(0, 0, 0, .62);
}
/* Ember (coral, the default) is the base palette above; the other accents override it. */
:root[data-accent="indigo"] { --accent: #2451e6; --accent-hover: #1b3fc4; --accent-fill: #2451e6; --accent-soft: #e5ecfd; --accent-soft-text: #1737a6; }
:root[data-accent="cyan"] { --accent: #0e7490; --accent-hover: #155e75; --accent-fill: #0e7490; --accent-soft: #e3f4f8; --accent-soft-text: #155e75; }
:root[data-accent="emerald"] { --accent: #047857; --accent-hover: #065f46; --accent-fill: #047857; --accent-soft: #e6f5ef; --accent-soft-text: #065f46; }
:root[data-accent="violet"] { --accent: #6d3ae0; --accent-hover: #5626c4; --accent-fill: #6d3ae0; --accent-soft: #efe9fd; --accent-soft-text: #5222c0; }
:root[data-accent="rose"] { --accent: #cf1d63; --accent-hover: #a8164f; --accent-fill: #cf1d63; --accent-soft: #fde7ef; --accent-soft-text: #9d1249; }
:root[data-accent="sky"] { --accent: #0270ad; --accent-hover: #025a8c; --accent-fill: #0270ad; --accent-soft: #e0f1fd; --accent-soft-text: #075482; }
/* Graphite is monochrome: near-black fills on light, near-white fills with dark text on dark. */
:root[data-accent="graphite"] { --accent: #334155; --accent-hover: #0f172a; --accent-fill: #334155; --accent-soft: #e8ebef; --accent-soft-text: #0f172a; }
:root[data-theme="dark"][data-accent="indigo"] { --accent: #8c96ff; --accent-hover: #a7afff; --accent-fill: #5160ee; --accent-soft: #1e2140; --accent-soft-text: #dfe2ff; }
:root[data-theme="dark"][data-accent="cyan"] { --accent: #22d3ee; --accent-hover: #67e8f9; --accent-soft: #10292f; --accent-soft-text: #cff6fc; }
:root[data-theme="dark"][data-accent="emerald"] { --accent: #34d399; --accent-hover: #6ee7b7; --accent-soft: #10281f; --accent-soft-text: #d1fae5; }
:root[data-theme="dark"][data-accent="violet"] { --accent: #b39dff; --accent-hover: #cbbcff; --accent-fill: #6f42d8; --accent-soft: #231a3e; --accent-soft-text: #ece6ff; }
:root[data-theme="dark"][data-accent="rose"] { --accent: #ff7eb0; --accent-hover: #ffa3c8; --accent-fill: #c2195c; --accent-soft: #36162a; --accent-soft-text: #ffe0ec; }
:root[data-theme="dark"][data-accent="sky"] { --accent: #5cc6ff; --accent-hover: #8ad6ff; --accent-fill: #0270ad; --accent-soft: #0e2535; --accent-soft-text: #d7f0ff; }
:root[data-theme="dark"][data-accent="graphite"] { --accent: #d4d9e1; --accent-hover: #f2f4f7; --accent-fill: #e4e7ec; --accent-ink: #0b0d12; --accent-soft: #262b35; --accent-soft-text: #f2f4f7; }

* { box-sizing: border-box; }
.theme-switching * { transition: none !important; }
body { margin: 0; background: var(--bg); font-size: 13px; line-height: 1.5; }
body:has(dialog[open]) { overflow: hidden; }
::selection { background: var(--accent-fill); color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 2px; }
p { line-height: 1.65; }
h1 { font-size: 26px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 15px; line-height: 1.4; font-weight: 550; letter-spacing: -.01em; margin: 0; }
h3 { line-height: 1.4; }
code, .mono { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.hidden { display: none !important; }
.feature-off { display: none !important; }
.muted, .fine { color: var(--muted); line-height: 1.65; }
.fine { font-size: 12px; }
.error { color: var(--red); font-size: 13px; }
.danger { color: var(--red); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main:focus, main:focus-visible { outline: none; }

/* Section labels: a small uppercase caption with an accent dot. */
.eyebrow {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px;
  font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--muted); text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* Buttons: one filled primary, outlined secondaries, text actions inside tables. */
button { cursor: pointer; border-radius: var(--radius-sm); transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
button:disabled { opacity: .5; cursor: wait; }
button.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 7px 14px; border: 1px solid transparent;
  background: var(--accent-fill); color: var(--accent-ink); font-size: 13px; font-weight: 550; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .14), inset 0 1px 0 rgba(255, 255, 255, .18);
}
/* Mixing toward the text color lightens on dark and darkens on light. */
button.primary:hover { background: color-mix(in srgb, var(--accent-fill) 86%, var(--text)); }
.subtle {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 12px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap;
  box-shadow: var(--card-shadow);
}
.subtle:hover { background: var(--surface-2); border-color: var(--control-line); color: var(--text); }
a.subtle { text-decoration: none; }
.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: 2px 8px; }
.icon-button:hover { color: var(--text); background: var(--surface-3); }
.table-action { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 500; min-height: 28px; padding: 3px 10px; border-radius: 7px; white-space: nowrap; box-shadow: var(--card-shadow); }
.table-action:hover { background: var(--surface-2); border-color: var(--control-line); color: var(--text); }
td > div:has(> .table-action), td > details { white-space: normal; }
.table-action.danger { color: var(--red); }
.table-action.danger:hover { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--line-strong)); }
.icon-control { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; background: transparent; color: var(--muted); flex-shrink: 0; }
.icon-control:hover { background: var(--surface-3); color: var(--text); }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-icon] svg, .icon-control svg { width: 16px; height: 16px; }
kbd { font-family: var(--sans); font-size: 10.5px; font-weight: 500; border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 5px; line-height: 1.4; white-space: nowrap; color: var(--muted); background: var(--surface-2); }

/* Forms */
label { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; font-size: 12.5px; font-weight: 550; color: var(--text-2); }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 36px;
  background: var(--field); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 7px 11px; color: var(--text); font-weight: 400; font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:hover, select:hover, textarea:hover { border-color: var(--control-line); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--accent-fill); }
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; }
/* One authoritative DNS value per row: value, health node, rule, remove. */
.value-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.3fr) minmax(0, 1.1fr) auto; gap: 0 12px; align-items: center; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
@media (max-width: 650px) { .value-row { grid-template-columns: 1fr; } }
.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: 16px 0; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; background: var(--surface-2); }
details[open] { padding-bottom: 6px; }
summary { font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; padding: 11px 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-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.target-editor { background: var(--surface-2); margin: 16px 0; }
.target-editor legend { color: var(--accent); }
.upstream-editor { background: var(--surface-2); }
.upstream-editor legend { color: var(--accent); }
.upstream-paste { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 14px; }
.upstream-paste label { flex: 1; margin-bottom: 0; }
.upstream-row { border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 12px; }
.pool-pick { display: flex; gap: 12px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 8px 0; }
.pool-pick label { margin: 0; flex: 1; min-width: 0; }
.pool-pick select { width: 55%; flex: none; }
.pool-pick input[type=checkbox] { flex: none; }
@media (max-width: 650px) { .pool-pick { flex-wrap: wrap; } .pool-pick select { width: 100%; } }
/* Firewall rule sets: one card per ordered rule, and the tester's verdict line. */
.firewall-rules { display: grid; gap: 10px; margin-bottom: 12px; }
.firewall-rule { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px 4px; background: var(--surface-2); }
.firewall-rule-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.firewall-result { margin-top: 14px; }
.firewall-decision { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.firewall-servers .row-actions { flex-wrap: nowrap; }
pre {
  white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; font-family: var(--mono); font-size: 12px; line-height: 1.7; color: var(--text-2);
}
.secret-box {
  background: var(--surface-2); border: 1px dashed var(--accent); border-radius: var(--radius-sm);
  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; }
/* Subscription links are long, so their codes are dense. */
.qr-code.large { width: 260px; height: 260px; }
.recovery-codes { white-space: pre-line; line-height: 2; font-size: 14px; font-family: var(--mono); }

/* Brand: an accent tile with a white diamond beside the wordmark. */
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-sub { margin-top: 1px; font-size: 11px; font-weight: 450; letter-spacing: 0; color: var(--muted); }
.brand-mark {
  position: relative; flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent-fill);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(0, 0, 0, .12);
}
.brand-mark::after { content: ""; position: absolute; inset: 9px; border: 2px solid var(--accent-ink); border-radius: 2px; transform: rotate(45deg); }

/* Workspace shell: the sidebar and page header sit on the canvas; content sits on cards. */
.application { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: relative; z-index: 25; background: var(--chrome); }
.sidebar-inner { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding: 16px 12px 10px; }
.sidebar .brand { padding: 2px 8px 16px; }
.search-trigger { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; margin: 0 0 16px; padding: 6px 8px 6px 10px; border: 1px solid var(--card-line); border-radius: 10px; background: var(--surface); box-shadow: var(--card-shadow); color: var(--muted); font-size: 12.5px; text-align: left; }
.search-trigger:hover { border-color: var(--control-line); color: var(--text-2); }
.search-trigger kbd { margin-left: auto; }
.sidebar nav { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -12px; padding: 0 12px 16px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
.nav-group + .nav-group { margin-top: 14px; }
.nav-label { margin: 0 10px 4px; font-size: 12px; line-height: 1.6; font-weight: 500; color: var(--muted); }
.nav-button { position: relative; width: 100%; display: flex; align-items: center; gap: 10px; min-height: 32px; margin: 1px 0; padding: 5px 10px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: 13px; line-height: 1.4; color: var(--text-2); }
.nav-button > span[data-icon] { width: 16px; color: var(--section-ink, var(--muted)); }
/* Each sidebar section carries one companion color on its icons; labels stay neutral and the current page keeps the accent. */
.sidebar nav > .nav-group:nth-of-type(1) { --section-ink: var(--teal-ink); }
.sidebar nav > .nav-group:nth-of-type(2) { --section-ink: var(--blue); }
.sidebar nav > .nav-group:nth-of-type(3) { --section-ink: var(--violet-ink); }
.sidebar nav > .nav-group:nth-of-type(4) { --section-ink: var(--pink-ink); }
.sidebar nav > .nav-group:nth-of-type(5) { --section-ink: var(--amber); }
/* Only the current page is marked, with a warm accent tint and a bar on its leading edge; touch screens skip hover so a tapped item never looks selected. */
@media (hover: hover) { .nav-button:not(.active):hover { background: var(--nav-hover); color: var(--text); } }
.nav-button.active, .guide-link.active { background: var(--nav-active); box-shadow: inset 2px 0 0 var(--nav-active-bar); color: var(--text); font-weight: 600; }
.nav-button.active > span[data-icon] { color: var(--accent); }
.sidebar-foot { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; padding: 8px 6px 8px 10px; border: 1px solid var(--card-line); border-radius: 10px; background: var(--surface); box-shadow: var(--card-shadow); }
.avatar { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; }
.identity { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.identity strong, .identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity strong { font-size: 12.5px; font-weight: 600; color: var(--text); }
.identity span { font-size: 11px; color: var(--muted); }
.workspace { display: flex; flex-direction: column; min-width: 0; }
.pagebar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px 16px; min-height: 64px; padding: 12px 28px 10px; background: var(--pagebar); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
/* The light canvas is fixed to the window and painted on the page, sidebar and page header alike, so they read
   as one continuous background and content scrolling under the header stays hidden. */
:root[data-theme="light"] :is(body, .sidebar, .pagebar) { background: var(--canvas); background-attachment: fixed; }
.pagebar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pagebar h1 { font-size: 19px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-tools { display: flex; align-items: center; gap: 8px; min-width: 0; }
.page-tools:empty { display: none; }
.pagebar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.updated { display: inline-flex; align-items: center; gap: 7px; margin-right: 2px; font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-fill); box-shadow: 0 0 0 3px var(--green-soft); }
.pagebar-button { min-height: 32px; padding: 5px 10px; font-size: 12.5px; }
/* Auto-refresh runs every few seconds; the button stays steady instead of blinking. */
#refresh:disabled { opacity: 1; cursor: progress; }
.language-toggle { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 7px; min-height: 32px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--card-shadow); color: var(--text-2); font-size: 12px; white-space: nowrap; cursor: pointer; }
.language-toggle:hover { background: var(--surface-3); color: var(--text); border-color: var(--control-line); }
.language-symbol { font-size: 10.5px; color: var(--muted); }
main { flex: 1; width: 100%; padding: 8px 28px 24px; }
.view-description { margin: 0 0 18px; max-width: 78em; font-size: 13px; line-height: 1.6; color: var(--muted); }
.nav-backdrop, .nav-backdrop[hidden] { display: none; }
.mobile-only { 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; }
.build-badge { font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.7; color: var(--muted); }
footer > span:first-child { flex-shrink: 0; color: var(--text-2); }

/* Metric strip: one card split into sections, each with an icon tile, label, number and context. */
.metrics, .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius); box-shadow: var(--card-shadow); }
.metric, .kpi { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 16px 20px; }
.metric + .metric::before, .kpi + .kpi::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 1px; background: var(--line); }
.metric:has(> .tile-icon) { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; gap: 4px 14px; }
.metric:has(> .tile-icon) > * { grid-column: 2; }
.metric > .tile-icon { grid-column: 1; grid-row: 1 / span 3; align-self: start; }
.kpi-head { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.kpi-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
/* Summary cards cycle through the companion colors, so a row of four reads teal, blue, violet, pink and matches the sparklines under them. */
.kpi:nth-child(4n+1), .metric:nth-child(4n+1) { --tile: var(--teal); --tile-ink: var(--teal-ink); }
.kpi:nth-child(4n+2), .metric:nth-child(4n+2) { --tile: var(--blue-fill); --tile-ink: var(--blue); }
.kpi:nth-child(4n+3), .metric:nth-child(4n+3) { --tile: var(--violet); --tile-ink: var(--violet-ink); }
.kpi:nth-child(4n+4), .metric:nth-child(4n+4) { --tile: var(--pink); --tile-ink: var(--pink-ink); }
.tile-icon { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border: 1px solid color-mix(in srgb, var(--tile, var(--line-strong)) 28%, var(--surface)); border-radius: 9px; background: color-mix(in srgb, var(--tile, var(--surface-2)) 13%, var(--surface)); color: var(--tile-ink, var(--text-2)); }
:root[data-theme="dark"] .tile-icon { background: color-mix(in srgb, var(--tile, var(--surface-2)) 18%, var(--surface)); }
.tile-icon svg { width: 16px; height: 16px; }
.metric-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 450; color: var(--muted); }
.metric-value { margin-top: 2px; font-size: 25px; font-weight: 500; line-height: 1.2; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); overflow-wrap: anywhere; }
.metric-foot { font-size: 11.5px; line-height: 1.55; color: var(--muted); }
.kpi { justify-content: space-between; gap: 14px; }
.kpi .metric-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi > .spark { width: 100%; height: 40px; }
.kpi > .fleet-bar { margin-bottom: 6px; }
.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) 18%, transparent); stroke: none; }
.spark-empty { stroke: var(--line-strong); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.spark.teal { --spark: var(--teal); }
.spark.blue { --spark: var(--blue-fill); }
.spark.violet { --spark: var(--violet); }
.spark-compare { fill: none; stroke: var(--muted); stroke-width: 1.3; stroke-dasharray: 5 4; stroke-linejoin: round; vector-effect: non-scaling-stroke; opacity: .85; }
/* Summary bars: each card's own companion colour; a bin without reports stays a grey tick. */
.kpi > .spark.bars { height: 34px; }
.spark.bars .bar { fill: var(--spark); }
.spark.bars .bar-gap { fill: var(--line-strong); }
.kpi-delta { color: var(--muted); }
.kpi-delta b { font-weight: 600; color: var(--tile-ink, var(--text)); font-variant-numeric: tabular-nums; }
.kpi-delta b.better { color: var(--green); }
.kpi-delta b.worse { color: var(--amber); }
.fleet-bar { display: flex; gap: 5px; height: 10px; }
.fleet-bar i { flex: 1; border-radius: 999px; background: var(--line-strong); }
.fleet-bar i.up { background: var(--stripes), var(--green-fill); }
.fleet-bar i.partial { background: var(--stripes), var(--amber-fill); }
.fleet-bar i.down { background: var(--stripes), var(--red-fill); }

/* Panels and tables */
.panel { margin-bottom: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius); box-shadow: var(--card-shadow); }
/* Cards take turns through the companion colors as a light wash: app.js gives each card on a page a data-tone in
   order, starting with the page's sidebar section color, and summary strips wash each cell in its icon color. The
   wash holds a light tint through the top third of the card's heading (or the cell) and fades to transparent by
   its end, so tables, charts and forms below sit on the plain surface. Every text color keeps 4.5:1 or more even
   on the strongest point of the wash. */
.panel[data-tone="teal"] { --tone: var(--teal); }
.panel[data-tone="blue"] { --tone: var(--blue-fill); }
.panel[data-tone="violet"] { --tone: var(--violet); }
.panel[data-tone="pink"] { --tone: var(--pink); }
.panel[data-tone="gold"] { --tone: var(--amber-fill); }
.kpis > .kpi, .metrics > .metric { --tone: var(--tile); }
/* --wash-level (0-1) is the reader's Appearance setting; at 1 the wash reaches 18% light or 11% dark, the most
   each theme allows before some text color drops under 4.5:1. */
.panel[data-tone] > .panel-head, .kpis > .kpi, .metrics > .metric { --wash: color-mix(in srgb, var(--tone) calc(18% * var(--wash-level)), transparent); background-image: linear-gradient(var(--wash) 35%, transparent); }
/* Dark washes lift muted text a little so it keeps 4.5:1 where the wash is strongest. */
:root[data-theme="dark"] :is(.panel[data-tone] > .panel-head, .kpis > .kpi, .metrics > .metric) { --muted: #9c9da3; --wash: color-mix(in srgb, var(--tone) calc(11% * var(--wash-level)), transparent); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 16px 18px 12px; }
/* The description keeps a readable width; actions move under it before squeezing it. */
.panel-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.panel-head h2 { font-size: 14px; font-weight: 550; }
.panel-head p { margin: 3px 0 0; max-width: 72em; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.panel-head > button { white-space: nowrap; flex-shrink: 0; }
.panel-head > div + div { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; flex-shrink: 0; min-width: 0; max-width: 100%; }
.panel-head > input[type="search"] { max-width: 240px; min-height: 32px; margin: 0; padding: 5px 10px; font-size: 12.5px; }
.panel-body { padding: 18px; }
.panel-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; margin-bottom: 16px; }
.panel-pair > .panel { margin: 0; }
.panel > p.fine { margin: 0; padding: 12px 18px 16px; }
.node-panel > .panel-head { align-items: flex-start; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.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%; }
.badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
td .badge-row { gap: 6px; margin: 6px 0 0; }
.health-summary { padding: 12px 18px; 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; }
.page-tabs > .toolbar { margin: 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, .12), transparent) left / 12px 100% no-repeat scroll,
    linear-gradient(to left, rgba(0, 0, 0, .12), transparent) right / 12px 100% no-repeat scroll;
}
.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; 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: 9px 14px; background: var(--surface); border-top: 1px solid var(--line);
  font-size: 12px; font-weight: 450; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--text-2); }
td:first-child, th:first-child { padding-left: 18px; }
td:last-child, th:last-child { padding-right: 18px; }
td strong { font-weight: 550; color: var(--text); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
tr.row-link { cursor: pointer; }
tr.row-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
tr.row-link.selected { background: var(--accent-soft); }
.subline { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.subline.mono { font-size: 11px; }

/* Status labels: a softly tinted tag in the status color, no ring. */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 1px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; line-height: 1.6;
  background: var(--surface-3); color: var(--muted); white-space: nowrap;
}
.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); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 3px 10px; border-radius: 7px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.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); }
.status-pill.neutral { color: var(--muted); background: var(--surface-3); }

.empty { padding: 44px 24px; text-align: center; }
.empty .empty-symbol { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-2); font-size: 18px; color: var(--accent); }
.empty h2 { font-size: 15px; }
.empty p { max-width: 440px; margin: 8px auto 18px; font-size: 12.5px; color: var(--muted); }

.notification { margin-bottom: 16px; padding: 11px 16px; border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); border-radius: 10px; background: var(--green-soft); font-size: 13px; line-height: 1.6; color: var(--text); }
.notification.failure { border-color: color-mix(in srgb, var(--red) 35%, transparent); background: var(--red-soft); }

.capabilities { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; padding: 6px 18px 12px; }
.capability { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.feature-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 12px; padding: 16px 18px 18px; }
.feature-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.feature-row.on { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); box-shadow: inset 3px 0 0 var(--green); }
.feature-text { display: grid; gap: 6px; min-width: 0; }
.feature-text h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0; font-size: 14px; color: var(--text); }
.feature-text p { margin: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.6; }
.feature-text .feature-usage { color: var(--amber); font-weight: 600; }
.feature-row > button { flex-shrink: 0; min-width: 84px; }

/* Dialogs: editing and details slide in from the right; confirmations stay centered. */
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(4, 6, 10, .5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
/* Appearance changes preview live, so the page behind stays sharp and only lightly dimmed. */
#dialog:has(.appearance-settings)::backdrop { background: rgba(4, 6, 10, .12); -webkit-backdrop-filter: none; backdrop-filter: none; }
#dialog.sheet { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(600px, 100%); max-width: 100%; height: 100vh; height: 100dvh; max-height: none; border-width: 0 0 0 1px; border-radius: 0; overflow-y: auto; overscroll-behavior: contain; }
#dialog.sheet[open] { animation: sheet-in .22s cubic-bezier(.2, .8, .2, 1); }
#dialog.sheet:has(.setup-cards) { width: min(880px, 100%); }
#dialog.sheet:has(.forwarding-diagram) { width: min(1120px, 100%); }
#dialog.sheet:has(.connections-dialog) { width: min(1040px, 100%); }
#dialog.sheet:has(.appearance-settings) { width: min(520px, 100%); }
#dialog.confirm { width: min(500px, calc(100% - 32px)); }
@keyframes sheet-in { from { transform: translateX(32px); opacity: 0; } }
.dialog-head { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dialog-head h2 { font-size: 16px; }
#dialog-body { padding: 4px 22px 22px; }
.dialog-actions { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin: 22px -22px -22px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface); }
/* A dialog's error line follows the action bar; clear the bar's negative bottom margin so the bar does not cover it. */
.dialog-actions + .error:not(:empty) { margin-top: 31px; }
/* The Diagnostics speed test form sits in the page, not a dialog: no sticky bar. */
.speed-test-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* Inspector sheets: a header strip, label/value facts and grouped actions. */
.inspector-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 16px 0 14px; border-bottom: 1px solid var(--line); }
.inspector-head .mono { color: var(--muted); }
.inspector-section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.inspector-section:last-child { border-bottom: 0; }
.inspector-section > h3 { margin: 0 0 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
/* Deleting sits at the end of the details under a red heading: easy to find, apart from everyday actions. */
.inspector-danger > h3 { color: var(--red); }
.inspector-danger > p { margin: 0 0 12px; max-width: 60em; }
.facts { display: grid; grid-template-columns: minmax(7em, 34%) minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.facts dd.warning { color: var(--amber); }
.facts dd.error { color: var(--red); }
.inspector-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }

/* Overview: KPI tiles, then the map beside what needs attention, then paths and nodes. */
.overview-bento { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; margin-bottom: 16px; }
.overview-bento > .panel { margin: 0; min-width: 0; display: flex; flex-direction: column; }
.overview-waiting { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; margin-bottom: 16px; border: 1px solid color-mix(in srgb, var(--blue) 28%, transparent); border-radius: var(--radius); background: var(--blue-soft); }
.overview-waiting strong { font-size: 13px; }
.overview-waiting p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-2); max-width: 70em; }
.overview-waiting button { flex-shrink: 0; }
/* Three trend charts sit in one row on a laptop screen. */
.overview-trends { margin-bottom: 16px; }
.chart-grid.overview-trends { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
/* Second row: the 24-hour connection dial on the left, what needs attention and throughput stacked on the right. */
.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.overview-grid > .panel { margin: 0; min-width: 0; display: flex; flex-direction: column; }
.overview-grid > .dial-panel { grid-row: span 2; }
.dial-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 4px 18px 20px; }
.dial { display: block; width: 100%; max-width: 540px; height: auto; aspect-ratio: 1; overflow: visible; font-family: var(--sans); }
.dial .ok { fill: var(--teal); }
.dial .fail { fill: var(--red-fill); }
.dial .idle { fill: var(--line-strong); }
.dial-face { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.dial-tick { stroke: var(--line-strong); stroke-width: 1; }
.dial-tick.major { stroke: var(--muted); }
.dial-hour { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.dial-alert { font-family: var(--mono); font-size: 11px; font-weight: 600; fill: var(--red); }
.dial-hand { stroke: var(--text-2); stroke-width: 1.3; stroke-linecap: round; }
.dial-hand-dot { fill: var(--text); }
.dial-value { font-size: 38px; font-weight: 600; letter-spacing: -.02em; fill: var(--text); font-variant-numeric: tabular-nums; }
.dial-label { font-size: 13px; fill: var(--muted); }
.dial-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 26px; font-size: 12.5px; color: var(--muted); }
.dial-key span { display: inline-flex; align-items: center; gap: 7px; }
.dial-key i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.dial-key i.ok { background: var(--teal); }
.dial-key i.fail { background: var(--red-fill); }
.dial-key b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.attention-count { font-size: 12.5px; font-weight: 550; color: var(--amber); white-space: nowrap; }
.attention-count.clear { color: var(--green); }
/* The open problem as a tinted callout: red for critical, amber for a warning, green when nothing is open. */
.attention-callout { --call: var(--red); --call-fill: var(--red-fill); --call-soft: var(--red-soft); display: grid; grid-template-columns: 9px minmax(0, 1fr); gap: 12px; margin: 0 18px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--call) 38%, var(--line)); border-radius: 10px; background: var(--call-soft); }
.attention-callout.warning { --call: var(--amber); --call-fill: var(--amber-fill); --call-soft: var(--amber-soft); }
.attention-callout.clear { --call: var(--green); --call-fill: var(--green-fill); --call-soft: var(--green-soft); }
.attention-callout > i { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--call-fill); box-shadow: 0 0 0 3px color-mix(in srgb, var(--call-fill) 28%, transparent); }
.attention-text { min-width: 0; }
.attention-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.attention-title strong { font-size: 13.5px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.attention-title time { flex-shrink: 0; font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
.attention-text p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 4px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere; }
.attention-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
.attention-actions button { min-height: 30px; padding: 4px 14px; font-size: 12.5px; }
.attention-more { font-size: 12px; color: var(--text-2); }
.traffic-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 4px; }
.traffic-head h3 { margin: 0; font-size: 13px; font-weight: 550; color: var(--text); }
.traffic-head h3 span { font-weight: 400; color: var(--muted); }
.text-link { min-height: 0; padding: 3px 4px; border: 0; background: none; box-shadow: none; color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.text-link:hover { background: none; color: var(--accent); }
.traffic-rank { list-style: none; margin: 0; padding: 2px 18px 14px; }
.traffic-rank li { display: grid; grid-template-columns: 1.4em minmax(0, 9em) minmax(0, 7em) minmax(48px, 1fr) 6.5em; align-items: center; gap: 12px; padding: 6px 0; font-size: 12.5px; }
.traffic-index { font-family: var(--mono); color: var(--muted); }
.traffic-rank strong { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.traffic-place { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.traffic-bar { height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.traffic-bar i { display: block; height: 100%; border-radius: inherit; background: var(--muted); }
.traffic-bar i.up { background: var(--teal); }
.traffic-bar i.partial { background: var(--amber-fill); }
.traffic-bar i.down { background: var(--red-fill); }
.traffic-value { font-family: var(--mono); font-size: 12px; color: var(--text); text-align: right; white-space: nowrap; }
.throughput-panel .chart-body { flex: 1; }
.legend i.teal { background: var(--teal); }
.legend i.compare { height: 0; border-radius: 0; background: none; border-top: 2px dashed var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 4px; border-radius: 2px; background: var(--line-strong); }
.legend i.up { background: var(--green-fill); }
.legend i.partial { background: var(--amber-fill); }
.legend i.down { background: var(--red-fill); }
.legend i.unknown { background: var(--muted); }
.graph-panel .panel-head { flex-wrap: wrap; }
.chain-wrap { flex: 1; display: flex; flex-direction: column; align-items: stretch; min-height: 240px; padding: 14px 18px 18px; overflow-x: auto; background-color: var(--surface); background-image: radial-gradient(var(--grid) 1px, transparent 1px); background-size: 16px 16px; }
.chain-notice { margin: 4px 0 12px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.chain { flex: 1; flex-shrink: 0; 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-fill); stroke-dasharray: 6 5; animation: flow 1.2s linear infinite; }
.edge.partial { stroke: var(--amber-fill); stroke-dasharray: 6 5; animation: flow 1.2s linear infinite; }
.edge.down { stroke: var(--red-fill); 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; }
.edge-label.partial { fill: var(--amber); }
.edge-label.down { fill: var(--red); }
.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-fill); }
.chain-node.partial .dot { fill: var(--amber-fill); }
.chain-node.down .dot { fill: var(--red-fill); }
.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); }
.alert-status.event-board { grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.event-board .alert-stat { padding: 12px 16px; }
.event-board .alert-stat .metric-value { margin: 0 0 2px; font-size: 22px; }
.incidents { list-style: none; margin: 0; padding: 2px 0; flex: 1; }
.incident { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 18px; 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-fill); }
.incident.warning > i { background: var(--amber-fill); }
.incident.critical > i { background: var(--red-fill); 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 { display: flex; align-items: center; min-height: 120px; padding: 24px 18px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.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-fill); }
.meter-fill.mid { fill: var(--amber-fill); }
.meter-fill.high { fill: var(--red-fill); }
/* Compact overview: the same data in shorter cards. */
body[data-overview-layout="workspace"] .kpi > .spark { height: 30px; }
body[data-overview-layout="workspace"] .metric-value { font-size: 22px; }
body[data-overview-layout="workspace"] .chain-wrap { min-height: 200px; }
body[data-overview-layout="workspace"] .dial { max-width: 400px; }
body[data-overview-layout="workspace"] td { padding-top: 9px; padding-bottom: 9px; }

/* Alerts */
.alert-status { display: grid; grid-template-columns: repeat(3, minmax(110px, 160px)) 1fr; gap: 1px; background: var(--line); }
.alert-stat { padding: 16px 18px; background: var(--surface); }
.alert-stat .metric-value { margin: 0 0 4px; font-size: 24px; }
.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: 16px 18px; background: var(--surface); }
.row-actions { display: flex; gap: 6px; 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: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.error-text { margin: 8px 0 0; color: var(--red); 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; }

/* Search is a real local command palette; no external service or request. */
.command-dialog { width: min(620px, calc(100% - 28px)); margin-top: min(16vh, 130px); overflow: hidden; border-radius: 14px; }
.command-input-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.command-input-row input { flex: 1; min-width: 0; min-height: 0; margin: 0; padding: 8px 0; border: 0; background: transparent; outline: none; box-shadow: none; font-size: 15px; color: var(--text); }
.command-escape { border: 1px solid var(--line-strong); color: var(--muted); background: var(--surface-2); font-size: 10.5px; padding: 2px 6px; 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: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.command-result > svg { flex-shrink: 0; width: 17px; height: 17px; color: var(--muted); }
.command-result strong { display: block; font-size: 13px; font-weight: 550; }
.command-result div > span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.command-result.selected, .command-result:hover { background: var(--accent-soft); color: var(--accent-soft-text); }
.result-enter { margin-left: auto; color: var(--muted); font-size: 13px; }
.command-footer { display: flex; justify-content: space-between; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.command-footer kbd { margin-right: 3px; }
.search-empty { text-align: center; color: var(--muted); font-size: 12.5px; padding: 30px 15px; }
.search-empty strong { color: var(--text-2); font-weight: 550; }

/* The handbook: chapter list, article and in-article contents. */
.guide-layout { display: grid; grid-template-columns: 200px minmax(0, 760px); gap: 28px; align-items: start; }
.guide-contents { position: sticky; top: 84px; padding: 2px 0; }
.guide-contents .nav-label { margin: 0 8px 10px; }
.guide-link { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 10px; margin-bottom: 2px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.guide-link svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--muted); }
.guide-link.active svg { color: var(--accent); }
.guide-link:not(.active):hover { background: var(--surface-2); }
.guide-paper { padding: 32px 40px; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--card-shadow); }
.guide-heading { padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.guide-read { font-size: 11.5px; font-weight: 600; color: var(--accent); }
.guide-heading h2 { margin-top: 10px; font-size: 26px; line-height: 1.3; letter-spacing: -.025em; font-weight: 650; }
.guide-lead { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.guide-steps section { display: flex; align-items: flex-start; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 84px; }
.guide-steps section:last-child { border: 0; }
.step-number { flex-shrink: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-soft-text); font-family: var(--mono); font-size: 12px; font-weight: 650; }
.guide-steps h2 { font-size: 15px; line-height: 30px; font-weight: 600; }
.guide-steps p { margin: 6px 0 0; font-size: 14px; color: var(--text-2); line-height: 1.85; }
.guide-callout { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: var(--blue-soft); border: 1px solid color-mix(in srgb, var(--blue) 28%, transparent); border-radius: 10px; margin: 6px 0 24px; }
.guide-callout svg { width: 17px; height: 17px; color: var(--blue); flex-shrink: 0; margin-top: 3px; }
.guide-callout p { margin: 0; font-size: 13px; line-height: 1.75; 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: 13px; font-weight: 550; }
.guide-toc { display: none; position: sticky; top: 84px; padding-left: 16px; border-left: 1px solid var(--line); }
.guide-toc .nav-label { margin: 0 0 8px; }
.toc-link { display: block; width: 100%; padding: 6px 0; text-align: left; background: transparent; border: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.toc-link:hover { color: var(--accent); }
.guide-toc .fine { font-size: 11.5px; margin-top: 18px; }

/* Appearance */
.appearance-settings > p { font-size: 12.5px; margin: 10px 0; }
.appearance-settings fieldset { padding: 10px; margin: 14px 0 8px; border-radius: 10px; }
.appearance-settings legend { 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: 8px; }
.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: 11px 12px; min-height: 46px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); 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; }
.wash-control { display: flex; align-items: center; gap: 12px; }
.wash-control input[type="range"] { flex: 1; min-height: 28px; padding: 0; border: 0; background: none; box-shadow: none; accent-color: var(--accent-fill); }
.wash-control output { min-width: 3em; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.appearance-settings [data-preference="wash"] small { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.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: 11.5px; font-weight: 400; line-height: 1.55; margin-top: 2px; }
.accent-swatch { display: block; width: 14px; height: 14px; flex-shrink: 0; border-radius: 50%; }
.accent-swatch[data-accent="indigo"] { background: #2451e6; }
.accent-swatch[data-accent="cyan"] { background: #0e7490; }
.accent-swatch[data-accent="emerald"] { background: #047857; }
.accent-swatch[data-accent="ember"] { background: #d24201; }
.accent-swatch[data-accent="violet"] { background: #6d3ae0; }
.accent-swatch[data-accent="rose"] { background: #cf1d63; }
.accent-swatch[data-accent="sky"] { background: #0270ad; }
.accent-swatch[data-accent="graphite"] { background: #334155; }
:root[data-theme="dark"] .accent-swatch[data-accent="indigo"] { background: #8c96ff; }
:root[data-theme="dark"] .accent-swatch[data-accent="cyan"] { background: #22d3ee; }
:root[data-theme="dark"] .accent-swatch[data-accent="emerald"] { background: #34d399; }
:root[data-theme="dark"] .accent-swatch[data-accent="ember"] { background: #f87029; }
:root[data-theme="dark"] .accent-swatch[data-accent="violet"] { background: #b39dff; }
:root[data-theme="dark"] .accent-swatch[data-accent="rose"] { background: #ff7eb0; }
:root[data-theme="dark"] .accent-swatch[data-accent="sky"] { background: #5cc6ff; }
:root[data-theme="dark"] .accent-swatch[data-accent="graphite"] { background: #d4d9e1; }

/* Sign in: the form on the left, a static and inexpensive network illustration on the right. */
.login-screen { position: relative; min-height: 100vh; display: grid; grid-template-columns: minmax(400px, 44%) 1fr; background: var(--bg); }
.login-card { width: min(400px, calc(100% - 64px)); justify-self: center; align-self: center; padding: 48px 0; }
.login-brand { margin-bottom: 56px; font-size: 22px; }
.login-brand .brand-sub { font-size: 12px; }
.login-card > .eyebrow { margin-top: 0; }
.login-card h1 { font-size: 32px; line-height: 1.35; font-weight: 650; letter-spacing: -.025em; }
.login-card > .muted { font-size: 13.5px; margin: 14px 0 26px; }
.login-card label { font-size: 12.5px; }
.login-card input { min-height: 40px; }
.login-card > .primary { width: 100%; min-height: 42px; margin-top: 10px; padding: 10px 16px; justify-content: space-between; font-size: 14px; }
.login-card .fine code { color: var(--text-2); }
.login-language-toggle { position: absolute; top: 22px; right: 24px; z-index: 1; }
.login-art {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; padding: 60px 48px;
  border-left: 1px solid var(--line);
  background: radial-gradient(ellipse at 60% 30%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 62%), radial-gradient(var(--grid) 1px, transparent 1px) 0 0 / 20px 20px, var(--chrome);
}
.login-note { width: min(100%, 520px); }
.login-note > p { font-size: clamp(40px, 4.6vw, 62px); font-weight: 700; letter-spacing: -.035em; line-height: 1.06; margin: 18px 0; }
.login-note em { font-style: normal; color: var(--accent); }
.login-note > span:last-child { color: var(--muted); font-size: 13px; }
.route-card { width: min(100%, 520px); border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.route-head { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; 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: 44px 24px 36px; }
.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: 36px; padding: 0 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--surface); font-family: var(--mono); font-size: 11.5px; 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: 9px 0; }
.hop span { font-size: 11.5px; color: var(--muted); }
.route-log { border-top: 1px solid var(--line); padding: 12px 18px; font-family: var(--mono); font-size: 11.5px; line-height: 2; color: var(--muted); }
.route-log em { font-style: normal; color: var(--accent); margin-right: 12px; }
.network-label { position: absolute; bottom: 30px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .3em; color: var(--muted); }

@media (min-width: 1500px) {
  main { padding-left: 36px; padding-right: 36px; }
  .pagebar { padding-left: 36px; padding-right: 36px; }
  .guide-layout { grid-template-columns: 200px minmax(0, 760px) 180px; }
  .guide-toc { display: block; }
}
@media (max-width: 1280px) {
  .overview-bento { grid-template-columns: minmax(0, 1fr); }
  .incidents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .incident-empty { min-height: 64px; grid-column: 1 / -1; }
}
@media (max-width: 1180px) {
  .updated { display: none; }
  .pagebar-label { display: none; }
  .pagebar-button { width: 32px; padding: 0; }
  .pagebar .language-symbol { display: none; }
  .pagebar .language-toggle { width: auto; padding: 5px 9px; }
}
@media (max-width: 1100px) {
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .overview-grid > .dial-panel { grid-row: auto; }
  .dial { max-width: 380px; }
  .kpis, .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(odd)::before, .kpi:nth-child(odd)::before { display: none; }
  .metric:nth-child(n+3), .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .guide-layout { grid-template-columns: 1fr; gap: 18px; }
  .guide-contents { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .guide-contents .nav-label { width: 100%; }
  .guide-link { width: auto; padding: 7px 10px; }
}
@media (max-width: 920px) {
  .application { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; transform: translateX(-100%); transition: transform .2s ease; }
  .nav-open { overflow: hidden; }
  .nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 24; background: rgba(5, 7, 10, .55); border: 0; border-radius: 0; }
  .mobile-only { display: inline-flex; }
  .pagebar { padding: 10px 16px; gap: 10px; }
  main { padding: 18px 18px 20px; }
  .login-screen { grid-template-columns: 1fr 1fr; }
  .login-card { width: calc(100% - 40px); padding: 36px 10px; }
  .login-art { padding: 40px 24px; }
  .login-card h1 { font-size: 27px; }
  .route { gap: 5px; padding: 30px 10px; }
  .hop b { min-width: 48px; font-size: 10px; }
}
@media (max-width: 640px) {
  /* Phones: the title row scrolls away with the page; status and page tools wrap under it. */
  .pagebar { position: relative; flex-wrap: wrap; gap: 8px; min-height: 56px; padding: 8px 12px 10px; }
  .pagebar-title { display: contents; }
  .pagebar h1 { flex: 1 1 45%; min-width: 0; font-size: 17px; }
  .pagebar-actions { gap: 2px; margin-left: 0; }
  .pagebar .status-pill { order: 3; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .page-tools { order: 4; flex: 1 1 auto; }
  .page-tools .mode-picker { width: 100%; }
  #context-help { display: none; }
  .pagebar .language-toggle, .pagebar-button { min-height: 36px; }
  .login-language-toggle { top: 18px; right: 18px; }
  main { padding: 14px 12px 20px; }
  .view-description { font-size: 12.5px; margin-bottom: 14px; }
  .kpis, .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi, .metric { padding: 13px 13px 12px; }
  .kpi-head, .metric:has(> .tile-icon) { column-gap: 10px; }
  .tile-icon { width: 30px; height: 30px; }
  .metric-value, .kpi .metric-value { font-size: 21px; }
  .metric-foot { font-size: 11px; }
  .incidents { grid-template-columns: 1fr; }
  .traffic-rank li { grid-template-columns: 1.2em minmax(0, 1fr) minmax(40px, 1fr) 6.5em; gap: 10px; }
  .traffic-place { display: none; }
  .attention-callout { margin: 0 14px; }
  .traffic-head, .traffic-rank { padding-left: 14px; padding-right: 14px; }
  .panel-head { padding: 13px 14px; flex-wrap: wrap; }
  .panel-head > input[type="search"] { max-width: none; }
  .panel-body { padding: 14px; }
  .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; }
  .feature-row { flex-direction: column; gap: 14px; }
  .feature-row > button { width: 100%; }
  .alert-status { grid-template-columns: repeat(3, 1fr); }
  .alert-actions { grid-column: 1 / -1; justify-content: flex-start; padding: 12px 14px; }
  .alert-stat { padding: 12px 14px; }
  footer { flex-direction: column; gap: 6px; }
  .guide-paper { padding: 22px 18px; }
  .guide-heading h2 { font-size: 21px; }
  .guide-steps section { gap: 12px; padding: 18px 0; }
  .guide-steps p { font-size: 13.5px; }
  .command-footer { padding: 11px 12px; gap: 8px; }
  .command-input-row { padding: 12px 14px; }
  .command-input-row input { font-size: 16px; }
  input, select, textarea { font-size: 16px; }
  .nav-button { min-height: 40px; }
  .appearance-options, .appearance-settings [data-preference="theme"] .appearance-options { grid-template-columns: 1fr; }
  .overview-waiting { flex-direction: column; align-items: flex-start; padding: 14px; }
  .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: 44px; }
  .login-card h1 { font-size: 28px; }
  #dialog.confirm { max-height: 88dvh; }
  .dialog-head { padding: 14px 18px; }
  #dialog-body { padding: 4px 18px 22px; }
  .dialog-actions { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* 0.128: forwarding tabs, compact paths, templates, node actions and the overview globe. */
.page-tabs { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
/* Segmented controls share one look: a recessed track with the chosen option raised. */
.page-tab-list, .mode-picker { display: inline-flex; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 3px; border: 0; border-radius: 10px; background: var(--track); }
.page-tab, .mode-picker button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 30px; padding: 4px 13px; border: 0; border-radius: 7px; background: transparent; font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; box-shadow: none; }
.page-tab:hover, .mode-picker button:hover { background: transparent; color: var(--text); }
.page-tab[aria-current="page"], .mode-picker button[aria-pressed="true"] { background: var(--segment); color: var(--text); box-shadow: var(--segment-shadow); }
.tab-count { min-width: 20px; padding: 0 6px; border-radius: 5px; background: color-mix(in srgb, var(--text) 9%, transparent); color: var(--text-2); font-size: 11px; line-height: 18px; text-align: center; }
.path-list { display: flex; flex-direction: column; }
.path-list .path-summary { margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.path-list .path-summary:last-child { border-bottom: 0; }
.path-list .path-summary-head { align-items: flex-start; padding: 18px 22px 10px; }
.path-title { min-width: 0; }
.path-title h3 { margin: 0 0 8px; font-size: 15px; }
.path-tags, .path-actions, .row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.path-actions { justify-content: flex-end; flex-shrink: 0; }
.route-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 0 22px 14px; }
.route-chip { display: inline-flex; flex-direction: column; gap: 2px; min-width: 0; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-size: 12px; line-height: 1.35; }
.route-chip strong { font-size: 12.5px; color: var(--text); }
.route-chip .mono { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.route-chip.route-end { border-style: dashed; background: var(--surface-2); color: var(--text-2); }
.route-chip.route-warning { border-color: var(--amber); color: var(--amber); }
.route-service { margin-top: 2px; font-size: 10.5px; font-weight: 600; color: var(--accent); }
.route-arrow { color: var(--muted); font-size: 14px; }
.route-link { display: inline-flex; align-items: center; gap: 6px; }
.route-probe { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; line-height: 1.3; color: var(--muted); font-variant-numeric: tabular-nums; }
.route-link .route-probe { max-width: 24em; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); }
.route-probe::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.route-probe.up::before { background: var(--green-fill); }
.route-probe.partial { color: var(--amber); }
.route-probe.partial::before { background: var(--amber-fill); }
.route-probe.down { color: var(--red); }
.route-probe.down::before { background: var(--red-fill); }
.route-chip.route-failed { border-color: var(--red); }
.route-note { margin-top: 2px; font-size: 10.5px; font-weight: 600; color: var(--amber); }
.route-note.down { color: var(--red); }
.route-chip.route-candidates { gap: 6px; }
.route-candidate { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; }
.route-chip .route-candidate-name { font-size: 12px; color: var(--text); }
.route-role { padding: 1px 6px; border-radius: 4px; background: var(--surface-2); color: var(--text-2); font-size: 10.5px; }
.route-conn { flex: none; white-space: nowrap; font-weight: 650; color: var(--green); }
.route-probe > .route-conn:not(:first-child)::before { content: "·"; margin-right: 5px; font-weight: 400; color: var(--muted); }
.route-conn.partial { color: var(--amber); }
.route-conn.down { color: var(--red); }
.hop-history-box:empty { display: none; }
.hop-history-box { margin: 4px 0 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.hop-history-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.hop-history-head > div:first-child { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.hop-history { display: grid; grid-template-columns: fit-content(15rem) minmax(160px, 1fr) max-content; align-items: center; gap: 8px 14px; }
.hop-history-label { font-size: 12px; color: var(--text); overflow-wrap: anywhere; }
.hop-history-total { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-align: right; }
.hop-history-total.up { color: var(--green); }
.hop-history-total.partial { color: var(--amber); }
.hop-history-total.down { color: var(--red); }
.uptime { display: grid; grid-template-columns: repeat(var(--bins), minmax(0, 1fr)); gap: 2px; height: 22px; }
.uptime i { border-radius: 2px; background: var(--surface-3); }
.uptime i.up { background: var(--green-fill); }
.uptime i.partial { background: var(--amber-fill); }
.uptime i.down { background: var(--red-fill); }
@media (hover: hover) { .uptime i:hover { outline: 2px solid var(--text); outline-offset: 1px; } }
.hop-history-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); }
@media (max-width: 640px) {
  /* Each hop's name gets its own line; cells touch so 168 hourly bins still fit. */
  .hop-history-box { padding: 12px; }
  .hop-history { grid-template-columns: minmax(0, 1fr) max-content; gap: 4px 10px; }
  .hop-history-label { grid-column: 1 / -1; margin-top: 6px; }
  .hop-history > span:empty { display: none; }
  .uptime { gap: 0; }
  .uptime i { border-radius: 0; }
}
.overview-trends { margin-bottom: 18px; }
details.path-details { margin: 0; padding: 0 22px; border: 0; border-top: 1px dashed var(--line); border-radius: 0; background: none; }
details.path-details > summary { padding: 11px 0; color: var(--accent); }
details.path-details[open] { padding-bottom: 14px; }
.path-details .forwarding-diagram { margin: 0 0 4px; border: 1px solid var(--line); border-radius: 10px; }
.path-details .path-node-actions { padding: 12px 0 0; }
.toolbar.pager { justify-content: center; padding: 16px; margin: 0; border-top: 1px solid var(--line); }
.subline.warning { color: var(--amber); }
.subline.error { color: var(--red); }
.workflow-callout.warning { border-color: color-mix(in srgb, var(--amber) 35%, transparent); background: var(--amber-soft); }
.node-actions { flex-direction: row; flex-wrap: wrap; gap: 6px; max-width: 240px; }
.action-list { display: flex; flex-direction: column; }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.action-row:last-child { border-bottom: 0; }
.action-row p { margin: 4px 0 0; color: var(--muted); }
.action-row button { flex-shrink: 0; }
.template-wizards { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.template-wizards p { margin: 4px 0 0; color: var(--muted); }
.rollout-targets { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.rollout-targets legend { padding: 0 6px; font-size: 12px; font-weight: 600; }
.rollout-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 230px); align-items: center; gap: 12px; }
.rollout-row label { margin: 0; }
.rollout-row .subline { margin: 0 0 0 4px; }
.rollout-row input:not([type="checkbox"]) { font-family: var(--mono); font-size: 12px; }
.shared-lines { background: var(--surface-2); }
.shared-lines legend { color: var(--accent); }
.shared-line-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 14px; }
.shared-line-list label { margin: 8px 0; }
.shared-port-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.shared-port-row label { flex: 0 1 220px; margin: 8px 0 0; }
.shared-line-status { display: flex; flex-direction: column; gap: 4px; }
.shared-line-status > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.shared-entries .mono { white-space: nowrap; overflow-wrap: normal; }
.globe-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 260px; min-height: 0; }
.globe { position: relative; height: 440px; min-width: 0; background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--blue) 6%, transparent), transparent 70%); overflow: hidden; }
.globe canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.globe canvas:active { cursor: grabbing; }
.globe canvas.pointer { cursor: pointer; }
.globe-tip { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 3px; max-width: 260px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); box-shadow: 0 6px 18px #0000001a; font-size: 12px; pointer-events: none; }
.globe-tip span { color: var(--muted); font-size: 11px; }
.globe-side { display: flex; flex-direction: column; min-width: 0; padding: 16px 18px; border-left: 1px solid var(--line); }
.globe-count { margin: 0 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .03em; color: var(--muted); }
.globe-list { display: flex; flex-direction: column; gap: 4px; max-height: 410px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.globe-node { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; width: 100%; padding: 9px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: left; }
.globe-node:hover:not(:disabled), .globe-node.selected { border-color: var(--line-strong); background: var(--surface-2); }
.globe-node:disabled { opacity: 1; cursor: default; }
/* A long status badge moves under the name instead of cutting the name short. */
.globe-node-text { display: flex; flex-direction: column; flex: 1 1 8.5rem; min-width: 0; }
.globe-node-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.globe-node-text .subline { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.globe-node .badge { flex-shrink: 0; margin-left: auto; }
.globe-dot { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.globe-dot.up { background: var(--green-fill); box-shadow: 0 0 0 3px var(--green-soft); }
.globe-dot.partial { background: var(--amber-fill); box-shadow: 0 0 0 3px var(--amber-soft); }
.globe-dot.down { background: var(--red-fill); box-shadow: 0 0 0 3px var(--red-soft); }
.globe-side > .fine { margin: 12px 0 0; color: var(--muted); line-height: 1.6; }
body[data-overview-layout="workspace"] .globe { height: 340px; }
body[data-overview-layout="workspace"] .globe-list { max-height: 310px; }
@media (max-width: 980px) {
  .globe-body { grid-template-columns: 1fr; }
  .globe { height: 360px; }
  .globe-side { border-left: 0; border-top: 1px solid var(--line); }
  .globe-list { max-height: none; }
}
@media (max-width: 650px) {
  .setup-cards { grid-template-columns: 1fr; }
  .page-tabs > button.primary { width: 100%; }
  .path-list .path-summary-head { flex-direction: column; padding: 16px; }
  .path-actions { justify-content: flex-start; }
  .route-chips, details.path-details { padding-left: 16px; padding-right: 16px; }
  .rollout-row { grid-template-columns: 1fr; gap: 4px; }
  .action-row { flex-direction: column; align-items: stretch; }
}

/* Chart views for the monitoring pages, and the globe's empty state. */
.view-toolbar { justify-content: flex-end; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; margin-bottom: 18px; }
.chart-grid > .panel { margin-bottom: 0; min-width: 0; }
.chart-body { padding: 18px 22px 22px; }
.chart-key { grid-column: 1 / -1; margin-bottom: 2px; }
.chart-key i { width: 12px; height: 5px; border-radius: 3px; }
.chart-part, .chart-key i.unknown { background: var(--muted); }
.chart-part.teal, .chart-key i.teal { background: var(--teal); }
.chart-part.blue, .chart-key i.blue { background: var(--blue-fill); }
.chart-part.violet, .chart-key i.violet { background: var(--violet); }
.chart-part.up, .chart-key i.up { background: var(--green-fill); }
.chart-part.partial, .chart-key i.partial { background: var(--amber-fill); }
.chart-part.down, .chart-key i.down { background: var(--red-fill); }
.chart-part.unknown, .chart-key i.unknown { opacity: .5; }
.chart-part.free, .chart-key i.free { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-strong); }
.bar-chart { display: grid; grid-template-columns: fit-content(15rem) minmax(120px, 1fr) max-content max-content; align-items: center; gap: 14px 16px; }
.bar-label { display: flex; flex-direction: column; min-width: 0; }
.bar-label strong, .bar-label .subline { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label strong { font-size: 13px; }
.bar-track { display: flex; gap: 3px; height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar-track .chart-part { flex: none; height: 100%; border-radius: 999px; background-image: var(--stripes); }
.bar-track .chart-part.free { box-shadow: none; }
.bar-track.failed { background: repeating-linear-gradient(135deg, var(--red-soft) 0 5px, transparent 5px 10px), var(--surface-3); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 50%, transparent); }
.bar-value { font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: nowrap; text-align: right; }
.chart-frame { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 10px; }
.chart-axis { display: flex; flex-direction: column; justify-content: space-between; height: 160px; font-family: var(--mono); font-size: 11px; line-height: 1; color: var(--muted); text-align: right; }
.chart-labels { display: flex; justify-content: space-between; gap: 6px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.column-plot, .trend-chart .spark { height: 160px; border-bottom: 1px solid var(--line-strong); background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 50%; }
.column-plot { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); align-items: end; gap: 6px; }
.column { display: flex; flex-direction: column-reverse; justify-self: center; width: 100%; max-width: 64px; height: 100%; }
.column .chart-part { flex: none; width: 100%; background-image: var(--stripes); }
.column .chart-part:last-child { border-radius: 4px 4px 0 0; }
.column-labels { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); text-align: center; }
.trend-chart .spark { width: 100%; }
.spark.up { --spark: var(--green-fill); }
.timeline { display: grid; grid-template-columns: fit-content(12rem) minmax(0, 1fr); align-items: center; gap: 10px 14px; }
.timeline-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.timeline-track { position: relative; border-radius: 5px; background: linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 25% 100%, var(--surface-2); }
.timeline-bar { position: absolute; height: 10px; min-width: 3px; border-radius: 3px; }
.timeline-bar.partial { background-color: var(--amber-fill); }
.timeline-bar.down { background-color: var(--red-fill); }
.timeline-bar.open, .chart-key i.open { background-image: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--surface) 50%, transparent) 4px 7px); }
.chart-key i.open { background-color: var(--muted); }
.globe-stage { position: relative; min-width: 0; }
.globe-empty { position: absolute; top: 50%; left: 50%; width: min(340px, calc(100% - 40px)); padding: 18px 20px; border: 1px solid var(--line-strong); border-radius: 12px; background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: 0 10px 30px #0000001a; text-align: center; transform: translate(-50%, -50%); }
.globe-empty strong { display: block; font-size: 14px; }
.globe-empty p { margin: 6px 0 14px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
@media (max-width: 640px) {
  .view-toolbar { justify-content: stretch; }
  .mode-picker { width: 100%; }
  .mode-picker button { flex: 1; min-height: 40px; }
  .chart-body { padding: 16px; }
  .bar-chart { grid-template-columns: minmax(0, 1fr) max-content; gap: 6px 12px; }
  .bar-label { grid-column: 1 / -1; margin-top: 8px; }
  .bar-actions { grid-column: 1 / -1; }
  .bar-actions:empty { display: none; }
  .node-toolbar-actions { width: 100%; margin-left: 0; }
  .node-toolbar-actions .mode-picker { flex: 1; width: auto; }
  .timeline { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .timeline-name { margin-top: 6px; }
}

/* Live logs and diagnostics (0.132.0) */
.log-toolbar { flex-wrap: wrap; }
.log-toolbar label { flex-direction: row; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.log-toolbar input[type="search"] { flex: 1; min-width: 160px; max-width: 320px; }
.log-view { height: min(62vh, 640px); overflow: auto; padding: 8px 0; background: var(--surface-2); font-family: var(--mono); font-size: 12px; line-height: 1.6; }
.log-view:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.log-line { display: grid; grid-template-columns: max-content max-content 5ch minmax(0, 1fr); gap: 12px; padding: 1px 22px; }
.log-view:not(:has(.log-source)) .log-line { grid-template-columns: max-content 5ch minmax(0, 1fr); }
.log-line:hover { background: var(--surface-3); }
.log-line time, .log-source { color: var(--muted); white-space: nowrap; }
.log-source { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; }
.log-level { font-weight: 650; color: var(--muted); }
.log-line.warn .log-level { color: var(--amber); }
.log-line.error .log-level { color: var(--red); }
.log-line.error .log-text { color: var(--red); }
.log-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.log-note { margin: 6px 22px; padding: 3px 0; border-top: 1px dashed var(--line-strong); color: var(--muted); font-family: var(--sans); font-size: 11.5px; }
.log-empty { padding: 48px 22px; font-family: var(--sans); font-size: 12.5px; line-height: 1.7; color: var(--muted); text-align: center; }
.log-foot { padding: 10px 22px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.diagnostics-board { grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.findings .incident { grid-template-columns: 8px minmax(0, 1fr); }
.finding-title { font-size: 13px; font-weight: 600; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; }
.finding-detail { margin-top: 4px; font-size: 12.5px; line-height: 1.6; color: var(--text-2); overflow-wrap: anywhere; }
.finding-detail.code { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; padding: 6px 10px; border-radius: 6px; background: var(--surface-2); font-family: var(--mono); font-size: 11.5px; }
.finding-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; }
.finding-links .subline { margin: 0 6px 0 0; }
.diagnostics-contents { margin: 0; padding: 16px 22px 4px 40px; font-size: 13px; line-height: 1.9; color: var(--text-2); }
.diagnostics-note { margin: 0; padding: 4px 22px 18px; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) {
  .log-view { height: 60vh; font-size: 11px; }
  .log-toolbar label { width: 100%; }
  .log-toolbar label select { flex: 1; max-width: none; }
  .log-line, .log-view:not(:has(.log-source)) .log-line { display: flex; flex-wrap: wrap; gap: 0 8px; padding: 3px 14px; }
  .log-text { flex-basis: 100%; }
  .diagnostics-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.chain-members, .chain-layers { margin: 0; padding-left: 18px; }
.chain-members > li + li, .chain-layers > li + li { margin-top: 4px; }
.chain-members .badge { margin-left: 6px; }
.chain-editor-list { margin: 8px 0; padding-left: 20px; }
.chain-members.chain-editor-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.chain-row-tools { display: inline-flex; gap: 6px; }
.chain-layers.chain-editor-list > li { margin: 10px 0; padding: 2px 12px 10px; border: 1px solid var(--line); border-radius: 10px; }
.chain-layers.chain-editor-list .toolbar { margin: 0; justify-content: flex-end; }
