/* Al-Gedaan website: mobile-first app shell, one step per screen. Flat: space, weight and tints separate, no cards or capsules. */
:root {
    --outer: #fff; --bg: #fff; --surface: #fff; --surface-2: #f2f5f3; --surface-3: #e8eeea; --text: #13201a; --muted: #5f6f66; --line: #e3e9e5;
    --brand: #047857; --brand-btn: #059669; --brand-hover: #047857; --brand-50: #e9f5ef; --on-brand: #fff;
    --accent: #b45309; --accent-50: #fdf3e1; --danger: #b42318; --danger-50: #fdecea; --wa: #16a34a;
    --shadow: none;
    --hero: #064e3b;
    --gut: 16px; --r: 10px;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --outer: #0d1310; --bg: #0d1310; --surface: #0d1310; --surface-2: #151e19; --surface-3: #1c2721; --text: #e6eee9; --muted: #9aaea2; --line: #222e28;
        --brand: #34d399; --brand-hover: #10b981; --brand-50: #12302a; --accent: #fbbf24; --accent-50: #2b2213; --danger: #f87171; --danger-50: #3a1716;
        --hero: #053a2d;
    }
}
:root[data-theme="dark"] {
    --outer: #0d1310; --bg: #0d1310; --surface: #0d1310; --surface-2: #151e19; --surface-3: #1c2721; --text: #e6eee9; --muted: #9aaea2; --line: #222e28;
    --brand: #34d399; --brand-hover: #10b981; --brand-50: #12302a; --accent: #fbbf24; --accent-50: #2b2213; --danger: #f87171; --danger-50: #3a1716;
    --hero: #053a2d;
}
@media (min-width: 640px) { :root { --gut: max(24px, calc((100vw - 600px) / 2)); } }
@media (min-width: 1024px) { :root { --gut: 20vw; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[x-cloak] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 Tajawal, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: Cairo, Tajawal, sans-serif; line-height: 1.35; margin: 0 0 .35em; }
h1 { font-size: 1.55rem; font-weight: 800; }
h2 { font-size: 1.08rem; font-weight: 800; margin-top: 30px; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .xs { font-size: .78rem; }
.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.center { text-align: center; }
.ltr { direction: ltr; text-align: right; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--brand-btn); outline-offset: 2px; }

/* App shell: full screen at every width; content sits in the middle column set by --gut */
.app { width: 100%; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); position: relative; overflow: hidden; }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.appbar { display: flex; align-items: center; gap: 6px; padding: 6px max(8px, calc(var(--gut) - 8px)); min-height: 60px; background: var(--bg); flex: none; }
.appbar .title { flex: 1; text-align: center; font-weight: 800; font-family: Cairo; font-size: 1rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin: 0; }
.appbar .slot { width: 44px; height: 44px; display: grid; place-items: center; flex: none; }
.icon-btn { width: 44px; height: 44px; border-radius: var(--r); border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--text); font-size: 1.1rem; }
.icon-btn:hover { background: var(--surface-2); }
.logo-mark { width: 36px; height: 36px; border-radius: 8px; background: var(--brand-btn); color: #fff; display: grid; place-items: center; }
.stepbar { padding: 0 var(--gut) 12px; background: var(--bg); flex: none; }
.stepbar .track { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.stepbar .fill { height: 100%; background: var(--brand-btn); transition: width .3s; }
.stepbar .lbl { font-size: .78rem; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; }
.view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 20px var(--gut) 36px; overscroll-behavior: contain; animation: inF .2s ease; }
@keyframes inF { from { opacity: 0; } }
.cta { padding: 12px var(--gut) calc(12px + env(safe-area-inset-bottom)); background: var(--surface-2); display: grid; gap: 6px; flex: none; }
.tabbar { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface-2); padding: 6px max(4px, var(--gut)) calc(6px + env(safe-area-inset-bottom)); flex: none; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .76rem; color: var(--muted); padding: 4px; position: relative; }
.tabbar a i { font-size: 1.2rem; }
.tabbar a.on { color: var(--brand); font-weight: 800; }
.tabbar .dot { position: absolute; top: 0; inset-inline-start: calc(50% + 6px); background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; border-radius: 8px; padding: 0 5px; line-height: 1.5; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--r); padding: 12px 18px; font-weight: 700; cursor: pointer; background: var(--surface-2); color: var(--text); min-height: 48px; transition: background .12s; width: 100%; text-align: center; }
.btn:hover { background: var(--surface-3); }
.btn[disabled], .btn[data-loading] { opacity: .6; pointer-events: none; }
.btn-primary { background: var(--brand-btn); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-50); }
.btn-outline { background: var(--surface-2); }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: .88rem; border-radius: 8px; width: auto; }
.btn-danger { background: var(--danger-50); color: var(--danger); }
.link { background: none; border: 0; color: var(--brand); font-weight: 700; cursor: pointer; padding: 0; }

/* Journey pieces: options are tinted rows, not boxed cards */
.q-lead { font-size: .82rem; font-weight: 700; color: var(--brand); margin-bottom: 4px; }
.sub { color: var(--muted); margin-bottom: 24px; }
.choice { display: flex; gap: 14px; align-items: center; width: 100%; text-align: start; padding: 16px; border: 0; border-radius: var(--r); background: var(--surface-2); cursor: pointer; margin-bottom: 8px; color: var(--text); transition: background .12s; }
.choice:hover { background: var(--surface-3); }
.choice b { display: block; font-family: Cairo; font-size: 1.05rem; }
.choice .s { display: block; color: var(--muted); font-size: .88rem; }
.choice .chev { margin-inline-start: auto; color: var(--muted); }
.choice.hl { background: var(--brand-50); }
.choice.hl:hover { background: color-mix(in srgb, var(--brand-50) 70%, var(--brand-btn) 12%); }
.ibox { width: 44px; height: 44px; border-radius: var(--r); display: grid; place-items: center; background: transparent; color: var(--brand); font-size: 1.25rem; flex: none; }
.ibox.sm { width: 36px; height: 36px; font-size: 1.05rem; }
.ibox.acc { color: var(--accent); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { min-height: 120px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 16px; border: 0; border-radius: var(--r); background: var(--surface-2); cursor: pointer; text-align: start; color: var(--text); transition: background .12s; }
.tile:hover { background: var(--surface-3); }
.tile b { font-family: Cairo; font-size: .98rem; line-height: 1.35; display: block; }
.tile small { color: var(--muted); font-size: .78rem; }
.rowbtn { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px; margin-inline: -12px; width: calc(100% + 24px); border: 0; border-radius: var(--r); background: transparent; margin-bottom: 2px; text-align: start; cursor: pointer; color: var(--text); transition: background .12s; }
.rowbtn:hover { background: var(--surface-2); }
.rowbtn.static { cursor: default; }
.rowbtn.static:hover { background: transparent; }
.rowbtn.dashed { background: var(--surface-2); margin-inline: 0; width: 100%; }
.rowbtn .chev { margin-inline-start: auto; color: var(--muted); font-size: .85rem; }
.rowbtn .t { flex: 1; min-width: 0; }
.rowbtn .t b { display: block; }
.rowbtn .t span { display: block; font-size: .8rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 0; background: var(--surface-2); border-radius: 8px; padding: 8px 14px; cursor: pointer; color: var(--text); font-weight: 500; }
.chip:hover { background: var(--surface-3); }
.chip.on { background: var(--brand-50); color: var(--brand); font-weight: 700; }
.chip small { color: var(--muted); margin-inline-start: 4px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--brand-50); color: var(--brand); }
.pill.acc { background: var(--accent-50); color: var(--accent); }
.card { background: var(--surface-2); border: 0; border-radius: var(--r); padding: 16px; }
.soft { background: var(--surface-2); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--brand-50); color: var(--brand); font-size: .88rem; margin-bottom: 14px; }
.notice.warn { background: var(--accent-50); color: var(--accent); }
.notice.err { background: var(--danger-50); color: var(--danger); }

/* Inputs: tinted fields, the brand colour shows only on focus */
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { font-weight: 700; }
.hint { font-size: .82rem; color: var(--muted); }
.err { font-size: .85rem; color: var(--danger); }
.field.invalid .input { border-color: var(--danger); background: var(--danger-50); }
.input { width: 100%; border: 1.5px solid transparent; background: var(--surface-2); border-radius: var(--r); padding: 12px 14px; min-height: 50px; outline: none; }
.input:focus { border-color: var(--brand-btn); background: var(--bg); }
.input.big { font-size: 1.2rem; min-height: 58px; }
textarea.input { min-height: 120px; resize: vertical; }
.pw { position: relative; }
.pw .input { padding-inline-end: 52px; }
.pw button { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; width: 44px; height: 44px; }
.searchfield { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0 6px 0 14px; padding-inline: 14px 6px; min-height: 54px; border: 1.5px solid transparent; border-radius: var(--r); background: var(--surface-2); color: var(--muted); cursor: text; text-align: start; }
.searchfield:focus-within { border-color: var(--brand-btn); background: var(--bg); }
.searchfield input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; font-size: 1.05rem; color: var(--text); min-height: 50px; }

/* Companies: list rows, no boxes */
.logo-tile { width: 52px; height: 52px; border-radius: var(--r); display: grid; place-items: center; font-family: Cairo; font-weight: 800; font-size: 1.05rem; flex: none; color: #fff; overflow: hidden; background: var(--brand-btn); }
.logo-tile img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.co-card { display: flex; gap: 14px; align-items: center; padding: 12px; margin-inline: -12px; width: calc(100% + 24px); border: 0; border-radius: var(--r); background: transparent; margin-bottom: 2px; text-align: start; color: var(--text); transition: background .12s; }
.co-card:hover { background: var(--surface-2); }
.co-card .t { flex: 1; min-width: 0; }
.co-card b { display: block; font-family: Cairo; }
.co-card .m { font-size: .8rem; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hscroll { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex: 0 0 72%; scroll-snap-align: start; }
.feat { padding: 0; background: transparent; text-align: start; color: var(--text); display: grid; gap: 8px; align-content: start; }
.feat p { font-size: .85rem; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.co-top { text-align: center; padding: 4px 0 8px; }
.co-top .logo-tile { width: 80px; height: 80px; font-size: 1.7rem; border-radius: 14px; margin: 0 auto 12px; }
.photo { aspect-ratio: 4 / 3; border-radius: var(--r); display: grid; place-items: center; color: #fff; font-size: 1.5rem; position: relative; overflow: hidden; border: 0; background: var(--surface-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo span { position: absolute; bottom: 0; inset-inline: 0; padding: 6px 10px; font-size: .78rem; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); text-align: start; color: #fff; }
.hscroll .photo { flex-basis: 62%; }
.done-ic { width: 80px; height: 80px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-size: 2.1rem; margin: 10px auto 18px; }
.done-ic.muted { background: var(--surface-2); color: var(--muted); }
.meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand-btn); }
.next { background: var(--brand-50); border-radius: var(--r); padding: 18px; }
.msg { display: flex; gap: 12px; padding: 12px; margin-inline: -12px; width: calc(100% + 24px); border: 0; border-radius: var(--r); background: transparent; margin-bottom: 2px; text-align: start; cursor: pointer; color: var(--text); transition: background .12s; }
.msg:hover { background: var(--surface-2); }
.msg.unread { background: var(--brand-50); font-weight: 600; }
.msg .d { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-btn); margin-top: 9px; flex: none; }
.msg.read .d { background: transparent; }
.dropzone { display: block; border: 1.5px dashed var(--surface-3); border-radius: var(--r); padding: 34px 16px; text-align: center; cursor: pointer; background: var(--surface-2); }
.dropzone:hover { border-color: var(--brand-btn); background: var(--brand-50); }

/* Sheet, chat, toast */
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); z-index: 20; }
.sheet { position: absolute; inset-inline: 0; bottom: 0; background: var(--bg); border-radius: 16px 16px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); z-index: 21; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 0 auto 14px; }
.bubble { max-width: 86%; padding: 10px 14px; border-radius: 12px; font-size: .95rem; margin-bottom: 10px; word-break: break-word; }
.bubble p:last-child { margin: 0; }
.bubble.bot { background: var(--surface-2); border-start-start-radius: 4px; }
.bubble.me { background: var(--brand-btn); color: #fff; margin-inline-start: auto; border-start-end-radius: 4px; white-space: pre-wrap; }
.toast-wrap { position: absolute; top: 70px; inset-inline: 0; display: grid; justify-items: center; gap: 8px; z-index: 30; pointer-events: none; padding: 0 16px; }
.toast { background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: var(--r); font-weight: 700; display: flex; gap: 8px; align-items: center; font-size: .92rem; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Landing page: one solid band for search, then plain sections */
.landing-hero { background: var(--hero); color: #fff; margin: 0 calc(-1 * var(--gut)); padding: 28px var(--gut) 26px; }
.landing-hero h1 { font-size: 1.5rem; margin: 0 0 4px; }
.landing-hero p { color: #cfe7dc; font-size: .92rem; margin: 0 0 16px; }
.landing-hero .searchfield { background: #fff; color: #5f6f66; }
.landing-hero .searchfield input { color: #13201a; }
.landing-hero .searchfield .btn { flex: none; }
.hero-chips { margin-top: 12px; }
.hero-chips .chip { background: rgba(255, 255, 255, .1); color: #fff; padding: 5px 12px; font-size: .85rem; }
.hero-chips .chip:hover { background: rgba(255, 255, 255, .2); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 34px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 700; white-space: nowrap; }
.carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; scroll-padding: 0 16px; }
.carousel::-webkit-scrollbar { display: none; }
.ann { flex: 0 0 100%; scroll-snap-align: start; border-radius: var(--r); overflow: hidden; color: #fff; display: flex; flex-direction: column; min-height: 140px; }
.ann img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.ann-body { padding: 18px; display: grid; gap: 6px; align-content: start; }
.ann-body h3 { margin: 0; font-size: 1.1rem; font-family: Cairo; }
.ann-body p { margin: 0; font-size: .9rem; opacity: .9; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ann-kind { font-size: .75rem; font-weight: 700; opacity: .8; }
.ann-btn { background: #fff; color: #13201a; justify-self: start; margin-top: 6px; }
.ann-btn:hover { background: #f2f5f3; }
.tone-brand { background: var(--hero); }
.tone-accent { background: #b45309; }
.tone-dark { background: #1e293b; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.dots span { width: 6px; height: 6px; border-radius: 3px; background: var(--surface-3); transition: .2s; }
.dots span.on { width: 18px; background: var(--brand-btn); }
.promo { display: flex; flex-direction: column; gap: 10px; background: transparent; color: var(--text); }
.promo-cover { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--surface-2); display: block; transition: opacity .12s; }
.promo:hover .promo-cover { opacity: .9; }
.promo-cover img { width: 100%; height: 100%; object-fit: cover; }
.promo-tag { position: absolute; top: 8px; inset-inline-start: 8px; }
.promo-body { display: flex; gap: 10px; align-items: center; position: relative; }
.promo-body .logo-tile { width: 40px !important; height: 40px !important; }
.promo-body b { display: block; font-family: Cairo; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promo-body .m { display: block; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.showcase { display: flex; gap: 14px; align-items: center; padding: 10px 12px; margin-inline: -12px; width: calc(100% + 24px); border-radius: var(--r); background: transparent; margin-bottom: 2px; color: var(--text); transition: background .12s; }
.showcase:hover { background: var(--surface-2); }
.showcase-media { width: 96px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; display: grid; place-items: center; color: #fff; font-size: 1.3rem; flex: none; }
.showcase-media img { width: 100%; height: 100%; object-fit: cover; }
.showcase .t { flex: 1; min-width: 0; }
.showcase b { display: block; font-family: Cairo; }
.showcase .m2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .82rem; color: var(--muted); }
a.photo { display: grid; }
.promo-cover .promo-icon { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.2rem; color: var(--brand); opacity: .3; }
.preview-strip { flex: none; background: var(--accent-50); color: var(--accent); font-size: .76rem; font-weight: 700; padding: 6px var(--gut); text-align: center; }

/* Wider screens: same flat page, the scrolling rows show more at once */
@media (min-width: 640px) {
    .hscroll, .carousel { margin: 0; padding-inline: 0; scroll-padding: 0; }
    .hscroll > *, .hscroll .photo { flex-basis: calc((100% - 16px) / 2); }
    .sheet { inset-inline: var(--gut); }
    .tiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (min-width: 1024px) {
    .hscroll > *, .hscroll .photo { flex-basis: calc((100% - 32px) / 3); }
    .ann img { max-height: 320px; }
}
