/* Farabi mobile — neutral surfaces + one accent (Alfarabi Scan blue #1E96D3). */
:root {
  --bg: #F5F6F8; --surface: #FFFFFF; --surface-2: #FAFBFC;
  --ink: #0F172A; --ink-2: #334155; --muted: #64748B; --faint: #94A3B8;
  --line: #E6E8EC; --line-2: #EEF0F3;
  --accent: #1E96D3; --accent-ink: #0B6FA4; --accent-soft: #EAF5FB; --on-accent: #FFFFFF;
  --ok: #15803D; --ok-soft: #ECFDF3; --warn: #B45309; --warn-soft: #FFF7E6; --bad: #B42318; --bad-soft: #FEF3F2;
  --r: 12px; --r-sm: 8px; --r-lg: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tab-h: 64px; --top-h: 56px;
  color-scheme: light;
}
html[lang="ar"] { --font: 'Cairo', 'Inter', system-ui, sans-serif; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.num, time, .price { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent-ink); text-decoration: none; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* shell */
#app { max-width: 520px; margin: 0 auto; min-height: 100%; background: var(--bg); position: relative; }
.top { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 8px; padding: 0 16px; background: rgba(245, 246, 248, .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; }
.top.scrolled { border-bottom-color: var(--line); }
.top h1 { flex: 1; margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.top .brand img { width: 34px; height: 34px; object-fit: contain; }
.top .brand b { font-size: 15px; font-weight: 650; display: block; }
.top .brand small { display: block; color: var(--muted); font-size: 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; position: relative; color: var(--ink-2); flex: none; }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.dot { position: absolute; top: 8px; inset-inline-end: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.lang-btn { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; }
main { padding: 12px 16px calc(var(--tab-h) + 28px + env(safe-area-inset-bottom)); }
main.no-tabs { padding-bottom: 32px; }

.tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; z-index: 30; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 11px; font-weight: 550; }
.tabs a.on { color: var(--accent-ink); }
.tabs a.on svg { stroke-width: 2.1; }
.tabs a.cta span.pill { width: 44px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.tabs a.cta.on span.pill { background: var(--accent-ink); }

/* type */
.h-xl { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 2px; }
.h-sec { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 10px; }
.h-sec h2 { margin: 0; font-size: 13px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
html[lang="ar"] .h-sec h2 { text-transform: none; letter-spacing: 0; font-size: 14px; }
.h-sec a { font-size: 13px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }

/* cards & lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card.pad { padding: 16px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.row { color: inherit; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line-2); cursor: pointer; background: none; border-inline: 0; border-bottom: 0; width: 100%; text-align: start; }
.row:first-child { border-top: 0; }
.row:active { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: 15px; }
.row .s { color: var(--muted); font-size: 13px; margin-top: 1px; }
.row .chev { color: var(--faint); }
.row.sel { background: var(--accent-soft); }
.row.sel .t { color: var(--accent-ink); }
.ava { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13px; }
.ava.n { background: #F1F3F6; color: var(--ink-2); }

.hero { padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.next { display: flex; gap: 14px; align-items: stretch; }
.cal { width: 58px; border-radius: 12px; border: 1px solid var(--line); text-align: center; overflow: hidden; flex: none; }
.cal .m { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 0; text-transform: uppercase; }
.cal .d { font-size: 22px; font-weight: 700; padding: 4px 0 0; }
.cal .w { font-size: 11px; color: var(--muted); padding-bottom: 5px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; color: var(--ink); min-height: 96px; }
.tile .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.tile b { font-size: 14px; font-weight: 600; }
.tile small { color: var(--muted); font-size: 12px; }
.qa { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.qa a { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); font-weight: 550; text-align: center; }
.qa a span { width: 52px; height: 52px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent-ink); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap; color: var(--ink-2); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: #F1F3F6; color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.acc { background: var(--accent-soft); color: var(--accent-ink); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

/* forms */
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 0 14px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: 88px; padding: 12px 14px; resize: none; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30, 150, 211, .15); }
.phone-wrap { display: flex; gap: 8px; direction: ltr; }
.phone-wrap .cc { width: 76px; text-align: center; color: var(--muted); display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); font-weight: 600; }
.otp { display: flex; gap: 10px; direction: ltr; justify-content: center; }
.otp input { width: 56px; height: 60px; text-align: center; font-size: 24px; font-weight: 700; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); outline: none; font-variant-numeric: tabular-nums; }
.otp input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30, 150, 211, .15); }

.btn { height: 50px; width: 100%; border-radius: var(--r); border: 1px solid transparent; background: var(--accent); color: var(--on-accent); font-weight: 650; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { background: var(--accent-ink); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.sec { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.dark { background: var(--ink); }
.btn.danger { background: var(--surface); color: var(--bad); border-color: var(--line); }
.btn.sm { height: 36px; width: auto; padding: 0 14px; font-size: 13px; border-radius: 9px; }
.btn.link { background: none; color: var(--accent-ink); height: auto; width: auto; padding: 6px; }
.btns { display: flex; gap: 8px; }

/* booking wizard */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 4px 0 18px; }
.steps i { height: 3px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--accent); }
.step-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day { flex: none; width: 60px; padding: 10px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: center; cursor: pointer; }
.day small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.day b { display: block; font-size: 20px; font-weight: 700; margin-top: 2px; }
.day.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.day.on small { color: #CBD5E1; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot { height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; direction: ltr; }
.slot.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.slot[disabled] { color: var(--faint); background: var(--surface-2); text-decoration: line-through; cursor: default; }
.sumrow { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.sumrow:first-child { border-top: 0; }
.sumrow span { color: var(--muted); }
.sumrow b { font-weight: 600; text-align: end; }
.sticky-cta { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); width: 100%; max-width: 520px; padding: 12px 16px; background: linear-gradient(to top, var(--bg) 70%, rgba(245, 246, 248, 0)); z-index: 25; }

.seg { display: grid; grid-template-columns: 1fr 1fr; background: #ECEEF2; border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.seg button { height: 34px; border: 0; border-radius: 8px; background: none; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }

.appt { padding: 16px; }
.appt + .appt { margin-top: 10px; }
.appt .top-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.appt .t { font-weight: 650; font-size: 15px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; color: var(--ink-2); font-size: 13px; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta svg.i { width: 16px; height: 16px; color: var(--muted); }
.appt .act { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; }

.report h3 { font-size: 13px; color: var(--muted); font-weight: 650; margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .05em; }
html[lang="ar"] .report h3 { text-transform: none; letter-spacing: 0; font-size: 14px; }
.report .body { font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.report .imp { background: var(--accent-soft); border-radius: var(--r); padding: 12px 14px; color: var(--ink); font-weight: 550; }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .ico { width: 56px; height: 56px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 14px; color: var(--faint); }
.skel { background: linear-gradient(90deg, #ECEEF2 0, #F4F5F7 50%, #ECEEF2 100%); background-size: 200% 100%; animation: sk 1.2s infinite linear; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }

.toast { position: fixed; left: 50%; transform: translate(-50%, 20px); bottom: calc(var(--tab-h) + 20px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 14px; font-weight: 550; opacity: 0; transition: .2s; z-index: 60; max-width: 90%; pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.banner { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 600; display: flex; gap: 8px; align-items: center; }

.sheet-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet h3 { margin: 0 0 14px; font-size: 17px; }

.login { min-height: 100vh; display: flex; flex-direction: column; padding: 24px 20px; }
.login .logo { width: 120px; margin: 28px auto 20px; display: block; }
.login h1 { font-size: 24px; font-weight: 700; margin: 0 0 6px; letter-spacing: -.02em; }
.login p.lead { color: var(--muted); margin: 0 0 24px; }
.login .foot { margin-top: auto; text-align: center; padding-top: 24px; }
.devcode { margin: 10px 0 18px; text-align: center; font-size: 13px; color: var(--muted); }
.devcode b { color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .15em; }

.profile-head { display: flex; gap: 14px; align-items: center; padding: 18px; }
.profile-head .ava { width: 56px; height: 56px; border-radius: 16px; font-size: 18px; }
.kv { display: flex; justify-content: space-between; padding: 14px 16px; border-top: 1px solid var(--line-2); font-size: 14px; }
.kv:first-child { border-top: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; direction: ltr; unicode-bidi: plaintext; }
.notif.unread .t::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-inline-end: 8px; vertical-align: 2px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
/* user/server free text may be in either language: let each paragraph pick its own direction */
.report .body, .row .t, .row .s, .appt .t, .appt .muted, .sumrow b, .tile b, .profile-head div { unicode-bidi: plaintext; }
.report .body { text-align: start; }
/* phase 2: reasons, FAQ, testimonials */
.radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--faint); flex: none; }
.row.sel .radio { border: 6px solid var(--accent); }
.faq details { border-top: 1px solid var(--line-2); }
.faq details:first-child { border-top: 0; }
.faq summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; font-weight: 600; font-size: 15px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary span { flex: 1; unicode-bidi: plaintext; }
.faq summary .chev { color: var(--faint); transform: rotate(90deg); transition: transform .15s; }
.faq details[open] summary .chev { transform: rotate(-90deg); }
.faq .ans { padding: 0 16px 16px; color: var(--ink-2); font-size: 14px; line-height: 1.65; unicode-bidi: plaintext; }
.tcar { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; scrollbar-width: none; }
.tcar::-webkit-scrollbar { display: none; }
.tcard { flex: none; width: 82%; scroll-snap-align: start; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.tcard blockquote { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); flex: 1; }
.tcard figcaption { display: flex; gap: 10px; align-items: center; }
.tcard figcaption b { display: block; font-size: 13px; }
.tcard figcaption small { display: block; font-size: 12px; color: var(--muted); }
.stars { color: #D4A017; font-size: 13px; letter-spacing: 1px; }
.stars span { color: var(--line); }
