.transit-wallet { position:fixed; inset-inline-start:0; inset-block-start:45%; z-index:39; }
.transit-wallet [hidden] { display:none !important; }
.wallet-launcher { width:64px; min-height:92px; padding:12px 10px; border:1px solid #ad8950; border-inline-start:0; border-radius:16px 0 0 16px; background:#111d34; color:#fff5da; font:inherit; font-weight:700; cursor:pointer; box-shadow:0 5px 18px #10192c30; }
body:has(#modalBg:not([hidden]),#drawerBg:not([hidden])) .transit-wallet { visibility:hidden; }

/* ---------- the wallet sheet ---------- */
.wallet-dialog {
  box-sizing:border-box; position:fixed; inset:0; inset-inline-end:auto; margin:0;
  width:min(440px,100vw); max-width:none; height:100dvh; max-height:100dvh; overflow:auto;
  padding:22px 22px 28px; border:0; border-radius:0 0 0 0; direction:rtl;
  background:#fbf6ea url('/img/transit-east-cream-background.webp') center bottom / cover no-repeat;
  color:#141a2e; font:15px/1.55 Heebo,Arial,sans-serif; box-shadow:-20px 0 60px #0a12214d;
}
.wallet-dialog::before { content:""; position:absolute; inset:0; background:#fbf6eadd; pointer-events:none; z-index:-1; }
.wallet-dialog > * { position:relative; }
.wallet-dialog::backdrop { background:#0a1221a6; backdrop-filter:blur(3px); }
.wallet-close { position:absolute; inset-inline-start:14px; inset-block-start:12px; z-index:3; width:40px; height:40px; border:0; border-radius:50%; background:#ffffffcc; color:#141a2e; font-size:24px; line-height:1; cursor:pointer; box-shadow:0 2px 10px #0000001a; }
.wallet-close:hover { background:#fff; }

/* balance card */
.wallet-card {
  position:relative; overflow:hidden; margin:34px 0 18px; padding:22px 22px 20px; border-radius:22px; color:#fbefd6;
  background:radial-gradient(120% 140% at 100% 0%,#2b3a5e 0%,#141a2e 55%,#0c1020 100%);
  box-shadow:0 18px 40px #141a2e40, inset 0 1px #ffffff14; isolation:isolate;
}
.wallet-card::before { content:""; position:absolute; inset:auto -40px -70px auto; width:220px; height:220px; border-radius:50%; background:radial-gradient(circle,#e3a43c40,transparent 70%); z-index:-1; }
.wallet-card::after { content:""; position:absolute; inset:0; border-radius:inherit; border:1px solid #e3a43c55; pointer-events:none; }
.wallet-card-mark { position:absolute; inset-inline-end:20px; inset-block-start:18px; width:40px; height:auto; opacity:.95; }
.wallet-card-brand { margin:0 0 2px; font:600 11px/1 'Josefin Sans',Heebo,sans-serif; letter-spacing:.22em; color:#e3a43c; direction:ltr; text-align:right; }
.wallet-card h2 { margin:6px 0 18px; font-size:22px; font-weight:700; color:#fff; }
.wallet-card-label { margin:0; font-size:13px; color:#c9cfdf; }
.wallet-card-balance { margin:0; font-size:42px; font-weight:300; line-height:1.15; color:#fff; letter-spacing:-.5px; }
.wallet-card-note { margin:8px 0 0; font-size:12.5px; color:#aab2c8; }
.wallet-card.is-guest .wallet-card-balance { color:#7f889f; }
.wallet-card.is-bumped { animation:wallet-bump .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes wallet-bump { 40% { transform:scale(1.025); } }

.wallet-intro { margin:0 2px 16px; color:#4d576b; font-size:14.5px; }

/* join */
.wallet-join { padding:18px; border-radius:16px; background:#fff; border:1px solid #eadfcb; text-align:center; }
.wallet-join p { margin:0 0 12px; color:#4d576b; }

/* form */
.wallet-form { display:grid; gap:16px; padding:18px; border-radius:18px; background:#fffdf9; border:1px solid #eadfcb; box-shadow:0 6px 20px #2b241712; }
.wallet-form h3 { margin:0; font-size:17px; }
.wallet-form fieldset { margin:0; padding:0; border:0; min-width:0; }
.wallet-form legend { padding:0; margin-bottom:8px; font-size:13px; font-weight:600; color:#6b6457; }
.wallet-providers { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.wallet-providers legend { grid-column:1 / -1; }
.wallet-provider { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; min-height:76px; padding:12px 8px; border:1.5px solid #e6dccb; border-radius:14px; background:#fff; cursor:pointer; text-align:center; transition:border-color .2s,box-shadow .2s,background .2s; }
.wallet-provider input { position:absolute; opacity:0; pointer-events:none; }
.wallet-provider-name { font-size:18px; font-weight:800; color:#141a2e; }
.wallet-provider-mode { font-size:11.5px; font-weight:600; color:#8a7f6c; }
.wallet-provider-mode[data-live="true"] { color:#2f6b2c; }
.wallet-provider:has(input:checked) { border-color:#e3a43c; background:#fffaf0; box-shadow:0 0 0 3px #e3a43c33; }
.wallet-provider:has(input:checked)::after { content:""; position:absolute; inset-inline-start:10px; inset-block-start:10px; width:18px; height:18px; border-radius:50%; background:#e3a43c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23141a2e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 13px no-repeat; }
.wallet-provider:has(input:disabled) { opacity:.45; cursor:not-allowed; }
.wallet-provider:has(input:focus-visible) { outline:2px solid #141a2e; outline-offset:2px; }

.wallet-chips { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.wallet-chip { min-height:44px; border:1.5px solid #e6dccb; border-radius:12px; background:#fff; color:#141a2e; font:700 15px Heebo,Arial,sans-serif; cursor:pointer; transition:all .15s; }
.wallet-chip:hover:not(:disabled) { border-color:#c98d2b; }
.wallet-chip[aria-pressed="true"] { background:#141a2e; border-color:#141a2e; color:#fbefd6; }
.wallet-chip:disabled { opacity:.4; cursor:not-allowed; }
.wallet-other { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:10px; font-size:13.5px; color:#6b6457; }
.wallet-other-field { display:flex; align-items:center; gap:6px; padding:0 12px; min-height:44px; border:1.5px solid #e6dccb; border-radius:12px; background:#fff; }
.wallet-other-field:focus-within { border-color:#141a2e; }
.wallet-other input { width:90px; border:0; outline:0; background:transparent; font:700 16px Heebo,Arial,sans-serif; color:#141a2e; text-align:center; -moz-appearance:textfield; }
.wallet-other input::-webkit-outer-spin-button,.wallet-other input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }

.wallet-cta { display:flex; align-items:center; justify-content:center; gap:6px; min-height:52px; padding:0 20px; border:0; border-radius:14px; background:#e3a43c; color:#141a2e; font:800 17px Heebo,Arial,sans-serif; text-decoration:none; cursor:pointer; box-shadow:0 8px 20px #b77a1a40,inset 0 1px #ffffff66; transition:background .2s,transform .08s; }
.wallet-cta:hover:not(:disabled) { background:#d4932a; }
.wallet-cta:active:not(:disabled) { transform:scale(.98); }
.wallet-cta:disabled { background:#e4dccd; color:#7d7465; box-shadow:none; cursor:not-allowed; }
.wallet-secure { display:flex; align-items:flex-start; gap:6px; margin:-6px 0 0; font-size:12px; color:#6b6457; }
.wallet-secure svg { flex:none; width:15px; height:15px; margin-top:2px; color:#2f6b2c; }

.wallet-status { min-height:0; margin:12px 2px 0; font-size:14px; font-weight:600; }
.wallet-status:empty { margin:0; }
.wallet-status[data-tone="ok"] { padding:10px 14px; border-radius:12px; background:#e6f2e3; color:#2f6b2c; }
.wallet-status[data-tone="error"] { padding:10px 14px; border-radius:12px; background:#fbe7e3; color:#b3261e; }
.wallet-status[data-tone="warn"] { padding:10px 14px; border-radius:12px; background:#fbefd6; color:#8a5a12; }

/* how it works */
.wallet-steps { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:18px 0 0; padding:0; list-style:none; }
.wallet-steps li { display:flex; flex-direction:column; align-items:center; gap:6px; padding:12px 6px; border-radius:14px; background:#ffffffa8; text-align:center; font-size:12.5px; line-height:1.35; color:#4d576b; }
.wallet-steps b { display:grid; place-items:center; width:26px; height:26px; border-radius:50%; background:#141a2e; color:#e3a43c; font-size:13px; }

/* history */
.wallet-history { margin-top:20px; }
.wallet-history h3 { margin:0 0 8px; font-size:15px; }
.wallet-history ul { margin:0; padding:6px 14px; list-style:none; border-radius:16px; background:#fffdf9; border:1px solid #eadfcb; }
.wallet-history li { display:flex; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid #f0e8da; }
.wallet-history li:last-child { border-bottom:0; }
.wallet-entry-icon { flex:none; display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#f3ece0; color:#6b6457; }
.wallet-entry-icon svg { width:16px; height:16px; }
.wallet-history li.in .wallet-entry-icon { background:#e6f2e3; color:#2f6b2c; }
.wallet-entry-text { flex:1; min-width:0; display:flex; flex-direction:column; }
.wallet-entry-text b { font-size:14px; font-weight:600; }
.wallet-entry-text small { font-size:12px; color:#8a7f6c; }
.wallet-entry-amount { font-weight:700; font-variant-numeric:tabular-nums; }
.wallet-history li.in .wallet-entry-amount { color:#2f6b2c; }

@media (max-width:480px) {
  .wallet-dialog { width:100vw; padding:18px 16px 24px; }
  .wallet-card-balance { font-size:38px; }
}
@media (prefers-reduced-motion:no-preference) {
  .wallet-dialog[open] { animation:wallet-slide-in .32s cubic-bezier(.2,.8,.2,1); }
  .wallet-dialog[open]::backdrop { animation:wallet-fade .3s ease-out; }
  @keyframes wallet-slide-in { from { transform:translateX(100%); } to { transform:translateX(0); } }
  @keyframes wallet-fade { from { opacity:0; } }
}

body:not(.transit-wallet-ready) .wallet-placement { display:none; }
.wallet-artwork { display:block; width:fit-content; max-width:100%; padding:0; border:0; border-radius:12px; background:transparent; cursor:pointer; }
.wallet-artwork img { display:block; max-width:100%; max-height:11rem; width:auto; height:auto; object-fit:contain; border-radius:inherit; }
.storefront-home > .wallet-artwork { margin:1rem auto; max-width:calc(100% - 2rem); }
.center > .wallet-artwork, .page > .wallet-artwork { margin-block:0 1rem; }
.wallet-registration { white-space:pre-wrap; overflow-wrap:anywhere; }
