:root {
  --portal-brand: var(--portal-primary, #087A45);
  --portal-navy: var(--portal-secondary, #0f172a);
  --portal-text: #172033;
  --portal-muted: #64748b;
  --portal-line: #e2e8f0;
  --portal-surface: #fff;
  --portal-bg: #f5f8f7;
  --portal-shadow: 0 8px 24px rgba(15, 23, 42, .07);
  /* Fixed mobile bottom navigation: 46px tap target + 14px padding + border. */
  --portal-bottom-nav-height: 64px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--portal-text);
  background: var(--portal-bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 280px; scroll-behavior: smooth; }
body.wifi-portal {
  min-width: 280px;
  min-height: 100vh;
  /* Dynamic viewport unit keeps the fixed bottom nav above the system
     captive-portal bar without a fixed height that breaks on rotate. */
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--portal-text);
  background: linear-gradient(180deg, #fff 0, var(--portal-bg) 430px, #f5f8fb 100%);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .7; }
a { color: var(--portal-brand); }
svg { display: block; }
.is-hidden, .d-none, [hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Compact, owner-branded header */
.portal-header {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(110deg, #092a3d 0%, #0b473c 55%, #087c55 100%);
  padding: calc(12px + env(safe-area-inset-top)) 18px 14px;
}
.portal-header::after {
  content: ""; position: absolute; width: 380px; height: 190px; right: -130px; top: -118px;
  border: 1px solid rgba(255,255,255,.14); border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(255,255,255,.035), 0 0 0 44px rgba(255,255,255,.025);
  pointer-events: none;
}
.portal-header-inner {
  position: relative; z-index: 1; width: min(100%, 1160px); margin: 0 auto;
  min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.portal-brand { position: relative; min-width: 0; display: flex; align-items: center; gap: 11px; }
.portal-brand-mark {
  flex: 0 0 45px; width: 45px; height: 45px; display: grid; place-items: center;
  color: var(--portal-accent); background: color-mix(in srgb, var(--portal-accent) 18%, #fff); border-radius: 15px;
}
.portal-brand-mark svg { width: 33px; height: 33px; }
.portal-brand-logo {
  flex: 0 0 auto; height: 46px; width: auto; max-width: min(190px, 32vw);
  object-fit: contain; border-radius: 12px; background: #fff; padding: 4px;
}
.portal-brand-copy { min-width: 0; max-width: 100%; display: flex; flex-direction: column; gap: 3px; }
.portal-brand-logo-only, .portal-brand-name-only { gap: 0; }
.portal-brand-logo-only .portal-brand-logo { max-width: 190px; margin-right: 0; }
.portal-brand-name-only .portal-brand-copy { align-items: flex-start; }
.portal-brand-combined .portal-brand-copy { align-items: flex-start; }
.portal-brand-name {
  display: -webkit-box; overflow: hidden; color: #fff; font-size: clamp(16px, 4vw, 21px); font-weight: 800;
  line-height: 1.12; overflow-wrap: anywhere;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.portal-tagline {
  display: -webkit-box; max-width: min(44vw, 430px); overflow: hidden;
  color: rgba(255,255,255,.8); font-size: 12px; line-height: 1.25; overflow-wrap: anywhere;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.network-chip {
  max-width: 48%; min-width: 124px; display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; color: var(--portal-navy); background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.72); border-radius: 16px; box-shadow: 0 5px 18px rgba(0,0,0,.12);
}
.network-chip-icon { flex: 0 0 27px; color: var(--portal-brand); }
.network-chip-icon svg { width: 27px; height: 27px; }
.network-chip-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.2; }
.network-chip-copy > span { color: #64748b; font-size: 10px; }
.network-chip-copy strong { overflow-wrap: anywhere; font-size: 12px; line-height: 1.25; }
.network-chip-copy small { overflow: hidden; color: #64748b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.portal-main { width: min(100%, 1180px); margin: 0 auto; padding: 22px 20px 30px; }
.portal-container { display: flex; flex-direction: column; gap: 24px; }
.portal-intro { padding: 4px 8px 0; text-align: center; }
.portal-eyebrow, .section-kicker, .checkout-step {
  margin: 0 0 7px; color: var(--portal-brand); font-size: 11px; font-weight: 800;
  letter-spacing: .13em; text-transform: uppercase;
}
.portal-intro h1 {
  margin: 0; color: var(--portal-navy); font-size: clamp(27px, 5vw, 43px); font-weight: 850;
  letter-spacing: -.045em; line-height: 1.1;
}
.portal-intro h1 span { color: var(--portal-brand); }
.portal-intro-copy { max-width: 620px; margin: 10px auto 0; color: #5f6d80; font-size: 15px; line-height: 1.5; }

.portal-benefits {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  padding: 5px 0 1px;
}
.benefit-item { min-width: 0; display: flex; align-items: center; gap: 10px; }
.benefit-icon {
  flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center;
  color: var(--portal-brand); background: color-mix(in srgb, var(--portal-brand) 11%, #fff); border-radius: 50%;
}
.benefit-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.benefit-item strong, .benefit-item small { display: block; }
.benefit-item strong { color: var(--portal-navy); font-size: 12px; line-height: 1.3; }
.benefit-item small { margin-top: 2px; color: var(--portal-muted); font-size: 11px; line-height: 1.35; }

.plans-section { min-width: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.section-kicker { margin-bottom: 4px; font-size: 10px; }
.section-heading h2 { margin: 0; color: var(--portal-navy); font-size: clamp(22px, 4vw, 29px); font-weight: 800; letter-spacing: -.025em; }
.currency-note { flex: 0 0 auto; padding: 8px 11px; color: #475569; background: #fff; border: 1px solid var(--portal-line); border-radius: 12px; font-size: 11px; }
.currency-note strong { color: var(--portal-navy); }
.package-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.pkg-card {
  --plan-accent: #059669; --plan-tint: #effcf6;
  position: relative; min-width: 0; display: flex; flex-direction: column; padding: 16px;
  background: var(--portal-surface); border: 1px solid #dce6ef; border-radius: 19px;
  box-shadow: 0 5px 16px rgba(15, 23, 42, .055); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.pkg-card:nth-child(4n + 2) { --plan-accent: #7656e8; --plan-tint: #f4f1ff; }
.pkg-card:nth-child(4n + 3) { --plan-accent: #1479e8; --plan-tint: #eef6ff; }
.pkg-card:nth-child(4n + 4) { --plan-accent: #e87911; --plan-tint: #fff6eb; }
.pkg-card:hover { transform: translateY(-2px); border-color: var(--plan-accent); box-shadow: var(--portal-shadow); }
.pkg-card.pkg-featured { border-color: var(--plan-accent); background: linear-gradient(160deg, var(--plan-tint), #fff 55%); }
.pkg-card.selected { border-color: var(--plan-accent); box-shadow: 0 0 0 3px rgba(5, 150, 105, .18), var(--portal-shadow); }
.pkg-card-head { min-height: 54px; display: flex; align-items: center; gap: 11px; }
.plan-icon { flex: 0 0 50px; width: 50px; height: 50px; display: grid; place-items: center; color: #fff; background: var(--plan-accent); border-radius: 50%; }
.plan-icon svg { width: 31px; height: 31px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pkg-heading-copy { min-width: 0; }
.pkg-name { margin: 0; color: var(--portal-navy); font-size: clamp(14px, 2vw, 18px); font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.pkg-desc { margin: 3px 0 0; color: var(--portal-muted); font-size: 11px; line-height: 1.35; }
.pkg-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 13px 0 12px; color: var(--plan-accent); }
.pkg-price span { font-size: 13px; font-weight: 750; }
.pkg-price strong { font-size: clamp(23px, 4vw, 32px); font-weight: 850; letter-spacing: -.045em; line-height: 1.1; overflow-wrap: anywhere; }
.pkg-features { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.pkg-features li { min-width: 0; display: flex; align-items: flex-start; gap: 8px; color: #26354b; font-size: 12px; line-height: 1.4; }
.pkg-features li > svg { flex: 0 0 17px; width: 17px; height: 17px; margin-top: 1px; fill: none; stroke: #485a72; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pkg-features strong { color: var(--portal-navy); font-weight: 750; }
.feature-secondary { color: var(--portal-muted); }
.pkg-policy { margin: auto 0 12px; padding-top: 10px; color: var(--portal-muted); border-top: 1px solid #edf1f5; font-size: 10px; line-height: 1.4; }
.pkg-badge { position: absolute; top: -9px; right: 12px; display: flex; align-items: center; gap: 4px; padding: 5px 9px; color: #fff; background: var(--plan-accent); border-radius: 999px; font-size: 10px; font-weight: 750; }
.pkg-badge svg { width: 13px; height: 13px; fill: currentColor; }
.plan-select, .voucher-submit {
  min-height: 48px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 14px; color: #fff; background: linear-gradient(100deg, #07834e, #05a86c);
  border: 0; border-radius: 12px; box-shadow: 0 5px 12px rgba(5, 150, 105, .16);
  font-size: 14px; font-weight: 800; text-align: center; transition: filter .15s ease, transform .15s ease;
}
.plan-select { margin-top: auto; }
.plan-select svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.plan-select:hover, .voucher-submit:hover { filter: brightness(.95); }
.plan-select:focus-visible, .voucher-submit:focus-visible, input:focus-visible, .payment-option:focus-within { outline: 3px solid rgba(5, 150, 105, .32); outline-offset: 2px; }
.plan-select:active, .voucher-submit:active { transform: translateY(1px); }
.plan-select:disabled { box-shadow: none; opacity: .65; }
.plan-select[aria-pressed="true"] { background: var(--portal-navy); }

.portal-empty { padding: 34px 20px; text-align: center; background: #fff; border: 1px dashed #cbd5e1; border-radius: 18px; }
.empty-icon { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 10px; color: var(--portal-brand); background: color-mix(in srgb, var(--portal-brand) 11%, #fff); border-radius: 50%; }
.empty-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.portal-empty h3 { margin: 0; color: var(--portal-navy); font-size: 17px; }
.portal-empty p { margin: 5px 0 0; color: var(--portal-muted); font-size: 13px; }

.checkout-panel, .session-panel { padding: 19px; background: #fff; border: 1px solid var(--portal-line); border-radius: 19px; box-shadow: var(--portal-shadow); }
.checkout-heading h2, .session-panel h2 { margin: 0; color: var(--portal-navy); font-size: 21px; font-weight: 800; }
.checkout-step { margin-bottom: 4px; font-size: 10px; }
.checkout-summary { margin: 14px 0; padding: 13px 14px; background: #effaf5; border: 1px solid #d1f0e0; border-radius: 12px; }
.summary-name { color: var(--portal-navy); font-weight: 800; }
.summary-price { margin-top: 3px; color: var(--portal-brand); font-size: 19px; font-weight: 850; }
.checkout-instruction { margin: 12px 0; color: var(--portal-muted); font-size: 13px; line-height: 1.5; }
.contact-methods { min-width: 0; display: flex; flex-wrap: wrap; gap: 9px; margin: 12px 0 14px; padding: 0; border: 0; }
.contact-methods legend { width: 100%; margin-bottom: 1px; color: #334155; font-size: 12px; font-weight: 750; }
.contact-choice { min-height: 44px; min-width: 128px; display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; color: var(--portal-navy); background: #fff; border: 1px solid var(--portal-line); border-radius: 11px; font-size: 13px; font-weight: 700; cursor: pointer; }
.contact-choice input { width: 16px; height: 16px; accent-color: var(--portal-brand); }
.contact-choice.is-selected { background: #effaf5; border-color: var(--portal-brand); }
.contact-choice-disabled { color: #8491a1; background: #f8fafc; cursor: not-allowed; }
.contact-choice-disabled small { display: block; margin-top: 2px; color: #8a94a3; font-size: 10px; font-weight: 500; }
.contact-unavailable { margin: -7px 0 12px; color: #8a5300; font-size: 11px; line-height: 1.45; }
.payment-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 9px; margin: 12px 0; }
.payment-option { min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 11px 12px; background: #fff; border: 1px solid var(--portal-line); border-radius: 12px; color: var(--portal-navy); font-size: 13px; font-weight: 700; cursor: pointer; }
.payment-option.is-selected { border-color: var(--portal-brand); background: #effaf5; }
.payment-option input { width: 17px; height: 17px; accent-color: var(--portal-brand); }
.payment-unavailable { padding: 10px 12px; color: #64748b; background: #f8fafc; border: 1px solid var(--portal-line); border-radius: 12px; font-size: 12px; }
.payment-unavailable strong { display: block; color: #334155; }
.form-field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.form-field label { color: #334155; font-size: 12px; font-weight: 750; }
.form-field input, .voucher-form input {
  width: 100%; min-height: 48px; padding: 12px 13px; color: var(--portal-text); background: #fff;
  border: 1px solid #cbd5e1; border-radius: 11px; font-size: 16px;
}
.form-field small { color: var(--portal-muted); font-size: 11px; }
.form-feedback { min-height: 0; margin: 7px 0; color: #475569; font-size: 13px; line-height: 1.45; }
.form-feedback:empty { display: none; }
.form-feedback.is-error { color: #b42318; }
.form-feedback.is-success { color: #087443; }
.checkout-pay { margin-top: 11px; }
.checkout-secure { display: flex; align-items: center; gap: 7px; margin: 13px 0 0; color: #64748b; font-size: 11px; }
.checkout-secure svg { flex: 0 0 17px; width: 17px; height: 17px; fill: none; stroke: var(--portal-brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.text-button { display: block; margin: 6px auto 0; padding: 8px; color: var(--portal-brand); background: transparent; border: 0; font-size: 13px; font-weight: 700; }

.voucher-panel { display: flex; align-items: flex-start; gap: 14px; padding: 18px; background: linear-gradient(110deg, #f0f6fa, #eef5f9); border: 1px solid #e2eaf0; border-radius: 18px; }
.voucher-icon { flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; color: #7656e8; background: #e9e4ff; border-radius: 13px; }
.voucher-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.voucher-content { min-width: 0; flex: 1; }
.voucher-content h2 { margin: 1px 0 3px; color: var(--portal-navy); font-size: 17px; font-weight: 800; }
.voucher-content > p { margin: 0 0 12px; color: var(--portal-muted); font-size: 12px; }
.voucher-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.voucher-submit { width: auto; min-width: 125px; min-height: 48px; }
.voucher-form input { min-width: 0; }
.existing-user-login { margin: -12px 0 0; color: var(--portal-muted); font-size: 12px; text-align: center; }
.existing-user-login a { color: var(--portal-brand); font-weight: 750; text-decoration: none; }
.existing-user-login a:hover { text-decoration: underline; }

.portal-status { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid transparent; border-radius: 14px; font-size: 14px; font-weight: 650; }
.portal-status.pending { color: #8a5300; background: #fff7e6; border-color: #f5dfae; }
.portal-status.connected { color: #086b42; background: #e9f9f1; border-color: #c8eedb; }
.portal-status.ended { color: #a22a24; background: #fff0ef; border-color: #f5d0ce; }
.portal-status.signed-in { color: #155e75; background: #ecfaff; border-color: #c8eaf4; }
.status-indicator { flex: 0 0 9px; width: 9px; height: 9px; background: currentColor; border-radius: 50%; }
.session-content { display: grid; gap: 8px; margin-top: 12px; }
.session-meta { display: flex; flex-wrap: wrap; gap: 7px 16px; color: #475569; font-size: 12px; }
.session-meta strong { color: var(--portal-navy); }
.session-disconnect { justify-self: start; min-height: 40px; padding: 9px 13px; color: #a22a24; background: #fff; border: 1px solid #efc7c4; border-radius: 10px; font-weight: 700; }

.support-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 3px; border-top: 1px solid var(--portal-line); }
.support-contact { display: flex; align-items: center; gap: 11px; min-width: 0; }
.support-headset { flex: 0 0 34px; color: var(--portal-navy); }
.support-headset svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.support-contact h2 { margin: 0 0 3px; color: var(--portal-navy); font-size: 14px; font-weight: 800; }
.support-contact a, .support-contact span { display: block; color: #526176; font-size: 12px; line-height: 1.45; text-decoration: none; overflow-wrap: anywhere; }
.support-contact a:hover { color: var(--portal-brand); text-decoration: underline; }
.support-promises { display: flex; align-items: center; justify-content: flex-end; gap: clamp(10px, 2.4vw, 26px); }
.support-promises span { display: flex; align-items: center; gap: 6px; color: #42516a; font-size: 11px; white-space: nowrap; }
.support-promises svg { flex: 0 0 19px; width: 19px; height: 19px; fill: none; stroke: var(--portal-navy); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.portal-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 11px; padding: 13px 18px calc(14px + env(safe-area-inset-bottom)); color: #64748b; border-top: 1px solid #e6edf2; font-size: 11px; text-align: center; }
.portal-footer-owner { color: #64748b; }
.portal-footer-credit { color: var(--portal-navy); font-weight: 750; }
.portal-footer-note { flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; color: #8190a3; font-size: 10px; }
.portal-footer-note a { color: #64748b; text-decoration: none; }

@media (max-width: 370px) {
  .portal-header { padding-right: 12px; padding-left: 12px; }
  .portal-brand { gap: 8px; }
  .portal-brand-mark { flex-basis: 39px; width: 39px; height: 39px; border-radius: 13px; }
  .portal-brand-logo { height: 39px; max-width: 142px; }
  .network-chip { min-width: 0; max-width: 47%; gap: 5px; padding: 7px; }
  .network-chip-icon { flex-basis: 22px; }
  .network-chip-icon svg { width: 22px; height: 22px; }
  .network-chip-copy strong { font-size: 10px; }
  .portal-main { padding-right: 12px; padding-left: 12px; }
  .package-grid { grid-template-columns: minmax(0, 1fr); }
  .pkg-card { padding: 17px; }
  .voucher-panel { gap: 9px; padding: 13px; }
  .voucher-icon { flex-basis: 34px; width: 34px; height: 34px; }
  .voucher-form { grid-template-columns: minmax(0, 1fr); }
  .voucher-submit { width: 100%; }
}

@media (min-width: 640px) {
  .portal-header { padding-right: 28px; padding-left: 28px; }
  .portal-header-inner { min-height: 66px; }
  .portal-main { padding: 30px 28px 36px; }
  .portal-container { gap: 28px; }
  .portal-benefits { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .package-grid { gap: 17px; }
  .pkg-card { padding: 19px; }
  .plan-icon { flex-basis: 58px; width: 58px; height: 58px; }
  .plan-icon svg { width: 36px; height: 36px; }
  .pkg-features li { font-size: 13px; }
}

@media (min-width: 900px) {
  .portal-header { padding-right: 36px; padding-left: 36px; }
  .portal-main { padding-top: 35px; }
  .package-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .pkg-card { min-height: 325px; }
  .pkg-price strong { font-size: 34px; }
}

@media (min-width: 1180px) {
  .package-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .portal-main { padding: 18px 15px 24px; }
  .portal-container { gap: 20px; }
  .section-heading { align-items: center; }
  .currency-note { padding: 7px 9px; font-size: 10px; }
  .support-panel { align-items: flex-start; flex-direction: column; gap: 14px; }
  .support-promises { width: 100%; justify-content: space-between; gap: 8px; }
  .support-promises span { font-size: 10px; }
  .voucher-form { grid-template-columns: minmax(0, 1fr); }
  .voucher-submit { width: 100%; }
}

/* App-like customer shell and live subscription summary. */
.portal-intro {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 34px;
  overflow: hidden;
  text-align: left;
  background: linear-gradient(120deg, #fff 0%, color-mix(in srgb, var(--portal-brand) 9%, #fff) 100%);
  border: 1px solid color-mix(in srgb, var(--portal-brand) 22%, #fff);
  border-radius: 26px;
  box-shadow: 0 14px 34px rgba(8, 122, 69, .07);
}
.portal-intro-copy-block { position: relative; z-index: 1; max-width: 620px; }
.portal-intro .portal-eyebrow { margin-bottom: 9px; }
.portal-intro h1 { font-size: clamp(29px, 4.5vw, 44px); }
.portal-intro-copy { margin: 11px 0 0; max-width: 510px; }
.portal-hero-actions { display: flex; align-items: center; gap: 13px; margin-top: 19px; }
.hero-primary-action, .hero-secondary-action {
  min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 15px; border-radius: 12px; text-decoration: none; font-size: 13px; font-weight: 800;
}
.hero-primary-action { color: #fff; background: linear-gradient(110deg, var(--portal-brand), color-mix(in srgb, var(--portal-brand) 72%, #fff)); box-shadow: 0 6px 16px color-mix(in srgb, var(--portal-brand) 22%, transparent); }
.hero-primary-action:hover { color: #fff; filter: brightness(.96); }
.hero-primary-action > span { width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; }
.hero-primary-action svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hero-secondary-action { color: var(--portal-brand); background: rgba(255,255,255,.74); border: 1px solid #c9e5d3; }
.hero-secondary-action:hover { background: #fff; }
.hero-secondary-action svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.portal-open-browser { border-style: dashed; }
.portal-hero-art { position: relative; flex: 0 0 240px; width: 240px; height: 190px; display: grid; place-items: center; }
.portal-hero-art svg { position: relative; z-index: 1; width: 100%; height: 100%; overflow: visible; }
.portal-hero-art.has-hero-image { display: flex; align-items: center; justify-content: center; }
.portal-hero-image { position: relative; z-index: 1; display: block; width: 100%; height: 100%; max-height: 220px; object-fit: contain; border-radius: 18px; }
.router-signal, .router-line, .router-detail { fill: none; stroke: var(--portal-brand); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.router-signal { opacity: .78; }
.router-body { fill: var(--portal-brand); filter: drop-shadow(0 10px 12px color-mix(in srgb, var(--portal-brand) 22%, transparent)); }
.router-line { stroke: color-mix(in srgb, var(--portal-brand) 55%, #000); stroke-width: 4; }
.router-light { fill: color-mix(in srgb, var(--portal-accent) 55%, #fff); }
.router-light-two { fill: color-mix(in srgb, var(--portal-accent) 80%, #fff); }
.router-detail { stroke: rgba(255,255,255,.65); stroke-width: 3; }
.hero-orbit { position: absolute; border: 1px solid color-mix(in srgb, var(--portal-brand) 22%, transparent); border-radius: 50%; }
.hero-orbit-one { width: 185px; height: 185px; }
.hero-orbit-two { width: 225px; height: 225px; }
.hero-art-caption { position: absolute; z-index: 2; right: 0; bottom: 0; padding: 7px 10px; color: var(--portal-brand); background: #fff; border: 1px solid color-mix(in srgb, var(--portal-brand) 22%, #fff); border-radius: 999px; font-size: 10px; font-weight: 800; box-shadow: 0 4px 12px rgba(15,23,42,.06); }
.portal-account { background: #fff; border-color: color-mix(in srgb, var(--portal-brand) 20%, #fff); box-shadow: 0 8px 22px rgba(15,23,42,.045); }
.portal-account h2 { color: var(--portal-navy); }
.portal-account a { color: var(--portal-brand); }
.portal-subscription-card { margin-top: 15px; padding: 16px; background: linear-gradient(120deg, color-mix(in srgb, var(--portal-brand) 7%, #fff), #fff); border: 1px solid color-mix(in srgb, var(--portal-brand) 20%, #fff); border-radius: 15px; }
.subscription-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.subscription-kicker { display: block; color: #60776a; font-size: 9px; font-weight: 850; letter-spacing: .11em; }
.subscription-topline h3 { margin: 4px 0 0; color: #172033; font-size: 16px; font-weight: 800; }
.subscription-status { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.subscription-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-is-active { color: #087443; background: #dcfce7; }
.status-is-pending { color: #965900; background: #fff4d9; }
.status-is-expired { color: #9a3412; background: #ffedd5; }
.status-is-suspended { color: #854d0e; background: #fef3c7; }
.status-is-revoked { color: #b42318; background: #feeceb; }
.status-is-off { color: #64748b; background: #eef2f6; }
.subscription-usage { margin-top: 15px; }
.subscription-usage > strong { display: block; color: #172033; font-size: 14px; }
.subscription-usage > strong span { color: #64748b; font-weight: 600; }
.subscription-usage > span, .subscription-usage > small { display: block; margin-top: 6px; color: #64748b; font-size: 11px; }
.subscription-progress { height: 8px; margin-top: 9px; overflow: hidden; background: #e4eee7; border-radius: 999px; }
.subscription-progress span { display: block; height: 100%; min-width: 0; background: linear-gradient(90deg, var(--portal-accent), var(--portal-brand)); border-radius: inherit; }
.subscription-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #e1eee5; color: #64748b; font-size: 10px; }
.subscription-footer > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.subscription-footer svg { width: 15px; height: 15px; fill: none; stroke: var(--portal-brand); stroke-width: 1.8; stroke-linecap: round; }
.subscription-footer strong { color: #334155; }
.subscription-access-note { color: #087443; font-weight: 750; text-align: right; }
.portal-bottom-nav { display: none; }
.connection-guide {
  display: flex; align-items: flex-start; gap: 13px; padding: 16px 18px;
  background: #fff; border: 1px solid var(--portal-line); border-radius: 17px;
}
.connection-guide-icon { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; color: var(--portal-brand); background: color-mix(in srgb, var(--portal-brand) 10%, #fff); border-radius: 13px; }
.connection-guide-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.connection-guide-copy { min-width: 0; }
.connection-guide-copy .section-kicker { margin: 0 0 3px; font-size: 9px; }
.connection-guide-copy h2 { margin: 0 0 5px; color: var(--portal-navy); font-size: 17px; font-weight: 800; }
.connection-guide-copy > p:not(.section-kicker) { margin: 0; color: #5f6d80; font-size: 12px; line-height: 1.5; }
.connection-guide-copy .connection-guide-note { margin-top: 7px !important; color: #64748b !important; font-size: 11px !important; }
.connection-guide-note strong { color: #334155; }

@media (min-width: 641px) {
  .portal-account { padding: 19px 21px; }
  .portal-subscription-card { max-width: 760px; }
}
@media (max-width: 640px) {
  .portal-main { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  /* The fixed bottom navigation sits outside the main flow, so the footer needs
     its own clearance. This keeps the support/contact/branding block scrollable
     above the bar on every phone height and safe-area inset. */
  .portal-footer { padding-bottom: 96px; padding-bottom: calc(18px + var(--portal-bottom-nav-height) + env(safe-area-inset-bottom)); }
  .portal-intro { min-height: 0; padding: 22px 19px; border-radius: 22px; }
  .portal-hero-art { flex-basis: 122px; width: 122px; height: 130px; margin-right: -4px; }
  .hero-orbit-one { width: 104px; height: 104px; }
  .hero-orbit-two { width: 130px; height: 130px; }
  .hero-art-caption { right: -5px; bottom: -4px; font-size: 8px; }
  .portal-intro-copy-block { min-width: 0; }
  .portal-intro h1 { font-size: clamp(26px, 7vw, 34px); }
  .portal-intro-copy { font-size: 13px; }
  .portal-hero-actions { flex-wrap: wrap; gap: 7px; margin-top: 14px; }
  .hero-primary-action, .hero-secondary-action { min-height: 43px; padding: 9px 11px; font-size: 11px; }
  .portal-bottom-nav {
    position: fixed; z-index: 50; right: 0; bottom: 0; left: 0;
    display: flex; align-items: stretch; justify-content: space-around; gap: 3px;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.97); border-top: 1px solid #e2e8f0;
    box-shadow: 0 -8px 24px rgba(15,23,42,.08); backdrop-filter: blur(16px);
  }
  .portal-bottom-nav a {
    flex: 1; min-width: 0; min-height: 46px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px; padding: 4px 2px;
    border-radius: 11px; color: #64748b; text-decoration: none; font-size: 10px; font-weight: 750;
  }
  .portal-bottom-nav a:hover, .portal-bottom-nav a:focus-visible { color: var(--portal-brand); background: #effaf4; }
  .portal-bottom-nav a.is-active { color: var(--portal-brand); }
  .portal-bottom-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .subscription-footer { align-items: flex-start; flex-direction: column; }
  .subscription-access-note { text-align: left; }
}
@media (max-width: 370px) {
  .portal-intro { padding: 18px 14px; }
  .portal-hero-art { flex-basis: 88px; width: 88px; height: 106px; }
  .portal-intro h1 { font-size: 25px; }
  .portal-intro-copy { font-size: 12px; }
  .hero-art-caption { display: none; }
  .hero-primary-action, .hero-secondary-action { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-bottom-nav *, .hero-primary-action, .hero-secondary-action { transition: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Verified customer account (optional; checkout/voucher flows unchanged). */
.portal-account {
  border: 1px solid rgba(15, 118, 110, .22);
  background: linear-gradient(135deg, rgba(240, 253, 250, .92), rgba(255, 255, 255, .96));
  border-radius: 18px;
  padding: 16px 18px;
}
.portal-account-head { display: block; }
.portal-account h2 { margin: 0 0 4px; font-size: 1.02rem; }
.portal-account p { margin: 0; color: #475569; font-size: .88rem; line-height: 1.5; }
.portal-account a { color: #0f766e; font-weight: 700; }
.portal-account .account-new { margin-top: 4px; font-size: .82rem; color: #64748b; }
.account-entitlements { margin-top: 14px; display: grid; gap: 10px; }
.account-entitlements-title { font-weight: 700; color: #0f172a; font-size: .84rem; }
.account-entitlement {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px;
}
.account-entitlement strong { display: block; font-size: .9rem; }
.account-entitlement small { color: #64748b; font-size: .76rem; }
.account-entitlement .account-reconnect { width: auto; flex: 0 0 auto; padding: 10px 12px; font-size: .8rem; }
.account-empty { margin-top: 10px !important; }
.checkout-account-note { margin: 0 0 10px; color: #0f766e; font-size: .82rem; }
.checkout-account-note a { font-weight: 700; }
@media (max-width: 640px) {
  .account-entitlement { align-items: flex-start; flex-direction: column; }
  .account-entitlement .account-reconnect { width: 100%; }
}

/* ==========================================================================
   Owner-branded portal themes (published configuration)
   ========================================================================== */
body.wifi-portal { position: relative; background: var(--portal-bg, #f5f8f7); }
body.wifi-portal::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--portal-primary) 10%, #fff) 0, var(--portal-bg) 430px, color-mix(in srgb, var(--portal-bg) 92%, #dfe7e4) 100%);
}
body.wifi-portal.has-portal-bg-gradient::before {
  background: linear-gradient(150deg, var(--portal-gradient-from, #062e24) 0%, var(--portal-gradient-to, #087a45) 100%);
  opacity: .14;
}
body.wifi-portal.has-portal-bg-image::before {
  background-image: linear-gradient(rgba(6,20,16,.42), rgba(6,20,16,.42)), var(--portal-bg-image);
  background-size: cover; background-position: center; opacity: 1;
}
.portal-header { background: linear-gradient(120deg, var(--portal-secondary) 0%, var(--portal-primary) 100%); }
.portal-brand-logo { padding: 4px; }
.portal-connection-note {
  display: flex; align-items: flex-start; gap: 8px; margin: 18px 0 0;
  color: var(--portal-muted); font-size: 12.5px; line-height: 1.5;
}
.portal-connection-note span {
  flex: 0 0 8px; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%;
  background: var(--portal-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--portal-accent) 18%, transparent);
}
.portal-intro h1 { font-family: var(--portal-font); }
.portal-intro h1 span { color: var(--portal-primary); }
.pkg-badge-popular { background: var(--portal-secondary); }
.pkg-card { border-radius: var(--portal-radius, 20px); background: var(--portal-card, #fff); }
.pkg-card.pkg-featured { background: linear-gradient(180deg, color-mix(in srgb, var(--portal-primary) 7%, #fff), var(--portal-card, #fff)); }
.pkg-price strong, .pkg-name, .subscription-topline h3 { font-family: var(--portal-font); }
.plan-select, .hero-primary-action, .voucher-submit, .checkout-pay, .voucher-form button {
  border-radius: var(--portal-radius, 20px); background: var(--portal-button);
}
.portal-buttons-outline .plan-select,
.portal-buttons-outline .hero-primary-action,
.portal-buttons-outline .voucher-submit,
.portal-buttons-outline .checkout-pay {
  background: transparent; color: var(--portal-button); border: 1.5px solid var(--portal-button);
}
.portal-buttons-solid .plan-select,
.portal-buttons-solid .hero-primary-action,
.portal-buttons-solid .voucher-submit,
.portal-buttons-solid .checkout-pay { border-radius: 10px; }
.portal-buttons-pill .plan-select,
.portal-buttons-pill .hero-primary-action,
.portal-buttons-pill .voucher-submit,
.portal-buttons-pill .checkout-pay { border-radius: 999px; }

.portal-terms {
  max-width: 860px; margin: 18px auto 0; padding: 14px 18px;
  border: 1px solid var(--portal-line); border-radius: var(--portal-radius, 20px);
  background: var(--portal-card, #fff); color: var(--portal-muted); font-size: 12.5px;
}
.portal-terms summary { cursor: pointer; color: var(--portal-text); font-weight: 700; }
.portal-terms p { margin: 10px 0 0; line-height: 1.6; white-space: pre-line; }

/* Layout: Minimal */
.portal-theme-minimal .portal-header { background: var(--portal-primary); }
.portal-theme-minimal .portal-header::after,
.portal-theme-minimal .portal-hero-art:not(.has-hero-image),
.portal-theme-minimal .hero-orbit { display: none; }
.portal-theme-minimal .portal-intro { min-height: 0; padding: 34px 0 26px; text-align: center; }
.portal-theme-minimal .portal-intro-copy-block { max-width: 700px; margin: 0 auto; }
.portal-theme-minimal .portal-intro h1 { font-size: clamp(27px, 6vw, 39px); }
.portal-theme-minimal .portal-hero-actions { justify-content: center; }
.portal-theme-minimal .portal-connection-note { justify-content: center; }
.portal-theme-minimal .portal-account,
.portal-theme-minimal .connection-guide,
.portal-theme-minimal .portal-benefits,
.portal-theme-minimal .support-panel,
.portal-theme-minimal .voucher-panel { box-shadow: none; border-radius: 12px; }
.portal-theme-minimal .pkg-card { box-shadow: none; border-radius: 12px; }

/* Layout: Classic */
.portal-theme-classic { --portal-font: Georgia, "Times New Roman", serif; }
.portal-theme-classic .portal-header { background: var(--portal-secondary); }
.portal-theme-classic .portal-intro h1 { font-size: clamp(31px, 7vw, 48px); font-weight: 500; }
.portal-theme-classic .portal-intro { border-bottom: 3px double var(--portal-line); }
.portal-theme-classic .portal-hero-art { opacity: .5; }
.portal-theme-classic .portal-account,
.portal-theme-classic .connection-guide,
.portal-theme-classic .portal-benefits,
.portal-theme-classic .support-panel,
.portal-theme-classic .voucher-panel,
.portal-theme-classic .pkg-card { border-radius: 4px; }
.portal-theme-classic .plan-select,
.portal-theme-classic .hero-primary-action,
.portal-theme-classic .voucher-submit,
.portal-theme-classic .checkout-pay { border-radius: 3px; }
.portal-theme-classic .portal-brand-name { font-family: Georgia, serif; }

/* Editor preview: a real render with interactions safely inert. */
html.portal-preview-mode a,
html.portal-preview-mode button,
html.portal-preview-mode input,
html.portal-preview-mode select,
html.portal-preview-mode textarea { pointer-events: none !important; }
html.portal-preview-mode .portal-bottom-nav { display: none; }
html.portal-preview-mode body { min-height: 100%; }

@media (prefers-reduced-motion: reduce) {
  body.wifi-portal *, body.wifi-portal *::before, body.wifi-portal *::after {
    animation-duration: .001ms !important; transition-duration: .001ms !important;
  }
}

/* ==========================================================================
   Branded welcome splash â€” first screen inside the captive-portal window.
   Self-contained, mobile-first and dependency-free so it paints instantly on
   OpenWrt, MikroTik and the online portal.
   ========================================================================== */
body.portal-splash-open { overflow: hidden; }
body.portal-splash-open > .portal-header,
body.portal-splash-open > .portal-main,
body.portal-splash-open > .portal-footer { visibility: hidden; }

.portal-splash {
  position: fixed; inset: 0; z-index: 2147483000; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  color: var(--splash-text, #172033); background: var(--splash-bg, #f5f8f7);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  animation: splashFade .22s ease-out both;
}
.portal-splash *, .portal-splash *::before, .portal-splash *::after { box-sizing: border-box; }
.portal-splash .splash-backdrop { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.portal-splash .splash-backdrop::before,
.portal-splash .splash-backdrop::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(2px);
}
.portal-splash .splash-backdrop::before {
  width: 520px; height: 520px; top: -260px; right: -230px;
  background: radial-gradient(circle, color-mix(in srgb, var(--splash-primary) 42%, transparent) 0%, transparent 68%);
  opacity: .55;
}
.portal-splash .splash-backdrop::after {
  width: 420px; height: 420px; bottom: -230px; left: -190px;
  background: radial-gradient(circle, color-mix(in srgb, var(--splash-secondary) 34%, transparent) 0%, transparent 70%);
  opacity: .45;
}
.portal-splash[data-background="gradient"] {
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--splash-primary) 26%, transparent) 0%, transparent 58%),
    radial-gradient(120% 90% at 0% 100%, color-mix(in srgb, var(--splash-secondary) 30%, transparent) 0%, transparent 55%),
    linear-gradient(160deg, #ffffff 0%, var(--splash-bg) 46%, color-mix(in srgb, var(--splash-bg) 72%, var(--splash-primary)) 100%);
}
.portal-splash[data-background="solid"] { background: var(--splash-bg); }
.portal-splash[data-background="glow"] {
  background:
    radial-gradient(85% 60% at 50% 12%, color-mix(in srgb, var(--splash-primary) 30%, transparent) 0%, transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--splash-bg) 88%, #ffffff) 0%, var(--splash-bg) 100%);
}
.portal-splash[data-appearance="dark"] {
  --splash-text: #F8FAFC;
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--splash-primary) 46%, transparent) 0%, transparent 60%),
    radial-gradient(110% 80% at 0% 100%, color-mix(in srgb, var(--splash-secondary) 58%, transparent) 0%, transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--splash-secondary) 88%, #000000) 0%, color-mix(in srgb, var(--splash-secondary) 62%, var(--splash-primary)) 100%);
}
.portal-splash[data-appearance="dark"] .splash-backdrop::before { opacity: .85; }
.portal-splash[data-appearance="dark"] .splash-backdrop::after { opacity: .7; }
@media (prefers-color-scheme: dark) {
  .portal-splash[data-appearance="auto"] {
    --splash-text: #F8FAFC;
    background:
      radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--splash-primary) 46%, transparent) 0%, transparent 60%),
      radial-gradient(110% 80% at 0% 100%, color-mix(in srgb, var(--splash-secondary) 58%, transparent) 0%, transparent 60%),
      linear-gradient(160deg, color-mix(in srgb, var(--splash-secondary) 88%, #000000) 0%, color-mix(in srgb, var(--splash-secondary) 62%, var(--splash-primary)) 100%);
  }
  .portal-splash[data-appearance="auto"] .splash-eyebrow { color: color-mix(in srgb, var(--splash-primary) 42%, #ffffff); }
  .portal-splash[data-appearance="auto"] .splash-description,
  .portal-splash[data-appearance="auto"] .splash-opens,
  .portal-splash[data-appearance="auto"] .splash-help-toggle,
  .portal-splash[data-appearance="auto"] .splash-text-button { color: rgba(248,250,252,.8); }
  .portal-splash[data-appearance="auto"] .splash-network { color: #ffffff; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.22); }
  .portal-splash[data-appearance="auto"] .splash-thanks { color: rgba(248,250,252,.9); background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); }
  .portal-splash[data-appearance="auto"] .splash-fallback { background: rgba(15,23,42,.92); border-color: rgba(255,255,255,.16); color: #F8FAFC; }
  .portal-splash[data-appearance="auto"] .splash-secondary { background: rgba(255,255,255,.1); color: #ffffff; border-color: rgba(255,255,255,.24); }
  .portal-splash[data-appearance="auto"] .splash-cta-secondary { color: #ffffff; border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.08); }
  .portal-splash[data-appearance="auto"] .splash-footer { color: rgba(248,250,252,.6); border-color: rgba(255,255,255,.14); }
}

.portal-splash .splash-shell {
  position: relative; width: min(100%, 520px); min-height: 100%; margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 20px calc(18px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px;
}
.portal-splash .splash-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.portal-splash .splash-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.portal-splash .splash-logo {
  height: 42px; width: auto; max-width: 160px; object-fit: contain;
  border-radius: 12px; background: rgba(255,255,255,.94); padding: 5px;
  box-shadow: 0 6px 18px rgba(15,23,42,.12);
}
.portal-splash .splash-brand-name {
  font-size: clamp(17px, 4.2vw, 21px); font-weight: 800; line-height: 1.15;
  letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.portal-splash .splash-network {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  color: var(--splash-primary); background: color-mix(in srgb, var(--splash-primary) 12%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--splash-primary) 22%, transparent);
  white-space: nowrap;
}
.portal-splash .splash-network svg { width: 15px; height: 15px; }
.portal-splash[data-appearance="dark"] .splash-network {
  color: #ffffff; background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.22);
}

.portal-splash .splash-main {
  flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center;
  gap: 22px; padding: 8px 0 12px;
}
.portal-splash .splash-hero { text-align: center; animation: splashRise .42s cubic-bezier(.2,.7,.3,1) both; }
.portal-splash .splash-wifi-badge {
  position: relative; width: 82px; height: 82px; margin: 0 auto 16px;
  display: grid; place-items: center; border-radius: 26px;
  color: #ffffff; background: linear-gradient(145deg, var(--splash-primary), color-mix(in srgb, var(--splash-primary) 52%, var(--splash-secondary)));
  box-shadow: 0 18px 38px color-mix(in srgb, var(--splash-primary) 34%, transparent);
}
.portal-splash .splash-wifi-badge::after {
  content: ""; position: absolute; inset: -9px; border-radius: 32px;
  border: 1px solid color-mix(in srgb, var(--splash-primary) 34%, transparent);
  animation: splashPulse 3.2s ease-in-out infinite;
}
.portal-splash .splash-wifi-badge svg { width: 46px; height: 46px; }
.portal-splash .splash-eyebrow {
  margin: 0 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--splash-primary);
}
.portal-splash[data-appearance="dark"] .splash-eyebrow { color: color-mix(in srgb, var(--splash-primary) 42%, #ffffff); }
.portal-splash .splash-title {
  margin: 0 auto 10px; max-width: 15ch; font-size: clamp(28px, 8vw, 38px);
  line-height: 1.08; letter-spacing: -.03em; font-weight: 850; text-wrap: balance;
}
.portal-splash .splash-description {
  margin: 0 auto; max-width: 42ch; font-size: clamp(14px, 3.8vw, 15.5px);
  line-height: 1.62; color: color-mix(in srgb, var(--splash-text) 76%, transparent);
}
.portal-splash[data-appearance="dark"] .splash-description { color: rgba(248,250,252,.82); }
.portal-splash .splash-thanks {
  display: flex; align-items: flex-start; gap: 10px; margin: 16px auto 0; max-width: 40ch;
  padding: 12px 14px; text-align: left; font-size: 13px; line-height: 1.55;
  border-radius: 16px; color: color-mix(in srgb, var(--splash-text) 84%, transparent);
  background: color-mix(in srgb, var(--splash-primary) 8%, rgba(255,255,255,.72));
  border: 1px solid color-mix(in srgb, var(--splash-primary) 20%, transparent);
}
.portal-splash[data-appearance="dark"] .splash-thanks {
  color: rgba(248,250,252,.9); background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.18);
}
.portal-splash .splash-thanks span[aria-hidden] { flex: 0 0 auto; color: var(--splash-primary); }
.portal-splash[data-appearance="dark"] .splash-thanks span[aria-hidden] { color: #FCA5A5; }
.portal-splash .splash-thanks svg { width: 17px; height: 17px; margin-top: 1px; }

.portal-splash .splash-action { animation: splashRise .5s .06s cubic-bezier(.2,.7,.3,1) both; }
.portal-splash .splash-cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 58px; padding: 16px 20px; border-radius: 18px;
  color: #ffffff; text-decoration: none; font-size: 17px; font-weight: 800;
  letter-spacing: -.01em; background: var(--splash-button);
  box-shadow: 0 16px 32px color-mix(in srgb, var(--splash-button) 38%, transparent);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.portal-splash .splash-cta:active { transform: scale(.985); box-shadow: 0 8px 20px color-mix(in srgb, var(--splash-button) 30%, transparent); }
.portal-splash .splash-cta.is-launching {
  cursor: progress; opacity: .88; pointer-events: none;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--splash-button) 28%, transparent);
}
.portal-splash .splash-cta-secondary {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 52px; margin-top: 10px; padding: 13px 18px;
  border-radius: 16px; border: 1.5px solid color-mix(in srgb, var(--splash-primary) 46%, transparent);
  background: color-mix(in srgb, var(--splash-primary) 7%, #ffffff);
  color: var(--splash-primary); font-size: 15.5px; font-weight: 800;
  letter-spacing: -.01em; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.portal-splash .splash-cta-secondary:active { transform: scale(.987); background: color-mix(in srgb, var(--splash-primary) 13%, #ffffff); }
.portal-splash .splash-cta-secondary:focus-visible { outline: 3px solid color-mix(in srgb, var(--splash-primary) 42%, #ffffff); outline-offset: 3px; }
.portal-splash[data-appearance="dark"] .splash-cta-secondary {
  color: #ffffff; border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.08);
}
.portal-splash[data-appearance="dark"] .splash-cta-secondary:active { background: rgba(255,255,255,.14); }
.portal-splash .splash-cta:focus-visible { outline: 3px solid color-mix(in srgb, var(--splash-button) 45%, #ffffff); outline-offset: 3px; }
.portal-splash .splash-cta svg { width: 21px; height: 21px; flex: 0 0 auto; }
.portal-splash .splash-opens {
  display: flex; align-items: flex-start; justify-content: center; gap: 7px;
  margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; text-align: center;
  color: color-mix(in srgb, var(--splash-text) 66%, transparent);
}
.portal-splash[data-appearance="dark"] .splash-opens { color: rgba(248,250,252,.72); }
.portal-splash .splash-opens svg { width: 15px; height: 15px; margin-top: 2px; flex: 0 0 auto; }
.portal-splash .splash-help-toggle,
.portal-splash .splash-text-button {
  display: block; margin: 22px auto 0; padding: 8px 10px; border: 0; background: transparent;
  color: color-mix(in srgb, var(--splash-text) 62%, transparent); font-size: 12.5px;
  font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
}
.portal-splash[data-appearance="dark"] .splash-help-toggle,
.portal-splash[data-appearance="dark"] .splash-text-button { color: rgba(248,250,252,.72); }
.portal-splash .splash-help-toggle:focus-visible,
.portal-splash .splash-text-button:focus-visible { outline: 2px solid var(--splash-primary); outline-offset: 2px; }

.portal-splash .splash-fallback {
  margin-top: 14px; padding: 16px; border-radius: 18px; text-align: left;
  background: rgba(255,255,255,.96); border: 1px solid rgba(15,23,42,.1);
  box-shadow: 0 16px 40px rgba(15,23,42,.14); color: #172033;
}
.portal-splash[data-appearance="dark"] .splash-fallback { background: rgba(15,23,42,.92); border-color: rgba(255,255,255,.16); color: #F8FAFC; }
.portal-splash .splash-fallback-title { margin: 0 0 12px; font-size: 13px; line-height: 1.5; font-weight: 700; }
.portal-splash .splash-fallback-hint { margin: -4px 0 12px; font-size: 12.5px; line-height: 1.55; color: #475569; }
.portal-splash[data-appearance="dark"] .splash-fallback-hint { color: rgba(248,250,252,.78); }
.portal-splash .splash-secondary {
  display: block; width: 100%; min-height: 46px; margin: 0 0 10px; padding: 11px 14px;
  border-radius: 12px; border: 1px solid color-mix(in srgb, var(--splash-primary) 34%, transparent);
  background: color-mix(in srgb, var(--splash-primary) 10%, #ffffff); color: var(--splash-primary);
  font-size: 14px; font-weight: 800;
}
.portal-splash[data-appearance="dark"] .splash-secondary { background: rgba(255,255,255,.1); color: #ffffff; border-color: rgba(255,255,255,.24); }
.portal-splash .splash-link-row {
  display: flex; flex-direction: column; gap: 5px; margin: 0 0 10px;
  padding: 10px 12px; border-radius: 12px; background: rgba(15,23,42,.05);
}
.portal-splash[data-appearance="dark"] .splash-link-row { background: rgba(255,255,255,.08); }
.portal-splash .splash-link-label { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .62; }
.portal-splash .splash-url {
  display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; line-height: 1.45; word-break: break-all;
  -webkit-user-select: all; user-select: all;
}
.portal-splash .splash-status { min-height: 18px; margin: 10px 0 0; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--splash-primary); }
.portal-splash[data-appearance="dark"] .splash-status { color: #A7F3D0; }

.portal-splash .splash-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 6px 12px; padding-top: 12px; font-size: 11px;
  color: color-mix(in srgb, var(--splash-text) 54%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--splash-text) 12%, transparent);
}
.portal-splash[data-appearance="dark"] .splash-footer { color: rgba(248,250,252,.6); border-color: rgba(255,255,255,.14); }
.portal-splash .splash-footer-owner { font-weight: 700; }

@keyframes splashFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes splashRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes splashPulse {
  0%, 100% { transform: scale(1); opacity: .75; }
  50% { transform: scale(1.06); opacity: .25; }
}

@media (max-width: 360px) {
  .portal-splash .splash-shell { padding-left: 16px; padding-right: 16px; }
  .portal-splash .splash-wifi-badge { width: 72px; height: 72px; border-radius: 22px; }
  .portal-splash .splash-wifi-badge svg { width: 40px; height: 40px; }
  .portal-splash .splash-title { font-size: 27px; }
  .portal-splash .splash-cta { font-size: 15.5px; min-height: 54px; }
}
@media (min-width: 640px) {
  .portal-splash .splash-shell { padding-left: 26px; padding-right: 26px; }
  .portal-splash .splash-title { font-size: 40px; }
}
@media (max-height: 640px) {
  .portal-splash .splash-main { gap: 14px; }
  .portal-splash .splash-wifi-badge { width: 64px; height: 64px; margin-bottom: 10px; border-radius: 20px; }
  .portal-splash .splash-wifi-badge svg { width: 36px; height: 36px; }
  .portal-splash .splash-title { font-size: 26px; }
  .portal-splash .splash-thanks { display: none; }
}


/* ==========================================================================
   Universal payment modal
   One shared experience for the online portal and both router-hosted portals.
   Mobile-first, safe-area aware, scroll-contained so Android's captive WebView
   keeps the page behind the dialog fixed while the sheet scrolls.
   ========================================================================== */
body.payment-modal-open { overflow: hidden; }
body.payment-modal-open .portal-bottom-nav { visibility: hidden; }

.checkout-payment-cta { display: block; }
.payment-status-panel {
  margin: 14px 0 0; padding: 13px 14px; background: #fff9ec;
  border: 1px solid #f2dfb7; border-radius: 13px;
}
.payment-status-panel p { margin: 0; color: #7a4c00; font-size: 12.5px; line-height: 1.5; }
.payment-status-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.payment-status-actions .text-button { margin: 8px 0 0; padding: 6px 0; }

.payment-modal {
  position: fixed; inset: 0; z-index: 1000; display: flex;
  align-items: flex-end; justify-content: center;
  animation: paymentModalFade .16s ease-out both;
}
.payment-modal[hidden] { display: none !important; }
.payment-modal-backdrop {
  position: absolute; inset: 0; background: rgba(4, 12, 24, .58);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.payment-modal-sheet {
  position: relative; width: min(100%, 580px);
  max-height: calc(100vh - 18px); max-height: calc(100dvh - 18px);
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; padding: 16px 18px calc(20px + env(safe-area-inset-bottom));
  background: #fff; color: var(--portal-text);
  border-radius: 22px 22px 0 0; box-shadow: 0 -18px 60px rgba(4, 12, 24, .32);
  animation: paymentModalRise .22s cubic-bezier(.2, .7, .3, 1) both;
  outline: none;
}
.payment-modal-head {
  position: sticky; top: -16px; z-index: 2; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; margin: -16px -18px 6px;
  padding: 14px 18px 10px; background: #fff;
}
.payment-modal-brand { min-width: 0; display: flex; align-items: center; gap: 9px; }
.payment-modal-brand[hidden] { display: none !important; }
.payment-modal-paystack { min-width: 0; display: flex; align-items: center; gap: 10px; }
.payment-modal-paystack[hidden] { display: none !important; }
.paystack-mark { flex: 0 0 auto; display: inline-grid; gap: 3px; }
.paystack-mark i { display: block; width: 21px; height: 4px; border-radius: 2px; background: #09a5db; }
.paystack-wordmark {
  color: #0b2b45; font-size: 25px; font-weight: 850; letter-spacing: -.045em;
  line-height: 1; font-family: var(--portal-font, system-ui, sans-serif);
}
.payment-modal-trust {
  display: flex; align-items: center; gap: 7px; margin: 2px 0 12px;
  color: #087a43; font-size: 12.5px; font-weight: 650; line-height: 1.35;
}
.payment-modal-trust svg {
  flex: 0 0 17px; width: 17px; height: 17px; fill: none; stroke: #087a43;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.payment-modal-logo {
  height: 32px; width: auto; max-width: 128px; object-fit: contain;
  border-radius: 9px; background: #fff; padding: 3px; border: 1px solid var(--portal-line);
}
.payment-modal-brand-name {
  overflow: hidden; color: var(--portal-navy); font-size: 13px; font-weight: 800;
  text-overflow: ellipsis; white-space: nowrap;
}
.payment-modal-close {
  flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center;
  color: #475569; background: #f1f5f9; border: 0; border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.payment-modal-close:active { background: #e2e8f0; }
.payment-modal-close:focus-visible { outline: 3px solid rgba(5, 150, 105, .32); outline-offset: 2px; }
.payment-modal-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.payment-modal-title {
  margin: 4px 0 0; color: var(--portal-navy); font-size: clamp(21px, 4.6vw, 26px);
  font-weight: 850; letter-spacing: -.03em; line-height: 1.15;
}
.payment-modal-summary {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  margin: 14px 0 18px; padding: 13px 14px; background: #eef2ff;
  border: 1px solid #dfe5ff; border-radius: 14px;
}
.payment-modal-summary-icon {
  flex: 0 0 46px; width: 46px; height: 46px; display: grid; place-items: center;
  color: #5b4bdb; background: #e3e7ff; border-radius: 13px;
}
.payment-modal-summary-icon svg {
  width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.payment-modal-summary-copy { min-width: 0; }
.payment-modal-summary-name {
  margin: 0; color: var(--portal-navy); font-size: 15px; font-weight: 800; line-height: 1.3;
  overflow-wrap: anywhere;
}
.payment-modal-summary-meta { margin: 3px 0 0; color: #4f6176; font-size: 11.5px; line-height: 1.4; }
.payment-modal-summary-price {
  flex: 0 0 auto; text-align: right; color: var(--portal-brand);
  font-size: 19px; font-weight: 850; letter-spacing: -.03em; white-space: nowrap;
}
.payment-modal-summary-price span { display: block; font-size: 10px; font-weight: 800; letter-spacing: .08em; color: #64748b; }
.payment-modal-section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 10px;
}
.payment-modal-section-head h3 { margin: 0; color: var(--portal-navy); font-size: 15px; font-weight: 800; }
.payment-modal-section-head span { color: #8491a1; font-size: 11px; }
.payment-provider-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; margin: 0 0 14px; }
.payment-provider {
  width: 100%; min-height: 68px; display: flex; align-items: center; gap: 12px;
  padding: 12px 13px; text-align: left; color: var(--portal-navy);
  background: #fff; border: 1.5px solid #dbe4ee; border-radius: 15px;
  font-size: 13px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.payment-provider:active { background: #f8fafc; }
.payment-provider:focus-visible { outline: 3px solid rgba(5, 150, 105, .3); outline-offset: 2px; }
.payment-provider.is-selected {
  border-color: var(--portal-brand);
  background: color-mix(in srgb, var(--portal-brand) 7%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--portal-brand) 16%, transparent);
}
.payment-provider-icon {
  flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px;
}
.payment-provider-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.payment-provider-icon.provider-paystack { color: #0b4a8f; background: #eaf3ff; }
.payment-provider-icon.provider-nunuapay { color: #6b3ff2; background: #f1ecff; }
.payment-provider-icon.provider-mpesa { color: #087a43; background: #e8f8ee; }
.payment-provider-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.payment-provider-copy strong { font-size: 14.5px; font-weight: 800; line-height: 1.25; }
.payment-provider-copy span { color: #5a6b80; font-size: 11.5px; line-height: 1.4; }
.payment-provider-channels { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px; }
.payment-provider-channels em {
  padding: 2px 6px; color: #3d5169; background: #f1f5f9; border-radius: 999px;
  font-size: 9.5px; font-style: normal; font-weight: 700; white-space: nowrap;
}
.payment-provider-radio {
  flex: 0 0 21px; width: 21px; height: 21px; border: 2px solid #cbd5e1; border-radius: 50%;
  background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
.payment-provider.is-selected .payment-provider-radio {
  border-color: var(--portal-brand); background: var(--portal-brand);
  box-shadow: inset 0 0 0 4px #fff;
}
.payment-submethods { margin: 0 0 13px; padding: 0; border: 0; }
.payment-submethods legend { width: 100%; margin: 0 0 8px; color: #334155; font-size: 12px; font-weight: 750; }
.payment-submethod-list { display: flex; flex-wrap: wrap; gap: 7px; }
.payment-submethod {
  min-height: 44px; display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 12px; color: var(--portal-navy); background: #fff;
  border: 1px solid #dbe4ee; border-radius: 11px; font-size: 12.5px; font-weight: 700;
}
.payment-submethod.is-selected { background: #effaf5; border-color: var(--portal-brand); }
.payment-submethod input { width: 16px; height: 16px; accent-color: var(--portal-brand); }
.payment-modal-view .form-field { margin: 8px 0 10px; }
.payment-modal-view #pay-btn { margin-top: 6px; }
.payment-modal-back {
  display: inline-flex; align-items: center; gap: 7px; min-height: 42px;
  margin: 0 0 10px; padding: 8px 4px; color: var(--portal-brand);
  background: transparent; border: 0; font-size: 13px; font-weight: 800;
}
.payment-modal-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.payment-modal-back[hidden] { display: none !important; }
.payment-provider-heading { display: flex; align-items: center; gap: 11px; margin: 0 0 14px; }
.payment-provider-heading .payment-provider-icon { flex-basis: 46px; width: 46px; height: 46px; }
.payment-provider-heading strong { display: block; color: var(--portal-navy); font-size: 16px; font-weight: 850; }
.payment-provider-heading span { display: block; margin-top: 2px; color: #5a6b80; font-size: 11.5px; }
.payment-provider-status {
  margin: 0 0 12px; padding: 18px 16px; text-align: center;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px;
}
.payment-provider-status.is-pending { background: #fff8e8; border-color: #f2dfb7; }
.payment-provider-status.is-success { background: #eefbf4; border-color: #c6efd9; }
.payment-provider-status.is-error { background: #fff3f1; border-color: #f5d2cd; }
.payment-provider-status h4 { margin: 10px 0 4px; color: var(--portal-navy); font-size: 16px; font-weight: 850; }
.payment-provider-status p { margin: 0 auto; max-width: 38ch; color: #4f6176; font-size: 12.5px; line-height: 1.55; }
.payment-provider-status .payment-reference {
  display: inline-block; margin-top: 9px; padding: 5px 9px; color: #334155;
  background: rgba(255,255,255,.8); border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px; word-break: break-all;
}
.payment-spinner {
  width: 38px; height: 38px; margin: 0 auto; border-radius: 50%;
  border: 3.5px solid color-mix(in srgb, var(--portal-brand) 22%, #fff);
  border-top-color: var(--portal-brand); animation: paymentSpin .9s linear infinite;
}
.payment-status-icon { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto; border-radius: 50%; }
.payment-status-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.payment-status-icon.is-success { color: #087a43; background: #d9f6e7; }
.payment-status-icon.is-error { color: #b42318; background: #fde4e0; }
.payment-status-icon.is-pending { color: #8a5300; background: #fceecb; }
.payment-provider-actions { display: grid; gap: 8px; margin-top: 12px; }
.payment-provider-actions .plan-select { margin-top: 0; }
.payment-provider-actions .text-button { margin: 2px auto 0; }
.payment-modal-view .checkout-secure { margin-top: 12px; }

@keyframes paymentModalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes paymentModalRise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }
@keyframes paymentSpin { to { transform: rotate(360deg); } }

@media (min-width: 640px) {
  .payment-modal { align-items: center; padding: 24px; }
  .payment-modal-sheet {
    border-radius: 24px; max-height: min(86vh, 780px);
    padding: 20px 22px 24px;
  }
  .payment-modal-head { top: -20px; margin: -20px -22px 6px; padding: 17px 22px 11px; }
}
@media (max-height: 620px) and (max-width: 639px) {
  .payment-modal-sheet { max-height: 100vh; max-height: 100dvh; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .payment-modal, .payment-modal-sheet { animation: none; }
  .payment-spinner { animation-duration: 2s; }
}

/* ---------------------------------------------------------------------------
   Verified connection state + mobile-first polish (2026-11-16)
   Kept in plain CSS so the router-hosted bundle stays small.
   --------------------------------------------------------------------------- */
#portal-home,
#packages-section,
#portal-account,
#connection-guide-title,
#checkout-section {
  scroll-margin-top: 84px;
}

/* The old hero note was a single unconditional line. The verified state card
   below is driven by the Connection Status API, so it can never claim a
   connection that the gateway has not confirmed. */
.portal-connection-note { display: none; }
.connection-state {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 16px;
  padding: 11px 13px;
  color: #1f2a3a;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 14px;
  text-align: left;
}
.connection-state-dot {
  flex: 0 0 11px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, .18);
}
.connection-state-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.connection-state-copy strong { font-size: 13px; font-weight: 800; line-height: 1.25; }
.connection-state-copy span { color: #5f6d80; font-size: 11.5px; line-height: 1.35; }
.connection-state.is-connected { background: #ecfdf3; border-color: #bfe9d1; }
.connection-state.is-connected .connection-state-dot { background: #0a9d5c; box-shadow: 0 0 0 4px rgba(10, 157, 92, .16); }
.connection-state.is-connected strong { color: #06663c; }
.connection-state.is-connecting { background: #fff8e8; border-color: #f2ddae; }
.connection-state.is-connecting .connection-state-dot {
  background: #e3a008;
  box-shadow: 0 0 0 4px rgba(227, 160, 8, .16);
  animation: connectionPulse 1.6s ease-in-out infinite;
}
.connection-state.is-connecting strong { color: #8a5300; }
.connection-state.is-action-required { background: #eef8ff; border-color: #c2e3f5; }
.connection-state.is-action-required .connection-state-dot { background: #1479e8; box-shadow: 0 0 0 4px rgba(20, 121, 232, .14); }
.connection-state.is-action-required strong { color: #0b4f93; }
.connection-state.is-disconnected { background: #f7f8fa; border-color: #e2e8f0; }
.connection-state.is-disconnected .connection-state-dot { background: #64748b; box-shadow: 0 0 0 4px rgba(100, 116, 139, .14); }
.connection-state.is-error { background: #fff1ef; border-color: #f3c9c4; }
.connection-state.is-error .connection-state-dot { background: #d92d20; box-shadow: 0 0 0 4px rgba(217, 45, 32, .14); }
.connection-state.is-error strong { color: #9f1f16; }
.connection-state.is-checking .connection-state-dot { background: #64748b; }

@keyframes connectionPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
@media (prefers-reduced-motion: reduce) {
  .connection-state.is-connecting .connection-state-dot { animation: none; }
}

.portal-status.error { color: #9f1f16; background: #fff1ef; border-color: #f3c9c4; }
.portal-status .status-indicator {
  flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; background: currentColor;
}

/* Header: stronger business identity, calmer network chip. */
.portal-header { padding: calc(14px + env(safe-area-inset-top)) 18px 16px; }
.portal-header-inner { min-height: 58px; gap: 14px; }
.portal-brand-name { letter-spacing: -.015em; }
.portal-brand-logo { height: 48px; max-width: min(196px, 34vw); }
.portal-tagline { color: rgba(255, 255, 255, .86); }
.network-chip { padding: 8px 11px; border-radius: 14px; }
.network-chip-copy > span { letter-spacing: .04em; text-transform: uppercase; }

/* Hero: less empty vertical space, clearer hierarchy, prominent primary CTA. */
.portal-intro {
  min-height: 0;
  padding: 24px 30px;
  gap: 16px;
  border-radius: 24px;
}
.portal-intro-copy-block { flex: 1 1 auto; }
.portal-intro h1 { letter-spacing: -.04em; line-height: 1.08; }
.portal-intro-copy { max-width: 46ch; }
.portal-hero-actions { margin-top: 16px; }
.hero-primary-action {
  min-height: 50px;
  padding: 12px 20px;
  font-size: 14px;
  border-radius: 13px;
}
.hero-secondary-action { min-height: 50px; padding: 12px 16px; font-size: 13px; }
.portal-hero-art { flex-basis: 210px; width: 210px; height: 168px; }
.hero-art-caption { font-size: 9.5px; padding: 6px 9px; }

/* Bottom navigation: larger touch targets and an unmistakable active item. */
.portal-bottom-nav a { position: relative; min-height: 50px; }
.portal-bottom-nav a.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 24px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--portal-brand);
}
.portal-bottom-nav a.is-active span { font-weight: 800; }

@media (max-width: 640px) {
  .portal-main { padding: 16px 14px 22px; }
  .portal-intro { padding: 20px 16px; border-radius: 20px; }
  .portal-intro h1 { font-size: clamp(26px, 7.2vw, 34px); }
  .portal-intro-copy { font-size: 13px; margin-top: 8px; }
  .portal-hero-actions { gap: 9px; margin-top: 14px; }
  .hero-primary-action { flex: 1 1 100%; min-height: 50px; font-size: 14px; }
  .hero-secondary-action { flex: 0 1 auto; min-height: 44px; font-size: 12px; }
  .portal-hero-art { flex-basis: 104px; width: 104px; height: 116px; margin-right: -2px; }
  .hero-orbit-one { width: 92px; height: 92px; }
  .hero-orbit-two { width: 114px; height: 114px; }
  .hero-art-caption { display: none; }
  .connection-state { margin-top: 13px; padding: 10px 12px; }
  .portal-header { padding-left: 14px; padding-right: 14px; }
  .portal-brand-logo { height: 44px; max-width: min(150px, 36vw); }
}

@media (max-width: 380px) {
  .portal-intro { padding: 18px 14px; }
  .portal-hero-art { display: none; }
  .portal-hero-actions { gap: 7px; }
  .portal-brand-logo { max-width: min(120px, 32vw); }
}
.summary-meta { margin-top: 4px; color: var(--portal-muted); font-size: 11.5px; line-height: 1.4; }

/* ==========================================================================
   Start Over Payment (provider-reconciled restart)
   ========================================================================== */
.hero-tertiary-action {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  color: var(--portal-brand);
  background: transparent;
  border: 1.5px solid color-mix(in srgb, var(--portal-brand) 55%, #fff);
  border-radius: 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hero-tertiary-action:hover { background: color-mix(in srgb, var(--portal-brand) 7%, #fff); }
.hero-tertiary-action:active { background: color-mix(in srgb, var(--portal-brand) 12%, #fff); }
.hero-tertiary-action:focus-visible { outline: 3px solid color-mix(in srgb, var(--portal-brand) 28%, transparent); outline-offset: 2px; }
.hero-tertiary-action > svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.start-over-provider {
  padding: 2px 7px;
  border: 1px solid #bfe8fa;
  border-radius: 999px;
  background: #e8f7ff;
  color: #0877a8;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .01em;
  white-space: nowrap;
}
.start-over-provider.provider-paystack { background: #e9f8fd; border-color: #a9e2f5; color: #0784ad; }
.start-over-provider.provider-mpesa { background: #e9f8ef; border-color: #b6e7c8; color: #087a43; }
.start-over-provider.provider-nunuapay { background: #f1edff; border-color: #d8ceff; color: #5b3cc4; }

body.payment-restart-open { overflow: hidden; }
body.payment-restart-open .portal-bottom-nav { visibility: hidden; }

.restart-dialog {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: paymentModalFade .16s ease-out both;
}
.restart-dialog[hidden] { display: none !important; }
.restart-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 12, 24, .58);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.restart-dialog-sheet {
  position: relative;
  width: min(100%, 430px);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  padding: 24px 22px calc(20px + env(safe-area-inset-bottom));
  background: #fff;
  color: var(--portal-text);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(4, 12, 24, .3);
  text-align: center;
  outline: none;
  animation: paymentModalRise .2s cubic-bezier(.2, .7, .3, 1) both;
}
.restart-dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #475569;
  background: #f1f5f9;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.restart-dialog-close:active { background: #e2e8f0; }
.restart-dialog-close:focus-visible { outline: 3px solid rgba(5, 150, 105, .32); outline-offset: 2px; }
.restart-dialog-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.restart-dialog-icon {
  width: 54px;
  height: 54px;
  margin: 4px auto 12px;
  display: grid;
  place-items: center;
  color: var(--portal-brand);
  background: color-mix(in srgb, var(--portal-brand) 10%, #fff);
  border-radius: 50%;
}
.restart-dialog-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.restart-dialog-title {
  margin: 0;
  color: var(--portal-navy);
  font-size: clamp(21px, 5vw, 25px);
  font-weight: 850;
  letter-spacing: -.03em;
  line-height: 1.15;
}
.restart-dialog-copy { margin: 10px auto 0; max-width: 34ch; color: var(--portal-muted); font-size: 13.5px; line-height: 1.55; }
.restart-dialog-status {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #f2dfb7;
  border-radius: 12px;
  background: #fff9ec;
  color: #7a4c00;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.45;
}
.restart-dialog-status.is-error { border-color: #f3c9c9; background: #fff5f5; color: #9d1c1c; }
.restart-dialog-status.is-success { border-color: #bfe7cf; background: #f1fbf5; color: #087a43; }
.restart-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.restart-dialog-primary,
.restart-dialog-secondary {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 13px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.restart-dialog-primary {
  color: #fff;
  background: linear-gradient(110deg, var(--portal-brand), color-mix(in srgb, var(--portal-brand) 72%, #fff));
  border: 1px solid transparent;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--portal-brand) 22%, transparent);
}
.restart-dialog-primary:disabled { opacity: .62; cursor: default; box-shadow: none; }
.restart-dialog-secondary { color: var(--portal-brand); background: #fff; border: 1px solid #c9e5d3; }
.restart-dialog-secondary:active { background: #f4fbf7; }
.restart-dialog-primary:focus-visible,
.restart-dialog-secondary:focus-visible { outline: 3px solid color-mix(in srgb, var(--portal-brand) 28%, transparent); outline-offset: 2px; }
.restart-dialog-note { margin: 14px 0 0; color: var(--portal-muted); font-size: 11px; line-height: 1.45; }

@media (max-width: 640px) {
  .hero-tertiary-action { flex: 1 1 100%; min-height: 46px; font-size: 12.5px; }
  .restart-dialog { align-items: flex-end; padding: 0; }
  .restart-dialog-sheet {
    width: 100%;
    max-height: calc(100dvh - 18px);
    border-radius: 24px 24px 0 0;
    padding: 22px 20px calc(18px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .restart-dialog, .restart-dialog-sheet { animation: none !important; }
}
.portal-status.success { color: #087a43; background: #effaf4; border-color: #bfe7cf; }

/* ==========================================================================
   Payment recovery notice (Start Over on the LEFT, message on the RIGHT)
   ========================================================================== */
.payment-recovery-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #0e4f5c;
  background: #ecfaff;
  border: 1px solid #c8eaf4;
  border-radius: 16px;
  scroll-margin-top: 8px;
}
.payment-recovery-notice[data-state="processing"],
.payment-recovery-notice[data-state="unknown"],
.payment-recovery-notice[data-state="timeout"],
.payment-recovery-notice[data-state="failed"] {
  color: #7a4b00;
  background: #fff8ea;
  border-color: #f2dfb4;
}
.recovery-notice-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.35;
}
.recovery-notice-copy strong {
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.recovery-notice-copy > span {
  color: #4b6570;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.payment-recovery-notice[data-state="processing"] .recovery-notice-copy > span,
.payment-recovery-notice[data-state="unknown"] .recovery-notice-copy > span,
.payment-recovery-notice[data-state="timeout"] .recovery-notice-copy > span,
.payment-recovery-notice[data-state="failed"] .recovery-notice-copy > span { color: #6b5630; }
.recovery-start-over {
  flex: 0 0 auto;
  min-width: 104px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  color: #fff;
  background: var(--portal-brand, #087a45);
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
  -webkit-tap-highlight-color: transparent;
}
.recovery-start-over:disabled { opacity: .75; cursor: wait; }
.recovery-start-over:focus-visible { outline: 3px solid color-mix(in srgb, var(--portal-brand) 30%, transparent); outline-offset: 2px; }
.recovery-start-over svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.recovery-check-status {
  align-self: flex-start;
  margin-top: 4px;
  padding: 0;
  color: var(--portal-brand, #087a45);
  background: none;
  border: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
}
@media (max-width: 370px) {
  .payment-recovery-notice { gap: 9px; padding: 10px 11px; }
  .recovery-start-over { min-width: 92px; padding: 8px 10px; font-size: 11.5px; }
  .recovery-notice-copy strong { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .payment-recovery-notice, .recovery-start-over { transition: none !important; }
}
