:root {
  --canvas: #07100d;
  --sidebar: #091410;
  --surface: #0d1a16;
  --surface-2: #12221c;
  --surface-3: #172a22;
  --line: #263b32;
  --line-soft: rgba(151, 177, 164, 0.14);
  --text: #f4f8f5;
  --muted: #9dafa5;
  --faint: #6f8178;
  --mint: #67e6aa;
  --amber: #f3c969;
  --coral: #ff8875;
  --blue: #8fb4ff;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--canvas);
  font-family: var(--sans);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  gap: 22px;
  z-index: 20;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.sidebar > .brand {
  padding: 0 8px;
}

.logo {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(103, 230, 170, 0.4);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--mint);
  background: #10241c;
  font-weight: 800;
  font-size: 12px;
}

.title {
  font-weight: 750;
  font-size: 14px;
}

.subtitle {
  margin-top: 2px;
  color: var(--faint);
  font-size: 11px;
}

.nav-section {
  display: grid;
  gap: 6px;
}

.nav-label {
  padding: 0 9px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav a {
  min-height: 41px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav a.active {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-2);
}

.nav svg,
.search svg,
.button svg,
button svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 13px 9px 0;
  display: grid;
  gap: 9px;
}

.sidebar-foot-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 66px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 13, 0.94);
  backdrop-filter: blur(16px);
  padding: 11px 24px;
  display: grid;
  gap: 8px;
}

.topline {
  display: grid;
  grid-template-columns: auto minmax(260px, 580px);
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topline > .brand {
  display: none;
}

.search {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 0;
}

.search:focus-within {
  border-color: rgba(103, 230, 170, 0.65);
}

.search input {
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px 11px;
}

.search button {
  min-height: 38px;
  border-radius: 0 6px 6px 0;
}

.status-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.pill {
  width: fit-content;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 650;
}

.pill strong {
  color: var(--text);
  font-family: var(--mono);
  font-weight: 600;
}

.pill-label {
  color: var(--faint);
}

.pill.success {
  color: var(--mint);
  border-color: rgba(103, 230, 170, 0.35);
}

.pill.warn {
  color: var(--amber);
  border-color: rgba(243, 201, 105, 0.35);
}

.pill.error {
  color: var(--coral);
  border-color: rgba(255, 136, 117, 0.35);
}

.content {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 30px 28px 88px;
  display: grid;
  gap: 22px;
}

.page-hero {
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 6px;
}

.page-hero h1 {
  margin: 0;
  font-size: clamp(27px, 4vw, 40px);
  line-height: 1.05;
  font-weight: 760;
}

.page-hero p {
  margin: 3px 0 0;
  max-width: 760px;
  line-height: 1.55;
  font-size: 14px;
}

.eyebrow,
.label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.card,
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.grid > .card {
  min-height: 108px;
  align-content: space-between;
}

.value {
  color: var(--text);
  font-family: var(--mono);
  font-size: clamp(20px, 2.3vw, 28px);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.value.success,
.mono.success,
strong.success {
  color: var(--mint);
}

.value.warn,
.mono.warn,
strong.warn {
  color: var(--amber);
}

.value.error,
.mono.error,
strong.error {
  color: var(--coral);
}

.mono {
  font-family: var(--mono);
  font-size: 11px;
  overflow-wrap: anywhere;
}

form,
.stack {
  display: grid;
  gap: 12px;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

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

.field label,
label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 41px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: var(--surface-2);
  color: var(--text);
  padding: 9px 11px;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(103, 230, 170, 0.7);
}

input[readonly] {
  color: var(--muted);
  background: #0b1713;
}

button,
.button {
  width: fit-content;
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
}

button:hover,
.button:hover {
  border-color: rgba(103, 230, 170, 0.55);
}

button.primary,
.button.primary {
  border-color: var(--mint);
  background: var(--mint);
  color: #07100d;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.list,
.health-list {
  display: grid;
  gap: 8px;
}

.list-item,
.health-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  padding: 11px;
}

.list-item {
  display: grid;
  gap: 5px;
  font-size: 12px;
}

.health-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.5fr) repeat(4, minmax(80px, 0.7fr)) minmax(150px, 1.2fr);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.health-row.rpc-health-row {
  grid-template-columns: minmax(210px, 1.8fr) repeat(5, minmax(80px, 0.7fr)) minmax(150px, 1.2fr);
}

.health-row.public-node-row {
  grid-template-columns: minmax(48px, 0.4fr) minmax(170px, 1.45fr) repeat(9, minmax(76px, 0.65fr)) minmax(150px, 1.25fr);
}

.health-row.success {
  border-color: rgba(103, 230, 170, 0.3);
}

.health-row.warn {
  border-color: rgba(243, 201, 105, 0.3);
}

.health-row.error {
  border-color: rgba(255, 136, 117, 0.3);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-button {
  min-height: 34px;
  color: var(--muted);
}

.filter-button.active {
  color: var(--mint);
  border-color: rgba(103, 230, 170, 0.4);
  background: rgba(103, 230, 170, 0.08);
}

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

.fee-preview > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  padding: 11px;
}

.fee-preview strong {
  display: block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.result {
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #050b09;
  color: var(--muted);
  padding: 12px;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.55;
}

.qr-box {
  min-height: 220px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  padding: 16px;
}

.qr-box img,
.qr-box canvas {
  max-width: 100%;
  background: #fff;
  border-radius: 7px;
  padding: 9px;
}

.hide {
  display: none !important;
}

.wallet-mobile-nav {
  display: none;
}

body[data-theme="light"] {
  --canvas: #edf3ef;
  --sidebar: #f4f8f5;
  --surface: #ffffff;
  --surface-2: #f4f8f5;
  --surface-3: #e7efe9;
  --line: #cad8d0;
  --line-soft: rgba(39, 63, 51, 0.1);
  --text: #122219;
  --muted: #586d62;
  --faint: #7d9187;
}

body[data-theme="light"] .topbar {
  background: rgba(237, 243, 239, 0.94);
}

body[data-theme="light"] .result {
  background: #e8efea;
}

@media (max-width: 1080px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .health-row,
  .health-row.rpc-health-row,
  .health-row.public-node-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    min-height: 58px;
    padding: 9px 12px;
  }

  .topline {
    grid-template-columns: 1fr;
  }

  .status-row {
    display: none;
  }

  .content {
    padding: 22px 14px 90px;
    gap: 18px;
  }

  .fee-preview {
    grid-template-columns: 1fr;
  }

  .wallet-mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    min-height: 64px;
    border-top: 1px solid var(--line);
    background: rgba(9, 20, 16, 0.97);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }

  .wallet-mobile-nav a {
    display: grid;
    place-items: center;
    gap: 3px;
    color: var(--faint);
    font-size: 9px;
    font-weight: 650;
  }

  .wallet-mobile-nav a.active {
    color: var(--mint);
  }

  .wallet-mobile-nav svg {
    width: 17px;
    height: 17px;
  }
}
