@font-face {
  font-family: "Lato";
  src: url("/assets/fonts/lato-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("/assets/fonts/lato-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("/assets/fonts/lato-900.woff2") format("woff2");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "Playfair Display";
  src: url("/assets/fonts/playfair-display-600-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #f5f7f6;
  --surface: #ffffff;
  --surface-strong: #edf3f0;
  --ink: #17211e;
  --muted: #64716c;
  --line: #d6dfdb;
  --brand: #0b6b54;
  --brand-hover: #075743;
  --brand-soft: #dceee8;
  --coral: #c84f35;
  --gold: #e7ad3c;
  --blue: #315d86;
  --danger: #a83c32;
  --success: #16734d;
  --shadow: 0 18px 50px rgba(23, 33, 30, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Lato", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

button,
.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

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

button:active,
.button:active {
  transform: translateY(1px);
}

button:focus-visible,
.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(49, 93, 134, 0.3);
  outline-offset: 2px;
}

button.secondary,
.button.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

button.secondary:hover,
.button.secondary:hover {
  background: var(--surface-strong);
}

button.danger {
  background: var(--danger);
}

button[disabled] {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

a {
  color: var(--brand);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
}

.site-header {
  height: 68px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header nav,
.page-width {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 650;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a.button,
.nav-links a.button:hover {
  color: #fff;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--coral);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  line-height: 1.15;
}

h1,
h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
}

.about-hero {
  min-height: 70vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  gap: 72px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 72px;
}

.about-hero h1 {
  margin: 0;
  font-size: 64px;
  max-width: 720px;
}

.lede {
  margin: 22px 0 0;
  max-width: 660px;
  color: var(--muted);
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.payment-map {
  position: relative;
  min-height: 440px;
  border-left: 1px solid var(--line);
  padding: 26px 0 26px 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.rail-item {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 10px 28px rgba(23, 33, 30, 0.06);
  animation: settle-in 480ms ease both;
}

.rail-item:nth-child(2) {
  animation-delay: 80ms;
}

.rail-item:nth-child(3) {
  animation-delay: 160ms;
}

.rail-item:nth-child(4) {
  animation-delay: 240ms;
}

.rail-item::before {
  content: "";
  position: absolute;
  left: -49px;
  width: 12px;
  height: 12px;
  border: 4px solid var(--canvas);
  border-radius: 50%;
  background: var(--brand);
}

.rail-icon {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 900;
}

.rail-item:nth-child(2) .rail-icon {
  background: #f8eadf;
  color: var(--coral);
}

.rail-item:nth-child(3) .rail-icon {
  background: #e2eaf2;
  color: var(--blue);
}

.rail-item strong,
.rail-item small {
  display: block;
}

.rail-item small {
  margin-top: 4px;
  color: var(--muted);
}

.state-label {
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
}

.state-label.future {
  color: var(--blue);
}

.about-band {
  border-top: 1px solid var(--line);
  padding: 74px 0;
  background: var(--surface);
}

.about-band.alt {
  background: var(--canvas);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: 56px;
  align-items: start;
}

.section-heading h2 {
  margin: 0;
  font-size: 36px;
}

.section-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 46px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.step {
  padding: 26px 24px 30px 0;
  border-right: 1px solid var(--line);
  margin-right: 24px;
}

.step:last-child {
  border-right: 0;
  margin-right: 0;
}

.step-number {
  color: var(--coral);
  font-weight: 850;
}

.step h3 {
  margin: 20px 0 8px;
  font-size: 18px;
}

.step p {
  margin: 0;
  color: var(--muted);
}

.contact-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: center;
}

.contact-band h2 {
  margin: 0 0 8px;
  font-size: 32px;
}

.contact-band p {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
  font-size: 13px;
}

.site-footer .page-width {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

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

.auth-shell,
.checkout-shell,
.invalid-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-layout {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-context {
  padding: 52px;
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-context .brand {
  color: #fff;
}

.auth-context h1 {
  margin: 50px 0 14px;
  font-size: 38px;
}

.auth-context p {
  margin: 0;
  color: #b9c5c1;
}

.auth-form {
  padding: 52px 42px;
}

.auth-form h2 {
  margin: 0 0 8px;
  font-size: 25px;
}

.auth-form > p {
  margin: 0 0 28px;
  color: var(--muted);
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  background: var(--surface);
  color: var(--ink);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.field {
  margin-bottom: 16px;
}

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

.field-wide {
  grid-column: 1 / -1;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
}

.check-field input {
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  accent-color: var(--brand);
}

.check-field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.form-error,
.form-note {
  min-height: 22px;
  margin: 12px 0;
  font-size: 13px;
}

.form-error {
  color: var(--danger);
}

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

.full-button {
  width: 100%;
}

.console-body {
  background: #f3f5f4;
}

.console-header {
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.console-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.console-user button {
  min-height: 36px;
  padding: 6px 10px;
}

.console-layout {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
}

.console-nav {
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 20px 12px;
}

.console-nav button {
  width: 100%;
  min-height: 40px;
  justify-content: flex-start;
  margin-bottom: 4px;
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.console-nav button:hover,
.console-nav button.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.console-main {
  width: 100%;
  max-width: 1340px;
  padding: 28px;
  overflow: hidden;
}

.view[hidden] {
  display: none;
}

.view-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}

.view-head h1 {
  margin: 0;
  font-size: 27px;
}

.view-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--surface);
}

.stat {
  min-height: 112px;
  padding: 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat:nth-child(4n) {
  border-right: 0;
}

.stat:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
}

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

.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 18px;
  min-width: 0;
}

.panel h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.panel > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.panel-actions,
.table-actions,
.filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-actions {
  margin-top: 16px;
}

.merchant-share {
  margin-top: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 20px;
  align-items: center;
}

.merchant-share-copy {
  min-width: 0;
}

.admin-merchant-qr {
  width: 132px;
  height: 132px;
  border: 1px solid var(--line);
  background: #fff;
}

.created-payment-page {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.created-payment-page strong,
.created-payment-page a {
  display: block;
}

.created-payment-page a {
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

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

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: #f8faf9;
  font-size: 12px;
  font-weight: 800;
}

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

tbody tr:hover {
  background: #f8faf9;
}

td .secondary,
td button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  background: var(--muted);
}

.status-dot.active,
.status-dot.succeeded {
  background: var(--success);
}

.status-dot.pending,
.status-dot.processing {
  background: var(--gold);
}

.status-dot.failed,
.status-dot.inactive {
  background: var(--danger);
}

.merchant-usage {
  margin-top: 18px;
}

.usage-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 2fr) 60px;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
}

.usage-track {
  height: 8px;
  background: var(--surface-strong);
  overflow: hidden;
}

.usage-track span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width 360ms ease;
}

.empty-state {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}

.filters {
  margin-bottom: 14px;
}

.filters select {
  width: auto;
  min-width: 180px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  max-width: 380px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--danger);
}

dialog {
  width: min(560px, calc(100% - 30px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(23, 33, 30, 0.48);
}

.dialog-body {
  padding: 22px;
}

.dialog-body h2 {
  margin: 0 0 8px;
}

.secret-output {
  display: block;
  margin: 14px 0;
  padding: 12px;
  background: var(--ink);
  color: #fff;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.checkout-frame {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(420px, 1.14fr);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.checkout-summary {
  padding: 40px;
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 590px;
}

.checkout-summary .brand {
  color: #fff;
}

.checkout-merchant {
  margin-top: auto;
}

.checkout-merchant p {
  margin: 0 0 5px;
  color: #b9c5c1;
}

.checkout-merchant h1 {
  margin: 0 0 26px;
  font-size: 30px;
}

.order-line,
.order-total {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-top: 1px solid #43514c;
}

.order-line span,
.order-total span {
  color: #b9c5c1;
}

.order-total strong {
  font-size: 22px;
}

.checkout-form {
  padding: 40px;
}

.checkout-form h2 {
  margin: 0 0 7px;
  font-size: 25px;
}

.checkout-form > p {
  margin: 0 0 22px;
  color: var(--muted);
}

.method-list {
  display: grid;
  gap: 9px;
}

.method-option {
  min-height: 72px;
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.method-option:hover,
.method-option.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.method-option[disabled]:hover {
  border-color: var(--line);
  background: var(--surface);
}

.method-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-strong);
  color: var(--brand);
  font-weight: 900;
}

.method-mpesa .method-mark {
  background: #e3f3e9;
  color: #167647;
}

.method-card .method-mark {
  background: #e7eef7;
  color: #315d86;
}

.method-google_pay .method-mark {
  background: #f4eee2;
  color: #9b4c2f;
}

.method-apple_pay .method-mark {
  background: #eceeed;
  color: #17211e;
}

.method-option strong,
.method-option small {
  display: block;
}

.method-option small {
  color: var(--muted);
  font-weight: 500;
}

.method-state {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.checkout-action {
  width: 100%;
  margin-top: 18px;
}

.checkout-status {
  min-height: 24px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.checkout-status.error {
  color: var(--danger);
}

.security-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.merchant-pay-body {
  min-height: 100vh;
  background: #eef3f1;
}

.merchant-pay-header {
  min-height: 68px;
  padding: 0 max(22px, calc((100vw - 1160px) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.secure-label {
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.merchant-pay-shell {
  width: min(1100px, calc(100% - 40px));
  min-height: calc(100vh - 116px);
  margin: 24px auto;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(420px, 1.14fr);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.merchant-pay-identity {
  padding: 54px 46px;
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
}

.merchant-pay-identity h1 {
  margin: 0;
  font-size: 42px;
  overflow-wrap: anywhere;
}

.merchant-instructions {
  margin: 20px 0 44px;
  color: #c3ceca;
  font-size: 17px;
}

.merchant-qr-wrap {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid #43514c;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.merchant-qr {
  width: 112px;
  height: 112px;
  background: #fff;
  border: 8px solid #fff;
}

.merchant-qr-wrap strong {
  display: block;
}

.merchant-qr-wrap p {
  margin: 5px 0 12px;
  color: #b9c5c1;
  font-size: 13px;
}

.merchant-qr-wrap .secondary {
  background: transparent;
  border-color: #66736e;
  color: #fff;
}

.merchant-qr-wrap .secondary:hover {
  background: #2b3733;
}

.compact-button {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 13px;
}

.merchant-pay-form {
  padding: 46px;
}

.merchant-form-head {
  margin-bottom: 26px;
}

.merchant-form-head h2 {
  margin: 4px 0 0;
  font-size: 28px;
}

.step-label {
  margin: 0;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.merchant-pay-form .field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.package-fieldset {
  min-width: 0;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.package-fieldset legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.merchant-package-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.merchant-package-option {
  min-height: 88px;
  width: 100%;
  padding: 12px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  display: block;
  text-align: left;
}

.merchant-package-option:hover,
.merchant-package-option.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.merchant-package-option[disabled]:hover {
  border-color: var(--line);
  background: var(--surface);
}

.package-option-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.package-option-detail {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.currency-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  background: #fff7e8;
  color: #694e18;
  font-size: 12px;
}

.checkout-result-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.checkout-result {
  width: min(520px, 100%);
  padding: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.checkout-result .brand {
  justify-content: center;
  margin-bottom: 34px;
}

.checkout-result h1 {
  margin: 8px 0 12px;
  font-size: 34px;
}

.checkout-result > p:not(.eyebrow) {
  margin: 0 auto 26px;
  max-width: 420px;
  color: var(--muted);
}

.result-mark {
  width: 62px;
  height: 62px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-strong);
  color: var(--brand);
  font-weight: 900;
  animation: settle-in 320ms ease both;
}

.result-mark.success {
  background: #dff1e7;
  color: var(--success);
}

.result-mark.error {
  background: #f6e5e2;
  color: var(--danger);
}

.manual-frame,
.invalid-frame {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 26px;
}

.manual-frame h1,
.invalid-frame h1 {
  margin: 22px 0 8px;
  font-size: 27px;
}

.manual-frame > p,
.invalid-frame p {
  color: var(--muted);
}

.manual-amount {
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.qr-image {
  width: 220px;
  height: 220px;
  display: block;
  margin: 22px auto;
  padding: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.payment-reference {
  display: block;
  padding: 11px;
  background: var(--surface-strong);
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.instruction-list {
  margin: 18px 0 12px;
  border-top: 1px solid var(--line);
}

.instruction-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.instruction-row span {
  color: var(--muted);
  font-size: 13px;
}

.instruction-row strong {
  text-align: right;
  word-break: break-word;
}

.pending-note {
  margin-top: 18px;
  padding: 12px;
  border-left: 4px solid var(--gold);
  background: #fff8e6;
  color: #6b5520;
  font-size: 13px;
}

@keyframes settle-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .about-hero {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .about-hero h1 {
    font-size: 52px;
  }

  .payment-map {
    min-height: auto;
  }

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

  .step:nth-child(2) {
    border-right: 0;
    margin-right: 0;
  }

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

  .console-nav {
    position: sticky;
    top: 64px;
    z-index: 20;
    display: flex;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 14px;
  }

  .console-nav button {
    width: auto;
    white-space: nowrap;
    margin: 0 4px 0 0;
  }

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

  .stat:nth-child(2n) {
    border-right: 0;
  }

  .stat:nth-last-child(-n + 4) {
    border-bottom: 1px solid var(--line);
  }

  .stat:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .workspace-grid,
  .workspace-grid.equal {
    grid-template-columns: 1fr;
  }

  .checkout-frame {
    grid-template-columns: 1fr;
  }

  .merchant-pay-shell {
    grid-template-columns: 1fr;
  }

  .merchant-pay-identity {
    min-height: 480px;
  }

  .checkout-summary {
    min-height: auto;
  }

  .checkout-merchant {
    margin-top: 46px;
  }
}

@media (max-width: 700px) {
  .page-width,
  .site-header nav {
    width: min(100% - 28px, 1160px);
  }

  .nav-links a:not(.button) {
    display: none;
  }

  .about-hero {
    min-height: auto;
    padding-top: 48px;
  }

  .about-hero h1 {
    font-size: 42px;
  }

  .lede {
    font-size: 17px;
  }

  .payment-map {
    padding-left: 26px;
  }

  .rail-item {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .rail-item::before {
    left: -33px;
  }

  .rail-icon {
    width: 46px;
    height: 46px;
  }

  .state-label {
    grid-column: 2;
  }

  .section-heading,
  .contact-band {
    grid-template-columns: 1fr;
    gap: 18px;
  }

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

  .step,
  .step:nth-child(2) {
    margin: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .step:last-child {
    border-bottom: 0;
  }

  .site-footer .page-width,
  .view-head {
    flex-direction: column;
  }

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

  .auth-context,
  .auth-form {
    padding: 30px 24px;
  }

  .auth-context h1 {
    margin-top: 38px;
  }

  .console-header {
    padding: 0 14px;
  }

  .console-user span {
    display: none;
  }

  .console-main {
    padding: 20px 14px;
  }

  .stats-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .stat,
  .stat:nth-child(2n),
  .stat:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stat:last-child {
    border-bottom: 0;
  }

  .checkout-shell {
    padding: 0;
    align-items: start;
  }

  .checkout-frame {
    border: 0;
    box-shadow: none;
  }

  .checkout-summary,
  .checkout-form {
    padding: 28px 20px;
  }

  .merchant-pay-header {
    min-height: 62px;
    padding: 0 14px;
  }

  .secure-label {
    display: none;
  }

  .merchant-pay-shell {
    width: 100%;
    min-height: calc(100vh - 62px);
    margin: 0;
    border: 0;
    box-shadow: none;
  }

  .merchant-pay-identity,
  .merchant-pay-form {
    padding: 32px 20px;
  }

  .merchant-pay-identity {
    min-height: 430px;
  }

  .merchant-pay-identity h1 {
    font-size: 35px;
  }

  .merchant-qr-wrap {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .merchant-qr {
    width: 92px;
    height: 92px;
  }

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

  .merchant-share {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
