        :root {
            /* Palette: Wedding Elegant SaaS */
            --primary: #4F46E5;       /* Modern Indigo */
            --primary-dark: #4338ca;
            --primary-soft: #EEF2FF;

            --secondary: #0F172A;     /* Deep Slate */
            --gold: #D4AF37;          /* Wedding Gold Accent */

            /* Status Colors */
            --success-bg: #DCFCE7; --success-text: #166534;
            --warning-bg: #FEF3C7; --warning-text: #92400E;
            --danger-bg: #FEE2E2;  --danger-text: #991B1B;
            --info-bg: #E0F2FE;    --info-text: #075985;

            /* Backgrounds & Surfaces */
            --bg-body: #F1F5F9;
            --bg-card: #FFFFFF;
            --bg-sidebar: #1E293B;

            /* Text */
            --text-main: #1E293B;
            --text-muted: #64748B;
            --text-light: #94A3B8;

            /* UI Elements */
            --border: #E2E8F0;
            --radius-lg: 14px;
            --radius-md: 9px;
            --radius-sm: 6px;
            --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
            --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

            --sidebar-width: 234px;
            --header-height: 57px;
            --sidebar-width-mobile: 252px;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        /* ─── Accessibility: keyboard-focus baseline ──────────────────────────────
           Several components below already define their own :focus-visible treatment
           (search box, filter pickers, table tiles, seg buttons...). This rule is the
           safety net for everything else — plain buttons, links, the modal-close ×,
           and any element given tabindex for keyboard support (row checkboxes, the
           send-date calendar cells, template picker cards). It matters cross-browser:
           Safari in particular does not draw a default outline on <button>/<a> at all,
           so without this a mouse-only reviewer can't see it, but a keyboard user gets
           no visible focus indicator whatsoever. More specific rules elsewhere in this
           file win by CSS specificity, so this never overrides an existing look. */
        a:focus-visible,
        button:focus-visible,
        input:focus-visible,
        select:focus-visible,
        textarea:focus-visible,
        [tabindex]:focus-visible,
        [role="button"]:focus-visible,
        [role="checkbox"]:focus-visible {
            outline: 2px solid var(--primary);
            outline-offset: 2px;
        }

        /* On dark surfaces (sidebar, the floating selection pill) an indigo outline
           doesn't have enough contrast against the background — use white instead. */
        .nav-item:focus-visible,
        .sidebar-toggle-btn:focus-visible,
        .selected-bar button:focus-visible {
            outline: 2px solid #fff;
            outline-offset: -2px;
        }

        /* overflow-x:hidden hides the scrollbar but still lets the BROWSER scroll
           sideways on its own (revealing a focused control, scrollIntoView). On an RTL
           page that leaves the whole layout parked a few dozen pixels off with no way
           to scroll back. `overflow-x: clip` does NOT help — it is coerced back to
           hidden when it propagates to the viewport (measured). The actual guard is
           resetHorizontalDrift() in js/app/01-core.js. */
        body {
            font-family: 'Assistant', 'Inter', sans-serif;
            font-size: 14.4px;
            background-color: var(--bg-body);
            color: var(--text-main);
            direction: rtl;
            overflow-x: hidden;
            height: 100vh;
        }

        /* --- Layout Structure --- */
        .app-layout {
            display: flex;
            min-height: 100vh;
        }

        /* Sidebar */
        .sidebar {
            width: var(--sidebar-width);
            background: var(--bg-sidebar);
            color: white;
            display: flex;
            flex-direction: column;
            position: fixed;
            right: 0;
            top: 0;
            bottom: 0;
            z-index: 1000;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
        }

        .sidebar-backdrop {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
            z-index: 999;
            display: none;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .sidebar-header {
            min-height: var(--header-height);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.45rem 1.2rem;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }

        .logo-area {
            display: flex;
            align-items: center;
            gap: 10px;
            font-weight: 700;
            font-size: 0.9rem;
            letter-spacing: -0.5px;
            min-width: 0;
            overflow: hidden;
        }

        .logo-area span {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .logo-icon {
            width: 29px;
            height: 29px;
            background: linear-gradient(135deg, var(--primary), #818cf8);
            border-radius: 7px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.95rem;
        }

        .sidebar-nav {
            padding: 0.9rem;
            flex: 1;
            overflow-y: visible;
            display: flex;
            flex-direction: column;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 9px 0.9rem;
            color: #94a3b8;
            text-decoration: none;
            border-radius: var(--radius-md);
            margin-bottom: 3px;
            cursor: pointer;
            transition: all 0.2s;
            font-weight: 600;
            font-size: 0.82rem;
            border: none;
            background: none;
            width: 100%;
            text-align: right;
        }

        .nav-item:hover {
            background: rgba(255,255,255,0.05);
            color: white;
        }

        .whatsapp-cta {
            background: linear-gradient(135deg, #25D366, #128C7E);
            color: white;
            border: none;
            padding: 14px 24px;
            border-radius: var(--radius-md);
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            width: 100%;
            margin-top: 1rem;
            transition: all 0.3s ease;
            box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
            font-size: 1rem;
            position: relative;
            overflow: hidden;
        }

        .whatsapp-cta::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s ease;
        }

        .whatsapp-cta:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
        }

        .whatsapp-cta:hover::before {
            left: 100%;
        }

        .whatsapp-cta:active {
            transform: translateY(0);
            box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
        }

        .whatsapp-cta i {
            font-size: 1.2rem;
        }

        .nav-item.active {
            background: var(--primary);
            color: white;
            box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
        }

        .nav-item i { width: 20px; text-align: center; }

        .sidebar-footer {
            padding: 1rem;
            border-top: 1px solid rgba(255,255,255,0.1);
        }

        /* Main Content */
        .main-content {
            flex: 1;
            margin-right: var(--sidebar-width);
            display: flex;
            flex-direction: column;
            min-width: 0;
            transition: margin-right 0.3s ease;
        }

        /* Top Header */
        .top-header {
            height: var(--header-height);
            background: var(--bg-card);
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 1.5rem;
            position: sticky;
            top: 0;
            z-index: 40;
            box-shadow: var(--shadow-sm);
        }

        /* Sticky Stats Bar */
        .sticky-stats-bar {
            position: sticky;
            top: var(--header-height);
            background: linear-gradient(135deg, #FEFCFB 0%, #F9F7F5 100%);
            border-bottom: 1px solid #E5E7EB;
            padding: 0.75rem 1.5rem;
            display: flex;
            gap: 1.5rem;
            align-items: center;
            justify-content: center;
            z-index: 39;
            opacity: 0;
            transform: translateY(-100%);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            pointer-events: none;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }

        .sticky-stats-bar.visible {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }

        .sticky-stat {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            background: white;
            border-radius: var(--radius-md);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
            font-size: 0.9rem;
            font-weight: 600;
        }

        .sticky-stat i {
            font-size: 1rem;
            color: var(--primary);
        }

        .sticky-stat span {
            color: var(--secondary);
        }

        .page-title h1 {
            font-size: 1.35rem;
            font-weight: 700;
            color: var(--secondary);
        }

        .page-title p {
            font-size: 0.875rem;
            color: var(--text-muted);
            margin-top: 2px;
        }

        /* Wedding Details Styles */
        .wedding-details-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1rem;
        }

        .wedding-detail-card {
            background: linear-gradient(135deg, #FEFCFB 0%, #F9F7F5 100%);
            border: 1px solid rgba(212, 175, 55, 0.2);
            border-radius: var(--radius-lg);
            padding: 1.25rem;
            display: flex;
            align-items: center;
            gap: 1rem;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        }

        .wedding-detail-card:hover {
            box-shadow: 0 4px 16px rgba(212, 175, 55, 0.15);
            border-color: rgba(212, 175, 55, 0.4);
        }

        /* כרטיס הספירה לאחור משתמש כעת ב-.wedding-detail-card הסטנדרטי */

        .wedding-limits-note {
            margin-top: 1rem;
            background: #FAF8F3;
            border: 1px dashed rgba(212, 175, 55, 0.45);
            border-radius: var(--radius-md);
            padding: 0.7rem 0.9rem;
        }

        .wedding-limits-header {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.82rem;
            color: var(--text-muted);
            margin-bottom: 0.55rem;
            font-weight: 600;
        }

        .wedding-limits-header i {
            color: #D4AF37;
        }

        .wedding-limits-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .wedding-limit-pill {
            background: #fff;
            border: 1px solid rgba(212, 175, 55, 0.3);
            border-radius: 999px;
            padding: 4px 6px 4px 12px;
            font-size: 0.78rem;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--secondary);
        }

        .wedding-limit-pill i {
            color: #D4AF37;
        }

        .wedding-limit-pill .limit-num {
            background: linear-gradient(135deg, #D4AF37 0%, #F4D03F 100%);
            color: #fff;
            border-radius: 999px;
            padding: 2px 9px;
            font-weight: 700;
            font-size: 0.72rem;
            min-width: 22px;
            text-align: center;
        }

        /* היסטוריית הודעות — סיכום מגבלות */
        .history-limits-summary {
            background: linear-gradient(135deg, #FEFCE8 0%, #FEF3C7 100%);
            border: 1px solid #FBBF24;
            border-radius: var(--radius-md);
            padding: 0.75rem 1rem;
            margin-bottom: 1.25rem;
        }

        .history-limits-summary .summary-title {
            font-size: 0.85rem;
            color: #78350F;
            margin-bottom: 0.6rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .history-limits-summary .summary-title i {
            color: #D97706;
        }

        .history-limits-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 8px;
        }

        .history-limit-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #fff;
            border: 1px solid #FDE68A;
            border-radius: 8px;
            padding: 6px 10px;
            font-size: 0.82rem;
        }

        .history-limit-row .label {
            display: flex;
            align-items: center;
            gap: 6px;
            color: var(--secondary);
            font-weight: 600;
        }

        .history-limit-row .label i {
            color: #D97706;
            font-size: 0.85rem;
        }

        .history-limit-row .count {
            font-weight: 700;
            background: #FEF3C7;
            padding: 2px 10px;
            border-radius: 999px;
            border: 1px solid #FDE68A;
            color: #78350F;
            font-size: 0.78rem;
            min-width: 38px;
            text-align: center;
        }

        .history-limit-row.exhausted .count {
            background: #FECACA;
            border-color: #FCA5A5;
            color: #991B1B;
        }

        .history-limit-row.exhausted .label i {
            color: #DC2626;
        }

        .detail-icon {
            font-size: 2rem;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 60px;
            height: 60px;
            background: linear-gradient(135deg, #D4AF37 0%, #F4D03F 100%);
            color: white;
            border-radius: 50%;
            box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
            flex-shrink: 0;
        }

        .detail-content {
            flex: 1;
        }

        .detail-content h4 {
            margin: 0 0 0.25rem 0;
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--secondary);
        }

        .detail-content p {
            margin: 0;
            font-size: 0.85rem;
            color: var(--text-muted);
        }

        @keyframes gentle-pulse {
            0% { transform: scale(1); box-shadow: 0 4px 16px rgba(212, 175, 55, 0.15); }
            50% { transform: scale(1.01); box-shadow: 0 6px 20px rgba(212, 175, 55, 0.25); }
            100% { transform: scale(1); box-shadow: 0 4px 16px rgba(212, 175, 55, 0.15); }
        }

        @media (max-width: 768px) {
            .wedding-details-grid {
                grid-template-columns: 1fr;
                gap: 0.75rem;
            }

            .wedding-detail-card {
                padding: 1rem;
                gap: 0.75rem;
            }

            .detail-icon {
                font-size: 1.5rem;
                width: 50px;
                height: 50px;
            }
        }

        .header-actions {
            display: flex;
            gap: 12px;
        }

        .btn-action {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 7px 14px;
            border-radius: var(--radius-md);
            font-weight: 600;
            font-size: 0.82rem;
            cursor: pointer;
            border: 1px solid var(--border);
            background: white;
            color: var(--text-main);
            transition: all 0.2s;
        }

        .btn-action:hover { background: #f8fafc; transform: translateY(-1px); }

        .btn-primary {
            background: var(--primary);
            color: white;
            border: none;
            box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
        }
        .btn-primary:hover { background: var(--primary-dark); }

        .btn-outline { background: transparent; border: 1px solid var(--border); }

        /* Page Content */
        .page-content {
            flex: 1;
            padding: 1.75rem;
            max-width: 1600px;
            margin: 0 auto;
            width: 100%;
        }

        /* Page States */
        .page-state {
            display: none;
        }

        .page-state.active {
            display: block;
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Stats Grid */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.3rem;
            margin-bottom: 1.75rem;
        }

        .stat-card {
            background: var(--bg-card);
            padding: 1.3rem;
            border-radius: var(--radius-lg);
            border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
            position: relative;
            overflow: hidden;
            cursor: pointer;
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }

        .stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

        .stat-card:active { transform: translateY(0); }

        .stat-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
        .stat-icon {
            width: 38px; height: 38px;
            border-radius: 12px;
            display: flex; align-items: center; justify-content: center;
            font-size: 1.08rem;
        }
        .stat-label { font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }
        .stat-value { font-size: 1.8rem; font-weight: 800; color: var(--secondary); line-height: 1; margin-bottom: 5px; }
        .stat-trend { font-size: 0.85rem; display: flex; align-items: center; gap: 5px; }

        /* Filters & Toolbar
           Two tiers inside one card: .toolbar-row holds the narrow controls
           (search + status/table/message pickers), .rel-filter-row below it holds
           the labelled relationship filter. */
        .toolbar {
            background: var(--bg-card);
            padding: 1rem;
            border-radius: var(--radius-lg);
            border: 1px solid var(--border);
            margin-bottom: 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 0.9rem;
            box-shadow: var(--shadow-sm);
        }

        .toolbar-row {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            align-items: center;
        }

        .search-wrapper {
            position: relative;
            flex: 1;
            min-width: 250px;
        }

        .search-input {
            width: 100%;
            padding: 10px 40px 10px 16px;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            font-family: inherit;
            font-size: 0.95rem;
            transition: border-color 0.2s;
        }
        .search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
        .search-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-light); }

        .filter-select {
            padding: 10px 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            font-family: inherit;
            background: white;
            font-size: 0.9rem;
            min-width: 140px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }
        .filter-select:focus { outline: none; border-color: var(--primary); }

        /* ─── Relationship filter row (tier 2 of the guest-list toolbar) ─────────
           Holds the trigger for the relationship picker. The picker itself is
           styled with the table number-pad below, since the two share a shell. */
        .rel-filter-row {
            display: flex;
            align-items: center;
            gap: 0.85rem;
            padding-top: 0.9rem;
            border-top: 1px solid var(--border);
        }

        .rel-filter-lead {
            flex-shrink: 0;
            font-size: 0.78rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            color: var(--text-muted); /* was --text-light: ~2.6:1 on white, fails AA */
            white-space: nowrap;
        }

        /* ─── Toolbar filter pickers ─────────────────────────────────────────────
           The guest list has two multi-select filters — tables and relationships.
           They share one popover shell (anchored under the trigger, search on top,
           actions in the footer) so they read as one control family; only the body
           differs: a grid of numbered tiles vs. a list of named checkbox rows.
           Built by updateTableFilter() / updateRelationshipFilter() in 07-filters.js. */
        .table-filter-container {
            position: relative;
        }

        /* Trigger carries the "a filter is on" signal. background-COLOR only —
           the mobile .filter-select rules paint the caret as a background-image,
           and the shorthand would wipe it. */
        .table-filter-trigger.is-active,
        .rel-filter-trigger.is-active {
            background-color: var(--primary-soft);
            color: var(--primary-dark);
            border-color: #C7D2FE;
            font-weight: 700;
        }

        .table-picker,
        .rel-picker {
            position: absolute;
            top: 100%;
            right: 0;
            margin-top: 6px;
            background: white;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            box-shadow: var(--shadow-lg);
            z-index: 100;
            width: 322px;
            max-width: 92vw;
            overflow: hidden;
        }

        .table-picker-head,
        .rel-picker-head {
            padding: 8px;
            border-bottom: 1px solid var(--border);
        }

        .table-picker-head input,
        .rel-picker-head input {
            width: 100%;
            padding: 8px 10px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 0.85rem;
            font-family: inherit;
            direction: rtl;
            text-align: right;
            box-sizing: border-box;
        }
        .table-picker-head input:focus,
        .rel-picker-head input:focus { outline: none; border-color: var(--primary); }

        .table-picker-body {
            max-height: 302px;
            overflow-y: auto;
            padding: 10px;
        }

        /* "ללא שולחן" — a category, not a number, so it sits above the grid */
        .table-picker-special {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            padding: 8px 10px;
            margin-bottom: 10px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: #F8FAFC;
            color: var(--text-main);
            font-family: inherit;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .table-picker-special:hover { border-color: var(--primary); background: var(--primary-soft); }
        .table-picker-special[aria-pressed="true"] {
            background: var(--primary);
            border-color: var(--primary);
            color: #fff;
        }
        .table-picker-special .table-picker-special-count {
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--text-muted); /* was --text-light: fails AA contrast on white */
            font-variant-numeric: tabular-nums;
        }
        .table-picker-special[aria-pressed="true"] .table-picker-special-count { color: rgba(255,255,255,0.75); }

        .table-picker-grid {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 6px;
        }

        .table-tile {
            display: flex;
            align-items: center;
            justify-content: center;
            aspect-ratio: 1 / 1;
            min-height: 40px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: #F8FAFC;
            color: var(--text-main);
            font-family: inherit;
            font-size: 0.9rem;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .table-tile:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
        .table-tile:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.28); }
        .table-tile[aria-pressed="true"] {
            background: var(--primary);
            border-color: var(--primary);
            color: #fff;
        }
        .table-tile[aria-pressed="true"]:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

        .table-picker-empty,
        .rel-picker-empty {
            padding: 14px 4px;
            text-align: center;
            color: var(--text-muted); /* was --text-light: fails AA contrast on white */
            font-size: 0.85rem;
        }

        .table-picker-foot,
        .rel-picker-foot {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 8px 10px;
            border-top: 1px solid var(--border);
            background: #F8FAFC;
            font-size: 0.8rem;
            color: var(--text-muted);
            font-weight: 600;
        }
        .table-picker-clear {
            border: none;
            background: transparent;
            color: var(--primary);
            font-family: inherit;
            font-size: 0.8rem;
            font-weight: 700;
            cursor: pointer;
            padding: 2px 4px;
            border-radius: var(--radius-sm);
        }
        .table-picker-clear:hover { text-decoration: underline; }
        .table-picker-clear:disabled { color: var(--text-light); cursor: default; text-decoration: none; }

        /* ─── Relationship picker — the list inside the shared shell ─────────────
           Named groups, so a searchable list of checkbox rows: name on the start
           edge, guest count in a pill on the end edge (tabular figures line the
           numbers up into a column you can read down). */
        .rel-picker-body {
            max-height: 302px;
            overflow-y: auto;
        }

        .rel-row {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            padding: 10px 12px;
            border: none;
            border-bottom: 1px solid #F1F5F9;   /* hairline, not a boxed form row */
            background: transparent;
            color: var(--text-main);
            font-family: inherit;
            font-size: 0.88rem;
            font-weight: 600;
            text-align: right;
            cursor: pointer;
            transition: background 0.15s ease;
        }
        .rel-row:last-of-type { border-bottom: none; }
        .rel-row:hover { background: #F8FAFC; }
        .rel-row:focus-visible {
            outline: none;
            box-shadow: inset 0 0 0 2px rgba(79, 70, 229, 0.35);
        }
        .rel-row[aria-checked="true"] {
            background: var(--primary-soft);
            color: var(--primary-dark);
            font-weight: 700;
        }
        .rel-row[aria-checked="true"]:hover { background: #E0E7FF; }

        .rel-row .custom-checkbox { margin: 0; flex-shrink: 0; }

        .rel-row-name {
            flex: 1;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .rel-row-count {
            flex-shrink: 0;
            min-width: 34px;
            padding: 2px 8px;
            text-align: center;
            border-radius: 999px;
            background: #F1F5F9;
            color: var(--text-muted);
            font-size: 0.74rem;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
        }
        .rel-row[aria-checked="true"] .rel-row-count { background: #fff; color: var(--primary); }

        /* A relationship nobody is tagged with — still selectable, visibly empty */
        .rel-row.is-empty .rel-row-name { color: var(--text-muted); } /* was --text-light: fails AA contrast on white */

        /* Two equal footer actions: drop the filter, or put the picker away */
        .rel-picker-foot button {
            flex: 1;
            height: 34px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: #fff;
            color: var(--text-muted);
            font-family: inherit;
            font-size: 0.8rem;
            font-weight: 700;
            cursor: pointer;
            transition: background 0.15s ease, color 0.15s ease;
        }
        .rel-picker-clear:hover:not(:disabled) { background: #F1F5F9; color: var(--text-main); }
        .rel-picker-clear:disabled { color: var(--text-light); cursor: default; }
        /* Scoped to beat `.rel-picker-foot button` above — a lone .rel-picker-done
           loses to it on specificity and the primary would render white. */
        .rel-picker-foot .rel-picker-done {
            background: var(--primary);
            border-color: var(--primary);
            color: #fff;
        }
        .rel-picker-foot .rel-picker-done:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

        @media (prefers-reduced-motion: reduce) {
            .table-tile, .table-picker-special, .rel-row, .rel-picker-done { transition: none; }
        }

        /* ─── Relationship multi-select dropdown (assign-guests modal only) ──────
           Sole user: #assignRelationshipDropdown inside the "assign guests to
           tables" modal (04-seating.js). The guest-list relationship filter is the
           toolbar picker above (.rel-picker) — deliberately NOT this class: this
           one is a plain in-modal checkbox list with no counts and no footer, and
           the two would fight over what a row looks like. */
        .relationship-filter-container {
            position: relative;
        }

        .relationship-dropdown {
            position: absolute;
            top: 100%;
            right: 0;
            margin-top: 4px;
            background: white;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            box-shadow: var(--shadow-lg);
            z-index: 100;
            min-width: 250px;
            max-width: 90vw;
            max-height: 300px;
            overflow-y: auto;
        }

        .relationship-dropdown-item {
            padding: 10px 12px;
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
            transition: background 0.2s;
            border-bottom: 1px solid var(--border);
        }

        .relationship-dropdown-item:last-child {
            border-bottom: none;
        }

        .relationship-dropdown-item:hover {
            background: #F8FAFC;
        }

        .relationship-dropdown-item input[type="checkbox"] {
            cursor: pointer;
        }

        .relationship-dropdown-item label {
            cursor: pointer;
            flex: 1;
            user-select: none;
        }

        /* Search box at the top of a relationship multi-select dropdown (T6) */
        .relationship-dropdown-search {
            position: sticky;
            top: 0;
            background: white;
            padding: 8px;
            border-bottom: 1px solid var(--border);
            z-index: 1;
        }
        .relationship-dropdown-search input {
            width: 100%;
            padding: 8px 10px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 0.85rem;
            font-family: inherit;
            direction: rtl;
            text-align: right;
            box-sizing: border-box;
        }
        .relationship-dropdown-search input:focus {
            outline: none;
            border-color: var(--primary);
        }

        /* Trigger-button labels that must truncate instead of stretching the button */
        #tableFilterLabel,
        #assignRelationshipFilterLabel {
            flex: 1;
            text-align: right;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* Table Styles - Responsive */
        .guest-list-card {
            background: var(--bg-card);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
            overflow: hidden;
        }

        .table-responsive {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            min-width: 900px;
            table-layout: auto;
        }

        thead { background: #F8FAFC; border-bottom: 1px solid var(--border); }

        th {
            text-align: right;
            padding: 0.5rem 0.75rem;
            font-weight: 600;
            font-size: 0.8rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.3px;
            cursor: pointer;
            user-select: none;
            white-space: nowrap;
        }

        th:hover { color: var(--primary); background: rgba(0,0,0,0.02); }

        tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
        tbody tr:last-child { border-bottom: none; }
        tbody tr:hover { background: #F8FAFC; }
        tbody tr.selected { background: var(--primary-soft); }

        td {
            padding: 0.5rem 0.75rem;
            vertical-align: middle;
            font-size: 0.875rem;
            white-space: nowrap;
        }

        /* Component Styles */
        .avatar-initial {
            width: 32px; height: 32px;
            background: var(--primary-soft);
            color: var(--primary);
            border-radius: 50%;
            display: inline-flex; align-items: center; justify-content: center;
            font-weight: 700; font-size: 0.85rem;
            margin-left: 8px;
        }

        .guest-name-cell { display: flex; align-items: center; }

        .status-badge {
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 600;
            display: inline-block;
        }
        .status-confirmed { background: var(--success-bg); color: var(--success-text); }
        .status-pending { background: var(--warning-bg); color: var(--warning-text); }
        .status-declined { background: var(--danger-bg); color: var(--danger-text); }

        .relationship-pill {
            background: #F1F5F9; color: var(--text-muted);
            padding: 2px 10px; border-radius: 4px; font-size: 0.8rem;
            white-space: nowrap;
        }

        .dietary-badge {
            display: inline-block;
            padding: 2px 6px;
            background: #FEF3C7;
            border: 1px solid #FDE68A;
            border-radius: 4px;
            font-size: 1rem;
            line-height: 1;
            cursor: help;
            transition: all 0.2s;
        }

        .dietary-badge:hover {
            transform: scale(1.2);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        }

        /* אורח שנרשם לבד דרך הקישור הפתוח — תג 🔗 + כפתור ✓ להסרת הסימון */
        .open-link-badge {
            display: inline-block;
            padding: 1px 5px;
            margin-right: 4px;
            background: #EEF2FF;
            border: 1px solid #C7D2FE;
            border-radius: 4px;
            font-size: 0.8rem;
            line-height: 1.2;
            cursor: help;
        }

        .open-link-approve {
            display: inline-block;
            margin-right: 2px;
            padding: 1px 7px;
            background: #ECFDF5;
            color: #059669;
            border: 1px solid #A7F3D0;
            border-radius: 4px;
            font-size: 0.8rem;
            line-height: 1.2;
            font-weight: 700;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.15s;
        }

        .open-link-approve:hover {
            background: #059669;
            color: #fff;
        }

        /* 📦 פיצ'ר שלא כלול בחבילת החתונה — נעול: אפור, טשטוש קל, בלי הסתרה.
           הטולטיפ מוסבר ב-title (applyPlanGating), לחיצה מציגה toast הסבר. */
        .plan-locked {
            opacity: 0.45;
            filter: grayscale(1) blur(0.4px);
            cursor: not-allowed !important;
            position: relative;
        }

        .plan-locked:hover {
            opacity: 0.6;
        }

        .plan-locked::after {
            content: '🔒';
            font-size: 0.7em;
            margin-right: 4px;
        }

        /* 🕯️ אירוע שבוטל (applyCancelledState ב-01-core.js). באנר רגוע — גווני אפור-כחלחל,
           לא אדום ולא צהוב-אזהרה, בלי כפתור סגירה. רוחבו תואם ל-.page-content שמתחתיו. */
        .event-cancelled-banner {
            display: none;
            align-items: flex-start;
            gap: 12px;
            box-sizing: border-box;
            width: calc(100% - 3.5rem);
            max-width: calc(1600px - 3.5rem);
            margin: 1.25rem auto 0;
            padding: 14px 18px;
            background: #F1F5F9;
            border: 1px solid #CBD5E1;
            border-right: 4px solid #64748B;
            border-radius: var(--radius-md);
            color: #334155;
            line-height: 1.55;
        }

        body.event-cancelled .event-cancelled-banner {
            display: flex;
        }

        .event-cancelled-banner > i {
            color: #64748B;
            font-size: 1.15rem;
            margin-top: 3px;
            flex-shrink: 0;
        }

        .event-cancelled-banner strong {
            display: block;
            font-size: 1.02rem;
            color: #1E293B;
        }

        .event-cancelled-banner p {
            margin: 2px 0 0;
            font-size: 0.9rem;
        }

        @media (max-width: 768px) {
            .event-cancelled-banner {
                width: calc(100% - 2rem);
                margin-top: 1rem;
                padding: 12px 14px;
            }
        }

        @media (max-width: 480px) {
            .event-cancelled-banner {
                width: calc(100% - 1.5rem);
                margin-top: 0.75rem;
            }
        }

        /* פעולה שננעלה בגלל ביטול האירוע: מעומעמת, עדיין לחיצה — הלחיצה מסבירה למה (toast). */
        .cancel-locked {
            opacity: 0.45;
            filter: grayscale(1);
            cursor: not-allowed !important;
        }

        .cancel-locked:hover {
            opacity: 0.6;
        }

        .cancelled-rules-note {
            margin: 0 0 0.75rem;
            padding: 10px 14px;
            background: #F1F5F9;
            border: 1px solid #CBD5E1;
            border-radius: var(--radius-md);
            color: #334155;
            font-size: 0.88rem;
        }

        .custom-checkbox {
            width: 18px; height: 18px;
            border: 2px solid #CBD5E1;
            border-radius: 4px;
            cursor: pointer;
            position: relative;
            transition: all 0.2s;
            margin: 0 auto;
        }
        .custom-checkbox.checked { background: var(--primary); border-color: var(--primary); }
        .custom-checkbox.checked::after {
            content: ''; position: absolute; left: 5px; top: 1px;
            width: 4px; height: 9px;
            border: solid white; border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }

        /* ─── Table card selection (T3) ───────────────────────────────────────────
           No checkbox: the card header IS the target and the card carries the state.
           The dot is a quiet confirmation of what a click does — it fades in on
           hover (pointer devices) and stays visible on touch, where there is no hover. */
        .table-select-target {
            cursor: pointer;
            -webkit-tap-highlight-color: transparent;
        }
        .table-select-target:focus-visible {
            outline: 2px solid var(--primary);
            outline-offset: 3px;
            border-radius: var(--radius-sm);
        }

        .table-select-dot {
            width: 20px; height: 20px;
            flex-shrink: 0;
            border-radius: 50%;
            border: 1.5px solid #CBD5E1;
            background: #fff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
        }
        .table-select-dot i {
            font-size: 10px;
            color: #fff;
            opacity: 0;
            transform: scale(0.5);
            transition: opacity 0.15s ease, transform 0.15s ease;
        }
        .table-card:hover .table-select-dot,
        .table-select-target:focus-visible .table-select-dot,
        .table-card.is-selected .table-select-dot { opacity: 1; }
        .table-select-target:hover .table-select-dot { border-color: var(--primary); }
        .table-card.is-selected .table-select-dot {
            background: var(--primary);
            border-color: var(--primary);
        }
        .table-card.is-selected .table-select-dot i { opacity: 1; transform: scale(1); }

        /* Touch devices never hover — keep the affordance visible, just quiet */
        @media (hover: none) {
            .table-select-dot { opacity: 1; border-color: #E2E8F0; }
        }
        @media (prefers-reduced-motion: reduce) {
            .table-select-dot, .table-select-dot i { transition: none; }
        }

        /* Shared table-size picker (T1) */
        .size-picker-bar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.5rem;
        }
        .size-picker-option {
            min-width: 56px;
            padding: 10px 14px;
            border: 2px solid var(--border);
            border-radius: var(--radius-md);
            background: #fff;
            color: var(--text-dark);
            font-weight: 700;
            font-size: 1rem;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.15s;
        }
        .size-picker-option:hover {
            border-color: var(--primary);
        }
        .size-picker-option.active {
            background: var(--primary);
            border-color: var(--primary);
            color: #fff;
        }
        .size-picker-custom {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-right: 4px;
        }
        .size-picker-custom label {
            font-size: 0.9rem;
            color: var(--text-muted);
        }
        .size-picker-custom input {
            width: 72px;
            padding: 9px 10px;
            border: 2px solid var(--border);
            border-radius: var(--radius-md);
            font-size: 1rem;
            font-family: inherit;
            text-align: center;
            box-sizing: border-box;
        }
        .size-picker-custom input:focus {
            outline: none;
            border-color: var(--primary);
        }

        /* Action Buttons in Table */
        .icon-btn {
            width: 32px;
            height: 32px;
            border-radius: 6px;
            border: none;
            background: transparent;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-left: 4px;
        }
        .icon-btn:hover { background: #F1F5F9; color: var(--primary); }
        .icon-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
        .icon-btn.edit:hover { background: #FEF3C7; color: #92400E; }
        .icon-btn.ping:hover { background: #DCFCE7; color: #059669; }
        .icon-btn.delete:hover { background: #FEE2E2; color: #DC2626; }

        /* Three-dots action button (always visible) */
        .info-mobile { display: inline-flex; }
        .info-mobile:hover { background: #EDE9FE; color: #7C3AED; }

        /* Row actions popup (mobile) */
        /* Anchored to the ⋮ button by toggleRowActions(), which measures the menu and only then
           reveals it. It used to default to top:0/left:0 AND start animating on append, so the
           menu painted in the screen corner for a frame before JS moved it. Worse, it borrowed
           popupFade — keyframes written for a CENTERED modal, ending on translate(-50%,-50%).
           That offset the anchored menu by half its own size for the animation's duration and
           then snapped it again when the transform reverted on completion. Two visible jumps.
           Hence: no position default, hidden until anchored, and its own transform-safe animation. */
        .row-actions-popup {
            position: fixed;
            visibility: hidden;
            background: white;
            border-radius: 18px;
            box-shadow: 0 20px 60px -10px rgba(0,0,0,0.28), 0 4px 16px rgba(0,0,0,0.08);
            border: none;
            padding: 0.5rem;
            z-index: 1500;
            min-width: 230px;
            display: flex;
            flex-direction: column;
            gap: 3px;
        }
        .row-actions-popup.is-positioned {
            visibility: visible;
            animation: rowActionsIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
        }
        /* Anchored-popup entrance: opacity + a small rise only. Must NOT use a centering
           translate — see the note above. */
        @keyframes rowActionsIn {
            from { opacity: 0; transform: translateY(-6px) scale(0.97); }
            to   { opacity: 1; transform: translateY(0) scale(1); }
        }
        .row-actions-popup-title {
            padding: 0.7rem 1rem 0.5rem;
            font-size: 0.78rem;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.04em;
            border-bottom: 1px solid var(--border);
            margin-bottom: 0.25rem;
        }
        .row-actions-popup button {
            border: none;
            background: transparent;
            padding: 0.85rem 1.1rem;
            text-align: right;
            border-radius: 12px;
            display: flex;
            align-items: center;
            gap: 0.85rem;
            cursor: pointer;
            font-size: 1rem;
            color: var(--text);
            font-family: inherit;
            font-weight: 500;
            width: 100%;
            transition: background 0.15s;
        }
        .row-actions-popup button:active { background: #F8FAFC; }
        .row-actions-popup button.action-ping i { color: #059669; }
        .row-actions-popup button.action-edit i { color: #D97706; }
        .row-actions-popup button.action-delete { color: #DC2626; }
        .row-actions-popup button.action-delete i { color: #DC2626; }
        .row-actions-popup button i { width: 20px; text-align: center; font-size: 1rem; }
        /* ⚠️ CENTERED elements only — it ends on translate(-50%,-50%), which assumes the element
           is positioned at 50%/50% and centers itself with that transform. Using it on anything
           anchored to a button (as .row-actions-popup once did) offsets the element by half its
           own size and then snaps it back when the animation completes. Currently unused. */
        @keyframes popupFade {
            from { opacity: 0; transform: translate(-50%, -48%) scale(0.95); }
            to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
        }

        /* Floating Selected Bar */
        .selected-bar {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            /* Glassmorphism Effect */
            background: rgba(15, 23, 42, 0.85);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: white;
            padding: 10px 24px;
            border-radius: 50px;
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
            display: flex;
            align-items: center;
            gap: 20px;
            z-index: 1000;
            min-width: max-content;
            animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            /* Performance optimization for smooth animations */
            will-change: transform, opacity;
            -webkit-transform: translateX(-50%);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .selected-bar div:first-child {
            border-left: 1px solid rgba(255,255,255,0.2);
            padding-left: 20px;
            font-weight: 600;
            font-size: 0.95rem;
            letter-spacing: 0.5px;
        }

        .selected-bar button {
            background: transparent;
            border: none;
            color: #CBD5E1; /* Light gray */
            padding: 8px 16px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 0.9rem;
            font-weight: 500;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .selected-bar button:hover {
            color: white;
            background: rgba(255, 255, 255, 0.1);
            transform: translateY(-2px);
        }

        /* Table Assignment Button - Blue. #60A5FA measured ~3.5:1 against this pill's
           translucent dark background — below the 4.5:1 AA text minimum. One step
           lighter (blue-300) restores it to ~5:1 without changing the hover state. */
        .selected-bar .btn-table {
            color: #93C5FD;
            background: rgba(96, 165, 250, 0.15);
        }
        .selected-bar .btn-table:hover {
            background: #3B82F6;
            color: white;
            transform: translateY(-2px);
        }

        /* WhatsApp Button - Green */
        .selected-bar .btn-whatsapp {
            color: #4ADE80;
            background: rgba(74, 222, 128, 0.15);
        }
        .selected-bar .btn-whatsapp:hover {
            background: #25D366;
            color: white;
            transform: translateY(-2px);
        }

        /* Delete Button - Red. #F87171 measured ~3.4:1 against this pill's translucent
           dark background — below the 4.5:1 AA text minimum. One step lighter
           (red-300) restores it to ~4.9:1 without changing the hover state. */
        .selected-bar .btn-delete {
            color: #FCA5A5;
            background: rgba(248, 113, 113, 0.15);
        }
        .selected-bar .btn-delete:hover {
            background: #DC2626;
            color: white;
            transform: translateY(-2px);
        }

        /* Seating variant of the same bar (#tableBulkBar). Identical pill, but its
           visibility is class-driven: the base .selected-bar sets display:flex, and
           on mobile it is hidden !important in favour of the guest FAB — an inline
           display:none could not win against that, a class can. */
        .selected-bar--tables { display: none; }
        .selected-bar--tables.is-visible { display: flex; }

        @keyframes slideUp { from { transform: translate(-50%, 150%); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
        @keyframes slideDown { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(-50%, 150%); opacity: 0; } }
        @keyframes progress-shimmer { 0% { background-position: 200% center; } 100% { background-position: -200% center; } }
        .send-progress-indeterminate { width: 100% !important; background: linear-gradient(90deg, #6366F1 25%, #a5b4fc 50%, #6366F1 75%) !important; background-size: 200% 100% !important; animation: progress-shimmer 1.4s linear infinite !important; transition: none !important; }

        /* MODALS - Improved for Mobile */
        .modal {
            display: none;
            position: fixed;
            z-index: 2000;
            left: 0; top: 0;
            width: 100%; height: 100%;
            background-color: rgba(15, 23, 42, 0.8);
            backdrop-filter: blur(4px);
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

        .modal-content {
            background-color: #fff;
            border-radius: var(--radius-lg);
            width: 95%;
            max-width: 650px;
            max-height: 90vh;
            box-shadow: var(--shadow-lg);
            animation: modalFadeIn 0.3s ease;
            display: flex;
            flex-direction: column;
        }

        @keyframes modalFadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

        /* Prevent background scroll when a modal is open (mobile) */
        body:has(.modal[style*="flex"]) {
            overflow: hidden;
        }

        .modal-header {
            padding: 1.25rem 1.5rem;
            border-bottom: 1px solid var(--border);
            display: flex; justify-content: space-between; align-items: center;
            flex-shrink: 0;
        }
        .modal-header h2 { font-size: 1.25rem; font-weight: 700; color: var(--secondary); display: flex; align-items: center; gap: 10px; }
        .modal-close { font-size: 1.5rem; background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 0; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
        .modal-close:hover { background: #F1F5F9; }

        .modal-body {
            padding: 1.5rem;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
            flex: 1 1 auto;
            min-height: 0;
        }

        /* Invitation preview — the artwork is portrait (taller than wide) and taller than the
           modal, so it has to SCALE into the space left under the header rather than overflow
           it. A plain wrapper div got clipped by .modal-content's overflow:hidden and the
           bottom half of the invitation simply vanished. min-height:0 is the load-bearing
           part: without it a flex child refuses to shrink below its content height, so a
           max-height on the image alone would not have helped. */
        .invitation-preview-body {
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #F9FAFB;
            padding: 0;
        }
        .invitation-preview-body img {
            max-width: 100%;
            /* Viewport units, NOT max-height:100%. The percentage would resolve against
               .modal-content, whose height is capped by max-height:90vh but never definite —
               so the percentage is ignored and a tall invitation overflows anyway (measured).
               90vh is the modal cap; 5rem covers the header above the image. */
            max-height: calc(90vh - 5rem);
            width: auto;
            height: auto;
            object-fit: contain;
            display: block;
        }

        .modal-footer {
            padding: 1.25rem 1.5rem;
            border-top: 1px solid var(--border);
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            background: #F8FAFC;
            border-radius: 0 0 var(--radius-lg) var(--radius-lg);
            flex-shrink: 0;
        }

        /* ─── Template Preview Modal tabs ─── */
        .tmpl-tab-btn {
            flex: 1;
            padding: 11px 8px;
            border: none;
            background: none;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-muted);
            cursor: pointer;
            border-bottom: 3px solid transparent;
            margin-bottom: -2px;
            transition: color 0.2s, border-color 0.2s;
            font-family: inherit;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }
        .tmpl-tab-btn.active {
            color: #25D366;
            border-bottom-color: #25D366;
            background: white;
        }

        /* ─── Assign Tables Modal ─── */
        .assign-modal-content { max-width: 900px; }
        .assign-tabs-bar { display: none; } /* desktop: hidden */
        .assign-modal-body { padding: 1.5rem; }
        .assign-panels-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 2rem;
            height: 540px;
        }
        .assign-panel { display: flex; flex-direction: column; min-height: 0; }
        .assign-panel-guests { border-right: 1px solid var(--border); padding-right: 2rem; }
        .assign-panel-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.6rem; color: var(--secondary); }
        .assign-panel-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
        .assign-panel-title-row .assign-panel-title { margin-bottom: 0; }
        .assign-table-selection { font-size: 0.82rem; color: var(--text-muted); }
        .assign-search { font-size: 0.9rem; margin-bottom: 0.75rem; }
        .assign-list { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; min-height: 0; }
        .assign-status { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; flex-shrink: 0; }

        /* Form Elements */
        .form-group { margin-bottom: 1rem; }
        .form-label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; color: var(--text-main); }
        .form-control {
            width: 100%; padding: 10px 12px;
            border: 1px solid var(--border); border-radius: var(--radius-sm);
            font-family: inherit; font-size: 0.95rem;
            transition: all 0.2s;
        }
        .form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
        .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

        /* Template Grid in Modal */
        .template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; margin-top: 10px; }
        .template-card {
            border: 2px solid var(--border); border-radius: var(--radius-md);
            padding: 1.2rem; text-align: center; cursor: pointer; transition: all 0.2s;
            background: white;
        }
        .template-card:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(79,70,229,0.13); }
        .template-card.active { border-color: var(--primary); background: #EEF2FF; box-shadow: 0 0 0 2px var(--primary-soft); }
        .template-icon { font-size: 1.5rem; color: var(--primary); margin-bottom: 10px; }
        .template-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
        .template-hint { font-size: 0.78rem; color: #6B7280; margin-top: 2px; } /* was #9CA3AF: ~2.5:1 on white, fails AA */
        .template-card-locked { opacity: 0.6; cursor: not-allowed; background: #F9FAFB; }
        .template-card-locked:hover { border-color: var(--border); background: #F9FAFB; transform: none; box-shadow: none; }
        .template-card-locked .template-icon { color: #9CA3AF; }
        .template-premium-note { color: #7C3AED; font-weight: 600; }
        /* Template Preview Box */
        .template-preview-box {
            background: #F8FAFC;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 1rem;
            margin-top: 1rem;
        }

        .preview-label {
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 600;
            color: var(--text-main);
            margin-bottom: 10px;
            font-size: 0.9rem;
        }

        .template-preview-content {
            width: 100% !important;
            height: auto !important;
            min-height: 120px;
            background: white;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 12px;
            font-family: 'Assistant', sans-serif;
            font-size: 0.9rem;
            line-height: 1.6;
            color: var(--text-main);
            resize: vertical;
        }

        .template-preview-content.readonly {
            background: #FAFAFA;
            color: var(--text-muted);
            cursor: not-allowed;
        }

        /* Seating Module */
        .seating-section {
            background: var(--bg-card);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border);
            padding: 1.5rem;
            margin-bottom: 2rem;
            box-shadow: var(--shadow-sm);
        }

        .seating-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .table-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1.5rem;
            margin-top: 2rem;
        }

        .table-card {
            background: var(--bg-card);
            border: 2px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 1.5rem;
            transition: all 0.3s;
        }

        .table-card:hover {
            border-color: var(--primary);
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }

        /* Selected state lives on the card, not on a control inside it.
           Must follow :hover — equal specificity, so source order decides.
           The inline relationship rail (border-right) deliberately survives. */
        .table-card.is-selected,
        .table-card.is-selected:hover {
            border-color: var(--primary);
            background:
                linear-gradient(0deg, rgba(79, 70, 229, 0.05), rgba(79, 70, 229, 0.05)),
                var(--bg-card);
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16), var(--shadow-md);
        }

        .table-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border);
        }

        .table-number {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary);
        }

        .table-nickname {
            font-size: 1rem;
            color: var(--secondary);
            margin-top: 4px;
        }

        .table-capacity {
            font-size: 0.9rem;
            color: var(--text-muted);
        }

        .table-guests {
            margin-top: 1rem;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
            gap: 8px;
            min-height: 40px;
        }

        @media (max-width: 1200px) {
            .table-guests {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        @media (max-width: 768px) {
            .table-guests {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        .guest-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
            border: 1px solid #C7D2FE;
            border-radius: 20px;
            padding: 4px 8px 4px 12px;
            font-size: 0.85rem;
            transition: all 0.2s;
            cursor: grab;
            min-width: 0;
            max-width: 100%;
            box-sizing: border-box;
        }

        .guest-pill:active {
            cursor: grabbing;
        }

        .guest-pill.dragging {
            opacity: 0.5;
            transform: scale(1.05);
            box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
        }

        .drop-zone {
            transition: all 0.2s ease;
            min-height: 80px;
        }

        .drop-zone.drag-over {
            background: rgba(79, 70, 229, 0.05);
            border: 2px dashed var(--primary);
            border-radius: var(--radius-md);
            transform: scale(1.02);
        }

        /* Drag auto-scroll edge glow ("הילה") — desktop native DnD only.
           Two fixed bands pinned to the top & bottom viewport edges. Created in
           09-dnd-bulk.js (startDragAutoScroll). Full-width + symmetric = RTL-safe.
           pointer-events:none so they NEVER intercept a drop or the drag itself.
           Reuses the drop-highlight accent rgba(79,70,229,…) = var(--primary). */
        .drag-scroll-glow {
            position: fixed;
            left: 0;
            right: 0;
            height: 96px;          /* matches DRAG_SCROLL_HOT_ZONE in 09-dnd-bulk.js */
            z-index: 9998;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.25s ease;
            will-change: opacity;
        }

        .drag-scroll-glow.top {
            top: 0;
            background: linear-gradient(to bottom,
                rgba(79, 70, 229, 0.55) 0%,
                rgba(79, 70, 229, 0.18) 45%,
                rgba(79, 70, 229, 0) 100%);
        }

        .drag-scroll-glow.bottom {
            bottom: 0;
            background: linear-gradient(to top,
                rgba(79, 70, 229, 0.55) 0%,
                rgba(79, 70, 229, 0.18) 45%,
                rgba(79, 70, 229, 0) 100%);
        }

        /* Dim/idle while merely dragging (both bands showing). */
        .drag-scroll-glow.visible {
            opacity: 0.35;
        }

        /* Intensifies while the pointer is inside this band's hot-zone = scrolling. */
        .drag-scroll-glow.visible.active {
            opacity: 1;
        }

        .guest-pill:hover {
            background: linear-gradient(135deg, #E0E7FF 0%, #C7D2FE 100%);
            transform: translateY(-1px);
            box-shadow: 0 2px 4px rgba(79, 70, 229, 0.15);
        }

        .guest-pill-name {
            font-weight: 600;
            color: var(--secondary);
            display: flex;
            flex-direction: column;
            gap: 2px;
            min-width: 0;
            overflow-wrap: anywhere;
        }

        .guest-pill-rel {
            font-size: 0.7rem;
            font-weight: 400;
            color: var(--text-muted);
        }

        .guest-pill-qty {
            background: var(--primary);
            color: white;
            border-radius: 50%;
            width: 20px;
            height: 20px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
            font-weight: 700;
        }

        .guest-pill-remove {
            background: transparent;
            border: none;
            color: #6B7280;
            cursor: pointer;
            padding: 2px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            width: 18px;
            height: 18px;
            transition: all 0.2s;
        }

        .guest-pill-remove:hover {
            background: rgba(239, 68, 68, 0.1);
            color: #EF4444;
        }

        .empty-table {
            text-align: center;
            color: var(--text-muted);
            padding: 1.5rem;
            font-style: italic;
            grid-column: 1 / -1;
        }

        /* Calendar Styles */
        .calendar-container {
            background: var(--bg-card);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border);
            padding: 1.5rem;
            margin-bottom: 2rem;
            box-shadow: var(--shadow-sm);
        }

        /* Show calendar on desktop, hide mobile message */
        .calendar-mobile-message {
            display: none;
        }

        .calendar-desktop {
            display: block;
        }

        /* Wedding-themed Calendar */
        .fc {
            font-family: 'Assistant', 'Inter', sans-serif !important;
            background: white !important;
            border-radius: var(--radius-lg) !important;
            border: 1px solid var(--border) !important;
            padding: 1rem !important;
            box-shadow: var(--shadow-sm) !important;
        }

        .fc-view-harness {
            height: auto !important;
            min-height: 300px !important;
        }

        .fc-view-harness-active {
            height: auto !important;
            min-height: 300px !important;
        }

        .fc-dayGridMonth-view .fc-daygrid-body {
            min-height: 270px !important;
        }

        .fc-toolbar {
            flex-wrap: wrap;
            gap: 0.75rem;
            margin-bottom: 1.5rem !important;
            background: var(--bg-card);
            padding: 1rem;
            border-radius: var(--radius-md);
            border: 1px solid var(--border);
            box-shadow: none;
        }

        .fc-toolbar-title {
            font-size: 1.3rem !important;
            font-weight: 600 !important;
            color: var(--secondary) !important;
            position: relative;
        }

        .fc-button {
            background: var(--primary) !important;
            border: 1px solid var(--primary) !important;
            border-radius: var(--radius-md) !important;
            font-size: 0.85rem !important;
            padding: 6px 12px !important;
            font-weight: 500 !important;
            color: white !important;
            box-shadow: none !important;
            transition: all 0.2s ease !important;
            font-family: inherit !important;
        }

        .fc-button:hover {
            background: var(--primary-dark) !important;
            border-color: var(--primary-dark) !important;
            transform: none !important;
            box-shadow: var(--shadow-sm) !important;
        }

        .fc-button-primary:not(:disabled).fc-button-active {
            background: var(--primary-dark) !important;
            border-color: var(--primary-dark) !important;
            box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1) !important;
        }

        .fc-daygrid-day-frame {
            min-height: 80px !important;
            transition: background 0.2s ease;
        }

        .fc-daygrid-day-frame:hover {
            background: rgba(79, 70, 229, 0.04) !important;
        }

        .fc-day {
            border-color: var(--border) !important;
        }

        .fc-day-today {
            background: rgba(79, 70, 229, 0.05) !important;
            position: relative;
        }

        .fc-day-today .fc-daygrid-day-number {
            background: var(--primary) !important;
            color: white !important;
            border-radius: 50% !important;
            width: 28px !important;
            height: 28px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            font-weight: 600 !important;
        }

        .fc-event {
            border-radius: var(--radius-sm) !important;
            border: none !important;
            padding: 3px 6px !important;
            font-size: 0.8rem !important;
            font-weight: 500 !important;
            box-shadow: var(--shadow-sm) !important;
            transition: all 0.2s ease !important;
        }

        .fc-event:hover {
            transform: translateY(-1px) !important;
            box-shadow: var(--shadow-md) !important;
        }

        .fc-event-title {
            font-weight: 500 !important;
        }

        .fc-col-header-cell {
            background: var(--bg-muted) !important;
            border-color: var(--border) !important;
            font-weight: 600 !important;
            color: var(--text-muted) !important; /* was --text-light: fails AA contrast */
            padding: 8px !important;
            font-size: 0.85rem !important;
        }

        /* תיקון לתצוגה בטלפון */
        @media (max-width: 768px) {
            .calendar-container {
                padding: 1rem;
            }

            /* Hide calendar on mobile, show message instead */
            .calendar-desktop {
                display: none !important;
            }

            .calendar-mobile-message {
                display: block !important;
            }

            .fc {
                padding: 0.5rem !important;
                max-height: 450px !important;
                background: linear-gradient(135deg, #FEFCFB 0%, #F9F7F5 100%) !important;
            }

            .fc-toolbar {
                flex-direction: column;
                align-items: stretch;
                gap: 0.5rem;
                padding: 0.5rem;
                margin-bottom: 1rem !important;
            }

            .fc-toolbar-title {
                font-size: 1.1rem !important;
                text-align: center;
            }

            .fc-toolbar-chunk {
                display: flex;
                justify-content: center;
                gap: 0.3rem;
                flex-wrap: wrap;
            }

            .fc-button {
                width: 100%;
                margin: 2px 0 !important;
                font-size: 0.85rem !important;
                padding: 8px 14px !important;
            }

            .fc-daygrid-day-frame {
                min-height: 70px !important;
            }

            .fc-event {
                font-size: 0.75rem !important;
                padding: 3px 6px !important;
            }

            .fc-daygrid-day-number {
                font-size: 0.9rem !important;
            }
        }

        /* Extra small phones */
        @media (max-width: 480px) {
            .calendar-container {
                padding: 0.5rem;
                margin-bottom: 1rem;
            }

            .fc {
                padding: 0.5rem !important;
                max-height: 420px !important;
            }

            .fc-toolbar {
                padding: 0.5rem;
                gap: 0.4rem;
            }

            .fc-daygrid-day-frame {
                min-height: 55px !important;
            }

            .fc-toolbar-title {
                font-size: 1rem !important;
            }

            .fc-toolbar-title::before {
                content: '';
                margin-left: 0;
            }

            .fc-button {
                font-size: 0.75rem !important;
                padding: 6px 10px !important;
                border-radius: 12px !important;
            }

            .fc-event {
                font-size: 0.7rem !important;
                padding: 2px 4px !important;
            }

            .fc-daygrid-day-number {
                font-size: 0.85rem !important;
                padding: 4px !important;
            }

            .fc-day-today::before {
                font-size: 0.7rem;
                top: 2px;
                right: 2px;
            }
        }

        /* NOTE: .fc, .fc-toolbar, .fc-button styles are defined above
           with the full wedding gold theme — do not add duplicates here */

        /* Settings Page */
        .settings-section {
            background: var(--bg-card);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border);
            padding: 1.5rem;
            margin-bottom: 2rem;
            box-shadow: var(--shadow-sm);
        }

        .settings-section h3 {
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 2px solid var(--primary-soft);
            color: var(--secondary);
        }

        /* ─── Table settings: launcher + dialog (seating page) ────────────────────
           The heavy/rare table actions used to be an inline accordion that shoved
           the grid down. They now live in a centered dialog; the page keeps one
           quiet button. */
        .seating-settings-launch {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-wrap: wrap;
            margin-bottom: 1.5rem;
        }
        .seating-settings-btn {
            background: white;
            border-color: #CBD5E1;
            color: var(--secondary);
        }
        .seating-settings-btn:hover {
            background: var(--primary-soft);
            border-color: var(--primary);
            color: var(--primary);
        }
        .seating-settings-btn i {
            color: var(--text-muted);
            transition: color 0.2s ease, transform 0.35s ease;
        }
        .seating-settings-btn:hover i { color: var(--primary); transform: rotate(60deg); }
        .seating-settings-hint {
            font-size: 0.82rem;
            color: var(--text-muted); /* was --text-light: fails AA contrast on white */
        }
        @media (prefers-reduced-motion: reduce) {
            .seating-settings-btn i { transition: none; }
            .seating-settings-btn:hover i { transform: none; }
        }

        .seating-settings-modal { max-width: 560px; }
        .seating-settings-modal .modal-body {
            background: #F8FAFC;
            padding: 1.15rem;
            display: flex;
            flex-direction: column;
            gap: 0.8rem;
        }

        /* What the actions are about to act on — read live from the tables data */
        .seating-settings-stats {
            display: flex;
            align-items: stretch;
            background: white;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 0.7rem 0.5rem;
        }
        .seating-stat { flex: 1; text-align: center; }
        .seating-stat + .seating-stat { border-inline-start: 1px solid var(--border); }
        .seating-stat b {
            display: block;
            font-size: 1.3rem;
            font-weight: 800;
            line-height: 1.15;
            color: var(--secondary);
            font-variant-numeric: tabular-nums;
        }
        .seating-stat span {
            font-size: 0.74rem;
            color: var(--text-muted); /* was --text-light: fails AA contrast on white */
        }
        .seating-settings-stats--empty {
            display: block;
            text-align: center;
            font-size: 0.88rem;
            color: var(--text-muted);
            padding: 0.9rem;
        }

        /* One card per group. The start-edge rail says what the group does to the
           seating you already have — the same rail language the table cards use for
           relationship colour. indigo = only reads · amber = moves · red = deletes. */
        .seating-action-group {
            background: white;
            border: 1px solid var(--border);
            border-inline-start: 4px solid var(--group-accent);
            border-radius: var(--radius-md);
            padding: 0.85rem 1rem 0.95rem;
        }
        .seating-action-group--read    { --group-accent: var(--primary); }
        .seating-action-group--arrange { --group-accent: #F59E0B; }
        .seating-action-group--danger  { --group-accent: #DC2626; }

        .seating-action-title {
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--secondary);
            margin: 0 0 0.25rem 0;
        }

        .seating-action-note {
            color: var(--text-muted);
            font-size: 0.82rem;
            line-height: 1.55;
            margin: 0 0 0.7rem 0;
        }
        .seating-action-note strong { color: var(--text-main); font-weight: 700; }

        .seating-action-row {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }
        .seating-action-row .btn-action {
            flex: 1 1 auto;
            justify-content: center;
            text-align: center;
        }

        /* Button intents used inside the panel (replaces per-button inline styles) */
        .btn-action--report {
            background: var(--primary-soft);
            color: var(--primary);
            border-color: #C7D2FE;
        }
        .btn-action--report:hover { background: #E0E7FF; }

        .btn-action--info {
            background: var(--info-bg);
            color: var(--info-text);
            border-color: #BAE6FD;
        }
        .btn-action--info:hover { background: #CFEAFB; }

        .btn-action--danger {
            background: var(--danger-bg);
            color: #DC2626;
            border-color: #FECACA;
        }
        .btn-action--danger:hover { background: #FECACA; color: #B91C1C; }

        /* Seating header + view-filter bar */
        .seating-header-actions {
            display: flex;
            gap: 0.75rem;
            flex-wrap: wrap;
        }

        /* ── Seating header & controls ──────────────────────────────────────────────
           The header and the filter bar used to be two separate white slabs stacked on
           each other, which read as two unrelated panels and gave the page no focal
           point. They are now ONE surface: title + live status on the right, actions on
           the left, a hairline, then the controls. Gold (--gold, already in the token
           set and barely used) is this page's accent — seating is the celebratory part
           of the product, and it separates this page from the indigo of the data screens. */
        .seating-header {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg) var(--radius-lg) 0 0;
            box-shadow: var(--shadow-sm);
            padding: 1.15rem 1.35rem;
            margin-bottom: 0;
            /* A gold edge was tried here and removed: the table cards below already use a coloured
               leading edge to encode relationship/status, and because the cards sit inside a grid
               their edges never line up with the full-width header — two vertical rules at
               different x positions read as a misalignment, not as a system. The accent now lives
               only where it means something: the "still to seat" chip. */
        }
        .seating-title-block h2 {
            color: var(--secondary);
            margin: 0 0 0.4rem;
            font-size: 1.3rem;
            letter-spacing: -0.02em;
        }

        /* The live "still to seat" count. Gold because it is an invitation to act, not an
           error — an unseated guest is normal work in progress, not a failure. */
        .seating-unseated-chip {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.4rem 0.7rem 0.4rem 0.55rem;
            border-radius: 999px;
            border: 1px solid #EBD9A4;
            background: linear-gradient(180deg, #FDF8E7, #FBF1D5);
            color: #7A5B12;
            font-family: inherit;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.15s, box-shadow 0.15s;
        }
        .seating-unseated-chip strong { font-size: 1rem; color: #5C440B; }
        .seating-unseated-chip i { font-size: 0.7rem; opacity: 0.65; }
        .seating-unseated-chip:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px -4px rgba(122, 91, 18, 0.35);
        }
        .seating-unseated-chip:hover i { opacity: 1; }
        .seating-unseated-dot {
            width: 7px; height: 7px; border-radius: 50%;
            background: var(--gold);
            box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.22);
        }
        .seating-all-seated {
            margin: 0;
            font-size: 0.88rem;
            font-weight: 600;
            color: var(--success-text);
            display: flex; align-items: center; gap: 0.4rem;
        }
        /* An author-level `display` beats the browser's own [hidden] rule, so setting
           el.hidden = true on either of these left them on screen — the "0 אורחים בלי שולחן"
           chip showed with a zero in it. Re-assert the hide at the same specificity. */
        .seating-unseated-chip[hidden],
        .seating-all-seated[hidden] { display: none; }

        /* Second tier of the same surface — joined to the header by a hairline, not floating
           as its own card. */
        .seating-filter-bar {
            background: var(--bg-card);
            padding: 0.85rem 1.35rem;
            border: 1px solid var(--border);
            border-top: none;
            border-radius: 0 0 var(--radius-lg) var(--radius-lg);
            margin-bottom: 1.5rem;
        }

        .seating-filter-row {
            display: flex;
            gap: 0.75rem;
            align-items: center;
            flex-wrap: wrap;
        }

        /* Segmented control — three visible, mutually exclusive views.
           The white "pill" is a single absolutely-positioned element that SLIDES between the
           segments, rather than a background that pops on and off the active button. JS measures
           the target segment and sets --seg-x / --seg-w (see _syncSeatingViewSegments). */
        .seg-control {
            position: relative;
            display: inline-flex;
            padding: 3px;
            gap: 2px;
            background: var(--bg-body);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            isolation: isolate;
        }
        .seg-control::before {
            content: '';
            position: absolute;
            top: 3px; bottom: 3px;
            /* Offsets are measured from the control's leading edge, which is the RIGHT one in RTL. */
            inset-inline-start: var(--seg-x, 3px);
            width: var(--seg-w, 0px);
            background: var(--bg-card);
            border-radius: 7px;
            box-shadow: var(--shadow-sm);
            transition: inset-inline-start 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                        width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: -1;
        }
        /* Before JS has measured anything there is nothing to slide — don't paint a stray pill. */
        .seg-control:not([style*="--seg-w"])::before { opacity: 0; }
        @media (prefers-reduced-motion: reduce) {
            .seg-control::before { transition: none; }
        }
        .seg-btn {
            position: relative;
            border: none;
            background: transparent;
            font-family: inherit;
            font-size: 0.82rem;
            font-weight: 600;
            color: var(--text-muted);
            padding: 6px 13px;
            border-radius: 7px;
            cursor: pointer;
            white-space: nowrap;
            transition: color 0.2s;
        }
        .seg-btn:hover { color: var(--text-main); }
        .seg-btn.is-active { color: var(--secondary); }
        .seg-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

        /* The real <select> stays in the DOM (the JS reads its .value) but is removed from
           layout and from the accessibility tree — the segments above are its interface.
           It is aria-hidden + tabindex=-1, so it must NOT be reachable at all; display:none
           is therefore correct and the clip-based sr-only pattern is wrong here. That pattern
           also broke in practice: it keeps the element in layout, and the later
           `.filter-select` rules (including width:100% under max-width:768px) out-ranked its
           1px sizing, leaving an invisible 369px absolutely-positioned box hanging past the
           left edge — which is what tilted the whole seating page sideways on a phone.
           Selector is `select.seg-shadow-select` on purpose: (0,1,1) outranks every
           `.filter-select` rule whatever order they land in. */
        select.seg-shadow-select {
            display: none;
        }

        /* Icon-led field: the icon carries the label so the row keeps its width for controls. */
        .seating-inline-field {
            display: inline-flex;
            align-items: center;
            gap: 0.45rem;
            padding-inline-start: 0.6rem;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            background: var(--bg-card);
        }
        .seating-inline-field > i { color: var(--text-light); font-size: 0.85rem; }
        .seating-inline-field .filter-select {
            border: none;
            background: transparent;
            min-width: 150px;
        }
        .seating-inline-field:focus-within { border-color: var(--primary); }

        .sr-only {
            position: absolute; width: 1px; height: 1px;
            padding: 0; margin: -1px; overflow: hidden;
            clip: rect(0 0 0 0); white-space: nowrap; border: 0;
        }

        /* Table-number pad. Numbers are short and there can be dozens, so a grid of keys beats a
           checkbox list — the whole set is visible at once and picking three is three taps. */
        .seating-table-pad {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
            gap: 6px;
            padding: 0.6rem;
            max-height: 40vh;
            overflow-y: auto;
        }
        .seating-table-key {
            border: 1px solid var(--border);
            background: var(--bg-card);
            color: var(--text-main);
            font-family: inherit;
            font-weight: 700;
            font-size: 0.85rem;
            padding: 9px 0;
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: background 0.15s, color 0.15s, border-color 0.15s;
        }
        .seating-table-key:hover { border-color: var(--primary); color: var(--primary); }
        .seating-table-key.is-on {
            background: var(--primary);
            border-color: var(--primary);
            color: #fff;
        }
        .rel-filter-trigger.has-selection {
            border-color: var(--primary);
            color: var(--primary);
            font-weight: 600;
        }

        /* Smart-fill list — a proposal to review, so the party size is as prominent as the name. */
        .smart-fill-list { max-height: 46vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
        .smart-fill-row {
            display: grid;
            grid-template-columns: auto 1fr auto auto;
            align-items: center;
            gap: 0.7rem;
            padding: 0.6rem 0.7rem;
            border-radius: var(--radius-md);
            cursor: pointer;
        }
        .smart-fill-row:hover { background: var(--bg-body); }
        .smart-fill-row input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }
        .smart-fill-name { font-weight: 600; color: var(--text-main); }
        .smart-fill-rel  { font-size: 0.78rem; color: var(--text-muted); } /* was --text-light: fails AA contrast on white */
        .smart-fill-qty {
            min-width: 26px; text-align: center;
            font-weight: 700; font-size: 0.85rem;
            color: var(--primary);
            background: var(--primary-soft);
            border-radius: 6px; padding: 2px 6px;
        }

        /* ── Seating header on a phone ──────────────────────────────────────────────
           At phone width the three action buttons stacked full-width and pushed the controls
           off the first screen, and the segmented control was squeezed against the edge with
           the sort field wrapped underneath it. Stack the header into a readable order —
           title, status, then actions as an even row — and let the segments use the full width
           so all three labels stay legible. */
        @media (max-width: 640px) {
            .seating-header {
                flex-direction: column;
                align-items: stretch;
                gap: 0.9rem;
                padding: 1rem 1.05rem;
            }
            .seating-title-block h2 { font-size: 1.15rem; }
            .seating-header-actions { gap: 0.5rem; }
            /* Even thirds instead of three different widths wrapping unevenly. */
            .seating-header-actions .btn-action {
                flex: 1 1 0;
                justify-content: center;
                padding: 9px 6px;
                font-size: 0.78rem;
            }
            .seating-filter-bar { padding: 0.8rem 1.05rem; }
            .seating-filter-row { gap: 0.6rem; }
            .seg-control { width: 100%; }
            .seg-btn { flex: 1 1 0; padding: 8px 4px; font-size: 0.76rem; text-align: center; }
            .seating-inline-field { width: 100%; }
            .seating-inline-field .filter-select { flex: 1 1 auto; min-width: 0; }
            .seating-unseated-chip { align-self: flex-start; }
        }

        /* The three selects share the row instead of huddling on one side and
           leaving the bar looking like an empty billboard. */
        .seating-filter-row .filter-select {
            flex: 1 1 auto;
        }

        .settings-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 2rem;
        }

        /* Relationship Cards */
        #relationshipTypesList {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 1rem;
        }

        .relationship-card {
            background: white;
            border: 2px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 1.25rem;
            transition: all 0.3s ease;
            box-shadow: var(--shadow-sm);
        }

        .relationship-card:hover {
            border-color: var(--primary);
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }

        .relationship-card-header {
            display: flex;
            align-items: flex-start;
            gap: 1rem;
            margin-bottom: 1rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border);
        }

        .relationship-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
            flex-shrink: 0;
        }

        .relationship-icon.high {
            background: linear-gradient(135deg, #DCFCE7, #BBF7D0);
            color: #166534;
        }

        .relationship-icon.medium {
            background: linear-gradient(135deg, #FEF3C7, #FDE68A);
            color: #92400E;
        }

        .relationship-icon.low {
            background: linear-gradient(135deg, #E0F2FE, #BAE6FD);
            color: #075985;
        }

        .relationship-info {
            flex: 1;
            min-width: 0;
        }

        .relationship-name {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--secondary);
            margin: 0 0 0.25rem 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .relationship-badge {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin: 0;
            padding: 2px 8px;
            background: #F8FAFC;
            border-radius: 4px;
            display: inline-block;
        }

        .relationship-actions {
            display: flex;
            gap: 0.5rem;
        }

        .btn-icon-sm {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            border: none;
            background: var(--primary-soft);
            color: var(--primary);
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.875rem;
        }

        .btn-icon-sm:hover {
            background: var(--primary);
            color: white;
            transform: scale(1.1);
        }

        .btn-icon-sm.delete {
            background: #FEE2E2;
            color: #DC2626;
        }

        .btn-icon-sm.delete:hover {
            background: #DC2626;
            color: white;
        }

        .relationship-stats {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
        }

        .stat-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            flex: 1;
        }

        .relationship-card .stat-value {
            font-size: 1.5rem;
            font-weight: 800;
            color: var(--secondary);
            line-height: 1;
        }

        .relationship-card .stat-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 0.25rem;
            font-weight: 600;
        }

        .stat-divider {
            width: 1px;
            height: 40px;
            background: var(--border);
        }

        /* Automation Rules with Trigger Button */
        .rule-item {
            background: #F8FAFC;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 1rem;
            margin-bottom: 1rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.2s;
        }

        .rule-item:hover {
            background: #F1F5F9;
            border-color: var(--primary);
        }

        .rule-info {
            flex: 1;
        }

        .rule-actions {
            display: flex;
            gap: 8px;
        }

        .trigger-btn {
            background: #059669;
            color: white;
            border: none;
            padding: 6px 12px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: 5px;
            transition: background 0.2s;
        }

        .trigger-btn:hover {
            background: #047857;
        }

        /* Loading Spinner */
        .loading { display: flex; flex-direction: column; align-items: center; padding: 3rem; color: var(--text-muted); }
        .spinner { width: 40px; height: 40px; border: 3px solid #E2E8F0; border-top: 3px solid var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 1rem; }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

        /* Empty State */
        .empty-state { text-align: center; padding: 4rem 1rem; color: var(--text-muted); }
        .empty-state i { font-size: 3rem; margin-bottom: 1rem; color: #CBD5E1; }

        /* Mobile Responsive */
        .mobile-menu-btn {
            display: none;
            background: none;
            border: none;
            font-size: 1.5rem;
            color: var(--text-main);
            cursor: pointer;
            width: 40px;
            height: 40px;
            align-items: center;
            justify-content: center;
            border-radius: var(--radius-md);
        }

        .mobile-menu-btn:hover {
            background: #F1F5F9;
        }

        /* Responsive Breakpoints */
        @media (max-width: 1200px) {
            .app-layout {
                position: relative;
            }

            .sidebar {
                position: fixed;
                right: -100%; /* מחוץ למסך לגמרי */
                top: 0;
                bottom: 0;
                width: 280px;
                transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                z-index: 1000;
                box-shadow: -2px 0 20px rgba(0, 0, 0, 0.3);
            }

            .sidebar.open {
                right: 0; /* נכנס למסך */
            }

            /* תוכן הדף לא זז */
            .main-content {
                margin-right: 0;
                transition: none;
            }

            .sidebar.open ~ .main-content {
                transform: none;
                filter: none;
            }

            /* כפתור בכותרת הראשית */
            .top-header .mobile-menu-btn {
                display: flex !important;
                align-items: center;
                justify-content: center;
                width: 40px;
                height: 40px;
                border: none;
                background: none;
                color: var(--text-main);
                font-size: 1.5rem;
                cursor: pointer;
                border-radius: var(--radius-md);
                position: relative;
                z-index: 1001; /* מעל הסליידבר */
            }

            /* כפתור בסליידבר */
            .sidebar-toggle-btn {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 40px;
                height: 40px;
                border: none;
                background: none;
                color: white;
                font-size: 1.5rem;
                cursor: pointer;
                border-radius: var(--radius-md);
                transition: all 0.3s ease;
                margin-left: 10px; /* רווח מהלוגו */
            }

            .sidebar-toggle-btn:hover {
                background: rgba(255, 255, 255, 0.1);
            }

            /* אנימציית מעבר לכפתור */
            .top-header .mobile-menu-btn {
                transition: all 0.3s ease;
            }

            /* כאשר הסליידבר פתוח - הסתר את הכפתור בכותרת */
            .sidebar.open ~ .main-content .top-header .mobile-menu-btn {
                opacity: 0;
                visibility: hidden;
                transform: translateX(20px);
            }
        }

        @media (min-width: 1201px) {
            .sidebar {
                position: fixed;
                right: 0 !important;
                transform: none !important;
            }

            .main-content {
                margin-right: var(--sidebar-width);
            }

            .top-header .mobile-menu-btn,
            .sidebar-toggle-btn {
                display: none !important;
            }
        }
        @media (max-width: 768px) {
            .page-content {
                padding: 1rem;
            }

            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 0.8rem;
            }

            .stat-card {
                padding: 1rem;
            }

            .stat-card h3 {
                font-size: 0.82rem;
            }

            .stat-value {
                font-size: 1.5rem;
            }

            /* Sticky stats on mobile */
            .sticky-stats-bar {
                padding: 0.5rem;
                gap: 0.5rem;
            }

            .sticky-stat {
                padding: 0.4rem 0.6rem;
                font-size: 0.8rem;
            }

            .sticky-stat i {
                font-size: 0.85rem;
            }

            .form-row {
                grid-template-columns: 1fr;
            }

            .toolbar {
                gap: 0.75rem;
            }

            .toolbar-row {
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 0.6rem;
            }

            .toolbar-row .search-wrapper {
                grid-column: 1 / -1;
                width: 100%;
                min-width: unset;
            }

            /* Odd number of pickers: the last one spans instead of sitting alone
               in a half-empty row. Self-corrects if a control is added later. */
            .toolbar-row > *:last-child:nth-child(even) {
                grid-column: 1 / -1;
            }

            /* Relationship row: the lead label stacks above the trigger, which then
               takes the full width like the other filters */
            .rel-filter-row {
                flex-direction: column;
                align-items: stretch;
                gap: 0.5rem;
                padding-top: 0.75rem;
            }
            .rel-filter-lead { line-height: 1.2; }

            .filter-select {
                width: 100%;
                min-width: 0;
            }

            .col-phone {
                display: none;
            }

            /* Relationship Cards - Mobile */
            #relationshipTypesList {
                grid-template-columns: 1fr;
            }

            .relationship-card {
                padding: 1rem;
            }

            .relationship-icon {
                width: 40px;
                height: 40px;
                font-size: 1rem;
            }

            .relationship-name {
                font-size: 1rem;
            }

            .stat-value {
                font-size: 1.25rem;
            }

            .stat-label {
                font-size: 0.7rem;
            }

            /* Stray horizontal swipes must not nudge the layout. Phones only —
               on desktop this would also kill trackpad swipe-to-navigate. */
            body { overscroll-behavior-x: none; }

            .selected-bar {
                /* The desktop pill sizes itself with min-width:max-content. On a phone
                   that measures the button row UNWRAPPED — wider than the screen — and
                   since the bar is centred with translateX(-50%) it then hangs off both
                   edges and drags the whole page sideways. Cap it to the viewport: the
                   bar floats OVER the page and never changes its width. */
                min-width: 0;
                width: 88%;
                max-width: min(400px, calc(100vw - 24px));
                flex-direction: column;
                align-items: center;
                text-align: center;
                bottom: 16px;
                padding: 10px 14px;
                gap: 8px;
                border-radius: 20px;
                animation: slideUpMobile 0.35s cubic-bezier(0.16, 1, 0.3, 1);
                transform: translateX(-50%) translateZ(0);
                -webkit-transform: translateX(-50%) translateZ(0);
            }

            .selected-bar div:first-child {
                border-left: none !important;
                padding-left: 0 !important;
                font-size: 0.82rem;
                justify-content: center;
                width: 100%;
            }

            .selected-bar > div:last-child {
                display: flex !important;
                flex-direction: row !important;
                flex-wrap: wrap !important;
                justify-content: center !important;
                gap: 6px !important;
                width: 100%;
            }

            .selected-bar button {
                width: auto !important;
                flex-shrink: 0;
                margin-bottom: 0;
                padding: 7px 11px;
                font-size: 0.78rem;
                white-space: nowrap;
                border-radius: 20px !important;
            }

            /* Mobile-specific slide-up animation */
            @keyframes slideUpMobile {
                from {
                    transform: translate(-50%, calc(100% + 40px));
                    opacity: 0;
                }
                to {
                    transform: translate(-50%, 0);
                    opacity: 1;
                }
            }

            .modal-content {
                max-height: 85vh;
            }

            .modal-body {
                padding: 1rem;
            }

            .modal-footer {
                flex-direction: column;
            }

            .modal-footer button {
                width: 100%;
            }

            .seating-header {
                flex-direction: column;
                align-items: stretch;
            }

            .seating-header .btn-action {
                width: 100%;
                justify-content: center;
            }

            .fc-toolbar {
                flex-direction: column;
                align-items: stretch;
            }

            .fc-toolbar-chunk {
                display: flex;
                flex-direction: column;
                gap: 0.5rem;
            }

            /* Better touch targets on mobile - minimum 44px */
            .guest-row .action-buttons button,
            .btn-icon-sm {
                min-width: 44px;
                min-height: 44px;
                padding: 12px;
            }

            /* Improved table rows for mobile */
            .guest-row {
                padding: 1rem;
                cursor: pointer;
                -webkit-tap-highlight-color: transparent;
            }

            .guest-row:active {
                background: var(--background-secondary);
                transform: scale(0.98);
            }

            /* Better modals on mobile */
            .modal {
                padding: 0;
            }

            .modal-content {
                border-radius: var(--radius-lg) var(--radius-lg) 0 0;
                max-width: 100%;
                width: 100%;
                max-height: 90vh;
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
                animation: none;
                transform: translateY(100%);
                transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
                will-change: transform;
                backface-visibility: hidden;
            }

            /* Class added by openModalSmooth — safer than inline style */
            .modal-content.slide-open {
                transform: translateY(0) !important;
            }

            /* Hide less critical table columns on mobile */
            .col-messages, .col-relationship, .col-expected, .col-notes, .col-phone {
                display: none;
            }

            /* Prevent horizontal scroll on the table container */
            .table-responsive { overflow-x: hidden !important; }

            /* Fixed-layout table — fills screen exactly, no horizontal scroll */
            #guestsTable {
                table-layout: fixed !important;
                width: 100% !important;
                font-size: 0.85rem;
                min-width: 0 !important;
            }
            #guestsTable th { white-space: nowrap; overflow: hidden; text-overflow: clip; font-size: 0.72rem !important; padding: 6px 3px !important; }
            #guestsTable td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
            #guestsTable th:first-child,
            #guestsTable td:first-child { width: 8% !important; padding: 6px 2px; }
            /* name has no width — gets all remaining space after fixed % cols */
            .col-name    { min-width: 0 !important; width: 31% !important; padding: 6px 4px; font-weight: 600; }
            .col-status  { width: 18% !important; }
            .col-arriving { width: 15% !important; text-align: center; }
            .col-table   { width: 15% !important; text-align: center; }
            .col-actions-header { width: 13% !important; }
            .col-actions-cell { width: 13% !important; padding: 2px; }

            /* Swipeable modal indicator */
            .modal-header::before {
                content: '';
                position: absolute;
                top: 8px;
                left: 50%;
                transform: translateX(-50%);
                width: 36px;
                height: 4px;
                background: rgba(0, 0, 0, 0.2);
                border-radius: 2px;
            }

            .modal-header {
                padding-top: 1.5rem;
                position: relative;
            }

            /* Improve input fields on mobile */
            .form-control {
                font-size: 16px; /* Prevents zoom on iOS */
                min-height: 44px;
            }

            /* Better spacing for mobile cards */
            .settings-card,
            .relationship-card {
                margin-bottom: 1rem;
            }

            /* Improve checkbox and radio size */
            input[type="checkbox"],
            input[type="radio"] {
                min-width: 20px;
                min-height: 20px;
            }

            /* Better scrolling on mobile */
            .guests-table,
            .modal-body {
                -webkit-overflow-scrolling: touch;
            }

            /* Hide some decorative elements on mobile to save space */
            .guest-row .guest-relationship i {
                display: none;
            }

            /* Make tags more compact */
            .tag {
                padding: 4px 8px;
                font-size: 0.75rem;
            }
        }

        @media (max-width: 480px) {
            .top-header {
                padding: 0 1rem;
            }

            .header-actions .btn-action span {
                display: none;
            }

            .header-actions .btn-action i {
                margin: 0;
            }

            .icon-btn {
                margin-left: 2px;
            }

            th, td {
                padding: 0.75rem 0.5rem;
                font-size: 0.85rem;
            }

            .table-card {
                padding: 0.75rem;
            }

            /* התאמה לטלפונים קטנים */
            .sidebar {
                width: 85vw !important;
                max-width: 300px;
            }

            .sidebar.open ~ .main-content {
                transform: none !important;
            }

            /* Modal adjustments for small phones */
            .modal-content {
                width: 98%;
                max-height: 92vh;
            }

            .modal-header h2 {
                font-size: 1.1rem;
            }

            .modal-body {
                padding: 0.75rem;
            }

            /* Form elements */
            .form-group {
                margin-bottom: 0.75rem;
            }

            .form-label {
                font-size: 0.85rem;
            }

            /* Template grid */
            .template-grid {
                grid-template-columns: 1fr;
                gap: 0.75rem;
            }

            /* Seating table grid */
            .table-grid {
                grid-template-columns: 1fr !important;
            }

            .table-guests {
                grid-template-columns: 1fr !important;
            }

            /* Relationship dropdown (assign-guests modal) */
            .relationship-dropdown {
                min-width: unset;
                width: 90vw;
                right: 50%;
                transform: translateX(50%);
            }

            /* Both toolbar pickers become bottom sheets. Anchoring a 320px popover
               to a half-width trigger pushes it off screen, and a sheet is the
               pattern a thumb expects anyway. Each stays a DOM child of its own
               container, so the click-outside handlers keep working. */
            .table-picker,
            .rel-picker {
                position: fixed;
                top: auto;
                right: 0;
                left: 0;
                bottom: 0;
                width: auto;
                max-width: none;
                margin-top: 0;
                border-radius: 16px 16px 0 0;
                border-bottom: none;
                box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.22);
                z-index: 1200;
            }
            .table-picker-body, .rel-picker-body { max-height: 46vh; }
            .rel-row { padding: 13px 14px; }        /* thumb-sized rows */
            .table-picker-grid {
                grid-template-columns: repeat(5, 1fr);
                gap: 8px;
            }
            .table-tile { min-height: 46px; font-size: 0.95rem; }

            /* Stats grid */
            .stats-grid {
                gap: 0.75rem;
            }

            .stat-card {
                padding: 0.75rem;
            }

            /* Page content padding */
            .page-content {
                padding: 0.75rem;
            }
        }
        /* Animation for page transitions */
        .page-transition-enter {
            animation: pageFadeIn 0.3s ease;
        }

        @keyframes pageFadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .sidebar-toggle-btn {
        display: none;
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-md);
        transition: background 0.2s;
    }

    .sidebar-toggle-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    @media (max-width: 1200px) {
        .sidebar-toggle-btn {
            display: flex;
        }
    }

    /* Pagination buttons */
    .btn-sm {
        background: white;
        border: 1px solid var(--border);
        color: var(--secondary);
        padding: 6px 12px;
        border-radius: var(--radius-md);
        cursor: pointer;
        font-size: 0.9rem;
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 36px;
    }

    .btn-sm:hover:not(:disabled) {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
        transform: translateY(-1px);
    }

    .btn-sm:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

/* ─── Send-time calendar picker ───────────────────────────────── */
.send-calendar {
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    padding: 12px;
    background: white;
    max-width: 360px;
}
.send-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.send-cal-title { font-weight: 600; color: #111827; }
.send-cal-nav {
    background: #F3F4F6;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    width: 30px; height: 30px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}
.send-cal-nav:hover { background: #E5E7EB; }
.send-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.send-cal-dow {
    text-align: center;
    font-size: 0.75rem;
    color: #6B7280;
    padding: 4px 0;
    font-weight: 600;
}
.send-cal-day {
    text-align: center;
    padding: 8px 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #111827;
    border: 1px solid transparent;
}
.send-cal-day:hover:not(.send-cal-disabled) {
    background: #EEF2FF;
    border-color: #C7D2FE;
}
.send-cal-disabled {
    color: #9CA3AF;
    cursor: not-allowed;
    background: #F3F4F6;
}
.send-cal-sat { color: #6B7280; background: #F3F4F6; } /* was #9CA3AF: fails AA if ever shown non-disabled */
.send-cal-selected {
    background: #4F46E5 !important;
    color: white !important;
    border-color: #4F46E5 !important;
}
.send-cal-note {
    margin-top: 12px;
    font-size: 0.8rem;
    color: #6B7280;
}

/* ─── Per-person expense calculator: price × quantity = total ───
   One flex row on a wide screen. On a phone the numbers can be six digits long
   ("₪108,000"), so the row is allowed to break into three lines instead of
   clipping the total: [price × quantity] / [=] / [total]. */
.ppc-cell {
    text-align: center;
    padding: 0 1rem;
    min-width: 0;
}
.ppc-cell-total { flex: 1; }
.ppc-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.ppc-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}
.ppc-value-total { font-size: 2rem; }
.ppc-op {
    font-size: 1.5rem;
    color: #667eea;
    flex-shrink: 0;
    text-align: center;   /* stays centred when it takes a whole row on a phone */
}

/* ─── Mobile UI polish: sidebar backdrop blur + header + filters ─── */

.sidebar-backdrop {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@media (max-width: 1200px) {
    .sidebar-backdrop.open {
        display: block;
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 10px 14px;
        gap: 6px;
    }
    .page-title {
        flex: 1;
        min-width: 0;
        padding: 0 6px;
    }
    .page-title h1 {
        font-size: 1.05rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        letter-spacing: -0.3px;
    }
    .page-title p {
        font-size: 0.72rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-top: 1px;
    }
    .header-actions {
        gap: 6px;
    }
    .header-actions .btn-action {
        width: 40px;
        height: 40px;
        padding: 0;
        gap: 0;
        justify-content: center;
        border-radius: 12px;
        flex-shrink: 0;
    }
    .header-actions .btn-action i {
        margin: 0;
        font-size: 1rem;
    }
    .header-actions .btn-action span {
        display: none;
    }
    .header-actions .btn-primary {
        box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
    }

    .filter-select {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-color: #F8FAFC;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: left 14px center;
        padding: 12px 16px 12px 40px;
        border: 1px solid #E2E8F0;
        border-radius: 12px;
        font-weight: 600;
        font-size: 0.9rem;
        color: var(--text-main);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
        transition: all 0.2s ease;
    }
    .filter-select:hover,
    .filter-select:focus {
        background-color: white;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
    }
    .filter-select::-ms-expand {
        display: none;
    }
    .relationship-filter-container .filter-select i.fa-chevron-down,
    .table-filter-trigger i.fa-chevron-down {
        display: none;
    }

    .search-input {
        background: #F8FAFC;
        border-radius: 12px;
        padding: 12px 44px 12px 16px;
        font-weight: 500;
    }
    .search-input:focus {
        background: white;
    }

    /* Sidebar: hide invitation preview — removes empty space on mobile */
    .sidebar-invite-preview { display: none !important; }
    .sidebar-footer { margin-top: auto; }

    /* Expenses form: stack all fields vertically */
    #directAmountMode {
        grid-template-columns: 1fr !important;
    }
    #directAmountMode .btn-action {
        width: 100%;
        justify-content: center;
    }
    #perPersonMode > div:first-child {
        grid-template-columns: 1fr !important;
    }
    .expense-mode-toggle {
        width: 100%;
        justify-content: stretch;
    }
    .expense-mode-toggle button {
        flex: 1;
        text-align: center;
    }
    /* Expense form header: stack title + toggle on mobile */
    #expenseFormHeader {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    /* Automation: 1-column form grid */
    #automationFormGrid {
        grid-template-columns: 1fr !important;
    }

    /* Wedding detail cards: hide sub-labels on mobile */
    .detail-content p {
        display: none;
    }

    /* Wedding detail cards: date+location side by side, countdown full-width */
    .wedding-details-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    .wedding-detail-card:nth-child(3) {
        grid-column: 1 / -1;
    }
    .wedding-detail-card {
        padding: 0.75rem !important;
        gap: 0.5rem !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
    .detail-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.4rem !important;
        flex-shrink: 0;
    }
    .detail-content h4 {
        font-size: 0.85rem !important;
        line-height: 1.3;
    }

    /* Limits pills: הזמנה full-width, תזכורת+יום side by side */
    .wedding-limits-list {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        justify-items: center;
    }
    .wedding-limit-pill:first-child {
        grid-column: 1 / -1;
    }
    /* Center limits note on mobile */
    .wedding-limits-note {
        text-align: center;
    }
    .wedding-limits-header {
        justify-content: center;
    }

    /* Table-settings dialog action rows: equal-width pairs */
    .seating-settings-launch { gap: 0.5rem; }
    .seating-settings-btn { width: 100%; justify-content: center; }
    .seating-settings-hint { display: none; }
    .seating-action-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        width: 100%;
    }
    .seating-action-row .btn-action {
        width: 100% !important;
        justify-content: center !important;
    }
    .seating-action-row--single {
        grid-template-columns: 1fr !important;
    }

    /* Seating summary: 2-column grid on mobile */
    #tablesSummary {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Seating table: hide progress bar on mobile */
    .table-occupancy-section {
        display: none !important;
    }

    /* Seating guest pills: 2-column grid */
    .table-guests {
        grid-template-columns: 1fr 1fr !important;
    }
    .guest-pill {
        display: flex !important;
        width: 100% !important;
        justify-content: space-between !important;
        cursor: pointer;
    }

    /* Seating filter dropdowns: 2 per row */
    #seatingViewMode, #seatingRelFilterBtn, #seatingGuestSort {
        min-width: 0 !important;
        width: 100% !important;
        flex: 1 !important;
    }
    /* (was targeting :nth-child(3) — that index resolves to #tableBulkBar, not the
       filter bar. Now bound to the class so the rule reaches what it describes.) */
    .seating-filter-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .seating-filter-bar label {
        display: none;
    }

    /* Seating action buttons: stacked full-width */
    .seating-header-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    .seating-header .btn-action {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Seating stats cards: smaller label font to prevent wrapping */
    #tablesSummary > div > div:first-child {
        font-size: 0.78rem !important;
        white-space: nowrap;
    }

    /* Per-person calc display: stack on mobile, no overflow */
    #perPersonCalcDisplay {
        flex-direction: column !important;
        gap: 0.75rem;
        overflow: hidden;
    }
    #perPersonCalcDisplay .btn-action {
        width: 100% !important;
        justify-content: center !important;
        margin-right: 0 !important;
    }
    /* Let the row break instead of clipping the total (see .ppc-* base rules). */
    .per-person-calc-row {
        flex-wrap: wrap;
        gap: 0.4rem 0.5rem !important;
        justify-content: center;
        width: 100%;
    }
    .per-person-calc-row .ppc-cell {
        padding: 0 0.2rem !important;
    }
    .ppc-value {
        font-size: 1.25rem !important;
        white-space: nowrap;
    }
    .ppc-value-total {
        font-size: 1.6rem !important;
    }

    /* Status badge: prevent text cut */
    .status-badge {
        white-space: nowrap;
    }
    .col-status  { width: 22% !important; }
    .col-name    { width: 27% !important; padding: 6px 4px; font-weight: 600; }

    /* ─── Assign Modal — Mobile ─── */
    .assign-modal-content { max-width: 100% !important; }

    .assign-tabs-bar {
        display: flex;
        border-bottom: 2px solid var(--border);
        background: #F8FAFC;
        flex-shrink: 0;
    }
    .assign-tab-btn {
        flex: 1;
        padding: 12px;
        border: none;
        background: none;
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text-muted);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        border-bottom: 3px solid transparent;
        margin-bottom: -2px;
        transition: color 0.2s, border-color 0.2s;
    }
    .assign-tab-btn.active {
        color: var(--primary);
        border-bottom-color: var(--primary);
        background: #fff;
    }

    .assign-modal-body { padding: 0 !important; }
    .assign-panels-grid {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        gap: 0 !important;
    }
    .assign-panel {
        display: none;
        padding: 1rem;
        height: calc(100dvh * 0.55);
        max-height: 55dvh;
    }
    .assign-panel.tab-active { display: flex; }
    .assign-panel-guests { border-right: none !important; padding-right: 1rem !important; }

    /* Guest items: compact, dropdown full-width */
    #unassignedGuestsList .guest-item {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px;
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: 10px;
        margin-bottom: 8px;
        background: #fff;
    }
    #unassignedGuestsList .guest-item select {
        width: 100% !important;
        font-size: 0.9rem !important;
    }

    /* Table cards in assign modal: compact */
    #availableTablesList .table-card {
        padding: 10px 12px !important;
        margin-bottom: 8px !important;
    }
    #availableTablesList .table-card button {
        font-size: 0.85rem !important;
        padding: 8px 12px !important;
    }

    /* Relationship cards: single column, no overflow */
    #relationshipTypesList {
        grid-template-columns: 1fr !important;
        overflow-x: hidden;
    }
    .relationship-card {
        max-width: 100%;
        overflow: hidden;
    }
    .relationship-card-header {
        flex-wrap: wrap;
        overflow-x: hidden;
    }
    .relationship-name {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-word;
        white-space: normal;
    }
    /* Compact stat values in relationship card */
    .relationship-card .stat-value {
        font-size: 1.1rem !important;
    }

    /* Hide desktop selected-bar on mobile — replaced by FAB */
    .selected-bar { display: none !important; }

    /* ...except the seating bar: two actions fit a phone, so it keeps the pill
       instead of needing a FAB + sheet of its own. */
    .selected-bar--tables.is-visible { display: flex !important; }

    /* Grab handle — generous touch target above the 4px pill people actually see */
    .sheet-grab {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 28px;
        margin-bottom: 8px;
        cursor: grab;
    }
    .sheet-grab span {
        width: 44px;
        height: 5px;
        background: #CBD5E1;
        border-radius: 3px;
    }

    /* Selection bottom-sheet action buttons */
    .sheet-action-btn {
        width: 100%;
        padding: 13px 16px;
        border-radius: 12px;
        border: 1px solid #E2E8F0;
        background: #F8FAFC;
        color: #1E293B;
        font-size: 0.95rem;
        font-weight: 600;
        text-align: right;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .sheet-action-table { background: #EFF6FF; border-color: #BFDBFE; color: #1D4ED8; }
    .sheet-action-wa    { background: #F0FDF4; border-color: #BBF7D0; color: #15803D; }
    .sheet-action-delete { background: #FEF2F2; border-color: #FECACA; color: #DC2626; }
    .sheet-action-cancel { background: transparent; border: 1px solid #E2E8F0; color: #64748B; justify-content: center; }
}

/* Popover anchoring at the row's edge.
   .table-picker / .rel-picker are 322px wide and anchored `right: 0`, so in RTL they grow
   leftward from the trigger. The LAST control in the filter row sits at the viewport's left
   edge, so its popover grows straight past it and gets clipped by body{overflow-x:hidden}.
   Anchor the last one the other way so it opens inward instead — which control is last is a
   layout decision, so bind this to position rather than to a specific id. */
.toolbar-row > *:last-child .table-picker,
.toolbar-row > *:last-child .rel-picker,
.seating-filter-row > *:last-child .rel-picker {
    right: auto;
    left: 0;
}

/* Phone-width per-person calculator: there is never room for one line, so pin the
   break points instead of leaving them to chance. flex-basis:100% on the "=" pushes
   it — and the total after it — onto their own rows:

       מחיר למנה  ×  כמות
             =
            סה"כ

   Above this width the row wraps only if the numbers actually run out of space. */
@media (max-width: 600px) {
    .per-person-calc-row .ppc-op-eq,
    .per-person-calc-row .ppc-cell-total {
        flex: 0 0 100%;
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   SITE TOUR MODAL — "סיור באתר"
   Everything below is scoped under #siteTourModal so it can never leak
   onto the rest of the dashboard, and can never be overridden BY it either
   (an ID-prefixed selector always beats a bare .class rule). The one name
   that would otherwise collide with the app's own .sidebar is deliberately
   called .tour-sidebar instead — not just style-scoped, but a different
   class entirely, so a stray `document.querySelector('.sidebar')`
   elsewhere in the app can never grab this one by accident.
   ═══════════════════════════════════════════════════════════════════════ */
#siteTourModal .modal-content{ width:min(97vw, 1220px); max-width:none; height:min(95vh, 820px); max-height:none; padding:0; }
#siteTourModal .modal-body{ padding:0; overflow:hidden; }
#siteTourModal .modal-header{ padding:.85rem 1.4rem; }

#siteTourModal{
    --tour-bg:#F1F5F9; --tour-surface:#FFFFFF; --tour-surface-2:#F8FAFC; --tour-surface-3:#EEF2FF;
    --tour-ink:#1E293B; --tour-ink-dim:#64748B; --tour-ink-faint:#94A3B8;
    --tour-border:#E2E8F0;
    --tour-indigo:#4F46E5; --tour-indigo-dark:#4338CA; --tour-indigo-ink:#FFFFFF;
    --tour-warning:#D97706;
    --tour-danger:#DC2626;
    --tour-shadow-md: 0 8px 20px -8px rgba(15,23,42,.14);
    --tour-shadow-lg: 0 20px 45px -15px rgba(15,23,42,.16);
    --tour-rail-dot:#CBD5E1;
}
#siteTourModal .tour-wrap{ direction:rtl; font-family:'Assistant','Segoe UI',system-ui,sans-serif; color:var(--tour-ink); background:var(--tour-bg); height:100%; display:flex; flex-direction:column; overflow:hidden; }
#siteTourModal .tour-wrap *{ box-sizing:border-box; }
#siteTourModal .tour-wrap h1, #siteTourModal .tour-wrap h2, #siteTourModal .tour-wrap h3{ text-wrap:balance; margin:0; }
#siteTourModal .tour-wrap p{ line-height:1.6; color:var(--tour-ink-dim); font-size:clamp(.85rem,1.6vh,1.02rem); margin:0; }

#siteTourModal .tour-header{ flex:none; display:flex; align-items:center; justify-content:space-between; padding:.6rem 1.3rem; border-bottom:1px solid var(--tour-border); background:var(--tour-surface); }
#siteTourModal .tour-header .tour-brand{ font-weight:800; font-size:.88rem; color:var(--tour-ink); }
#siteTourModal .tour-header .tour-brand b{ color:var(--tour-indigo); }
#siteTourModal .tour-toc-link{ font-size:.78rem; font-weight:700; color:var(--tour-indigo); background:var(--tour-surface-3); border:none; border-radius:999px; padding:.32rem .85rem; cursor:pointer; font-family:inherit; }
#siteTourModal .tour-counter{ direction:ltr; font-size:.74rem; color:var(--tour-ink-faint); }

#siteTourModal .tour-body-row{ flex:1 1 auto; min-height:0; display:flex; overflow:hidden; }

#siteTourModal .tour-sidebar{ flex:none; width:14.5rem; background:var(--tour-surface-2); border-inline-start:1px solid var(--tour-border); padding:.85rem .7rem; display:flex; flex-direction:column; gap:.2rem; overflow-y:auto; }
#siteTourModal .tour-sidebar-item{ font-family:inherit; text-align:start; cursor:pointer; border:none; background:none; color:var(--tour-ink-dim); border-radius:.55rem; padding:.5rem .7rem; font-size:.82rem; font-weight:600; display:flex; align-items:center; gap:.5rem; transition:background .15s ease, color .15s ease; }
#siteTourModal .tour-sidebar-item i{ width:1rem; text-align:center; color:var(--tour-ink-faint); font-size:.85rem; }
#siteTourModal .tour-sidebar-item:hover{ background:var(--tour-surface); color:var(--tour-ink); }
#siteTourModal .tour-sidebar-item.active{ background:var(--tour-surface-3); color:var(--tour-indigo-dark); }
#siteTourModal .tour-sidebar-item.active i{ color:var(--tour-indigo); }
#siteTourModal .tour-sidebar-item.sub{ padding-inline-start:2.1rem; font-size:.76rem; font-weight:500; color:var(--tour-ink-faint); position:relative; padding-top:.35rem; padding-bottom:.35rem; }
#siteTourModal .tour-sidebar-item.sub::before{ content:"–"; position:absolute; inset-inline-start:1.3rem; color:var(--tour-rail-dot); }
#siteTourModal .tour-sidebar-item.sub.active{ color:var(--tour-indigo-dark); font-weight:700; }
#siteTourModal .tour-sidebar-item.sub.active::before{ color:var(--tour-indigo); }
#siteTourModal .tour-sidebar-divider{ height:1px; background:var(--tour-border); margin:.45rem .25rem; }
#siteTourModal .tour-sidebar-title{ font-size:.68rem; font-weight:700; color:var(--tour-ink-faint); text-transform:uppercase; letter-spacing:.06em; padding:.35rem .7rem 0; }

#siteTourModal .tour-viewport{ flex:1 1 auto; min-height:0; overflow:hidden; position:relative; }
#siteTourModal .tour-track{ direction:ltr; display:flex; height:100%; transition:transform .45s cubic-bezier(.65,0,.35,1); }
@media (prefers-reduced-motion: reduce){ #siteTourModal .tour-track{ transition:none; } }

/* overflow-y:auto is a safety net, not the plan — every slide is sized to
   fit without it on a normal screen. It only kicks in on a short/zoomed
   viewport, where a quiet scrollbar beats silently clipped content. */
#siteTourModal .tour-panel{ flex:0 0 100%; width:100%; height:100%; overflow-y:auto; overflow-x:hidden; direction:rtl; position:relative; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; padding:clamp(.8rem,2.6vh,1.7rem) clamp(1rem,3.2vw,2.4rem); }
#siteTourModal .tour-panel.cover, #siteTourModal .tour-panel.divider{ justify-content:center; }
#siteTourModal .tour-panel:not(.cover):not(.divider) .tour-inner{ margin-top:clamp(.2rem,1.4vh,.7rem); }
#siteTourModal .tour-inner{ width:100%; max-width:58rem; opacity:0; transform:translateY(10px); transition:opacity .5s ease, transform .5s ease; }
#siteTourModal .tour-panel.active .tour-inner{ opacity:1; transform:translateY(0); }
@media (prefers-reduced-motion: reduce){ #siteTourModal .tour-inner{ transition:none; opacity:1; transform:none; } }

#siteTourModal .tour-footer{ flex:none; display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.55rem 1.3rem; border-top:1px solid var(--tour-border); background:var(--tour-surface); }
#siteTourModal .tour-navbtn{ font-family:inherit; cursor:pointer; border:1px solid var(--tour-border); background:var(--tour-surface); color:var(--tour-ink); border-radius:999px; padding:.4rem 1.05rem; font-size:.8rem; font-weight:700; display:inline-flex; align-items:center; gap:.4rem; transition:background .15s ease; }
#siteTourModal .tour-navbtn:hover:not(:disabled){ background:var(--tour-surface-2); }
#siteTourModal .tour-navbtn:disabled{ opacity:.3; cursor:default; }
#siteTourModal .tour-footer-title{ font-size:.78rem; font-weight:700; color:var(--tour-ink-dim); }

/* Deliberately NOT an uppercase/tracked "eyebrow" — that reads as slide-deck
   chrome. Styled the same way the real dashboard labels a page (e.g.
   "ניהול אורחים" / "ניהול אישורי הגעה וסידורי הושבה"): a plain muted line,
   sentence case, no letter-spacing, no decorative dash. */
#siteTourModal .tour-eyebrow{ font-size:clamp(.78rem,1.5vh,.88rem); font-weight:500; color:var(--tour-ink-dim); margin-bottom:.3rem; }
#siteTourModal .tour-heading-row{ display:flex; align-items:baseline; justify-content:space-between; gap:1rem; flex-wrap:wrap; margin-bottom:clamp(.6rem,1.8vh,1.1rem); }
#siteTourModal .tour-heading-row h2{ font-size:clamp(1.1rem,2.4vh,1.6rem); }

/* A single-slide topic has no divider slide of its own — this heading
   carries that "new chapter" weight directly, so jumping to it from the
   sidebar or TOC lands somewhere that still reads as a chapter opener. */
#siteTourModal .tour-chapter-head{ display:flex; align-items:center; gap:.6rem; margin-bottom:.15rem; }
#siteTourModal .tour-chapter-icon{ flex:none; width:2.1rem; height:2.1rem; border-radius:50%; background:var(--tour-surface-3); color:var(--tour-indigo); display:flex; align-items:center; justify-content:center; font-size:.95rem; }
#siteTourModal .tour-chapter-head h2{ font-size:clamp(1.15rem,2.6vh,1.7rem); font-weight:800; }

#siteTourModal .tour-chip{ display:inline-flex; align-items:center; gap:.4rem; background:var(--tour-surface-3); color:var(--tour-indigo-dark); border:1px solid var(--tour-border); border-radius:999px; padding:.28rem .75rem; font-size:.76rem; font-weight:700; }
#siteTourModal .tour-stripe{ border-inline-start:3px solid var(--tour-indigo); background:var(--tour-surface); border-radius:.55rem; padding:clamp(.5rem,1.5vh,.85rem) 1rem; box-shadow:var(--tour-shadow-md); }
#siteTourModal .tour-stripe.warn{ border-inline-start-color:var(--tour-warning); }
#siteTourModal .tour-stripe.danger{ border-inline-start-color:var(--tour-danger); }
#siteTourModal .tour-stripe b{ color:var(--tour-ink); }
#siteTourModal .tour-stripe p{ margin-top:.2rem; font-size:clamp(.74rem,1.4vh,.84rem); }

#siteTourModal .tour-split{ display:grid; grid-template-columns:1.15fr .85fr; gap:clamp(.9rem,2.6vw,1.8rem); align-items:center; width:100%; }
@media (max-width:60rem){ #siteTourModal .tour-split{ grid-template-columns:1fr; } }

#siteTourModal .tour-shotcard{ background:var(--tour-surface); border:1px solid var(--tour-border); border-radius:14px; padding:.65rem; box-shadow:var(--tour-shadow-lg); text-align:center; }
/* .tour-shot-frame shrink-wraps the image (display:inline-block, not a fixed
   width:100%) so the frame and the <img> always share the exact same box —
   the numbered rects are positioned as % of THIS box, so if frame and image
   ever disagreed on size the callouts would drift off their targets. Capping
   the image's height (not stretching every screenshot to fill its column)
   keeps the tallest ones — e.g. the guest table — from pushing the slide
   past the viewport, while every rect still lands correctly regardless of
   how large the image itself ends up rendering. */
#siteTourModal .tour-shot-frame{ position:relative; display:inline-block; max-width:100%; line-height:0; border-radius:9px; overflow:hidden; background:var(--tour-surface-2); }
#siteTourModal .tour-shot-frame img{ display:block; width:auto; max-width:100%; height:auto; max-height:min(40vh, 370px); }
#siteTourModal .tour-shot-rect{ position:absolute; border:1.5px solid rgba(79,70,229,.62); border-radius:9px; background:rgba(79,70,229,.045); pointer-events:none; }
#siteTourModal .tour-shot-rect.pill{ border-radius:999px; }
#siteTourModal .tour-shot-num{ position:absolute; width:1.35rem; height:1.35rem; border-radius:50%; background:var(--tour-indigo); color:var(--tour-indigo-ink); font-weight:800; font-size:.72rem; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 6px rgba(15,23,42,.3); transform:translate(-50%,-50%); z-index:3; }
#siteTourModal .tour-shot-num.corner{ transform:translate(50%,-50%); }

#siteTourModal .tour-legend{ display:flex; flex-direction:column; gap:clamp(.35rem,1.2vh,.6rem); }
#siteTourModal .tour-legend-item{ display:flex; gap:.65rem; align-items:flex-start; }
#siteTourModal .tour-legend-item .n{ flex:none; width:1.3rem; height:1.3rem; border-radius:50%; background:var(--tour-indigo); color:var(--tour-indigo-ink); font-size:.7rem; font-weight:800; display:flex; align-items:center; justify-content:center; margin-top:.1rem; }
#siteTourModal .tour-legend-item b{ display:block; font-size:clamp(.78rem,1.5vh,.87rem); color:var(--tour-ink); }
#siteTourModal .tour-legend-item span{ font-size:clamp(.7rem,1.3vh,.79rem); color:var(--tour-ink-dim); }

#siteTourModal .tour-tabbar{ display:flex; gap:.45rem; margin-bottom:clamp(.5rem,1.6vh,1rem); flex-wrap:wrap; }
#siteTourModal .tour-tabbtn{ font-family:inherit; cursor:pointer; border:1px solid var(--tour-border); background:var(--tour-surface); color:var(--tour-ink-dim); border-radius:999px; padding:.4rem 1rem; font-size:.78rem; font-weight:700; transition:all .15s ease; }
#siteTourModal .tour-tabbtn.active{ background:var(--tour-indigo); border-color:var(--tour-indigo); color:var(--tour-indigo-ink); }
#siteTourModal .tour-tabbtn .badge-android{ font-size:.68rem; opacity:.85; margin-inline-start:.3rem; }
#siteTourModal .tour-tabpanel{ display:none; }
#siteTourModal .tour-tabpanel.active{ display:block; }

#siteTourModal .tour-bridge{ display:flex; align-items:center; justify-content:center; gap:.75rem; flex-wrap:wrap; margin:clamp(.7rem,1.8vh,1.3rem) 0; }
#siteTourModal .tour-bubble{ background:var(--tour-surface); border:1px solid var(--tour-border); border-radius:1.1rem; padding:.65rem 1.15rem; box-shadow:var(--tour-shadow-md); text-align:center; min-width:7.5rem; }
#siteTourModal .tour-bubble .num{ width:1.5rem; height:1.5rem; border-radius:50%; background:var(--tour-indigo); color:var(--tour-indigo-ink); font-weight:800; font-size:.78rem; display:flex; align-items:center; justify-content:center; margin:0 auto .35rem; }
#siteTourModal .tour-bubble b{ display:block; font-size:.84rem; } #siteTourModal .tour-bubble span{ font-size:.68rem; color:var(--tour-ink-dim); }
#siteTourModal .tour-bridge .arrow{ color:var(--tour-ink-faint); font-size:1.1rem; }

#siteTourModal .tour-tips-grid{ display:grid; grid-template-columns:1fr 1fr; gap:clamp(.4rem,1.4vh,.7rem); }
@media (max-width:52rem){ #siteTourModal .tour-tips-grid{ grid-template-columns:1fr; } }
#siteTourModal .tour-tip-card{ border-inline-start:3px solid var(--tour-indigo); background:var(--tour-surface); border-radius:.55rem; padding:clamp(.45rem,1.4vh,.75rem) .9rem; box-shadow:var(--tour-shadow-md); }
#siteTourModal .tour-tip-card b{ display:flex; align-items:center; gap:.45rem; font-size:clamp(.76rem,1.5vh,.85rem); margin-bottom:.2rem; color:var(--tour-ink); }
#siteTourModal .tour-tip-card b i{ color:var(--tour-indigo); width:1rem; text-align:center; }
#siteTourModal .tour-tip-card span{ font-size:clamp(.68rem,1.3vh,.77rem); color:var(--tour-ink-dim); }

#siteTourModal .tour-faq-list{ display:flex; flex-direction:column; gap:clamp(.35rem,1vh,.55rem); }
#siteTourModal .tour-faq-item{ background:var(--tour-surface); border:1px solid var(--tour-border); border-radius:.6rem; overflow:hidden; }
#siteTourModal .tour-faq-q{ width:100%; text-align:start; font-family:inherit; background:none; border:none; color:var(--tour-ink); font-size:clamp(.78rem,1.6vh,.9rem); font-weight:700; padding:clamp(.5rem,1.5vh,.8rem) 1rem; cursor:pointer; display:flex; justify-content:space-between; align-items:center; gap:1rem; }
#siteTourModal .tour-faq-q .plus{ flex:none; width:1.3rem; height:1.3rem; border-radius:50%; border:1px solid var(--tour-border); display:flex; align-items:center; justify-content:center; color:var(--tour-indigo); font-size:.9rem; transition:transform .2s ease; }
#siteTourModal .tour-faq-item.open .plus{ transform:rotate(45deg); }
#siteTourModal .tour-faq-a{ max-height:0; overflow:hidden; transition:max-height .25s ease; }
#siteTourModal .tour-faq-item.open .tour-faq-a{ max-height:9rem; }
#siteTourModal .tour-faq-a-inner{ padding:0 1rem clamp(.5rem,1.5vh,.9rem); font-size:clamp(.7rem,1.3vh,.8rem); color:var(--tour-ink-dim); line-height:1.5; }

#siteTourModal .tour-panel.cover{ text-align:center; position:relative; overflow:hidden; }
#siteTourModal .tour-cover-backdrop{ position:absolute; inset:0; z-index:0; }
#siteTourModal .tour-cover-backdrop img{ width:100%; height:100%; object-fit:cover; object-position:top; filter:blur(4px) brightness(1.12) saturate(.85); opacity:.5; transform:scale(1.06); }
#siteTourModal .tour-cover-backdrop::after{ content:""; position:absolute; inset:0; background:radial-gradient(60% 55% at 50% 38%, rgba(241,245,249,.5), var(--tour-bg) 88%); }
#siteTourModal .tour-panel.cover .tour-inner{ position:relative; z-index:1; }
#siteTourModal .tour-panel.cover .tour-wordmark{ font-weight:800; font-size:clamp(.9rem,2vh,1.15rem); letter-spacing:-.01em; direction:ltr; color:var(--tour-ink-dim); margin-bottom:.7rem; }
#siteTourModal .tour-panel.cover .tour-wordmark b{ color:var(--tour-indigo); }
#siteTourModal .tour-panel.cover h1{ font-weight:800; font-size:clamp(1.7rem,5.5vh,3rem); }
#siteTourModal .tour-panel.cover .tour-tagline{ font-size:clamp(.82rem,1.8vh,1.02rem); color:var(--tour-ink); margin-top:.75rem; max-width:32rem; margin-inline:auto; }
#siteTourModal .tour-panel.cover .tour-scope-chip{ margin-top:clamp(.8rem,2vh,1.4rem); display:inline-flex; }
#siteTourModal .tour-enter-btn{ margin-top:clamp(1rem,2.4vh,1.6rem); font-family:inherit; cursor:pointer; border:none; background:var(--tour-indigo); color:#fff; border-radius:999px; padding:.6rem 1.5rem; font-size:.85rem; font-weight:700; box-shadow:var(--tour-shadow-md); }

#siteTourModal .tour-panel.divider{ text-align:center; }
#siteTourModal .tour-panel.divider .divnum{ font-size:clamp(.78rem,1.8vh,.95rem); color:var(--tour-indigo); font-weight:700; direction:ltr; margin-bottom:.5rem; }
#siteTourModal .tour-panel.divider h2{ font-size:clamp(1.5rem,4.8vh,2.6rem); font-weight:800; }
#siteTourModal .tour-panel.divider p{ margin-top:.7rem; font-size:clamp(.82rem,1.7vh,.98rem); max-width:30rem; margin-inline:auto; }
#siteTourModal .tour-panel.divider .icon{ font-size:clamp(1.8rem,4.8vh,2.8rem); margin-bottom:.4rem; color:var(--tour-indigo); }

#siteTourModal .tour-toc-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:clamp(.5rem,1.6vh,.9rem); }
@media (max-width:56rem){ #siteTourModal .tour-toc-grid{ grid-template-columns:1fr 1fr; } }
#siteTourModal .tour-toc-card{ background:var(--tour-surface); border:1px solid var(--tour-border); border-radius:12px; padding:clamp(.7rem,1.8vh,1.05rem) clamp(.7rem,1.4vw,1rem); box-shadow:var(--tour-shadow-md); cursor:pointer; text-align:start; font-family:inherit; display:flex; flex-direction:column; gap:.3rem; transition:transform .15s ease, box-shadow .15s ease; }
#siteTourModal .tour-toc-card:hover{ transform:translateY(-2px); box-shadow:var(--tour-shadow-lg); border-color:var(--tour-indigo); }
#siteTourModal .tour-toc-card .n{ font-size:.68rem; color:var(--tour-indigo); font-weight:700; }
#siteTourModal .tour-toc-card .t{ font-size:clamp(.8rem,1.7vh,.94rem); font-weight:800; color:var(--tour-ink); display:flex; align-items:center; gap:.4rem; }
#siteTourModal .tour-toc-card .t i{ color:var(--tour-indigo); width:1.1rem; text-align:center; }
#siteTourModal .tour-toc-card .d{ font-size:clamp(.68rem,1.3vh,.76rem); color:var(--tour-ink-dim); line-height:1.4; }

@media (max-width: 768px){
    #siteTourModal .modal-content{ width:100%; height:100dvh; max-height:100dvh; border-radius:0; }
    #siteTourModal .tour-body-row{ flex-direction:column; }
    #siteTourModal .tour-sidebar{ display:none; }
}

/* ── Send window: who is selected, and what happened after the send (2026-10-05) ── */
.recipient-breakdown { margin: 0.35rem 0 0.5rem; font-size: 0.85rem; color: var(--text-muted); }
.recipient-breakdown b { color: var(--text-dark); }
.choice-buttons { display: flex; flex-direction: column; gap: 0.6rem; }
.choice-buttons .btn-action { width: 100%; justify-content: center; }
.send-results { padding: 14px 20px 10px; border-top: 1px solid #E0E7FF; }
.send-results-head { font-weight: 700; color: #4338CA; margin-bottom: 0.6rem; }
.send-results-counts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.7rem; }
.send-results-counts span { padding: 4px 10px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.sr-ok { background: #DCFCE7; color: #166534; }
.sr-wait { background: #FEF3C7; color: #92400E; }
.sr-fail { background: #FEE2E2; color: #991B1B; }
.send-results h4 { font-size: 0.88rem; margin: 0.7rem 0 0.35rem; }
.send-results ul { list-style: none; margin: 0; padding: 0; max-height: 160px; overflow-y: auto; }
.send-results li { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.3rem 0; border-bottom: 1px solid #F1F5F9; font-size: 0.85rem; }
.send-results li button { flex-shrink: 0; font-size: 0.78rem; padding: 3px 9px; border-radius: 8px; border: 1px solid #C7D2FE; background: #EEF2FF; color: #4338CA; cursor: pointer; }
.send-results-note { font-size: 0.78rem; color: var(--text-muted); margin: 0.6rem 0 0; }
