/* ==========================================================================
   Kadisha Obituary Builder
   ========================================================================== */

:root {
    --ko-burgundy: #6B2D2D;
    --ko-burgundy-dark: #4A1E1E;
    --ko-gold: #B08B4F;
    --ko-gold-light: #D4B878;
    --ko-cream: #F7F2E9;
    --ko-ink: #2a1a1a;
    --ko-muted: #6b5a4f;
    --ko-line: rgba(176, 139, 79, 0.22);
}

.kadisha-obit-page {
    direction: rtl;
    background: #fbf9f4;
    color: var(--ko-ink);
    font-family: 'Assistant', 'Frank Ruhl Libre', Arial, sans-serif;
}

.kadisha-container { max-width: 1300px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Hero ---------- */
.kadisha-obit-header {
    padding: 3.5rem 0 2rem;
    background: linear-gradient(135deg, var(--ko-burgundy-dark), var(--ko-burgundy));
    color: var(--ko-cream);
    text-align: center;
}
.kadisha-obit-eyebrow {
    display: inline-block; font-size: 0.85rem; letter-spacing: 0.2em;
    color: var(--ko-gold-light); margin-bottom: 0.6rem;
}
.kadisha-obit-title {
    font-family: 'Frank Ruhl Libre', serif; font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 500; margin: 0 0 0.5rem; color: var(--ko-cream);
}
.kadisha-obit-lede {
    max-width: 760px; margin: 0 auto; font-size: 1.05rem; line-height: 1.7;
    color: rgba(247, 242, 233, 0.92);
}

/* ---------- Layout ---------- */
.kadisha-obit-section { padding: 2.5rem 0 4rem; }
.kadisha-obit-layout {
    display: grid;
    grid-template-columns: minmax(320px, 380px) 1fr;
    gap: 2rem;
    align-items: start;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1.25rem;
}
@media (max-width: 1100px) {
    .kadisha-obit-layout { grid-template-columns: 1fr; }
}

/* ---------- Form ---------- */
.kadisha-obit-form {
    background: #fff;
    border: 1px solid var(--ko-line);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 18px rgba(74, 30, 30, 0.06);
    position: sticky; top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}
@media (max-width: 1100px) { .kadisha-obit-form { position: static; max-height: none; } }

.kadisha-obit-fs { border: 0; padding: 0; margin: 0 0 1.25rem; }
.kadisha-obit-fs legend {
    font-family: 'Frank Ruhl Libre', serif; font-size: 1.05rem;
    color: var(--ko-burgundy-dark); font-weight: 600;
    padding: 0; margin-bottom: 0.6rem;
    border-bottom: 1px solid var(--ko-line); padding-bottom: 0.35rem; width: 100%;
}
.kadisha-obit-fs label {
    display: flex; flex-direction: column; gap: 0.3rem;
    margin-bottom: 0.7rem; font-size: 0.875rem; color: var(--ko-ink); font-weight: 600;
}
.kadisha-obit-fs input, .kadisha-obit-fs select, .kadisha-obit-fs textarea {
    padding: 0.5rem 0.6rem; border: 1.5px solid var(--ko-line);
    border-radius: 4px; font: inherit; font-weight: 400; color: var(--ko-ink);
    background: #fff;
}
.kadisha-obit-fs input:focus, .kadisha-obit-fs select:focus, .kadisha-obit-fs textarea:focus {
    outline: none; border-color: var(--ko-gold);
    box-shadow: 0 0 0 3px rgba(176, 139, 79, 0.12);
}
.kadisha-obit-fs textarea { resize: vertical; min-height: 80px; }

/* שורת checkbox - אופקי, לא בעמודה כמו label רגיל. שמירה על המראה
   של שאר ה-controls בטופס. */
.kadisha-obit-fs label.kadisha-obit-checkbox-row {
    flex-direction: row;
    align-items: center;
    gap: 0.55rem;
    font-weight: 500;
    color: var(--ko-muted);
    cursor: pointer;
}
.kadisha-obit-fs label.kadisha-obit-checkbox-row input[type="checkbox"] {
    width: auto; padding: 0; margin: 0;
    accent-color: var(--ko-burgundy);
    cursor: pointer;
}

/* תיבת התאריך העברי המחושב - מוצג כ"רמז" מתחת לשדה הלועזי */
.kadisha-obit-computed {
    margin: 0 0 0.85rem;
    padding: 0.5rem 0.7rem;
    background: var(--ko-cream);
    border: 1px dashed var(--ko-line);
    border-radius: 5px;
    font-size: 0.85rem;
    color: var(--ko-muted);
}
.kadisha-obit-computed strong {
    color: var(--ko-burgundy-dark);
    font-weight: 700;
    margin-inline-start: 4px;
}

.kadisha-obit-btn {
    display: inline-block; padding: 0.55rem 1.25rem;
    background: var(--ko-burgundy); color: var(--ko-cream);
    border: 1.5px solid var(--ko-burgundy); border-radius: 5px;
    font: inherit; font-weight: 700; cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.kadisha-obit-btn:hover { background: var(--ko-burgundy-dark); border-color: var(--ko-burgundy-dark); }
.kadisha-obit-btn-outline { background: transparent; color: var(--ko-burgundy); }
.kadisha-obit-btn-outline:hover { background: var(--ko-burgundy); color: var(--ko-cream); }

/* ---------- Preview & Toolbar ---------- */
.kadisha-obit-preview-wrap { min-width: 0; }

.kadisha-obit-toolbar {
    display: flex; gap: 1rem; flex-wrap: wrap;
    align-items: center; justify-content: space-between;
    margin-bottom: 1rem;
}
.kadisha-obit-styles {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.kadisha-obit-style-btn {
    width: 38px; height: 38px; padding: 0;
    border: 2px solid var(--ko-line);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-weight: 700; color: var(--ko-burgundy);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.kadisha-obit-style-btn:hover { border-color: var(--ko-gold); }
.kadisha-obit-style-btn.is-active {
    background: var(--ko-burgundy); color: var(--ko-cream);
    border-color: var(--ko-burgundy);
}
.kadisha-obit-export { display: flex; gap: 0.5rem; }

.kadisha-obit-stage {
    background: #efe9dd;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid var(--ko-line);
    overflow: hidden;
    min-height: 480px;
    display: flex; align-items: flex-start; justify-content: center;
}

/* Scaler — מקטין ויזואלית את התבנית כדי שתתאים למסך, מבלי לשנות
   את המידות הטבעיות שלה (חשוב לייצוא PNG/PDF איכותי). */
.kadisha-obit-scaler {
    width: var(--ko-scaled-w, 842px);
    height: var(--ko-scaled-h, 595px);
    position: relative;
    flex: 0 0 auto;
}
.kadisha-obit-scaler .kadisha-obit-tpl {
    transform: scale(var(--ko-scale, 1));
    transform-origin: top right; /* RTL: יוצא מהפינה הימנית-עליונה */
}
/* בייצוא — מאפסים את ה-scale ופותחים overflow */
.kadisha-obit-tpl.is-exporting { transform: none !important; }
.kadisha-obit-scaler:has(.kadisha-obit-tpl.is-exporting) {
    width: auto !important; height: auto !important;
}
.kadisha-obit-hint {
    margin-top: 1rem; font-size: 0.875rem; color: var(--ko-muted);
}
.kadisha-obit-hint a { color: var(--ko-burgundy); font-weight: 700; }

/* ==========================================================================
   הבסיס לכל מודעה - שדות ופריסה משותפת
   ========================================================================== */

.kadisha-obit-tpl {
    width: 842px;       /* A4 landscape */
    min-height: 595px;
    box-sizing: border-box;
    padding: 50px 70px;
    background: #fff;
    color: #1a1a1a;
    font-family: 'Frank Ruhl Libre', 'David', 'Times New Roman', serif;
    direction: rtl;
    text-align: center;
    line-height: 1.55;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    display: flex; flex-direction: column; gap: 14px;
    position: relative;
}
.kadisha-obit-tpl > * { margin: 0; }
.kadisha-obit-tpl .ka-obit-opening {
    font-size: 1.5rem; font-weight: 700; letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}
.kadisha-obit-tpl .ka-obit-family { font-size: 1.05rem; }
.kadisha-obit-tpl .ka-obit-name-block {
    margin: 0.85rem 0 1.1rem;
    padding: 0.85rem 0; border-block: 1.5px solid currentColor;
    display: flex; flex-direction: column; gap: 4px;
}
.kadisha-obit-tpl .ka-obit-prefix { font-size: 1rem; }
.kadisha-obit-tpl .ka-obit-titleline { font-size: 2rem; font-weight: 700; line-height: 1.15; }
.kadisha-obit-tpl .ka-obit-parent { font-size: 0.95rem; }
.kadisha-obit-tpl .ka-obit-suffix { font-size: 1.15rem; font-weight: 700; }
/* ברירת מחדל: סיומת ותואר ב-inline מוסתרים — מוצגים רק בעיצובים שדורשים אותם
   (מופיעים ליד השם בעמודה הימנית/שמאלית של הכותרת הגדולה). */
.kadisha-obit-tpl .ka-obit-suffix-inline,
.kadisha-obit-tpl .ka-obit-title-inline { display: none; }
.kadisha-obit-tpl .ka-obit-age { font-size: 0.95rem; opacity: 0.85; }
.kadisha-obit-tpl .ka-obit-deathdate { font-size: 0.95rem; }
.kadisha-obit-tpl .ka-obit-funeral { font-size: 1rem; line-height: 1.7; margin-top: 0.4rem; }
.kadisha-obit-tpl .ka-obit-funeral strong { display: block; font-size: 1.1rem; margin-bottom: 0.25rem; }
.kadisha-obit-tpl .ka-obit-shiva { font-size: 0.95rem; line-height: 1.7; }
.kadisha-obit-tpl .ka-obit-shiva strong { display: block; font-size: 1.05rem; margin-bottom: 0.2rem; }
.kadisha-obit-tpl .ka-obit-mourners {
    margin: 0.8rem 0; font-size: 0.95rem; line-height: 1.85; white-space: pre-line;
}
.kadisha-obit-tpl .ka-obit-closing {
    font-size: 1.1rem; font-weight: 700; margin-top: auto; padding-top: 0.5rem;
}
.kadisha-obit-tpl .ka-obit-phone { font-size: 0.875rem; opacity: 0.75; margin-top: 0.4rem; }

/* ==========================================================================
   10 ווריאציות עיצוב - ka-obit-style-1 ... ka-obit-style-10
   ========================================================================== */

/* 1. קלאסי שחור על לבן - מסגרת עבה + תיבת שם פנימית
   (עיצוב מודעת אבל ישראלית מסורתית — שחור-לבן, אותיות בולד) */
.ka-obit-style-1 {
    background: #fff;
    color: #000;
    border: 12px solid #000;
    padding: 36px 56px 44px;
    font-family: 'Heebo', 'Assistant', 'Arial Hebrew', Arial, sans-serif;
    font-weight: 700;
    line-height: 1.5;
    gap: 8px;
}
.ka-obit-style-1 .ka-obit-opening {
    font-size: 60px;
    font-weight: 900;
    letter-spacing: 0.02em;
    margin: 0 0 0.5rem;
}
.ka-obit-style-1 .ka-obit-family {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 0 0 0.75rem;
    white-space: pre-line;
}
.ka-obit-style-1 .ka-obit-name-block {
    border: 4px solid #000;
    border-radius: 0;
    padding: 1.4rem 1rem 1.85rem;
    margin: 0.4rem 0 1rem;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.ka-obit-style-1 .ka-obit-prefix,
.ka-obit-style-1 .ka-obit-parent,
.ka-obit-style-1 .ka-obit-age,
.ka-obit-style-1 .ka-obit-deathdate,
.ka-obit-style-1 .ka-obit-shiva,
.ka-obit-style-1 .ka-obit-phone,
.ka-obit-style-1 .ka-obit-closing {
    display: none !important;
}
.ka-obit-style-1 .ka-obit-titleline {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #000;
}
.ka-obit-style-1 .ka-obit-suffix {
    position: absolute;
    bottom: 0.55rem;
    inset-inline-end: 0.95rem; /* ב-RTL: visually left, כמו בדוגמה */
    font-size: 1.45rem;
    font-weight: 700;
}
.ka-obit-style-1 .ka-obit-funeral {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.65;
    margin: 0;
}
.ka-obit-style-1 .ka-obit-funeral strong {
    /* ההדגשה הפנימית של "ההלוויה תצא" — נשארת בולד אך באותו גודל */
    display: inline; font-size: 1.2rem; font-weight: 700; margin: 0;
}
.ka-obit-style-1 .ka-obit-mourners {
    display: block !important;
    width: fit-content;
    max-width: 55%;
    margin-inline-start: auto; /* RTL: דוחף את הבלוק לצד שמאל הוויזואלי */
    margin-inline-end: 0;
    text-align: center;        /* הטקסט בתוך הבלוק מרוכז */
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.7;
    margin-top: 1.25rem;
    padding-top: 0.5rem;
    white-space: pre-line;
}

/* 2. עיתון עברי קלאסי — ללא מסגרת, אותיות בולד מאוד, תואר/סיומת ליד השם
   (כמו מודעות אבל מסורתיות בעיתונים החרדיים) */
.ka-obit-style-2 {
    background: #fff;
    color: #000;
    border: 0;
    padding: 36px 56px 32px;
    font-family: 'Heebo', 'Assistant', 'Arial Hebrew', Arial, sans-serif;
    font-weight: 700;
    line-height: 1.5;
    /* Grid 2 עמודות - מאפשר לסדר שיבעה (ימין) ואבלים (שמאל) זה לצד זה */
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 2.5rem;
    row-gap: 6px;
    align-content: start;
}
/* בברירת מחדל כל אלמנט תופס שתי עמודות (שורה מלאה) */
.ka-obit-style-2 > * { grid-column: 1 / -1; }
.ka-obit-style-2 .ka-obit-opening {
    font-size: 60px;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 3px;
    margin: 0 0 0.65rem;
}
.ka-obit-style-2 .ka-obit-family {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.55;
    margin: 0 0 0.5rem;
    white-space: pre-line;
}
.ka-obit-style-2 .ka-obit-name-block {
    border: 0;
    padding: 0.5rem 0;
    margin: 0.4rem 0 0.5rem;
    position: static;
    display: flex;
    flex-direction: column;
    gap: 0;
}
/* החלפת מצב: התואר והסיומת מוצגים inline ליד השם, לא בבלוקים נפרדים */
.ka-obit-style-2 .ka-obit-suffix-inline,
.ka-obit-style-2 .ka-obit-title-inline { display: inline; }
.ka-obit-style-2 .ka-obit-suffix,
.ka-obit-style-2 .ka-obit-prefix,
.ka-obit-style-2 .ka-obit-deathdate { display: none !important; }
.ka-obit-style-2 .ka-obit-titleline {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.55rem;
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
}
.ka-obit-style-2 .ka-obit-title-inline {
    font-size: 1.4rem;   /* תואר ("ר'", "מרת") קטן יותר מהשם */
    font-weight: 700;
}
.ka-obit-style-2 .ka-obit-name {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
}
.ka-obit-style-2 .ka-obit-suffix-inline {
    font-size: 1.45rem;
    font-weight: 700;
}
.ka-obit-style-2 .ka-obit-parent {
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 0.35rem;
}
.ka-obit-style-2 .ka-obit-funeral {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.6;
}
.ka-obit-style-2 .ka-obit-funeral strong,
.ka-obit-style-2 .ka-obit-shiva strong {
    display: inline; font-size: inherit; font-weight: 700; margin: 0;
}
/* שורת חתימה ממורכזת מעל הזוג שיבעה/אבלים */
.ka-obit-style-2 .ka-obit-closing {
    order: 90;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1.25rem;
    padding-top: 0.5rem;
}
/* שיבעה - בצד ימין הוויזואלי (עמודה 1 ב-RTL grid), טקסט ממורכז */
.ka-obit-style-2 .ka-obit-shiva {
    order: 91;
    grid-column: 1;     /* RTL: visual right */
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.7;
    margin-top: 0.4rem;
}
/* אבלים - בצד שמאל הוויזואלי (עמודה 2 ב-RTL grid), טקסט ממורכז */
.ka-obit-style-2 .ka-obit-mourners {
    order: 92;
    grid-column: 2;     /* RTL: visual left */
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.7;
    margin-top: 0.4rem;
    white-space: pre-line;
}
.ka-obit-style-2 .ka-obit-phone {
    order: 99;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

/* 3. בורדו וזהב - מותג מגרב-קדישא */
.ka-obit-style-3 {
    background: linear-gradient(180deg, #4A1E1E 0%, #6B2D2D 100%);
    color: #F7F2E9;
    border: 1px solid #B08B4F;
    box-shadow: inset 0 0 0 6px rgba(212,184,120,0.18), 0 8px 28px rgba(0,0,0,0.25);
}
.ka-obit-style-3 .ka-obit-opening,
.ka-obit-style-3 .ka-obit-titleline,
.ka-obit-style-3 .ka-obit-suffix,
.ka-obit-style-3 .ka-obit-closing { color: #D4B878; }
.ka-obit-style-3 .ka-obit-name-block { border-color: #D4B878; }

/* 4. מסגרת מעוטרת - vintage flourish */
.ka-obit-style-4 {
    background: #fdfcf7; color: #2a1a1a;
    border: 12px solid transparent;
    border-image: repeating-linear-gradient(45deg, #b08b4f 0 8px, #4A1E1E 8px 16px) 12;
}
.ka-obit-style-4 .ka-obit-name-block {
    border-color: #b08b4f;
    border-block-width: 2px;
}
.ka-obit-style-4 .ka-obit-opening { letter-spacing: 0.15em; font-style: italic; }

/* 5. שחור פורמלי */
.ka-obit-style-5 {
    background: #111; color: #f5f5f0;
    border: 1px solid #444;
}
.ka-obit-style-5 .ka-obit-opening,
.ka-obit-style-5 .ka-obit-closing { color: #c9a14a; }
.ka-obit-style-5 .ka-obit-name-block { border-color: #c9a14a; }

/* 6. תכלת מודרני */
.ka-obit-style-6 {
    background: linear-gradient(180deg, #f4f9fc 0%, #e8eef3 100%);
    color: #1d2b3a;
    border: 1px solid #c4d1dd;
}
.ka-obit-style-6 .ka-obit-titleline { color: #1d3a5f; }
.ka-obit-style-6 .ka-obit-name-block { border-color: #6b8aa8; }
.ka-obit-style-6 .ka-obit-opening { font-weight: 400; letter-spacing: 0.08em; }

/* 7. עיתון מסורתי */
.ka-obit-style-7 {
    background: #f8f5ee; color: #1a1a1a;
    border: 3px solid #1a1a1a;
    font-family: 'David Libre', 'Frank Ruhl Libre', Georgia, serif;
}
.ka-obit-style-7::before {
    content: ''; position: absolute; inset: 8px;
    border: 1px solid #1a1a1a; pointer-events: none;
}
.ka-obit-style-7 .ka-obit-name-block { border-block-width: 3px; }

/* 8. אבן/טקסטורה */
.ka-obit-style-8 {
    background:
        repeating-linear-gradient(90deg, transparent 0 80px, rgba(0,0,0,0.03) 80px 81px),
        repeating-linear-gradient(0deg, transparent 0 80px, rgba(0,0,0,0.03) 80px 81px),
        linear-gradient(180deg, #d8d2c4 0%, #c8c0ad 100%);
    color: #2a2820;
    border: 4px solid #6b5a4f;
}
.ka-obit-style-8 .ka-obit-titleline { font-style: italic; }
.ka-obit-style-8 .ka-obit-name-block { border-color: #6b5a4f; }

/* 9. ריבוע אינסטגרם 1080x1080 */
.ka-obit-style-9 {
    width: 720px; min-height: 720px; height: 720px;
    background: linear-gradient(135deg, #6B2D2D, #4A1E1E);
    color: #F7F2E9;
    border: 1px solid #B08B4F;
    padding: 50px;
    box-shadow: inset 0 0 0 4px rgba(212,184,120,0.25), 0 8px 28px rgba(0,0,0,0.3);
    justify-content: center;
}
.ka-obit-style-9 .ka-obit-opening { font-size: 1.25rem; }
.ka-obit-style-9 .ka-obit-titleline { font-size: 1.75rem; }
.ka-obit-style-9 .ka-obit-mourners { font-size: 0.85rem; }
.ka-obit-style-9 .ka-obit-name-block { border-color: #D4B878; }
.ka-obit-style-9 .ka-obit-titleline,
.ka-obit-style-9 .ka-obit-closing { color: #D4B878; }

/* 10. סטורי 9:16 */
.ka-obit-style-10 {
    width: 540px; min-height: 960px;
    background: #fff;
    background-image:
        linear-gradient(180deg, rgba(107,45,45,0.05), transparent 30%, transparent 70%, rgba(107,45,45,0.05)),
        repeating-linear-gradient(135deg, transparent 0 40px, rgba(212,184,120,0.05) 40px 41px);
    color: #1a1a1a;
    padding: 60px 45px;
    border: 2px solid #6B2D2D;
}
.ka-obit-style-10 .ka-obit-opening,
.ka-obit-style-10 .ka-obit-titleline { color: #6B2D2D; }
.ka-obit-style-10 .ka-obit-name-block { border-color: #B08B4F; border-block-width: 2px; }

/* ==========================================================================
   עורך אינליין - לחיצה על שדה מציגה תפריט שינוי פונט/גודל
   ========================================================================== */

.kadisha-obit-tpl [data-bind] {
    cursor: text;
    transition: outline 0.15s, background 0.15s;
    border-radius: 2px;
}
.kadisha-obit-tpl [data-bind]:hover {
    outline: 1px dashed rgba(176, 139, 79, 0.5);
    outline-offset: 2px;
}
.kadisha-obit-tpl [data-bind].is-editing {
    outline: 2px solid var(--ko-gold);
    outline-offset: 3px;
    background: rgba(176, 139, 79, 0.06);
}

.ka-obit-editor {
    position: fixed;
    z-index: 1000;
    background: #fff;
    color: var(--ko-ink);
    border: 1.5px solid var(--ko-gold);
    border-radius: 6px;
    padding: 0.65rem 0.75rem;
    box-shadow: 0 8px 24px rgba(74, 30, 30, 0.18);
    min-width: 240px;
    direction: rtl;
    font-family: 'Assistant', sans-serif;
    font-size: 0.85rem;
}
.ka-obit-editor[hidden] { display: none; }
.ka-obit-editor::before {
    content: '';
    position: absolute;
    top: -7px; right: 18px;
    width: 12px; height: 12px;
    background: #fff;
    border-top: 1.5px solid var(--ko-gold);
    border-inline-end: 1.5px solid var(--ko-gold);
    transform: rotate(-45deg);
}
.ka-obit-editor-row {
    display: flex; align-items: center; gap: 0.4rem;
    margin-bottom: 0.4rem;
}
.ka-obit-editor-row:last-child { margin-bottom: 0; }
.ka-obit-editor-row label {
    flex: 0 0 60px;
    font-weight: 700; color: var(--ko-burgundy-dark);
}
.ka-obit-editor-row select,
.ka-obit-editor-row input[type="number"] {
    flex: 1;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--ko-line);
    border-radius: 4px;
    font: inherit;
    background: #fff;
    color: var(--ko-ink);
}
.ka-obit-editor-buttons {
    display: flex; gap: 0.4rem;
    margin-top: 0.4rem; padding-top: 0.4rem;
    border-top: 1px solid var(--ko-line);
}
.ka-obit-editor-btn {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--ko-line);
    border-radius: 4px;
    background: #fff;
    color: var(--ko-burgundy);
    font: inherit; font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.ka-obit-editor-btn:hover { background: var(--ko-cream); border-color: var(--ko-gold); }
.ka-obit-editor-btn-reset { color: #b32d2d; }

/* בייצוא — מסתירים סימני עריכה ומסירים שדות דוגמה אפורים מהתמונה */
.kadisha-obit-tpl.is-exporting [data-bind] { outline: none !important; background: transparent !important; }
.kadisha-obit-tpl.is-exporting [data-bind].is-editing { outline: none !important; background: transparent !important; }
.kadisha-obit-tpl.is-exporting [data-bind].is-sample { display: none !important; }

/* שדות דוגמה - מוצגים באפור בהיר (במהלך עריכה) עד שהמשתמש מקליד */
.kadisha-obit-tpl [data-bind].is-sample {
    opacity: 0.28;
    transition: opacity 0.25s;
}

@media print {
    .kadisha-obit-form, .kadisha-obit-toolbar, .kadisha-obit-hint, .ka-obit-editor,
    .kadisha-obit-header { display: none; }
    .kadisha-obit-stage { background: transparent; padding: 0; border: 0; overflow: visible; }
    .kadisha-obit-scaler {
        width: auto !important; height: auto !important;
        transform: none !important;
    }
    .kadisha-obit-scaler .kadisha-obit-tpl {
        transform: none !important;
        box-shadow: none !important;
        margin: 0 auto !important;
    }
    @page { margin: 1cm; size: A4 landscape; }
}

/* התאמה למובייל - הטופס בתחילה ואחר כך התצוגה */
@media (max-width: 1100px) {
    .kadisha-obit-stage { min-height: 0; padding: 1rem; overflow: hidden; }
    /* transform-origin: top right נשמר גם במובייל - מקבע את התבנית
       לקצה הימני (start ב-RTL) של ה-scaler, כך שהתצוגה לא דולפת. */
}
@media (max-width: 600px) {
    .kadisha-obit-stage { padding: 0.5rem; }
    .kadisha-obit-toolbar { gap: 0.5rem; }
    .kadisha-obit-style-btn { width: 32px; height: 32px; font-size: 0.85rem; }
}
