/* الهوية: ألوان الشعار وطين نجد. الخلفيات مقطع وصور حقيقية من مواد الشركة (tools/make_media.ps1)، والمثلثات النجدية إطار فقط. */
:root {
  color-scheme: light;
  --night: #0B2230; --night-2: #123A52; --night-3: #1B4E6B;
  --blue: #1F74A8; --blue-ink: #155A86; --blue-soft: #E4F0F7;
  --orange: #F28C1E; --orange-2: #F7A445; --orange-ink: #A85604; --orange-soft: #FDF0DF;
  --mud: #B98A5E; --mud-ink: #7A5636; --sand: #EADBC4; --lime: #F7F1E7; --paper: #FFFDF9;
  --ink: #14242E; --ink-2: #3F505B; --ink-3: #5F6F79; --line: #E5DACA; --line-2: #D5C7B2;
  --good: #1B7A4B; --warn: #9A5B00; --bad: #B3261E;
  --head: "Readex Pro", "Dubai", "Segoe UI", Tahoma, sans-serif;
  --body: "Readex Pro", "IBM Plex Sans", "Dubai", "Segoe UI", Tahoma, sans-serif;
  --p-field: url(/assets/media/bg-field.webp); --p-rows: url(/assets/media/bg-rows.webp); --p-pivot: url(/assets/media/bg-pivot.webp); --p-closeup: url(/assets/media/bg-closeup.webp); --p-structure: url(/assets/media/bg-structure.webp); --p-horizon: url(/assets/media/bg-horizon.webp);
  --r: 14px; --r-lg: 22px; --shadow: 0 1px 2px rgba(20,36,46,.05), 0 8px 28px rgba(20,36,46,.08); --shadow-lg: 0 2px 4px rgba(11,34,48,.08), 0 24px 60px rgba(11,34,48,.22);
  --gutter: 24px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--lime); color: var(--ink); font: 400 16px/1.75 var(--body); overflow-wrap: anywhere; }
html[lang="en"] body { line-height: 1.6; }
img, svg { max-width: 100%; }
a { color: var(--blue-ink); text-underline-offset: 3px; }
a:hover { color: var(--orange-ink); }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 600; line-height: 1.3; margin: 0 0 .5em; color: var(--ink); overflow-wrap: normal; }
h1 { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.6rem); }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.5vw, 2.3rem); }
h3 { font-size: 1.14rem; font-family: var(--body); font-weight: 600; }
p { margin: 0 0 1em; }
ul, ol { padding-inline-start: 1.3em; margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 8px; color: #fff; }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 800px; }
.num, [data-num] { font-family: "IBM Plex Sans", var(--body); font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.hidden, [hidden] { display: none !important; }

/* ===== Header ===== */
.site-head { position: sticky; top: 0; z-index: 40; background: rgba(255,253,249,.94); backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--line); }
.head-in { display: flex; align-items: center; gap: 18px; min-height: 72px; }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 54px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: 2px; flex: 1; flex-wrap: nowrap; }
.nav > a, .nav summary { padding: 8px 11px; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; cursor: pointer; white-space: nowrap; list-style: none; }
.nav summary::-webkit-details-marker { display: none; }
.nav > a:hover, .nav summary:hover { background: var(--orange-soft); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--orange-ink); font-weight: 600; }
.nav details { position: relative; }
.nav summary::after { content: ""; display: inline-block; width: 7px; height: 7px; border-inline-end: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translate(-2px,-2px); margin-inline-start: 7px; }
.nav .menu { position: absolute; inset-inline-start: 0; top: calc(100% + 8px); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 8px; min-width: 250px; display: grid; gap: 2px; }
.nav .menu a { padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .95rem; }
.nav .menu a:hover { background: var(--orange-soft); }
.head-end { display: flex; align-items: center; gap: 10px; flex: none; }
.lang { font-size: .9rem; text-decoration: none; color: var(--ink-2); padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 8px; font-weight: 500; }
.burger { display: none; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 22px; border-radius: 11px; font: 600 1rem/1.3 var(--body); border: 1.5px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s, transform .1s; text-align: center; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); color: #1A1206; }
.btn-primary:hover { background: var(--orange-2); color: #1A1206; }
.btn-dark { background: var(--night); color: #fff; }
.btn-dark:hover { background: var(--night-3); color: #fff; }
.btn-line { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-line:hover { border-color: var(--ink); color: var(--ink); }
.btn-ghost-light { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); color: #fff; }
.btn-ghost-light:hover { background: rgba(255,255,255,.16); color: #fff; }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: .92rem; border-radius: 9px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ===== Hero ===== */
.hero { position: relative; background: var(--night); color: #fff; isolation: isolate; overflow: hidden; }
.hero-art, .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; z-index: -2; }
.hero-video { opacity: 0; transition: opacity 1.2s ease; }
.hero-video.on { opacity: 1; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to left, rgba(6,23,42,.84) 0%, rgba(6,23,42,.7) 44%, rgba(6,23,42,.14) 82%), linear-gradient(to bottom, rgba(6,23,42,.42), transparent 30%); }
html[dir="ltr"] .hero::after { background: linear-gradient(to right, rgba(6,23,42,.84) 0%, rgba(6,23,42,.7) 44%, rgba(6,23,42,.14) 82%), linear-gradient(to bottom, rgba(6,23,42,.42), transparent 30%); }
.hero-motion { position: absolute; top: 14px; inset-inline-end: 14px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.5); background: rgba(6,23,42,.6); color: #fff; cursor: pointer; }
.hero-motion[hidden] { display: none; }
.hero-motion:hover { background: rgba(6,23,42,.85); }
.hero-motion svg { width: 18px; height: 18px; fill: currentColor; }
.hero-in { padding-block: clamp(36px, 6vw, 76px) clamp(250px, 25vw, 340px); }
.hero h1 { color: #fff; font-weight: 700; max-width: 15em; margin-bottom: .35em; text-wrap: balance; }
.hero-sub { font-size: clamp(1.02rem, .95rem + .35vw, 1.22rem); max-width: 34em; color: #E7E2D6; margin-bottom: 0; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .92rem; color: #FFD9A3; margin-bottom: 14px; font-weight: 500; }
.hero-eyebrow::before { content: ""; width: 34px; height: 2px; background: var(--orange); }
.page-hero { position: relative; isolation: isolate; background: var(--night); color: #fff; padding-block: clamp(38px, 6vw, 72px) clamp(44px, 6vw, 76px); overflow: hidden; --photo: var(--p-rows); }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to left, rgba(6,23,42,.88), rgba(6,23,42,.74) 52%, rgba(6,23,42,.34)), var(--photo) center / cover no-repeat; animation: photo-drift 40s ease-in-out infinite alternate; }
html[dir="ltr"] .page-hero::before { background: linear-gradient(to right, rgba(6,23,42,.88), rgba(6,23,42,.74) 52%, rgba(6,23,42,.34)), var(--photo) center / cover no-repeat; }
@keyframes photo-drift { from { transform: scale(1.02); } to { transform: scale(1.1) translateX(-1.5%); } }
/* لكل موضوع لقطته. صفحتا «من نحن» و«المشاريع» بلقطة ألواح قريبة لا تدل على مشروع بعينه، لأن نصهما يَعِد بألا يُعرض مشروع قبل موافقة صاحبه. */
.pg-about .page-hero, .pg-projects .page-hero, .pg-hybrid .page-hero, .pg-store .page-hero, .pg-calculators-hybrid .page-hero, .pg-calculators-battery .page-hero, .pg-knowledge-battery-sizing .page-hero { --photo: var(--p-closeup); }
.pg-services .page-hero, .pg-on-off-grid .page-hero, .pg-calculators .page-hero, .pg-calculators-ongrid .page-hero, .pg-calculators-roi .page-hero, .pg-knowledge-net-billing .page-hero, .pg-knowledge-tariff-2027 .page-hero { --photo: var(--p-field); }
.pg-pumping .page-hero, .pg-calculators-pump .page-hero, .pg-knowledge-pump-sizing .page-hero { --photo: var(--p-pivot); }
.pg-equipment .page-hero, .pg-support .page-hero, .pg-calculators-area .page-hero { --photo: var(--p-structure); }
.pg-knowledge .page-hero, .pg-knowledge-system-types .page-hero, .pg-calculators-offgrid .page-hero, .pg-privacy .page-hero { --photo: var(--p-horizon); }
@media (max-width: 700px) {
  .hero::after, html[dir="ltr"] .hero::after { background: linear-gradient(to bottom, rgba(6,23,42,.8) 0%, rgba(6,23,42,.7) 58%, rgba(6,23,42,.3) 100%); }
  .page-hero::before, html[dir="ltr"] .page-hero::before { background: linear-gradient(rgba(6,23,42,.8), rgba(6,23,42,.72)), var(--photo) center / cover no-repeat; }
}
.page-hero h1 { color: #fff; font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.9rem); max-width: 20em; }
.page-hero p { color: #E7E2D6; max-width: 40em; font-size: 1.07rem; margin: 0; }
.page-hero::after, .band { content: ""; display: block; height: 26px; background: url(/assets/img/band-najd.svg) repeat-x center; }
.page-hero::after { position: absolute; inset-inline: 0; bottom: 0; background-image: url(/assets/img/band-najd-dark.svg); opacity: .8; }
.crumbs { font-size: .88rem; color: #C9D4DA; margin-bottom: 12px; }
.crumbs a { color: #FFD9A3; }

/* ===== Smart calculator bar ===== */
.calc-shell { position: relative; z-index: 5; margin-top: clamp(-230px, -18vw, -150px); }
.calc-card { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: clamp(18px, 2.4vw, 30px); border: 1px solid rgba(255,255,255,.6); }
.calc-card > h2 { font: 700 clamp(1.2rem, 1rem + .9vw, 1.6rem)/1.35 var(--body); margin-bottom: 4px; }
.calc-card > p { color: var(--ink-3); margin-bottom: 16px; font-size: .96rem; }
.fields { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.fields-main { grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl { font-weight: 500; font-size: .92rem; color: var(--ink); }
.field .hint { font-size: .8rem; color: var(--ink-3); line-height: 1.5; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="password"], .field input[type="search"], .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 9px 12px; border: 1.5px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--ink); font: 400 1rem/1.4 var(--body);
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,116,168,.18); }
.field.invalid input, .field.invalid select { border-color: var(--bad); }
.field .err { color: var(--bad); font-size: .84rem; }
.with-unit { position: relative; display: flex; align-items: stretch; }
.with-unit input { flex: 1; min-width: 0; font-size: 1.1rem !important; font-weight: 600; }
html[dir="rtl"] .with-unit input { padding-left: 74px; text-align: left; }
html[dir="ltr"] .with-unit input { padding-right: 74px; }
.field input::placeholder { color: #8C9AA3; font-weight: 400; opacity: 1; }
.with-unit .unit { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: .86rem; pointer-events: none; }
input[type="range"] { width: 100%; accent-color: var(--orange); height: 26px; margin: 0; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: .95rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--orange); flex: none; }
.seg { display: inline-flex; border: 1.5px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; min-height: 46px; }
.seg label { display: flex; align-items: center; justify-content: center; flex: 1; padding: 6px 14px; cursor: pointer; font-size: .95rem; white-space: nowrap; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--night); color: #fff; }
.seg label:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: -3px; }
/* حاسبة الضخ: بطاقات نوع المضخة وبطاقات الخيارات الثلاثة */
.pump-types { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.pump-type { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; min-height: 44px; border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff; cursor: pointer; }
.pump-type input { position: absolute; opacity: 0; pointer-events: none; }
.pump-type b { font-size: 1.02rem; }
.pump-type small { color: var(--ink-3); font-size: .8rem; }
.pump-type span { color: var(--ink-2); font-size: .86rem; line-height: 1.55; }
.pump-type:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); box-shadow: inset 0 0 0 1px var(--orange); }
.pump-type:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }
.pump-opts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.pump-opt { text-align: start; font: inherit; color: inherit; padding: 14px 16px; border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff; cursor: pointer; min-width: 0; }
.pump-opt[aria-checked="true"] { border-color: var(--orange); background: var(--orange-soft); box-shadow: inset 0 0 0 1px var(--orange); }
.pump-opt:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.pump-opt-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.pump-opt-h .num { font-weight: 700; color: var(--orange-dark, var(--ink)); }
.pump-opt dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin: 0; font-size: .9rem; }
.pump-opt dt { color: var(--ink-2); }
.pump-opt dd { margin: 0; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; text-align: end; }
.pump-opt dd[dir="rtl"] { direction: rtl; text-align: start; }
.field[hidden] { display: none; }
.calc-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-top: 16px; }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--blue-ink); list-style: none; display: inline-flex; gap: 8px; align-items: center; padding: 8px 0; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 1rem; line-height: 1; }
details.more[open] > summary::before { content: "\2212"; }
details.more .fields { margin-top: 8px; padding-top: 14px; border-top: 1px dashed var(--line-2); }

/* ===== Results ===== */
.results { padding-block: 28px 8px; }
.results.stale .results-main > * { opacity: .35; pointer-events: none; }
.results-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.results-side { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow: auto; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(16px, 2vw, 24px); box-shadow: 0 1px 2px rgba(20,36,46,.04); margin-bottom: 20px; min-width: 0; }
.panel > h3:first-child, .panel > .panel-head { margin-top: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 12px; }
.panel-head h3 { margin: 0; }
.headline { background: linear-gradient(135deg, var(--night) 0%, var(--night-2) 100%); color: #fff; border: 0; position: relative; overflow: hidden; }
.headline::after { content: ""; position: absolute; inset: 0; background: url(/assets/img/tile-najd.svg); opacity: .8; pointer-events: none; }
.headline > * { position: relative; z-index: 1; }
.headline .eyebrow { color: #FFD9A3; font-size: .95rem; margin-bottom: 4px; }
.hero-num { font: 700 clamp(1.9rem, 1.2rem + 3vw, 3.1rem)/1.15 "IBM Plex Sans", var(--body); color: #fff; font-variant-numeric: tabular-nums; }
.hero-num small { font-size: .42em; font-weight: 500; color: #E7E2D6; margin-inline-start: 6px; font-family: var(--body); }
.headline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 22px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.18); }
.headline-grid b { display: block; font: 600 1.25rem/1.3 "IBM Plex Sans", var(--body); }
.headline-grid span { color: #C9D4DA; font-size: .86rem; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: .94rem; line-height: 1.65; margin-bottom: 14px; background: var(--orange-soft); border: 1px solid #F3D5AE; color: #5E3B10; }
.notice.info { background: var(--blue-soft); border-color: #C5DEEC; color: #103F5E; }
.notice.bad { background: #FBEAE8; border-color: #F0C4C0; color: #7D1B15; }
.notice.good { background: #E5F4EC; border-color: #BFE3CE; color: #125C38; }
.notice > :last-child { margin-bottom: 0; }
.sizes { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.size { text-align: start; background: #fff; border: 1.5px solid var(--line-2); border-radius: 14px; padding: 14px; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 3px; position: relative; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.size:hover { border-color: var(--mud); }
.size[aria-pressed="true"] { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange) inset; background: #FFFBF4; }
.size .t { font-size: 1.02rem; font-weight: 600; }
.size .kw { font: 700 1.5rem/1.25 "IBM Plex Sans", var(--body); }
.size .kw small { font: 500 .8rem var(--body); color: var(--ink-3); }
.size .s { font-size: .85rem; color: var(--ink-2); line-height: 1.5; }
.size .why { font-size: .8rem; color: var(--ink-3); line-height: 1.45; margin-top: 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--lime); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.tile b { display: block; font: 600 1.28rem/1.3 "IBM Plex Sans", var(--body); font-variant-numeric: tabular-nums; }
.tile b small { font: 500 .78rem var(--body); color: var(--ink-3); margin-inline-start: 3px; }
.tile span { font-size: .84rem; color: var(--ink-2); }
.tile.pending b { font: 500 .95rem/1.5 var(--body); color: var(--ink-2); }
.meter { display: flex; gap: 2px; height: 14px; margin: 8px 0; }
.meter i { display: block; height: 100%; min-width: 2px; }
.meter i:first-child { border-start-start-radius: 4px; border-end-start-radius: 4px; }
.meter i:last-child { border-start-end-radius: 4px; border-end-end-radius: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .86rem; color: var(--ink-2); margin-bottom: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.legend i.ln { height: 3px; width: 16px; border-radius: 2px; vertical-align: 4px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: "IBM Plex Sans", var(--body); }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 8px 11px; border-radius: 9px; font-size: .83rem; line-height: 1.55; z-index: 5; white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.chart-tip b { display: block; font-weight: 600; margin-bottom: 2px; }
.chart-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
details.tbl-toggle { margin-top: 8px; font-size: .9rem; }
details.tbl-toggle summary { cursor: pointer; color: var(--blue-ink); font-weight: 500; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th, table.t td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
table.t th { font-weight: 600; color: var(--ink); background: var(--lime); white-space: nowrap; }
table.t td.n, table.t th.n { font-family: "IBM Plex Sans", var(--body); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tfoot td, table.t tr.total td { font-weight: 700; background: var(--lime); }
table.t tr.sel td { background: #FFF6E9; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.list-clean { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .94rem; }
.list-clean li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.6; }
.list-clean li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: .55em; background: var(--mud); transform: rotate(45deg); }
.list-clean.review li::before { background: var(--orange); }
.side-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.side-title h3 { margin: 0; font-size: 1.05rem; }
.linklike { background: none; border: 0; padding: 0; color: var(--blue-ink); font: inherit; font-size: .86rem; text-decoration: underline; cursor: pointer; }
.side-fields { display: grid; gap: 13px; }
.side-fields .field > label { display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; }
.side-fields .val { font-weight: 600; font-family: "IBM Plex Sans", var(--body); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.disclaimer { font-size: .86rem; color: var(--ink-3); line-height: 1.7; }

/* ===== Sections ===== */
.sec { padding-block: clamp(44px, 6vw, 84px); }
.sec-paper { background: var(--paper); }
.sec-night { background: linear-gradient(rgba(6,23,42,.86), rgba(6,23,42,.9)), var(--p-horizon) center / cover no-repeat; color: #fff; }
.sec-night h2, .sec-night h3 { color: #fff; }
.sec-night p, .sec-night li { color: #DDE3E6; }
.sec-night a:not(.btn) { color: #FFD9A3; }
.sec-head { max-width: 720px; margin-bottom: clamp(22px, 3vw, 36px); }
.sec-head p { color: var(--ink-2); font-size: 1.05rem; margin: 0; }
.sec-night .sec-head p { color: #DDE3E6; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 6px; min-width: 0; transition: transform .18s, box-shadow .18s, border-color .18s; }
a.card { text-decoration: none; color: inherit; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--mud); color: inherit; }
.card h3 { margin-bottom: 2px; }
.card p { color: var(--ink-2); margin: 0; font-size: .97rem; }
.card .go { margin-top: auto; padding-top: 10px; color: var(--orange-ink); font-weight: 600; font-size: .92rem; }
.ico { width: 46px; height: 46px; margin-bottom: 8px; color: var(--orange-ink); flex: none; }
.sec-night .card { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.14); color: #fff; }
.sec-night .card p { color: #DDE3E6; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 18px; counter-reset: st; }
.step { position: relative; padding-top: 44px; }
.step::before { counter-increment: st; content: counter(st); position: absolute; top: 0; inset-inline-start: 0; width: 34px; height: 34px; display: grid; place-items: center; background: var(--orange); color: #1A1206; font: 700 1rem "IBM Plex Sans", var(--body); transform: rotate(45deg); border-radius: 6px; }
.step::before { transform: none; clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); }
.step h3 { margin-bottom: 4px; }
.step p { margin: 0; color: var(--ink-2); font-size: .97rem; }
.sec-night .step p { color: #DDE3E6; }
.prose { font-size: 1.04rem; }
.prose h2 { margin-top: 1.6em; font: 600 1.32rem/1.4 var(--body); }
.prose h3 { margin-top: 1.3em; }
.prose table { margin-block: 1em; }
.prose .src { font-size: .88rem; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 28px; }
.tag { display: inline-block; font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-ink); font-weight: 500; }
.tag.orange { background: var(--orange-soft); color: var(--orange-ink); }
.tag.mud { background: #F2E7D8; color: var(--mud-ink); }
.source-note { font-size: .85rem; color: var(--ink-3); margin-top: 10px; }
html[dir="ltr"] .cta-band { background: linear-gradient(to right, rgba(6,23,42,.9), rgba(6,23,42,.66)), var(--p-field) center / cover no-repeat; }
.cta-band { background: linear-gradient(to left, rgba(6,23,42,.9), rgba(6,23,42,.66)), var(--p-field) center / cover no-repeat; color: #fff; border-radius: var(--r-lg); padding: clamp(24px, 4vw, 44px); display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.cta-band h2 { color: #fff; margin: 0 0 4px; font-size: clamp(1.3rem, 1rem + 1.2vw, 1.9rem); }
.cta-band p { margin: 0; color: #DDE3E6; }

/* ===== Forms ===== */
.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(18px, 3vw, 30px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.hp { position: absolute !important; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.file-box { border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 12px; background: #fff; font-size: .92rem; }
.file-box input { width: 100%; font: inherit; }
.summary-box { background: var(--lime); border-radius: 12px; padding: 12px 14px; font-size: .93rem; margin-bottom: 14px; }
.summary-box dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 6px 0 0; }
.summary-box dt { color: var(--ink-3); }
.summary-box dd { margin: 0; font-weight: 500; }

/* ===== Store ===== */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { border: 1.5px solid var(--line-2); background: var(--paper); border-radius: 999px; padding: 6px 15px; cursor: pointer; font: 500 .92rem var(--body); color: var(--ink); min-height: 38px; }
.chip[aria-pressed="true"] { background: var(--night); color: #fff; border-color: var(--night); }

/* ===== Links page ===== */
.links-page { min-height: 100vh; background: var(--night); color: #fff; position: relative; isolation: isolate; display: flex; flex-direction: column; }
.links-page .hero-art { position: fixed; object-position: 50% 45%; }
.links-page::after { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(to bottom, rgba(6,23,42,.74), rgba(6,23,42,.6) 58%, rgba(6,23,42,.78)); }
.links-in { width: min(520px, 100%); margin-inline: auto; padding: clamp(28px, 6vh, 64px) 16px; flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.plaque { background: rgba(255,253,249,.97); border-radius: 22px; padding: 10px 22px; box-shadow: 0 10px 34px rgba(0,0,0,.35); }
.plaque img { display: block; height: 96px; width: auto; }
.links-in h1 { color: #fff; font-size: 1.5rem; margin: 10px 0 0; }
.links-in > p { color: #E7E2D6; margin: 0 0 8px; font-size: .98rem; }
.link-list { display: grid; gap: 10px; width: 100%; }
.link-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; min-height: 58px; border-radius: 14px; background: rgba(255,253,249,.1); border: 1px solid rgba(255,217,163,.42); color: #fff; text-decoration: none; font-weight: 500; font-size: 1.03rem; backdrop-filter: blur(6px); transition: background .15s, border-color .15s; }
.link-btn:hover { background: rgba(255,253,249,.2); border-color: #FFD9A3; color: #fff; }
.link-btn.primary { background: var(--orange); color: #1A1206; border-color: var(--orange); font-weight: 600; }
.link-btn.primary:hover { background: var(--orange-2); color: #1A1206; }
.link-btn.off { opacity: .62; cursor: default; }
.link-btn.off:hover { background: rgba(255,253,249,.1); border-color: rgba(255,217,163,.42); }
.link-btn small { font-size: .8rem; font-weight: 400; color: #E7E2D6; }
.link-btn .arr { flex: none; }
html[dir="rtl"] .link-btn .arr { transform: scaleX(-1); }

/* ===== Footer ===== */
.site-foot { background: var(--night); color: #C9D4DA; font-size: .93rem; }
.site-foot::before { content: ""; display: block; height: 26px; background: url(/assets/img/band-najd-dark.svg) repeat-x center; opacity: .85; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; padding-block: 38px 22px; }
.foot-grid h4 { color: #fff; font-size: 1rem; margin-bottom: 10px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.foot-grid a { color: #C9D4DA; text-decoration: none; }
.foot-grid a:hover { color: #FFD9A3; }
.foot-logo { display: inline-block; background: var(--paper); border-radius: 12px; padding: 6px 12px; margin-bottom: 12px; }
.foot-logo img { height: 58px; width: auto; display: block; }
.foot-legal { border-top: 1px solid rgba(255,255,255,.14); padding-block: 16px 22px; font-size: .84rem; color: #A9B7BF; display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: space-between; }
/* زر واتساب العائم: دائرة صغيرة واضحة، وضغطة واحدة تفتح المحادثة */
.fab { position: fixed; inset-inline-end: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 35; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #1FA855; color: #fff; text-decoration: none; box-shadow: 0 6px 18px rgba(6,23,42,.32); transition: transform .15s, opacity .15s; }
.fab svg { width: 30px; height: 30px; }
.fab:hover, .fab:focus-visible { color: #fff; background: #168A45; transform: scale(1.06); }
.fab.away { opacity: 0; pointer-events: none; transform: scale(.6); }
/* أزرار ما بعد النتيجة: تحميل PDF ومشاركته والتواصل */
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.result-actions .note { flex-basis: 100%; margin: 4px 0 0; font-size: .9rem; color: var(--ink-3); }
.result-actions .btn svg { width: 18px; height: 18px; vertical-align: -3px; margin-inline-end: 6px; }
.btn-wa { background: #1FA855; border-color: #1FA855; color: #fff; }
.btn-wa:hover { background: #168A45; border-color: #168A45; color: #fff; }
.result-actions .done { font-size: .88rem; color: var(--good, #12857A); }
.tariff-compare th:first-child, .tariff-compare td:first-child { min-width: 9.5em; }
.tariff-compare th small { display: block; font-weight: 400; color: var(--ink-3); font-size: .8em; }

/* ===== Admin ===== */
.admin { min-height: 100vh; background: var(--lime); }
.admin-top { background: var(--night); color: #fff; padding: 12px 0; }
.admin-top .wrap { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 18px; }
.admin-tabs button { border: 1.5px solid var(--line-2); background: var(--paper); border-radius: 10px; padding: 8px 15px; font: 500 .95rem var(--body); cursor: pointer; color: var(--ink); }
.admin-tabs button[aria-selected="true"] { background: var(--night); color: #fff; border-color: var(--night); }
.admin input[type="number"], .admin table input, .admin table select { min-height: 36px; padding: 5px 8px; border: 1.5px solid var(--line-2); border-radius: 8px; font: 400 .92rem var(--body); width: 100%; min-width: 74px; background: #fff; color: var(--ink); }
.stage { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; background: var(--blue-soft); color: var(--blue-ink); white-space: nowrap; }
.toast { position: fixed; inset-inline: 16px; bottom: 16px; margin-inline: auto; max-width: 460px; background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 16px; z-index: 60; text-align: center; box-shadow: var(--shadow-lg); }

/* ===== Report (print) ===== */
.report { max-width: 860px; margin: 0 auto; background: #fff; padding: 28px; }
.report h1 { font: 700 1.5rem/1.3 var(--body); margin: 0; }
.report h2 { font: 600 1.08rem/1.4 var(--body); margin: 20px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--orange); }
.report-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 14px; }
.report-top img { height: 74px; width: auto; }
.report table.t { font-size: .88rem; }
.report table.t th, .report table.t td { padding: 5px 8px; }
.report .band { height: 26px; margin-block: 8px; }
.report ul { font-size: .88rem; margin-bottom: 8px; }
.report .chart svg { max-height: 200px; }

/* ===== Responsive ===== */
@media (max-width: 1120px) {
  .fields-main { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .fields-main .f-bill { grid-column: 1 / -1; }
  .results-grid { grid-template-columns: minmax(0,1fr); }
  .results-side { position: static; max-height: none; order: 2; }
  .nav { display: none; }
  .burger { display: block; position: static; margin-inline-start: auto; }
  .burger > summary { list-style: none; cursor: pointer; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 9px; font-weight: 500; font-size: .95rem; }
  .burger > summary::-webkit-details-marker { display: none; }
  .burger .sheet { position: absolute; inset-inline: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: 10px var(--gutter) 16px; display: grid; gap: 2px; max-height: calc(100vh - 72px); overflow: auto; }
  .burger .sheet a { padding: 10px 8px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--lime); font-weight: 500; }
  .burger .sheet a[aria-current="page"] { color: var(--orange-ink); }
  .head-in { min-height: 64px; position: relative; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .fields-main { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sizes { grid-template-columns: minmax(0,1fr); }
  .two, .form-grid { grid-template-columns: minmax(0,1fr); }
  .form-grid .full { grid-column: auto; }
  .grid-2 { grid-template-columns: minmax(0,1fr); }
  .brand img { height: 46px; }
  .head-end .btn { display: none; }
  .hero-in { padding-block: 28px 290px; }
  .hero-sub { text-shadow: 0 1px 8px rgba(6,23,42,.8); }
  .hero-art, .hero-video { object-position: 50% 100%; }
  .hero-motion { top: auto; bottom: 132px; inset-inline-end: 12px; }
  .calc-shell { margin-top: -120px; }
  .foot-grid { grid-template-columns: minmax(0,1fr); }
  .fab { width: 46px; height: 46px; inset-inline-end: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .fab svg { width: 26px; height: 26px; }
  /* مساحة أسفل الصفحة حتى لا يغطي الزر آخر سطر أو زر */
  body { padding-bottom: 64px; }
  body.pg-links { padding-bottom: 0; }
  .result-actions .btn { flex: 1 1 100%; }
}
@media (max-width: 420px) {
  .fields-main { grid-template-columns: minmax(0,1fr); }
  .headline-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 11.5pt; }
  .site-head, .site-foot, .fab, .no-print, .results-side, .hero, .sec, .calc-shell, details.tbl-toggle { display: none !important; }
  .results { display: block !important; padding: 0; }
  .results-grid { display: block; }
  .panel { break-inside: avoid; box-shadow: none; }
  .report { padding: 0; max-width: none; }
  .report h2 { break-after: avoid; }
  .headline { background: #fff !important; color: var(--ink) !important; border: 1px solid var(--line) !important; }
  .headline * { color: var(--ink) !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
