:root {
  color-scheme: light;
  --paper: #232522;
  --paper-strong: #2b2d2a;
  --ink: #151715;
  --ink-soft: #1f221f;
  --ink-strong: #101210;
  --text: #e4e1da;
  --muted: #9b9d97;
  --paper-muted: #a5a69f;
  --paper-line: #444741;
  --line: #3e423d;
  --accent: #dd7950;
  --accent-hover: #e2865f;
  --success: #69a36d;
  --error: #e76258;
  --radius: 5px;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 48% 2%, rgb(255 255 255 / 5%), transparent 38rem), var(--paper);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.site-header {
  min-height: 76px;
  padding: 0 clamp(20px, 3.7vw, 62px);
  border-bottom: 1px solid var(--paper-line);
  display: flex;
  align-items: center;
  background: rgb(38 40 37 / 94%);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  background: var(--text);
  clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%);
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 9px;
  background: var(--paper-strong);
  clip-path: inherit;
}

.brand-copy {
  display: grid;
  gap: 4px;
  text-transform: uppercase;
}

.brand-copy strong {
  font-size: 16px;
  letter-spacing: 0.1em;
}

.brand-copy small {
  color: var(--paper-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.11em;
}

.header-actions {
  min-height: 38px;
  margin-left: auto;
  display: flex;
  align-items: center;
}

.environment-label,
.header-link,
.header-nav-link {
  min-height: 38px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
}

.environment-label {
  position: relative;
  padding-left: 18px;
}

.environment-label::before {
  content: "";
  position: absolute;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.header-link {
  border-left: 1px solid var(--paper-line);
}

.header-nav-link {
  text-decoration: none;
}

.header-link::after {
  content: "↗";
  margin-left: 8px;
  font-size: 15px;
}

.header-link:hover,
.header-nav-link:hover {
  color: var(--accent);
}

.page-shell {
  width: min(100%, 1800px);
  min-height: calc(100dvh - 76px);
  margin-inline: auto;
  padding: 30px clamp(20px, 3.7vw, 62px) 34px;
  display: grid;
  grid-template-columns: minmax(0, 1.82fr) minmax(340px, 1fr);
  gap: clamp(22px, 2.4vw, 38px);
  align-items: start;
}

.intro,
.intro-content {
  min-width: 0;
}

.intro-content {
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 3.5vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.intro-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.flow-tabs {
  width: min(100%, 570px);
  min-height: 54px;
  margin-top: 24px;
  border: 1px solid var(--paper-line);
  border-bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--paper-strong);
}

.flow-tab {
  position: relative;
  min-height: 54px;
  padding: 0 20px;
  border: 0;
  border-bottom: 1px solid var(--paper-line);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  text-transform: uppercase;
}

.flow-tab + .flow-tab {
  border-left: 1px solid var(--paper-line);
}

.flow-tab[aria-selected="true"] {
  color: var(--accent);
}

.flow-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  left: -1px;
  height: 4px;
  background: var(--accent);
}

.flow-tab:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.payment-form,
.payment-stage,
.payment-panel,
.signer-panel,
.activity-list,
.intent-meta {
  color: var(--text);
}

.payment-form {
  min-height: 520px;
  padding: clamp(24px, 2.2vw, 34px);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  display: grid;
  gap: 18px;
  background:
    radial-gradient(circle at 85% 0%, rgb(255 255 255 / 3%), transparent 24rem), var(--ink);
}

.form-title,
.lifecycle-title {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.network-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

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

.field label,
.signed-transaction-form label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background: var(--ink-strong);
  color: var(--text);
}

input,
select {
  min-height: 58px;
}

select {
  appearance: none;
  padding: 0 46px 0 16px;
}

.select-control {
  position: relative;
}

.select-control::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 8px;
  height: 8px;
  border-right: 1px solid var(--text);
  border-bottom: 1px solid var(--text);
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

input {
  padding: 0 78px 0 16px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

#destination-address {
  padding-inline: 16px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
}

input::placeholder,
textarea::placeholder {
  color: #777975;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 2px;
}

input:disabled,
select:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.amount-control {
  position: relative;
}

.amount-control > span {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.field-help,
.field-error,
.signer-help {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.field-help,
.signer-help {
  color: var(--muted);
}

.field-error {
  color: var(--error);
}

.field-error:empty {
  display: none;
}

.turnstile-slot {
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.turnstile-slot iframe {
  max-width: 100%;
}

.primary-button,
.secondary-button {
  min-height: 54px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.035em;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.primary-button {
  min-height: 62px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--ink);
}

.primary-button:hover:not(:disabled) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.primary-button:active:not(:disabled),
.secondary-button:active:not(:disabled) {
  transform: translateY(1px);
}

.secondary-button {
  padding: 0 16px;
  border: 1px solid #5d605d;
  background: transparent;
  color: var(--text);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--text);
}

.secondary-button[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.5;
}

.testnet-note {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.testnet-note p {
  margin: 0;
}

.note-icon {
  width: 21px;
  height: 21px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  font-weight: 700;
}

.payment-stage {
  min-width: 0;
  min-height: 718px;
  padding: 30px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 85% 0%, rgb(255 255 255 / 3%), transparent 22rem), var(--ink);
}

.empty-state,
.loading-state {
  min-height: 658px;
}

.empty-state {
  display: flex;
  flex-direction: column;
}

.lifecycle-title {
  order: 1;
  margin-bottom: 20px;
}

.empty-flow {
  order: 2;
  counter-reset: lifecycle;
}

.empty-flow > div {
  position: relative;
  min-height: 58px;
  padding: 0 0 0 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  counter-increment: lifecycle;
}

.empty-flow > div::before {
  content: counter(lifecycle);
  position: absolute;
  top: 11px;
  left: 4px;
  width: 34px;
  height: 34px;
  border: 2px solid #6f726e;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.empty-flow > div:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 45px;
  bottom: -13px;
  left: 21px;
  width: 1px;
  background: #6f726e;
}

.empty-flow > div:first-child::before {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.empty-flow strong {
  font-size: 14px;
  font-weight: 500;
}

.empty-flow > div:first-child strong {
  color: var(--accent);
}

.empty-flow span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.empty-heading {
  order: 3;
  margin-top: auto;
  padding: 22px;
  border: 1px solid var(--line);
}

.empty-heading > p:first-child {
  margin: 0;
}

.empty-heading h2 {
  margin: 14px 0 8px;
  font-size: 17px;
  line-height: 1.25;
}

.empty-heading > p:last-of-type {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.empty-heading::after {
  content: "STATUS TRACKED ON-CHAIN";
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  display: block;
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.05em;
}

.status-label,
.detail-label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.loading-state {
  display: grid;
  align-content: start;
  gap: 32px;
}

.loading-heading,
.loading-qr,
.loading-copy span,
.loading-copy strong {
  border-radius: var(--radius);
  background: var(--ink-soft);
}

.loading-heading {
  width: 62%;
  height: 48px;
}

.loading-payment {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(180px, 1fr);
  gap: 28px;
}

.loading-qr {
  aspect-ratio: 1;
}

.loading-copy {
  display: grid;
  align-content: start;
  gap: 18px;
}

.loading-copy span {
  width: 52%;
  height: 14px;
}

.loading-copy strong {
  width: 78%;
  height: 64px;
}

.loading-state > p {
  color: var(--muted);
}

.page-shell[data-stage="intent"],
.page-shell[data-stage="withdrawal"] {
  grid-template-columns: 1fr;
  row-gap: 0;
}

.page-shell[data-stage="intent"] .payment-form,
.page-shell[data-stage="intent"] .testnet-note,
.page-shell[data-stage="withdrawal"] .payment-form,
.page-shell[data-stage="withdrawal"] .testnet-note {
  display: none;
}

.page-shell[data-stage="intent"] .payment-stage,
.page-shell[data-stage="withdrawal"] .payment-stage {
  min-height: 0;
  margin-top: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.82fr) minmax(340px, 1fr);
  gap: clamp(22px, 2.4vw, 38px);
  background: transparent;
}

#intent-state:not([hidden]),
#withdrawal-state:not([hidden]) {
  display: contents;
}

#intent-state .payment-panel,
#withdrawal-state .payment-panel {
  grid-column: 1;
  grid-row: 1;
}

#intent-state .activity-list,
#withdrawal-state .activity-list {
  grid-column: 2;
  grid-row: 1 / span 3;
}

#intent-state .intent-meta,
#withdrawal-state .intent-meta {
  grid-column: 1;
}

.payment-panel,
.signer-panel,
.activity-list,
.intent-meta {
  min-width: 0;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 85% 0%, rgb(255 255 255 / 3%), transparent 22rem), var(--ink);
}

.payment-panel {
  min-height: 420px;
  padding: clamp(24px, 2.2vw, 34px);
}

.intent-header {
  margin-bottom: 26px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.intent-header h2 {
  margin: 0;
  font-size: 13px;
  line-height: 1.1;
}

.status-detail {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.status-orbit {
  position: relative;
  width: 32px;
  height: 32px;
  border: 2px dashed var(--accent);
  border-radius: 50%;
  display: block;
  flex: none;
}

.intent-header[data-status="paid"] .status-orbit,
.intent-header[data-status="complete"] .status-orbit,
.intent-header[data-status="refunded"] .status-orbit {
  border: 2px solid var(--success);
}

.intent-header[data-status="paid"] .status-orbit::after,
.intent-header[data-status="complete"] .status-orbit::after,
.intent-header[data-status="refunded"] .status-orbit::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 10px;
  width: 7px;
  height: 12px;
  border-right: 2px solid var(--success);
  border-bottom: 2px solid var(--success);
  transform: rotate(45deg);
}

.payment-content {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(260px, 1fr);
  gap: clamp(28px, 4vw, 58px);
  align-items: center;
}

.qr-panel img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border: 12px solid #fff;
  border-radius: var(--radius);
  display: block;
  background: #fff;
}

.payment-details {
  display: grid;
  gap: 28px;
}

.amount-due {
  margin: 8px 0 0;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.amount-due strong {
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 500;
  letter-spacing: -0.06em;
}

.amount-due span {
  margin-left: 7px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 27px);
}

.confirmation-block,
.address-block {
  display: grid;
  gap: 10px;
}

.confirmation-track {
  display: flex;
  align-items: center;
}

.confirmation-step {
  position: relative;
  width: 22px;
  height: 22px;
  border: 1px solid #777a76;
  border-radius: 50%;
  display: block;
  color: var(--text);
  font-size: 10px;
  line-height: 20px;
  text-align: center;
}

.confirmation-step + .confirmation-step {
  margin-left: 36px;
}

.confirmation-step + .confirmation-step::before {
  content: "";
  position: absolute;
  top: 10px;
  right: 21px;
  width: 36px;
  height: 1px;
  background: #777a76;
}

.confirmation-step[data-complete="true"] {
  border-color: var(--success);
  background: var(--success);
}

.confirmation-step[data-complete="true"]::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 7px;
  width: 5px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}

#confirmation-summary {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

#send-label,
.address-block .detail-label {
  color: var(--muted);
}

.address-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(120px, 0.8fr);
  gap: 12px;
}

.address-value {
  min-height: 54px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--ink-strong);
  color: var(--text);
  cursor: pointer;
}

.address-value code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-value span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.payment-closed {
  min-height: 280px;
  display: grid;
  place-content: center;
  text-align: center;
}

.payment-closed strong {
  font-size: 28px;
}

.payment-closed p {
  margin: 10px 0 0;
  color: var(--muted);
}

.payment-closed .secondary-button {
  min-width: 210px;
  margin: 24px auto 0;
}

.terminal-action {
  min-width: 210px;
  margin-top: 28px;
}

.withdrawal-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(300px, 1.3fr);
  gap: 36px;
  align-items: end;
}

.swap-route-summary {
  margin: 0 0 26px;
  padding: 18px;
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
}

.swap-route-summary dt,
.route-grid dt,
.proposal-grid dt,
.intent-meta dt {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.swap-route-summary dd,
.route-grid dd,
.proposal-grid dd,
.intent-meta dd {
  min-width: 0;
  margin: 6px 0 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.route-grid,
.proposal-grid {
  margin: 0;
  display: grid;
  gap: 14px;
}

.activity-list {
  margin: 0;
  padding: 26px;
  align-self: stretch;
}

.activity-list::before {
  content: "LIFECYCLE";
  margin-bottom: 18px;
  display: block;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.activity-section {
  position: relative;
  min-height: 106px;
  padding: 12px 0 12px 54px;
}

.activity-section + .activity-section {
  border-top: 0;
}

.activity-section:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 47px;
  bottom: -13px;
  left: 16px;
  width: 1px;
  background: #6f726e;
}

.activity-marker {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 0;
  width: 34px;
  height: 34px;
  border: 2px solid #6f726e;
  border-radius: 50%;
  display: block;
  background: var(--ink);
}

.activity-section[data-state="active"] .activity-marker,
.activity-section[data-state="warning"] .activity-marker {
  border-color: var(--accent);
  background: var(--accent);
}

.activity-section[data-state="detected"] .activity-marker,
.activity-section[data-state="success"] .activity-marker {
  border-color: var(--success);
  background: var(--success);
}

.activity-section[data-state="detected"] .activity-marker::after,
.activity-section[data-state="success"] .activity-marker::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 10px;
  width: 7px;
  height: 12px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}

.activity-body {
  min-width: 0;
}

.activity-heading,
.activity-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.activity-title h3,
.activity-heading h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.activity-status {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.activity-section[data-state="active"] .activity-title h3,
.activity-section[data-state="active"] .activity-status,
.activity-section[data-state="warning"] .activity-title h3,
.activity-section[data-state="warning"] .activity-status {
  color: var(--accent);
}

.activity-section[data-state="success"] .activity-title h3,
.activity-section[data-state="success"] .activity-status,
.activity-section[data-state="detected"] .activity-title h3,
.activity-section[data-state="detected"] .activity-status {
  color: var(--success);
}

.activity-content {
  min-width: 0;
  margin-top: 9px;
  color: var(--text);
  font-size: 11px;
  line-height: 1.5;
}

.activity-content p {
  margin: 0;
}

.activity-content a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

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

.transaction-item + .transaction-item {
  margin-top: 10px;
}

.transaction-hash {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  overflow-wrap: anywhere;
}

.intent-meta {
  margin: 0;
  padding: 22px 26px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.signer-panel {
  grid-column: 1;
  margin: 0;
  padding: 26px;
}

.signer-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.signer-panel h3,
.signer-panel p {
  margin: 0;
}

.signer-panel h3 {
  font-size: 16px;
  text-transform: uppercase;
}

.signer-panel header p {
  max-width: 58ch;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.proposal-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.proposal-data {
  grid-column: 1 / -1;
}

.signed-transaction-form {
  margin-top: 22px;
  display: grid;
  gap: 9px;
}

.signed-transaction-form textarea {
  min-height: 90px;
  padding: 13px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
}

.signed-transaction-form .primary-button {
  min-height: 56px;
}

.global-error {
  position: fixed;
  z-index: 10;
  top: 94px;
  right: clamp(18px, 3.7vw, 62px);
  width: min(520px, calc(100vw - 36px));
  margin: 0;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--error) 55%, var(--line));
  border-radius: var(--radius);
  color: #ffd9d6;
  background: #321a18;
  font-size: 12px;
}

.analytics-page {
  width: min(100%, 1800px);
  min-height: calc(100dvh - 76px);
  margin-inline: auto;
  padding: 38px clamp(20px, 3.7vw, 62px) 48px;
}

.analytics-intro {
  margin-bottom: 26px;
}

.analytics-intro p {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.analytics-intro .analytics-updated {
  margin-top: 17px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.analytics-error {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--error) 55%, var(--paper-line));
  border-radius: var(--radius);
  color: #ffd9d6;
  background: #321a18;
  font-size: 12px;
}

.analytics-summary {
  margin: 0 0 22px;
  border: 1px solid var(--paper-line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: rgb(21 23 21 / 38%);
}

.analytics-summary > div {
  min-height: 132px;
  padding: 30px 32px;
}

.analytics-summary > div + div {
  border-left: 1px solid var(--paper-line);
}

.analytics-summary dt,
.analytics-section h2,
.analytics-table th {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.analytics-summary dt {
  color: var(--paper-muted);
}

.analytics-summary dd {
  margin: 12px 0 0;
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
}

.analytics-section {
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  background: rgb(21 23 21 / 38%);
}

.analytics-section h2 {
  margin: 0;
  padding: 21px 28px 17px;
  color: var(--text);
}

.analytics-table-wrap {
  padding: 0 28px 6px;
  overflow-x: auto;
}

.analytics-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.analytics-table th {
  padding: 10px 0 12px;
  color: var(--paper-muted);
  text-align: left;
}

.analytics-table th:first-child {
  width: 20%;
}

.analytics-table th:nth-child(2),
.analytics-table th:nth-child(3),
.analytics-table th:nth-child(4) {
  width: 12%;
}

.analytics-table th:nth-child(5),
.analytics-table th:nth-child(6) {
  width: 22%;
}

.analytics-table td {
  height: 60px;
  padding: 10px 0;
  border-top: 1px solid var(--paper-line);
  color: var(--text);
  font-size: 14px;
}

.analytics-table .numeric-cell {
  font-variant-numeric: tabular-nums;
}

.analytics-table .amount-cell {
  padding-right: 28px;
  font-variant-numeric: tabular-nums;
}

.amount-line {
  position: relative;
  width: 100%;
  height: 3px;
  margin-top: 8px;
  display: block;
  overflow: hidden;
  background: var(--paper-line);
}

.amount-line::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--amount-progress);
  background: var(--accent);
}

.amount-line[data-tone="collected"]::after {
  background: var(--success);
}

.analytics-status-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.analytics-status dl {
  margin: 0;
  padding: 0 28px 14px;
}

.analytics-status dl > div {
  min-height: 44px;
  border-top: 1px solid var(--paper-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.analytics-status dt {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--paper-muted);
  font-size: 14px;
}

.analytics-status dd {
  margin: 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

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

.analytics-status [data-status="complete"] .status-dot,
.analytics-status [data-status="refunded"] .status-dot {
  background: var(--success);
}

.analytics-status [data-status="confirming"] .status-dot,
.analytics-status [data-status="input_confirming"] .status-dot,
.analytics-status [data-status="submitted"] .status-dot,
.analytics-status [data-status="output_submitted"] .status-dot,
.analytics-status [data-status="refund_submitted"] .status-dot {
  background: #d8a153;
}

.analytics-status [data-status="failed"] .status-dot,
.analytics-status [data-status="reorged"] .status-dot {
  background: var(--error);
}

.analytics-status dl > .analytics-empty {
  justify-content: flex-start;
  color: var(--muted);
}

.analytics-empty dt {
  font-size: 13px;
}

.signer-page {
  width: min(100%, 1800px);
  min-height: calc(100dvh - 76px);
  margin-inline: auto;
  padding: 38px clamp(20px, 3.7vw, 62px) 48px;
}

.signer-intro {
  margin-bottom: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.signer-intro p {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.signer-intro .signer-warning {
  margin-top: 17px;
  color: var(--paper-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.signer-intro .secondary-button {
  min-width: 120px;
}

.signer-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(480px, 1.2fr);
  gap: 22px;
  align-items: start;
}

.signer-inbox > header {
  min-height: 58px;
  padding: 0 22px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.signer-inbox > header h2 {
  padding: 0;
}

#inbox-count {
  color: var(--paper-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.inbox-item {
  width: 100%;
  padding: 19px 28px;
  border: 0;
  border-bottom: 1px solid var(--paper-line);
  display: grid;
  gap: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.inbox-item:hover,
.inbox-item[data-selected="true"] {
  background: rgb(221 121 80 / 8%);
}

.inbox-item[data-selected="true"] {
  box-shadow: inset 3px 0 var(--accent);
}

.inbox-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.purpose-badge,
.inbox-expiry,
.inbox-reference {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.purpose-badge {
  color: var(--accent);
}

.inbox-expiry,
.inbox-reference,
.inbox-route {
  color: var(--muted);
}

.inbox-amount {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.inbox-route {
  font-size: 12px;
}

.inbox-reference {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-empty {
  margin: 0;
  padding: 34px 28px;
  color: var(--muted);
  font-size: 13px;
}

.inbox-more {
  width: calc(100% - 56px);
  margin: 18px 28px;
}

.signer-review {
  min-height: 560px;
}

.review-empty {
  min-height: 558px;
  padding: 52px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.review-empty h2 {
  margin: 18px 0 0;
  padding: 0;
  font-size: 16px;
}

.review-empty p {
  max-width: 42ch;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

#review-content {
  padding: 28px;
}

.review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.review-header h2 {
  margin: 8px 0 0;
  padding: 0;
  font-size: 34px;
  letter-spacing: -0.035em;
  text-transform: none;
}

.review-header p {
  margin: 9px 0 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.review-summary {
  margin: 25px 0 0;
  border-top: 1px solid var(--paper-line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-summary > div {
  min-width: 0;
  padding: 16px 18px 16px 0;
  border-bottom: 1px solid var(--paper-line);
}

.review-summary > div:nth-child(even) {
  padding-left: 18px;
  border-left: 1px solid var(--paper-line);
}

.review-summary dt {
  color: var(--paper-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.review-summary dd {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.review-summary > .review-data {
  grid-column: 1 / -1;
  padding-left: 0;
  border-left: 0;
}

.review-data code {
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 1080px) {
  .page-shell {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
  }

  .payment-content {
    grid-template-columns: minmax(180px, 230px) minmax(220px, 1fr);
    gap: 28px;
  }
}

@media (max-width: 900px) {
  .page-shell,
  .page-shell[data-stage="intent"],
  .page-shell[data-stage="withdrawal"] {
    grid-template-columns: 1fr;
  }

  .payment-stage,
  .page-shell[data-stage="intent"] .payment-stage,
  .page-shell[data-stage="withdrawal"] .payment-stage {
    grid-template-columns: 1fr;
  }

  #intent-state .payment-panel,
  #withdrawal-state .payment-panel,
  #intent-state .activity-list,
  #withdrawal-state .activity-list,
  #intent-state .intent-meta,
  #withdrawal-state .intent-meta,
  .signer-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .activity-list {
    min-height: 0;
  }

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

  .analytics-summary > div:nth-child(3) {
    border-left: 0;
  }

  .analytics-summary > div:nth-child(n + 3) {
    border-top: 1px solid var(--paper-line);
  }

  .analytics-status-grid {
    grid-template-columns: 1fr;
  }

  .signer-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .site-header {
    min-height: 66px;
    padding-inline: 16px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand-mark::before {
    inset: 7px;
  }

  .brand-copy strong {
    font-size: 11px;
  }

  .brand-copy small,
  .environment-label {
    display: none;
  }

  .header-link,
  .header-nav-link {
    padding: 0;
    border-left: 0;
  }

  .header-link {
    display: none;
  }

  .header-actions {
    gap: 14px;
  }

  .page-shell {
    min-height: calc(100dvh - 66px);
    padding: 28px 16px;
  }

  .analytics-page {
    min-height: calc(100dvh - 66px);
    padding: 28px 16px;
  }

  .signer-page {
    min-height: calc(100dvh - 66px);
    padding: 28px 16px;
  }

  .signer-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .signer-intro p {
    font-size: 14px;
  }

  .signer-intro .secondary-button {
    width: 100%;
  }

  .signer-inbox > header,
  .inbox-item,
  #review-content {
    padding-inline: 20px;
  }

  .inbox-more {
    width: calc(100% - 40px);
    margin-inline: 20px;
  }

  .review-header {
    flex-direction: column;
  }

  .review-summary {
    grid-template-columns: 1fr;
  }

  .review-summary > div:nth-child(even) {
    padding-left: 0;
    border-left: 0;
  }

  .review-empty {
    min-height: 420px;
    padding: 32px 20px;
  }

  .analytics-intro p {
    font-size: 14px;
  }

  .analytics-summary > div {
    min-height: 108px;
    padding: 22px 18px;
  }

  .analytics-summary dd {
    font-size: 36px;
  }

  .analytics-section h2 {
    padding-inline: 18px;
  }

  .analytics-table-wrap,
  .analytics-status dl {
    padding-inline: 18px;
  }

  h1 {
    font-size: clamp(38px, 12vw, 48px);
  }

  .flow-tabs {
    width: 100%;
  }

  .flow-tab {
    padding-inline: 8px;
    font-size: 10px;
  }

  .payment-form,
  .payment-stage,
  .payment-panel,
  .signer-panel,
  .activity-list,
  .intent-meta {
    padding: 20px;
  }

  .payment-stage {
    min-height: 620px;
  }

  .network-fields,
  .loading-payment,
  .payment-content,
  .withdrawal-summary,
  .address-actions,
  .proposal-grid,
  .swap-route-summary {
    grid-template-columns: 1fr;
  }

  .loading-qr,
  .qr-panel {
    width: min(100%, 290px);
    margin-inline: auto;
  }

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

  .signer-panel > header {
    flex-direction: column;
  }

  .proposal-data {
    grid-column: auto;
  }

  .global-error {
    top: 78px;
    right: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .primary-button,
  .secondary-button {
    transition: none;
  }
}

[hidden] {
  display: none;
}
