/* Bona Fide's brand, shared with the landing page's Certificate design: its typefaces, its palette
   and the identity in each page's top bar. The pages have one theme, light, whatever the system's
   setting. The build copies each file named here by its path in the repo into assets/. */

@font-face {
  font-family: "Big Shoulders Display";
  src: url("big-shoulders-display-203dd8ba4a.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Hanken Grotesk";
  src: url("hanken-grotesk-1f21c6eaa0.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Azeret Mono";
  src: url("azeret-mono-20cbb53806.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --page: #f6f4f9;
  --band: #efebf6;
  --paper: #ece6f6;
  --paper-2: #e9f1ee;
  --paper-3: #eee7f3;
  --seal-bg: #f3eef9;
  --ink: #2b2459;
  --ink-deep: #1d1838;
  --green: #3f7a6b;
  --green-deep: #346a5c;
  --red: #c8323c;
  --red-deep: #b02a34;
  --mint: #a8e6d2;
  --rule: #dcd5ea;
  --rule-2: #cfc6e4;
  --numeral: #8a80b0;
  --on-ink: #f6f4f9;
  --on-ink-2: #dcd5ea;

  --font-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", sans-serif;
  --font-body:
    "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Azeret Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

.bf-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.bf-brand:hover {
  color: var(--ink-deep);
  text-decoration: none;
}

.bf-brand .mark svg {
  width: 40px;
  height: 40px;
}

.bf-brand .area {
  overflow: hidden;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
}

/* Bona Fide's pages: the deposit page, the Maintainer's pages and the public repo page. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
}

[hidden] {
  display: none !important;
}

img,
svg {
  display: block;
}

/* Until a page's script first shows its state, only its loading card shows. */
html:not([data-rendered]) [data-show]:not([data-show~="loading"]),
html:not([data-rendered]) [data-hide],
html:not([data-rendered]) [data-if] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:root {
  --bg: var(--page);
  --surface: #ffffff;
  --surface-2: var(--band);
  --text: #1d1838;
  --text-2: #5a547a;
  --border: var(--rule);
  /* The edge of a control: 3:1 against white and the page. */
  --border-strong: var(--numeral);
  --accent: var(--ink);
  --accent-hover: var(--ink-deep);
  --accent-soft: var(--paper);
  --link: var(--ink);
  --ok: var(--green-deep);
  --ok-soft: #e4f1ec;
  --ok-border: #b5d6cb;
  --warn: #8a5a00;
  --warn-soft: #fdf4e3;
  --warn-border: #f0d9a8;
  --danger: var(--red-deep);
  --danger-strong: var(--red);
  --danger-soft: #fbe9ea;
  --danger-border: #efc2c6;
  --shadow: 0 1px 2px rgba(43, 36, 89, 0.05), 0 14px 34px -22px rgba(43, 36, 89, 0.4);
  --shadow-lift: 0 12px 30px -10px rgba(43, 36, 89, 0.6);
  --radius: 14px;
  --mono: var(--font-mono);
}

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

/* Links are the ink of the text, so the underline marks them. */
a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a[href]:hover {
  color: var(--red-deep);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  border-radius: 6px;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.86em;
}

code {
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: var(--surface-2);
}

.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon.md {
  width: 18px;
  height: 18px;
}

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

/* Top bar */

.bf-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1080px;
  height: 64px;
  margin: 0 auto;
  padding: 0 24px;
}

/* The bar's rule runs the width of the window, as on the landing page. */
.bf-top::after {
  position: absolute;
  top: 64px;
  left: 0;
  width: 100%;
  border-top: 1px solid var(--border);
  content: "";
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--ok);
}

.dot.warn {
  background: var(--warn);
}

/* Page layout */

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

.page.narrow {
  max-width: 740px;
}

.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 40px;
  align-items: start;
}

/* Repo and item names keep their case, so labels that carry them aren't set in capitals. */
.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.4vw, 64px);
  font-weight: 900;
  line-height: 0.9;
  text-transform: uppercase;
  overflow-wrap: break-word;
}

.lede {
  max-width: 62ch;
  margin-top: 14px;
  color: var(--text-2);
  font-size: 17px;
}

.item-line {
  margin-top: 10px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 13px;
}

.item-line strong {
  color: var(--text);
  font-weight: 600;
}

.amount {
  margin: 22px 0 24px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 104px;
  font-weight: 900;
  line-height: 0.85;
  font-variant-numeric: tabular-nums;
}

.amount .unit {
  margin-left: 12px;
  color: var(--green-deep);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.section-title {
  margin: 0 0 10px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* The rules: what happens to a Deposit */

.outcomes {
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--ink);
  list-style: none;
}

.outcomes li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule-2);
}

.outcomes li:last-child {
  border-bottom: 2px solid var(--ink);
}

.outcomes .when {
  font-weight: 600;
}

.outcomes .detail {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 14px;
}

.outcomes .back {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* What comes back after a Forfeit, in the red the landing page gives it. */
.outcomes .ico.accent ~ .back {
  color: var(--red-deep);
}

.outcomes .back small {
  display: block;
  margin-top: 4px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* A ringed stamp around each icon. */
.ico {
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  color: var(--text-2);
}

.ico.ok {
  color: var(--ok);
}

.ico.accent {
  color: var(--ink);
}

.ico.warn {
  color: var(--warn);
}

.ico.danger {
  color: var(--danger);
}

.promise {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
}

.promise .icon {
  margin-top: 3px;
  color: var(--mint);
}

.fine {
  margin-top: 16px;
  color: var(--text-2);
  font-size: 13px;
}

.fine + .fine {
  margin-top: 8px;
}

/* Cards and panels */

.card {
  padding: 26px;
  border: 1px solid var(--rule-2);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 16px;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: uppercase;
}

.card h2 + p,
.card h2 + .muted {
  margin-top: 8px;
}

.muted {
  color: var(--text-2);
}

.stack > * + * {
  margin-top: 14px;
}

.stack > .choices {
  margin-top: 22px;
}

.hint {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--text-2);
  font-size: 13.5px;
}

.hint .icon {
  margin-top: 3px;
}

.divider {
  height: 1px;
  margin: 20px 0 16px;
  border: 0;
  background: var(--border);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  font: 600 16px/1.2 var(--font-body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn.block {
  display: flex;
  width: 100%;
}

.btn.primary,
a.btn.primary:hover {
  background: var(--accent);
  color: var(--on-ink);
}

.btn.primary:not([disabled], [aria-disabled="true"]):hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

.btn.secondary,
a.btn.secondary:hover {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.btn.secondary:not([disabled], [aria-disabled="true"]):hover {
  background: var(--surface-2);
}

.btn.ghost,
a.btn.ghost:hover {
  min-height: 44px;
  background: transparent;
  color: var(--ink);
}

.btn.ghost:hover {
  background: var(--surface-2);
}

.btn.danger,
a.btn.danger:hover {
  background: var(--danger-strong);
  color: #ffffff;
}

.btn.small {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 14px;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-button:hover {
  color: var(--red-deep);
}

/* Connected wallet */

.wallet {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

/* The certificate's holographic thread, as the wallet's badge. */
.wallet .avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(from 40deg, #ff9ad5, #9ad0ff, #a8ffcf, #fff59a, #ffb38a, #ff9ad5);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.wallet .avatar.other {
  background: conic-gradient(from 200deg, #ffb38a, #fff59a, #9ad0ff, #ff9ad5, #ffb38a);
}

.wallet .who {
  min-width: 0;
}

.wallet .addr {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.wallet .sub {
  color: var(--text-2);
  font-size: 13px;
}

.wallet .end {
  margin-left: auto;
  text-align: right;
}

/* Statuses are stamps: an outline in the status's ink, set in the mono face. */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  color: var(--ok);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag.warn {
  color: var(--warn);
}

.tag.danger {
  color: var(--danger);
}

.tag.neutral {
  color: var(--text-2);
}

.tag.accent {
  color: var(--ink);
}

/* Payment choices */

.choices {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.choices legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
}

.choice {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--rule-2);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.choice:hover {
  border-color: var(--border-strong);
  color: inherit;
  text-decoration: none;
}

.choice.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.choice .radio {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
}

.choice.selected .radio {
  border-color: var(--accent);
  background: radial-gradient(var(--accent) 0 4px, transparent 4.5px);
}

.choice strong {
  font-weight: 600;
}

.choice small {
  display: block;
  margin-top: 2px;
  color: var(--text-2);
  font-size: 13px;
}

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.explain {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14.5px;
}

/* Alerts */

.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.alert > .icon {
  margin-top: 3px;
}

.alert strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 650;
}

.alert p + p {
  margin-top: 6px;
}

.alert.warn {
  border-color: var(--warn-border);
  background: var(--warn-soft);
}

.alert.warn > .icon {
  color: var(--warn);
}

.alert.error {
  border-color: var(--danger-border);
  background: var(--danger-soft);
}

.alert.error > .icon {
  color: var(--danger);
}

.alert.ok {
  border-color: var(--ok-border);
  background: var(--ok-soft);
}

.alert.ok > .icon {
  color: var(--ok);
}

/* Progress and steps */

.progress {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.progress li {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  color: var(--text-2);
}

.progress li::before {
  content: "";
  height: 4px;
  border-radius: 999px;
  background: var(--border);
}

.progress li.done::before {
  background: var(--ok);
}

.progress li.current {
  color: var(--text);
  font-weight: 700;
}

.progress li.current::before {
  background: var(--accent);
}

.waiting {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface-2);
}

.waiting strong {
  display: block;
  margin-bottom: 2px;
}

.spinner {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 1px;
  border: 2.5px solid var(--accent);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn .spinner {
  width: 16px;
  height: 16px;
  margin: 0;
  border-color: currentColor;
  border-right-color: transparent;
}

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

.tx-steps {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  list-style: none;
}

.tx-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
}

.tx-steps li + li {
  border-top: 1px solid var(--border);
}

.tx-steps .num {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.tx-steps li.current .num {
  border-color: var(--accent);
  color: var(--link);
}

.tx-steps .num,
.setup-steps li .num {
  font-family: var(--mono);
}

.tx-steps li.done .num {
  border-color: var(--ok);
  background: var(--ok);
  color: #ffffff;
}

.tx-steps strong {
  font-weight: 600;
}

.tx-steps small {
  display: block;
  margin-top: 2px;
  color: var(--text-2);
  font-size: 13px;
}

/* Definition rows */

.rows {
  margin: 0;
}

.rows > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}

.rows > div:first-child {
  border-top: 0;
}

.rows dt {
  padding-top: 3px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* A field's name, such as validBefore, keeps its case. */
.rows dt code {
  padding: 0;
  background: none;
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
}

.rows dd {
  margin: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.rows dd small {
  display: block;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 400;
}

.rows.compact > div {
  grid-template-columns: 120px minmax(0, 1fr);
  padding: 8px 0;
  font-size: 14px;
}

/* Results */

.result {
  text-align: center;
}

.result .big {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 4px auto 16px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  box-shadow:
    0 0 0 4px var(--surface),
    0 0 0 5px var(--rule-2);
}

.result .big.info {
  background: var(--seal-bg);
  color: var(--ink);
}

.result .big.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.result .big svg {
  width: 28px;
  height: 28px;
}

.result h2 {
  font-size: 34px;
}

.result p {
  margin-top: 8px;
  color: var(--text-2);
}

/* Dialog */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(29, 24, 56, 0.55);
}

.dialog {
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 30px 70px -20px rgba(29, 24, 56, 0.6);
}

.dialog h2 {
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.wallet-option {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--rule-2);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.wallet-option:hover {
  border-color: var(--border-strong);
}

.wallet-option + .wallet-option {
  margin-top: 10px;
}

.wallet-option small {
  display: block;
  color: var(--text-2);
  font-size: 13px;
}

.wallet-option .ico {
  border-radius: 10px;
}

/* Footer */

.bf-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 24px 36px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
}

.page.narrow + .bf-foot {
  max-width: 740px;
}

.bf-foot a {
  color: var(--text-2);
}

/* Setup steps */

.setup-steps {
  display: flex;
  gap: 8px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.setup-steps li {
  display: flex;
  flex: 1;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
}

.setup-steps li .num {
  display: grid;
  width: 24px;
  height: 24px;
  flex: none;
  place-items: center;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 650;
}

.setup-steps li.done .num {
  border-color: var(--ok);
  background: var(--ok);
  color: #ffffff;
}

.setup-steps li.current {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--text);
  font-weight: 600;
}

.setup-steps li.current .num {
  border-color: var(--accent);
  color: var(--link);
}

pre.typed {
  margin: 12px 0 0;
  padding: 14px;
  overflow: auto;
  border-radius: 10px;
  background: var(--surface-2);
  font: 12.5px/1.6 var(--mono);
}

details summary {
  color: var(--link);
  font-weight: 600;
  cursor: pointer;
}

.terms-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.term {
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-2);
}

.term span {
  display: block;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.term strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.term small {
  display: block;
  margin-top: 6px;
  color: var(--text-2);
  font-size: 12.5px;
}

.callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--rule-2);
  border-radius: 14px;
  background: var(--surface);
}

.callout strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 650;
}

.callout p {
  color: var(--text-2);
}

/* Forfeit split */

.split {
  display: flex;
  gap: 2px;
  height: 14px;
  margin: 16px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface);
}

.split .to-fund {
  background: var(--red);
}

.split .to-depositor {
  background: var(--ink);
}

.legend {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legend li {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  transform: translateY(1px);
}

.swatch.fund {
  background: var(--red);
}

.swatch.depositor {
  background: var(--ink);
}

.confirm {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}

.confirm input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

/* Public repo page */

.repo-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1.8px solid currentColor;
  border-radius: 999px;
  color: var(--ok);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status .dot {
  background: currentColor;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.two-col > .card + .card {
  margin-top: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 16px;
  margin-top: 16px;
}

.stat .n {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 900;
  line-height: 0.95;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.stat .l {
  margin-top: 6px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat.wide {
  grid-column: 1 / -1;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  padding: 10px 12px;
  border-bottom: 2px solid var(--ink);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table th:first-child,
.table td:first-child {
  padding-left: 0;
}

.table th:last-child,
.table td:last-child {
  padding-right: 0;
  text-align: right;
}

.table .for strong {
  display: block;
  font-weight: 600;
}

.table .for span {
  color: var(--text-2);
  font-size: 13px;
}

.table .num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.router {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* What waits for Protocol Guild, on the certificate's paper. */
.balance {
  padding: 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--paper), var(--paper-2) 55%, var(--paper-3));
  box-shadow: inset 0 0 0 1px var(--rule-2);
}

.balance > span {
  display: block;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.balance strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 900;
  line-height: 0.95;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.balance small {
  display: block;
  color: var(--text-2);
  font-size: 13px;
}

.path {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--text-2);
  font-size: 14px;
}

.path li + li {
  margin-top: 6px;
}

.exempt-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.exempt-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.exempt-list .icon {
  margin-top: 3px;
  color: var(--ok);
}

/* Phones */

@media (max-width: 860px) {
  .bf-top {
    padding: 0 16px;
  }

  .bf-brand {
    font-size: 21px;
  }

  .bf-brand .mark svg {
    width: 34px;
    height: 34px;
  }

  .page {
    padding: 24px 16px 56px;
  }

  .checkout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* Rules first until the Contributor pays; after that, and when there's nothing to pay, the status. */
  :root:is(
      [data-state="loading"],
      [data-state="signing"],
      [data-state="submitted"],
      [data-state="unconfirmed"],
      [data-state="two-step-deposit"],
      [data-state="confirmed"],
      [data-state="expired"],
      [data-state="cant-sign"],
      [data-state="problem"],
      [data-state="already-active"],
      [data-state="timed-out"],
      [data-state="refunded"],
      [data-state="not-live"]
    )
    .checkout
    > .pay {
    order: -1;
  }

  .amount {
    margin: 18px 0 20px;
    font-size: 84px;
  }

  .amount .unit {
    font-size: 24px;
  }

  .card {
    padding: 20px;
  }

  .card h2 {
    font-size: 26px;
  }

  .outcomes li {
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 14px 0;
  }

  .outcomes .back {
    grid-column: 2;
    font-size: 28px;
    text-align: left;
  }

  .outcomes .back small {
    display: inline;
    margin-left: 6px;
  }

  .rows > div,
  .rows.compact > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .setup-steps {
    flex-direction: column;
  }

  .terms-grid {
    grid-template-columns: 1fr;
  }

  .two-col,
  .router {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exempt-list {
    grid-template-columns: 1fr;
  }

  .table thead {
    display: none;
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
  }

  .table tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }

  .table tr:last-child {
    border-bottom: 0;
  }

  .table td {
    padding: 2px 0;
    border: 0;
    text-align: left;
  }

  .table td:last-child {
    text-align: left;
  }

  .table td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--text-2);
    font-family: var(--font-body);
    font-size: 14px;
  }

  .bf-foot {
    padding: 20px 16px 28px;
  }

  .stat .n {
    font-size: 40px;
  }

  .balance strong {
    font-size: 46px;
  }

  .hide-phone {
    display: none !important;
  }
}

/* Spacing, instead of inline styles */

.mt-8 {
  margin-top: 8px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-14 {
  margin-top: 14px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-20 {
  margin-top: 20px;
}

.mt-24 {
  margin-top: 24px;
}

.mb-16 {
  margin-bottom: 16px;
}

/* Top bar: the network and the connected wallet */

.bf-top .end {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bf-top .pill {
  min-width: 0;
}

/* The deposit page: the terms are the certificate being issued. Its paper, frame, waves and seal are
   the landing page's; the text and the stamps are the page's own. */

.cert {
  position: relative;
  overflow: hidden;
  padding: 46px 42px 38px 50px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--paper), var(--paper-2) 55%, var(--paper-3));
  box-shadow:
    0 40px 70px -46px rgba(43, 36, 89, 0.6),
    0 0 0 1px var(--rule-2);
}

.cert::before {
  position: absolute;
  inset: 0;
  background: url("guilloche-waves-e79bbadd70.svg") center / cover no-repeat;
  opacity: 0.4;
  content: "";
  pointer-events: none;
}

.cert-frame {
  position: absolute;
  inset: 14px 14px 14px 24px;
  border: 1.5px solid var(--ink);
  pointer-events: none;
}

.cert-frame::after {
  position: absolute;
  inset: 5px;
  border: 0.6px solid var(--ink);
  content: "";
}

/* The holographic thread down the certificate's edge. */
.cert-holo {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 10px;
  pointer-events: none;
}

.cert-holo::before,
.cert-holo::after {
  position: absolute;
  inset: 0;
  content: "";
}

.cert-holo::before {
  background: linear-gradient(180deg, #ff9ad5, #9ad0ff, #a8ffcf, #fff59a, #ffb38a, #ff9ad5);
  opacity: 0.85;
  animation: holo 6s linear infinite;
}

.cert-holo::after {
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.35) 0 3px, transparent 3px 9px);
}

@keyframes holo {
  to {
    filter: hue-rotate(360deg);
  }
}

.cert-seal {
  position: absolute;
  top: 34px;
  right: 34px;
  width: 132px;
  aspect-ratio: 1;
  background:
    url("guilloche-rosette-c02412604f.svg") center / contain no-repeat,
    radial-gradient(circle, var(--seal-bg) 0 60%, transparent 61%);
  opacity: 0.9;
  pointer-events: none;
}

.cert > :where(:not(.cert-frame, .cert-holo, .cert-seal)) {
  position: relative;
}

/* The title keeps clear of the seal. */
.cert h1 {
  max-width: calc(100% - 150px);
  color: var(--ink);
  font-size: clamp(40px, 4.6vw, 58px);
}

.cert .fine {
  color: var(--text-2);
}

.item-line a {
  font-weight: 600;
}

.terms-start {
  margin: -8px 0 20px;
  white-space: normal;
}

.stack > .choices + *,
.stack > .link-row {
  margin-top: 10px;
}

.link-row {
  text-align: center;
  font-size: 14px;
}

.inline-note {
  color: var(--text-2);
  font-size: 13px;
  text-align: center;
}

.alert .detail {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .cert {
    padding: 38px 28px 30px 38px;
  }

  .cert-seal {
    top: 28px;
    right: 26px;
    width: 96px;
  }

  .cert h1 {
    max-width: calc(100% - 110px);
  }
}

/* On a phone the seal is small, so the title's longest word stays whole beside it. */
@media (max-width: 480px) {
  .cert-seal {
    width: 64px;
  }

  .cert h1 {
    max-width: calc(100% - 72px);
    font-size: 38px;
  }
}

/* Motion stops when asked: the thread's shimmer and the buttons' lift. The spinner keeps turning,
   since it is the only sign that something is still in progress. */
@media (prefers-reduced-motion: reduce) {
  .cert-holo::before {
    animation: none;
  }

  .btn {
    transition: none;
  }

  .btn.primary:hover {
    transform: none;
  }
}

/* The wallet picker */

.wallet-option img,
.wallet-option .ico {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 10px;
}

.dialog .empty {
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  color: var(--text-2);
  font-size: 14px;
}

.dialog .empty strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

/* Setup: what comes next */

.next-list {
  display: grid;
  gap: 14px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.next-list li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
}

.next-list p {
  color: var(--text-2);
}

pre.example {
  margin: 12px 0 0;
  padding: 14px;
  overflow: auto;
  border-radius: 10px;
  background: var(--surface-2);
  font: 12.5px/1.6 var(--mono);
}

/* The repo page's table */

.table .state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.table .state small {
  color: var(--text-2);
  font-size: 13px;
}

.table td:last-child {
  color: var(--text-2);
  white-space: nowrap;
}

.table .for a {
  color: var(--text);
  font-weight: 600;
}

/* The repo page's decision log */

.decisions {
  margin: 0;
  padding: 0;
  list-style: none;
}

.decision {
  padding: 14px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.decision-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.decision-item {
  color: var(--text);
  font-weight: 600;
}

.decision-time {
  margin-left: auto;
  color: var(--text-2);
  font-size: 13px;
}

.decision p {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

.decision-suggestion {
  font-weight: 500;
}

.decision-reasons {
  margin: 4px 0 0;
  padding-left: 20px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.decision-facts {
  margin-top: 8px;
}

/* A fact's label can name a file, such as VOUCHED.td, so it keeps its case. */
.decision-facts.rows > div {
  grid-template-columns: 210px minmax(0, 1fr);
}

.decision-facts dt {
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.decision-facts dd {
  overflow-wrap: anywhere;
}

.decision .decision-meta {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 13px;
}

.progress-line {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text-2);
  font-size: 14px;
}

.noscript {
  max-width: 740px;
  margin: 24px auto;
  padding: 16px 24px;
}

@media (max-width: 860px) {
  .decision-facts.rows > div {
    grid-template-columns: 1fr;
  }

  .noscript {
    margin: 16px;
  }
}

.status.pending {
  color: var(--warn);
}

/* A repo's name is a link that reads as the heading, in its own case. */
h1 a.plain {
  color: inherit;
  text-decoration: none;
  text-transform: none;
  overflow-wrap: anywhere;
}

/* The Bounty page's forms */

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: start;
}

.fields > .btn,
.fields.single > * {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field label {
  font-size: 14px;
  font-weight: 600;
}

.field small {
  color: var(--text-2);
  font-size: 13px;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 14px;
}

@media (max-width: 860px) {
  .fields {
    grid-template-columns: 1fr;
  }
}

/* Headings the page moves focus to, for screen readers, show no focus ring. */
[tabindex="-1"]:focus {
  outline: none;
}
