  /* Heebo (OFL, גוגל) - באירוח עצמי: עברית ולטינית, משקל משתנה 400-800. בלי CDN, נכנס למטמון ה-SW */
  @font-face { font-family: 'Heebo'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(vendor/fonts/heebo-hebrew.woff2) format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
  @font-face { font-family: 'Heebo'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(vendor/fonts/heebo-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

  :root {
    --primary: #7c5cbf;
    --primary-dark: #5d4494;
    --bg: #faf7f2;
    --card: #ffffff;
    --text: #33302e;
    --muted: #6b6560;   /* נגישות: 4.5:1 לפחות על הרקע, על לבן ועל #efe9f7 (היה #8a8580 = 3.4:1) */
    --border: #eae4dc;
    --gold: #e9b949;
    --gold-text: #946b00;   /* זהב לטקסט על לבן (4.8:1); --gold עצמו רק לרקעים */
    --radius: 14px;
    --shadow: 0 2px 12px rgba(60, 40, 90, .08);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: 'Heebo', 'Segoe UI', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
  }

  .hidden { display: none !important; }

  h1, h2 { font-weight: 700; letter-spacing: -.01em; }
  h2 { font-size: 1.1rem; margin-bottom: 12px; color: var(--primary-dark); }

  /* ---------- כפתורים ושדות ---------- */
  .btn {
    border: none; border-radius: 10px; padding: 10px 18px;
    font-size: 1rem; font-family: inherit; cursor: pointer;
    transition: filter .15s, transform .05s;
  }
  .btn:active { transform: scale(.97); }
  .btn:hover { filter: brightness(1.08); }
  .btn-primary { background: var(--primary); color: #fff; }
  .btn-light { background: #efe9f7; color: var(--primary-dark); }
  .btn-danger { background: #e4572e; color: #fff; }
  .btn-block { width: 100%; }
  .btn-sm { padding: 6px 12px; font-size: .85rem; }
  /* "המשך עם Google" (דפי הכניסה/הרשמה): לבן עם מסגרת לפי הנחיות המיתוג של גוגל */
  .btn-google, a.btn-google { background: #fff; color: #3c4043; border: 1px solid #dadce0; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; }
  .btn-google svg { width: 18px; height: 18px; flex: none; }
  .auth-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: .85rem; }
  .auth-or::before, .auth-or::after { content: ''; flex: 1; border-top: 1px solid var(--border); }

  input, select, textarea {
    width: 100%; padding: 10px 12px; margin-bottom: 10px;
    border: 1.5px solid var(--border); border-radius: 10px;
    font-size: 1rem; font-family: inherit; background: #fff;
  }
  input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
  }

  /* ---------- מסך התחברות ---------- */
  .auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, #7c5cbf 0%, #a98fd8 60%, #e9b949 130%);
    padding: 20px;
  }
  .auth-card {
    background: var(--card); border-radius: 20px; box-shadow: var(--shadow);
    padding: 36px 32px; width: 100%; max-width: 380px; text-align: center;
  }
  .auth-logo { font-size: 3rem; margin-bottom: 8px; }
  .auth-card h1 { font-size: 1.4rem; margin-bottom: 22px; color: var(--primary-dark); }
  .auth-switch { margin-top: 14px; font-size: .9rem; color: var(--muted); }
  .reg-hint {
    text-align: right; font-size: .85rem; color: var(--text);
    background: var(--bg); border-radius: 10px; padding: 10px 12px;
    margin-bottom: 10px; line-height: 1.65;
  }
  .reg-hint span { color: var(--muted); }
  .auth-switch a:not(.btn) { color: var(--primary); }
  .error-msg {
    margin-top: 14px; padding: 10px; border-radius: 10px;
    background: #fdecea; color: #b3261e; font-size: .9rem;
  }

  /* ---------- סרגל עליון ---------- */
  .topbar {
    background: var(--card); box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 18px;
    padding: 10px 22px; position: sticky; top: 0; z-index: 500;
    flex-wrap: wrap;
  }
  .topbar-title { font-weight: 700; color: var(--primary-dark); }
  .topbar-nav { display: flex; gap: 4px; flex-wrap: wrap; }
  .nav-link {
    text-decoration: none; color: var(--muted); padding: 8px 14px;
    border-radius: 10px; font-size: .95rem; white-space: nowrap;
  }
  .nav-link.active { background: #efe9f7; color: var(--primary-dark); font-weight: 600; }
  /* מחשב: שורה אחת - ניווט | לוגו ושם המשפחה + שלום | 👤 🚪. הסדר נקבע ב-order כדי שבטלפון יתחלף */
  .topbar-second { display: flex; align-items: center; gap: 12px; order: 2; flex: 1 1 auto; min-width: 0; }
  .topbar-second .topbar-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .topbar-me { font-size: .9rem; color: var(--muted); white-space: nowrap; }
  .topbar-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; order: 3; flex-shrink: 0; }
  .topbar-actions a { text-decoration: none; font-size: 1.1rem; }
  .topbar-actions button.icon-btn { border: none; background: none; cursor: pointer; font-size: 1.1rem; padding: 0; font-family: inherit; }
  .topbar-nav { order: 1; }
  .badge {
    background: #e4572e; color: #fff; border-radius: 20px;
    font-size: .7rem; padding: 1px 7px; vertical-align: top;
  }

  main { max-width: 1100px; margin: 0 auto; padding: 22px 16px 60px; }

  .card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px;
  }

  /* ---------- דשבורד ---------- */
  /* מחשב: המספרים ברוחב מלא, ומתחת האירועים והמפה זה לצד זה באותו גובה - הרשימה גוללת בתוך עצמה
     ולא מותחת את הדף. טלפון: הכל אחד אחרי השני, הרשימה בגובה מלא. */
  .dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; }
  .dash-events { display: flex; flex-direction: column; }
  .dash-list { flex: 1; min-height: 0; }
  @media (min-width: 761px) {
    .dash-list { max-height: 380px; overflow-y: auto; padding-inline-end: 4px; overscroll-behavior: contain; }
    .dash-map { display: flex; flex-direction: column; }
    .dash-map #main-map { flex: 1; min-height: 380px; }
  }
  @media (max-width: 760px) { .dash-grid { grid-template-columns: 1fr; } }

  .stats-row { display: flex; gap: 14px; flex-wrap: wrap; }
  .stat {
    flex: 1; min-width: 90px; text-align: center; padding: 14px 8px;
    background: var(--bg); border-radius: 12px;
  }
  .stat .num { font-size: 1.7rem; font-weight: 700; color: var(--primary); }
  .stat .lbl { font-size: .8rem; color: var(--muted); }

  .bday-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .95rem;
  }
  .bday-row:last-child { border-bottom: none; }
  /* לאווטאר יש margin:auto גלובלי (צנטור בכרטיסים) - בשורת flex זה דוחף אותו פנימה */
  .bday-row .avatar, .bday-row .avatar-placeholder { margin: 0; flex-shrink: 0; }

  /* בוחר בני הזוג ביום נישואין: הריחוף מדגיש (מסגרת+התכהות) -
     ההבהרה הכללית של .btn:hover מלבינה את הרקע הבהיר ונראית כאילו הכפתור השני הוא הנבחר */
  .anniv-choice {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 14px 20px; border: 2px solid transparent;
  }
  .anniv-choice:hover {
    filter: none; border-color: var(--primary); background: #e3d9f3; transform: translateY(-2px);
  }
  .anniv-choice:active { transform: scale(.97); }
  .bday-days { margin-inline-start: auto; color: var(--gold-text); font-weight: 700; white-space: nowrap; }

  #main-map { height: 380px; border-radius: 12px; }

  /* ---------- בני המשפחה ---------- */
  .people-toolbar { display: flex; gap: 12px; margin-bottom: 16px; }
  .people-toolbar input { margin-bottom: 0; flex: 1; }
  .people-toolbar .btn { white-space: nowrap; }

  .people-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px;
  }

  /* כרטיס תיקיית משפחה - באותו גודל וצורה של כרטיס אדם */
  .folder-card { background: #fffaf0; border: 1.5px solid #f0e2c0; }
  .folder-card .folder-icon {
    width: 84px; height: 84px; margin: 0 auto 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.6rem; background: #fdf3d8; border-radius: 24px;
    border: 3px solid #f5e7c4;
  }
  .folder-view-head {
    display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  }
  .folder-view-head h2 { margin: 0; font-size: 1.15rem; }
  .person-card {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 18px; text-align: center; cursor: pointer;
    transition: transform .12s, box-shadow .12s;
  }
  .person-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(60,40,90,.14); }
  .avatar {
    width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
    margin: 0 auto 10px; display: block; border: 3px solid #efe9f7;
    background: #efe9f7;
  }
  .avatar-placeholder {
    width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 10px;
    background: #efe9f7; display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: var(--primary-dark); font-weight: 700; border: 3px solid #e3d9f3;
  }
  .person-card .name { font-weight: 700; margin-bottom: 3px; }
  .person-card .sub { font-size: .82rem; color: var(--muted); }
  .editable-tag {
    display: inline-block; margin-top: 8px; font-size: .72rem;
    background: #eaf6ec; color: #2e7d43; border-radius: 20px; padding: 2px 9px;
  }

  /* ---------- עץ משפחה: תרשים אילן יוחסין מלמעלה למטה ----------
     ul מקונן = דור; הקווים המחברים נבנים מ-::before/::after בשטח ה-padding העליון
     של כל ענף. המבנה סימטרי ולכן עובד ב-RTL כמו שהוא */
  .tree-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
  .tree-toolbar input { width: auto; flex: 1 1 150px; min-width: 0; margin: 0; padding: 6px 10px; font-size: .9rem; }
  .tree-hint { color: var(--muted); font-size: .82rem; margin-bottom: 10px; }
  /* פירורי לחם: 🏠 כל המשפחה › סבא וסבתא › דוד ורחל. האחרון = הבית שבמיקוד */
  .tree-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin-bottom: 6px; color: var(--muted); font-size: .88rem; }
  .tree-crumb { border: none; background: none; font: inherit; color: var(--primary-dark); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
  .tree-crumb:hover { background: #efe9f7; }
  .tree-crumb[aria-current] { font-weight: 700; color: var(--text); cursor: default; }
  /* יציאה מהמיקוד: כפתור מעל הבית העליון עם קו שיורד אליו */
  .ftree-up { display: flex; flex-direction: column; align-items: center; margin-bottom: 4px; }
  .ftree-up::after { content: ''; width: 0; height: 18px; border-left: 2px dashed #c9b8e8; }
  @media (max-width: 640px) {
    .ftree-up { align-items: flex-start; margin-bottom: 8px; }
    .ftree-up::after { display: none; }
  }
  /* צ'יפים של הענף: ▲ הסתרה / "▼ N בענף" פתיחה במקום, ו-🎯 מיקוד; גדולים מספיק לאצבע */
  .ftree-ctl { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
  .ftree-focus-btn { padding: 6px 8px; }
  .ftree-toggle {
    border: none; cursor: pointer; font-family: inherit;
    background: #efe9f7; color: var(--primary-dark); font-weight: 600;
    border-radius: 20px; padding: 6px 12px; font-size: .76rem;
    flex-shrink: 0; white-space: nowrap;
    box-shadow: 0 1px 2px rgba(60, 40, 90, .15);
  }
  .ftree-toggle:hover { filter: brightness(.95); }
  /* הבית שבמיקוד (depth 0) מודגש בטבעת סגולה; האדם שחיפשו / האדם של החשבון - בטבעת זהב */
  .ftree-focus > .ftree-couple, .ftree-focus > .ftree-card { border-color: var(--primary); box-shadow: 0 0 0 3px #e3d9f3; }
  .ftree-card.ftree-mark, .ftree-card.ftree-mark:hover { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold); }
  /* touch-action מאפשר גלילה באצבע אחת אבל משאיר לנו את הצביטה בשתי אצבעות (זום) */
  .ftree-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 4px 4px 8px; touch-action: pan-x pan-y; }
  /* במחשב גוררים את העץ בעכבר (initTreeGestures) */
  @media (hover: hover) {
    .ftree-scroll { cursor: grab; user-select: none; }
    .ftree-scroll:active { cursor: grabbing; }
  }
  .tree-zoom { display: flex; gap: 4px; margin-inline-start: auto; }
  /* שני כיווני פריסה לאותו מבנה HTML:
     מחשב (מסך רחב) - מלמעלה למטה כמו אילן יוחסין קלאסי;
     טלפון (מסך צר) - מימין לשמאל, האחים נערמים אנכית והעץ גדל כלפי מטה */
  .ftree { display: inline-block; min-width: 100%; }
  .ftree ul { display: flex; margin: 0; list-style: none; position: relative; }
  .ftree ul::before { content: ''; position: absolute; }
  .ftree li { display: flex; align-items: center; position: relative; }
  .ftree li::before, .ftree li::after { content: ''; position: absolute; }
  /* השורש: בלי קווים לפני הדור הראשון */
  .ftree > ul::before { display: none; }
  .ftree > ul > li::before, .ftree > ul > li::after { display: none; }

  @media (min-width: 641px) {
    /* מלמעלה למטה */
    .ftree ul { justify-content: center; align-items: flex-start; padding: 22px 0 0; }
    .ftree ul::before { top: 0; left: 50%; height: 22px; border-left: 2px solid #c9b8e8; }
    .ftree li { flex-direction: column; padding: 22px 6px 0; }
    .ftree li::before { top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid #c9b8e8; }
    .ftree li::after { top: 0; left: 50%; width: 50%; height: 22px; border-top: 2px solid #c9b8e8; border-left: 2px solid #c9b8e8; }
    /* קיצוץ הקצוות: ב-RTL הילד הראשון הוא הימני ביותר והאחרון השמאלי ביותר */
    .ftree li:first-child::after { border-top: none; }
    .ftree li:last-child::before { display: none; }
    .ftree > ul { padding-top: 0; }
    .ftree > ul > li { padding-top: 0; }
    .ftree-ctl { margin: 6px 0 0; }
  }

  @media (max-width: 640px) {
    /* מימין לשמאל */
    .ftree ul { flex-direction: column; justify-content: center; padding: 0 16px 0 0; }
    .ftree ul::before { top: 50%; right: 0; width: 16px; border-top: 2px solid #c9b8e8; }
    .ftree li { padding: 4px 16px 4px 0; }
    .ftree li::before { top: 0; right: 0; width: 16px; height: 50%; border-right: 2px solid #c9b8e8; }
    .ftree li::after { top: 50%; right: 0; width: 16px; height: 50%; border-right: 2px solid #c9b8e8; border-top: 2px solid #c9b8e8; }
    /* קיצוץ הקצוות: הילד הראשון הוא העליון והאחרון התחתון */
    .ftree li:first-child::before { display: none; }
    .ftree li:last-child::after { border-right: none; }
    .ftree > ul { padding-right: 0; }
    .ftree > ul > li { padding-right: 0; }
    .ftree-ctl { margin: 0 4px; flex-direction: column; }
    .ftree-toggle { padding: 5px 8px; }
  }

  /* עותק הייצוא ל-PDF: מרונדר מוסתר מחוץ למסך ומצולם. תמיד בפריסת מלמעלה-למטה,
     בלי תלות בגודל המסך (כללים בלי media query גוברים על שני המצבים בזכות הסלקטור הספציפי) */
  .ftree-print-host { position: absolute; top: 0; left: -100000px; }
  .ftree-print { background: #fff; padding: 20px 28px; width: max-content; }
  .ftree-print h1 { text-align: center; font-size: 1.25rem; margin: 0 0 2px; color: #3a2d55; }
  .ftree-print-sub { text-align: center; color: var(--muted); font-size: .78rem; margin-bottom: 12px; }
  .ftree-print .ftree { display: block; min-width: 0; }
  .ftree-print .ftree ul {
    flex-direction: row; justify-content: center; align-items: flex-start; padding: 20px 0 0;
  }
  .ftree-print .ftree ul::before {
    top: 0; left: 50%; right: auto; width: 0; height: 20px;
    border: none; border-left: 2px solid #b39ddb;
  }
  .ftree-print .ftree li { flex-direction: column; align-items: center; padding: 20px 5px 0; }
  .ftree-print .ftree li::before {
    top: 0; right: 50%; left: auto; width: 50%; height: 20px;
    border: none; border-top: 2px solid #b39ddb;
  }
  .ftree-print .ftree li::after {
    top: 0; left: 50%; right: auto; width: 50%; height: 20px;
    border: none; border-top: 2px solid #b39ddb; border-left: 2px solid #b39ddb;
  }
  /* קיצוץ קצוות כמו בפריסת המחשב (חייב להיות מנוסח כאן שוב כדי לגבור על כללי המובייל) */
  .ftree-print .ftree li:first-child::before { display: block; }
  .ftree-print .ftree li:first-child::after { border-top: none; }
  .ftree-print .ftree li:last-child::before { display: none; }
  .ftree-print .ftree > ul { padding: 0; }
  .ftree-print .ftree > ul::before { display: none; }
  .ftree-print .ftree > ul > li { padding-top: 0; }
  .ftree-print .ftree > ul > li::before, .ftree-print .ftree > ul > li::after { display: none; }
  .ftree-print .ftree-card { box-shadow: none; }
  .ftree-print .ftree-couple { box-shadow: none; }

  /* הרוחב אחיד ונקבע ב-JS לפי השם הארוך ביותר (--ftree-card-w); הטקסטים לעולם לא נשברים */
  .ftree-card {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: var(--card); border: 1.5px solid #e3d9f3; border-radius: 12px;
    padding: 8px 10px; cursor: pointer; width: var(--ftree-card-w, auto); min-width: 74px; flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(60, 40, 90, .08); text-align: center;
    font-family: inherit; color: inherit;   /* בדף הנחיתה הכרטיס הוא <button> */
  }
  .ftree-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(60, 40, 90, .2); }
  .ftree-name { font-weight: 600; font-size: .82rem; line-height: 1.2; white-space: nowrap; }
  /* שם המשפחה והגיל בשורות נפרדות; שם ארוך נשבר בתוך הכרטיס במקום לגלוש החוצה */
  .ftree-card small { color: var(--muted); font-size: .72rem; display: block; white-space: nowrap; line-height: 1.2; }
  .ftree-card .ftree-age { color: var(--primary-dark); }
  /* זוג = צומת אחד: שני כרטיסונים בתוך מעטפת סגלגלה עם לב */
  .ftree-couple {
    display: flex; align-items: center; gap: 2px;
    background: #f6f1fc; border: 1.5px solid #e3d9f3; border-radius: 16px; padding: 4px;
  }
  .ftree-card .tree-avatar { width: 44px; height: 44px; margin: 0; }
  .tree-avatar {
    width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
    background: #efe9f7; border: 2px solid #e3d9f3; flex-shrink: 0;
    -webkit-user-drag: none;   /* שגרירת העץ בעכבר לא תגרור את התמונה */
  }
  .tree-avatar-ph {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; color: var(--primary-dark); font-weight: 700;
  }
  .tree-heart { font-size: 1.05rem; margin: 0 4px; }

  /* ---------- מודאל ---------- */
  .modal-backdrop {
    position: fixed; inset: 0; background: rgba(40, 30, 60, .45);
    display: flex; align-items: center; justify-content: center; z-index: 1200; padding: 16px;
    overscroll-behavior: contain;
  }
  /* הדף מאחורי חלונית פתוחה נעול (ראו lockPage_ ב-core.js) */
  body.modal-open { position: fixed; width: 100%; overflow: hidden; }
  .modal {
    background: var(--card); border-radius: 18px; max-width: 560px; width: 100%;
    max-height: 90vh; max-height: calc(100dvh - 32px); overflow-y: auto; padding: 26px;
    -webkit-overflow-scrolling: touch;
    /* overflow-y:auto לבדו גורם לדפדפן להפוך גם את ציר ה-X לגליל, וכל ילד
       שגולש במעט הופך את החלונית לנגררת לצדדים - זה מה שהרגיש בטלפון כמו
       חלונית שלא תואמת לרוחב המסך. הכללים למטה מונעים את הגלישה עצמה. */
    overflow-x: hidden;
    overscroll-behavior: contain;
  }
  /* ילדים של flex/grid מקבלים min-width:auto, ולכן טקסט ארוך בכפתור או הרוחב
     המובנה של שדה קלט "דוחפים" את החלונית רחב מהמסך במקום להתכווץ */
  .modal-actions .btn, .map-search input, .map-search .btn,
  .form-row > div, .detail-grid dt, .detail-grid dd { min-width: 0; }
  .detail-grid dd { overflow-wrap: anywhere; }
  .modal .btn { white-space: normal; }
  .modal h2 { display: flex; align-items: center; gap: 10px; }
  .modal .close-x {
    margin-inline-start: auto; cursor: pointer; border: none; background: none;
    font-size: 1.3rem; color: var(--muted);
  }
  .detail-photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
  .detail-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .95rem; margin: 10px 0; }
  .detail-grid dt { color: var(--muted); }
  /* הפרטים הנוספים חיים באותה רשת של הפרטים הבסיסיים (display:contents),
     כך שעמודת הכותרות מיושרת לכל אורך הכרטיס - קודם כל בלוק חישב רוחב משלו */
  .details-more { display: contents; }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
  @media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }
  label.fld { font-size: .82rem; color: var(--muted); display: block; margin-bottom: 2px; }
  .fld-hint { font-size: .72rem; opacity: .75; }
  #edit-map { height: 220px; border-radius: 10px; margin-bottom: 10px; }
  #person-view-map { grid-column: 1 / -1; height: 220px; border-radius: 12px; margin-top: 8px; }

  /* התמונה המשפחתית הכללית בראש הדשבורד */
  .dash-family-photo {
    display: block; width: 100%; max-height: 300px; object-fit: cover;
    border-radius: 18px; margin-bottom: 14px; cursor: pointer;
    box-shadow: 0 2px 10px rgba(60, 40, 100, .12);
  }
  .photo-full { display: block; width: 100%; border-radius: 12px; }
  .map-hint { font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
  .modal-actions { display: flex; gap: 10px; margin-top: 14px; }
  .modal-actions .btn { flex: 1; }

  /* ---------- ניהול ---------- */
  .request-card { border: 1.5px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
  .request-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
  .request-head .who { font-size: .82rem; color: var(--muted); }
  .diff-table { width: 100%; font-size: .88rem; border-collapse: collapse; margin-bottom: 10px; }
  .diff-table td, .diff-table th { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: right; }
  .diff-old { color: #b3261e; text-decoration: line-through; }
  .diff-new { color: #2e7d43; font-weight: 600; }
  .users-table { width: 100%; font-size: .9rem; border-collapse: collapse; }
  .users-table td, .users-table th { padding: 8px; border-bottom: 1px solid var(--border); text-align: right; }
  .users-table select { width: auto; margin: 0; padding: 5px 8px; }
  .picker-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 4px; border-bottom: 1px solid var(--border);
  }
  .picker-row:last-child { border-bottom: none; }
  .picker-name { flex: 1; font-weight: 600; }
  .picker-name small { color: var(--muted); font-weight: 400; }

  /* ---------- טוסט ולואדר ---------- */
  .toast {
    position: fixed; bottom: 26px; right: 50%; transform: translateX(50%);
    background: var(--text); color: #fff; padding: 12px 22px;
    border-radius: 30px; z-index: 1300; font-size: .95rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
  }
  .loader {
    position: fixed; inset: 0; background: rgba(255,255,255,.55);
    display: flex; align-items: center; justify-content: center; z-index: 1400;
  }
  .spinner {
    width: 44px; height: 44px; border-radius: 50%;
    border: 4px solid #e3d9f3; border-top-color: var(--primary);
    animation: spin .8s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ---------- העלאת תמונות וחותך ---------- */
  .upload-btn {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    background: #efe9f7; color: var(--primary-dark); font-weight: 600;
    border: 1.5px dashed #cdbfe8; border-radius: 10px;
    padding: 10px 16px; margin: 4px 0 10px; margin-inline-end: 8px; font-size: .92rem;
  }
  .upload-btn:hover { filter: brightness(.97); }

  #crop-viewport {
    position: relative; width: 280px; height: 280px; margin: 0 auto 12px;
    overflow: hidden; border-radius: 14px; background: #1c1723;
    touch-action: none; cursor: grab; user-select: none;
  }
  #crop-viewport:active { cursor: grabbing; }
  #crop-img {
    position: absolute; top: 0; left: 0; transform-origin: 0 0;
    max-width: none; pointer-events: none;
  }
  #crop-mask { position: absolute; inset: 0; pointer-events: none; }
  #crop-mask.circle::after {
    content: ''; position: absolute; inset: 8px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.9);
    box-shadow: 0 0 0 400px rgba(20,12,35,.55);
  }
  #crop-mask.square::after {
    content: ''; position: absolute; inset: 8px; border-radius: 12px;
    border: 2px solid rgba(255,255,255,.9);
    box-shadow: 0 0 0 400px rgba(20,12,35,.35);
  }
  input[type=range] { accent-color: var(--primary); }

  /* ---------- כפתורי אייקון קטנים וחיפוש מפה ---------- */
  .btn-icon { padding: 10px 13px; font-size: 1.05rem; flex: 0 0 auto !important; }
  .map-search { display: flex; gap: 8px; margin-bottom: 8px; position: relative; }
  .map-search input { margin-bottom: 0; flex: 1; }
  .map-search .btn { white-space: nowrap; }

  /* מפות: כולא את שכבות ה-z הפנימיות של Leaflet (שמגיעות עד 1000) בתוך המכל,
     כדי שכפתורי הזום והקרדיט לא יצופו מעל חלוניות פתוחות */
  #main-map, #edit-map, #person-view-map { position: relative; z-index: 0; }

  /* רשימת השלמה אוטומטית לחיפוש כתובות */
  .map-suggestions {
    position: absolute; top: 100%; right: 0; left: 0; margin-top: 4px;
    background: #fff; border: 1px solid #e8e2f5; border-radius: 12px;
    box-shadow: 0 8px 22px rgba(0,0,0,.14); z-index: 30;
    max-height: 225px; overflow-y: auto;
  }
  .map-suggestions div { padding: 9px 12px; cursor: pointer; font-size: .9rem; }
  .map-suggestions div:hover { background: var(--bg); }

  /* הודעת תוצאת החיפוש - קבועה מתחת לתיבה ולא טוסט חולף, כי כשהדיוק חלקי
     המשתמש צריך לפעול לפיה (לסמן ידנית) ולא רק להבחין בה לרגע */
  .map-hint { margin: 7px 2px 0; font-size: .86rem; line-height: 1.5; color: var(--muted); }
  /* כפתור "הצגת כולם" שיושב על המפה */
  .map-reset-btn {
    width: 34px; height: 34px; padding: 0; margin: 0;
    background: #fff; border: 2px solid rgba(0,0,0,.2); border-radius: 8px;
    font-size: 1.05rem; line-height: 1; cursor: pointer;
    box-shadow: 0 1px 5px rgba(0,0,0,.2);
  }
  .map-reset-btn:hover { background: #f4f4f4; }

  /* בועה גבוהה נגללת בתוך עצמה במקום להיחתך (Leaflet מוסיף את המחלקה
     leaflet-popup-scrolled כשמעבירים maxHeight) */
  .leaflet-popup-content { margin: 12px 14px; }
  /* צל בקצה שמופיע רק כשיש תוכן מעבר לקיפול. הטריק: שכבות local נגללות עם
     התוכן ומכסות את הצל כשמגיעים לקצה, ושכבות scroll נשארות במקום - כך שהצל
     נעלם לבד בסוף הגלילה ואין צורך במאזין גלילה */
  .leaflet-popup-scrolled {
    overscroll-behavior: contain;
    background:
      linear-gradient(#fff 30%, rgba(255,255,255,0)) top / 100% 22px no-repeat local,
      linear-gradient(rgba(255,255,255,0), #fff 70%) bottom / 100% 22px no-repeat local,
      radial-gradient(farthest-side at 50% 0, rgba(80,60,110,.22), rgba(0,0,0,0)) top / 100% 9px no-repeat scroll,
      radial-gradient(farthest-side at 50% 100%, rgba(80,60,110,.22), rgba(0,0,0,0)) bottom / 100% 9px no-repeat scroll;
  }
  /* קו מפריד בין משפחות - גבול ברור גם כשחלק מהרשימה מתחת לקיפול */
  .map-pop-family { border-top: 1px solid var(--border); padding-top: 7px; }
  .map-pop-family:first-child { border-top: none; padding-top: 0; }

  /* בועת המפה: כמה משפחות באותה כתובת מופרדות לרשימות, כל אחת עם קישור לתיקייה */
  .map-pop-place { color: var(--muted); font-size: .82rem; margin-bottom: 6px; }
  .map-pop-family {
    display: block; font-weight: 700; color: var(--primary);
    text-decoration: none; margin-top: 7px;
  }
  .map-pop-family:first-child { margin-top: 0; }
  .map-pop-names { font-size: .88rem; line-height: 1.5; }

  /* תיבת "גר עם ההורה" - הכתובת נגזרת ולא מוקלדת */
  .place-inherit-box {
    background: var(--bg); border: 1px solid #e8e2f5; border-radius: 12px;
    padding: 11px 13px; font-size: .9rem; line-height: 1.6;
  }
  .place-toggle { margin-top: 8px; }

  .map-hint.warn {
    color: #8a3d05; background: #fff7ed; border: 1px solid #fdd9a8;
    border-radius: 10px; padding: 8px 11px;
  }

  /* ---------- פוטר קרדיט ---------- */
  .site-footer {
    max-width: 1100px; margin: 0 auto; padding: 6px 16px 34px;
    display: flex; align-items: center; justify-content: center; gap: 14px;
    flex-wrap: wrap; color: var(--muted); font-size: .88rem; text-align: center;
  }
  #contact-line { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
  @media (max-width: 640px) {
    /* בטלפון: כל פריט בשורה משלו, ממורכז - במקום שורה אחת שנשברת באמצע */
    .site-footer { flex-direction: column; gap: 10px; padding-top: 14px; }
    #contact-line { flex-direction: column; gap: 6px; }
  }
  .site-footer a { color: var(--primary); }
  .folder-photo { object-fit: cover; padding: 0; }

  /* ---------- התאמה לטלפון ---------- */
  @media (max-width: 640px) {
    .topbar { padding: 8px 10px; gap: 8px; }
    .topbar-title { font-size: .92rem; }
    /* בטלפון: כפתורי הניווט מוצגים כאייקונים בלבד, בלי אימוג'י בכותרת שמתבלבל איתם */
    .nav-link .nav-text { display: none; }
    .nav-link { font-size: 1.25rem; padding: 6px 9px; border-radius: 12px; }
    .title-emoji { display: none; }
    /* טלפון: שורה 1 = כל האייקונים (ניווט + 👤 🚪), שורה 2 = לוגו, שם המשפחה, שלום */
    .topbar-actions { margin-inline-start: auto; gap: 6px; }
    .topbar-actions a, .topbar-actions button.icon-btn { font-size: 1.25rem; padding: 6px 4px; }
    .topbar-second { order: 4; flex-basis: 100%; justify-content: space-between; gap: 8px; }
    .topbar-me { font-size: .8rem; }
    main { padding: 12px 10px 40px; }
    .card { padding: 14px 12px; }
    .stats-row { gap: 8px; }
    .stat { min-width: 70px; padding: 10px 4px; }
    .stat .num { font-size: 1.3rem; }
    #main-map { height: 260px; }
    .people-toolbar { flex-wrap: wrap; }
    .people-toolbar input { flex-basis: 100%; }
    .people-toolbar .btn { flex: 1; padding: 10px 8px; font-size: .9rem; }
    .people-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .person-card { padding: 12px 8px; }
    .person-card .avatar, .person-card .avatar-placeholder { width: 68px !important; height: 68px !important; }
    .folder-card .folder-icon { width: 68px; height: 68px; font-size: 2rem; }
    .modal { padding: 18px 14px; max-height: 94vh; max-height: calc(100dvh - 16px); border-radius: 16px; }
    .modal-backdrop { padding: 8px; }
    #edit-map { height: 180px; }
    .ftree-card .tree-avatar { width: 34px; height: 34px; }
    .ftree-card { min-width: 64px; padding: 5px 6px; }
    .ftree-name { font-size: .72rem; }
    .tree-heart { font-size: .9rem; margin: 0 2px; }
    .users-table { display: block; overflow-x: auto; }
    .diff-table { display: block; overflow-x: auto; }
  }

  /* ==================== פלטפורמה: תוספות ==================== */

  /* כותרת המשפחה בסרגל - קישור למסך המשפחות כשיש יותר מאחת */
  a.topbar-title { text-decoration: none; }
  .switch-hint { color: var(--muted); font-weight: 400; font-size: .9em; }
  .topbar-user button.icon-btn {
    border: none; background: none; cursor: pointer; font-size: 1.1rem; padding: 0; font-family: inherit;
  }

  /* פס מצב: ניסיון / נעולה */
  .status-banner {
    max-width: 1100px; margin: 12px auto 0; padding: 10px 16px; border-radius: 12px;
    font-size: .9rem; line-height: 1.6;
  }
  .status-banner.trial { background: #fff7e0; color: #7a5a00; border: 1px solid #f3dd9a; }
  .status-banner.locked { background: #fdecea; color: #8a2016; border: 1px solid #f3b9b2; }
  .status-banner a { color: inherit; font-weight: 600; }
  @media (max-width: 640px) { .status-banner { margin: 10px 10px 0; } }

  /* תפריט החשבון */
  .menu-list { display: flex; flex-direction: column; gap: 6px; }
  .menu-item {
    display: block; width: 100%; text-align: right; text-decoration: none; cursor: pointer;
    background: var(--bg); color: var(--text); border: 1.5px solid var(--border); border-radius: 12px;
    padding: 11px 14px; font-size: .98rem; font-family: inherit; line-height: 1.4;
  }
  .menu-item small { display: block; color: var(--muted); font-size: .78rem; }
  .menu-item:hover { border-color: var(--primary); }
  .menu-item.danger { color: #b3261e; }

  /* קוד הצטרפות בדף הניהול */
  .join-box { background: var(--bg); border-radius: 12px; padding: 12px 14px; margin-top: 10px; }
  .join-code { font-size: 1.25rem; letter-spacing: 2px; background: #fff; padding: 3px 10px; border-radius: 8px; border: 1px dashed #cdbfe8; direction: ltr; display: inline-block; }
  .join-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  .join-actions .btn { text-decoration: none; }
  .danger-zone { margin-top: 16px; border: 1.5px solid #f3b9b2; border-radius: 12px; padding: 10px 14px; }
  .danger-zone summary { cursor: pointer; color: #b3261e; font-weight: 600; }
  .danger-zone p { font-size: .88rem; color: var(--muted); margin: 8px 0; }

  /* ---------- מסך המשפחות שלי ---------- */
  .fam-wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 60px; }
  /* בטלפון הכותרת, האימייל והכפתורים לא נכנסים בשורה אחת - הכותרת נשארת שלמה והשאר יורד לשורה הבאה
     (בלי wrap הכפתורים ברחו מחוץ למסך והכותרת נשברה לשתי שורות) */
  .fam-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 18px; }
  .fam-head h1 { font-size: 1.4rem; color: var(--primary-dark); flex: 1 1 auto; white-space: nowrap; }
  .fam-list { display: grid; gap: 12px; margin-bottom: 20px; }
  .fam-card {
    display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px 18px; border: 2px solid transparent; text-align: right;
    cursor: pointer; font-family: inherit; font-size: 1rem; width: 100%;
  }
  .fam-card:hover { border-color: var(--primary); }
  .fam-card.pending { cursor: default; opacity: .8; }
  .fam-card .fam-emoji { font-size: 2rem; }
  .fam-card .fam-name { font-weight: 700; }
  .fam-card .fam-sub { font-size: .82rem; color: var(--muted); }
  .fam-card .fam-go { margin-inline-start: auto; color: var(--primary); font-size: 1.3rem; }
  .fam-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  @media (max-width: 560px) { .fam-actions { grid-template-columns: 1fr; } }
  .emoji-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
  .emoji-row button {
    font-size: 1.4rem; background: var(--bg); border: 2px solid transparent; border-radius: 10px;
    padding: 4px 8px; cursor: pointer;
  }
  .emoji-row button.sel { border-color: var(--primary); background: #efe9f7; }

  /* ---------- דף הנחיתה ---------- */
  .landing { background: var(--bg); color: var(--text); }
  .l-header {
    display: flex; align-items: center; gap: 14px; padding: 14px 22px; background: var(--card);
    box-shadow: var(--shadow); position: sticky; top: 0; z-index: 50; flex-wrap: wrap;
  }
  .l-brand { font-weight: 800; font-size: 1.25rem; color: var(--primary-dark); text-decoration: none; }
  .l-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-inline-start: auto; }
  .l-nav a { text-decoration: none; color: var(--primary-dark); padding: 8px 12px; border-radius: 10px; font-size: .95rem; font-weight: 500; }
  .l-nav a.btn { color: #fff; font-weight: 600; }
  .l-nav a:hover { background: #efe9f7; color: var(--primary-dark); }
  .l-nav .btn { padding: 8px 16px; }
  .l-section { max-width: 1060px; margin: 0 auto; padding: 56px 20px; }
  .l-section h2 { font-size: 1.7rem; color: var(--primary-dark); text-align: center; margin-bottom: 8px; }
  .l-section .l-sub { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 30px; line-height: 1.7; }
  .l-hero {
    background: linear-gradient(145deg, #6c4db0 0%, #7c5cbf 60%, #8a6ac8 140%); color: #fff;   /* נגישות: טקסט לבן 4.5:1 לפחות בכל נקודה (הגרסה הבהירה/זהובה נתנה 2.1-2.6:1) */
    padding: 70px 20px 60px; text-align: center;
  }
  .l-hero h1 { font-size: 2.5rem; line-height: 1.25; margin-bottom: 14px; }
  .l-hero p { font-size: 1.2rem; max-width: 640px; margin: 0 auto 26px; line-height: 1.7; }
  .l-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
  .l-cta .btn { font-size: 1.1rem; padding: 14px 26px; text-decoration: none; }
  .btn-gold { background: var(--gold); color: #3a2d00; font-weight: 700; }
  .btn-ghost { background: rgba(0,0,0,.15); color: #fff; border: 1.5px solid rgba(255,255,255,.6); }
  .l-note { font-size: .9rem; margin-top: 14px; }

  .l-demo-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start; }
  @media (max-width: 800px) { .l-demo-grid { grid-template-columns: 1fr; } }
  .l-demo .card { margin-bottom: 18px; }
  .l-demo .ftree { display: block; min-width: 0; overflow-x: auto; padding-bottom: 6px; }
  .l-demo .ftree-card, .l-demo .bday-row { cursor: pointer; }
  /* שורות האירועים בדוגמה הן <button> (נגישות מקלדת) - נראות כמו השורות באפליקציה */
  .l-demo button.bday-row { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--border); font: inherit; color: inherit; }
  .l-demo button.bday-row:last-child { border-bottom: 0; }
  .l-demo-caption { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 4px; }
  /* ילדי grid/flex מקבלים min-width:auto ולכן שורת אירוע ארוכה הרחיבה את הכרטיס מעבר לעמודה */
  .l-demo-grid > div, .l-demo .card { min-width: 0; }
  /* רק עמודת הטקסט (הילד השני, אחרי האווטאר/האייקון) נמתחת - לא האייקון. והדמו יושב בתוך
     סעיף ממורכז, אז השורות חוזרות ליישור להתחלה כמו באפליקציה */
  .l-demo .bday-row { text-align: start; }
  .l-demo .bday-row > :nth-child(2) { min-width: 0; flex: 1; }
  @media (max-width: 640px) {
    .l-section { padding: 40px 12px; }
    .l-hero { padding: 50px 16px 44px; }
    .l-hero h1 { font-size: 1.9rem; }
    .l-hero p { font-size: 1.05rem; }
  }
  .l-demo-phone {
    border: 10px solid #2b2333; border-radius: 30px; padding: 12px; background: var(--bg);
    max-width: 330px; margin: 0 auto; box-shadow: 0 12px 30px rgba(40,30,60,.25);
  }
  .l-demo-phone .detail-grid { font-size: .88rem; }

  .l-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
  .l-feature { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
  .l-feature .ico { font-size: 2rem; margin-bottom: 8px; }
  .l-feature h3 { font-size: 1.05rem; margin-bottom: 6px; color: var(--primary-dark); }
  .l-feature p { font-size: .9rem; color: var(--muted); line-height: 1.6; }

  .l-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; counter-reset: step; }
  .l-step { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 20px 20px; position: relative; }
  .l-step::before {
    counter-increment: step; content: counter(step);
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; margin-bottom: 10px;
  }
  .l-step h3 { font-size: 1.05rem; margin-bottom: 6px; }
  .l-step p { font-size: .9rem; color: var(--muted); line-height: 1.6; }

  .l-privacy { background: #efe9f7; }
  .l-privacy ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
  .l-privacy li { background: var(--card); border-radius: 12px; padding: 14px 16px; line-height: 1.6; font-size: .95rem; }
  .l-privacy li b { color: var(--primary-dark); }

  .l-faq details { background: var(--card); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
  .l-faq summary { cursor: pointer; font-weight: 600; }
  .l-faq p { margin-top: 8px; color: var(--muted); line-height: 1.7; font-size: .95rem; }

  .l-start .auth-card { max-width: 460px; margin: 0 auto; text-align: right; }
  .l-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
  .l-tabs button {
    flex: 1; border: none; background: var(--bg); color: var(--muted); border-radius: 10px;
    padding: 10px 6px; font-family: inherit; font-size: .92rem; cursor: pointer; font-weight: 600;
  }
  .l-tabs button.active { background: var(--primary); color: #fff; }
  .l-terms { display: flex; gap: 8px; align-items: flex-start; font-size: .85rem; color: var(--muted); margin: 6px 0 12px; line-height: 1.5; }
  .l-terms input { width: auto; margin: 3px 0 0; }
  .l-terms a { color: var(--primary); }
  .ok-msg { margin-top: 14px; padding: 10px; border-radius: 10px; background: #eaf6ec; color: #2e7d43; font-size: .9rem; }

  .l-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 26px 16px 40px; line-height: 1.9; }
  .l-footer a:not(.btn) { color: var(--primary); }

  /* ---------- דפים משפטיים ---------- */
  .legal { max-width: 820px; margin: 0 auto; padding: 30px 20px 60px; line-height: 1.8; }
  .legal h1 { color: var(--primary-dark); font-size: 1.6rem; margin-bottom: 4px; }
  .legal .updated { color: var(--muted); font-size: .85rem; margin-bottom: 22px; }
  .legal h2 { font-size: 1.15rem; margin: 26px 0 8px; }
  .legal ul { padding-inline-start: 22px; margin-bottom: 8px; }
  .legal p { margin-bottom: 10px; }
  .legal .box { background: #efe9f7; border-radius: 12px; padding: 12px 16px; margin: 12px 0; }

  /* ---------- ניהול הפלטפורמה ---------- */
  .plat-table { width: 100%; font-size: .88rem; border-collapse: collapse; }
  .plat-table th, .plat-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: top; }
  .plat-table input, .plat-table select { width: auto; margin: 0; padding: 5px 8px; font-size: .85rem; }
  .plat-table .plan-active { color: #2e7d43; font-weight: 600; }
  .plat-table .plan-locked { color: #b3261e; font-weight: 600; }
  .plat-wrap { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
  .plat-wrap .stats-row { margin-bottom: 16px; }
  /* ---------- דפי כניסה/הרשמה נפרדים ---------- */
  .auth-brand { display: block; text-decoration: none; color: var(--primary-dark); font-weight: 800; font-size: 1.3rem; margin-bottom: 6px; }
  .auth-card-wide { max-width: 470px; text-align: right; }
  .auth-card-wide h1, .auth-card-wide .auth-brand, .auth-card-wide .auth-switch { text-align: center; }
  .auth-intro { font-size: .9rem; color: var(--muted); line-height: 1.6; margin-bottom: 14px; text-align: center; }
  .auth-card .form-row { text-align: right; }
  .l-hero-bottom { padding: 50px 20px; }
  .l-hero-bottom h2 { font-size: 1.8rem; margin-bottom: 8px; color: #fff; }
  /* מסך בינוני (טאבלט/חלון צר): הניווט באייקונים בלבד, כדי שהכל יישאר בשורה אחת */
  @media (max-width: 960px) {
    .nav-link .nav-text { display: none; }
    .nav-link { font-size: 1.2rem; padding: 6px 9px; border-radius: 12px; }
    .title-emoji { display: none; }
  }

  /* ---------- כרטיסים מתקפלים (ניהול, המשפחות שלי) ---------- */
  details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
  details.fold > summary::-webkit-details-marker { display: none; }
  details.fold > summary::before { content: '▸'; color: var(--primary); font-size: 1.1rem; transition: transform .15s; }
  details.fold[open] > summary::before { transform: rotate(-90deg); }
  details.fold > summary h2 { margin: 0; }
  details.fold[open] > summary { margin-bottom: 12px; }
  details.fold > summary:hover h2 { color: var(--primary); }

  /* ---------- טופס אירוע: סוגים עם אייקון, בן משפחה מקושר ---------- */
  .event-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-bottom: 12px; }
  .event-type {
    display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: inherit; font-size: .76rem;
    background: var(--bg); border: 2px solid transparent; border-radius: 10px; padding: 6px 4px; cursor: pointer; color: var(--text);
  }
  .event-type span { font-size: 1.5rem; line-height: 1.1; }
  .event-type.sel { border-color: var(--primary); background: #efe9f7; font-weight: 600; }
  .linked-chip { display: inline-flex; align-items: center; gap: 8px; background: #efe9f7; border-radius: 20px; padding: 4px 12px 4px 4px; font-weight: 600; }
  .linked-chip .avatar, .linked-chip .avatar-placeholder { margin: 0; }

  .heb-preview { font-size: .85rem; color: var(--primary-dark); min-height: 1.2em; margin: -6px 0 8px; }

  /* ---------- לוגו משפחה ---------- */
  .topbar-logo { width: 28px; height: 28px; border-radius: 7px; object-fit: cover; vertical-align: middle; }
  .fam-card .fam-logo { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
  .logo-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
  .logo-preview { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; border: 2px solid var(--border); }
  .logo-ph { display: flex; align-items: center; justify-content: center; font-size: 2rem; background: var(--bg); }
  .logo-row .upload-btn { margin: 0 0 6px; }
  /* דף הנחיתה בטלפון: שורה אחת בכותרת - לוגו, כניסה, ניסיון. קישורי הסעיפים מיותרים שם */
  @media (max-width: 640px) {
    .l-header { padding: 10px 12px; gap: 8px; flex-wrap: nowrap; }
    .l-brand { font-size: 1.05rem; white-space: nowrap; }
    .l-nav { gap: 2px; flex-wrap: nowrap; }
    .l-nav a:not(.btn):not(.l-nav-keep) { display: none; }
    .l-nav a { padding: 8px 10px; font-size: .9rem; white-space: nowrap; }
    .l-nav .btn { padding: 8px 12px; font-size: .9rem; }
    .l-cta .btn { width: 100%; font-size: 1rem; padding: 13px 16px; }
    .l-section h2 { font-size: 1.45rem; }
  }
  /* קפיצה לסעיף מתחת לכותרת הדביקה, לא מאחוריה */
  /* לסעיף יש 56px ריווח עליון משלו, אז 30px מספיקים כדי שהכותרת תנחת מתחת לפס העליון (64px) */
  html { scroll-behavior: smooth; scroll-padding-top: 30px; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  }

  /* תחתית דפי הכניסה: כפתורים במקום קישורים בשורה */
  .auth-forgot { font-size: .8rem; margin-top: 10px; }
  .auth-alt { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
  .auth-alt-title { color: var(--muted); font-size: .9rem; text-align: center; margin-bottom: 2px; line-height: 1.5; }
  a.btn-block { display: block; text-align: center; text-decoration: none; }
  /* מבנה העץ בדף הניהול: כרטיסים לא מקושרים */
  .orphan-list { display: flex; flex-direction: column; gap: 6px; }
  .orphan-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--bg); border-radius: 10px; padding: 8px 10px; }
  .orphan-row .orphan-name { flex: 1 1 180px; font-weight: 600; font-size: .92rem; }
  .orphan-row select { flex: 2 1 200px; margin: 0; padding: 6px 8px; font-size: .9rem; }
  /* בחירת שדות בדף הניהול */
  .fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
  .field-toggle { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: .92rem; cursor: pointer; }
  .field-toggle input { width: auto; margin: 0; accent-color: var(--primary); }
  /* כפתורי יצירת קשר (וואטסאפ ירוק) */
  .contact-btns { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: center; vertical-align: middle; margin: 4px 0; }
  .contact-btns .btn { text-decoration: none; }
  .btn-wa { background: #25d366; color: #0b3d20; font-weight: 600; }   /* לבן על ירוק וואטסאפ = 2:1; ירוק כהה = 6.2:1 */
  .l-operator { color: var(--text); }
  /* ---------- מחירים ---------- */
  .price-promo { background: #fff7e0; border: 1px solid #f3dd9a; color: #7a5a00; border-radius: 12px; padding: 12px 16px; text-align: center; font-weight: 600; margin: 0 auto 22px; max-width: 640px; }
  .price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: stretch; }
  .price-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 20px; text-align: center; display: flex; flex-direction: column; border: 2px solid transparent; }
  .price-card.featured { border-color: var(--primary); }
  .price-name { font-weight: 800; font-size: 1.15rem; color: var(--primary-dark); }
  .price-desc { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
  .price-main { font-size: 2.2rem; font-weight: 800; color: var(--primary); }
  .price-main small { font-size: .95rem; color: var(--muted); font-weight: 500; }
  .price-alt { font-size: .92rem; margin: 4px 0 14px; }
  .price-alt span { color: var(--gold-text); font-weight: 600; }
  .price-feats { list-style: none; text-align: right; font-size: .88rem; color: var(--text); margin: 0 0 16px; flex: 1; }
  .price-feats li { padding: 4px 0; border-bottom: 1px solid var(--border); }
  .price-feats li::before { content: '✓ '; color: #2e7d43; font-weight: 700; }
  /* "מחובר כרגע" בדפי ההרשמה */
  .logged-notice { background: #fff7e0; border: 1px solid #f3dd9a; color: #5a4300; border-radius: 12px; padding: 10px 12px; font-size: .9rem; line-height: 1.6; margin-bottom: 14px; text-align: right; }
  .logged-notice .join-actions .btn { text-decoration: none; }
