/* حجزُ المشروع في «تواصل» (fx/book.js) — فوق أنماط المحادثة في contact.html (`.th`، وهي تأتي بعد هذا الملفّ فتغلبه): جسدٌ
   يتمرّر، وخانةٌ تُكتب، وأجوبةٌ أزرار، وملخّصٌ يُراجَع قبل «احجز»؛ وجنبها خريطةُ العراق، وتحتهما الخطواتُ الأربعُ بالعرض تتبع
   الحجزَ بعده — «الإشارة»، الثالثةُ من أربعٍ رآها بأفلام (docs/superpowers/specs/2026-10-12-booking-lab/). وقبل الأسئلة يُدعى
   مَن ليس داخلاً لحسابه إلى الدخول («ميكدر يحجز بشرط تسجيل الدخول»). */
#book { scroll-margin-top: 80px; }
.th-body { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(245,247,247,.14) transparent; padding-bottom: 14px; }
.th-list { transform: none !important; }

/* خانةُ الكتابة: حقلٌ حقيقيٌّ وزرُّ إرسال */
.th-input { padding: 6px; padding-inline-start: 18px; color: #F5F7F7; transition: background .25s, box-shadow .25s; }
.th-input:focus-within { background: rgba(245,247,247,.08); box-shadow: 0 0 0 1px rgba(0,199,177,.45); }
.th-input input, .th-input textarea { all: unset; flex: 1; min-width: 0; font: 400 16px/1.5 Tajawal, sans-serif; color: #F5F7F7; padding: 8px 0; }
/* `all: unset` فوق يمحو [hidden] المتصفّح — فيُقال مرّةً ثانية */
.th-input [hidden] { display: none !important; }
.th-input textarea { max-height: 96px; overflow-y: auto; white-space: pre-wrap; }
.th-input input::placeholder, .th-input textarea::placeholder { color: rgba(245,247,247,.38); }
.th-input input[dir="ltr"] { text-align: left; font-family: 'IBM Plex Mono', Tajawal, monospace; font-size: 15px; }
.th-input button { all: unset; cursor: pointer; flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--sig); color: #052320; transition: transform .2s, opacity .2s; }
.th-input button:hover { transform: scale(1.06); }
.th-input button:focus-visible { outline: 2px solid #B9FFF4; outline-offset: 3px; }
.th-input button svg { width: 18px; height: 18px; transform: scaleX(-1); }
.th-input.off { opacity: .55; }
.th-input.off button { opacity: .4; pointer-events: none; }
/* الحقلُ المخفيّ: لا يراه إنسانٌ فلا يملؤه */
.th-input .trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* الأجوبةُ التي هي أزرار: من أنت، والمحافظة، ونوعُ المشروع، وواتساب، و«لم أختره بعد» — على أرض المحادثة لا في فقاعة */
.th .b.us.chips { display: flex; flex-wrap: wrap; gap: 8px; max-width: 94%; padding: 0; background: none; border: 0; animation: none; }
.th .chips button { all: unset; cursor: pointer; padding: 9px 16px; border-radius: 999px; border: 1px solid rgba(0,199,177,.45); background: rgba(0,199,177,.07); color: #B9FFF4; font: 500 15px/1.2 Tajawal, sans-serif; animation: thIn .45s cubic-bezier(.2,1.3,.4,1) both; animation-delay: calc(var(--i) * .05s); transition: background .2s, color .2s, transform .2s; }
.th .chips button:hover { background: rgba(0,199,177,.2); color: #fff; transform: translateY(-1px); }
.th .chips button:focus-visible { outline: 2px solid var(--sig); outline-offset: 2px; }
.th .chips.big button { padding: 12px 22px; font-size: 16px; font-weight: 700; }
.th .chips.used { opacity: .35; pointer-events: none; }
.th .chips.gov { max-width: 100%; gap: 6px; }
.th .chips.gov button { padding: 7px 12px; font-size: 14px; }
.th .q button { animation: none; }

/* الجوابُ الغلط: الصوتُ نفسُه بحافّةٍ دافئة */
.th .b.warn { border-color: rgba(255,196,120,.4); background: #2a2419; }

/* الملخّص: كلُّ جوابٍ بسطر، ولكلٍّ «تعديل»، ثمّ «احجز» */
.th .sum { align-self: stretch; max-width: none; padding: 16px 16px 14px; background: #16212b; border: 1px solid rgba(0,199,177,.28); border-radius: 20px; }
.th .sum h3 { margin: 0 0 4px; font: 800 18px/1.3 Tajawal, sans-serif; }
.th .sum .k2 { margin: 0 0 12px; color: var(--mute); font: 400 14px/1.5 Tajawal, sans-serif; }
.th .sum dl { margin: 0; display: grid; grid-template-columns: auto 1fr auto; column-gap: 14px; }
.th .sum dt, .th .sum dd { padding: 9px 0; border-top: 1px solid rgba(245,247,247,.07); margin: 0; }
.th .sum dt { color: rgba(245,247,247,.55); font: 400 14px/1.5 Tajawal, sans-serif; white-space: nowrap; }
.th .sum dd { font: 500 15px/1.5 Tajawal, sans-serif; overflow-wrap: anywhere; }
.th .sum dd.ltr { direction: ltr; text-align: right; font-family: 'IBM Plex Mono', Tajawal, monospace; font-size: 14px; }
.th .sum dd.none { color: rgba(245,247,247,.4); }
.th .sum .ed { all: unset; cursor: pointer; align-self: center; padding: 4px 10px; border-radius: 999px; color: #7FF0DF; font: 500 13px/1.2 Tajawal, sans-serif; }
.th .sum .ed:hover { background: rgba(0,199,177,.12); }
.th .sum .ed:focus-visible { outline: 2px solid var(--sig); }
.th .sum .go { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.th .sum .book { all: unset; cursor: pointer; padding: 13px 30px; border-radius: 999px; background: var(--sig); color: #052320; font: 800 16px/1 Tajawal, sans-serif; box-shadow: 0 10px 34px -10px rgba(0,199,177,.75); transition: transform .2s, box-shadow .2s, opacity .2s; }
.th .sum .book:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -8px rgba(0,199,177,.9); }
.th .sum .book:focus-visible { outline: 2px solid #B9FFF4; outline-offset: 3px; }
.th .sum .book:disabled { opacity: .55; cursor: wait; transform: none; }
.th .sum .note { flex: 1; min-width: 180px; color: rgba(245,247,247,.5); font: 400 12.5px/1.55 Tajawal, sans-serif; }
.th .sum .note a { color: #7FF0DF; }
/* بعد «احجز» تبقى أعمدةُ «تعديل» مكانَها، وإلّا زحف كلُّ سطرٍ خانةً */
.th .sum.sent { opacity: .55; }
.th .sum.sent .ed { visibility: hidden; }
.th .sum.sent .go { display: none; }
.th .sum.kept { opacity: .9; }

/* بعد الحجز: الرقمُ كبيرٌ بما يكفي ليُذكر بالواتساب، ورابطُ المتابعة، و«حجز جديد» */
.th .sys b { font: 700 15px/1 'IBM Plex Mono', Tajawal, monospace; color: #fff; }
.th .b.link .lk { display: block; margin: 8px 0 6px; padding: 8px 12px; border-radius: 10px; background: rgba(0,199,177,.1); color: #B9FFF4; font: 500 13.5px/1.5 'IBM Plex Mono', monospace; word-break: break-all; text-align: left; }
.th .b.link .cp { all: unset; cursor: pointer; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(0,199,177,.45); color: #7FF0DF; font: 500 13px/1.2 Tajawal, sans-serif; }
.th .b.link .cp:hover { background: rgba(0,199,177,.14); }
.th .again { all: unset; cursor: pointer; align-self: center; margin-top: 4px; color: rgba(245,247,247,.55); font: 400 14px/1 Tajawal, sans-serif; text-decoration: underline; text-underline-offset: 4px; }
.th .again:hover, .th .again:focus-visible { color: #F5F7F7; }

/* الدعوةُ إلى الدخول: زرٌّ يذهب إلى صفحة الحساب ويرجع هنا (account?next=contact) */
.th .b.us.gate { display: flex; flex-wrap: wrap; gap: 8px; max-width: 94%; padding: 0; background: none; border: 0; }
.th .gate a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; background: var(--sig); color: #052320; font: 800 16px/1 Tajawal, sans-serif; text-decoration: none; box-shadow: 0 10px 34px -10px rgba(0,199,177,.75); transition: transform .2s, box-shadow .2s; }
.th .gate a:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -8px rgba(0,199,177,.9); }
.th .gate a:focus-visible { outline: 2px solid #B9FFF4; outline-offset: 3px; }
.th .gate a.s { background: none; color: #B9FFF4; border: 1px solid rgba(0,199,177,.45); box-shadow: none; font-weight: 700; }

/* جنب المحادثة: الخريطةُ وسطرُها، متوسّطتين على ارتفاعها */
.bk-col { display: flex; flex-direction: column; justify-content: center; }
/* اعتذرت: الخطوةُ الثانيةُ دافئة */
.th-steps li.no .n { border-color: #ffb86b; background: rgba(255,184,107,.12); color: #ffcf99; box-shadow: none; }
.th-steps li.no b, .th-steps li.no .d { color: #ffcf99; }

/* الخريطة: محافظاتُ العراق، وعلامتُنا في وسطه، والخطُّ من محافظة الزائر */
.bk-map svg { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; overflow: visible; }
.bk-map .regs path { fill: rgba(245,247,247,.025); stroke: rgba(127,240,223,.2); stroke-width: 1.4; transition: fill .8s, stroke .8s; }
.bk-map .regs path.on { fill: rgba(0,199,177,.3); stroke: #7FF0DF; stroke-width: 2.2; }
.bk-map .edge { fill: none; stroke: rgba(127,240,223,.55); stroke-width: 2.2; }
.bk-map .arc { fill: none; stroke: rgba(0,199,177,.8); stroke-width: 3; stroke-linecap: round; opacity: 0; transition: stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1), opacity .3s; filter: drop-shadow(0 0 6px rgba(0,199,177,.9)); }
.bk-map .arc.on { opacity: 1; }
.bk-map .dot { fill: #B9FFF4; filter: drop-shadow(0 0 8px #00C7B1) drop-shadow(0 0 18px #00C7B1); }
.bk-map .dot.big { fill: #fff; }
.bk-map .land { fill: none; stroke: #7FF0DF; stroke-width: 2.5; transform-box: fill-box; transform-origin: center; animation: bkLand 1.4s ease-out forwards; }
.bk-map .land.big { stroke-width: 4; animation-duration: 1.8s; }
.bk-map .ring { fill: none; stroke: rgba(0,199,177,.55); stroke-width: 1.6; transform-box: fill-box; transform-origin: center; animation: bkRing 2.7s ease-out infinite; }
.bk-map .mk { color: #F5F7F7; }
.bk-map .spin { transform-box: fill-box; transform-origin: center; }
.bk-map.wait .spin, .bk-map.complete .spin { animation: bkSpin 1.3s cubic-bezier(.2,.8,.2,1); }
.bk-map .say { font: 700 26px Tajawal, sans-serif; fill: #7FF0DF; text-anchor: middle; }
.bk-cap { margin: 6px 0 0; text-align: center; }
.bk-cap b { display: block; font: 800 18px/1.4 Tajawal, sans-serif; transition: color .5s; }
.bk-cap small { color: var(--mute); font: 400 14px/1.6 Tajawal, sans-serif; }
/* بعد الحجز: ينتظر، والشغلُ ماشٍ (النبضاتُ ترجع من العلامة)، وتمّ، واعتذرت */
.bk-map.wait .bk-cap b, .bk-map.working .bk-cap b, .bk-map.complete .bk-cap b { color: #7FF0DF; }
.bk-map.working .arc { stroke-width: 4; }
.bk-map.working .ring { animation-duration: 1.6s; }
.bk-map.complete .regs path.on { fill: rgba(0,199,177,.5); stroke: #B9FFF4; }
.bk-map.complete .arc { stroke: #B9FFF4; stroke-width: 4; }
.bk-map.declined .arc { opacity: .22; filter: none; }
.bk-map.declined .regs path.on { fill: rgba(255,184,107,.14); stroke: #ffcf99; }
.bk-map.declined .bk-cap b { color: #ffcf99; }
@keyframes bkLand { from { transform: scale(.6); opacity: 1; } to { transform: scale(5); opacity: 0; } }
@keyframes bkRing { from { transform: scale(1); opacity: .9; } to { transform: scale(3.4); opacity: 0; } }
@keyframes bkSpin { to { transform: rotate(360deg); } }
html[data-motion="paused"] .bk-map *, html[data-motion="paused"] .th .chips button { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { .bk-map .ring, .bk-map .spin { animation: none; } }

@media (max-width: 860px) {
  .bk-map svg { max-width: 360px; }
  .th .sum dl { grid-template-columns: 1fr auto; }
  .th .sum dt { grid-column: 1 / -1; padding-bottom: 0; }
  .th .sum dd { border-top: 0; padding-top: 2px; }
  /* زرُّ «أوقف الحركة» المثبَّتُ يغطّي طرفَ الخانة على التلفون — يغيب ما دام المؤشّرُ فيها */
  html.book-typing .motion-switch { visibility: hidden; }
}
