/* =========================================================
   HYDROTECH ENGINEERS CHATBOT
   PROFESSIONAL RESPONSIVE CHAT WIDGET
   Version: 2.0
   Class Prefix: hydrotech-chatbot

   IMPORTANT:
   The chat window uses the native [hidden] attribute.
   JS should use:
       chatWindow.hidden = false; // OPEN
       chatWindow.hidden = true;  // CLOSE
========================================================= */


/* =========================================================
   01. VARIABLES
========================================================= */

:root {
    --hydrotech-primary: #0b4f71;
    --hydrotech-primary-dark: #073b55;
    --hydrotech-primary-deep: #052f45;

    --hydrotech-accent: #0f789f;
    --hydrotech-accent-light: #e9f5fa;

    --hydrotech-success: #16855b;
    --hydrotech-success-light: #eaf8f2;

    --hydrotech-danger: #c0392b;
    --hydrotech-danger-light: #fff4f2;

    --hydrotech-white: #ffffff;
    --hydrotech-bg: #f5f8fa;
    --hydrotech-bg-soft: #f8fbfc;

    --hydrotech-border: #dce5ea;
    --hydrotech-border-dark: #cbd8df;

    --hydrotech-text: #18313d;
    --hydrotech-text-dark: #102934;
    --hydrotech-muted: #71808a;
    --hydrotech-placeholder: #9aa7ae;

    --hydrotech-shadow:
        0 24px 70px rgba(5, 35, 50, 0.22),
        0 8px 25px rgba(5, 35, 50, 0.12);

    --hydrotech-shadow-soft:
        0 5px 18px rgba(10, 45, 60, 0.08);

    --hydrotech-radius: 20px;
}


/* =========================================================
   02. RESET / BASE
========================================================= */

.hydrotech-chatbot,
.hydrotech-chatbot *,
.hydrotech-chatbot *::before,
.hydrotech-chatbot *::after {
    box-sizing: border-box;
}

.hydrotech-chatbot {
    position: fixed;
    inset: 0;

    z-index: 999999;

    width: 100%;
    height: 100%;

    margin: 0;
    padding: 0;

    pointer-events: none;

    font-family:
        "Poppins",
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    color: var(--hydrotech-text);

    line-height: 1.5;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* =========================================================
   03. HIDDEN ELEMENTS — CRITICAL
========================================================= */

/*
   DO NOT remove this rule.

   The HTML uses:
       hidden

   Therefore hidden elements must actually disappear.
*/

.hydrotech-chatbot [hidden] {
    display: none !important;
}


/* =========================================================
   04. INTERACTIVE ELEMENTS
========================================================= */

.hydrotech-chatbot button,
.hydrotech-chatbot input,
.hydrotech-chatbot select,
.hydrotech-chatbot textarea {
    font-family: inherit;
}

.hydrotech-chatbot button,
.hydrotech-chatbot a {
    -webkit-tap-highlight-color: transparent;
}

.hydrotech-chatbot button {
    appearance: none;
}

.hydrotech-chatbot img {
    max-width: 100%;
}

.hydrotech-chatbot button:disabled {
    cursor: not-allowed;
}


/* =========================================================
   05. RIGHT SIDE LAUNCHER
========================================================= */

.hydrotech-chatbot-toggle {
    position: fixed;

    right: 0;
    top: 50%;

    width: 50px;


    margin: 0;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 17px 0 0 17px;

    background:
        linear-gradient(
            180deg,
            var(--hydrotech-primary),
            var(--hydrotech-primary-dark)
        );

    color: var(--hydrotech-white);

    cursor: pointer;

    pointer-events: auto;

    transform: translateY(-50%);

    box-shadow:
        -7px 10px 28px rgba(5, 43, 61, 0.22);

    transition:
        width 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.hydrotech-chatbot-toggle:hover {
    width: 56px;

    background:
        linear-gradient(
            180deg,
            var(--hydrotech-accent),
            var(--hydrotech-primary-dark)
        );

    box-shadow:
        -9px 12px 34px rgba(5, 43, 61, 0.28);
}

.hydrotech-chatbot-toggle:active {
    transform:
        translateY(-50%)
        scale(0.98);
}

.hydrotech-chatbot-toggle:focus-visible {
    outline: 3px solid rgba(15, 120, 159, 0.35);
    outline-offset: 3px;
}


/* Launcher icon */

.hydrotech-chatbot-toggle-icon {
    display: block;

    font-size: 21px;
    line-height: 1;
    margin-top: -25px;

    color: #ffffff;

    transform: translateY(-17px);
}


/* Launcher text */

.hydrotech-chatbot-toggle::after {
    content: "CHAT";

    position: absolute;

    left: 50%;
    bottom: 44px;
  transform: translateX(-50%) rotate(-90deg);
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
    line-height: 1;

    font-weight: 700;

    letter-spacing: 2px;

    white-space: nowrap;

    pointer-events: none;
}


/* =========================================================
   06. CHAT WINDOW
========================================================= */

/*
   IMPORTANT:
   No opacity/visibility system is used here.

   [hidden] = closed
   no [hidden] = open
*/

.hydrotech-chatbot-window {
    position: fixed;

    right: 20px;
    bottom: 20px;

    width: min(420px, calc(100vw - 40px));

    height: min(
        700px,
        calc(100dvh - 40px)
    );

    max-height: calc(100dvh - 40px);

    min-height: 480px;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    margin: 0;
    padding: 0;

    background: var(--hydrotech-white);

    border:
        1px solid
        rgba(11, 79, 113, 0.13);

    border-radius: var(--hydrotech-radius);

    box-shadow: var(--hydrotech-shadow);

    pointer-events: auto;

    color: var(--hydrotech-text);

    isolation: isolate;
}


/*
   CRITICAL CLOSE RULE
*/

.hydrotech-chatbot-window[hidden] {
    display: none !important;
}


/* =========================================================
   07. HEADER
========================================================= */

.hydrotech-chatbot-header {
    position: relative;

    z-index: 5;

    flex: 0 0 auto;

    min-height: 76px;

    padding:
        12px
        14px;

    display: flex;
    align-items: center;

    gap: 11px;

    background:
        linear-gradient(
            135deg,
            var(--hydrotech-primary),
            var(--hydrotech-primary-dark)
        );

    color: #ffffff;

    border-radius:
        var(--hydrotech-radius)
        var(--hydrotech-radius)
        0
        0;
}


/* =========================================================
   08. LOGO
========================================================= */

.hydrotech-chatbot-logo {
    width: 48px;
    height: 48px;

    flex: 0 0 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    background: #ffffff;

    border:
        1px solid
        rgba(255, 255, 255, 0.22);

    border-radius: 12px;

    box-shadow:
        0 5px 16px rgba(0, 0, 0, 0.16);
}

.hydrotech-chatbot-logo img {
    display: block;

    width: 100%;
    height: 100%;

    padding: 5px;

    object-fit: contain;
}


/* =========================================================
   09. HEADER TEXT
========================================================= */

.hydrotech-chatbot-heading {
    min-width: 0;

    flex: 1;
}

.hydrotech-chatbot-heading h2 {
    margin: 0 0 3px;

    overflow: hidden;

    color: #ffffff;

    font-size: 16px;
    line-height: 1.25;

    font-weight: 700;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.hydrotech-chatbot-heading span {
    display: block;

    overflow: hidden;

    color:
        rgba(255, 255, 255, 0.82);

    font-size: 10.5px;
    line-height: 1.4;

    font-weight: 400;

    white-space: nowrap;
    text-overflow: ellipsis;
}


/* =========================================================
   10. CLOSE BUTTON
========================================================= */

.hydrotech-chatbot-close {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border:
        1px solid
        rgba(255, 255, 255, 0.20);

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.10);

    color: #ffffff;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.hydrotech-chatbot-close:hover {
    background:
        rgba(255, 255, 255, 0.20);

    transform: rotate(90deg);
}

.hydrotech-chatbot-close:active {
    transform:
        rotate(90deg)
        scale(0.95);
}

.hydrotech-chatbot-close:focus-visible {
    outline:
        2px solid
        #ffffff;

    outline-offset: 2px;
}


/* =========================================================
   11. CHAT BODY
========================================================= */

.hydrotech-chatbot-body {
    position: relative;

    flex: 1 1 auto;

    min-height: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            #f8fbfc 0%,
            #f3f7f9 100%
        );
}


/* =========================================================
   12. CONVERSATION
========================================================= */

.hydrotech-chatbot-conversation {
    flex: 1 1 auto;

    min-height: 100%;

    width: 100%;

    padding:
        18px
        15px
        20px;

    overflow-y: auto;
    overflow-x: hidden;

    scroll-behavior: smooth;

    overscroll-behavior: contain;

    -webkit-overflow-scrolling: touch;
}


/* Scrollbar */

.hydrotech-chatbot-conversation::-webkit-scrollbar {
    width: 6px;
}

.hydrotech-chatbot-conversation::-webkit-scrollbar-track {
    background: transparent;
}

.hydrotech-chatbot-conversation::-webkit-scrollbar-thumb {
    background:
        rgba(11, 79, 113, 0.20);

    border-radius: 20px;
}

.hydrotech-chatbot-conversation {
    scrollbar-width: thin;

    scrollbar-color:
        rgba(11, 79, 113, 0.20)
        transparent;
}


/* =========================================================
   13. CHAT MESSAGE
========================================================= */

.hydrotech-chatbot-message {
    width: 100%;

    display: flex;

    margin:
        0 0 12px;
}

.hydrotech-chatbot-message:last-child {
    margin-bottom: 0;
}

.hydrotech-chatbot-message--bot {
    justify-content: flex-start;
}

.hydrotech-chatbot-message--user {
    justify-content: flex-end;
}


/* =========================================================
   14. CHAT BUBBLE
========================================================= */

.hydrotech-chatbot-bubble {
    max-width: 88%;

    padding:
        11px
        13px;

    border-radius: 15px;

    font-size: 13px;

    line-height: 1.65;

    overflow-wrap: anywhere;
    word-break: break-word;
}


/* Bot bubble */

.hydrotech-chatbot-message--bot
.hydrotech-chatbot-bubble {
    background: #ffffff;

    color: var(--hydrotech-text);

    border:
        1px solid
        rgba(11, 79, 113, 0.09);

    border-top-left-radius: 5px;

    box-shadow:
        0 3px 12px
        rgba(14, 52, 67, 0.06);
}


/* User bubble */

.hydrotech-chatbot-message--user
.hydrotech-chatbot-bubble {
    background:
        linear-gradient(
            135deg,
            var(--hydrotech-primary),
            var(--hydrotech-accent)
        );

    color: #ffffff;

    border-top-right-radius: 5px;

    box-shadow:
        0 4px 13px
        rgba(11, 79, 113, 0.16);
}


/* Links */

.hydrotech-chatbot-bubble a {
    color: var(--hydrotech-accent);

    font-weight: 600;

    text-decoration: underline;
}

.hydrotech-chatbot-message--user
.hydrotech-chatbot-bubble a {
    color: #ffffff;
}


/* Strong */

.hydrotech-chatbot-bubble strong {
    font-weight: 700;
}


/* Paragraph */

.hydrotech-chatbot-bubble p {
    margin:
        0 0 8px;
}

.hydrotech-chatbot-bubble p:last-child {
    margin-bottom: 0;
}


/* Lists */

.hydrotech-chatbot-bubble ul,
.hydrotech-chatbot-bubble ol {
    margin:
        7px 0
        0
        17px;

    padding: 0;
}

.hydrotech-chatbot-bubble li {
    margin-bottom: 4px;
}


/* =========================================================
   15. TYPING INDICATOR
========================================================= */

.hydrotech-chatbot-typing
.hydrotech-chatbot-bubble {
    display: flex;
    align-items: center;

    gap: 5px;

    min-width: 58px;

    padding:
        12px
        14px;
}

.hydrotech-chatbot-dot {
    width: 7px;
    height: 7px;

    flex: 0 0 7px;

    border-radius: 50%;

    background:
        var(--hydrotech-primary);

    animation:
        hydrotechTyping
        1.2s
        infinite
        ease-in-out;
}

.hydrotech-chatbot-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.hydrotech-chatbot-dot:nth-child(3) {
    animation-delay: 0.30s;
}

@keyframes hydrotechTyping {

    0%,
    60%,
    100% {
        opacity: 0.45;

        transform:
            translateY(0);
    }

    30% {
        opacity: 1;

        transform:
            translateY(-4px);
    }
}


/* =========================================================
   16. QUICK ACTIONS
========================================================= */

.hydrotech-chatbot-actions {
    width: 100%;

    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin:
        2px 0 15px;
}

.hydrotech-chatbot-action {
    appearance: none;

    min-height: 36px;

    padding:
        8px
        12px;

    border:
        1px solid
        rgba(11, 79, 113, 0.16);

    border-radius: 10px;

    background: #ffffff;

    color:
        var(--hydrotech-primary);

    font-family: inherit;

    font-size: 11.5px;

    line-height: 1.35;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.hydrotech-chatbot-action:hover {
    background:
        var(--hydrotech-primary);

    color: #ffffff;

    border-color:
        var(--hydrotech-primary);

    transform:
        translateY(-1px);

    box-shadow:
        0 5px 12px
        rgba(11, 79, 113, 0.15);
}

.hydrotech-chatbot-action:active {
    transform:
        translateY(0);
}

.hydrotech-chatbot-action:focus-visible {
    outline:
        2px solid
        rgba(15, 120, 159, 0.35);

    outline-offset: 2px;
}

.hydrotech-chatbot-action--quote {
    background:
        var(--hydrotech-accent-light);

    border-color:
        rgba(11, 79, 113, 0.20);
}


/* =========================================================
   17. FORM WRAPPER
========================================================= */

.hydrotech-chatbot-form-wrap {
    flex: 1 1 auto;

    min-height: 0;

    width: 100%;

    padding:
        16px
        15px
        20px;

    overflow-y: auto;
    overflow-x: hidden;

    background:
        linear-gradient(
            180deg,
            #f8fbfc,
            #f3f7f9
        );

    overscroll-behavior: contain;

    -webkit-overflow-scrolling: touch;
}


/* Form scrollbar */

.hydrotech-chatbot-form-wrap::-webkit-scrollbar {
    width: 6px;
}

.hydrotech-chatbot-form-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.hydrotech-chatbot-form-wrap::-webkit-scrollbar-thumb {
    background:
        rgba(11, 79, 113, 0.20);

    border-radius: 20px;
}

.hydrotech-chatbot-form-wrap {
    scrollbar-width: thin;

    scrollbar-color:
        rgba(11, 79, 113, 0.20)
        transparent;
}


/* =========================================================
   18. FORM BACK BUTTON
========================================================= */

.hydrotech-chatbot-form-back {
    display: inline-flex;

    align-items: center;

    gap: 6px;

    margin:
        0 0 13px;

    padding: 0;

    border: 0;

    background: transparent;

    color:
        var(--hydrotech-primary);

    font-family: inherit;

    font-size: 11.5px;

    font-weight: 600;

    cursor: pointer;
}

.hydrotech-chatbot-form-back:hover {
    text-decoration: underline;
}

.hydrotech-chatbot-form-back:focus-visible {
    outline:
        2px solid
        rgba(15, 120, 159, 0.30);

    outline-offset: 3px;
}


/* =========================================================
   19. FORM TITLE
========================================================= */

.hydrotech-chatbot-form-title {
    margin:
        0 0 5px;

    color:
        var(--hydrotech-text-dark);

    font-size: 19px;

    line-height: 1.35;

    font-weight: 700;
}

.hydrotech-chatbot-form-note {
    margin:
        0 0 15px;

    color:
        var(--hydrotech-muted);

    font-size: 11px;

    line-height: 1.6;
}


/* =========================================================
   20. FORM ALERT
========================================================= */

.hydrotech-chatbot-form-alert {
    display: none;

    margin:
        0 0 12px;

    padding:
        10px
        11px;

    border:
        1px solid
        rgba(192, 57, 43, 0.20);

    border-radius: 9px;

    background:
        var(--hydrotech-danger-light);

    color:
        var(--hydrotech-danger);

    font-size: 11px;

    line-height: 1.5;
}

.hydrotech-chatbot-form-alert.hydrotech-is-visible {
    display: block;
}


/* =========================================================
   21. FORM
========================================================= */

.hydrotech-chatbot-form {
    width: 100%;

    margin: 0;
    padding: 0;
}


/* Field */

.hydrotech-chatbot-field {
    width: 100%;

    margin:
        0 0 12px;
}


/* Label */

.hydrotech-chatbot-label {
    display: block;

    margin:
        0 0 5px;

    color:
        var(--hydrotech-text);

    font-size: 11px;

    line-height: 1.4;

    font-weight: 600;
}

.hydrotech-chatbot-label span {
    color:
        var(--hydrotech-danger);
}


/* =========================================================
   22. FORM INPUTS
========================================================= */

.hydrotech-chatbot-form
.hydrotech-chatbot-input,
.hydrotech-chatbot-select,
.hydrotech-chatbot-textarea {
    display: block;

    width: 100%;

    margin: 0;

    border:
        1px solid
        var(--hydrotech-border);

    border-radius: 9px;

    outline: none;

    background:
        #ffffff;

    color:
        var(--hydrotech-text);

    font-family: inherit;

    font-size: 11.5px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


/* Text / select */

.hydrotech-chatbot-form
.hydrotech-chatbot-input,
.hydrotech-chatbot-select {
    height: 42px;

    padding:
        0 11px;
}


/* Textarea */

.hydrotech-chatbot-textarea {
    min-height: 82px;

    padding:
        10px
        11px;

    resize: vertical;

    line-height: 1.5;
}


/* Placeholder */

.hydrotech-chatbot-form
.hydrotech-chatbot-input::placeholder,
.hydrotech-chatbot-textarea::placeholder {
    color:
        var(--hydrotech-placeholder);

    opacity: 1;
}


/* Focus */

.hydrotech-chatbot-form
.hydrotech-chatbot-input:focus,
.hydrotech-chatbot-select:focus,
.hydrotech-chatbot-textarea:focus {
    border-color:
        var(--hydrotech-accent);

    background:
        #ffffff;

    box-shadow:
        0 0 0 3px
        rgba(15, 120, 159, 0.09);
}


/* Select */

.hydrotech-chatbot-select {
    cursor: pointer;
}


/* Error */

.hydrotech-chatbot-form
.hydrotech-has-error {
    border-color:
        var(--hydrotech-danger) !important;

    box-shadow:
        0 0 0 3px
        rgba(192, 57, 43, 0.08) !important;
}


/* =========================================================
   23. ERROR MESSAGE
========================================================= */

.hydrotech-chatbot-error {
    display: none;

    margin:
        4px 0 0;

    padding: 0;

    color:
        var(--hydrotech-danger);

    font-size: 9.5px;

    line-height: 1.4;
}

.hydrotech-chatbot-error.hydrotech-is-visible {
    display: block;
}


/* =========================================================
   24. TURNSTILE
========================================================= */

.hydrotech-chatbot-turnstile {
    width: 100%;

    min-height: 65px;

    margin:
        6px 0 4px;

    display: flex;

    align-items: center;
    justify-content: flex-start;

    overflow: hidden;
}

.hydrotech-chatbot-turnstile .cf-turnstile {
    display: block;

    max-width: 100%;
}


/* =========================================================
   25. SUBMIT BUTTON
========================================================= */

.hydrotech-chatbot-submit {
    width: 100%;

    min-height: 44px;

    margin:
        8px 0 0;

    padding:
        10px
        14px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    border: 0;

    border-radius: 10px;

    background:
        linear-gradient(
            135deg,
            var(--hydrotech-primary),
            var(--hydrotech-accent)
        );

    color: #ffffff;

    font-family: inherit;

    font-size: 12px;

    line-height: 1.3;

    font-weight: 700;

    text-decoration: none;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

.hydrotech-chatbot-submit:hover:not(:disabled) {
    transform:
        translateY(-1px);

    box-shadow:
        0 6px 18px
        rgba(11, 79, 113, 0.20);
}

.hydrotech-chatbot-submit:active:not(:disabled) {
    transform:
        translateY(0);
}

.hydrotech-chatbot-submit:disabled {
    opacity: 0.65;

    cursor: not-allowed;
}


/* =========================================================
   26. SECURE TEXT
========================================================= */

.hydrotech-chatbot-secure {
    margin:
        8px 0 0;

    text-align: center;

    color:
        #8a969d;

    font-size: 9.5px;

    line-height: 1.4;
}

.hydrotech-chatbot-secure i {
    margin-right: 4px;
}


/* =========================================================
   27. SUCCESS PANEL
========================================================= */

.hydrotech-chatbot-success {
    width: 100%;

    padding:
        22px
        5px
        12px;

    text-align: center;
}

.hydrotech-chatbot-success-icon {
    width: 62px;
    height: 62px;

    margin:
        0 auto 14px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background:
        var(--hydrotech-success-light);

    color:
        var(--hydrotech-success);

    font-size: 25px;
}

.hydrotech-chatbot-success-title {
    margin:
        0 0 8px;

    color:
        var(--hydrotech-text-dark);

    font-size: 17px;

    line-height: 1.4;

    font-weight: 700;
}

.hydrotech-chatbot-success-text {
    max-width: 340px;

    margin:
        0 auto 8px;

    color:
        var(--hydrotech-muted);

    font-size: 11px;

    line-height: 1.6;
}

.hydrotech-chatbot-success-phone {
    display: inline-block;

    margin:
        4px 0 15px;

    color:
        var(--hydrotech-primary);

    font-size: 15px;

    line-height: 1.4;

    font-weight: 700;

    text-decoration: none;
}

.hydrotech-chatbot-success-phone:hover {
    text-decoration: underline;
}


/* =========================================================
   28. SUCCESS ACTIONS
========================================================= */

.hydrotech-chatbot-success-actions {
    width: 100%;

    display: flex;

    flex-direction: column;

    gap: 8px;
}

.hydrotech-chatbot-btn-secondary,
.hydrotech-chatbot-btn-ghost {
    width: 100%;

    min-height: 40px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 10px;

    font-family: inherit;

    font-size: 11px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.hydrotech-chatbot-btn-secondary {
    border:
        1px solid
        rgba(11, 79, 113, 0.18);

    background:
        var(--hydrotech-accent-light);

    color:
        var(--hydrotech-primary);
}

.hydrotech-chatbot-btn-ghost {
    border:
        1px solid
        var(--hydrotech-border);

    background:
        #ffffff;

    color:
        var(--hydrotech-muted);
}

.hydrotech-chatbot-btn-secondary:hover,
.hydrotech-chatbot-btn-ghost:hover {
    background:
        #f1f6f8;

    transform:
        translateY(-1px);
}


/* =========================================================
   29. PERSISTENT FOOTER
========================================================= */

.hydrotech-chatbot-footer {
    position: relative;

    z-index: 10;

    flex: 0 0 auto;

    width: 100%;

    padding:
        10px
        12px
        12px;

    background:
        #ffffff;

    border-top:
        1px solid
        var(--hydrotech-border);

    box-shadow:
        0 -4px 14px
        rgba(10, 38, 52, 0.04);
}


/* =========================================================
   30. CHAT INPUT ROW
========================================================= */

.hydrotech-chatbot-inputrow {
    width: 100%;

    display: flex;

    align-items: center;

    gap: 7px;
}

.hydrotech-chatbot-input--chat {
    min-width: 0;

    flex: 1 1 auto;

    width: 100%;

    height: 43px;

    padding:
        0 13px;

    border:
        1px solid
        var(--hydrotech-border);

    border-radius: 12px;

    outline: none;

    background:
        #f9fbfc;

    color:
        var(--hydrotech-text);

    font-family: inherit;

    font-size: 12px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.hydrotech-chatbot-input--chat::placeholder {
    color:
        var(--hydrotech-placeholder);
}

.hydrotech-chatbot-input--chat:focus {
    border-color:
        var(--hydrotech-accent);

    background:
        #ffffff;

    box-shadow:
        0 0 0 3px
        rgba(15, 120, 159, 0.10);
}


/* =========================================================
   31. SEND BUTTON
========================================================= */

.hydrotech-chatbot-send {
    width: 43px;
    height: 43px;

    flex: 0 0 43px;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            var(--hydrotech-primary),
            var(--hydrotech-accent)
        );

    color: #ffffff;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.hydrotech-chatbot-send:hover {
    transform:
        translateY(-1px);

    box-shadow:
        0 5px 14px
        rgba(11, 79, 113, 0.20);
}

.hydrotech-chatbot-send:active {
    transform:
        translateY(0);
}


/* =========================================================
   32. FOOTER CTA
========================================================= */

.hydrotech-chatbot-footer-cta {
    width: 100%;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        82px;

    gap: 8px;

    margin-top: 8px;
}

.hydrotech-chatbot-quote,
.hydrotech-chatbot-call {
    min-width: 0;

    min-height: 39px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 6px;

    border-radius: 10px;

    font-family: inherit;

    font-size: 11.5px;

    line-height: 1.2;

    font-weight: 700;

    text-decoration: none;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


/* Quote */

.hydrotech-chatbot-quote {
    border: 0;

    background:
        linear-gradient(
            135deg,
            var(--hydrotech-primary),
            var(--hydrotech-accent)
        );

    color:
        #ffffff;
}

.hydrotech-chatbot-quote:hover {
    transform:
        translateY(-1px);

    box-shadow:
        0 5px 14px
        rgba(11, 79, 113, 0.20);
}


/* Call */

.hydrotech-chatbot-call {
    border:
        1px solid
        rgba(22, 133, 91, 0.20);

    background:
        #f0faf6;

    color:
        var(--hydrotech-success);
}

.hydrotech-chatbot-call:hover {
    background:
        #e5f7ef;

    transform:
        translateY(-1px);
}


/* =========================================================
   33. SCREEN READER ONLY
========================================================= */

.hydrotech-chatbot-sr {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    padding: 0 !important;
    margin: -1px !important;

    overflow: hidden !important;

    clip:
        rect(0, 0, 0, 0) !important;

    white-space: nowrap !important;

    border: 0 !important;
}


/* =========================================================
   34. GLOBAL FOCUS
========================================================= */

.hydrotech-chatbot
button:focus-visible,
.hydrotech-chatbot
input:focus-visible,
.hydrotech-chatbot
select:focus-visible,
.hydrotech-chatbot
textarea:focus-visible,
.hydrotech-chatbot
a:focus-visible {
    outline:
        2px solid
        var(--hydrotech-accent);

    outline-offset: 2px;
}


/* =========================================================
   35. TABLET
========================================================= */

@media (max-width: 767px) {

    .hydrotech-chatbot-toggle {
        width: 44px;
        height: 128px;

        border-radius:
            15px 0 0 15px;
    }

    .hydrotech-chatbot-toggle:hover {
        width: 48px;
    }

    .hydrotech-chatbot-toggle-icon {
        font-size: 19px;

        transform:
            translateY(-15px);
    }

    .hydrotech-chatbot-toggle::after {
        bottom: 15px;

        font-size: 8px;
    }


    /* Chat */

    .hydrotech-chatbot-window {
        right: 10px;
        bottom: 10px;

        width:
            calc(100vw - 20px);

        height:
            min(
                680px,
                calc(100dvh - 20px)
            );

        max-height:
            calc(100dvh - 20px);

        min-height: 440px;

        border-radius: 17px;
    }


    /* Header */

    .hydrotech-chatbot-header {
        min-height: 70px;

        padding:
            10px 11px;
    }

    .hydrotech-chatbot-logo {
        width: 44px;
        height: 44px;

        flex-basis: 44px;
    }

    .hydrotech-chatbot-heading h2 {
        font-size: 14px;
    }

    .hydrotech-chatbot-heading span {
        font-size: 9.5px;
    }

    .hydrotech-chatbot-close {
        width: 34px;
        height: 34px;

        flex-basis: 34px;
    }


    /* Conversation */

    .hydrotech-chatbot-conversation {
        padding:
            15px
            12px
            18px;
    }

    .hydrotech-chatbot-bubble {
        max-width: 91%;

        font-size: 12px;

        line-height: 1.6;
    }


    /* Actions */

    .hydrotech-chatbot-actions {
        gap: 7px;
    }

    .hydrotech-chatbot-action {
        min-height: 35px;

        padding:
            7px
            10px;

        font-size: 10.5px;
    }


    /* Footer */

    .hydrotech-chatbot-footer {
        padding:
            8px
            9px
            10px;
    }

    .hydrotech-chatbot-input--chat {
        height: 41px;

        font-size: 11.5px;
    }

    .hydrotech-chatbot-send {
        width: 41px;
        height: 41px;

        flex-basis: 41px;
    }

    .hydrotech-chatbot-footer-cta {
        grid-template-columns:
            minmax(0, 1fr)
            72px;
    }

    .hydrotech-chatbot-quote,
    .hydrotech-chatbot-call {
        min-height: 37px;

        font-size: 10.5px;
    }


    /* Form */

    .hydrotech-chatbot-form-wrap {
        padding:
            13px
            12px
            20px;
    }
}


/* =========================================================
   36. MOBILE
========================================================= */

@media (max-width: 480px) {

    .hydrotech-chatbot-toggle {
        width: 40px;
        height: 116px;

        border-radius:
            13px 0 0 13px;
    }

    .hydrotech-chatbot-toggle:hover {
        width: 43px;
    }


    /* Full mobile window */

    .hydrotech-chatbot-window {
        top: 7px;
        right: 7px;
        bottom: 7px;
        left: 7px;

        width: auto;
        height: auto;

        max-height: none;

        min-height: 0;

        border-radius: 14px;
    }


    /* Header */

    .hydrotech-chatbot-header {
        min-height: 66px;

        padding:
            9px
            10px;
    }

    .hydrotech-chatbot-logo {
        width: 41px;
        height: 41px;

        flex-basis: 41px;

        border-radius: 10px;
    }

    .hydrotech-chatbot-logo img {
        padding: 4px;
    }

    .hydrotech-chatbot-heading h2 {
        font-size: 13px;
    }

    .hydrotech-chatbot-heading span {
        font-size: 9px;
    }

    .hydrotech-chatbot-close {
        width: 32px;
        height: 32px;

        flex-basis: 32px;

        border-radius: 9px;
    }


    /* Conversation */

    .hydrotech-chatbot-conversation {
        padding:
            13px
            10px
            16px;
    }

    .hydrotech-chatbot-message {
        margin-bottom: 10px;
    }

    .hydrotech-chatbot-bubble {
        max-width: 94%;

        padding:
            9px
            11px;

        font-size: 11.5px;

        line-height: 1.58;

        border-radius: 13px;
    }


    /* Actions */

    .hydrotech-chatbot-actions {
        gap: 6px;

        margin-bottom: 12px;
    }

    .hydrotech-chatbot-action {
        min-height: 34px;

        padding:
            7px
            9px;

        border-radius: 9px;

        font-size: 10px;
    }


    /* Footer */

    .hydrotech-chatbot-footer {
        padding:
            7px
            8px
            calc(
                9px + env(safe-area-inset-bottom)
            );
    }

    .hydrotech-chatbot-input--chat {
        height: 39px;

        padding:
            0
            10px;

        border-radius: 10px;

        font-size: 11px;
    }

    .hydrotech-chatbot-send {
        width: 39px;
        height: 39px;

        flex-basis: 39px;

        border-radius: 10px;
    }

    .hydrotech-chatbot-footer-cta {
        grid-template-columns:
            minmax(0, 1fr)
            66px;

        gap: 6px;

        margin-top: 6px;
    }

    .hydrotech-chatbot-quote,
    .hydrotech-chatbot-call {
        min-height: 35px;

        border-radius: 9px;

        font-size: 10px;
    }


    /* Form */

    .hydrotech-chatbot-form-wrap {
        padding:
            11px
            10px
            18px;
    }

    .hydrotech-chatbot-form-title {
        font-size: 17px;
    }

    .hydrotech-chatbot-form-note {
        font-size: 10px;

        line-height: 1.55;
    }

    .hydrotech-chatbot-label {
        font-size: 10px;
    }

    .hydrotech-chatbot-form
    .hydrotech-chatbot-input,
    .hydrotech-chatbot-select {
        height: 39px;

        padding:
            0
            10px;

        font-size: 11px;

        border-radius: 8px;
    }

    .hydrotech-chatbot-textarea {
        min-height: 70px;

        padding:
            8px
            10px;

        font-size: 11px;

        border-radius: 8px;
    }

    .hydrotech-chatbot-field {
        margin-bottom: 10px;
    }

    .hydrotech-chatbot-submit {
        min-height: 41px;

        font-size: 11px;

        border-radius: 9px;
    }


    /* Success */

    .hydrotech-chatbot-success {
        padding-top: 16px;
    }

    .hydrotech-chatbot-success-icon {
        width: 54px;
        height: 54px;

        font-size: 22px;
    }

    .hydrotech-chatbot-success-title {
        font-size: 15px;
    }

    .hydrotech-chatbot-success-text {
        font-size: 10.5px;
    }

    .hydrotech-chatbot-success-phone {
        font-size: 14px;
    }
}


/* =========================================================
   37. VERY SMALL DEVICES
========================================================= */

@media (max-width: 360px) {

    .hydrotech-chatbot-toggle {
        width: 38px;
        height: 108px;

        border-radius:
            12px 0 0 12px;
    }

    .hydrotech-chatbot-toggle:hover {
        width: 41px;
    }

    .hydrotech-chatbot-toggle-icon {
        font-size: 17px;
    }

    .hydrotech-chatbot-toggle::after {
        bottom: 13px;

        font-size: 7px;

        letter-spacing: 1.5px;
    }


    .hydrotech-chatbot-window {
        top: 4px;
        right: 4px;
        bottom: 4px;
        left: 4px;

        border-radius: 12px;
    }


    .hydrotech-chatbot-header {
        min-height: 61px;

        padding: 8px;
    }

    .hydrotech-chatbot-logo {
        width: 37px;
        height: 37px;

        flex-basis: 37px;
    }

    .hydrotech-chatbot-heading h2 {
        font-size: 12px;
    }

    .hydrotech-chatbot-heading span {
        font-size: 8px;
    }

    .hydrotech-chatbot-close {
        width: 30px;
        height: 30px;

        flex-basis: 30px;
    }


    .hydrotech-chatbot-bubble {
        font-size: 11px;
    }


    .hydrotech-chatbot-action {
        width: 100%;

        justify-content: center;
    }


    .hydrotech-chatbot-footer-cta {
        grid-template-columns:
            minmax(0, 1fr)
            60px;
    }
}


/* =========================================================
   38. LANDSCAPE MOBILE
========================================================= */

@media
(max-height: 600px)
and
(max-width: 900px) {

    .hydrotech-chatbot-window {
        top: 4px;
        right: 6px;
        bottom: 4px;
        left: 6px;

        height: auto;

        max-height: none;
    }


    .hydrotech-chatbot-header {
        min-height: 57px;

        padding:
            7px
            9px;
    }

    .hydrotech-chatbot-logo {
        width: 37px;
        height: 37px;

        flex-basis: 37px;
    }


    .hydrotech-chatbot-conversation {
        padding-top: 9px;
        padding-bottom: 9px;
    }


    .hydrotech-chatbot-footer {
        padding-top: 6px;
        padding-bottom: 7px;
    }


    .hydrotech-chatbot-footer-cta {
        margin-top: 5px;
    }


    .hydrotech-chatbot-action {
        min-height: 31px;

        padding-top: 5px;
        padding-bottom: 5px;
    }
}


/* =========================================================
   39. LARGE DESKTOP
========================================================= */

@media (min-width: 1400px) {

    .hydrotech-chatbot-window {
        width: 430px;
        height: 710px;

        right: 25px;
        bottom: 25px;
    }


    .hydrotech-chatbot-toggle {
        width: 52px;
        padding: 60px 20px;
    }
}


/* =========================================================
   40. EXTRA LARGE DESKTOP
========================================================= */

@media (min-width: 1800px) {

    .hydrotech-chatbot-window {
        width: 440px;
        height: 720px;

        right: 30px;
        bottom: 30px;
    }
}


/* =========================================================
   41. REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .hydrotech-chatbot *,
    .hydrotech-chatbot *::before,
    .hydrotech-chatbot *::after {

        scroll-behavior: auto !important;

        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;

        transition-duration:
            0.01ms !important;
    }
}


/* =========================================================
   42. PRINT
========================================================= */

@media print {

    .hydrotech-chatbot {
        display: none !important;
    }
}





/* =========================================================
   HYDROTECH CHATBOT — RESPONSIVE MOBILE FIX
   Append this AFTER your existing CSS
========================================================= */

/* 1. Prevent widget overflow and sizing conflicts */
.hydrotech-chatbot,
.hydrotech-chatbot *,
.hydrotech-chatbot *::before,
.hydrotech-chatbot *::after {
    box-sizing: border-box;
}

.hydrotech-chatbot {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    z-index: 999999;
    overflow: visible;
    pointer-events: none;
}

.hydrotech-chatbot [hidden],
.hydrotech-chatbot-window[hidden] {
    display: none !important;
}

/* 2. Right-side launcher — consistent icon placement */
.hydrotech-chatbot-toggle {
    position: fixed;
    top: 80%;
    right: 0;
    left: auto;

    width: 48px;
    height: 142px;
    min-height: 142px;

    margin: 0;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 14px 0 0 14px;

    transform: translateY(-50%);
    transform-origin: center;

    pointer-events: auto;
    overflow: hidden;
}

.hydrotech-chatbot-toggle:hover {
    width: 48px;
}

.hydrotech-chatbot-toggle:active {
    transform: translateY(-50%);
}

.hydrotech-chatbot-toggle-icon {
    position: absolute;
    top: 15px;
    left: 50%;

    display: block;
    margin: 0;

    font-size: 21px;
    line-height: 1;

    transform: translateX(-50%);
}

.hydrotech-chatbot-toggle::after {
    content: "CHAT";

    position: absolute;
    top: 50%;
    left: 50%;
    bottom: auto;

    margin: 0;
    padding: 0;

    font-size: 11px;
    line-height: 1;
    letter-spacing: 2px;
    white-space: nowrap;

    transform: translate(-50%, -50%) rotate(-90deg);
}

/* 3. Desktop chat window */
.hydrotech-chatbot-window {
    position: fixed;

    top: auto;
    right: 20px;
    bottom: 20px;
    left: auto;

    width: min(420px, calc(100vw - 40px));
    height: min(700px, calc(100dvh - 40px));

    min-width: 0;
    min-height: 0;
    max-width: calc(100vw - 40px);
    max-height: calc(100dvh - 40px);

    display: flex;
    flex-direction: column;

    overflow: hidden;
    overscroll-behavior: contain;

    border-radius: 20px;
    pointer-events: auto;
}

.hydrotech-chatbot-window[hidden] {
    display: none !important;
}

/* 4. Header must not shrink */
.hydrotech-chatbot-header {
    flex: 0 0 auto;
    min-width: 0;
    min-height: 70px;
    overflow: hidden;
}

.hydrotech-chatbot-logo {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
}

.hydrotech-chatbot-heading {
    min-width: 0;
    overflow: hidden;
}

.hydrotech-chatbot-close {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
}

/* 5. Body fills only the remaining window height */
.hydrotech-chatbot-body {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    height: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}

/* 6. Conversation scrolls independently */
.hydrotech-chatbot-conversation {
    flex: 1 1 0;

    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 0;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Avoid long URLs and words pushing the layout wider */
.hydrotech-chatbot-bubble {
    min-width: 0;
    max-width: 90%;
    overflow-wrap: anywhere;
    word-break: normal;
}

.hydrotech-chatbot-bubble img,
.hydrotech-chatbot-bubble video,
.hydrotech-chatbot-bubble iframe {
    max-width: 100%;
}

.hydrotech-chatbot-actions {
    min-width: 0;
    max-width: 100%;
}

.hydrotech-chatbot-action {
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* 7. Footer remains visible at the bottom */
.hydrotech-chatbot-footer {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;

    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.hydrotech-chatbot-inputrow {
    min-width: 0;
}

.hydrotech-chatbot-input--chat {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
}

.hydrotech-chatbot-send {
    flex: 0 0 43px;
}

/* 8. Form view gets its own scrolling area */
.hydrotech-chatbot-form-wrap {
    flex: 1 1 0;

    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 0;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

.hydrotech-chatbot-form,
.hydrotech-chatbot-field {
    min-width: 0;
    max-width: 100%;
}

.hydrotech-chatbot-form input,
.hydrotech-chatbot-form select,
.hydrotech-chatbot-form textarea,
.hydrotech-chatbot-select,
.hydrotech-chatbot-textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

/* 9. Tablet and mobile */
@media (max-width: 767px) {
    .hydrotech-chatbot-toggle {
        width: 44px;
        height: 120px;
        min-height: 120px;
        border-radius: 13px 0 0 13px;
    }

    .hydrotech-chatbot-toggle:hover {
        width: 44px;
    }

    .hydrotech-chatbot-toggle-icon {
        top: 13px;
        font-size: 19px;
    }

    .hydrotech-chatbot-toggle::after {
        font-size: 10px;
    }

    .hydrotech-chatbot-window {
        top: 10px;
        right: 10px;
        bottom: 10px;
        left: 10px;

        width: auto;
        height: auto;

        min-width: 0;
        min-height: 0;

        max-width: none;
        max-height: none;

        border-radius: 16px;
    }

    .hydrotech-chatbot-header {
        min-height: 66px;
        padding: 9px 11px;
        gap: 9px;

        border-radius: 15px 15px 0 0;
    }

    .hydrotech-chatbot-logo {
        flex-basis: 41px;
        width: 41px;
        height: 41px;
    }

    .hydrotech-chatbot-heading h2 {
        font-size: 14px;
    }

    .hydrotech-chatbot-heading span {
        font-size: 10px;
    }

    .hydrotech-chatbot-close {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }

    .hydrotech-chatbot-conversation {
        padding: 13px 11px 16px;
    }

    .hydrotech-chatbot-bubble {
        max-width: 92%;
        padding: 10px 11px;
        font-size: 12px;
        line-height: 1.6;
    }

    .hydrotech-chatbot-footer {
        padding: 8px 9px;
        padding-bottom: calc(9px + env(safe-area-inset-bottom, 0px));
    }

    .hydrotech-chatbot-input--chat {
        height: 42px;
        font-size: 16px;
    }

    .hydrotech-chatbot-send {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
    }

    .hydrotech-chatbot-footer-cta {
        grid-template-columns: minmax(0, 1fr) minmax(65px, 82px);
        gap: 7px;
    }

    .hydrotech-chatbot-quote,
    .hydrotech-chatbot-call {
        min-width: 0;
        padding: 7px 5px;
        font-size: 11px;
    }

    .hydrotech-chatbot-form-wrap {
        padding: 13px 12px 18px;
    }
}

/* 10. Small mobile phones */
@media (max-width: 480px) {
    .hydrotech-chatbot-window {
        top: 5px;
        right: 5px;
        bottom: 5px;
        left: 5px;

        border-radius: 13px;
    }

    .hydrotech-chatbot-header {
        min-height: 62px;
        padding: 8px 9px;
        gap: 8px;
    }

    .hydrotech-chatbot-logo {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
        border-radius: 9px;
    }

    .hydrotech-chatbot-heading h2 {
        font-size: 13px;
    }

    .hydrotech-chatbot-heading span {
        font-size: 9px;
    }

    .hydrotech-chatbot-close {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
    }

    .hydrotech-chatbot-conversation {
        padding: 11px 9px 14px;
    }

    .hydrotech-chatbot-message {
        margin-bottom: 9px;
    }

    .hydrotech-chatbot-bubble {
        max-width: 94%;
        padding: 9px 10px;
        font-size: 12px;
    }

    .hydrotech-chatbot-actions {
        gap: 6px;
    }

    .hydrotech-chatbot-action {
        min-height: 36px;
        padding: 8px 9px;
        font-size: 11px;
    }

    .hydrotech-chatbot-footer {
        padding: 7px 8px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }

    .hydrotech-chatbot-input--chat {
        height: 40px;
        padding: 0 10px;
    }

    .hydrotech-chatbot-send {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
    }

    .hydrotech-chatbot-footer-cta {
        grid-template-columns: minmax(0, 1fr) 68px;
        gap: 6px;
        margin-top: 6px;
    }

    .hydrotech-chatbot-quote,
    .hydrotech-chatbot-call {
        min-height: 36px;
        font-size: 10px;
    }

    .hydrotech-chatbot-form-wrap {
        padding: 11px 10px 16px;
    }

    .hydrotech-chatbot-form-title {
        font-size: 17px;
    }

    .hydrotech-chatbot-label {
        font-size: 11px;
    }

    .hydrotech-chatbot-form .hydrotech-chatbot-input,
    .hydrotech-chatbot-select {
        height: 42px;
        font-size: 16px;
    }

    .hydrotech-chatbot-textarea {
        min-height: 76px;
        font-size: 16px;
    }

    .hydrotech-chatbot-submit {
        min-height: 44px;
        font-size: 12px;
    }

    .hydrotech-chatbot-turnstile {
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .hydrotech-chatbot-success {
        padding: 16px 4px 10px;
    }
}

/* 11. Very narrow phones */
@media (max-width: 360px) {
    .hydrotech-chatbot-toggle {
        width: 38px;
        height: 108px;
        min-height: 108px;
    }

    .hydrotech-chatbot-toggle:hover {
        width: 38px;
    }

    .hydrotech-chatbot-window {
        top: 3px;
        right: 3px;
        bottom: 3px;
        left: 3px;
    }

    .hydrotech-chatbot-header {
        gap: 6px;
        padding: 7px;
    }

    .hydrotech-chatbot-logo {
        flex-basis: 35px;
        width: 35px;
        height: 35px;
    }

    .hydrotech-chatbot-heading h2 {
        font-size: 12px;
    }

    .hydrotech-chatbot-heading span {
        font-size: 8px;
    }

    .hydrotech-chatbot-footer-cta {
        grid-template-columns: minmax(0, 1fr) 62px;
        gap: 5px;
    }

    .hydrotech-chatbot-quote,
    .hydrotech-chatbot-call {
        font-size: 9px;
    }

    .hydrotech-chatbot-action {
        max-width: 100%;
        white-space: normal;
    }
}

/* 12. Short screens and landscape mobile */
@media (max-height: 600px) and (max-width: 900px) {
    .hydrotech-chatbot-window {
        top: 3px;
        right: 5px;
        bottom: 3px;
        left: 5px;

        width: auto;
        height: auto;
        min-height: 0;
        max-height: none;
    }

    .hydrotech-chatbot-header {
        min-height: 52px;
        padding: 5px 8px;
    }

    .hydrotech-chatbot-logo {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }

    .hydrotech-chatbot-conversation {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .hydrotech-chatbot-footer {
        padding-top: 5px;
        padding-bottom: calc(5px + env(safe-area-inset-bottom, 0px));
    }

    .hydrotech-chatbot-footer-cta {
        margin-top: 5px;
    }

    .hydrotech-chatbot-form-wrap {
        padding-top: 8px;
        padding-bottom: 10px;
    }

    .hydrotech-chatbot-field {
        margin-bottom: 8px;
    }
    
    
   
}

/* 13. Reduced-motion accessibility */
@media (prefers-reduced-motion: reduce) {
    .hydrotech-chatbot *,
    .hydrotech-chatbot *::before,
    .hydrotech-chatbot *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
     
}

/* 14. Hide widget when printing */
@media print {
    .hydrotech-chatbot {
        display: none !important;
    }
}

/* =========================================================
   HYDROTECH CHATBOT — FINAL MOBILE POSITION FIX
   Add after all existing chatbot CSS
========================================================= */

/* Keep the widget independent of the website layout */
.hydrotech-chatbot {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 999999 !important;
    pointer-events: none;
}

/* Keep the chat window hidden until opened */
.hydrotech-chatbot .hydrotech-chatbot-window[hidden] {
    display: none !important;
}

/* Desktop and tablet default */
.hydrotech-chatbot .hydrotech-chatbot-window {
    position: fixed;
    top: auto;
    right: 20px;
    bottom: 20px;
    left: auto;

    width: min(420px, calc(100vw - 40px));
    height: min(700px, calc(100dvh - 40px));

    min-width: 0;
    min-height: 0;
    max-width: calc(100vw - 40px);
    max-height: calc(100dvh - 40px);

    display: flex;
    flex-direction: column;
    overflow: hidden;

    pointer-events: auto;
}

/* Mobile: anchor the chat to all four screen edges */
@media screen and (max-width: 767px) {
    .hydrotech-chatbot .hydrotech-chatbot-window {
        position: fixed !important;

        top: 8px !important;
        right: 8px !important;
        bottom: 8px !important;
        left: 8px !important;

        width: auto !important;
        height: auto !important;

        min-width: 0 !important;
        min-height: 0 !important;

        max-width: none !important;
        max-height: none !important;

        margin: 0 !important;

        display: flex;
        flex-direction: column;

        overflow: hidden;
        border-radius: 14px;

        box-sizing: border-box;
    }

    /* Keep the header visible */
    .hydrotech-chatbot .hydrotech-chatbot-header {
        flex: 0 0 auto;
    }

    /* Let the chat body use the available space */
    .hydrotech-chatbot .hydrotech-chatbot-body {
        flex: 1 1 0;
        height: 0;
        min-height: 0;
        overflow: hidden;
    }

    /* Scroll messages inside the window */
    .hydrotech-chatbot .hydrotech-chatbot-conversation {
        flex: 1 1 0;
        height: 0;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Keep the bottom controls visible */
    .hydrotech-chatbot .hydrotech-chatbot-footer {
        flex: 0 0 auto;
        padding-bottom: calc(
            9px + env(safe-area-inset-bottom, 0px)
        );
    }

    /* Allow the enquiry form to scroll independently */
    .hydrotech-chatbot .hydrotech-chatbot-form-wrap {
        flex: 1 1 0;
        height: 0;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Very small phones */
@media screen and (max-width: 360px) {
    .hydrotech-chatbot .hydrotech-chatbot-window {
        top: 4px !important;
        right: 4px !important;
        bottom: 4px !important;
        left: 4px !important;
    }
}

/* Short screens and landscape phones */
@media screen and (max-height: 600px) and (max-width: 900px) {
    .hydrotech-chatbot .hydrotech-chatbot-window {
        top: 4px !important;
        right: 5px !important;
        bottom: 4px !important;
        left: 5px !important;
    }
}



/* HYDROTECH: MOBILE CHAT BESIDE THE CHAT BUTTON */
@media screen and (max-width: 767px) {

    .hydrotech-chatbot .hydrotech-chatbot-toggle {
        position: fixed !important;
        top: 50% !important;
        right: 0 !important;
        bottom: auto !important;
        left: auto !important;
        transform: translateY(-50%) !important;
        z-index: 1000002 !important;
    }

    .hydrotech-chatbot .hydrotech-chatbot-window:not([hidden]) {
        position: fixed !important;

        top: 50% !important;
        right: 46px !important;
        bottom: auto !important;
        left: auto !important;

        width: min(300px, calc(100vw - 54px)) !important;
        height: min(500px, calc(100dvh - 30px)) !important;

        min-width: 0 !important;
        min-height: 0 !important;
        max-width: none !important;
        max-height: calc(100dvh - 30px) !important;

        margin: 0 !important;
        transform: translateY(-50%) !important;
        border-radius: 14px !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
        z-index: 1000001 !important;
    }

    .hydrotech-chatbot .hydrotech-chatbot-window[hidden] {
        display: none !important;
    }
}

@media screen and (max-width: 360px) {
    .hydrotech-chatbot .hydrotech-chatbot-window:not([hidden]) {
        right: 42px !important;
        width: calc(100vw - 50px) !important;
    }
}

/* =========================================================
   END HYDROTECH ENGINEERS CHATBOT CSS
========================================================= */