:root {
  color-scheme: light dark;
  --bg-page: #fafaf7;
  --bg-surface: #ffffff;
  --bg-muted: #f1efe8;
  --text-primary: #1a1a1a;
  --text-secondary: #5f5e5a;
  --text-tertiary: #888780;
  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.15);
  --fireblocks-bg: #eeedfe;
  --fireblocks-fg: #3c3489;
  --turnkey-bg: #e1f5ee;
  --turnkey-fg: #085041;
  --vls-bg: #f1efe8;
  --vls-fg: #444441;
  --lightning-bg: #e6f1fb;
  --lightning-fg: #0c447c;
  --success: #27500a;
  --warning: #854f0b;
  --danger: #791f1f;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #1a1a1a;
    --bg-surface: #242422;
    --bg-muted: #2c2c2a;
    --text-primary: #f5f4ef;
    --text-secondary: #b4b2a9;
    --text-tertiary: #888780;
    --border: rgba(255,255,255,0.1);
    --border-strong: rgba(255,255,255,0.18);
    --fireblocks-bg: #26215c;
    --fireblocks-fg: #cecbf6;
    --turnkey-bg: #04342c;
    --turnkey-fg: #9fe1cb;
    --vls-bg: #2c2c2a;
    --vls-fg: #d3d1c7;
    --lightning-bg: #042c53;
    --lightning-fg: #b5d4f4;
  }
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

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

button, a, input, select, textarea {
  outline: none;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--lightning-fg);
  outline-offset: 2px;
}

button {
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}

button:hover { background: var(--bg-muted); }
button:disabled { cursor: not-allowed; opacity: 0.6; }

input, select, textarea {
  width: 100%;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 14px;
}

textarea {
  min-height: 104px;
  resize: vertical;
  font-family: var(--font-mono);
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; font-weight: 500; line-height: 1.1; }
h2 { font-size: 18px; font-weight: 500; line-height: 1.2; }
h3 { font-size: 16px; font-weight: 500; line-height: 1.25; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-page);
  border-bottom: 0.5px solid var(--border);
}

.header-inner, .page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand, .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--lightning-bg);
  color: var(--lightning-fg);
}

.brand-icon i { font-size: 18px; }
.brand p, .refresh-note { color: var(--text-secondary); font-size: 12px; }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
}

.service-pill, .status-pill, .custody-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  white-space: nowrap;
}

.service-pill {
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
}

.service-pill span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.service-pill.good { background: #eaf3de; color: var(--success); }
.service-pill.warn { background: #fff0d8; color: var(--warning); }
.service-pill.bad { background: #f8dddd; color: var(--danger); }
.service-pill.muted { background: var(--bg-muted); color: var(--text-secondary); }

.page-shell {
  display: grid;
  gap: 1.5rem;
  padding: 24px 0 48px;
}

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

.node-stack {
  display: grid;
  gap: 10px;
}

.node-card {
  overflow: hidden;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
}

.node-card-header {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 14px 16px;
  text-align: left;
}

.node-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--lightning-bg);
  color: var(--lightning-fg);
  font-weight: 500;
}

.node-avatar.muted { background: var(--bg-muted); color: var(--text-tertiary); }

.node-title-row {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.node-title-row strong { font-size: 14px; font-weight: 500; }
.node-subtitle { margin-top: 2px; color: var(--text-tertiary); font-size: 11px; }
.node-warning { display: inline-flex; align-items: center; gap: 4px; color: var(--warning); }

.investor-badge {
  border-radius: 8px;
  padding: 2px 6px;
  background: var(--fireblocks-bg);
  color: var(--fireblocks-fg);
  font-size: 11px;
}

.node-balance { text-align: right; }
.node-balance strong { display: block; font-size: 18px; font-weight: 500; line-height: 1.2; }
.node-balance span { color: var(--text-tertiary); font-size: 11px; }

.node-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
  padding: 2px 6px;
  background: var(--bg-muted);
  color: var(--text-tertiary);
  font-size: 11px;
}

.node-pill.turnkey-active { background: var(--turnkey-bg); color: var(--turnkey-fg); }

.node-addresses {
  display: grid;
  gap: 0;
  border-top: 0.5px solid var(--border);
  padding: 12px 16px 14px;
  background: var(--bg-muted);
}

.node-addresses-title {
  margin-bottom: 8px;
  color: var(--text-tertiary);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.address-row {
  display: grid;
  grid-template-columns: 80px max-content minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-top: 0.5px solid var(--border);
}

.address-row:first-of-type { border-top: 0; }

.address-pill {
  border-radius: 8px;
  padding: 2px 6px;
  text-align: center;
  font-size: 11px;
}

.address-pill.fireblocks { background: var(--fireblocks-bg); color: var(--fireblocks-fg); }
.address-pill.turnkey { background: var(--turnkey-bg); color: var(--turnkey-fg); }
.address-pill.ldk { background: var(--vls-bg); color: var(--vls-fg); }
.address-value {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}
.address-role { color: var(--text-tertiary); font-size: 12px; }

.section-footnote {
  margin-top: 10px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.metric-card {
  position: relative;
  min-height: 92px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--bg-muted);
}

.metric-card label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-header label { margin-bottom: 4px; }
.metric-mempool-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--warning);
  cursor: help;
  opacity: 0.85;
}

.metric-card strong {
  display: block;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
}

.metric-card small {
  display: block;
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.metric-card small.warning { color: var(--warning); }

.metric-card .unit {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
}

.skeleton {
  position: relative;
  overflow: hidden;
}

.skeleton::before {
  content: "";
  display: block;
  height: 100%;
  min-height: 68px;
  border-radius: 8px;
  background: var(--bg-surface);
}

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

.section-heading { margin-bottom: 10px; }
.section-heading p, .card-heading span { color: var(--text-tertiary); font-size: 12px; }

.raised-card {
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
}

.custody-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px;
}

.custody-box {
  min-height: 96px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.custody-box span {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.custody-box strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 500;
}

.custody-box p { font-size: 12px; }
.fireblocks-box { background: var(--fireblocks-bg); color: var(--fireblocks-fg); }
.turnkey-box { background: var(--turnkey-bg); color: var(--turnkey-fg); }
.vls-box { background: var(--vls-bg); color: var(--vls-fg); }

.flow-arrow {
  color: var(--text-tertiary);
  font-size: 18px;
}

.topology-actions-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
}

.topology-card, .quick-actions-card { padding: 14px 16px; }
.topology-canvas { min-height: 230px; margin-top: 12px; }

.topology-canvas svg {
  display: block;
  width: 100%;
  height: auto;
}

.node-circle { fill: var(--lightning-bg); stroke: var(--lightning-fg); stroke-width: 0.5; }
.node-letter { fill: var(--lightning-fg); font-size: 13px; font-weight: 500; }
.node-label, .channel-label { fill: var(--text-secondary); font-size: 11px; }
.channel-label.active { fill: #185fa5; }
.channel-label.pending { fill: #854f0b; }
.channel-label.inactive { fill: #b4b2a9; }
.peer-label { fill: var(--text-tertiary); font-size: 10px; opacity: 0.7; }
.peer-line {
  stroke: #888780;
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.45;
  cursor: default;
}
.peer-line:hover { opacity: 0.8; }
.channel-line { stroke-linecap: round; }
.channel-line.active { stroke: #185fa5; opacity: 1; }
.channel-line.pending { stroke: #854f0b; stroke-width: 2; stroke-dasharray: 6 3; opacity: 0.85; }
.channel-line.inactive { stroke: #b4b2a9; stroke-width: 1; stroke-dasharray: 4 4; opacity: 0.5; }
.channel-line:hover, .channel-line.highlight, .channel-line.selected { stroke-width: 3.5; }
.channel-line.selected { stroke: #185fa5; }

@media (prefers-color-scheme: dark) {
  .channel-line.pending { stroke: #fac775; }
  .channel-label.pending { fill: #fac775; }
}

.topology-popover {
  position: fixed;
  z-index: 40;
  max-width: 280px;
  border: 0.5px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
}

.topology-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.quick-actions button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
}

.quick-actions button span { margin-left: auto; color: var(--text-tertiary); }

.activity-feed { overflow: hidden; }

.activity-empty {
  padding: 16px;
  color: var(--text-secondary);
}

.activity-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  width: 100%;
  border: 0;
  border-bottom: 0.5px solid var(--border);
  border-radius: 0;
  padding: 12px 16px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.activity-row:last-child { border-bottom: 0; }
.activity-row:hover { background: var(--bg-muted); }
.activity-row:focus-visible {
  outline: 2px solid var(--lightning-fg);
  outline-offset: -2px;
}

.event-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  flex-shrink: 0;
}

.event-icon i { font-size: 14px; }
.event-icon.channel_open { background: var(--lightning-bg); color: var(--lightning-fg); }
.event-icon.payment { background: var(--turnkey-bg); color: var(--turnkey-fg); }
.event-icon.funding_tx { background: var(--fireblocks-bg); color: var(--fireblocks-fg); }
.event-icon.sweep_tx { background: var(--vls-bg); color: var(--vls-fg); }
.event-icon.close_tx { background: #f8dddd; color: var(--danger); }
.event-icon.onchain_tx { background: var(--vls-bg); color: var(--vls-fg); }

.event-title {
  color: var(--text-primary);
  font-size: 14px;
}

.event-title span { color: var(--text-secondary); }

.event-subinfo {
  display: block;
  margin-top: 2px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.custody-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.custody-pill {
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 11px;
}

.custody-pill.fireblocks { background: var(--fireblocks-bg); color: var(--fireblocks-fg); }
.custody-pill.turnkey { background: var(--turnkey-bg); color: var(--turnkey-fg); }
.custody-pill.local { background: var(--vls-bg); color: var(--vls-fg); }

.event-side {
  display: grid;
  gap: 2px;
  justify-items: end;
  min-width: 92px;
  text-align: right;
}

.event-amount {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
}

.status-text { display: block; font-size: 11px; font-weight: 400; }
.status-text.success { color: var(--success); }
.status-text.warning { color: var(--warning); }
.status-text.danger { color: var(--danger); }
.status-text.muted { color: var(--text-tertiary); }

.event-detail {
  grid-column: 2 / 4;
  display: grid;
  gap: 8px;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
}

.detail-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.detail-line code {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  flex: 0 0 auto;
}

.explorer-link {
  color: var(--lightning-fg);
  text-decoration: none;
}

.explorer-link:hover { text-decoration: underline; }

.show-more {
  margin-top: 10px;
  width: 100%;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
}

.modal-panel {
  width: min(480px, 100%);
  max-height: min(720px, calc(100vh - 32px));
  overflow: auto;
  border: 0.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-surface);
}

.modal-header, .modal-body, .modal-footer { padding: 16px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 0.5px solid var(--border);
}

.modal-body {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label, .field span {
  color: var(--text-secondary);
  font-size: 12px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 0.5px solid var(--border);
}

.primary-button {
  background: var(--lightning-fg);
  color: var(--bg-surface);
}

.primary-button:hover { background: var(--lightning-fg); }
.danger-button { border-color: rgba(121, 31, 31, 0.3); color: var(--danger); }

.vault-chip-grid, .opener-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.vault-chip, .opener-card {
  display: grid;
  gap: 2px;
  text-align: left;
}

.vault-chip strong, .opener-card strong { font-weight: 500; }
.vault-chip small, .opener-card small { color: var(--text-tertiary); font-size: 11px; }
.vault-chip.selected, .opener-card.selected { border-color: #534ab7; background: var(--fireblocks-bg); color: var(--fireblocks-fg); }
.vault-chip:disabled, .opener-card:disabled { cursor: not-allowed; opacity: 0.5; }

.input-with-suffix {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-with-suffix input { max-width: 160px; }
.field-hint { color: var(--text-tertiary); font-size: 11px; }
.field-warning { color: var(--warning); font-size: 11px; }
.funding-source-box, .funding-summary-box {
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 12px;
}

.funding-summary-box.error { color: var(--danger); }

.help-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--text-tertiary);
}

.help-tooltip span {
  position: absolute;
  left: 0;
  bottom: 125%;
  display: none;
  width: min(320px, 80vw);
  border: 0.5px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
}

.help-tooltip:hover span, .help-tooltip:focus-within span { display: block; }

.inspector-panel {
  overflow: hidden;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
}

.inspector-header, .inspector-section, .inspector-footer { padding: 14px 16px; }
.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 0.5px solid var(--border);
}

.inspector-count {
  color: var(--text-tertiary);
  font-size: 11px;
}

.inspector-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  text-align: center;
}

.inspector-empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--text-tertiary);
}

.inspector-empty-icon i { font-size: 24px; }
.inspector-empty h3 { margin-bottom: 4px; font-size: 14px; font-weight: 500; }
.inspector-empty p {
  max-width: 360px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 12px;
}

.channel-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--border);
}

.channel-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
}

.channel-chip.selected {
  border-color: #185fa5;
  background: #e6f1fb;
  color: #0c447c;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #b4b2a9;
}

.status-dot.active { background: #639922; }
.status-dot.pending { background: #ef9f27; }
.status-dot.inactive { background: #b4b2a9; }
.channel-chip-state { color: var(--text-tertiary); font-size: 10px; }

.mono-pill {
  border-radius: 8px;
  padding: 2px 6px;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.status-pill.active, .status-pill.confirmed, .status-pill.succeeded { background: #eaf3de; color: var(--success); }
.status-pill.pending, .status-pill.mempool { background: #fff0d8; color: var(--warning); }
.status-pill.inactive { background: #f8dddd; color: var(--danger); }
.status-pill { gap: 6px; padding: 3px 8px; font-size: 12px; }

.capacity-labels {
  display: flex;
  justify-content: space-between;
  margin: 12px 0 6px;
  color: var(--text-secondary);
  font-size: 11px;
}

.capacity-bar {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--lightning-bg);
}

.capacity-outbound { background: var(--lightning-fg); }
.capacity-inbound { background: color-mix(in srgb, var(--lightning-fg) 45%, var(--lightning-bg)); }

.custody-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 0.5px solid var(--border);
}

.custody-row:first-of-type { border-top: 0; }
.inspector-footer { display: flex; gap: 8px; justify-content: flex-end; border-top: 0.5px solid var(--border); }
.inspector-footer button i { margin-right: 6px; font-size: 14px; vertical-align: -2px; }
.inspector-footer .danger-button { border-color: #791f1f; color: #791f1f; }

.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.tab-button.active {
  background: var(--bg-muted);
  border-color: var(--border-strong);
}

.toast-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
}

.toast {
  position: relative;
  border: 0.5px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px 38px 12px 14px;
  background: var(--bg-surface);
  color: var(--text-primary);
}

.toast.success { border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.toast.error { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.toast strong { display: block; margin-bottom: 2px; font-weight: 500; }
.toast p { color: var(--text-secondary); font-size: 13px; }
.toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
}
.toast-error-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.toast-hint {
  overflow: hidden;
  color: var(--text-tertiary);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toast-details {
  margin-top: 6px;
  padding: 3px 8px;
  font-size: 11px;
}
.toast-full {
  display: none;
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 0;
  border-radius: 8px;
  padding: 8px;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: pre-wrap;
}
.toast.expanded .toast-error-text { display: none; }
.toast.expanded .toast-hint { white-space: normal; }
.toast.expanded .toast-full { display: block; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .metrics-grid, .topology-actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .header-inner { align-items: flex-start; flex-direction: column; padding: 12px 0; }
  .header-actions { width: 100%; flex-wrap: wrap; }
  .refresh-note { margin-left: auto; }
  .metrics-grid, .topology-actions-grid { grid-template-columns: 1fr; }
  .node-card-header { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .node-balance, .node-pill { grid-column: 2; justify-self: start; text-align: left; }
  .address-row { grid-template-columns: 80px minmax(0, 1fr) auto auto; }
  .address-value { white-space: normal; overflow-wrap: anywhere; }
  .address-role { grid-column: 2 / 5; }
  .vault-chip-grid, .opener-grid { grid-template-columns: 1fr; }
  .custody-flow { grid-template-columns: 1fr; }
  .flow-arrow { justify-self: center; transform: rotate(90deg); }
  .activity-row { grid-template-columns: 28px minmax(0, 1fr); }
  .event-side { grid-column: 2; text-align: left; }
  .event-detail { grid-column: 2; }
}

@media (max-width: 480px) {
  .address-row { grid-template-columns: 80px minmax(0, 1fr); }
  .address-value, .address-role { grid-column: 1 / 3; }
  .address-row .copy-button { justify-self: end; }
}

@media (max-width: 520px) {
  .header-inner, .page-shell { width: min(100% - 20px, 1200px); }
  .section-heading, .card-heading { align-items: flex-start; flex-direction: column; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer button { width: 100%; }
}
