:root {
  --portal-purple: #432957;
  --portal-purple-dark: #372147;
  --portal-teal: #009688;
  --portal-blue: #1e88e5;
  --portal-red: #d50022;
  --text: #222222;
  --muted: #6f6f6f;
  --border: #d9d9d9;
  --soft: #f5f5f5;
  --success-soft: #e4f5f1;
  --warning-soft: #fff8e1;
  --warning: #a46300;
  --card-width: 1164px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: #ffffff;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.48;
}

.embed-body {
  background: transparent;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: #0000ee;
}

.borrower-topbar {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 56px;
  padding: 0 16px;
  color: #ffffff;
  background: linear-gradient(180deg, var(--portal-purple) 0%, var(--portal-purple-dark) 100%);
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.12);
  position: relative;
  z-index: 2;
}

.logo-mark {
  display: grid;
  width: 48px;
  min-width: 48px;
  height: 48px;
  place-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.topbar-spacer {
  flex: 1;
}

.sibling-topbar {
  min-height: 56px;
}

.borrower-topbar a {
  color: #ffffff;
  font-size: 16px;
  text-decoration: none;
}

.topbar-title {
  flex: 0 1 auto;
  margin: 0;
  color: #ffffff;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
}

.topbar-link,
.topbar-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 4px;
  font-size: 16px;
  white-space: nowrap;
}

.topbar-link {
  border: 0;
}

.topbar-tab {
  color: #ffffff;
  background: transparent;
  border: 0;
}

.topbar-tab.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.31);
}

.portal-content {
  width: min(var(--card-width), calc(100vw - 32px));
  margin: 24px auto 72px;
}

.borrower-shell.is-embedded .portal-content {
  width: min(var(--card-width), 100%);
  margin: 0 auto;
}

.borrower-shell.is-embedded .center-state {
  margin: 24px auto;
}

.servicing-card,
.crypto-card,
.fine-print-card,
.center-state,
.login-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.servicing-card,
.crypto-card {
  margin-bottom: 22px;
  padding: 18px;
}

.servicing-card {
  padding: 24px 30px 28px;
}

.pay-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.pay-layout > .crypto-card,
.pay-layout > .servicing-card {
  margin-bottom: 0;
}

@media (min-width: 1024px) {
  .pay-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    margin-bottom: 22px;
  }

  .pay-layout > .servicing-card {
    position: sticky;
    top: 16px;
    padding: 20px 22px 22px;
  }

  .pay-layout > .servicing-card .info-grid {
    max-width: none;
    gap: 10px;
  }

  .pay-layout > .servicing-card .info-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .pay-layout > .servicing-card .info-row span {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 600;
  }

  .pay-layout > .servicing-card .info-row strong {
    font-size: 14px;
    color: var(--text);
    word-break: break-word;
  }

  .pay-layout > .servicing-card .card-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .pay-layout > .servicing-card h2 {
    font-size: 16px;
    margin: 0;
  }

  .pay-layout > .servicing-card .intro-copy {
    font-size: 13px;
    margin: 0;
  }
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  font-size: 21px;
  font-weight: 400;
}

h2 {
  margin-bottom: 7px;
  font-size: 21px;
  font-weight: 400;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 500;
}

.intro-copy,
.crypto-card p {
  max-width: 760px;
  color: var(--text);
}

.eligible-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 12px;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
  white-space: nowrap;
}

.eligible-chip {
  color: #ffffff;
  background: var(--portal-teal);
}

.status-chip {
  color: var(--warning);
  background: var(--warning-soft);
  border: 1px solid #f1d99a;
}

.status-chip.confirmed {
  color: #087443;
  background: var(--success-soft);
  border-color: #b7ded4;
}

.status-chip.rejected {
  color: #b42318;
  background: #fee4e2;
  border-color: #f3b8b2;
}

.info-grid {
  display: grid;
  gap: 14px;
  max-width: 720px;
  margin-top: 16px;
}

.info-grid.compact {
  max-width: none;
  gap: 10px;
}

.info-row {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  font-size: 16px;
}

.info-row span {
  color: var(--text);
}

.info-row strong {
  font-weight: 400;
}

.info-row.emphasis strong {
  font-weight: 600;
}

.task-style-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 18px -18px 0;
  padding: 18px 38px;
  border-top: 1px solid #eeeeee;
  border-bottom: 1px solid #eeeeee;
}

.material-word {
  color: var(--portal-teal);
  font-size: 13px;
  text-align: center;
}

.task-style-row h3 {
  margin: 0 0 4px;
}

.task-style-row p {
  margin: 0;
  color: var(--muted);
}

.payment-wizard-card {
  padding: 18px;
}

.wizard-progress {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  list-style: none;
  margin: 18px -18px 0;
  padding: 16px 18px;
  border-top: 1px solid #eeeeee;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.wizard-progress::-webkit-scrollbar {
  display: none;
}

.progress-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.progress-step .dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #bfcbd5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.progress-step.done .dot,
.progress-step.active .dot {
  background: var(--portal-teal);
  border-color: var(--portal-teal);
  color: #ffffff;
}

.progress-step.active .dot {
  box-shadow: 0 0 0 4px rgba(0, 150, 136, 0.15);
}

.progress-step.done {
  color: var(--text);
}

.progress-step.active {
  color: var(--text);
  font-weight: 600;
}

.progress-step .label {
  line-height: 1;
}

.progress-step .sep {
  margin: 0 6px;
  color: #cbd5e1;
  flex-shrink: 0;
}

.progress-step.done + .progress-step .sep,
.progress-step.done .sep {
  color: var(--portal-teal);
}

/* Compact view on narrow screens: only active step keeps its label */
@media (max-width: 640px) {
  .wizard-progress {
    gap: 0;
    padding: 14px 18px;
  }
  .progress-step .label {
    display: none;
  }
  .progress-step.active .label {
    display: inline;
  }
  .progress-step .sep {
    margin: 0 4px;
  }
}

.wizard-panel {
  margin-top: 18px;
  padding: 18px;
  background: #fafafa;
  border: 1px solid #eeeeee;
  border-radius: 4px;
}

.wizard-stage {
  display: grid;
  gap: 18px;
}

.wizard-copy h3 {
  margin-bottom: 4px;
  font-size: 18px;
}

.wizard-copy p {
  margin-bottom: 0;
  color: var(--muted);
}

.wizard-amount {
  background: #ffffff;
}

.success-stage {
  justify-items: start;
}

.processing-state {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #dce8e5;
  border-top-color: var(--portal-teal);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.success-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #ffffff;
  background: var(--portal-teal);
  border-radius: 50%;
  font-size: 22px;
  font-weight: 600;
}

.next-steps-card {
  display: grid;
  gap: 10px;
  width: min(680px, 100%);
  padding: 16px;
  background: var(--success-soft);
  border: 1px solid #b7ded4;
  border-radius: 4px;
}

.next-steps-card h4 {
  margin: 0;
  color: #087443;
  font-size: 15px;
  font-weight: 600;
}

.next-steps-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.next-steps-card li {
  color: var(--text);
}

.payment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 24px;
  padding-top: 22px;
}

.payment-builder {
  display: grid;
  gap: 18px;
}

.field-block label,
.proof-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

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

.choice-row button {
  display: grid;
  gap: 6px;
  min-height: 96px;
  padding: 14px 16px;
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.choice-row button:hover {
  border-color: #98a2ad;
}

.choice-row button.active {
  background: var(--success-soft);
  border-color: var(--portal-teal);
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.12);
}

/* --- Payment option tiles (Step 1) --- */
.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.option-tile {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  text-align: left;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease, background 140ms ease;
}

.option-tile:hover {
  border-color: #98a2ad;
  transform: translateY(-1px);
}

.option-tile.active {
  border-color: var(--portal-teal);
  background: linear-gradient(180deg, #ffffff 0%, var(--success-soft) 100%);
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.14);
}

.option-tile.best::before {
  content: "Best value";
  position: absolute;
  top: -10px;
  left: 14px;
  padding: 3px 9px;
  background: var(--portal-purple);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
}

.option-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.option-head strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.save-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: linear-gradient(90deg, #16a34a 0%, #15803d 100%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(22, 163, 74, 0.3);
}

.option-amount {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.option-amount .amount-num {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.option-amount .amount-asset {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.option-meta {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.option-savings {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: #15803d;
}

/* --- Receipt summary --- */
.receipt-card {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.receipt-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text);
}

.receipt-row .value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.receipt-row.savings {
  color: #15803d;
}

.receipt-row.savings .value {
  color: #15803d;
}

.save-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

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

.receipt-row.total {
  font-size: 16px;
}

.receipt-row.total .value {
  font-size: 20px;
  font-weight: 700;
}

.receipt-row.total .value em {
  font-style: normal;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 2px;
}

.receipt-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 9px 12px;
  background: var(--success-soft);
  color: #087443;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
}

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

.choice-row span {
  color: var(--muted);
}

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

.choice-row em {
  width: fit-content;
  padding: 3px 8px;
  color: #087443;
  background: var(--success-soft);
  border-radius: 10px;
  font-size: 12px;
  font-style: normal;
}

.amount-box {
  display: grid;
  gap: 3px;
  width: 320px;
  max-width: 100%;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 4px;
  text-align: center;
}

.amount-box span,
.amount-box small {
  color: var(--muted);
}

.amount-box strong {
  font-size: 30px;
  font-weight: 400;
}

.primary-action,
.outline-action {
  min-height: 36px;
  padding: 0 18px;
  border-radius: 4px;
  font-weight: 500;
}

.primary-action {
  width: fit-content;
  color: #ffffff;
  background: var(--portal-teal);
  border: 0;
  box-shadow: 0 2px 4px rgba(0, 150, 136, 0.25);
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.outline-action {
  color: var(--portal-blue);
  background: #ffffff;
  border: 1px solid var(--portal-blue);
}

.link-action {
  min-height: 36px;
  padding: 0;
  color: var(--portal-blue);
  background: transparent;
  border: 0;
  font-weight: 500;
}

.review-panel {
  padding: 16px;
  background: var(--soft);
  border-radius: 4px;
}

.review-panel h3 {
  margin-bottom: 12px;
}

.review-panel ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.review-panel li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.review-panel li span {
  width: 16px;
  height: 16px;
  border: 2px solid #bfcbd5;
  border-radius: 50%;
}

.review-panel li.done {
  color: var(--text);
}

.review-panel li.done span {
  background: var(--portal-teal);
  border-color: var(--portal-teal);
  box-shadow: inset 0 0 0 4px #ffffff;
}

.instruction-grid,
.quote-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.instruction-grid div,
.quote-summary-grid div {
  display: grid;
  gap: 5px;
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.instruction-grid span,
.quote-summary-grid span,
.address-copy span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.instruction-grid strong,
.quote-summary-grid strong {
  font-size: 17px;
}

.checkout-note {
  max-width: 760px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.address-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  background: #fafafa;
  border: 1px dashed #bfcbd5;
  border-radius: 4px;
}

.qr-panel {
  display: grid;
  grid-template-columns: 192px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.qr-frame {
  display: grid;
  width: 176px;
  height: 176px;
  place-items: center;
  background: #ffffff;
  border: 1px solid #eeeeee;
  border-radius: 4px;
}

.qr-code {
  display: block;
  width: 154px;
  height: 154px;
}

.qr-panel span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.qr-panel strong,
.qr-panel small {
  display: block;
  margin-top: 5px;
}

.qr-panel small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.payment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.payment-feedback {
  display: grid;
  gap: 4px;
  min-height: 18px;
}

.payment-message,
.payment-error {
  font-size: 13px;
}

.payment-message {
  color: #087443;
}

.payment-error {
  color: #b42318;
}

.wallet-step {
  display: grid;
  gap: 18px;
}

.wallet-actions {
  display: grid;
  gap: 12px;
}

.wallet-instruction {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.wallet-address-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wallet-connected-label {
  font-size: 14px;
  color: var(--muted);
}

.wallet-connected-label code {
  display: inline;
  margin: 0;
  font-size: inherit;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

.wallet-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

/* --- Network chips (Step 1) --- */
.network-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.network-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
  cursor: pointer;
  min-height: 40px;
}

.network-chip:hover {
  border-color: #98a2ad;
}

.network-chip.active {
  border-color: var(--portal-teal);
  background: var(--success-soft);
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.12);
}

.network-chip .chip-name {
  line-height: 1;
}

.network-chip .chip-tag {
  padding: 2px 8px;
  background: rgba(0, 150, 136, 0.12);
  color: #00695f;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.network-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.asset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  min-height: 40px;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.asset-chip:hover { border-color: #98a2ad; }

.asset-chip.active {
  border-color: var(--portal-teal);
  background: var(--success-soft);
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.12);
}

.method-summary {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.method-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.method-summary-row > span {
  color: var(--muted);
}

.method-summary-row strong.with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.payment-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* --- Payment card (Step 2) --- */
.pay-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pay-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.pay-amount {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

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

.pay-amount-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
}

.pay-amount-value span {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

.pay-amount-sub {
  font-size: 13px;
  color: var(--muted);
}

.pay-network {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

/* --- Mode tabs --- */
.mode-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--soft);
  border-radius: 10px;
}

.mode-tab {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 7px;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
  cursor: pointer;
}

.mode-tab svg { opacity: 0.85; }

.mode-tab:hover {
  color: var(--text);
}

.mode-tab.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* --- Wallet pane --- */
.wallet-pane,
.manual-pane {
  display: grid;
  gap: 14px;
}

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

.pane-error {
  margin: 0;
  padding: 10px 12px;
  background: #fdecea;
  border: 1px solid #f6c8c2;
  border-radius: 8px;
  color: var(--portal-red);
  font-size: 13px;
}

.primary-action.wide {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
}

.wallet-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d97706;
  flex-shrink: 0;
}
.status-dot.ok { background: #16a34a; }

.wallet-status-text {
  display: grid;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
}

.wallet-addr code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--text);
  background: transparent;
  padding: 0;
  margin: 0;
}

.wallet-status-sub {
  font-size: 12px;
  color: var(--muted);
}

.ghost-action {
  border: 0;
  background: transparent;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
}

.ghost-action:hover {
  color: var(--text);
  background: rgba(15, 23, 42, 0.05);
}

/* --- Manual pane --- */
.manual-grid {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.manual-qr {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.manual-qr img {
  width: 196px;
  height: 196px;
  display: block;
}

.qr-hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

.manual-fields {
  display: grid;
  gap: 10px;
}

.manual-field {
  display: grid;
  gap: 5px;
}

.manual-field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.manual-value-row.plain {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  width: fit-content;
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.copy-row:hover {
  border-color: var(--portal-teal);
  background: #fcfdfd;
}

.copy-row code {
  flex: 1 1 auto;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--text);
  background: transparent;
  padding: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-row .copy-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--portal-teal);
  flex-shrink: 0;
}

.copy-feedback {
  margin: -4px 0 0;
  font-size: 12px;
  color: #087443;
  text-align: center;
}

.fade-enter-active, .fade-leave-active { transition: opacity 160ms ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

.manual-submit {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.manual-field input[type="text"] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  background: #ffffff;
  color: var(--text);
}

.manual-field input[type="text"]:focus {
  outline: none;
  border-color: var(--portal-teal);
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.18);
}

@media (max-width: 640px) {
  .manual-grid {
    grid-template-columns: 1fr;
  }
  .manual-qr {
    justify-self: center;
  }
  .pay-summary {
    flex-wrap: wrap;
  }
}

.feedback-row {
  margin-top: 0;
}

.wallet-message,
.wallet-error {
  font-size: 13px;
}

.wallet-message {
  color: #087443;
}

.wallet-error {
  color: #b42318;
}

code {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.proof-form,
.submitted-box {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #eeeeee;
}

.proof-form input,
.proof-form textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid #bfcbd5;
  border-radius: 4px;
}

.fallback-copy {
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.proof-form textarea {
  min-height: 82px;
  resize: vertical;
}

.fine-print-card {
  display: grid;
  gap: 7px;
  padding: 14px 18px;
  color: #5b470c;
  background: #fffaf0;
}

.portal-alert {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 60px;
  margin-bottom: 16px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--portal-red);
}

.portal-alert span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--portal-red);
  background: #ffffff;
  border-radius: 50%;
  font-size: 28px;
}

.center-state {
  width: min(520px, calc(100vw - 32px));
  margin: 60px auto;
  padding: 18px;
  text-align: center;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #f7f7f7;
}

.login-card {
  width: min(520px, 100%);
  padding: 28px;
}

.brand-row,
.login-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-logo-mark {
  display: grid;
  width: 34px;
  height: 42px;
  place-items: center;
}

.login-logo-mark img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand-mark {
  color: var(--portal-purple);
  font-weight: 600;
}

.login-card h1 {
  margin: 24px 0 12px;
  font-size: 28px;
  font-weight: 400;
}

.login-card p,
.fine-print {
  color: var(--muted);
}

.login-actions {
  flex-wrap: wrap;
  margin: 22px 0 12px;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 4px;
  text-decoration: none;
}

.primary-btn {
  color: #ffffff;
  background: var(--portal-teal);
}

.secondary-btn {
  color: var(--portal-blue);
  border: 1px solid var(--portal-blue);
}

@media (max-width: 860px) {
  .borrower-topbar {
    gap: 14px;
  }

  .topbar-link {
    display: none;
  }

  .topbar-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
  }

  .topbar-spacer {
    display: none;
  }

  .topbar-tab {
    min-height: 34px;
    padding: 0 12px;
    font-size: 14px;
  }

  .logo-mark {
    width: 36px;
    min-width: 36px;
    height: 36px;
  }

  .portal-content {
    margin-top: 24px;
  }

  .card-title-row,
  .payment-layout,
  .instruction-grid,
  .quote-summary-grid,
  .address-copy,
  .qr-panel,
  .choice-row,
  .info-row {
    grid-template-columns: 1fr;
  }

  .card-title-row {
    display: grid;
  }

  .wallet-row {
    display: grid;
  }

  .payment-actions {
    display: grid;
  }

  .qr-frame {
    width: 100%;
    max-width: 220px;
    height: 220px;
  }

  .qr-code {
    width: 192px;
    height: 192px;
  }

  .processing-state {
    grid-template-columns: 1fr;
  }

  .task-style-row {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .info-row {
    gap: 4px;
  }

  .primary-action {
    width: 100%;
  }
}

/* ============================================================
   Hero savings card (Step 1) + trust strip + portal FAQ
   ============================================================ */

.hero-savings {
  display: grid;
  gap: 10px;
  padding: 6px 0 18px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--portal-teal);
}

.hero-headline {
  margin: 0;
  font-size: clamp(20px, 3.2vw, 26px);
  line-height: 1.28;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.hero-number {
  display: inline;
  font-size: 1.55em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--portal-purple);
  white-space: nowrap;
}

.hero-annualized {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.hero-annualized strong {
  color: var(--text);
  font-weight: 600;
}

.hero-annualized .hero-urgency {
  margin-left: 2px;
  color: #92580c;
  font-weight: 500;
}

.trust-strip {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.trust-strip--hero {
  /* same look as default — hero is now flat */
}

.trust-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.trust-divider {
  color: #cbd5e1;
  font-size: 14px;
}

.trust-caption {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

.savings-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.savings-chip svg {
  flex-shrink: 0;
}

.pay-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Portal FAQ accordion */
.portal-faq {
  margin: 22px auto 0;
  padding: 22px 24px 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.portal-faq-title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.portal-faq-item {
  border-top: 1px solid #eeeeee;
  padding: 12px 0;
}

.portal-faq-item:first-of-type {
  border-top: 0;
  padding-top: 6px;
}

.portal-faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  padding: 6px 0;
}

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

.portal-faq-q {
  flex: 1 1 auto;
}

.portal-faq-chevron {
  color: var(--muted);
  transition: transform 200ms ease;
  flex-shrink: 0;
}

.portal-faq-item[open] .portal-faq-chevron {
  transform: rotate(180deg);
  color: var(--portal-teal);
}

.portal-faq-item[open] summary {
  color: var(--portal-teal);
}

.portal-faq-a {
  margin: 8px 0 6px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #444;
}

@media (max-width: 640px) {
  .hero-savings {
    padding: 22px 20px 18px;
    margin: -2px -2px 18px;
  }
  .hero-headline-tail {
    font-size: 15px;
  }
  .trust-row {
    gap: 10px;
  }
  .portal-faq {
    padding: 18px 18px 6px;
  }
}

/* ============================================================
   Sign-in gate (standalone landing when no email is known)
   ============================================================ */

.sign-in-gate {
  display: grid;
  gap: 14px;
  max-width: 520px;
  margin: 56px auto;
  padding: 32px 32px 28px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.sign-in-gate-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0a8472;
}

.sign-in-gate-headline {
  margin: 0;
  font-size: clamp(22px, 4.6vw, 28px);
  line-height: 1.22;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.sign-in-gate-body {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: #555555;
}

.sign-in-gate-body code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
  background: var(--soft);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text);
  border: 1px solid var(--border);
}

.sign-in-gate-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  min-height: 46px;
  padding: 0 22px;
  background-color: #009688;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 150, 136, 0.4);
  width: 100%;
  cursor: pointer;
}

.sign-in-gate-cta:hover {
  background-color: #00897b;
}

.sign-in-gate-subline {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .sign-in-gate {
    margin: 24px 12px;
    padding: 28px 22px 24px;
  }
}
