/* ShopGlowsy — chat-first store assistant */
.sg-ai-fab {
    position: fixed;
    bottom: 100px;
    left: 20px;
    z-index: 2400;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #7a3e4d 0%, #4a2c3a 50%, #9d5c6d 100%);
    background-size: 200% 200%;
    animation: sgAiFabGlow 4s ease infinite;
    color: #fff;
    box-shadow: 0 12px 32px rgba(74, 44, 58, 0.45);
    cursor: pointer;
    font-size: 1.25rem;
    display: none;
    transition: transform 0.2s ease;
}
@keyframes sgAiFabGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
body.store-editor-on .sg-ai-fab { display: flex; align-items: center; justify-content: center; }
.sg-ai-fab:hover { transform: translateY(-3px) scale(1.04); }

.sg-ai-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 10, 14, 0.45);
    backdrop-filter: blur(6px);
    z-index: 2500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.sg-ai-backdrop.is-open { opacity: 1; pointer-events: auto; }

.sg-ai-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 100vw);
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    --sg-ai-kb-offset: 0px;
    padding-bottom: var(--sg-ai-kb-offset);
    background: #faf8f9;
    z-index: 2510;
    display: flex;
    flex-direction: column;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.12);
    transform: translateX(105%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.sg-ai-panel.is-open { transform: translateX(0); }

/* Focus mode — hide visual editor chrome while chatting */
body.sg-ai-panel-open .store-editor-bar,
body.sg-ai-panel-open .se-save-float,
body.sg-ai-panel-open .store-editor-image-guide,
body.sg-ai-panel-open .se-style-panel,
body.sg-ai-panel-open .se-style-panel-backdrop {
    display: none !important;
}
body.sg-ai-panel-open.store-editor-on {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.sg-ai-panel-header {
    padding: 14px 16px;
    background: linear-gradient(135deg, #4a2c3a, #7a3e4d);
    color: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.sg-ai-mode-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 9px;
    border-radius: 999px;
    line-height: 1;
    flex-shrink: 0;
    align-self: flex-start;
}
.sg-ai-mode-badge--template {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.22);
}
.sg-ai-mode-badge--studio {
    background: linear-gradient(135deg, rgba(255, 183, 220, 0.35), rgba(232, 160, 200, 0.22));
    color: #ffe8f4;
    border: 1px solid rgba(255, 183, 220, 0.45);
}
.sg-ai-panel-title h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sg-ai-panel-tagline {
    margin: 4px 0 0;
    font-size: 0.72rem;
    opacity: 0.88;
    line-height: 1.35;
}
.sg-ai-panel-close {
    border: none;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    cursor: pointer;
    flex-shrink: 0;
}

.sg-ai-section-chip {
    margin: 8px 12px 0;
    padding: 7px 11px;
    background: rgba(122, 62, 77, 0.1);
    border-radius: 10px;
    font-size: 0.75rem;
    color: #4a2c3a;
    display: none;
    border-left: 3px solid #7a3e4d;
    flex-shrink: 0;
}
.sg-ai-section-chip.is-visible { display: block; }

/* Chat area — primary focus */
.sg-ai-chat {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sg-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
}
.sg-ai-messages > * {
    flex-shrink: 0;
}

.sg-ai-msg {
    max-width: 88%;
    padding: 11px 14px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.5;
    animation: sgAiMsgIn 0.35s ease;
}
@keyframes sgAiMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.sg-ai-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #7a3e4d, #5c3040);
    color: #fff;
    border-bottom-right-radius: 5px;
}
.sg-ai-msg.assistant {
    align-self: flex-start;
    background: #fff;
    border: 1px solid rgba(74, 44, 58, 0.08);
    color: #3d2a32;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.sg-ai-msg-welcome { max-width: 95%; font-size: 0.86rem; }

/* Inline action / preview cards */
.sg-ai-card {
    align-self: stretch;
    max-width: 100%;
    background: #fff;
    border: 1px solid rgba(122, 62, 77, 0.18);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 8px 24px rgba(74, 44, 58, 0.08);
    animation: sgAiMsgIn 0.4s ease;
}
.sg-ai-card-preview { border-color: rgba(122, 62, 77, 0.28); }
.sg-ai-card-error {
    border-color: rgba(220, 38, 38, 0.25);
    background: #fffbfb;
}
.sg-ai-card-staging {
    border-style: dashed;
    border-color: rgba(122, 62, 77, 0.35);
    background: linear-gradient(135deg, #fff 0%, #faf6f8 100%);
}
.sg-ai-card-studio {
    border-color: rgba(255, 183, 220, 0.45);
    background: linear-gradient(180deg, rgba(255, 183, 220, 0.08), rgba(255, 255, 255, 0.98));
}
.sg-ai-card-studio-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.sg-ai-onboarding-backdrop {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(8, 4, 14, 0.72);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.sg-ai-onboarding-card {
    width: min(420px, 100%);
    border-radius: 20px;
    padding: 1.35rem 1.4rem 1.45rem;
    background: linear-gradient(160deg, #12081a 0%, #241230 55%, #3a1f48 100%);
    color: #f7edf5;
    border: 1px solid rgba(255, 183, 220, 0.28);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.sg-ai-onboarding-kicker {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 0.45rem;
}
.sg-ai-onboarding-card h3 {
    margin: 0 0 0.75rem;
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    line-height: 1.25;
}
.sg-ai-onboarding-card p {
    margin: 0 0 0.65rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
}
.sg-ai-onboarding-note {
    font-size: 0.8rem !important;
    opacity: 0.78;
}
.sg-ai-onboarding-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
    align-items: center;
}
.sg-ai-onboarding-start {
    border: none;
    border-radius: 999px;
    padding: 0.7rem 1.1rem;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, #ffb7dc, #e8a0c8);
    color: #2a1220;
}
.sg-ai-onboarding-link {
    color: #ffe8f4;
    font-size: 0.85rem;
    text-decoration: underline;
}
.sg-ai-card-dismissed { opacity: 0.55; pointer-events: none; transition: opacity 0.35s ease; }
.sg-ai-msg-streaming::after {
    content: '▋';
    display: inline-block;
    margin-left: 2px;
    color: rgba(122, 62, 77, 0.85);
    animation: sg-ai-stream-cursor 1s step-end infinite;
    vertical-align: baseline;
}
@keyframes sg-ai-stream-cursor {
    50% { opacity: 0; }
}
body.sg-ai-studio-workspace .sg-ai-msg-streaming {
    white-space: pre-wrap;
    line-height: 1.55;
}
.sg-ai-card-applied { border-color: rgba(22, 163, 74, 0.35); }

.sg-ai-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7a3e4d;
    margin-bottom: 8px;
}
.sg-ai-card-summary {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.45;
    color: #4a2c3a;
}
.sg-ai-card-changes {
    margin: 10px 0 0;
    padding: 0 0 0 18px;
    font-size: 0.8rem;
    color: #5c3040;
    line-height: 1.4;
}
.sg-ai-card-changes li { margin-bottom: 4px; }

.sg-ai-card-diff {
    margin-top: 10px;
    padding: 10px;
    background: #f8f4f5;
    border-radius: 12px;
    font-size: 0.74rem;
}
.sg-ai-card-diff-row {
    display: grid;
    grid-template-columns: 52px 1fr 1fr;
    gap: 6px;
    align-items: start;
    margin-bottom: 6px;
}
.sg-ai-card-diff-label {
    font-weight: 700;
    color: #8b6f7a;
    font-size: 0.65rem;
    text-transform: uppercase;
}
.sg-ai-card-diff-before {
    padding: 6px 8px;
    background: #fef2f2;
    color: #7f1d1d;
    border-radius: 8px;
    word-break: break-word;
}
.sg-ai-card-diff-after {
    padding: 6px 8px;
    background: #f0fdf4;
    color: #166534;
    border-radius: 8px;
    word-break: break-word;
}
.sg-ai-card-swatch-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.sg-ai-card-swatch-row i {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}
.sg-ai-card-diff-hint {
    margin: 0;
    color: #8b6f7a;
    font-size: 0.72rem;
}

.sg-ai-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.sg-ai-card-actions button {
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.sg-ai-card-apply {
    background: linear-gradient(135deg, #25d366, #1ea854);
    color: #fff;
    flex: 1;
    min-width: 140px;
    justify-content: center;
}
.sg-ai-card-apply:disabled { opacity: 0.7; cursor: wait; }
.sg-ai-card-dismiss,
.sg-ai-card-retry {
    background: #f0ebe9;
    color: #4a2c3a;
}
.sg-ai-card-undo {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca !important;
}
.sg-ai-card-applied-label {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 700;
    color: #166534;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Thinking indicator */
.sg-ai-thinking {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin: 0 12px 8px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(122, 62, 77, 0.12);
    font-size: 0.8rem;
    color: #5c3040;
    flex-shrink: 0;
}
.sg-ai-thinking.is-visible { display: flex; }
.sg-ai-thinking-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7a3e4d, #9d5c6d);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}
.sg-ai-thinking-body { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sg-ai-thinking-dots { display: flex; gap: 4px; }
.sg-ai-thinking-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7a3e4d;
    animation: sgAiDot 1.2s ease-in-out infinite;
}
.sg-ai-thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.sg-ai-thinking-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes sgAiDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Floating suggestions above compose */
.sg-ai-compose-wrap {
    flex-shrink: 0;
    background: #fff;
    border-top: 1px solid rgba(74, 44, 58, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sg-ai-suggestions {
    display: flex;
    gap: 8px;
    padding: 10px 12px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.sg-ai-suggestions::-webkit-scrollbar { display: none; }
.sg-ai-suggestion {
    flex: 0 0 auto;
    border: 1px solid rgba(122, 62, 77, 0.22);
    background: #faf8f9;
    color: #4a2c3a;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.sg-ai-suggestion:hover,
.sg-ai-suggestion:active {
    background: rgba(122, 62, 77, 0.1);
    border-color: #7a3e4d;
}

.sg-ai-compose {
    padding: 10px 12px 12px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.sg-ai-compose textarea {
    flex: 1;
    border: 1px solid rgba(74, 44, 58, 0.18);
    border-radius: 22px;
    padding: 12px 16px;
    font-size: 16px;
    line-height: 1.35;
    resize: none;
    min-height: 48px;
    max-height: 120px;
    background: #faf8f9;
}
.sg-ai-send {
    border: none;
    background: linear-gradient(135deg, #7a3e4d, #4a2c3a);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
}
.sg-ai-send:disabled { opacity: 0.45; cursor: not-allowed; }

/* Advanced — hidden by default */
.sg-ai-advanced {
    flex-shrink: 0;
    margin: 0 12px 6px;
    font-size: 0.78rem;
}
.sg-ai-advanced > summary {
    cursor: pointer;
    color: #8b6f7a;
    font-weight: 600;
    padding: 6px 0;
    list-style: none;
}
.sg-ai-advanced > summary::-webkit-details-marker { display: none; }
.sg-ai-style-presets {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.sg-ai-style-preset {
    flex: 0 0 auto;
    border: 2px solid rgba(74, 44, 58, 0.1);
    background: #fff;
    border-radius: 12px;
    padding: 8px 10px;
    min-width: 80px;
    cursor: pointer;
    text-align: left;
}
.sg-ai-style-preset.is-loading { opacity: 0.6; pointer-events: none; }
.sg-ai-style-swatch { display: flex; gap: 3px; margin-bottom: 4px; }
.sg-ai-style-swatch span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.sg-ai-style-preset strong { font-size: 0.68rem; color: #4a2c3a; }

.sg-ai-memory {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(74, 44, 58, 0.12);
}
.sg-ai-memory summary { cursor: pointer; color: #7a3e4d; font-weight: 600; }
.sg-ai-memory textarea {
    width: 100%;
    margin-top: 6px;
    border: 1px solid rgba(74, 44, 58, 0.15);
    border-radius: 8px;
    padding: 8px;
    font-size: 0.78rem;
}
.sg-ai-memory-save {
    margin-top: 8px;
    border: none;
    background: #4a2c3a;
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

/* Live preview highlights on storefront */
.store-editor-section-wrap.sg-ai-section-highlight {
    outline: 3px solid rgba(122, 62, 77, 0.55);
    outline-offset: 4px;
    border-radius: 12px;
    animation: sgAiSectionPulse 2s ease infinite;
}
@keyframes sgAiSectionPulse {
    0%, 100% { outline-color: rgba(122, 62, 77, 0.45); }
    50% { outline-color: rgba(212, 175, 55, 0.75); }
}
#sgAiLiveStyleSheet { display: none; }

.se-ai-section-btn, .se-ai-bar-btn {
    border: 1px solid rgba(122, 62, 77, 0.35);
    background: rgba(122, 62, 77, 0.1);
    color: #7a3e4d;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.se-ai-bar-btn {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 767px) {
    .sg-ai-panel {
        width: 100%;
        top: auto;
        bottom: 0;
        height: 94vh;
        height: min(94dvh, 780px);
        max-height: 94vh;
        max-height: 94dvh;
        border-radius: 20px 20px 0 0;
        transform: translateY(110%);
    }
    .sg-ai-fab {
        z-index: 2390;
    }
    body.sg-ai-panel-open .sg-ai-fab {
        opacity: 0;
        pointer-events: none;
    }
    .sg-ai-panel.is-open { transform: translateY(0); }
    .sg-ai-fab {
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
        left: 14px;
    }
    body.store-editor-on .se-save-float.show ~ .sg-ai-fab {
        bottom: calc(150px + env(safe-area-inset-bottom, 0px));
    }
    .sg-ai-msg { max-width: 92%; }
    .sg-ai-card-diff-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sg-ai-fab, .sg-ai-thinking-dots span, .store-editor-section-wrap.sg-ai-section-highlight {
        animation: none;
    }
    .sg-ai-panel { transition: transform 0.15s ease; }
}

/* AI Studio V2 — designer brief, compare, progress stream */
.sg-ai-designer-brief {
    background: linear-gradient(135deg, rgba(122, 62, 77, 0.08), rgba(212, 175, 55, 0.06));
    border: 1px solid rgba(122, 62, 77, 0.14);
    border-radius: 14px;
    padding: 12px 14px;
}
.sg-ai-brief-lead {
    margin: 0 0 10px;
    font-weight: 600;
    line-height: 1.45;
    color: #4a2c3a;
}
.sg-ai-brief-kicker {
    margin: 10px 0 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7a3e4d;
}
.sg-ai-brief-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #4a2c3a;
}
.sg-ai-brief-list--check { list-style: none; padding-left: 0; }
.sg-ai-brief-list--check li { padding-left: 0; }
.sg-ai-brief-patterns {
    margin: 10px 0 0;
    font-size: 0.74rem;
    color: rgba(74, 44, 58, 0.72);
}
.sg-ai-brief-progress-label {
    margin: 12px 0 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #7a3e4d;
}

.sg-ai-progress-stream {
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(122, 62, 77, 0.06);
    border: 1px dashed rgba(122, 62, 77, 0.18);
}
.sg-ai-progress-line {
    margin: 0;
    font-size: 0.8rem;
    color: #7a3e4d;
    animation: sgAiProgressPulse 1.8s ease infinite;
}
@keyframes sgAiProgressPulse {
    0%, 100% { opacity: 0.72; }
    50% { opacity: 1; }
}

.sg-ai-v2-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0 8px;
    padding: 8px;
    border-radius: 10px;
    background: rgba(74, 44, 58, 0.05);
}
.sg-ai-v2-compare-col {
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(74, 44, 58, 0.65);
}
.sg-ai-v2-compare-col--draft {
    color: #7a3e4d;
}

.sg-ai-card-diff--collapsed {
    display: none;
}
.sg-ai-card-changes-title {
    margin: 10px 0 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7a3e4d;
}
.sg-ai-card-changes-check li::before {
    content: '✓ ';
    color: #2d8a4e;
    font-weight: 700;
}
.sg-ai-card-applied-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: #2d8a4e;
    font-size: 0.82rem;
}
.sg-ai-card-draft-note {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    color: rgba(74, 44, 58, 0.65);
}
.sg-ai-card-use-draft {
    background: linear-gradient(135deg, #7a3e4d, #4a2c3a) !important;
}
.sg-ai-card-toggle-diff {
    border: 1px solid rgba(122, 62, 77, 0.25) !important;
    background: transparent !important;
    color: #7a3e4d !important;
}

.sg-ai-director-progress .sg-ai-progress-title {
    margin: 0 0 8px;
    font-weight: 700;
    font-size: 0.82rem;
    color: #4a2c3a;
}
.sg-ai-progress-checklist {
    margin: 0;
    padding: 0;
    list-style: none;
}
.sg-ai-progress-step {
    font-size: 0.78rem;
    line-height: 1.5;
    color: rgba(74, 44, 58, 0.55);
    padding: 2px 0;
}
.sg-ai-progress-step.is-active {
    color: #7a3e4d;
    font-weight: 600;
}
.sg-ai-progress-step.is-done {
    color: #2d8a4e;
}
.sg-ai-brief-archetype {
    margin: 8px 0 0;
    font-size: 0.76rem;
    color: #7a3e4d;
}

/* Developer-only QA report — hidden unless ?sg_qa=1 */
.sg-ai-qa-panel {
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 99990;
    width: min(360px, calc(100vw - 24px));
    max-height: min(52vh, 420px);
    display: flex;
    flex-direction: column;
    background: rgba(12, 10, 18, 0.96);
    border: 1px solid rgba(201, 169, 98, 0.35);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    color: #e8e2f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    line-height: 1.45;
}
.sg-ai-qa-panel[hidden] {
    display: none !important;
}
.sg-ai-qa-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 12px;
}
.sg-ai-qa-badge {
    margin-left: auto;
    margin-right: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(201, 169, 98, 0.2);
    color: #c9a962;
    font-size: 10px;
    letter-spacing: 0.06em;
}
.sg-ai-qa-close {
    border: 0;
    background: transparent;
    color: #a89bb8;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.sg-ai-qa-body {
    margin: 0;
    padding: 10px 12px 12px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    flex: 1 1 auto;
}
