/* ===================================================================
   CODEX — design tokens
=================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500;600&family=Noto+Sans+Arabic:wght@400;500;600;700;800&display=swap');

:root{
  color-scheme: dark;

  /* surfaces */
  --bg: #06070c;
  --bg-1: #0a0c15;
  --bg-2: #0d0f1a;
  --surface: rgba(255,255,255,0.045);
  --surface-hover: rgba(255,255,255,0.075);
  --surface-solid: #12141f;
  --border: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.18);

  /* text */
  --fg: #f5f5f8;
  --fg-muted: #9a9db0;
  --fg-faint: #62667a;

  /* brand */
  --primary: #6d6afb;
  --primary-2: #9b6df0;
  --gradient: linear-gradient(135deg, var(--primary), var(--primary-2));
  --gradient-soft: linear-gradient(135deg, rgba(109,106,251,.16), rgba(155,109,240,.10));
  /* IQD price: champagne fading to rose-gold — the premium accent, used only for Iraqi-dinar prices */
  --iqd: #e8b8a0;
  --gradient-iqd: linear-gradient(120deg, #f4d3a8 0%, #e9b49a 48%, #dc9db0 100%);
  --ring: rgba(109,106,251,.55);

  /* status */
  --success: #22c55e;
  --success-bg: rgba(34,197,94,.12);
  --warning: #f5a524;
  --warning-bg: rgba(245,165,36,.12);
  --danger: #f0455c;
  --danger-bg: rgba(240,69,92,.12);
  --info: #38bdf8;

  /* radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* motion */
  --ease: cubic-bezier(.16,1,.3,1);
  --fast: 160ms;
  --med: 280ms;
  --slow: 460ms;

  /* type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* layout */
  --header-h: 60px;
  --dock-h: 66px;
  --dock-clearance: 108px;
  --container: 1240px;

  --shadow-1: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 30px -14px rgba(0,0,0,.6);
  --shadow-glow: 0 0 0 1px rgba(255,255,255,.06), 0 24px 70px -24px rgba(109,106,251,.45);
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ===================================================================
   Reset
=================================================================== */
*, *::before, *::after{ box-sizing: border-box; }
html, body{ height: 100%; }
html{ -webkit-text-size-adjust: 100%; }
body{
  margin:0;
  background: radial-gradient(120% 70% at 50% -10%, rgba(109,106,251,.14), transparent 60%), var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
img{ max-width:100%; display:block; }
a{ color: inherit; text-decoration: none; }
button, input, textarea, select{ font: inherit; color: inherit; }
button{ cursor: pointer; background: none; border: none; appearance: none; -webkit-appearance: none; padding: 0; text-align: inherit; }
ul{ list-style: none; margin:0; padding:0; }
h1,h2,h3,h4,p{ margin:0; }
svg{ display:block; flex-shrink:0; width:20px; height:20px; }
.i{ display:inline-flex; align-items:center; justify-content:center; }

/* icon sizing per context (beats the generic default above via specificity) */
.btn svg{ width:16px; height:16px; }
.icon-btn svg{ width:18px; height:18px; }
.icon-wrap svg{ width:24px; height:24px; }
.app-card-cta svg{ width:14px; height:14px; }
.detail-list li svg{ width:16px; height:16px; }
.buy-meta svg{ width:16px; height:16px; }
.vote-btn svg{ width:14px; height:14px; }
.toast svg{ width:18px; height:18px; }
.chip-tag button svg, .shot-thumb button svg{ width:11px; height:11px; }
.pm-icon svg{ width:19px; height:19px; }
.reminder-icon svg{ width:17px; height:17px; }

::selection{ background: var(--primary); color:#fff; }

:focus-visible{ outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* scrollbar */
::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.12); border-radius: 8px; border:2px solid transparent; background-clip: padding-box;}

.container{ max-width: var(--container); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px){ .container{ padding: 0 16px; } }

.serif{ font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.mono{ font-family: var(--font-mono); }

/* ===================================================================
   Header + collapsible search  (matches the Codex app's own header)
=================================================================== */
.site-header{
  position: sticky; top:0; z-index: 40;
  height: calc(var(--header-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); box-sizing: border-box;
  display:flex; align-items:center;
  background: rgba(10,12,20,.72);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom-left-radius:20px; border-bottom-right-radius:20px;
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 18px 40px -24px rgba(0,0,0,.65);
  overflow: visible;
}
.header-inner{ position:relative; z-index:1; display:flex; align-items:center; gap:10px; width:100%; max-width:960px; margin:0 auto; padding:0 16px; }
.brand{ display:flex; align-items:center; height:100%; max-height: var(--header-h); overflow:hidden; flex-shrink:0; }
.brand img{ height:22px; width:65px; object-fit:contain; object-position:left center; display:block; flex-shrink:0; }
[dir="rtl"] .brand img{ object-position:right center; }
.header-spacer{ flex:1; }
.icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:40px; height:40px; border-radius: var(--r-pill);
  background: var(--surface); border:1px solid var(--border); color: var(--fg-muted);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.icon-btn:hover{ background: var(--surface-hover); color: var(--fg); border-color: var(--border-strong); }
.header-inner .icon-btn, .sheet-head .icon-btn{ width:34px; height:34px; }
.header-inner .icon-btn svg, .sheet-head .icon-btn svg{ width:16px; height:16px; }
.avatar-btn{
  width:34px; height:34px; border-radius: var(--r-pill); background: var(--surface); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
  font-weight:700; font-size:12.5px; color: var(--fg-muted); overflow:hidden; text-align:center;
}
.avatar-btn.signed-in{ background: var(--gradient); color:#fff; border-color:transparent; }

.search-expand{
  position:absolute; top: env(safe-area-inset-top); right:0; bottom:0; left:0; z-index:2;
  display:flex; align-items:center; gap:10px; padding: 0 max(12px, calc((100vw - 960px) / 2 + 16px));
  background: rgba(8,9,16,.55); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom-left-radius:20px; border-bottom-right-radius:20px;
  transform: translateY(-6px) scale(.99); opacity:0; pointer-events:none;
  transition: transform var(--med) var(--ease), opacity var(--fast) var(--ease);
}
.search-expand.open{ transform: translateY(0) scale(1); opacity:1; pointer-events:auto; }
.search-back{ width:32px; height:32px; border-radius: var(--r-pill); display:flex; align-items:center; justify-content:center; flex-shrink:0; color: var(--fg-muted); }
.search-back svg{ width:17px; height:17px; stroke:currentColor; fill:none; stroke-width:1.8; }
[dir="rtl"] .search-back svg{ transform: scaleX(-1); }
.search-pill{
  flex:1; min-width:0; height:38px; display:flex; align-items:center; gap:9px;
  background: rgba(255,255,255,.09); border:1px solid rgba(255,255,255,.16); border-radius:999px; padding:0 15px;
  box-shadow: 0 8px 20px -10px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.07);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) var(--ease);
}
.search-pill:focus-within{ background: rgba(255,255,255,.12); border-color: rgba(109,106,251,.65); box-shadow: 0 0 0 3px rgba(109,106,251,.16), inset 0 1px 0 rgba(255,255,255,.07); }
.search-pill svg.s-icon{ width:14px; height:14px; stroke: var(--fg-faint); flex-shrink:0; }
.search-pill input{ flex:1; min-width:0; outline:none; border:none; font-size:13.5px; font-weight:500; letter-spacing:-.01em; color: var(--fg); background:none; }
.search-pill input::placeholder{ color: var(--fg-faint); font-weight:400; }
.search-clear{ width:22px; height:22px; border-radius: var(--r-pill); display:flex; align-items:center; justify-content:center; flex-shrink:0; color: var(--fg-faint); background: var(--surface-hover); }
.search-clear svg{ width:11px; height:11px; stroke:currentColor; fill:none; stroke-width:2.4; }
.search-panel{
  position:absolute; left:0; right:0; margin:0 auto; width: calc(100% - 24px); max-width:560px; top: calc(100% + 8px); z-index:39;
  background: var(--surface-solid); border:1px solid var(--border-strong); border-radius: var(--r-lg);
  box-shadow: 0 30px 60px -18px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04) inset;
  transform: translateY(-6px) scale(.98); opacity:0; pointer-events:none;
  transition: transform var(--med) var(--ease), opacity var(--fast) var(--ease); overflow:hidden; transform-origin: top center;
}
.search-panel.open{ transform: translateY(0) scale(1); opacity:1; pointer-events:auto; }
.search-panel-scroll{ max-height:min(58vh,400px); overflow-y:auto; padding:8px; }
.search-panel-label{ font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color: var(--fg-faint); padding:8px 10px 6px; }
.search-result{ display:flex; width:100%; align-items:center; gap:11px; padding:9px 10px; border-radius: var(--r-md); text-align:start; transition: background var(--fast) var(--ease); }
.search-result:hover, .search-result:active{ background: var(--surface-hover); }
.search-result .ic{ width:34px; height:34px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; overflow:hidden; }
.search-result .ic svg{ width:16px; height:16px; fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.search-result .info{ flex:1; min-width:0; }
.search-result h4{ font-size:13px; font-weight:600; }
.search-result p{ font-size:11px; color: var(--fg-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:1px; }
.search-result .go{ width:13px; height:13px; stroke: var(--fg-faint); fill:none; stroke-width:2; flex-shrink:0; }
[dir="rtl"] .search-result .go{ transform: scaleX(-1); }
.search-empty{ padding:30px 16px; text-align:center; color: var(--fg-muted); font-size:12.8px; }

/* ===================================================================
   Buttons
=================================================================== */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border-radius: var(--r-pill); border:1px solid transparent;
  padding: 12px 22px; font-size:14.5px; font-weight:600; letter-spacing: -.01em;
  transition: transform var(--fast) var(--ease), background var(--fast) var(--ease), border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), opacity var(--fast) var(--ease);
  white-space: nowrap; min-height:44px;
}
.btn:active{ transform: scale(.97); }
.btn.block{ width:100%; }
.btn.sm{ padding:9px 16px; font-size:13.5px; min-height:36px; }
.btn-primary{ background: var(--gradient); color:#fff; box-shadow: 0 8px 24px -8px rgba(109,106,251,.6); }
.btn-primary:hover{ box-shadow: 0 10px 30px -6px rgba(109,106,251,.75); }
.btn-secondary{ background: var(--surface); border-color: var(--border); color: var(--fg); }
.btn-secondary:hover{ background: var(--surface-hover); border-color: var(--border-strong); }
.btn-ghost{ background: transparent; color: var(--fg-muted); }
.btn-ghost:hover{ color: var(--fg); background: var(--surface); }
.btn-danger{ background: var(--danger-bg); color:#ff8b98; border-color: rgba(240,69,92,.3); }
.btn-danger:hover{ background: rgba(240,69,92,.2); }
.btn[disabled]{ opacity:.45; cursor:not-allowed; transform:none !important; }

/* ===================================================================
   Tags / badges / pills
=================================================================== */
.tag{
  display:inline-flex; align-items:center; gap:6px;
  font-size:12px; font-weight:600; letter-spacing:.01em;
  padding:5px 11px; border-radius: var(--r-pill);
  background: var(--surface); border:1px solid var(--border); color: var(--fg-muted);
}
.price-pill{
  display:inline-flex; align-items:baseline; gap:4px;
  background: rgba(6,7,12,.65); backdrop-filter: blur(8px);
  border:1px solid var(--border-strong); color:#fff;
  padding:6px 12px; border-radius: var(--r-pill); font-weight:700; font-size:14px;
}
.price-pill small{ font-weight:600; font-size:11px; color: var(--fg-muted); }
.status-pill{ display:inline-flex; align-items:center; gap:6px; padding:4px 11px; border-radius:var(--r-pill); font-size:12px; font-weight:700; }
.status-pill::before{ content:''; width:6px; height:6px; border-radius:50%; background:currentColor; }
.status-pending{ background: var(--warning-bg); color: var(--warning); }
.status-paid{ background: var(--success-bg); color: var(--success); }
.status-draft{ background: var(--surface); color: var(--fg-muted); }
.status-published{ background: var(--success-bg); color: var(--success); }
.status-declined{ background: var(--danger-bg); color:#ff8b98; }

/* ===================================================================
   Layout / views
=================================================================== */
.view{ display:none; min-height: calc(100vh - var(--header-h)); padding-bottom: var(--dock-clearance); }
.view.active{ display:block; }
.page-pad{ padding-top: 40px; }

.eyebrow{ font-family: var(--font-mono); font-size:12px; letter-spacing:.14em; text-transform:uppercase; color: var(--primary-2); font-weight:600; }
.section-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:26px; flex-wrap:wrap; }
.section-head h2{ font-size: clamp(22px,3vw,30px); letter-spacing:-.02em; margin-top:8px; }
.section-head p{ color: var(--fg-muted); margin-top:6px; max-width:56ch; }

/* ===================================================================
   Store — hero, top rated, chips, app cards  (same structure and values as the Codex app)
=================================================================== */
.pad{ max-width:960px; margin:0 auto; padding:16px; }
#view-settings .pad{ max-width:560px; }
.pad .eyebrow{ display:block; font-family: var(--font-sans); font-size:11px; font-weight:700; letter-spacing:.09em; text-transform:uppercase; color: var(--primary-2); margin-bottom:4px; }
.pad .section-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:12px; flex-wrap:nowrap; }
.pad .section-head h2{ font-size:19px; letter-spacing:-.01em; margin-top:0; }
.pad .section-head h2.serif{ font-size:21px; }
.pad .section-head p{ color: var(--fg-muted); font-size:12.8px; margin-top:4px; max-width:none; }
.view.active{ animation: viewfade .22s var(--ease); }
@keyframes viewfade{ from{ opacity:0; transform: translateY(8px); } to{ opacity:1; transform: translateY(0); } }

.store-hero{ padding:6px 0 28px; text-align:center; }
.hero-scatter{ display:flex; justify-content:center; align-items:flex-end; gap:10px; margin-bottom:22px; }
.hero-scatter .ic{ width:38px; height:38px; border-radius:12px; display:flex; align-items:center; justify-content:center; box-shadow: 0 10px 20px -8px rgba(0,0,0,.55); flex-shrink:0; overflow:hidden; }
.hero-scatter .ic svg{ width:17px; height:17px; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; stroke:#fff; }
.hero-scatter .ic:nth-child(2){ width:44px; height:44px; transform: translateY(-5px); }
.hero-scatter .ic:nth-child(3){ width:48px; height:48px; transform: translateY(-9px); }
.hero-scatter .ic:nth-child(3) svg{ width:21px; height:21px; }
.hero-scatter .ic:nth-child(4){ width:44px; height:44px; transform: translateY(-5px); }
.store-hero h1{ font-size: clamp(29px, 4.6vw, 40px); line-height:1.18; margin:0 0 10px; letter-spacing:-.005em; font-weight:800; }
.store-hero p{ color: var(--fg-muted); font-size:13.5px; line-height:1.6; margin:0 auto; max-width:36ch; }
@media (min-width:640px){ .store-hero p{ font-size:14.5px; max-width:46ch; } }

.app-logo-img{ width:100%; height:100%; object-fit:cover; border-radius:inherit; display:block; }

.top-list{ display:flex; flex-direction:column; gap:8px; margin-bottom:28px; }
.rank-card{ display:flex; align-items:center; gap:12px; padding:11px 14px; border-radius: var(--r-lg); background: var(--surface); border:1px solid var(--border); text-align:start; width:100%; }
.rank-card .rank-num{ font-family: var(--font-serif); font-style:italic; font-size:19px; color: var(--fg-faint); width:18px; flex-shrink:0; text-align:center; }
.rank-card .ic{ width:38px; height:38px; border-radius:11px; display:flex; align-items:center; justify-content:center; flex-shrink:0; overflow:hidden; }
.rank-card .ic svg{ width:17px; height:17px; fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; stroke:#fff; }
.rank-card .nm{ font-weight:700; font-size:13.5px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media (hover:hover){ .rank-card:hover{ border-color: var(--border-strong); } }

.filter-row{ display:flex; gap:8px; overflow-x:auto; padding:0 0 4px; margin-bottom:14px; scrollbar-width:none; }
.filter-row::-webkit-scrollbar{ display:none; }
.filter-row .chip{ flex-shrink:0; padding:7px 15px; border-radius: var(--r-pill); background: var(--surface); border:1px solid var(--border); color: var(--fg-muted); font-size:12.8px; font-weight:600; white-space:nowrap; transition: background var(--fast) var(--ease), color var(--fast) var(--ease); }
.filter-row .chip.active{ background: var(--gradient); color:#fff; border-color:transparent; }

.grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap:12px; }
.app-card{
  display:block; width:100%; text-align:start; position:relative;
  background: var(--surface-solid); border:1px solid var(--border); border-radius: var(--r-lg); overflow:hidden;
  box-shadow: var(--shadow-1);
  transition: transform var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.app-card:active{ transform: scale(.985); border-color: var(--border-strong); }
@media (hover:hover){ .app-card:hover{ border-color: var(--border-strong); } }
/* the inner wrapper (not the button) takes the scroll-linked focus animation, so it never fights the tap feedback above */
.app-card-inner{ display:flex; gap:14px; padding:14px; align-items:stretch; transform-origin:center; will-change: filter, transform, opacity; }
@media (max-width:639px){
  .app-card.flip .app-card-media{ order:2; }
  .app-card.flip .app-card-body{ order:1; }
}
.app-card-media{ flex:0 0 92px; width:92px; position:relative; border-radius:14px; overflow:hidden; display:flex; align-items:center; justify-content:center; }
.app-card-media .banner-icon{ width:44px; height:44px; border-radius:13px; display:flex; align-items:center; justify-content:center; flex-shrink:0; box-shadow: 0 8px 20px -6px rgba(0,0,0,.4); }
.app-card-media .banner-icon svg{ width:22px; height:22px; fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; stroke:#fff; }
.app-card-body{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; justify-content:center; padding:0; gap:0; }
.cat-eyebrow{ display:inline-flex; align-items:center; gap:5px; font-family: var(--font-sans); font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; margin-bottom:6px; }
.cat-eyebrow::before{ content:''; width:6px; height:6px; border-radius:50%; background:currentColor; flex-shrink:0; }
.app-card-body h3{ font-size:15.5px; margin-bottom:3px; letter-spacing:-.01em; }
.app-card-body .tagline{ font-size:12.5px; color: var(--fg-muted); line-height:1.5; margin-bottom:10px; }
.app-card-tags{ display:flex; flex-wrap:wrap; gap:6px; margin-top:0; padding-top:0; }
.app-card-tags .tag{ font-size:11px; padding:4px 10px; }
.app-card-foot{ margin-top:12px; padding-top:11px; border-top:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; gap:10px; }
.app-card-foot .price-pill{ background:none; backdrop-filter:none; border:none; padding:0; color: var(--fg); display:inline-flex; align-items:baseline; gap:3px; }
/* IQD is the headline price — champagne / rose-gold gradient, distinct from every other colour on the page */
.app-card-foot .price-pill b, .buy-price b{ background: var(--gradient-iqd); -webkit-background-clip:text; background-clip:text; color:transparent; -webkit-text-fill-color:transparent; font-weight:800; letter-spacing:-.01em; }
.app-card-foot .price-pill b{ font-size:15.5px; }
.app-card-foot .price-pill b.usdt, .buy-price b.usdt{ background: var(--gradient); -webkit-background-clip:text; background-clip:text; }
#paymentOverlay{ z-index:100; }
.app-card-foot .price-pill small{ color: var(--fg-faint); margin-inline-start:1px; font-size:10px; font-weight:600; }
.app-card-cta{ display:flex; align-items:center; gap:4px; font-size:12.8px; font-weight:700; color: var(--primary-2); flex-shrink:0; margin-top:0; justify-content:flex-start; }
.app-card-cta svg{ width:14px; height:14px; transition: transform var(--fast) var(--ease); }
.app-card:active .app-card-cta svg{ transform: translateX(3px); }
[dir="rtl"] .app-card-cta svg{ transform: scaleX(-1); }
[dir="rtl"] .app-card:active .app-card-cta svg{ transform: scaleX(-1) translateX(3px); }
.price-pill.owned-pill{ background: rgba(34,197,94,.92); border:none; color:#fff; padding:5px 10px; border-radius: var(--r-pill); backdrop-filter:none; }
.price-pill.owned-pill svg{ width:11px; height:11px; stroke:#fff; fill:none; stroke-width:3; margin-inline-end:2px; vertical-align:-1px; }
.tag{ font-size:11px; padding:4px 10px; gap:5px; }

/* ===================================================================
   Cards / surfaces generic
=================================================================== */
.surface{ background: var(--surface-solid); border:1px solid var(--border); border-radius: var(--r-lg); }
.glass{ background: var(--surface); border:1px solid var(--border); border-radius: var(--r-lg); backdrop-filter: blur(14px); }

/* stat tile */
.stat-row{ display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:16px; }
.stat-tile{
  position:relative; padding:22px; overflow:hidden; border-radius: var(--r-xl);
  background: linear-gradient(155deg, rgba(255,255,255,.055), rgba(255,255,255,.015));
  backdrop-filter: blur(14px);
  transition: transform var(--fast) var(--ease), border-color var(--fast) var(--ease), box-shadow var(--med) var(--ease);
}
.stat-tile::before{
  content:''; position:absolute; top:-50%; right:-25%; width:150px; height:150px; border-radius:50%;
  background: var(--gradient-soft); filter:blur(34px); pointer-events:none; opacity:.8;
}
.stat-tile:hover{ transform:translateY(-3px); border-color: var(--border-strong); box-shadow: 0 16px 36px rgba(0,0,0,.4), 0 0 0 1px var(--ring) inset; }
.stat-tile.clickable{ cursor:pointer; }
.stat-tile.clickable:active{ transform:translateY(-1px); }
.stat-icon{
  position:relative; width:36px; height:36px; border-radius:11px; display:flex; align-items:center; justify-content:center;
  background: var(--gradient-soft); color: var(--primary-2); margin-bottom:16px;
}
.stat-icon svg{ width:18px; height:18px; stroke-width:2; }
.stat-icon.success{ background: var(--success-bg); color: var(--success); }
.stat-icon.warning{ background: var(--warning-bg); color: var(--warning); }
.stat-icon.danger{ background: var(--danger-bg); color: var(--danger); }
.stat-icon.info{ background: rgba(56,189,248,.12); color: var(--info); }
.stat-tile .stat-label{ position:relative; font-size:12.5px; color: var(--fg-muted); font-weight:600; letter-spacing:.01em; }
.stat-tile .stat-value{ position:relative; font-size:30px; font-weight:800; letter-spacing:-.02em; margin-top:6px; }
.stat-tile .stat-value.accent{ background: var(--gradient); -webkit-background-clip:text; background-clip:text; color:transparent; }
.stat-tile .stat-live-dot{ display:inline-block; width:7px; height:7px; border-radius:50%; background: var(--info); margin-right:7px; box-shadow:0 0 0 3px rgba(56,189,248,.18); animation: statPulse 1.8s ease-in-out infinite; }
@keyframes statPulse{ 0%,100%{ opacity:1; } 50%{ opacity:.4; } }

/* apps-sold-info modal */
.sold-apps-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:12px; margin-top:18px; }
.sold-app-card{ display:flex; flex-direction:column; align-items:center; gap:6px; padding:18px 10px; border-radius: var(--r-md); background: var(--surface); border:1px solid var(--border); text-align:center; }
.sold-app-logo{ width:42px; height:42px; border-radius:12px; object-fit:cover; background: var(--bg-2); }
.sold-app-logo-fallback{ display:flex; align-items:center; justify-content:center; color: var(--fg-faint); }
.sold-app-logo-fallback .i svg{ width:20px; height:20px; }
.sold-app-name{ font-size:13px; font-weight:700; line-height:1.3; }
.sold-app-count{ font-size:22px; font-weight:800; margin-top:2px; }
.sold-app-count-label{ font-size:11px; color: var(--fg-faint); }

/* APK/iOS Apps admin section */
.apk-app-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:14px; margin-top:16px; }
.apk-app-card{ padding:18px; border-radius: var(--r-md); background: var(--surface); border:1px solid var(--border); }
.apk-app-card .apk-app-name{ font-size:14.5px; font-weight:700; margin-bottom:12px; }
.apk-app-card .apk-app-row{ display:flex; justify-content:space-between; align-items:center; font-size:12.5px; color: var(--fg-muted); padding:5px 0; }
.apk-app-card .apk-app-row strong{ color: var(--fg); font-weight:700; }
.apk-app-card .apk-app-row.revenue strong{ color: var(--accent); }

/* ===================================================================
   Forms
=================================================================== */
.field{ display:flex; flex-direction:column; gap:7px; }
.field label{ font-size:13px; font-weight:600; color: var(--fg-muted); }
.field .hint{ font-size:12px; color: var(--fg-faint); }
.field .error{ font-size:12px; color: var(--danger); display:none; }
.field.invalid .error{ display:block; }
.field.invalid input, .field.invalid textarea, .field.invalid select{ border-color: var(--danger); }
.input, textarea.input, select.input{
  background: var(--bg-2); border:1px solid var(--border); border-radius: var(--r-sm);
  padding:12px 14px; color: var(--fg); font-size:14.5px; width:100%;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
  min-height:46px;
}
textarea.input{ min-height:110px; resize:vertical; line-height:1.5; }
.input:focus{ outline:none; border-color: var(--primary); background: var(--bg-1); }
.input::placeholder{ color: var(--fg-faint); }
select.input{ appearance:none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239a9db0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position: right 14px center; padding-right:38px; }
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media (max-width:560px){ .form-grid{ grid-template-columns:1fr; } }
.form-row{ display:flex; flex-direction:column; gap:18px; }

/* ===================================================================
   Tabs
=================================================================== */
.tabs{ display:flex; gap:4px; background: var(--surface); border:1px solid var(--border); padding:4px; border-radius: var(--r-pill); width:fit-content; max-width:100%; overflow-x:auto; }
.tab-btn{ padding:9px 17px; border-radius: var(--r-pill); font-size:13.5px; font-weight:600; color: var(--fg-muted); white-space:nowrap; transition: all var(--fast) var(--ease); }
.tab-btn.active{ background: var(--gradient); color:#fff; }
.tab-btn:not(.active):hover{ color: var(--fg); }

/* ===================================================================
   Bottom Dock Navigation  (4 items, sliding gradient highlight — same as the app)
=================================================================== */
.dock-wrap{ position:fixed; left:0; right:0; bottom:0; z-index:50; display:flex; justify-content:center; padding: 0 14px calc(14px + env(safe-area-inset-bottom)); pointer-events:none; }
.dock{
  position:relative; pointer-events:auto;
  display:flex; align-items:center; gap:2px;
  background: rgba(14,15,24,.82); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border:1px solid var(--border-strong); border-radius: var(--r-pill);
  padding:6px; box-shadow: 0 20px 50px -14px rgba(0,0,0,.65), 0 1px 0 rgba(255,255,255,.06) inset;
  width:100%; max-width:420px;
}
.dock-item{
  position:relative; z-index:1; flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  padding:9px 4px 8px; border-radius: var(--r-pill); color: rgba(255,255,255,.4); min-height:48px;
}
.dock-item svg{ width:20px; height:20px; transition: transform var(--fast) var(--ease); }
.dock-item span{ font-size:10px; font-weight:600; }
.dock-item.active{ color:#fff; }
.dock-item.active span{ font-weight:800; }
.dock-item:active svg{ transform: scale(.88); }
.dock-highlight{
  position:absolute; top:6px; bottom:6px; left:6px; width: calc(25% - 4.5px); border-radius: var(--r-pill);
  background: var(--gradient); z-index:0; transition: transform var(--med) var(--ease);
  box-shadow: 0 6px 20px -4px rgba(109,106,251,.65);
}
[dir="rtl"] .dock-highlight{ left:auto; right:6px; }
body.hide-dock .dock-wrap{ display:none; }
body.hide-dock .view{ padding-bottom:40px; }

/* ===================================================================
   App detail — slides up from the bottom as a sheet (same as the app)
=================================================================== */
.overlay{ position:fixed; inset:0; z-index:80; display:none; }
.overlay.open{ display:block; }
.overlay-scrim{ position:absolute; inset:0; background: rgba(4,4,8,.6); backdrop-filter: blur(3px); opacity:0; transition: opacity var(--med) var(--ease); }
.overlay.animate-in .overlay-scrim{ opacity:1; }

.detail-panel{
  position:absolute; left:50%; bottom:0; width:100%; max-width:640px; max-height:92vh;
  background: var(--bg-1); border:1px solid var(--border-strong); border-bottom:none; border-radius: 24px 24px 0 0;
  display:flex; flex-direction:column; overflow:hidden;
  transform: translate(-50%, 100%); transition: transform var(--med) var(--ease);
}
.overlay.animate-in .detail-panel{ transform: translate(-50%, 0); }
.detail-grabber{ width:36px; height:4px; border-radius:2px; background: var(--border-strong); margin:10px auto 4px; flex-shrink:0; }
.detail-scroll{ overflow-y:auto; flex:1; }
.detail-close{ position:absolute; top:14px; right:14px; z-index:5; width:32px; height:32px; background: rgba(6,7,12,.6); backdrop-filter: blur(8px); }
[dir="rtl"] .detail-close{ right:auto; left:14px; }
.detail-close svg{ width:16px; height:16px; stroke:#fff; }

/* hero / media carousel — slide 1 is the app hero (logo + name), then the animation, then the real screenshot */
.media-carousel{ position:relative; aspect-ratio:16/9; background: var(--bg-2); overflow:hidden; touch-action: pan-y; cursor: grab; }
.media-carousel:active{ cursor: grabbing; }
.media-carousel::after{ content:''; position:absolute; inset:0; background: linear-gradient(180deg, rgba(10,12,21,0) 55%, var(--bg-1) 100%); pointer-events:none; z-index:3; }
.media-track{ display:flex; width:100%; height:100%; transition: transform var(--slow) var(--ease); will-change: transform; }
.media-slide{ position:relative; flex:0 0 100%; width:100%; height:100%; background:#000; }
.media-slide img{ width:100%; height:100%; object-fit:cover; object-position: top center; display:block; }
.media-slide.hero-slide{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; padding-bottom:26px; }
.media-slide.hero-slide .banner-icon{ width:72px; height:72px; border-radius:20px; display:flex; align-items:center; justify-content:center; overflow:hidden; position:relative; z-index:1; box-shadow: 0 12px 28px -8px rgba(0,0,0,.5); }
.media-slide.hero-slide .banner-icon img{ width:100%; height:100%; object-fit:cover; object-position:center; }
.media-slide.hero-slide .banner-icon svg{ width:34px; height:34px; fill:none; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; stroke:#fff; }
.media-slide.hero-slide .banner-name{ position:relative; z-index:1; font-size:26px; font-weight:800; letter-spacing:-.01em; color:#fff; text-align:center; padding:0 20px; }
.media-slide iframe{ position:absolute; inset:0; width:100%; height:100%; border:0; }
.media-slide iframe.commercial-frame{ pointer-events:none; }
.media-slide video{ width:100%; height:100%; object-fit:cover; display:block; background:#000; }
.media-nav{ position:absolute; top:50%; transform:translateY(-50%); z-index:4; width:38px; height:38px;
  background: rgba(6,7,12,.55); backdrop-filter: blur(8px); border:1px solid var(--border-strong); color:#fff; opacity:.85; }
.media-nav:hover{ opacity:1; background: rgba(6,7,12,.8); }
.media-nav.prev{ left:14px; }
.media-nav.next{ right:14px; }
[dir="rtl"] .media-nav.prev{ left:auto; right:14px; }
[dir="rtl"] .media-nav.next{ right:auto; left:14px; }
[dir="rtl"] .media-nav svg{ transform: scaleX(-1); }
.media-nav.hidden{ display:none; }
.media-dots{ position:absolute; left:0; right:0; bottom:14px; z-index:4; display:flex; justify-content:center; gap:7px; }
.media-dots.hidden{ display:none; }
.media-dot{ width:8px; height:8px; border-radius:50%; background: rgba(255,255,255,.4); transition: all var(--fast) var(--ease); }
.media-dot.active{ width:22px; border-radius: var(--r-pill); background:#fff; }

.detail-body{ padding:18px 20px 28px; display:block; }
.detail-body h2{ font-size:20px; margin-bottom:4px; letter-spacing:-.01em; }
.detail-body .tagline{ font-size:13.5px; color: var(--fg-muted); margin-top:0; margin-bottom:12px; }
.detail-version{ font-size:11.5px; font-weight:700; color: var(--fg-faint); letter-spacing:.02em; margin:-8px 0 14px; }
.detail-tags{ display:flex; flex-wrap:wrap; gap:6px; margin:0 0 14px; }
.detail-desc{ margin:0 0 20px; color: var(--fg-muted); line-height:1.65; font-size:14px; }
.detail-h4{ font-size:12px; text-transform:uppercase; letter-spacing:.05em; color: var(--fg-faint); font-weight:700; margin:0 0 10px; }
.detail-list{ display:flex; flex-direction:column; gap:0; margin:0 0 20px; }
.detail-list li{ display:flex; align-items:flex-start; gap:9px; font-size:13.5px; color: var(--fg-muted); padding:6px 0; line-height:1.5; }
.detail-list li svg{ width:16px; height:16px; color: var(--success); margin-top:1px; flex-shrink:0; }
.buy-card{ position:static; padding:18px; height:auto; }
.buy-price{ display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; margin-bottom:14px; font-size:inherit; letter-spacing:normal; }
.buy-price b{ font-size:27px; letter-spacing:-.01em; }
.buy-price .or{ font-size:12px; color: var(--fg-faint); font-weight:700; text-transform:uppercase; }
.buy-price .alt{ font-size:15px; font-weight:700; color: var(--fg-muted); }
.buy-price small{ font-size:14px; color: var(--fg-muted); font-weight:600; }
.buy-card .hint{ font-size:12px; color: var(--fg-faint); line-height:1.5; }
.buy-meta{ display:flex; flex-direction:column; gap:0; margin:0 0 16px; font-size:12.5px; color: var(--fg-muted); }
.buy-meta li{ display:flex; gap:9px; align-items:flex-start; padding:5px 0; }
.buy-meta svg{ width:15px; height:15px; color: var(--primary-2); margin-top:1px; }

/* ===================================================================
   Payment sheet
=================================================================== */
.sheet-wrap{ position:absolute; inset:0; display:flex; align-items:flex-end; justify-content:center; z-index:6; }
.sheet{
  width:100%; max-width:440px; background: var(--bg-1); border:1px solid var(--border-strong);
  border-radius: var(--r-xl) var(--r-xl) 0 0; padding:26px 24px calc(26px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform var(--med) var(--ease);
  max-height:90vh; overflow-y:auto;
}
@media (min-width:721px){ .sheet{ border-radius: var(--r-xl); margin-bottom:5vh; } }
.overlay.animate-in .sheet{ transform: translateY(0); }
.sheet-handle{ width:36px; height:4px; background: var(--border-strong); border-radius:2px; margin:0 auto 18px; }
.network-row{ display:flex; gap:8px; }
.network-chip{ flex:1; padding:12px; border-radius: var(--r-sm); border:1px solid var(--border); background: var(--surface); text-align:center; font-size:13px; font-weight:700; transition: all var(--fast) var(--ease); }
.network-chip.active{ border-color: var(--primary); background: var(--gradient-soft); color: var(--primary-2); }
.wallet-box{ display:flex; align-items:center; gap:10px; background: var(--bg-2); border:1px solid var(--border); border-radius: var(--r-sm); padding:12px 14px; margin-top:10px; }
.wallet-box .addr{ font-family: var(--font-mono); font-size:12.5px; color: var(--fg-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }

/* payment method picker */
.pm-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:9px; }
@media (max-width:420px){ .pm-grid{ grid-template-columns:1fr; } }
.pm-card{ display:flex; flex-direction:column; align-items:center; gap:5px; padding:16px 8px; border-radius: var(--r-md); background: var(--surface); border:1px solid var(--border); text-align:center; transition: all var(--fast) var(--ease); }
.pm-card:hover{ border-color: var(--primary); background: var(--gradient-soft); }
.pm-icon{ width:38px; height:38px; border-radius:50%; background: var(--gradient-soft); display:flex; align-items:center; justify-content:center; color: var(--primary-2); }
.pm-name{ font-weight:700; font-size:13.5px; }
.pm-sub{ font-size:11px; color: var(--fg-faint); }
.pm-price{ font-size:12px; font-weight:700; color: var(--primary-2); margin-top:2px; }
.pm-price-old{ color: var(--fg-faint); font-weight:600; margin-inline-end:5px; text-decoration-color: var(--danger); }

/* Coupon / promo code box */
.coupon-box{ background: var(--surface); border:1px solid var(--border); border-radius: var(--r-md); padding:12px 14px; margin-bottom:14px; }
.coupon-label{ display:block; font-size:12.5px; font-weight:600; color: var(--fg-muted); margin-bottom:8px; }
.coupon-input-row{ display:flex; align-items:center; gap:0; }
.coupon-input-row input{
  flex:1; min-width:0; background: var(--bg-2); border:1px solid var(--border); color: var(--fg);
  border-radius: var(--r-sm); padding:9px 12px; font-size:13.5px; outline:none;
  transition: border-radius var(--fast) var(--ease);
}
.coupon-input-row input:focus{ border-color: var(--primary); }
.coupon-confirm-btn{
  display:inline-flex; align-items:center; justify-content:center; white-space:nowrap;
  max-width:0; opacity:0; overflow:hidden; padding:9px 0; margin-inline-start:0;
  background: var(--primary); color:#fff; border:none; border-radius: var(--r-sm);
  font-size:13px; font-weight:700; cursor:pointer;
  transition: max-width var(--fast) var(--ease), opacity var(--fast) var(--ease), padding var(--fast) var(--ease), margin var(--fast) var(--ease);
}
.coupon-confirm-btn.show{ max-width:120px; opacity:1; padding:9px 16px; margin-inline-start:8px; }
.coupon-feedback{ font-size:12.5px; margin-top:8px; min-height:0; }
.coupon-applied{ color: var(--success); font-weight:600; display:inline-flex; align-items:center; gap:5px; }
.coupon-applied svg{ width:13px; height:13px; }
.coupon-error{ color: var(--danger); font-weight:600; }

/* Admin: promo codes list */
.promo-add-row{ display:flex; gap:8px; margin-bottom:10px; }
.promo-add-row #afPromoCode{ flex:1; }
.promo-codes-list{ display:flex; flex-direction:column; gap:6px; }
.promo-row{
  display:flex; align-items:center; gap:8px; background: var(--surface); border:1px solid var(--border);
  border-radius: var(--r-sm); padding:8px 10px;
}
.promo-code{ font-weight:700; font-size:13px; letter-spacing:.02em; }
.promo-pct{ color: var(--primary-2); font-weight:600; font-size:12.5px; }
.promo-row button{ margin-inline-start:auto; display:flex; color: var(--fg-faint); }
.promo-row button:hover{ color: var(--danger); }

/* QR display */
.qr-display{ display:flex; flex-direction:column; align-items:center; gap:10px; margin:14px 0; }
.qr-display img{ width:100%; max-width:220px; border-radius: var(--r-md); border:1px solid var(--border); background:#fff; padding:8px; }

/* receipt reminder */
.reminder-note{ display:flex; gap:10px; align-items:flex-start; background: var(--warning-bg); border:1px solid rgba(245,165,36,.3); border-radius: var(--r-md); padding:12px 14px; margin-top:14px; }
.reminder-icon{ color: var(--warning); flex-shrink:0; margin-top:1px; }
.reminder-text{ font-size:12.5px; color: var(--fg-muted); line-height:1.5; flex:1; }
.reminder-close{ color: var(--fg-faint); flex-shrink:0; }

.price-iqd{ font-size:12px; color: var(--fg-faint); font-weight:600; margin-top:-2px; }
.price-iqd-detail{ font-size:13px; color: var(--fg-muted); font-weight:600; margin-top:2px; }

/* ===================================================================
   Auth card
=================================================================== */
.auth-wrap{ max-width:420px; margin:0 auto; padding-top:20px; }
.auth-card{ padding:30px 26px; }
.auth-head{ text-align:center; margin-bottom:22px; }
.auth-head .icon-wrap{ width:52px; height:52px; border-radius:16px; background: var(--gradient-soft); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; margin:0 auto 16px; color: var(--primary-2); }
.auth-head h2{ font-size:22px; }
.auth-head p{ color: var(--fg-muted); font-size:13.5px; margin-top:6px; }

.order-row{ display:flex; align-items:center; gap:14px; padding:16px; border-bottom:1px solid var(--border); }
.order-row:last-child{ border-bottom:none; }
.order-row img{ width:52px; height:38px; object-fit:cover; border-radius:8px; flex-shrink:0; }
.order-row .grow{ flex:1; min-width:0; }
.order-row .grow h4{ font-size:14.5px; font-weight:700; }
.order-row .grow p{ font-size:12.5px; color: var(--fg-faint); margin-top:2px; }
.order-row .amt{ font-weight:700; font-size:14px; text-align:right; }

/* A purchase row plus its optional subscription-status strips below it.
   The wrapper owns the separator line so warning/renew strips stay
   visually attached to their own app rather than the next one. */
.order-row-wrap{ border-bottom:1px solid var(--border); }
.order-row-wrap:last-child{ border-bottom:none; }
.order-row-wrap .order-row{ border-bottom:none; }

/* Subscription countdown — small bubbly pill with a soft shadow, elegant
   italic serif numerals, recoloring green -> yellow -> light red -> dark
   red (pulsing like a heartbeat) as the 6-month period runs out. */
.sub-countdown{
  display:inline-flex; align-items:center; gap:6px;
  padding:5px 12px; margin-top:6px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.05); box-shadow: var(--shadow-1);
  font-family: var(--font-serif); font-style:italic; font-weight:600; font-size:12.5px;
  color: var(--success); width:fit-content;
  transition: color .35s ease;
}
.sub-countdown .i{ width:13px; height:13px; }
.sub-countdown.stage-yellow{ color: var(--warning); }
.sub-countdown.stage-lightred{ color:#ff6b7a; }
.sub-countdown.stage-darkred,
.sub-countdown.stage-expired{ color: var(--danger); animation: sub-heartbeat 1.1s ease-in-out infinite; }
@keyframes sub-heartbeat{
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.07); }
  40% { transform: scale(1); }
  55% { transform: scale(1.05); }
}
@media (prefers-reduced-motion: reduce){
  .sub-countdown.stage-darkred, .sub-countdown.stage-expired{ animation:none; }
}

.sub-warning, .sub-renew-box{
  display:flex; align-items:center; gap:10px; margin:0 16px 14px;
  padding:10px 14px; border-radius: var(--r-md); box-shadow: var(--shadow-1);
  font-size:12.5px; font-weight:600;
}
.sub-warning{ background: var(--danger-bg); color: var(--danger); }
.sub-warning .i{ flex-shrink:0; }
.sub-renew-box{ background: var(--warning-bg); color: var(--warning); justify-content:space-between; }
.sub-renew-box .i{ vertical-align:-2px; margin-inline-end:4px; }

/* ===================================================================
   Request page
=================================================================== */
.request-wrap{ max-width:640px; margin:0 auto; }
.request-hero{ text-align:center; margin-bottom:32px; }
.request-hero .icon-wrap{ width:56px; height:56px; border-radius:18px; background: var(--gradient-soft); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; margin:0 auto 18px; color: var(--primary-2); }
.request-hero h1{ font-size: clamp(24px,4vw,32px); letter-spacing:-.02em; }
.request-hero p{ color: var(--fg-muted); margin-top:10px; max-width:44ch; margin-inline:auto; }
.request-card{ padding:30px; }
.success-card{ text-align:center; padding:52px 30px; }
.success-card .icon-wrap{ width:64px; height:64px; border-radius:50%; background: var(--success-bg); color: var(--success); display:flex; align-items:center; justify-content:center; margin:0 auto 20px; }
.success-card h3{ font-size:20px; }
.success-card p{ color: var(--fg-muted); margin-top:8px; }
.success-card .ref{ font-family:var(--font-mono); font-size:13px; color: var(--primary-2); margin-top:14px; display:block; }

/* ===================================================================
   Admin
=================================================================== */
.admin-shell{ display:flex; min-height: calc(100vh - var(--header-h)); }
.admin-sidebar{ width:220px; flex-shrink:0; border-right:1px solid var(--border); padding:22px 14px; position:sticky; top:var(--header-h); height: calc(100vh - var(--header-h)); display:flex; flex-direction:column; }
.admin-sidebar #adminNav{ display:flex; flex-direction:column; gap:2px; }
.admin-sidebar .admin-foot{ margin-top:auto; display:flex; flex-direction:column; gap:2px; padding-top:14px; border-top:1px solid var(--border); }
.admin-sidebar .sb-title{ font-size:11px; text-transform:uppercase; letter-spacing:.1em; color: var(--fg-faint); font-weight:700; padding:0 12px 10px; }
.admin-nav-item{ display:flex; align-items:center; gap:11px; padding:11px 12px; border-radius: var(--r-sm); color: var(--fg-muted); font-size:14px; font-weight:600; margin-bottom:2px; transition: all var(--fast) var(--ease); }
.admin-nav-item svg{ width:18px; height:18px; }
.admin-nav-item:hover{ background: var(--surface); color: var(--fg); }
.admin-nav-item.active{ background: var(--gradient-soft); color: var(--primary-2); }
.admin-main{ flex:1; padding:30px 32px 80px; min-width:0; }
@media (max-width:860px){
  .admin-shell{ flex-direction:column; }
  .admin-sidebar{ width:100%; position:sticky; top:var(--header-h); z-index:20; height:auto; flex-direction:row; align-items:center; overflow-x:auto; scrollbar-width:none; padding:10px 14px; border-right:none; border-bottom:1px solid var(--border); gap:8px; background: rgba(12,12,18,.92); backdrop-filter: blur(14px); }
  .admin-sidebar::-webkit-scrollbar{ display:none; }
  .admin-sidebar .sb-title{ display:none; }
  .admin-sidebar #adminNav, .admin-sidebar .admin-foot{ display:contents; }
  .admin-sidebar .admin-foot .admin-nav-item[data-route]{ order:-1; }
  .admin-sidebar #adminLogoutBtn{ order:99; }
  .admin-nav-item{ white-space:nowrap; margin:0; padding:9px 14px; border-radius:999px; border:1px solid var(--border); background: var(--surface); font-size:13px; flex-shrink:0; }
  .admin-nav-item.active{ border-color: transparent; }
  .admin-nav-item svg{ width:16px; height:16px; }
  .admin-main{ padding:22px 16px 60px; }
}
.admin-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; flex-wrap:wrap; gap:12px; }
.admin-head h1{ font-size:23px; letter-spacing:-.02em; }
.admin-head p{ color: var(--fg-muted); font-size:13.5px; margin-top:4px; }

.data-table{ width:100%; border-collapse:collapse; }
.data-table th{ text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:.06em; color: var(--fg-faint); font-weight:700; padding:12px 16px; border-bottom:1px solid var(--border); }
.data-table td{ padding:13px 16px; border-bottom:1px solid var(--border); font-size:13.5px; vertical-align:middle; }
.data-table tr:last-child td{ border-bottom:none; }
.data-table img.thumb-sm{ width:44px; height:32px; object-fit:cover; border-radius:6px; }
.table-wrap{ overflow-x:auto; border:1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-solid); }
.table-wrap .data-table{ min-width:640px; }
.row-actions{ display:flex; gap:6px; justify-content:flex-end; }

.modal-overlay{ position:fixed; inset:0; z-index:110; display:none; align-items:center; justify-content:center; padding:20px; }
.modal-overlay.open{ display:flex; }
.modal-overlay .overlay-scrim{ opacity:1; }
.modal-box{ position:relative; width:100%; max-width:560px; max-height:88vh; overflow-y:auto; background: var(--bg-1); border:1px solid var(--border-strong); border-radius: var(--r-xl); padding:28px; box-shadow: 0 40px 100px -20px rgba(0,0,0,.7); }
.modal-box.wide{ max-width:720px; }
.modal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.modal-head h3{ font-size:19px; }

.chip-input{ display:flex; flex-wrap:wrap; gap:7px; padding:10px; background: var(--bg-2); border:1px solid var(--border); border-radius: var(--r-sm); min-height:46px; }
.chip-input input{ flex:1; min-width:120px; background:none; border:none; outline:none; color:var(--fg); font-size:13.5px; }
.chip-tag{ display:flex; align-items:center; gap:6px; background: var(--surface); border:1px solid var(--border); padding:4px 6px 4px 10px; border-radius: var(--r-pill); font-size:12px; font-weight:600; }
.chip-tag button{ display:flex; color: var(--fg-faint); }
.file-drop{ border:1.5px dashed var(--border-strong); border-radius: var(--r-sm); padding:20px; text-align:center; color: var(--fg-muted); font-size:13px; cursor:pointer; transition: all var(--fast) var(--ease); }
.file-drop:hover{ border-color: var(--primary); background: var(--gradient-soft); }
.shot-grid{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.shot-thumb{ position:relative; width:76px; height:54px; border-radius:8px; overflow:hidden; border:1px solid var(--border); }
.shot-thumb img, .shot-thumb video{ width:100%; height:100%; object-fit:cover; }
.shot-thumb button{ position:absolute; top:2px; right:2px; width:18px; height:18px; border-radius:50%; background: rgba(0,0,0,.7); color:#fff; display:flex; align-items:center; justify-content:center; }
.shot-badge{ position:absolute; left:2px; bottom:2px; width:16px; height:16px; border-radius:50%; background: rgba(0,0,0,.7); color:#fff; display:flex; align-items:center; justify-content:center; }
.shot-badge svg{ width:8px; height:8px; }
.switch-row{ display:flex; align-items:center; justify-content:space-between; padding:14px 16px; background: var(--bg-2); border:1px solid var(--border); border-radius: var(--r-sm); }
.switch{ position:relative; width:42px; height:24px; border-radius:var(--r-pill); background: var(--surface-hover); border:1px solid var(--border); flex-shrink:0; }
.switch::after{ content:''; position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%; background: var(--fg-muted); transition: all var(--fast) var(--ease); }
.switch.on{ background: var(--gradient); border-color:transparent; }
.switch.on::after{ left:20px; background:#fff; }

/* ===================================================================
   Toast
=================================================================== */
.toast-stack{ position:fixed; top:16px; left:50%; transform:translateX(-50%); z-index:200; display:flex; flex-direction:column; gap:8px; align-items:center; width:100%; padding:0 16px; }
.toast{
  display:flex; align-items:center; gap:10px; background: var(--surface-solid); border:1px solid var(--border-strong);
  padding:12px 18px; border-radius: var(--r-pill); font-size:13.5px; font-weight:600; box-shadow: var(--shadow-1);
  opacity:0; transform: translateY(-12px); transition: all var(--med) var(--ease); max-width:92vw;
}
.toast.show{ opacity:1; transform:translateY(0); }
.toast svg{ color: var(--success); flex-shrink:0; }
.toast.error svg{ color: var(--danger); }

/* ===================================================================
   Upcoming / Request / Settings + full-page sheets  (same as the app)
=================================================================== */
.upcoming-card{ display:block; padding:16px; margin-bottom:12px; border-radius: var(--r-lg); }
.upcoming-card h3{ font-size:15px; margin:8px 0 4px; }
.upcoming-card p{ font-size:12.8px; color: var(--fg-muted); margin-bottom:10px; }
.upcoming-foot{ display:flex; align-items:center; justify-content:space-between; margin-top:0; padding-top:0; border-top:none; }
.vote-btn{ display:flex; align-items:center; gap:6px; padding:7px 13px; border-radius: var(--r-pill); background: var(--surface); border:1px solid var(--border); font-size:12.5px; font-weight:700; color: var(--fg-muted); }
.vote-btn svg{ width:14px; height:14px; }
.vote-btn:hover{ border-color: var(--border-strong); color: var(--fg-muted); }
.vote-btn.voted{ background: var(--surface); color: var(--warning); border-color: rgba(245,165,36,.4); }

/* form fields inside the Request page and the Settings sheets */
#view-request .field, #settingsSheet .field{ margin-bottom:14px; gap:0; }
#view-request .field label, #settingsSheet .field label{ display:block; font-size:12px; font-weight:700; color: var(--fg-faint); text-transform:uppercase; letter-spacing:.04em; margin-bottom:6px; }
#view-request .input, #settingsSheet .input{ width:100%; background: var(--bg-2); border:1.5px solid var(--border); border-radius: var(--r-md); padding:12px 13px; font-size:14.5px; outline:none; color: var(--fg); min-height:0; }
#view-request textarea.input, #settingsSheet textarea.input{ resize:vertical; min-height:90px; }
#view-request .input:focus, #settingsSheet .input:focus{ border-color: var(--border-strong); background: var(--bg-2); }
#view-request .request-card, #settingsSheet .request-card, #settingsSheet .auth-card{ padding:16px; }
#view-request .form-row, #settingsSheet .form-row{ gap:0; }

.profile-head{ display:flex; align-items:center; gap:14px; padding:16px; margin-bottom:16px; width:100%; text-align:start; }
.profile-avatar{ width:48px; height:48px; border-radius: var(--r-pill); background: var(--gradient); display:flex; align-items:center; justify-content:center; font-weight:800; font-size:16px; color:#fff; flex-shrink:0; overflow:hidden; }
.profile-head > div{ min-width:0; }
.profile-head h2{ font-size:15px; overflow-wrap:anywhere; }
.profile-head p{ font-size:12px; color: var(--fg-muted); margin-top:2px; overflow-wrap:anywhere; }
.settings-row{ display:flex; align-items:center; gap:12px; padding:14px 16px; border-bottom:1px solid var(--border); width:100%; text-align:start; }
.settings-row:last-child{ border-bottom:none; }
.settings-row .ic{ width:34px; height:34px; border-radius:10px; background: var(--surface); display:flex; align-items:center; justify-content:center; flex-shrink:0; overflow:hidden; }
.settings-row .ic svg{ width:17px; height:17px; stroke: var(--fg-muted); fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.settings-row .lbl{ flex:1; min-width:0; }
.settings-row .lbl b{ display:block; font-size:14px; font-weight:600; overflow-wrap:anywhere; }
.settings-row .lbl span{ font-size:12px; color: var(--fg-muted); }
.settings-row .chev{ width:15px; height:15px; stroke: var(--fg-faint); fill:none; stroke-width:2; flex-shrink:0; }
[dir="rtl"] .settings-row .chev{ transform: scaleX(-1); }
.lang-switch{ display:flex; background: var(--bg-2); border:1px solid var(--border); border-radius: var(--r-pill); padding:3px; flex-shrink:0; width:fit-content; margin-bottom:18px; }
.lang-opt{ padding:7px 18px; border-radius: var(--r-pill); font-size:13px; font-weight:700; color: var(--fg-muted); }
.lang-opt.active{ background: var(--gradient); color:#fff; }
.about-body{ font-size:14px; line-height:1.75; color: var(--fg-muted); }
.about-body p{ margin-bottom:14px; }
.about-logo{ width:52px; height:52px; border-radius:16px; background: var(--surface); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; margin-bottom:16px; overflow:hidden; }
.about-logo img{ height:22px; width:34px; object-fit:contain; display:block; }
.mini-ic{ width:38px; height:38px; border-radius:11px; display:flex; align-items:center; justify-content:center; flex-shrink:0; overflow:hidden; }
.mini-ic svg{ width:17px; height:17px; fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; stroke:#fff; }
#settingsSheet .order-row.stack{ flex-wrap:wrap; align-items:flex-start; gap:10px 12px; }
#settingsSheet .order-row.stack .grow{ flex:1 1 calc(100% - 50px); }
#settingsSheet .order-row.stack > .btn, #settingsSheet .order-row.stack > .text-muted, #settingsSheet .order-row.stack > div:last-child{ margin-inline-start:50px; }
#settingsSheet .order-row.stack > div:last-child{ flex-direction:row !important; align-items:center !important; gap:10px !important; }
.sheet-group-label{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.09em; color: var(--primary-2); margin:22px 2px 8px; }
.sheet-group-label:first-child{ margin-top:0; }
.err{ color:#ff8b98; font-size:12.5px; min-height:16px; margin:4px 0 8px; }
.pwd-field{ position:relative; }
.pwd-field .input{ padding-inline-end:42px; }
.pwd-toggle{ position:absolute; top:50%; inset-inline-end:4px; transform: translateY(-50%); width:30px; height:30px; border-radius: var(--r-pill); display:flex; align-items:center; justify-content:center; color: var(--fg-faint); }
.pwd-toggle svg{ width:17px; height:17px; stroke:currentColor; fill:none; stroke-width:1.8; }

/* full-page sheet that slides in from the side */
.sheet-overlay{ position:fixed; inset:0; z-index:95; background: var(--bg); transform: translateX(100%); transition: transform var(--med) var(--ease); display:flex; flex-direction:column; visibility:hidden; }
.sheet-overlay.open{ transform: translateX(0); visibility:visible; }
[dir="rtl"] .sheet-overlay{ transform: translateX(-100%); }
[dir="rtl"] .sheet-overlay.open{ transform: translateX(0); }
.sheet-head{ display:flex; align-items:center; gap:12px; padding:16px 14px; flex-shrink:0; background: rgba(10,12,20,.72); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); border-bottom-left-radius:20px; border-bottom-right-radius:20px; box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 18px 40px -24px rgba(0,0,0,.65); }
.sheet-head button svg{ stroke: var(--fg-muted); }
[dir="rtl"] .sheet-head button svg{ transform: scaleX(-1); }
.sheet-head h3{ font-size:16px; }
.sheet-body{ flex:1; overflow-y:auto; padding:18px 16px 40px; width:100%; max-width:560px; margin:0 auto; }

/* empty state */
.empty-state{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:12px; padding:56px 20px; color: var(--fg-muted); }
.empty-state .icon-wrap{ width:52px; height:52px; border-radius:50%; background: var(--surface); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; color: var(--fg-faint); }
.empty-state h4{ color: var(--fg); font-size:16px; }
.empty-state p{ font-size:13.5px; max-width:34ch; }

/* utility */
.mt-0{margin-top:0} .flex{display:flex} .items-center{align-items:center} .gap-8{gap:8px} .justify-between{justify-content:space-between}
.hidden{ display:none !important; }
[hidden]{ display:none !important; }
.text-muted{ color: var(--fg-muted); }
.center-lock{ display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; min-height:60vh; gap:14px; padding:20px; }
.center-lock .icon-wrap{ width:60px; height:60px; border-radius:18px; background: var(--surface); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; color: var(--fg-faint); }
.center-lock h3{ font-size:19px; }
.center-lock p{ color: var(--fg-muted); max-width:36ch; font-size:14px; }

/* ===================================================================
   RTL (Arabic)
   Most layouts here are plain flex rows, which reverse direction on
   their own once the document is dir="rtl" — only the handful of
   physical (non-logical) left/right rules and directional icons below
   need an explicit override.
=================================================================== */
[dir="rtl"] body{ font-family: 'Noto Sans Arabic', var(--font-sans); }
[dir="rtl"] .serif{ font-style: normal; } /* Instrument Serif's italic has no Arabic glyphs */
[dir="rtl"] #pmBackBtn svg{ transform: scaleX(-1); }
.center-lock p{ color: var(--fg-muted); max-width:36ch; font-size:14px; }

/* ---- Admin tables become stacked cards on phones (labels come from data-label,
   filled in by labelAdminTables() in main.js) ---- */
@media (max-width:700px){
  #adminMain .table-wrap{ overflow:visible; background:none; border:none; box-shadow:none; }
  #adminMain .data-table, #adminMain .data-table tbody, #adminMain .data-table tr, #adminMain .data-table td{ display:block; width:100%; min-width:0 !important; }
  #adminMain .data-table thead{ display:none; }
  #adminMain .data-table tr{ background: var(--surface); border:1px solid var(--border); border-radius:14px; padding:6px 14px; margin-bottom:10px; }
  #adminMain .data-table td{ display:flex; align-items:center; justify-content:space-between; gap:14px; padding:8px 0; border:none; text-align:right; min-width:0; word-break:break-word; }
  #adminMain .data-table td[data-label]::before{ content:attr(data-label); flex-shrink:0; font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--fg-faint); text-align:left; }
  #adminMain .data-table td:not([data-label]), #adminMain .data-table td[data-label=""]{ justify-content:flex-end; padding-top:10px; margin-top:4px; border-top:1px solid var(--border); }
  #adminMain .data-table td .row-actions{ flex-wrap:wrap; justify-content:flex-end; }
  #adminMain .data-table td[colspan]{ display:block; text-align:left; }
}

/* ---- "Get Codex app store" button under the landing hero: premium 3D, Android only ---- */
.get-app-pill{ display:none; position:relative; overflow:hidden; align-items:center; gap:12px; margin:20px auto 0; padding:10px 18px 10px 10px; min-width:min(300px,100%); border-radius:20px; color:#fff; text-align:left;
  background: linear-gradient(180deg, #8f8bff 0%, #6d6afb 50%, #5650e0 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -3px 0 rgba(0,0,0,.2), 0 0 0 1px rgba(255,255,255,.14), 0 6px 0 #3a3699, 0 16px 26px -6px rgba(109,106,251,.65), 0 26px 40px -14px rgba(0,0,0,.8);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease); }
html.is-android .get-app-pill{ display:flex; width:fit-content; }
.get-app-pill img{ width:46px; height:46px; border-radius:13px; flex-shrink:0; box-shadow: 0 0 0 1px rgba(255,255,255,.25), 0 4px 10px rgba(0,0,0,.45); }
.get-app-pill .gap-text{ display:flex; flex-direction:column; gap:1px; flex:1; min-width:0; }
.get-app-pill .gap-text small{ font-size:10px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:rgba(255,255,255,.78); }
.get-app-pill .gap-text b{ font-size:16px; font-weight:800; letter-spacing:-.01em; line-height:1.15; }
.get-app-pill .gap-arrow{ width:30px; height:30px; border-radius:50%; background:rgba(255,255,255,.2); display:flex; align-items:center; justify-content:center; flex-shrink:0; box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.get-app-pill .gap-arrow svg{ width:16px; height:16px; }
html[dir="rtl"] .get-app-pill{ text-align:right; }
/* slow light sweep across the button */
.get-app-pill::after{ content:''; position:absolute; top:0; bottom:0; left:-60%; width:40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg); animation: gapShine 4.2s ease-in-out infinite; pointer-events:none; }
@keyframes gapShine{ 0%, 55%{ left:-60%; } 100%{ left:130%; } }
@media (prefers-reduced-motion: reduce){ .get-app-pill::after{ animation:none; display:none; } }
.get-app-pill:active{ transform: translateY(4px); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 -3px 0 rgba(0,0,0,.2), 0 0 0 1px rgba(255,255,255,.14), 0 2px 0 #3a3699, 0 8px 14px -6px rgba(109,106,251,.6), 0 12px 20px -12px rgba(0,0,0,.8); }
