/* ==========================================================================
   StudioColor SaaS — Support Chat Styles (iOS Glassmorphism & Motion)
   Strictly adheres to Emil Kowalski & Apple Design Guidelines
   ========================================================================== */

.screen.support-screen,
.support-screen {
    box-sizing: border-box !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    width: 100% !important;
    height: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: -webkit-fill-available !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    display: none;
    flex-direction: column;
    padding-top: calc(6px + env(safe-area-inset-top, 0px)) !important;
    padding-left: var(--page-x) !important;
    padding-right: var(--page-x) !important;
    padding-bottom: 0 !important; /* CRITICAL: Override .screen padding-bottom: 150px !important from home_v2.css */
    margin: 0 !important;
    z-index: 2000 !important;
    transform: translate3d(0, 0, 0);
    background: transparent !important;
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
}

/* Full-bleed wallpaper background layer extending beyond physical screen edges */
.support-screen::before {
    content: "" !important;
    position: fixed !important;
    top: -80px !important;
    bottom: -80px !important;
    left: -80px !important;
    right: -80px !important;
    width: calc(100% + 160px) !important;
    height: calc(100% + 160px) !important;
    z-index: -1 !important;
    pointer-events: none !important;
    background-color: #141219;
    background-image:
        linear-gradient(
            180deg,
            rgba(14, 14, 18, 0.82) 0%,
            rgba(14, 14, 18, 0.78) 50%,
            rgba(14, 14, 18, 0.85) 100%
        ),
        var(--app-wallpaper-url, url("fon/day_bg.webp"));
    background-position: var(--app-wallpaper-position, center center);
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    filter: blur(20px) !important;
    -webkit-filter: blur(20px) !important;
    transform: scale(1.08) translate3d(0, 0, 0) !important;
    -webkit-transform: scale(1.08) translate3d(0, 0, 0) !important;
    will-change: transform, filter;
}

.support-screen.is-active {
    display: flex !important;
}

/* Prevent viewport shifts on mobile keyboard focus */
html:has(body.is-support-active) {
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
    height: 100% !important;
}

body.is-support-active {
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    min-height: -webkit-fill-available !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
}

/* Eliminate parent tabbar padding when support chat is open */
body.is-support-active .mobile-app,
body.is-support-active .app-shell {
    padding-bottom: 0 !important;
    min-height: 100% !important;
}

body.is-support-active .support-messages-scroll {
    touch-action: pan-y !important;
}

/* Hide bottom nav bar completely when support screen is active */
body:has(.support-screen.is-active) #react-bottom-nav-root,
body.is-support-active #react-bottom-nav-root,
.support-screen.is-active ~ #react-bottom-nav-root {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translate(-50%, 150px) !important;
}

.support-screen .support-topbar {
    margin-bottom: 4px !important;
    height: 44px !important;
    padding: 6px 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    flex-shrink: 0;
}

.support-screen .support-topbar h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    pointer-events: none;
}

.support-close-ticket-btn {
    margin-left: auto;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 5px 12px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 120ms cubic-bezier(0.23, 1, 0.32, 1), background-color 120ms ease, color 120ms ease;
    z-index: 10;
}

.support-close-ticket-btn:active {
    transform: scale(0.94);
    background: rgba(255, 255, 255, 0.18);
}

/* 2. Main Chat Container */
.support-chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
    width: 100%;
    margin: 0 auto;
}

/* 3. Messages Scroll Area */
.support-messages-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 6px 2px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    position: relative;
}

.support-welcome-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 16px;
    margin: auto 0;
    width: 100%;
    box-sizing: border-box;
    animation: supportMsgEnter 220ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 220ms cubic-bezier(0.16, 1, 0.3, 1), transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.support-welcome-card.is-fading-out {
    opacity: 0 !important;
    transform: translateY(-8px) scale(0.96) !important;
    pointer-events: none !important;
}

.support-welcome-icon-box {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    margin-bottom: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 6px 18px rgba(0, 0, 0, 0.15);
}

.support-welcome-card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
    line-height: 1.35;
    max-width: 320px;
}

.support-welcome-card p {
    font-size: 0.88rem;
    line-height: 1.48;
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
    max-width: 310px;
}

/* Closed Ticket Card */
.support-closed-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 20px;
    margin: auto 0;
    width: 100%;
    box-sizing: border-box;
    animation: supportMsgEnter 220ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.support-closed-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #34c759;
    margin-bottom: 16px;
}

.support-closed-card h2 {
    font-size: 1.22rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px;
}

.support-closed-card p {
    font-size: 0.9rem;
    line-height: 1.48;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 20px;
    max-width: 300px;
}

.support-new-ticket-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #000000;
    font-weight: 600;
    font-size: 0.92rem;
    border: none;
    border-radius: 16px;
    padding: 12px 28px;
    cursor: pointer;
    transition: transform 120ms cubic-bezier(0.23, 1, 0.32, 1), background-color 120ms ease;
}

.support-new-ticket-btn:active {
    transform: scale(0.96);
    background: #e5e5ea;
}

.support-messages-scroll::-webkit-scrollbar {
    width: 4px;
}
.support-messages-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* 4. Message Bubble Styles */
.support-msg-bubble-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    animation: supportMsgEnter 180ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: bottom center;
}

@keyframes supportMsgEnter {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.support-msg-bubble-wrap.is-user {
    align-items: flex-end;
}

.support-msg-bubble-wrap.is-support {
    align-items: flex-start;
}

.support-msg-bubble-wrap.is-system {
    align-items: center;
    margin: 6px 0;
}

.support-msg-bubble {
    max-width: 84%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.94rem;
    line-height: 1.42;
    position: relative;
    word-break: break-word;
}

/* User Message (Right Side — Translucent Liquid Glass) */
.support-msg-bubble-wrap.is-user .support-msg-bubble {
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Support Operator Message (Left Side — Dark Translucent Liquid Glass) */
.support-msg-bubble-wrap.is-support .support-msg-bubble {
    background: rgba(20, 24, 28, 0.7);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    color: #f3f4f6;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 16px rgba(0, 0, 0, 0.2);
}

.support-msg-author-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* System Message (Center — Subtle) */
.support-msg-bubble-wrap.is-system .support-msg-bubble {
    max-width: 90%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
    border-radius: 14px;
    padding: 8px 14px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Message Attachments */
.support-msg-attachments {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    width: 100%;
    max-width: 100%;
}

.support-msg-images-grid {
    display: grid;
    gap: 6px;
    width: 100%;
    max-width: 230px;
    margin-top: 4px;
}

.support-msg-images-grid.is-single,
.support-msg-images-grid:has(.support-msg-image-item:only-child) {
    display: block;
    max-width: 230px;
}

.support-msg-images-grid:not(.is-single) {
    grid-template-columns: repeat(2, minmax(0, 110px));
}

.support-msg-image-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.15);
    cursor: zoom-in;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1), opacity 140ms ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    max-width: 230px;
}

.support-msg-image-item:active {
    transform: scale(0.97);
    opacity: 0.92;
}

.support-msg-images-grid.is-single .support-msg-image-item,
.support-msg-images-grid:has(.support-msg-image-item:only-child) .support-msg-image-item {
    max-width: 230px;
    max-height: 230px;
}

.support-msg-images-grid.is-single .support-msg-image-item img,
.support-msg-images-grid:has(.support-msg-image-item:only-child) .support-msg-image-item img {
    display: block;
    max-width: 100%;
    max-height: 230px;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: 11px;
}

.support-msg-images-grid:not(.is-single) .support-msg-image-item {
    aspect-ratio: 1 / 1;
    width: 100%;
}

.support-msg-images-grid:not(.is-single) .support-msg-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.support-msg-doc-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    text-decoration: none;
    color: #ffffff;
    font-size: 0.85rem;
    transition: transform 120ms cubic-bezier(0.23, 1, 0.32, 1), background-color 120ms ease;
}

.support-msg-doc-card:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.16);
}

.support-msg-doc-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a84ff;
    flex-shrink: 0;
}

.support-msg-doc-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.support-msg-doc-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
}

.support-msg-doc-size {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Message Meta (Time & Status Tick) */
.support-msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    margin-top: 4px;
    font-size: 0.68rem;
    opacity: 0.85;
}

.support-msg-bubble-wrap.is-support .support-msg-meta {
    justify-content: flex-start;
    color: rgba(255, 255, 255, 0.55);
}

/* 5. Pure SVG Status Micro-Components */
.support-msg-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    line-height: 1;
}

.support-msg-retry-btn {
    background: rgba(255, 69, 58, 0.22);
    color: #ff453a;
    border: 1px solid rgba(255, 69, 58, 0.4);
    border-radius: 10px;
    padding: 2px 7px;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 4px;
    transition: transform 120ms cubic-bezier(0.23, 1, 0.32, 1), background-color 120ms ease;
}

.support-msg-retry-btn:active {
    transform: scale(0.93);
    background: rgba(255, 69, 58, 0.35);
}

.support-status-svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.support-status-svg.is-sending {
    animation: supportStatusSpin 0.9s linear infinite;
    color: rgba(255, 255, 255, 0.7);
}

@keyframes supportStatusSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.support-status-svg.is-sent {
    color: rgba(255, 255, 255, 0.75);
}

.support-status-svg.is-read,
.support-status-svg.is-delivered {
    color: #ffffff;
}

.support-status-svg.is-failed {
    color: #ff453a;
    cursor: pointer;
}

/* Floating New Messages Pill */
.support-new-messages-pill {
    position: absolute;
    bottom: 82px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 40;
    animation: supportPillEnter 180ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes supportPillEnter {
    from {
        opacity: 0;
        transform: translate(-50%, 8px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* 6. Attachment Preview Bar (Composer) */
.support-attachment-preview-bar {
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0 4px 8px 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
    width: calc(100% - 24px);
    max-width: 720px;
    margin: 0 auto;
    box-sizing: border-box;
}

.support-attachment-preview-bar::-webkit-scrollbar {
    height: 3px;
}

.support-attachment-preview-bar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.support-attach-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 4px 8px 4px 4px;
    font-size: 0.82rem;
    color: #ffffff;
    max-width: 200px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.support-attach-chip.is-error {
    border-color: rgba(255, 69, 58, 0.4);
    background: rgba(255, 69, 58, 0.12);
}

.support-attach-chip-thumb {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.support-attach-chip-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
}

.support-attach-chip-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    gap: 1px;
}

.support-attach-chip-name {
    font-weight: 500;
    font-size: 0.76rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
}

.support-attach-chip-size {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.6);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.support-attach-chip-size.is-error-text {
    color: #ff453a;
    font-weight: 500;
}

.support-attach-chip-check-svg {
    width: 11px;
    height: 11px;
    color: rgba(255, 255, 255, 0.85);
    stroke-width: 2.2;
    display: inline-block;
    vertical-align: middle;
}

.support-attach-chip-error-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.support-attach-chip-retry {
    font-size: 0.68rem;
    font-weight: 600;
    color: #0a84ff;
    background: rgba(10, 132, 255, 0.16);
    border: 1px solid rgba(10, 132, 255, 0.3);
    border-radius: 6px;
    padding: 1px 6px;
    cursor: pointer;
    transition: transform 120ms ease, background-color 120ms ease;
}

.support-attach-chip-retry:active {
    transform: scale(0.92);
    background: rgba(10, 132, 255, 0.28);
}

.support-attach-chip-remove {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    margin-left: 2px;
    transition: transform 120ms cubic-bezier(0.23, 1, 0.32, 1), background-color 120ms ease;
}

.support-attach-chip-remove:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.3);
}

.support-attach-chip-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: #0a84ff;
    transition: width 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

/* 7. Elevated Composer: 3 Distinct Components [ 📎 ] [ INPUT ] [ ➤ ] on one horizontal line */
form#supportForm,
.support-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    box-sizing: border-box;
    width: calc(100% - 24px);
    max-width: 720px;
    margin: auto auto calc(max(env(safe-area-inset-bottom, 0px), 8px) + 6px) auto;
    flex-shrink: 0;
    transition: margin-bottom 160ms cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 15;
}

.support-screen.is-keyboard-open form#supportForm,
.support-screen.is-keyboard-open .support-input-bar {
    margin-top: auto !important;
    margin-bottom: calc(var(--support-keyboard-offset, 0px) + 8px);
}

@media (min-width: 768px) {
    form#supportForm,
    .support-input-bar {
        margin-bottom: calc(max(env(safe-area-inset-bottom, 0px), 16px) + 16px);
    }
    .support-screen.is-keyboard-open form#supportForm,
    .support-screen.is-keyboard-open .support-input-bar {
        margin-bottom: calc(var(--support-keyboard-offset, 0px) + 16px);
    }
}

/* Element 1: Distinct Attachment Button [ 📎 ] */
.support-attach-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 120ms cubic-bezier(0.23, 1, 0.32, 1), color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.support-attach-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.32);
}

.support-attach-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Element 2: Distinct Input Container [ Введите сообщение... ] */
.support-input-wrapper {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 20px;
    padding: 9px 14px;
    display: flex;
    align-items: center;
    min-height: 40px;
    box-sizing: border-box;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.support-input-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.support-textarea {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.94rem;
    line-height: 1.35;
    resize: none;
    max-height: 120px;
    min-height: 20px;
    height: 20px;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: inherit;
    display: block;
}

.support-textarea::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

/* Element 3: Distinct Send Button [ ➤ ] */
.support-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: not-allowed;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1), background-color 140ms ease, color 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.support-send-btn.is-active:not(:disabled) {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #ffffff !important;
    opacity: 1 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 0 12px rgba(255, 255, 255, 0.4) !important;
}

.support-send-btn.is-active:not(:disabled):active {
    transform: scale(0.92);
    background: #e5e5ea !important;
}

.support-send-btn:disabled,
.support-send-btn:not(.is-active) {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    box-shadow: none !important;
}

/* 7. Close Confirmation Modal Backdrop & Dialog */
.support-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    z-index: 500;
    animation: supportFadeIn 160ms ease;
}

@keyframes supportFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.support-confirm-dialog {
    background: rgba(28, 28, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 22px;
    padding: 24px 20px 20px;
    width: 100%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
    animation: supportDialogScale 180ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes supportDialogScale {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.support-confirm-dialog h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 10px;
}

.support-confirm-dialog p {
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 20px;
}

.support-confirm-actions {
    display: flex;
    gap: 10px;
}

.support-dialog-btn {
    flex: 1;
    padding: 11px 0;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: transform 120ms cubic-bezier(0.23, 1, 0.32, 1), background-color 120ms ease;
}

.support-dialog-btn.is-cancel {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.support-dialog-btn.is-cancel:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.18);
}

.support-dialog-btn.is-confirm {
    background: #ff453a;
    color: #ffffff;
}

.support-dialog-btn.is-confirm:active {
    transform: scale(0.96);
    background: #d32f2f;
}

/* 8. Image Lightbox Modal */
.support-lightbox-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    animation: supportFadeIn 160ms ease;
    cursor: zoom-out;
}

.support-lightbox-img {
    max-width: 92vw;
    max-height: 85vh;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    object-fit: contain;
    cursor: default;
    animation: supportLightboxScale 180ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes supportLightboxScale {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.support-lightbox-close {
    position: absolute;
    top: max(calc(env(safe-area-inset-top) + 16px), 24px);
    right: 24px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 120ms cubic-bezier(0.23, 1, 0.32, 1), background-color 120ms ease;
    z-index: 1001;
}

.support-lightbox-close:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.28);
}

/* 9. Unread Badge in Settings */
.support-more-badge {
    background-color: #ff3b30;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: auto;
    margin-right: 6px;
    line-height: 1.2;
}

/* 9. Accessibility & Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .support-msg-bubble-wrap,
    .support-welcome-card,
    .support-closed-card,
    .support-confirm-dialog,
    .support-new-messages-pill {
        animation: none !important;
        transition: none !important;
    }
    .support-status-svg.is-sending {
        animation: none !important;
    }
}
