/* Layout: a plain white wall cut into a 12-column grid of square cells; ads occupy whole cells. Single light look by the owner's choice ("صفحة بيضاء"). */
:root {
  --paper: #FFFFFF;
  --ink: #14161F;
  --muted: #646A7D;
  --line: #E3E6EE;
  --cell-line: #E9ECF3;
  --soft: #F5F6FA;
  --accent: #1F4FE0;
  --accent-ink: #FFFFFF;
  --accent-soft: #E6ECFD;
  --ok: #1B7F4B;
  --ok-soft: #E3F4EA;
  --warn: #9A5B00;
  --warn-soft: #FFF1DC;
  --bad: #B8323A;
  --bad-soft: #FCE7E8;
  --display: "Reem Kufi", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --gap: 6px;
  color-scheme: light;
}
html, body { background: var(--paper); color: var(--ink); }
body { font-family: var(--body); font-size: 15px; line-height: 1.6; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--paper); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.num, .money { font-variant-numeric: tabular-nums; }
.inner { max-width: 1140px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.top .inner { display: flex; align-items: center; gap: 16px; padding-block: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-inline-end: auto; }
.brand-mark { width: 26px; height: 26px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; }
.brand-mark i { background: var(--ink); border-radius: 2px; }
.brand-mark i:nth-child(2) { background: var(--accent); }
.brand-name { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: 0; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--soft); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--soft); }
.nav a.cta { background: var(--accent); color: var(--accent-ink); }
.nav a.cta:hover { filter: brightness(1.08); }
.nav a:focus-visible, .btn:focus-visible, .opt:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.demo-note { background: var(--soft); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.demo-note .inner { padding-block: 7px; }

main { padding-block: 28px 96px; }
.view h1 { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4vw, 38px); line-height: 1.25; margin: 0; text-wrap: balance; }
.view h2 { font-family: var(--display); font-weight: 500; font-size: 20px; margin: 0; }
.lede { color: var(--muted); margin: 6px 0 0; max-width: 60ch; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--paper); border-radius: 9px; padding: 8px 14px; cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.good { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger.armed { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.btn.big { padding: 12px 18px; font-size: 16px; width: 100%; }

/* wall */
.wall-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.wall-meta { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.wall { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: dense; gap: var(--gap); grid-auto-rows: var(--cell, 80px); }
.slot { border: 1px dashed var(--cell-line); border-radius: 4px; display: grid; place-items: center; color: transparent; text-decoration: none; font-size: 18px; transition: background .15s, border-color .15s, color .15s; }
.slot:hover, .slot:focus-visible { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); outline: none; }
.ad { position: relative; overflow: hidden; border-radius: 6px; display: block; background: var(--soft); box-shadow: 0 0 0 1px var(--line); container-type: size; text-decoration: none; color: inherit; }
.ad.circle { border-radius: 50%; }
.ad img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.ad:hover { box-shadow: 0 0 0 2px var(--accent); }
.ad[class*="fx-"] { z-index: 1; }
.ad.fx-glow, a.ad.fx-glow:hover { box-shadow: 0 0 0 2px var(--fx), 0 0 14px 4px var(--fx); }
.ad.fx-blink { animation: fx-blink 1.1s ease-in-out infinite; }
.ad.fx-rainbow { animation: fx-rainbow 2.4s linear infinite; }
@keyframes fx-blink {
  0%, 45% { box-shadow: 0 0 0 2px var(--fx), 0 0 16px 5px var(--fx); }
  55%, 100% { box-shadow: 0 0 0 1px var(--line), 0 0 0 0 transparent; }
}
@keyframes fx-rainbow {
  0%, 100% { box-shadow: 0 0 0 2px #FF3B6B, 0 0 16px 5px #FF3B6B; }
  25% { box-shadow: 0 0 0 2px #FFC21A, 0 0 16px 5px #FFC21A; }
  50% { box-shadow: 0 0 0 2px #22C55E, 0 0 16px 5px #22C55E; }
  75% { box-shadow: 0 0 0 2px #19C3F5, 0 0 16px 5px #19C3F5; }
}
.fx-demo { width: 36px; height: 36px; border-radius: 6px; background: var(--ink); }
.tx { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 7cqmin; gap: 2cqmin; }
.tx strong { font-family: var(--display); font-weight: 700; font-size: clamp(7px, min(26cqh, 17cqw), 60px); line-height: 1.15; overflow-wrap: anywhere; }
.tx span { font-size: clamp(6px, min(13cqh, 8.5cqw), 20px); opacity: .85; line-height: 1.3; }
.ad .tag { position: absolute; top: 5px; inset-inline-start: 5px; font-size: 10px; line-height: 1.5; background: rgba(255,255,255,.88); color: var(--ink); padding: 0 6px; border-radius: 99px; }
.ad.circle .tag { inset-inline-start: auto; left: 50%; transform: translateX(-50%); top: 9%; }
@container (max-height: 70px) { .ad .tag { display: none; } }
.wall-foot { margin-top: 14px; color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 640px) { :root { --gap: 3px; } }

/* advertise */
.adv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; margin-top: 24px; }
.step { padding-block: 22px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.step:first-child { border-top: 0; padding-top: 0; }
.step-h { display: flex; align-items: baseline; gap: 10px; }
.step-n { font-family: var(--display); color: var(--accent); font-size: 15px; min-width: 1.4em; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.opt { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; background: var(--paper); text-align: start; cursor: pointer; display: grid; gap: 8px; align-content: start; }
.opt:hover { border-color: #C6CCDB; }
.opt[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.opt b { font-size: 16px; }
.opt small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.opt .price { font-weight: 700; color: var(--ink); }
.glyph-box { height: 56px; display: flex; align-items: center; gap: 6px; }
.glyph { background: var(--ink); border-radius: 3px; }
.opt[aria-checked="true"] .glyph { background: var(--accent); }
.glyph.circle { border-radius: 50%; }
.sub-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { border: 1.5px solid var(--line); background: var(--paper); border-radius: 99px; padding: 6px 14px; cursor: pointer; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.chip[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip em { font-style: normal; font-size: 11.5px; background: var(--ok-soft); color: var(--ok); padding: 0 6px; border-radius: 99px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label, .field .lbl { font-weight: 600; font-size: 14px; }
.field input[type="text"], .field input[type="tel"], .field input[type="url"], .field input[type="number"] { border: 1.5px solid var(--line); border-radius: 9px; padding: 9px 12px; background: var(--paper); width: 100%; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.days-input { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.days-input input { width: 84px; border: 1.5px solid var(--line); border-radius: 9px; padding: 6px 10px; text-align: center; }
.drop { border: 1.5px dashed #C6CCDB; border-radius: 12px; padding: 18px; display: flex; gap: 14px; align-items: center; cursor: pointer; background: var(--soft); }
.drop:hover { border-color: var(--accent); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.drop .thumb { width: 64px; height: 64px; border-radius: 8px; background: var(--paper) center/cover no-repeat; border: 1px solid var(--line); flex: none; display: grid; place-items: center; color: var(--muted); font-size: 22px; }
.drop .t { display: grid; gap: 2px; min-width: 0; }
.drop .t b { font-size: 14.5px; }
.seg { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; border-radius: 8px; padding: 6px 14px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(20,22,31,.12); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.sw[aria-checked="true"] { box-shadow: 0 0 0 2px var(--accent); }
.bank { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; }
.bank dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; font-size: 14px; }
.bank dt { color: var(--muted); }
.bank dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.iban { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.iban code { font-family: ui-monospace, Consolas, monospace; direction: ltr; unicode-bidi: isolate; font-size: 14px; }

.summary { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 14px; background: var(--paper); }
.prev-stage { background: var(--soft); border-radius: 10px; height: 190px; display: grid; place-items: center; padding: 14px; background-image: linear-gradient(var(--cell-line) 1px, transparent 1px), linear-gradient(90deg, var(--cell-line) 1px, transparent 1px); background-size: 20px 20px; }
.prev-stage .ad { box-shadow: 0 6px 18px rgba(20,22,31,.14); }
.prev-empty { color: var(--muted); font-size: 13px; text-align: center; }
.lines { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; font-size: 14px; }
.lines dt { color: var(--muted); }
.lines dd { margin: 0; text-align: end; font-weight: 500; }
.total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 12px; }
.total b { font-family: var(--display); font-size: 26px; }
.errors { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin: 0; padding-inline-start: 28px; }
.mbar { display: none; }
.done { max-width: 560px; margin: 40px auto; text-align: center; display: grid; gap: 14px; justify-items: center; }
.done .big-num { font-family: var(--display); font-size: 34px; }
.done .actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

@media (max-width: 900px) {
  .adv-grid { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .mbar { display: flex; position: fixed; inset: auto 0 0 0; z-index: 25; background: var(--paper); border-top: 1px solid var(--line); padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); align-items: center; justify-content: space-between; gap: 12px; }
  .mbar b { font-family: var(--display); font-size: 20px; }
}
@media (max-width: 520px) { .row2 { grid-template-columns: minmax(0, 1fr); } }

/* admin */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 20px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { display: block; font-family: var(--display); font-size: 26px; line-height: 1.3; }
.tabs { display: flex; gap: 4px; margin-top: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .count { font-size: 12px; background: var(--soft); border-radius: 99px; padding: 0 7px; margin-inline-start: 4px; }
.list { display: grid; gap: 12px; margin-top: 16px; }
.req { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; }
.req-prev { background: var(--soft); border-radius: 10px; display: grid; place-items: center; min-height: 130px; padding: 10px; }
.req-body { display: grid; gap: 10px; min-width: 0; }
.req-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.req-head strong { font-size: 17px; }
.req-head .num { color: var(--muted); font-size: 13px; }
.pill { font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 99px; background: var(--soft); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--accent-soft); color: var(--accent); }
.req dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 16px; font-size: 13.5px; }
.req dl div { min-width: 0; }
.req dt { color: var(--muted); font-size: 12px; }
.req dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.req-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.req-actions .note { color: var(--warn); font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 40px 16px; border: 1px dashed var(--line); border-radius: 14px; }
@media (max-width: 600px) { .req { grid-template-columns: minmax(0, 1fr); } }
.price-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; }
.price-table { border-collapse: collapse; width: 100%; min-width: 460px; }
.price-table th, .price-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: start; }
.price-table tr:last-child td { border-bottom: 0; }
.price-table th { font-size: 13px; color: var(--muted); font-weight: 600; background: var(--soft); }
.price-table input { width: 90px; border: 1.5px solid var(--line); border-radius: 8px; padding: 6px 8px; text-align: center; }
.price-table .dim { color: var(--muted); font-size: 12px; display: block; }
.settings-grid { display: grid; gap: 14px; margin-top: 22px; max-width: 720px; }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(20,22,31,.55); display: grid; place-items: center; padding: 20px; }
.modal { background: var(--paper); border-radius: 16px; padding: 24px; max-width: 420px; width: 100%; display: grid; gap: 12px; text-align: center; justify-items: center; }
.modal img { max-height: 70vh; border-radius: 8px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; z-index: 50; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 10px; font-weight: 500; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(20,22,31,.25); }
@media (max-width: 900px) { .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } .slot { transition: none; } .ad.fx-blink, .ad.fx-rainbow { animation-duration: 4s; } }

/* ---- real-site additions ---- */
body { margin: 0; }
img { max-width: 100%; }
.brand-name { direction: ltr; }
.site-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.site-foot .inner { padding-block: 18px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.site-foot a { color: var(--muted); }
.ts-box { min-height: 65px; }
.pay-box { border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 12px; max-width: 520px; margin: 24px auto; }
.loading { color: var(--muted); text-align: center; padding: 40px 0; }
.prose { max-width: 70ch; display: grid; gap: 10px; }
.prose h2 { margin-top: 14px; }
.prose p, .prose li { color: var(--ink); }
