/**
 * PA Comms Hub — Chat Widget Styles v2.0
 *
 * Production-grade live chat widget with CSS custom properties for theming.
 * The admin widget customizer sets --pach-primary and all colours cascade.
 */

/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
    --pach-primary: #7c3aed;
    --pach-primary-dark: #6d28d9;
    --pach-primary-light: #ede9fe;
    --pach-bg: #ffffff;
    --pach-text: #1a1a1a;
    --pach-muted: #6b7280;
    --pach-border: #e5e7eb;
    --pach-radius: 16px;
    --pach-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   CSS Isolation — prevent theme styles from affecting widget
   ============================================================ */
#pach-chat-root,
#pach-chat-root *,
#pach-chat-root *::before,
#pach-chat-root *::after {
    box-sizing: border-box !important;
    -webkit-text-size-adjust: 100% !important;
    text-decoration: none !important;
    list-style: none !important;
    float: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

/* Ensure all interactive elements are clickable */
#pach-chat-root button,
#pach-chat-root input,
#pach-chat-root textarea,
#pach-chat-root [role="button"] {
    pointer-events: auto !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
#pach-chat-root input,
#pach-chat-root textarea {
    cursor: text !important;
}

#pach-chat-root {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 2147483647 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 12px !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    color: #1a1a1a !important;
    letter-spacing: normal !important;
    text-align: left !important;
    word-spacing: normal !important;
    text-transform: none !important;
    float: none !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    background: transparent !important;
    overflow: visible !important;
}

/* ============================================================
   Root wrapper — CSS variables for theming
   ============================================================ */
#pach-chat-root {
    --pach-color: var(--pach-primary, #7c3aed);
    --pach-side: 24px;
}

/* Left position support */
#pach-chat-root.pach-position-left {
    left: var(--pach-side);
    right: auto;
    align-items: flex-start;
}

#pach-chat-root.pach-position-left #pach-chat-panel {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

#pach-chat-root.pach-position-left #pach-chat-preview {
    right: auto;
    left: 0;
}

#pach-chat-root.pach-position-left #pach-chat-preview::after {
    right: auto;
    left: 24px;
}

/* ============================================================
   Toggle button — 52px circle
   ============================================================ */
#pach-chat-toggle {
    position: relative !important;
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;
    border-radius: 50% !important;
    background: #7c3aed !important;
    background: var(--pach-color, #7c3aed) !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease !important;
    flex-shrink: 0 !important;
    order: 2 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    outline: none !important;
    overflow: visible !important;
    line-height: 1 !important;
    font-size: 0 !important;
}

#pach-chat-toggle svg {
    width: 24px !important;
    height: 24px !important;
    display: block !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    color: #fff !important;
    flex-shrink: 0 !important;
}

#pach-chat-toggle:hover,
#pach-chat-toggle:focus-visible {
    transform: scale(1.08) !important;
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.5), 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    outline: none !important;
}

#pach-chat-toggle:active {
    transform: scale(0.97);
}

#pach-chat-toggle svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease;
}

/* ============================================================
   Pulse attention ring — stops after first open
   ============================================================ */
@keyframes pachPulse {
    0%   { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18), 0 0 0 0 rgba(124, 58, 237, 0.45); }
    70%  { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18), 0 0 0 14px rgba(124, 58, 237, 0); }
    100% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18), 0 0 0 0 rgba(124, 58, 237, 0); }
}

#pach-chat-toggle.pach-pulse {
    animation: pachPulse 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* ============================================================
   Unread badge — red circle
   ============================================================ */
#pach-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-sizing: border-box;
    pointer-events: none;
    line-height: 1;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* ============================================================
   Welcome preview bubble
   ============================================================ */
#pach-chat-preview {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 14px;
    background: var(--pach-bg);
    border-radius: 12px;
    padding: 14px 38px 14px 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
    max-width: 280px;
    min-width: 200px;
    cursor: pointer;
    animation: pachPreviewIn 0.3s cubic-bezier(0, 1.2, 1, 1) forwards;
    transform-origin: bottom right;
    order: 0;
    border-left: 3px solid var(--pach-color);
}

#pach-chat-preview::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: var(--pach-bg);
    transform: rotate(45deg);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.04);
}

/* Auto-hide preview when panel is open */
#pach-chat-panel:not(.pach-hidden) ~ #pach-chat-preview,
#pach-chat-preview[style*="display: none"],
#pach-chat-preview.pach-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

@keyframes pachPreviewIn {
    from { transform: scale(0.85) translateY(8px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

#pach-preview-text {
    margin: 0;
    font-size: 13px;
    color: var(--pach-text);
    line-height: 1.45;
}

#pach-preview-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

#pach-preview-close:hover {
    color: var(--pach-muted);
}

/* ============================================================
   Chat panel — 380px desktop, 580px max-height
   ============================================================ */
#pach-chat-panel {
    width: 380px !important;
    max-height: 580px;
    max-height: min(580px, calc(100vh - 100px)) !important;
    background: var(--pach-bg, #ffffff) !important;
    border-radius: var(--pach-radius, 16px) !important;
    box-shadow: var(--pach-shadow, 0 8px 32px rgba(0, 0, 0, 0.12)) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    order: 1;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* ============================================================
   Panel open animation (spring)
   ============================================================ */
@keyframes pachPanelIn {
    from { transform: translateY(20px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0) scale(1);       opacity: 1; }
}

#pach-chat-panel:not(.pach-hidden) {
    animation: pachPanelIn 0.25s cubic-bezier(0, 1.2, 1, 1) forwards;
}

/* ============================================================
   Header — 56px, purple gradient
   ============================================================ */
#pach-chat-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 16px !important;
    height: 52px !important;
    min-height: 52px !important;
    background: linear-gradient(135deg, var(--pach-color) 0%, var(--pach-primary-dark, #6d28d9) 100%) !important;
    color: #fff !important;
    flex-shrink: 0;
    border-radius: 16px 16px 0 0 !important;
}

.pach-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

/* Persona avatar — 32px circle with white initials */
.pach-header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--pach-color, #7c3aed);
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pach-header-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

#pach-chat-title {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.pach-header-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 8px;
    gap: 4px;
}

/* ============================================================
   Online / offline status indicator
   ============================================================ */
.pach-status-line {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pach-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.pach-status-dot.online {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.pach-status-dot.offline {
    background: #9ca3af;
}

.pach-status-text {
    font-size: 11px;
    opacity: 0.8;
    line-height: 1;
}

/* ============================================================
   Sound toggle + close button (header)
   ============================================================ */
.pach-sound-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    padding: 6px;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.pach-sound-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.pach-sound-toggle svg {
    width: 16px;
    height: 16px;
}

/* Mobile back arrow (hidden on desktop, shown on mobile) */
.pach-back-btn {
    display: none;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding: 6px;
    margin-right: 4px;
    border-radius: 6px;
    align-items: center;
    justify-content: center;
}

.pach-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.pach-back-btn svg {
    width: 18px;
    height: 18px;
}

#pach-chat-close {
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 18px !important;
    cursor: pointer !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 10 !important;
    line-height: 1;
    padding: 6px;
    flex-shrink: 0;
    transition: color 0.15s ease, background 0.15s ease;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#pach-chat-close:hover,
#pach-chat-close:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

/* ============================================================
   Welcome state — greeting + quick replies + contact form
   ============================================================ */
.pach-welcome {
    padding: 20px 16px 8px;
    flex-shrink: 0;
}

.pach-welcome-greeting {
    font-size: 15px;
    font-weight: 500;
    color: var(--pach-text);
    line-height: 1.5;
    margin: 0 0 12px;
}

/* ============================================================
   Contact / identity form — compact inline card
   ============================================================ */
#pach-chat-form {
    margin: 0 16px 12px;
    padding: 14px;
    border: 1px solid var(--pach-border);
    border-radius: 12px;
    background: #fafbfc;
    flex-shrink: 0;
}

.pach-form-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

#pach-chat-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--pach-text);
    background: #fff;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#pach-chat-form input:focus {
    border-color: var(--pach-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
}

#pach-chat-form input::placeholder {
    color: #9ca3af;
}

.pach-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

#pach-form-start {
    flex: 1;
    background: var(--pach-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

#pach-form-start:hover,
#pach-form-start:focus-visible {
    background: var(--pach-primary-dark);
    outline: none;
}

#pach-form-start:active {
    transform: scale(0.98);
}

.pach-form-skip {
    background: none;
    border: none;
    color: var(--pach-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: color 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.pach-form-skip:hover {
    color: var(--pach-text);
}

/* ============================================================
   Messages area
   ============================================================ */
#pach-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scroll-behavior: smooth;
    min-height: 200px;
}

#pach-chat-messages::-webkit-scrollbar {
    width: 4px;
}

#pach-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#pach-chat-messages::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-radius: 4px;
}

#pach-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a1a1aa;
}

/* ============================================================
   Message bubbles
   ============================================================ */
.pach-msg {
    display: flex !important;
    flex-direction: column !important;
    max-width: 75% !important;
}

/* Visitor — themed color, right-aligned */
.pach-msg--visitor {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.pach-msg--visitor .pach-bubble {
    background: var(--pach-color) !important;
    color: #fff !important;
    border-radius: 16px 16px 4px 16px !important;
}

.pach-msg--visitor .pach-bubble a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

/* AI — light grey, left-aligned */
.pach-msg--ai {
    align-self: flex-start;
}

.pach-msg--ai .pach-bubble {
    background: #f3f4f6 !important;
    color: var(--pach-text) !important;
    border-radius: 16px 16px 16px 4px !important;
}

/* Admin — subtle green-tinted, left-aligned */
.pach-msg--admin {
    align-self: flex-start;
}

.pach-msg--admin .pach-bubble {
    background: #ecfdf5 !important;
    color: #065f46 !important;
    border-radius: 16px 16px 16px 4px !important;
}

/* System message — amber banner */
.pach-msg--system {
    align-self: center;
    max-width: 90%;
}

.pach-msg--system .pach-bubble {
    background: #fef3c7;
    color: #92400e;
    font-size: 13px;
    text-align: center;
    border-radius: 8px;
    padding: 8px 14px;
}

.pach-bubble {
    padding: 10px 14px !important;
    word-break: break-word;
    font-size: 14px !important;
    line-height: 1.45 !important;
}

/* Timestamp under bubble */
.pach-msg-time {
    font-size: 11px;
    color: var(--pach-muted);
    margin-top: 3px;
    padding: 0 4px;
    opacity: 0.7;
}

.pach-msg--visitor .pach-msg-time {
    text-align: right;
}

/* ============================================================
   Typing dots indicator
   ============================================================ */
.pach-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    min-width: 48px;
}

.pach-typing-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
    animation: pachBounce 1.2s infinite ease-in-out;
}

.pach-typing-dots span:nth-child(1) { animation-delay: 0s;   }
.pach-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.pach-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pachBounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
    40%            { transform: scale(1);   opacity: 1;   }
}

/* ============================================================
   Quick replies — horizontal wrap of outlined pills
   ============================================================ */
.pach-quick-replies {
    display: flex;
    gap: 8px;
    padding: 8px 16px 12px;
    flex-wrap: nowrap;
    flex-shrink: 0;
    overflow-x: auto;
}

.pach-quick-reply-btn {
    background: var(--pach-bg);
    color: var(--pach-color);
    border: 1.5px solid var(--pach-color);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
    flex-shrink: 0;
}

.pach-quick-reply-btn:hover {
    background: var(--pach-color);
    color: #fff;
}

.pach-quick-reply-btn:active {
    transform: scale(0.96);
}

/* ============================================================
   Input area — clean bottom bar
   ============================================================ */
#pach-chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--pach-border);
    background: var(--pach-bg);
    flex-shrink: 0;
}

#pach-chat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 22px;
    padding: 9px 16px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    color: var(--pach-text);
    background: #f9fafb;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

#pach-chat-input:focus {
    border-color: var(--pach-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
    background: #fff;
}

#pach-chat-input::placeholder {
    color: #9ca3af;
}

#pach-chat-input:disabled {
    background: #f3f4f6;
    color: var(--pach-muted);
    cursor: not-allowed;
}

#pach-chat-send {
    width: 38px !important;
    height: 38px !important;
    background: var(--pach-color) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background 0.15s ease, transform 0.1s ease;
    flex-shrink: 0;
    padding: 0 !important;
}

#pach-chat-send:hover,
#pach-chat-send:focus-visible {
    background: var(--pach-primary-dark);
    outline: none;
}

#pach-chat-send:active {
    transform: scale(0.92);
}

#pach-chat-send:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

#pach-chat-send svg {
    width: 18px;
    height: 18px;
}

/* ============================================================
   Post-chat rating UI
   ============================================================ */
.pach-rating {
    padding: 20px 16px;
    text-align: center;
    border-top: 1px solid var(--pach-border);
    flex-shrink: 0;
    background: #fafbfc;
}

.pach-rating h4 {
    margin: 0 0 14px;
    font-size: 15px;
    color: var(--pach-text);
    font-weight: 600;
}

.pach-stars {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 14px;
}

.pach-star {
    cursor: pointer;
    transition: transform 0.15s ease;
    display: flex;
    align-items: center;
    padding: 2px;
}

.pach-star:hover {
    transform: scale(1.2);
}

.pach-star svg {
    width: 28px;
    height: 28px;
}

.pach-rating textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    margin-bottom: 10px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s;
    color: var(--pach-text);
}

.pach-rating textarea:focus {
    border-color: var(--pach-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
}

.pach-rating textarea::placeholder {
    color: #9ca3af;
}

.pach-rating button {
    background: var(--pach-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.pach-rating button:hover {
    background: var(--pach-primary-dark);
}

.pach-rating button:active {
    transform: scale(0.98);
}

.pach-rating-thanks {
    color: #22c55e;
    font-weight: 600;
    font-size: 14px;
    margin: 0;
    padding: 8px 0;
}

/* ============================================================
   Powered-by footer
   ============================================================ */
.pach-powered {
    text-align: center;
    padding: 6px 16px 8px;
    font-size: 11px;
    color: #b0b0b8;
    border-top: 1px solid var(--pach-border);
    background: var(--pach-bg);
    flex-shrink: 0;
}

/* ============================================================
   Utility
   ============================================================ */
.pach-hidden,
#pach-chat-panel.pach-hidden,
#pach-chat-preview.pach-hidden,
#pach-chat-root .pach-hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* ============================================================
   Mobile — fullscreen panel
   ============================================================ */
@media (max-width: 480px) {
    #pach-chat-root {
        bottom: 80px !important;
        right: 16px !important;
        left: auto !important;
    }

    #pach-chat-root.pach-position-left {
        left: 16px !important;
        right: auto !important;
    }

    /* Bubble: 48px, above BeTheme bottom nav */
    #pach-chat-toggle {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        align-self: flex-end !important;
        box-shadow: 0 4px 16px rgba(124, 58, 237, 0.45) !important;
    }

    #pach-chat-toggle svg {
        width: 22px !important;
        height: 22px !important;
    }

    /* Panel: fullscreen */
    #pach-chat-panel {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        z-index: 2147483647 !important;
    }

    /* Show back arrow, hide X */
    .pach-back-btn {
        display: flex;
    }

    #pach-chat-close {
        display: none;
    }

    /* Stack form fields */
    .pach-form-row {
        flex-direction: column;
    }

    #pach-chat-preview {
        max-width: calc(100vw - 80px);
    }

    /* Scroll lock on body when open */
    body.pach-chat-open {
        overflow: hidden !important;
        position: fixed;
        width: 100%;
    }
}
