.ocf-chat-widget {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 90;
    width: 3.5rem;
    height: 3.5rem;
    font-size: 0.9375rem;
}

.ocf-chat-trigger,
.ocf-chat-close,
.ocf-chat-submit {
    border: 0;
    font: inherit;
}

.ocf-chat-trigger {
    display: inline-grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    padding: 0;
    border-radius: 50%;
    background: var(--ocf-primary);
    color: #fff;
    box-shadow: 0 0.5rem 1.25rem color-mix(in srgb, var(--ocf-heading) 22%, transparent);
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.ocf-chat-trigger svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 2; }
.ocf-chat-trigger span { display: none; }
.ocf-chat-trigger:hover, .ocf-chat-trigger:focus-visible { background: var(--ocf-primary-hover); transform: translateY(-1px); box-shadow: 0 0.7rem 1.5rem color-mix(in srgb, var(--ocf-heading) 28%, transparent); }

.ocf-chat-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.75rem);
    width: min(22rem, calc(100vw - 2rem));
    overflow: hidden;
    border: 1px solid var(--ocf-border);
    border-radius: var(--card-radius);
    background: var(--ocf-bg);
    box-shadow: var(--card-shadow-hover);
}

.ocf-chat-panel[hidden] { display: none; }
.ocf-chat-panel__header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1rem 1rem 0.85rem; border-bottom: 1px solid var(--ocf-border-light); }
.ocf-chat-panel__header strong { color: var(--ocf-heading); }
.ocf-chat-panel__header p { margin: 0.3rem 0 0; color: var(--ocf-body); font-size: 0.84rem; line-height: 1.45; }
.ocf-chat-close { display: inline-grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border-radius: 50%; background: transparent; color: var(--ocf-body); cursor: pointer; }
.ocf-chat-close:hover, .ocf-chat-close:focus-visible { background: var(--ocf-bg-alt); color: var(--ocf-heading); }
.ocf-chat-close svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; }

.ocf-chat-form { display: grid; gap: 0.65rem; padding: 1rem; }
.ocf-chat-form label { color: var(--ocf-heading); font-size: 0.78rem; font-weight: var(--font-weight-semibold); }
.ocf-chat-form input, .ocf-chat-form textarea { width: 100%; border: 1px solid var(--ocf-border); border-radius: var(--radius-sm); background: var(--ocf-bg); color: var(--ocf-heading); padding: 0.62rem 0.7rem; font: inherit; }
.ocf-chat-form textarea { resize: vertical; min-height: 5rem; }
.ocf-chat-form input:focus, .ocf-chat-form textarea:focus { outline: 2px solid color-mix(in srgb, var(--ocf-primary) 35%, transparent); outline-offset: 1px; border-color: var(--ocf-primary); }
.ocf-chat-submit { width: 100%; margin-top: 0.2rem; padding: 0.68rem 1rem; border-radius: var(--button-radius); background: var(--ocf-primary); color: #fff; font-weight: var(--font-weight-bold); cursor: pointer; }
.ocf-chat-submit:hover, .ocf-chat-submit:focus-visible { background: var(--ocf-primary-hover); }
.ocf-chat-form .ocf-form-status { font-size: 0.82rem; }

@media (max-width: 480px) {
    .ocf-chat-widget { right: 1rem; bottom: 1rem; }
}

/* OCF_AGENT_BLOCK:chat-submit-status START */
.ocf-chat-form .ocf-form-status.is-visible {
    display: block;
}

.ocf-chat-form .ocf-form-status.is-success {
    color: var(--ocf-primary);
}

.ocf-chat-form .ocf-form-status.is-error {
    color: #b42318;
}
/* OCF_AGENT_BLOCK:chat-submit-status END */

/* OCF_AGENT_BLOCK:chat-success-screen START */
.ocf-chat-success {
    display: grid;
    justify-items: center;
    gap: 0.8rem;
    min-height: 17rem;
    padding: 2rem 1.5rem;
    align-content: center;
    text-align: center;
}

.ocf-chat-success__icon {
    display: inline-grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--ocf-primary) 12%, var(--ocf-bg));
    color: var(--ocf-primary);
}

.ocf-chat-success__icon svg {
    width: 1.7rem;
    height: 1.7rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.35;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ocf-chat-success strong {
    color: var(--ocf-heading);
    font-family: var(--ocf-font-heading), system-ui, sans-serif;
    font-size: 1.45rem;
    line-height: 1.15;
}

.ocf-chat-success p {
    max-width: 24ch;
    margin: 0;
    color: var(--ocf-body);
    font-size: 1rem;
    line-height: 1.5;
}

.ocf-chat-success__close {
    margin-top: 0.4rem;
    border: 1px solid var(--ocf-border);
    border-radius: var(--button-radius);
    background: var(--ocf-bg);
    color: var(--ocf-heading);
    padding: 0.55rem 1rem;
    font: inherit;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
}

.ocf-chat-success__close:hover,
.ocf-chat-success__close:focus-visible {
    border-color: var(--ocf-primary);
    color: var(--ocf-primary);
}
/* OCF_AGENT_BLOCK:chat-success-screen END */

/* OCF_AGENT_BLOCK:chat-hidden-states START */
.ocf-chat-form[hidden],
.ocf-chat-success[hidden] {
    display: none !important;
}
/* OCF_AGENT_BLOCK:chat-hidden-states END */

/* OCF_AGENT_BLOCK:a2p-chat-sms-consent START */
.ocf-chat-panel {
    /* Leave room for the sticky site navigation above and the chat trigger below. */
    max-height: calc(100vh - 12rem);
    max-height: calc(100dvh - 12rem - env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.ocf-chat-panel__header {
    position: sticky;
    top: 0;
    z-index: 1;
    padding-top: 1.25rem;
    background: var(--ocf-bg);
}

.ocf-chat-form .ocf-chat-name-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    min-width: 0;
}

.ocf-chat-form .ocf-chat-name-field {
    display: grid;
    align-content: start;
    gap: 0.45rem;
    min-width: 0;
}

.ocf-chat-form .ocf-chat-name-field input { min-width: 0; }

.ocf-chat-form .ocf-chat-sms-preferences {
    --sms-muted: #4B5563;
    display: grid;
    gap: 0.5rem;
    min-width: 0;
}

.ocf-chat-form .ocf-chat-sms-heading {
    margin: 0;
    color: var(--ocf-heading);
    font: inherit;
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    line-height: 1.4;
}

.ocf-chat-form .ocf-chat-sms-consents {
    display: grid;
    gap: 11px;
    min-width: 0;
}

.ocf-chat-form .ocf-chat-sms-choice {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    color: var(--sms-muted);
    font-size: 12.5px;
    font-weight: var(--font-weight-regular);
    line-height: 1.4;
    cursor: pointer;
}

.ocf-chat-form .ocf-chat-sms-choice input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    padding: 0;
    accent-color: var(--ocf-primary);
}

.ocf-chat-form .ocf-chat-sms-disclosure {
    margin: 0;
    color: var(--sms-muted);
    font-size: 12.5px;
    line-height: 1.4;
}

.ocf-chat-form .ocf-chat-sms-disclosure a {
    color: var(--ocf-primary);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

@media (max-width: 639px) {
    .ocf-chat-form .ocf-chat-sms-heading,
    .ocf-chat-form .ocf-chat-sms-choice,
    .ocf-chat-form .ocf-chat-sms-disclosure { font-size: 12px; }
}

@media (max-width: 390px) {
    .ocf-chat-form .ocf-chat-name-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-color-scheme: dark) {
    .ocf-chat-form .ocf-chat-sms-preferences { --sms-muted: var(--ocf-body); }
}
/* OCF_AGENT_BLOCK:a2p-chat-sms-consent END */
