/* LuxStash floating support chat */
.lux-chat-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    width: 58px;
    height: 58px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #111;
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
}

.lux-chat-launcher:hover { transform: translateY(-2px); }
.lux-chat-launcher svg { width: 25px; height: 25px; stroke: currentColor; stroke-width: 1.8; }

.lux-chat-panel {
    position: fixed;
    right: 24px;
    bottom: 94px;
    z-index: 9998;
    width: min(390px, calc(100vw - 32px));
    height: min(590px, calc(100dvh - 130px));
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .20);
    display: none;
    grid-template-rows: auto 1fr auto auto;
    overflow: hidden;
    font-family: inherit;
    color: #111;
}

.lux-chat-panel.open { display: grid; }

.lux-chat-head {
    padding: 18px 20px;
    background: #111;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.lux-chat-head strong { display: block; font-size: 14px; font-weight: 700; letter-spacing: .015em; line-height: 1.15; }
.lux-chat-head span { display: block; margin-top: 4px; font-size: 12px; color: #cfcfcf; }
.lux-chat-close { border: 0; background: transparent; color: #fff; font-size: 27px; line-height: 1; cursor: pointer; padding: 3px; }

.lux-chat-messages {
    padding: 18px;
    overflow-y: auto;
    background: #f7f7f5;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.lux-chat-message { max-width: 84%; padding: 11px 13px; font-size: 14px; line-height: 1.45; white-space: pre-line; }
.lux-chat-message.bot { align-self: flex-start; background: #fff; border: 1px solid #e7e7e7; border-radius: 3px 14px 14px 14px; }
.lux-chat-message.user { align-self: flex-end; background: #111; color: #fff; border-radius: 14px 3px 14px 14px; }
.lux-chat-suggestions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 2px; }
.lux-chat-suggestion { border: 1px solid #d8d8d8; border-radius: 999px; background: #fff; padding: 7px 10px; font: inherit; font-size: 12px; cursor: pointer; color: #111; }
.lux-chat-suggestion:hover { border-color: #111; }

.lux-chat-status { font-size: 12px; color: #777; padding: 8px 18px; background: #f7f7f5; display: none; }
.lux-chat-status.show { display: block; }

.lux-chat-form { border-top: 1px solid #e6e6e6; background: #fff; padding: 12px; display: flex; gap: 8px; }
.lux-chat-input { min-width: 0; flex: 1; border: 1px solid #d8d8d8; border-radius: 0; padding: 11px 12px; font: inherit; font-size: 14px; outline: none; background: #fff; color: #111; }
.lux-chat-input:focus { border-color: #111; }
.lux-chat-send { border: 0; background: #111; color: #fff; min-width: 46px; padding: 0 13px; cursor: pointer; font-size: 18px; }

@media (max-width: 600px) {
    .lux-chat-launcher { right: 16px; bottom: 16px; width: 54px; height: 54px; }
    .lux-chat-panel {
        right: 12px;
        bottom: 82px;
        width: calc(100vw - 24px);
        height: min(620px, calc(100dvh - 106px));
        border-radius: 16px;
    }
    body.lux-chat-open { overflow: hidden; }
}

@media (max-width: 380px) {
    .lux-chat-panel { right: 8px; width: calc(100vw - 16px); }
}

/* Step 3: inline contact + feedback cards */
.lux-chat-action { background:#111; color:#fff; border-color:#111; }
.lux-chat-inline-card { align-self:stretch; background:#fff; border:1px solid #dedede; border-radius:14px; padding:14px; display:grid; gap:9px; }
.lux-chat-inline-card strong { font-size:14px; }
.lux-chat-inline-card input,.lux-chat-inline-card textarea,.lux-chat-inline-card select { width:100%; box-sizing:border-box; border:1px solid #d8d8d8; background:#fff; color:#111; padding:9px 10px; font:inherit; font-size:13px; }
.lux-chat-inline-card textarea { min-height:76px; resize:vertical; }
.lux-chat-inline-card small { font-size:11px; color:#666; }
.lux-chat-inline-card button { border:0; background:#111; color:#fff; padding:10px 12px; font:inherit; font-size:12px; font-weight:700; cursor:pointer; }
.lux-chat-inline-card label { font-size:12px; display:grid; gap:5px; }
.lux-chat-inline-card .lux-chat-check { display:flex; grid-template-columns:none; flex-direction:row; align-items:flex-start; gap:7px; line-height:1.35; }
.lux-chat-inline-card .lux-chat-check input { width:auto; margin-top:2px; }

/* Step 5: final chat UX polish */
.lux-chat-launcher {
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.lux-chat-launcher:active { transform: scale(.94); }
.lux-chat-launcher.active { transform: rotate(-6deg); }

.lux-chat-panel {
    display: grid;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px) scale(.985);
    transform-origin: bottom right;
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.lux-chat-panel.open {
    display: grid;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
}
.lux-chat-close,
.lux-chat-send,
.lux-chat-suggestion,
.lux-chat-inline-card button {
    transition: transform .14s ease, opacity .14s ease, background-color .14s ease, border-color .14s ease;
}
.lux-chat-close:hover { transform: scale(1.08); }
.lux-chat-suggestion:active,
.lux-chat-send:active,
.lux-chat-inline-card button:active { transform: scale(.97); }
.lux-chat-send:disabled,
.lux-chat-inline-card button:disabled { opacity: .5; cursor: default; }
.lux-chat-inline-card input:disabled,
.lux-chat-inline-card textarea:disabled,
.lux-chat-inline-card select:disabled { opacity: .65; cursor: default; }

.lux-chat-input {
    resize: none;
    max-height: 96px;
    overflow-y: auto;
    line-height: 1.4;
}
.lux-chat-new { animation: lux-chat-message-in .2s ease both; }
@keyframes lux-chat-message-in {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}
.lux-chat-card-error {
    border: 1px solid #d7b4b4;
    background: #fff7f7;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.4;
    color: #7d2525;
}

@media (prefers-reduced-motion: reduce) {
    .lux-chat-launcher,
    .lux-chat-panel,
    .lux-chat-close,
    .lux-chat-send,
    .lux-chat-suggestion,
    .lux-chat-inline-card button { transition: none; }
    .lux-chat-new { animation: none; }
}

/* Safe internal resource link shown under selected assistant answers. */
.lux-chat-resource-link {
    display: inline-block;
    margin-top: 9px;
    color: inherit;
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Persistent chat: header actions */
.lux-chat-head-actions { display:flex; align-items:center; gap:6px; }
.lux-chat-new-chat { border:0; background:transparent; color:#fff; font-size:20px; line-height:1; cursor:pointer; padding:4px 6px; opacity:.82; }
.lux-chat-new-chat:hover { opacity:1; transform:rotate(-18deg); }
.lux-chat-new-chat:disabled { opacity:.4; cursor:default; transform:none; }
.lux-chat-new-chat,
.lux-chat-close { transition:transform .14s ease, opacity .14s ease; }
