/* Wallet passes, simulated phones and the design picker. Tokens come from theme.css. */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- pass scaling: every size below is in em, so a pass scales with its container ---------- */
.pass { container-type: inline-size; width: 100%; }
.pass, .device, .pick-card, .stack-card { font-family: var(--device-font); }
.pg { font-family: "Google Sans", Roboto, var(--device-font); }
.pa, .pg { font-size: calc(100cqw / 25.2); line-height: 1.22; }

.f { min-width: 0; }
.f-v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-alt { font-size: .86em; letter-spacing: .06em; margin-top: .4em; color: #1f1f1f; font-variant-numeric: tabular-nums; }

/* ---------- Apple Wallet store card ---------- */
.pa {
  display: flex; flex-direction: column; aspect-ratio: 252 / 352; overflow: hidden;
  background: var(--bg); color: var(--fg); border-radius: 1.1em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 1.4em 3em -1em rgba(0, 0, 0, .75);
}
.pa-top { display: flex; align-items: center; justify-content: space-between; gap: .8em; padding: 1.15em 1.25em .85em; }
.pa-brand { display: flex; align-items: center; gap: .45em; min-width: 0; font-size: 1.45em; font-weight: 600; }
.pa-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-brand .mark { width: 1.35em; height: 1.35em; flex: none; color: var(--mk); }
.pa .f-l { font-size: .82em; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--lb); }
.pa .f-v { font-size: 1.5em; font-weight: 500; margin-top: .1em; }
/* Arabic: no letter spacing (it breaks joined letters), and a larger size because the script runs small */
[dir="rtl"] .f-l, [dir="rtl"] .f-v { letter-spacing: 0 !important; }
.pa[dir="rtl"] .f-l { font-size: 1.05em; }
.pg[dir="rtl"] .f-l { font-size: 1.2em; }
.pa-header { flex: none; text-align: end; }
.pa-strip { position: relative; flex: none; aspect-ratio: 375 / 144; overflow: hidden; }
.pa-strip > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pa-strip.has-primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .46), transparent 74%);
}
[dir="rtl"] .pa-strip.has-primary::after { background: linear-gradient(270deg, rgba(0, 0, 0, .46), transparent 74%); }
.pa-primary { position: absolute; z-index: 1; inset-inline-start: 1.25em; bottom: .8em; color: var(--sf); }
.pa .pa-primary .f-l { color: inherit; opacity: .9; }
.pa .pa-primary .f-v { font-size: 2.9em; font-weight: 400; margin-top: 0; letter-spacing: -.01em; }
.pa-primary-flat { padding: 1.5em 1.25em .3em; }
.pa .pa-primary-flat .f-v { font-size: 2.6em; font-weight: 400; }
.pa-row { display: flex; justify-content: space-between; gap: 1em; padding: 1em 1.25em .6em; }
.pa-row .f:last-child { text-align: end; }
.pa-code { margin: auto auto 1.2em; padding: .8em .8em .55em; background: #fff; color: #111; border-radius: .75em; text-align: center; }
.pa-code svg { display: block; width: 9em; height: 9em; }
.pa-code.wide svg { width: 17.5em; height: 4.7em; }

/* ---------- Google Wallet loyalty pass ---------- */
.pg {
  overflow: hidden; background: var(--bg); color: var(--fg); border-radius: 1.8em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 1.4em 3em -1em rgba(0, 0, 0, .75);
}
.pg-head { display: flex; align-items: center; gap: .7em; padding: 1.3em 1.4em .45em; }
.pg-logo { display: grid; place-items: center; width: 3em; height: 3em; flex: none; border-radius: 50%; background: var(--logo-bg); color: var(--logo-fg); }
.pg-logo .mark { width: 1.85em; height: 1.85em; }
.pg-issuer { font-size: 1.3em; font-weight: 500; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-program { font-size: 2.1em; font-weight: 500; padding: .15em .67em 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-rows { display: grid; gap: .75em; padding: .8em 1.4em 0; }
.pg-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 1em; }
.pg .f-l { font-size: 1.02em; opacity: .85; }
.pg .f-v { font-size: 1.5em; font-weight: 500; }
.pg-code { width: fit-content; margin: 1em auto 0; padding: .8em .8em .5em; background: #fff; color: #1f1f1f; border-radius: 1em; text-align: center; }
.pg-code svg { display: block; width: 8.2em; height: 8.2em; }
.pg-code.wide svg { width: 17.5em; height: 4.7em; }
.pg-hero { aspect-ratio: 1032 / 812; margin-top: 1em; }
.pg-hero svg { display: block; width: 100%; height: 100%; }

/* ---------- phones ---------- */
/* a single phone on the landing page: <div class="phone-solo" data-phone="iphone" data-design="..."> */
.phone-solo { --dw: 296px; position: relative; display: flex; justify-content: center; }
.phone-solo::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(58, 116, 242, .3), transparent 78%);
}
.devices { --dw: 296px; position: relative; display: flex; justify-content: center; gap: 24px; }
.devices::before {
  content: ""; position: absolute; inset: -6% 0 8%; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(58, 116, 242, .32), transparent 78%);
}
.device { position: relative; z-index: 1; width: min(var(--dw), 100%); flex: none; margin: 0; }
.device figcaption { margin-top: 18px; text-align: center; font-size: 14px; color: var(--text-2); }
.device figcaption strong { display: block; color: var(--text); font-weight: 650; font-size: 15px; }
.device-body { position: relative; aspect-ratio: 296 / 628; padding: 3px; }
.device-bezel { width: 100%; height: 100%; background: #050505; }
.device-screen { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden; color: #fff; }
.side { position: absolute; width: 3px; border-radius: 2px; }
.side.l { left: -2px; }
.side.r { right: -2px; }

.status { flex: none; display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
.status-icons { display: flex; align-items: center; gap: 5px; }
.status-icons svg { display: block; height: 11px; width: auto; fill: currentColor; }
.appbar { flex: none; display: flex; align-items: center; justify-content: space-between; }
.appbar svg { display: block; width: 18px; height: 18px; fill: currentColor; }
.appbar svg[fill="none"] { fill: none; }
.scr-body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; padding: 0 11px 14px; }
.scr-body::-webkit-scrollbar { display: none; }

/* iPhone: rounded titanium band, Dynamic Island, Wallet close and share controls */
.iphone .device-body { border-radius: 54px; background: linear-gradient(135deg, #b0aea6, #5f5e59 28%, #94928a 52%, #4e4d49 78%, #a4a29a); box-shadow: 0 44px 80px -34px rgba(0, 0, 0, .95); }
.iphone .device-bezel { border-radius: 51px; padding: 8px; }
.iphone .device-screen { border-radius: 43px; background: #000; }
.iphone .side { background: linear-gradient(180deg, #8d8b83, #5a5954); }
.iphone .side.a { top: 92px; height: 24px; }
.iphone .side.b { top: 136px; height: 46px; }
.iphone .side.c { top: 194px; height: 46px; }
.iphone .side.d { top: 158px; height: 74px; }
.island { position: absolute; z-index: 3; top: 10px; left: 50%; width: 84px; height: 25px; border-radius: 14px; background: #000; box-shadow: 0 0 0 1px #1c1c1e; transform: translateX(-50%); }
.iphone .status { padding: 13px 22px 0 28px; font-size: 14px; }
.iphone .appbar { padding: 16px 12px 10px; }
.chip { display: flex; align-items: center; justify-content: center; gap: 10px; height: 32px; min-width: 32px; border-radius: 16px; background: #2c2c2e; }
.chip svg { width: 15px; height: 15px; }
.chip.wide { padding: 0 11px; }
.stack { position: absolute; left: 11px; right: 11px; bottom: 0; z-index: 2; }
.stack-card {
  display: flex; align-items: flex-start; gap: 7px; height: 70px; margin-top: -38px; padding: 9px 12px;
  border-radius: 13px 13px 0 0; background: var(--bg); color: var(--fg); font-size: 12px; font-weight: 600;
  box-shadow: 0 -5px 12px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.stack-card:first-child { margin-top: 0; }
.stack-card .mark { width: 15px; height: 15px; flex: none; color: var(--mk); }
.home-bar { position: absolute; z-index: 3; left: 50%; bottom: 7px; width: 104px; height: 4.5px; border-radius: 3px; background: #fff; transform: translateX(-50%); }

/* Samsung Galaxy: flatter frame, tighter corners, centred punch-hole, side keys on the right, three-button navigation */
.samsung .device-body { border-radius: 36px; background: linear-gradient(135deg, #767981, #43454b 34%, #62656c 66%, #37393e); box-shadow: 0 44px 80px -34px rgba(0, 0, 0, .95); }
.samsung .device-bezel { border-radius: 33px; padding: 6px; }
.samsung .device-screen { border-radius: 27px; background: #131314; }
.samsung .side { background: linear-gradient(180deg, #5d6066, #3b3d42); }
.samsung .side.a { top: 124px; height: 84px; }
.samsung .side.b { top: 226px; height: 46px; }
.punch { position: absolute; z-index: 3; top: 9px; left: 50%; width: 12px; height: 12px; border-radius: 50%; background: #000; box-shadow: 0 0 0 1px #2a2a2c; transform: translateX(-50%); }
.samsung .status { padding: 7px 16px 0 18px; font-size: 12.5px; font-weight: 500; }
.samsung .status-icons svg { height: 10px; }
.pct { font-size: 11.5px; }
.samsung .appbar { padding: 12px 12px 8px; }
.plain { display: flex; color: #e3e3e3; }
.plain svg { width: 20px; height: 20px; }
.samsung .scr-body { padding: 0 9px 10px; }
.navbar { flex: none; display: flex; align-items: center; justify-content: space-around; height: 36px; padding: 0 22px; color: #c7c7cc; }
.navbar svg { display: block; width: 19px; height: 19px; }

@media (prefers-reduced-motion: no-preference) {
  .pass.swap { animation: pass-swap .34s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes pass-swap { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
}

/* ---------- studio layout ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 4.4fr) minmax(0, 7.6fr); gap: 48px; align-items: start; }
.studio-stage { position: sticky; top: 88px; }
.picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 12px; margin-top: 28px; }
.pick { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.pick-card {
  position: relative; display: block; aspect-ratio: 1.68; overflow: hidden; border-radius: 12px;
  background: var(--bg); color: var(--fg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 12px 24px -14px rgba(0, 0, 0, .9);
  transition: transform .18s cubic-bezier(.2, .7, .2, 1), box-shadow .18s;
}
.pick:hover .pick-card { transform: translateY(-3px); }
.pick-brand { position: absolute; z-index: 1; top: 8px; inset-inline: 9px; display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 650; white-space: nowrap; overflow: hidden; }
.pick-brand .mark { width: 14px; height: 14px; flex: none; color: var(--mk); }
.pick-art { position: absolute; inset: 37% 0 0; display: block; }
.pick-art svg { display: block; width: 100%; height: 100%; }
.pick-title { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13.5px; line-height: 1.3; font-weight: 600; color: var(--text-2); }
.pick[aria-pressed="true"] .pick-title { color: var(--text); }
.pick[aria-pressed="true"] .pick-title::before {
  content: ""; flex: none; width: 15px; height: 15px; background: var(--action);
  -webkit-mask: var(--check) center / contain no-repeat; mask: var(--check) center / contain no-repeat;
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.500 4.500 4.500L19 7.500'/%3E%3C/svg%3E");
}
.pick[aria-pressed="true"] .pick-card { box-shadow: 0 0 0 2px var(--canvas-1), 0 0 0 4px var(--action), 0 12px 24px -14px rgba(0, 0, 0, .9); }
.pick:focus-visible { outline: none; }
.pick:focus-visible .pick-card { outline: 2px solid var(--focus); outline-offset: 6px; }
.studio-current { margin: 24px 0 0; font-size: 15px; color: var(--text-2); }
.studio-current strong { color: var(--text); font-weight: 650; }
.studio-note { margin: 10px 0 22px; font-size: 13px; color: var(--text-3); max-width: 52ch; }

.device-tabs { display: none; width: fit-content; margin: 0 auto 26px; padding: 4px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--field); }
.device-tabs button { padding: 9px 22px; border: 0; border-radius: 9px; background: none; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.device-tabs button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }

@media (max-width: 1099px) {
  .studio { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .studio-stage { position: static; }
  .picker { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 14px; }
  .pick-brand { font-size: 12.5px; }
  .studio-note { margin-bottom: 18px; }
}
@media (max-width: 719px) {
  .device-tabs { display: flex; }
  .devices[data-show="iphone"] .samsung, .devices[data-show="samsung"] .iphone { display: none; }
  .devices { --dw: 296px; }
  .picker {
    display: flex; gap: 12px; margin-inline: -20px; padding: 6px 20px 12px; overflow-x: auto;
    scroll-snap-type: x proximity; scroll-padding-inline: 20px; scrollbar-width: none;
  }
  .picker::-webkit-scrollbar { display: none; }
  .pick { flex: 0 0 148px; scroll-snap-align: start; }
}

@media (max-width: 719px) {
  .device-tabs button { min-height: 44px; font-size: 16px; }
  .pick-title { font-size: 16px; }
  .studio-current, .studio-note { font-size: 16px; }
}
