.ss-assistant {
    --ss-red: #d51b2b;
    --ss-red-dark: #b71320;
    --ss-text: #172033;
    --ss-muted: #6c7480;
    --ss-border: #e6e9ee;
    --ss-bg: #ffffff;
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.ss-assistant * { box-sizing: border-box; }

.ss-assistant-toggle {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: var(--ss-red);
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(24, 30, 42, .22);
}

.ss-assistant-toggle:hover { background: var(--ss-red-dark); }

.ss-assistant-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: 370px;
    max-width: calc(100vw - 28px);
    height: min(600px, calc(100vh - 110px));
    background: var(--ss-bg);
    border: 1px solid var(--ss-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(20, 28, 44, .25);
}

.ss-assistant-panel[hidden] { display: none !important; }

.ss-assistant-header {
    min-height: 66px;
    padding: 13px 14px 13px 18px;
    background: linear-gradient(135deg, #bd1423, #e12636);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ss-assistant-header strong { display: block; font-size: 16px; }
.ss-assistant-header small { display: block; margin-top: 2px; opacity: .82; font-size: 12px; }
.ss-assistant-header button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: rgba(255,255,255,.14);
    color: #fff;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.ss-assistant-messages {
    height: calc(100% - 178px);
    padding: 16px;
    overflow-y: auto;
    background: #f7f8fa;
}

.ss-assistant-message { display: flex; flex-direction: column; margin: 0 0 12px; }
.ss-assistant-message.is-user { align-items: flex-end; }
.ss-assistant-message.is-bot { align-items: flex-start; }

.ss-assistant-bubble {
    max-width: 88%;
    padding: 11px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.ss-assistant-message.is-user .ss-assistant-bubble {
    background: var(--ss-red);
    color: #fff;
    border-bottom-right-radius: 5px;
}

.ss-assistant-message.is-bot .ss-assistant-bubble {
    background: #fff;
    color: var(--ss-text);
    border: 1px solid var(--ss-border);
    border-bottom-left-radius: 5px;
}

.ss-assistant-action {
    display: inline-flex;
    margin-top: 7px;
    padding: 8px 11px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #f0b4ba;
    color: var(--ss-red);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.ss-assistant-results { width: 88%; margin-top: 7px; display: grid; gap: 6px; }
.ss-assistant-results a {
    display: block;
    padding: 9px 10px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--ss-border);
    color: #22304a;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.ss-assistant-results a:hover { border-color: #e0a0a6; color: var(--ss-red); }

.ss-assistant-quick {
    min-height: 48px;
    padding: 7px 10px;
    border-top: 1px solid var(--ss-border);
    background: #fff;
    display: flex;
    gap: 6px;
    overflow-x: auto;
}

.ss-assistant-quick button {
    flex: 0 0 auto;
    border: 1px solid var(--ss-border);
    background: #fff;
    color: #333b4a;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    cursor: pointer;
}
.ss-assistant-quick button:hover { border-color: #e1a1a8; color: var(--ss-red); }

.ss-assistant-form {
    height: 64px;
    padding: 9px;
    background: #fff;
    border-top: 1px solid var(--ss-border);
    display: flex;
    gap: 7px;
}

.ss-assistant-form input {
    min-width: 0;
    flex: 1;
    height: 44px;
    border: 1px solid #dfe3e9;
    border-radius: 11px;
    padding: 0 12px;
    color: var(--ss-text);
    outline: none;
}
.ss-assistant-form input:focus { border-color: #d95d69; box-shadow: 0 0 0 3px rgba(213, 27, 43, .08); }

.ss-assistant-form button {
    height: 44px;
    border: 0;
    border-radius: 11px;
    padding: 0 14px;
    background: var(--ss-red);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.ss-assistant-form.is-busy button { opacity: .55; pointer-events: none; }

@media (max-width: 520px) {
    .ss-assistant { right: 12px; bottom: 12px; }
    .ss-assistant-panel {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 82px;
        width: auto;
        height: min(620px, calc(100vh - 100px));
    }
    .ss-assistant-toggle { width: 54px; height: 54px; }
}
