/* Same visual language as apps/explorer/web/index.html's inline stylesheet (the mini explorer this
   app succeeds), lifted into its own file since this app has more than one HTML entry point of
   markup (multiple views, all client-rendered into #view) and richer views (spec item 3). */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-alt: #f4f5f7;
  --fg: #14171a;
  --fg-muted: #56606a;
  --border: #d8dce1;
  --card-bg: #fbfbfc;
  --code-bg: #eef0f3;
  --link: #1a5fb4;
  --ok: #1e7d32;
  --ok-bg: #e8f5e9;
  --warn: #9a5b00;
  --warn-bg: #fff3e0;
  --err: #a11414;
  --err-bg: #fdecea;
  --load: #56606a;
  --load-bg: #eef0f3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --bg-alt: #1b1f23;
    --fg: #e6e8eb;
    --fg-muted: #9aa4ae;
    --border: #2e343a;
    --card-bg: #1b1f23;
    --code-bg: #22272c;
    --link: #7cb0f2;
    --ok: #7fd68a;
    --ok-bg: #123420;
    --warn: #e0b04a;
    --warn-bg: #3a2c0c;
    --err: #f28b82;
    --err-bg: #3a1616;
    --load: #9aa4ae;
    --load-bg: #22272c;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  max-width: 1040px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
code, .mono { word-break: break-all; }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.88em; }
pre {
  background: var(--code-bg);
  padding: 0.75rem 0.9rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0.5rem 0;
}

header { display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1rem; }
h1 { font-size: 1.4rem; margin: 0; letter-spacing: -0.2px; }
h1 a { color: var(--fg); }
h1 a:hover { text-decoration: none; color: var(--link); }
h2 { font-size: 1.05rem; margin: 2rem 0 0.75rem; border-top: 1px solid var(--border); padding-top: 1.25rem; }
.chip {
  font: 0.78rem var(--mono, ui-monospace, monospace);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  background: var(--bg-alt);
}
.chip.network-badge { color: var(--fg); font-weight: 600; }
.navlink { font-size: 0.85rem; margin-left: auto; }

/* Language toggle (js/i18n.js) : two buttons sharing the .chip look, the active one highlighted. */
.lang-toggle { display: flex; gap: 0.25rem; }
.lang-toggle button {
  font: inherit;
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--fg-muted);
  cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] { color: var(--fg); border-color: var(--link); font-weight: 600; }

/* Epoch budget bar (js/views/home.js's epoch card, spec item 3). */
.progress { height: 0.5rem; border-radius: 999px; background: var(--code-bg); overflow: hidden; margin-top: 0.35rem; }
.progress > span { display: block; height: 100%; background: var(--link); }

.searchbar { display: flex; gap: 0.5rem; margin: 0.5rem 0 1.5rem; }
.searchbar input {
  flex: 1;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--fg);
  min-width: 0;
}
.searchbar button, .toolbar button, .load-more {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--fg);
  cursor: pointer;
}
.searchbar button:hover, .toolbar button:hover, .load-more:hover { border-color: var(--link); }
.load-more { margin: 0.6rem 0; }
.load-more:disabled { opacity: 0.6; cursor: default; }

.box { border: 1px solid var(--border); background: var(--bg-alt); border-radius: 8px; padding: 1rem 1.1rem; font-size: 0.92rem; margin: 1rem 0; }
.box.notice { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }
.muted { color: var(--fg-muted); }

.card { border: 1px solid var(--border); background: var(--card-bg); border-radius: 10px; padding: 1.1rem 1.25rem 1.3rem; margin: 1rem 0; }

/* Proof trail chain (web/js/views/trail.js) : one maillon per step, each carrying its own network
   badge. Left border echoes .box's visual language without competing with .card's own use elsewhere. */
.chain-step { border-left: 3px solid var(--border); padding: 0.1rem 0 0.1rem 1rem; margin: 1.25rem 0; }
.chain-step-head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.chain-step .card { margin: 0.6rem 0; }

.infogrid { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; font-size: 0.9rem; }
.infogrid dt { color: var(--fg-muted); }
.infogrid dd { margin: 0; }

table.list { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.list th { text-align: left; color: var(--fg-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border); }
table.list td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list tr.nonempty td:first-child { border-left: 3px solid var(--ok); }
table.list tr.link-row { cursor: pointer; }
table.list tr.link-row:hover { background: var(--bg-alt); }

.badge { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--load-bg); color: var(--load); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.err { background: var(--err-bg); color: var(--err); }
.badge.count { background: var(--code-bg); color: var(--fg-muted); }

details { margin-top: 0.6rem; font-size: 0.85rem; }
summary { cursor: pointer; color: var(--fg-muted); }
summary:hover { color: var(--fg); }

details.section { margin-top: 0; font-size: inherit; }
details.section > summary.section-title {
  list-style: none;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  margin: 2rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
details.section > summary.section-title::-webkit-details-marker { display: none; }
details.section[open] > summary.section-title { margin-bottom: 0.75rem; }

footer { color: var(--fg-muted); font-size: 0.82rem; margin-top: 3rem; border-top: 1px solid var(--border); padding-top: 1rem; }

/* ------------------------------------------------------------------------------------------------
   #/receipt and the Mainnet home entry (web/js/views/receipt.js, apodix:ux-recu, 25/09/2026).
   Mobile first : every rule below holds at 360 px with no horizontal scroll (no fixed width over
   360, long hashes break anywhere). Scale values follow the Vauban Design Language by VALUE (radius
   8/12/16, 200 ms decelerate, reduced motion honored) ; the explorer does not load the VDL package
   itself (vanilla, no bundler), and copying its token file into a consumer is what VDL forbids.
   Tones : a text label always carries the state, the color only repeats it (WCAG 1.4.1).
   ------------------------------------------------------------------------------------------------ */
:root {
  --rc-radius: 12px;
  --rc-radius-lg: 16px;
  --rc-ease: cubic-bezier(0, 0, 0.2, 1);
  --rc-partial: #1a5fb4;
  --rc-partial-bg: #eaf1fb;
  --rc-none: #4a535c;
  --rc-none-bg: #eef0f3;
  --rc-line: #d8dce1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --rc-partial: #8dbcf5;
    --rc-partial-bg: #16263a;
    --rc-none: #b3bcc5;
    --rc-none-bg: #22272c;
    --rc-line: #2e343a;
  }
}
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.rc { max-width: 42rem; }
.rc-title, .rc-hero-title { font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0.25rem 0 0.5rem; border-top: none; padding-top: 0; }
.rc-lead { color: var(--fg-muted); margin: 0 0 1.25rem; font-size: 1rem; }
.rc-hero { margin: 0 0 1.5rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--rc-radius-lg); background: var(--card-bg); }
.rc-hero .rc-hero-title { font-size: 1.35rem; margin-top: 0; }

/* Entry : one field, one button, a two-choice network switch. 16px input text : iOS does not zoom. */
.rc-entry { margin: 0 0 1.5rem; }
.rc-entry-label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.4rem; }
.rc-entry-row { display: flex; gap: 0.5rem; }
.rc-entry input[type="text"], .rc-field input {
  flex: 1; min-width: 0; width: 100%;
  font: inherit; font-size: 16px; line-height: 1.3;
  min-height: 48px; padding: 0.7rem 0.85rem;
  border-radius: var(--rc-radius); border: 1px solid var(--border);
  background: var(--bg); color: var(--fg);
  transition: border-color 200ms var(--rc-ease), box-shadow 200ms var(--rc-ease);
}
.rc-entry input[type="text"]:focus, .rc-field input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 25%, transparent); }
.rc-entry input[aria-invalid="true"] { border-color: var(--err); }
.rc-button, .rc-button-secondary {
  font: inherit; font-weight: 600; font-size: 1rem;
  min-height: 48px; padding: 0 1.2rem; border-radius: var(--rc-radius);
  cursor: pointer; white-space: nowrap;
  transition: background 200ms var(--rc-ease), border-color 200ms var(--rc-ease);
}
.rc-button { border: 1px solid var(--link); background: var(--link); color: var(--bg); }
.rc-button:hover { filter: brightness(1.08); }
.rc-button-secondary { border: 1px solid var(--border); background: var(--bg-alt); color: var(--fg); }
.rc-button-secondary:hover { border-color: var(--link); }
.rc-entry-err { color: var(--err); font-size: 0.9rem; margin: 0.4rem 0 0; min-height: 0; }
.rc-entry-err:empty { display: none; }
.rc-net { border: none; padding: 0; margin: 0.75rem 0 0; display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.rc-net legend { float: left; font-size: 0.85rem; color: var(--fg-muted); margin-right: 0.5rem; padding: 0; }
.rc-net label { position: relative; }
.rc-net input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.rc-net span {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 0.9rem;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg-alt);
  color: var(--fg-muted); font-size: 0.88rem;
}
.rc-net input:checked + span { color: var(--fg); border-color: var(--link); font-weight: 600; background: var(--bg); }
.rc-net input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }
.rc-pair { margin-top: 0.9rem; font-size: 0.92rem; }
.rc-pair > summary { min-height: 44px; display: flex; align-items: center; color: var(--link); }
.rc-field { margin: 0.6rem 0; }
.rc-field label { display: block; font-size: 0.85rem; color: var(--fg-muted); margin-bottom: 0.25rem; }
.rc-pair .rc-button-secondary { margin-top: 0.25rem; }

/* Loading : three dots, no layout jump ; still under reduced motion. */
.rc-loading { display: flex; gap: 0.4rem; padding: 1.5rem 0; }
.rc-loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-muted); animation: rc-pulse 1s var(--rc-ease) infinite; }
.rc-loading span:nth-child(2) { animation-delay: 0.15s; }
.rc-loading span:nth-child(3) { animation-delay: 0.3s; }
@keyframes rc-pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* Tones. */
.tone-ok { --tone: var(--ok); --tone-bg: var(--ok-bg); }
.tone-partial, .tone-wait { --tone: var(--rc-partial); --tone-bg: var(--rc-partial-bg); }
.tone-none, .tone-external { --tone: var(--rc-none); --tone-bg: var(--rc-none-bg); }
.tone-unknown { --tone: var(--warn); --tone-bg: var(--warn-bg); }
.tone-err { --tone: var(--err); --tone-bg: var(--err-bg); }

/* The verdict. */
.rc-verdict {
  border-radius: var(--rc-radius-lg); padding: 1.25rem 1.25rem 1.1rem;
  background: var(--tone-bg); border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent);
  margin: 0 0 1.75rem; animation: rc-in 300ms var(--rc-ease);
}
.rc-verdict:focus { outline: none; }
.rc-verdict:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.rc-verdict-head { display: flex; align-items: center; gap: 0.55rem; color: var(--tone); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.01em; }
.rc-verdict-mark { display: inline-flex; width: 32px; height: 32px; border-radius: 50%; align-items: center; justify-content: center; background: var(--tone); color: var(--tone-bg); flex: none; }
.rc-verdict-mark .rc-icon { width: 20px; height: 20px; }
.rc-verdict-title { font-size: 1.3rem; line-height: 1.3; letter-spacing: -0.01em; margin: 0.7rem 0 0.4rem; color: var(--fg); overflow-wrap: anywhere; }
.rc-verdict-meaning { margin: 0 0 0.6rem; color: var(--fg); }
.rc-verdict-scope { margin: 0; font-size: 0.85rem; color: var(--fg-muted); overflow-wrap: anywhere; }
.rc-verdict-action { margin: 0.8rem 0 0; }
.rc-nowrap { white-space: nowrap; word-break: normal; }
.rc-verdict-action a { font-weight: 600; }
/* Transform only, never opacity : a paused or throttled animation must never leave the verdict faded. */
@keyframes rc-in { from { transform: translateY(6px); } to { transform: none; } }

/* The steps : a vertical timeline, marker then text ; the connecting line sits under the markers. */
.rc-section-title { font-size: 1.05rem; margin: 0 0 0.9rem; border-top: none; padding-top: 0; }
.rc-steps { list-style: none; margin: 0 0 1.75rem; padding: 0; }
.rc-step { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 0.85rem; padding-bottom: 1.15rem; }
.rc-step::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; border-radius: 1px; background: var(--rc-line); }
.rc-step:last-child { padding-bottom: 0; }
.rc-step:last-child::before { display: none; }
.rc-step-mark { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--tone-bg); color: var(--tone); border: 1.5px solid var(--tone); }
.rc-step-mark .rc-icon { width: 16px; height: 16px; }
.rc-step-body { min-width: 0; }
.rc-step-head { display: flex; align-items: baseline; gap: 0.2rem 0.6rem; flex-wrap: wrap; min-height: 28px; }
.rc-step-title { font-size: 1rem; margin: 0; font-weight: 600; }
.rc-step-state { font-size: 0.8rem; font-weight: 600; color: var(--tone); background: var(--tone-bg); padding: 0.1rem 0.55rem; border-radius: 999px; }
.rc-step-why { margin: 0.2rem 0 0; color: var(--fg); font-size: 0.92rem; overflow-wrap: anywhere; }
.rc-step-line, .rc-step-note { margin: 0.2rem 0 0; color: var(--fg-muted); font-size: 0.92rem; overflow-wrap: anywhere; }
.rc-proof { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.3rem; min-height: 44px; margin-top: 0.1rem; font-size: 0.92rem; font-weight: 500; }
.rc-proof-hash { color: var(--fg-muted); font-size: 0.82rem; white-space: nowrap; word-break: normal; }
.rc-icon-sm { width: 14px; height: 14px; }
.rc-proof-none { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--fg-muted); font-style: italic; }

/* What the receipt does not assert : reading size, a quiet frame, never small print. */
.rc-limits { border-left: 3px solid var(--border); padding: 0.1rem 0 0.1rem 1rem; margin: 0 0 1.75rem; }
.rc-limits p, .rc-limits li { margin: 0 0 0.5rem; font-size: 0.95rem; overflow-wrap: anywhere; }
.rc-limits ul { margin: 0 0 0.6rem; padding-left: 1.2rem; }

/* Technical details : folded by default, each value copyable. */
.rc-tech { margin: 0 0 1rem; border: 1px solid var(--border); border-radius: var(--rc-radius); background: var(--card-bg); font-size: 0.92rem; }
.rc-tech > summary { min-height: 48px; display: flex; align-items: center; padding: 0 1rem; font-weight: 600; color: var(--fg); }
.rc-tech[open] > summary { border-bottom: 1px solid var(--border); }
.rc-tech-hint { margin: 0.8rem 1rem; color: var(--fg-muted); font-size: 0.85rem; }
.rc-tech-sub { margin: 1rem 1rem 0.2rem; font-size: 0.9rem; }
.rc-kvs { margin: 0; padding: 0 1rem 0.6rem; }
.rc-kv { padding: 0.55rem 0; border-top: 1px solid var(--border); }
.rc-kv:first-child { border-top: none; }
.rc-kv dt { font-size: 0.8rem; color: var(--fg-muted); margin-bottom: 0.15rem; }
.rc-kv dd { margin: 0; display: flex; align-items: flex-start; gap: 0.5rem; overflow-wrap: anywhere; }
.rc-kv-value { flex: 1; min-width: 0; word-break: break-all; font-size: 0.84rem; }
.rc-copy {
  flex: none; font: inherit; font-size: 0.8rem; font-weight: 600;
  min-height: 32px; min-width: 64px; padding: 0 0.7rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--link); cursor: pointer;
}
.rc-copy:hover { border-color: var(--link); }
.rc-copy.is-done { color: var(--ok); border-color: var(--ok); }

@media (min-width: 640px) {
  .rc-title { font-size: 1.9rem; }
  .rc-verdict { padding: 1.5rem 1.6rem 1.35rem; }
  .rc-verdict-title { font-size: 1.5rem; }
  .rc-kv { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 1rem; }
}
@media (max-width: 380px) {
  body { padding-left: 1rem; padding-right: 1rem; }
  .rc-entry-row { flex-direction: column; }
  .rc-button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .rc-verdict { animation: none; }
  .rc-loading span { animation: none; opacity: 0.6; }
  .rc-entry input[type="text"], .rc-button, .rc-button-secondary { transition: none; }
}
