/* ───────────────────────────────────────────────────────────────
   גננת מסננת — מערכת עיצוב
   מובייל קודם. הורה פותח את זה בטלפון, בעמידה, ליד הגן.
   ─────────────────────────────────────────────────────────────── */

:root {
  --mint-50:  #f2fbf8;
  --mint-100: #dff5ef;
  --mint-200: #b9e9de;
  --teal-400: #3ec9b8;
  --teal-500: #12b3a0;
  --teal-600: #0d8d7f;
  --ink-900:  #06231f;
  --ink-700:  #0d3b34;
  --ink-500:  #38635c;
  --ink-300:  #7fa39c;
  --coral:    #ff8a5b;
  --coral-dk: #f2683a;
  --sun:      #ffc93c;
  --danger:   #ef4f56;

  --bg: linear-gradient(170deg, #f6fdfb 0%, #eef9f6 42%, #f7f4ef 100%);
  --surface: #ffffff;
  --surface-2: #f4faf8;
  --border: #e2f0ec;
  --text: var(--ink-900);
  --text-dim: var(--ink-500);
  --text-faint: var(--ink-300);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 34px;

  --shadow-sm: 0 2px 8px rgba(6, 46, 41, .05);
  --shadow-md: 0 8px 26px rgba(6, 46, 41, .08);
  --shadow-lg: 0 20px 50px rgba(6, 46, 41, .14);

  --nav-h: 68px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: linear-gradient(170deg, #08130f 0%, #0a1a17 50%, #0d1512 100%);
    --surface: #10201c;
    --surface-2: #162924;
    --border: #1e3630;
    --text: #e9f6f2;
    --text-dim: #9dbbb4;
    --text-faint: #6a8983;
    --mint-100: #14312a;
    --mint-50: #102420;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, .38);
    --shadow-lg: 0 22px 54px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  min-height: 100%;
}

body {
  direction: rtl;
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Rubik', 'Assistant', -apple-system, 'Segoe UI', system-ui, 'Noto Sans Hebrew', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--teal-600); }

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
}

/* ── טיפוגרפיה ────────────────────────────────────────────── */
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0; }
.dim   { color: var(--text-dim); }
.faint { color: var(--text-faint); font-size: .85rem; }
.center { text-align: center; }

/* ── כפתורים ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px;
  border-radius: var(--r-lg);
  font-weight: 600; font-size: 1rem;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), opacity .18s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--teal-400), var(--teal-600));
  color: #fff;
  box-shadow: 0 8px 22px rgba(18, 179, 160, .32);
}
.btn-accent {
  background: linear-gradient(135deg, var(--sun), var(--coral));
  color: #40200f;
  box-shadow: 0 8px 22px rgba(255, 138, 91, .32);
}
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-quiet { color: var(--text-dim); padding: 10px 14px; }
.btn-danger { background: rgba(239, 79, 86, .1); color: var(--danger); }
.btn-block { width: 100%; }
.btn-lg { padding: 17px 26px; font-size: 1.06rem; }
.btn-sm { padding: 9px 15px; font-size: .88rem; border-radius: var(--r-md); }

/* ── כרטיסים ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 18px;
}
.card-flush { padding: 0; overflow: hidden; }

/* ── מסך הרשמה ────────────────────────────────────────────── */
.onboard {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: max(28px, env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom));
}

.progress {
  display: flex; gap: 6px; margin-bottom: 30px;
}
.progress i {
  flex: 1; height: 5px; border-radius: 99px;
  background: var(--border);
  transition: background .45s var(--ease);
}
.progress i.on { background: linear-gradient(90deg, var(--teal-400), var(--teal-500)); }

.step { flex: 1; display: flex; flex-direction: column; animation: rise .5s var(--ease) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.step-head { margin-bottom: 26px; }
.step-head .kicker {
  display: inline-block;
  font-size: .78rem; font-weight: 600; letter-spacing: .04em;
  color: var(--teal-600);
  background: var(--mint-100);
  padding: 5px 13px; border-radius: 99px;
  margin-bottom: 14px;
}
.step-head h1 { margin-bottom: 8px; }
.step-body { flex: 1; }
.step-foot { padding-top: 22px; display: flex; gap: 10px; align-items: center; }
.step-foot .btn-primary { flex: 1; }

/* מסך פתיחה */
.hero { text-align: center; padding-top: 6vh; }
.hero .mark { width: 132px; height: 132px; margin: 0 auto 26px; display: block; }
.hero h1 { font-size: 2.2rem; margin-bottom: 10px; }
.hero .tag { color: var(--text-dim); font-size: 1.05rem; max-width: 22ch; margin: 0 auto; }

.pitch { display: grid; gap: 12px; margin: 34px 0 8px; text-align: right; }
.pitch li {
  display: flex; gap: 13px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 13px 15px;
  box-shadow: var(--shadow-sm);
  animation: rise .5s var(--ease) both;
}
.pitch li:nth-child(2) { animation-delay: .07s; }
.pitch li:nth-child(3) { animation-delay: .14s; }
.pitch li b { display: block; font-size: .96rem; }
.pitch li span { font-size: .84rem; color: var(--text-dim); }
.pitch .ico {
  width: 42px; height: 42px; flex: 0 0 42px;
  display: grid; place-items: center;
  border-radius: 14px; font-size: 1.3rem;
  background: var(--mint-100);
}

/* ── טפסים ────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: .86rem; font-weight: 600;
  color: var(--text-dim); margin-bottom: 7px;
}
.input {
  width: 100%; padding: 15px 17px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color .18s, box-shadow .18s;
}
.input:focus {
  outline: none;
  border-color: var(--teal-400);
  box-shadow: 0 0 0 4px rgba(62, 201, 184, .16);
}
.input::placeholder { color: var(--text-faint); }

.kid-row {
  display: flex; gap: 10px; align-items: center; margin-bottom: 12px;
}
.kid-row .input { flex: 1; }
.emoji-btn {
  width: 56px; height: 54px; flex: 0 0 56px;
  font-size: 1.6rem;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  display: grid; place-items: center;
}
.emoji-pick {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px; background: var(--surface-2);
  border-radius: var(--r-md); margin-bottom: 12px;
}
.emoji-pick button {
  width: 44px; height: 44px; font-size: 1.5rem;
  border-radius: 12px; display: grid; place-items: center;
}
.emoji-pick button:hover, .emoji-pick button.on { background: var(--mint-100); }

/* ── QR ───────────────────────────────────────────────────── */
.qr-frame {
  width: min(78vw, 300px); aspect-ratio: 1;
  margin: 0 auto; padding: 14px;
  background: #fff; border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  display: grid; place-items: center;
  position: relative; overflow: hidden;
}
.qr-frame img { width: 100%; height: 100%; object-fit: contain; border-radius: 14px; }
.qr-frame .scanline {
  position: absolute; inset-inline: 12px; height: 3px;
  background: linear-gradient(90deg, transparent, var(--teal-400), transparent);
  animation: scan 2.4s ease-in-out infinite;
}
@keyframes scan {
  0%, 100% { top: 14px; opacity: .25; }
  50% { top: calc(100% - 18px); opacity: 1; }
}

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--mint-200); border-top-color: var(--teal-500);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.howto { counter-reset: s; display: grid; gap: 10px; margin-top: 26px; }
.howto li {
  counter-increment: s;
  display: flex; gap: 12px; align-items: flex-start;
  font-size: .92rem; color: var(--text-dim);
}
.howto li::before {
  content: counter(s);
  flex: 0 0 24px; height: 24px;
  display: grid; place-items: center;
  background: var(--mint-100); color: var(--teal-600);
  border-radius: 50%; font-size: .78rem; font-weight: 700;
}

/* ── העלאת ייחוסים ────────────────────────────────────────── */
.ref-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.ref-cell {
  aspect-ratio: 1; border-radius: var(--r-md);
  overflow: hidden; position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  animation: pop .35s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }
.ref-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-cell .x {
  position: absolute; top: 5px; inset-inline-start: 5px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(6, 35, 31, .62); color: #fff;
  display: grid; place-items: center; font-size: .95rem;
  backdrop-filter: blur(6px);
}
.ref-add {
  aspect-ratio: 1; border-radius: var(--r-md);
  border: 2px dashed var(--mint-200);
  background: var(--mint-50);
  display: grid; place-items: center; gap: 2px;
  color: var(--teal-600); font-size: .8rem; font-weight: 600;
  text-align: center; padding: 6px;
}
.ref-add span:first-child { font-size: 1.5rem; line-height: 1; }
.ref-add.busy { opacity: .6; pointer-events: none; }

.angle-tips {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 4px 0 10px; margin: 0 -4px;
  scrollbar-width: none;
}
.angle-tips::-webkit-scrollbar { display: none; }
.angle-tips .tip {
  flex: 0 0 auto; padding: 8px 13px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 99px; font-size: .82rem; color: var(--text-dim);
  display: flex; gap: 6px; align-items: center;
}
.angle-tips .tip.done { background: var(--mint-100); border-color: var(--mint-200); color: var(--teal-600); }

.meter { height: 8px; border-radius: 99px; background: var(--border); overflow: hidden; margin: 14px 0 6px; }
.meter i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--teal-400), var(--teal-500));
  transition: width .5s var(--ease);
}

/* ── בחירת קבוצות ─────────────────────────────────────────── */
.group-list { display: grid; gap: 9px; }
.group-item {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 15px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color .2s, background .2s, transform .15s var(--ease);
  text-align: right; width: 100%;
}
.group-item:active { transform: scale(.985); }
.group-item.on { border-color: var(--teal-400); background: var(--mint-50); }
.group-item .av {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.15rem;
  background: var(--mint-100); color: var(--teal-600); font-weight: 700;
}
.group-item .meta { flex: 1; min-width: 0; }
.group-item .meta b { display: block; font-size: .96rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-item .meta span { font-size: .79rem; color: var(--text-faint); }
.check {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  border: 2px solid var(--border);
  display: grid; place-items: center;
  transition: all .2s var(--ease);
}
.group-item.on .check {
  background: var(--teal-500); border-color: var(--teal-500); color: #fff;
}

.search-bar {
  position: relative; margin-bottom: 14px;
}
.search-bar .input { padding-inline-start: 44px; }
.search-bar .ico {
  position: absolute; inset-inline-start: 15px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); pointer-events: none;
}

/* ── מעטפת האפליקציה ──────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  padding: max(14px, env(safe-area-inset-top)) 18px 12px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.topbar .brand { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.topbar .brand svg { width: 32px; height: 32px; flex: 0 0 32px; }
.topbar .brand b { font-size: 1.05rem; letter-spacing: -.02em; }
.topbar .brand span { font-size: .72rem; color: var(--text-faint); display: block; margin-top: -3px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 99px;
  font-size: .76rem; font-weight: 600;
  background: var(--mint-100); color: var(--teal-600);
}
.pill.warn { background: rgba(255, 201, 60, .18); color: #9a6b00; }
.pill.bad  { background: rgba(239, 79, 86, .12); color: var(--danger); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.live .dot { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.75); } }

.view {
  padding: 18px 18px calc(var(--nav-h) + 34px + env(safe-area-inset-bottom));
  animation: fade .3s var(--ease);
}
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── ניווט תחתון ──────────────────────────────────────────── */
.nav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 40;
  max-width: 560px; margin: 0 auto;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.5);
  border-top: 1px solid var(--border);
}
.nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: .69rem; font-weight: 600;
  color: var(--text-faint);
  position: relative;
  transition: color .2s;
}
.nav button svg { width: 23px; height: 23px; stroke-width: 1.8; }
.nav button.on { color: var(--teal-500); }
.nav button.on::before {
  content: ''; position: absolute; top: 0;
  width: 26px; height: 3px; border-radius: 0 0 4px 4px;
  background: var(--teal-500);
}
.nav .badge {
  position: absolute; top: 8px; inset-inline-start: calc(50% - 20px);
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px; background: var(--coral); color: #fff;
  font-size: .62rem; font-weight: 700;
  display: grid; place-items: center;
}

/* ── כרטיס סטטיסטיקה ──────────────────────────────────────── */
.hero-stat {
  border-radius: var(--r-xl);
  padding: 22px;
  background: linear-gradient(140deg, var(--teal-500), var(--teal-600) 60%, #0a6f65);
  color: #fff;
  box-shadow: 0 16px 38px rgba(13, 141, 127, .28);
  position: relative; overflow: hidden;
  margin-bottom: 18px;
}
.hero-stat::after {
  content: ''; position: absolute; inset-block-start: -55%; inset-inline-end: -22%;
  width: 250px; height: 250px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.2), transparent 68%);
}
.hero-stat .big { font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.hero-stat .sub { opacity: .85; font-size: .9rem; margin-top: 5px; }
.hero-stat .row { display: flex; gap: 20px; margin-top: 16px; position: relative; }
.hero-stat .row div b { display: block; font-size: 1.15rem; font-weight: 700; }
.hero-stat .row div span { font-size: .74rem; opacity: .8; }

/* ── שבבי סינון ───────────────────────────────────────────── */
.chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 0 14px; margin: 0 -18px; padding-inline: 18px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 99px;
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: .87rem; font-weight: 600; color: var(--text-dim);
  transition: all .2s var(--ease);
}
.chip.on { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.chip .n {
  font-size: .74rem; padding: 1px 7px; border-radius: 99px;
  background: var(--surface-2); color: var(--text-dim);
}
.chip.on .n { background: rgba(255,255,255,.2); color: #fff; }
.chip .av { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; }

/* ── גלריה ────────────────────────────────────────────────── */
.masonry { columns: 2; column-gap: 10px; }
@media (min-width: 460px) { .masonry { columns: 3; } }

.shot {
  break-inside: avoid; margin-bottom: 10px;
  border-radius: var(--r-md); overflow: hidden;
  position: relative; display: block; width: 100%;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  animation: pop .4s var(--ease) both;
}
.shot img { width: 100%; display: block; }
.shot .tagline {
  position: absolute; inset-inline: 0; bottom: 0;
  padding: 22px 9px 7px;
  background: linear-gradient(to top, rgba(4, 26, 23, .82), transparent);
  color: #fff; font-size: .7rem;
  display: flex; align-items: center; gap: 5px;
}
.shot .tagline .dot { width: 6px; height: 6px; border-radius: 50%; }
.shot .fav {
  position: absolute; top: 7px; inset-inline-end: 7px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(6, 35, 31, .5); backdrop-filter: blur(6px);
  display: grid; place-items: center; color: #fff; font-size: .85rem;
}
.shot .fav.on { background: var(--coral); }
.shot.maybe { border: 2px solid var(--sun); }
.shot .maybe-tag {
  position: absolute; top: 7px; inset-inline-start: 7px;
  padding: 3px 9px; border-radius: 99px;
  background: var(--sun); color: #4a3200;
  font-size: .66rem; font-weight: 700;
}

/* ── מצב ריק ──────────────────────────────────────────────── */
.empty {
  text-align: center; padding: 46px 22px;
  color: var(--text-dim);
}
.empty .art { font-size: 3.2rem; margin-bottom: 12px; display: block; }
.empty h3 { margin-bottom: 6px; color: var(--text); }
.empty p { font-size: .9rem; max-width: 28ch; margin: 0 auto 18px; }

/* ── שורות ילדים / הגדרות ─────────────────────────────────── */
.row-item {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 16px; width: 100%; text-align: right;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); margin-bottom: 9px;
  box-shadow: var(--shadow-sm);
}
.row-item .av {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 16px;
  display: grid; place-items: center; font-size: 1.4rem;
}
.row-item .meta { flex: 1; min-width: 0; }
.row-item .meta b { display: block; }
.row-item .meta span { font-size: .8rem; color: var(--text-dim); }
.row-item .chev { color: var(--text-faint); }

.toggle {
  width: 50px; height: 30px; flex: 0 0 50px;
  border-radius: 99px; background: var(--border);
  position: relative; transition: background .25s var(--ease);
}
/* הכפתור נח בקצה ההתחלה (בעברית: מימין) ונוסע 20px שמאלה כשהוא דלוק —
   50 רוחב פחות 24 כפתור פחות 3+3 שוליים. inset-inline-END היה מניח אותו
   מלכתחילה בצד השמאלי, ומשם ה-translate היה מוציא אותו מהמסילה. */
.toggle::after {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2);
  transition: transform .25s var(--ease);
}
.toggle.on { background: var(--teal-500); }
.toggle.on::after { transform: translateX(-20px); }

.seg {
  display: grid; grid-auto-flow: column; gap: 4px;
  background: var(--surface-2); border-radius: var(--r-md); padding: 4px;
}
.seg button {
  padding: 10px 8px; border-radius: 13px;
  font-size: .85rem; font-weight: 600; color: var(--text-dim);
  transition: all .2s var(--ease);
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.section-title {
  font-size: .78rem; font-weight: 700; letter-spacing: .05em;
  color: var(--text-faint); margin: 24px 0 10px;
}

/* ── תצוגת תמונה מלאה ─────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(4, 20, 18, .93);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column;
  animation: fade .22s var(--ease);
}
.lightbox .lb-top {
  display: flex; align-items: center; gap: 10px;
  padding: max(16px, env(safe-area-inset-top)) 18px 12px;
  color: #fff;
}
.lightbox .lb-top .meta { flex: 1; min-width: 0; }
.lightbox .lb-top b { font-size: .95rem; display: block; }
.lightbox .lb-top span { font-size: .76rem; opacity: .7; }
.lightbox .lb-x {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff;
  display: grid; place-items: center; font-size: 1.1rem;
}
.lightbox .stage {
  flex: 1; display: grid; place-items: center; padding: 0 14px; min-height: 0;
}
.lightbox .stage img {
  max-width: 100%; max-height: 100%;
  border-radius: var(--r-md);
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.lightbox .lb-bar {
  display: flex; gap: 9px; justify-content: center;
  padding: 16px 18px calc(20px + env(safe-area-inset-bottom));
}
.lightbox .lb-bar .btn { background: rgba(255,255,255,.12); color: #fff; }
.lightbox .lb-bar .btn.go { background: var(--teal-500); }
.lightbox .lb-bar .btn.no { background: rgba(239,79,86,.9); }

/* ── טוסט ─────────────────────────────────────────────────── */
.toasts {
  position: fixed; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
  inset-inline: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; padding: 0 18px;
}
.toast {
  background: var(--ink-900); color: #fff;
  padding: 12px 20px; border-radius: 99px;
  font-size: .88rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .35s var(--ease);
  max-width: 100%;
}
.toast.bad { background: var(--danger); }
.toast.good { background: var(--teal-600); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }

/* ── גיליון תחתון ─────────────────────────────────────────── */
.sheet-back {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(4, 20, 18, .5);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .22s var(--ease);
}
.sheet {
  width: 100%; max-width: 560px;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  max-height: 88dvh; overflow-y: auto;
  animation: slideUp .34s var(--ease);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet .grab {
  width: 40px; height: 4px; border-radius: 99px;
  background: var(--border); margin: 0 auto 16px;
}

.hidden { display: none !important; }
.stack > * + * { margin-top: 12px; }
.rowline { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; }
