/* 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; }

/* ===== StampBuzz brand (stampbuzz.com): owner app, sign-up, scanner, admin, product page =====
   Only under body.sb. Customer pages (join, card) have no .sb and keep each shop's own colours. */
.sb {
  --bg: #FAF6F0; --surface: #FFFFFF; --surface-2: #F3ECE3; --text: #16110E; --muted: #6F6660;
  --line: rgba(22, 17, 14, .12); --accent: #16110E; --accent-text: #FAF6F0;
  --brand: #FF4A1C; --brand-deep: #C8340E; --brand-ink: #16110E; --pop: #FFE1D6;
  --ok: #1F8A4C; --radius: 18px;
  --font: "Archivo", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  .sb { --bg: #16110E; --surface: #211A16; --surface-2: #2B231E; --text: #FAF6F0; --muted: rgba(250, 246, 240, .68);
        --line: rgba(250, 246, 240, .14); --accent: #FF4A1C; --accent-text: #16110E; --brand-deep: #FF6A43; --pop: #3A2219; }
}
.sb h1, .sb h2, .sb h3 { font-weight: 800; letter-spacing: -0.02em; }
.sb h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.08; }
[dir="rtl"] .sb h1, [dir="rtl"] .sb h2, [dir="rtl"] .sb h3, .sb[dir="rtl"] h1 { letter-spacing: 0; line-height: 1.3; }
.sb .eyebrow { color: var(--brand-deep); text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; display: inline-flex; align-items: center; gap: 8px; }
.sb .eyebrow::before { content: ""; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--brand); }
[dir="rtl"] .sb .eyebrow { letter-spacing: 0; }
.sb .btn { border-radius: 999px; padding: 0 24px; min-block-size: 50px; display: inline-flex; align-items: center; justify-content: center;
           box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .55); transition: transform .15s ease; }
.sb .btn:hover { transform: translateY(-1px); }
.sb .btn.ghost { border: 2px solid var(--text); box-shadow: none; }
.sb .btn.small { padding: 0 16px; min-block-size: 40px; }
.sb .btn:focus-visible, .sb a:focus-visible, .sb input:focus-visible, .sb select:focus-visible, .sb button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.sb .card { border-radius: var(--radius); box-shadow: 0 1px 0 rgba(0, 0, 0, .03), 0 18px 40px -30px rgba(0, 0, 0, .35); }
.sb input, .sb select, .sb textarea { border-radius: 12px; border-width: 1.5px; }
.sb input:focus, .sb select:focus, .sb textarea:focus { border-color: var(--brand); outline: none; }
.sb a { color: inherit; }
.sb .banner { border-radius: 14px; }
/* header with the logo */
.sb .topbar { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(160%) blur(12px);
              -webkit-backdrop-filter: saturate(160%) blur(12px); position: sticky; inset-block-start: 0; z-index: 20; min-block-size: 60px; }
.sb .topbar a { text-decoration: none; }
.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { block-size: 30px; inline-size: auto; display: block; }
.brand .logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .sb .brand .logo-light { display: none; } .sb .brand .logo-dark { display: block; } }
.brand-icon { inline-size: 32px; block-size: 32px; border-radius: 8px; flex: none; }
.sb .topbar .tag { background: var(--brand); color: var(--brand-ink); border-radius: 999px; padding: 2px 10px; font-size: .8rem; }
.sb .topbar .shopname { font-weight: 600; }
.brandbar { justify-content: center; border-block-end: 0 !important; }
/* tabs, steps, chips */
.sb .tabs { background: var(--bg); }
.sb .tabs a { border-radius: 999px; font-weight: 600; }
.sb .tabs a.on { background: var(--accent); color: var(--accent-text); }
.sb .steps li { border-radius: 999px; }
.sb .steps li.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 700; }
.sb .chip.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
/* numbers and plans */
.sb .stat { border-radius: var(--radius); }
.sb .stat b { font-weight: 800; letter-spacing: -0.02em; }
.sb .price { color: var(--text); }
.sb .plan:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.sb .b.stamps, .sb .k.stamps { background: var(--brand); } .sb .b.joins, .sb .k.joins { background: var(--text); }
.sb .toast { background: var(--brand-ink); }
.sb .big-dots { --pass-label: var(--brand); }
.sb .foot .by { color: var(--muted); }

/* card colours: logo first, then tappable themes; pickers only under "Custom colours" */
.visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.logo-drop { display: block; font-weight: 400; margin: 0; cursor: pointer; }
.logo-drop input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.logo-drop-in { display: flex; gap: 14px; align-items: center; padding: 14px; border: 2px dashed var(--line); border-radius: 16px; background: var(--bg); }
.logo-drop:hover .logo-drop-in, .logo-drop:focus-within .logo-drop-in { border-color: var(--brand, var(--accent)); }
.logo-drop-in img { inline-size: 56px; block-size: 56px; object-fit: contain; border-radius: 12px; background: var(--surface); flex: none; }
.logo-drop-in small { display: block; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.swatch { display: flex; flex-direction: column; gap: 6px; align-items: stretch; margin: 0; font-weight: 600; font-size: .85rem; cursor: pointer; text-align: center; }
.swatch input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; }
.swatch .mini { position: relative; display: flex; align-items: flex-end; gap: 4px; block-size: 62px; padding: 8px; border-radius: 12px;
                background: var(--m-bg); color: var(--m-fg); border: 2px solid var(--line); box-shadow: 0 6px 14px -10px rgba(0,0,0,.5); }
.swatch .mini i { inline-size: 12px; block-size: 12px; border-radius: 50%; background: var(--m-label); }
.swatch .mini b { position: absolute; inset-block-start: 6px; inset-inline-start: 9px; font-size: .95rem; }
.swatch input:checked + .mini { border-color: var(--brand, var(--accent)); box-shadow: 0 0 0 3px var(--brand, var(--accent)); }
.swatch input:focus-visible + .mini { outline: 3px solid var(--brand, var(--accent)); outline-offset: 2px; }
.custom-colors { margin-block-start: 12px; }
.custom-colors summary { font-weight: 600; font-size: .9rem; color: var(--muted); }
.color-row { display: flex; gap: 14px; flex-wrap: wrap; margin-block-start: 8px; }
.color-row label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; margin: 0; }
.color-row input[type=color] { inline-size: 64px; block-size: 44px; padding: 3px; border-radius: 10px; cursor: pointer; }
@media (max-width: 760px) {
  /* phones: the live card first, so tapping a theme shows the change right away */
  .split > div:has(> .pass) { order: -1; }
  .brand-split > div:has(> .pass) { position: sticky; inset-block-start: 64px; z-index: 5; }  /* short Brand step only */
  .split > div:has(> .pass) .pass { padding: 14px; }
  .split > div:has(> .pass) .pass-stamps { margin-block: 10px; }
}
.sb { accent-color: var(--brand); }  /* radios, checkboxes, ranges: brand orange, never the browser's blue */
.sb .scan .big-btn { margin-block: 0 16px; }
@media (min-width: 761px) { .split > div:has(> .pass) { position: sticky; inset-block-start: 84px; } }
.cycle-toggle { margin: 0 0 14px; } .cycle-toggle a { border: 1px solid var(--line); }
.cycle-toggle a.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
