.sc-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 898;
    display: none;
}
.sc-backdrop.active { display: block; }

.sc-bubble {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 52px;
    height: 52px;
    background-color: var(--green-mid, #2d5a27);
    color: white;
    cursor: pointer;
    z-index: 900;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.22);
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}
.sc-bubble:hover { transform: scale(1.08); }
.sc-bubble svg { width: 22px; height: 22px; stroke-width: 2; }

.sc-panel {
    position: fixed;
    bottom: 88px;
    right: 28px;
    width: 340px;
    max-height: 520px;
    display: none;
    flex-direction: column;
    background: white;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 899;
    font-family: 'DM Sans', sans-serif;
}
.sc-panel.open { display: flex; }

.sc-header {
    background: linear-gradient(135deg, var(--green-dark, #1a2e1a), var(--green-mid, #2d5a27));
    color: white;
    padding: 14px 16px;
    border-radius: 14px 14px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.sc-header-title { font-size: 0.92rem; font-weight: 600; }
.sc-close {
    cursor: pointer;
    opacity: 0.7;
    font-size: 1.1rem;
    background: none;
    border: none;
    color: white;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
}
.sc-close:hover { opacity: 1; }
.sc-close svg { width: 16px; height: 16px; stroke-width: 2; }

.sc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
}

.sc-msg {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.45;
    word-break: break-word;
}
.sc-msg.bot  { background: #f0f4ee; color: var(--green-dark, #1a2e1a); align-self: flex-start; border-radius: 4px 14px 14px 14px; }
.sc-msg.user { background: var(--green-mid, #2d5a27); color: white; align-self: flex-end; border-radius: 14px 4px 14px 14px; }
.sc-msg.typing { opacity: 0.6; font-style: italic; }

.sc-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e8e4da;
    flex-shrink: 0;
}
.sc-input {
    flex: 1;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 0.85rem;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 80px;
}
.sc-input:focus { border-color: var(--green-mid, #2d5a27); }
.sc-send {
    background: var(--green-mid, #2d5a27);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 13px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    white-space: nowrap;
    align-self: flex-end;
}
.sc-send:hover    { background: var(--green-bright, #4a8c3f); }
.sc-send:disabled { opacity: 0.5; cursor: default; }

.sc-msg-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.sc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-left: 2px;
}

.sc-action-btn {
    background: var(--green-mid, #2d5a27);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.sc-action-btn:hover { background: var(--green-bright, #4a8c3f); }

.sc-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding-left: 2px;
}

.sc-suggestion {
    background: white;
    color: var(--green-mid, #2d5a27);
    border: 1.5px solid var(--green-mid, #2d5a27);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.76rem;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.sc-suggestion:hover { background: #f0f4ee; }

@media (max-width: 480px) {
    .sc-panel { bottom: 0; right: 0; width: calc(100vw - 24px); border-radius: 14px 14px 0 0; }
}

/* ── Feedback icon buttons ──────────────────────────────────────────────────── */
.sc-feedback-btn {
    display: none; /* shown via JS when feedbackEnabled */
    align-items: center;
    justify-content: center;
    background: none;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    flex-shrink: 0;
    align-self: flex-end;
    transition: border-color 0.15s, background 0.15s;
    padding: 0;
    color: var(--green-mid, #2d5a27);
}
.sc-feedback-btn svg { width: 16px; height: 16px; stroke-width: 1.75; }
.sc-feedback-btn:hover { border-color: var(--green-mid, #2d5a27); background: #f0f4ee; }

/* ── Feedback overlay + dialog ──────────────────────────────────────────────── */
#sc-fb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.sc-fb-dialog {
    background: white;
    border-radius: 14px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(0,0,0,0.22);
    font-family: 'DM Sans', sans-serif;
    overflow: hidden;
}
.sc-fb-dialog-wide { max-width: 680px; }

.sc-fb-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #e8e4da;
    flex-shrink: 0;
}
.sc-fb-title { font-size: 1rem; font-weight: 700; color: var(--green-dark, #1a2e1a); }
.sc-fb-close {
    background: none;
    border: none;
    color: #9a9a8e;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
}
.sc-fb-close svg { width: 16px; height: 16px; stroke-width: 2; }
.sc-fb-close:hover { color: var(--green-dark, #1a2e1a); }

.sc-fb-body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1;
}
.sc-fb-body-screenshot { padding: 12px 16px; }

.sc-fb-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2a3a2a;
    margin-bottom: 6px;
}
.sc-fb-input, .sc-fb-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    resize: vertical;
    color: var(--green-dark, #1a2e1a);
}
.sc-fb-input:focus, .sc-fb-textarea:focus { border-color: var(--green-mid, #2d5a27); }

.sc-fb-err {
    font-size: 0.8rem;
    color: #c0392b;
    min-height: 18px;
    margin-top: 6px;
}

.sc-fb-footer {
    padding: 12px 18px;
    border-top: 1px solid #e8e4da;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
}
.sc-fb-cancel {
    background: none;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    color: #5a6a5a;
}
.sc-fb-cancel:hover { border-color: #aaa; }
.sc-fb-next {
    background: var(--green-mid, #2d5a27);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 0.88rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}
.sc-fb-next:hover    { background: var(--green-bright, #4a8c3f); }
.sc-fb-next:disabled { opacity: 0.5; cursor: default; }
.sc-fb-submit-btn { background: #1e3a8a; }
.sc-fb-submit-btn:hover:not(:disabled) { background: #2563eb; }

.sc-fb-hint {
    font-size: 0.82rem;
    color: #6a7a6a;
    margin-bottom: 10px;
    font-style: italic;
}

.sc-fb-canvas-wrap {
    position: relative;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    cursor: crosshair;
    max-height: 400px;
}
.sc-fb-screenshot {
    display: block;
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}
.sc-fb-canvas {
    position: absolute;
    inset: 0;
    cursor: crosshair;
    touch-action: none;
}

.sc-fb-no-shot {
    padding: 32px;
    text-align: center;
    font-size: 0.85rem;
    color: #9a9a8e;
    background: #f8f8f6;
    border-radius: 8px;
}

.sc-fb-canvas-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.sc-fb-undo-btn {
    background: none;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    color: #5a6a5a;
}
.sc-fb-undo-btn:hover { border-color: #aaa; }
.sc-fb-canvas-tip {
    font-size: 0.78rem;
    color: #9a9a8e;
    font-style: italic;
}

@media (max-width: 520px) {
    .sc-fb-dialog-wide { max-width: 100%; }
    .sc-fb-canvas-wrap { max-height: 240px; }
    .sc-fb-screenshot  { max-height: 240px; }
}

/* ── Inline mode (embedded in page, no floating bubble) ──────────────────── */
.sc-inline {
    background: white;
    border: 1.5px solid #dde8dd;
    border-radius: 12px;
    overflow: hidden;
    font-family: 'DM Sans', sans-serif;
    max-width: 560px;
    margin: 0 auto;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.sc-inline .sc-messages {
    flex: none;
    max-height: 300px;
    min-height: 0;
    padding: 16px 16px 10px;
}
.sc-inline .sc-input-row {
    padding: 10px 14px 14px;
}
