/* The look of the Ark-0 sites (colours, type, glass cards): explorer, faucet and wallet. */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/space-grotesk-latin-500-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/static/fonts/space-grotesk-latin-600-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/space-grotesk-latin-700-normal.woff2) format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2");
}

:root {
  --void: #03070d;
  /* See-through, without blur: the lattice shows inside the panels as it does around them. */
  --panel: rgba(7, 21, 34, 0.3);
  --panel-solid: #071522;
  /* Text fields stay solid, so what is typed never sits on the lattice. */
  --field: #121c25;
  --cyan: #21e6ff;
  --cobalt: #287dff;
  --text-hi: #f2f6ff;
  --text-mid: #9aa7c7;
  --text-dim: #7c8aa5;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.14);
  --good: #35c77e;
  --caution: #efc13c;
  --bad: #e5544f;
  --gradient: linear-gradient(135deg, #21e6ff 0%, #287dff 100%);
  --glow: 0 0 32px rgba(33, 230, 255, 0.22);
  --radius: 16px;
  --heading: "Space Grotesk", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Text over the lattice keeps a halo in the page colour: 25 unblurred copies of each glyph cover it and two
     pixels round it, so a bright point of the lattice never sits right under a letter, inside the see-through
     panels too. Text clipped from a gradient takes it as a filter instead (a text-shadow would paint over the
     gradient); eight 1 px drop-shadows compound to the same 5×5. */
  --halo: 0 0 var(--void), -1px -1px var(--void), 0 -1px var(--void), 1px -1px var(--void), -1px 0 var(--void),
    1px 0 var(--void), -1px 1px var(--void), 0 1px var(--void), 1px 1px var(--void), -2px -2px var(--void),
    -1px -2px var(--void), 0 -2px var(--void), 1px -2px var(--void), 2px -2px var(--void), -2px -1px var(--void),
    2px -1px var(--void), -2px 0 var(--void), 2px 0 var(--void), -2px 1px var(--void), 2px 1px var(--void),
    -2px 2px var(--void), -1px 2px var(--void), 0 2px var(--void), 1px 2px var(--void), 2px 2px var(--void);
  --halo-filter: drop-shadow(1px 0 var(--void)) drop-shadow(1px 0 var(--void)) drop-shadow(-1px 0 var(--void))
    drop-shadow(-1px 0 var(--void)) drop-shadow(0 1px var(--void)) drop-shadow(0 1px var(--void))
    drop-shadow(0 -1px var(--void)) drop-shadow(0 -1px var(--void));
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* The colour sits on html, so the glow behind the page (body::before) paints above it. */
html { background: var(--void); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-hi);
  font: 15.5px/1.7 var(--body);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(640px 420px at 12% -8%, rgba(33, 230, 255, 0.11), transparent 70%),
    radial-gradient(560px 400px at 92% 4%, rgba(40, 125, 255, 0.11), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px) 0 0 / 56px 56px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 45%, transparent 90%);
  mask-image: linear-gradient(to bottom, #000 0, #000 45%, transparent 90%);
}

/* The lattice behind the page: backdrop.svg (tools/backdrop.py draws it), floating slowly, no script needed.
   Only its transform moves, which the compositor does alone. The Lattice edition draws a moving one instead. */
body::after {
  --lattice-size: min(84vmin, 820px);
  content: "";
  position: fixed;
  z-index: -1;
  top: calc(46% - var(--lattice-size) / 2);
  right: calc(var(--lattice-size) * -0.16);
  width: var(--lattice-size);
  height: var(--lattice-size);
  pointer-events: none;
  background: url("backdrop.svg?v=1") center / contain no-repeat;
  opacity: 0.72;
  animation: lattice-float 22s ease-in-out infinite alternate;
}
@keyframes lattice-float {
  from { transform: translate3d(0, -1.4vmin, 0) rotate(-3deg); }
  to { transform: translate3d(-1.8vmin, 1.4vmin, 0) rotate(4deg) scale(1.04); }
}
/* On a phone it sits above the content's start, fainter: the text runs across the whole width. */
@media (max-width: 760px) {
  body::after {
    --lattice-size: 100vmin;
    top: 40px;
    right: calc(50% - var(--lattice-size) / 2);
    opacity: 0.45;
  }
}

::selection { background: rgba(33, 230, 255, 0.25); }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: 20px; }

/* --- Header ---------------------------------------------------------------------------------------- */

header.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(3, 7, 13, 0.82);
  border-bottom: 1px solid var(--glass);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; padding-block: 12px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-hi); }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font: 600 1.02rem/1.2 var(--heading); letter-spacing: -0.01em; }
.brand-by { font: 500 0.62rem/1.4 var(--mono); letter-spacing: 0.28em; text-transform: uppercase; color: var(--text-dim); }

/* The same links on every site, then the language menu; the current page's is in the accent and underlined. */
nav.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; margin-left: auto; }
nav.nav a { color: var(--text-mid); font-size: 0.92rem; white-space: nowrap; }
nav.nav a:hover { color: var(--cyan); text-decoration: none; }
nav.nav a[aria-current] { color: var(--cyan); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 7px; }
/* The download page's link: a pill in the accent, seen at once, filled with it on the download page itself. */
nav.nav a.nav-download { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 13px 3px 11px; color: var(--cyan); border: 1px solid var(--cyan); border-radius: 999px; }
nav.nav a.nav-download:hover { background: rgba(33, 230, 255, 0.1); }
nav.nav a.nav-download[aria-current] { color: var(--void); background: var(--cyan); text-decoration: none; }
.icon-down { width: 14px; height: 14px; flex: none; }
/* The language menu: a details element, so it opens without a script (the explorer and faucet have none). */
nav.nav .lang-menu { position: relative; }
nav.nav .lang-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; min-height: 32px; padding: 2px 12px; color: var(--text-mid); font-size: 0.92rem; white-space: nowrap; border: 1px solid var(--glass); border-radius: 999px; }
nav.nav .lang-menu summary::-webkit-details-marker { display: none; }
nav.nav .lang-menu summary:hover, nav.nav .lang-menu[open] summary { color: var(--cyan); border-color: rgba(33, 230, 255, 0.5); }
nav.nav .lang-menu ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 9.5em; margin: 0; padding: 6px; list-style: none; background: var(--panel-solid); border: 1px solid var(--glass-strong); border-radius: 10px; box-shadow: var(--glow); }
nav.nav .lang-menu li a { display: block; padding: 5px 10px; border-radius: 6px; }
nav.nav .lang-menu li a:hover { background: var(--glass); }
/* Japanese, Korean and Russian text in fonts made for it, rather than in the Chinese-first default. */
html:lang(ja) { --body: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, "Noto Sans JP", system-ui, sans-serif; --heading: "Space Grotesk", "Hiragino Sans", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif; }
html:lang(ko) { --body: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif; --heading: "Space Grotesk", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }
html:lang(ru) { --body: system-ui, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; --heading: "Space Grotesk", system-ui, "Segoe UI", Roboto, "Noto Sans", sans-serif; }

/* The explorer's own pages and its search: a second row of the header, on the explorer's pages only. */
.subbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding-block: 0 10px; }
nav.subnav { display: flex; flex-wrap: wrap; gap: 4px 6px; }
nav.subnav a { padding: 5px 12px; color: var(--text-mid); font-size: 0.9rem; white-space: nowrap; border-radius: 999px; }
nav.subnav a:hover { color: var(--cyan); text-decoration: none; }
nav.subnav a[aria-current] { color: var(--cyan); background: rgba(33, 230, 255, 0.08); }
form.search { display: flex; gap: 8px; flex: 1 1 280px; min-width: 0; margin-left: auto; max-width: 440px; }
input, button { font: inherit; }
input {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  color: var(--text-hi);
  background: var(--field);
  border: 1px solid var(--glass);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s;
}
input::placeholder { color: var(--text-dim); }
input:focus { border-color: rgba(33, 230, 255, 0.6); box-shadow: 0 0 0 1px rgba(33, 230, 255, 0.35); }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  color: var(--void);
  font: 600 0.95rem/1.2 var(--heading);
  background: var(--gradient);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
button:hover, .button:hover { transform: scale(1.03); box-shadow: var(--glow); text-decoration: none; }
.button.ghost { color: var(--text-hi); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass); }
.button.ghost:hover { color: var(--cyan); border-color: rgba(33, 230, 255, 0.5); box-shadow: none; }

/* The halo on everything that sits over the lattice. Filled buttons and text fields have a background of their
   own; the browser's own style sets text-shadow: none on buttons, so the see-through ghost ones take it back. */
main, .notice, footer.site-footer { text-shadow: var(--halo); }
button:not(.ghost), .button:not(.ghost), input, textarea, select { text-shadow: none; }
button.ghost { text-shadow: var(--halo); }
/* An outline button in the accent, see-through like the ghost ones (the home page's link to the download page). */
.button.accent { color: var(--cyan); background: transparent; border: 1px solid var(--cyan); text-shadow: var(--halo); }
.button.accent:hover { background: rgba(33, 230, 255, 0.1); }
.button.accent .icon-down { width: 16px; height: 16px; filter: var(--halo-filter); }

/* The standing disclaimer: one quiet line under the header. */
.notice {
  font-size: 0.84rem;
  line-height: 1.55;
  color: #d9c78f;
  background: rgba(239, 193, 60, 0.06);
  border-bottom: 1px solid rgba(239, 193, 60, 0.18);
}
.notice .wrap { padding-block: 8px; }

main.wrap { flex: 1; padding-block: 8px 56px; }

/* --- Type ------------------------------------------------------------------------------------------ */

h1, h2, h3 { font-family: var(--heading); letter-spacing: -0.01em; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 700; line-height: 1.2; margin: 34px 0 16px; }
h2 { font-size: 1.22rem; font-weight: 600; margin: 40px 0 14px; }
h3 { font-size: 1.02rem; font-weight: 600; margin: 0 0 10px; }
p { margin: 0 0 12px; }

.eyebrow {
  margin: 0 0 14px;
  font: 500 0.78rem/1.4 var(--mono);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(33, 230, 255, 0.9);
}
:lang(zh) .eyebrow { letter-spacing: 0.16em; }
.hero { padding-top: 34px; }
.hero h1 { margin: 0 0 14px; }
.lead { max-width: 72ch; font-size: 1.05rem; color: var(--text-mid); }

code, .mono { font-family: var(--mono); font-size: 0.86em; overflow-wrap: anywhere; }
code { padding: 2px 6px; color: #d7e6ff; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass); border-radius: 6px; }

.note { font-size: 0.9rem; color: var(--text-dim); }
.muted { color: var(--text-dim); }

/* --- Cards ----------------------------------------------------------------------------------------- */

.card, dl.kv, .table-wrap, .stat {
  background: var(--panel);
  border: 1px solid var(--glass);
  border-radius: var(--radius);
}
.card { padding: 24px 26px; }

/* A 1 px cyan-to-cobalt border, as on the site's highlighted cards. */
.try-card, section.p2mr { position: relative; background: var(--panel); border-radius: var(--radius); }
.try-card::before, section.p2mr::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(33, 230, 255, 0.5), rgba(40, 125, 255, 0.2) 40%, rgba(255, 255, 255, 0.06) 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

dl.kv {
  display: grid;
  grid-template-columns: minmax(140px, 240px) 1fr;
  gap: 10px 24px;
  margin: 0 0 12px;
  padding: 20px 24px;
}
dl.kv dt { color: var(--text-dim); font-size: 0.9rem; }
dl.kv dd { margin: 0; min-width: 0; }

/* --- Home ------------------------------------------------------------------------------------------ */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 26px 0 6px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; color: var(--text-hi); transition: border-color 0.2s, box-shadow 0.2s; }
a.stat:hover { text-decoration: none; border-color: rgba(33, 230, 255, 0.4); box-shadow: var(--glow); }
.stat-label { font: 500 0.7rem/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); }
.stat-value { font: 700 1.9rem/1.15 var(--heading); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
a.stat .stat-value { color: var(--cyan); }
.stat-sub { font-size: 0.86rem; color: var(--text-mid); }

.try-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.try-card { display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 20px; color: var(--text-hi); transition: transform 0.25s, box-shadow 0.25s; }
.try-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--glow); }
.try-step { font: 500 0.78rem/1 var(--mono); letter-spacing: 0.2em; color: var(--cyan); }
.try-title { font: 600 1.08rem/1.35 var(--heading); }
.try-body { flex: 1; font-size: 0.92rem; color: var(--text-mid); }
.try-go { font: 600 0.9rem/1.2 var(--heading); color: var(--cyan); }

/* --- Tables ---------------------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; margin: 0 0 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { padding: 11px 16px; text-align: left; vertical-align: top; }
th {
  font: 500 0.68rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--glass);
  white-space: nowrap;
}
/* Cells keep to one line; on a narrow screen the table scrolls sideways instead. */
td { border-bottom: 1px solid rgba(255, 255, 255, 0.045); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(33, 230, 255, 0.035); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block;
  margin: 2px 2px 0 6px;
  padding: 0 9px;
  font: 500 0.72rem/1.7 var(--mono);
  color: var(--cyan);
  background: rgba(33, 230, 255, 0.08);
  border: 1px solid rgba(33, 230, 255, 0.28);
  border-radius: 999px;
  white-space: nowrap;
}

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 14px 0; }
.pager a { padding: 4px 14px; border: 1px solid var(--glass); border-radius: 999px; }
.pager a:hover { text-decoration: none; border-color: rgba(33, 230, 255, 0.5); }
.pager span { color: var(--text-dim); }

/* --- A P2MR spend, taken apart --------------------------------------------------------------------- */

section.p2mr { margin: 26px 0; padding: 24px 26px; }
section.p2mr h3 { font-size: 1.08rem; color: var(--cyan); }
section.p2mr > p { color: var(--text-mid); max-width: 80ch; }
section.p2mr dl.kv { background: transparent; border: 0; padding: 0; margin: 16px 0 0; }
ol.steps { margin: 0; padding-left: 1.3em; font-family: var(--mono); font-size: 0.84rem; }
ol.steps li { margin: 3px 0; overflow-wrap: anywhere; }

/* An OP_CHECKMLDSA44 template leaf, or a tripwired leaf (M3), inside the P2MR spend that executes it. */
.mldsa44, .tripwired { margin: 18px 0 0; padding: 16px 20px; border: 1px solid rgba(33, 230, 255, 0.28); border-radius: 12px; background: rgba(33, 230, 255, 0.04); }
.tripwired { border-color: rgba(93, 155, 255, 0.4); }
.mldsa44 h4, .tripwired h4 { margin: 0 0 8px; font: 600 1rem/1.4 var(--heading); letter-spacing: -0.01em; }
.mldsa44 > p, .tripwired > p { max-width: 80ch; }

.ok, .bad { display: inline-block; padding: 3px 12px; border-radius: 999px; font-weight: 600; }
.ok { color: var(--good); background: rgba(53, 199, 126, 0.1); border: 1px solid rgba(53, 199, 126, 0.35); }
.bad { color: #ff8a85; background: rgba(229, 84, 79, 0.1); border: 1px solid rgba(229, 84, 79, 0.35); }
p.bad { display: block; border-radius: 12px; padding: 10px 14px; font-weight: 500; }

/* --- Faucet ---------------------------------------------------------------------------------------- */

.faucet-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; margin-top: 26px; align-items: start; }
form.claim { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
form.claim label { font: 600 0.95rem/1.4 var(--heading); }
form.claim input { padding: 12px 16px; font-family: var(--mono); font-size: 0.92rem; }
form.claim button { align-self: flex-start; padding: 12px 28px; font-size: 1rem; }
.work-status { margin: 0; min-height: 1.4em; font-size: 0.88rem; color: var(--text-mid); }
/* The faucet's traps. Off-screen: fields and a button no person sees or reaches (out of the tab order, hidden
   from screen readers too). Visually hidden: a note no one sees but screen readers and agents read. Neither may
   use a style attribute (the policy allows the style sheet only). */
.offscreen { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; }
.cf-turnstile { min-height: 65px; }

.how h2 { margin: 0 0 14px; }
ol.how-steps { list-style: none; margin: 0 0 16px; padding: 0; counter-reset: how; }
ol.how-steps li { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 0 0 14px 42px; counter-increment: how; }
ol.how-steps li::before {
  content: counter(how, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font: 500 0.72rem/1 var(--mono);
  color: var(--cyan);
  background: rgba(33, 230, 255, 0.08);
  border: 1px solid rgba(33, 230, 255, 0.3);
  border-radius: 10px;
}
.how-title { font: 600 0.98rem/1.4 var(--heading); }
.how-body { font-size: 0.92rem; color: var(--text-mid); }

.panel { margin: 0 0 16px; padding: 16px 20px; border-radius: 14px; border: 1px solid var(--glass); background: var(--panel); }
.panel.good { color: #c9f5dc; background: rgba(53, 199, 126, 0.08); border-color: rgba(53, 199, 126, 0.35); }
.panel.error { color: #ffc9c6; background: rgba(229, 84, 79, 0.08); border-color: rgba(229, 84, 79, 0.35); }

/* --- Wallet ---------------------------------------------------------------------------------------- */

.wallet { margin-top: 22px; }
.wallet-status { margin: 0 0 18px; color: var(--text-mid); font-size: 0.92rem; }
.wallet-status.bad { color: #ffc9c6; }
.wallet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; align-items: start; }
.wallet .card { margin-bottom: 18px; }
.wallet-grid .card { margin-bottom: 0; }
.wallet .card h2 { margin: 0 0 12px; }
.wallet .address, .wallet .backup-code { overflow-wrap: anywhere; font-size: 0.92rem; color: var(--text-hi); }
.wallet .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.wallet button.small, .wallet .button.small { padding: 6px 14px; font-size: 0.88rem; }
.wallet button:disabled { opacity: 0.5; cursor: default; }
/* The page shows and hides parts with the hidden attribute; flex and inline-flex rules must not undo it. */
.wallet [hidden] { display: none !important; }
.wallet p.bad:empty { display: none; }
.wallet input[type=checkbox], .wallet input[type=radio] { flex: none; width: auto; margin: 0; }
.wallet .account dl.kv { grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; padding: 14px 18px; }
.wallet dl.kv { margin: 12px 0; }
.wallet dd.bad { color: #ffc9c6; }
.send-form { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.send-form label, .send-form .field-label { margin: 6px 0 0; font: 600 0.95rem/1.4 var(--heading); }
.send-form label.choice, .choices .choice { font: inherit; font-weight: 400; display: inline-flex; align-items: center; gap: 8px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.send-form .row { display: flex; flex-wrap: wrap; gap: 10px; }
.send-form input:not([type]), .send-form input#send-amount { font-family: var(--mono); font-size: 0.92rem; }
.send-form > button { align-self: flex-start; margin-top: 8px; }
.wallet textarea {
  width: 100%;
  margin: 8px 0;
  padding: 10px 14px;
  color: var(--text-hi);
  font: 0.9rem/1.5 var(--mono);
  background: var(--field);
  border: 1px solid var(--glass);
  border-radius: 12px;
  resize: vertical;
}
.review .panel { margin-top: 8px; }
.review dd.mono { overflow-wrap: anywhere; }
.hero-guide { margin: 12px 0 0; font-size: 0.98rem; }
/* Shown only if the wallet script never starts (a browser too old for it, or scripts blocked): the script
   replaces it as it starts, so a normal load never shows it. */
.wallet-stuck { visibility: hidden; color: var(--text-mid); animation: wallet-stuck 0s 12s forwards; }
@keyframes wallet-stuck { to { visibility: visible; } }
/* The field the copy command copies from: out of sight, and 16 px so that iOS does not zoom in on it. */
.copy-field { position: fixed; top: 0; left: -9999px; width: 1px; height: 1px; opacity: 0; font-size: 16px; }

/* The network line: a live dot, the tip, and how long ago the last block came. */
.wallet-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.wallet-status .net-dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(53, 199, 126, 0.55);
  animation: net-live 2.4s ease-out infinite;
}
.wallet-status.bad .net-dot { background: var(--bad); animation: none; }
.wallet-status .net-ago { color: var(--text-dim); font-size: 0.86rem; }
.wallet-status .net-ago:empty { display: none; }
.wallet-status .net-ago::before { content: "·"; margin-right: 10px; }
.wallet-status.new-block .net-text { animation: net-block 1.6s ease-out; }
@keyframes net-live {
  0% { box-shadow: 0 0 0 0 rgba(53, 199, 126, 0.55); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(53, 199, 126, 0); }
}
@keyframes net-block {
  0% { color: var(--cyan); text-shadow: var(--halo), 0 0 18px rgba(33, 230, 255, 0.8); }
  100% { color: inherit; text-shadow: var(--halo); }
}

/* Cards come in one after another. */
.wallet-main > * { animation: rise 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.wallet-main > *:nth-child(2) { animation-delay: 0.05s; }
.wallet-main > *:nth-child(3) { animation-delay: 0.1s; }
.wallet-main > *:nth-child(4) { animation-delay: 0.15s; }
.wallet-main > *:nth-child(n+5) { animation-delay: 0.2s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Small labelled states: available, pending, a reminder. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 3px 12px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-mid);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass);
  border-radius: 999px;
}
.chip.ok { color: #c9f5dc; border-color: rgba(53, 199, 126, 0.3); background: rgba(53, 199, 126, 0.07); }
.chip.pending { color: #f6dd92; border-color: rgba(239, 193, 60, 0.35); background: rgba(239, 193, 60, 0.08); }
.chip.pending::before, .tx.mempool .dot, .tx.broadcast .dot {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--caution);
  animation: pending-pulse 1.4s ease-in-out infinite;
}
.chip.warn { color: #f6dd92; border-color: rgba(239, 193, 60, 0.4); background: rgba(239, 193, 60, 0.08); }
/* A wallet opened by logging in has no post-quantum protection (wallet/src/storage.ts SeedFrom): the same amber as .chip.warn. */
p.pq-none { color: #f6dd92; border-left: 3px solid rgba(239, 193, 60, 0.6); padding: 2px 0 2px 10px; }
a.chip.warn:hover { text-decoration: none; border-color: rgba(239, 193, 60, 0.7); }
@keyframes pending-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

/* The overview: the whole balance, and what waits for a block. */
.wallet .overview { position: relative; overflow: hidden; }
.wallet .overview::after {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 360px;
  height: 360px;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(33, 230, 255, 0.12), transparent);
}
.ov-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ov-label { margin: 0; font: 500 0.78rem/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); }
.ov-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 6px 0 10px; }
.ov-amount {
  font: 700 clamp(2rem, 6vw, 3rem)/1.1 var(--heading);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  background: linear-gradient(120deg, #f2f6ff 30%, #9ff3ff 60%, #8fb8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: var(--halo-filter);
}
.ov-amount.changed { animation: amount-glow 1.2s ease-out; }
@keyframes amount-glow {
  0% { filter: var(--halo-filter) drop-shadow(0 0 14px rgba(33, 230, 255, 0.75)); }
  100% { filter: var(--halo-filter); }
}
.ov-unit { color: var(--text-dim); font-size: 0.95rem; }
.ov-split { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; }
.wallet .ov-actions { margin-bottom: 0; }

/* Why two addresses: open from the start; its summary folds it away. */
.why-two {
  margin: 0 0 18px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass);
  border-radius: var(--radius);
}
.why-two summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; cursor: pointer; list-style: none; }
.why-two summary::-webkit-details-marker { display: none; }
.why-two summary::after { content: "+"; margin-left: auto; font: 500 1.1rem/1 var(--mono); color: var(--cyan); transition: transform 0.2s; }
.why-two[open] summary::after { transform: rotate(45deg); }
.why-q { font: 600 0.98rem/1.4 var(--heading); color: var(--text-hi); }
.why-a { color: var(--text-mid); font-size: 0.93rem; }
.why-body { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--glass); }
.why-body p { max-width: 80ch; color: var(--text-mid); }
.why-body .sig-badge { margin-right: 4px; }

/* Why two addresses, as a duel: one strike from a quantum computer every few seconds; the curve of today's
   signatures cracks, the lattice of the post-quantum one takes it and rings. The resting state is the end of
   a strike, so with reduced motion (every animation off) the page shows that, still. */
.duel {
  --duel: 8s;
  --orb: 30px;
  display: grid;
  grid-template-columns: minmax(0, 300px) 76px minmax(0, 300px);
  justify-content: center;
  gap: 2px 0;
  margin: 2px 0 14px;
}
.duel-art { display: block; width: 100%; height: auto; overflow: hidden; }
/* Every piece has its cell, so moving the quantum computer's name on a phone moves nothing else. */
.duel-art.classic { grid-area: 1 / 1; }
.duel-orb { grid-area: 1 / 2; }
.duel-art.pq { grid-area: 1 / 3; }
.duel-caption.classic { grid-area: 2 / 1; }
.duel-attacker { grid-area: 2 / 2; }
.duel-caption.pq { grid-area: 2 / 3; }
.duel-caption, .duel-attacker { font: 500 0.78rem/1.4 var(--mono); text-align: center; }
.duel-caption { animation: duel-caption var(--duel) ease-in-out infinite; }
.duel-caption.classic { color: #ffb08a; }
.duel-caption.pq { color: var(--cyan); }
.duel-attacker { font-size: 0.68rem; color: #c9a8ff; }
/* The orb sits at the strikes' height (--strike-at, set by ui.ts), and two short strikes leave it first. */
.duel-orb { position: relative; }
.duel-orb .orb {
  position: absolute;
  top: calc(var(--strike-at) - var(--orb) / 2);
  left: calc(50% - var(--orb) / 2);
  width: var(--orb);
  height: var(--orb);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f5e8ff, #b77bff 45%, rgba(120, 60, 255, 0.25) 75%);
  box-shadow: 0 0 16px rgba(170, 110, 255, 0.6);
  animation: duel-orb var(--duel) ease-in-out infinite;
}
.duel-orb::before, .duel-orb::after {
  content: "";
  position: absolute;
  top: calc(var(--strike-at) - 1.25px);
  width: 50%;
  height: 2.5px;
  border-radius: 2px;
  background: #c49bff;
  opacity: 0;
  animation: duel-stub var(--duel) ease-out infinite;
}
.duel-orb::before { left: 0; transform-origin: right center; }
.duel-orb::after { right: 0; transform-origin: left center; }

.duel-art .axis { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 1; }
.duel-art .beam {
  fill: none;
  stroke: #c49bff;
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0;
  transform-box: view-box;
  animation: duel-beam var(--duel) ease-out infinite;
}
/* Each strike runs on from the drawing's edge next to the orb; ui.ts sets where (--strike-y, --key-x, --key-y). */
.duel-art.classic .beam { transform-origin: 240px var(--strike-y); }
.duel-art.pq .beam { transform-origin: 0 var(--strike-y); }

/* Today's signature: the curve glitches, its public key turns, the cracks spread from it. */
.duel-art .curve {
  fill: none;
  stroke: #4f7fd6;
  stroke-width: 2;
  opacity: 0.75;
  animation: duel-curve var(--duel) linear infinite;
}
.duel-art .cracks { transform-box: view-box; transform-origin: var(--key-x) var(--key-y); animation: duel-crack var(--duel) ease-out infinite; }
.duel-art .cracks path { fill: none; stroke: #ff7a59; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.duel-art .key { fill: #ff7a59; animation: duel-key var(--duel) linear infinite; }
.duel-art .flash {
  fill: rgba(255, 170, 120, 0.55);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: duel-flash var(--duel) ease-out infinite;
}

/* The post-quantum signature: the lattice takes the strike, a ring runs through it, the nodes light up and settle. */
.duel-art .edges { fill: none; stroke: rgba(33, 230, 255, 0.45); stroke-width: 1; }
.duel-art .node { fill: var(--cyan); transform-box: fill-box; transform-origin: center; animation: duel-node var(--duel) ease-out infinite; }
.duel-art .node.d1 { animation-delay: 0.12s; }
.duel-art .node.d2 { animation-delay: 0.24s; }
.duel-art .node.d3 { animation-delay: 0.36s; }
.duel-art .node.d4 { animation-delay: 0.48s; }
.duel-art .ring {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: duel-ring var(--duel) ease-out infinite;
}
.duel-art .ring.late { animation-delay: 0.25s; }

/* One strike in 8 s: the orb charges (0 to 0.9 s), fires, the strike lands at 1.3 s (16.25%). */
@keyframes duel-orb {
  0%, 100% { transform: scale(0.9); }
  10% { transform: scale(1.18); box-shadow: 0 0 32px rgba(190, 140, 255, 0.95); }
  13% { transform: scale(0.84); }
  30% { transform: scale(0.95); }
}
@keyframes duel-stub {
  0%, 10% { opacity: 0; transform: scaleX(0); }
  11% { opacity: 1; }
  12.5% { opacity: 1; transform: scaleX(1); }
  18%, 100% { opacity: 0; transform: scaleX(1); }
}
@keyframes duel-beam {
  0%, 12% { opacity: 0; transform: scaleX(0); }
  12.5% { opacity: 1; transform: scaleX(0.04); }
  16.25% { opacity: 1; transform: scaleX(1); }
  22%, 100% { opacity: 0; transform: scaleX(1); }
}
@keyframes duel-curve {
  0%, 16% { transform: none; stroke: #5d9bff; opacity: 1; }
  17% { transform: translate(2px, -1px); stroke: #ffb08a; opacity: 1; }
  18.5% { transform: translate(-2px, 1px); opacity: 0.55; }
  20% { transform: translate(1px, 0); opacity: 1; }
  23%, 90% { transform: none; stroke: #4f7fd6; opacity: 0.75; }
  100% { transform: none; stroke: #5d9bff; opacity: 1; }
}
@keyframes duel-crack {
  0%, 16.25% { transform: scale(0); opacity: 0; }
  24% { transform: scale(1); opacity: 1; }
  88% { transform: scale(1); opacity: 1; }
  96%, 100% { transform: scale(1); opacity: 0; }
}
@keyframes duel-key {
  0%, 16% { fill: #8fb8ff; }
  16.5%, 92% { fill: #ff7a59; }
  100% { fill: #8fb8ff; }
}
@keyframes duel-flash {
  0%, 16% { opacity: 0; transform: scale(0.2); }
  17% { opacity: 1; transform: scale(0.45); }
  26%, 100% { opacity: 0; transform: scale(1.6); }
}
@keyframes duel-node {
  0%, 16.25% { transform: scale(1); fill: var(--cyan); }
  19% { transform: scale(1.9); fill: #e6fdff; }
  27%, 100% { transform: scale(1); fill: var(--cyan); }
}
@keyframes duel-ring {
  0%, 16.25% { opacity: 0; transform: scale(0.3); }
  17.5% { opacity: 0.9; }
  32%, 100% { opacity: 0; transform: scale(3.2); }
}
@keyframes duel-caption {
  0%, 18% { opacity: 0.25; }
  24%, 88% { opacity: 1; }
  96%, 100% { opacity: 0.25; }
}

/* What each one is, side by side; the line that matters most on each side stands out. */
.duel-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.duel-card { min-width: 0; padding: 12px 14px; background: rgba(3, 7, 13, 0.3); border: 1px solid var(--glass); border-radius: 12px; }
.duel-card.classic { border-color: rgba(40, 125, 255, 0.35); }
.duel-card.pq { border-color: rgba(33, 230, 255, 0.45); box-shadow: 0 0 26px -12px rgba(33, 230, 255, 0.75); }
/* Margins, not gap: flexbox gap came to WebKit only in Safari 14.1. */
.duel-card-head { display: flex; flex-wrap: wrap; align-items: center; margin-bottom: 2px; }
.why-body .duel-card-head > * { margin: 0 10px 4px 0; }
.duel-card-head b { font: 600 0.92rem/1.4 var(--heading); color: var(--text-hi); }
.duel-card ul { margin: 0; padding-left: 1.1em; color: var(--text-mid); font-size: 0.9rem; }
.duel-card li + li { margin-top: 4px; }
.duel-card.classic li:last-child { color: #ffb08a; }
.duel-card.pq li:nth-child(2) { color: #9ff3ff; }
.why-body .duel-outlook {
  margin: 12px 0 0;
  padding: 10px 14px;
  color: var(--text-hi);
  background: linear-gradient(90deg, rgba(33, 230, 255, 0.08), transparent);
  border-left: 2px solid var(--cyan);
}
/* On a phone the drawings take the width; the quantum computer's name goes to a line of its own below. */
@media (max-width: 640px) {
  .duel-cards { grid-template-columns: minmax(0, 1fr); }
  .duel { --orb: 22px; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); }
  .duel-caption { font-size: 0.7rem; }
  .duel-attacker { grid-area: 3 / 1 / 4 / 4; }
}

/* tb1z here, bc1z on mainnet: the same kind of address, so nobody wonders whether theirs is wrong. */
.prefix-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin: 0 0 18px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(33, 230, 255, 0.08), rgba(40, 125, 255, 0.05));
  border: 1px solid rgba(33, 230, 255, 0.32);
  border-radius: var(--radius);
  box-shadow: var(--glow);
}
.prefix-pair { display: flex; align-items: center; gap: 10px; flex: 0 1 auto; min-width: 0; max-width: 100%; }
.prefix-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-strong);
  background: rgba(3, 7, 13, 0.3);
  flex: 0 1 auto;
  min-width: 0;
}
.prefix-chip b { font-size: 1.15rem; letter-spacing: 0.02em; }
.prefix-chip small { color: var(--text-dim); font-size: 0.75rem; text-align: center; overflow-wrap: anywhere; }
.prefix-chip.here { border-color: rgba(33, 230, 255, 0.55); }
.prefix-chip.here b { color: var(--cyan); }
.prefix-chip.main b { color: var(--text-mid); }
.prefix-eq { font: 600 1.2rem/1 var(--mono); color: var(--text-dim); }
.prefix-text { flex: 1 1 280px; min-width: 0; }
.prefix-text p { margin: 0; max-width: 80ch; color: var(--text-mid); }
.prefix-text .prefix-title { margin-bottom: 4px; font: 600 1rem/1.4 var(--heading); color: var(--text-hi); }

/* The two kinds of signature, told apart at a glance: classical in cobalt, post-quantum in cyan. */
.sig-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 10px;
  font: 500 0.74rem/1.7 var(--mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
  border-radius: 999px;
}
.sig-badge::before { content: ""; width: 7px; height: 7px; flex: none; }
.sig-badge.classic { color: #a9c7ff; background: rgba(40, 125, 255, 0.12); border: 1px solid rgba(40, 125, 255, 0.4); }
.sig-badge.classic::before { border-radius: 50%; background: #5d9bff; }
.sig-badge.pq { color: var(--cyan); background: rgba(33, 230, 255, 0.08); border: 1px solid rgba(33, 230, 255, 0.38); }
.sig-badge.mixed { color: #c6e4ff; background: rgba(33, 160, 255, 0.1); border: 1px solid rgba(64, 180, 255, 0.4); }
.sig-badge.mixed::before { border-radius: 50%; background: linear-gradient(90deg, #5d9bff 50%, var(--cyan) 50%); }
.sig-badge.pq::before {
  background:
    radial-gradient(circle, var(--cyan) 1px, transparent 1.5px) 0 0 / 3.5px 3.5px;
}
.wallet .account { position: relative; overflow: hidden; }
.wallet .account::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, #287dff, rgba(40, 125, 255, 0));
}
.wallet .account.pq::before { background: linear-gradient(90deg, #21e6ff, #287dff 60%, rgba(40, 125, 255, 0)); }
.wallet .account.mixed::before { background: linear-gradient(90deg, #287dff, #21e6ff 45%, rgba(33, 230, 255, 0)); }
/* The mixed address (M3) takes the whole row under the other two. */
.wallet-grid > .account.mixed { grid-column: 1 / -1; }
/* A faint lattice behind the post-quantum address. */
.wallet .account.pq {
  background:
    radial-gradient(circle, rgba(33, 230, 255, 0.09) 1px, transparent 1.4px) 0 0 / 14px 14px,
    var(--panel);
}
.acct-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.wallet .acct-head h2 { margin: 0; }
.acct-purpose { color: var(--text-mid); font-size: 0.93rem; }
.wallet .address { padding: 10px 14px; background: rgba(3, 7, 13, 0.3); border: 1px solid var(--glass); border-radius: 12px; }
.wallet .address[aria-busy] { color: var(--cyan); }
.wallet dd.arriving { color: #f6dd92; }
.wallet dd.switched { color: var(--cyan); }
details.tech summary { cursor: pointer; color: var(--text-dim); font-size: 0.88rem; }
details.tech summary:hover { color: var(--cyan); }
details.tech p { margin-top: 8px; }
.create-gets { display: flex; flex-wrap: wrap; gap: 8px; }

/* Transactions on their way. */
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.wallet .card-head h2 { margin: 0; }
.tx-list { list-style: none; margin: 0 0 12px; padding: 0; }
.tx-empty { padding: 14px 0; color: var(--text-dim); font-size: 0.92rem; }
.tx {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 14px;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  animation: rise 0.35s ease-out both;
}
.tx:last-child { border-bottom: 0; }
.tx-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font: 600 1rem/1 var(--mono);
  color: var(--cyan);
  background: rgba(33, 230, 255, 0.08);
  border: 1px solid rgba(33, 230, 255, 0.25);
}
.tx.in .tx-icon::before { content: "↓"; }
.tx.out .tx-icon::before { content: "↑"; }
.tx.between .tx-icon::before { content: "⇄"; }
.tx.out .tx-icon { color: #a9c7ff; background: rgba(40, 125, 255, 0.1); border-color: rgba(40, 125, 255, 0.3); }
.tx-main { display: flex; flex-direction: column; min-width: 0; }
.tx-title { font-weight: 600; overflow-wrap: anywhere; }
.tx-id { font-size: 0.8rem; color: var(--text-dim); }
.tx-side { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.tx-amount { font: 600 1rem/1.4 var(--heading); font-variant-numeric: tabular-nums; }
.tx.in .tx-amount { color: #9ff3c4; }
.tx-state { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-mid); }
.tx.mempool .tx-state, .tx.broadcast .tx-state { color: #f6dd92; }
.tx.confirmed .tx-state { color: #9ff3c4; }
.tx.confirmed .dot { width: 14px; height: 14px; border-radius: 50%; background: rgba(53, 199, 126, 0.2); position: relative; }
.tx.confirmed .dot::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 2px;
  width: 4px;
  height: 7px;
  border: solid var(--good);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  animation: tick 0.4s ease-out both;
}
.tx.broadcast .dot { background: var(--cyan); }
.tx.unknown .tx-state { color: var(--text-dim); }
@keyframes tick {
  from { opacity: 0; transform: rotate(45deg) scale(0.3); }
  to { opacity: 1; transform: rotate(45deg) scale(1); }
}

/* Steps shown one after another (motion.ts Steps): making a wallet, and a send. */
ol.flow { position: relative; list-style: none; margin: 14px 0 12px; padding: 18px 0 0; counter-reset: steps; }
ol.flow::before, ol.flow::after { content: ""; position: absolute; top: 0; left: 0; height: 3px; border-radius: 3px; }
ol.flow::before { right: 0; background: rgba(255, 255, 255, 0.07); }
ol.flow::after {
  width: calc(var(--progress, 0) * 100%);
  background: var(--gradient);
  box-shadow: 0 0 12px rgba(33, 230, 255, 0.6);
  transition: width 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
ol.flow li { position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 26px; padding: 3px 0 9px 36px; color: var(--text-dim); transition: color 0.3s; }
ol.flow li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 20px;
  height: 20px;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}
ol.flow li.active { color: var(--text-hi); }
ol.flow li.active::before { border-color: rgba(33, 230, 255, 0.25); border-top-color: var(--cyan); animation: spin 0.8s linear infinite; }
ol.flow li.done { color: var(--text-mid); }
ol.flow li.done::before { border-color: var(--good); background: rgba(53, 199, 126, 0.16); }
ol.flow li.done::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 7px;
  width: 5px;
  height: 9px;
  border: solid var(--good);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  animation: tick 0.3s ease-out both;
}
ol.flow li.failed { color: #ffc9c6; }
ol.flow li.failed::before { border-color: var(--bad); background: rgba(229, 84, 79, 0.16); }
ol.flow li.failed::after { content: "×"; position: absolute; left: 0; top: 2px; width: 20px; text-align: center; font: 700 0.9rem/20px var(--mono); color: var(--bad); }
.step-note { display: block; color: var(--text-dim); font-size: 0.8rem; overflow-wrap: anywhere; animation: rise 0.3s ease-out both; }
ol.flow li.done .step-note, ol.flow li.active .step-note { color: #9fdbe6; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Making, restoring or opening a wallet. */
.wallet .forge {
  max-width: 720px;
  margin-inline: auto;
  padding: 30px 32px;
  background:
    linear-gradient(115deg, transparent 40%, rgba(33, 230, 255, 0.06) 50%, transparent 60%) 0 0 / 250% 100%,
    var(--panel);
  animation: rise 0.4s ease-out both, sweep 2.6s linear infinite;
}
.wallet .forge h2.forge-title { margin: 0 0 4px; font-size: clamp(1.35rem, 3vw, 1.7rem); }
.forge ol.flow li { font-size: 0.98rem; }
@keyframes sweep { from { background-position: 100% 0, 0 0; } to { background-position: -150% 0, 0 0; } }
.send-steps { max-width: 640px; }

/* The faucet's report of a claim: the steps behind it, then the ways on. */
ol.flow.claim-flow { max-width: 640px; }
.claim-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 8px; }

/* A reminder until the backup code has been shown or copied once. */
.wallet .backup.todo { border-color: rgba(239, 193, 60, 0.35); }
.backup-todo { margin-bottom: 10px; }
.choices .choice .sig-badge { margin-left: 4px; }

/* The challenge desk: the cost table keeps its three columns on a phone, and the column of the spend signed
   above stands out; the node's reason, word for word, stays one box however many lines it takes. */
.challenge th, .challenge td { padding: 8px 10px; }
.challenge td:first-child { white-space: normal; }
.challenge .this { color: var(--cyan); }
.challenge code { display: inline-block; }

/* --- Guide ----------------------------------------------------------------------------------------- */

.guide-toc { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 22px 0 26px; padding: 0; list-style: none; }
.guide-toc a { display: inline-block; padding: 4px 14px; color: var(--text-mid); border: 1px solid var(--glass); border-radius: 999px; }
.guide-toc a:hover { color: var(--cyan); text-decoration: none; border-color: rgba(33, 230, 255, 0.5); }
.guide-section { margin-bottom: 18px; scroll-margin-top: 90px; }
.guide-section h2 { margin: 0 0 12px; }
.guide-section h3 { margin: 18px 0 4px; font-size: 1rem; }
.guide-section p, .guide-section li { max-width: 78ch; }
.guide-section p { margin: 0 0 12px; }
.guide-section ul { margin: 0 0 12px; padding-left: 1.2em; }
.guide-section ul li { margin: 4px 0; }
ol.guide-steps { list-style: none; margin: 14px 0; padding: 0; counter-reset: guide; }
ol.guide-steps li { position: relative; min-height: 30px; margin: 0 0 12px; padding-left: 42px; counter-increment: guide; }
ol.guide-steps li::before {
  content: counter(guide);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font: 500 0.78rem/1 var(--mono);
  color: var(--cyan);
  background: rgba(33, 230, 255, 0.08);
  border: 1px solid rgba(33, 230, 255, 0.3);
  border-radius: 10px;
}
.guide-section .panel { margin: 14px 0 4px; max-width: 78ch; }
/* Commands to copy: kept on their lines and scrolled sideways on a narrow screen, never wrapped. */
.guide-section pre, .download-section pre { max-width: 78ch; margin: 8px 0 10px; padding: 10px 12px; overflow-x: auto; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass); border-radius: 8px; }
.guide-section pre code, .download-section pre code { padding: 0; font-size: 0.8rem; white-space: pre; overflow-wrap: normal; background: none; border: 0; border-radius: 0; }
strong.ui { white-space: nowrap; padding: 0 7px; font: 600 0.9em/1.5 var(--heading); color: var(--text-hi); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--glass); border-radius: 7px; }
.guide-end { margin: 8px 0 30px; }
.nowrap { white-space: nowrap; }

/* --- Home page of ark0.si (home.py) -------------------------------------------------------------- */

/* Sections are linked by id: they stop below the header, which stays on top from 641 px up. */
.home-hero, .home-section { overflow-wrap: anywhere; scroll-margin-top: 84px; }
/* The hero: the text, and on wide screens the mark beside it with a faint cyan glow. */
.home-hero { display: flex; align-items: center; gap: 40px; }
.home-intro { flex: 1 1 auto; min-width: 0; }
.home-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.home-mark { flex: none; width: 220px; margin-right: 12px; }
.home-mark .mark { display: block; width: 220px; height: 220px; filter: var(--halo-filter) drop-shadow(0 0 28px rgba(33, 230, 255, 0.3)); }

/* The rules by height: four cards, then two, then one. */
.rule-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 14px; }
.home-section .try-grid { margin-bottom: 14px; }
.home-rule { display: flex; flex-direction: column; padding: 20px 20px 18px; }
.rule-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.rule-height { color: var(--cyan); }
.rule-milestone { padding: 1px 10px; font: 500 0.75rem/1.5 var(--mono); letter-spacing: 0.08em; }
.home-rule h3 + p { font-size: 0.92rem; color: var(--text-mid); }
.rule-since { margin: auto 0 0; padding-top: 8px; font-size: 0.84rem; color: var(--text-dim); }

/* Where to check it: the repositories, then the release key and the network side by side. */
.repo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0 16px; }
.home-repo { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; color: var(--text-mid); transition: border-color 0.2s, box-shadow 0.2s; }
.home-repo:hover { text-decoration: none; border-color: rgba(33, 230, 255, 0.4); box-shadow: var(--glow); }
.repo-name { font-size: 0.95rem; color: var(--cyan); }
.repo-body { font-size: 0.9rem; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.check-grid .panel { margin: 0; padding: 20px 22px; }
.key-label { margin: 0 0 4px; font: 500 0.7rem/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); }
/* The fingerprint as gpg prints it, two spaces in the middle kept; it wraps at its spaces on a phone. */
.fingerprint { margin: 0 0 14px; font-size: 1rem; color: var(--text-hi); white-space: pre-wrap; user-select: all; -webkit-user-select: all; }
.home-params dl.kv { grid-template-columns: minmax(110px, auto) minmax(0, 1fr); margin: 0; padding: 0; background: none; border: 0; }

/* The milestones: a thin line with a dot for each. */
ol.timeline { position: relative; margin: 14px 0 0; padding: 0 0 0 26px; list-style: none; }
ol.timeline::before { content: ""; position: absolute; left: 6px; top: 12px; bottom: 12px; width: 1px; background: linear-gradient(rgba(33, 230, 255, 0.5), rgba(40, 125, 255, 0.15)); }
ol.timeline li { position: relative; display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 2px 18px; padding: 6px 0; }
ol.timeline li::before { content: ""; position: absolute; left: -24px; top: 13px; width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px rgba(33, 230, 255, 0.5); }
ol.timeline time { color: var(--cyan); white-space: nowrap; }

/* The questions: two columns on wide screens. */
.faq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 36px; }
.faq-item p { color: var(--text-mid); }

@media (max-width: 1000px) {
  .rule-grid, .repo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .home-mark { display: none; }
  .check-grid, .faq-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .rule-grid, .repo-grid { grid-template-columns: minmax(0, 1fr); }
  .home-hero, .home-section { scroll-margin-top: 0; }
  .home-params dl.kv { grid-template-columns: minmax(0, 1fr); }
  ol.timeline li { grid-template-columns: minmax(0, 1fr); }
}

/* --- Download page of ark0.si (download.py) ---------------------------------------------------------- */

/* One card per system, linked by id (/download#android): two columns, then one. */
.system-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.system { display: flex; flex-direction: column; min-width: 0; scroll-margin-top: 84px; }
.system h3 { margin: 0 0 4px; font-size: 1.15rem; }
.system-req { color: var(--text-mid); font-size: 0.92rem; }
/* Each file: its button, its name and size, its SHA-256, how to install it. */
.system-file, .system-cert { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--glass); }
.system-file .button { margin-bottom: 12px; }
.file-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0 0 8px; }
.file-name { color: var(--text-hi); }
.file-size { color: var(--text-dim); font-size: 0.88rem; white-space: nowrap; }
.file-hash { margin: 0 0 10px; }
.file-hash .key-label { display: block; }
/* Hashes are selected whole with one click and wrap anywhere on a narrow screen. */
.hash { display: block; margin: 0; color: var(--text-hi); word-break: break-all; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.download-section ol.guide-steps li, .download-section > p { max-width: 78ch; }
.download-key { max-width: 640px; }
.download-key .fingerprint { margin: 0; }
.download-section .panel { max-width: 78ch; }
.download-section .panel p:last-child { margin: 0; }
/* The other ways in: bullets of its own, which take the halo. */
ul.download-more { list-style: none; margin: 0; padding-left: 1.2em; }
ul.download-more li { position: relative; margin: 6px 0; max-width: 78ch; }
ul.download-more li::before { content: "•"; position: absolute; right: 100%; margin-right: 0.45em; white-space: nowrap; }
@media (max-width: 760px) {
  .system-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .system { scroll-margin-top: 0; }
}

/* --- Lists over the lattice ------------------------------------------------------------------------ */

/* A list marker takes no text-shadow (CSS Lists 3 limits what ::marker can use), so the halo cannot reach it over
   the lattice: these lists draw their own numbers, bullets and disclosure triangle, which inherit the halo. */
ol.steps, .duel-card ul, .guide-section ul, details.tech summary { list-style: none; }
ol.steps { counter-reset: step; }
ol.steps li, .duel-card li, .guide-section ul li { position: relative; }
ol.steps li { counter-increment: step; }
ol.steps li::before { content: counter(step) "."; position: absolute; right: 100%; margin-right: 0.5em; white-space: nowrap; }
.duel-card li::before, .guide-section ul li::before { content: "•"; position: absolute; right: 100%; margin-right: 0.45em; white-space: nowrap; }
details.tech summary::-webkit-details-marker { display: none; }
details.tech summary::before { content: "▸"; display: inline-block; width: 1em; transition: transform 0.2s; }
details.tech[open] summary::before { transform: rotate(90deg); }

/* --- Footer ---------------------------------------------------------------------------------------- */

footer.site-footer { border-top: 1px solid var(--glass); background: rgba(3, 7, 13, 0.3); }
footer.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-block: 26px 30px; }
.foot-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-mid); font-size: 0.9rem; flex: 1 1 320px; }
.foot-brand .mark { width: 22px; height: 22px; flex: none; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.9rem; }
.foot-links a { color: var(--text-mid); }
.foot-links a:hover { color: var(--cyan); }
.foot-note { flex: 1 0 100%; margin: 0; font-size: 0.8rem; color: var(--text-dim); }

/* --- Narrow screens -------------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .try-grid, .faucet-grid, .wallet-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  header.top { position: static; }
  .wrap { padding-inline: 16px; }
  .bar { gap: 8px 16px; padding-block: 10px; }
  nav.nav { margin-left: 0; }
  form.search { flex-basis: 100%; max-width: none; margin-left: 0; }
  dl.kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; padding: 16px 18px; }
  dl.kv dd { margin-bottom: 10px; }
  .stat-value { font-size: clamp(1.15rem, 6vw, 1.55rem); }
  .card, section.p2mr { padding: 20px 18px; }
  .mldsa44, .tripwired { padding: 14px; }
}
/* On a phone the header is three lines at most, the longest labels (Russian, Japanese) included: the brand, then the
   links and the language menu in two lines; the pill and the menu stay 32 px high. */
@media (max-width: 480px) {
  nav.nav { gap: 6px 10px; }
  nav.nav a, nav.nav .lang-menu summary { font-size: 0.84rem; }
  html:lang(ja) nav.nav a, html:lang(ja) nav.nav .lang-menu summary { font-size: 0.8rem; }
  nav.nav a.nav-download { gap: 4px; padding: 3px 10px 3px 8px; }
  nav.nav .lang-menu summary { padding: 2px 9px; }
}
/* The Turnstile widget is 300 px wide at least: from 360 px screens up it fits the claim card, below that
   the card gives up its frame. */
@media (max-width: 400px) {
  .wrap { padding-inline: 14px; }
  .card { padding: 18px 14px; }
}
@media (max-width: 359px) {
  .wrap { padding-inline: 10px; }
  .claim-card { padding: 0; background: none; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  /* The note for a wallet that never starts shows by an animation's delay: that one stays. */
  :not(.wallet-stuck), ::before, ::after { animation: none !important; }
}
