/* =========================================================================
   Orood · Purchase & Redeem prototype
   Tokens → base → device frame → shared components → screens → overlays
   ========================================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  /* colors */
  --ink: #0c212c;            /* text-primary / icon-default */
  --muted: #576b74;          /* text-secondary / icon-secondary */
  --n800: #36474f;
  --brand: #7209b7;          /* action-primary-bg */
  --brand-subtle: #fef8ff;
  --green: #339413;          /* price / success */
  --green-subtle: #f8fcf2;
  --old: #b8c5ca;            /* old price */
  --n100: #f3f4f5;
  --hint: #808c91;           /* neutral-600 */
  --bg-subtle: #f9fafa;
  --border: #e7eaeb;
  --border-strong: #d6dadb;
  --white: #ffffff;
  --red: #ce2163;
  --red-subtle: #fff2f2;
  --partner: #d52b1e;
  --tab-active: #a03cd3;
  --tab-icon: #94a5ab;
  --stc: #420483;
  --likes: #f0778d;          /* bold heart in likes counter */
  --card-shadow: 0 12px 24px -10px rgba(179, 182, 186, .05);
  --scrim: rgba(0, 0, 0, .4);

  /* radii */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-sheet: 24px;
  --r-full: 999px;

  /* frame insets (desktop frame values; phones override below) */
  --sb: 0px;    /* top inset: no fake status bar, the device shows its own */
  --hi: 34px;   /* home indicator strip */

  /* motion */
  --ease-sheet: cubic-bezier(.32, .72, 0, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --d-sheet: 420ms;

  --font: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- 1b. Tajawal metrics ----------
   Figma centres Tajawal glyphs in the line box with different ascent/descent than browsers
   (text rendered ~2-3px low). Same family name re-declared after the Google Fonts <link>,
   with metric overrides, so every text style picks it up. */
/* arabic */
@font-face {
  font-family: "Tajawal";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  ascent-override: 89%;
  descent-override: 63%;
  line-gap-override: 0%;
  src: url(https://fonts.gstatic.com/s/tajawal/v12/Iura6YBj_oCad4k1nzSBC45I.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin */
@font-face {
  font-family: "Tajawal";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  ascent-override: 89%;
  descent-override: 63%;
  line-gap-override: 0%;
  src: url(https://fonts.gstatic.com/s/tajawal/v12/Iura6YBj_oCad4k1nzGBCw.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* arabic */
@font-face {
  font-family: "Tajawal";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  ascent-override: 89%;
  descent-override: 63%;
  line-gap-override: 0%;
  src: url(https://fonts.gstatic.com/s/tajawal/v12/Iurf6YBj_oCad4k1l8KiHrRpiYlJ.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin */
@font-face {
  font-family: "Tajawal";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  ascent-override: 89%;
  descent-override: 63%;
  line-gap-override: 0%;
  src: url(https://fonts.gstatic.com/s/tajawal/v12/Iurf6YBj_oCad4k1l8KiHrFpiQ.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* arabic */
@font-face {
  font-family: "Tajawal";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  ascent-override: 89%;
  descent-override: 63%;
  line-gap-override: 0%;
  src: url(https://fonts.gstatic.com/s/tajawal/v12/Iurf6YBj_oCad4k1l4qkHrRpiYlJ.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin */
@font-face {
  font-family: "Tajawal";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  ascent-override: 89%;
  descent-override: 63%;
  line-gap-override: 0%;
  src: url(https://fonts.gstatic.com/s/tajawal/v12/Iurf6YBj_oCad4k1l4qkHrFpiQ.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #e9ebee;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
img { display: block; }
p, h1, h2, h3 { margin: 0; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* Icon (mask-based so it inherits currentColor) */
.ic {
  display: inline-block;
  flex: none;
  width: 24px; height: 24px;
  background-color: currentColor;
  -webkit-mask: var(--m) center / contain no-repeat;
          mask: var(--m) center / contain no-repeat;
}
.ic.s16 { width: 16px; height: 16px; }
.ic.s20 { width: 20px; height: 20px; }
.ic.s24 { width: 24px; height: 24px; }

/* Press feedback */
.press { transition: transform 140ms var(--ease-out), opacity 140ms; }
.press:active { transform: scale(.97); }

/* ---------- 3. Stage & device frame ---------- */
.stage {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 20px;
}
.device-wrap {
  width: calc(360px * var(--scale, 1));
  height: calc(800px * var(--scale, 1));
  flex: none;
}
.device {
  position: relative;
  width: 360px;
  height: 800px;
  border-radius: 40px;
  overflow: hidden;
  background: var(--white);
  transform: scale(var(--scale, 1));
  transform-origin: top left;
  box-shadow: 0 0 0 1px rgba(12, 33, 44, .06), 0 30px 80px -20px rgba(12, 33, 44, .28), 0 8px 24px -8px rgba(12, 33, 44, .12);
  isolation: isolate;
}

/* On-brand chrome (AUT-01 Splash): white home bar */
.device.on-brand .homebar::after { background: var(--white); }

/* Home indicator (frame only) */
.homebar {
  position: absolute; inset: auto 0 0 0;
  height: var(--hi);
  z-index: 40;
  pointer-events: none;
}
.homebar::after {
  content: ""; position: absolute; left: 113px; top: 20px;
  width: 134px; height: 5px; border-radius: 100px; background: var(--hint);
  transition: background-color 420ms ease;
}

/* Phones: app fills the viewport, no fake chrome */
@media (max-width: 500px) {
  :root {
    --sb: env(safe-area-inset-top, 0px);
    --hi: env(safe-area-inset-bottom, 0px);
  }
  body { background: var(--white); }
  .stage { padding: 0; display: block; }
  .device-wrap { width: 100%; height: 100dvh; }
  .device { width: 100%; height: 100dvh; border-radius: 0; transform: none; box-shadow: none; }
  .homebar { display: none; }
}

/* ---------- 4. Screens & router ---------- */
.screens { position: absolute; inset: 0; z-index: 1; }
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--white);
  padding-top: var(--sb);
  padding-bottom: var(--hi);
  will-change: transform;
  overflow: hidden;
}
.screen.is-hidden { visibility: hidden; }
.scroll {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.scroll::-webkit-scrollbar { display: none; }

/* ---------- 5. Shared components ---------- */

/* Button/Main */
.btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 48px; width: 100%;
  border-radius: var(--r-lg);
  font: 700 18px/24px var(--font);
  transition: transform 140ms var(--ease-out), background-color 200ms, opacity 200ms;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: var(--white); }
.btn-secondary { background: var(--brand-subtle); color: var(--brand); }
.btn .btn-label { transition: opacity 160ms, transform 160ms; }
.btn .spinner {
  position: absolute; width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  opacity: 0; transform: scale(.6);
  transition: opacity 160ms, transform 160ms;
}
.btn-secondary .spinner { border-color: rgba(114, 9, 183, .25); border-top-color: var(--brand); }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn-label { opacity: 0; transform: scale(.9); }
.btn.is-loading .spinner { opacity: 1; transform: scale(1); animation: spin .8s linear infinite; }

/* Tag/Offer Type */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 4px 8px;
  border-radius: var(--r-full);
  font: 500 12px/14px var(--font);
  white-space: nowrap; flex: none;
}
.tag-paid { background: var(--brand-subtle); color: var(--brand); }
.tag-free { background: var(--green-subtle); color: var(--green); }

/* Brand/Shop logo */
.shop-logo { flex: none; border-radius: 50%; overflow: hidden; object-fit: cover; background: var(--n100); }
.shop-logo.s20 { width: 20px; height: 20px; }
.shop-logo.s24 { width: 24px; height: 24px; }
.shop-logo.s48 { width: 48px; height: 48px; }

/* Navigation/Header (inner screens) */
.nav-header {
  flex: none; height: 44px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: var(--white);
}
.nav-header .back { width: 24px; height: 24px; display: grid; place-items: center; color: var(--ink); }
.nav-header h1 { font: 700 17px/22px var(--font); color: var(--ink); position: relative; top: 2px; } /* Figma centres this title 2px lower than the global metric fix */

/* Top row with close (result screens) */
.result-top { flex: none; height: 48px; display: flex; align-items: center; justify-content: flex-end; padding: 0 16px; }
.icon-btn { width: 24px; height: 24px; display: grid; place-items: center; color: var(--muted); border-radius: 50%; }
.icon-btn:active { transform: scale(.9); }

/* Card/Voucher */
.vcard {
  display: flex; align-items: stretch;
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  text-align: right;
  transition: transform 140ms var(--ease-out);
}
button.vcard:active { transform: scale(.985); }
.vc-content { flex: 1 1 auto; min-width: 0; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.vc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vc-shop { display: flex; align-items: center; gap: 6px; font: 500 12px/14px var(--font); color: var(--muted); white-space: nowrap; }
.vc-title { font: 500 16px/20px var(--font); color: var(--ink); }
.vc-meta { display: flex; align-items: center; gap: 4px; font: 500 12px/14px var(--font); color: var(--muted); }
.vc-divider {
  flex: none; width: 1px;
  background: repeating-linear-gradient(to bottom, var(--border-strong) 0 4px, transparent 4px 8px);
}
.vc-stub {
  flex: none; width: 76px;
  background: var(--bg-subtle);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 8px;
}
.vc-count { font: 700 17px/22px var(--font); color: var(--brand); }
.vc-left { font: 500 10px/10px var(--font); color: var(--muted); }
.vc-use {
  display: inline-flex; align-items: center; justify-content: center;
  height: 26px; width: 65px; padding: 6px 12px;
  border-radius: var(--r-full);
  background: var(--brand); color: var(--white);
  font: 500 12px/14px var(--font);
}
.vcard.is-used .vc-count, .vcard.is-expired .vc-count { color: var(--hint); }
.vcard.is-used .vc-use, .vcard.is-expired .vc-use { background: var(--n100); color: var(--hint); }
.vcard.is-used .vc-title, .vcard.is-expired .vc-title { color: var(--muted); }

/* Info box (key/value rows) */
.kv-box {
  width: 100%;
  background: var(--bg-subtle);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 500 14px/14px var(--font); min-height: 14px; }
.kv-row .k { color: var(--muted); white-space: nowrap; }
.kv-row .v { color: var(--ink); text-align: left; }

/* List/Item */
.litem {
  width: 100%; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding-right: 2px;
  color: var(--muted);
}
.litem .li-main { display: flex; align-items: center; gap: 12px; }
.litem .li-title { font: 500 18px/24px var(--font); color: var(--ink); }
.litem:active { opacity: .6; }

/* Divider */
.hr { height: 1px; background: var(--border); width: 100%; flex: none; }

/* ---------- 6. Screen: Offer details (PUR-01 / PUR-02) ---------- */
.offer-content { display: flex; flex-direction: column; gap: 20px; padding: 20px 0 24px; }
.hero {
  position: relative; flex: none;
  height: 233px; overflow: hidden;
  padding: 16px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: #c81c1c;
}
/* hero.png is the clean 360×233 photo; live HTML chips sit on top */
.hero-img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
@media (max-width: 500px) { .hero { height: auto; aspect-ratio: 360 / 233; } }
.hero-row { position: relative; display: flex; align-items: center; justify-content: space-between; }
.glass {
  background: rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.glass-btn { width: 32px; height: 32px; border-radius: 14px; display: grid; place-items: center; color: var(--ink); }
.glass-btn:active { transform: scale(.92); }
.heart-btn .ic { transition: color 200ms; }
.heart-btn .heart-fill { position: absolute; opacity: 0; transform: scale(.3); color: var(--brand); transition: opacity 200ms, transform 300ms var(--ease-out); }
.heart-btn { position: relative; }
.heart-btn.is-on .heart-fill { opacity: 1; transform: scale(1); }
.heart-btn.is-on .heart-line { color: var(--brand); }
.heart-btn.pop { animation: heartPop 420ms var(--ease-out); }
.glass-chip { height: 24px; border-radius: var(--r-sm); display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; color: var(--ink); font: 500 10px/10px var(--font); }
.glass-logo { width: 24px; height: 24px; border-radius: var(--r-sm); display: grid; place-items: center; }
.glass-logo img { width: 7.4px; height: 14.6px; }

.offer-content.paid { gap: 16px; padding: 0 0 16px; }
.offer-body { padding: 0 16px; display: flex; flex-direction: column; gap: 16px; }
.shop-row { display: flex; align-items: center; justify-content: space-between; height: 24px; }
.shop-row .shop { display: flex; align-items: center; gap: 8px; font: 700 15px/22px var(--font); color: var(--muted); }
.offer-title { font: 700 18px/24px var(--font); color: var(--ink); }
.price-row { display: flex; align-items: baseline; gap: 4px; height: 24px; }
.price-row .grp { display: inline-flex; align-items: baseline; gap: 2px; }
.price-row .big { font: 500 24px/24px var(--font); }
.price-row .unit { font: 500 16px/20px var(--font); }
.price-row .new { color: var(--green); }
.price-row .instead { font: 500 16px/20px var(--font); color: var(--muted); }
.price-row .old { color: var(--old); }
.meta-row { display: flex; align-items: center; gap: 16px; height: 16px; }
.meta-row .m { display: inline-flex; align-items: center; gap: 4px; font: 500 12px/14px var(--font); color: var(--muted); white-space: nowrap; }
.how-card { background: var(--bg-subtle); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.how-card h3 { font: 500 16px/20px var(--font); color: var(--ink); }
.how-steps { display: flex; gap: 8px; }
.how-step { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.how-step .circle { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-subtle); color: var(--brand); display: grid; place-items: center; }
.how-step span { font: 500 12px/14px var(--font); color: var(--ink); white-space: nowrap; }
.offer-desc { font: 400 14px/20px var(--font); color: var(--muted); }
.offer-list { display: flex; flex-direction: column; }

/* Purchase/Bottom bar */
.buybar {
  flex: none;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--white);
}
.buybar .btn { flex: 1 1 auto; width: auto; }
.buybar .price-blk { flex: none; display: flex; flex-direction: column; gap: 2px; text-align: right; }
.buybar .pb-top { display: flex; align-items: baseline; gap: 6px; }
.buybar .pb-now { font: 700 17px/22px var(--font); color: var(--green); white-space: nowrap; }
.buybar .pb-old { font: 500 12px/14px var(--font); color: var(--old); white-space: nowrap; }
.buybar .pb-sub { font: 500 12px/14px var(--font); color: var(--green); white-space: nowrap; }
.buybar .pb-sub.muted { color: var(--muted); }

/* ---------- 7. Screen: Results (PUR-05 / PUR-06 / PUR-10) ---------- */
.result-body { padding: 0 16px 16px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.badge { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.badge.ok { background: var(--green-subtle); }
.badge.err { background: var(--red-subtle); }
.badge svg { width: 44px; height: 44px; overflow: visible; }
.result-texts { display: flex; flex-direction: column; gap: 8px; text-align: center; width: 100%; }
.result-texts h1 { font: 700 18px/24px var(--font); color: var(--ink); }
.result-texts p { font: 400 14px/20px var(--font); color: var(--muted); }
.err-box {
  width: 100%; min-height: 40px;
  background: var(--red-subtle); color: var(--red);
  border-radius: var(--r-lg); padding: 12px;
  display: flex; align-items: center; gap: 8px;
  font: 500 14px/15px var(--font);
}
.result-actions { flex: none; display: flex; flex-direction: column; gap: 12px; padding: 16px 16px 0; background: var(--white); }

/* success badge animation */
.badge.ok.anim { animation: badgePop 560ms cubic-bezier(.34, 1.56, .64, 1) both; }
.badge.ok.anim .disc { transform-origin: 22px 22px; animation: discPop 480ms 120ms cubic-bezier(.34, 1.56, .64, 1) both; }
.badge.ok.anim .check { stroke-dasharray: 22; animation: draw 420ms 380ms var(--ease-out) both; }
.badge.err.anim { animation: badgePop 480ms cubic-bezier(.34, 1.56, .64, 1) both, shake 520ms 420ms both; }
.badge.err.shake { animation: shake 520ms both; }

/* staggered content */
.stagger > * { animation: fadeUp 520ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms + 140ms); }

/* ---------- 8. Screen: My Vouchers (PUR-07) ---------- */
.tabs { flex: none; position: relative; display: flex; height: 45px; border-bottom: 1px solid var(--border); }
.tab {
  flex: 1 1 0; height: 44px;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12px;
  color: var(--muted);
  transition: color 220ms;
}
.tab span { display: block; font: 500 16px/20px var(--font); transform: scale(.875) translateY(1px); transition: transform 260ms var(--ease-out); }
.tab.is-active { color: var(--brand); }
.tab.is-active span { transform: none; }
.tab-ind {
  position: absolute; right: 0; bottom: -1px;
  width: calc(100% / 3); height: 2px; background: var(--brand);
  transform: translateX(calc(var(--ti, 0) * -100%));
  transition: transform 320ms var(--ease-sheet);
}
.chips { flex: none; display: flex; gap: 8px; padding: 16px 16px 0; height: 45px; }
.chip {
  height: 29px; padding: 6px 16px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--white); color: var(--ink);
  font: 500 14px/15px var(--font);
  transition: background-color 220ms, color 220ms, border-color 220ms, transform 140ms var(--ease-out);
}
.chip:active { transform: scale(.95); }
.chip.is-on { background: var(--brand); border-color: var(--brand); color: var(--white); }
.vlist { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.vlist > * { animation: fadeUp 380ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 64px 32px 32px; }
.empty .e-icon { width: 80px; height: 80px; border-radius: 50%; background: var(--bg-subtle); color: var(--hint); display: grid; place-items: center; margin-bottom: 4px; }
.empty h2 { font: 700 17px/22px var(--font); color: var(--ink); }
.empty p { font: 400 14px/20px var(--font); color: var(--muted); }
.empty .btn { width: auto; padding: 0 24px; margin-top: 8px; }

/* Navigation/Tab Bar */
.tabbar { flex: none; height: 56px; display: flex; padding-top: 6px; background: var(--white); border-radius: 12px 12px 0 0; }
.tb-item { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--tab-icon); }
.tb-item span { font: 500 11px/13px var(--font); color: var(--hint); }
.tb-item.is-active { color: var(--tab-active); }
.tb-item.is-active span { color: var(--brand); }

/* ---------- 9. Screen: Voucher details (PUR-08) ---------- */
.vd-content { padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 16px; }
.vd-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.vd-head h2 { font: 700 15px/22px var(--font); color: var(--ink); }
.qr-card {
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: var(--white);
}
.uses-pill {
  height: 24px; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--r-full);
  background: var(--brand-subtle); color: var(--brand);
  font: 500 14px/15px var(--font);
}
.qr-box { position: relative; width: 166.4px; height: 166.4px; padding: 9.44px; background: var(--white); border-radius: 8px; overflow: hidden; }
.qr-box svg { width: 147.5px; height: 147.5px; display: block; }
.qr-box.tappable { cursor: pointer; }
.qr-box .scanline {
  position: absolute; left: 0; right: 0; top: 0; height: 36px;
  background: linear-gradient(to bottom, rgba(114, 9, 183, 0), rgba(114, 9, 183, .22) 85%, rgba(114, 9, 183, .9) 100%);
  opacity: 0; transform: translateY(-40px);
}
.qr-box.scanning .scanline { animation: scan 900ms var(--ease-out) forwards; }
.qr-box.is-dim svg { opacity: .15; }
.qr-box .qr-stamp {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 17px/22px var(--font); color: var(--hint);
}
.code-row { display: flex; align-items: center; gap: 8px; height: 24px; }
.code-row .code { font: 700 18px/24px var(--font); color: var(--brand); direction: ltr; unicode-bidi: isolate; }
.copy-btn { position: relative; width: 20px; height: 20px; color: var(--brand); }
.copy-btn .ic { position: absolute; inset: 0; transition: opacity 200ms, transform 240ms var(--ease-out); }
.copy-btn .ok { opacity: 0; transform: scale(.4); color: var(--green); }
.copy-btn.done .cp { opacity: 0; transform: scale(.4); }
.copy-btn.done .ok { opacity: 1; transform: scale(1); }
.qr-hint { font: 500 14px/15px var(--font); color: var(--muted); text-align: center; max-width: 294px; }
.vd-actions { flex: none; padding: 12px 16px 0; background: var(--white); }

/* Brand/Orood Logo (horizontal) — mask so one SVG serves white (splash) and purple (header) */
.logo-full {
  display: block; flex: none;
  background-color: currentColor;
  -webkit-mask: url('assets/icons/orood-logo-full.svg') center / contain no-repeat;
          mask: url('assets/icons/orood-logo-full.svg') center / contain no-repeat;
}

/* ---------- 9b. Screen: Splash (AUT-01) ---------- */
.scr-splash { background: transparent; }
.splash-bg { position: absolute; inset: 0; background: var(--brand); }
.splash-glow {
  position: absolute; left: 50%; top: 50%;
  width: 420px; height: 420px; margin: -210px 0 0 -210px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0));
  opacity: 0; pointer-events: none;
  animation: splashGlow 1600ms 120ms var(--ease-out) both;
}
.splash-logo {
  position: absolute; left: 50%; top: 50%;          /* 217.8×52 centred → x71.1, y374 */
  width: 217.8px; height: 52px;
  transform: translate(-50%, -50%);
  transform-origin: center;
}
.splash-logo .logo-full {
  width: 100%; height: 100%;
  color: var(--white);
  background-image: linear-gradient(105deg, rgba(255, 255, 255, 0) 38%, rgba(222, 186, 255, .95) 50%, rgba(255, 255, 255, 0) 62%);
  background-size: 260% 100%; background-repeat: no-repeat; background-position: 130% 0;
  animation: logoIn 900ms 120ms cubic-bezier(.2, .8, .2, 1) both, logoShimmer 950ms 620ms ease-in-out both;
}
.splash-tap { position: absolute; inset: 0; z-index: 1; cursor: pointer; }
.still .splash-glow { opacity: 0; }
.still .splash-logo .logo-full { background-image: none; }

/* ---------- 9c. Screen: Offers Home (OFR-01) ---------- */
/* Navigation/Header type=main-screens: status bar 44 + gap 14 + 44 row = 102 */
.home-header {
  flex: none; height: 58px;
  padding: 14px 16px 0;
  display: flex; align-items: center;
  background: var(--white);
}
.home-header .logo-full { width: 108.9px; height: 26px; color: var(--brand); }
.home-content { display: flex; flex-direction: column; gap: 24px; padding: 21px 0 24px; }
.sec { display: flex; flex-direction: column; gap: 12px; }

/* Layout/Section Header */
.sec-head { height: 22px; margin: 0 16px; display: flex; align-items: center; justify-content: space-between; }
.sec-head h2 { font: 700 17px/22px var(--font); color: var(--ink); }
.sec-head .link { font: 500 15px/20px var(--font); color: var(--brand); }
.sec-head .link:active { opacity: .6; }

/* Horizontal carousels (RTL: first card on the right) */
.carousel {
  display: flex; gap: 16px;
  padding: 0 16px;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-padding-inline: 16px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  user-select: none; -webkit-user-select: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel > * { flex: none; scroll-snap-align: start; }
.carousel.flash { padding-bottom: 24px; margin-bottom: -24px; } /* room for the card shadow */
.carousel.cats { gap: 8px; }
.carousel.dragging { scroll-snap-type: none; cursor: grabbing; }

/* Card/Offer (large + small) */
.ocard {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start;
  text-align: right; cursor: pointer;
  transition: transform 140ms var(--ease-out);
}
.ocard:active:not(:has(.fav-btn:active)) { transform: scale(.97); }
.oc-media { position: relative; overflow: hidden; flex: none; background: var(--n100); }
.oc-media img { position: absolute; max-width: none; }
.fav-btn {
  position: absolute; left: 8px; top: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--n800);
}
.fav-btn:active { transform: scale(.92); }
.oc-tag { position: absolute; left: 8px; bottom: 8px; padding: 4px; }
.oc-text { display: flex; flex-direction: column; }
.oc-row { display: flex; align-items: center; justify-content: space-between; height: 22px; }
.oc-shop { color: var(--ink); white-space: nowrap; }
.likes { display: inline-flex; align-items: center; gap: 2px; font: 500 12px/14px var(--font); color: var(--muted); }
.likes .ic { color: var(--likes); }
.oc-desc {
  color: var(--muted); letter-spacing: -.41px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.ocard .price-row { margin-top: auto; }

/* size=large 242×283 — no fill/stroke, soft shadow */
.ocard.lg { width: 242px; height: 283px; padding: 1px 1px 14px 0; box-shadow: var(--card-shadow); }
.ocard.lg .oc-media { width: 240px; height: 148px; border-radius: var(--r-sm); }
.ocard.lg .oc-media img { width: 248px; height: 184px; left: -4px; top: -13px; }
.ocard.lg .oc-text { width: 222px; margin: 9px 9px 0 0; gap: 7px; }
.ocard.lg .oc-row { padding-bottom: 1px; }
.ocard.lg .oc-shop { font: 700 17px/22px var(--font); }
.ocard.lg .oc-desc { font: 500 16px/22px var(--font); height: 44px; }
.ocard.lg .price-row { margin-right: 9px; }

/* size=small 156×223 — white, #f3f4f5 stroke */
.ocard.sm { width: 156px; height: 223px; padding-bottom: 10px; background: var(--white); border: 1px solid var(--n100); border-radius: var(--r-sm); }
.ocard.sm .oc-media { width: 154px; height: 103px; border-radius: 3px; }
.ocard.sm .oc-media img { width: 159.1px; height: 128.1px; left: -2.6px; top: -9px; }
.ocard.sm .oc-text { width: 140px; margin: 10px 7px 0 0; gap: 4px; }
.ocard.sm .oc-shop { font: 700 15px/22px var(--font); }
.ocard.sm .oc-desc { font: 500 12px/22px var(--font); height: 44px; }
.ocard.sm .price-row { margin-right: 7px; }
.price-row.sm { height: 18px; }
.price-row.sm .big { font: 500 18px/18px var(--font); }
.price-row.sm .unit, .price-row.sm .instead { font: 500 12px/14px var(--font); }

/* Offers grid: 2 × 156, 16 gaps */
.ogrid { display: grid; grid-template-columns: repeat(2, 156px); gap: 16px; padding: 0 16px; }

/* Card/Category 156×167 */
.ccard {
  width: 156px; height: 167px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 11px;
  background: var(--white); border: 1px solid var(--n100); border-radius: var(--r-sm);
  text-align: right;
  transition: transform 140ms var(--ease-out);
}
.ccard:active { transform: scale(.97); }
.cc-media { position: relative; display: block; width: 154px; height: 103px; border-radius: 3px; overflow: hidden; background: var(--n100); }
.cc-media img { width: 100%; height: 100%; object-fit: cover; }
.cc-content { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-right: 7px; }
.cc-row { display: flex; align-items: center; gap: 4px; height: 18px; }
.cc-row .ic { color: var(--brand); }
.cc-title { font: 700 15px/18px var(--font); color: var(--n800); white-space: nowrap; }
.cc-details { display: flex; align-items: center; gap: 8px; font: 500 14px/14px var(--font); letter-spacing: -.41px; color: var(--muted); white-space: nowrap; }
.cc-details .sep { color: var(--old); }

/* ---------- 10. Overlays: scrim, sheets, dialog, toast ---------- */
.scrim {
  position: absolute; inset: 0; z-index: 10;
  background: var(--scrim);
  opacity: 0; pointer-events: none;
  transition: opacity 320ms ease;
}
.scrim.is-on { opacity: 1; pointer-events: auto; }

.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 11;
  max-height: calc(100% - var(--sb) - 12px);
  display: flex; flex-direction: column;
  background: var(--white);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  transform: translateY(105%);
  transition: transform var(--d-sheet) var(--ease-sheet);
  will-change: transform;
  visibility: hidden;
}
.sheet.is-open { transform: translateY(0); visibility: visible; }
.sheet.is-closing { visibility: visible; }
.sheet.dragging { transition: none; }
.sheet-grab { flex: none; padding: 8px 16px 0; touch-action: none; cursor: grab; }
.sheet-handle { width: 40px; height: 4px; border-radius: var(--r-full); background: var(--border-strong); margin: 0 auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; height: 24px; margin-top: 16px; }
.sheet-head h2 { font: 700 17px/22px var(--font); color: var(--ink); }
.sheet-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none;
  padding: 16px 16px calc(16px + var(--hi));
  display: flex; flex-direction: column; gap: 16px;
}
.sheet-body::-webkit-scrollbar { display: none; }
@media (max-width: 500px) { .sheet-body { padding-bottom: calc(16px + max(var(--hi), 8px)); } }

/* Checkout (PUR-03) */
#sheet-checkout { min-height: 462px; }
.co-item { display: flex; align-items: center; gap: 12px; }
.co-thumb { width: 56px; height: 56px; border-radius: var(--r-md); object-fit: cover; flex: none; }
.co-texts { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.co-name { font: 500 16px/20px var(--font); color: var(--ink); }
.co-unit { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; height: 15px; }
.co-unit .u { font: 500 14px/15px var(--font); color: var(--green); }
.co-unit .o { font: 500 12px/14px var(--font); color: var(--old); }
.stepper {
  flex: none; width: 110px; height: 42px;
  display: flex; align-items: center; gap: 4px;
  padding: 4px; border: 1px solid var(--border); border-radius: var(--r-lg);
}
.stepper button {
  width: 32px; height: 32px; border-radius: var(--r-md);
  background: var(--n100); color: var(--ink);
  display: grid; place-items: center;
  transition: transform 120ms var(--ease-out), opacity 200ms;
}
.stepper button:active { transform: scale(.88); }
.stepper button:disabled { opacity: .4; pointer-events: none; }
.stepper button.at-limit { opacity: .4; }
.stepper .val { width: 28px; text-align: center; font: 500 16px/20px var(--font); color: var(--ink); overflow: hidden; }
.co-limit { font: 500 12px/14px var(--font); color: var(--hint); }
.co-limit.flash { animation: flashText 700ms ease; }
.co-qty { display: flex; align-items: center; gap: 8px; }
.co-qty .co-limit { flex: 1 1 auto; min-width: 0; white-space: nowrap; }
.summary { display: flex; flex-direction: column; gap: 12px; }
.sum-row { display: flex; align-items: center; justify-content: space-between; font: 500 14px/14px var(--font); }
.sum-row .k { color: var(--muted); }
.sum-row .v { color: var(--ink); }
.sum-row .v.green { color: var(--green); }
.sum-total { display: flex; align-items: center; justify-content: space-between; font: 700 15px/22px var(--font); color: var(--ink); }
.sum-note { font: 500 12px/14px var(--font); color: var(--hint); }
.co-terms { font: 500 12px/14px var(--font); color: var(--hint); text-align: center; }
.num { display: inline-block; }
.num.bump { animation: numBump 320ms var(--ease-out); }

/* List/Payment Method */
.pm {
  width: 100%; height: 62px;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--border);
  text-align: right;
  transition: background-color 240ms, box-shadow 240ms, transform 140ms var(--ease-out);
}
button.pm:active { transform: scale(.985); }
.pm.is-on { background: var(--brand-subtle); box-shadow: inset 0 0 0 1.5px var(--brand); }
.pm-logo {
  flex: none; width: 44px; height: 28px; border-radius: var(--r-sm);
  border: 1px solid var(--border);
  display: grid; place-items: center; overflow: hidden;
  font: 500 12px/12px -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  direction: ltr;
}
.pm-logo img { width: 100%; height: 100%; object-fit: contain; }
.pm-logo.apple { background: #000; color: #fff; }
.pm-logo.mada { background: #fff; color: var(--ink); font-weight: 600; }
.pm-logo.card { background: var(--n100); color: var(--muted); }
.pm-logo.stc { background: var(--stc); color: #fff; font-weight: 600; border-color: var(--stc); }
.pm-texts { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pm-title { font: 500 16px/20px var(--font); color: var(--ink); }
.pm-detail { font: 500 12px/14px var(--font); color: var(--muted); }
.radio {
  position: relative; flex: none; width: 20px; height: 20px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--border-strong);
  background: var(--white);
  transition: box-shadow 200ms;
}
.radio::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--brand);
  transform: scale(0); transition: transform 260ms cubic-bezier(.34, 1.56, .64, 1);
}
.radio::after {
  content: ""; position: absolute; left: 6px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--white);
  transform: scale(0); transition: transform 240ms 80ms cubic-bezier(.34, 1.56, .64, 1);
}
.pm.is-on .radio { box-shadow: inset 0 0 0 1.5px var(--brand); }
.pm.is-on .radio::before, .pm.is-on .radio::after { transform: scale(1); }
.pm-list { display: flex; flex-direction: column; gap: 8px; }
.add-card {
  width: 100%; height: 54px;
  display: flex; align-items: center; gap: 8px; padding: 16px;
  border-radius: var(--r-lg);
  color: var(--brand); font: 500 16px/20px var(--font);
  position: relative;
}
.add-card:active { transform: scale(.985); }
.add-card .dash { position: absolute; inset: .5px; width: calc(100% - 1px); height: calc(100% - 1px); overflow: visible; pointer-events: none; }
.add-card .dash rect { fill: none; stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 4 4; }
.secure { display: flex; align-items: center; gap: 6px; height: 16px; font: 500 12px/14px var(--font); color: var(--muted); }
.secure .ic { color: var(--green); }

/* Dialog (PUR-09) */
.dialog-wrap {
  position: absolute; inset: 0; z-index: 12;
  display: grid; place-items: center; padding: 16px;
  pointer-events: none;
}
.dialog {
  width: 100%; max-width: 328px;
  background: var(--white); border-radius: var(--r-sheet);
  padding: 24px 16px;
  display: flex; flex-direction: column; gap: 24px;
  opacity: 0; transform: scale(.92);
  transition: opacity 220ms ease, transform 320ms cubic-bezier(.34, 1.4, .64, 1);
}
.dialog-wrap.is-open { pointer-events: auto; }
.dialog-wrap.is-open .dialog { opacity: 1; transform: scale(1); }
.dlg-content { display: flex; flex-direction: column; gap: 20px; text-align: center; }
.dlg-content h2 { font: 700 18px/24px var(--font); color: var(--ink); }
.dlg-content p { font: 500 16px/21px var(--font); color: var(--ink); }
.dlg-actions { display: flex; flex-direction: column; gap: 24px; }

/* Toast */
.toast {
  position: absolute; left: 50%; bottom: calc(var(--hi) + 92px); z-index: 30;
  max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-radius: var(--r-lg);
  background: rgba(12, 33, 44, .94); color: var(--white);
  font: 500 14px/18px var(--font);
  white-space: nowrap;
  opacity: 0; transform: translate(-50%, 16px) scale(.96);
  transition: opacity 220ms ease, transform 360ms var(--ease-sheet);
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast .ic { color: #8fd86f; }

/* ---------- 11. Prototype menu (not part of the design) ---------- */
.proto-panel {
  flex: none; width: 260px;
  max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--white); border-radius: 20px;
  box-shadow: 0 12px 40px -16px rgba(12, 33, 44, .25), 0 0 0 1px rgba(12, 33, 44, .05);
  padding: 18px 14px 14px;
  font: 500 14px/18px var(--font);
}
.pp-title { font: 700 15px/20px var(--font); padding: 0 6px; }
.pp-sub { font: 400 12px/16px var(--font); color: var(--muted); padding: 2px 6px 10px; }
.pp-list { display: flex; flex-direction: column; gap: 2px; }
.pp-group { font: 700 11px/14px var(--font); color: var(--hint); padding: 10px 6px 4px; }
.pp-group:first-of-type { padding-top: 4px; }
.pp-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 6px; border-radius: 10px; text-align: right;
  transition: background-color 160ms;
}
.pp-item:hover { background: var(--bg-subtle); }
.pp-item.is-on { background: var(--brand-subtle); color: var(--brand); }
.pp-item code { font: 600 11px/14px ui-monospace, Menlo, Consolas, monospace; color: var(--hint); direction: ltr; min-width: 46px; }
.pp-item.is-on code { color: var(--brand); }
.pp-sep { height: 1px; background: var(--border); margin: 10px 0; }
.pp-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px; cursor: pointer; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 99px; background: var(--border-strong); flex: none; transition: background-color 200ms; }
.switch::after { content: ""; position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform 240ms var(--ease-out); }
.pp-toggle.is-on .switch { background: var(--brand); }
.pp-toggle.is-on .switch::after { transform: translateX(-16px); }
.pp-reset { width: 100%; margin-top: 6px; padding: 9px; border-radius: 10px; background: var(--n100); font: 500 14px/18px var(--font); }
.pp-reset:active { transform: scale(.98); }
.pp-tips { font: 400 12px/17px var(--font); color: var(--muted); padding: 10px 6px 0; }
.pp-tips b { color: var(--ink); font-weight: 500; }
.proto-fab { display: none; }

@media (max-width: 500px) {
  .proto-fab {
    display: flex; align-items: center; gap: 4px;
    position: fixed; left: 0; top: calc(env(safe-area-inset-top, 0px) + 150px); z-index: 100;
    width: 18px; height: 44px; padding: 0; justify-content: center;
    border-radius: 0 10px 10px 0;
    font-size: 11px;
    background: rgba(12, 33, 44, .55); color: #fff;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    font: 500 12px/14px var(--font);
    opacity: .75;
  }
  .proto-fab .lbl { display: none; }
  .proto-panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 101;
    width: auto; max-height: 82dvh;
    border-radius: 20px 20px 0 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateY(105%);
    transition: transform var(--d-sheet) var(--ease-sheet);
  }
  .proto-panel.is-open { transform: none; }
  .proto-scrim { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: opacity 300ms; }
  .proto-scrim.is-on { opacity: 1; pointer-events: auto; }
}
@media (min-width: 501px) and (max-width: 720px) { .proto-panel { display: none; } .proto-fab { display: flex; position: fixed; left: 12px; bottom: 12px; padding: 8px 14px; border-radius: 99px; background: rgba(12,33,44,.7); color: #fff; font: 500 13px/16px var(--font); z-index: 100; } }

/* ---------- 12. Keyframes ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes badgePop { 0% { opacity: 0; transform: scale(.5); } 100% { opacity: 1; transform: scale(1); } }
@keyframes discPop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes draw { from { stroke-dashoffset: 22; } to { stroke-dashoffset: 0; } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-8px); } 30% { transform: translateX(7px); }
  45% { transform: translateX(-5px); } 60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); } 90% { transform: translateX(1px); }
}
@keyframes heartPop { 0% { transform: scale(1); } 35% { transform: scale(1.28); } 65% { transform: scale(.92); } 100% { transform: scale(1); } }
@keyframes numBump { 0% { transform: translateY(45%); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes scan { 0% { opacity: 0; transform: translateY(-40px); } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(166px); } }
@keyframes logoIn { 0% { opacity: 0; transform: scale(.84); filter: blur(8px); } 60% { opacity: 1; filter: blur(0); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes logoShimmer { from { background-position: 130% 0; } to { background-position: -30% 0; } }
@keyframes splashGlow { 0% { opacity: 0; transform: scale(.6); } 55% { opacity: 1; } 100% { opacity: .55; transform: scale(1); } }
@keyframes flashText { 0%, 100% { color: var(--hint); } 30% { color: var(--red); } }

/* ---------- 13. Reduced motion ---------- */
/* ?still in the URL freezes all motion (for design QA screenshots) */
.still *, .still *::before, .still *::after { animation: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
  .btn.is-loading .spinner { animation: spin .8s linear infinite !important; animation-iteration-count: infinite !important; }
}
