/* Geist and Geist Mono (Google Fonts, OFL), self-hosted so no third-party requests */
@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---- design tokens ---- */
:root {
  --bg: #0e1420;
  --panel: #141c2b;
  --panel-2: #0b111c;
  --line: #243247;
  --ink: #e8edf5;
  --muted: #8497b0;
  --faint: #5c6c85;
  --signal: #2fd6c3;
  /* --signal as text on panels; light theme needs a darker teal for 4.5:1 contrast */
  --signal-ink: var(--signal);
  --signal-dim: #173f3c;
  --warn: #f2b04a;
  --danger: #ef6a6a;
  --radius: 14px;
  --mono: "Geist Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root[data-theme="light"] {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #eef1f8;
  --line: #d9dfeb;
  --ink: #16202e;
  --muted: #5c6c85;
  --faint: #8497b0;
  --signal: #0f9c8c;
  --signal-ink: #0a776b;
  --signal-dim: #d7f3ef;
  --warn: #b4720a;
  --danger: #cc3b3b;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f6fb;
    --panel: #ffffff;
    --panel-2: #eef1f8;
    --line: #d9dfeb;
    --ink: #16202e;
    --muted: #5c6c85;
    --faint: #8497b0;
    --signal: #0f9c8c;
    --signal-ink: #0a776b;
    --signal-dim: #d7f3ef;
    --warn: #b4720a;
    --danger: #cc3b3b;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
}

body {
  background: radial-gradient(1100px 500px at 50% -10%, var(--panel-2) 0%, transparent 60%), var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
  padding: 28px 16px 60px;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s, color 0.2s;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
}

/* ---- masthead ---- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: block;
  flex: none;
  width: auto;
  height: 28px;
}

/* Phones: the live dot alone carries the status, so brand and controls share one row */
@media (max-width: 420px) {
  .status #statusText {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

.brand .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 var(--signal);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 214, 195, 0.5);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(47, 214, 195, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 214, 195, 0);
  }
}

.brand .brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Dark shows the sun (switch to light); light shows the moon */
.theme-btn .icon-moon {
  display: none;
}

:root[data-theme="light"] .theme-btn .icon-sun {
  display: none;
}

:root[data-theme="light"] .theme-btn .icon-moon {
  display: block;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-btn .icon-sun {
    display: none;
  }

  :root:not([data-theme="dark"]) .theme-btn .icon-moon {
    display: block;
  }
}

.top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top {
  flex-wrap: wrap;
}

.tagline {
  flex-basis: 100%;
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  font-family: var(--mono);
}

.status .live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  transition: background 0.2s;
}

.status.is-paused .live {
  background: var(--faint);
}

.status.is-error .live {
  background: var(--danger);
}

/* ---- cards ---- */
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

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

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 12px;
}

.eyebrow button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: 0.15s;
}

.eyebrow button:hover:not(:disabled) {
  color: var(--signal);
}

.eyebrow button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ---- section 1: address ---- */
.addr-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.addr {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 16px;
  min-height: 56px;
  min-width: 0;
}

.addr .val {
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: -0.01em;
  word-break: break-all;
}

.addr .val .local {
  color: var(--ink);
}

.addr .val .at {
  color: var(--faint);
}

.addr .val .dom {
  color: var(--signal-ink);
}

.icon-btn {
  width: 56px;
  min-width: 56px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 11px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: 0.15s;
}

.icon-btn:hover:not(:disabled) {
  border-color: var(--signal);
  color: var(--signal);
}

.icon-btn.copy {
  background: var(--signal-dim);
  border-color: transparent;
}

.icon-btn.copy:hover:not(:disabled) {
  background: var(--signal);
  color: #04201d;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.expiry {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.previous {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.prev-addr {
  font-family: var(--mono);
  color: var(--ink);
  word-break: break-all;
}

.link-btn {
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--signal-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.expiry b {
  color: var(--warn);
  font-variant-numeric: tabular-nums;
}

.expiry.dead b {
  color: var(--danger);
}

/* ---- action row ---- */
.actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 8px;
  border-radius: 11px;
  cursor: pointer;
  transition: 0.15s;
}

.btn:hover:not(:disabled) {
  border-color: var(--signal);
  color: var(--signal);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn.danger:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
}

.btn.solid {
  background: var(--signal-dim);
  border-color: transparent;
  color: var(--signal);
}

.btn.solid:hover:not(:disabled) {
  background: var(--signal);
  color: #04201d;
}

.btn.sm {
  padding: 8px 12px;
  font-size: 12.5px;
  border-radius: 9px;
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* ---- section 2: inbox ---- */
.inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 30px 4px 12px;
}

.inbox-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.inbox-head .count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Inbox as a card, matching the address card: header inside, table flush */
.card.inbox {
  margin-top: 16px;
  padding: 0;
  overflow: hidden;
}

.card.inbox .inbox-head {
  margin: 0;
  padding: 18px 22px 16px;
}

.card.inbox table {
  background: transparent;
  border: 0;
  border-radius: 0;
}

.card.inbox thead th {
  border-top: 1px solid var(--line);
}

.card.inbox thead th:first-child,
.card.inbox tbody td:first-child {
  padding-left: 22px;
}

.card.inbox thead th:last-child,
.card.inbox tbody td:last-child {
  padding-right: 22px;
}

thead th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 14px 18px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}

thead th:last-child {
  text-align: right;
}

tbody td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  cursor: pointer;
  transition: 0.12s;
}

tbody tr:hover {
  background: var(--panel-2);
}

tbody tr.unread .subject::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--signal);
}

.sender {
  color: var(--muted);
  font-size: 13px;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject {
  color: var(--ink);
  font-weight: 600;
}

.otp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--signal-dim);
  color: var(--signal);
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
}

.otp-chip:hover {
  background: var(--signal);
  color: #04201d;
}

.view-link {
  color: var(--signal);
  font-family: var(--mono);
  font-size: 12.5px;
  text-align: right;
  white-space: nowrap;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  padding: 48px 24px 52px;
  text-align: center;
}

.card.inbox .empty {
  border-top: 1px solid var(--line);
}

/* An envelope with a soft pulse: the inbox is live and listening */
.empty-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--signal-dim);
  color: var(--signal);
}

.empty--waiting .empty-icon::before,
.empty--waiting .empty-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--signal);
  opacity: 0;
  animation: listen 2.8s ease-out infinite;
}

.empty--waiting .empty-icon::after {
  animation-delay: 1.4s;
}

@keyframes listen {
  0% {
    transform: scale(1);
    opacity: 0.45;
  }
  100% {
    transform: scale(1.75);
    opacity: 0;
  }
}

.empty--unavailable .empty-icon {
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  color: var(--warn);
}

.empty h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 18px;
  letter-spacing: -0.01em;
}

.empty .empty-hint {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.empty-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.empty-steps li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12.5px;
  counter-increment: step;
}

.empty-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--signal-dim);
  color: var(--signal);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .empty--waiting .empty-icon::before,
  .empty--waiting .empty-icon::after {
    animation: none;
  }
}

/* ---- modal ---- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(6, 10, 18, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.backdrop.on {
  display: grid;
  animation: fade-in 0.18s ease-out;
}

body.modal-open {
  overflow: hidden;
}

.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 680px;
  max-height: min(820px, 90vh);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55);
  outline: none;
}

.backdrop.on .modal {
  animation: modal-in 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

/* HTML emails get a tall, steady box the email fills; text emails size to their content */
.modal.modal--frame {
  height: min(820px, 90vh);
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 20px 18px 22px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.m-avatar {
  --hue: 170;
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: hsl(var(--hue) 55% 42% / 0.22);
  color: hsl(var(--hue) 70% 62%);
  font-size: 17px;
  font-weight: 700;
}

:root[data-theme="light"] .m-avatar {
  color: hsl(var(--hue) 60% 36%);
}

.m-meta {
  flex: 1;
  min-width: 0;
}

.m-subject {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.m-from {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin: 0;
  font-size: 13.5px;
}

.m-from-name {
  color: var(--ink);
  font-weight: 600;
}

.m-from-addr {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.m-when {
  margin: 4px 0 0;
  color: var(--faint);
  font-size: 12.5px;
}

.modal-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  margin: -4px -6px 0 0;
}

.m-icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.m-icon-btn:hover {
  background: var(--panel-2);
  color: var(--ink);
}

.m-icon-btn svg {
  width: 18px;
  height: 18px;
}

/* The icon shows where a click takes you: sun = light background, moon = dark */
.frame-theme[data-target="light"] .icon-moon,
.frame-theme[data-target="dark"] .icon-sun {
  display: none;
}

/* The code is the reason most people open a message: make it the hero */
.otp-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px 20px 0;
  padding: 14px 14px 14px 20px;
  border: 1px solid color-mix(in srgb, var(--signal) 35%, transparent);
  border-radius: 14px;
  background: var(--signal-dim);
  flex: none;
}

.otp-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.otp-lbl {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.otp-code-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--signal);
  cursor: copy;
  text-align: left;
}

.otp-code-btn code {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.2;
}

.otp-code-btn:hover code {
  text-decoration: underline dotted;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}

.otp-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: none;
  min-width: 132px;
  justify-content: center;
}

.otp-copy svg {
  width: 16px;
  height: 16px;
}

.otp-copy.done svg {
  display: none;
}

.blocked-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  margin: 12px 20px 0;
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  flex: none;
}

.blocked-note[hidden] {
  display: none;
}

.blocked-note svg {
  width: 14px;
  height: 14px;
  color: var(--signal);
}

.modal-body {
  display: flex;
  flex: 1;
  min-height: 0;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  overflow: auto;
}

/* sanitized HTML bodies live in a sandboxed frame, never in the page */
#mFrame {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 280px;
  border: 0;
  background: #fff;
}

/* Same colour as the dark frame document, so nothing flashes white while it loads */
#mFrame[data-theme="dark"] {
  background: #141c2b;
}

.modal .body {
  width: 100%;
  margin: 0;
  padding: 20px 22px 26px;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Phones: a bottom sheet that uses the whole width */
@media (max-width: 560px) {
  .backdrop {
    place-items: end stretch;
    padding: 0;
  }

  .modal,
  .modal.modal--frame {
    max-width: none;
    height: 92vh;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
  }

  .modal:not(.modal--frame) {
    height: auto;
  }

  .backdrop.on .modal {
    animation-name: sheet-in;
  }

  @keyframes sheet-in {
    from {
      transform: translateY(40px);
      opacity: 0;
    }
  }

  .modal-head {
    padding: 16px 14px 14px 16px;
    gap: 12px;
  }

  .m-avatar {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .otp-card {
    margin: 14px 14px 0;
    padding: 12px 12px 12px 16px;
  }

  .otp-code-btn code {
    font-size: 24px;
  }

  .otp-copy {
    min-width: 0;
  }

  .blocked-note {
    margin: 10px 14px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .backdrop.on,
  .backdrop.on .modal {
    animation: none;
  }
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--signal);
  color: #04201d;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 60;
}

.toast.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#qr {
  margin-top: 14px;
  display: none;
  background: #fff;
  padding: 12px;
  border-radius: 11px;
  width: fit-content;
}

#qr.on {
  display: block;
}

#qr img {
  display: block;
  width: 148px;
  height: 148px;
}

.note {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--faint);
}

.note code {
  font-family: var(--mono);
  color: var(--muted);
}

/* ---- admin ---- */
.admin-links {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12.5px;
}

.admin-links a {
  color: var(--muted);
  text-decoration: none;
  transition: 0.15s;
}

.admin-links a:hover {
  color: var(--signal);
}

.field {
  flex: 1;
  min-width: 0;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 16px;
  min-height: 56px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
}

.field::placeholder {
  color: var(--faint);
}

.field:focus {
  outline: none;
  border-color: var(--signal);
}

.dlist {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

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

.drow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  flex-wrap: wrap;
}

.drow .dname {
  font-family: var(--mono);
  font-size: 14.5px;
  color: var(--ink);
}

.drow .dactions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.pill.live {
  background: var(--signal-dim);
  color: var(--signal);
}

.pill.retired {
  background: #2a2233;
  color: var(--warn);
}

@media (max-width: 560px) {
  .actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .card {
    padding: 18px 16px;
  }

  /* Address on its own full-width row; the QR and copy buttons share the row below it */
  .addr-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .addr {
    flex: 1 1 100%;
    padding: 0 12px;
    min-height: 52px;
  }

  .addr-row .icon-btn {
    flex: 1 1 0;
    height: 44px;
  }

  /* Shrinks with the screen so a typical address stays on one line; if one still doesn't
     fit, it breaks after the @ rather than mid-word */
  .addr .val {
    font-size: clamp(11px, 3.5vw, 15px);
    letter-spacing: -0.02em;
    word-break: normal;
    overflow-wrap: anywhere;
  }

  .addr .val .at::after {
    content: "\200B";
  }

  .eyebrow {
    font-size: 10.5px;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }

  .eyebrow button {
    font-size: 10.5px;
    letter-spacing: 0.06em;
  }

  .drow .dactions {
    margin-left: 0;
    width: 100%;
  }

  .top {
    flex-wrap: wrap;
  }

  .tagline {
    margin-top: 0;
  }
}

/* ---- accessibility: visible focus ring everywhere, keyboard users only ---- */
a:focus-visible,
button:focus-visible,
.field:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: 8px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--signal);
  color: #04201d;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  font-size: 13px;
  font-weight: 600;
  z-index: 50;
}

.skip-link:focus {
  left: 0;
}

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

/* ---- about / FAQ content ---- */
.about {
  margin-top: 40px;
}

.about h2 {
  font-size: 20px;
  margin: 0 0 6px;
}

.about p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 640px;
}

.about + .about {
  margin-top: 28px;
}

.about h2 {
  margin-bottom: 10px;
}

.about p + p {
  margin-top: 0;
}

.compare-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.compare {
  min-width: 560px;
  border: 0;
  border-radius: 0;
  font-size: 13.5px;
}

.compare thead th {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  padding: 12px 14px;
}

.compare thead th:last-child {
  text-align: left;
}

.compare thead th:nth-child(2) {
  color: var(--signal-ink);
}

.compare tbody tr {
  cursor: default;
}

.compare tbody tr:hover {
  background: none;
}

.compare tbody th,
.compare tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.compare tbody tr:last-child th,
.compare tbody tr:last-child td {
  border-bottom: none;
}

.compare tbody th {
  color: var(--muted);
  font-weight: 500;
}

.compare td {
  color: var(--muted);
}

.compare td.yes {
  color: var(--ink);
  font-weight: 600;
}

.compare td.no {
  color: var(--muted);
}

.compare td:nth-child(2) {
  background: color-mix(in srgb, var(--signal) 7%, transparent);
}

.steps {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 640px;
}

.steps li + li {
  margin-top: 8px;
}

.steps strong {
  color: var(--ink);
}

.faq {
  margin-top: 28px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 14.5px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item .faq-q {
  margin: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--muted);
  font-weight: 400;
  font-size: 18px;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item p {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

footer.site-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12.5px;
  text-align: center;
}

footer.site-footer a {
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  margin-bottom: 12px;
  font-size: 13px;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- legal pages ---- */
.legal {
  max-width: 680px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.legal h1 {
  margin: 14px 0 4px;
  color: var(--ink);
  font-size: 32px;
  letter-spacing: -0.025em;
}

.legal h2 {
  margin: 36px 0 10px;
  color: var(--ink);
  font-size: 19px;
  letter-spacing: -0.01em;
}

.legal h3 {
  margin: 22px 0 6px;
  color: var(--ink);
  font-size: 15.5px;
}

.legal p {
  margin: 0 0 14px;
}

.legal ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

.legal li + li {
  margin-top: 8px;
}

.legal strong {
  color: var(--ink);
}

.legal a {
  color: var(--signal);
}

.legal-updated {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
}

.legal .legal-lead {
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
}

.legal .legal-see {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.back-link {
  display: inline-block;
  font-size: 13px;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Invisible but focusable: they catch Tab at the dialog's edges and loop it back */
.focus-guard {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* Inbox rows are keyboard-reachable; show where focus is */
tbody tr:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: -2px;
  border-radius: 0;
}

.modal--bare .modal-body {
  margin-top: 0;
  border-top: 0;
}

/* ---- "at a glance" facts: short, self-contained, quotable ---- */
.facts {
  margin-top: 40px;
  padding: 22px 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
}

.facts h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.facts-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts-list li {
  position: relative;
  padding-left: 26px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.facts-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--signal-dim);
  box-shadow: inset 0 0 0 5px var(--signal-dim), inset 0 0 0 16px var(--signal);
}

.facts-list strong {
  color: var(--ink);
}

.facts + .about {
  margin-top: 36px;
}

.learn-more {
  margin-top: 14px;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.7;
}

.learn-more a {
  color: var(--muted);
  text-underline-offset: 3px;
}

.learn-more a:hover {
  color: var(--signal);
}

@media (max-width: 560px) {
  .facts {
    padding: 18px 16px;
  }

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

/* ---- contact page ---- */
.legal .contact-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px 24px;
  margin: 24px 0 16px;
  padding: 22px 24px;
  border: 1px solid color-mix(in srgb, var(--signal) 35%, transparent);
  border-radius: 16px;
  background: var(--signal-dim);
}

.legal .contact-card > div {
  flex: 1;
  min-width: 220px;
}

.legal .contact-label {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.legal .contact-email {
  margin: 0 0 4px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.legal .contact-note {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.legal .contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 11px;
  background: var(--signal);
  color: #04201d;
  font-weight: 700;
  text-decoration: none;
}

.legal .contact-btn:hover {
  background: color-mix(in srgb, var(--signal), #000 10%);
  color: #04201d;
}

.legal .contact-btn svg {
  width: 17px;
  height: 17px;
}

.legal .contact-warning {
  padding: 12px 16px;
  border-left: 3px solid var(--warn);
  border-radius: 6px;
  background: color-mix(in srgb, var(--warn) 9%, transparent);
  font-size: 14px;
}
