:root {
  --bg: #f6f7f5;
  --card: #ffffff;
  --ink: #17201d;
  --muted: #5d6965;
  --line: #e1e5e2;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --brand-soft: #e3f2ef;
  --me: #0f766e;
  --bot: #ffffff;
  --warn: #b45309;
  --danger: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); font-weight: 600; text-decoration: none; color: var(--ink);
}
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); min-height: 40px; padding: 6px 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: 14px; }

/* ── Landing ── */
.hero { background: radial-gradient(120% 90% at 85% 0%, #dff3ee 0%, var(--bg) 60%); padding: 22px 0 8px; overflow: hidden; }
.cta { margin-top: 6px; box-shadow: 0 8px 20px rgba(15,118,110,.25); }
.cta-note { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.fan { position: relative; height: 250px; margin: 22px auto 0; max-width: 360px; }
.fan img { position: absolute; top: 0; width: 46%; border-radius: 8px; box-shadow: 0 12px 30px rgba(15,61,58,.22); background: #fff; }
.fan .f1 { left: 4%; top: 26px; transform: rotate(-9deg); }
.fan .f3 { right: 4%; top: 26px; transform: rotate(9deg); }
.fan .f2 { left: 27%; z-index: 2; animation: floaty 5s ease-in-out infinite; }
.fan .stag { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 3; background: rgba(23,32,29,.75); color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 999px; }
@keyframes floaty { 50% { transform: translateY(-6px); } }
.sec-title { font-size: 20px; margin: 26px 0 12px; }
.how { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: none; }
.how li { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.how .n { flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; }
.how b { display: block; } .how span { color: var(--muted); font-size: 14px; }
.landing .points { margin-bottom: 18px; }
@media (prefers-reduced-motion: reduce) { .fan .f2 { animation: none; } }

/* شاشة التوليد */
.gen .gen-icon { margin-bottom: 10px; display: flex; justify-content: center; animation: floaty 2.4s ease-in-out infinite; }
.gen-steps { list-style: none; padding: 0; margin: 16px auto 14px; text-align: start; display: inline-grid; gap: 8px; }
.gen-steps li { color: #a3ada9; padding-inline-start: 26px; position: relative; transition: color .3s; }
.gen-steps li::before { content: ''; position: absolute; inset-inline-start: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #cfd6d3; }
.gen-steps li.now { color: var(--ink); font-weight: 600; }
.gen-steps li.now::before { border-color: var(--brand); border-top-color: transparent; animation: spin 1s linear infinite; }
.gen-steps li.ok { color: var(--brand); }
.gen-steps li.ok::before { content: '✓'; border-color: var(--brand); background: var(--brand); color: #fff; font-size: 10px; display: grid; place-items: center; line-height: 1; }

/* شريط الدفع الثابت */
.sticky-buy { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-top: 1px solid var(--line); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); transition: transform .25s; }
.sticky-buy.hide { transform: translateY(110%); }
.sticky-buy .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sticky-buy b { font-size: 20px; color: var(--brand); }
.sticky-buy small { display: block; font-size: 12px; color: #92400e; }
.sticky-buy .btn { min-width: 140px; }
.save-note { background: #fff7e6; border: 1px solid #fde3a7; border-radius: 10px; padding: 8px 12px; font-size: 13px; color: #7a4b00; margin: 6px 0 10px; }

.landing { padding-bottom: 40px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
/* شعار سيرَتي */
.brandmark { display: inline-flex; align-items: center; gap: calc(var(--s) * .32); }
.brandmark .b-icon { width: calc(var(--s) * 1.15); height: calc(var(--s) * 1.15); display: block; flex: none; }
.brandmark .b-icon svg { width: 100%; height: 100%; display: block; }
.wordmark { font-weight: 800; color: #0f3d3a; font-size: var(--s, 30px); line-height: 1.35; position: relative; display: inline-block; padding-bottom: .05em; }
.brandmark .wordmark { font-size: calc(var(--s) * .95); }
.wordmark.has-bub .w-bub { position: absolute; left: .08em; bottom: -.16em; width: .62em; height: .34em; }

.intro { position: fixed; inset: 0; z-index: 100; background: radial-gradient(circle at 50% 40%, #ffffff 0%, #eaf6f3 70%); display: grid; place-items: center; transition: opacity .45s ease; }
.intro.out { opacity: 0; pointer-events: none; }
.intro-in { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.intro .b-icon { width: 96px; height: 96px; animation: introPop .6s cubic-bezier(.2,1.4,.4,1) both; }
.intro .b-icon svg { width: 100%; height: 100%; }
.intro .b-check { transform-box: fill-box; transform-origin: center; animation: introPop .45s .95s cubic-bezier(.2,1.6,.4,1) both; }
.intro .b-bub1, .intro .b-bub2 { transform-box: fill-box; transform-origin: bottom; animation: introPop .4s .9s cubic-bezier(.2,1.6,.4,1) both; }
.intro .b-bub2 { animation-delay: 1.1s; }
.intro-word { font-size: 64px; animation: introReveal .8s .35s ease-out both; }
.intro-word .w-bub path { animation: introPop .4s 1.1s cubic-bezier(.2,1.6,.4,1) both; transform-box: fill-box; transform-origin: bottom; }
.intro small { font: 600 15px Poppins, sans-serif; letter-spacing: 6px; color: #0f766e; animation: introFade .5s 1.2s ease-out both; }
@keyframes introPop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* الكلمة بتنكتب من اليمين لليسار متل الكتابة العربية */
@keyframes introReveal { from { clip-path: inset(-40% -10% -60% 100%); opacity: .2; } to { clip-path: inset(-40% -10% -60% -10%); opacity: 1; } }
@keyframes introFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.brand .dot { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 15px; }
.land-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.btn.lang-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.landing h1 { font-size: 30px; line-height: 1.25; margin: 26px 0 10px; }
.landing .lead { color: var(--muted); font-size: 17px; margin: 0 0 22px; }
.points { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 10px; }
.points li { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.points li b { display: block; }
.points li span { color: var(--muted); font-size: 14px; }
.points .ic { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.starts { display: grid; gap: 10px; }
.resume { margin-bottom: 14px; background: var(--brand-soft); border-radius: 12px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.foot { margin-top: 28px; color: var(--muted); font-size: 13px; text-align: center; }
.foot a { color: var(--muted); }
.help-line { text-align: center; margin: 4px 0 18px; font-size: 14px; }
.help-line a { color: var(--brand); font-weight: 600; text-decoration: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-form textarea { min-height: 110px; }
.modal .box { max-height: 92dvh; overflow-y: auto; }

/* ── Chat ── */
.chat { display: flex; flex-direction: column; height: 100dvh; position: fixed; top: 0; left: 0; right: 0; will-change: transform; }
.first-choice { display: grid; gap: 8px; margin: 4px 0 12px; }
.first-choice .note { text-align: center; margin: 2px 0 0; }
.topbar { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 54px; }
.progress { height: 4px; background: var(--line); }
.progress > i { display: block; height: 100%; background: var(--brand); transition: width .4s; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 0 8px; }
.msg { max-width: 86%; margin: 0 0 10px; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; box-shadow: var(--shadow); }
.msg.bot { background: var(--bot); border-start-start-radius: 4px; }
.msg.me { background: var(--me); color: #fff; margin-inline-start: auto; border-start-end-radius: 4px; position: relative; }
.msg.me .edit { display: block; margin-top: 4px; font-size: 12px; color: #cdeee9; background: none; border: 0; padding: 0; text-decoration: underline; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa5a1; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 10px; }
.chip { border: 1px solid var(--brand); color: var(--brand); background: var(--card); border-radius: 999px; padding: 7px 13px; font-size: 14px; min-height: 38px; }
.composer { background: var(--card); border-top: 1px solid var(--line); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); }
.composer form { display: flex; gap: 8px; align-items: flex-end; }
.chip.on { background: var(--brand); color: #fff; }
.composer .btn.attach { width: 44px; background: var(--bg); font-size: 20px; }
.composer textarea { flex: 1; resize: none; min-height: 48px; max-height: 140px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--bg); }
.composer .btn { flex: none; width: 52px; padding: 0; }
.done-panel { background: var(--brand-soft); border-radius: var(--radius); padding: 14px; margin: 8px 0 12px; }
.done-panel h3 { margin: 0 0 6px; font-size: 17px; }
.done-panel p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ── Preview ── */
.page-head { padding: 14px 0 6px; }
.page-head h2 { margin: 0; font-size: 21px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.sheet { background: #dfe3e0; border-radius: var(--radius); padding: 10px; overflow: hidden; }
.sheet .frame { position: relative; overflow: hidden; border-radius: 4px; background: #fff; }
.sheet iframe { border: 0; width: 794px; transform-origin: top left; display: block; background: #fff; }
[dir=rtl] .sheet iframe { transform-origin: top right; position: absolute; right: 0; top: 0; }
[dir=ltr] .sheet iframe { position: absolute; left: 0; top: 0; }
.toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card p.sub { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.field textarea { min-height: 90px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 8px 0; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--brand); }
.check.consent { margin: 12px 2px 4px; color: var(--muted); font-size: 13px; line-height: 1.5; border: 2px solid transparent; border-radius: 10px; padding: 8px; transition: background .2s, border-color .2s; }
.check.consent a { color: var(--brand); font-weight: 600; }
.terms { max-height: 60dvh; overflow-y: auto; font-size: 14px; color: var(--muted); }
.terms p { margin: 0 0 10px; }
.check.consent.need { border-color: var(--danger); background: #fef2f2; color: #7f1d1d; animation: shake .45s; }
.check.consent.need input { outline: 2px solid var(--danger); outline-offset: 2px; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.note { font-size: 13px; color: var(--muted); }

/* ── Editor ── */
.editor fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0 0 12px; }
.editor legend { font-weight: 700; padding: 0 6px; }
.editor .item { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 4px; }
.editor .item:first-of-type { border-top: 0; padding-top: 0; }
.editor .rm { color: var(--danger); }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ── Offer ── */
.designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.design { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 6px; text-align: center; font-weight: 600; font-size: 14px; }
.design.on { border-color: var(--brand); }
.design .thumb { position: relative; height: 200px; overflow: hidden; border-radius: 6px; background: #fff; margin-bottom: 6px; pointer-events: none; }
.design .thumb iframe { border: 0; width: 794px; height: 1123px; transform: scale(.19); transform-origin: top left; position: absolute; left: 0; top: 0; }
.design .ptag { display: block; font-weight: 400; font-size: 12px; color: var(--brand); }
.photo-card .two { margin-top: 4px; }
.buy-card { border: 2px solid var(--brand); }
.buy-card .price-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.buy-card .launch { display: inline-block; background: #fef3c7; color: #92400e; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.buy-card .big-price { font-size: 36px; font-weight: 800; color: var(--brand); line-height: 1.1; margin-top: 4px; }
.buy-card .big-price small { font-size: 16px; font-weight: 600; }
.buy-card ul { margin: 4px 0 0; padding-inline-start: 18px; color: var(--muted); font-size: 14px; }
.buy-card .after { margin: 8px 0 12px; color: var(--muted); font-size: 14px; }
.btn.big { min-height: 56px; font-size: 17px; }
.buy-card .toolbar { margin: 10px 0 4px; }
.free-link { display: block; text-align: center; font-size: 13px; color: var(--muted); margin-top: 6px; }
.pkg { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pkg .price { font-size: 22px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.pkg ul { margin: 6px 0 0; padding-inline-start: 18px; color: var(--muted); font-size: 14px; }
.soon { opacity: .75; }
.badge { display: inline-block; font-size: 12px; background: #fef3c7; color: #92400e; border-radius: 999px; padding: 2px 8px; margin-inline-start: 6px; vertical-align: middle; }
.dl-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dl-row:last-child { border-bottom: 0; }
.dl-row .acts { display: flex; gap: 6px; }

.loading { min-height: 60dvh; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 20px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #1f2937; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100% - 32px); z-index: 50; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: grid; place-items: end center; z-index: 40; }
.modal .box { background: var(--card); width: 100%; max-width: 640px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.modal h3 { margin: 0 0 8px; }

@media (min-width: 700px) {
  .landing h1 { font-size: 38px; }
  .modal { place-items: center; }
  .modal .box { border-radius: 18px; }
}
