:root {
  color-scheme: dark;
  --bg: #101114;
  --surface: #191b20;
  --panel: #202329;
  --line: #343841;
  --line-soft: #292d34;
  --text: #f0f1f3;
  --muted: #a0a5ae;
  --silver: #c4cad2;
  --blue: #a9bed5;
  --blue-quiet: #667f9a;
  --purple: #c0b4d2;
  --green: #a5c4b1;
  --warning: #dfc5a5;
  --red: #f0a8a5;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --sans: Inter, 'Segoe UI', system-ui, sans-serif;
  font: 14px/1.55 var(--sans);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, select, input, textarea { font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 2px solid #b4cde8; outline-offset: 3px; }
code, pre, .mono { font-family: var(--mono); overflow-wrap: anywhere; }
p { margin: 0 0 0.8rem; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 625; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.55rem); letter-spacing: -0.058em; }
h2 { font-size: 1.33rem; letter-spacing: -0.025em; }
h3 { font-size: 1rem; }
small, .muted { color: var(--muted); }
strong { font-weight: 630; }
svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip:focus { position: fixed; z-index: 20; left: 12px; top: 10px; padding: 8px; background: var(--panel); }
.topbar { height: 69px; position: sticky; top: 0; z-index: 5; display: flex; padding: 0 30px 0 26px; align-items: center; justify-content: space-between; gap: 12px; background: #141519; border-bottom: 1px solid var(--line-soft); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); font-size: 1.24rem; font-weight: 730; letter-spacing: 0.11em; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font: 0.57rem var(--mono); letter-spacing: 0.13em; margin-top: 2px; white-space: nowrap; }
.brand-mark { display: block; width: 36px; height: 36px; flex: 0 0 auto; object-fit: contain; border-radius: 8px; }
.top-right, .actions, .inline { display: flex; align-items: center; gap: 10px; }
.top-right select { min-width: 100px; }
.workspace { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 69px); }
.rail { border-right: 1px solid var(--line-soft); background: #141519; display: flex; flex-direction: column; justify-content: space-between; padding: 28px 15px 20px; }
.nav-group { margin-bottom: 28px; }
.nav-head, .eyebrow { color: var(--muted); font: 0.68rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.14em; }
.nav-head { margin: 0 0 8px 11px; }
.nav-link { display: flex; align-items: center; gap: 10px; color: #b7bbc3; padding: 9px 10px; min-height: 40px; margin: 2px 0; border: 1px solid transparent; border-radius: 5px; font-size: 0.92rem; font-weight: 510; }
.nav-link:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav-link[aria-current="page"] { color: var(--text); background: #222630; border-color: #3b4653; }
.nav-link[aria-current="page"] svg { color: var(--blue); }
.nav-footer { border-top: 1px solid var(--line-soft); padding: 15px 10px 0; color: var(--muted); font: 0.72rem var(--mono); }
.nav-footer a { display: block; margin-top: 10px; }
.main { width: min(100%, 1500px); margin-inline: auto; padding: 43px clamp(20px, 4vw, 58px) 57px; min-width: 0; }
.page-head { margin-bottom: 28px; }
.page-head .eyebrow { margin-bottom: 11px; color: var(--blue); }
.page-head p:last-child { color: var(--muted); max-width: 68ch; margin: 9px 0 0; font-size: 1.02rem; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0,1fr)); margin: 23px 0; }
.stat { min-width: 0; min-height: 118px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 15px; }
.stat .inline { justify-content: space-between; gap: 5px; color: var(--muted); }
.stat svg { color: var(--blue); }
.stat strong { font: 2rem/1.4 var(--mono); display: block; margin-top: 7px; color: var(--silver); }
.stat small { display: block; font-size: 0.73rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid.wide-left { grid-template-columns: minmax(0,1.35fr) minmax(0,1fr); }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.panel { min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 20px; }
.panel + .panel.full { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel p:last-child { margin-bottom: 0; }
.panel.emphasis { background: #1b2028; border-color: #455160; }
.panel.documents { padding: clamp(18px, 3.2vw, 39px); }
.documents article { max-width: 82ch; }
.documents article h2 { margin: 24px 0 8px; }
.documents article h2:first-child { margin-top: 0; }
.documents article p { color: var(--silver); }
.subsection { margin-top: 24px; }
.subsection > h2 { margin-bottom: 12px; }
.badge { display: inline-flex; gap: 6px; align-items: center; border: 1px solid #48505a; padding: 2px 7px; border-radius: 4px; font: 0.65rem/1.5 var(--mono); color: var(--silver); white-space: nowrap; }
.badge i { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.badge.local, .badge.active, .top-local { color: var(--green); border-color: #43584e; background: #1b2822; }
.badge.experimental { color: var(--purple); border-color: #5a4f69; background: #272330; }
.badge.planned, .badge.unknown { color: var(--warning); border-color: #5c5145; background: #29241f; }
.badge.unavailable, .badge.revoked { color: var(--red); border-color: #654948; background: #2b2223; }
.button, .icon-button, select, input, textarea { border: 1px solid #444b57; border-radius: 5px; background: #121419; color: var(--text); min-height: 38px; }
input, textarea, select { padding: 8px 10px; }
input, textarea { width: 100%; min-width: 0; }
input::placeholder, textarea::placeholder { color: #8e95a0; }
textarea { min-height: 82px; resize: vertical; font-family: var(--mono); font-size: 0.84rem; }
input[type="checkbox"] { width: 16px; min-height: auto; margin: 0 7px 0 0; accent-color: #a9bed5; }
.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; padding: 7px 12px; text-decoration: none; font-weight: 620; }
.button:hover, .icon-button:hover { border-color: #8497ae; background: #29303a; text-decoration: none; }
.button.primary { background: #c4cad2; border-color: #c4cad2; color: #14161c; }
.button.primary:hover { background: #e0e5ec; }
.button.secondary { background: #252a32; color: var(--text); }
.button[disabled] { opacity: 0.57; cursor: wait; }
.icon-button { padding: 5px 10px; }
.mobile-only { display: none; }
.fields { display: grid; gap: 12px; }
.fields label, label.field { display: grid; gap: 5px; color: var(--silver); font-size: 0.88rem; font-weight: 570; min-width: 0; }
label.check { display: flex; align-items: center; width: fit-content; color: var(--muted); font-size: 0.86rem; }
.field-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.actions { flex-wrap: wrap; }
.result { margin-top: 16px; }
.notice { padding: 10px 12px; color: var(--silver); background: #222832; border-left: 2px solid #7790ac; border-radius: 3px; }
.notice.error { background: #2b2223; color: var(--red); border-color: var(--red); }
.notice.success { background: #202b25; color: var(--green); border-color: var(--green); }
.data { margin: 0; }
.data > div { display: grid; grid-template-columns: minmax(96px, 0.63fr) minmax(0,1fr); align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.data dt { color: var(--muted); }
.data dd { margin: 0; min-width: 0; overflow-wrap: anywhere; text-align: right; }
.list { display: grid; margin: 0; padding: 0; list-style: none; }
.list > li { padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.list > li:last-child { border-bottom: 0; }
.list > li p { margin: 4px 0 0; color: var(--muted); }
.list .inline { flex-wrap: wrap; }
.list .meta { font: 0.7rem var(--mono); color: var(--muted); }
pre { margin: 12px 0; padding: 11px 13px; background: #101216; border: 1px solid var(--line); border-radius: 5px; font-size: 0.8rem; white-space: pre-wrap; max-height: 280px; overflow: auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; text-align: left; border-collapse: collapse; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { color: var(--muted); font: 0.72rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
td .badge { margin-right: 4px; }
footer { margin-top: 29px; padding-top: 15px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 0.83rem; display: flex; gap: 12px 20px; flex-wrap: wrap; }
footer > span { margin-right: auto; }
dialog { width: min(480px, calc(100% - 24px)); padding: 23px; border: 1px solid #49515d; background: var(--surface); color: var(--text); border-radius: 9px; }
dialog::backdrop { background: #08090bdc; }
dialog h2 { padding: 2px 32px 13px 0; }
.dialog-close { float: right; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 6; max-width: calc(100% - 40px); }
.toast:not(:empty) { background: #272e39; border: 1px solid #48586b; padding: 10px 14px; border-radius: 6px; }
.module-link { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--silver); }
.module-link > span:first-child { display: flex; gap: 9px; align-items: center; }
.topology { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; margin: 13px 0; }
.node { border: 1px solid #465160; border-radius: 5px; background: #202731; padding: 10px; min-width: 0; }
.node small { display: block; }
.source-title { margin: 5px 0; }
.source-title a { color: var(--text); }
@media (max-width: 1060px) {
  .workspace { grid-template-columns: 184px minmax(0,1fr); }
  .cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .topbar { padding-inline: 18px; }
}
@media (max-width: 760px) {
  .mobile-only { display: inline-flex; }
  .topbar { height: 62px; padding-inline: 11px; }
  .brand { margin-right: auto; gap: 8px; font-size: 1.02rem; }
  .brand-mark { width: 28px; height: 28px; border-radius: 6px; }
  .top-right { gap: 6px; }
  .top-local, .brand small { display: none; }
  .top-right select { min-width: 0; padding: 6px; }
  .top-right .button { padding-inline: 8px; font-size: 0.8rem; }
  .workspace { display: block; min-height: calc(100vh - 62px); }
  .rail { display: none; position: fixed; z-index: 4; left: 0; top: 62px; bottom: 0; width: 220px; overflow: auto; border-right-color: #56616f; }
  .rail.open { display: flex; }
  .main { padding-top: 25px; }
  .grid, .grid.wide-left { grid-template-columns: minmax(0,1fr); }
  .panel { padding: 15px; }
}
@media (max-width: 380px) {
  .topbar { gap: 7px; }
  .brand { gap: 5px; font-size: 0.9rem; }
  .brand-mark { width: 25px; height: 25px; }
  .main { padding-inline: 13px; }
  .topology { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}

.result:empty, .stack > [aria-live]:empty { display: none; }
.external-icon { display: inline-flex; margin-left: 4px; vertical-align: -2px; color: var(--blue); }
.external-icon svg { width: 13px; height: 13px; }

.wallet-chain { border-top: 1px solid #49515d; margin-top: 18px; padding-top: 16px; }
.wallet-chain-title { margin: 0 0 8px; }
.wallet-chain pre { white-space: pre-wrap; overflow-wrap: anywhere; }
