/* Classic phone-directory look: yellow newsprint, black ink, narrow type, ruled columns. */

:root {
  --paper: #f6d64a;
  --paper-light: #fbe57f;
  --ink: #17140f;
  --ink-soft: #3d3626;
  --rule: #17140f;
  --red: #a8201a;
  --amber: #7a4b00;
  --green: #1f5a1a;
  --narrow: "Archivo Narrow", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --black: "Archivo Black", "Arial Black", Impact, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

/* Dark mode is the same page with ink and paper swapped: yellow type on a black sheet.
   It follows the system unless the toggle stored a choice (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17140f;
    --paper-light: #221d14;
    --ink: #f6d64a;
    --ink-soft: #c4aa45;
    --rule: #f6d64a;
    --red: #ff7b6b;
    --amber: #f0a73a;
    --green: #8fd67c;
  }
}

:root[data-theme="dark"] {
  --paper: #17140f;
  --paper-light: #221d14;
  --ink: #f6d64a;
  --ink-soft: #c4aa45;
  --rule: #f6d64a;
  --red: #ff7b6b;
  --amber: #f0a73a;
  --green: #8fd67c;
}

/* Testnet: the same directory printed on blue stock, so it is never mistaken for the real one.
   data-network is set from the node's chain type (and early from a testnet.* hostname). */
:root[data-network="testnet"] {
  --paper: #a4d4f4;
  --paper-light: #c6e5f9;
  --ink: #0b1a2c;
  --ink-soft: #23405e;
  --rule: #0b1a2c;
  --red: #9e1b16;
  --amber: #6a3f00;
  --green: #17501a;
}

@media (prefers-color-scheme: dark) {
  :root[data-network="testnet"]:not([data-theme="light"]) {
    --paper: #0b1622;
    --paper-light: #13212f;
    --ink: #86c8f2;
    --ink-soft: #5f9fca;
    --rule: #86c8f2;
    --red: #ff7b6b;
    --amber: #f0a73a;
    --green: #8fd67c;
  }
}

:root[data-network="testnet"][data-theme="dark"] {
  --paper: #0b1622;
  --paper-light: #13212f;
  --ink: #86c8f2;
  --ink-soft: #5f9fca;
  --rule: #86c8f2;
  --red: #ff7b6b;
  --amber: #f0a73a;
  --green: #8fd67c;
}

* {
  box-sizing: border-box;
}

/* Component display rules (buttons, banners) must not override the hidden attribute. */
[hidden] {
  display: none !important;
}

html {
  background: var(--paper);
}

/* The footer stays at the bottom of the window on short pages. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--narrow);
  font-size: 16px;
  line-height: 1.35;
}

a {
  color: inherit;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
}

/* ---------- masthead ---------- */

.masthead {
  background: var(--ink);
  color: var(--paper);
}

.masthead-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--black);
  font-size: clamp(34px, 7vw, 64px);
  letter-spacing: -0.02em;
  line-height: 0.9;
}

/* Testnet stamp after the name; the same word in every language. */
:root[data-network="testnet"] .brand-title::after {
  content: "TESTNET";
  display: inline-block;
  vertical-align: top;
  margin-left: 0.5em;
  padding: 3px 6px 2px;
  border: 2px solid currentColor;
  font-family: var(--narrow);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.12em;
  line-height: 1;
}

.brand-sub {
  font-style: italic;
  font-size: 18px;
  margin-top: 6px;
}

/* Every link in the nav is the same height box, so they line up. */
.masthead-nav {
  --nav-h: 34px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.masthead-nav a {
  height: var(--nav-h);
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
}

.masthead-nav a {
  text-decoration: none;
  padding: 0 12px;
}

.masthead-nav a:hover {
  border-color: var(--paper);
}

.masthead-nav .cta {
  background: var(--paper);
  color: var(--ink);
}

/* ---------- wallet (header control and its panel) ---------- */

.wallet {
  position: relative;
}

.masthead-nav button.wallet-toggle {
  height: var(--nav-h);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--paper);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.masthead-nav button.wallet-toggle:hover,
.masthead-nav button.wallet-toggle[aria-expanded="true"] {
  background: var(--paper);
  color: var(--ink);
}

.wallet-toggle .wallet-addr {
  font-family: var(--mono);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.wallet-toggle .wallet-more {
  font-size: 12px;
}

.wallet-toggle .more-word {
  display: none;
}

/* Wallet on another network than the site: a small amber dot on the button. */
.wallet-toggle.warn::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  outline: 2px solid var(--paper);
}

.wallet-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: 340px;
  max-width: calc(100vw - 32px);
  padding: 16px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 15px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  display: grid;
  gap: 14px;
}

.wallet-panel section {
  display: grid;
  gap: 8px;
}

.wallet-panel section + section {
  border-top: 1px solid var(--ink);
  padding-top: 14px;
}

.wallet-panel h3 {
  font-family: var(--black);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 14px;
  line-height: 1.2;
  margin: 0;
}

.wallet-panel p {
  margin: 0;
}

.wallet-panel .fine {
  font-size: 13px;
  color: var(--ink-soft);
}

/* Connected: "Connected with Velora" on the left, the network on the right. */
.wallet-panel .wallet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.net-chip {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border: 1px solid var(--ink);
  white-space: nowrap;
}

button.wallet-option {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: stretch;
}

button.wallet-option:disabled {
  cursor: progress;
  opacity: 0.8;
}

button.wallet-option[aria-busy="true"] .icon {
  animation: retry-spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  button.wallet-option[aria-busy="true"] .icon {
    animation: none;
  }
}

/* No wallet in this browser: the news in a quiet box, then one full-width way forward. */
.wallet-empty {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--paper-light);
  border-left: 3px solid var(--ink);
}

.wallet-empty .icon {
  flex: none;
  height: 1lh;
}

/* Same as the "connect" button of a wallet that is there. The masthead's own link rules
   (fixed height, outline colours) must not reach it, hence the long selector. */
.masthead-nav .wallet-panel .wallet-get {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  justify-self: stretch;
  height: auto;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--black);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

.masthead-nav .wallet-panel .wallet-get:hover {
  background: transparent;
  color: var(--ink);
}

/* The address and its button: one height, one border. */
.wallet-watch {
  display: flex;
  gap: 6px;
}

.wallet-watch input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 13px;
  padding: 6px 8px;
  border: 2px solid var(--ink);
  background: var(--paper-light);
  color: var(--ink);
}

.wallet-panel .wallet-watch button {
  width: auto; /* not the phones' full-width submit buttons */
  padding: 6px 14px;
  border: 2px solid var(--ink);
  font-size: 12px;
}

.wallet-accounts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

/* Two lines per account: name over what it holds on the left, address and copy on the right. */
.wallet-accounts li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 10px;
  padding: 8px 10px;
  background: var(--paper-light);
  border-left: 3px solid var(--ink);
}

/* Name and what the account holds: a link to its box on the wallet page. */
.wallet-panel a.wallet-acc {
  display: grid;
  gap: 1px;
  height: auto;
  padding: 0;
  border: 0;
  text-decoration: none;
  font-size: 14px;
}

.wallet-panel a.wallet-acc:hover .wallet-label,
.wallet-panel a.wallet-acc:focus-visible .wallet-label {
  text-decoration: underline;
}

.wallet-accounts .wallet-label {
  font-weight: 700;
}

.wallet-has {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wallet-has .icon {
  width: 13px;
  height: 13px;
}

/* The panel sits inside the masthead nav: undo its link box (fixed height, inline-flex). */
.wallet-panel a.wallet-mine {
  justify-self: stretch;
  justify-content: center;
  height: auto;
  padding: 10px 16px;
}

/* Counts on the left, Disconnect on the right; the wallet's note, if any, under both. */
.wallet-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  border-top: 1px solid var(--ink);
  padding-top: 12px;
}

.wallet-foot > p {
  flex-basis: 100%;
}

/* A button that reads as a plain link: for quiet actions such as "Disconnect". */
button.text-btn {
  margin-left: auto;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: 700 14px var(--narrow);
  text-transform: none;
  letter-spacing: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

button.text-btn:hover {
  background: transparent;
  color: var(--red);
}

.wallet-error {
  color: var(--red);
  font-weight: 700;
}

/* An address with its small square icons (copy, explorer) right after it. */
.addr-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.addr-line code {
  font-size: 13px;
  margin-right: 2px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
}

.icon-btn .icon {
  width: 15px;
  height: 15px;
}

button.icon-btn:hover,
.icon-btn:hover {
  background: transparent;
  border-color: var(--ink);
}

/* ---------- Get listed: the numbered steps under the form ---------- */

.ad-steps {
  list-style: none;
  margin: 24px 0 8px;
  padding: 22px 0 0;
  border-top: 2px solid var(--rule);
}

.ad-step {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 14px;
  padding-bottom: 20px;
}

.ad-step:last-child {
  padding-bottom: 0;
}

/* The thread from one marker down to the next. */
.ad-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 36px;
  bottom: 6px;
  border-left: 2px dotted var(--ink-soft);
}

.ad-step[data-state="done"]:not(:last-child)::before {
  border-left-style: solid;
  border-color: var(--green);
}

.step-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--ink);
  font-family: var(--black);
  font-size: 15px;
  line-height: 1;
}

.step-mark .icon {
  width: 18px;
  height: 18px;
}

.ad-step[data-state="todo"] .step-mark {
  border-style: dashed;
  color: var(--ink-soft);
  border-color: var(--ink-soft);
}

.ad-step[data-state="current"] .step-mark {
  background: var(--ink);
  color: var(--paper);
}

.ad-step[data-state="done"] .step-mark {
  border-color: var(--green);
  color: var(--green);
}

.ad-step[data-state="bad"] .step-mark {
  border-color: var(--red);
  color: var(--red);
}

.result .ad-step h3 {
  margin: 6px 0 10px;
}

.ad-step[data-state="todo"] h3 {
  color: var(--ink-soft);
}

/* The last thing shown, even when a hidden button (step 1's retry) comes after it. */
.step-body > :last-child,
.step-body > :nth-last-child(1 of :not([hidden])) {
  margin-bottom: 0;
}

/* ---------- removing a listing with the wallet ---------- */

/* The owner's own listing: what they can do with it, in plain sight above the details. */
.owner-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 18px 0 0;
  padding: 10px 12px;
  border: 2px solid var(--ink);
}

.owner-bar p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
}

.owner-bar-actions,
.remove-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.owner-bar-actions .button,
.remove-actions button {
  font-size: 13px;
  padding: 8px 14px;
  border: 2px solid var(--ink);
}

.remove-panel {
  margin: 14px 0 0;
  padding: 14px;
  border: 2px solid var(--red);
  background: var(--paper);
}

.slot .remove-panel {
  margin: 0 14px 14px;
}

.remove-panel h3 {
  font-family: var(--black);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 16px;
  margin: 0 0 6px;
  color: var(--red);
}

.remove-panel > p {
  margin: 0 0 4px;
}

.remove-panel .ad-cost {
  margin: 10px 0 14px;
}

.remove-panel .wallet-error {
  margin: 10px 0 0;
}

.remove-actions {
  justify-content: flex-end;
  align-items: center;
}

.remove-actions .wallet-error.quiet {
  flex: 1 1 200px;
  margin: 0;
}

button.danger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--red);
  color: var(--paper);
}

.remove-actions button.danger {
  border-color: var(--red);
}

button.danger:hover {
  background: transparent;
  color: var(--red);
}

button.danger:disabled,
.remove-actions .button:disabled,
.owner-bar-actions .button:disabled,
.slot-actions .button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.owner-bar-actions .button:disabled:hover,
.slot-actions .button:disabled:hover {
  background: transparent;
  color: var(--ink);
}

.remove-panel h3:focus {
  outline: none; /* the panel's red border already shows where the focus went */
}

button.danger[aria-busy="true"] {
  opacity: 1;
  cursor: progress;
}

button.danger[aria-busy="true"] .icon {
  animation: retry-spin 0.8s linear infinite;
}

/* Sent, waiting for the chain: one spinner, the news, and the transaction (removal and step 3). */
.chain-wait {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--paper);
  border: 2px dashed var(--ink-soft);
  font-weight: 400;
}

.chain-wait .icon {
  height: 1lh;
  animation: retry-spin 0.8s linear infinite;
}

.chain-wait > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.remove-wait {
  margin: 12px 0 0;
}

/* Removed: the same one-line card as a listing that went live. */
.remove-panel.done {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  border-color: var(--green);
}

.wallet-page .remove-panel.done {
  margin: 0 0 16px;
}

/* Phones: the buttons share the row in equal parts; removing stacks, the red one first. */
@media (max-width: 600px) {
  /* One column: each label sits over its value, small and in capitals like "Available". */
  dl.ad-cost {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
  }

  dl.ad-cost dt {
    padding-right: 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
  }

  dl.ad-cost dd + dt {
    margin-top: 8px;
  }

  dl.ad-cost .sign-check {
    grid-column: 1;
  }

  /* The dashed rule goes above the label only; its value follows straight under it. */
  dl.ad-cost .sign-check + dt + dd {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  button.sign-button {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .owner-bar-actions,
  .done-actions {
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    width: 100%;
  }

  /* Up to three buttons after a removal: one per row. */
  .remove-panel.done .done-actions {
    grid-auto-flow: row;
  }

  .remove-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .remove-actions button.danger {
    order: -1;
  }

  .remove-actions .wallet-error.quiet {
    order: 1; /* under the buttons on a phone */
  }

  .owner-bar-actions .button,
  .done-actions .button,
  .remove-actions button {
    justify-self: stretch;
    justify-content: center;
    text-align: center;
    min-height: 44px;
  }

  .owner-bar-actions .button {
    display: inline-flex;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  button.danger[aria-busy="true"] .icon,
  .chain-wait .icon {
    animation: none;
  }
}

/* ---------- signing with a wallet (Get listed, step 2) ---------- */

.sign-account {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 10px;
}

/* With a wallet, the account row leads the cost box. */
.ad-cost dt,
.ad-cost dd {
  align-self: center;
}

.ad-cost .sign-check {
  grid-column: 2;
}

.ad-cost .sign-check .account-check {
  margin: 0;
  font-size: 14px;
}

.ad-cost .sign-check:has(> .account-check:empty) {
  display: none;
}

/* The amounts start under a dashed rule, apart from the account. Both cells stretch to the
   row's height, so the rule stays one straight line when the value wraps. */
.ad-cost .sign-check + dt,
.ad-cost .sign-check + dt + dd {
  align-self: stretch;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--rule);
}

/* The button, then each message on its own line; "cancelled" sits beside the button instead. */
.sign-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 12px 0 4px;
}

.sign-box p {
  flex-basis: 100%;
}

.sign-box p.wallet-error.quiet {
  flex: 1 1 220px;
}

button.sign-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

button.sign-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.sign-button[aria-busy="true"] {
  opacity: 1;
  cursor: progress;
}

button.sign-button[aria-busy="true"] .icon {
  animation: retry-spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  button.sign-button[aria-busy="true"] .icon {
    animation: none;
  }
}

.sign-box p {
  margin: 0;
}

.sign-box p:empty {
  display: none;
}

.sign-sent {
  font-weight: 700;
  color: var(--green);
}

/* "Cancelled in the wallet" is a choice, not a failure. */
.wallet-error.quiet {
  color: var(--ink-soft);
  font-weight: 400;
}

.wallet-hint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 8px 10px;
  border: 1px dashed var(--ink);
}

.wallet-hint span {
  flex: 1 1 220px;
}

/* ---------- my listings (#/wallet): one box per account ---------- */

.wallet-page .card-lead {
  margin-bottom: 18px;
}

.wallet-page > .notice {
  margin: 0 0 14px;
}

.slots {
  display: grid;
  gap: 16px;
}

.slot {
  border: 2px solid var(--ink);
  background: var(--paper);
}

/* Reached from the wallet menu: a short outline so the eye finds it. */
.flash {
  animation: slot-flash 1.6s ease-out;
}

@keyframes slot-flash {
  from {
    outline: 4px solid var(--ink);
    outline-offset: 4px;
  }
  to {
    outline: 4px solid transparent;
    outline-offset: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flash {
    animation: none;
  }
}

/* The account: name and address on the left, what it has available on the right. */
.slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink);
}

.slot-who {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
}

.slot-label {
  font-weight: 700;
  font-size: 16px;
}

.slot-balance {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.slot-key {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.slot-value {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
}

/* Its listing: what it is on the left, the actions on the right (below it on phones). */
.slot-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  padding: 16px 14px;
  background: var(--paper-light);
}

.slot-main {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1 1 260px;
}

.slot-main p {
  margin: 0;
}

.slot-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}


.slot-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* Meta items separated by a middle dot. */
.slot-meta > span + span::before {
  content: "·";
  margin: 0 8px;
}

.slot-featured {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--ink);
}

.slot-featured .icon {
  width: 14px;
  height: 14px;
}

.slot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slot-actions .button {
  font-size: 13px;
  padding: 8px 14px;
  border: 2px solid var(--ink);
}

/* Secondary action next to a primary one: same size, outlined. */
.button.outline {
  background: transparent;
  color: var(--ink);
}

.button.outline:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Accounts with nothing on them: one compact row each, inside a single box. */
.slots + .empty-accounts {
  margin-top: 16px;
}

.empty-accounts .slot-head {
  justify-content: flex-start;
  gap: 4px 12px;
}

.empty-accounts ul {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--paper-light);
}

.empty-accounts li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 14px;
}

.empty-accounts li + li {
  border-top: 1px solid var(--ink);
}

.empty-accounts .slot-who {
  flex: 1 1 260px;
}

.empty-accounts .button {
  font-size: 13px;
  padding: 6px 12px;
}

.wallet-page .slot-note {
  margin: 18px 0 0;
}

/* On phones the panel spans the screen under the masthead instead of hanging off one edge. */
@media (max-width: 600px) {
  .wallet {
    position: static;
  }

  .masthead-inner {
    position: relative;
  }

  .wallet-panel {
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
  }

  .wallet-watch input {
    font-size: 16px; /* keeps iOS from zooming in */
    min-height: 44px;
  }

  .masthead-nav .wallet-panel .wallet-get {
    min-height: 44px;
  }

  .slot-actions {
    width: 100%;
  }

  .slot-actions .button {
    flex: 1;
    text-align: center;
  }

  /* An empty account: its balance, then the button over the rest of the row, as tall as the others. */
  .empty-accounts .button {
    flex: 1;
    text-align: center;
    font-size: 13px;
    padding: 9px 14px;
  }
}

.edition-bar {
  border-top: 1px solid var(--paper);
  max-width: 1200px;
  margin: 0 auto;
  padding: 4px 16px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- banners ---------- */

.banner {
  margin: 12px max(16px, calc((100% - 1168px) / 2)) 0;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  font-weight: 600;
}

.banner.warn {
  background: var(--paper-light);
}

.banner.bad {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- page ---------- */

/* Grows to push the footer down; auto side margins would otherwise shrink it to its content. */
.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 3px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 10px 0;
  margin-bottom: 18px;
}

.search label {
  font-family: var(--black);
  text-transform: uppercase;
  white-space: nowrap;
}

.search input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 18px;
  padding: 6px 10px;
  background: var(--paper-light);
  border: 2px solid var(--ink);
  color: var(--ink);
}

.columns {
  column-count: 3;
  column-gap: 28px;
  column-rule: 1px solid var(--rule);
}

@media (max-width: 960px) {
  .columns {
    column-count: 2;
  }
}

@media (max-width: 600px) {
  .columns {
    column-count: 1;
  }
  .search {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Categories may continue in the next column, like a printed directory, so the columns stay even.
   A listing is never cut, and a heading never ends a column on its own. */
.category {
  margin-bottom: 18px;
}

.category-head {
  break-after: avoid;
}

/* break-after alone is not always honoured when the columns balance, so the heading travels with its first listing. */
.category-start {
  break-inside: avoid;
}

.category-head,
.section-head {
  font-family: var(--black);
  font-size: 15px;
  letter-spacing: 0.08em;
  background: var(--ink);
  color: var(--paper);
  margin: 0 0 8px;
  padding: 3px 8px;
}

/* ---------- listings ---------- */

/* The whole row opens the listing: the name link is stretched over it. */
.listing {
  position: relative;
  break-inside: avoid;
  padding: 3px 0;
}

.listing-name::after {
  content: "";
  position: absolute;
  inset: 0;
}

.listing-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.listing-name {
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
}

.listing-name:hover {
  text-decoration: underline;
}

.leader {
  flex: 1;
  min-width: 12px;
  border-bottom: 2px dotted var(--ink-soft);
  transform: translateY(-4px);
}

.listing-tail {
  flex: 1 0 auto;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.listing-addr {
  font-family: var(--mono);
  font-size: 13px;
  white-space: nowrap;
}

/* The connected wallet's own listings, marked in the directory. */
.listing-yours {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 4px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.listing-sub {
  font-size: 14px;
  padding-left: 12px;
  color: var(--ink-soft);
  /* One line, so every row keeps the same rhythm; the listing's page has the whole location. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing.featured {
  border: 3px double var(--ink);
  background: var(--paper-light);
  padding: 8px 10px;
  margin: 6px 0 10px;
}

.listing.featured .listing-line {
  flex-wrap: wrap;
}

.listing.featured .listing-loc {
  font-size: 14px;
  color: var(--ink-soft);
}


.listing.featured .listing-name {
  flex-basis: 100%;
  max-width: none;
  white-space: normal;
  font-family: var(--black);
  font-weight: 400;
  font-size: 19px;
  text-transform: uppercase;
  /* Two lines at most in the directory; the listing's own page has the whole name. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Without a location (the dots follow the name), the address joins the name's line, dots
   between, like any other row. A name too long for both pushes them to the next line. */
.listing.featured .listing-name:has(+ .listing-tail) {
  flex-basis: auto;
}

.listing.featured .listing-tail .leader {
  min-width: 24px;
}

.listing-bio {
  margin: 6px 0 4px;
  font-style: italic;
  /* Three lines at most in the directory; the listing's own page has all of it. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.listing-links {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  font-size: 14px;
}

.listing-links li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 1px 0;
}

/* Label and address share one line: a long label gives way first, so the address stays readable. */
.listing-links .link-label,
.listing-links a {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* A short label never gives way; a long one stops at 45%. The address takes what is left. */
.listing-links .link-label {
  flex: none;
  max-width: 45%;
}

/* "+N more ···· View listing →": the same row as the links, but it opens the listing itself. */
.listing-more .link-label {
  font-weight: 400;
  color: var(--ink-soft);
}

.listing-more-go {
  flex: none;
  font-weight: 600;
  white-space: nowrap;
}

.listing:hover .listing-more-go {
  text-decoration: underline;
}

/* Above the name's stretched link, so they open the site instead of the listing. */
.listing-links a {
  flex: 0 1 auto;
  position: relative;
  z-index: 1;
  font-weight: 600;
  max-width: 65%;
}

/* One icon size everywhere, relative to the adjacent text (1.2em). Inline holders (badge, tip) are exactly
   one line tall and center the icon in it, so the icon sits on the middle of the text line it belongs to. */
.icon {
  display: block;
  flex: none;
  width: 1.2em;
  height: 1.2em;
}

.badge,
button.tip {
  display: inline-flex;
  align-items: center;
  height: 1lh;
  vertical-align: top;
  flex: none;
}

.badge {
  cursor: help;
}

/* Badges sit at the end of a row, so their tooltip opens leftwards instead of past the column edge. */
button.tip.badge::after {
  left: auto;
  right: 0;
  transform: none;
}

/* Multi-line notices: the icon box is one line tall, so it centers on the first line of text. */
.warning .icon,
.notice .icon {
  height: 1lh;
}

/* Beats button.tip's hover colour, so a status keeps its colour while its tooltip is open. */
button.tip.badge.ok {
  color: var(--green);
}
button.tip.badge.bad {
  color: var(--red);
}
button.tip.badge.warn {
  color: var(--amber);
}
button.tip.badge.muted {
  color: var(--ink-soft);
}

.empty {
  border: 2px dashed var(--ink);
  padding: 28px;
  text-align: center;
  font-size: 18px;
}

/* ---------- other anchors (collapsed) ---------- */

.others {
  margin-top: 28px;
  overflow-x: auto;
}

.others summary {
  cursor: pointer;
}

.registry {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.registry th {
  text-align: left;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--rule);
  padding: 4px 8px 4px 0;
}

.registry td {
  border-bottom: 1px dotted var(--ink-soft);
  padding: 5px 8px 5px 0;
  vertical-align: middle;
}

.registry td a {
  font-family: var(--mono);
  font-size: 13px;
}

/* ---------- entry card ---------- */

.card {
  --card-pad-y: 22px;
  --card-pad-x: 22px;
  max-width: 760px;
  margin: 0 auto;
  border: 4px double var(--ink);
  background: var(--paper-light);
  padding: var(--card-pad-y) var(--card-pad-x);
}

/* Featured: a heavier frame and a solid band reaching the frame on three sides. */
.card.featured {
  border-width: 6px;
}

.card-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  margin: calc(-1 * var(--card-pad-y)) calc(-1 * var(--card-pad-x)) var(--card-pad-y);
  padding: 9px var(--card-pad-x);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--black);
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-banner > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card-banner .icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.card-banner-locked {
  font-family: var(--narrow);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.back {
  display: inline-block;
  font-weight: 700;
  margin-bottom: 12px;
}

.card-cat {
  font-size: 13px;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.card-top .back {
  margin-bottom: 0;
}

/* Category, featured stamp and verdict; right-aligned, and still right-aligned when they wrap below. */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 10px;
  margin-left: auto;
}

.card-name {
  font-family: var(--black);
  font-weight: 400;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1;
  margin: 18px 0 8px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

/* The listing's status as a compact badge (a tip: the full sentence shows on hover or tap). */
button.tip.verdict {
  gap: 5px;
  height: auto;
  padding: 3px 8px;
  border: 2px solid currentColor;
  font-weight: 700;
  font-size: 14px;
  cursor: help;
}

/* Retry next to an unavailable verdict: icon only, as tall as the verdict (one text line + padding + border). */
button.tip.verdict.retry {
  min-height: calc(1lh + 10px);
  padding: 3px 5px;
  color: var(--ink);
  cursor: pointer;
}

button.tip.verdict.retry.busy .icon {
  animation: retry-spin 0.8s linear infinite;
}

@keyframes retry-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  button.tip.verdict.retry.busy .icon {
    animation: none;
  }
}

/* At the right edge, so the tooltip opens leftwards. */
button.tip.verdict::after {
  left: auto;
  right: 0;
  transform: none;
}

/* Beats button.tip's hover colour, like the status badges. */
button.tip.verdict.ok {
  color: var(--green);
}
button.tip.verdict.bad {
  color: var(--red);
}
button.tip.verdict.warn {
  color: var(--amber);
}
button.tip.verdict.muted {
  color: var(--ink-soft);
}

.warning,
.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.warning {
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  font-weight: 700;
}

/* Close under the name: it reads as the name's subtitle. */
.card-bio {
  font-size: 19px;
  font-style: italic;
  margin: 0 0 16px;
}

/* The location belongs to the name, so it sits close below it, before the description. */
.card-loc {
  margin: 0 0 12px;
  color: var(--ink-soft);
}

/* A form's introduction, close under its title like a listing's description. */
.card-lead {
  margin: 0;
}

.card-links,
.card-files {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.card-links li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 0;
  font-size: 18px;
}

.link-label {
  font-weight: 700;
}

.card-links a {
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* One line per link, as in the directory: a long label gives way first, then the address; the
   browser still shows the whole address on hover. */
.card-links:not(.card-facts) .link-label,
.card-links:not(.card-facts) a,
.card-links:not(.card-facts) .link-blocked {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-links:not(.card-facts) .link-label {
  flex: none;
  max-width: 45%;
}

.link-blocked {
  text-decoration: line-through;
  color: var(--ink-soft);
}

.card-files li {
  padding: 2px 0;
}

.hash {
  color: var(--ink-soft);
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  border-top: 2px solid var(--rule);
  padding-top: 12px;
  margin: 20px 0 12px;
}

.facts dt {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding-top: 2px;
}

.facts dd {
  margin: 0;
  min-width: 0;
}

.wrap {
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  .facts {
    grid-template-columns: 1fr;
  }
  .facts dd {
    margin-bottom: 6px;
  }
}

.fine {
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- advertise form ---------- */

.ad-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 4px;
  font-weight: 700;
}

/* Label on the left, "12 / 80" on the right. */
.field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.field .count {
  font-weight: 400;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.field .count.full {
  color: var(--amber);
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.ad-cost select {
  font: inherit;
  font-weight: 400;
  padding: 6px 8px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
}

button,
.button {
  font-family: var(--black);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  justify-self: start;
}

button:hover,
.button:hover {
  background: var(--ink-soft);
}

/* Secondary actions (copy, explorer): outlined, smaller. */
/* No taller than a line of text, so a row with buttons keeps the height of the others. */
button.small,
.button.small {
  font-size: 12px;
  line-height: 1.2;
  padding: 3px 8px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

button.small:hover,
.button.small:hover {
  background: var(--ink);
  color: var(--paper);
}

.result h3 {
  font-family: var(--black);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 16px;
  margin: 22px 0 8px;
}

.result pre,
details.tech pre,
.extras-panel pre {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 10px;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* What activating costs, read at a glance before the details. */
.ad-cost {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 0; /* the space between columns is the dt's padding, so a row's rule runs unbroken */
  margin: 12px 0 16px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
}

.ad-cost dt {
  font-weight: 700;
  padding-right: 14px;
}

.ad-cost dd {
  margin: 0;
}

.result input[readonly] {
  background: transparent;
}

.account-check {
  margin: 6px 0 12px;
  font-size: 15px;
  color: var(--ink-soft);
}

.account-check.ok {
  color: var(--green);
  font-weight: 700;
}

.account-check.warn {
  color: var(--amber);
  font-weight: 700;
}

.account-check.bad {
  color: var(--red);
  font-weight: 700;
}

.ad-request-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 12px 0 6px;
}

.activation.ok {
  color: var(--green);
  font-weight: 700;
}

/* Step 3 done: one line, the news on the left and the way to the listing on the right. */
.ad-step .activation.ok {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 14px;
  border: 2px solid var(--green);
  color: var(--ink);
  font-weight: 400;
}

.done-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.done-text strong {
  color: var(--green);
}

.done-text span {
  font-family: var(--black);
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.done-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Side by side, one size: the secondary one (explorer, My listings) only loses its fill. */
.done-actions .button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.2;
  padding: 8px 14px;
  border: 2px solid var(--ink);
}

.done-actions .button.small,
.done-actions .button.outline {
  background: transparent;
  color: var(--ink);
}

.done-actions .button.small:hover,
.done-actions .button.outline:hover {
  background: var(--ink);
  color: var(--paper);
}

/* The buttons after "Activated" or "already live": their own row, side by side. */
.listing-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

/* Right under step 1's line (an update with nothing to change): close to it, not a paragraph away. */
.result > .listing-actions {
  margin-top: -10px;
}

.activation.waiting::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: skel-pulse 1.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .activation.waiting::before {
    animation: none;
  }
}

/* ---------- footer ---------- */

.colophon {
  width: 100%;
  max-width: 1200px;
  margin: 32px auto 0;
  padding: 14px 16px 28px;
  border-top: 3px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
}

#stats {
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 14px;
}

.colophon-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

/* The page's promise as a stamp, like the verdict on a listing card; the explanation is its tooltip. */
button.tip.seal {
  gap: 6px;
  height: auto;
  padding: 3px 9px;
  border: 2px solid currentColor;
  color: var(--green);
  font-weight: 700;
  font-size: 14px;
  cursor: help;
}

button.tip.seal:hover,
button.tip.seal.open {
  color: var(--green);
}

/* It sits at the left edge, so the tooltip opens rightwards. */
button.tip.seal::after {
  left: 0;
  transform: none;
}

/* Language and theme: one height, ink on paper (the masthead above is the inverse). */
.prefs {
  --pref-h: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch,
.spec-link,
button.theme-toggle {
  height: var(--pref-h);
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ink);
}

.lang-switch button {
  height: 100%;
  font-family: var(--narrow);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* The profile format (spec/) is a square like the theme toggle; its name is the tooltip. */
.spec-link,
button.theme-toggle {
  width: var(--pref-h);
  justify-content: center;
  padding: 0;
  background: transparent;
  color: var(--ink);
}

.spec-link:hover,
button.theme-toggle:hover {
  background: var(--ink);
  color: var(--paper);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- tooltips ---------- */

/* A help icon; its text comes from data-tip and shows on hover, keyboard focus or tap (.open). */
button.tip {
  position: relative;
  padding: 0 1px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
}

button.tip:hover,
button.tip.open {
  background: transparent;
  color: var(--ink);
}

button.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 300px;
  padding: 8px 10px;
  background: var(--ink);
  color: var(--paper-light);
  font: 400 14px/1.35 var(--narrow);
  text-align: left;
  white-space: normal;
  z-index: 10;
  visibility: hidden;
  pointer-events: none;
}

button.tip:hover::after,
button.tip:focus-visible::after,
button.tip.open::after {
  visibility: visible;
}

/* On phones the text docks to the bottom of the screen instead of risking the edges. */
@media (max-width: 600px) {
  button.tip::after,
  button.tip.badge::after,
  button.tip.seal::after,
  button.tip.verdict::after {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    transform: none;
    width: auto;
    max-width: none;
    padding: 12px 14px;
    font-size: 16px;
    border: 2px solid var(--paper);
    box-shadow: 0 6px 24px rgb(0 0 0 / 0.45);
  }
}

/* ---------- collapsed details ---------- */

details.tech,
details.how {
  margin-top: 18px;
  border-top: 1px dotted var(--ink-soft);
  padding-top: 8px;
}

details.tech > summary,
details.how > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-soft);
}

/* The explanation reads as the answer to its question, right under it. */
details.how > p {
  margin: 4px 0 0;
}

/* Open, the summary is ruled off from its content like the listing card's panels. */
details.tech[open] > summary {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--rule);
}

details.tech p {
  margin: 14px 0 6px;
}

/* The summary's own margin is the gap to whatever opens first, so every section opens alike. */
details.tech > summary + * {
  margin-top: 0;
}

/* ---------- listing card extras ---------- */

/* Toggles in one row under a dotted rule, styled like the summaries above; the open panel spans the card. */
.card-extras {
  margin-top: 18px;
  border-top: 1px dotted var(--ink-soft);
  padding-top: 8px;
}

.extras-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

button.extras-toggle {
  padding: 0;
  background: transparent;
  color: var(--ink-soft);
  font: 700 14px var(--narrow);
  letter-spacing: 0;
  text-transform: none;
}

button.extras-toggle::before {
  content: "▸";
  margin-right: 6px;
}

button.extras-toggle[aria-expanded="true"]::before {
  content: "▾";
}

button.extras-toggle:hover,
button.extras-toggle[aria-expanded="true"] {
  background: transparent;
  color: var(--ink);
}

/* Every open panel is set off from the toggles by the same rule, whatever it holds. */
.extras-panel {
  margin-top: 12px;
  border-top: 2px solid var(--rule);
  padding-top: 12px;
}

.extras-panel .facts {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

/* Update and remove side by side; stacked on phones. */
.owner-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px 24px;
  align-items: start;
}

.owner-actions .button {
  white-space: nowrap;
}

.owner-actions p {
  margin: 0 0 10px;
}

.owner-actions .fine {
  margin: 8px 0 0;
}

@media (max-width: 600px) {
  .owner-actions {
    grid-template-columns: 1fr;
  }
}

/* Listed since and account: leader rows like the links, a little smaller; the copy and explorer
   buttons move under the address when the row is too narrow. */
/* Set off by a dotted rule rather than a gap, but only when links or files come right before. */
.card-links:not(.card-facts) + .card-facts,
.card-files + .card-facts {
  margin-top: -6px;
  padding-top: 8px;
  border-top: 1px dotted var(--ink-soft);
}

.card-facts li {
  align-items: center;
  flex-wrap: wrap;
  font-size: 16px;
}

/* Centred rows (the buttons are taller than the text), so the dots drop to the text's baseline. */
.card-facts .leader {
  transform: translateY(5px);
}

.card-facts .link-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}


/* Same mark as the masthead's TESTNET: a ruled box of small capitals after the category. */
.stamp {
  display: inline-block;
  padding: 2px 5px 1px;
  border: 2px solid currentColor;
  font-size: 0.85em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  vertical-align: 1px;
}

.card-cat a {
  text-decoration: none;
}

.card-cat a:hover {
  text-decoration: underline;
}

/* ---------- advertise extras ---------- */

.link-rows {
  display: grid;
  gap: 6px;
}

.link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 6px;
}

.link-row input {
  font: inherit;
  font-weight: 400;
  padding: 6px 8px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
}

.link-row input:invalid:not(:placeholder-shown) {
  border-color: var(--red);
}

button.link-add {
  background: transparent;
  color: var(--ink);
  font: 700 14px var(--narrow);
  text-transform: none;
  letter-spacing: 0;
  padding: 4px 0;
  text-decoration: underline;
}

button.link-add:hover {
  background: transparent;
  color: var(--ink-soft);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.check > span {
  flex: 1;
}

.check label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.upload-status {
  font-weight: 700;
}

.upload-status.ok {
  color: var(--green);
}

.upload-status.bad {
  color: var(--red);
}

.notice {
  border-left: 4px solid var(--amber);
  padding: 4px 0 4px 10px;
  font-size: 15px;
}

/* Placeholders in the page's soft ink instead of the browser's grey; italic so they never read as typed text. */
::placeholder {
  color: var(--ink-soft);
  font-style: italic;
  opacity: 1;
}

/* ---------- checkbox ---------- */

/* Drawn in the page's ink instead of the browser default; the tick is a rotated border (no images under the CSP). */
input[type="checkbox"] {
  appearance: none;
  flex: none;
  display: inline-grid;
  place-items: center;
  font-size: 16px;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 2px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
}

input[type="checkbox"]::before {
  content: "";
  width: 0.32em;
  height: 0.62em;
  margin-top: -0.12em;
  border: solid var(--paper);
  border-width: 0 0.16em 0.16em 0;
  transform: rotate(45deg);
  visibility: hidden;
}

input[type="checkbox"]:checked {
  background: var(--ink);
}

input[type="checkbox"]:checked::before {
  visibility: visible;
}

input[type="checkbox"]:hover:not(:checked) {
  background: var(--paper-light);
}

/* ---------- phones ---------- */

/* Help icons and badges are small; an invisible pad makes them a comfortable finger target. */
button.tip::before {
  content: "";
  position: absolute;
  inset: -10px;
}

.cat-jump {
  display: none;
}

@media (max-width: 600px) {
  .page {
    padding: 12px;
  }

  /* Sticky category row; it scrolls sideways when the categories do not fit. */
  .cat-jump {
    display: flex;
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 5;
    margin: -10px -12px 12px;
    padding: 8px 12px;
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }

  .cat-jump::-webkit-scrollbar {
    display: none;
  }

  .cat-jump button {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    font-family: var(--narrow);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--paper-light);
    color: var(--ink);
    border: 2px solid var(--ink);
    cursor: pointer;
  }

  .cat-jump .count {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-soft);
  }

  .cat-jump button[aria-current] {
    background: var(--ink);
    color: var(--paper);
  }

  .cat-jump button[aria-current] .count {
    color: inherit;
  }

  /* Leave room for the sticky row when jumping to a category. */
  .category {
    scroll-margin-top: 64px;
  }

  .masthead-inner {
    padding: 14px 12px 10px;
    gap: 10px;
  }

  .masthead-nav {
    --nav-h: 40px;
    width: 100%;
    gap: 8px;
  }

  /* Two halves of the full width; the directory link gets an outline so both read as buttons. */
  .masthead-nav a {
    flex: 1;
    justify-content: center;
    padding: 0 8px;
  }

  .masthead-nav a:not(.cta) {
    border-color: var(--paper);
  }

  /* The wallet gets the row under them, full width; its panel's rows keep their own layout. */
  .masthead-nav .wallet {
    flex: 1 1 100%;
  }

  .masthead-nav button.wallet-toggle {
    width: 100%;
    justify-content: center;
  }

  .wallet-toggle .more-word {
    display: inline;
  }

  .masthead-nav .wallet-panel a {
    flex: none;
  }

  .wallet-panel a.wallet-acc {
    justify-content: stretch;
  }

  .prefs {
    --pref-h: 40px;
  }

  .lang-switch button {
    padding: 0 12px;
  }

  /* 16px keeps iOS from zooming into the page when a field is focused. */
  .search input,
  .field input,
  .field select,
  .field textarea,
  .ad-cost select,
  .link-row input {
    font-size: 16px;
  }

  .search input {
    padding: 10px 12px;
  }

  .field input,
  .field select,
  .ad-cost select,
  .link-row input {
    min-height: 44px;
  }

  /* Taller rows: easier to hit with a thumb, and to scan. */
  .listing:not(.featured) {
    padding: 9px 0;
    border-bottom: 1px dotted var(--ink-soft);
  }

  .listing.featured {
    margin: 8px 0;
  }

  /* Taller links in a boxed listing, so a thumb opens the site and not the listing around it. */
  .listing-links li {
    padding: 0;
    font-size: 15px;
  }

  .listing-links a {
    padding: 6px 0;
  }

  .listing-name {
    max-width: 62%;
  }

  .card {
    --card-pad-y: 18px;
    --card-pad-x: 14px;
    border-width: 3px;
  }

  .card.featured {
    border-width: 5px;
  }

  .card-name {
    overflow-wrap: anywhere;
  }

  /* A long name would fill the first screen at the full size. */
  .card-name.long {
    font-size: 22px;
    line-height: 1.1;
  }

  button[type="submit"],
  .result .button {
    width: 100%;
    min-height: 48px;
    text-align: center;
  }

  .link-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding-bottom: 8px;
    border-bottom: 1px dotted var(--ink-soft);
  }

  /* Other records: each row becomes a two-line entry instead of a cramped four-column table. */
  /* Stacked rows fit the width, so no scroller (it would also catch the badges' invisible touch pads). */
  .others {
    overflow-x: visible;
  }

  .registry,
  .registry tbody {
    display: block;
  }

  .registry thead {
    display: none;
  }

  .registry tr {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "account status"
      "what since";
    gap: 2px 12px;
    padding: 8px 0;
    border-bottom: 1px dotted var(--ink-soft);
  }

  .registry td {
    border: 0;
    padding: 0;
  }

  .registry td:nth-child(1) {
    grid-area: account;
  }

  .registry td:nth-child(2) {
    grid-area: what;
  }

  .registry td:nth-child(3) {
    grid-area: status;
    justify-self: end;
  }

  .registry td:nth-child(4) {
    grid-area: since;
    justify-self: end;
    color: var(--ink-soft);
    font-size: 13px;
  }
}

/* ---------- loading skeleton ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Ink at low opacity, so it reads right on every palette and theme. */
.skel {
  display: block;
  height: 0.8em;
  margin: 6px 0;
  background: var(--ink);
  opacity: 0.12;
  animation: skel-pulse 1.4s ease-in-out infinite;
}

.skel.on-ink {
  background: var(--paper);
  opacity: 0.35;
  margin: 3px 0;
}

.skel.tall {
  height: 1.1em;
}

.skel.title {
  height: 0.85em;
  margin: 0;
}

.skel.w-badge {
  width: 110px;
  height: 30px;
  margin: 0;
}

.w-20 { width: 20%; }
.w-25 { width: 25%; }
.w-30 { width: 30%; }
.w-40 { width: 40%; }
.w-45 { width: 45%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-70 { width: 70%; }
.w-80 { width: 80%; }
.w-90 { width: 90%; }

/* A name on the left, an address on the right: the shape of a directory row. */
.skel-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.skel-head {
  padding: 4px 8px;
}

.skel-rows {
  margin-top: 18px;
}

@keyframes skel-pulse {
  50% {
    opacity: 0.05;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skel {
    animation: none;
  }
}

/* No empty slot before the seal while the count is still unknown. */
#stats:empty {
  display: none;
}
