/* Stash2Go Chat Widget — syncs with site theme (aurora/dark/light) */

/* ================================================================== */
/* AURORA (default) — glassmorphic, animated, translucent             */
/* ================================================================== */
#s2g-chat-fab,
#s2g-chat-panel {
    --cw-bg: rgba(25, 15, 75, 0.42);
    --cw-bg-blur: blur(20px) saturate(1.4);
    --cw-surface: rgba(20, 12, 60, 0.6);
    --cw-surface2: rgba(255, 255, 255, 0.08);
    --cw-surface3: rgba(255, 255, 255, 0.12);
    --cw-border: rgba(139, 92, 246, 0.25);
    --cw-border-subtle: rgba(255, 255, 255, 0.1);
    --cw-text: white;
    --cw-text-muted: rgba(255, 255, 255, 0.6);
    --cw-text-faint: rgba(255, 255, 255, 0.35);
    --cw-text-footer: rgba(255, 255, 255, 0.3);
    --cw-accent: #8b5cf6;
    --cw-accent-text: rgba(167, 139, 250, 1);
    --cw-accent-bright: rgba(196, 181, 253, 1);
    --cw-accent-btn: rgba(139, 92, 246, 0.4);
    --cw-accent-btn-border: rgba(139, 92, 246, 0.4);
    --cw-accent-btn-hover: rgba(139, 92, 246, 0.6);
    --cw-user-bg: rgba(139, 92, 246, 0.25);
    --cw-user-border: rgba(139, 92, 246, 0.35);
    --cw-bot-bg: rgba(255, 255, 255, 0.06);
    --cw-bot-border: rgba(255, 255, 255, 0.08);
    --cw-rav-link: rgba(45, 212, 191, 0.9);
    --cw-rose: rgba(244, 114, 182, 0.9);
    --cw-img-border: rgba(255, 255, 255, 0.08);
    --cw-shadow: 0 8px 48px rgba(67, 56, 202, 0.25), 0 0 0 1px rgba(139, 92, 246, 0.1);
    --cw-fab-bg: rgba(25, 15, 75, 0.7);
    --cw-fab-hover: rgba(25, 15, 75, 0.85);
    --cw-fab-shadow: 0 4px 24px rgba(67, 56, 202, 0.3), 0 0 0 1px rgba(139, 92, 246, 0.15);
    --cw-fab-hover-shadow: 0 8px 32px rgba(67, 56, 202, 0.4), 0 0 0 1px rgba(139, 92, 246, 0.3);
    --cw-scrollbar: rgba(255, 255, 255, 0.12);
    --cw-dots: rgba(255, 255, 255, 0.4);
    --cw-suggestion-hover-bg: rgba(139, 92, 246, 0.2);
    --cw-suggestion-hover-border: rgba(139, 92, 246, 0.4);
    --cw-logo-filter: none;
    --cw-fab-color: white;
    --cw-send-color: white;
    --cw-input-bg: rgba(255, 255, 255, 0.06);
}

/* ================================================================== */
/* DARK — solid opaque backgrounds                                    */
/* ================================================================== */
.theme-dark #s2g-chat-fab,
.theme-dark #s2g-chat-panel {
    --cw-bg: #110d24;
    --cw-bg-blur: none;
    --cw-surface: #15102a;
    --cw-surface2: #1e1840;
    --cw-surface3: #2a2050;
    --cw-fab-bg: #1a1035;
    --cw-fab-hover: #231548;
    --cw-user-bg: #2d1b69;
    --cw-bot-bg: #1a1632;
    --cw-accent-btn: #3b1f8e;
    --cw-accent-btn-border: rgba(139, 92, 246, 0.3);
    --cw-accent-btn-hover: #4c28b0;
    --cw-shadow: 0 8px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(139, 92, 246, 0.15);
    --cw-fab-shadow: 0 4px 24px rgba(67, 56, 202, 0.35), 0 0 0 1px rgba(139, 92, 246, 0.15);
    --cw-fab-hover-shadow: 0 8px 32px rgba(67, 56, 202, 0.5), 0 0 0 1px rgba(139, 92, 246, 0.3);
    --cw-input-bg: #1e1840;
}

/* ================================================================== */
/* LIGHT — clean white, dark text, dark logo                          */
/* ================================================================== */
.theme-light #s2g-chat-fab,
.theme-light #s2g-chat-panel {
    --cw-bg: #ffffff;
    --cw-bg-blur: none;
    --cw-surface: #f8f7fc;
    --cw-surface2: #f0eef6;
    --cw-surface3: #e8e5f0;
    --cw-border: rgba(139, 92, 246, 0.18);
    --cw-border-subtle: rgba(0, 0, 0, 0.08);
    --cw-text: #1a1a2e;
    --cw-text-muted: rgba(0, 0, 0, 0.5);
    --cw-text-faint: rgba(0, 0, 0, 0.35);
    --cw-text-footer: rgba(0, 0, 0, 0.3);
    --cw-accent: #7c3aed;
    --cw-accent-text: #6d28d9;
    --cw-accent-bright: #5b21b6;
    --cw-accent-btn: #7c3aed;
    --cw-accent-btn-border: transparent;
    --cw-accent-btn-hover: #6d28d9;
    --cw-user-bg: #ede9fe;
    --cw-user-border: rgba(139, 92, 246, 0.25);
    --cw-bot-bg: #f8f7fc;
    --cw-bot-border: rgba(0, 0, 0, 0.07);
    --cw-rav-link: #0d9488;
    --cw-rose: #db2777;
    --cw-img-border: rgba(0, 0, 0, 0.08);
    --cw-shadow: 0 8px 48px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    --cw-fab-bg: #ffffff;
    --cw-fab-hover: #f8f7fc;
    --cw-fab-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(139, 92, 246, 0.15);
    --cw-fab-hover-shadow: 0 8px 32px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(139, 92, 246, 0.3);
    --cw-scrollbar: rgba(0, 0, 0, 0.1);
    --cw-dots: rgba(139, 92, 246, 0.5);
    --cw-suggestion-hover-bg: rgba(139, 92, 246, 0.06);
    --cw-suggestion-hover-border: rgba(139, 92, 246, 0.3);
    --cw-logo-filter: brightness(0.15);
    --cw-fab-color: #7c3aed;
    --cw-send-color: white;
    --cw-input-bg: #f0eef6;
}

/* ================================================================== */
/* FAB button                                                         */
/* ================================================================== */
#s2g-chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    border: 1px solid var(--cw-border);
    background: var(--cw-fab-bg);
    backdrop-filter: var(--cw-bg-blur);
    -webkit-backdrop-filter: var(--cw-bg-blur);
    color: var(--cw-fab-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--cw-fab-shadow);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
}

#s2g-chat-fab:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--cw-fab-hover-shadow);
    background: var(--cw-fab-hover);
}

#s2g-chat-fab svg {
    width: 26px;
    height: 26px;
    transition: transform 0.3s;
}

#s2g-chat-fab.open svg {
    transform: rotate(90deg);
}

/* ================================================================== */
/* Chat panel                                                         */
/* ================================================================== */
#s2g-chat-panel {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 420px;
    height: 580px;
    max-height: calc(100dvh - 120px);
    border-radius: 20px;
    border: 1px solid var(--cw-border);
    background: var(--cw-bg);
    backdrop-filter: var(--cw-bg-blur);
    -webkit-backdrop-filter: var(--cw-bg-blur);
    box-shadow: var(--cw-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.25s;
}

#s2g-chat-panel.visible {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ================================================================== */
/* Header                                                             */
/* ================================================================== */
#s2g-chat-panel .chat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    background: var(--cw-surface);
    border-bottom: 1px solid var(--cw-border-subtle);
    flex-shrink: 0;
}

#s2g-chat-panel .chat-head img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    filter: var(--cw-logo-filter);
    transition: filter 0.3s;
}

#s2g-chat-panel .chat-head-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

#s2g-chat-panel .chat-head-actions button {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--cw-border-subtle);
    background: var(--cw-surface2);
    color: var(--cw-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#s2g-chat-panel .chat-head-actions button:hover {
    background: var(--cw-surface3);
    color: var(--cw-text);
}

#s2g-chat-panel .chat-head-actions button:focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.6);
    outline-offset: 2px;
}

#s2g-chat-panel .chat-head-text h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--cw-text);
    margin: 0;
    line-height: 1.2;
}

#s2g-chat-panel .chat-head-text span {
    font-size: 11px;
    color: var(--cw-text-muted);
    font-weight: 500;
}

/* ================================================================== */
/* Messages                                                           */
/* ================================================================== */
#s2g-chat-panel .chat-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

#s2g-chat-panel .chat-msgs::-webkit-scrollbar { width: 4px; }
#s2g-chat-panel .chat-msgs::-webkit-scrollbar-track { background: transparent; }
#s2g-chat-panel .chat-msgs::-webkit-scrollbar-thumb {
    background: var(--cw-scrollbar);
    border-radius: 2px;
}

#s2g-chat-panel .msg {
    max-width: 88%;
    animation: msgIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

#s2g-chat-panel .msg.user { align-self: flex-end; }
#s2g-chat-panel .msg.bot { align-self: flex-start; }

#s2g-chat-panel .msg-body {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--cw-text);
}

#s2g-chat-panel .msg.user .msg-body {
    background: var(--cw-user-bg);
    border: 1px solid var(--cw-user-border);
    border-radius: 14px 14px 4px 14px;
}

#s2g-chat-panel .msg.bot .msg-body {
    background: var(--cw-bot-bg);
    border: 1px solid var(--cw-bot-border);
    border-radius: 14px 14px 14px 4px;
}

#s2g-chat-panel .msg-body p { margin-bottom: 8px; }
#s2g-chat-panel .msg-body p:last-child { margin-bottom: 0; }

#s2g-chat-panel .msg-body strong {
    color: var(--cw-text);
    font-weight: 700;
}

#s2g-chat-panel .msg-body em {
    color: var(--cw-rose);
}

#s2g-chat-panel .msg-body h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--cw-accent-bright);
    margin: 12px 0 4px;
}

#s2g-chat-panel .msg-body h3:first-child { margin-top: 0; }

#s2g-chat-panel .msg-body a {
    color: var(--cw-accent-text);
    text-decoration: none;
    font-weight: 600;
}

#s2g-chat-panel .msg-body a:hover {
    text-decoration: underline;
}

/* Pattern images — clickable */
#s2g-chat-panel .msg-body .pattern-img {
    margin: 8px 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--cw-img-border);
    max-width: 260px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

#s2g-chat-panel .msg-body .pattern-img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

#s2g-chat-panel .msg-body .pattern-img img {
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: cover;
    display: block;
}

#s2g-chat-panel .msg-body img:not(.pattern-img img) {
    max-width: 260px;
    max-height: 180px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--cw-img-border);
    display: block;
    margin: 8px 0;
}

/* CTA button */
#s2g-chat-panel .msg-body .open-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--cw-send-color);
    background: var(--cw-accent-btn);
    padding: 5px 12px;
    border-radius: 99px;
    text-decoration: none;
    border: 1px solid var(--cw-accent-btn-border);
    transition: all 0.2s;
}

#s2g-chat-panel .msg-body .open-btn:hover {
    background: var(--cw-accent-btn-hover);
    text-decoration: none;
    color: var(--cw-send-color);
}

#s2g-chat-panel .msg-body .rav-link {
    color: var(--cw-rav-link);
}

#s2g-chat-panel .msg-body .link-sep {
    color: var(--cw-text-faint);
    margin: 0 2px;
}

#s2g-chat-panel .msg-body ul,
#s2g-chat-panel .msg-body ol {
    margin: 6px 0;
    padding-left: 20px;
}

#s2g-chat-panel .msg-body ol {
    list-style: decimal;
}

#s2g-chat-panel .msg-body li {
    margin-bottom: 4px;
    line-height: 1.5;
}

/* ================================================================== */
/* Suggestions                                                        */
/* ================================================================== */
#s2g-chat-panel .suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

#s2g-chat-panel .suggestion {
    background: var(--cw-surface2);
    border: 1px solid var(--cw-border);
    color: var(--cw-text);
    padding: 7px 13px;
    border-radius: 99px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

#s2g-chat-panel .suggestion:hover {
    background: var(--cw-suggestion-hover-bg);
    border-color: var(--cw-suggestion-hover-border);
}

/* ================================================================== */
/* Typing indicator                                                   */
/* ================================================================== */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cw-dots);
    animation: dotPulse 1.4s infinite ease-in-out;
}

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

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.3; }
    40% { transform: scale(1.2); opacity: 0.8; }
}

/* ================================================================== */
/* Input                                                              */
/* ================================================================== */
#s2g-chat-panel .chat-input {
    display: flex;
    gap: 8px;
    padding: 12px 14px 14px;
    background: var(--cw-surface);
    border-top: 1px solid var(--cw-border-subtle);
    align-items: center;
    flex-shrink: 0;
}

#s2g-chat-panel .chat-input input {
    flex: 1;
    background: var(--cw-input-bg);
    border: 1px solid var(--cw-border-subtle);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--cw-text);
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

#s2g-chat-panel .chat-input input::placeholder {
    color: var(--cw-text-faint);
}

#s2g-chat-panel .chat-input input:focus {
    border-color: var(--cw-accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

#s2g-chat-panel .chat-input button {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--cw-accent-btn-border);
    background: var(--cw-accent-btn);
    color: var(--cw-send-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

#s2g-chat-panel .chat-input button:hover {
    background: var(--cw-accent-btn-hover);
}

#s2g-chat-panel .chat-input button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#s2g-chat-panel .chat-footer {
    text-align: center;
    font-size: 10px;
    color: var(--cw-text-footer);
    padding: 0 14px 10px;
}

/* ================================================================== */
/* Fullscreen                                                         */
/* ================================================================== */
#s2g-chat-panel.fullscreen {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    z-index: 10000;
}

#s2g-chat-panel.fullscreen .chat-msgs {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

#s2g-chat-panel.fullscreen .chat-input {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

#s2g-chat-panel.fullscreen .chat-footer {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

#s2g-chat-panel.fullscreen .msg {
    max-width: 80%;
}

#s2g-chat-panel.fullscreen .msg-body {
    font-size: 15px;
}

#s2g-chat-panel.fullscreen .pattern-img {
    max-width: 360px;
}

/* ================================================================== */
/* Reduced motion                                                     */
/* ================================================================== */
@media (prefers-reduced-motion: reduce) {
    #s2g-chat-fab,
    #s2g-chat-panel { animation: none; }
    #s2g-chat-panel .msg { animation: none; }
    .typing-dots span { animation: none; opacity: 0.6; }
    #s2g-chat-panel { transition-duration: 0.01s; }
}

/* ================================================================== */
/* Pattern detail modal                                               */
/* ================================================================== */
#s2g-pattern-modal {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
}

#s2g-pattern-modal.visible {
    visibility: visible;
    opacity: 1;
}

#s2g-pattern-modal .pm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#s2g-pattern-modal .pm-content {
    position: relative;
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    width: calc(100% - 32px);
    max-width: 340px;
    max-height: calc(100% - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(12px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#s2g-pattern-modal .pm-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

#s2g-pattern-modal.visible .pm-content {
    transform: translateY(0);
}

#s2g-pattern-modal .pm-img-wrap {
    width: 100%;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

#s2g-pattern-modal .pm-img-wrap img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
}

#s2g-pattern-modal h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--cw-text);
    margin: 14px 16px 6px;
    line-height: 1.3;
}

#s2g-pattern-modal .pm-details {
    padding: 0 16px 12px;
}

#s2g-pattern-modal .pm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--cw-border-subtle);
    font-size: 13px;
}

#s2g-pattern-modal .pm-row:last-child {
    border-bottom: none;
}

#s2g-pattern-modal .pm-label {
    color: var(--cw-text-muted);
    font-weight: 500;
}

#s2g-pattern-modal .pm-value {
    color: var(--cw-text);
    font-weight: 600;
}

#s2g-pattern-modal .pm-price {
    color: var(--cw-accent);
}

/* Stars and difficulty */
#s2g-pattern-modal .pm-stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

#s2g-pattern-modal .pm-stars svg {
    vertical-align: middle;
}

#s2g-pattern-modal .pm-rating-num {
    font-size: 12px;
    margin-left: 4px;
    color: var(--cw-text-muted);
}

#s2g-pattern-modal .pm-diff {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

#s2g-pattern-modal .pm-diff-bar {
    width: 60px;
    height: 6px;
    border-radius: 3px;
    background: var(--cw-surface2);
    overflow: hidden;
}

#s2g-pattern-modal .pm-diff-fill {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--cw-accent);
}

#s2g-pattern-modal .pm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 0 4px;
}

#s2g-pattern-modal .pm-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 99px;
    background: var(--cw-surface2);
    border: 1px solid var(--cw-border-subtle);
    color: var(--cw-text-muted);
    text-transform: capitalize;
}

#s2g-pattern-modal .pm-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--cw-border-subtle);
    flex-shrink: 0;
}

#s2g-pattern-modal .pm-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    border: none;
}

#s2g-pattern-modal .pm-btn-primary {
    background: var(--cw-accent);
    color: white;
}

#s2g-pattern-modal .pm-btn-primary:hover {
    filter: brightness(1.1);
    text-decoration: none;
    color: white;
}

#s2g-pattern-modal .pm-btn-secondary {
    background: var(--cw-surface2);
    color: var(--cw-text);
    border: 1px solid var(--cw-border-subtle);
}

#s2g-pattern-modal .pm-btn-secondary:hover {
    background: var(--cw-surface3);
}

/* ================================================================== */
/* Mobile — auto-fullscreen with safe area support                    */
/* ================================================================== */
@media (max-width: 480px) {
    #s2g-chat-panel.visible {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
        z-index: 10000;
    }

    #s2g-chat-panel.visible .chat-head {
        padding-top: calc(12px + env(safe-area-inset-top, 0px));
        padding-left: calc(18px + env(safe-area-inset-left, 0px));
        padding-right: calc(18px + env(safe-area-inset-right, 0px));
    }

    #s2g-chat-panel.visible .chat-msgs {
        padding-left: calc(16px + env(safe-area-inset-left, 0px));
        padding-right: calc(16px + env(safe-area-inset-right, 0px));
    }

    #s2g-chat-panel.visible .chat-input {
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        padding-left: calc(14px + env(safe-area-inset-left, 0px));
        padding-right: calc(14px + env(safe-area-inset-right, 0px));
    }

    #s2g-chat-panel.visible .chat-footer {
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    /* Hide FAB when panel is open on mobile */
    #s2g-chat-fab.open {
        display: none;
    }

    #s2g-chat-fab {
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        right: 16px;
    }

    /* Hide fullscreen button on mobile — always fullscreen */
    #s2g-chat-panel.visible #s2g-fullscreen {
        display: none;
    }
}
