/* מבנה ופריסה בלבד. כל הצבעים, הפונט והמרווחים מגיעים מ-theme.config.js
   דרך משתני ה-CSS שנכתבים ב-boot (js/theme.js). */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
}
img, video { display: block; max-width: 100%; }
button, input { font-family: var(--font); color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.app { max-width: var(--content-max); margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--bg); position: relative; }
.pad { padding-inline: var(--page-x); }
.stack { display: flex; flex-direction: column; }

/* ───────── typography ───────── */
.h1 { margin: 0; font-size: 36px; line-height: 1.18; font-weight: 700; letter-spacing: -.6px; }
.h2 { margin: 0; font-size: 30px; line-height: 1.22; font-weight: 700; letter-spacing: -.5px; }
.h3 { margin: 0; font-size: 28px; line-height: 1.28; font-weight: 700; letter-spacing: -.4px; }
.lead { margin: 0; font-size: 16px; line-height: 1.6; color: var(--text-muted); }
.lead--sm { font-size: 15px; }
.label { font-size: 11px; font-weight: 700; letter-spacing: 2.4px; color: var(--text-dim); }
.label--field { font-size: 12px; letter-spacing: 1.6px; }
.note { font-size: 13px; color: var(--text-dim); text-align: center; }
.note--sm { font-size: 12px; }
.mono { direction: ltr; font-variant-numeric: tabular-nums; }

/* ───────── header ───────── */
.hdr { display: flex; align-items: center; justify-content: space-between; padding: 22px var(--page-x) 0; min-height: 44px; }
.hdr__logo { height: 20px; width: auto; }
.hdr--home { padding-bottom: 22px; }
.hdr--home .hdr__logo { height: 24px; }
.hdr__meta { font-size: 12px; color: var(--text-dim); }
.back { width: 44px; height: 44px; margin-inline-start: -10px; display: flex; align-items: center; justify-content: flex-start; background: none; border: 0; cursor: pointer; }

/* ───────── buttons ───────── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: var(--control-h); border-radius: var(--radius);
  font-size: 17px; font-weight: 700; letter-spacing: .3px; cursor: pointer; text-decoration: none; border: 0;
}
.btn--primary { background: var(--text); color: var(--bg); }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--text); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn--sm { height: var(--input-h); font-size: 15px; width: auto; padding-inline: 22px; }

/* ───────── video frame (screen 1) ───────── */
.frame { position: relative; height: 300px; overflow: hidden; background: var(--surface); border-radius: var(--radius-media); margin-inline: var(--page-x); }
.frame__media { width: 100%; height: 100%; object-fit: cover; }
.play {
  position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .85); background: rgba(10, 10, 10, .35);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.frame__time { position: absolute; bottom: 14px; left: 18px; font-size: 11px; letter-spacing: 1px; color: #F2F2F2; }
.is-playing .play, .is-playing .frame__time { display: none; }

/* ───────── carousel (screen 1) ───────── */
.carousel { display: flex; gap: var(--gap); padding-inline: var(--page-x); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab; }
.carousel.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.carousel.is-dragging * { pointer-events: none; }
.carousel::-webkit-scrollbar { display: none; }
.case { flex: 0 0 246px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 10px; }
.case__img { width: 100%; height: 176px; object-fit: cover; background: var(--surface); border-radius: var(--radius-media); }
.case__name { font-size: 15px; font-weight: 700; }
.case__stats { font-size: 13px; color: var(--text-dim); }
.dots { display: flex; gap: 6px; justify-content: center; padding-top: 4px; }
.dots span { width: 18px; height: 2px; background: var(--inactive); }
.dots .is-on { background: var(--text); }

/* ───────── lists ───────── */
.rows { display: flex; flex-direction: column; }
.rows > li { font-size: 15px; padding: 13px 0; border-top: 1px solid var(--hairline-soft); list-style: none; }
.rows > li:last-child { border-bottom: 1px solid var(--hairline-soft); }
.rows--plain { margin: 0; padding: 0; }

/* ───────── form (screen 2) ───────── */
.progress-steps { display: flex; gap: 6px; padding: 10px var(--page-x) 0; }
.progress-steps span { flex: 1; height: 2px; background: var(--border); }
.progress-steps .is-on { background: var(--text); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field input {
  height: var(--input-h); background: var(--surface); border: var(--field-bw) solid var(--field-bc); color: var(--text);
  font-size: 16px; padding: 0 14px; border-radius: var(--radius-field);
}
.field input:hover { border-color: #9A9A9A; }
.field input:focus { border-color: var(--text); outline: none; }
.field input::placeholder { color: var(--placeholder); }
.field__label { font-size: 13px; color: var(--text-muted); }
.field__err { font-size: 12px; color: var(--text); border-inline-start: 2px solid var(--text); padding-inline-start: 8px; }
.row2 { display: flex; gap: var(--gap); }
.row2 > * { flex: 1; min-width: 0; }
.upload {
  height: 150px; background: transparent; border: var(--field-bw) solid var(--field-bc); color: var(--text); border-radius: var(--radius-field);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; cursor: pointer; text-align: center; padding: 0 18px;
}
.upload:hover { border-color: #9A9A9A; }
.upload.is-drag { border-color: var(--text); background: rgba(255, 255, 255, .04); }
.upload__title { font-size: 16px; font-weight: 700; }
.upload__hint { font-size: 12px; color: var(--text-dim); }
input[type=file] { display: none; }
.or { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--placeholder); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--hairline-soft); }

/* ───────── processing (screen 3) ───────── */
.stage { position: relative; height: 210px; background: var(--stage); border: 1px solid var(--hairline); overflow: hidden; border-radius: var(--radius-card); }
.stage__grid { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage__dots { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage__shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s ease; }
.stage__shot.is-on { opacity: .92; }
.stage__shot--fit { object-fit: contain; background: #fff; }           /* תכנית: כולה בפריים, בלי חיתוך */
.stage__shot--fit.is-on, .stage__shot--doc.is-on { opacity: 1; }
.stage__shot--doc { object-fit: cover; object-position: top center; background: #fff; }   /* דוח: ראש העמוד */
.stage.is-zoomable { cursor: zoom-in; }
/* כותרת התוצר החי — על התמונה, בראש הבמה */
.stage__title {
  position: absolute; top: 10px; right: 10px; z-index: 2; font-size: 14px; font-weight: 700; color: #fff;
  background: rgba(10, 10, 10, .78); padding: 5px 12px; border-radius: 999px; opacity: 0; transition: opacity .4s ease;
}
.stage__title.is-on { opacity: 1; }
/* כתב-כמויות על הבמה */
.stage__doc { position: absolute; inset: 0; background: #fff; color: #111; padding: 44px 16px 12px; overflow: hidden; }
.sdoc { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.sdoc__rows { display: flex; flex-direction: column; }
.sdoc__row, .sdoc__total { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid #e6e6e6; }
.sdoc__total { border-bottom: 0; border-top: 2px solid #111; font-size: 14px; font-weight: 700; padding-top: 7px; }
.viewer .sdoc { background: #fff; color: #111; padding: 16px; font-size: 14px; }
.stage__cap {
  position: absolute; bottom: 12px; left: 14px; font-size: 11px; letter-spacing: .4px; color: var(--text);
  background: rgba(10, 10, 10, .55); padding: 4px 9px; border-radius: 999px; opacity: 0; transition: opacity .6s ease;
}
.stage__cap.is-on { opacity: 1; }
.stage__count { position: absolute; bottom: 12px; right: 14px; font-size: 11px; letter-spacing: 1.5px; color: var(--text-faint); }

.msg { min-height: 112px; }
.msg.is-fading { opacity: 0; }
.msg { transition: opacity .35s ease; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar { flex: 1; height: 2px; background: var(--border); position: relative; overflow: hidden; }
.bar__fill { position: absolute; top: 0; bottom: 0; right: 0; width: 0; background: var(--text); transition: width .6s linear; }
.timer { font-size: 12px; color: var(--text-dim); min-width: 46px; text-align: left; }
.steps { display: flex; flex-direction: column; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #1C1C1C; font-size: 15px; color: var(--text-faint); list-style: none; }
.steps .mark { width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; flex: none; }
.steps .mark span { width: 8px; height: 8px; border-radius: 50%; border: 1px solid #3E3E3E; }
.steps li.is-active { color: var(--text); font-weight: 700; }
.steps li.is-active .mark span { background: var(--text); border-color: var(--text); }
.steps li.is-done { color: var(--text-dim); }
.capture { background: var(--surface); padding: 20px var(--page-x); display: flex; flex-direction: column; gap: 10px; border-radius: var(--radius-card); margin-inline: var(--page-x); }
.capture__title { font-size: 15px; font-weight: 700; }
.capture__row { display: flex; gap: 10px; }
.capture__row input { flex: 1; min-width: 0; height: var(--input-h); background: var(--bg); border: var(--field-bw) solid var(--field-bc); color: var(--text); font-size: 16px; padding: 0 14px; border-radius: var(--radius-field); }
.capture__row input::placeholder { color: var(--placeholder); }
.capture__note { font-size: 12px; color: var(--text-dim); line-height: 1.5; }

/* ───────── result (screen 4) ───────── */
.hero { width: 100%; height: 320px; object-fit: cover; background: var(--surface); border-radius: var(--radius-media) var(--radius-media) 0 0; }
.top3d { width: 100%; height: 190px; object-fit: cover; background: var(--surface); border-top: 1px solid var(--bg); border-radius: 0 0 var(--radius-media) var(--radius-media); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 8px; }
.stats div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stats b { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.stats span { font-size: 12px; color: var(--text-dim); }
.check { display: flex; flex-direction: column; }
.check__item {
  display: flex; align-items: center; gap: 14px; padding: 12px 0; width: 100%;
  border: 0; border-top: 1px solid var(--hairline); background: transparent; color: var(--text); text-align: right; cursor: pointer;
}
.check__item:last-child { border-bottom: 1px solid var(--hairline); }
.check__thumb { width: 54px; height: 42px; object-fit: cover; flex: none; background: #262626; border: 1px solid #333; border-radius: 6px; }
.check__main { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.check__title { font-size: 15px; }
.check__logos { display: flex; align-items: center; gap: 10px; color: var(--text-muted); }
.check__logos svg { display: block; flex: none; }
.check__tag { font-size: 11px; color: var(--text-dim); letter-spacing: 1px; }
.check__item.is-locked { cursor: default; }
.check__item.is-locked .check__title, .check__item.is-locked .check__tag { color: var(--text-dim); }
.check__lock { width: 54px; height: 42px; flex: none; background: #141414; border: 1px solid var(--hairline-soft); border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.sticky { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--hairline); padding: 14px var(--page-x) 18px; display: flex; flex-direction: column; gap: 8px; }

/* ───────── overlays ───────── */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; padding: 18px; }
.sheet__box { width: 100%; max-width: var(--content-max); }
.sheet__close { position: absolute; top: 16px; left: 16px; width: 44px; height: 44px; background: none; border: 1px solid var(--border); color: var(--text); cursor: pointer; border-radius: 50%; }
.viewer { position: relative; width: 100%; overflow: auto; background: #000; border-radius: var(--radius-card); }
.viewer img { width: 100%; height: auto; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.viewer__mark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; letter-spacing: 3px; color: rgba(255, 255, 255, .28); pointer-events: none; }
.viewer__title { font-size: 15px; font-weight: 700; padding-bottom: 10px; }
/* גלריית סט-התכניות: החלקה לצדדים, תמונה אחת בכל פעם */
.gal { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
       background: #fff; border-radius: var(--radius-card); scrollbar-width: none; }
.gal::-webkit-scrollbar { display: none; }
.gal__slide { flex: 0 0 100%; scroll-snap-align: start; display: flex; align-items: center; justify-content: center; max-height: 62vh; }
.gal__slide img { width: 100%; height: auto; max-height: 62vh; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.gal__nav { display: flex; align-items: center; justify-content: center; gap: 18px; padding-top: 12px; }
.gal__btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: none; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.gal__count { font-size: 13px; color: var(--text-dim); min-width: 56px; text-align: center; }
.gal__mark { position: static; display: block; text-align: center; padding-top: 6px; }
.form-card { background: var(--surface); padding: 22px var(--page-x); display: flex; flex-direction: column; gap: 14px; border-radius: var(--radius-card); }
.form-card h2 { margin: 0; font-size: 22px; font-weight: 700; }

/* דסקטופ: אותו תוכן, ממורכז, עם גבול עדין שמסמן את עמודת המובייל */
@media (min-width: 900px) {
  body { background: #060606; }
  .app { border-inline: 1px solid var(--hairline); min-height: 100vh; }
}

/* ───────── מצב עריכה (index.html?edit=1) ───────── */
.ed {
  position: fixed; top: 0; right: 0; left: 0; z-index: 60; display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: #fff; color: #111; border-bottom: 1px solid #ccc; flex-wrap: wrap;
  font-family: var(--font); font-size: 13px;
}
.ed__grow { flex: 1; }
.ed__nav { display: flex; gap: 6px; }
.ed__btn {
  height: 32px; padding: 0 12px; border: 1px solid #111; background: #fff; color: #111;
  border-radius: 999px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.ed__btn--dark, .ed__btn.is-on { background: #111; color: #fff; }
.ed__btn[disabled] { opacity: .35; cursor: default; }
.ed__status { min-width: 120px; color: #555; }
.ed__status.is-dirty { color: #111; font-weight: 700; }
.ed__foot {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 60; padding: 8px 14px;
  background: #fff; color: #444; border-top: 1px solid #ccc; font-family: var(--font); font-size: 12px; text-align: center;
}
body.has-editor { padding-top: 50px; padding-bottom: 36px; }
.edit-mode [contenteditable] { outline: 1px dashed rgba(255, 255, 255, .45); outline-offset: 3px; cursor: text; }
.edit-mode [contenteditable]:hover { outline-color: rgba(255, 255, 255, .8); }
.edit-mode [contenteditable]:focus { outline: 1.5px solid #fff; background: rgba(255, 255, 255, .06); }
.edit-mode .btn--primary [contenteditable]:focus { background: rgba(0, 0, 0, .06); }
.edit-mode input.is-ph-edit { outline: 1px dashed rgba(255, 255, 255, .5); outline-offset: 2px; }

/* ───────── מסך 1 — hero, השוואה, שלבים, רשימה ───────── */
.h1--hero { font-size: 33px; line-height: 1.2; color: var(--text-muted); }
.h1--hero .h1__hi { color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: rgba(255,255,255,.55); }
.badges { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.badge { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-field); background: rgba(255, 255, 255, .03); }
.badge__icon { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: center; color: var(--text); }
.badge__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.badge__body b { font-size: 14px; }
.badge__body span { font-size: 13px; color: var(--text-dim); }

.cmp { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cmp th, .cmp td { padding: 0; font-weight: 400; vertical-align: middle; text-align: center; }
.cmp__corner { width: 32%; }
.cmp__th { padding-bottom: 9px; font-size: 12.5px; font-weight: 700; color: var(--text-dim); vertical-align: bottom; }
.cmp__th--us { padding: 9px 4px 8px; background: var(--text); color: var(--bg); border-radius: 10px 10px 0 0; }
.cmp__logo { height: 16px; width: auto; margin: 0 auto; filter: invert(1); }
.cmp__tag { display: block; margin-top: 3px; font-size: 10px; letter-spacing: 1px; color: #555; direction: ltr; }
.cmp tbody th, .cmp tbody td { height: 54px; border-bottom: 1px solid var(--hairline-soft); }
.cmp__name { padding-left: 6px; font-size: 12.6px; line-height: 15px; font-weight: 700 !important; text-align: right !important; }
.cmp__price { display: block; font-size: 14px; line-height: 16px; color: var(--text-muted); }
.cmp__time { display: block; margin-top: 2px; font-size: 11px; line-height: 13px; color: var(--text-dim); }
.cmp__us { background: rgba(255, 255, 255, .06); border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.cmp__val { display: block; font-size: 14.4px; line-height: 17px; color: var(--text); }
.cmp__note { display: block; margin-top: 2px; font-size: 10.5px; line-height: 12px; color: var(--text-dim); }
.cmp__foot th, .cmp__foot td { border-bottom: 0; }
.cmp__foot .cmp__price { font-size: 15px; font-weight: 700; color: var(--text); }
.cmp__foot .cmp__us { border-radius: 0 0 10px 10px; border-bottom: 1px solid var(--border); }
.cmp__foot .cmp__val { font-size: 13px; font-weight: 700; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.kpi { padding: 14px 10px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius-card); background: rgba(255, 255, 255, .03); }
.kpi--main { grid-column: 1 / -1; background: var(--text); color: var(--bg); border-color: var(--text); }
.kpi__val { display: block; font-size: 26px; line-height: 30px; letter-spacing: -.4px; }
.kpi--main .kpi__val { font-size: 34px; line-height: 38px; }
.kpi__cap { display: block; margin-top: 3px; font-size: 12px; color: var(--text-dim); }
.kpi--main .kpi__cap { color: #555; }

.steps3 { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.glass { position: relative; padding: 18px; border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius-card);
  background: linear-gradient(135deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); backdrop-filter: blur(6px); display: flex; flex-direction: column; gap: 6px; }
.steps3__num { font-size: 28px; line-height: 30px; font-weight: 700; color: rgba(255, 255, 255, .32); letter-spacing: -.5px; }
.steps3__title { font-size: 16px; }
.steps3__text { font-size: 14px; line-height: 1.5; color: var(--text-dim); }

.rows--icons > li { display: flex; align-items: center; gap: 12px; }
.rows__icon { width: 30px; height: 30px; flex: none; display: flex; align-items: center; justify-content: center; color: var(--text-dim); }
.closing .h2, .closing .lead { text-align: center; }

/* ───────── תוצרים אמיתיים מהמנוע ───────── */
.top3d--live { object-fit: contain; background: #141a2c; height: auto; max-height: 300px; }
.boq { position: relative; gap: 10px; }
.boq__rows { display: flex; flex-direction: column; }
.boq__row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--hairline-soft); font-size: 14px; }
.boq__row > span:first-child { color: var(--text-dim); font-size: 12px; width: 22px; flex: none; }
.boq__scroll { max-height: 56vh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-inline-end: 4px; }
.boq__row--head { font-weight: 700; padding-top: 14px; }
.boq__row--item { padding: 6px 0; font-size: 13px; color: var(--text-muted); border-top-color: transparent; }
.boq__row--item .boq__name { line-height: 1.35; }
.boq__row--item .mono { color: var(--text-muted); white-space: nowrap; }
.boq__row b.mono { white-space: nowrap; }
.boq__name { flex: 1; }
.boq__total { display: flex; align-items: baseline; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 15px; }
.boq__total b { font-size: 20px; }
.boq__mark { position: absolute; inset: auto 0 6px 0; font-size: 11px; }
