/* Ask Exhale: the floating help button and its panel on the landing page. */

.help-launch {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--cyan-deep);
    color: #FFFFFF;
    font: 500 14px/1 var(--font-sans);
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.help-launch:hover { background: var(--cyan-medium); }
.help-launch:focus-visible,
.help-close:focus-visible,
.help-send:focus-visible,
.help-input:focus-visible {
    outline: 2px solid var(--cyan-light);
    outline-offset: 2px;
}

.help-panel {
    position: fixed;
    right: 16px;
    bottom: 72px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    width: min(380px, calc(100vw - 32px));
    height: min(540px, calc(100vh - 120px));
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    font: 400 15px/1.5 var(--font-sans);
    overflow: hidden;
}

.help-panel[hidden] { display: none; }

.help-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--glass-border);
}

.help-title {
    font: 600 15px/1 var(--font-sans);
    letter-spacing: 0.02em;
}

.help-close {
    padding: 6px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font: 500 13px/1 var(--font-sans);
    cursor: pointer;
}

.help-close:hover { color: var(--text-primary); }

.help-log {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    overflow-y: auto;
}

.help-msg {
    max-width: 86%;
    padding: 10px 13px;
    border-radius: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.help-msg--assistant {
    align-self: flex-start;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.help-msg--user {
    align-self: flex-end;
    background: var(--cyan-deep);
    color: #FFFFFF;
}

.help-msg--pending { color: var(--text-muted); }

.help-msg--error {
    color: var(--text-secondary);
    font-style: italic;
}

.help-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--glass-border);
}

/* The site styles every bare <input> and <button type="submit"> (full width on
   phones, centred text, wide padding, a glass gradient). These selectors are
   scoped under .help-panel so they win that cascade, and reset what it adds. */
body .help-panel .help-input {
    flex: 1;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: var(--glass-bg);
    color: var(--text-primary);
    font: 400 16px/1.2 var(--font-sans);
    letter-spacing: normal;
    text-align: left;
}

body .help-panel .help-input::placeholder { color: var(--text-muted); }

body .help-panel button.help-send {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: var(--cyan-deep);
    color: #FFFFFF;
    font: 500 14px/1 var(--font-sans);
    letter-spacing: normal;
    box-shadow: none;
    backdrop-filter: none;
    transform: none;
    cursor: pointer;
}

body .help-panel button.help-send:hover {
    background: var(--cyan-medium);
    color: #FFFFFF;
    transform: none;
    box-shadow: none;
}

body .help-panel .help-send:disabled,
body .help-panel .help-input:disabled { opacity: 0.6; cursor: default; }

.help-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 480px) {
    .help-panel {
        right: 16px;
        left: 16px;
        width: auto;
        bottom: 64px;
        height: min(540px, calc(100vh - 100px));
    }
    .help-launch { right: 16px; bottom: 16px; }
}
