/* Crier Cards base styles. Logical properties only (inline-start/end), so Arabic RTL and English LTR share one file. */
:root {
  --bg: #f7f7f5; --surface: #ffffff; --text: #111827; --muted: #6b7280; --line: #e5e7eb;
  --accent: #111827; --accent-text: #ffffff; --ok: #047857; --warn: #b45309; --bad: #b91c1c;
  --radius: 14px; --gap: 16px;
  --font: system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0f17; --surface: #131a26; --text: #f3f4f6; --muted: #9ca3af; --line: #253042;
          --accent: #f3f4f6; --accent-text: #0b0f17; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* .btn and others set display; hidden must still win */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
.wrap { max-inline-size: 640px; margin-inline: auto; padding: 24px var(--gap) 48px; }
h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); line-height: 1.25; margin: 0 0 12px; }
.eyebrow { color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.lead { font-size: 1.1rem; margin: 0 0 24px; }
.muted { color: var(--muted); font-size: .9rem; }
.hero { padding-block: 40px 24px; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-text); text-decoration: none;
       border: 0; border-radius: var(--radius); padding: 14px 22px; font: inherit; font-weight: 700;
       cursor: pointer; min-block-size: 48px; text-align: center; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--gap); }
.foot { text-align: center; padding: 24px var(--gap); color: var(--muted); font-size: .9rem; }
.foot a { color: inherit; }
.by { color: var(--muted); font-size: .8rem; }
input, select, textarea { font: inherit; inline-size: 100%; padding: 12px; border-radius: 10px;
       border: 1px solid var(--line); background: var(--surface); color: var(--text); }
label { display: block; font-weight: 600; margin-block: 14px 6px; }
[dir="rtl"] .ltr { direction: ltr; unicode-bidi: isolate; text-align: end; }

/* layout */
.wrap.wide { max-inline-size: 1080px; }
.center { text-align: center; }
.small { font-size: .85rem; }
.big { font-size: 1.15rem; }
.block { display: block; inline-size: 100%; }
.inline { display: inline; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-block-end: 10px; }
.row > a { margin-inline-start: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 760px) { .split, .grid2 { grid-template-columns: 1fr; } }
.form .btn { margin-block-start: 18px; }
.card + .card, .card + form, form + .card { margin-block-start: 14px; }
h2 { font-size: 1.15rem; margin: 26px 0 10px; }
.btn.small { padding: 8px 14px; min-block-size: 38px; font-size: .9rem; }
button.link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
ul.plain, ol.plain { padding-inline-start: 1.2em; }
.banner { padding: 12px var(--gap); border-radius: 10px; margin: 12px auto; max-inline-size: 1080px; }
.banner.ok { background: #ecfdf5; color: #065f46; } .banner.warn { background: #fffbeb; color: #92400e; }
.banner.bad { background: #fef2f2; color: #991b1b; }
.banner a { color: inherit; font-weight: 700; }
.table { inline-size: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 12px; border-block-end: 1px solid var(--line); text-align: start; }
pre { white-space: pre-wrap; background: var(--bg); padding: 10px; border-radius: 8px; }
/* dashboard chrome */
.topbar { display: flex; gap: 14px; align-items: center; padding: 12px var(--gap); background: var(--surface); border-block-end: 1px solid var(--line); }
.topbar .logo-link { font-weight: 800; color: var(--text); text-decoration: none; }
.topbar .shopname { color: var(--muted); }
.topbar form { margin-inline-start: auto; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px var(--gap); background: var(--surface); border-block-end: 1px solid var(--line); }
.tabs a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tabs a.on { background: var(--bg); color: var(--text); font-weight: 700; }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.steps li { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.steps li.on { background: var(--accent); color: var(--accent-text); } .steps li.done { color: var(--ok); }
.map { block-size: 280px; border-radius: 10px; border: 1px solid var(--line); margin-block-end: 8px; }
/* plans */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-block: 12px; }
.plan { display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.plan.disabled { opacity: .45; cursor: not-allowed; }
.plan input { inline-size: auto; }
.plan-name { font-size: 1.1rem; } .price { font-size: 1.3rem; font-weight: 800; }
.cycle { border: 0; padding: 0; display: flex; gap: 18px; }
.cycle input, label.inline input { inline-size: auto; }
/* the card (wallet look) */
.pass { background: var(--pass-bg); color: var(--pass-fg); border-radius: 18px; padding: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.18); max-inline-size: 380px; }
.pass-top { display: flex; align-items: center; gap: 10px; }
.pass-logo { max-block-size: 44px; max-inline-size: 120px; object-fit: contain; }
.pass-name { font-weight: 800; font-size: 1.1rem; }
.pass-stamps { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 18px; }
.pass-stamps .dot { inline-size: 26px; block-size: 26px; border-radius: 50%; border: 2px solid var(--pass-fg); opacity: .7; }
.pass-stamps .dot.on { background: var(--pass-label); border-color: var(--pass-label); opacity: 1; }
.pass-row { display: flex; justify-content: space-between; gap: 12px; }
.pass-label { display: block; font-size: .75rem; color: var(--pass-label); text-transform: uppercase; }
.pass-qr { background: #fff; border-radius: 12px; padding: 10px; margin-block-start: 16px; text-align: center; color: #111; }
.pass-qr svg { inline-size: 180px; block-size: 180px; }
.ltr-num { direction: ltr; unicode-bidi: isolate; }
/* public pages */
.join-head { text-align: center; padding-block: 20px 8px; }
.join-logo { max-block-size: 90px; max-inline-size: 200px; object-fit: contain; }
.join-offer { font-size: 1.15rem; font-weight: 700; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { inline-size: 22px; block-size: 22px; flex: none; margin-block-start: 2px; }
details.terms { margin-block: 14px; } details summary { cursor: pointer; font-weight: 600; }
.save-row { display: flex; flex-direction: column; gap: 10px; margin-block: 8px 16px; align-items: center; }
.wallet-btn { display: inline-flex; align-items: center; justify-content: center; min-block-size: 52px; padding: 0 22px;
  border-radius: 999px; background: #000; color: #fff; text-decoration: none; font-weight: 700; inline-size: min(100%, 340px); }
.pass { margin-inline: auto; }
.pass-qr .code { font-weight: 700; letter-spacing: .15em; margin-block-start: 6px; }
.msg p { margin: 4px 0; }
/* scanner */
.scan video { display: none; inline-size: 100%; border-radius: var(--radius); background: #000; margin-block-end: 10px; aspect-ratio: 1; object-fit: cover; }
.scan video.on { display: block; }
.scan .code-in, .scan .pin { font-size: 1.4rem; letter-spacing: .2em; text-align: center; }
.big-dots { --pass-fg: var(--muted); --pass-label: #f59e0b; }
.big-dots .dot { inline-size: 30px; block-size: 30px; }
.big-btn { font-size: 1.2rem; min-block-size: 60px; margin-block: 10px; }
.qty { display: flex; gap: 16px; align-items: center; justify-content: center; font-size: 1.4rem; }
.toast { position: fixed; inset-inline: 16px; inset-block-end: 24px; padding: 16px; border-radius: 14px; text-align: center; font-weight: 800; font-size: 1.1rem; background: #111827; color: #fff; z-index: 10; }
.toast.ok { background: #047857; } .toast.bad { background: #b91c1c; }
/* dashboard widgets */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-block: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat span { display: block; color: var(--muted); font-size: .85rem; } .stat b { font-size: 1.6rem; }
.seg { display: flex; gap: 4px; margin-inline-start: auto; } .seg a { padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.seg a.on { background: var(--surface); color: var(--text); font-weight: 700; }
.chart { display: flex; align-items: flex-end; gap: 3px; block-size: 160px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; direction: ltr; }
.chart .col { flex: 1; display: flex; align-items: flex-end; gap: 1px; block-size: 100%; }
.chart .b { flex: 1; display: block; min-block-size: 1px; border-radius: 3px 3px 0 0; }
.b.stamps, .k.stamps { background: #f59e0b; } .b.joins, .k.joins { background: #2563eb; }
.legend .k { display: inline-block; inline-size: 10px; block-size: 10px; border-radius: 2px; margin-inline: 8px 4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .filters input, .filters select { inline-size: auto; flex: 1; }
.filters .narrow { flex: 0 0 70px; }
.chip { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); margin: 3px; text-decoration: none; color: var(--text); }
.chip.on { background: var(--accent); color: var(--accent-text); }
details.auto summary { padding-block: 4px; }
/* product page */
.push-end { margin-inline-start: auto; color: var(--text); }
.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.features { padding-inline-start: 1.1em; } .features li { margin-block: 8px; }
.legal { max-inline-size: 720px; } .legal h2 { margin-block-start: 22px; }
a.on { font-weight: 800; }
