:root {
  color-scheme: light;
  --ink: #17201b;
  --ink-soft: #3e4942;
  --muted: #657069;
  --line: #d8dfda;
  --line-strong: #bac6be;
  --surface: #ffffff;
  --surface-soft: #f5f7f5;
  --surface-hover: #f9fcfa;
  --step-surface: rgba(255, 255, 255, .55);
  --canvas: #edf2ee;
  --green: #187248;
  --green-dark: #105537;
  --green-action: #187248;
  --green-action-hover: #105537;
  --green-soft: #e4f3ea;
  --green-border: #96c5a9;
  --amber: #a55e08;
  --amber-soft: #fff0d8;
  --amber-text: #68470f;
  --red: #a83232;
  --red-soft: #fae7e7;
  --red-border: #deb5b5;
  --red-hover: #f7dddd;
  --red-border-hover: #cf9797;
  --error-ring: 0 0 0 3px rgba(168, 50, 50, .16);
  --code: #17231c;
  --code-text: #dbe8df;
  --input-line: #899990;
  --input-hover: #6d8375;
  --control-hover: #91a298;
  --neutral: #98a29c;
  --toggle-track: #aeb8b2;
  --tooltip: #27322b;
  --segmented: #e5eae7;
  --tab-badge: #dfe5e1;
  --code-status: #edf1ee;
  --code-gutter: #89938d;
  --function-lock: #53645a;
  --reference-border: #b9d7c5;
  --green-hover-soft: #d7ecdf;
  --switch-knob: #ffffff;
  --session-overlay: rgba(237, 242, 238, .9);
  --brand-bg: #17201b;
  --brand-ink: #ffffff;
  --shadow: 0 12px 30px rgba(24, 40, 30, 0.09);
  --shadow-soft: 0 4px 14px rgba(25, 39, 30, .05);
  --focus-ring: 0 0 0 3px rgba(25, 113, 73, .14);
  --motion-fast: 140ms;
  --motion-base: 190ms;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8f0ea;
  --ink-soft: #c4d0c8;
  --muted: #95a69c;
  --line: #29382f;
  --line-strong: #42564a;
  --surface: #121a16;
  --surface-soft: #19241e;
  --surface-hover: #202e26;
  --step-surface: rgba(255, 255, 255, .025);
  --canvas: #0b100d;
  --green: #36ad70;
  --green-dark: #7bdda8;
  --green-action: #1e7d50;
  --green-action-hover: #276944;
  --green-soft: #153824;
  --green-border: #3c7758;
  --amber: #f0b34d;
  --amber-soft: #463419;
  --amber-text: #ffd17d;
  --red: #ff8585;
  --red-soft: #462126;
  --red-border: #754047;
  --red-hover: #56282e;
  --red-border-hover: #94515a;
  --error-ring: 0 0 0 3px rgba(255, 133, 133, .2);
  --code: #08110c;
  --code-text: #d8e8dc;
  --input-line: #607368;
  --input-hover: #7c9184;
  --control-hover: #71877a;
  --neutral: #718177;
  --toggle-track: #526158;
  --tooltip: #26322b;
  --segmented: #25332b;
  --tab-badge: #2b3931;
  --code-status: #202c25;
  --code-gutter: #75867c;
  --function-lock: #4d6255;
  --reference-border: #356e50;
  --green-hover-soft: #1c482f;
  --switch-knob: #f2f5f3;
  --session-overlay: rgba(11, 16, 13, .88);
  --brand-bg: #1e7d50;
  --brand-ink: #ffffff;
  --shadow: 0 14px 34px rgba(0, 0, 0, .3);
  --shadow-soft: 0 5px 16px rgba(0, 0, 0, .18);
  --focus-ring: 0 0 0 3px rgba(54, 173, 112, .22);
}

* { box-sizing: border-box; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--canvas); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font: 14px/1.4 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
body.auth-active { overflow: hidden; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: border-color var(--motion-base) ease, background-color var(--motion-base) ease, color var(--motion-base) ease, box-shadow var(--motion-base) ease, transform var(--motion-fast) ease, opacity var(--motion-base) ease; }
button:focus-visible, a:focus-visible { outline: 0; box-shadow: var(--focus-ring); }

.auth-view {
  min-height: 100svh; padding: 28px 18px; display: grid; place-items: center;
  background: var(--canvas);
}
.auth-panel {
  width: min(100%, 390px); padding: 28px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 7px; box-shadow: var(--shadow);
}
.auth-brand { display: flex; align-items: center; gap: 11px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.auth-brand strong, .auth-brand span { display: block; }
.auth-brand strong { font-size: 16px; }
.auth-brand span { margin-top: 1px; color: var(--muted); font-size: 11px; }
.auth-heading { margin: 24px 0 20px; }
.auth-heading h1 { margin: 3px 0 0; font-size: 24px; line-height: 1.2; }
.auth-panel form { display: grid; gap: 14px; }
.auth-panel .field { gap: 6px; }
.auth-panel input { height: 42px; }
.auth-submit { width: 100%; min-height: 42px; margin-top: 3px; }
.auth-error { margin: 0; padding: 9px 10px; color: var(--red); background: var(--red-soft); border: 1px solid var(--red-border); border-radius: 5px; font-size: 12px; }
.auth-version { position: fixed; right: 18px; bottom: 14px; color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.auth-theme-toggle { position: fixed; top: 18px; right: 18px; }

.app-header {
  height: 68px;
  padding: 0 max(24px, calc((100vw - 1400px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand-block, .header-actions, .section-heading, .dialog-head, .card-head { display: flex; align-items: center; }
.brand-block { gap: 11px; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  color: var(--brand-ink); background: var(--brand-bg); border-radius: 6px; font-weight: 800;
}
.brand-block h1 { margin: 0; font-size: 17px; line-height: 20px; }
.brand-block p { margin: 1px 0 0; color: var(--muted); font-size: 12px; }
.header-actions { gap: 12px; }
.header-command {
  min-height: 32px; padding: 0 8px; color: var(--muted); background: transparent;
  border: 0; border-bottom: 1px solid transparent; font-size: 11px; font-weight: 650;
}
.header-command:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.global-state { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.global-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); }
.global-state.ready i { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.global-state.warning i { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.global-state.error i { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.icon-button, .compact-icon {
  display: grid; place-items: center; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 5px; line-height: 1;
}
.icon-button { width: 34px; height: 34px; font-size: 20px; }
.theme-toggle { font-size: 16px; }
.theme-toggle span { display: grid; place-items: center; }
.compact-icon { width: 36px; height: 38px; font-size: 18px; font-weight: 600; }
.icon-button:hover, .compact-icon:hover { border-color: var(--line-strong); background: var(--surface-soft); transform: translateY(-1px); }
.icon-button:active, .compact-icon:active { transform: translateY(0); }
.icon-button.loading { animation: rotate .8s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }

main { max-width: 1400px; margin: 0 auto; padding: 24px; }
.workspace-tabs {
  display: flex; align-items: end; gap: 24px; margin-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
}
.workspace-tab {
  height: 38px; padding: 0 2px; color: var(--muted); background: transparent;
  border: 0; border-bottom: 2px solid transparent; font-size: 13px; font-weight: 650;
  transition: color var(--motion-base) ease, border-color var(--motion-base) ease;
}
.workspace-tab:hover { color: var(--ink); }
.workspace-tab.active { color: var(--ink); border-bottom-color: var(--green); }
.workspace-panel[hidden] { display: none; }
.workspace-panel:not([hidden]) { animation: panel-in var(--motion-base) ease-out both; }
.selection-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 24px minmax(260px, 1fr) minmax(190px, .6fr);
  align-items: end;
  gap: 12px;
  padding: 16px 18px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-soft);
  animation: panel-in var(--motion-base) ease-out both;
}
.selection-group { min-width: 0; }
.selection-label { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.selection-label span {
  width: 19px; height: 19px; display: grid; place-items: center;
  border-radius: 50%; color: white; background: var(--green-action); font-size: 10px; font-weight: 800;
}
.selection-label label { color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.select-actions { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 7px; }
.select-actions.is-loading select { padding-right: 34px; }
.select-actions.is-loading::after {
  content: ""; width: 14px; height: 14px; position: absolute; right: 49px; top: 12px;
  border: 2px solid var(--muted); border-right-color: transparent; border-radius: 50%;
  animation: rotate .7s linear infinite; pointer-events: none;
}
.manage-hint { position: relative; font-size: 15px; font-weight: 800; }
.manage-hint::after {
  content: attr(title); width: max-content; max-width: 240px; position: absolute; right: 0; bottom: calc(100% + 8px);
  z-index: 10; padding: 7px 9px; color: white; background: var(--tooltip); border-radius: 4px;
  font-size: 11px; font-weight: 550; line-height: 1.4; text-align: left;
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(3px); transition: .15s ease;
}
.manage-hint:hover::after, .manage-hint:focus-visible::after { opacity: 1; visibility: visible; transform: translateY(0); }
.selection-arrow { align-self: center; padding-top: 19px; color: var(--line-strong); font-size: 30px; text-align: center; }
.selection-summary { min-width: 0; padding: 4px 0 5px 17px; border-left: 1px solid var(--line); }
.selection-summary span, .selection-summary strong { display: block; }
.selection-summary span { color: var(--muted); font-size: 11px; }
.selection-summary strong { margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.selection-loading-status {
  min-height: 20px; position: absolute; left: 18px; bottom: 3px; align-items: center; gap: 7px;
  color: var(--green-dark); font-size: 11px; font-weight: 650;
}
.selection-loading-status:not([hidden]) { display: flex; }
.selection-loading-status::before {
  content: ""; width: 11px; height: 11px; flex: 0 0 auto; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%; animation: rotate .7s linear infinite;
}

input, select, textarea {
  min-width: 0; width: 100%; height: 38px; padding: 0 10px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-bottom-color: var(--input-line);
  box-shadow: inset 0 -1px 0 var(--input-line);
  border-radius: 5px; outline: none; font-variant-ligatures: none;
}
#protocolName, #policyResourceName, #policyActionName, #rpkiName, #rpkiRoa4Table, #rpkiRoa6Table { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
textarea {
  min-height: 136px; height: auto; padding: 10px; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.55;
}
input:hover, select:hover, textarea:hover { border-color: var(--control-hover); border-bottom-color: var(--input-hover); box-shadow: inset 0 -1px 0 var(--input-hover); }
input:focus, select:focus, textarea:focus { border-color: var(--green); border-bottom-color: var(--green-dark); box-shadow: var(--focus-ring), inset 0 -1px 0 var(--green-dark); }
select:disabled { color: var(--muted); background: var(--surface-soft); }
input:disabled, textarea:disabled { color: var(--muted); background: var(--surface-soft); }
form.validation-attempted input:not([type="checkbox"]):invalid,
form.validation-attempted select:invalid,
form.validation-attempted textarea:invalid,
form.validation-attempted input:not([type="checkbox"])[aria-invalid="true"],
form.validation-attempted select[aria-invalid="true"],
form.validation-attempted textarea[aria-invalid="true"] {
  border-color: var(--red);
  border-bottom-color: var(--red);
  background: var(--red-soft);
  box-shadow: var(--error-ring), inset 0 -1px 0 var(--red);
}
form.validation-attempted .field-invalid > label,
form.validation-attempted .field-invalid > .field-label,
form.validation-attempted .channel-enable-row.field-invalid h3 { color: var(--red); }

.resource-workspace { min-width: 0; }
.resource-header { padding: 7px 0 12px; }
.resource-header h2 { margin: 2px 0 0; font-size: 22px; }
.resource-tabs {
  display: flex; align-items: end; gap: 22px; border-bottom: 1px solid var(--line-strong);
  overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.resource-tab {
  height: 40px; padding: 0 1px; color: var(--muted); background: transparent;
  border: 0; border-bottom: 2px solid transparent; font-size: 12px; font-weight: 650;
  transition: color var(--motion-base) ease, border-color var(--motion-base) ease;
}
.resource-tab:hover { color: var(--ink); }
.resource-tab.active { color: var(--green-dark); border-bottom-color: var(--green); }
.resource-panel[hidden] { display: none; }
.resource-panel:not([hidden]) { animation: panel-in var(--motion-base) ease-out both; }
.resource-section { min-height: 520px; padding: 26px 0; scroll-margin-top: 18px; }
.resource-section .section-heading { margin-bottom: 13px; }
.resource-section h3 { margin: 2px 0 0; font-size: 17px; }
.resource-section.resource-highlight { animation: resource-highlight 1.2s ease; }
@keyframes resource-highlight { 0%, 35% { background: rgba(24, 114, 72, .07); } 100% { background: transparent; } }
.resource-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.resource-table-wrap table { min-width: 760px; }
.resource-table-wrap .ordered-resource-table { min-width: 980px; }
.resource-table-wrap td { height: 54px; }
.resource-table-wrap tbody tr { transition: background-color var(--motion-base) ease; }
.resource-table-wrap tbody tr:hover { background: var(--surface-hover); }
.resource-table-wrap th:last-child, .resource-table-wrap td:last-child {
  width: 58px; position: sticky; right: 0; z-index: 1; background: var(--surface);
  box-shadow: -1px 0 var(--line);
}
.resource-table-wrap th:last-child { background: var(--surface-soft); }
.resource-table-wrap .ordered-resource-table th:last-child,
.resource-table-wrap .ordered-resource-table td:last-child { width: 126px; }
.resource-table-wrap td strong, .resource-table-wrap td small { display: block; }
.resource-table-wrap td strong { font-size: 12px; }
.resource-table-wrap td small { margin-top: 3px; color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.resource-table-wrap code { font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.entry-summary { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-state { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.resource-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--neutral); }
.resource-state.enabled { color: var(--green-dark); }
.resource-state.enabled::before { background: var(--green); }
.row-edit-button {
  width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 5px; font-size: 15px;
}
.row-edit-button:hover { color: var(--green-dark); border-color: var(--green); background: var(--green-soft); transform: translateY(-1px); }
.row-edit-button:active { transform: translateY(0); }
.resource-row-actions { display: flex; align-items: center; gap: 5px; }
.compact-command { min-height: 34px !important; padding: 6px 11px !important; font-size: 12px; }

.topology-section { padding: 25px 0; border-bottom: 1px solid var(--line-strong); }
.section-heading { justify-content: space-between; margin-bottom: 18px; }
.section-heading.compact { margin-bottom: 20px; }
.section-heading h2, dialog h2 { margin: 2px 0 0; font-size: 19px; line-height: 24px; }
.eyebrow { margin: 0; color: var(--green); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.updated-at { color: var(--muted); font-size: 12px; }

.topology-actions { display: flex; align-items: center; gap: 10px; }
.node-icon {
  width: 29px; height: 29px; display: grid; place-items: center;
  border-radius: 5px; background: var(--surface-soft); font-size: 12px; font-weight: 800;
}
.status-pill, .compatibility-badge {
  min-height: 24px; display: inline-flex; align-items: center; padding: 3px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 700; transition: color var(--motion-base) ease, background-color var(--motion-base) ease;
}
.status-pill.unknown { background: var(--surface-soft); color: var(--muted); }
.status-pill.online, .status-pill.established { background: var(--green-soft); color: var(--green-dark); }
.status-pill.offline, .status-pill.down { background: var(--red-soft); color: var(--red); }
.status-pill.disabled { background: var(--surface-soft); color: var(--muted); }
.status-pill.unconfigured { background: var(--amber-soft); color: var(--amber); }
.compatibility-badge { background: var(--amber-soft); color: var(--amber-text); }
.ebgp-canvas { min-width: 0; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.ebgp-canvas-board { position: relative; min-width: 100%; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 22px 22px; }
.ebgp-canvas-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ebgp-canvas-edges line { stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 6 5; }
.ebgp-canvas-edges line.established { stroke: var(--green); stroke-dasharray: none; }
.ebgp-canvas-edges line.selected { stroke-width: 3; stroke-opacity: 1; }
.ebgp-canvas-node {
  position: absolute; z-index: 1; display: grid; align-content: center; gap: 7px; padding: 12px;
  color: var(--ink); text-align: left; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 7px;
  box-shadow: 0 3px 12px rgb(0 0 0 / 10%); cursor: grab; touch-action: none; user-select: none;
}
.ebgp-canvas-node:active { cursor: grabbing; }
.ebgp-local-node { width: 248px; height: 116px; }
.ebgp-local-node.online { border-color: var(--green-border); box-shadow: 0 0 0 3px rgba(24, 114, 72, .07), var(--shadow-soft); }
.ebgp-peer-node { width: 260px; height: 144px; }
.ebgp-peer-node:hover, .ebgp-peer-node.selected { border-color: var(--green); background: var(--surface-hover); box-shadow: 0 0 0 2px rgba(25, 113, 73, .09); }
.ebgp-canvas-node-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ebgp-canvas-node strong { display: block; overflow-wrap: anywhere; font-size: 13px; line-height: 1.25; }
.ebgp-canvas-node small { display: block; color: var(--muted); font: 10px/1.25 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.topology-empty, .ebgp-canvas-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; pointer-events: none; }
.ebgp-canvas-empty { left: 310px; }

.workspace-grid { display: grid; grid-template-columns: minmax(380px, .72fr) minmax(600px, 1.28fr); align-items: start; gap: 38px; padding-top: 25px; }
.session-section, .inspect-section { align-self: start; position: sticky; top: 16px; max-height: calc(100svh - 32px); overflow-y: auto; scrollbar-gutter: stable; }
.session-section { min-width: 0; position: sticky; padding-right: 38px; border-right: 1px solid var(--line-strong); }
.inspect-section { min-width: 0; padding-right: 2px; }
.session-preview-overlay {
  position: absolute; z-index: 10; inset: 0; display: grid; align-items: start; justify-items: center; padding: 68px 18px 18px;
  background: var(--session-overlay); backdrop-filter: blur(2px); cursor: wait;
}
.session-preview-notice {
  width: min(360px, 100%); display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 11px;
  padding: 13px 15px; background: var(--surface); border: 1px solid var(--green-border); border-radius: 6px; box-shadow: var(--shadow);
}
.session-preview-spinner { width: 24px; height: 24px; border: 3px solid var(--green-border); border-right-color: var(--green); border-radius: 50%; animation: rotate .75s linear infinite; }
.session-preview-notice strong, .session-preview-notice span { display: block; overflow-wrap: anywhere; }
.session-preview-notice strong { color: var(--ink); font-size: 12px; }
.session-preview-notice span { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.pair-summary {
  display: grid; grid-template-columns: 1fr 34px 1fr; align-items: center;
  margin-bottom: 17px; padding: 11px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px;
}
.pair-summary div { min-width: 0; }
.pair-summary span, .pair-summary strong { display: block; }
.pair-summary span { color: var(--muted); font-size: 10px; }
.pair-summary strong { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.pair-summary div:last-child { text-align: right; }
.pair-summary i { height: 1px; background: var(--green); }
#sessionForm { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pair-summary, .channel-editors, .policy-block, .session-options, .advanced-settings, .toggle-row, .form-actions, .text-danger-button { grid-column: 1 / -1; }
.field { min-width: 0; }
.field.full-width { grid-column: 1 / -1; }
.field label, .field-label { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.field-readonly { min-height: 38px; display: flex; align-items: center; padding: 0 11px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; font-size: 13px; }
.node-path-settings { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.node-path-settings summary { min-height: 42px; display: flex; align-items: center; cursor: pointer; font-size: 12px; font-weight: 700; }
.node-path-grid { padding: 4px 0 14px; }
.node-rpki-warning { padding: 12px 14px; color: var(--amber-text); background: var(--amber-soft); border-left: 3px solid var(--amber); border-radius: 4px; }
.node-rpki-warning-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.node-rpki-warning-head strong { font-size: 12px; }
.node-rpki-warning-head span { font-size: 10px; font-weight: 700; }
.node-rpki-warning p { margin: 7px 0 0; font-size: 10px; line-height: 1.55; }
.node-rpki-warning ul { display: grid; gap: 7px; margin: 10px 0 0; padding: 0; list-style: none; }
.node-rpki-warning li { min-width: 0; padding-top: 7px; border-top: 1px solid color-mix(in srgb, var(--amber) 25%, transparent); }
.node-rpki-warning li > strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 10px; }
.node-rpki-warning li div { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.node-rpki-warning li span { font-size: 9px; }
.node-rpki-warning code { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font: 9px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.node-rpki-warning .node-rpki-action { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; margin-top: 4px; color: var(--ink); }
.node-rpki-warning .node-rpki-action span { color: var(--amber-text); font-weight: 700; }
.node-onboarding { padding: 14px 0 2px; border-top: 1px solid var(--line); }
.node-onboarding-head, .node-onboarding-actions, .setup-guide-heading, .setup-include { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.node-onboarding-head strong { font-size: 13px; }
.node-onboarding-head span { color: var(--muted); font-size: 11px; }
.node-onboarding-head span.ready { color: var(--green-dark); font-weight: 700; }
.node-onboarding-head span.error { color: var(--red); font-weight: 700; }
.node-onboarding-actions { justify-content: flex-start; margin-top: 11px; }
.node-setup-guide { margin-top: 12px; }
.setup-guide-heading, .setup-include { color: var(--muted); font-size: 11px; }
.node-setup-guide pre { max-height: 240px; overflow: auto; margin: 7px 0 10px; padding: 11px; color: var(--code-text); background: var(--code); border-radius: 5px; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
.setup-include code { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 11px; }
.policy-block { min-width: 0; padding: 15px 0 1px; border-top: 1px solid var(--line); }
.channel-editors { min-width: 0; padding-top: 4px; }
.afi-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line-strong); }
.afi-tab {
  min-width: 0; height: 42px; padding: 0 12px; color: var(--muted); background: transparent;
  border: 0; border-bottom: 2px solid transparent; font-size: 12px; font-weight: 700;
  transition: color var(--motion-base) ease, border-color var(--motion-base) ease;
}
.afi-tab.active { color: var(--ink); border-bottom-color: var(--green); }
.afi-tab span { margin-left: 7px; color: var(--green-dark); font-size: 9px; font-weight: 650; }
.afi-tab.disabled span { color: var(--muted); }
.afi-channel-panel { min-width: 0; padding-top: 14px; }
.afi-channel-panel[hidden] { display: none; }
.channel-enable-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; }
.channel-enable-row > div span { color: var(--green); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.channel-enable-row h3 { margin: 2px 0 0; font-size: 14px; }
.channel-enable-row .compact-toggle { width: 116px; align-self: center; }
.channel-content { min-width: 0; transition: opacity var(--motion-base) ease; }
.channel-content.disabled { opacity: .45; }
.channel-advanced-settings { min-width: 0; margin-top: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.channel-advanced-settings summary {
  min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  cursor: pointer; color: var(--ink); font-size: 12px; font-weight: 750; list-style-position: inside;
}
.channel-advanced-settings summary small { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 550; }
.channel-advanced-settings .advanced-content { padding-top: 4px; }
.policy-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.policy-heading span { color: var(--green); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.policy-heading h3 { margin: 1px 0 0; font-size: 13px; }
.policy-heading small { color: var(--muted); font-size: 10px; }
.segmented-control { display: grid; grid-template-columns: repeat(2, 1fr); min-height: 36px; padding: 3px; background: var(--segmented); border-radius: 6px; }
.segmented-control label { min-width: 0; cursor: pointer; }
.segmented-control input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.segmented-control span { height: 30px; display: grid; place-items: center; color: var(--muted); border-radius: 4px; font-size: 11px; font-weight: 700; }
.segmented-control input:checked + span { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgba(20, 35, 26, .12); }
.segmented-control input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 1px; }
.policy-mode-fields { margin-top: 11px; }
.policy-mode-fields[hidden] { display: none; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.field-label-row .compact-icon { width: 28px; height: 28px; font-size: 13px; }
.policy-step-actions { display: inline-flex; align-items: center; gap: 6px; }
.compact-action-button { min-height: 28px !important; padding: 4px 8px !important; font-size: 10px !important; }
.function-picker { display: grid; gap: 5px; max-height: 260px; overflow-y: auto; padding: 6px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; }
.function-step {
  min-width: 0; min-height: 44px; display: grid;
  grid-template-columns: 20px 16px minmax(76px, 1fr) 78px 83px;
  align-items: center; gap: 6px; padding: 5px 6px;
  background: var(--step-surface); border: 1px solid transparent; border-radius: 4px;
}
.function-step.selected { background: var(--surface); border-color: var(--line); }
.function-step.form-step { grid-template-columns: 20px 16px minmax(76px, 1fr) 78px 83px; }
.function-step > input { width: 15px; height: 15px; margin: 0; accent-color: var(--green); }
.step-order { color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; }
.step-lock { width: 16px; height: 16px; display: grid; place-items: center; color: white; background: var(--green-action); border-radius: 3px; font-size: 9px; font-weight: 800; }
.step-lock.function { background: var(--function-lock); }
.step-name, .step-name strong, .step-name small { min-width: 0; display: block; }
.step-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.step-name small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.function-step select { height: 30px; padding: 0 5px; font-size: 10px; }
.step-action-static { height: 30px; display: grid; place-items: center; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 4px; font-size: 10px; }
.step-moves { display: flex; gap: 4px; }
.step-moves button { width: 25px; height: 28px; padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 4px; }
.step-moves button:hover:not(:disabled) { color: var(--green-dark); border-color: var(--green); }
.function-step-add { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 6px; padding-top: 2px; }
.function-step-add select { height: 32px; font-size: 10px; }
.function-step-add button { width: 34px; height: 32px; padding: 0; color: white; background: var(--green-action); border: 1px solid var(--green-action); border-radius: 4px; font-size: 17px; font-weight: 700; }
.policy-empty { min-height: 48px; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.policy-form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 12px; transition: opacity var(--motion-base) ease; }
.policy-form-fields[hidden] { display: none; }
.policy-form-fields.single-field { grid-template-columns: minmax(0, 1fr); }
.policy-form-fields.paused { opacity: .55; }
.policy-action-dialog { width: min(660px, calc(100vw - 32px)); }
.policy-action-fields.full-width, .policy-action-inline.full-width, .policy-action-community.full-width { grid-column: 1 / -1; }
.policy-action-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.policy-action-fields[hidden], .policy-action-inline[hidden], .policy-action-community[hidden] { display: none; }
.policy-action-fields .toggle-row { min-height: 56px; }
.policy-action-fields .toggle-row span strong, .policy-action-fields .toggle-row span small { display: block; }
.policy-action-fields .toggle-row span small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 500; }
.policy-action-fields > .policy-action-inline { grid-column: 1 / -1; }
.policy-action-inline, .policy-action-community { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.policy-action-community { grid-template-columns: 1fr 1fr; }
.policy-action-community .full-width { grid-column: 1 / -1; }
.policy-action-condition { min-height: 76px; }
.field-help { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.session-options { min-width: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.option-heading { margin-bottom: 11px; }
.option-heading span { color: var(--green); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.option-heading h3, .advanced-group h3 { margin: 1px 0 0; font-size: 13px; }
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.limit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 105px minmax(0, 1fr) 105px; gap: 8px; margin-top: 11px; }
.compact-toggle {
  min-width: 0; min-height: 38px; display: flex; align-items: center; justify-content: space-between;
  align-self: end; gap: 9px; padding: 7px 9px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 5px; cursor: pointer;
}
.compact-toggle span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.compact-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.compact-toggle i { width: 30px; height: 18px; position: relative; flex: 0 0 auto; border-radius: 999px; background: var(--toggle-track); transition: background var(--motion-base) ease, box-shadow var(--motion-base) ease; }
.compact-toggle i::after { content: ""; width: 14px; height: 14px; position: absolute; left: 2px; top: 2px; border-radius: 50%; background: var(--switch-knob); transition: transform var(--motion-base) cubic-bezier(.2,.8,.2,1); }
.compact-toggle input:checked + i { background: var(--green); }
.compact-toggle input:checked + i::after { transform: translateX(12px); }
.compact-toggle:focus-within { border-color: var(--green); box-shadow: var(--focus-ring); }
.compact-toggle.automatic { background: var(--green-soft); border-color: var(--green-border); cursor: default; }
.compact-toggle.automatic span { color: var(--green-dark); }
.advanced-settings { min-width: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.advanced-settings summary {
  min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  cursor: pointer; color: var(--ink); font-size: 12px; font-weight: 750; list-style-position: inside;
}
.advanced-settings summary small { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 550; }
.advanced-content { padding: 0 0 15px 16px; border-left: 2px solid var(--line); }
.advanced-group { min-width: 0; padding: 15px 0; border-top: 1px solid var(--line); }
.advanced-group:first-child { border-top: 0; }
.advanced-group h3 { margin-bottom: 11px; }
.raw-options { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.raw-options h3 { grid-column: 1 / -1; }
.compact-code-editor { min-height: 118px; font-size: 11px; }
.toggle-row {
  min-height: 47px; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
}
.toggle-row span strong, .toggle-row span small { display: block; }
.toggle-row span strong { font-size: 12px; }
.toggle-row span small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.toggle-row input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.toggle-row i { width: 36px; height: 20px; position: relative; border-radius: 999px; background: var(--toggle-track); transition: background var(--motion-base) ease, box-shadow var(--motion-base) ease; }
.toggle-row i::after { content: ""; width: 16px; height: 16px; position: absolute; left: 2px; top: 2px; border-radius: 50%; background: var(--switch-knob); transition: transform var(--motion-base) cubic-bezier(.2,.8,.2,1); }
.toggle-row input:checked + i { background: var(--green); }
.toggle-row input:checked + i::after { transform: translateX(16px); }
.form-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; }
.empty-state { min-height: 230px; place-items: center; align-content: center; gap: 15px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 6px; }
.empty-state:not([hidden]) { display: grid; }
.empty-state strong { color: var(--ink); font-size: 13px; }

button.primary-button, button.secondary-button, button.danger-button {
  min-height: 40px; padding: 8px 14px; border-radius: 6px; font-weight: 700;
}
.primary-button { color: white; background: var(--green-action); border: 1px solid var(--green-action); }
.primary-button:hover { background: var(--green-action-hover); border-color: var(--green-action-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(24, 114, 72, .16); }
.secondary-button { color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); }
.secondary-button:hover { background: var(--surface-soft); border-color: var(--control-hover); transform: translateY(-1px); }
.danger-button { color: var(--red); background: var(--red-soft); border: 1px solid var(--red-border); font-size: 12px; }
.danger-button:hover { background: var(--red-hover); border-color: var(--red-border-hover); transform: translateY(-1px); }
.text-danger-button { width: max-content; padding: 3px 0; color: var(--red); background: transparent; border: 0; font-size: 12px; font-weight: 650; }
button:disabled { cursor: not-allowed; opacity: .5; transform: none !important; }
button.is-loading { display: inline-flex; align-items: center; justify-content: center; gap: 8px; pointer-events: none; }
button.is-loading::after { content: ""; width: 12px; height: 12px; flex: 0 0 auto; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rotate .7s linear infinite; }

.protocol-control {
  min-width: 136px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px; border: 1px solid transparent; border-radius: 6px; font-size: 12px; font-weight: 750;
  transition: color var(--motion-base) ease, background-color var(--motion-base) ease, border-color var(--motion-base) ease, box-shadow var(--motion-base) ease, transform var(--motion-fast) ease;
}
.protocol-control::before { content: ""; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.protocol-control.is-loading::before { display: none; }
.protocol-control.stop { color: var(--red); background: var(--red-soft); border-color: var(--red-border); }
.protocol-control.stop:hover { background: var(--red-hover); border-color: var(--red-border-hover); box-shadow: 0 4px 12px rgba(168, 50, 50, .12); }
.protocol-control.start { color: var(--green-dark); background: var(--green-soft); border-color: var(--green-border); }
.protocol-control.start:hover { background: var(--green-hover-soft); border-color: var(--green); box-shadow: 0 4px 12px rgba(24, 114, 72, .12); }
.protocol-control:active:not(:disabled) { transform: translateY(1px); }

.protocol-table-wrap { min-height: 133px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { height: 43px; padding: 0 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 12px; overflow-wrap: anywhere; }
th { height: 38px; color: var(--muted); background: var(--surface-soft); font-size: 10px; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.protocol-table-wrap tbody tr { transition: background-color var(--motion-base) ease; }
.protocol-table-wrap tbody tr:hover { background: var(--surface-hover); }
.route-summary-button {
  width: 100%; min-height: 32px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 5px 8px; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; text-align: left;
}
.route-summary-button:hover { background: var(--surface-hover); border-color: var(--green-border); }
.route-summary-button:disabled { color: var(--muted); background: transparent; }
.route-summary-copy { min-width: 0; display: grid; gap: 2px; }
.route-summary-copy span { overflow: hidden; font-size: 9px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.route-summary-copy strong { color: var(--ink); font-size: 10px; }
.route-summary-button > span:last-child { color: var(--green-dark); font-size: 14px; }
.empty-cell { height: 92px; color: var(--muted); text-align: center; }
.table-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; white-space: nowrap; }
.table-state::before { content: ""; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--neutral); }
.table-state.up { color: var(--green-dark); }
.table-state.up::before { background: var(--green); }
.table-state.down { color: var(--red); }
.table-state.down::before { background: var(--red); }

.tabs { display: flex; align-items: end; gap: 2px; margin-top: 20px; border-bottom: 1px solid var(--line-strong); }
.tab { height: 35px; padding: 0 12px; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; font-size: 12px; transition: color var(--motion-base) ease, border-color var(--motion-base) ease; }
.tab.active { color: var(--ink); border-bottom-color: var(--green); font-weight: 700; }
.tab span { margin-left: 4px; padding: 1px 5px; background: var(--tab-badge); border-radius: 999px; font-size: 10px; }
.tab-panels { min-height: 330px; max-height: 470px; overflow: auto; background: var(--code); border-radius: 0 0 6px 6px; }
.tab-panel { display: none; margin: 0; padding: 17px; color: var(--code-text); font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.tab-panel.active { display: block; animation: panel-in var(--motion-base) ease-out both; }
.event-log { min-height: 330px; color: var(--ink); background: var(--surface); font-family: inherit; }
.log-row { display: grid; grid-template-columns: 76px 68px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.log-row time, .log-row span { color: var(--muted); }
.log-row strong { font-weight: 550; }
.log-row.error strong { color: var(--red); }
.log-row.success strong { color: var(--green-dark); }
.log-row.warning strong { color: var(--amber); }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 20; display: grid; gap: 9px; width: min(360px, calc(100vw - 44px)); }
.toast { padding: 12px 14px; color: white; background: var(--tooltip); border-radius: 6px; box-shadow: var(--shadow); animation: toast-in .22s ease-out both; font-size: 12px; }
.toast.error { background: #842d2d; }
.toast.success { background: var(--green-action-hover); }
.mutation-wait-dialog {
  position: fixed; top: max(16px, env(safe-area-inset-top)); left: 50%; width: min(430px, calc(100vw - 32px));
  margin: 0; padding: 0; translate: -50% 0; overflow: hidden; border: 1px solid var(--line-strong);
  box-shadow: 0 18px 48px rgba(15, 25, 19, .3);
}
.mutation-wait-dialog::backdrop { background: rgba(17, 26, 21, .32); }
.mutation-wait-content { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 12px; padding: 15px 17px; }
.mutation-wait-spinner { width: 28px; height: 28px; border: 3px solid var(--green-border); border-right-color: var(--green); border-radius: 50%; animation: rotate .75s linear infinite; }
.mutation-wait-copy { min-width: 0; }
.mutation-wait-copy strong, .mutation-wait-copy span { display: block; overflow-wrap: anywhere; }
.mutation-wait-copy strong { color: var(--ink); font-size: 13px; line-height: 19px; }
.mutation-wait-copy span { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 17px; }
@keyframes toast-in { from { transform: translate3d(0, 8px, 0); opacity: 0; } }
@keyframes panel-in { from { transform: translateY(4px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes wire-in { from { transform: scaleX(.6); transform-origin: left center; opacity: .35; } to { transform: scaleX(1); opacity: 1; } }
@keyframes dialog-in { from { transform: translateY(7px) scale(.985); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

dialog { width: min(460px, calc(100vw - 32px)); padding: 0; color: var(--ink); background: var(--surface); border: 0; border-radius: 7px; box-shadow: 0 22px 60px rgba(15, 25, 19, .28); }
dialog[open] { animation: dialog-in var(--motion-base) ease-out both; }
dialog.editor-dialog { width: min(580px, calc(100vw - 32px)); }
dialog.editor-dialog { max-height: calc(100vh - 32px); overflow: auto; }
dialog.static-editor-dialog { width: min(1080px, calc(100vw - 32px)); }
dialog.policy-editor-dialog { width: min(860px, calc(100vw - 32px)); }
.irr-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.irr-actions > span { margin-left: auto; color: var(--muted); font-size: 11px; }
.irr-sync-status { display: grid; gap: 4px; padding: 11px 12px; color: var(--ink-soft); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; font-size: 11px; }
.irr-sync-status.error { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.code-input .policy-source-editor[readonly] { color: var(--ink-soft); background: var(--surface-soft); cursor: text; }
dialog.source-policy-editor-dialog { width: min(1120px, calc(100vw - 32px)); }
.policy-scope-field { outline: none; }
.policy-scope-heading { min-height: 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.policy-scope-heading .field-label { margin-bottom: 6px; }
.policy-scope-heading > span:last-child { color: var(--muted); font-size: 10px; font-weight: 650; }
.policy-scope-selector { margin-top: 8px; padding: 10px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; }
.policy-scope-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.policy-scope-toolbar > input { min-width: 0; min-height: 34px; padding: 6px 9px; font-size: 11px; }
.policy-scope-toolbar > span { display: flex; gap: 6px; }
.policy-scope-node-list { max-height: 210px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 9px; overflow: auto; }
.policy-scope-node { min-width: 0; min-height: 43px; display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 8px; padding: 6px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.policy-scope-node:hover { border-color: var(--control-hover); background: var(--surface-hover); }
.policy-scope-node input { width: 16px; height: 16px; accent-color: var(--green); }
.policy-scope-node span, .policy-scope-node strong, .policy-scope-node code { min-width: 0; display: block; }
.policy-scope-node strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.policy-scope-node code { margin-top: 2px; overflow: hidden; color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.policy-scope-field.field-invalid .policy-scope-selector { border-color: var(--red); box-shadow: var(--error-ring); }
.policy-scope-field.field-invalid .field-label, .policy-scope-field .field-error { color: var(--red); }
.policy-scope-field .field-error { margin: 7px 0 0; font-size: 10px; font-weight: 650; }
dialog.account-settings-dialog { width: min(720px, calc(100vw - 32px)); }
dialog.route-dialog { width: min(900px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(17, 26, 21, .48); }
dialog form { padding: 22px; }
.route-dialog-shell { min-width: 0; padding: 22px; }
.route-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.route-dialog-head h2 { margin: 2px 0 0; font-size: 19px; letter-spacing: 0; }
.route-dialog-head > div { min-width: 0; }
.route-dialog-head > div > span { display: block; margin-top: 4px; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
.route-dialog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; }
.route-segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(84px, 1fr); padding: 3px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; }
.route-segmented button { min-height: 32px; padding: 5px 12px; color: var(--muted); background: transparent; border: 0; border-radius: 4px; font-size: 11px; font-weight: 700; }
.route-segmented button:hover:not(:disabled) { color: var(--ink); background: var(--surface-hover); }
.route-segmented button.active { color: var(--green-dark); background: var(--surface); box-shadow: 0 1px 4px rgba(15, 25, 19, .1); }
.route-segmented button:disabled { display: none; }
.route-dialog-meta { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 0 4px; color: var(--muted); font-size: 10px; }
.route-dialog-meta span:last-child { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.route-dialog-body { min-height: 320px; max-height: min(58vh, 620px); overflow: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; }
.route-dialog-state { min-height: 318px; display: grid; place-items: center; padding: 28px; color: var(--muted); text-align: center; font-size: 12px; }
.route-dialog-state.error { color: var(--red); }
.route-loading-copy { display: grid; justify-items: center; gap: 11px; }
.route-loading-copy i { width: 25px; height: 25px; border: 3px solid var(--green-border); border-right-color: var(--green); border-radius: 50%; animation: rotate .75s linear infinite; }
.route-list { margin: 0; padding: 0; list-style: none; }
.route-entry { border-bottom: 1px solid var(--line); }
.route-entry:last-child { border-bottom: 0; }
.route-entry details > summary { min-height: 55px; display: grid; grid-template-columns: minmax(170px, .65fr) minmax(0, 1.35fr) 18px; align-items: center; gap: 14px; padding: 9px 13px; cursor: pointer; list-style: none; }
.route-entry details > summary::-webkit-details-marker { display: none; }
.route-entry details > summary:hover { background: var(--surface-hover); }
.route-entry details > summary::after { content: "+"; color: var(--green-dark); font-size: 16px; text-align: center; }
.route-entry details[open] > summary::after { content: "−"; }
.route-entry-prefix { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.route-entry-summary { min-width: 0; overflow-wrap: anywhere; color: var(--ink-soft); font: 10px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.route-entry pre { margin: 0; padding: 13px; overflow: auto; color: var(--code-text); background: var(--code); border-top: 1px solid var(--line); font: 10px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.route-list-notice { padding: 10px 13px; color: var(--amber-text); background: var(--amber-soft); border-bottom: 1px solid var(--line-strong); font-size: 10px; }
.dialog-head { gap: 12px; }
.dialog-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 6px; background: var(--green-soft); color: var(--green-dark); font-size: 15px; font-weight: 800; }
.dialog-icon.remote { color: var(--amber); background: var(--amber-soft); }
.dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 20px; }
.dialog-grid .full-width { grid-column: 1 / -1; }
.single-column-dialog { grid-template-columns: 1fr; }
.code-input {
  display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: minmax(290px, 1fr) 27px;
  overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 5px;
}
.code-input:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(25, 113, 73, .12); }
.code-input-lines {
  grid-column: 1; grid-row: 1; min-height: 290px; margin: 0; padding: 10px 9px 10px 4px;
  overflow: hidden; color: var(--code-gutter); background: var(--surface-soft); border-right: 1px solid var(--line);
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; text-align: right; user-select: none;
}
.code-input .policy-source-editor {
  grid-column: 2; grid-row: 1; min-height: 290px; height: 100%; margin: 0; padding: 10px 12px;
  overflow: auto; tab-size: 2; white-space: pre; border: 0; border-radius: 0; resize: vertical;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.code-input .policy-source-editor:focus { border: 0; box-shadow: none; }
.code-input-status {
  grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; justify-content: space-between;
  padding: 0 9px; color: var(--muted); background: var(--code-status); border-top: 1px solid var(--line); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.code-references { min-width: 0; margin-top: 10px; padding: 10px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; }
.code-references[hidden] { display: none; }
.code-reference-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.code-reference-heading { min-width: 100px; }
.code-reference-heading strong, .code-reference-heading span { display: block; }
.code-reference-heading strong { color: var(--ink); font-size: 11px; }
.code-reference-heading span { margin-top: 1px; color: var(--muted); font-size: 9px; }
#policySourceReferenceSearch { width: min(330px, 60%); min-height: 34px; padding: 6px 9px; font-size: 11px; }
.code-reference-groups { min-width: 0; max-height: 260px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; margin-top: 9px; overflow: auto; }
.code-reference-group { min-width: 0; }
.code-reference-group-heading { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: 25px; padding: 0 3px 5px; color: var(--muted); border-bottom: 1px solid var(--line-strong); }
.code-reference-group-heading strong { color: var(--ink-soft); font-size: 10px; }
.code-reference-group-heading > span:last-child { font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.code-reference-kind { width: 18px; height: 18px; display: grid; place-items: center; color: var(--green-dark); background: var(--green-soft); border-radius: 3px; font-size: 9px; font-weight: 800; }
.code-reference-kind.function { color: var(--amber-text); background: var(--amber-soft); }
.code-reference-list { display: grid; }
.code-reference-button {
  width: 100%; min-width: 0; min-height: 48px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 4px;
  color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left;
}
.code-reference-button:hover { color: var(--ink); background: var(--surface-hover); }
.code-reference-button:focus-visible { position: relative; z-index: 1; }
.code-reference-copy { min-width: 0; }
.code-reference-copy strong, .code-reference-copy code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-reference-copy strong { font-size: 10px; font-weight: 700; }
.code-reference-copy code { margin-top: 2px; color: var(--green-dark); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.code-reference-meta { min-width: 76px; color: var(--muted); text-align: right; }
.code-reference-meta span { display: block; font-size: 8px; line-height: 1.45; white-space: nowrap; }
.code-reference-empty { grid-column: 1 / -1; padding: 13px 8px; color: var(--muted); border-top: 1px dashed var(--line-strong); font-size: 10px; text-align: center; }
.dialog-route { display: grid; grid-template-columns: 1fr 40px 1fr; align-items: center; margin: 20px 0 13px; padding: 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; text-align: center; font-weight: 700; font-size: 12px; }
.dialog-route i { height: 1px; background: var(--green); }
.dialog-note { margin: 0; color: var(--muted); line-height: 1.55; font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.split-actions { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; }
.node-retire-actions { display: flex; align-items: center; gap: 14px; }
.node-retire-actions details { position: relative; color: var(--muted); font-size: 11px; }
.node-retire-actions summary { cursor: pointer; }
.node-retire-actions details .text-danger-button { margin-top: 7px; }
.cleanup-list { margin: 16px 0 0; padding-left: 20px; color: var(--ink-soft); line-height: 1.8; font-size: 12px; }
.source-policy-groups, .source-policy-preview { min-width: 0; margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.source-policy-section-head, .source-policy-group-head, .source-policy-code-head, .source-policy-plan-status { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.source-policy-section-head h3 { margin: 0; font-size: 13px; }
.source-policy-section-head small { display: block; max-width: 720px; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.source-policy-group { min-width: 0; margin-top: 11px; padding: 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; }
.source-policy-group-head { align-items: end; }
.source-policy-group-head .field { min-width: min(360px, 100%); }
.source-policy-group-head .source-policy-table-field { min-width: min(260px, 100%); }
.source-policy-table-field small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.source-policy-source-list { min-width: 0; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.source-policy-list-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 700; }
.source-policy-source-row { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 6px; margin-top: 6px; }
.source-policy-source-row input { min-height: 33px; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.source-policy-source-row .row-edit-button { width: 32px; min-height: 33px; }
.source-policy-source-list > .compact-command { margin-top: 8px; }
.source-policy-import { margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line-strong); }
.source-policy-import summary { color: var(--green-dark); cursor: pointer; font-size: 10px; font-weight: 700; }
.source-policy-import textarea { min-height: 110px; margin-top: 9px; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.source-policy-import .secondary-button { margin-top: 7px; }
.source-policy-internal { margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.source-policy-internal .toggle-row span { display: grid; gap: 3px; }
.source-policy-internal .toggle-row small { color: var(--muted); font-size: 10px; font-weight: 400; }
.source-policy-define-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.source-policy-define-option { min-width: 0; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 8px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.source-policy-define-option input { width: 15px; height: 15px; accent-color: var(--green); }
.source-policy-define-option span, .source-policy-define-option strong, .source-policy-define-option code { min-width: 0; display: block; }
.source-policy-define-option strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.source-policy-define-option code { margin-top: 2px; overflow: hidden; color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.source-policy-define-option > small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.source-policy-plan { min-width: 0; margin-top: 11px; padding: 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; }
.source-policy-plan-status { align-items: center; color: var(--muted); font-size: 10px; }
.source-policy-plan-status strong { color: var(--ink); font-size: 12px; }
.source-policy-code-grid { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 10px; }
.source-policy-code-grid > div { min-width: 0; }
.source-policy-code-head { align-items: center; min-height: 27px; color: var(--muted); font-size: 10px; font-weight: 700; }
.source-policy-code-grid pre { min-height: 170px; max-height: 360px; margin: 0; padding: 10px; overflow: auto; color: var(--code-text); background: var(--code); border-radius: 4px; font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
.source-policy-openwrt { min-width: 0; }
.source-policy-openwrt ol { min-height: 170px; max-height: 360px; margin: 0; padding: 9px 9px 9px 30px; overflow: auto; background: var(--code); border-radius: 4px; color: var(--code-text); }
.source-policy-openwrt li { padding: 5px 0; font-size: 10px; }
.source-policy-openwrt li code { margin-right: 6px; color: var(--code-text); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.source-policy-instructions { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.source-policy-systemd { min-width: 0; margin-top: 15px; padding-top: 13px; border-top: 1px dashed var(--line-strong); }
.static-route-editor { min-width: 0; padding-top: 3px; }
.static-route-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.static-route-editor-head h3 { margin: 0; font-size: 13px; }
.static-route-editor-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.static-route-bulk { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(180px, 1fr) auto auto auto; align-items: end; gap: 10px; margin-top: 13px; padding: 11px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; }
.static-route-bulk .field { gap: 5px; }
.static-route-bulk .secondary-button, .static-route-bulk .text-danger-button { grid-column: auto; min-height: 36px; padding: 7px 11px; font-size: 11px; white-space: nowrap; }
.static-route-workspace { min-width: 0; height: min(58vh, 620px); display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); margin-top: 10px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 6px; }
.static-route-action-list { min-width: 0; overflow: auto; background: var(--surface-soft); border-right: 1px solid var(--line-strong); }
.static-route-row { width: 100%; min-width: 0; min-height: 58px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; gap: 4px 10px; padding: 9px 11px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; }
.static-route-row:hover { color: var(--ink); background: var(--surface-hover); }
.static-route-row.active { background: var(--surface); box-shadow: inset 3px 0 0 var(--green); }
.static-route-prefix { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.static-route-row small { color: var(--muted); font-size: 9px; }
.static-route-row > span { grid-row: 1 / 3; grid-column: 2; align-self: center; min-width: 24px; padding: 2px 5px; color: var(--green-dark); background: var(--green-soft); border-radius: 4px; font-size: 9px; text-align: center; }
.static-route-detail { min-width: 0; overflow: auto; padding: 15px 17px 20px; }
.static-route-detail-head { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.static-route-detail-head > div { min-width: 0; }
.static-route-detail-head span { display: block; color: var(--muted); font-size: 9px; }
.static-route-detail-head code { display: block; margin-top: 2px; overflow-wrap: anywhere; color: var(--ink); font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
#staticRouteDetailStatus { flex: 0 0 auto; color: var(--green-dark); }
.static-route-action-fields { display: grid; grid-template-columns: minmax(160px, .75fr) minmax(220px, 1fr); gap: 11px; margin-top: 13px; }
.static-filter-operations { margin-top: 17px; }
.static-filter-section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.static-filter-section-head span, .static-filter-section-head strong { display: block; }
.static-filter-section-head span { color: var(--muted); font-size: 9px; }
.static-filter-section-head strong { margin-top: 2px; color: var(--ink); font-size: 11px; }
.static-filter-add-controls { display: flex; align-items: center; gap: 7px; }
.static-filter-add-controls select { min-height: 33px; }
.static-filter-add-controls .secondary-button { min-height: 33px; padding: 5px 10px; font-size: 10px; }
.static-filter-operation-list { margin-top: 8px; border-top: 1px solid var(--line-strong); }
.static-filter-operation-row { min-width: 0; display: grid; grid-template-columns: 30px minmax(105px, .7fr) minmax(0, 1.4fr); align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.static-filter-operation-index { color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.static-filter-operation-fields { min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); gap: 7px; }
.static-filter-operation-fields input, .static-filter-operation-fields select, .static-filter-operation-row > select { min-width: 0; min-height: 34px; padding: 6px 8px; font-size: 10px; }
.static-filter-operation-actions { min-width: 0; grid-column: 2 / -1; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
.static-filter-operation-actions button { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; font-size: 11px; }
.static-filter-empty { margin: 0; padding: 13px 4px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 10px; }
.static-route-custom-field { margin-top: 17px; }
.static-route-custom-field textarea { min-height: 118px; }
.static-code-references { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
#staticReferenceSearch { width: min(330px, 60%); min-height: 34px; padding: 6px 9px; font-size: 11px; }
.static-code-references .code-reference-groups { max-height: 190px; }
.static-route-preview { margin-top: 14px; }
.static-route-preview > span { color: var(--muted); font-size: 9px; }
.static-route-preview pre { min-height: 70px; margin: 5px 0 0; padding: 11px; overflow: auto; color: var(--code-text); background: var(--code); border-radius: 5px; font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre; }
.static-route-empty { margin: 10px 0 0; padding: 11px; color: var(--muted); background: var(--surface-soft); border: 1px dashed var(--line-strong); border-radius: 5px; font-size: 11px; }
.account-session-section { margin-top: 20px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.account-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.account-section-heading h3, .password-settings-section h3 { margin: 0; font-size: 13px; }
.account-section-heading span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.account-section-heading .secondary-button { min-height: 32px; padding: 5px 10px; font-size: 11px; }
.account-session-section > .auth-error { margin-top: 12px; }
.account-session-retry { min-height: 30px; margin-top: 8px; padding: 4px 9px; font-size: 10px; }
.account-session-list { margin-top: 13px; border-top: 1px solid var(--line); }
.account-session-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.account-session-row:last-child { border-bottom: 0; padding-bottom: 0; }
.account-session-copy { min-width: 0; }
.account-session-title { min-width: 0; display: flex; align-items: center; gap: 7px; }
.account-session-title strong { min-width: 0; overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-session-current { flex: 0 0 auto; padding: 2px 6px; color: var(--green-dark); background: var(--green-soft); border-radius: 999px; font-size: 9px; font-weight: 750; }
.account-session-client, .account-session-time { display: block; overflow-wrap: anywhere; }
.account-session-client { margin-top: 3px; color: var(--ink-soft); font-size: 10px; }
.account-session-time { margin-top: 2px; color: var(--muted); font-size: 10px; }
.account-session-row .text-danger-button { grid-column: auto; white-space: nowrap; }
.account-session-empty { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.password-settings-section { padding-top: 18px; }
.account-password-fields { margin-top: 13px; }
#sshHostField[hidden] { display: none; }

@media (max-width: 1080px) {
  .selection-section { grid-template-columns: 1fr 20px 1fr; }
  .selection-summary { display: none; }
  .workspace-grid { grid-template-columns: 1fr; gap: 28px; }
  .session-section, .inspect-section { position: static; max-height: none; overflow: visible; }
  .session-section { padding-right: 0; padding-bottom: 28px; border-right: 0; border-bottom: 1px solid var(--line-strong); }
}

@media (max-width: 700px) {
  .app-header { padding: 0 15px; }
  .auth-panel { padding: 23px 20px; }
  .header-actions { gap: 5px; }
  .header-command { padding: 0 4px; font-size: 10px; }
  .global-state { display: flex; width: 18px; height: 18px; justify-content: center; gap: 0; overflow: hidden; color: transparent; font-size: 0; }
  .global-state i { width: 8px; height: 8px; flex: 0 0 auto; }
  main { padding: 16px 15px; }
  .workspace-tabs { gap: 20px; margin-bottom: 16px; }
  .selection-section { grid-template-columns: 1fr; align-items: stretch; padding: 14px 14px 24px; }
  .manage-hint::after { display: none; }
  .selection-arrow { display: none; }
  .topology-actions { align-items: flex-end; flex-direction: column; }
  #sessionForm, .dialog-grid { grid-template-columns: 1fr; }
  .pair-summary { grid-template-columns: 1fr; gap: 8px; }
  .pair-summary i { width: 42px; }
  .pair-summary div:last-child { text-align: left; }
  .field.full-width { grid-column: 1; }
  .policy-block { grid-column: 1; }
  .policy-form-fields { grid-template-columns: 1fr; }
  .policy-action-fields, .policy-action-inline, .policy-action-community { grid-template-columns: 1fr; }
  .policy-action-community .full-width { grid-column: 1; }
  .option-grid, .limit-grid, .raw-options { grid-template-columns: 1fr; }
  .raw-options h3 { grid-column: 1; }
  .advanced-content { padding-left: 10px; }
  .form-actions { grid-template-columns: 1fr; }
  .protocol-table-wrap table { min-width: 620px; }
  .dialog-grid .full-width { grid-column: 1; }
  .code-reference-toolbar { align-items: stretch; flex-direction: column; gap: 8px; }
  #policySourceReferenceSearch { width: 100%; }
  .code-reference-groups { grid-template-columns: 1fr; max-height: 300px; }
  .policy-scope-toolbar { align-items: stretch; flex-direction: column; }
  .policy-scope-node-list { grid-template-columns: 1fr; }
  .static-route-bulk { grid-template-columns: 1fr 1fr; }
  .static-route-bulk .secondary-button, .static-route-bulk .text-danger-button { grid-column: span 1; }
  .static-route-workspace { height: auto; grid-template-columns: 1fr; overflow: visible; }
  .static-route-action-list { max-height: 230px; border-right: 0; border-bottom: 1px solid var(--line-strong); }
  .static-route-detail { max-height: none; overflow: visible; padding: 14px; }
  .static-route-action-fields { grid-template-columns: 1fr; }
  .source-policy-define-list, .source-policy-code-grid { grid-template-columns: 1fr; }
  .source-policy-group-head, .source-policy-section-head { align-items: stretch; flex-direction: column; }
  .source-policy-group-head .field { min-width: 0; }
  .source-policy-code-grid pre, .source-policy-openwrt ol { min-height: 130px; max-height: 280px; }
  .static-filter-section-head { align-items: stretch; flex-direction: column; }
  .static-filter-add-controls { display: grid; grid-template-columns: 1fr auto; }
  .static-filter-operation-row { grid-template-columns: 26px minmax(0, 1fr); align-items: start; }
  .static-filter-operation-row > select { grid-column: 2; }
  .static-filter-operation-fields { grid-column: 2 / -1; grid-row: 2; grid-template-columns: 1fr; }
  .static-filter-operation-actions { grid-column: 2 / -1; grid-row: 3; }
  #staticReferenceSearch { width: 100%; }
  .account-section-heading { align-items: flex-start; }
  .account-session-row { grid-template-columns: 1fr; gap: 7px; }
  .account-session-row .text-danger-button { justify-self: start; }
  .split-actions { grid-template-columns: auto 1fr; }
  .split-actions span { display: none; }
  .split-actions .node-retire-actions { grid-column: 1 / -1; margin-bottom: 5px; }
  .split-actions .secondary-button, .split-actions .primary-button { grid-column: span 1; }
  .resource-section { padding: 22px 0; }
  .resource-header { padding-top: 3px; }
  .resource-tabs { gap: 18px; overflow-x: auto; }
  .resource-tab { flex: 0 0 auto; }
  .section-heading { align-items: flex-start; gap: 12px; }
  .section-heading.compact { margin-bottom: 14px; }
  .protocol-control { min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .route-dialog-shell { padding: 18px 15px; }
  .route-dialog-toolbar { align-items: stretch; flex-direction: column; }
  .route-segmented { width: 100%; }
  .route-entry details > summary { grid-template-columns: minmax(0, 1fr) 18px; gap: 5px 10px; }
  .route-entry-summary { grid-column: 1; }
  .route-entry details > summary::after { grid-column: 2; grid-row: 1 / 3; }
}

@media (max-width: 520px) {
  .brand-block > div:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

.ibgp-workspace { padding-top: 4px; }
.ibgp-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ibgp-toolbar select { min-width: 180px; }
.ibgp-layout { display: grid; gap: 24px; }
.ibgp-canvas-panel, .ibgp-connection-panel, .ibgp-pair-workspace { min-width: 0; border-top: 1px solid var(--line); padding-top: 16px; }
.ibgp-domain-strip { width: min(560px, 100%); display: grid; grid-template-columns: minmax(220px, 1fr) minmax(170px, .65fr); gap: 12px; margin-bottom: 16px; }
.panel-head, .subsection-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h3, .subsection-head h3 { margin: 0; font-size: 15px; }
.panel-head small, .subsection-head span { color: var(--muted); font-size: 11px; }
.compact-button { min-height: 30px; padding: 0 10px; }
.ibgp-canvas { position: relative; min-height: 430px; margin-top: 14px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background-color: var(--surface-soft); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 22px 22px; }
.ibgp-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ibgp-edges line { stroke: var(--green); stroke-width: 2; stroke-opacity: .45; }
.ibgp-edges line.selected { stroke-width: 3; stroke-opacity: .9; }
.ibgp-node { position: absolute; z-index: 1; width: 144px; min-height: 68px; display: grid; gap: 3px; align-content: center; padding: 10px 12px; text-align: left; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 7px; box-shadow: 0 3px 12px rgb(0 0 0 / 10%); cursor: grab; touch-action: none; }
.ibgp-node:active { cursor: grabbing; }
.ibgp-node.selected { border-color: var(--green); box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 25%, transparent); }
.ibgp-node strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.ibgp-node span { color: var(--green); font-size: 11px; text-transform: capitalize; }
.ibgp-node small { color: var(--muted); font-size: 10px; }
.ibgp-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ibgp-form-grid .full-width { grid-column: 1 / -1; }
.ibgp-subsection { padding-top: 15px; border-top: 1px solid var(--line); }
.subsection-head { margin-bottom: 12px; }
.check-row { display: flex; align-items: center; gap: 12px; min-height: 38px; }
.check-row label, .toggle-line { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 12px; }
.ibgp-connection-controls { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 300px) minmax(220px, 300px); gap: 14px; align-items: end; margin-bottom: 12px; }
.ibgp-connection-controls .subsection-head { align-self: center; margin: 0; }
.ibgp-connection-controls .subsection-head > div { display: grid; gap: 4px; }
.ibgp-transport-field, .ibgp-connection-search { min-width: 0; }
.quick-node-list { max-height: 248px; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 8px; overflow-y: auto; overscroll-behavior: contain; padding-right: 5px; scrollbar-gutter: stable; }
.connection-list-row { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 6px; align-items: stretch; }
.quick-node { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; color: var(--ink-soft); text-align: left; background: transparent; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.quick-node:hover:not(:disabled), .quick-node.active { color: var(--ink); border-color: var(--green); background: color-mix(in srgb, var(--green) 8%, transparent); }
.quick-node:disabled { opacity: .55; cursor: default; }
.quick-node > span:first-child { min-width: 0; display: grid; gap: 3px; }
.quick-node strong, .quick-node small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-node strong { color: var(--ink); font-size: 12px; }
.quick-node small, .quick-node > span:last-child { color: var(--muted); font-size: 10px; }
.quick-node > span:last-child { flex: 0 0 auto; align-self: center; }
.ibgp-pair-heading { margin-bottom: 14px; }
.ibgp-pair-heading > div { display: grid; gap: 4px; }
.ibgp-session-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.ibgp-side-column { min-width: 0; max-height: calc(100svh - 88px); display: grid; gap: 18px; align-content: start; overflow-y: auto; overscroll-behavior: contain; padding-right: 7px; scrollbar-gutter: stable; }
.ibgp-side-editor { min-width: 0; }
.ibgp-side-heading { padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.ibgp-side-heading > div { min-width: 0; display: grid; gap: 4px; }
.ibgp-side-heading h3, .ibgp-side-heading span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibgp-side-editor .session-options { margin-top: 16px; }
.ibgp-channel-editors { margin-top: 16px; }
.ibgp-preview-section { min-width: 0; }
.ibgp-preview-tabs { justify-content: space-between; }
.ibgp-preview-tabs > span { align-self: center; margin-left: auto; padding-right: 10px; color: var(--muted); font-size: 10px; }
.ibgp-preview-panels { min-height: 260px; max-height: 420px; border-radius: 0 0 6px 6px; }
.ibgp-preview-panels .tab-panel { min-height: 260px; white-space: pre; overflow-wrap: normal; overflow: auto; }
.preview-valid { color: var(--green); }
.preview-invalid, .ibgp-preview-error { color: var(--red); }
.ibgp-preview-error { display: block; padding: 8px 10px; border: 1px solid var(--line); border-top: 0; white-space: pre-wrap; font-size: 10px; }

@media (max-width: 980px) {
  .ibgp-connection-controls, .ibgp-session-grid { grid-template-columns: 1fr; }
  .ibgp-side-column { max-height: none; overflow: visible; padding-right: 0; }
}
@media (max-width: 620px) {
  .ibgp-domain-strip { grid-template-columns: 1fr; }
  .ibgp-form-grid { grid-template-columns: 1fr; }
  .ibgp-form-grid .full-width { grid-column: 1; }
  .ibgp-canvas { min-height: 420px; overflow: auto; }
  .quick-node-list { grid-template-columns: 1fr; }
}
