/* ================================================================
   melikhaya-light-theme-v2.css
   ── AWARD-WORTHY EDITORIAL LIGHT THEME ──
   COMPLETE OVERRIDE. Drop AFTER melikhaya.css.
   No JS changes. No HTML changes to existing structure.

   Design DNA:
   Apple VisionOS glass × Vogue editorial masthead ×
   Sotheby's property brochure × Linear precision ×
   South African property intelligence prestige.

   Brand: #1A1D20 · #F58220 · #56C4F8
================================================================ */

/* ═══════════════════════════════════════════════════════
   FONTS — Extended editorial stack
═══════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300;1,9..40,400&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400;1,600&display=swap');

/* ═══════════════════════════════════════════════════════
   1. GLOBAL LIGHT TOKEN SYSTEM
   Scoped to the full chatbot surface tree
═══════════════════════════════════════════════════════ */
.mel-window,
.mel-titlebar,
.mel-header,
.mel-header-bg,
.mel-header-glass,
.mel-chips-container,
.mel-messages-wrapper,
.mel-input-area,
.mel-scroll-controls,
.mel-minimised-pill {
    --mel-text-primary: #1A1D20;
    --mel-text-secondary: rgba(26,29,32,0.78);
    --mel-text-tertiary: rgba(26,29,32,0.48);
    --mel-glass-border: rgba(26,29,32,0.08);
    --mel-glass-border-strong: rgba(26,29,32,0.15);
    --mel-glass-light: rgba(255,255,255,0.75);
    --mel-glass-shine: rgba(255,255,255,0.92);
    --mel-surface-void: #F4F2EF;
    --mel-surface-base: #FDFCFB;
    --mel-surface-raised: #FFFFFF;
    --mel-surface-overlay: rgba(253,252,251,0.96);
    --mel-shadow-sm: 0 1px 3px rgba(26,29,32,0.07), 0 2px 8px rgba(26,29,32,0.05);
    --mel-shadow-md: 0 4px 24px rgba(26,29,32,0.10), 0 1px 4px rgba(26,29,32,0.07);
    --mel-shadow-lg: 0 28px 80px rgba(26,29,32,0.20), 0 10px 32px rgba(26,29,32,0.12);
    --neu-raised: 7px 7px 18px rgba(26,29,32,0.11), -4px -4px 14px rgba(255,255,255,0.95);
    --neu-inset: inset 4px 4px 10px rgba(26,29,32,0.09), inset -3px -3px 9px rgba(255,255,255,0.85);
}

/* ═══════════════════════════════════════════════════════
   2. CHAT WINDOW — Sculpted ceramic glass vessel
═══════════════════════════════════════════════════════ */
.mel-window {
    /* Highly translucent gradient to let the site background bleed through */
    background: linear-gradient(145deg, rgba(255,255,255,0.65) 0%, rgba(250,248,244,0.45) 100%) !important;
    backdrop-filter: blur(48px) saturate(200%) brightness(1.05) !important;
    -webkit-backdrop-filter: blur(48px) saturate(200%) brightness(1.05) !important;
    /* Enhanced thick-glass edge refraction */
    border: 1px solid rgba(255,255,255,0.95) !important;
    box-shadow: 0 45px 100px rgba(26,29,32,0.25), 0 16px 40px rgba(26,29,32,0.12), 0 0 0 1px rgba(255,255,255,0.5) inset, 0 0 0 2px rgba(255,255,255,0.2) inset, inset 1px 0 0 rgba(255,255,255,0.8), inset -1px 0 0 rgba(255,255,255,0.4) !important;
}

    /* Top reflection streak — the "thick glass edge" moment */
    .mel-window::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 180px;
        border-radius: inherit;
        background: linear-gradient( 175deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.2) 30%, transparent 55% );
        pointer-events: none;
        z-index: 0;
    }

/* ═══════════════════════════════════════════════════════
   3. TITLEBAR — ultra-refined masthead bar
═══════════════════════════════════════════════════════ */
.mel-titlebar {
    background: rgba(255,255,255,0.45) !important; /* Translucent to match window */
    border-bottom: 1px solid rgba(26,29,32,0.08) !important;
    box-shadow: 0 1px 0 rgba(255,255,255,0.6), 0 4px 16px rgba(26,29,32,0.03) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    position: relative;
    z-index: 2;
}

.mel-titlebar-label {
    color: rgba(26,29,32,0.7) !important;
    font-family: 'DM Sans', system-ui, sans-serif !important;
    font-size: 0.57rem !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
}

.mel-tl {
    width: 14px !important;
    height: 14px !important;
    background: rgba(26,29,32,0.08) !important;
    border: 1px solid rgba(26,29,32,0.12) !important;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.9), 0 1px 2px rgba(26,29,32,0.04) !important;
    transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1) !important;
    position: relative;
    overflow: hidden;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}


/* Traffic lights — Awwwards-worthy micro-interactions */
.mel-traffic-lights {
    gap: 8px !important;
    padding: 4px !important;
    margin-left: -4px !important; /* Optical alignment */
}

.mel-tl {
    width: 14px !important;
    height: 14px !important;
    background: rgba(26,29,32,0.06) !important;
    border: 1px solid rgba(26,29,32,0.10) !important;
    color: transparent !important; /* Icons hidden by default for clean look */
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.9), 0 1px 2px rgba(26,29,32,0.04) !important;
    transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1) !important;
    position: relative;
    overflow: hidden;
}

/* Reveal icons smoothly when hovering over the container group */
.mel-traffic-lights:hover .mel-tl {
    border-color: rgba(26,29,32,0.18) !important;
}

/* Visible but subtle icons by default for UI discoverability */
.mel-tl i {
    font-size: 0.55rem !important;
    font-weight: 900 !important;
    color: rgba(26,29,32,0.4) !important;
    transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), color 0.3s ease !important;
    transform: scale(0.8) !important; /* Slightly smaller until hovered */
    opacity: 1 !important;
}

.mel-traffic-lights:hover .mel-tl i {
    transform: scale(1) !important;
    color: rgba(26,29,32,0.7) !important;
}

/* Specific hover states with premium liquid glows & magnetic scale */
.mel-tl-close:hover {
    background: linear-gradient(135deg, #FF5F57 0%, #D94F4F 100%) !important;
    border-color: #D94F4F !important;
    transform: scale(1.2) !important;
    box-shadow: 0 6px 16px rgba(255, 95, 87, 0.4), inset 0 2px 4px rgba(255,255,255,0.5) !important;
}

.mel-tl-min:hover {
    background: linear-gradient(135deg, #FEBC2E 0%, #D49B25 100%) !important;
    border-color: #D49B25 !important;
    transform: scale(1.2) !important;
    box-shadow: 0 6px 16px rgba(254, 188, 46, 0.4), inset 0 2px 4px rgba(255,255,255,0.5) !important;
}

.mel-tl-max:hover {
    background: linear-gradient(135deg, #28C840 0%, #1E9E30 100%) !important;
    border-color: #1E9E30 !important;
    transform: scale(1.2) !important;
    box-shadow: 0 6px 16px rgba(40, 200, 64, 0.4), inset 0 2px 4px rgba(255,255,255,0.5) !important;
}



    /* Icons turn white when their specific button is hovered */
    .mel-tl-close:hover i,
    .mel-tl-min:hover i,
    .mel-tl-max:hover i {
        color: #FFFFFF !important;
    }

.mel-tl:active {
    transform: scale(0.95) !important;
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.2) !important;
}


/* Top Right Action Icons - 3D Magnetic effect */
.mel-tl-icon-btn {
    color: rgba(26,29,32,0.45) !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1) !important;
    width: 28px !important;
    height: 28px !important;
}

    .mel-tl-icon-btn:hover {
        color: var(--mel-orange) !important;
        background: rgba(255,255,255,0.5) !important;
        border-color: rgba(26,29,32,0.08) !important;
        transform: scale(1.1) translateY(-1px) !important;
        box-shadow: 0 4px 12px rgba(26,29,32,0.06), inset 0 2px 4px rgba(255,255,255,0.8) !important;
    }

    .mel-tl-icon-btn:active {
        transform: scale(0.95) !important;
        box-shadow: inset 0 2px 6px rgba(26,29,32,0.08) !important;
    }

/* ═══════════════════════════════════════════════════════
   4. HEADER HERO — Magazine Masthead + VisionOS Glass
   This entire section is rebuilt as a luxury hero panel.
═══════════════════════════════════════════════════════ */

/* Override the dark background entirely */
.mel-header-bg {
    background: linear-gradient( 168deg, rgba(255,252,248,0.96) 0%, rgba(250,248,244,0.94) 45%, rgba(245,246,250,0.95) 100% ) !important;
    z-index: 0;
}

/* Recolor orbs for warm light theme */
.mel-hbg-orb--orange {
    background: radial-gradient(circle, rgba(245,130,32,0.22) 0%, rgba(245,130,32,0.08) 50%, transparent 100%) !important;
    opacity: 1 !important;
    width: 260px !important;
    height: 260px !important;
    top: -90px !important;
    right: -60px !important;
}

.mel-hbg-orb--blue {
    background: radial-gradient(circle, rgba(86,196,248,0.18) 0%, rgba(86,196,248,0.06) 55%, transparent 100%) !important;
    opacity: 1 !important;
    width: 180px !important;
    height: 180px !important;
    bottom: -50px !important;
    left: -20px !important;
}

.mel-hbg-orb--green {
    background: radial-gradient(circle, rgba(86,196,248,0.12) 0%, transparent 100%) !important;
    opacity: 1 !important;
}

/* Architectural grid texture overlay */
.mel-header-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(26,29,32,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(26,29,32,0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    z-index: 1;
    pointer-events: none;
}

/* Blueprint diagonal accent rule */
.mel-header-bg::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 100%;
    background: linear-gradient( 270deg, rgba(245,130,32,0.06) 0%, transparent 100% );
    pointer-events: none;
    z-index: 1;
}

/* Glass panel over the hero */
.mel-header-glass {
    background: rgba(255,255,255,0.55) !important;
    backdrop-filter: blur(24px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(160%) !important;
    border-bottom: 1px solid rgba(26,29,32,0.08) !important;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.95), inset 0 -1px 0 rgba(26,29,32,0.05), 0 4px 20px rgba(26,29,32,0.05) !important;
    padding: 11px 16px 11px !important;
    position: relative;
}

    /* Top glass reflection on header panel */
    .mel-header-glass::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 50%;
        border-radius: inherit;
        background: linear-gradient( 180deg, rgba(255,255,255,0.65) 0%, transparent 100% );
        pointer-events: none;
        z-index: 0;
    }

/* ── BRAND AVATAR — compact circle, no letter, orange gradient */
.mel-avatar {
    position: relative !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    background: linear-gradient(145deg, #F58220 0%, #C96A0E 100%) !important;
    border: none !important;
    box-shadow: 0 0 0 1.5px rgba(245,130,32,0.5), 0 0 0 4px rgba(245,130,32,0.12), 0 4px 16px rgba(245,130,32,0.35) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
    flex-shrink: 0 !important;
}

    /* Subtle shine arc */
    .mel-avatar::before {
        content: '' !important;
        position: absolute !important;
        inset: auto !important;
        top: 5px !important;
        left: 7px !important;
        width: 14px !important;
        height: 6px !important;
        border-radius: 50% !important;
        background: rgba(255,255,255,0.42) !important;
        filter: blur(2px) !important;
        z-index: 1 !important;
        pointer-events: none !important;
    }

    .mel-avatar::after {
        display: none !important;
    }

/* Online dot — repositioned for square avatar */
.mel-avatar-online {
    bottom: -3px !important;
    right: -3px !important;
    border-color: rgba(255,255,255,0.95) !important;
    box-shadow: 0 0 8px rgba(52,217,134,0.80), 0 0 0 2px rgba(255,255,255,0.90) !important;
    width: 11px !important;
    height: 11px !important;
}

/* ── AGENT INFO — compact, premium ── */
.mel-agent-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 8px !important;
}

    /* Remove the 'South African Property Intelligence' pseudo label */
    .mel-agent-info::before {
        display: none !important;
    }

/* Masthead name — bold DM Sans, consistent with dark theme */
.mel-agent-name {
    font-family: 'DM Sans', system-ui, sans-serif !important;
    font-size: 1.15rem !important; /* Slightly larger for horizontal layout */
    font-weight: 700 !important;
    font-style: normal !important;
    color: #1A1D20 !important;
    letter-spacing: -0.02em !important;
    line-height: 1 !important;
}

    /* The orange period — editorial brand punctuation */
    .mel-agent-name::after {
        content: '.';
        color: #F58220 !important;
        font-style: normal !important;
    }

/* Vertical rule + subtitle — magazine column divider */
.mel-agent-sub {
    font-family: 'DM Sans', system-ui, sans-serif !important;
    font-size: 0.65rem !important;
    font-weight: 500 !important;
    font-style: normal !important;
    color: rgba(26,29,32,0.45) !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    margin-top: 0 !important; /* Removed top margin */
    display: inline-block !important;
}

    /* Rule between subtitle segments */
.mel-agent-status {
    display: none !important;
}

/* Status line — hidden in new compact header */
.mel-agent-status {
    display: none !important;
}

/* Tagline block — hidden in new compact header */
.mel-tagline {
    display: none !important;
}

/* ── Light theme caption — mirrors dark but with light palette ── */
.mel-header-caption {
    font-size: 0.6rem !important;
    font-family: 'DM Sans', system-ui, sans-serif !important;
    font-weight: 400 !important;
    color: rgba(26,29,32,0.40) !important;
    letter-spacing: 0.04em !important;
    text-align: right !important;
    line-height: 1.55 !important;
    flex-shrink: 0 !important;
    text-transform: uppercase !important;
    margin: 0 !important;
    padding: 0 !important;
    border-left: 1px solid rgba(245,130,32,0.30) !important;
    padding-left: 11px !important;
}

/* ═══════════════════════════════════════════════════════
   5. CHIPS BAR — editorial tag strip
═══════════════════════════════════════════════════════ */
.mel-chips-container {
    background: rgba(255,255,255,0.4) !important; /* Translucent to reveal background */
    border-bottom: 1px solid rgba(26,29,32,0.06) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow: 0 4px 12px rgba(26,29,32,0.02) !important;
}

.mel-chip-arrow-left {
    background: linear-gradient(to right, rgba(248,247,244,0.99), transparent) !important;
    color: rgba(26,29,32,0.50) !important;
}

.mel-chip-arrow-right {
    background: linear-gradient(to left, rgba(248,247,244,0.99), transparent) !important;
    color: rgba(26,29,32,0.50) !important;
}

.mel-chip-arrow:hover {
    color: #F58220 !important;
}

.mel-chip {
    background: rgba(255,255,255,0.88) !important;
    border: 1px solid rgba(26,29,32,0.09) !important;
    color: rgba(26,29,32,0.68) !important;
    font-family: 'DM Sans', system-ui, sans-serif !important;
    font-size: 0.63rem !important;
    font-weight: 400 !important;
    box-shadow: 4px 4px 10px rgba(26,29,32,0.08), -3px -3px 8px rgba(255,255,255,0.95) !important;
    transition: all 0.22s cubic-bezier(0.34,1.56,0.64,1) !important;
}

    .mel-chip:hover {
        background: rgba(255,255,255,1.00) !important;
        border-color: rgba(245,130,32,0.38) !important;
        color: #F58220 !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(245,130,32,0.18), 4px 4px 10px rgba(26,29,32,0.06), -3px -3px 8px rgba(255,255,255,0.98) !important;
    }

/* ═══════════════════════════════════════════════════════
   6. MESSAGES AREA
═══════════════════════════════════════════════════════ */
.mel-messages-wrapper {
    background: transparent !important; /* Allows the main window glass to show through */
    box-shadow: inset 0 8px 24px rgba(26,29,32,0.02) !important; /* Deep inner shadow */
}

    /* Warm paper-grain texture */
    .mel-messages-wrapper::before {
        opacity: 0.015 !important;
        background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.80' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") !important;
    }

/* Bot bubbles — sculpted neumorphic glass with pull-quote rule */
.mel-bubble {
    background: rgba(255,255,255,0.92) !important;
    border: 1px solid rgba(26,29,32,0.07) !important;
    border-left: 2.5px solid rgba(245,130,32,0.40) !important;
    color: #1A1D20 !important;
    font-family: 'DM Sans', system-ui, sans-serif !important;
    font-weight: 400 !important;
    font-size: 0.82rem !important;
    line-height: 1.72 !important;
    padding-left: 15px !important;
    box-shadow: 0 3px 16px rgba(26,29,32,0.07), 0 1px 4px rgba(26,29,32,0.04), inset 0 1px 0 rgba(255,255,255,0.98), inset 0 -1px 0 rgba(26,29,32,0.02) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

.mel-msg.mel-user .mel-bubble {
    background: linear-gradient(148deg, #F58220 0%, #E07218 55%, #C96A0E 100%) !important;
    color: #FFFFFF !important;
    border: none !important;
    border-left: none !important;
    padding-left: 14px !important;
    box-shadow: 0 6px 28px rgba(245,130,32,0.40), 0 3px 10px rgba(245,130,32,0.22), inset 0 1px 0 rgba(255,255,255,0.30), inset 0 -1px 0 rgba(0,0,0,0.10) !important;
}

/* Bubble text elements */
.mel-bubble h4 {
    color: #1A1D20 !important;
    font-family: 'Cormorant Garamond', Georgia, serif !important;
    font-style: italic !important;
    border-bottom-color: rgba(245,130,32,0.20) !important;
}

.mel-bubble ul li {
    color: rgba(26,29,32,0.78) !important;
}

.mel-bubble strong {
    color: #1A1D20 !important;
}

.mel-bubble em {
    color: #F58220 !important;
}

.mel-bubble p {
    color: rgba(26,29,32,0.85) !important;
}

.mel-msg-time {
    color: rgba(26,29,32,0.38) !important;
}

/* Typing bubble */
.mel-typing-bubble {
    background: rgba(255,255,255,0.92) !important;
    border-color: rgba(26,29,32,0.07) !important;
    border-left: 2.5px solid rgba(86,196,248,0.45) !important;
    box-shadow: 0 3px 14px rgba(26,29,32,0.06) !important;
}

/* Scroll sidebar */
.mel-scroll-controls {
    background: rgba(246,244,241,0.88) !important;
    border-left: 1px solid rgba(26,29,32,0.06) !important;
}

.mel-scroll-btn {
    color: rgba(26,29,32,0.42) !important;
}

    .mel-scroll-btn:hover {
        background: rgba(26,29,32,0.05) !important;
        color: #F58220 !important;
    }

.mel-scroll-track {
    background: rgba(26,29,32,0.08) !important;
}

/* Law tags, number pills */
.mel-law-tag {
    background: rgba(86,196,248,0.10) !important;
    border-color: rgba(86,196,248,0.28) !important;
    color: #1A7FAF !important;
}

.mel-num-pill {
    background: rgba(245,130,32,0.10) !important;
    border-color: rgba(245,130,32,0.28) !important;
    color: #C96A0E !important;
}

.mel-source-refs {
    border-top-color: rgba(26,29,32,0.07) !important;
}

.mel-source-ref {
    background: rgba(26,29,32,0.03) !important;
    border-color: rgba(26,29,32,0.08) !important;
    color: rgba(26,29,32,0.50) !important;
}

button.mel-source-ref:hover {
    background: rgba(245,130,32,0.08) !important;
    border-color: rgba(245,130,32,0.35) !important;
    color: #F58220 !important;
}

.mel-like-btn {
    color: rgba(26,29,32,0.32) !important;
}

    .mel-like-btn:hover, .mel-like-btn.mel-liked {
        color: #F58220 !important;
    }

/* Yes/No buttons */
.mel-yn-btn {
    background: rgba(255,255,255,0.85) !important;
    border-color: rgba(26,29,32,0.12) !important;
    color: rgba(26,29,32,0.68) !important;
    box-shadow: 3px 3px 8px rgba(26,29,32,0.07), -2px -2px 6px rgba(255,255,255,0.92) !important;
}

    .mel-yn-btn.mel-yn-yes {
        border-color: rgba(245,130,32,0.40) !important;
        color: #C96A0E !important;
    }

    .mel-yn-btn:hover {
        background: #FFFFFF !important;
        transform: translateY(-1.5px) !important;
        box-shadow: 0 5px 16px rgba(26,29,32,0.10), -2px -2px 6px rgba(255,255,255,0.96) !important;
    }

/* ═══════════════════════════════════════════════════════
   7. INPUT AREA — The Iconic Composer Surface
   Ceramic glass, editorial publishing feel
═══════════════════════════════════════════════════════ */
.mel-input-area {
    padding: 14px 14px 11px !important;
    border-top: 1px solid rgba(255,255,255,0.85) !important;
    background: rgba(250,249,247,0.93) !important;
    backdrop-filter: blur(28px) saturate(170%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(170%) !important;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.98), 0 -6px 24px rgba(26,29,32,0.04) !important;
    position: relative !important;
    z-index: 2;
}

    /* Left accent editorial rule */
    .mel-input-area::before {
        content: '';
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        width: 2.5px;
        height: 55%;
        background: linear-gradient(180deg, #F58220 0%, rgba(86,196,248,0.60) 100%);
        border-radius: 2px;
        opacity: 0.55;
        transition: height 0.35s cubic-bezier(0.25,0.46,0.45,0.94), opacity 0.35s ease;
        pointer-events: none;
    }

    .mel-input-area:focus-within::before {
        height: 82% !important;
        opacity: 1 !important;
    }

/* ── The Composer Wrap — sculpted ceramic object ── */
.mel-input-wrap {
    display: flex !important;
    gap: 8px !important;
    align-items: flex-end !important;
    background: rgba(255,255,255,0.82) !important;
    border: 1px solid rgba(255,255,255,0.94) !important;
    border-radius: 20px !important;
    padding: 11px 11px 11px 15px !important;
    margin-left: 11px !important;
    position: relative !important;
    transition: all 0.30s cubic-bezier(0.25,0.46,0.45,0.94) !important;
    box-shadow: 8px 8px 22px rgba(26,29,32,0.10), -5px -5px 15px rgba(255,255,255,0.96), inset 0 2px 0 rgba(255,255,255,0.99), inset 0 -1px 0 rgba(26,29,32,0.03) !important;
}

    /* Glass top reflection on composer */
    .mel-input-wrap::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 46%;
        border-radius: 20px 20px 0 0;
        background: linear-gradient(180deg, rgba(255,255,255,0.68) 0%, transparent 100%);
        pointer-events: none;
        z-index: 0;
    }

    /* Orange-to-blue spectral glow bar — bottom of wrap */
    .mel-input-wrap::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 20px;
        right: 20px;
        height: 2px;
        background: linear-gradient( 90deg, transparent 0%, rgba(245,130,32,0.32) 30%, rgba(86,196,248,0.32) 70%, transparent 100% );
        border-radius: 1px;
        opacity: 0;
        transition: opacity 0.35s ease;
        pointer-events: none;
    }

    /* Focus — cinematic bloom */
    .mel-input-wrap:focus-within {
        background: rgba(255,255,255,0.98) !important;
        border-color: rgba(245,130,32,0.25) !important;
        box-shadow: 10px 10px 28px rgba(26,29,32,0.11), -5px -5px 18px rgba(255,255,255,0.98), 0 0 0 3.5px rgba(245,130,32,0.07), 0 0 32px rgba(245,130,32,0.12), 0 0 64px rgba(86,196,248,0.07), inset 0 2px 0 rgba(255,255,255,1.0) !important;
    }

        .mel-input-wrap:focus-within::after {
            opacity: 1;
        }

/* Textarea */
.mel-textarea {
    flex: 1 !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    font-family: 'DM Sans', system-ui, sans-serif !important;
    font-size: 0.87rem !important;
    color: #1A1D20 !important;
    resize: none !important;
    max-height: 110px !important;
    line-height: 1.62 !important;
    min-height: 22px !important;
    font-weight: 400 !important;
    letter-spacing: 0.008em !important;
    caret-color: #F58220 !important;
    position: relative !important;
    z-index: 1 !important;
    scrollbar-width: none !important;
}

    .mel-textarea::-webkit-scrollbar {
        display: none !important;
    }

    /* Editorial italic placeholder — magazine subheading */
    .mel-textarea::placeholder {
        color: rgba(26,29,32,0.30) !important;
        font-style: italic !important;
        font-family: 'Cormorant Garamond', Georgia, serif !important;
        font-size: 0.92rem !important;
        font-weight: 400 !important;
        letter-spacing: 0.01em !important;
    }

/* Caret colour shimmer between brand tones */
@keyframes mel-caret-breathe {
    0%,100% {
        caret-color: #F58220;
    }

    50% {
        caret-color: #56C4F8;
    }
}

.mel-textarea:focus {
    animation: mel-caret-breathe 2.6s ease infinite !important;
}

/* Mic button */
.mel-mic-btn {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(26,29,32,0.08) !important;
    background: rgba(255,255,255,0.75) !important;
    color: rgba(26,29,32,0.45) !important;
    font-size: 0.88rem !important;
    flex-shrink: 0 !important;
    transition: all 0.22s cubic-bezier(0.34,1.56,0.64,1) !important;
    outline: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    z-index: 1 !important;
    box-shadow: 4px 4px 10px rgba(26,29,32,0.09), -3px -3px 8px rgba(255,255,255,0.94) !important;
    cursor: pointer !important;
}

    .mel-mic-btn:hover {
        background: rgba(245,130,32,0.08) !important;
        border-color: rgba(245,130,32,0.30) !important;
        color: #F58220 !important;
        transform: scale(1.10) !important;
        box-shadow: 0 5px 18px rgba(245,130,32,0.20), 4px 4px 10px rgba(26,29,32,0.07), -3px -3px 8px rgba(255,255,255,0.97) !important;
    }

    .mel-mic-btn.mel-mic-active {
        background: #F58220 !important;
        border-color: #F58220 !important;
        color: #FFFFFF !important;
        animation: mel-mic-glow 1s ease infinite !important;
        box-shadow: 0 5px 20px rgba(245,130,32,0.50) !important;
    }

@keyframes mel-mic-glow {
    0%,100% {
        box-shadow: 0 0 0 0 rgba(245,130,32,0.55), 0 5px 20px rgba(245,130,32,0.35);
    }

    50% {
        box-shadow: 0 0 0 9px rgba(245,130,32,0.00), 0 5px 20px rgba(245,130,32,0.35);
    }
}

/* Send button — flagship "publish" control */
.mel-send-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    border: none !important;
    background: linear-gradient(148deg, #F58220 0%, #E07218 55%, #C96A0E 100%) !important;
    color: #FFFFFF !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.86rem !important;
    flex-shrink: 0 !important;
    outline: none !important;
    position: relative !important;
    z-index: 1 !important;
    transition: transform 0.24s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.24s ease !important;
    box-shadow: 0 5px 20px rgba(245,130,32,0.50), 0 2px 8px rgba(245,130,32,0.30), inset 0 1.5px 0 rgba(255,255,255,0.35), inset 0 -1.5px 0 rgba(0,0,0,0.14) !important;
}
    /* Glass highlight on send button */
    .mel-send-btn::before {
        content: '';
        position: absolute;
        top: 5px;
        left: 8px;
        width: 13px;
        height: 6px;
        background: rgba(255,255,255,0.40);
        border-radius: 50%;
        filter: blur(2.5px);
        pointer-events: none;
    }

    .mel-send-btn:hover:not(:disabled) {
        transform: scale(1.14) translateY(-1.5px) !important;
        box-shadow: 0 10px 32px rgba(245,130,32,0.58), 0 5px 14px rgba(245,130,32,0.36), inset 0 1.5px 0 rgba(255,255,255,0.38), inset 0 -1.5px 0 rgba(0,0,0,0.12) !important;
    }

    .mel-send-btn:active:not(:disabled) {
        transform: scale(1.04) translateY(0) !important;
    }

    .mel-send-btn:disabled {
        background: rgba(26,29,32,0.10) !important;
        box-shadow: none !important;
        cursor: not-allowed !important;
        transform: none !important;
        color: rgba(26,29,32,0.28) !important;
    }

/* ═══════════════════════════════════════════════════════
   8. MICROCOPY — HIGH CONTRAST FIXES
   All weak text areas upgraded to elegant legibility
═══════════════════════════════════════════════════════ */

/* Input hint row — Enter / Shift+Enter / voice */
.mel-input-hint {
    font-size: 0.56rem !important;
    color: rgba(26,29,32,0.50) !important; /* ↑ from 0.30 — now clearly readable */
    text-align: center !important;
    margin-top: 8px !important;
    font-family: 'DM Sans', system-ui, sans-serif !important;
    letter-spacing: 0.07em !important;
    text-transform: uppercase !important;
    font-weight: 400 !important;
}

    /* kbd pills — crisp contrast */
    .mel-input-hint kbd {
        background: rgba(26,29,32,0.08) !important;
        border: 1px solid rgba(26,29,32,0.14) !important;
        border-radius: 4px !important;
        padding: 1px 5px !important;
        color: rgba(26,29,32,0.62) !important; /* ↑ strong enough to read */
        font-size: 0.54rem !important;
        box-shadow: 0 1px 3px rgba(26,29,32,0.09) !important;
        font-family: 'DM Sans', system-ui, sans-serif !important;
    }

/* Disclaimer — stronger but elegant */
.mel-disclaimer {
    color: rgba(26,29,32,0.45) !important; /* ↑ from 0.28 */
    border-top: 1px solid rgba(26,29,32,0.05) !important;
    background: rgba(248,247,244,0.75) !important;
    font-family: 'DM Sans', system-ui, sans-serif !important;
    font-size: 0.55rem !important;
    letter-spacing: 0.02em !important;
    padding: 7px 14px 9px !important;
    line-height: 1.6 !important;
}

/* Titlebar label — crisp */
.mel-titlebar-label {
    color: rgba(26,29,32,0.52) !important;
}

/* Traffic light icons */
.mel-tl i {
    color: rgba(26,29,32,0.60) !important;
    font-size: 0.70rem !important;
}

/* ═══════════════════════════════════════════════════════
   9. MINIMISED PILL
═══════════════════════════════════════════════════════ */
.mel-minimised-pill {
    background: rgba(255,255,255,0.94) !important;
    border: 1px solid rgba(26,29,32,0.09) !important;
    box-shadow: 0 10px 36px rgba(26,29,32,0.16), 0 3px 10px rgba(26,29,32,0.08), inset 0 1.5px 0 rgba(255,255,255,0.98) !important;
    backdrop-filter: blur(22px) !important;
    -webkit-backdrop-filter: blur(22px) !important;
}

.mel-min-restore-btn {
    color: rgba(26,29,32,0.50) !important;
}

    .mel-min-restore-btn:hover {
        color: #F58220 !important;
    }

/* ═══════════════════════════════════════════════════════
   10. HOVER SPEECH BUBBLE LABEL
═══════════════════════════════════════════════════════ */
.mel-hover-label,
.mel-speech-bubble {
    background: rgba(255,255,255,0.95) !important;
    border: 1px solid rgba(26,29,32,0.09) !important;
    box-shadow: 0 10px 32px rgba(26,29,32,0.14), inset 0 1px 0 rgba(255,255,255,0.98) !important;
}

.mel-hover-name {
    color: #1A1D20 !important;
    font-weight: 600 !important;
}

.mel-hover-sub {
    color: rgba(26,29,32,0.55) !important;
}

/* ═══════════════════════════════════════════════════════
   11. AI LISTENING GLOW PULSE (light version)
═══════════════════════════════════════════════════════ */
@keyframes mel-ai-glow-light {
    0%,100% {
        box-shadow: 8px 8px 22px rgba(26,29,32,0.10), -5px -5px 15px rgba(255,255,255,0.96);
    }

    50% {
        box-shadow: 8px 8px 22px rgba(26,29,32,0.10), -5px -5px 15px rgba(255,255,255,0.96), 0 0 24px rgba(245,130,32,0.20), 0 0 48px rgba(86,196,248,0.12);
    }
}

.mel-input-wrap.mel-ai-listening {
    animation: mel-ai-glow-light 2s ease infinite !important;
}

/* ═══════════════════════════════════════════════════════
   12. ACCESSIBILITY VARIANTS
═══════════════════════════════════════════════════════ */
html.a11y-high-contrast .mel-window {
    background: #FFFFFF !important;
    border: 2px solid #1A1D20 !important;
}

html.a11y-high-contrast .mel-bubble {
    border: 1.5px solid rgba(26,29,32,0.22) !important;
    color: #1A1D20 !important;
}

html.a11y-high-contrast .mel-input-wrap {
    border: 1.5px solid rgba(26,29,32,0.25) !important;
}

    html.a11y-high-contrast .mel-input-wrap:focus-within {
        border-color: #F58220 !important;
        outline: 3px solid rgba(245,130,32,0.35) !important;
    }

html.a11y-large-text .mel-textarea {
    font-size: 1.04rem !important;
}

html.a11y-large-text .mel-chip {
    font-size: 0.78rem !important;
    padding: 6px 16px !important;
}

/* ═══════════════════════════════════════════════════════
   13. MOBILE (≤ 500px)
═══════════════════════════════════════════════════════ */
@media (max-width: 500px) {
    .mel-input-area::before {
        display: none;
    }

    .mel-input-wrap {
        margin-left: 0 !important;
    }

    .mel-agent-name {
        font-size: 1.45rem !important;
    }

    .mel-avatar {
        width: 46px !important;
        height: 46px !important;
        border-radius: 14px !important;
    }

    .mel-avatar-letter {
        font-size: 1.50rem !important;
    }
}
