/* =====================================================================
   الجواد الأبيض — نظام تصميم الموقع العام
   الهوية من الشعار الرسمي: بنفسجي #4A1D6F، برتقالي #F39518، لافندر #ECEAF2
   العنصر المميز: «الحلقات الشمسية» (نفس فتحة حلقات الشعار) — مؤشر التقدم وحلقة النتيجة
   ===================================================================== */

:root {
  --purple: #4A1D6F;
  --deep: #3D0E5F;
  --orange: #F39518;
  --orange-d: #C46F05;
  --lav: #ECEAF2;
  --lav-2: #F6F3FA;
  --paper: #FFFFFF;
  --ink: #1F2430;
  --muted: #555B6B;
  --line: rgba(74, 29, 111, .14);
  --line-2: rgba(74, 29, 111, .24);
  --teal: #0F7C78;
  --ok: #2E7D32;
  --warn: #9A5B00;
  --bad: #C0392B;
  --r-card: 20px;
  --r-tile: 16px;
  --r-ctl: 12px;
  --sh-1: 0 1px 2px rgba(61, 14, 95, .06), 0 10px 28px -14px rgba(61, 14, 95, .22);
  --sh-2: 0 2px 4px rgba(61, 14, 95, .08), 0 18px 44px -18px rgba(61, 14, 95, .35);
  --f-body: "Tajawal", "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  --f-head: "Reem Kufi", "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --mbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--lav);
  color: var(--ink);
  font: 400 16.5px/1.8 var(--f-body);
  padding-bottom: calc(var(--mbar-h) + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { body { padding-bottom: 0; } }
img, svg { max-width: 100%; }
a { color: var(--purple); text-underline-offset: 3px; }
a:hover { color: var(--deep); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--f-head); color: var(--purple); line-height: 1.35; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(30px, 6vw, 44px); }
h2 { font-size: clamp(22px, 4vw, 28px); }
h3 { font-size: 19px; }
h4 { font-size: 16px; }
p { margin: 0 0 1em; }
b, strong { font-weight: 700; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; top: -60px; right: 12px; z-index: 100; background: var(--purple); color: #fff; padding: 10px 16px; border-radius: 10px; }
.skip:focus { top: 10px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---------- الأزرار ---------- */
.btn {
  --bg: var(--paper); --fg: var(--purple); --bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px; border-radius: var(--r-ctl);
  background: var(--bg); color: var(--fg); border: 1.5px solid var(--bd);
  font: 700 15.5px/1.2 var(--f-body); text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--purple); color: var(--fg); }
.btn:active { transform: translateY(1px); }
.btn-primary { --bg: var(--purple); --fg: #fff; --bd: var(--purple); }
.btn-primary:hover { --bg: var(--deep); border-color: var(--deep); color: #fff; }
.btn-accent { --bg: var(--orange); --fg: #2A1240; --bd: var(--orange); }
.btn-accent:hover { --bg: #F7A73B; border-color: #F7A73B; color: #2A1240; }
.btn-water { --bg: var(--teal); --fg: #fff; --bd: var(--teal); }
.btn-ghost { --bg: transparent; --bd: transparent; }
.btn-ghost:hover { --bg: rgba(74, 29, 111, .06); border-color: transparent; }
.btn-sm { min-height: 40px; padding: 7px 14px; font-size: 14.5px; }
.btn-lg { min-height: 54px; padding: 12px 22px; font-size: 17px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 8px 4px; min-height: 44px;
  color: var(--purple); font: 700 15px var(--f-body); cursor: pointer; text-decoration: underline; text-decoration-color: rgba(74, 29, 111, .35); text-underline-offset: 4px;
}
.link-btn.danger { color: var(--bad); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--purple); cursor: pointer; }
.icon-btn:hover { background: rgba(74, 29, 111, .07); }
.ic { flex: none; vertical-align: middle; }

/* ---------- الحقول ---------- */
.field { margin: 0 0 16px; }
.field label, .field .label { display: block; font-weight: 700; color: var(--deep); margin-bottom: 6px; font-size: 15px; }
.opt-tag { color: var(--muted); font-weight: 500; font-size: 13.5px; }
input[type=text], input[type=search], input[type=number], input[type=tel], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--r-ctl);
  border: 1.5px solid var(--line-2); background: var(--paper); color: var(--ink);
  font: 500 16px/1.4 var(--f-body);
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 4px rgba(243, 149, 24, .28); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234A1D6F' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-left: 40px; }
.num-unit { display: flex; align-items: stretch; border: 1.5px solid var(--line-2); border-radius: var(--r-ctl); background: var(--paper); overflow: hidden; }
.num-unit:focus-within { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(243, 149, 24, .28); }
.num-unit input { border: 0; min-height: 46px; box-shadow: none !important; text-align: center; direction: ltr; }
.num-unit span { display: grid; place-items: center; padding: 0 12px; background: var(--lav-2); color: var(--muted); font-size: 14px; white-space: nowrap; border-inline-start: 1px solid var(--line); }
.num-unit select { flex: 0 0 auto; width: auto; min-height: 46px; border: 0; border-inline-start: 1px solid var(--line); border-radius: 0; background-color: var(--lav-2); color: var(--deep); font: 700 14px var(--f-body); padding-block: 0; padding-inline: 12px 30px; cursor: pointer; box-shadow: none !important; }
.num-unit select:focus-visible { outline: 3px solid var(--orange); outline-offset: -3px; }
.field-row { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .field-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.field-inline label { font-weight: 600; }
.field-err, .form-err { color: var(--bad); font-size: 14px; margin: 6px 0 0; font-weight: 600; }
.hint, .hint-sm { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 14.5px; margin: 8px 0 0; }
.hint .ic { color: var(--orange-d); margin-top: 3px; }
.hint-sm { font-size: 13.5px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--purple); flex: none; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 5px; background: var(--lav-2); border-radius: 14px; border: 1px solid var(--line); }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 16px; border-radius: 10px; font-weight: 700; color: var(--muted); font-size: 15px; }
.seg input:checked + span { background: var(--paper); color: var(--purple); box-shadow: 0 1px 3px rgba(61, 14, 95, .16); }
.seg input:focus-visible + span { outline: 3px solid var(--orange); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- الرأس ---------- */
.hdr { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.hdr-in { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; flex: none; }
.brand img { width: auto; height: 44px; }
.nav { display: none; flex: 1; gap: 2px; justify-content: center; }
.nav a { padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; white-space: nowrap; }
.nav a:hover { background: var(--lav-2); color: var(--purple); }
.nav a[aria-current] { color: var(--purple); box-shadow: inset 0 -3px 0 var(--orange); border-radius: 10px 10px 0 0; }
.hdr-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.menu-btn { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--purple); cursor: pointer; }
.hide-sm { display: none; }
@media (min-width: 1040px) {
  .nav { display: flex; }
  .menu-btn { display: none; }
  .hdr-actions { margin-inline-start: 0; }
}
@media (min-width: 600px) { .hide-sm { display: inline-flex; } }
@media (max-width: 1039px) {
  .nav.open { display: flex; flex-direction: column; position: absolute; top: 100%; inset-inline: 0; background: var(--paper); padding: 8px 16px 16px; border-bottom: 1px solid var(--line); box-shadow: var(--sh-2); }
  .nav.open a { padding: 14px 12px; font-size: 16.5px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav.open a[aria-current] { box-shadow: inset -4px 0 0 var(--orange); }
}

/* ---------- الشريط البنفسجي أعلى الصفحة + المنحنى الأبيض ---------- */
.band { position: relative; background: var(--purple); color: #fff; overflow: hidden; }
.band::before {
  content: ""; position: absolute; inset-inline-start: -140px; top: -120px; width: 520px; height: 520px; pointer-events: none;
  background: url("../brand/emblem.svg") no-repeat center / contain; opacity: .07; filter: brightness(10) saturate(0);
}
.band-in { position: relative; padding: 26px 16px 92px; }
.band h1 { color: #fff; margin-bottom: 10px; }
.band-lead { color: #E3DAEE; font-size: 17.5px; max-width: 62ch; margin: 0; }
.band-sm .band-in { padding-bottom: 80px; }
.band-curve { position: absolute; bottom: -1px; left: 0; width: 100%; height: 64px; display: block; fill: var(--lav); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: #CDBFDD; margin-bottom: 14px; }
.crumbs a { color: #fff; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- المستشار ---------- */
.adv { position: relative; margin-top: -64px; padding-bottom: 48px; }
.adv-card { background: var(--paper); border-radius: var(--r-card); box-shadow: var(--sh-2); max-width: 820px; margin: 0 auto; border: 1px solid var(--line); }
.adv-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px 6px; }
.prog { width: 64px; height: 64px; flex: none; }
.prog circle { fill: none; stroke-width: 8.4; }
.prog-track { stroke: #E9E3F0; }
.prog-fill { stroke: var(--orange); transition: stroke-dasharray .45s ease; }
.prog-fill.inner { stroke: var(--purple); }
.prog-num { font: 700 30px var(--f-head); fill: var(--purple); }
.adv-stepno { color: var(--muted); font-size: 14px; font-weight: 600; }
.adv-title { margin: 0; font-size: clamp(21px, 4.4vw, 27px); outline: none; }
.adv-body { padding: 10px 20px 4px; }
.step { border: 0; margin: 0; padding: 0; min-width: 0; }
.step-lead { color: var(--muted); margin: 0 0 14px; }
.adv-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 20px 20px; }
.adv-nav [data-act=next] { margin-inline-start: auto; min-width: 150px; }
.adv-resume { max-width: 820px; margin: 0 auto 14px; background: var(--paper); border: 1px dashed var(--line-2); border-radius: 14px; padding: 8px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; position: relative; z-index: 1; }

/* أنواع المشاريع */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 820px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { position: relative; cursor: pointer; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile-in {
  display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 12px 14px; border-radius: var(--r-tile);
  border: 1.5px solid var(--line); background: var(--paper); font-weight: 700; color: var(--ink); line-height: 1.35; transition: border-color .15s, background .15s;
}
.tile-in .ic { color: var(--purple); }
.tile:hover .tile-in { border-color: var(--line-2); background: var(--lav-2); }
.tile input:checked + .tile-in { border-color: var(--purple); background: #F4EEFA; box-shadow: inset 0 0 0 1px var(--purple); }
.tile input:checked + .tile-in .ic { color: var(--orange-d); }
.tile input:focus-visible + .tile-in { outline: 3px solid var(--orange); outline-offset: 2px; }

/* خيارات بقائمة */
.choices { display: grid; gap: 10px; }
.choice { position: relative; cursor: pointer; display: block; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span {
  display: block; position: relative; padding: 14px 52px 14px 16px; border-radius: var(--r-tile); border: 1.5px solid var(--line);
  font-weight: 700; background: var(--paper); transition: border-color .15s, background .15s;
}
.choice > span::before { content: ""; position: absolute; right: 16px; top: 17px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; }
.choice small { display: block; font-weight: 500; color: var(--muted); font-size: 14px; margin-top: 2px; }
.choice input:checked + span { border-color: var(--purple); background: #F4EEFA; }
.choice input:checked + span::before { border-color: var(--purple); box-shadow: inset 0 0 0 5px #fff; background: var(--purple); }
.choice input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }
.choice input:disabled + span { opacity: .45; cursor: not-allowed; }
.cond { margin-top: 14px; padding: 14px 16px 2px; background: var(--lav-2); border-radius: 14px; }
.callout { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--lav-2); border: 1px solid var(--line); }
.callout p { margin: 4px 0 8px; color: var(--muted); font-size: 15px; }
.callout-water { background: #E9F5F4; border-color: rgba(15, 124, 120, .3); }
.callout-water > .ic { color: var(--teal); margin-top: 2px; }
.callout-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }

/* الأجهزة */
.loads { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.load { border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); }
.load.open { border-color: var(--line-2); box-shadow: var(--sh-1); }
.load-main { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; }
.load-toggle { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 8px 10px; background: none; border: 0; text-align: right; cursor: pointer; border-radius: 10px; font-family: var(--f-body); }
.load-toggle:hover { background: var(--lav-2); }
.load-name { font-weight: 700; font-size: 16px; color: var(--ink); }
.load-meta { color: var(--muted); font-size: 14px; }
.load-surge { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 700; color: var(--warn); background: #FDF1E2; border-radius: 999px; padding: 1px 8px; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line-2); border-radius: 12px; overflow: hidden; flex: none; }
.stepper button { width: 42px; height: 42px; display: grid; place-items: center; border: 0; background: var(--paper); color: var(--purple); cursor: pointer; }
.stepper button:hover { background: var(--lav-2); }
.stepper output { min-width: 34px; text-align: center; font: 700 17px var(--f-head); color: var(--ink); }
.load-edit { padding: 4px 14px 10px; border-top: 1px dashed var(--line); }
.load-edit .field { margin-bottom: 10px; }
.load-edit label { font-size: 13.5px; }
.add-load { position: relative; margin-top: 6px; }
.search-wrap { position: relative; }
.search-wrap .ic { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-wrap input { padding-right: 42px; }
.add-list { list-style: none; margin: 6px 0 0; padding: 6px; position: absolute; inset-inline: 0; top: 100%; z-index: 20; background: var(--paper); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--sh-2); max-height: 320px; overflow: auto; }
.add-list li { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.add-list li[aria-selected=true], .add-list li:hover { background: var(--lav-2); }
.add-list small { color: var(--muted); }
.add-list .cat { cursor: default; font-size: 12.5px; font-weight: 700; color: var(--orange-d); padding: 8px 12px 2px; }
.add-list .cat:hover { background: none; }

/* الملخص الحي */
.live {
  position: sticky; bottom: calc(var(--mbar-h) + env(safe-area-inset-bottom)); z-index: 5;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 12px; padding: 10px 12px;
  background: var(--deep); color: #fff; border-radius: 16px; box-shadow: var(--sh-2);
}
@media (min-width: 900px) { .live { bottom: 12px; margin: 0 20px; } }
.live-item { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.25; }
.live-item span { font-size: 12px; color: #CDBFDD; }
.live-item b { font: 700 21px var(--f-head); color: var(--orange); margin: 2px 0; }
.live-item small { font-size: 11.5px; color: #CDBFDD; }

/* ملخص المدخلات بعد الحساب */
.adv-summary { max-width: 820px; margin: 0 auto 16px; background: var(--paper); border-radius: 16px; border: 1px solid var(--line); padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; box-shadow: var(--sh-1); position: relative; z-index: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--lav-2); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--deep); }
.adv-summary .link-btn { margin-inline-start: auto; }

/* ---------- النتيجة ---------- */
.adv-result { max-width: 1120px; margin: 0 auto; }
.res-head { background: var(--paper); border-radius: var(--r-card); padding: 20px; border: 1px solid var(--line); box-shadow: var(--sh-1); margin-bottom: 14px; }
.res-head h2 { margin-bottom: 6px; }
.res-sub { margin: 0; color: var(--muted); }
.res-sub b { color: var(--ink); }
.res-note { display: flex; gap: 8px; margin: 10px 0 0; color: var(--deep); background: var(--lav-2); padding: 8px 12px; border-radius: 12px; font-size: 15px; }
.opts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(262px, 82%); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 2px 14px; margin: 0 -2px; overscroll-behavior-x: contain; }
@media (min-width: 900px) { .opts { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; } }
.opt {
  scroll-snap-align: center; display: flex; flex-direction: column; gap: 8px; text-align: right; padding: 16px; border-radius: var(--r-card);
  background: var(--paper); border: 1.5px solid var(--line); cursor: pointer; font-family: var(--f-body); color: var(--ink); position: relative;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.opt:hover { border-color: var(--line-2); }
.opt.is-rec { border-color: rgba(243, 149, 24, .7); }
.opt.is-sel { border-color: var(--purple); box-shadow: inset 0 0 0 1.5px var(--purple), var(--sh-1); }
.opt-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.opt-label { font: 700 21px var(--f-head); color: var(--purple); }
.opt-badge { font-size: 12.5px; font-weight: 800; color: #2A1240; background: var(--orange); border-radius: 999px; padding: 3px 10px; }
.opt-for { color: var(--muted); font-size: 14.5px; margin-top: -6px; }
.opt-specs { display: grid; gap: 4px; font-size: 15px; font-weight: 600; }
.opt-specs span { display: flex; align-items: center; gap: 8px; }
.opt-specs .ic { color: var(--orange-d); }
.opt-price { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); font: 700 19px var(--f-head); color: var(--deep); }

.panel { background: var(--paper); border-radius: var(--r-card); border: 1px solid var(--line); box-shadow: var(--sh-1); padding: 20px; margin-bottom: 14px; }
.panel h3 { font-size: 19px; }
.panel-top { display: grid; gap: 20px; }
@media (min-width: 820px) { .panel-top { grid-template-columns: 290px 1fr; align-items: start; } }
.ringbox { display: flex; flex-direction: column; align-items: center; }
.rings { width: 210px; height: 210px; }
.rings circle { fill: none; stroke-width: 8.4; }
.r-track { stroke: #ECE6F2; }
.r-prod { stroke: var(--orange); }
.r-cons { stroke: var(--purple); }
.r-num { font: 700 26px var(--f-head); fill: var(--deep); }
.r-cap { font: 600 9.5px var(--f-body); fill: var(--muted); }
.panel:not([hidden]) .r-prod, .panel:not([hidden]) .r-cons { animation: ring-draw 1.1s cubic-bezier(.3, .7, .2, 1) both; }
.panel:not([hidden]) .r-cons { animation-delay: .15s; }
@keyframes ring-draw { from { stroke-dasharray: 0 360; } }
.legend { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; font-size: 14.5px; color: var(--muted); }
.legend b { color: var(--ink); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-inline-end: 8px; vertical-align: -1px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 4px; }
.k-prod { background: var(--orange); }
.k-cons { background: var(--purple); }
.k-soc { background: var(--ok); }
.comp-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.comp-price { font: 700 22px var(--f-head); color: var(--deep); }
.comp-price small { font: 600 13px var(--f-body); color: var(--muted); }
.comp-sar { display: block; margin-top: 2px; font: 700 15px var(--f-body); color: var(--deep); }
.comp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.comp-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--lav-2); }
.comp-list .ic { color: var(--purple); margin-top: 2px; }
.comp-list b { display: block; font-size: 16.5px; }
.comp-list span { display: block; color: var(--muted); font-size: 14.5px; }
.save { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #FDF1E2; color: #5A3600; }
.save p { margin: 0; }
.save .ic { color: var(--orange-d); margin-top: 3px; }
.why, .sim, .pc { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.why p { max-width: 75ch; }
.chart { width: 100%; height: auto; display: block; margin-top: 4px; }
.chart .g { stroke: #ECE6F2; stroke-width: 1; }
.chart { max-width: 680px; margin-inline: auto; }
.chart .ax { font: 500 11px var(--f-body); fill: var(--muted); }
@media (max-width: 600px) { .chart .ax { font-size: 14.5px; } .chart .ax.unit { font-size: 12px; } }
.chart .ax.unit { font-size: 10px; }
.chart .ax.soc { fill: var(--ok); }
.chart .a-prod { fill: rgba(243, 149, 24, .22); }
.chart .l-prod { fill: none; stroke: var(--orange); stroke-width: 2.5; stroke-linejoin: round; }
.chart .l-cons { fill: none; stroke: var(--purple); stroke-width: 2.5; stroke-linejoin: round; }
.chart .l-soc { fill: none; stroke: var(--ok); stroke-width: 2; stroke-dasharray: 5 4; }
.sim-cap { margin: 6px 0 0; font-size: 15px; }
.pc { display: grid; gap: 16px; }
@media (min-width: 700px) { .pc { grid-template-columns: 1fr 1fr; } }
.ticks, .dots { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ticks li, .dots li { position: relative; padding-right: 26px; }
.ticks li::before { content: ""; position: absolute; right: 2px; top: 9px; width: 12px; height: 7px; border: solid var(--ok); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg); }
.dots li::before { content: ""; position: absolute; right: 6px; top: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.tech { margin-top: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--lav-2); }
.tech summary { cursor: pointer; padding: 14px 16px; font-weight: 700; color: var(--deep); list-style: none; display: flex; align-items: center; gap: 8px; min-height: 48px; }
.tech summary::-webkit-details-marker { display: none; }
.tech summary::after { content: ""; margin-inline-start: auto; width: 9px; height: 9px; border: solid var(--purple); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; }
.tech[open] summary::after { transform: rotate(-135deg); }
.tech > :not(summary) { margin-inline: 16px; }
.tech-grid { display: grid; gap: 0 24px; }
@media (min-width: 760px) { .tech-grid { grid-template-columns: 1fr 1fr; } }
.tech dl { margin: 0 0 12px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14.5px; }
.tech dt { color: var(--muted); }
.tech dd { margin: 0; font-weight: 600; text-align: left; }
.table-wrap { overflow-x: auto; }
.boq { width: 100%; border-collapse: collapse; font-size: 14.5px; background: var(--paper); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.boq th, .boq td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: right; }
.boq th { background: #EFE9F6; color: var(--deep); font-weight: 700; }
.boq td:last-child, .boq th:last-child { text-align: left; white-space: nowrap; }
.tech-notes { font-size: 14px; color: var(--muted); margin: 0 0 14px; padding-right: 18px; }
.advice { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.advice li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.advice .ic { margin-top: 3px; }
.adv-tip .ic { color: var(--orange-d); }
.adv-info .ic { color: var(--purple); }
.adv-warn { border-color: rgba(154, 91, 0, .35) !important; background: #FFF8EE !important; }
.adv-warn .ic { color: var(--warn); }
.res-actions { background: var(--paper); border-radius: var(--r-card); padding: 18px; border: 1px solid var(--line); box-shadow: var(--sh-1); display: grid; gap: 10px; }
/* الزرّان في سطر واحد إن اتسعا بنصّهما كاملاً، وإلا ينزل الثاني تحت الأول بعرض كامل — لا تجاوز ولا كسر للنص */
.res-actions-row { display: flex; flex-wrap: wrap; gap: 10px; }
.res-actions-row .btn { flex: 1 1 auto; white-space: nowrap; padding-inline: 10px; }
.money { unicode-bidi: isolate; white-space: nowrap; }
.res-actions-row.subtle { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 16px; }
.disclaimer { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 14px; margin: 14px 4px 0; }
.again { text-align: center; margin-top: 18px; }

/* ---------- نافذة الطلب ---------- */
.sheet { border: 0; padding: 0; width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; margin: auto auto 0; max-height: 94vh; background: var(--paper); color: var(--ink); box-shadow: var(--sh-2); }
@media (min-width: 640px) { .sheet { border-radius: 22px; margin: auto; } }
.sheet::backdrop { background: rgba(43, 13, 66, .55); }
.sheet-in { padding: 18px 20px 22px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-head h2 { margin: 0; font-size: 23px; }
.sheet-lead { color: var(--muted); font-size: 15px; margin: 4px 0 14px; }
.sheet-done { text-align: center; padding-top: 26px; }
.branch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.branch { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--line-2); border-radius: 16px; background: var(--paper); color: var(--ink); text-decoration: none; min-height: 72px; }
.branch:hover, .branch:focus-visible { border-color: var(--purple); background: var(--lav-2); }
.branch:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.branch-pin { flex: 0 0 auto; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--purple); color: var(--orange); }
.branch-txt { flex: 1 1 auto; min-width: 0; display: grid; gap: 3px; }
.branch-txt b { font: 700 18px var(--f-head); color: var(--deep); }
.branch-txt small { color: var(--muted); font-size: 14px; line-height: 1.5; }
.branch-go { flex: 0 0 auto; color: var(--purple); }
.done-mark { width: 92px; height: 92px; }
.done-mark circle { fill: none; stroke: var(--orange); stroke-width: 8.4; }
.done-mark path { fill: none; stroke: var(--purple); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.sheet-done h2 { margin: 10px 0 6px; }

/* ---------- الصفحة ---------- */
.err-page { text-align: center; padding: 56px 16px 72px; max-width: 640px; }
.err-mark { width: 110px; height: 110px; margin-bottom: 8px; }
.err-mark circle { fill: none; stroke-width: 8.4; stroke: var(--orange); }
.err-mark circle + circle { stroke: var(--purple); }
.err-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

/* ---------- التذييل ---------- */
.ftr { background: var(--deep); color: #DCD2E8; margin-top: 24px; }
.ftr-grid { display: grid; gap: 26px; padding-top: 40px; padding-bottom: 26px; }
@media (min-width: 760px) { .ftr-grid { grid-template-columns: 1.4fr 1.2fr 1fr .8fr; } }
.ftr h2 { color: #fff; font-size: 18px; margin-bottom: 10px; }
.ftr p { font-size: 15px; margin-bottom: 8px; }
.ftr strong { color: #fff; }
.ftr-brand img { height: 70px; width: auto; margin-bottom: 12px; }
.ftr ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ftr a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; }
.ftr a:hover { color: var(--orange); }
.ftr-bottom { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 14px; padding-bottom: 18px; font-size: 13.5px; color: #B7A8C9; }

/* ---------- شريط الجوال السفلي ---------- */
.mbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -6px 20px -12px rgba(61, 14, 95, .35); }
.mbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--mbar-h); font-size: 12.5px; font-weight: 700; color: var(--deep); text-decoration: none; }
.mbar .ic { color: var(--purple); }
.mbar-main { background: var(--purple); color: #fff !important; }
.mbar-main .ic { color: var(--orange); }
@media (min-width: 900px) { .mbar { display: none; } }

/* ---------- تقليل الحركة ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- الطباعة ---------- */
.print-head { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; font-size: 12.5pt; padding: 0; }
  .hdr, .ftr, .mbar, .band, .adv-card, .adv-summary, .opts, .res-actions, .advice, .again, .sheet, .skip, .adv-resume { display: none !important; }
  .adv { margin: 0; padding: 0; }
  .print-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2.5pt solid var(--orange); padding-bottom: 8pt; margin-bottom: 12pt; }
  .print-head img { height: 52pt; width: auto; }
  .print-head p { margin: 0; font-size: 10pt; color: #444; text-align: left; }
  .panel, .res-head { box-shadow: none; border: 0; padding: 0; }
  .panel[hidden] { display: none !important; }
  .tech { display: block; }
  .tech > * { display: block; }
  .tech summary::after { display: none; }
  .comp-list li, .save, .tech { background: #fff; border: 1px solid #ddd; }
  .rings circle, .chart * { animation: none !important; }
  a { color: inherit; text-decoration: none; }
}
