/* No Rush · design system: iridescent security paper, matched to the selected key logo.
   Default theme "uv": ink-indigo paper, pearl-lilac foil, ice-blue guilloche and soft violet fibres.
   Theme "day": the same paper printed in daylight. Page CSS lives in css/<page>.css. */

/* ---------------------------------------------------------------- fonts (self-hosted, OFL; web/vendor/LICENSES.txt)
   English draws Latin from the bundled faces: "NR Sans" (Inter) for text, "NR Display EN" (Fraunces) for display
   type, "NR Mono" (IBM Plex Mono) for labels and numbers; each covers curly quotes, dashes and the ellipsis, so they
   never fall through to a CJK face. Chinese keeps the CJK-first stacks below: its punctuation (“” …… ——) must come
   from the CJK faces, so the Latin-only "NR Display" stops at U+00FF. */
@font-face { font-family: "NR Sans"; src: url("/vendor/fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "NR Display EN"; src: url("/vendor/fonts/fraunces-latin-opsz.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0020-007E, U+00A0-00FF, U+2010-2027, U+2030-203A; }
@font-face { font-family: "NR Display EN"; src: url("/vendor/fonts/fraunces-latin-opsz-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; unicode-range: U+0020-007E, U+00A0-00FF, U+2010-2027, U+2030-203A; }
@font-face { font-family: "NR Display"; src: url("/vendor/fonts/fraunces-latin-opsz.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0020-007E, U+00A0-00FF; }
@font-face { font-family: "NR Display"; src: url("/vendor/fonts/fraunces-latin-opsz-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; unicode-range: U+0020-007E, U+00A0-00FF; }
@font-face { font-family: "NR Mono"; src: url("/vendor/fonts/ibm-plex-mono-latin-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "NR Mono"; src: url("/vendor/fonts/ibm-plex-mono-latin-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "NR Mono"; src: url("/vendor/fonts/ibm-plex-mono-latin-600.woff2") format("woff2"); font-weight: 600 900; font-style: normal; font-display: swap; }

:root {
  /* Chinese (and the first paint before the language is known): CJK faces first */
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Latin in the serif comes from the vendored Fraunces ("NR Display", Latin only), CJK from the system Song faces */
  --font-serif: "NR Display", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", Georgia, "Times New Roman", serif;
  /* one monospace everywhere (labels, chips, numbers); CJK inside a mono label falls back to a clean sans */
  --font-mono: "NR Mono", ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", "Roboto Mono", Consolas, "PingFang SC", "Microsoft YaHei", monospace;
  --nr-mono: "NR Mono", var(--font-mono);
  --nr-display: "NR Display", var(--font-serif);
  --r: 2px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --t-fast: 160ms;
  --t-med: 420ms;
}
/* English: the bundled Latin faces first (applyI18n and the boot script in index.html set <html lang>) */
:root:lang(en) {
  --font-sans: "NR Sans", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "NR Display EN", Georgia, "Times New Roman", "Songti SC", "Noto Serif CJK SC", "Microsoft YaHei", serif;
}

:root,
:root[data-theme="uv"] {
  color-scheme: dark;
  --bg: #0a0818;
  --bg-2: #100d26;
  --bg-3: #19133b;
  --plate: rgba(174, 156, 221, .045);
  --plate-2: rgba(174, 156, 221, .08);
  --ink: #f1efff;
  --ink-2: #d3cdea;
  --muted: #aaa1c9;
  --line: rgba(175, 158, 219, .18);
  --line-2: rgba(175, 158, 219, .32);
  --cyan: #a9dfea;
  --magenta: #b7a0e6;
  --green: #a7d8c9;
  --amber: #dfcba3;
  --seal: #e58cb4;
  /* Deeper rose keeps white action labels readable against the softer brand palette. */
  --seal-btn: #8c456f;
  --accent: var(--cyan);
  --accent-2: var(--magenta);
  --accent-ink: #04121a;
  --ok: #a7d8c9;
  --err: #f29aaa;
  --glow: 0 0 22px rgba(169, 223, 234, .16), 0 0 2px rgba(169, 223, 234, .42);
  --glow-m: 0 0 22px rgba(183, 160, 230, .16), 0 0 2px rgba(183, 160, 230, .42);
  --guilloche: rgba(151, 169, 218, .38);
  --guilloche-2: rgba(168, 143, 209, .32);
  --fibre-a: #a9dfea;
  --fibre-b: #b7a0e6;
  --fibre-c: #c4c7eb;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
  --foil: linear-gradient(115deg, #b8ddec 0%, #c6b0eb 24%, #eadcf3 46%, #dfb9d5 65%, #c1c6ef 82%, #b8ddec 100%);
}

:root[data-theme="day"] {
  color-scheme: light;
  --bg: #f3f1f8;
  --bg-2: #e9e4f3;
  --bg-3: #ddd5ec;
  --plate: rgba(31, 58, 95, .035);
  --plate-2: rgba(31, 58, 95, .07);
  --ink: #211b36;
  --ink-2: #433957;
  --muted: #625570;
  --line: rgba(56, 42, 83, .16);
  --line-2: rgba(56, 42, 83, .3);
  --cyan: #365b72;
  --magenta: #71558f;
  --green: #3d6d63;
  --amber: #82643b;
  --seal: #9c315f;
  --seal-btn: #9c315f;
  --accent: #365b72;
  --accent-2: #71558f;
  --accent-ink: #f3f1f8;
  --ok: #3d6d63;
  --err: #b0102a;
  --glow: none;
  --glow-m: none;
  --guilloche: rgba(54, 91, 114, .4);
  --guilloche-2: rgba(113, 85, 143, .3);
  --fibre-a: #365b72;
  --fibre-b: #71558f;
  --fibre-c: #68618c;
  --shadow: 0 30px 60px -36px rgba(40, 30, 10, .45);
  --foil: linear-gradient(115deg, #b3cbd7 0%, #c5b7dd 30%, #d8c9e5 50%, #e8dce9 70%, #b5c1df 100%);
}

/* bunker mode: the canary tripped */
:root.bunker {
  --accent: #ff9f1a;
  --accent-2: #ff3d3d;
  --guilloche: rgba(255, 159, 26, .55);
  --guilloche-2: rgba(255, 61, 61, .45);
}

*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.6 var(--font-sans);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
/* links inside running text are underlined, not told apart by colour alone */
main p a:not([class]), .foot a, .closing p a { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-decoration-thickness: 1px; }
main p a:not([class]):hover, .foot a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1, "zero" 1; letter-spacing: -.01em; }
.serif { font-family: var(--font-serif); }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.err { color: var(--err); }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.row { display: flex; align-items: center; }
.wrap-items, .wrap { flex-wrap: wrap; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt40 { margin-top: 40px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 6px 10px; z-index: 100; }
.skip:focus { left: 8px; }
.noscript { padding: 40px; text-align: center; }

/* ---------------------------------------------------------------- backdrop, grain, watermark */
#backdrop { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; opacity: .9; }
#grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
:root[data-theme="day"] #grain { opacity: .12; mix-blend-mode: multiply; filter: invert(1); }
/* fork demo only: a small badge in the bottom-left corner (the amber frame on <body> marks the mode too) */
#watermark {
  position: fixed; z-index: 90; pointer-events: none;
  left: calc(10px + env(safe-area-inset-left)); bottom: calc(10px + env(safe-area-inset-bottom));
  padding: 5px 8px 4px; border: 1px solid var(--amber); border-radius: 2px; white-space: nowrap;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  font: 700 10px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--amber);
}
.top, #ribbon, main, .foot { position: relative; z-index: 2; }

/* ---------------------------------------------------------------- header */
.top {
  display: flex; align-items: center; gap: 20px;
  padding: 14px var(--gutter); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  position: sticky; top: 0; z-index: 50;
}
/* the brand and the actions share the space either side equally, so the nav stays put when the wallet text changes */
.brand { flex: 1 1 0; min-width: max-content; display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; }
.brand-mark { flex: none; width: 42px; height: 42px; object-fit: contain; border-radius: 10px; box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 16%, transparent); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font: 900 22px/1 var(--font-serif); letter-spacing: .08em; }
.brand-text i { font: 600 10px/1.4 var(--font-mono); font-style: normal; letter-spacing: .38em; color: var(--muted); }
/* English: "No Rush" with the $NORUSH ticker as a small vermilion stamp beside it */
:root:lang(en) .brand-text { flex-direction: row; align-items: center; gap: 9px; }
:root:lang(en) .brand-text b { font-weight: 700; letter-spacing: -.01em; }
:root:lang(en) .brand-text i {
  display: inline-block; padding: 3px 5px 2px; border: 1.5px solid currentColor; border-radius: 2px;
  font: 700 10.5px/1 var(--font-mono); letter-spacing: .06em; color: var(--seal); transform: rotate(-4deg);
  text-shadow: 0 0 8px color-mix(in srgb, var(--seal) 45%, transparent);
}
:root[data-theme="day"]:lang(en) .brand-text i { text-shadow: none; }
.nav { flex: 0 1 auto; display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.nav a {
  color: var(--ink-2); padding: 7px 12px; border-radius: var(--r); font-size: 14px; text-decoration: none !important; white-space: nowrap;
  border: 1px solid transparent; transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.nav .ns { display: none; }
.nav a:hover { color: var(--ink); border-color: var(--line); }
.nav a.on { color: var(--accent); border-color: var(--line-2); background: var(--plate); box-shadow: var(--glow); }
.top-actions { flex: 1 1 0; min-width: max-content; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; cursor: pointer;
  background: var(--plate); border: 1px solid var(--line); border-radius: 999px; font: 600 12px/1 var(--font-mono); letter-spacing: .06em;
}
.chip:hover { border-color: var(--line-2); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: var(--glow); }
#modeBtn .mi { flex: none; width: 15px; height: 15px; fill: var(--accent); color: var(--accent); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 55%, transparent)); }
#modeBtn .mi-day, :root[data-theme="day"] #modeBtn .mi-uv { display: none; }
:root[data-theme="day"] #modeBtn .mi-day { display: block; filter: none; }
#langBtn { font-family: var(--font-sans); font-weight: 700; letter-spacing: .02em; }
/* ETH the vault owes this wallet (a prize or tip it could not send): claimable from every page */
.chip-owed { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 55%, transparent); background: color-mix(in srgb, var(--ok) 9%, transparent); font-family: var(--font-sans); font-weight: 700; letter-spacing: .01em; }
.chip-owed:hover { border-color: var(--ok); }

/* ---------------------------------------------------------------- buttons */
.btn {
  --b: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; cursor: pointer;
  border: 1px solid var(--b); border-radius: var(--r); background: var(--b); color: var(--accent-ink);
  font: 700 14px/1 var(--font-sans); letter-spacing: .04em; text-decoration: none !important;
  box-shadow: var(--glow); transition: transform var(--t-fast) var(--ease), filter var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
/* disabled: the label is often the reason ("Opens at launch", "Takes closed"), so it stays readable */
.btn:disabled, .btn[aria-disabled="true"] {
  cursor: not-allowed; transform: none; filter: none; box-shadow: none; opacity: 1;
  background: color-mix(in srgb, var(--b) 10%, transparent); border-style: dashed; border-color: color-mix(in srgb, var(--b) 60%, transparent); color: var(--ink-2);
}
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); box-shadow: none; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-seal { --b: var(--seal-btn); color: #fff; box-shadow: var(--glow-m); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 56px; padding: 0 30px; font-size: 16px; letter-spacing: .08em; }
/* the header wallet button: an outline at rest, so the red take button stays the loudest thing on screen */
.btn-wallet { height: 34px; padding: 0 14px; font-size: 13px; background: transparent; color: var(--accent); box-shadow: none; }
.btn-wallet:hover { background: var(--accent); color: var(--accent-ink); box-shadow: var(--glow); filter: none; }
.btn-wallet .ws { display: none; }
.btn-wallet.on { background: transparent; color: var(--accent); }
.btn-wallet.on:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.btn-wallet.warn { --b: var(--amber); background: var(--amber); color: #1a1003; }
.btn-wallet.warn:hover { background: var(--amber); color: #1a1003; }
:root[data-theme="day"] .btn-wallet.warn, :root[data-theme="day"] .btn-wallet.warn:hover { color: #fff; }

/* ---------------------------------------------------------------- plates (security-paper cards) */
.plate {
  position: relative; border: 1px solid var(--line);
  /* a calm backing for reading: the moving backdrop shows in the gutters, not under the text */
  background: linear-gradient(180deg, var(--plate-2), var(--plate)), color-mix(in srgb, var(--bg-2) 86%, transparent);
  border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); overflow: hidden;
}
.plate::before {
  /* guilloche border: two interference line fields */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--guilloche) 25%, transparent) 6px 7px),
    repeating-linear-gradient(-45deg, transparent 0 9px, color-mix(in srgb, var(--guilloche-2) 18%, transparent) 9px 10px);
  -webkit-mask: linear-gradient(#000 0 0) top/100% 6px no-repeat, linear-gradient(#000 0 0) bottom/100% 6px no-repeat,
    linear-gradient(#000 0 0) left/6px 100% no-repeat, linear-gradient(#000 0 0) right/6px 100% no-repeat;
  mask: linear-gradient(#000 0 0) top/100% 6px no-repeat, linear-gradient(#000 0 0) bottom/100% 6px no-repeat,
    linear-gradient(#000 0 0) left/6px 100% no-repeat, linear-gradient(#000 0 0) right/6px 100% no-repeat;
}
.plate-title { margin: 0 0 14px; font: 700 12px/1.2 var(--font-mono); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.plate-title b { color: var(--ink); font-weight: 700; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--muted); }
.kv em { font-style: normal; color: var(--muted); }
.label { font: 600 11px/1.3 var(--font-mono); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
/* English small caps read as words, not spaced letters */
:root:lang(en) .label, :root:lang(en) .plate-title { letter-spacing: .12em; }
.big { font: 800 clamp(28px, 4.2vw, 46px)/1.05 var(--font-mono); letter-spacing: -.02em; }
.huge { font: 900 clamp(40px, 7vw, 84px)/1 var(--font-mono); letter-spacing: -.03em; }
/* a slow foil drift in ~8 steps a second: the same look for a fraction of the paint work of a per-frame sweep */
.foil-text { background: var(--foil); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: foil 9s steps(72) infinite; }
@keyframes foil { to { background-position: 300% 0; } }
/* placeholders ("TBA at launch", "Loading…", "Read failed · retrying") are words: always the sans, never below 13px */
.tba { color: var(--muted); font-family: var(--font-sans) !important; font-weight: 600; letter-spacing: .04em; font-size: max(13px, .62em); }
.stale { opacity: .6; }

/* ---------------------------------------------------------------- split-flap */
.flap { display: inline-flex; gap: 2px; font-family: var(--font-mono); }
.flap-plain { display: inline; }
.fc {
  position: relative; display: inline-block; min-width: .64em; padding: .04em .06em; text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-3) 92%, var(--accent)) 0 49%, var(--bg-2) 51% 100%);
  border-radius: 2px; box-shadow: inset 0 0 0 1px var(--line), 0 1px 0 rgba(0, 0, 0, .4);
}
.fc::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, .55); }
.fc-sep { background: none; box-shadow: none; min-width: .3em; }
.fc-sep::after { display: none; }
.fc-flip { animation: flip var(--t-med) var(--ease); transform-origin: 50% 50%; }
@keyframes flip { 0% { transform: rotateX(90deg); filter: brightness(1.8); } 60% { transform: rotateX(-12deg); } 100% { transform: rotateX(0); } }
:root[data-theme="day"] .fc { background: linear-gradient(180deg, #fbf8f0 0 49%, #efe9da 51% 100%); }

/* ---------------------------------------------------------------- stamps */
.stamp {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 2px solid currentColor; border-radius: 3px;
  font: 800 12px/1.2 var(--font-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--seal); transform: rotate(-4deg);
  mix-blend-mode: screen;
}
:root[data-theme="day"] .stamp { mix-blend-mode: multiply; }
.stamp.s-ok { color: var(--ok); } .stamp.s-cyan { color: var(--cyan); } .stamp.s-amber { color: var(--amber); } .stamp.s-muted { color: var(--muted); }
.stamp-in { animation: stampIn 520ms var(--ease); }
@keyframes stampIn { 0% { transform: scale(2.2) rotate(-14deg); opacity: 0; } 60% { transform: scale(.94) rotate(-3deg); opacity: 1; } 100% { transform: scale(1) rotate(-4deg); } }

/* ---------------------------------------------------------------- ribbon (global state of the gate and the game) */
.ribbon { z-index: 40; border-bottom: 1px solid var(--line); overflow: hidden; }
.ribbon-in {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px; padding: 9px var(--gutter);
  font: 600 13px/1.3 var(--font-sans); color: inherit; text-decoration: none !important;
}
a.ribbon-in:hover .r-id, a.ribbon-in:focus-visible .r-id { text-decoration: underline; }
a.ribbon-in:focus-visible { outline-offset: -3px; }
.ribbon b { font: 800 12px/1 var(--font-mono); letter-spacing: .2em; text-transform: uppercase; }
.ribbon .r-id { font: 700 13px/1 var(--font-mono); white-space: nowrap; }
.ribbon .r-short { display: none; }
.ribbon.r-notice { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--amber) 16%, transparent) 0 14px, color-mix(in srgb, var(--amber) 6%, transparent) 14px 28px); color: var(--amber); }
.ribbon.r-exec { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--cyan) 18%, transparent) 0 14px, color-mix(in srgb, var(--cyan) 6%, transparent) 14px 28px); color: var(--cyan); }
.ribbon.r-end { background: color-mix(in srgb, var(--seal) 14%, transparent); color: var(--seal); }
.ribbon.r-bunker { background: repeating-linear-gradient(-45deg, rgba(255, 61, 61, .2) 0 14px, rgba(255, 159, 26, .12) 14px 28px); color: #ffb26b; }
:root[data-theme="day"] .ribbon.r-notice { color: #6e4608; }
:root[data-theme="day"] .ribbon.r-exec { color: #1f3a5f; }
:root[data-theme="day"] .ribbon.r-bunker { color: #8a3a06; }
/* a posted shutdown: takes close HOLD before it can execute */
.ribbon .r-closing { padding: 3px 8px; border: 1.5px solid var(--seal); border-radius: 2px; color: var(--seal); font: 800 12px/1.2 var(--font-sans); letter-spacing: .04em; white-space: nowrap; }
.ribbon .r-closing-pre { border-style: dashed; border-color: currentColor; color: inherit; }

/* ---------------------------------------------------------------- posted-shutdown notice (home hero, play) */
.closing {
  position: relative; display: grid; gap: 6px; min-width: 0; padding: 12px 14px 12px 16px; color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--amber) 50%, transparent); border-left: 3px solid var(--amber); border-radius: var(--r);
  background:
    repeating-linear-gradient(-45deg, color-mix(in srgb, var(--amber) 9%, transparent) 0 12px, color-mix(in srgb, var(--amber) 3%, transparent) 12px 24px),
    color-mix(in srgb, var(--bg) 72%, transparent);
}
.closing .cl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.closing .cl-badge {
  flex: none; padding: 3px 6px 2px; border: 1.5px solid currentColor; border-radius: 2px; color: var(--amber);
  font: 800 10.5px/1.1 var(--nr-mono); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
}
a.cl-badge:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.closing .cl-title { min-width: 0; font: 800 15px/1.4 var(--font-sans); letter-spacing: .02em; color: var(--amber); overflow-wrap: anywhere; }
.closing .cl-cd { font-family: var(--nr-mono); font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.closing p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.closing time { font-family: var(--nr-mono); font-weight: 600; color: var(--ink); white-space: nowrap; }
.closing .cl-paid { font-size: 12.5px; color: var(--muted); }
.closing.cl-closed, .closing.cl-due {
  border-color: color-mix(in srgb, var(--seal) 55%, transparent); border-left-color: var(--seal);
  background:
    repeating-linear-gradient(-45deg, color-mix(in srgb, var(--seal) 10%, transparent) 0 12px, color-mix(in srgb, var(--seal) 3%, transparent) 12px 24px),
    color-mix(in srgb, var(--bg) 72%, transparent);
}
.closing.cl-closed .cl-title, .closing.cl-due .cl-title, .closing.cl-closed .cl-badge, .closing.cl-due .cl-badge { color: var(--seal); }

/* ---------------------------------------------------------------- main, footer */
/* until the page module renders, the footer waits below the fold (no jump when the page arrives) */
main#view { min-height: 100vh; min-height: 100svh; }
.foot { margin-top: 80px; border-top: 1px solid var(--line); padding: 32px var(--gutter) 24px; background: color-mix(in srgb, var(--bg) 80%, transparent); }
.foot-grid { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
.foot-brand b { font: 800 14px/1 var(--font-mono); letter-spacing: .3em; }
.foot-brand-link { display: inline-flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none !important; }
.foot-brand-link img { flex: none; width: 48px; height: 48px; border-radius: 11px; }
.foot-intro { color: var(--muted); font-size: 13px; max-width: 64ch; }
.foot-social { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 5px 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--plate); color: var(--ink-2); font: 500 12px/1.4 var(--font-mono); text-decoration: none !important; }
.foot-social-mark { color: var(--accent-2); font: 600 15px/1 var(--font-sans); }
.foot-social:hover { color: var(--accent); border-color: var(--accent); background: var(--plate-2); }
.foot-social:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.foot-contracts { font-size: 13px; }
.foot-contracts > b { display: block; font: 700 11px/1 var(--font-mono); letter-spacing: .26em; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; }
.foot-contracts .kv { align-items: center; padding: 2px 0; }
.foot-contracts .kv a { padding: 7px 0; }
.foot-contracts .kv em { padding: 7px 0; }
.microprint {
  max-width: var(--max); margin: 24px auto 0; overflow: hidden; white-space: nowrap; font: 500 6px/1.2 var(--font-mono);
  letter-spacing: .12em; color: var(--muted); opacity: .55; user-select: none;
}

/* ---------------------------------------------------------------- modal, toast, wallets, tx */
.modal-wrap { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(4, 3, 10, .66); backdrop-filter: blur(6px); animation: fadeIn 160ms; }
.modal-wrap.out { opacity: 0; transition: opacity 160ms; }
.modal { width: min(460px, 100%); max-height: calc(100vh - 32px); max-height: calc(100svh - 32px); overflow: auto; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.modal-title { margin: 0 0 14px; font: 700 18px/1.3 var(--font-sans); }
.modal-title:focus { outline: none; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
@keyframes fadeIn { from { opacity: 0; } }
.wallets { display: grid; gap: 8px; }
.wallet-opt { display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; background: var(--plate); border: 1px solid var(--line); border-radius: var(--r); text-align: left; }
.wallet-opt:hover { border-color: var(--accent); }
.wallet-opt img { width: 28px; height: 28px; }
.wallet-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--foil); }
.tx-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tx-steps li { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); color: var(--muted); font-size: 14px; }
.tx-steps li.on { color: var(--ink); border-color: var(--accent); box-shadow: var(--glow); }
.tx-steps li.done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.tx-steps li.fail { color: var(--err); border-color: var(--err); box-shadow: none; }
.tx-msg { margin: 12px 0 0; font-size: 13px; word-break: break-word; }
.acct-addr { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; font: 600 14px/1.4 var(--font-mono); word-break: break-all; }
.acct .kv { font-size: 14px; }
#toasts { position: fixed; z-index: 300; right: 16px; bottom: 16px; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 14px; border-radius: var(--r); background: var(--bg-3); border: 1px solid var(--line-2); font-size: 14px; box-shadow: var(--shadow); animation: fadeIn 200ms; }
.toast.out { opacity: 0; transition: opacity 300ms; }
.toast-err { border-color: var(--err); }
.toast-ok { border-color: var(--ok); }

/* ---------------------------------------------------------------- page scaffolding shared by pages */
.page-head { padding: 48px 0 20px; }
.page-head h1 { margin: 0; font: 900 clamp(30px, 5vw, 56px)/1.05 var(--font-serif); letter-spacing: .02em; }
/* one English display token for every page title (home keeps the largest size) */
:root:lang(en) .page-head h1 { font-family: var(--nr-display); font-weight: 700; letter-spacing: -.015em; font-size: clamp(36px, 4.4vw, 56px); }
.page-head p { margin: 12px 0 0; color: var(--ink-2); max-width: 70ch; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.input, .textarea {
  width: 100%; height: 44px; padding: 0 12px; background: var(--bg-2); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r);
  font: 500 15px/1 var(--font-mono);
}
.textarea { height: auto; min-height: 64px; padding: 10px 12px; line-height: 1.4; resize: vertical; font-family: var(--font-sans); }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
/* keyboard focus is always drawn, in both themes (daylight has no glow) */
.input:focus-visible, .textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hint { font-size: 12px; color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 20px 0; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top { flex-wrap: wrap; gap: 10px; }
  .brand, .top-actions { flex: 0 1 auto; min-width: 0; }
  .top-actions { margin-left: auto; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; scrollbar-width: none; scroll-behavior: smooth; }
  .nav a { flex: none; }
  .nav::-webkit-scrollbar { display: none; }
  /* a fade at the edge where more links wait (main.js sets these while the nav overflows) */
  .nav.more-r { -webkit-mask-image: linear-gradient(90deg, #000 84%, transparent); mask-image: linear-gradient(90deg, #000 84%, transparent); }
  .nav.more-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%); mask-image: linear-gradient(90deg, transparent, #000 16%); }
  .nav.more-l.more-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .brand-text i { display: none; }
  :root:lang(en) .brand-text i { display: inline-block; }
  .chip { padding: 0 10px; }
  /* phones: the fork badge stands upright in the right-hand gutter, clear of the text and the bottom bars */
  #watermark { left: auto; right: env(safe-area-inset-right); bottom: auto; top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; padding: 7px 2px; border-right: 0; border-radius: 2px 0 0 2px; font-size: 9px; letter-spacing: .12em; }
  /* the ribbon on one line: label, the change (ellipsis), the entry number; the whole line links to the log */
  .ribbon-in { flex-wrap: nowrap; justify-content: flex-start; gap: 8px; min-height: 38px; padding: 8px var(--gutter); white-space: nowrap; font-size: 12.5px; }
  .ribbon-in > * { flex: none; }
  .ribbon-in > .r-txt { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .ribbon b { font-size: 11px; letter-spacing: .12em; }
  .ribbon .r-id { margin-left: auto; }
  .ribbon .r-closing { padding: 2px 6px; font-size: 11.5px; }
}
/* phones: brand and actions on one row, the nav (short labels, all six visible) on the next */
@media (max-width: 480px) {
  .top { gap: 8px 8px; padding-top: 10px; padding-bottom: 6px; }
  .brand { gap: 8px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 8px; }
  .brand-text b { font-size: 19px; }
  :root:lang(en) .brand-text { gap: 7px; }
  :root:lang(en) .brand-text i { font-size: 10px; padding: 2px 4px 1px; }
  .top-actions { gap: 6px; }
  .chip { height: 32px; padding: 0 9px; }
  #modeLabel { display: none; }
  .btn-wallet { height: 32px; padding: 0 10px; font-size: 12px; letter-spacing: .02em; }
  .btn-wallet .wb-demo { display: none; }
  /* 44 px touch targets without a taller header */
  .top .chip, .top .btn-wallet { position: relative; }
  .top .chip::after, .top .btn-wallet::after { content: ""; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px; }
  .nav { gap: 2px; }
  .nav a { padding: 10px 10px; font-size: 14px; }
  .nav .nl { display: none; }
  .nav .ns { display: inline; }
  .ribbon .r-long { display: none; }
  .ribbon .r-short { display: inline; }
}
@media (max-width: 379px) {
  .btn-wallet .wl { display: none; }
  .btn-wallet .ws { display: inline; }
}
@media (max-width: 370px) {
  .brand-text b { font-size: 18px; }
  .chip { padding: 0 8px; }
  .top-actions { gap: 5px; }
  .nav a { padding: 10px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .nav { scroll-behavior: auto; }
}
