/* --- GLOBAL FIXES & BEST PRACTICES --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* 1. Prevent the "elastic" bounce on the whole page */
html,
body {
    overscroll-behavior: none;
    height: 100%;
    margin: 0;
    padding: 0;
    /* Prevents the body itself from being scrollable */
    overflow: hidden;
}

/* --- FIX ELEMENTOR'S WRAPPER (Keep this from before) --- */
.elementor-widget-shortcode > .elementor-widget-container {
    padding: 0 !important;
}

/* --- COMPONENT STYLES --- */

/* The root component, our rigid "shell" */
#capacity-breath-root {
    width: 100%;
    /* 2. KEY FIX FOR IOS: Use dynamic viewport height */
    height: 100dvh;
    display: flex;
    flex-direction: column;
    /* Ensure this container itself never scrolls */
    overflow: hidden;
}

/* The inner container that holds the scroll area and the form */
#capacity-breath-root .capacity-chat-container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    font-family: system-ui, sans-serif;
    color: #fff;
    /* Removing border-radius and padding if you want it edge-to-edge */
    /* border-radius: 1em; */
    /* padding: 2em; */
}

/* 3. The specific area that is allowed to scroll */
#capacity-breath-root .capacity-chat-scroll-area {
    flex: 1;
    /* Show a scrollbar ONLY if content overflows */
    overflow-y: auto;
    /* Prevents this element from breaking the flexbox layout */
    min-height: 0;
    width: 100%;
    padding: 2em;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#capacity-breath-root .capacity-chat-heading {
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
    color: white;
}

/* The form area, which should not scroll */
#capacity-breath-root .capacity-chat-form {
    display: flex;
    align-items: center;
    background: #333;
    border-radius: 9999px;
    overflow: hidden;
    margin: 2em 0;
    width: 90%;
    max-width: 600px;
}

#capacity-breath-root .capacity-chat-input-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

#capacity-breath-root .capacity-chat-input {
    padding: 0.75em 1em;
    font-size: 1em;
    background: transparent;
    border: none;
    color: white;
    flex: 1;
    min-width: 0;
}

#capacity-breath-root .capacity-chat-input::placeholder {
    color: #aaa;
}

#capacity-breath-root .capacity-chat-submit {
    background: #444;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin-right: 7px;
}

#capacity-breath-root .capacity-chat-submit:hover {
    background: #555;
}

#capacity-breath-root .capacity-chat-input:focus,
#capacity-breath-root .capacity-chat-submit:focus {
    outline: none;
    box-shadow: none;
}