/* "Ballar va chegirmalar" — umumiy mavzu tokenlari (/theme/tokens.css), bo‘lmasa zaxira ranglar. Oq/Qora mavzu, RTL, mobil. */
.rw {
  --rw-bg: var(--mbx-bg, #f5f5f3);
  --rw-surface: var(--mbx-surface, #fff);
  --rw-surface-2: var(--mbx-surface-2, #f0f0ed);
  --rw-text: var(--mbx-text, #111);
  --rw-muted: var(--mbx-text-muted, #5c5c57);
  --rw-border: var(--mbx-border, #e4e4df);
  --rw-ink: var(--mbx-ink, #0a0a0a);
  --rw-on-ink: var(--mbx-on-ink, #fff);
  --rw-accent: var(--mbx-accent, #ffd21f);
  --rw-accent-ink: var(--mbx-accent-ink, #0a0a0a);
  --rw-accent-text: var(--mbx-accent-text, #7a5c00);
  --rw-ok: var(--mbx-success, #12865b);
  --rw-ok-bg: var(--mbx-success-bg, #eaf7f0);
  --rw-bad: var(--mbx-danger, #b3261e);
  --rw-bad-bg: var(--mbx-danger-bg, #fdecea);
  --rw-warn: var(--mbx-warning, #8a5a0b);
  --rw-warn-bg: var(--mbx-warning-bg, #fff6e0);
  --rw-radius: var(--mbx-radius, 14px);
  --rw-shadow: var(--mbx-shadow, 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.07));
  --rw-focus: var(--mbx-focus, #1266c8);
  margin: 0; min-height: 100vh; background: var(--rw-bg); color: var(--rw-text);
  font: 15px/1.45 var(--mbx-font, Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] .rw { --rw-hero: #1b1b1e; }
.rw *, .rw *::before, .rw *::after { box-sizing: border-box; }
.rw [hidden] { display: none !important; }
.rw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.rw-top { position: sticky; top: 0; z-index: 5; display: flex; gap: 12px; align-items: center; padding: max(12px, var(--mbx-sa-top,env(safe-area-inset-top,0px))) 16px 12px;
  background: color-mix(in srgb, var(--rw-bg) 86%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--rw-border); }
.rw-back { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--rw-surface); color: var(--rw-text); text-decoration: none; font-size: 20px; border: 1px solid var(--rw-border); flex: none; }
[dir="rtl"] .rw-back span { display: inline-block; transform: scaleX(-1); }
.rw-head h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.rw-head p { margin: 2px 0 0; color: var(--rw-muted); font-size: 13px; }

.rw-main { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(32px + var(--mbx-sa-bottom,env(safe-area-inset-bottom,0px))); display: grid; gap: 14px; }
#content { display: grid; gap: 14px; }
#content[hidden] { display: none; }
.rw-card { background: var(--rw-surface); border: 1px solid var(--rw-border); border-radius: calc(var(--rw-radius) + 6px); padding: 18px; box-shadow: var(--rw-shadow); }
.rw-card h2 { margin: 0 0 12px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.rw-h3 { margin: 18px 0 8px; font-size: 14px; color: var(--rw-muted); font-weight: 600; }
.rw-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.rw-card-head h2 { margin: 0; }
.rw-note { margin: 12px 0 0; color: var(--rw-muted); font-size: 12.5px; }
.rw-sub { margin: 4px 0 0; color: color-mix(in srgb, var(--rw-on-ink) 72%, transparent); font-size: 13px; }
.rw-muted { color: var(--rw-muted); font-size: 12.5px; display: block; }
.rw-empty { color: var(--rw-muted); padding: 10px 0; list-style: none; }

/* Balans kartasi — qora "premium" panel */
.rw-hero { background: var(--rw-hero, #0a0a0a); color: #fff; border-radius: calc(var(--rw-radius) + 8px); padding: 22px 20px 20px; box-shadow: 0 12px 32px rgba(0,0,0,.22); position: relative; overflow: hidden; }
.rw-hero::after { content: ""; position: absolute; inset-inline-end: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--rw-accent) 55%, transparent), transparent 70%); pointer-events: none; }
.rw-hero .rw-sub { color: rgba(255,255,255,.72); }
.rw-hero-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; position: relative; z-index: 1; }
.rw-eyebrow { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.66); font-weight: 600; }
.rw-balance { margin: 6px 0 0; font-size: 40px; line-height: 1.05; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rw-unit { font-size: 17px; font-weight: 600; color: rgba(255,255,255,.75); }
.rw-chip { flex: none; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; background: #cd7f32; color: #111; }
.rw-chip[data-tier="silver"] { background: #d9d9de; }
.rw-chip[data-tier="gold"] { background: var(--rw-accent); color: var(--rw-accent-ink); }
.rw-chip[data-tier="platinum"] { background: linear-gradient(135deg, #f4f4f0, #bfc4cc); }
.rw-progress { position: relative; z-index: 1; height: 8px; border-radius: 999px; background: rgba(255,255,255,.16); margin: 18px 0 6px; overflow: hidden; }
.rw-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--rw-accent); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.rw-warn { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--rw-warn-bg); color: var(--rw-warn); font-size: 13px; font-weight: 600; }
.rw-hero .rw-warn { background: rgba(255,210,31,.16); color: var(--rw-accent); }
.rw-perks { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 14px 0 0; padding: 0; }
.rw-perks li { padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 12.5px; }

/* MBX Plus */
.rw-plus { position: relative; }
.rw-plus.on { border-color: color-mix(in srgb, var(--rw-accent) 70%, var(--rw-border)); }
.rw-plus-mark { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--rw-accent); color: var(--rw-accent-ink); font-weight: 800; margin-inline-end: 4px; }
.rw-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--rw-surface-2); color: var(--rw-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.rw-pill.on { background: var(--rw-ok-bg); color: var(--rw-ok); }
.rw-benefits { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 8px; }
.rw-benefits li { display: flex; gap: 10px; align-items: center; }
.rw-check { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--rw-ink); color: var(--rw-on-ink); font-size: 12px; flex: none; }
.rw-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 12px; }
.rw-plans:empty { display: none; }
.rw-plan { border: 1px solid var(--rw-border); border-radius: var(--rw-radius); padding: 12px; display: grid; gap: 2px; background: var(--rw-surface-2); }
.rw-plan span { color: var(--rw-muted); font-size: 13px; }

/* Tugmalar */
.rw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 12px; border: 0; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .12s ease, filter .12s ease; }
.rw-btn:active { transform: scale(.98); }
.rw-btn:disabled { opacity: .55; cursor: progress; }
.rw-btn-primary { background: var(--rw-accent); color: var(--rw-accent-ink); width: 100%; }
.rw-btn-primary:hover { filter: brightness(.97); }
.rw-btn-ink { background: var(--rw-ink); color: var(--rw-on-ink); }
.rw-btn-ghost { background: var(--rw-surface-2); color: var(--rw-text); border: 1px solid var(--rw-border); }
.rw :focus-visible { outline: 3px solid var(--rw-focus); outline-offset: 2px; }

/* Promo-kod */
.rw-code { display: grid; gap: 10px; }
.rw-code input, .rw-code select { width: 100%; min-height: 46px; border-radius: 12px; border: 1px solid var(--rw-border); background: var(--rw-surface-2); color: var(--rw-text); font: inherit; padding: 0 14px; }
#code { font-size: 18px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
#code::placeholder { letter-spacing: 0; text-transform: none; font-weight: 500; }
.rw-code-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rw-code-row label { display: grid; gap: 4px; font-size: 12.5px; color: var(--rw-muted); }
.rw-result { margin: 10px 0 0; min-height: 1.2em; font-weight: 600; }
.rw-result.ok { color: var(--rw-ok); }
.rw-result.bad { color: var(--rw-bad); }

/* Ro‘yxatlar */
.rw-list, .rw-ledger, .rw-tiers { list-style: none; margin: 0; padding: 0; display: grid; }
.rw-list li, .rw-ledger li, .rw-tiers li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--rw-border); }
.rw-list li:first-child, .rw-ledger li:first-child, .rw-tiers li:first-child { border-top: 0; }
.rw-list li > div, .rw-ledger li > div, .rw-tiers li > div { flex: 1; min-width: 0; }
.rw-offer-val { flex: none; min-width: 64px; padding: 8px 10px; border-radius: 12px; text-align: center; font-weight: 800; background: var(--rw-accent); color: var(--rw-accent-ink); font-size: 14px; }
.rw-codechip { flex: none; font: inherit; font-weight: 700; letter-spacing: .05em; padding: 7px 10px; border-radius: 10px; border: 1.5px dashed var(--rw-border); background: transparent; color: var(--rw-text); cursor: pointer; }
.rw-coupon .rw-pill { font-variant-numeric: tabular-nums; }
.rw-plus-pts { color: var(--rw-ok); font-weight: 750; font-variant-numeric: tabular-nums; }
.rw-minus-pts { color: var(--rw-muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.rw-tier-dot { width: 14px; height: 14px; border-radius: 50%; background: #cd7f32; flex: none; }
.rw-tiers li[data-tier="silver"] .rw-tier-dot { background: #c3c3c9; }
.rw-tiers li[data-tier="gold"] .rw-tier-dot { background: var(--rw-accent); }
.rw-tiers li[data-tier="platinum"] .rw-tier-dot { background: linear-gradient(135deg, #f4f4f0, #9aa0aa); }
.rw-tiers li.current strong::after { content: " ●"; color: var(--rw-accent-text); }

/* Referal */
.rw-ref .rw-sub { color: var(--rw-muted); }
.rw-refbox { display: grid; gap: 10px; margin-top: 10px; }
.rw-refbox code { display: block; text-align: center; padding: 14px; border-radius: 12px; background: var(--rw-surface-2); border: 1.5px dashed var(--rw-border); font: 700 22px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; user-select: all; }
.rw-ref-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rw-ref-actions .rw-btn { width: 100%; }
#refGet { margin-top: 10px; }

.rw-login { text-align: center; display: grid; gap: 12px; }
.rw-toast { position: fixed; inset-inline: 16px; bottom: calc(16px + var(--mbx-sa-bottom,env(safe-area-inset-bottom,0px))); margin: 0 auto; max-width: 480px; z-index: 20; padding: 12px 16px; border-radius: 12px; background: var(--rw-ink); color: var(--rw-on-ink); box-shadow: var(--rw-shadow); font-weight: 600; }
.rw-toast.bad { background: var(--rw-bad); color: #fff; }

@media (max-width: 380px) { .rw-code-row, .rw-ref-actions { grid-template-columns: 1fr; } .rw-balance { font-size: 34px; } }
@media (prefers-reduced-motion: reduce) { .rw-progress span, .rw-btn { transition: none; } }
