/* لينك الفاحص — للتليفون أولاً، هوية Motive (لايم على غامق)، أزرار كبيرة تتداس بالصباع. */
:root {
  --lime: #BBD531; --lime-d: #A6BE22; --ink: #0C0E0D; --bg: #F5F6F2; --card: #FFFFFF; --line: #DFE3DC;
  --text: #0C0E0D; --muted: #5B6460; --good: #2F7D32; --good-bg: #E6F2D0; --warn: #8A5A00; --warn-bg: #FDF1D8;
  --bad: #B3261E; --bad-bg: #FBE9E9;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #080B0B; --card: #141817; --line: #333A37; --text: #F8F8F4; --muted: #AFB7B4;
          --good: #BBD531; --good-bg: #26300B; --warn: #F0C264; --warn-bg: #3A2D10; --bad: #FF8A8A; --bad-bg: #3A1717; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: Cairo, "Segoe UI", Tahoma, sans-serif; font-size: 16px; line-height: 1.6;
       padding-bottom: env(safe-area-inset-bottom, 0px); }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.mi-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; background: var(--ink); color: #F8F8F4;
          padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; }
.mi-back { font-size: 30px; line-height: 1; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: #ffffff14; }
.mi-top-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mi-top-text strong { font-weight: 900; font-size: 17.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-top-text span { font-size: 12.5px; color: #F8F8F4B3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-top-trim { color: var(--lime); font-weight: 800; font-size: 13px; }
.mi-top-trim.is-none { color: #F0C264; font-weight: 600; }
.mi-top-progress { font-variant-numeric: tabular-nums; font-weight: 700; background: var(--lime); color: var(--ink); border-radius: 999px; padding: 2px 12px; white-space: nowrap; }
.mi-bar { position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); z-index: 19; height: 4px; background: #ffffff1f; background-color: var(--line); }
.mi-bar i { display: block; height: 100%; background: var(--lime); transition: width .3s; }
.mi-main { max-width: 760px; margin: 0 auto; padding: 16px 16px 120px; }

.mi-h { font-size: 15px; font-weight: 800; color: var(--muted); margin: 22px 0 10px; }
.mi-hint { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.mi-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); margin-inline-end: 4px; }
.mi-note { color: var(--muted); font-size: 13.5px; margin: 14px 0; }
.mi-label { display: block; font-weight: 700; font-size: 14px; margin: 18px 0 6px; }
.mi-textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: inherit; font: inherit; padding: 10px 12px; resize: vertical; }
.mi-textarea:focus { outline: none; border-color: var(--lime); }

/* الشاسيه والعداد جنب بعض فوق الصفحة — وعلى الموبايل الضيق تحت بعض */
.mi-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; margin-bottom: 14px; }
.mi-keys > .mi-chassis { margin-bottom: 0; }
@media (max-width: 560px) { .mi-keys { grid-template-columns: 1fr; } }
.mi-chassis { background: var(--card); border: 1.5px solid var(--warn); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.mi-chassis.is-ok { border-color: var(--line); }
.mi-chassis .mi-label { margin-top: 0; }
.mi-chassis-input { width: 100%; max-width: 300px; font: inherit; font-size: 24px; font-weight: 900; letter-spacing: .28em; text-align: center; text-transform: uppercase;
                    border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: inherit; padding: 8px 10px; font-variant-numeric: tabular-nums; }
.mi-chassis-input:focus { outline: none; border-color: var(--lime); }
.mi-chassis-state { min-height: 22px; font-size: 13.5px; font-weight: 800; color: var(--good); margin-top: 6px; }
.mi-chassis-state.is-pending { color: var(--warn); }
.mi-odometer-input { letter-spacing: .08em; }
.mi-summary-text { font-weight: 700; font-size: 14.5px; line-height: 1.7; margin: 6px 0; text-align: start; }
.mi-sec .mi-summary-text { background: var(--bg); border-radius: 10px; padding: 8px 12px; margin: 0 0 8px; }
.mi-chassis-help { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; }
.mi-list { display: flex; flex-direction: column; gap: 8px; }
.mi-row-wrap { display: flex; align-items: stretch; gap: 6px; }
.mi-row-wrap.is-skipped .mi-row { opacity: .5; }
.mi-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-height: 64px; }
.mi-row:active { transform: scale(.99); }
.mi-row-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; font-size: 20px; background: var(--bg); border-radius: 12px; }
.mi-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mi-row-text b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-row-text small { color: var(--muted); font-size: 13px; }
.mi-row-photos { border-color: var(--ink); }
.mi-skip { flex: none; border: 1px dashed var(--line); background: transparent; color: var(--muted); border-radius: 14px; font: inherit; font-size: 12.5px; padding: 0 10px; min-width: 58px; }
.mi-chip { flex: none; font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 2px 10px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.mi-chip.is-ok { background: var(--good-bg); color: var(--good); }
.mi-chip.is-todo { background: var(--warn-bg); color: var(--warn); }
.mi-chip.is-bad { background: var(--bad-bg); color: var(--bad); }

.mi-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.mi-section-head h1 { font-size: 22px; font-weight: 900; margin: 0; line-height: 1.3; }
.mi-items { display: flex; flex-direction: column; gap: 8px; }
.mi-item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.mi-item-head { width: 100%; display: flex; align-items: center; gap: 10px; background: transparent; border: 0; color: inherit; font: inherit; text-align: start; padding: 14px; min-height: 56px; }
.mi-item-mark { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.mi-item.is-ok .mi-item-mark { background: var(--lime); border-color: var(--lime); }
.mi-item.is-photo .mi-item-mark { background: var(--bad); border-color: var(--bad); }
.mi-item-name { flex: 1; font-weight: 700; }
.mi-item-answer { color: var(--muted); font-size: 13.5px; max-width: 45%; text-align: end; }
.mi-item.is-photo .mi-item-answer { color: var(--bad); }
.mi-item-body { display: none; padding: 0 14px 14px; }
.mi-item.is-open .mi-item-body { display: block; }
.mi-item.is-open { border-color: var(--ink); }
.mi-guidance { color: var(--muted); font-size: 13.5px; margin: 0 0 10px; }
.mi-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.mi-option { min-height: 52px; border: 1.5px solid var(--line); background: transparent; color: inherit; border-radius: 12px; font: inherit; font-weight: 700; padding: 8px 10px; }
.mi-option:active { transform: scale(.98); }
.mi-option.is-on { border-color: var(--ink); background: var(--ink); color: #F8F8F4; }
.mi-option.is-on.is-good { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.mi-option.is-on.is-notice { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.mi-option.is-on.is-bad { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.mi-photo-need { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 6px 12px; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.mi-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.mi-thumb { position: relative; width: 84px; height: 84px; margin: 0; border-radius: 12px; overflow: hidden; background: var(--bg); }
.mi-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mi-thumb-del { position: absolute; top: 4px; inset-inline-end: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: #000000b3; color: #fff; font-size: 16px; line-height: 1; }
.mi-thumb.is-loading { display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); border: 1.5px dashed var(--line); }
.mi-thumb.is-failed { border: 1.5px solid var(--bad); color: var(--bad); text-align: center; padding: 6px; font-size: 12px; }
.mi-thumb-bar { position: absolute; inset-inline: 0; bottom: 0; height: 5px; background: var(--line); }
.mi-thumb-bar i { display: block; height: 100%; width: 0; background: var(--lime); }
.mi-add { width: 84px; height: 84px; border: 1.5px dashed var(--line); border-radius: 12px; display: grid; place-items: center; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 4px; }

.mi-shots { display: flex; flex-direction: column; gap: 8px; }
.mi-shot { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.mi-shot.is-done { border-color: var(--lime); }
.mi-shot-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 8px; }
.mi-shot-text small { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.mi-req { font-size: 11.5px; font-weight: 700; color: var(--warn); background: var(--warn-bg); border-radius: 999px; padding: 0 8px; }

.mi-problems { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 12px 14px; margin: 16px 0; font-size: 14.5px; }
.mi-problems ul { margin: 6px 0 0; padding-inline-start: 18px; }
.mi-footer, .mi-nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 15; display: flex; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
                      background: linear-gradient(to top, var(--bg) 70%, transparent); }
.mi-btn { flex: 1; display: grid; place-items: center; min-height: 54px; border: 0; border-radius: 14px; background: var(--lime); color: var(--ink); font: inherit; font-weight: 900; font-size: 16px; padding: 0 12px; text-align: center; }
.mi-btn:active { background: var(--lime-d); }
.mi-btn[disabled] { opacity: .6; }
.mi-btn.is-ghost { background: var(--card); color: var(--text); border: 1.5px solid var(--line); flex: .7; font-weight: 700; font-size: 14px; }
.mi-toast { position: fixed; inset-inline: 16px; bottom: 84px; z-index: 30; background: var(--ink); color: #F8F8F4; border-radius: 12px; padding: 10px 14px; font-weight: 700; text-align: center; }
.mi-toast.is-bad { background: var(--bad); }

.mi-result { text-align: center; padding: 20px 0 8px; }
.mi-ring { --mi-score: 0; width: 170px; height: 170px; margin: 0 auto; border-radius: 50%; display: grid; place-content: center;
           background: radial-gradient(closest-side, var(--card) 80%, transparent 81% 100%), conic-gradient(var(--lime) calc(var(--mi-score) * 1%), var(--line) 0); }
.mi-ring-score { font-size: 52px; font-weight: 900; line-height: 1; }
.mi-ring-of { color: var(--muted); font-size: 13px; }
.mi-grade { display: inline-grid; place-items: center; min-width: 64px; height: 64px; margin-top: -22px; position: relative; border-radius: 18px; background: var(--ink); color: var(--lime); font-size: 36px; font-weight: 900; }
.mi-result-line { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.mi-blocked { background: var(--bad-bg); color: var(--bad); border-radius: 12px; padding: 8px 12px; font-weight: 700; display: inline-block; }
.mi-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 18px; }
.mi-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.mi-card-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; }
.mi-card-score { font-variant-numeric: tabular-nums; }
.mi-card-verdict { display: inline-block; font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 1px 10px; margin-top: 4px; background: var(--bg); color: var(--muted); }
.mi-card.is-sound .mi-card-verdict { background: var(--good-bg); color: var(--good); }
.mi-card.is-notes .mi-card-verdict { background: var(--warn-bg); color: var(--warn); }
.mi-card.is-attention .mi-card-verdict { background: var(--bad-bg); color: var(--bad); }
.mi-card ul { margin: 10px 0 0; padding-inline-start: 18px; font-size: 13.5px; color: var(--muted); }
.mi-card ul b { color: var(--text); }
/* ── العربية على الرئيسية: الاسم كبير والفئة باينة ── */
.mi-car { background: var(--ink); color: #F8F8F4; border-radius: 18px; padding: 16px 18px; margin-bottom: 14px; }
.mi-car-name { font-size: 26px; font-weight: 900; line-height: 1.25; margin: 0 0 8px; }
.mi-car-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mi-car-trim { background: var(--lime); color: var(--ink); border-radius: 999px; padding: 3px 14px; font-weight: 700; font-size: 14.5px; }
.mi-car-trim b { font-weight: 900; }
.mi-car-trim.is-none { background: #3A2D10; color: #F0C264; }
.mi-car .mi-chip { background: #ffffff1a; color: #F8F8F4; }
.mi-car .mi-hint { color: #F8F8F4B3; margin: 10px 0 0; }

.mi-car-said { margin: 10px 0 0; font-size: 13.5px; color: #F0C264; }
.mi-car-fix { margin-top: 12px; border: 1px dashed #ffffff55; background: transparent; color: #F8F8F4; font: inherit; font-size: 13.5px; font-weight: 700; border-radius: 10px; padding: 7px 12px; }
.mi-identity { margin-top: 12px; display: grid; grid-template-columns: 70px 1fr; gap: 8px 10px; align-items: center; background: #ffffff12; border-radius: 14px; padding: 12px; }
.mi-identity label { font-size: 13.5px; font-weight: 700; }
.mi-identity select { width: 100%; min-height: 46px; border-radius: 10px; border: 1.5px solid #ffffff33; background: #0C0E0D; color: #F8F8F4; font: inherit; padding: 0 10px; }
.mi-identity select:disabled { opacity: .45; }
.mi-identity-note { grid-column: 1 / -1; margin: 2px 0; font-size: 12.5px; color: #F8F8F4B3; }
.mi-identity-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.mi-identity-actions .mi-btn { min-height: 46px; }
.mi-identity-actions .mi-btn.is-ghost { background: transparent; color: #F8F8F4; border-color: #ffffff55; }

/* ── اختيار الطريقة ── */
.mi-modes .mi-h { margin-top: 6px; }
.mi-mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mi-mode { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; background: var(--card); color: inherit; font: inherit;
           border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 6px; min-height: 112px; }
.mi-mode b { font-weight: 900; font-size: 15px; }
.mi-mode small { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.mi-mode-icon { font-size: 22px; line-height: 1.2; }
.mi-mode.is-on { border-color: var(--ink); background: var(--ink); color: #F8F8F4; box-shadow: inset 0 -4px 0 var(--lime); }
.mi-mode.is-on small { color: #F8F8F4B3; }
.mi-mode[disabled] { opacity: .45; }
.mi-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-weight: 700; font-size: 14px; }
.mi-seg { display: flex; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 3px; }
.mi-seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: 13px; border-radius: 9px; padding: 7px 12px; }
.mi-seg button.is-on { background: var(--ink); color: #F8F8F4; }
html:not([data-mode="map"]) .mi-only-map { display: none; }
html:not([data-mode="all"]) .mi-only-all { display: none; }
html[data-mode="all"] .mi-not-all { display: none; }
/* ── إجراءات سريعة: الزرار ومكتوب جنبه هيعمل إيه ── */
/* صفحة الصور: تابات (الأساسية · الملاحظات · كل الصور) ورفع مجمّع (أبوبكر 21/9) */
.mi-ptabs { display: flex; gap: 4px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.mi-ptab { flex: 1; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 800; font-size: 14px; border-radius: 10px; min-height: 44px; }
.mi-ptab.is-on { background: var(--ink); color: #F8F8F4; }
.mi-ptab b { display: inline-block; min-width: 20px; margin-inline-start: 4px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 12px; padding: 0 6px; }
.mi-ptab.is-on b { background: #ffffff26; color: #F8F8F4; }
.mi-pview[hidden] { display: none; }
.mi-bulk { border: 1.5px dashed var(--lime); border-radius: 14px; padding: 12px; margin-bottom: 6px; }
.mi-bulk-btn { display: block; text-align: center; cursor: pointer; }
.mi-bulk small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.mi-bulk-state { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--good); }

/* كل صور الفحص في مكان واحد (أبوبكر 21/9) */
.mi-gallery-box { margin-top: 18px; border-top: 2px solid var(--line); padding-top: 12px; }
.mi-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mi-gphoto { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mi-gphoto img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.mi-gphoto figcaption { padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.mi-gphoto figcaption b { font-weight: 800; line-height: 1.35; }
.mi-gphoto figcaption small { color: var(--muted); font-size: 11.5px; }
.mi-gphoto .mi-tag { align-self: flex-start; }

/* أدوات التجربة: شكل مختلف عن أزرار الفحص عشان تبان إنها مش من الفحص */
.mi-demo { border: 1.5px dashed var(--warn); border-radius: 14px; padding: 10px 12px; margin-bottom: 14px; }
.mi-demo small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 6px; }

/* ملخص القسم: جوه قسمه تحت بنوده، بيتكوّن من البنود لوحده — قراءة بس، مفيش دوس عليه (أبوبكر 26/9) */
.mi-sumstrip { margin-top: 10px; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--bg); }
.mi-sumstrip-h { margin: 0 0 6px; font-size: 13.5px; font-weight: 800; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.mi-sumstrip-h small { font-weight: 600; font-size: 12px; color: var(--muted); }
.mi-sumline { display: flex; flex-direction: column; gap: 1px; background: var(--card); border: 1px solid var(--line);
  border-inline-start: 4px solid var(--line); border-radius: 10px; padding: 7px 10px; margin-bottom: 6px; }
.mi-sumline b { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.mi-sumline span { font-size: 15px; font-weight: 800; }
.mi-sumline.is-good { border-inline-start-color: var(--good); } .mi-sumline.is-good span { color: var(--good); }
.mi-sumline.is-notice { border-inline-start-color: var(--warn); } .mi-sumline.is-notice span { color: var(--warn); }
.mi-sumline.is-bad { border-inline-start-color: var(--bad); } .mi-sumline.is-bad span { color: var(--bad); }
.mi-sumstrip .mi-summary-text { margin: 6px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; background: none; padding: 0; }

/* الإجراءات السريعة: قسم مقفول زي أقسام الفحص، تفتحه تلاقي إجراءاته (أبوبكر 21/9) */
.mi-quick-sec { margin-bottom: 8px; }
.mi-quick-sec[open] > .mi-sec-head .mi-chip { background: var(--ink); color: var(--lime); }
.mi-quick-inline { margin-top: 10px; border: 1.5px dashed var(--line); border-radius: 12px; padding: 8px 10px; }
.mi-quick-inline > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 800; font-size: 14.5px; }
.mi-quick-inline > summary b { flex: 1; min-width: 0; }
.mi-quick-inline + .mi-quick-inline { margin-top: 6px; }
.mi-quick-inline[open] { border-color: var(--ink); border-style: solid; }
.mi-quick-inline > summary::-webkit-details-marker { display: none; }
.mi-quick-inline > summary small { background: var(--bg); border-radius: 999px; padding: 1px 8px; font-size: 12.5px; color: var(--muted); }
.mi-quick-inline[open] > summary { margin-bottom: 8px; }
.mi-quick-list { display: flex; flex-direction: column; gap: 8px; }
.mi-quick-row { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 10px; align-items: start; }
.mi-quick-btn { min-height: 52px; border: 0; border-radius: 12px; background: var(--ink); color: var(--lime); font: inherit; font-weight: 900; font-size: 15px; padding: 8px 10px; }
.mi-quick-btn:active { transform: scale(.98); }
.mi-quick-btn[disabled] { opacity: .5; }
.mi-quick-effect { font-size: 13px; line-height: 1.7; color: var(--muted); min-width: 0; }
.mi-quick-effect b { display: block; color: var(--text); font-size: 13.5px; margin-top: 2px; }
.mi-quick-effect p { margin: 0 0 2px; }
.mi-tag { display: inline-block; font-weight: 800; font-size: 12px; border-radius: 999px; padding: 0 9px; background: var(--bg); color: var(--text); }
.mi-tag.is-good { background: var(--good-bg); color: var(--good); }
.mi-tag.is-notice { background: var(--warn-bg); color: var(--warn); }
.mi-tag.is-bad { background: var(--bad-bg); color: var(--bad); }
html:not([data-mode="list"]) .mi-end { text-align: center; }
.mi-end .mi-label { text-align: start; }
/* ── «الفحص كله»: الأقسام مقفولة، وجواها مجموعات ── */
.mi-all { display: flex; flex-direction: column; gap: 8px; }
.mi-sec { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.mi-sec[open] { border-color: var(--ink); }
.mi-sec.is-skipped { opacity: .55; }
.mi-sec-head { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; }
.mi-sec-head::-webkit-details-marker { display: none; }
.mi-sec[open] > .mi-sec-head { position: sticky; top: calc(64px + env(safe-area-inset-top, 0px)); z-index: 5; background: var(--card); border-radius: 16px 16px 0 0; border-bottom: 1px solid var(--line); }
.mi-sec-head .mi-row-text b { white-space: normal; line-height: 1.35; }
.mi-sec-head .mi-row-text small { font-variant-numeric: tabular-nums; text-align: start; }
.mi-sec-body { padding: 4px 12px 14px; }
.mi-group { display: flex; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 900; margin: 14px 2px 8px; }
.mi-group small { color: var(--muted); font-weight: 700; font-size: 12px; background: var(--bg); border-radius: 999px; padding: 0 8px; }
.mi-sec .mi-chips { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.mi-sec .mi-partchip { background: var(--bg); }
.mi-partchip.is-active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--lime); }
.mi-partchip.is-summary { background: var(--ink); color: #F8F8F4; border-color: var(--ink); grid-column: 1 / -1; }
.mi-partchip.is-summary small { color: #F8F8F4B3; }
.mi-sec-skip { margin-top: 14px; border: 1px dashed var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 13px; border-radius: 10px; padding: 6px 12px; }
.mi-options.is-many { grid-template-columns: repeat(3, 1fr); }
.mi-options.is-many .mi-option { min-height: 46px; font-size: 14px; padding: 4px 6px; }
html[data-mode="list"] .mi-only-focus { display: none !important; }
html:not([data-mode="list"]) .mi-not-focus { display: none !important; }
.mi-row-map { border-color: var(--ink); }

/* ── «بند بند»: بند واحد مالي الشاشة ── */
.mi-view { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: inherit; font: inherit; font-size: 18px; }
.mi-view::before { content: "☰"; }
html[data-mode="list"] .mi-view::before { content: "▣"; }
.mi-focus-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.mi-segs { flex: 1; display: flex; gap: 2px; min-width: 0; }
.mi-segm { flex: 1; min-width: 3px; height: 10px; border: 0; padding: 0; border-radius: 3px; background: var(--line); }
.mi-segm.is-info { opacity: .55; }
.mi-segm.is-ok { background: var(--lime); opacity: 1; }
.mi-segm.is-defect { background: #E0A100; opacity: 1; }
.mi-segm.is-photo { background: var(--bad); opacity: 1; }
.mi-segm.is-current { outline: 2px solid var(--text); outline-offset: 1px; }
.mi-focus-count { flex: none; font-weight: 800; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mi-end { display: none; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px 16px; }
.mi-end h2 { margin: 6px 0 4px; font-size: 22px; font-weight: 900; }
.mi-end-mark { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 900; background: var(--warn-bg); color: var(--warn); }
.mi-end.is-done .mi-end-mark { background: var(--lime); color: var(--ink); }
.mi-end-jumps { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.mi-jump { border: 1.5px solid var(--line); background: transparent; color: inherit; font: inherit; font-size: 13.5px; font-weight: 700; border-radius: 999px; padding: 6px 12px; }
.mi-jump.is-photo { border-color: var(--bad); color: var(--bad); }
html:not([data-mode="list"]) .mi-items > .mi-item { display: none; }
html:not([data-mode="list"]) .mi-items > .mi-item.is-current { display: block; border: 0; background: transparent; overflow: visible; animation: mi-in .22s ease-out; }
html:not([data-mode="list"]) .mi-end.is-current { display: block; animation: mi-in .22s ease-out; }
html[data-mode="list"] .mi-end { display: block; text-align: start; padding: 14px; }
html[data-mode="list"] .mi-end .mi-end-mark, html[data-mode="list"] .mi-end h2 { display: none; }
html[data-mode="list"] .mi-end-jumps { justify-content: flex-start; }
html[data-mode="list"] .mi-end:not(:has(.mi-jump, .mi-tray-row)) { display: none; }
@keyframes mi-in { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
html:not([data-mode="list"]) .mi-item.is-current .mi-item-head { padding: 4px 0 12px; align-items: flex-start; flex-wrap: wrap; cursor: default; }
html:not([data-mode="list"]) .mi-item.is-current .mi-item-mark, html:not([data-mode="list"]) .mi-item.is-current .mi-item-answer { display: none; }
html:not([data-mode="list"]) .mi-item.is-current .mi-item-name { font-size: 25px; font-weight: 900; line-height: 1.3; flex-basis: 100%; }
html:not([data-mode="list"]) .mi-item.is-current .mi-item-body { display: block; padding: 0; }
html:not([data-mode="list"]) .mi-item.is-current .mi-guidance { font-size: 15px; background: var(--card); border-radius: 12px; padding: 10px 12px; }
html:not([data-mode="list"]) .mi-item.is-current .mi-options { grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
html:not([data-mode="list"]) .mi-item.is-current .mi-option { min-height: 62px; font-size: 17.5px; font-weight: 800; background: var(--card); text-align: start; padding: 10px 16px;
      border-inline-start-width: 7px; display: flex; align-items: center; justify-content: space-between; }
html:not([data-mode="list"]) .mi-item.is-current .mi-option.is-good { border-inline-start-color: var(--lime); }
html:not([data-mode="list"]) .mi-item.is-current .mi-option.is-notice { border-inline-start-color: #E0A100; }
html:not([data-mode="list"]) .mi-item.is-current .mi-option.is-bad { border-inline-start-color: var(--bad); }
html:not([data-mode="list"]) .mi-item.is-current .mi-option.is-on::after { content: "✓"; font-weight: 900; }
html:not([data-mode="list"]) .mi-item.is-current .mi-option.is-on { background: var(--ink); color: #F8F8F4; border-color: var(--ink); }
html:not([data-mode="list"]) .mi-item.is-current .mi-option.is-on.is-good { background: var(--lime); color: var(--ink); border-color: var(--lime); }
html:not([data-mode="list"]) .mi-item.is-current .mi-option.is-on.is-notice { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
html:not([data-mode="list"]) .mi-item.is-current .mi-option.is-on.is-bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }

/* ── الصور المجمّعة: صينية آخر القسم ── */
html[data-photos="group"] .mi-item .mi-photo-need { display: none; }
.mi-tray { text-align: start; margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 12px; }
.mi-tray h3 { font-size: 15px; font-weight: 900; margin: 0 0 10px; }
.mi-tray-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.mi-tray-row.is-photo { border-color: var(--bad); }
.mi-tray-text { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.mi-tray-text small { color: var(--muted); }
.mi-tray-row .mi-thumbs { margin-bottom: 0; }

/* ── المجسم ── */
.mi-layers { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 6px; scrollbar-width: none; }
.mi-layer { flex: none; border: 1.5px solid var(--line); background: var(--card); color: inherit; font: inherit; font-weight: 700; font-size: 13.5px; border-radius: 999px; padding: 8px 14px; white-space: nowrap; }
.mi-layer.is-done { border-color: var(--lime); }
.mi-layer.is-on { background: var(--ink); border-color: var(--ink); color: #F8F8F4; }
.mi-map-card { position: relative; background: #FFFFFF; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin-bottom: 12px; }
.mi-map-scroll { overflow: auto; max-height: 72vh; -webkit-overflow-scrolling: touch; }
.mi-map { width: 100%; padding: 8px; transition: width .2s; direction: ltr; }
.mi-svg { display: block; width: 100%; height: auto; font-family: Cairo, sans-serif; }
.mi-map-tools { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 2; display: flex; flex-direction: column; gap: 6px; }
.mi-map-tools button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid #DFE3DC; background: #FFFFFFE6; color: #0C0E0D; font-size: 22px; font-weight: 800; line-height: 1; }
.mi-part { cursor: pointer; }
.mi-part .mi-hit { fill: none; stroke: transparent; stroke-width: 12; pointer-events: stroke; }
.mi-part .mi-shape { fill: #FFFFFF; stroke: #93A0AC; stroke-width: 1.6; transition: fill .2s; }
.mi-part.is-inner .mi-shape { fill-opacity: .85; }
.mi-part.is-good .mi-shape { fill: #CDEBD8; stroke: #4FAE7F; }
.mi-part.is-notice .mi-shape { fill: #FCE3A8; stroke: #D9A520; }
.mi-part.is-bad .mi-shape { fill: #F6C3C7; stroke: #D0505C; }
.mi-part.is-neutral .mi-shape { fill: #DDE6F0; stroke: #7D93AD; }
.mi-part.is-photo .mi-shape { stroke: #B3261E; stroke-width: 3; stroke-dasharray: 4 3; }
.mi-part.is-active .mi-shape { stroke: #0C0E0D; stroke-width: 3.2; }
.mi-part.is-dim { pointer-events: none; opacity: .16; }
/* طبقة مختارة: أجزاءها تبان قوي — خط تقيل متصل، ولون مليان، وضل */
.mi-part.is-focus { filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .35)); }
.mi-part.is-focus .mi-shape { stroke-width: 2.8; stroke-dasharray: none; fill-opacity: 1; }
.mi-part.is-focus .mi-shape[fill-opacity] { fill-opacity: .55; }   /* حتة فوق رسم مجسّم: تفضل شفافة حتى وهي الطبقة المختارة */
.mi-part.is-focus.is-empty .mi-shape { fill: #FFF6C2; stroke: #0C0E0D; }
.mi-part.is-focus.is-good .mi-shape { fill: #9EDDB9; stroke: #1F7A4D; }
.mi-part.is-focus.is-notice .mi-shape { fill: #FFD36B; stroke: #A87600; }
.mi-part.is-focus.is-bad .mi-shape { fill: #F29AA2; stroke: #B3261E; }
.mi-part.is-focus.is-photo .mi-shape { stroke: #B3261E; stroke-dasharray: 5 3; }
.mi-map.has-layer .mi-svg text { opacity: .35; }
.mi-part.is-off { pointer-events: none; opacity: .45; }
.mi-part.is-off .mi-shape { fill: #EEF1F3; stroke: #DCE2E7; }
.mi-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; padding: 8px; font-size: 12px; color: #5B6460; border-top: 1px solid #EEF1EC; }
.mi-legend span::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-inline-end: 4px; vertical-align: -1px; border: 1.5px solid #93A0AC; background: #fff; }
.mi-legend .is-good::before { background: #CDEBD8; border-color: #4FAE7F; }
.mi-legend .is-notice::before { background: #FCE3A8; border-color: #D9A520; }
.mi-legend .is-bad::before { background: #F6C3C7; border-color: #D0505C; }
.mi-legend .is-photo::before { border: 2px dashed #B3261E; }
.mi-btn.is-dark { width: 100%; background: var(--ink); color: var(--lime); margin-bottom: 4px; }
.mi-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.mi-partchip { display: grid; grid-template-columns: 12px 1fr; align-items: center; column-gap: 8px; text-align: start; background: var(--card); color: inherit; font: inherit;
               border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; min-height: 52px; }
.mi-partchip i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); grid-row: span 2; }
.mi-partchip span { font-weight: 700; font-size: 13.5px; line-height: 1.35; }
.mi-partchip small { color: var(--muted); font-size: 12px; grid-column: 2; }
.mi-partchip.is-good i { background: var(--lime); border-color: var(--lime); }
.mi-partchip.is-notice i { background: #E0A100; border-color: #E0A100; }
.mi-partchip.is-bad i { background: var(--bad); border-color: var(--bad); }
.mi-partchip.is-neutral i { background: #7D93AD; border-color: #7D93AD; }
.mi-partchip.is-photo { border-color: var(--bad); }
.mi-partchip.is-offmap span::after { content: " ·"; color: var(--muted); }
.mi-sheet-back { position: fixed; inset: 0; z-index: 40; background: #000000A6; }
.mi-sheet { position: fixed; inset-inline: 0; bottom: 0; z-index: 41; max-height: 86vh; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0;
            padding: 8px 16px calc(18px + env(safe-area-inset-bottom, 0px)); animation: mi-up .22s ease-out; max-width: 760px; margin: 0 auto; }
@keyframes mi-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.mi-sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.mi-sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.mi-sheet-head h2 { margin: 0; font-size: 22px; font-weight: 900; line-height: 1.3; }
.mi-sheet-head small { color: var(--muted); font-size: 12.5px; }
.mi-sheet-close { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--card); color: inherit; font-size: 24px; line-height: 1; }
.mi-sheet .mi-options { grid-template-columns: 1fr 1fr; }
.mi-sheet .mi-option { min-height: 58px; background: var(--card); font-size: 15.5px; }
.mi-sheet .mi-option.is-on { background: var(--ink); }
.mi-sheet .mi-option.is-on.is-good { background: var(--lime); }
.mi-sheet .mi-option.is-on.is-notice { background: var(--warn-bg); }
.mi-sheet .mi-option.is-on.is-bad { background: var(--bad-bg); }

.mi-report-link { margin: 18px 0 4px; text-decoration: none; }
.mi-preview-main { max-width: 980px; }
.mi-preview-info { display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 12px; min-height: 84px; }
.mi-preview-info b { font-size: 19px; font-weight: 900; }
.mi-preview-info span { color: var(--muted); font-size: 14px; }
.mi-preview-info small { color: var(--muted); font-size: 12px; direction: ltr; text-align: end; }
.mi-preview .mi-map-scroll { max-height: none; }
.mi-preview .mi-svg { max-width: 760px; margin: 0 auto; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
