/* «استكشف البيت»: المشهد أو الصور، والشرائط فوقه، والبطاقة (جانبية على الكمبيوتر، سفلية على الجوال)، والمخطط والقوائم */
.ex-head { padding: clamp(20px, 4vw, 40px) 0 12px; }
.ex-head h1 { margin-bottom: 4px; }
/* بلا «تثبيت التمرير»: إدراج البطاقة أعلى العمود الجانبي كان يحرّك الصفحة بطول البطاقة */
.ex-wrap { display: grid; gap: 16px; overflow-anchor: none; }
@media (min-width: 1080px) { .ex.is-ready:not([data-mode="poster"]):not([data-mode="loading"]) .ex-wrap { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
/* لا يتجاوز العارض ارتفاع الشاشة تحت الترويسة، فيظهر شريطاه العلوي والسفلي معًا حتى على الجوال الأفقي وتكبير 200% */
.ex-stage { position: relative; height: min(max(380px, 66svh), 760px, calc(100svh - var(--head-h) - 20px)); border-radius: var(--radius); overflow: hidden; background: #E9E3D8; border: 1px solid var(--line); isolation: isolate; }
@media (min-width: 1080px) { .ex-stage { height: min(76vh, 780px); position: sticky; top: calc(var(--head-h) + 12px); } }
.ex-poster { position: absolute; inset: 0; }
.ex-poster img { width: 100%; height: 100%; object-fit: cover; }
.ex-poster-ui { position: absolute; inset-inline: 0; bottom: 0; padding: 48px 16px 18px; background: linear-gradient(to top, rgba(29, 27, 24, .66), rgba(29, 27, 24, 0)); color: #fff; }
.ex-poster-note { margin: 10px 0 0; font-size: 14px; color: #F4F2EE; max-width: 52ch; }
.ex-host { position: absolute; inset: 0; }
.ex-host canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.ex-host canvas:active { cursor: grabbing; }
.ex-photo { width: 100%; height: 100%; object-fit: cover; }
.hs-fade { position: absolute; inset: 0; background: #E9E3D8; opacity: 0; pointer-events: none; }

/* طبقة النقاط لا تعترض السحب؛ النقاط والصناديق وحدها قابلة للنقر */
.ex-hs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.hs { position: absolute; left: 0; top: 0; pointer-events: auto; border: 0; cursor: pointer; font: inherit; will-change: transform; padding: 0; }
.hs[hidden] { display: none; }
.hs-el, .hs-go, .hs-cluster { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0, 0, 0, .28); }
/* الخدمة «+» بيضاء بحد طوبي، والانتقال سهم داكن، والمجموعة عددها ظاهر: التمييز بالشكل لا باللون وحده */
.hs-el { background: rgba(255, 255, 255, .96); color: var(--action); box-shadow: 0 2px 10px rgba(0, 0, 0, .25), 0 0 0 3px rgba(138, 69, 36, .3); }
.hs-el .i { width: 22px; height: 22px; stroke-width: 2.4; }
.hs-go { background: rgba(29, 27, 24, .86); color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .3), 0 0 0 3px rgba(255, 255, 255, .55); }
.hs-go .i { width: 21px; height: 21px; stroke-width: 2.2; }
.hs-cluster { background: #fff; color: var(--text); font-weight: 700; font-size: 16px; box-shadow: 0 2px 10px rgba(0, 0, 0, .28), 0 0 0 3px var(--text); }
.hs-el:hover, .hs-el.is-on { background: var(--action); color: #fff; }
.hs-go:hover, .hs-go.is-on, .hs-cluster:hover, .hs-cluster.is-on { box-shadow: 0 2px 10px rgba(0, 0, 0, .3), 0 0 0 4px var(--action); }
.hs:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 7px var(--text); }
.hs-enter { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--action); color: #fff; font-size: 15px; font-weight: 600; white-space: nowrap; box-shadow: 0 3px 12px rgba(0, 0, 0, .25); }
.hs-enter .i { width: 18px; height: 18px; }
/* تسمية واحدة نشطة (مرور أو تركيز): تُوضع بحساب يتجنب النقاط الأخرى والأشرطة، ولا تعترض النقر */
.hs-tip { position: absolute; left: 0; top: 0; pointer-events: none; max-width: min(240px, calc(100% - 16px)); padding: 6px 12px; border-radius: 8px; background: rgba(29, 27, 24, .92); color: #fff; font-size: 14px; line-height: 1.5; white-space: normal; text-align: start; z-index: 3; }
.hs-tip[hidden], .hs-callout[hidden] { display: none; }
/* صندوق الإجراء: اسم الوجهة وزر واضح، أو قائمة الخيارات المتقاربة */
.hs-callout { position: absolute; left: 0; top: 0; pointer-events: auto; width: max-content; max-width: min(300px, calc(100% - 16px)); background: var(--bg); color: var(--text); border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .3); padding: 6px 10px 10px; z-index: 4; }
.hs-c-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.hs-c-title { margin: 0; font-weight: 600; font-size: 15px; line-height: 1.45; padding-inline-start: 2px; }
.hs-c-x { width: 40px; height: 40px; flex: none; }
.hs-c-list { list-style: none; display: grid; gap: 6px; margin: 2px 0 0; padding: 0; }
.hs-c-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; color: var(--text); font: inherit; font-size: 15px; line-height: 1.4; text-align: start; cursor: pointer; }
.hs-c-btn .i { width: 18px; height: 18px; flex: none; color: var(--action); }
.hs-c-btn.is-primary { background: var(--action); border-color: var(--action); color: #fff; font-weight: 600; justify-content: center; }
.hs-c-btn.is-primary .i { color: #fff; }

/* أعلى العارض: الموضع الحالي وأدوات «طريقة الاستخدام» و«تقليل الحركة» و«الخروج» في حاوية تلتف ولا تتراكب */
.ex-top { position: absolute; z-index: 5; top: 8px; inset-inline: 8px; display: none; flex-wrap: wrap; gap: 6px 8px; align-items: flex-start; justify-content: space-between; pointer-events: none; }
.ex-top > * { pointer-events: auto; }
.ex.is-ready:not([data-mode="poster"]) .ex-top { display: flex; }
.ex-where { margin: 0; background: rgba(255, 255, 255, .95); border-radius: var(--radius-sm); padding: 8px 12px; font-weight: 500; font-size: 14.5px; line-height: 1.5; flex: 1 1 200px; max-width: 520px; outline: none; }
.ex-where:empty { display: none; }
.ex-top-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-inline-start: auto; }
/* أسفل العارض: مجموعات واضحة تلتف على الشاشات العريضة؛ على الضيقة ثلاثة أزرار ولوحة أدوات */
.ex-bar { position: absolute; z-index: 5; bottom: 8px; inset-inline: 8px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 2px; pointer-events: none; }
.ex-bar > * { pointer-events: auto; }
.ex-bar:empty { display: none; }
.ex-grp { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; border-radius: 999px; background: rgba(29, 27, 24, .14); }
.ex-stage.is-compact .ex-bar { flex-wrap: nowrap; justify-content: center; }
.ex-stage.is-compact .ex-bar .ex-chip { flex: 1 1 0; min-width: 0; padding: 0 10px; }
.ex-tools { position: absolute; z-index: 6; inset-inline: 8px; bottom: 62px; max-height: calc(100% - 150px); overflow-y: auto; overscroll-behavior: contain; background: var(--bg); border-radius: 14px; box-shadow: 0 8px 28px rgba(0, 0, 0, .28); padding: 4px 12px 12px; }
.ex-tools[hidden] { display: none; }
.tl-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--bg); padding-top: 4px; }
.tl-title { margin: 0; font-weight: 600; }
.tl-h { margin: 8px 0 4px; font-size: 13.5px; color: var(--text-2); }
.tl-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ex-tools .ex-chip { background: #fff; border-color: var(--line-strong); }
.ex-tools .ex-chip[aria-current="true"], .ex-tools .ex-chip[aria-pressed="true"] { background: var(--text); color: #fff; border-color: var(--text); }
.ex-chip { flex: none; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(29, 27, 24, .14); background: rgba(255, 255, 255, .95); color: var(--text); cursor: pointer; font-size: 14.5px; white-space: nowrap; }
.ex-chip:hover { background: #fff; }
.ex-chip[aria-pressed="true"] { background: var(--text); color: #fff; border-color: var(--text); }
.ex-chip.ex-primary { background: var(--action); border-color: var(--action); color: #fff; font-weight: 600; }
.ex-sq { width: 44px; padding: 0; font-size: 20px; }
.ex-exit { background: rgba(29, 27, 24, .82); color: #fff; }
.hb-short { display: none; }
/* العارض الضيق (بحسب عرضه لا عرض الشاشة): أزرار أعلى مختصرة، و«تقليل الحركة» في لوحة الأدوات */
.ex-stage.is-compact .ex-top-acts .ex-reduce { display: none; }
.ex-stage.is-compact .ex-where { font-size: 13.5px; flex-basis: 140px; }
.ex-stage.is-compact .ex-top-acts { flex-wrap: nowrap; }
.ex-stage.is-compact .ex-help-btn { width: 44px; padding: 0; font-size: 18px; font-weight: 600; }
.ex-stage.is-compact .hb-long { display: none; }
.ex-stage.is-compact .hb-short { display: inline; }
.ex-stage.is-compact .ex-exit { padding: 0 12px; }
.ex-roam { position: absolute; z-index: 3; bottom: 64px; inset-inline: 0; display: flex; justify-content: center; gap: 10px; }
.ex-roam[hidden] { display: none; }
.ex-load { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; background: rgba(244, 242, 238, .94); }
.ex-load[hidden] { display: none; }
.ex-load p { margin: 0; font-weight: 500; }
.ex-fail-t { max-width: 36ch; }
.spin { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--action); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ex-help { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; background: rgba(29, 27, 24, .35); padding: 16px; }
.ex-help[hidden] { display: none; }
.help-in { background: var(--bg); border-radius: var(--radius); padding: 18px; max-width: 460px; box-shadow: var(--shadow); }
.help-in h2 { font-size: 19px; }
.help-in ul { padding-inline-start: 18px; display: grid; gap: 6px; margin-bottom: 12px; font-size: 15px; }

/* البطاقة */
/* عزل تخطيط البطاقة والجانب: فتح بطاقة لا يعيد تخطيط الصفحة كلها داخل النقرة */
.ex-card { background: var(--bg); z-index: 6; contain: layout style; }
.ex-side .sd-block { contain: layout style; }
.ex-hs, .ex-top, .ex-bar { contain: layout style; }
.ex-card[hidden] { display: none; }
.ex-stage > .ex-card { position: absolute; inset-inline: 0; bottom: 0; max-height: 64%; overflow-y: auto; border-radius: 14px 14px 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, .18); padding: 4px 14px 14px; overscroll-behavior: contain; }
.ex-stage > .ex-card.is-min { max-height: 64px; overflow: hidden; }
.ex-side > .ex-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px 14px; box-shadow: var(--shadow); position: sticky; top: calc(var(--head-h) + 12px); max-height: calc(100vh - var(--head-h) - 24px); overflow-y: auto; overscroll-behavior: contain; }
@media (min-width: 1080px) { .ex-bar { flex-wrap: wrap; overflow: visible; } }
.ex-side > .ex-card .cd-min { display: none; }
.cd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; position: sticky; top: 0; background: var(--bg); padding-top: 8px; z-index: 1; }
.cd-head h2 { font-size: 18px; margin: 0; outline: none; }
.cd-sub { margin: 2px 0 6px; font-size: 14px; color: var(--text-2); }
.cd-acts { display: flex; }
.cd-body { display: grid; gap: 10px; }
.cd-l { font-weight: 500; margin: 0 0 6px; }
.sw-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.sw { width: 44px; height: 44px; border-radius: 10px; border: 2px solid transparent; background: none; padding: 3px; cursor: pointer; }
.sw-c { display: block; width: 100%; height: 100%; border-radius: 7px; border: 1px solid rgba(0, 0, 0, .12); }
.sw[aria-pressed="true"] { border-color: var(--action); }
.cd-mat { margin: 0 0 6px; font-size: 15px; }
.cd-svcs { list-style: none; display: grid; gap: 10px; }
.cd-svc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 6px; justify-items: start; }
.cd-name { margin: 0; font-weight: 600; }
.cd-more summary { cursor: pointer; color: var(--action); font-size: 14.5px; min-height: 36px; display: flex; align-items: center; }
.cd-more p { margin: 4px 0; }
.cd-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.cd-foot > * { flex: 1 1 150px; }
.cd-in { margin: 0; color: var(--ok); font-weight: 500; font-size: 14.5px; }

/* الجانب: الموضع والمراحل والمخطط والغرف والنقاط */
.ex-side { display: grid; gap: 12px; }
.ex-side[hidden] { display: none; }
.sd-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.sd-where { margin: 0; font-weight: 600; }
.sd-h { font-size: 16px; margin: 0 0 8px; }
.sd-row { display: flex; justify-content: space-between; align-items: baseline; }
.sd-note { font-size: 14px; margin: 8px 0 0; }
.sd-floor { margin: 6px 0 4px; font-size: 14px; color: var(--text-2); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 44px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: #fff; cursor: pointer; font: inherit; }
.seg button[aria-pressed="true"] { background: var(--text); color: #fff; border-color: var(--text); }
.rooms { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.rooms button { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; font: inherit; font-size: 14.5px; }
.rooms button[aria-current="true"] { background: var(--action); color: #fff; border-color: var(--action); }
.elist { list-style: none; display: grid; gap: 6px; }
.elist button { width: 100%; text-align: start; min-height: 44px; padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.elist button[aria-current="true"] { border-color: var(--action); box-shadow: inset 0 0 0 1px var(--action); }
.plan { width: 100%; height: auto; display: block; background: #FBFAF7; border-radius: var(--radius-sm); }
.pl-room rect { fill: #fff; stroke: var(--text); stroke-width: .1; cursor: pointer; }
.pl-room:hover rect { fill: var(--surface-2); }
.pl-room.is-cur rect { fill: var(--action-soft); stroke: var(--action); stroke-width: .16; }
.pl-t { font-size: .62px; text-anchor: middle; fill: var(--text); font-family: var(--font); pointer-events: none; }
.pl-s { font-size: .44px; }
.pl-site { font-size: 1.5px; fill: var(--text-2); }
/* المقاسات في المخطط المكبر */
.pl-a { font-size: .46px; fill: var(--text-2); font-variant-numeric: tabular-nums; direction: rtl; }
.pl-dim line { stroke: var(--text-2); stroke-width: .05; }
.ex[data-mode="photos"] [data-help], .ex[data-mode="photos"] [data-reduce] { display: none; }
.pl-door { stroke: #FBFAF7; stroke-width: .24; }
.pl-win { stroke: #7FA6BF; stroke-width: .16; }
.pl-stair { fill: #E6E0D6; stroke: var(--text-2); stroke-width: .05; }
.pl-plot { fill: #EFE9DE; stroke: var(--text-2); stroke-width: .12; }
.pl-house { fill: #fff; stroke: var(--text); stroke-width: .16; }
.pl-cone { fill: rgba(138, 69, 36, .25); }
.pl-dot { fill: var(--action); stroke: #fff; stroke-width: .08; }

.ex-dlg { border: 0; padding: 0; border-radius: var(--radius); max-width: min(760px, calc(100vw - 24px)); width: 100%; background: var(--bg); color: var(--text); }
.ex-dlg::backdrop { background: rgba(29, 27, 24, .45); }
.dlg-in { padding: 12px 16px 16px; }
.plan-big { max-height: 70vh; }
.cmp-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .cmp-grid { grid-template-columns: 1fr 1fr; } }
.cmp-col { margin: 0; }
.cmp-col img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }

/* 19 أكتوبر: اختيار نموذج البيت أعلى الصفحة. الجوال: بطاقات تمر أفقيًا، والكمبيوتر: شبكة */
.ex-models { margin-top: 16px; }
.ex-models-h { margin: 0 0 8px; font-size: 1rem; font-weight: 600; }
.ex-models ul { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 72%); gap: 10px; margin: 0; padding: 0 0 6px; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
@media (min-width: 760px) { .ex-models ul { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); overflow: visible; } }
.ex-models li { scroll-snap-align: start; }
.ex-model { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: center; height: 100%; padding: 8px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s var(--ease); }
.ex-model:hover { border-color: var(--line-strong); }
.ex-model.is-on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.ex-model:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.ex-model-img { width: 92px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
.ex-model-t { display: grid; gap: 2px; min-width: 0; }
.ex-model-t b { font-weight: 600; }
.ex-model-t small { color: var(--text-2); font-size: .82rem; line-height: 1.5; }
.ex-model-n { font-variant-numeric: tabular-nums; }
/* الجوال: الاسم والأرقام فقط، والوصف الطويل على الشاشات الأعرض */
@media (max-width: 759px) { .ex-model-t small:not(.ex-model-n) { display: none; } .ex-models ul { grid-auto-columns: minmax(210px, 64%); } }
@media (prefers-reduced-motion: reduce) { .ex-model { transition: none; } }
