:root {
  color-scheme: light only;
  --bg: #f0f2f5; --card: #ffffff; --ink: #1d2733; --muted: #6b7580;
  --brand: #0070cd; --brand-soft: #e7f1fc; --accent: #f2a65a;
  --line: #dde4ee; --danger: #c8553d; --ok: #2e9e5b; --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Almarai", "Tajawal", system-ui, sans-serif; font-size: 16px; line-height: 1.6;
}
.wrap { max-width: 520px; margin: 0 auto; padding: 16px 16px 48px; }
header.hero { text-align: center; padding: 20px 8px 8px; }
.logo {
  width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-size: 30px; font-weight: 700;
}
h1 { font-size: 22px; margin: 0; }
.sub { color: var(--muted); margin: 2px 0 0; font-size: 15px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-top: 16px;
}
h2 { font-size: 17px; margin: 0 0 12px; }
.step { color: var(--brand); font-weight: 700; margin-inline-end: 4px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chip, .slot {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 10px 12px; font: inherit; cursor: pointer; white-space: nowrap;
}
.chip small { display: block; color: var(--muted); font-size: 12px; }
.chip.on, .slot.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.on small { color: #dbe9fb; }
.chip:disabled, .slot:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hint { color: var(--muted); font-size: 14px; }
label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: 15px; }
input, textarea, select {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type { border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; cursor: pointer; }
.type input { display: none; }
.type.on { border-color: var(--brand); background: var(--brand-soft); }
.type b { display: block; }
.btn {
  display: block; width: 100%; margin-top: 16px; padding: 13px; border: 0; border-radius: 12px;
  background: var(--brand); color: #fff; font: inherit; font-weight: 700; font-size: 17px;
  cursor: pointer; text-align: center; text-decoration: none;
}
.btn.wa { background: #25d366; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn:disabled { opacity: .5; }
.err { color: var(--danger); font-size: 14px; margin-top: 8px; min-height: 1em; }
.summary div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.summary div:last-child { border: 0; }
.done-icon { font-size: 44px; text-align: center; color: var(--ok); }
.addr { font-size: 14px; color: var(--muted); }
.addr a { color: var(--brand); }
.hidden { display: none !important; }
footer { text-align: center; color: var(--muted); font-size: 13px; margin-top: 24px; }
/* admin */
.row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.bk { border-bottom: 1px solid var(--line); padding: 10px 0; }
.bk:last-child { border: 0; }
.bk .t { font-weight: 700; color: var(--brand); min-width: 70px; }
.bk .actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.mini { font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); text-decoration: none; }
.mini.red { color: var(--danger); border-color: #f0c9bf; }
.mini.green { color: #178a47; border-color: #bfe5cf; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); }
.badge.f { background: #fdf0e1; color: #b0672a; }
.free { color: var(--muted); font-size: 14px; }
.logo-img { display: block; width: 180px; max-width: 60%; margin: 0 auto 6px; mix-blend-mode: multiply; }
/* v2 */
.center { text-align: center; }
.doc-hero { position: relative; margin: 8px -16px 0; background: linear-gradient(180deg,#a9cfdc 0%,#cfe4ea 100%); border-radius: 0 0 24px 24px; overflow: hidden; }
.doc-photo { display: block; width: 100%; max-height: 380px; object-fit: cover; object-position: center top; }
.doc-card { position: absolute; left: 12px; right: 12px; bottom: 12px; background: rgba(255,255,255,.93); backdrop-filter: blur(6px); border-radius: 16px; padding: 12px 14px; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.doc-card h1 { font-size: 22px; color: var(--brand); }
.doc-title { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.logo-mini { height: 34px; display: block; margin: 0 auto 2px; mix-blend-mode: multiply; }
.stars-line { margin-top: 4px; color: #e0a100; font-weight: 700; font-size: 14px; }
.btn.small { font-size: 15px; padding: 10px; margin-top: 12px; }
.rev { border-bottom: 1px solid var(--line); padding: 10px 0; }
.rev:last-child { border: 0; }
.rev p { margin: 4px 0; }
.stars { color: #f0a500; letter-spacing: 2px; font-size: 18px; }
.addr-card { margin-top: 18px; padding: 18px 16px; border-radius: 18px; text-align: center; color: #fff;
  background: linear-gradient(135deg, #ff7a59 0%, #f2a65a 100%); box-shadow: 0 8px 22px rgba(242,122,89,.35); }
.addr-icon { font-size: 30px; line-height: 1; }
.addr-label { font-size: 14px; font-weight: 600; opacity: .95; margin-top: 4px; }
.addr-text { font-size: 19px; font-weight: 700; line-height: 1.7; margin: 6px 0 12px; }
.addr-btn { display: inline-block; background: #fff; color: #d65a33; font-weight: 700; padding: 10px 18px; border-radius: 999px; text-decoration: none; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat { background: var(--brand-soft); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 22px; color: var(--brand); }
.stat span { font-size: 13px; color: var(--muted); }
.tabs { display: flex; gap: 6px; margin-top: 12px; }
.tabs button { flex: 1; font: inherit; padding: 9px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.tabs button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.badge.ok { background: #e2f5ea; color: #178a47; }
.badge.no { background: #fbe4df; color: #c8553d; }
.rating-pick { display: flex; justify-content: center; gap: 6px; font-size: 38px; direction: ltr; }
.rating-pick button { background: none; border: 0; font-size: inherit; color: #ccc; cursor: pointer; padding: 0 2px; }
.rating-pick button.on { color: #f0a500; }

/* v3: pointing hero */
.hero-a { position: relative; margin: -16px -16px 0; height: min(133vw, 640px);
  background: #82b2c0 url(doctor.jpg?v=9) -8vw top / auto 100% no-repeat; }
.hero-a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.hero-txt { position: absolute; top: 3%; right: 10px; width: 44%; }
.hero-logo { filter: drop-shadow(0 2px 3px rgba(0,0,0,.28)); display: block; width: 78%; max-width: 190px; height: auto; margin: 0 0 6px auto; }
.hero-txt h1 { margin: 26px 0 4px; font-size: clamp(18px, 5.3vw, 30px); font-weight: 800; white-space: nowrap; text-align: right; direction: rtl; margin-right: 0; width: max-content; max-width: none; margin-left: auto; color: #0f3d4a; line-height: 1.3; }
.hero-txt p { margin: 0; font-size: clamp(13.5px, 3.8vw, 16px); font-weight: 700; color: #1b5566; line-height: 1.6; }
.hero-txt .stars-line { color: #c98a00; }
.hero-cta { position: absolute; right: 10px; top: 60%; background: #e4131b; color: #fff; font-weight: 800;
  font-size: clamp(15px, 4.4vw, 18px); padding: 11px 18px; border-radius: 999px; text-decoration: none;
  box-shadow: 0 8px 20px rgba(228,19,27,.4); }
#bookView { position: relative; z-index: 3; margin-top: -24px; scroll-margin-top: 10px; }
/* v6 vaccines */
.types { grid-template-columns: repeat(3, 1fr); }
.vax { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vx { display: flex; align-items: center; gap: 6px; margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font-weight: 600; font-size: 14px; cursor: pointer; background: #fff; }
.vx input { width: auto; accent-color: var(--brand); margin: 0; }
.vx.on { border-color: var(--brand); background: var(--brand-soft); }
.badge.v { background: #ece6fb; color: #5b3fb0; }
.vline { font-size: 14px; font-weight: 700; color: #5b3fb0; margin-top: 2px; }

@media (min-width: 520px) { .hero-a { background-position: -60px top; } }

/* v13 blue/red */
.btn { background: #e4131b; }
.btn.blue { background: var(--brand); }
.type .ic { display: block; font-size: 22px; margin-top: 2px; }
.step { background: var(--brand); color: #fff; border-radius: 50%; display: inline-grid; place-items: center; width: 24px; height: 24px; font-size: 14px; margin-inline-end: 6px; }
.badge.cf { background: #e2f5ea; color: #178a47; }
.badge.wait { background: #eef1f5; color: #6b7580; }
.act-btns .btn { margin-top: 10px; }
.bk-info { text-align: center; font-size: 17px; line-height: 1.9; margin: 6px 0 4px; }
.warn { color: #c8553d; font-weight: 700; font-size: 14px; margin: 4px 0; }
.hist { background: #f5f7fa; border-radius: 10px; padding: 8px 10px; margin-top: 8px; font-size: 14px; line-height: 1.9; }
.bk.focus { background: #fff6cc; box-shadow: 0 0 0 3px #ffb703; border-radius: 12px; transition: background .6s; }
.bk { transition: background .6s, box-shadow .6s; }

/* v17 motion */
.logo-wrap { position: relative; width: 78%; max-width: 190px; margin: 0 0 6px auto; }
.logo-wrap .hero-logo { width: 100%; max-width: none; margin: 0; }
.pen { display: none; }
.check { display: block; width: 72px; height: 72px; margin: 4px auto 6px; }
.check circle { fill: #e2f5ea; stroke: #2e9e5b; stroke-width: 2.5; }
.check path { fill: none; stroke: #2e9e5b; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.yay { text-align: center; font-size: 22px; color: var(--brand); margin: 4px 0 12px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 999; }
.motion .hero-logo { animation: write 1.5s cubic-bezier(.5,.1,.4,1) .15s both; }
.motion .pen { display: block; position: absolute; top: 48%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
  background: #1d2733; box-shadow: 0 0 0 3px rgba(255,183,3,.45); animation: pen 1.5s cubic-bezier(.5,.1,.4,1) .15s both; }
@keyframes write { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes pen { 0% { right: 0; opacity: 1; transform: translateY(-14px); } 25% { transform: translateY(10px); } 50% { transform: translateY(-8px); } 75% { transform: translateY(12px); } 95% { opacity: 1; } 100% { right: 100%; opacity: 0; transform: translateY(0); } }
.motion .hero-txt h1, .motion .hero-txt p { animation: fadeUp .6s ease 1.3s both; }
.motion .hero-cta { animation: fadeUp .6s ease 1.6s both, nudge 2.4s ease-in-out 2.4s infinite; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes nudge { 0%, 80%, 100% { transform: none; } 88% { transform: translateY(4px); } }
.motion .reveal { opacity: 0; transform: translateY(28px); transition: opacity .55s ease, transform .55s ease; }
.motion .reveal.in { opacity: 1; transform: none; }
.motion .slot.pop { animation: pop .32s cubic-bezier(.3,1.5,.6,1) both; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.85); } to { opacity: 1; transform: none; } }
.check.go circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .6s ease forwards; }
.check.go path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s ease .55s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.motion .yay { animation: fadeUp .5s ease .8s both; }
/* v19 admin alternating booking colors */
#list .bk { border: 0; border-radius: 12px; padding: 12px; margin-bottom: 10px; }
#list .bk:nth-child(odd) { background: #e3effd; }
#list .bk:nth-child(even) { background: #d4f1fb; }
#list .bk:last-child { margin-bottom: 0; }
/* v20 source icons */
.si { width: 22px; height: 22px; flex: none; display: inline-block; vertical-align: middle; }
.si.em { font-size: 19px; line-height: 22px; text-align: center; }
.srcs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.srcb { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 10px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; text-align: right; }
.srcb.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.srcline { display: inline-flex; align-items: center; gap: 6px; }
.srcline .si { width: 18px; height: 18px; }
.srcline .si.em { font-size: 15px; line-height: 18px; }
