:root {
  --bg: #080c12;
  --panel: #0d141d;
  --line: #1c2734;
  --text: #e3ecf6;
  --muted: #8598ad;
  --dim: #5b6e83;
  --accent: #2fe3a5;
  --warn: #f0b542;
  --bad: #ff5b6e;
  --bad-bg: #1a0a10;
  --bad-line: #5c1f2b;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { background: var(--bg); }

body {
  margin: 0;
  color: var(--text);
  min-height: 100vh;
  font: 400 15px/1.5 "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: radial-gradient(700px 320px at 50% -140px, #10202b, var(--bg));
  padding-bottom: 28px;
}

/* ------------------------------------------------------------------ top bar */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.92);
  backdrop-filter: blur(10px);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent);
  color: #04231a;
  font-size: 22px;
  font-weight: 700;
}

.wordmark {
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.bar-actions { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }

/* Narrow phones: the brand keeps its full name on its own row rather than being
   clipped, with the controls right-aligned underneath. */
@media (max-width: 430px) {
  .bar { flex-wrap: wrap; row-gap: 8px; padding: 12px 12px 10px; }
  .brand { flex: 1 1 100%; }
  .bar-actions { flex: 1 1 100%; justify-content: flex-end; }
  .mark { width: 34px; height: 34px; flex-basis: 34px; font-size: 19px; border-radius: 9px; }
  .wordmark { font-size: 13px; letter-spacing: 0.1em; }
  .menu { top: 106px; }
}

.pill {
  font: 600 10px/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}
.pill.ok { color: var(--accent); border-color: rgba(47, 227, 165, 0.45); }
.pill.bad { color: var(--bad); border-color: var(--bad-line); }
.pill.warn { color: var(--warn); border-color: rgba(240, 181, 66, 0.4); }
.pill-quiet { color: #6b7f94; border-color: #24313f; cursor: pointer; }

.menu-btn {
  width: 38px;
  height: 34px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  border: 1px solid #24313f;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}
.menu-btn span { display: block; width: 15px; height: 1.5px; background: var(--muted); }

.menu[hidden] { display: none; }

.menu {
  position: sticky;
  top: 69px;
  z-index: 19;
  display: grid;
  gap: 2px;
  padding: 10px 14px 14px;
  background: #0b121a;
  border-bottom: 1px solid var(--line);
}
.menu a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  padding: 10px 8px;
  border-radius: 8px;
}
.menu a:active { background: #13202c; }

/* --------------------------------------------------------------------- body */

main {
  display: grid;
  gap: 14px;
  padding: 14px;
  max-width: 560px;
  margin: 0 auto;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.card h2 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* status card: the shape from the previous app, kept for the failure state */
.status { border-radius: 12px; }
.status.ok {
  border: 1px solid rgba(47, 227, 165, 0.28);
  background: #08150f;
  padding: 12px 14px;
  font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #8fe0c2;
}
.status.bad {
  border: 1px solid var(--bad-line);
  background: var(--bad-bg);
  padding: 14px;
  font: 12px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #ff8291;
}
.status.bad .line { word-break: break-word; }
.status.bad .dim { color: #b3897f; }
.status .btn { margin-top: 12px; }

/* hero */
.hero { padding: 18px 16px; background: linear-gradient(165deg, #101c27, var(--panel)); }
.eyebrow { margin: 0; font-size: 10px; letter-spacing: 0.15em; color: var(--dim); }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 4px; }
.hero-value {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.note { margin: 0; color: var(--muted); font-size: 12.5px; }
.note.err, .err { color: var(--bad); }

.btn {
  border: 0;
  border-radius: 9px;
  padding: 10px 14px;
  background: var(--accent);
  color: #04231a;
  font: 600 13px/1 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-quiet { background: #16222e; color: #cfe0ef; border: 1px solid #24313f; }

/* wallet stack */
.stack { display: grid; gap: 14px; }
.cells { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cell dt { color: var(--dim); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.cell dd { margin: 3px 0 0; font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.prov { margin: 2px 0 0; font: 9.5px/1.5 ui-monospace, monospace; color: #4f6276; word-break: break-all; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 12px 0 0; }
.facts dt { color: var(--dim); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.facts dd { margin: 2px 0 0; font: 12px/1.4 ui-monospace, monospace; word-break: break-all; }

/* checks */
.checks { list-style: none; margin: 10px 0 12px; padding: 0; display: grid; gap: 6px; }
.checks li {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 8px;
  align-items: baseline;
  font-size: 12.5px;
  border-bottom: 1px solid rgba(28, 39, 52, 0.7);
  padding-bottom: 6px;
}
.checks .id { font: 11px ui-monospace, monospace; color: var(--dim); }
.checks .res { font: 600 10px/1 ui-sans-serif; letter-spacing: 0.08em; }
.checks .pass { color: var(--accent); }
.checks .fail { color: var(--bad); }
.checks .skip { color: var(--dim); }

.foot {
  max-width: 560px;
  margin: 6px auto 0;
  padding: 0 14px;
  display: grid;
  gap: 4px;
  color: #4a5c6f;
  font-size: 10.5px;
  font-family: ui-monospace, monospace;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 18px;
  margin: 0 auto;
  max-width: 520px;
  background: #16222e;
  border: 1px solid #24313f;
  color: #d5e3f0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

@media (min-width: 620px) {
  main { max-width: 760px; }
  .stack { grid-template-columns: 1fr 1fr; }
  .hero-value { font-size: 50px; }
  .foot { max-width: 760px; }
}
