/* Bithex explorer. Money Harbor's light palette: white cards on a pale page,
   navy for what you can press, brass for labels, hairlines instead of boxes. */
@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/vazirmatn-arabic-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/vazirmatn-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --page: #f7f8f9; --card: #ffffff; --raise: #f3f4f6;
  --rule: #e2e7eb; --hair: #edf0f2; --edge: #d3d9dd;
  --ink: #101825; --muted: #525c63;
  --navy: #0b2b5b; --navy-strong: #08214a; --navy-tint: #e8edf5;
  --brass: #7d6331; --brass-line: #c2a468; --bone: #f6f1e6;
  --up: #0a7658; --up-tint: #e3f2ec; --down: #b42318; --wait: #8f5b12; --wait-tint: #f8eedc;
  --dot: #3c4650; --ring: #8b949b; --line: rgba(16, 24, 37, 0.13);
  --font-body: "Vazirmatn", Tahoma, system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page); color: var(--ink); font-family: var(--font-body);
  font-size: 15px; line-height: 1.75; -webkit-text-size-adjust: 100%;
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 5; }
.skip:focus { top: 12px; }
code, .mono { font-family: var(--font-mono); font-size: 0.86em; direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }

/* --- header */
.top { background: var(--card); border-bottom: 1px solid var(--rule); }
.bar {
  max-width: 1180px; margin: 0 auto; min-height: 68px; display: flex; align-items: center; gap: 18px;
  padding-inline: max(16px, env(safe-area-inset-left, 0px));
}
.mark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); min-height: 44px; }
.mark:hover { text-decoration: none; }
.hex { width: 22px; height: 24px; background: var(--navy); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); position: relative; }
.hex::after { content: ""; position: absolute; inset: 7px 6px; background: var(--card); border-radius: 50%; }
.word { font-family: var(--font-mono); font-weight: 500; font-size: 19px; letter-spacing: -0.01em; }
.sub { color: var(--muted); font-size: 13px; padding-inline-start: 10px; border-inline-start: 1px solid var(--rule); }
.search { flex: 1; display: flex; max-width: 560px; margin-inline-start: auto; }
.search input {
  flex: 1; min-width: 0; height: 44px; border: 1px solid var(--edge); border-inline-end: 0;
  border-start-start-radius: 12px; border-end-start-radius: 12px; padding-inline: 14px;
  font: inherit; font-size: 14px; color: var(--ink); background: var(--card);
}
.search input::placeholder { color: #6b747b; }
.search input:focus-visible { outline: none; border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy-tint); }
.search button {
  width: 48px; height: 44px; border: 0; background: var(--navy); color: #fff; cursor: pointer;
  border-start-end-radius: 12px; border-end-end-radius: 12px; display: grid; place-items: center;
}
.search button:hover { background: var(--navy-strong); }
.search svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.side { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.side a { min-height: 44px; display: inline-flex; align-items: center; padding-inline: 10px; border-radius: 10px; }
.side a:hover { background: var(--raise); text-decoration: none; }
.strip {
  margin: 0; background: var(--bone); border-top: 1px solid #eadfca; color: var(--brass);
  font-size: 13px; text-align: center; padding: 7px 16px; line-height: 1.6;
}

/* --- page */
main { max-width: 1180px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-left, 0px)) 40px; display: grid; gap: 22px; outline: none; }
.wait, .empty { color: var(--muted); margin: 0; }
.eyebrow { font-size: 12px; color: var(--brass); font-weight: 500; margin: 0 0 4px; }
html[lang="en"] .eyebrow { letter-spacing: 0.2em; text-transform: uppercase; font-size: 11px; }
h1 { margin: 0; font-weight: 460; font-size: clamp(24px, 4vw, 34px); line-height: 1.35; }
h2 { margin: 0; font-weight: 500; font-size: 16px; }
.lead { margin: 6px 0 0; max-width: 70ch; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 22px; min-width: 0; }
.card > header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.card > header a, .card > header span { font-size: 13px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.full { word-break: break-all; font-size: clamp(13px, 2.2vw, 16px); line-height: 1.6; }

/* stats: one card, hairlines between, no boxes inside */
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 0; }
.stats > div { padding: 16px 18px; border-inline-start: 1px solid var(--hair); display: grid; gap: 2px; }
.stats > div:first-child { border-inline-start: 0; }
.stats span { font-size: 12px; color: var(--muted); }
.stats b { font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; }
.stats b small { font-size: 12px; font-weight: 400; color: var(--muted); }
.pulse::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--up); margin-inline-end: 7px; vertical-align: 2px; }
.pulse.stale::before { background: var(--wait); }

/* the graph */
.stage { position: relative; height: min(56vh, 520px); min-height: 320px; padding: 0; overflow: hidden; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: manipulation; }
.stage .cap { position: absolute; inset-inline-start: 16px; bottom: 10px; font-size: 12px; color: var(--muted); background: rgba(255, 255, 255, 0.86); padding: 2px 8px; border-radius: 8px; }
.tip {
  position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
  padding: 8px 11px; font-size: 12px; line-height: 1.7; max-width: 260px; box-shadow: 0 8px 24px rgba(16, 24, 37, 0.08);
}
.tip[hidden] { display: none; }

/* rows: lists that stay readable at any width */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; gap: 4px 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--hair); min-height: 48px; }
.rows li:first-child { border-top: 0; }
.rows .k { color: var(--muted); font-size: 13px; }
.rows.blocks li { grid-template-columns: 5.5em 1fr auto auto; }
.rows.txs li { grid-template-columns: 1fr auto auto; }
.rows.hist li { grid-template-columns: 1fr auto auto; }
.rows .end { text-align: end; }
.rows .meta { color: var(--muted); font-size: 13px; }
.in { color: var(--up); }
.out { color: var(--down); }

/* definition lists */
.dl { display: grid; grid-template-columns: minmax(9em, 14em) 1fr; margin: 0; }
.dl dt, .dl dd { padding: 11px 0; border-top: 1px solid var(--hair); margin: 0; min-width: 0; }
.dl dt { color: var(--muted); font-size: 14px; }
.dl dd { overflow-wrap: anywhere; }
.dl dt:first-of-type, .dl dt:first-of-type + dd { border-top: 0; }

/* transaction flow */
.flow { display: grid; grid-template-columns: 1fr 34px 1fr; gap: 0 10px; align-items: start; }
.flow .arrow { align-self: center; justify-self: center; color: var(--brass-line); font-size: 22px; }
html[dir="rtl"] .flow .arrow { transform: scaleX(-1); }
.io { display: grid; gap: 8px; }
.io > div { border: 1px solid var(--hair); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; background: var(--card); }
.io .amt { font-weight: 500; font-variant-numeric: tabular-nums; }
.io .note { font-size: 12px; color: var(--muted); }

.status { margin: 0 0 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.lead.flat { margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; border-radius: 999px; padding: 3px 12px; }
.pill.ok { background: var(--up-tint); color: var(--up); }
.pill.wait { background: var(--wait-tint); color: var(--wait); }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; }
.tiles > div { padding: 16px 18px; border-inline-start: 1px solid var(--hair); display: grid; gap: 2px; }
.tiles > div:first-child { border-inline-start: 0; }
.tiles span { font-size: 12px; color: var(--muted); }
.tiles b { font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.copy {
  font: inherit; font-size: 13px; color: var(--navy); background: var(--card); border: 1px solid var(--edge);
  border-radius: 10px; min-height: 36px; padding: 0 12px; cursor: pointer; margin-top: 8px;
}
.copy:hover { background: var(--raise); }
.step { display: inline-flex; gap: 6px; }
.step a, .step span { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; border: 1px solid var(--edge); border-radius: 12px; background: var(--card); font-size: 18px; }
.step span { color: var(--edge); }
.step a:hover { background: var(--raise); text-decoration: none; }
html[dir="rtl"] .step .flip { transform: scaleX(-1); }
.keys { display: grid; gap: 4px; }
.keys code { font-size: 12px; word-break: break-all; color: var(--muted); }
.lost { text-align: center; padding: 48px 22px; }
.lost p { color: var(--muted); max-width: 52ch; margin: 8px auto 18px; }

.foot { max-width: 1180px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left, 0px)) 32px; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats > div:nth-child(4) { border-inline-start: 0; }
  .stats > div:nth-child(n + 4) { border-top: 1px solid var(--hair); }
  .cols { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles > div:nth-child(3) { border-inline-start: 0; }
  .tiles > div:nth-child(n + 3) { border-top: 1px solid var(--hair); }
}
@media (max-width: 720px) {
  .bar { flex-wrap: wrap; gap: 6px 12px; padding-block: 8px 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .side { margin-inline-start: auto; }
  .flow { grid-template-columns: 1fr; gap: 8px; }
  .flow .arrow { transform: rotate(90deg); }
  html[dir="rtl"] .flow .arrow { transform: rotate(90deg); }
  .dl { grid-template-columns: 1fr; }
  .dl dt { padding-bottom: 0; }
  .dl dd { border-top: 0; padding-top: 2px; }
  .rows.blocks li { grid-template-columns: 1fr auto; }
  .rows.blocks .hide-s { display: none; }
  .rows.blocks .end { grid-column: 1 / -1; text-align: start; }
}
@media (max-width: 460px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(4) { border-inline-start: 1px solid var(--hair); }
  .stats > div:nth-child(odd) { border-inline-start: 0; }
  .stats > div:nth-child(n + 3) { border-top: 1px solid var(--hair); }
  .sub { display: none; }
  .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
