/* src/app/dan/resident.css — האזור האישי (בית): העיצוב של דן, מועתק.
 * מקור: legacy/community/resident.html (`#panel-home` — ה-`<style>` של הדף, רק מה שהבית משתמש בו)
 *       + legacy/community/assets/js/announcement-format.js (ה-CSS שהמעצב מזריק: `kd-ann*` · הקיצוץ "קראו עוד").
 * מסך: src/app/screens/home.js — עוטף את עצמו ב-`<div class="dan dan-home">`. חיווט: src/app/home-mount.js.
 * הנוהל: docs/runbooks/dan-design-port.md · הפלטה (`--d-*`): src/app/dan/dan.css.
 *
 * 🔴 01.10 · גיל: "תעתיק גם את הלוגיקה והפונקציונליות בדף וגם את העיצוב של כל המסכים, פשוט העתקה ממקום למקום. שיהיה אחד לאחד".
 *
 * ⚠️ **מה שונה מהמקור, ולמה — חמישה דברים בלבד (כל השאר: הכללים, הערות הטעם והמספרים של דן):**
 *  ① **קידומת לכל סלקטור** — `.dan-home`. **אין `:root`** (tokens.css הוא ההצהרה היחידה): `var(--green)` ⟶ `var(--d-green)`.
 *     אין `*`/`body`/`main`/`header`/`aside` — המעטפת של עגור (הכותרת העליונה והסרגל הם `packages/ui/shell`).
 *  ② **מחלקות שמתנגשות עם packages/ui/kit.css — שם מקומי:** `card`→`dcard` · `tag`→`dtag` · `chip`→`dchip` · `empty`→`dempty`.
 *  ③ **@container ולא @media** — הרוחב תלוי במעטפת (סרגל פתוח/סגור): `@container dhome` על המכל. נקודת השבירה היחידה של הבית
 *     (`@media (max-width:1100px){ .events{1fr} }` בדן) ⟶ 720px של המכל.
 *  ④ **AA (4.5:1, `ui-a11y`):** `.ev.hl .date b` — `--orange` (#E07A3F) על לבן הוא 2.99:1 ⟶ `--d-orange-ink` (5.27); `.foot` — `#9AA39B` על
 *     רקע הדף הוא 2.26:1 ⟶ `--d-faint`. `--d-faint`/`--d-muted` כבר מוכהים ב-dan.css.
 *  ⑤ **תוספות של עגור** — מה שהמעטפת/הנתונים שלנו דורשים ולדן אין: כרטיסי "הפניות שלי" · "הילדים שלי" · "העוזר" · "הפרטים שלי"
 *     (בדן — פאנלים נפרדים בסרגל; כאן נשארו בדף הבית, מעוצבים באותו אוצר מילים: `.reqrow` · `.st` · `.qbtn` · `.pay`), שורת "בקשת הדיור שלי"
 *     (בדן — `style=""` מוטבע; כאן מחלקות), וטבעת מיקוד (ui-keyboard). והסטפר של הבקשה (`.kd-stepper*`) — ב-journey-stepper.js של דן זה CSS שמוזרק בזמן ריצה; כאן קובץ, תחום ל-`.dan-home`,
 *     `.st` ⟶ `.stp` (התנגשות עם גלולת הסטטוס שלנו) וצבע התחנה שטרם הושגה — ראו ההערה בסעיף הסטפר.
 */

/* ══ המכל ══ */
.dan-home { container: dhome / inline-size; display: flex; flex-direction: column; gap: 20px; color: var(--d-text); }
.dan-home *, .dan-home *::before, .dan-home *::after { box-sizing: border-box; }
.dan-home p { margin: 0; }
.dan-home a { color: var(--d-green); text-decoration: none; }
.dan-home a:hover { color: var(--d-orange-ink); }
.dan-home :is(a, button):focus-visible { outline: 2px solid var(--d-green); outline-offset: 2px; }

/* ══ שלום + תגיות ══ */
.dan-home .hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.dan-home h1 { font-size: 30px; font-weight: 600; color: var(--d-ink); letter-spacing: -.02em; margin: 0 0 6px; }
.dan-home .tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dan-home .dtag { font-size: 15px; font-weight: 500; color: var(--d-green-dark); background: var(--d-mint); border-radius: 999px; padding: 6px 14px; }
.dan-home .place { font-size: 15px; color: var(--d-muted); }

/* ══ הכרטיס ══ */
.dan-home .dcard { background: #fff; border-radius: 22px; padding: 26px 28px; box-shadow: var(--d-shadow); display: flex; flex-direction: column; gap: 18px; }
.dan-home .dcard h2 { font-size: 20px; font-weight: 600; color: var(--d-ink); margin: 0; }
.dan-home .cardhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dan-home .cardhead a { font-size: 15px; }
.dan-home .dempty { font-size: 15px; color: var(--d-faint); line-height: 1.6; padding: 6px 0; }
.dan-home .dempty b { color: var(--d-muted); font-weight: 500; }

/* ══ אירועים קרובים ══ */
.dan-home .events { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.dan-home .ev { display: flex; gap: 16px; align-items: center; background: var(--d-cream2); border-radius: 16px; padding: 16px 18px; }
.dan-home .ev.hl { background: var(--d-orange-soft); }
.dan-home .ev .date { width: 62px; flex: none; background: #fff; border-radius: 12px; padding: 8px 0; text-align: center; }
.dan-home .ev .date b { display: block; font-size: 22px; font-weight: 600; color: var(--d-green); line-height: 1.1; }
.dan-home .ev .date span { font-size: 13px; color: var(--d-faint); }
.dan-home .ev.hl .date b { color: var(--d-orange-ink); }
.dan-home .ev.hl .date span { color: var(--d-orange-ink); }
.dan-home .ev .txt { min-width: 0; text-align: start; }
.dan-home .ev .n { font-size: 17px; font-weight: 500; overflow-wrap: anywhere; }
.dan-home .ev .s { font-size: 14.5px; color: var(--d-muted); }
.dan-home .ev.hl .s { color: var(--d-orange-ink); }
.dan-home .ev .tagrow { margin: 5px 0 2px; }
/* בדן העטיפה אינה מצוירת כשאין מה להראות (resident.html:1110); כאן היא תמיד קיימת — חריץ ל-"✓ נרשמתם" שמגיע ברקע (home-mount.js) — ולכן ריקה ⟹ בלי שוליים. `insertAdjacentHTML` מוסיף ילד, ו-:empty מפסיק להתאים. */
.dan-home .ev .tagrow:empty { display: none; }
/* כותרת-ביניים ברשימת האירועים: "לכל הקיבוץ" מול "הבתים של הילדים". פורשת על שתי העמודות של .events,
   אחרת היא הייתה יושבת כתא בגריד ודוחפת כרטיס לשורה הבאה. */
.dan-home .evgroup { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.dan-home .evgroup:first-child { margin-top: 0; }
.dan-home .evgroup b { font-size: 14.5px; font-weight: 600; color: var(--d-muted); }
.dan-home .evgroup i { flex: 1; height: 1px; background: #E7EDE8; }
.dan-home .dchip { display: inline-block; font-size: 13px; font-weight: 500; color: var(--d-green-dark); background: var(--d-mint); border-radius: 999px; padding: 3px 10px; margin-inline-end: 6px; }
.dan-home .ev.hl .dchip { background: #fff; color: var(--d-orange-ink); }
.dan-home .evcard { cursor: pointer; transition: .15s; border: 1px solid transparent; color: inherit; }
.dan-home .evcard:hover { border-color: var(--d-green-mid); color: inherit; }
.dan-home .regtag { font-size: 12.5px; font-weight: 600; background: var(--d-green); color: #fff; border-radius: 999px; padding: 3px 11px; margin-inline-end: 6px; }
.dan-home .regtag.mine { background: var(--d-mint); color: var(--d-green-dark); }
.dan-home .ev.hl .regtag.mine { background: #fff; }
.dan-home .deadline { font-size: 13.5px; font-weight: 500; border-radius: 999px; padding: 5px 13px; background: var(--d-orange-soft); color: var(--d-orange-ink); white-space: nowrap; margin-inline-end: 6px; }
.dan-home .ev.hl .deadline { background: #fff; }
.dan-home .deadline.calm { background: #F3F1E9; color: #5F6B64; }

/* ══ הנכסים שלי ("הבית שלי" בדן) — מצב, לא פיד ══
   כרטיס "הבית שלי". ⚠️ אינו .ev ואינו .tag — הוא היחיד בדף שאינו פיד אלא **מצב**: לא משהו שקרה, אלא משהו שנכון עכשיו. */
.dan-home .homelist { display: flex; flex-direction: column; gap: 14px; }
.dan-home .home { border: 1px solid var(--d-line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 7px; }
.dan-home .home .hn { font-size: 17px; font-weight: 600; color: var(--d-ink); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dan-home .home .hn .dchip { font-size: 12.5px; margin: 0; }
.dan-home .home .hl { font-size: 14.5px; color: var(--d-faint); line-height: 1.5; }
.dan-home .home .note { font-size: 14.5px; border-radius: 10px; padding: 10px 12px; line-height: 1.55; background: var(--d-orange-soft); color: var(--d-orange-ink); }
.dan-home .home .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; }
.dan-home .qbtn { font-family: inherit; font-size: 15.5px; font-weight: 500; color: var(--d-green); background: #fff; border: 1px solid #D8E3DA; border-radius: 999px; padding: 12px 20px; cursor: pointer; display: inline-block; }
.dan-home .qbtn:hover { background: #F4F8F5; color: var(--d-green); }
.dan-home .qbtn.ghost { color: var(--d-muted); border-color: var(--d-line-soft); }
.dan-home .qbtn.ghost:hover { background: #FAF8F3; color: var(--d-ink); }
.dan-home .home .acts .qbtn { font-size: 14.5px; padding: 9px 18px; }
.dan-home .pay { font-family: inherit; font-size: 16px; font-weight: 600; color: #fff; background: var(--d-green); border: 0; border-radius: 999px; padding: 13px 28px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(14, 122, 85, .24); display: inline-block; }
.dan-home .pay:hover { background: var(--d-green-dark); color: #fff; }

/* ══ בקשת הדיור שלי — ב-resident.html `style=""` מוטבע על `#appBody`; כאן מחלקות ══ */
.dan-home .apphead { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.dan-home .apphead b { font-size: 17px; color: var(--d-text); }
.dan-home .apphead b.tone-approved { color: var(--d-green-dark); }
.dan-home .apphead b.tone-rejected { color: #8A3B3B; }
.dan-home .apphead b.tone-returned_to_applicant { color: var(--d-orange-ink); }
.dan-home .apphead .s { font-size: 15px; color: var(--d-muted); }
.dan-home .appnote { font-size: 15px; color: var(--d-muted); margin-top: 8px; }
.dan-home .appnote.warn { color: var(--d-orange-ink); }

/* הסטפר של הבקשה — `journey-stepper.js` של דן (`.kd-stepper*`, מוזרק שם בזמן ריצה), תחום ל-`.dan-home`.
   ⚠️ `.st` ⟶ `.stp`: `.dan-home .st` כאן הוא גלולת הסטטוס של "הפניות שלי" (padding · flex:none), והסטפר היה יורש אותה.
   ⚠️ צבע התחנה שטרם הושגה: ב-journey-stepper.js — `var(--cream-2,#e9e4d8)`; בעמוד של דן `--cream-2` מוגדר (#FBF8F1 — כמעט לבן על לבן) ולכן הנקודות והקו נעלמים. ה-fallback הוא הכוונה
   של המעצב (#e9e4d8) ⟹ `--d-line` (#ECE7DA). */
.dan-home .kd-stepper { display: flex; align-items: flex-start; margin: 8px 0 4px; direction: rtl; }
.dan-home .kd-stepper .stp { flex: 1; min-width: 0; text-align: center; position: relative; font-size: 12px; line-height: 1.25; color: var(--d-muted); padding: 0 2px; }
.dan-home .kd-stepper .stp i { display: block; width: 14px; height: 14px; border-radius: 50%; margin: 0 auto 5px; background: var(--d-line); border: 2px solid var(--d-line); box-sizing: border-box; position: relative; z-index: 1; }
.dan-home .kd-stepper .stp:not(:last-child)::after { content: ""; position: absolute; top: 6px; right: 50%; width: 100%; height: 2px; background: var(--d-line); }
.dan-home .kd-stepper .stp.done i { background: var(--d-green); border-color: var(--d-green); }
.dan-home .kd-stepper .stp.done::after { background: var(--d-green); }
.dan-home .kd-stepper .stp.now i { background: #fff; border-color: var(--d-green); box-shadow: 0 0 0 3px rgba(47, 107, 79, .18); }
.dan-home .kd-stepper .stp.now { color: var(--d-ink); font-weight: 600; }
.dan-home .kd-stepper .stp.neg i { background: #c2410c; border-color: #c2410c; }
.dan-home .kd-stepper .stp.neg { color: #8A3B3B; font-weight: 600; }
.dan-home .kd-stepper.compact .stp { font-size: 11px; }
.dan-home .kd-stepper.compact .stp i { width: 11px; height: 11px; }
.dan-home .kd-stepper-note { font-size: 12.5px; color: var(--d-muted); margin: 2px 0 6px; }
.dan-home .kd-stepper-note b { color: var(--d-ink); font-weight: 600; }

/* ══ הודעות מהמזכירות ══ */
.dan-home .news .newslist { display: flex; flex-direction: column; gap: 14px; }
.dan-home .news .item { display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid #F4F1E7; padding-bottom: 14px; }
.dan-home .news .item:last-child { border-bottom: 0; padding-bottom: 0; }
.dan-home .news .n { font-size: 17px; font-weight: 500; }
.dan-home .news .s { font-size: 15px; color: var(--d-muted); line-height: 1.55; }
.dan-home .news .item .d { font-size: 13px; color: var(--d-faint); }
.dan-home .news .item .img { display: block; width: 100%; aspect-ratio: 16 / 6; object-fit: cover; border-radius: 10px; margin-top: 2px; }
.dan-home .newshead { display: flex; align-items: baseline; gap: 10px; }
.dan-home .newshead .n { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* כפתור ההסתרה שיושב על פריט בפיד. קטן, אפור — הוא חייב להיות שם תמיד (אחרת אף אחד לא יגלה אותו) ולא למשוך את העין מהתוכן. */
.dan-home .hidebtn { font-family: inherit; font-size: 13px; color: var(--d-faint); background: none; border: 0; cursor: pointer; padding: 2px 6px; border-radius: 8px; align-self: flex-start; }
.dan-home .hidebtn:hover { background: #F3F1E9; color: var(--d-ink); }
.dan-home .hidebtn:disabled { opacity: .55; cursor: wait; }
.dan-home .newsmore { margin-top: 12px; }
.dan-home .newsmore .morebtn { width: 100%; font-family: inherit; font-size: 15px; font-weight: 500; color: var(--d-green); background: #fff; border: 1px solid #D8E3DA; border-radius: 999px; padding: 11px 20px; cursor: pointer; }
.dan-home .newsmore .morebtn:hover { background: #F4F8F5; }
.dan-home .newsmore .morebtn:disabled { opacity: .6; cursor: wait; }

/* מעצב ההודעות — `kd-ann*`: ב-announcement-format.js של דן זה CSS שמוזרק בזמן ריצה; כאן הוא קובץ, ותחום ל-`.dan-home` (כמו ב-announcements.css). */
.dan-home .kd-ann { font-size: 15px; line-height: 1.6; color: var(--d-text); display: flex; flex-direction: column; gap: 12px; }
.dan-home .kd-ann > :first-child { margin-top: 0; }
.dan-home .kd-ann-p { margin: 0; color: var(--d-muted); }
.dan-home .kd-ann strong { color: var(--d-ink); font-weight: 600; }
.dan-home .kd-ann-head { margin: 2px 0 -4px; font-size: 15.5px; font-weight: 600; color: var(--d-ink); letter-spacing: normal; line-height: 1.6; }
.dan-home .kd-ann-facts { margin: 0; display: flex; flex-direction: column; gap: 7px; background: var(--d-mint); border-radius: 14px; padding: 13px 16px; border: 1px solid #D6EADF; }
.dan-home .kd-ann-facts > div { display: flex; gap: 10px; align-items: baseline; }
.dan-home .kd-ann-facts dt { flex: none; min-width: 64px; font-size: 13.5px; font-weight: 600; color: var(--d-green-dark); }
.dan-home .kd-ann-facts dd { margin: 0; font-size: 15px; font-weight: 500; color: var(--d-ink); }
.dan-home .kd-ann-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.dan-home .kd-ann-list li { display: flex; gap: 9px; align-items: baseline; color: var(--d-muted); padding-inline-start: calc(var(--d, 0) * 20px); }
.dan-home .kd-ann-m { flex: none; font-weight: 600; color: var(--d-green); font-size: 14px; min-width: 22px; }
.dan-home .kd-ann-sign { border-top: 1px solid var(--d-line-soft); padding-top: 10px; font-size: 14px; color: var(--d-faint); }
/* הקיצוץ: הזימון המלא הוא ~20 שורות, ושש הודעות כאלה הן קיר. נחתך הגובה, ורק אם באמת חרג (clampAnnouncement ב-home-mount.js). */
.dan-home .kd-ann-wrap { display: flex; flex-direction: column; gap: 3px; }
.dan-home .kd-ann-clip { position: relative; max-height: 190px; overflow: hidden; }
.dan-home .kd-ann-clip::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 64px; pointer-events: none; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff); }
.dan-home .kd-ann-more { align-self: flex-start; font-family: inherit; font-size: 14px; font-weight: 500; color: var(--d-green); background: none; border: 0; padding: 4px 0; cursor: pointer; }
.dan-home .kd-ann-more:hover { color: var(--d-orange-ink); }

/* ══ תוספות של עגור — "הפניות שלי" · "הילדים שלי" ══
   שורה ברשימה: כמו `.reqrow` של פאנל הפניות בדן; הגלולה — `.st` של דן (`work` ירוק · `wait` כתום · `done` אפור). */
.dan-home .cnt { font-size: 15px; color: var(--d-muted); }
.dan-home .reqlist { display: flex; flex-direction: column; }
.dan-home .reqrow { display: flex; align-items: center; gap: 14px; padding: 15px 4px; border-bottom: 1px solid var(--d-line-soft); text-align: start; width: 100%; color: inherit; }
.dan-home .reqrow:last-child { border-bottom: 0; }
.dan-home a.reqrow:hover { background: #FAFBFA; color: inherit; }
.dan-home .reqrow .rt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dan-home .reqrow .n { font-size: 16.5px; font-weight: 500; color: var(--d-text); overflow-wrap: anywhere; }
.dan-home .reqrow .s { font-size: 14px; color: var(--d-faint); }
.dan-home .st { font-size: 14px; font-weight: 500; border-radius: 999px; padding: 5px 12px; flex: none; }
.dan-home .st.work { color: var(--d-green-dark); background: var(--d-mint); }
.dan-home .st.wait { color: var(--d-orange-ink); background: var(--d-orange-soft); }
.dan-home .st.done { color: #5F6B64; background: #F3F1E9; }
.dan-home .cardfoot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dan-home .cardnote { font-size: 14px; color: var(--d-faint); line-height: 1.5; }

/* ══ רגל הדף ══ (בדן: טלפון המשרד ושעותיו, קבועים בקוד — כאן קישור לשעות הפתיחה של הקהילה) */
.dan-home .foot { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--d-faint); font-size: 14px; padding-top: 6px; flex-wrap: wrap; }
/* ⚠️ אותה מחלת bidi של דן: רצף ספרות ומקף בתוך פסקה RTL מתהפך. מחלקה אחת, ולא נקודתיות. */
.dan-home .rng { direction: ltr; unicode-bidi: plaintext; display: inline-block; }

/* ══ שבירות ══ */
@container dhome (max-width: 720px) {
  .dan-home .events { grid-template-columns: 1fr; }
  .dan-home .dcard { padding: 22px 20px; }
  .dan-home h1 { font-size: 26px; }
}
