:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(29, 29, 31, 0.1);
  --line-strong: rgba(29, 29, 31, 0.16);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.09);
  --page-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(245, 245, 247, 0.98)), var(--bg);
  --chrome: rgba(255, 255, 255, 0.74);
  --field-bg: rgba(255, 255, 255, 0.88);
  --field-focus-bg: #ffffff;
  --button-bg: rgba(255, 255, 255, 0.78);
  --icon-bg: rgba(255, 255, 255, 0.2);
  --summary-bg: rgba(255, 255, 255, 0.58);
  --badge-bg: rgba(255, 255, 255, 0.72);
  --metric-bg: rgba(255, 255, 255, 0.7);
  --canvas-bg: rgba(255, 255, 255, 0.42);
  --grid-line: rgba(29, 29, 31, 0.035);
  --tree-line: rgba(29, 29, 31, 0.15);
  --card-bg: rgba(255, 255, 255, 0.9);
  --range-bg: rgba(245, 245, 247, 0.7);
  --address-bar-bg: #eef0f2;
  --empty-stripe-a: rgba(29, 29, 31, 0.08);
  --empty-stripe-b: rgba(255, 255, 255, 0.7);
  --dark-button-bg: #1d1d1f;
  --dark-button-ink: #ffffff;
  --toast-bg: rgba(29, 29, 31, 0.92);
  --scrim: rgba(0, 0, 0, 0.28);
  --blue: #0071e3;
  --blue-soft: #e8f2ff;
  --green: #28a745;
  --orange: #f5a623;
  --red: #d93025;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #101012;
    --surface: rgba(31, 31, 34, 0.78);
    --surface-strong: #222225;
    --ink: #f5f5f7;
    --muted: #a1a1a6;
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.2);
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
    --page-bg: linear-gradient(180deg, rgba(38, 38, 41, 0.78), rgba(16, 16, 18, 0.98)), var(--bg);
    --chrome: rgba(31, 31, 34, 0.74);
    --field-bg: rgba(255, 255, 255, 0.08);
    --field-focus-bg: rgba(255, 255, 255, 0.12);
    --button-bg: rgba(255, 255, 255, 0.09);
    --icon-bg: rgba(255, 255, 255, 0.15);
    --summary-bg: rgba(255, 255, 255, 0.07);
    --badge-bg: rgba(255, 255, 255, 0.09);
    --metric-bg: rgba(255, 255, 255, 0.07);
    --canvas-bg: rgba(255, 255, 255, 0.045);
    --grid-line: rgba(255, 255, 255, 0.04);
    --tree-line: rgba(255, 255, 255, 0.16);
    --card-bg: rgba(35, 35, 38, 0.92);
    --range-bg: rgba(255, 255, 255, 0.06);
    --address-bar-bg: rgba(255, 255, 255, 0.07);
    --empty-stripe-a: rgba(255, 255, 255, 0.08);
    --empty-stripe-b: rgba(255, 255, 255, 0.025);
    --dark-button-bg: #f5f5f7;
    --dark-button-ink: #1d1d1f;
    --toast-bg: rgba(245, 245, 247, 0.92);
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--chrome);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
  backdrop-filter: saturate(180%) blur(24px);
}

.brand-block,
.topbar-actions,
.canvas-actions,
.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.28rem, 2vw, 1.82rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.18;
}

.workspace {
  display: block;
  margin-top: 18px;
}

.sidebar {
  position: fixed;
  top: 104px;
  right: 22px;
  z-index: 45;
  width: min(390px, calc(100vw - 44px));
  max-height: calc(100vh - 126px);
  overflow: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
}

.sidebar.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.tool-panel {
  display: none;
}

.sidebar[data-active-panel="base"] [data-panel="base"],
.sidebar[data-active-panel="detail"] [data-panel="detail"],
.sidebar[data-active-panel="subdivide"] [data-panel="subdivide"] {
  display: block;
}

.panel,
.canvas-area {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: saturate(180%) blur(20px);
}

.panel {
  padding: 16px;
}

.panel-heading,
.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.base-network-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.base-network-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--summary-bg);
  color: var(--ink);
  text-align: left;
}

.base-network-item.is-current {
  border-color: rgba(0, 113, 227, 0.58);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.base-network-select {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.base-network-item strong {
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.base-network-item span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.base-network-delete {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--red);
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
}

.base-network-delete:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.stacked-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field span,
.check-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
select:focus {
  border-color: rgba(0, 113, 227, 0.7);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.13);
  background: var(--field-focus-bg);
}

input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
}

.check-field input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--blue);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 15px;
  color: var(--ink);
  background: var(--button-bg);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.button:active {
  transform: translateY(0);
}

.button.primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 22px rgba(0, 113, 227, 0.22);
}

.button.dark {
  background: var(--dark-button-bg);
  color: var(--dark-button-ink);
}

.button.ghost {
  border-color: var(--line);
}

.button.full {
  width: 100%;
}

.button.compact {
  min-height: 34px;
  padding-inline: 12px;
  font-size: 0.8rem;
}

.button.danger {
  color: var(--red);
}

.button-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: var(--icon-bg);
  font-size: 0.72rem;
}

.selected-summary {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--summary-bg);
}

.selected-summary strong {
  font-size: 1rem;
}

.selected-summary span {
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.badge,
.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--badge-bg);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-color: color-mix(in srgb, var(--status-color, var(--blue)) 58%, transparent);
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--status-color, var(--blue)) 18%, transparent);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.method-field.is-hidden,
.visually-hidden {
  display: none;
}

.action-row {
  margin-top: 12px;
}

.action-row .button {
  flex: 1;
}

.canvas-area {
  min-width: 0;
  padding: 18px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.metric-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--metric-bg);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 7px;
  font-size: clamp(1rem, 2vw, 1.35rem);
  overflow-wrap: anywhere;
}

.canvas-toolbar {
  margin-bottom: 14px;
}

.tree-wrap {
  position: relative;
  z-index: 1;
  min-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--canvas-bg);
  background-size: 28px 28px;
  padding: 16px;
}

.network-tree,
.children {
  display: grid;
  gap: 14px;
  min-width: min(880px, 100%);
}

.children {
  position: relative;
  margin-left: 26px;
  padding-left: 22px;
  border-left: 1px solid var(--tree-line);
}

.children::before {
  content: "";
  position: absolute;
  top: -13px;
  left: -1px;
  width: 22px;
  height: 21px;
  border-bottom: 1px solid var(--tree-line);
}

.network-node {
  position: relative;
  min-width: 0;
}

.network-node:hover,
.network-node:focus-within {
  z-index: 30;
}

.network-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.5fr) auto;
  gap: 14px;
  align-items: start;
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 6px solid var(--node-color, var(--blue));
  border-radius: var(--radius);
  background: var(--card-bg);
  padding: 14px;
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.06);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.network-card.has-toggle {
  padding-left: 46px;
}

.network-card:hover {
  z-index: 35;
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
}

.network-card:focus-within {
  z-index: 35;
}

.network-card.is-selected {
  border-color: rgba(0, 113, 227, 0.58);
  border-left-color: var(--node-color, var(--blue));
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1), 0 14px 34px rgba(0, 0, 0, 0.08);
}

.network-card.is-collapsed + .children {
  display: none;
}

.network-card.is-collapsed {
  align-items: center;
}

.network-card.is-collapsed .node-use,
.network-card.is-collapsed .node-details,
.network-card.is-collapsed .node-actions {
  display: none;
}

.node-title {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.node-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.node-title h3 {
  margin-bottom: 0;
  font-size: 1.02rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.node-cidr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  margin-left: auto;
  text-align: right;
}

.node-use {
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.node-details {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.range-line {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.range-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: var(--range-bg);
}

.range-item span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.range-item strong {
  display: block;
  margin-top: 5px;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.address-bar {
  position: relative;
  display: flex;
  height: 16px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--address-bar-bg);
}

.bar-segment {
  position: relative;
  flex: 0 0 auto;
  min-width: 2px;
  background: var(--segment-color, var(--blue));
  outline: none;
}

.bar-segment.status-reserved {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.34) 0,
      rgba(255, 255, 255, 0.34) 5px,
      rgba(0, 0, 0, 0.1) 5px,
      rgba(0, 0, 0, 0.1) 10px
    ),
    var(--segment-color, var(--orange));
}

.bar-segment.status-future {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.26) 0,
      rgba(255, 255, 255, 0.26) 2px,
      transparent 2px,
      transparent 8px
    ),
    var(--segment-color, var(--blue));
}

.address-bar > :first-child {
  border-bottom-left-radius: 999px;
  border-top-left-radius: 999px;
}

.address-bar > :last-child {
  border-bottom-right-radius: 999px;
  border-top-right-radius: 999px;
}

.bar-empty {
  position: relative;
  flex: 0 0 auto;
  background: repeating-linear-gradient(
    45deg,
    var(--empty-stripe-a) 0,
    var(--empty-stripe-a) 5px,
    var(--empty-stripe-b) 5px,
    var(--empty-stripe-b) 10px
  );
}

.address-bar > .bar-empty:only-child {
  flex: 1 1 auto;
}

.bar-segment:hover,
.bar-segment:focus,
.bar-segment:focus-visible,
.bar-empty:hover,
.bar-empty:focus,
.bar-empty:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.64), 0 0 0 3px rgba(0, 113, 227, 0.24);
}

.segment-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  z-index: 80;
  display: grid;
  gap: 7px;
  width: max-content;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 48px));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.segment-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 10px;
  border-bottom: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  background: var(--surface-strong);
  transform: translateX(-50%) rotate(45deg);
}

.bar-segment.tooltip-below .segment-tooltip,
.bar-empty.tooltip-below .segment-tooltip {
  top: calc(100% + 12px);
  bottom: auto;
  transform: translate(-50%, -6px);
}

.bar-segment.tooltip-below .segment-tooltip::after,
.bar-empty.tooltip-below .segment-tooltip::after {
  top: -6px;
  bottom: auto;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  border-right: 0;
  border-bottom: 0;
}

.bar-segment:hover .segment-tooltip,
.bar-segment:focus .segment-tooltip,
.bar-segment:focus-visible .segment-tooltip,
.bar-empty:hover .segment-tooltip,
.bar-empty:focus .segment-tooltip,
.bar-empty:focus-visible .segment-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.tooltip-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.tooltip-title strong {
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.tooltip-title span,
.tooltip-note {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.tooltip-grid {
  display: grid;
  gap: 6px;
  margin: 0;
}

.tooltip-grid div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
}

.tooltip-grid dt {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tooltip-grid dd {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: max-content;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.icon-button:hover {
  border-color: rgba(0, 113, 227, 0.35);
  color: var(--blue);
}

.close-button {
  width: 30px;
  height: 30px;
  font-size: 0.84rem;
}

.node-toggle {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  width: 32px;
  height: 32px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.card-action {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--ink);
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.card-action:hover {
  border-color: rgba(0, 113, 227, 0.35);
  color: var(--blue);
}

.card-action:disabled,
.card-action:disabled:hover {
  cursor: not-allowed;
  border-color: var(--line);
  color: var(--muted);
  opacity: 0.46;
  transform: none;
}

.subdivide-preview,
.base-network-preview {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--summary-bg);
}

.preview-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.preview-heading strong {
  font-size: 0.9rem;
}

.preview-heading span,
.preview-note {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.preview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preview-metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: var(--range-bg);
}

.preview-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
}

.preview-metric strong {
  display: block;
  margin-top: 5px;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.preview-list {
  display: grid;
  gap: 6px;
  max-height: 190px;
  overflow: auto;
}

.preview-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: var(--range-bg);
}

.preview-item strong,
.preview-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.preview-item span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.overlay-scrim {
  position: fixed;
  inset: 0;
  z-index: 44;
  display: block;
  border: 0;
  background: var(--scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.overlay-scrim.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 44px));
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--toast-bg);
  color: var(--bg);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .network-card {
    grid-template-columns: 1fr;
  }

  .node-actions {
    justify-content: start;
  }

  .node-heading {
    align-items: flex-start;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .canvas-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .canvas-actions {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .preview-metrics,
  .preview-item {
    grid-template-columns: 1fr;
  }

  .sidebar {
    top: auto;
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    max-height: min(680px, calc(100vh - 96px));
  }

  .range-line {
    grid-template-columns: 1fr;
  }

  .tree-wrap {
    min-height: 460px;
    padding: 12px;
  }

  .children {
    margin-left: 10px;
    padding-left: 14px;
  }
}
