/* ── MyPlatz Chat Button ──────────────────────────────────────────────────── */
.myplatz-chat {
    --chat-accent:  var(--color-primary, #10B1B6);
    --chat-radius:  14px;
    --chat-shadow:  0 8px 28px -4px rgba(0,0,0,.18);
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 8888;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .75rem;
}

/* Toggle button */
.myplatz-chat__btn {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .6rem 1.1rem .6rem .9rem;
    border-radius: 50px;
    border: none;
    background: var(--chat-accent);
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--chat-shadow);
    transition: filter .15s, transform .15s;
    white-space: nowrap;
}
.myplatz-chat__btn:hover { filter: brightness(1.08); transform: translateY(-1px); }

.myplatz-chat__btn-icon {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Panel */
.myplatz-chat__panel {
    width: min(94vw, 360px);
    background: #fff;
    border-radius: var(--chat-radius);
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatPanelIn .18s ease;
}

@keyframes chatPanelIn {
    from { opacity: 0; transform: translateY(8px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

.myplatz-chat__panel[hidden] { display: none; }

.myplatz-chat__panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1rem;
    background: var(--chat-accent);
    color: #fff;
}
.myplatz-chat__panel-title { font-weight: 600; font-size: .9rem; }

.myplatz-chat__close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 .1rem;
    opacity: .8;
}
.myplatz-chat__close:hover { opacity: 1; }

.myplatz-chat__search-wrap {
    padding: .75rem .9rem;
    border-bottom: 1px solid rgba(0,0,0,.07);
    position: relative;
}
.myplatz-chat__search-input {
    width: 100%;
    padding: .5rem 2.1rem .5rem .7rem;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 6px;
    font-size: .85rem;
    outline: none;
    box-sizing: border-box;
}
.myplatz-chat__search-input:focus { border-color: var(--chat-accent); }

.myplatz-chat__spinner {
    position: absolute;
    top: 50%;
    right: 1.6rem;
    width: 1rem;
    height: 1rem;
    margin-top: -.85rem;
    border: 2px solid rgba(0,0,0,.12);
    border-top-color: var(--chat-accent);
    border-radius: 50%;
    animation: myplatzChatSpin .6s linear infinite;
}
.myplatz-chat__spinner[hidden] { display: none; }

@keyframes myplatzChatSpin { to { transform: rotate(360deg); } }

.myplatz-chat__results {
    overflow-y: auto;
    max-height: 340px;
    padding: .4rem 0;
}

/* Result items — styled as chat message bubbles */
.myplatz-chat__result {
    padding: .7rem .9rem;
    margin: .5rem .6rem;
    background: var(--chat-bubble, #f4f6f7);
    border-radius: 10px;
}
.myplatz-chat__result:last-child { margin-bottom: .6rem; }

.myplatz-chat__result-q {
    font-size: .83rem;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
}
.myplatz-chat__result-q::after { content: '›'; color: var(--chat-accent); font-size: 1.1rem; }

.myplatz-chat__result-a {
    font-size: .8rem;
    color: #555;
    line-height: 1.55;
    margin-top: .4rem;
    display: none;
}
.myplatz-chat__result-a.is-open { display: block; }
.myplatz-chat__result-a-body :first-child { margin-top: 0; }
.myplatz-chat__result-a-body :last-child { margin-bottom: 0; }
.myplatz-chat__result-a-body p { margin: 0 0 .5em; }
.myplatz-chat__result-a-body h1,
.myplatz-chat__result-a-body h2,
.myplatz-chat__result-a-body h3,
.myplatz-chat__result-a-body h4 {
    font-size: .88rem;
    font-weight: 700;
    margin: .6em 0 .25em;
    color: #1a1a1a;
}
.myplatz-chat__result-a-body strong, .myplatz-chat__result-a-body b { font-weight: 700; }
.myplatz-chat__result-a-body ul, .myplatz-chat__result-a-body ol { margin: .3em 0 .5em 1.1em; padding: 0; }
.myplatz-chat__result-a-body a { color: var(--chat-accent); text-decoration: underline; }
.myplatz-chat__result-a-actions a {
    display: inline-block;
    margin-top: .35rem;
    padding: .25rem .65rem;
    border-radius: 4px;
    background: var(--chat-accent);
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
}

/* Hint / empty states */
.myplatz-chat__hint {
    padding: 1.5rem 1.2rem;
    text-align: center;
    font-size: .8rem;
    color: #888;
}

.myplatz-chat__empty {
    padding: 1.25rem 1.1rem;
    text-align: center;
    font-size: .8rem;
    color: #666;
}
.myplatz-chat__empty p { margin: 0 0 .6rem; }
.myplatz-chat__contact-btn {
    display: inline-block;
    padding: .5rem 1.1rem;
    border-radius: 50px;
    background: var(--chat-accent);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
}
.myplatz-chat__contact-btn:hover { filter: brightness(1.08); }

@media (max-width: 440px) {
    .myplatz-chat { bottom: 1rem; right: 1rem; }
    .myplatz-chat__btn-label { display: none; }
    .myplatz-chat__btn { padding: .7rem; }
}
