/* Riecoin Explorer. Same palette and type as riecoin.net. No inline styles anywhere (strict CSP). */
:root {
  color-scheme: dark;
  --bg: #040d0d; --bg2: #071414; --panel: #0a1919; --line: #142a2b; --line2: #224345;
  --text: #effaf8; --soft: #b2cbc8; --mute: #7a9795;
  --cyan: #40ffff; --yellow: #ffff80; --grad: linear-gradient(90deg, #40ffff, #ffff80); --ink: #03201f; --warn: #ffb37a;
  --sans: "Segoe UI Variable Display", "Segoe UI Variable", "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", "SF Mono", ui-monospace, Menlo, Consolas, "Roboto Mono", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
b, strong { font-weight: 600; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(1180px, 100% - 48px); margin-inline: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: var(--cyan); color: var(--ink); padding: 8px 14px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Header and search */
.top { position: sticky; top: 0; z-index: 20; background: rgba(4, 13, 13, .78); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.top-row { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; font-size: 18px; letter-spacing: -.01em; white-space: nowrap; }
.brand img { width: 34px; height: 34px; display: block; }
.brand i { font-style: normal; font-weight: 400; color: var(--mute); }
.nav { display: flex; gap: 26px; margin-left: auto; font-size: 15px; }
.nav a { color: var(--soft); text-decoration: none; white-space: nowrap; transition: color .15s; }
.nav a:hover, .nav a[aria-current] { color: var(--text); }

.searchbar { border-bottom: 1px solid var(--line); background: var(--bg2); }
.search { display: flex; gap: 10px; padding-block: 18px; }
.search input { flex: 1; min-width: 0; height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); font: 15px var(--mono); }
.search input::placeholder { color: var(--mute); font-family: var(--sans); }
.search input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(64, 255, 255, .14); }
.search button { height: 48px; padding: 0 24px; border: 0; border-radius: 12px; background: var(--grad); color: var(--ink); font: 650 15px var(--sans); cursor: pointer; }
.search button:hover { filter: brightness(1.08); }

.main { flex: 1; padding-block: 44px 88px; outline: none; }
.loading, .notice { color: var(--mute); padding: 48px 0; }
.error { margin-top: 8px; padding: 28px; border: 1px solid var(--line2); border-radius: 16px; background: var(--panel); }
.error h1 { font-size: 26px; letter-spacing: -.02em; }
.error p { margin-top: 10px; color: var(--soft); }
.error a { color: var(--yellow); }

/* Page heads */
.kicker { font: 500 12.5px/1 var(--mono); letter-spacing: .04em; color: var(--cyan); }
.title { margin-top: 12px; font-size: clamp(28px, 4.4vw, 44px); line-height: 1.05; letter-spacing: -.035em; font-weight: 650; }
.title em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--cyan); }
.sub { margin-top: 12px; color: var(--soft); max-width: 70ch; }
.hashline { margin-top: 14px; font: 13.5px/1.5 var(--mono); color: var(--soft); overflow-wrap: anywhere; }
.pager { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.pager a, .pager span { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border: 1px solid var(--line2); border-radius: 999px; font-size: 14px; text-decoration: none; color: var(--text); }
.pager a:hover { border-color: var(--cyan); color: var(--yellow); }
.pager span { color: var(--mute); border-color: var(--line); }
h2.h { margin: 56px 0 18px; font-size: 21px; letter-spacing: -.02em; font-weight: 650; }
h2.h small { margin-left: 10px; font: 400 13px var(--mono); color: var(--mute); }

/* Figures strip */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 18px; background: var(--panel); overflow: hidden; }
.stats > div { padding: 22px 24px; border-left: 1px solid var(--line); }
.stats > div:first-child { border-left: 0; }
.stats dt { font-size: 13px; color: var(--mute); }
.stats dd { margin-top: 6px; font: 500 24px/1.2 var(--mono); letter-spacing: -.02em; }
.stats dd small { display: block; margin-top: 6px; font: 400 12.5px/1.4 var(--sans); letter-spacing: 0; color: var(--mute); }

/* The prime constellation */
.prime { margin-top: 28px; padding: 28px; border: 1px solid var(--line2); border-radius: 20px; background:
  radial-gradient(120% 140% at 100% 0%, rgba(64, 255, 255, .09), rgba(64, 255, 255, 0) 55%), var(--panel); }
.prime-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.prime-head h2 { font-size: 19px; letter-spacing: -.015em; font-weight: 650; }
.prime-head p { font-size: 14px; color: var(--mute); }
.prime-head a { color: var(--yellow); text-decoration: none; }
.prime-n { margin-top: 18px; font: 14.5px/1.75 var(--mono); color: var(--soft); overflow-wrap: anywhere; }
.prime-n b { font-weight: 500; color: var(--text); background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.prime-n .lbl { color: var(--mute); }
.stars { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.stars li { padding: 8px 12px; border: 1px solid var(--line2); border-radius: 10px; font: 13.5px/1.2 var(--mono); color: var(--soft); background: rgba(4, 13, 13, .5); }
.stars li i { font-style: normal; color: var(--cyan); margin-right: 6px; }
.stars li b { font-weight: 500; color: var(--yellow); }
.prime-foot { margin-top: 16px; font-size: 13.5px; color: var(--mute); max-width: 78ch; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font: 500 12.5px var(--sans); color: var(--mute); padding: 0 14px 10px 0; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.table td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th.r, .table td.r { text-align: right; padding-right: 0; padding-left: 14px; }
.table tr:hover td { background: rgba(255, 255, 255, .018); }
.mono { font-family: var(--mono); }
.dim { color: var(--mute); }
.link { color: var(--yellow); text-decoration: none; overflow-wrap: anywhere; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.trunc { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.scroll { overflow-x: auto; }

/* Definition grid for details */
.facts { display: grid; grid-template-columns: 200px minmax(0, 1fr); border-top: 1px solid var(--line2); margin-top: 28px; }
.facts dt, .facts dd { padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--mute); font-size: 14.5px; }
.facts dd { font: 14.5px/1.55 var(--mono); overflow-wrap: anywhere; }
.facts dd.plain { font-family: var(--sans); }

/* Transaction inputs and outputs */
.io { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); gap: 0 12px; align-items: start; }
.io .arrow { text-align: center; padding-top: 14px; color: var(--cyan); font-size: 20px; }
.io ul { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.io li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); font: 13.5px/1.5 var(--mono); }
.io li:last-child { border-bottom: 0; }
.io li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.io li > span:last-child { white-space: nowrap; color: var(--text); }
.io .tag { color: var(--mute); }

.badge { display: inline-block; margin-left: 10px; padding: 3px 10px; border-radius: 999px; font: 500 12px/1.5 var(--sans); vertical-align: middle; border: 1px solid var(--line2); color: var(--soft); }
.badge.warn { border-color: rgba(255, 179, 122, .5); color: var(--warn); }
.badge.ok { border-color: rgba(64, 255, 255, .4); color: var(--cyan); }
.callout { margin-top: 24px; padding: 18px 20px; border: 1px solid rgba(255, 179, 122, .35); border-radius: 14px; color: var(--soft); background: rgba(255, 179, 122, .05); }
.callout b { color: var(--warn); }
.note { margin-top: 18px; font-size: 13.5px; color: var(--mute); max-width: 78ch; }

.groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.group { padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.group h3 { font-size: 18px; letter-spacing: -.015em; }
.group .why { margin-top: 4px; font-size: 13.5px; color: var(--mute); }
.group .amt { margin-top: 14px; font: 500 22px var(--mono); }
.group .amt small { font: 400 13px var(--sans); color: var(--mute); margin-left: 8px; }
.group ol { margin-top: 14px; border-top: 1px solid var(--line); }
.group ol li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font: 13px/1.5 var(--mono); }
.group ol li:last-child { border-bottom: 0; }
.group ol li > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group ol li > :last-child { white-space: nowrap; }

.foot { border-top: 1px solid var(--line); padding: 24px 0; font-size: 14px; color: var(--mute); }
.foot-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--soft); }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .io { grid-template-columns: minmax(0, 1fr); }
  .io .arrow { padding: 6px 0; transform: rotate(90deg); }
  .groups { grid-template-columns: minmax(0, 1fr); }
  .hide-s { display: none; }
}
@media (max-width: 680px) {
  .wrap { width: min(1180px, 100% - 36px); }
  .top-row { flex-wrap: wrap; height: auto; padding-block: 12px; gap: 8px 20px; }
  .nav { margin-left: 0; width: 100%; gap: 20px; overflow-x: auto; padding-bottom: 2px; }
  .search button { padding: 0 16px; }
  .main { padding-block: 32px 64px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dt { border-bottom: 0; padding-bottom: 0; }
  .facts dd { padding-top: 4px; }
  .prime { padding: 20px; }
  .stats dd { font-size: 20px; }
  .hide-xs { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
