:root {
  --brand: #e8590c;
  --ink: #111418;
  --muted: #5f6b7a;
  --bg: #f4f3f0;
  --card: #ffffff;
  --line: #e6e3de;
  --ok: #15803d;
  --ok-bg: #e8f6ec;
  --warn: #9a5b00;
  --warn-bg: #fff4dd;
  --wa: #1fa855;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(17, 20, 24, 0.05), 0 8px 24px rgba(17, 20, 24, 0.06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2f4f7;
    --muted: #9aa5b4;
    --bg: #0c0f14;
    --card: #151a22;
    --line: #262d38;
    --ok: #4ade80;
    --ok-bg: #12301f;
    --warn: #fbbf24;
    --warn-bg: #33270d;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "SF Arabic", "Segoe UI", "Noto Sans Arabic", "Noto Sans", Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
svg { fill: currentColor; }

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
.wrap.center { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 2px 14px; }
.venue { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex: none; }
.logo-initial { display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; }
.venue-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 7px 12px; font-size: 14px; cursor: pointer;
}
.lang-btn svg { width: 16px; height: 16px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 20px;
  margin-bottom: 14px;
}

.order { text-align: center; padding: 22px 20px 18px; position: relative; overflow: hidden; }
.order::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--brand);
}
.eyebrow { margin: 4px 0 0; color: var(--muted); font-size: 14px; letter-spacing: 0.02em; }
.num {
  margin: 0;
  font-size: clamp(76px, 30vw, 132px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}
.status {
  display: inline-block; margin: 6px 0 14px; padding: 6px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); font-weight: 700;
}
[data-status="ready"] .status { background: var(--ok-bg); color: var(--ok); }
[data-status="done"] .status { background: var(--ok-bg); color: var(--ok); }
[data-status="cancelled"] .status, [data-status="expired"] .status { background: var(--warn-bg); color: var(--warn); }

.steps { list-style: none; display: flex; justify-content: space-between; margin: 0 auto; padding: 0; max-width: 320px; counter-reset: s; }
.steps li { flex: 1; position: relative; font-size: 12px; color: var(--muted); padding-top: 22px; }
.steps li::before {
  content: ""; position: absolute; top: 3px; inset-inline-start: 50%; transform: translateX(50%);
  width: 12px; height: 12px; border-radius: 50%; background: var(--line);
}
[dir="ltr"] .steps li::before { transform: translateX(-50%); }
.steps li + li::after {
  content: ""; position: absolute; top: 8px; height: 2px; background: var(--line);
  inset-inline-end: calc(50% + 10px); width: calc(100% - 20px);
}
.steps li.done::before, .steps li.now::before { background: var(--brand); }
.steps li.done, .steps li.now { color: var(--ink); }
.steps li.done + li.done::after, .steps li.done + li.now::after { background: var(--brand); }
.steps li.now::before { box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 22%, transparent); animation: pulse 1.6s infinite; }
[data-status="ready"] .steps li::before, [data-status="done"] .steps li::before { background: var(--ok); }
.queue { margin: 14px 0 0; font-weight: 600; min-height: 1.5em; }
.queue small { color: var(--muted); font-weight: 500; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px; padding: 14px 18px; border: 0; border-radius: 16px;
  font-size: 18px; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 24px; height: 24px; flex: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary[disabled] { filter: saturate(0.4); opacity: 0.8; cursor: default; }
.btn-dark { background: var(--ink); color: var(--card); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-small { width: auto; min-height: 48px; font-size: 16px; padding: 10px 18px; background: var(--ink); color: var(--card); }
.btn-ready { background: #fff; color: #0f5132; font-size: 22px; min-height: 64px; margin-top: 8px; }
.btn-link { background: none; border: 0; padding: 8px; color: inherit; text-decoration: underline; cursor: pointer; font-size: 15px; }

.hint { margin: 8px 2px 0; color: var(--muted); font-size: 14px; text-align: center; }
.alerts > * + * { margin-top: 14px; }
.note { margin: 12px 0 0; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--brand) 8%, transparent); font-size: 15px; }
.note.ok { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.note.warn { background: var(--warn-bg); color: var(--warn); }

.verified {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px;
  background: var(--ok-bg); color: var(--ok); font-weight: 700;
}
.verified svg { width: 26px; height: 26px; flex: none; }
.sound-on {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 16px;
  background: var(--ok-bg); color: var(--ok); font-weight: 700;
}
[dir="rtl"] .sound-on { padding: 10px 16px 10px 10px; }
.sound-on svg { width: 22px; height: 22px; flex: none; }
.sound-on span { flex: 1; }
.sound-on .btn-link { color: inherit; font-weight: 700; font-size: 15px; padding: 6px 10px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid currentColor; border-top-color: transparent; animation: spin 0.8s linear infinite; flex: none; }

.phone label, .curb label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 15px; }
.phone-row { display: flex; gap: 8px; }
.phone-row input, textarea {
  flex: 1; min-width: 0; min-height: 48px; border: 1px solid var(--line); background: var(--bg);
  border-radius: 14px; padding: 10px 14px; font-size: 17px;
}
textarea { width: 100%; resize: vertical; margin: 12px 0 8px; }
.field-error { color: #c2410c; font-size: 14px; margin: 6px 0 0; }

.ios-steps { border: 1px dashed var(--line); border-radius: 14px; padding: 10px 14px; font-size: 15px; }
.ios-steps summary { cursor: pointer; font-weight: 600; }
.ios-steps p { margin: 8px 0 0; color: var(--muted); }

.chans { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.chans li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); }
.chans li::before {
  content: ""; width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 2px solid var(--line);
}
.chans li.on { color: var(--ink); }
.chans li.on::before {
  border-color: var(--ok); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/14px no-repeat;
}
.chans li.wait::before { border-color: var(--brand); border-top-color: transparent; animation: spin 0.9s linear infinite; }

.keep { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; cursor: pointer; }
.keep input { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background 0.2s; margin: 0; }
.keep input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: inset-inline-start 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.keep input:checked { background: var(--ok); }
.keep input:checked::after { inset-inline-start: 21px; }

.ready-sheet {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at 50% 30%, #22c55e, #15803d 70%); color: #fff; text-align: center;
  animation: flash 1.2s ease-in-out infinite alternate;
}
.ready-inner { width: 100%; max-width: 420px; }
.bell { width: 96px; height: 96px; margin: 0 auto 8px; border-radius: 50%; background: rgba(255,255,255,0.18); display: grid; place-items: center; animation: ring 1s ease-in-out infinite; }
.bell svg { width: 54px; height: 54px; fill: #fff; }
.ready-num { margin: 4px 0 0; font-size: clamp(80px, 32vw, 150px); font-weight: 800; line-height: 1; direction: ltr; font-variant-numeric: tabular-nums; }
.ready-title { margin: 8px 0 4px; font-size: 34px; }
.ready-sub { margin: 0 0 20px; font-size: 18px; opacity: 0.92; }
.ready-sheet .btn-link { color: #fff; margin-top: 8px; }
.ready-ack { font-weight: 700; font-size: 18px; margin-top: 12px; }
.ready-sheet.acked { animation: none; background: #15803d; }
.ready-sheet.acked .bell { animation: none; }

.stars { display: flex; justify-content: center; gap: 6px; margin: 8px 0 4px; direction: ltr; }
.stars button { font-size: 40px; line-height: 1; background: none; border: 0; color: var(--line); cursor: pointer; padding: 4px; }
.stars button.on { color: #f59e0b; }
.rate h2 { margin: 0 0 4px; }
.rate { text-align: center; }
#rateMore { margin-top: 14px; text-align: start; }

.conn { position: fixed; inset-inline: 16px; bottom: max(16px, env(safe-area-inset-bottom)); margin: 0 auto; max-width: 440px; padding: 10px 14px; border-radius: 12px; background: var(--ink); color: var(--card); text-align: center; font-size: 14px; z-index: 30; }
.foot { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.foot a { text-decoration: none; }

.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,0.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { width: 100%; max-width: 480px; background: var(--card); border-radius: 22px 22px 0 0; padding: 12px 12px max(16px, env(safe-area-inset-bottom)); max-height: 80vh; overflow: auto; }
.sheet-card ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet-card button { width: 100%; min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); font-size: 17px; cursor: pointer; }
.sheet-card button.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--card)); font-weight: 700; }

.landing-form { display: grid; gap: 12px; }
.landing-form input { min-height: 64px; font-size: 32px; text-align: center; border: 2px solid var(--line); border-radius: 16px; background: var(--bg); font-weight: 700; direction: ltr; }
.big-title { margin: 0 0 6px; font-size: 26px; text-align: center; }

@keyframes pulse { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--brand) 6%, transparent); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(6deg); } }
@keyframes flash { from { filter: brightness(1); } to { filter: brightness(1.12); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
