/* =========================================
   1. VISIBILITY & LAYOUT FIXES
   ========================================= */
/* Force Webflow hidden elements to be visible */

.home-hero-left, 
.home-hero-right, 
.split-content, 
.image-wrapper, 
h1, h2, h3, p {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
}

/* Force Accordions closed by default */
.brix---acordion-body {
  display: none;
}

/* Ensure accordion wrappers don't animate from Webflow */
.brix---accordion-item-wrapper {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

/* =========================================
   2. HERO SECTION & GENERAL TYPOGRAPHY
   ========================================= */

.home-hero-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.home-hero-left {
  max-width: 560px;
}

.home-hero-right {
  max-width: 460px;
}

.subtitle {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 13px;
}

.title.home-hero {
  font-size: 42px;
  line-height: 1.15;
  margin-top: 12px;
  margin-bottom: 20px;
}

.paragraph.home-hero {
  font-size: 18px;
  line-height: 1.6;
}

/* =========================================
   3. ATLAS SECTION / HERO LOGO
   ========================================= */

.section.home-features img.image-3 {
  display: block;
  max-width: 260px;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

/* Atlas hero section layout */
.atlas-section {
  padding: 40px 0 48px;
}

.atlas-row {
  align-items: center;
}

/* Logo sizing on desktop/tablet */
.atlas-section .image-3 {
  display: block;
  max-width: 260px;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

/* Spacer column placeholder (no desktop overrides needed yet) */
.atlas-spacer {}

/* Fade-in animation */
.atlas-fade-left,
.atlas-fade-right {
  opacity: 0;
}

.atlas-fade-left {
  animation: atlas-fade-up 0.7s ease-out 0.1s forwards;
}

.atlas-fade-right {
  animation: atlas-fade-up 0.7s ease-out 0.25s forwards;
}

@keyframes atlas-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .atlas-fade-left,
  .atlas-fade-right {
    animation: none;
    opacity: 1;
  }
}

/* =========================================
   4. CONDITIONS ACCORDION + PILLS
   ========================================= */

/* Accordion wrapper styling */
.brix---accordion-item-wrapper {
  border-radius: 24px;
  padding: 20px 24px;
  background-color: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  display: flex !important;
  align-items: flex-start !important;
  margin-bottom: 18px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* Hover effect */
.brix---accordion-item-wrapper:hover {
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

/* Circle button wrapper */
.brix---accordion-side {
  margin-right: 16px;
  margin-top: 4px !important;
  flex-shrink: 0;
}

/* Accordion title text */
.brix---accordion-title {
  font-size: 20px;
  line-height: 1.4;
}

/* Condition pills base */
.condition-pill,
.procedure-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 12px 24px;
  border: 1px solid #e2e8f0; /* The ONLY border */
  background-color: #f8fafc;
  color: #334155;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.4;
}

/* 2. Remove "Pill inside a Pill" Ghost Borders */
.condition-pill *, 
.procedure-pill * {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

/* Condition/procedure pill hover effect */
.condition-pill:hover,
.procedure-pill:hover {
  border-color: #0f766e;
  background-color: #ffffff;
  color: #0f766e;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.1);
  transform: translateY(-1px);
}

/* Pill text */
.text-block-5 {
  font-size: 16px;
  line-height: 1.4;
}

/* =========================================
   5. ATLAS FLOATING WIDGET (BOTTOM-RIGHT ICON)
   ========================================= */

#atlasWidget {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 9998;
}

/* Reset the button/link and make it a circle */
#atlasWidget button,
#atlasWidget a {
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
}

/* Circular chat bubble */
#atlasWidget .chat-bubble {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 9999px;
    background: radial-gradient(circle at 30% 30%, #4f46e5, #0ea5e9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.45);
    transition: transform 0.2s, box-shadow 0.2s;
}

#atlasWidget .chat-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.55);
}

/* Atlas logo inside the bubble */
#atlasWidget .atlas-logo-icon {
    width: 1.8rem;
    height: 1.8rem;
    display: block;
    object-fit: contain;
}

/* Small red "AI" pill badge */
#atlasWidget .atlas-ai-pill {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    transform: translate(25%, -25%);
    background: #ef4444;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    line-height: 1;
}

/* Gentle floating animation */
.float-animation {
    animation: atlas-float 3s ease-in-out infinite;
}

@keyframes atlas-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* =========================================
   6. CHAT WINDOW STYLING (REVISED)
   ========================================= */

#aiChatModal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 20px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#aiChatModal.open {
    display: flex !important; /* Forces the box to show even if JS hid it*/
}

/* Inner Layout Panel */
.atlas-chat-panel {
    position: relative;
    width: 450px;
    max-height: 850px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 10001;
    overflow: hidden;
    animation: slideUpPublic 0.3s ease-out;
}

@keyframes slideUpPublic {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- Compact Header --- */
.atlas-header {
    background: #003b3f; /* Darker Brand Teal */
    color: #ffffff;
    padding: 8px 12px; /* Slimmer padding */
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.atlas-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.atlas-header-icon {
    width: 28px; /* Smaller icon container */
    height: 28px;
    background: #ffffff;
    border-radius: 50%;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.atlas-header-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.atlas-header-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
}

.atlas-header-title {
    font-weight: 600;
    font-size: 14px; /* Smaller title */
    margin: 0;
}

.atlas-header-subtitle {
    font-size: 11px;
    opacity: 0.8;
    margin: 0;
    font-weight: 400;
}

/* Close Button */
.atlas-close-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}
.atlas-close-btn:hover { color: #ffffff; }

/* --- Scrollable Message Area --- */
#chatMessages {
    flex: 1; /* Takes all available remaining height */
    overflow-y: auto; /* Enables scroll */
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Input Area pinned to bottom */
.atlas-input-row textarea {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.4;
    padding: 10px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0; /* Prevents it from shrinking */
}

/* =========================================
   7. CHAT MESSAGE BUBBLES & FORMATTING
   ========================================= */

.atlas-message {
    display: flex;
    width: 100%;
    margin-bottom: 4px;
}

.atlas-message-user { justify-content: flex-end; }
.atlas-message-ai { justify-content: flex-start; }

.atlas-bubble {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.atlas-bubble-user {
    background-color: #0f766e;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.atlas-bubble-ai {
    background-color: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* --- Formatting Restoration --- */
.atlas-bubble strong { font-weight: 700; color: inherit; }
.atlas-bubble ul, .atlas-bubble ol { 
    margin: 4px 0 4px 20px; 
    padding: 0; 
    list-style-position: outside;
}
.atlas-bubble li { margin-bottom: 4px; }
.atlas-bubble p { margin: 0 0 8px 0; }
.atlas-bubble p:last-child { margin-bottom: 0; }
.atlas-link { color: #0f766e; text-decoration: underline; }

/* New Message Structure (matching patient chat) */
.atlas-msg {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.atlas-msg-ai {
    flex-direction: row;
}

.atlas-msg-user {
    flex-direction: row-reverse;
}

.atlas-msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.atlas-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.atlas-msg-avatar i {
    color: white;
    font-size: 1rem;
}

.atlas-msg-user .atlas-msg-avatar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.atlas-msg-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.atlas-msg-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    font-family: 'DM Sans', sans-serif;
}

.atlas-msg-text {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1e293b;
    font-family: 'DM Sans', sans-serif;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.atlas-msg-text .atlas-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #3b82f6;
    transition: all 0.2s ease;
}

.atlas-msg-text .atlas-link:hover {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
    background-color: rgba(59, 130, 246, 0.05);
}

.atlas-msg-user .atlas-msg-text {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.atlas-msg-user .atlas-msg-text .atlas-link {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.atlas-msg-user .atlas-msg-text .atlas-link:hover {
    border-bottom-color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.atlas-msg-time {
    font-size: 0.75rem;
    color: #94a3b8;
    padding: 0 4px;
}

/* Typing Indicator */
.atlas-typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.atlas-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    animation: typingBounce 1.4s infinite;
}

.atlas-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.atlas-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

/* Feedback Icons */
.atlas-feedback {
    margin-top: 4px;
    padding-left: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: #94a3b8;
}
.atlas-feedback-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s;
    font-size: 14px; /* Ensure icons are big enough to tap */
}
.atlas-feedback-btn:hover, .atlas-feedback-active {
    color: #0f766e;
    transform: scale(1.1);
}

/* =========================================
   FEEDBACK ICONS LOCKING
   ========================================= */

/* When feedback is submitted, reduce opacity of ALL buttons */
.atlas-feedback[data-submitted="true"] .atlas-feedback-btn {
    opacity: 0.3;
    pointer-events: none; /* Disable clicks */
    cursor: default;
}

/* But keep the SELECTED button fully visible */
.atlas-feedback[data-submitted="true"] .atlas-feedback-btn.atlas-feedback-active {
    opacity: 1;
    color: #0f766e; /* Brand color */
}

/* Ensure no hover effects happen after submission */
.atlas-feedback[data-submitted="true"] .atlas-feedback-btn:hover {
    transform: none;
    color: inherit;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    .atlas-chat-panel {
        width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
    }
}

/* =========================================
   8. ACCORDION ICON (+ → X) OVERRIDE
   ========================================= */

/* Hide the original icon lines & any img */
.brix---btn-circle-accordion-btn img,
.brix---btn-circle-accordion-btn .brix---accordion-btn-vertical-line,
.brix---btn-circle-accordion-btn .brix---accordion-btn-horizontal-line {
  display: none;
}

/* Draw our own "+" sign */
.brix---btn-circle-accordion-btn {
  position: relative;
}

/* Horizontal bar */
.brix---btn-circle-accordion-btn::before,
.brix---btn-circle-accordion-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  background-color: #0c2d2c; /* match your site’s dark green text */
  transform-origin: center;
  transition: transform 0.25s ease;
}

/* One bar horizontal */
.brix---btn-circle-accordion-btn::before {
  transform: translate(-50%, -50%) rotate(0deg);
}

/* One bar vertical → this makes it a "+" */
.brix---btn-circle-accordion-btn::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

/* When accordion is open → turn + into × */
.brix---accordion-item-wrapper.is-open
  .brix---btn-circle-accordion-btn::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.brix---accordion-item-wrapper.is-open
  .brix---btn-circle-accordion-btn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Remove inner spacer pill inside condition/procedure pills */
.condition-pill .brix---accordion-spacer,
.procedure-pill .brix---accordion-spacer {
  display: none;
}

/* =========================================
   9. CREDENTIAL BADGES (TESTIMONIALS HEADER)
   ========================================= */

.cred-badge {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background-color: #f9fafb;
    font-size: 13px;
    color: #1f2937;
    text-decoration: none !important;
    transition: all 0.18s ease-in-out;
    cursor: pointer;
    white-space: nowrap;
}

.cred-badge:hover {
    opacity: 1;
    transform: translateY(-1px); /* Slight lift effect */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background-color: #f9fafb;
    color: #1e40af
}

.cred-badge i {
    color: #eab308 !important; /* Gold color for stars */
}

/* 2. Desktop Testimonials Header Layout */

@media screen and (min-width: 992px) {
  .top-content.testimonials {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
    }

    .testimonials-left {
        max-width: 55%;
    }

    .testimonials-right {
        max-width: 45%;
        text-align: right;
    }

    .code-embed.w-embed a {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
}

/* =========================================
   10. ATLAS SECTION RESPONSIVE TWEAKS
   (tablet + phone for that band only)
   ========================================= */

@media screen and (max-width: 991px) {

    .nav-link,
    .header-button-mobile .w-button {
        color: #004f53;            /* make text visible on white pills */
        font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    }

  .atlas-section {
    padding: 28px 0 36px;
  }

  .atlas-section .image-3 {
    max-width: 200px;
    margin-bottom: 16px;
  }
}

/* Mobile - Atlas section stacking / centering */
@media screen and (max-width: 767px) {
  /* Hide spacer column on small screens */
  .atlas-spacer {
    display: none;
  }

  /* Center content when stacked */
  .atlas-section .column,
  .atlas-section .column-2,
  .atlas-section .w-col {
    text-align: center;
  }

  .atlas-section .image-3 {
    max-width: 140px;
    margin: 0 auto 20px auto;
  }

  .atlas-section {
    padding: 24px 0 32px;
  }
}

/* =========================================
   11. CHATBOX RESPONSIVE (SMALL SCREENS)
   ========================================= */

@media (max-width: 640px) {
  #atlasWidget {
    bottom: 16px;
    right: 16px;
  }
}

/* =========================================
   12. TESTIMONIALS CARD TWEAKS DESKTOP
   ========================================= */

.card.testimonial {
  border-radius: 32px;
  padding: 32px 28px;
}

/* =========================================
   13. MOBILE NAVIGATION (FINAL POLISHED BOX)
   ========================================= */
@media screen and (max-width: 991px) {
    
    /* 1. The Menu Container (Fixed Width Calculation) */
    .nav-menu.w-nav-menu {
        position: fixed !important;
        top: 12px !important;
        left: 12px !important;
        /* MATH: 100% width minus 12px margin on left and 12px on right */
        width: calc(100% - 24px) !important; 
        right: auto !important; 
        bottom: auto !important;
        height: auto !important;
        max-height: 85vh !important;
        background-color: #ffffff !important;
        border-radius: 20px !important;
        /* Padding: Top clears X button, Sides give breathing room */
        padding: 60px 12px 12px 12px !important; 
        box-shadow: 0 20px 60px rgba(0,0,0,0.3) !important;
        border: 1px solid #e2e8f0 !important;
        display: none;
        overflow-y: auto !important;
        z-index: 2147483600 !important; /* Extremely high to cover Logo */
    }

    .nav-menu.w-nav-menu.w--open {
        display: block !important;
    }

    /* 2. List Reset */
    .header-navigation {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    .nav-item-wrapper {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 3. Link Styling (App-Like Buttons) */
    .nav-link {
        display: flex !important; /* Use Flex to align text and arrow */
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 12px 16px !important; /* Comfortable tap area */
        font-size: 16px !important;
        font-weight: 500 !important;
        color: #334155 !important;
        text-align: left !important;
        background: transparent !important;
        border-bottom: none !important; /* No line dividers */
        border-radius: 12px !important; /* Rounded corners for items */
        margin-bottom: 4px !important; /* Tiny gap between items */
        transition: all 0.2s ease !important;
    }

    /* Add a Chevron (>) to the right */
    .nav-link::after {
        content: "›"; /* Chevron character */
        font-size: 22px;
        line-height: 1;
        color: #cbd5e1; /* Light grey by default */
        font-weight: 400;
        margin-left: 8px;
        transition: transform 0.2s ease, color 0.2s ease;
    }

    /* Hover/Active State */
    .nav-link:hover,
    .nav-link:active,
    .nav-link.w--current {
        background-color: #f0fdfa !important; /* Light Teal BG */
        color: #0f766e !important; /* Dark Teal Text */
    }

    /* Animate Chevron on Hover */
    .nav-link:hover::after,
    .nav-link:active::after {
        color: #0f766e;
        transform: translateX(4px); /* Move arrow slightly right */
    }

    /* 4. The Hamburger/X Button */
    .menu-button.w-nav-button {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px; height: 44px;
        background: #0f766e;
        border-radius: 50%;
        padding: 0;
        z-index: 2147483601 !important; /* Higher than menu */
    }

    .menu-button.w-nav-button.w--open {
        position: fixed !important;
        top: 24px !important;
        right: 24px !important;
        background: #f1f5f9 !important;
        box-shadow: none !important;
    }
    
    .menu-button-icon { width: 18px; height: 14px; position: relative; }
    .menu-line-top, .menu-line-middle, .menu-line-bottom { 
        background: #fff !important; height: 2px; width: 100%; position: absolute; left: 0; transition: 0.3s; 
    }
    .menu-line-top { top: 0; } .menu-line-middle { top: 6px; } .menu-line-bottom { bottom: 0; }

    .menu-button.w-nav-button.w--open .menu-line-top,
    .menu-button.w-nav-button.w--open .menu-line-middle,
    .menu-button.w-nav-button.w--open .menu-line-bottom { background: #334155 !important; }
    
    .menu-button.w-nav-button.w--open .menu-line-top { top: 6px; transform: rotate(45deg); }
    .menu-button.w-nav-button.w--open .menu-line-middle { opacity: 0; }
    .menu-button.w-nav-button.w--open .menu-line-bottom { bottom: 6px; transform: rotate(-45deg); }

  /* 5. 'Ask Atlas' Mobile Button Fix */
    .header-button-mobile {
        margin-top: 20px !important; /* More space from links */
        padding: 0 12px !important; /* Breathing room on sides */
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .header-button-mobile .w-button {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        /* Force comfortable internal spacing */
        padding: 14px 24px !important; 
        height: auto !important;
        font-size: 16px !important;
        line-height: 1.2 !important;
    }
}

/* =========================================
   14. PHONE-ONLY LAYOUT POLISH (≤ 767px)
   ========================================= */

@media screen and (max-width: 767px) {

  /* Atlas stat cards – add spacing between boxes */
  .home-features .w-layout-grid.home-features-grid {
    row-gap: 24px !important;
  }

  .home-features .card.home-feature {
    margin-bottom: 16px !important;
  }

  /* Reduce white space before Conditions section */
  .section.home-features {
    margin-bottom: 24px !important;
    padding-bottom: 24px !important;
  }

  .conditions-procedures-section {
    margin-top: 0 !important;
    padding-top: 24px !important;
  }

  /* Condition / procedure pills – uniform full-width buttons */
  .condition-grid,
  .procedure-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .condition-pill,
  .procedure-pill {
    width: 100% !important;
    text-align: center !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    box-sizing: border-box !important;
    min-height: 54px; /* Uniform height feel */
  }

  .condition-pill .text-block-5,
  .procedure-pill .text-block-5 {
    line-height: 1.3 !important;
    margin: 0 !important;
  }

  .brix---accordion-item-wrapper,
  .brix---btn-circle-accordion-btn {
    -webkit-tap-highlight-color: transparent;
  }

  .brix---accordion-item-wrapper:focus,
  .brix---btn-circle-accordion-btn:focus {
    outline: none;
  }

  /* Accordion toggle button in top-left */
  .brix---accordion-item-wrapper {
    align-items: flex-start !important;
  }

  .brix---accordion-side {
    align-self: flex-start !important;
    padding-top: 0 !important;     /* was 0.5rem – remove to stick it at the top */
  }

  /* Remove color flash on tap */
  .brix---accordion-item-wrapper,
  .brix---accordion-item-wrapper:hover,
  .brix---accordion-item-wrapper:active,
  .brix---accordion-item-wrapper:focus {
    background-color: #ffffff !important;
    transition: none !important;
  }

  .brix---btn-circle-accordion-btn,
  .brix---btn-circle-accordion-btn:hover,
  .brix---btn-circle-accordion-btn:active,
  .brix---btn-circle-accordion-btn:focus {
    background-color: #ffffff !important;
    transition: none !important;
  }

  /* Testimonials header – prevent left clipping and stack nicely */
  .top-content.testimonials {
    padding: 0 20px !important;
    text-align: center !important;
    box-sizing: border-box;
  }

  .title.testimonials {
    margin-left: 0 !important;
  }

  .testimonials-grid {
    grid-template-columns: 1fr !important;
  }
}

/* =========================================
   15. ATLAS CHATBOX LAYOUT FIX
   ========================================= */

#aiChatModal .atlas-chat-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #ffffff;
}

/* Header */
#aiChatModal .atlas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #003b3f;
  color: #ffffff;
  border-radius: 18px 18px 0 0;
}

/* Disclaimer Banners - Base Styles */
.atlas-disclaimer {
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.4;
}

.atlas-disclaimer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 100%;
}

.atlas-disclaimer-text {
  flex: 1;
}

.atlas-disclaimer-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-right: 4px;
}

.atlas-disclaimer-close {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

/* Legal Disclaimer (Yellow) */
.atlas-disclaimer-legal {
  background: #fef3c7;
  border-bottom: 1px solid #fbbf24;
}

.atlas-disclaimer-legal .atlas-disclaimer-text {
  color: #92400e;
}

.atlas-disclaimer-legal .atlas-disclaimer-text strong {
  color: #78350f;
  font-weight: 600;
}

.atlas-disclaimer-legal .atlas-disclaimer-close {
  color: #92400e;
}

.atlas-disclaimer-legal .atlas-disclaimer-close:hover {
  color: #78350f;
}

/* Confession/How I Work (Blue) */
.atlas-disclaimer-confession {
  background: #dbeafe;
  border-bottom: 1px solid #60a5fa;
}

.atlas-disclaimer-confession .atlas-disclaimer-text {
  color: #1e3a8a;
}

.atlas-disclaimer-confession .atlas-disclaimer-text strong {
  color: #1e40af;
  font-weight: 600;
}

.atlas-disclaimer-confession .atlas-disclaimer-close {
  color: #1e3a8a;
}

.atlas-disclaimer-confession .atlas-disclaimer-close:hover {
  color: #1e40af;
}

/* History Button for Patient Chat */
.atlas-history-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  font-size: 16px;
}

.atlas-history-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

#aiChatModal .atlas-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

#aiChatModal .atlas-logo {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
}

#aiChatModal .atlas-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

#aiChatModal .atlas-subtitle {
  font-size: 12px;
  opacity: 0.8;
}

/* Close "X" button inside the chat header */
#aiChatModal #atlasCloseBtn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

/* Messages area */
#aiChatModal #chatMessages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  background: #f9fafb;
}

/* Generic message row */
#aiChatModal .atlas-message {
  display: flex;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.4;
}

/* User vs assistant alignment */
#aiChatModal .atlas-message.user {
  justify-content: flex-end;
}

#aiChatModal .atlas-message.assistant {
  justify-content: flex-start;
}

/* Bubbles */
#aiChatModal .atlas-bubble {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 16px;
  box-sizing: border-box;
}

#aiChatModal .atlas-message.user .atlas-bubble {
  background: #0f766e;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

#aiChatModal .atlas-message.assistant .atlas-bubble {
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

/* Feedback row under assistant messages */
#aiChatModal .atlas-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

#aiChatModal .atlas-feedback button {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Input container wrapper */
#aiChatModal .atlas-input-container {
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 0 0 18px 18px;
  padding: 8px 10px 6px 10px;
}

/* Input row */
#aiChatModal .atlas-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Character counter - positioned below input */
#aiChatModal .atlas-char-counter {
  font-size: 11px;
  color: #94a3b8;
  text-align: right;
  padding: 4px 8px 0 0;
  user-select: none;
  transition: color 0.2s ease;
}

#aiChatModal .atlas-char-counter-warning {
  color: #f59e0b !important;
  font-weight: 500;
}

#aiChatModal .atlas-char-counter-over {
  color: #ef4444 !important;
  font-weight: 600;
}

/* Input textarea */
#aiChatModal #chatInput {
  flex: 1;
  border-radius: 20px;
  border: 1px solid #d1d5db;
  padding: 10px 14px;
  font-size: 14px;
  font-family: "DM Sans", sans-serif;
  outline: none;
  background: #ffffff;

  /* CRITICAL FIXES: */
  resize: none !important; /* Removes the arrow handle */
  overflow: hidden !important; /* Hides the scrollbar */
  min-height: 44px; /* Default height */
  max-height: 120px; /* Limit expansion */
  line-height: 1.4;
}

#aiChatModal #chatInput:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.2);
}

#aiChatModal #sendButton {
  border-radius: 999px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: #0f766e;
  color: #ffffff;
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important; /* Remove padding that pushes icon */
  width: 36px !important;
  height: 36px !important;
}

#aiChatModal #sendButton svg {
    margin-left: -2px; /* Visual optical adjustment for the paper plane */
    margin-top: 1px;
}

/* Chat Timestamp Styling */
#aiChatModal .atlas-timestamp {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 4px;
    text-align: left;
}
#aiChatModal .atlas-timestamp.user-time {
    text-align: right;
    color: rgba(255,255,255,0.8); /* Lighter on the teal user bubble */
}

/* Small screens – chat modal sizing */
@media screen and (max-width: 767px) {
  .atlas-chat-panel {
    width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
  }

  #aiChatModal #chatMessages {
    padding: 10px 10px;
  }
}

/* =========================================
   16. DESKTOP HEADER RESTORATION (Min-Width: 992px)
   ========================================= */

@media screen and (min-width: 992px) {
    
    /* 1. Force Horizontal Layout (Fix Alignment) */
    .nav-menu.w-nav-menu {
        display: flex !important;
        position: static !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
        border: none !important;
    }

    /* 2. List & Items Layout */
    .header-navigation {
        display: flex !important;
        align-items: center;
        gap: 24px; /* Space between items */
        margin: 0 !important;
        padding: 0 !important;
    }

    .nav-item-wrapper {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 3. Link Styling (Fix Color & Hover) */
    .nav-link {
        color: #ffffff !important; /* Force White Text on Teal Header */
        background: transparent !important;
        padding: 8px 0 !important;
        margin: 0 !important;
        font-size: 15px;
        font-weight: 500;
        text-decoration: none;
        position: relative;
        border-radius: 0 !important;
    }

    /* Remove the mobile "slide" effect on desktop */
    .nav-link:hover {
        transform: none !important;
        opacity: 0.8;
    }

    /* Underline Animation */
    .nav-link::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: 0;
        left: 0;
        background-color: #ffffff;
        transition: width 0.3s ease;
    }

    .nav-link:hover::after {
        width: 100%;
    }

    /* 4. Tweak Spacing */
    .section.home-hero {
        padding-top: 60px; /* Adjust as needed */
    }
}

/* =========================================
   17. HEADER SPACING FIX (Logo vs Menu)
   ========================================= */

@media screen and (min-width: 992px) {
    
    /* 1. Constrain the Logo Container */
    .brand.w-nav-brand {
        flex: 0 0 auto !important; /* Prevent logo from growing */
        margin-right: 24px !important; /* Reduce excessive gap between Logo and Menu */
        max-width: 150px; /* Ensure it stays compact */
    }

    /* 2. Optimize Menu Item Spacing */
    .header-navigation {
        gap: 20px !important; /* Slightly tighter gap between links (was 24px) */
        justify-content: flex-start;
    }

    /* 3. Ensure the Header Container utilizes full width */
    .header-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    /* 4. Allow the Left section (Logo + Menu) to take available space */
    .split-content.header-right {
        flex: 1; /* Grow to fill space */
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    /* 5. Stabilize the Right section (Ask Atlas Button) */
    .split-content.header-left {
        flex: 0 0 auto; /* Don't shrink */
        margin-left: 20px;
    }
    
    /* Optional: Tweak link font size if it's still too crowded */
    .nav-link {
        font-size: 15px !important;
    }
}

/* =========================================
   18. FINAL POLISH (Accordion, Borders, Spacing)
   ========================================= */

@media screen and (min-width: 992px) {
    
    /* 1. Desktop Accordion Alignment */
    .brix---accordion-item-wrapper {
        align-items: flex-start !important; /* Keep icon at top */
    }

    /* Reset the icon position */
    .brix---accordion-side {
        margin-top: 0 !important; 
    }

    /* PUSH THE TEXT DOWN to align with the icon's center */
    .brix---accordion-content-wrapper {
        padding-top: 8px !important; /* The magic number */
    }

    /* Ensure Title has no extra margin interfering */
    .brix---accordion-title {
        margin-top: 0 !important;
        line-height: 1.3 !important; 
        display: block;
    }
}

/* ... keep the rest of Section 18 (Borders, Conditions Text) unchanged ... */
.paragraph.home-about, 
.text-block-6, .text-block-7, .text-block-8, .text-block-9,
.home-about p {
    border: none !important;
    border-style: none !important;
    outline: none !important;
}

@media screen and (min-width: 992px) {
    .brix---inner-container-574px---center {
        max-width: 800px !important; 
        width: 100% !important;
    }
}

/* =========================================
   19. MODERN SCROLL ANIMATIONS (The "Cool" Factor)
   ========================================= */

/* The starting state: invisible and slightly down */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); /* Smooth 'Apple-like' ease */
    will-change: opacity, transform;
}

/* The active state: visible and in place */
.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delay for cards (optional but looks nice) */
.reveal-delay-100 { transition-delay: 0.1s; }
.reveal-delay-200 { transition-delay: 0.2s; }
.reveal-delay-300 { transition-delay: 0.3s; }

/* Ensure content is visible if JS fails or user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* =========================================
   20. ANIMATED ATLAS WIDGET (Pulse & Glow)
   ========================================= */

/* 1. The Pulse Ring (Sonar Effect) */
/* This creates a ring that sits behind the button */
#atlasWidget .chat-bubble::before {
    content: '';
    position: absolute;
    /* Start slightly outside the main border */
    top: -2px; left: -2px; right: -2px; bottom: -2px; 
    border-radius: 50%;
    /* Cyan color to match your AI branding */
    background: rgba(6, 182, 212, 0.4); 
    z-index: -1; /* Place it behind the button */
    opacity: 0;
    transform: scale(1);
    /* The animation definition */
    animation: atlas-sonar-wave 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* 2. The Main Bubble "Breathing" Effect */
#atlasWidget .chat-bubble {
    /* Ensure the transform origin is center for scaling */
    transform-origin: center;
    /* The breathing animation */
    animation: atlas-breathe 3s ease-in-out infinite;
    /* Smooth transition for when user hovers */
    transition: all 0.3s ease;
}

/* 3. Keyframes Definitions */

/* The Ring expanding outward and fading */
@keyframes atlas-sonar-wave {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.6); /* Expands to 1.6x size */
        opacity: 0; /* Fades to invisible */
    }
}

/* The Bubble gently lifting and glowing */
@keyframes atlas-breathe {
    0% {
        transform: scale(1);
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.45); /* Default Shadow */
    }
    50% {
        transform: scale(1.05); /* Slight grow */
        /* Add a Cyan Glow + Maintain Shadow */
        box-shadow: 0 0 15px rgba(6, 182, 212, 0.6), 0 12px 30px rgba(15, 23, 42, 0.45);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.45);
    }
}

/* 4. Interactive State (Hover) */
/* When user hovers, stop breathing and "Lock" the active state */
#atlasWidget .chat-bubble:hover {
    animation: none; /* Stop the loop */
    transform: scale(1.1); /* Grow larger */
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.8), 0 15px 40px rgba(15, 23, 42, 0.3); /* Strong Glow */
    cursor: pointer;
}

/* Pause the pulse ring on hover too, if desired */
#atlasWidget .chat-bubble:hover::before {
    animation: none;
    opacity: 0;
}

/* =========================================
   21. MODERN MODAL STYLING (Pop & Contrast)
   ========================================= */

/* 1. The Overlay (Background) */
.condition-modal-overlay, 
.procedure-modal-overlay {
    background-color: rgba(15, 23, 42, 0.75) !important; /* Much Darker */
    -webkit-backdrop-filter: blur(5px); /* Safari 9+ and iOS 9+ support */
    backdrop-filter: blur(5px); /* Blurs the website behind it */
}

/* 2. The Modal Box (The Card) */
.condition-modal-box, 
.procedure-modal-box {
    border-radius: 24px !important;
    /* Deep Shadow for "Lift" */
    box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.6) !important; 
    border: 1px solid rgba(255, 255, 255, 0.9); /* Bright border */
    /* Light Blue/Teal Tint Background */
    background: linear-gradient(to bottom, #f0fdfa, #ffffff) !important; 
    overflow: hidden;
    max-width: 600px;
    width: 90%;
    position: relative;
    padding: 0 !important;
}

/* The Content Area */
.condition-modal-content, 
.procedure-modal-content {
    padding: 32px !important;
    font-family: "DM Sans", sans-serif !important; /* Enforce Font */
    font-size: 15px !important; /* Slightly reduced (was likely 16px) */
    line-height: 1.6 !important;
    color: #334155;
    
    /* Modern Scrollbar Hiding */
    overflow-y: auto;
    max-height: 70vh; /* Keep it from hitting screen edges */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #cbd5e1 transparent;
}

/* Webkit Scrollbar Styling (Chrome/Safari) */
.condition-modal-content::-webkit-scrollbar, 
.procedure-modal-content::-webkit-scrollbar {
    width: 6px;
}

.condition-modal-content::-webkit-scrollbar-track, 
.procedure-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.condition-modal-content::-webkit-scrollbar-thumb, 
.procedure-modal-content::-webkit-scrollbar-thumb {
    background-color: #e2e8f0;
    border-radius: 20px;
}

/* Modal Headers */
.div-block-condition-modal h2, 
.div-block-procedure-modal h2 {
    font-size: 22px !important;
    font-weight: 700;
    color: #0f766e; /* Brand Teal */
    margin-top: 0;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

/* Modal Close Button (Floating Circle) */
.condition-modal-close, 
.procedure-modal-close {
    top: 16px !important;
    right: 16px !important;
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.condition-modal-close:hover, 
.procedure-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* =========================================
   22. FOOTER VISIBILITY FIX (ICONS & TEXT)
   ========================================= */

/* 1. Policy Links Visibility */
.footer-policy-links {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 16px;
}

.footer-link-small {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8) !important; /* Light White (High Visibility) */
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.footer-link-small:hover {
    color: #ffffff !important; /* Pure White on hover */
    text-decoration: underline;
}

.policy-divider {
    color: rgba(255, 255, 255, 0.4) !important; /* Dimmed White */
    font-size: 12px;
}

/* 1b. Footer Location Readability */
.footer .footer-nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}

.footer .footer-nav-link strong {
    color: #ffffff !important;
    font-weight: 600;
}

/* 2. Social Icons Visibility */
.footer-social-media-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px; 
    height: 44px;
    text-decoration: none;
    transition: transform 0.2s ease;
}

/* Force the icon to be WHITE by default */
.footer-social-media-link i {
    color: #ffffff !important; 
    font-size: 20px !important;
    opacity: 1 !important; /* Ensure it's not hidden */
    display: block;
}

/* Hover Effect (Scale up only, keep color white) */
.footer-social-media-link:hover {
    transform: scale(1.15);
    background: transparent !important;
}

/* Mobile Footer Layout */
@media screen and (max-width: 767px) {
    .footer-social-media-grid {
        display: flex !important;
        flex-direction: row !important; /* Keep icons horizontal */
        flex-wrap: wrap !important;     /* Allow wrapping */
        justify-content: center !important;
        gap: 20px !important; /* Space between icons */
        align-items: center !important;
    }
    
    /* Force the policy text to break to a new line */
    .footer-policy-links {
        flex-basis: 100% !important; /* Force full width */
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 8px !important; /* Space between icons and text */
        justify-content: center !important;
        order: 3; /* Ensures it sits below icons */
    }
}

/* =========================================
   PATIENT MODAL CONTAINER
   ========================================= */
#patientAtlasModal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    display: none;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 20px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Patient chat panel - match public chat height behavior */
#patientAtlasModal .atlas-chat-panel {
    height: 100%;
}
