    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --bg:           #f5f5f7;
      --card:         #ffffff;
      --border:       #f3f4f6;
      --border-mid:   #e5e7eb;
      --text:         #111827;
      --text-muted:   #6b7280;
      --text-hint:    #9ca3af;
      --green:        #00d54b;
      --green-hover:  #00c044;
      --green-text:   #00b341;
      --green-50:     #f0fdf4;
      --green-100:    #dcfce7;
      --green-200:    #bbf7d0;
      --green-300:    #86efac;
      --red:          #dc2626;
      --font-mono:    ui-monospace, 'Courier New', Courier, monospace;
    }

    body {
      font-family: 'Nunito', system-ui, -apple-system, sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      display: flex;
      align-items: flex-start;
      justify-content: center;
      padding: 32px 16px;
    }
    @media (min-width: 640px) { body { padding: 48px 16px; } }

    /* ===== Card ===== */
    .card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 24px;
      box-shadow: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.05);
      width: 100%;
      max-width: 448px;
      overflow: hidden;
      animation: card-in 200ms ease-out;
    }
    @keyframes card-in {
      from { opacity: 0; transform: translateY(8px); }
      to   { opacity: 1; transform: none; }
    }

    /* ===== Card head: Pay username + Secure badge ===== */
    .card-head {
      padding: 32px 24px 16px;
      text-align: center;
    }
    .pay-title {
      font-size: 24px;
      font-weight: 800;
      letter-spacing: -0.02em;
      color: var(--text);
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 1.2;
    }
    .pay-title .username { color: var(--green); word-break: break-all; }
    .badge-verified { margin-left: 6px; flex-shrink: 0; display: inline-flex; }
    .secure-badge-wrap { display: flex; justify-content: center; margin-top: 12px; }
    .secure-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      height: 26px;
      padding: 0 14px;
      border-radius: 999px;
      background: var(--green-50);
      color: var(--green-text);
      font-size: 12px;
      font-weight: 700;
    }
    .secure-badge svg { flex-shrink: 0; }

    /* ===== Brand panel ===== */
    .brand-panel {
      margin: 0 24px 20px;
      padding: 20px;
      border: 1px solid var(--border-mid);
      border-radius: 16px;
      text-align: center;
    }
    .brand-logo {
      width: 64px;
      height: 64px;
      margin: 0 auto 8px;
      border-radius: 16px;
      display: block;
    }
    .brand-name { font-size: 18px; font-weight: 800; color: var(--text); }
    .brand-tagline { font-size: 14px; color: var(--text-muted); margin-top: 2px; }

    /* ===== Amount panel (green) ===== */
    .amount-panel {
      margin: 0 24px 24px;
      padding: 20px;
      background: rgba(220, 252, 231, .7);
      border: 1px solid var(--green-200);
      border-radius: 16px;
    }
    .amount-panel-label {
      display: flex;
      align-items: center;
      gap: 8px;
      color: var(--green-text);
      font-size: 12px;
      font-weight: 800;
      letter-spacing: .1em;
      text-transform: uppercase;
      margin-bottom: 16px;
    }
    .dollar-chip {
      width: 20px;
      height: 20px;
      border-radius: 999px;
      background: rgba(0, 213, 75, .15);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      font-weight: 800;
      flex-shrink: 0;
    }

    .amt-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      margin-bottom: 12px;
    }
    .amt-btn {
      background: #fff;
      border: 1px solid var(--green-200);
      border-radius: 999px;
      color: var(--text);
      cursor: pointer;
      font-family: inherit;
      font-size: 16px;
      font-weight: 700;
      padding: 12px 0;
      transition: background .2s, border-color .2s;
      width: 100%;
    }
    .amt-btn:hover { background: var(--green-50); border-color: var(--green-300); }
    .amt-btn.selected {
      border: 2px solid var(--green);
      color: var(--green-text);
      box-shadow: 0 0 0 3px rgba(0, 213, 75, .15);
      padding: 11px 0; /* compensate 2px border */
    }

    .toggle-btn {
      width: 100%;
      background: var(--green-200);
      border: none;
      border-radius: 999px;
      color: var(--green-text);
      cursor: pointer;
      font-family: inherit;
      font-size: 14px;
      font-weight: 700;
      padding: 10px 0;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      transition: background .2s;
    }
    .toggle-btn:hover { background: var(--green-300); }
    .toggle-btn i { transition: transform .2s; }

    /* Custom input */
    .input-wrap {
      position: relative;
      display: flex;
      align-items: center;
    }
    .input-prefix {
      position: absolute;
      left: 16px;
      font-size: 15px;
      font-weight: 800;
      color: var(--green-text);
      pointer-events: none;
    }
    #custom-input {
      width: 100%;
      padding: 12px 16px 12px 36px;
      font-family: inherit;
      font-size: 15px;
      font-weight: 700;
      border-radius: 999px;
      border: 1px solid var(--green-200);
      background: #fff;
      color: var(--text);
      outline: none;
      transition: border-color .2s, box-shadow .2s;
    }
    #custom-input::placeholder { color: var(--text-hint); font-weight: 600; }
    #custom-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 213, 75, .3); }
    .field-err { font-size: 12px; color: var(--red); margin-top: 6px; display: none; font-weight: 600; }

    /* ===== Card body / Pay button ===== */
    .card-body { padding: 0 24px 24px; }
    .pay-btn, .pay-now-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: 100%;
      padding: 16px 0;
      background: var(--green);
      border: none;
      border-radius: 999px;
      color: #fff;
      cursor: pointer;
      font-family: inherit;
      font-size: 17px;
      font-weight: 800;
      box-shadow: 0 0 20px rgba(0, 213, 75, .35);
      transition: background .15s, transform .1s;
    }
    .pay-btn:hover:not(:disabled), .pay-now-btn:hover { background: var(--green-hover); }
    .pay-btn:active:not(:disabled), .pay-now-btn:active { transform: scale(.98); }
    .pay-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
    .pay-btn svg, .pay-now-btn svg { flex-shrink: 0; }
    .pay-btn i, .pay-now-btn i { font-size: 18px; }
    .pay-now-btn { margin-bottom: 16px; }

    /* Loading spinner */
    @keyframes btn-spin { to { transform: rotate(360deg); } }
    .btn-spinner {
      width: 22px; height: 22px;
      border: 3px solid rgba(255,255,255,0.3);
      border-top-color: #fff;
      border-radius: 50%;
      animation: btn-spin 0.7s linear infinite;
      flex-shrink: 0;
    }
    .pay-btn.loading, .pay-now-btn.loading {
      background: #9ca3af !important;
      box-shadow: none;
      cursor: not-allowed;
      pointer-events: none;
    }

    /* Status */
    .status-msg { text-align: center; margin-top: 10px; font-size: 13px; min-height: 18px; font-weight: 600; }

    /* Paid banner */
    .paid-banner {
      display: none;
      align-items: center;
      gap: 10px;
      background: var(--green-50);
      border: 1px solid var(--green-200);
      border-radius: 12px;
      padding: 12px 14px;
      margin-bottom: 8px;
      font-size: 14px;
      font-weight: 700;
      color: var(--green-text);
    }
    .paid-banner.show { display: flex; }

    /* Powered by */
    .powered-by {
      padding: 0 24px 24px;
      text-align: center;
      font-size: 12px;
      font-weight: 600;
      color: var(--text-hint);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    .powered-by-dot {
      width: 12px;
      height: 12px;
      border-radius: 999px;
      border: 1px solid var(--border-mid);
      display: inline-block;
      flex-shrink: 0;
    }
    .ok  { color: var(--green-text); }
    .err { color: var(--red); }

    /* ===== Invoice view ===== */
    .expiry-row { display: flex; justify-content: center; padding: 8px 24px 0; }
    .expiry-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 13px;
      font-weight: 700;
      color: var(--text-muted);
      background: var(--bg);
      border: 1px solid var(--border-mid);
      border-radius: 999px;
      padding: 5px 14px;
    }
    .amount-block {
      text-align: center;
      padding: 20px 24px 20px;
    }
    .amount-due-label {
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: .1em;
      color: var(--text-hint);
      margin-bottom: 6px;
    }
    .amount-usd {
      font-size: 44px;
      font-weight: 900;
      color: var(--green);
      line-height: 1.1;
    }
    .scan-label { font-size: 13px; color: var(--text-muted); margin-top: 6px; font-weight: 600; }
    .inv-qr-wrap { display: flex; justify-content: center; margin: 0 24px 20px; }
    .qr-frame {
      background: #fff;
      border: 1px solid var(--border-mid);
      border-radius: 16px;
      padding: 16px;
      display: inline-block;
    }
    .invoice-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      background: #f9fafb;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 10px 12px;
      margin: 0 24px 20px;
    }
    .invoice-row-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
    .invoice-row-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .invoice-row-icon img { width: 14px; height: 14px; border-radius: 3px; display: block; }
    .invoice-row-label { font-size: 13px; color: var(--text-muted); font-weight: 700; white-space: nowrap; }
    .invoice-row-id {
      font-family: var(--font-mono);
      font-size: 12px;
      color: var(--text-hint);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .invoice-copy-btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: #fff;
      border: 1px solid var(--border-mid);
      border-radius: 999px;
      color: var(--text-muted);
      cursor: pointer;
      font-family: inherit;
      font-size: 12px;
      font-weight: 700;
      padding: 6px 12px;
      flex-shrink: 0;
      transition: background .15s, color .15s, border-color .15s;
    }
    .invoice-copy-btn:hover { background: var(--bg); }
    .invoice-copy-btn.copied {
      color: var(--green-text);
      border-color: var(--green-200);
      background: var(--green-50);
    }

    /* ===== Splash Screen ===== */
    @keyframes splash-fade-in {
      from { opacity: 0; }
      to   { opacity: 1; }
    }
    @keyframes splash-logo-in {
      0%   { opacity: 0; filter: blur(12px) brightness(0.8); transform: scale(0.75); }
      60%  { opacity: 1; filter: blur(0px) brightness(1);    transform: scale(1.05); }
      100% { opacity: 1; filter: blur(0px) brightness(1);    transform: scale(1); }
    }
    @keyframes splash-halo {
      0%, 100% { opacity: 0.35; transform: scale(1); }
      50%      { opacity: 0.6;  transform: scale(1.15); }
    }
    @keyframes splash-text-in {
      from { opacity: 0; transform: translateY(8px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    #splash-screen {
      position: fixed;
      inset: 0;
      background: var(--bg);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      z-index: 99999;
      animation: splash-fade-in 0.3s ease-out;
      transition: opacity 0.5s ease-out, visibility 0.5s;
    }
    #splash-screen.fade-out {
      opacity: 0;
      pointer-events: none;
      visibility: hidden;
    }
    .splash-logo-wrap {
      position: relative;
      width: 80px;
      height: 80px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 20px;
    }
    .splash-logo-wrap::before {
      content: '';
      position: absolute;
      inset: -24px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(0, 213, 75, 0.3) 0%, rgba(0, 213, 75, 0.1) 50%, transparent 70%);
      animation: splash-halo 2.2s ease-in-out infinite;
    }
    .splash-logo {
      width: 80px;
      height: 80px;
      border-radius: 20px;
      position: relative;
      z-index: 1;
      animation: splash-logo-in 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }
    .splash-brand-name {
      font-size: 20px;
      font-weight: 800;
      color: var(--text);
      letter-spacing: 0.5px;
      animation: splash-text-in 0.8s ease-out 0.6s both;
    }
    .splash-brand-tagline {
      font-size: 13px;
      color: var(--text-muted);
      margin-top: 4px;
      animation: splash-text-in 0.8s ease-out 0.8s both;
    }
