/* FAB & Chat Widget - shared */
/* ── FAB Container ── */
        #fab-container {
            position: fixed;
            left: 20px;
            bottom: 30px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
        }

        /* ── Base FAB Button ── */
        .fab-btn {
            width: 52px;
            height: 52px;
            border-radius: 50%;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.25);
            transition: transform 0.25s ease, box-shadow 0.25s ease;
            position: relative;
            flex-shrink: 0;
        }
        .fab-btn:hover {
            transform: scale(1.12);
            box-shadow: 0 8px 30px rgba(0,0,0,0.35);
        }
        .fab-btn:active { transform: scale(0.95); }

        /* ── Tooltip label ── */
        .fab-btn::before {
            content: attr(data-tip);
            position: absolute;
            left: calc(100% + 10px);
            top: 50%;
            transform: translateY(-50%);
            background: #1d2531;
            color: #fff;
            font-size: 11px;
            font-weight: 600;
            white-space: nowrap;
            padding: 4px 10px;
            border-radius: 6px;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease;
            font-family: 'Cairo', sans-serif;
        }
        .fab-btn:hover::before { opacity: 1; }
        .fab-btn.active::before,
        .fab-btn.active:hover::before { opacity: 0 !important; }
        #fab-container.fab-hidden {
            opacity: 0;
            pointer-events: none;
            visibility: hidden;
        }
        html.light .fab-btn::before { background: #333; }

        /* Colors */
        #fab-share  { background: #5caf90; color: #fff; }
        #fab-chat   { background: #6366f1; color: #fff; }
        #fab-contact{ background: #22c55e; color: #fff; }

        /* ── Share Fan-out Menu ── */
        #share-menu {
            position: absolute;
            left: 62px;
            bottom: 0;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
        }
        #share-menu.open { pointer-events: all; }

        .share-item {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(0,0,0,0.2);
            text-decoration: none;
            border: none;
            opacity: 0;
            transform: translateX(-20px) scale(0.6);
            transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
        }
        .share-item:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.3); transform: scale(1.1) !important; }
        #share-menu.open .share-item {
            opacity: 1;
            transform: translateX(0) scale(1);
        }
        #share-menu.open .share-item:nth-child(1) { transition-delay: 0.05s; }
        #share-menu.open .share-item:nth-child(2) { transition-delay: 0.10s; }
        #share-menu.open .share-item:nth-child(3) { transition-delay: 0.15s; }
        #share-menu.open .share-item:nth-child(4) { transition-delay: 0.20s; }
        #share-menu.open .share-item:nth-child(5) { transition-delay: 0.25s; }
        #share-menu.open .share-item:nth-child(6) { transition-delay: 0.30s; }

        /* ── Contact Sub-menu ── */
        #contact-menu {
            position: absolute;
            left: 62px;
            bottom: 0;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
        }
        #contact-menu.open { pointer-events: all; }

        .contact-item {
            display: flex;
            align-items: center;
            gap: 8px;
            opacity: 0;
            transform: translateX(-20px);
            transition: opacity 0.3s ease, transform 0.3s ease;
            text-decoration: none;
            white-space: nowrap;
        }
        #contact-menu.open .contact-item { opacity: 1; transform: translateX(0); }
        #contact-menu.open .contact-item:nth-child(1) { transition-delay: 0.05s; }
        #contact-menu.open .contact-item:nth-child(2) { transition-delay: 0.12s; }
        #contact-menu.open .contact-item:nth-child(3) { transition-delay: 0.19s; }

        .contact-icon {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            flex-shrink: 0;
            box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        }
        .contact-label {
            background: #1d2531;
            color: #fff;
            font-size: 11px;
            font-weight: 700;
            padding: 4px 10px;
            border-radius: 6px;
            font-family: 'Cairo', sans-serif;
        }
        html.light .contact-label { background: #333; }

        /* ── Chatbot Widget ── */
        #chat-widget {
            position: fixed;
            left: 82px;
            bottom: 110px;
            width: 360px;
            height: 520px;
            max-height: 80vh;
            background: #ffffff;
            border: 1px solid rgba(0, 0, 0, 0.08);
            border-radius: 20px;
            box-shadow: 0 16px 60px rgba(0,0,0,0.1);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            z-index: 9998;
            opacity: 0;
            transform: scale(0.85) translateY(20px);
            transform-origin: bottom left;
            pointer-events: none;
            transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }
        #chat-widget.open {
            opacity: 1;
            transform: scale(1) translateY(0);
            pointer-events: all;
        }
        .dark #chat-widget { 
            background: #1d2531; 
            border-color: rgba(255, 255, 255, 0.08); 
            box-shadow: 0 16px 60px rgba(0,0,0,0.4); 
        }

        #chat-header {
            background: #f8f8fb;
            border-bottom: 1px solid rgba(0, 0, 0, 0.06);
            padding: 16px 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            flex-shrink: 0;
        }
        .dark #chat-header {
            background: #17181c;
            border-bottom-color: rgba(255, 255, 255, 0.06);
        }
        #chat-header .chat-avatar {
            width: 40px; height: 40px;
            border-radius: 50%;
            background: rgba(92, 175, 144, 0.15);
            display: flex; align-items: center; justify-content: center;
            font-size: 18px; color: #5caf90;
            flex-shrink: 0;
        }
        #chat-header .chat-info {
            flex: 1;
            min-width: 0;
            padding-inline-end: 12px;
        }
        #chat-header .chat-info h4 {
            font-size: 14px;
            font-weight: 700;
            color: #333;
            margin: 0;
            line-height: 1.3;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .dark #chat-header .chat-info h4 { color: #dedee0; }
        #chat-header .chat-info p  { font-size: 11px; color: #5caf90; margin: 0; font-weight: 500; }
        #chat-close-btn {
            margin-inline-start: auto;
            flex-shrink: 0;
            background: none; border: none;
            color: #888;
            cursor: pointer; font-size: 16px;
            padding: 6px;
            line-height: 1;
            transition: color 0.2s;
        }
        #chat-close-btn:hover { color: #5caf90; }

        #chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            scroll-behavior: smooth;
        }
        .chat-bubble {
            max-width: 85%;
            padding: 10px 14px;
            border-radius: 14px;
            font-size: 13px;
            line-height: 1.7;
            font-family: 'Cairo', 'Poppins', sans-serif;
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        .chat-bubble.bot {
            background: #f8f8fb;
            color: #333;
            border: 1px solid rgba(0, 0, 0, 0.05);
            border-bottom-left-radius: 4px;
            align-self: flex-start;
        }
        .chat-bubble.bot p {
            margin: 0 0 0.55em;
        }
        .chat-bubble.bot p:last-child {
            margin-bottom: 0;
        }
        .chat-bubble.bot ul,
        .chat-bubble.bot ol {
            margin: 0.4em 0 0.2em;
            padding-inline-start: 1.2em;
        }
        .chat-bubble.bot li {
            margin: 0.25em 0;
        }
        .chat-bubble.bot a {
            color: #5caf90;
            text-decoration: underline;
            font-weight: 600;
        }
        .chat-bubble.bot strong {
            font-weight: 700;
            color: inherit;
        }
        .dark class .chat-bubble.bot { 
            /* Placeholder for selector safety */
        }
        .dark #chat-messages .chat-bubble.bot {
            background: #17181c;
            color: #dedee0;
            border: 1px solid rgba(255, 255, 255, 0.05);
        }
        .dark #chat-messages .chat-bubble.bot a {
            color: #78c2a5;
        }
        .chat-bubble.user {
            background: #5caf90;
            color: #fff;
            border-bottom-right-radius: 4px;
            align-self: flex-end;
            box-shadow: 0 4px 12px rgba(92, 175, 144, 0.2);
        }

        .chat-quick-btns {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            padding: 0 20px 16px;
        }
        .chat-quick-btn {
            background: rgba(92, 175, 144, 0.05);
            color: #3e7d66;
            border: 1px solid rgba(92, 175, 144, 0.2);
            border-radius: 20px;
            font-size: 12px;
            padding: 6px 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            font-family: 'Cairo', sans-serif;
            white-space: nowrap;
        }
        .dark .chat-quick-btn { 
            background: rgba(92, 175, 144, 0.08); 
            color: #5caf90; 
            border-color: rgba(92, 175, 144, 0.25); 
        }
        .chat-quick-btn:hover { 
            background: #5caf90; 
            color: #fff; 
            border-color: #5caf90;
            transform: translateY(-1px);
        }

        #chat-input-area {
            display: flex;
            align-items: center;
            border-top: 1px solid rgba(0, 0, 0, 0.06);
            flex-shrink: 0;
            background: #f8f8fb;
            padding: 4px;
            min-height: 52px;
        }
        .dark #chat-input-area { 
            border-top-color: rgba(255, 255, 255, 0.06); 
            background: #17181c; 
        }
        #chat-input {
            flex: 1;
            background: transparent;
            border: none;
            outline: none;
            padding: 14px 16px;
            font-size: 13px;
            color: #333;
            font-family: 'Cairo', 'Poppins', sans-serif;
        }
        .dark #chat-input { color: #dedee0; }
        #chat-input::placeholder { color: #6b7280; }
        #chat-send-btn {
            background: none; border: none;
            color: #5caf90; font-size: 18px;
            padding: 0 16px; cursor: pointer;
            transition: color 0.2s, transform 0.2s;
        }
        #chat-send-btn:hover { color: #78c2a5; transform: scale(1.15); }

        /* ── Pulse animation on FAB ── */
        @keyframes fab-pulse {
            0%, 100% { box-shadow: 0 4px 20px rgba(92,175,144,0.4); }
            50% { box-shadow: 0 4px 30px rgba(92,175,144,0.8), 0 0 0 8px rgba(92,175,144,0.1); }
        }
        #fab-share { animation: fab-pulse 2.5s ease-in-out infinite; }
        #fab-share.active { animation: none; }

        /* ── Rotate icon when share open ── */
        #fab-share.active i { transform: rotate(45deg); }
        #fab-share i, #fab-contact i { transition: transform 0.3s ease; }
        #fab-contact.active i { transform: rotate(45deg); }

        @media (max-width: 500px) {
            #chat-widget {
                left: 16px;
                right: 16px;
                width: auto;
                bottom: 24px;
                max-height: min(70vh, calc(100dvh - 100px));
                height: auto;
                min-height: 360px;
            }
        }