:root {
    --yb-green: #1f3d2e;
    --yb-green-soft: #2d5a44;
    --yb-gold: #c8a24a;
    --yb-gold-soft: #d8b769;
    --yb-cream: #f8f5ee;
    --yb-text: #2b2b2b;
    --yb-muted: #6b6b6b;
    --yb-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.yb-launcher {
    position: fixed;
    bottom: 24px;
    z-index: 999998;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--yb-green);
    color: var(--yb-cream);
    border: none;
    cursor: pointer;
    box-shadow: var(--yb-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, background 0.18s ease;
}
.yb-launcher:hover { transform: scale(1.06); background: var(--yb-green-soft); }
.yb-launcher.yb-left { left: 24px; }
.yb-launcher.yb-right { right: 24px; }
.yb-launcher svg { width: 28px; height: 28px; }
.yb-launcher .yb-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--yb-gold);
    border: 2px solid var(--yb-green);
}

.yb-panel {
    position: fixed;
    bottom: 100px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 140px);
    z-index: 999999;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--yb-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--yb-text);
    animation: yb-pop 0.18s ease-out;
}
.yb-panel.yb-left { left: 24px; }
.yb-panel.yb-right { right: 24px; }
.yb-panel.yb-open { display: flex; }

@keyframes yb-pop {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.yb-header {
    background: var(--yb-green);
    color: var(--yb-cream);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 3px solid var(--yb-gold);
}
.yb-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--yb-gold);
    color: var(--yb-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}
.yb-header-title { flex: 1; }
.yb-header-title strong { display: block; font-size: 14px; }
.yb-header-title small { font-size: 11px; opacity: 0.85; }
.yb-close {
    background: transparent;
    border: none;
    color: var(--yb-cream);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    padding: 4px 8px;
}

.yb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: var(--yb-cream);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.yb-msg {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 14px;
    line-height: 1.45;
    font-size: 14px;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.yb-msg.yb-bot {
    background: #fff;
    color: var(--yb-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.yb-msg strong { color: var(--yb-green); font-weight: 600; }
.yb-msg.yb-user strong { color: inherit; font-weight: 700; }
.yb-msg code {
    background: rgba(0,0,0,0.06);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}
.yb-msg .yb-h1,
.yb-msg .yb-h2,
.yb-msg .yb-h3 {
    display: block;
    margin: 6px 0 2px;
    font-size: 14px;
}
.yb-msg a { color: var(--yb-gold); text-decoration: underline; }
.yb-msg.yb-user a { color: var(--yb-gold-soft); }

.yb-lead-form { max-width: 100% !important; padding: 14px !important; }
.yb-lf-title { font-weight: 700; color: var(--yb-green); margin-bottom: 4px; font-size: 14px; }
.yb-lf-sub { font-size: 12px; color: var(--yb-muted); margin-bottom: 10px; }
.yb-lf { display: flex; flex-direction: column; gap: 6px; }
.yb-lf input {
    padding: 8px 10px;
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
}
.yb-lf input:focus { outline: none; border-color: var(--yb-green); }
.yb-lf input:disabled { background: #f1f1f1; }
.yb-lf button {
    background: var(--yb-green);
    color: #fff;
    border: none;
    padding: 9px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    margin-top: 4px;
}
.yb-lf button:hover { background: var(--yb-green-soft); }
.yb-lf button:disabled { opacity: 0.6; cursor: not-allowed; }
.yb-lf-msg { font-size: 12px; margin-top: 6px; min-height: 16px; text-align: center; }
.yb-msg.yb-user {
    background: var(--yb-green);
    color: var(--yb-cream);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.yb-typing {
    display: inline-flex;
    gap: 4px;
    padding: 12px 14px;
}
.yb-typing span {
    width: 7px;
    height: 7px;
    background: var(--yb-green-soft);
    border-radius: 50%;
    animation: yb-bounce 1s infinite ease-in-out;
}
.yb-typing span:nth-child(2) { animation-delay: 0.15s; }
.yb-typing span:nth-child(3) { animation-delay: 0.30s; }
@keyframes yb-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-5px); opacity: 1; }
}

.yb-quick {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 0 14px 6px;
    background: var(--yb-cream);
}
.yb-quick button {
    background: #fff;
    border: 1px solid var(--yb-gold-soft);
    color: var(--yb-green);
    padding: 6px 10px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.yb-quick button:hover { background: var(--yb-gold-soft); color: #fff; }

.yb-input {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #eadfca;
    background: #fff;
}
.yb-input textarea {
    flex: 1;
    border: 1px solid #d9d9d9;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    max-height: 90px;
    min-height: 38px;
    outline: none;
}
.yb-input textarea:focus { border-color: var(--yb-green); }
.yb-send {
    background: var(--yb-green);
    color: var(--yb-cream);
    border: none;
    border-radius: 12px;
    padding: 0 14px;
    cursor: pointer;
    font-size: 14px;
}
.yb-send:hover { background: var(--yb-green-soft); }
.yb-send:disabled { opacity: 0.5; cursor: not-allowed; }

.yb-footer-note {
    text-align: center;
    font-size: 10px;
    color: var(--yb-muted);
    padding: 4px 0 8px;
    background: #fff;
}

@media (max-width: 480px) {
    .yb-panel {
        width: calc(100vw - 16px);
        height: calc(100vh - 100px);
        bottom: 90px;
    }
    .yb-panel.yb-left { left: 8px; }
    .yb-panel.yb-right { right: 8px; }
    .yb-launcher.yb-left { left: 16px; }
    .yb-launcher.yb-right { right: 16px; }
}
