/**
 * Customer chat workspace, responsive history and website review controls.
 *
 * @copyright  (C) Heavenly Technologies
 * @license    GPL-2.0-or-later
 */

.heavenlycrm-assist {
    --assist-fg: var(--bs-body-color, inherit);
    --assist-bg: var(--bs-body-bg, transparent);
    --assist-muted: var(--bs-secondary-color, inherit);
    --assist-border: var(--bs-border-color, currentColor);
    --assist-input-bg: var(--bs-form-control-bg, var(--bs-body-bg, transparent));
    --assist-bubble: var(--bs-secondary-bg, var(--bs-tertiary-bg, color-mix(in srgb, currentColor 8%, transparent)));
    --assist-focus: var(--bs-primary, var(--focus-ring-color, currentColor));
    color: var(--assist-fg);
    background: transparent;
    display: flex;
    flex-direction: column;
    min-height: min(72vh, 44rem);
    width: 100%;
    max-width: 48rem;
    margin-inline: auto;
    padding-block: 1.5rem;
}

.heavenlycrm-assist.heavenlycrm-assist--module {
    min-height: min(28rem, 60vh);
    padding-block: 0.75rem;
}

/* Full page with the chat-history sidebar. */
.heavenlycrm-assist--with-history {
    display: grid;
    grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr);
    gap: 1.5rem;
    max-width: 64rem;
}

.heavenlycrm-assist__main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.heavenlycrm-assist__website {
    margin-block: 1rem;
    padding: 1rem;
    border: 1px solid var(--assist-border);
    border-radius: 0.75rem;
    background: var(--assist-bubble);
    overflow-wrap: anywhere;
}

.heavenlycrm-assist__website[hidden] { display: none; }
.heavenlycrm-assist__handoff {
    margin-block-end: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--assist-border);
    border-radius: 0.75rem;
    background: var(--assist-bubble);
    overflow-wrap: anywhere;
}
.heavenlycrm-assist__handoff[hidden] { display: none; }
.heavenlycrm-assist__live-entry { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .85rem; margin: .65rem 0; color: var(--hcrm-text, #172033); }
.heavenlycrm-assist__live-entry[hidden] { display: none; }
.heavenlycrm-assist__live-entry > button { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid #5368a1; background: #fff; color: #254078; border-radius: .65rem; padding: .6rem .85rem; font: inherit; font-size: .875rem; }
.heavenlycrm-assist__live-entry > button:hover { background: #edf2ff; color: #182b54; }
.heavenlycrm-assist__live-entry > button:focus-visible { outline: 3px solid #5368a1; outline-offset: 3px; }
.heavenlycrm-assist__live-entry > button:disabled { opacity: .65; cursor: wait; }
.heavenlycrm-assist__handoff p { margin-block: 0.5rem; font-size: 0.9rem; }
.heavenlycrm-assist__website h3 { font-size: 1.05rem; margin-block: 0 0.5rem; }
.heavenlycrm-assist__website p { margin-block: 0 0.75rem; }
.heavenlycrm-assist__website ol {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 0.5rem 1.5rem;
    padding-inline-start: 1.5rem;
    margin-block: 0;
    font-size: 0.9rem;
}
.heavenlycrm-assist__website [aria-current="step"] { font-weight: 700; }
.heavenlycrm-assist__website .is-complete { text-decoration: line-through; }

.heavenlycrm-assist__reference {
    margin-block-start: 1rem;
    padding-block-start: 0.75rem;
    border-block-start: 1px solid var(--assist-border);
}
.heavenlycrm-assist__reference h4 { font-size: 1rem; margin-block: 0 0.5rem; }
.heavenlycrm-assist__reference p { font-size: 0.9rem; }
.heavenlycrm-assist__palette { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.heavenlycrm-assist__swatch { display: inline-block; width: 1.75rem; height: 1.75rem; border: 1px solid var(--assist-border); border-radius: 50%; }
.heavenlycrm-assist__website .heavenlycrm-assist__reference-note { margin-block: 0.75rem 0; font-size: 0.875rem; }

.heavenlycrm-assist__plan { border-block-start: 1px solid var(--assist-border); margin-block-start: 1rem; padding-block-start: 1rem; }
.heavenlycrm-assist__plan h4 { font-size: 1rem; margin-block: 0 0.5rem; }
.heavenlycrm-assist__plan ul { padding-inline-start: 1.25rem; }
.heavenlycrm-assist__plan li { margin-block-end: 0.5rem; }
.heavenlycrm-assist__plan small { display: block; }
.heavenlycrm-assist__website .heavenlycrm-assist__plan-note { margin-block: 0.75rem; font-size: 0.875rem; }
.heavenlycrm-assist__plan-editor { margin-block-start: 1rem; }
.heavenlycrm-assist__plan-editor fieldset { min-width: 0; }
.heavenlycrm-assist__plan-editor legend { font-size: 1rem; }
.heavenlycrm-assist__plan-editor label { display: block; margin-block: 0.75rem; }
.heavenlycrm-assist__plan-editor textarea, .heavenlycrm-assist__plan-editor select { display: block; width: 100%; max-width: 100%; }
.heavenlycrm-assist__plan-editor input[type="color"] { display: block; width: 4rem; height: 2.5rem; }
.heavenlycrm-assist__plan-editor button { margin: 0.25rem 0.5rem 0.25rem 0; }

.heavenlycrm-assist__history {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-inline-end: 1px solid var(--assist-border);
    padding-inline-end: 1rem;
    min-width: 0;
}

.heavenlycrm-assist__history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.heavenlycrm-assist__history-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

.heavenlycrm-assist__history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow-y: auto;
}

.heavenlycrm-assist__history-btn {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: start;
    border-radius: 0.65rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.heavenlycrm-assist__history-btn:hover,
.heavenlycrm-assist__history-btn[aria-current="true"] {
    background: var(--assist-bubble);
}

.heavenlycrm-assist__history-empty {
    font-size: 0.875rem;
    margin: 0;
}

@media (max-width: 47.99rem) {
    .heavenlycrm-assist--with-history {
        grid-template-columns: minmax(0, 1fr);
    }

    .heavenlycrm-assist__history {
        border-inline-end: 0;
        border-block-end: 1px solid var(--assist-border);
        padding-inline-end: 0;
        padding-block-end: 0.75rem;
        max-height: 12rem;
    }
}

.heavenlycrm-assist__notice {
    margin: auto;
    text-align: center;
    max-width: 28rem;
}

.heavenlycrm-assist__stage {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 12rem;
}

.heavenlycrm-assist.is-active .heavenlycrm-assist__stage {
    justify-content: flex-start;
    overflow: auto;
}

.heavenlycrm-assist__heading {
    text-align: center;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 1.5rem;
}

.heavenlycrm-assist__thread {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 1rem;
}

.heavenlycrm-assist__msg {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 1.15rem;
    line-height: 1.45;
}

.heavenlycrm-assist__msg--user {
    align-self: flex-end;
    background: var(--assist-bubble);
}

.heavenlycrm-assist__msg--engine,
.heavenlycrm-assist__msg--agent {
    align-self: flex-start;
}

/* Handoff / system lines from the engine. */
.heavenlycrm-assist__msg--system {
    align-self: center;
    max-width: 100%;
    text-align: center;
    font-size: 0.875rem;
    color: var(--assist-muted);
    padding-block: 0.35rem;
}

.heavenlycrm-assist__quotes {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.heavenlycrm-assist__escalating {
    font-size: 0.875rem;
    margin: 0.4rem 0 0;
}

.heavenlycrm-assist__msg-role {
    display: block;
    font-size: 0.75rem;
    color: var(--assist-muted);
    margin-bottom: 0.25rem;
}

.heavenlycrm-assist__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.heavenlycrm-assist__action {
    border: 1px solid var(--assist-border);
    background: var(--assist-input-bg);
    color: inherit;
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.3;
}

.heavenlycrm-assist__action:hover:not(:disabled) {
    opacity: 0.9;
}

.heavenlycrm-assist__action:disabled {
    opacity: 0.55;
}

.heavenlycrm-assist__dock {
    position: sticky;
    bottom: 0;
    padding-top: 0.75rem;
    background: var(--assist-bg);
}

.heavenlycrm-assist__pill {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
    border: 1px solid var(--assist-border);
    background: var(--assist-input-bg);
    border-radius: 1.75rem;
    padding: 0.4rem 0.5rem 0.4rem 0.4rem;
}

.heavenlycrm-assist__pill:focus-within {
    outline: 2px solid var(--assist-focus);
    outline-offset: 2px;
}

.heavenlycrm-assist__plus,
.heavenlycrm-assist__send {
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.heavenlycrm-assist__plus:hover,
.heavenlycrm-assist__send:hover,
.heavenlycrm-assist__tray-btn:hover {
    opacity: 0.9;
}

.heavenlycrm-assist__input {
    flex: 1 1 auto;
    border: 0;
    background: transparent;
    color: inherit;
    resize: none;
    min-height: 1.5rem;
    max-height: 8rem;
    padding: 0.45rem 0.25rem;
    line-height: 1.4;
    field-sizing: content;
}

.heavenlycrm-assist__input:focus {
    outline: none;
    box-shadow: none;
}

.heavenlycrm-assist__input::placeholder {
    color: var(--assist-muted);
}

.heavenlycrm-assist__tray {
    margin-top: 0.65rem;
}

.heavenlycrm-assist__tray-btn {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.65rem;
    width: 100%;
    border: 1px solid var(--assist-border);
    background: var(--assist-input-bg);
    color: inherit;
    border-radius: 1.25rem;
    padding: 0.55rem 0.9rem;
    text-align: start;
}

.heavenlycrm-assist__tray-hint {
    color: var(--assist-muted);
    font-size: 0.875rem;
}

.heavenlycrm-assist__files {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.heavenlycrm-assist__file-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--assist-border);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.85rem;
}

.heavenlycrm-assist__file-chip button {
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0 0.15rem;
    line-height: 1;
}

.heavenlycrm-assist__activity { margin: .5rem 1rem; color: var(--assist-muted); }
.heavenlycrm-assist__spinner { display: inline-block; width: 1rem; height: 1rem; margin-inline-end: .5rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: assist-spin .8s linear infinite; }
@keyframes assist-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .heavenlycrm-assist__spinner { animation: none; } }

.heavenlycrm-assist__draft { margin-block: 1rem; min-width: 0; }
.heavenlycrm-assist__content { margin-block: 1rem; border-block-start: 1px solid #cbd5e1; padding-block-start: 1rem; }
.heavenlycrm-assist__content-editor input[type="text"] { display: block; box-sizing: border-box; width: 100%; max-width: 100%; }
.heavenlycrm-assist__content-editor details { padding: .75rem; margin-block: .75rem; border: 1px solid #cbd5e1; }
.heavenlycrm-assist__content-editor summary { cursor: pointer; font-weight: 600; }
.heavenlycrm-assist__draft-controls { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.heavenlycrm-assist__draft-controls label { display: grid; gap: .25rem; }
.heavenlycrm-assist__draft-controls select,
.heavenlycrm-assist__draft-controls button { font: inherit; padding: .5rem; }
.heavenlycrm-assist__draft-viewport { overflow: hidden; max-width: 100%; border: 1px solid #cbd5e1; }
.heavenlycrm-assist__draft-viewport iframe { display: block; height: 650px; max-width: none; border: 0; background: white; transform-origin: top left; }

.heavenlycrm-assist__allowance { margin-block: 1rem; padding: .75rem; border: 1px solid var(--assist-border); border-radius: .5rem; }
.heavenlycrm-assist__allowance summary { cursor: pointer; font-weight: 600; }
.heavenlycrm-assist__allowance dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem 1rem; margin-bottom: 0; }
.heavenlycrm-assist__allowance dt { font-weight: 400; }
.heavenlycrm-assist__allowance dd { margin: 0; text-align: end; }

.heavenlycrm-assist__plan-editor label.heavenlycrm-assist__form-check {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.heavenlycrm-assist__plan-editor .heavenlycrm-assist__form-check input[type="checkbox"] {
    width: auto;
    min-width: 1.2rem;
    height: 1.2rem;
    flex: 0 0 auto;
}

/* Customer workspace: stable palette, generous controls and contained history. */
.hcrm-customer.heavenlycrm-assist {
    --assist-fg: #192639; --assist-bg: #fff; --assist-muted: #627086;
    --assist-border: #e2e7ef; --assist-input-bg: #fff; --assist-bubble: #edf2ff; --assist-focus: #3157d5;
    max-width: 1180px; padding: 0; margin: 10px auto 28px; min-height: 600px;
    border: 1px solid var(--assist-border); border-radius: 22px; background: #fff;
    box-shadow: 0 12px 42px #24345108; overflow: clip;
}
.heavenlycrm-assist.heavenlycrm-assist--with-history { grid-template-columns: 240px minmax(0, 1fr); gap: 0; }
.heavenlycrm-assist__topbar { grid-column: 1/-1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 26px; border-bottom: 1px solid var(--assist-border); }
.heavenlycrm-assist__identity { display: flex; align-items: center; gap: 12px; }
.heavenlycrm-assist__identity .hcrm-brand-mark { width: 38px; height: 38px; border-radius: 12px; }
.heavenlycrm-assist__identity strong { display: block; font-size: 15px; line-height: 1.5; font-weight: 700; }
.heavenlycrm-assist__identity div > span { display: block; color: var(--assist-muted); font-size: 12px; }
.heavenlycrm-assist__top-actions { display: flex; gap: 8px; }
.heavenlycrm-assist .heavenlycrm-assist__account { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: #53627c; font-size: 12px; }
.heavenlycrm-assist__account svg { width: 17px; height: 17px; }
.heavenlycrm-assist .heavenlycrm-assist__history-toggle { display: none; }
.heavenlycrm-assist__history { padding: 24px 18px; border-right: 1px solid var(--assist-border); background: #f7f9fc; gap: 18px; }
.heavenlycrm-assist__history-head { flex-direction: column-reverse; align-items: stretch; gap: 26px; }
.heavenlycrm-assist__history-title { padding-inline: 9px; text-transform: uppercase; letter-spacing: .1em; color: #596780 !important; font-size: 10px; font-weight: 700; }
.heavenlycrm-assist__history-head .btn { display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--hcrm-accent); background: #fff; border-color: #d8e0f2; font-size: 13px; }
.heavenlycrm-assist__history-head svg { width: 16px; height: 16px; }
.heavenlycrm-assist__history-list { max-height: 360px; gap: 4px; }
.heavenlycrm-assist__history-btn { min-height: 44px; padding: 11px 12px; font-size: 13px; color: #53627a; border-radius: 9px; text-overflow: ellipsis; }
.heavenlycrm-assist__history-btn[aria-current="true"] { color: #2748b3; background: #e9efff; font-weight: 600; }
.heavenlycrm-assist__history-btn:hover { background: #edf1f8; }
.heavenlycrm-assist__history-empty { font-size: 12px; color: #596780; line-height: 1.7; padding-inline: 9px; }
.heavenlycrm-assist__sidebar-note { margin-top: auto; border-top: 1px solid #e6eaf1; padding: 20px 9px 0; font-size: 11px; color: #596780; line-height: 1.8; }
.heavenlycrm-assist__main { padding: 30px 32px 18px; min-width: 0; }
.heavenlycrm-assist__stage { min-height: 320px; }
.heavenlycrm-assist__stage:focus-visible { outline-offset: 6px; }
.heavenlycrm-assist.is-active .heavenlycrm-assist__stage { max-height: 480px; max-height: min(54dvh, 520px); min-height: 260px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d4dceb transparent; padding-right: 8px; }
.heavenlycrm-assist__empty { text-align: center; padding: 12px 0 28px; }
.heavenlycrm-assist__welcome-icon { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border: 1px solid #e2e8f8; border-radius: 18px; background: #f5f7ff; color: var(--hcrm-accent); margin-bottom: 22px; }
.heavenlycrm-assist__empty .hcrm-eyebrow { font-size: 9px; margin-bottom: 12px; }
.heavenlycrm-assist__heading { font-size: clamp(27px,3vw,36px); line-height: 1.18; font-weight: 700; letter-spacing: -.04em; margin-bottom: 14px; }
.heavenlycrm-assist__intro { color: #596780; font-size: 13px; margin: 0 auto 26px; }
.heavenlycrm-assist__starters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; text-align: start; }
.heavenlycrm-assist__starters button { position: relative; display: flex; flex-direction: column; align-items: start; gap: 6px; border: 1px solid #e2e7f0; border-radius: 12px; padding: 18px 14px; background: #fff; color: #536784; text-align: start; cursor: pointer; transition: background .15s, border-color .15s; }
.heavenlycrm-assist__starters button:hover { border-color: #adc0f3; background: #f7f9ff; }
.heavenlycrm-assist__starters strong { font-size: 14px; font-weight: 650; color: #33445c; margin-top: 10px; }
.heavenlycrm-assist__starters span { font-size: 12px; line-height: 1.4; color: #627086; }
.heavenlycrm-assist__starters svg:last-child { position: absolute; top: 18px; right: 12px; width: 14px; height: 14px; color: #9aa8bd; }
.heavenlycrm-assist__thread { gap: 20px; padding: 0 0 24px; }
.heavenlycrm-assist__msg { max-width: 90%; padding: 14px 18px; border-radius: 16px; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.heavenlycrm-assist__msg--user { background: #eff3fc; border-bottom-right-radius: 5px; }
.heavenlycrm-assist__msg--engine, .heavenlycrm-assist__msg--agent { padding-left: 4px; }
.heavenlycrm-assist__msg-role { font-size: 10px; font-weight: 650; color: #596780; margin-bottom: 6px; }
.heavenlycrm-assist__msg--system { color: #596780; background: #f7f9fc; font-size: 12px; padding: 8px 14px; border-radius: 8px; }
.heavenlycrm-assist__actions { gap: 8px; margin-top: 14px; white-space: normal; }
.heavenlycrm-assist__action { min-height: 40px; border-radius: 9px; padding: 9px 13px; font-size: 12px; color: #3656b1; border-color: #d6dff5; }
.heavenlycrm-assist__action:hover:not(:disabled) { background: #eff3ff; opacity: 1; }
.heavenlycrm-assist__dock { padding-top: 16px; z-index: 2; background: #fff; }
.heavenlycrm-assist__pill { border: 1px solid #d6deec; border-radius: 16px; padding: 8px; gap: 8px; background: #fff; box-shadow: 0 3px 15px #21375806; }
.heavenlycrm-assist__pill:focus-within { border-color: #819ce6; outline: 3px solid #3157d50c; outline-offset: 0; }
.hcrm-customer.heavenlycrm-assist textarea.heavenlycrm-assist__input { border: 0; background: transparent; box-shadow: none; padding: 11px 0; min-width: 0; min-height: 44px; max-height: 128px; border-radius: 0; font-size: 14px; line-height: 1.55; outline: 0; }
.heavenlycrm-assist .heavenlycrm-assist__plus, .heavenlycrm-assist .heavenlycrm-assist__send { width: 42px; height: 44px; min-height: 44px; border-radius: 11px; padding: 0; border: 0; }
.heavenlycrm-assist .heavenlycrm-assist__plus { background: transparent; color: #7b8aa1; }
.heavenlycrm-assist .heavenlycrm-assist__send { color: #fff; background: #3157d5; }
.heavenlycrm-assist .heavenlycrm-assist__send:hover { background: #2545b2; opacity: 1; }
.heavenlycrm-assist__composer-help { display: flex; justify-content: space-between; gap: 8px; color: #596780; font-size: 10px; margin: 10px 4px 0; }
.heavenlycrm-assist__tray-btn { border-radius: 10px; min-height: 48px; font-size: 13px; }
.heavenlycrm-assist__tray-hint { font-size: 11px; }
.heavenlycrm-assist__file-chip { background: #f4f7fd; font-size: 12px; border-radius: 8px; }
.heavenlycrm-assist__file-chip button { min-width: 32px; min-height: 32px; }
.heavenlycrm-assist__activity { font-size: 12px; margin: 16px 4px 0; }
.heavenlycrm-assist__handoff { background: #f6f8fe; border-color: #dce4fa; font-size: 13px; padding: 18px; }
.heavenlycrm-assist__handoff p { font-size: 12px; }
.heavenlycrm-assist__website { background: #fbfcff; padding: 24px; border-radius: 16px; margin: 20px 0 0; }
.heavenlycrm-assist__website h3 { font-size: 20px; margin-bottom: 10px; }
.heavenlycrm-assist__website h4 { font-weight: 650; }
.heavenlycrm-assist__website p, .heavenlycrm-assist__website ol { font-size: 13px; color: #61728b; }
.heavenlycrm-assist__website ol { gap: 12px; margin: 22px 0; }
.heavenlycrm-assist__website .is-complete { text-decoration: none; color: #22735b; }
.heavenlycrm-assist__website [aria-current="step"] { color: #3157d5; }
.heavenlycrm-assist__plan, .heavenlycrm-assist__content, .heavenlycrm-assist__reference { border-color: #e4e9f3; padding-top: 20px; margin-top: 20px; }
.heavenlycrm-assist__draft-viewport { border-radius: 12px; }
.heavenlycrm-assist__plan-editor label { font-size: 13px; }
.heavenlycrm-assist__plan-editor :is(button,select), .heavenlycrm-assist__draft-controls button { min-height: 44px; border: 1px solid #cdd8ef; border-radius: 9px; padding: 9px 13px; background: #fff; color: #3157d5; }
.heavenlycrm-assist__allowance { padding: 16px; background: #fff; font-size: 12px; border-radius: 12px; }
.hcrm-customer.heavenlycrm-assist--gate { display: block; border: 0; background: transparent; box-shadow: none; min-height: 0; max-width: 1050px; overflow: visible; }
.heavenlycrm-assist__welcome-actions { display: grid; gap: 12px; }
.heavenlycrm-assist__welcome-actions a { text-align: center; }
.hcrm-customer.heavenlycrm-assist--module { min-height: 320px; }
.heavenlycrm-assist--module .heavenlycrm-assist__main { padding: 20px; }
.heavenlycrm-assist--module .heavenlycrm-assist__starters { grid-template-columns: 1fr; }
.heavenlycrm-assist--module .heavenlycrm-assist__starters button { padding: 12px; }
.heavenlycrm-assist--module .heavenlycrm-assist__starters strong { margin: 0; }
.heavenlycrm-assist--module .heavenlycrm-assist__starters button > svg:first-child { display: none; }
@media (max-width: 900px) {
    .heavenlycrm-assist.heavenlycrm-assist--with-history { grid-template-columns: 190px minmax(0,1fr); }
    .heavenlycrm-assist__main { padding: 24px 22px 16px; }
    .heavenlycrm-assist__starters { grid-template-columns: 1fr; gap: 8px; }
    .heavenlycrm-assist__starters button { display: grid; grid-template-columns: 24px 1fr; gap: 0 12px; padding: 12px 16px; }
    .heavenlycrm-assist__starters button > svg:first-child { grid-row: span 2; align-self: center; }
    .heavenlycrm-assist__starters strong { margin: 0; }
    .heavenlycrm-assist__starters span { grid-column: 2; }
    .heavenlycrm-assist__composer-help span:last-child { display: none; }
}
@media (max-width: 767px) {
    .heavenlycrm-assist.heavenlycrm-assist--with-history { display: flex; }
    .hcrm-customer.heavenlycrm-assist { border-radius: 16px; min-height: 0; margin-top: 0; }
    .heavenlycrm-assist__topbar { padding: 14px 16px; gap: 8px; }
    .heavenlycrm-assist__identity div > span { font-size: 10px; }
    .heavenlycrm-assist__identity strong { font-size: 13px; }
    .heavenlycrm-assist__identity .hcrm-brand-mark { display: none; }
    .heavenlycrm-assist .heavenlycrm-assist__history-toggle { display: flex; align-items: center; gap: 5px; padding: 8px; font-size: 12px; border: 0; }
    .heavenlycrm-assist__history-toggle svg { width: 18px; }
    .heavenlycrm-assist .heavenlycrm-assist__account { padding: 8px; }
    .heavenlycrm-assist__account span { display: none; }
    .heavenlycrm-assist__account::after { content: 'Account'; }
    .heavenlycrm-assist__history { display: none; max-height: 280px; padding: 18px; border: 0; border-bottom: 1px solid var(--assist-border); }
    .heavenlycrm-assist.is-history-open .heavenlycrm-assist__history { display: flex; }
    .heavenlycrm-assist__history-head { flex-direction: row; align-items: center; }
    .heavenlycrm-assist__history-head .btn { order: 1; }
    .heavenlycrm-assist__history-list { overflow-y: auto; }
    .heavenlycrm-assist__sidebar-note { display: none; }
    .heavenlycrm-assist__main { padding: 24px 16px 14px; }
    .heavenlycrm-assist__empty { padding: 0 0 12px; }
    .heavenlycrm-assist__heading { font-size: 28px; }
    .heavenlycrm-assist__welcome-icon { margin-bottom: 18px; width: 44px; height: 44px; border-radius: 14px; }
    .heavenlycrm-assist__intro { font-size: 12px; margin-bottom: 22px; }
    .heavenlycrm-assist__starters strong { font-size: 12px; }
    .heavenlycrm-assist__dock { padding-top: 14px; padding-bottom: env(safe-area-inset-bottom,0); }
    .hcrm-customer.heavenlycrm-assist textarea.heavenlycrm-assist__input { font-size: 16px; }
    .heavenlycrm-assist__msg { font-size: 14px; max-width: 95%; }
    .heavenlycrm-assist__website { padding: 18px; }
    .heavenlycrm-assist__website ol { grid-template-columns: 1fr; }
}

/* Compact modules keep their own layout and do not restyle the host page. */
.heavenlycrm-assist__team-status { padding: .8rem 1rem; margin: .5rem 0; border: 1px solid var(--assist-border, #dce3ee); border-radius: 12px; background: #f4f7fb; color: #243047; }
.heavenlycrm-assist__team-status[hidden] { display: none; }
.heavenlycrm-assist__team-status p { margin: 0 0 .4rem; color: inherit; }
.heavenlycrm-assist__team-status p + p { font-size: .8rem; }
.heavenlycrm-assist__team-status .btn { color: #243047; background: #fff; border-color: #a9b7cb; }
.heavenlycrm-assist__delivery { display: block; margin-top: .4rem; color: inherit; font-size: .8rem; }
.heavenlycrm-assist--module .hcrm-auth { grid-template-columns: 1fr; margin: 0; }
.heavenlycrm-assist--module .hcrm-auth__story { display: none; }
.heavenlycrm-assist--module .hcrm-auth__panel { padding: 24px; }
.heavenlycrm-assist--module .heavenlycrm-assist__topbar { padding: 14px; }
.heavenlycrm-assist--module .heavenlycrm-assist__account span { display: none; }

/* Website discovery uses the same component in full-page and embedded chat. */
.ht-brief{background:#fff;border:1px solid #e1e6ee;border-radius:20px;padding:24px;margin:20px 0;color:#243047;box-shadow:0 8px 28px #16203308}.ht-brief h4{font-size:1.2rem;margin:0 0 8px}.ht-brief__tabs{display:flex;gap:4px;border-bottom:1px solid #dbe2ec;overflow:auto;margin:18px 0}.ht-brief__tabs button{border:0;background:none;padding:12px 14px;white-space:nowrap;color:#526079}.ht-brief__tabs [aria-selected=true]{color:#244bd2;border-bottom:3px solid #244bd2;font-weight:700}.ht-brief__fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.ht-brief__fields[hidden],.ht-brief__editor[hidden]{display:none}.ht-brief__field label{display:block;font-weight:650;margin-bottom:8px}.ht-brief__field textarea{width:100%;box-sizing:border-box;padding:12px 14px;border:1px solid #ccd5e1;border-radius:12px;font:inherit;resize:vertical;background:#fafbfd;min-height:80px}.ht-brief__field small{display:block;color:#64718a;margin-top:6px}.ht-brief__options{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}.ht-brief__options button,.ht-brief__later{border:1px solid #dce3ee;border-radius:20px;padding:5px 10px;background:white;color:#354562;font-size:.8rem}.ht-brief__later{border:0;padding-left:0;margin-top:6px;color:#596d9b}.ht-brief__actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}.ht-brief__status{font-size:.9rem;color:#435375;min-height:1.5em;margin-top:18px}.ht-brief__directions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;grid-column:1/-1}.ht-brief__directions h5{grid-column:1/-1}.ht-brief__direction{border:2px solid #e2e6ed;background:white;border-radius:14px;padding:10px;text-align:left;display:flex;flex-direction:column;gap:7px}.ht-brief__direction[aria-pressed=true]{border-color:#4264de;box-shadow:0 0 0 3px #4264de18}.ht-brief__direction>small{font-size:.8rem;color:#56637a}.ht-brief__preview{display:flex;flex-direction:column;gap:16px;padding:16px;min-height:140px;border-radius:8px;align-self:stretch;overflow:hidden}.ht-brief__preview strong{font-size:1.45rem;line-height:1.1;max-width:130px}.ht-brief__preview small{font-size:.65rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.ht-brief__preview i{height:8px;width:42%;border-radius:8px}.ht-brief__preview--centered{text-align:center;align-items:center}.ht-brief__preview--split{border-radius:8px 35px 8px 8px}.ht-brief button:focus-visible,.ht-brief textarea:focus-visible{outline:3px solid #7794f7;outline-offset:3px}@media(max-width:680px){.ht-brief{padding:16px}.ht-brief__fields{grid-template-columns:1fr}.ht-brief__directions{grid-template-columns:repeat(2,minmax(0,1fr))}.ht-brief__actions .btn{flex:1 1 45%;white-space:normal}}

/* Keep each conversational choice group together; Other opens a local answer editor. */
.heavenlycrm-assist__question { align-items: flex-start; }
.heavenlycrm-assist__answer { display: grid; gap: .55rem; flex: 1 0 100%; min-width: 0; margin-top: .4rem; }
.heavenlycrm-assist__answer[hidden] { display: none; }
.heavenlycrm-assist__answer label { font-weight: 600; }
.heavenlycrm-assist__answer textarea { box-sizing: border-box; width: 100%; min-width: 0; min-height: 5rem; padding: .75rem; border: 1px solid #cbd5e1; border-radius: .75rem; font: inherit; color: #172b4d; background: #fff; resize: vertical; }
.heavenlycrm-assist__answer textarea:focus { outline: 2px solid #315ce8; outline-offset: 2px; }
.heavenlycrm-assist__answer small { color: #52647b; }
.heavenlycrm-assist__answer button { justify-self: start; }
.heavenlycrm-assist__question button:disabled { cursor: not-allowed; opacity: 1; }
/* One service question above the conversation; choices never submit a request. */
.heavenlycrm-assist__service-context{padding:1.25rem 1.5rem;border-bottom:1px solid var(--hcrm-border,#dce3ee);background:var(--hcrm-surface,#fff);color:var(--hcrm-text,#172033)}
.heavenlycrm-assist__service-context h2{font-size:1.3rem;line-height:1.4;margin:.4rem 0 1rem;color:inherit}
.heavenlycrm-assist__service-context p{margin:0 0 .75rem}
.heavenlycrm-assist[data-context-pending=true]:not(.is-active) .heavenlycrm-assist__stage{min-height:0}
.heavenlycrm-assist__service-context .hcrm-eyebrow{color:inherit}
.heavenlycrm-assist__service-choices{display:flex;flex-wrap:wrap;gap:.65rem;margin-bottom:.9rem}
.heavenlycrm-assist__service-choices .btn{white-space:normal;text-align:left;color:inherit;background:transparent;border:1px solid currentColor}
.heavenlycrm-assist__service-choices .btn:hover,.heavenlycrm-assist__service-choices .btn:focus-visible{color:#fff;background:#234eae;border-color:#234eae}
@media(max-width:600px){.heavenlycrm-assist__service-context{padding:1rem}.heavenlycrm-assist__service-choices .btn{flex:1 1 45%}}
