:root{
  --primary:#05a9c8;--primary2:#0a7894;--navy:#082f3b;--ink:#10242c;--muted:#64767d;
  --bg:#f4f8fa;--card:#fff;--line:#dce7eb;--success:#168047;--danger:#b42318;
  --shadow:0 18px 55px rgba(9,47,60,.10)
}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:Tahoma,Arial,sans-serif;background:var(--bg);color:var(--ink)}
button,input,select{font:inherit}.container{width:min(1180px,calc(100% - 32px));margin:auto}
.topbar{background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:30}
.topbar-inner{height:72px;display:flex;align-items:center;justify-content:space-between;gap:18px}
.brand{display:flex;align-items:center;gap:11px;text-decoration:none;color:var(--ink)}
.brand-mark{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:linear-gradient(135deg,var(--primary2),var(--primary));color:#fff;font-weight:900}
.brand b,.brand small{display:block}.brand small{font-size:11px;color:var(--muted);margin-top:3px}
.top-actions{display:flex;align-items:center;gap:15px}.text-link{color:var(--primary2);text-decoration:none;font-weight:700;font-size:14px}
.ghost-btn,.secondary-btn,.primary-btn,.dark-btn{border:0;border-radius:13px;padding:12px 18px;font-weight:800;cursor:pointer;transition:.2s}
.ghost-btn,.secondary-btn{background:#fff;border:1px solid var(--line);color:var(--ink)}.primary-btn{background:var(--primary);color:#fff}.dark-btn{background:var(--navy);color:#fff}
button:hover{transform:translateY(-1px)}.full{width:100%}.hidden{display:none!important}
.hero{background:linear-gradient(135deg,#062e3a,#087d99 64%,#18b6d3);color:#fff;overflow:hidden}
.hero-grid{min-height:340px;display:grid;grid-template-columns:1.25fr .75fr;align-items:center;gap:30px;padding-top:42px;padding-bottom:42px}
.eyebrow,.success-pill{display:inline-flex;padding:7px 11px;border-radius:999px;background:rgba(255,255,255,.14);font-size:12px;font-weight:800}
.hero h1{font-size:clamp(34px,5vw,58px);line-height:1.16;margin:15px 0 12px}.hero p{max-width:700px;line-height:1.9;margin:0;font-size:16px}
.hero-badges{display:flex;flex-wrap:wrap;gap:9px;margin-top:20px}.hero-badges span{background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.16);padding:8px 11px;border-radius:10px;font-size:12px}
.hero-visual{height:250px;position:relative}.sun{position:absolute;width:100px;height:100px;border-radius:50%;background:#ffd85c;top:10px;left:20px;box-shadow:0 0 60px rgba(255,216,92,.5)}
.panel{position:absolute;width:120px;height:78px;background:repeating-linear-gradient(90deg,#0e4b72 0 23px,#d3ebf3 24px 25px),repeating-linear-gradient(0deg,transparent 0 18px,#d3ebf3 19px 20px);border:4px solid #d6eaf0;transform:skewY(-8deg);box-shadow:0 15px 30px rgba(0,0,0,.18)}
.p1{bottom:30px;right:10px}.p2{bottom:53px;right:120px}.p3{bottom:76px;right:230px}.battery,.inverter{position:absolute;bottom:5px;background:#fff;color:var(--navy);font-weight:900;border-radius:13px;padding:17px 15px;box-shadow:0 12px 25px rgba(0,0,0,.16)}.battery{left:8px}.inverter{left:95px}
.app-shell{margin-top:-24px;padding-bottom:55px;position:relative;z-index:2}
.progress-wrap{background:#fff;border:1px solid var(--line);border-radius:19px;padding:19px 22px;box-shadow:var(--shadow)}
.progress-line{height:5px;background:#e8eff2;border-radius:99px;overflow:hidden}.progress-line span{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--primary2),var(--primary));transition:.35s}
.steps{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:13px}.step{border:0;background:transparent;display:flex;align-items:center;justify-content:center;gap:8px;color:var(--muted);cursor:pointer}.step i{font-style:normal;width:27px;height:27px;border-radius:50%;display:grid;place-items:center;background:#edf3f5;font-weight:800}.step.active{color:var(--primary2);font-weight:800}.step.active i{background:var(--primary);color:#fff}
.wizard-card{margin-top:18px;background:#fff;border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow);padding:30px}
.wizard-page{display:none}.wizard-page.active{display:block}.section-heading span{color:var(--primary2);font-weight:800;font-size:12px}.section-heading h2{font-size:30px;margin:8px 0}.section-heading p{color:var(--muted);line-height:1.7;margin:0}
.choice-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin-top:25px}.package-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin-top:25px}.choice-card,.package-card{border:1px solid var(--line);background:#fff;border-radius:18px;padding:24px;text-align:right;cursor:pointer}.choice-card.selected,.package-card.selected{border-color:var(--primary);box-shadow:0 0 0 3px rgba(5,169,200,.12)}.choice-card b,.choice-card small,.package-card b,.package-card small{display:block}.choice-card small,.package-card small{color:var(--muted);line-height:1.7;margin-top:7px}.choice-icon{width:48px;height:48px;border-radius:14px;display:grid;place-items:center;background:#e8f8fb;color:var(--primary2);font-weight:900;font-size:20px;margin-bottom:18px}
.nav-row{display:flex;justify-content:space-between;gap:12px;margin-top:28px}.nav-row.end{justify-content:flex-end}
.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:15px;margin-top:24px}.form-grid.three{grid-template-columns:repeat(3,1fr)}
.field span{display:block;font-weight:800;font-size:13px;margin-bottom:7px}.field input,.field select{width:100%;padding:13px 14px;border:1px solid #cadce2;border-radius:12px;outline:none;background:#fff}.field input:focus,.field select:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(5,169,200,.12)}.field small{display:block;color:var(--muted);font-size:11px;margin-top:6px}
.device-toolbar{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:end;margin-top:22px}.device-catalog{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:18px}.device-card{border:1px solid var(--line);border-radius:14px;padding:14px;background:#fff;text-align:right}.device-card b,.device-card small{display:block}.device-card small{color:var(--muted);margin-top:4px}.device-card button{margin-top:10px;border:0;background:#e9f8fb;color:var(--primary2);font-weight:800;padding:8px 10px;border-radius:9px;cursor:pointer}
.selected-loads{margin-top:25px;border-top:1px solid var(--line);padding-top:20px}.selected-row{display:grid;grid-template-columns:1fr 110px 110px 45px;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid #edf2f4}.selected-row input{width:100%;padding:9px;border:1px solid var(--line);border-radius:9px}.remove-device{border:0;background:#fff0f0;color:var(--danger);border-radius:9px;height:38px;cursor:pointer}.empty-mini{color:var(--muted);padding:15px 0}.subheading{margin:26px 0 13px}.package-grid{grid-template-columns:repeat(3,1fr)}.package-card span{font-size:11px;color:var(--primary2);font-weight:800}.package-card b{font-size:20px;margin-top:6px}
.result-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}.success-pill{background:#eaf8ef;color:var(--success)}.result-head h2{font-size:31px;margin:10px 0 7px}.result-head p{color:var(--muted);margin:0}
.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-top:24px}.metric{background:#f3fafb;border:1px solid var(--line);border-radius:16px;padding:17px}.metric span,.metric small{display:block;color:var(--muted);font-size:12px}.metric b{font-size:25px;display:block;margin:8px 0 3px}
.result-layout{display:grid;grid-template-columns:1fr 330px;gap:22px;margin-top:20px}.result-items{display:grid;gap:11px}.result-item{display:grid;grid-template-columns:1fr auto;gap:14px;align-items:center;border:1px solid var(--line);border-radius:15px;padding:15px}.result-item b,.result-item small{display:block}.result-item small{color:var(--muted);margin-top:5px;line-height:1.5}.item-qty{background:#e8f7fa;color:var(--primary2);border-radius:999px;padding:8px 12px;font-weight:900;white-space:nowrap}
.quote-card{background:var(--navy);color:#fff;border-radius:19px;padding:22px;align-self:start;position:sticky;top:92px}.quote-card>span{font-size:12px;opacity:.72}.quote-card>b{display:block;font-size:24px;margin:8px 0}.quote-card>small{display:block;opacity:.65;line-height:1.6}.quote-card hr{border:0;border-top:1px solid rgba(255,255,255,.14);margin:18px 0}.quote-line{display:flex;justify-content:space-between;gap:10px;font-size:13px;margin:10px 0}.quote-card button{margin-top:10px}.quote-card .secondary-btn{background:transparent;color:#fff;border-color:rgba(255,255,255,.25)}.action-message{font-size:12px;line-height:1.6;text-align:center;min-height:18px}
.engineering-note{margin-top:20px;background:#fff9e9;border:1px solid #efda96;color:#6d5819;border-radius:14px;padding:15px;line-height:1.75;font-size:13px}
footer{background:#062e3a;color:#fff;padding:26px 0}.footer-grid{display:flex;justify-content:space-between;gap:20px}.footer-grid p{margin:6px 0;opacity:.72;font-size:13px}
.modal{position:fixed;inset:0;background:rgba(2,21,28,.62);display:grid;place-items:center;padding:16px;z-index:50}.modal-card{width:min(620px,100%);background:#fff;border-radius:20px;padding:25px;position:relative}.modal-close{position:absolute;left:15px;top:12px;border:0;background:#edf3f5;border-radius:50%;width:34px;height:34px;font-size:22px;cursor:pointer}
@media(max-width:900px){.hero-grid{grid-template-columns:1fr}.hero-visual{display:none}.form-grid.three,.device-catalog{grid-template-columns:1fr 1fr}.metrics{grid-template-columns:1fr 1fr}.result-layout{grid-template-columns:1fr}.quote-card{position:static}.package-grid{grid-template-columns:1fr}}
@media(max-width:600px){.container{width:min(100% - 22px,1180px)}.top-actions .text-link{display:none}.hero-grid{min-height:300px}.hero h1{font-size:36px}.app-shell{margin-top:-15px}.progress-wrap{padding:15px 10px}.step span{display:none}.wizard-card{padding:19px;border-radius:19px}.choice-grid,.form-grid,.form-grid.three,.device-catalog{grid-template-columns:1fr}.device-toolbar{grid-template-columns:1fr}.selected-row{grid-template-columns:1fr 80px 80px 40px}.metrics{grid-template-columns:1fr 1fr}.metric b{font-size:20px}.result-head{display:block}.result-head button{margin-top:15px}.footer-grid{display:block}.topbar-inner{height:64px}}
@media print{.topbar,.hero,.progress-wrap,.nav-row,.quote-card button,footer,#editInputs{display:none!important}.app-shell{margin:0}.wizard-card{box-shadow:none;border:0}.result-layout{grid-template-columns:1fr 300px}.quote-card{background:#fff;color:#000;border:1px solid #ccc}.wizard-page{display:none!important}.wizard-page.result-page{display:block!important}}

.sync-badge{font-size:11px;font-weight:800;padding:7px 10px;border-radius:999px;background:#fff8df;color:#765d00;border:1px solid #f0dc91;white-space:nowrap}.sync-badge.ok{background:#eaf8ef;color:#168047;border-color:#bfe7ce}.sync-badge.warn{background:#fff0f0;color:#a22;border-color:#f0c6c6}@media(max-width:760px){.sync-badge{display:none}}

.result-layout>*{min-width:0}.result-item>div{min-width:0}.result-item b,.result-item small{overflow-wrap:anywhere;word-break:break-word}.wizard-card{overflow:hidden}

/* Product cards with live Ecwid image and prices */
.product-result-card{grid-template-columns:110px 1fr!important;align-items:stretch!important;gap:16px!important;padding:14px!important;overflow:hidden}
.result-product-image{width:110px;min-height:110px;border-radius:13px;background:#f3f8fa;border:1px solid var(--line);display:grid;place-items:center;overflow:hidden}
.result-product-image img{width:100%;height:100%;object-fit:contain;background:#fff}
.result-product-image span{font-size:34px;opacity:.55}
.result-product-info{min-width:0}.result-product-name{display:block;color:var(--ink);font-size:17px;font-weight:900;text-decoration:none;overflow-wrap:anywhere}.result-product-name:hover{color:var(--primary2)}
.result-product-info>small{display:block;color:var(--muted);line-height:1.6;margin-top:6px;overflow-wrap:anywhere}
.result-price-grid{display:grid;grid-template-columns:1fr 90px 1fr;gap:8px;margin-top:12px}
.result-price-grid>div{background:#f4fafb;border:1px solid var(--line);border-radius:10px;padding:9px 10px;min-width:0}
.result-price-grid span{display:block;color:var(--muted);font-size:10px;margin-bottom:5px}.result-price-grid b{display:block;font-size:13px;overflow-wrap:anywhere}
@media(max-width:600px){.product-result-card{grid-template-columns:82px 1fr!important;gap:11px!important}.result-product-image{width:82px;min-height:98px}.result-price-grid{grid-template-columns:1fr 62px}.result-price-grid>div:last-child{grid-column:1/-1}.result-product-name{font-size:15px}}

.result-product-image a{display:grid;place-items:center;width:100%;height:100%}
.result-product-image .no-image{font-size:11px!important;text-align:center;color:var(--muted);padding:8px;opacity:1!important}
.result-product-image.image-error:after{content:"تعذر تحميل الصورة";font-size:10px;color:var(--muted);text-align:center;padding:6px}
.sync-badge.warn{background:#fff1f0!important;color:#b42318!important;border:1px solid #ffc9c5!important}

.product-choice-section{margin-top:24px;border:1px solid var(--line);border-radius:20px;padding:20px;background:#fbfdfe}
.choice-section-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin-bottom:18px}.choice-section-head span{color:var(--primary2);font-size:12px;font-weight:900}.choice-section-head h3{margin:5px 0 0;font-size:23px}.choice-section-head small{max-width:460px;color:var(--muted);line-height:1.7}
.component-choice-block{margin-top:18px}.component-choice-block h4{margin:0 0 10px;font-size:16px}.panel-rule-note{background:#eff9fb;border:1px solid #cceaf0;border-radius:12px;padding:11px 13px;color:#315e68;font-size:12px;line-height:1.7}
.live-product-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}.live-choice-card{position:relative;border:1px solid var(--line);background:#fff;border-radius:15px;padding:12px;display:grid;grid-template-columns:72px 1fr;gap:11px;text-align:right;cursor:pointer;min-height:118px}.live-choice-card:hover{border-color:#91d8e4}.live-choice-card.selected{border-color:var(--primary);box-shadow:0 0 0 3px rgba(5,169,200,.13)}.live-choice-card input{position:absolute;opacity:0}.live-choice-card img,.choice-image-placeholder{width:72px;height:88px;object-fit:contain;border-radius:10px;background:#f3f7f8;border:1px solid var(--line)}.choice-image-placeholder{display:grid;place-items:center;font-size:25px}.live-choice-info{min-width:0}.live-choice-info b{display:block;font-size:13px;line-height:1.5}.live-choice-meta{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}.live-choice-meta span{font-size:10px;background:#edf7f9;color:#17677a;padding:4px 7px;border-radius:999px}.live-choice-price{display:block;margin-top:7px;color:var(--navy);font-weight:900;font-size:12px}.choice-unlisted{color:#a15c00!important}.panel-current-summary{font-size:11px;color:var(--success);font-weight:800;margin-top:5px;display:block}
@media(max-width:900px){.live-product-choices{grid-template-columns:1fr 1fr}.choice-section-head{display:block}.choice-section-head small{display:block;margin-top:8px}}
@media(max-width:600px){.live-product-choices{grid-template-columns:1fr}.product-choice-section{padding:14px}.live-choice-card{grid-template-columns:62px 1fr}.live-choice-card img,.choice-image-placeholder{width:62px;height:78px}}

/* V11: panel choices by wattage */
.live-choice-meta span:last-child{font-weight:700}
.live-choice-card:has(.choice-unlisted){border-style:dashed}

/* V24 — Al-Bayan logo and interface menu icons */
.brand-mark{
  overflow:hidden;
  background:#fff;
  border:1px solid var(--line);
  padding:3px;
}
.brand-mark img{
  width:100%;
  height:100%;
  display:block;
  object-fit:contain;
  border-radius:9px;
}
.choice-icon svg,.package-icon svg{
  width:28px;
  height:28px;
  fill:none;
  stroke:currentColor;
  stroke-width:2.6;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.choice-icon svg path:first-child:only-child{
  fill:currentColor;
  stroke:none;
}
.package-card{
  position:relative;
}
.package-icon{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:13px;
  background:#e8f8fb;
  color:var(--primary2);
  margin-bottom:14px;
}
.package-card.selected .package-icon{
  background:var(--primary);
  color:#fff;
}

/* Compact selected-product mode */
.live-product-choices:has(.change-product-btn){grid-template-columns:minmax(0,1fr);}
.live-product-choices:has(.change-product-btn) .live-choice-card{max-width:760px;width:100%;margin-inline:auto;grid-template-columns:92px 1fr;min-height:128px;}
.live-product-choices:has(.change-product-btn) .live-choice-card img,
.live-product-choices:has(.change-product-btn) .choice-image-placeholder{width:92px;height:102px;}
.change-product-btn{grid-column:1/-1;justify-self:center;border:1px solid #87cfdc;background:#eefafd;color:#075b70;border-radius:12px;padding:10px 18px;font:inherit;font-weight:800;cursor:pointer;margin-top:2px;}
.change-product-btn:hover{background:#dcf5f9;border-color:#18a8be;}
@media(max-width:600px){.live-product-choices:has(.change-product-btn) .live-choice-card{grid-template-columns:80px 1fr}.live-product-choices:has(.change-product-btn) .live-choice-card img,.live-product-choices:has(.change-product-btn) .choice-image-placeholder{width:80px;height:92px}}

/* V41 PDF quotation + customer form */
.customer-modal-card{max-width:640px}.customer-modal-card>p{margin-top:-4px;color:#64727b}.modal-actions{display:flex;gap:10px;justify-content:flex-start;margin-top:18px}.modal-actions button{min-width:150px}
.pdf-quote-render{position:fixed;left:-100000px;top:0;width:794px;background:#fff;z-index:-9999;font-family:"Times New Roman",Tahoma,Arial,sans-serif;color:#10232b}.pdf-sheet{width:794px;min-height:1123px;padding:0 42px 36px;background:#fff;box-sizing:border-box;position:relative;overflow:hidden}.pdf-sheet:before{content:"B";position:absolute;inset:260px 0 auto;text-align:center;font:700 420px/1 Georgia,serif;color:rgba(11,118,143,.035);z-index:0}.pdf-sheet>*{position:relative;z-index:1}.pdf-banner{display:block;width:100%;height:auto;max-height:154px;object-fit:contain;object-position:center;margin:0 auto 8px}.pdf-meta{display:flex;justify-content:space-between;font-size:16px;margin:4px 4px 8px}.pdf-sheet h1{text-align:center;font-size:24px;margin:6px 0 10px;color:#073e4d}.pdf-customer-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr;border:1px solid #9cb7c0;border-radius:8px;overflow:hidden;margin-bottom:12px}.pdf-customer-grid>div{padding:8px 10px;border-left:1px solid #c8d7dc;display:flex;flex-direction:column;gap:2px}.pdf-customer-grid>div:last-child{border-left:0}.pdf-customer-grid span{font-size:12px;color:#697d85}.pdf-customer-grid b{font-size:16px}.pdf-intro{font-size:14px;line-height:1.7;margin:8px 2px 12px;text-align:right}.pdf-table{width:100%;border-collapse:collapse;table-layout:fixed;direction:ltr;font-size:13px}.pdf-table th,.pdf-table td{border:1px solid #55727c;padding:6px;text-align:center;vertical-align:middle}.pdf-table th{background:#087f9b;color:#fff;font-size:13px}.pdf-table th:nth-child(1){width:4%}.pdf-table th:nth-child(2){width:52%}.pdf-table th:nth-child(3){width:14%}.pdf-table th:nth-child(4){width:7%}.pdf-table th:nth-child(5){width:17%}.pdf-details{text-align:left!important;line-height:1.35}.pdf-details strong{display:block;font-size:13px;margin-bottom:3px}.pdf-details small{display:block;font-size:11px;color:#40535a}.pdf-table tfoot td{background:#e9f2f5;font-weight:700;font-size:14px}.pdf-notes{display:flex;gap:12px;flex-wrap:wrap;margin-top:12px;border-right:4px solid #0786a2;background:#f3f8f9;padding:9px 12px;font-size:12px}.pdf-signature{margin:14px 25px 8px auto;width:220px;text-align:center;display:flex;flex-direction:column;gap:4px;font-size:14px}.pdf-footer{display:block;width:100%;height:66px;object-fit:contain;margin-top:6px}
@media(max-width:600px){.modal-actions{flex-direction:column}.modal-actions button{width:100%}.customer-modal-card{max-height:90vh;overflow:auto}}

/* V43: WhatsApp-only result action */
.whatsapp-only-card{display:flex;flex-direction:column;justify-content:center;gap:14px;min-height:210px;text-align:center}
.whatsapp-only-card h3{margin:0;font-size:1.35rem}
.whatsapp-only-card p{margin:0;color:var(--muted,#65727d);line-height:1.8}
