/* ==========================================================================
   Concierge — the "Ava" popup chat assistant. Colours come from the shared
   :root custom properties in base.css, so light/dark just work.
   ========================================================================== */

.cc-launcher {
    position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 45;
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .7rem 1.1rem; border: 1px solid var(--border);
    background: #6366f1; color: #fff; border-radius: 999px;
    font: 600 .9rem ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    cursor: pointer; box-shadow: 0 14px 34px -14px var(--ring);
    transition: transform .15s ease, box-shadow .15s ease;
}
.cc-launcher:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -14px var(--ring); }
.cc-launcher svg { width: 1.1rem; height: 1.1rem; }
.cc-launcher[hidden] { display: none; }

.cc-panel {
    position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 46;
    width: min(24rem, calc(100vw - 2rem));
    height: min(70vh, 34rem);
    display: none; flex-direction: column;
    background: var(--card); color: var(--ink);
    border: 1px solid var(--border); border-radius: 1rem;
    box-shadow: 0 28px 64px -22px rgba(15, 23, 42, .45);
    overflow: hidden;
}
.cc-panel.is-open { display: flex; }

.cc-head {
    display: flex; align-items: center; gap: .6rem;
    padding: .85rem 1rem; border-bottom: 1px solid var(--border);
}
.cc-head .cc-avatar {
    width: 2rem; height: 2rem; border-radius: 50%; flex: 0 0 auto;
    background: #6366f1; color: #fff; display: grid; place-items: center;
    font-weight: 700; font-size: .9rem;
}
.cc-head .cc-who { display: flex; flex-direction: column; line-height: 1.2; }
.cc-head .cc-who strong { font-size: .9rem; }
.cc-head .cc-who span { font-size: .72rem; color: var(--muted); }
.cc-head .cc-close {
    margin-left: auto; flex: 0 0 auto;
    width: 2rem; height: 2rem; display: grid; place-items: center;
    background: var(--bg); border: 1px solid var(--border); border-radius: .5rem;
    color: var(--ink); font-size: 1.4rem; font-weight: 700; line-height: 1;
    cursor: pointer; padding: 0;
}
.cc-head .cc-close:hover { background: #6366f1; border-color: #6366f1; color: #fff; }

.cc-log {
    flex: 1; overflow-y: auto; padding: 1rem;
    display: flex; flex-direction: column; gap: .6rem;
    background: var(--bg);
}
.cc-msg {
    max-width: 85%; padding: .6rem .8rem; border-radius: .9rem;
    font-size: .88rem; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word;
}
.cc-msg.cc-from-bot {
    align-self: flex-start; background: var(--card);
    border: 1px solid var(--border); border-bottom-left-radius: .25rem;
}
.cc-msg.cc-from-user {
    align-self: flex-end; background: #6366f1; color: #fff;
    border-bottom-right-radius: .25rem;
}
.cc-typing {
    align-self: flex-start; display: inline-flex; gap: .28rem;
    padding: .7rem .85rem; background: var(--card);
    border: 1px solid var(--border); border-radius: .9rem; border-bottom-left-radius: .25rem;
}
.cc-typing span {
    width: .4rem; height: .4rem; border-radius: 50%; background: var(--muted);
    animation: cc-bounce 1.2s infinite ease-in-out;
}
.cc-typing span:nth-child(2) { animation-delay: .15s; }
.cc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cc-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-.25rem); opacity: 1; } }

.cc-form {
    display: flex; gap: .5rem; padding: .75rem;
    border-top: 1px solid var(--border); background: var(--card);
}
.cc-form textarea {
    flex: 1; resize: none; border: 1px solid var(--border); border-radius: .6rem;
    background: var(--bg); color: var(--ink); padding: .55rem .7rem;
    font: inherit; font-size: .88rem; max-height: 5rem; line-height: 1.4;
}
.cc-form button {
    flex: 0 0 auto; border: 0; border-radius: .6rem; background: #6366f1; color: #fff;
    font-weight: 700; padding: 0 .95rem; cursor: pointer; font-size: .88rem;
}
.cc-form button:disabled { opacity: .5; cursor: default; }

@media (max-width: 720px) {
    .cc-launcher { bottom: 4.75rem; }
    .cc-panel {
        right: .75rem; left: .75rem; bottom: .75rem;
        width: auto; height: min(75vh, 32rem);
    }
}
