  #dripoli-chatbot {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 9999;
    font-family: 'Lato', sans-serif;
  }

  /* Delayed helper popup */
  .dripoli-chat-popup {
    position: fixed;
    bottom: 100px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 1px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 4px;
    z-index: 99999;
    font-family: 'Lato', sans-serif;
  }


  .dripoli-chat-prompt-button {
    background: none;
    border: none;
    font-size: 14px;
    color: #000;
    cursor: pointer;
    padding: 0px;
  }

  button.dripoli-chat-close-popup{
    padding:.5rem 5px .5rem .5rem!important;
  }

  .dripoli-chat-close-popup {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    margin: 0px;
  }

  .dripoli-chat-prompt-button:hover,
  .dripoli-chat-prompt-button:focus {
    background-color: transparent !important;
    color: inherit;
    outline: none;
    box-shadow: none;
  }

  .dripoli-chat-close-popup:hover,
  .dripoli-chat-close-popup:focus {
    background-color: transparent !important;
    color: #888;
    outline: none;
  }

  button.dripoli-chat-prompt-button,
  button.dripoli-chat-close-popup {
    transition: color 0.2s ease, background-color 0.2s ease;
  }

  /* Chatbot toggle button (always fixed) */
  .chatbot-button {
    width: 70px;
    height: 70px;
    background: transparent;
    /* transparent background */
    background-image: url("Poli-Icon-2.svg");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    border-radius: 50%;
    padding: 18px;
    overflow: visible;

    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    position: fixed;
    /* <-- this is key */
    bottom: 20px;
    right: 20px;
    z-index: 10001;
  }

  .chatbot-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    overflow: visible;
  }

  .chatbot-button:hover {

    transform: translateY(-2px);
  }



  .chatbot-box {
    width: min(360px, calc(100vw - 48px));
    height: min(560px, calc(100vh - 140px));
    background: #ffffff;
    /* border: 3px solid #E4E4E4; */
    border-radius: 38px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15);
  }

  .hidden {
    display: none;
  }

  .chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(90deg, #2896A8 0%, #4080A3 19%, #695B9C 55%, #834597 83%, #8D3D96 100%);
    border-top-left-radius: 35px;
    border-top-right-radius: 35px;
    color: white;
    min-height: 60px;
    overflow: visible;
  }

  .chatbot-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: visible;
  }

  .logo-icon {
    height: 22px;
    width: auto;
    min-width: 22px;
    max-width: 30px;
    object-fit: contain;
    overflow: visible;
  }

  .logo-text {
    height: 17px;
    width: auto;
    min-width: 50px;
    max-width: 75px;
    margin-top: 2px;
    object-fit: contain;
    overflow: visible;
  }

  .chatbot-close {
    background: transparent;
    border: none;
    font-size: 18px;
    color: white;
    cursor: pointer;
    padding: 6px;
    line-height: 1;
    transition: transform 0.2s ease;
  }


  .chatbot-close:hover,
  .chatbot-close:focus,
  .chatbot-close:hover {
    transform: scale(1.2);
    background-color: transparent !important;
  }

  .chatbot-messages {
    flex: 1;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
    background: url('./Poli-Wallpaper.jpg') center/contain;
    background-attachment: fixed, local;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
  }

  .message {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    box-sizing: border-box;
  }

  .message.bot {
    align-self: flex-start;
    background: #f9f9f9;
    border: 1px solid #ccc;
    color: #6A1B9A;
    flex-wrap: wrap!important;
    white-space: pre-wrap;
  }

  .message.user {
    align-self: flex-end;
    background: #e0e0e0;
    color: #333;
    border: none;
  }

  .chatbot-input {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f9f9f9;
    border-top: 1px solid #ddd;
  }

  .chatbot-input input {
    flex: 1;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 25px !important;
    border: 1px solid #ccc;
    outline: none;
    margin-right: 8px;
    box-sizing: border-box;
  }

  .chatbot-input button {
    padding: 10px 16px;
    font-size: 14px;
    background: #695B9C;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
  }

  .chatbot-input button:hover {
    background: #5c4e8a;
  }

  /* === GLOBAL MOBILE-FRIENDLY CONTENT STYLES === */

  /* Ensure all buttons in messages fit properly */
  .message button,
  .message .btn,
  .message [class*="btn"] {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
  }

  /* Ensure forms and containers don't overflow */
  .message form,
  .message .form-container,
  .message .calendar-container,
  .message .meeting-container {
    max-width: 100%;
    overflow: visible;
    box-sizing: border-box;
  }

  /* Text content safety */
  .message p,
  .message div,
  .message span {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
  }

  /* === Typing indicator (three bouncing dots) === */
  .message.typing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f4f4f4;
    color: #444;
    max-width: 75%;
  }

  .typing-dots {
    display: inline-flex;
    gap: 4px;
  }

  .typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8a8a8a;
    opacity: 0.35;
    animation: dripoli-typing-bounce 1s infinite;
  }

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

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

  @keyframes dripoli-typing-bounce {
    0% {
      opacity: .25;
      transform: translateY(0);
    }

    50% {
      opacity: 1;
      transform: translateY(-2px);
    }

    100% {
      opacity: .25;
      transform: translateY(0);
    }
  }
  /* ==== Responsive layout adjustments ==== */
  @media (max-width: 768px) {
    #dripoli-chatbot {
      left: 0;
      right: 0;
      bottom: 30px;
      padding: 0 16px;
    }

    .form-section textarea {
      overflow: auto;           /* still scrollable */
      scrollbar-width: none;    /* Firefox */
    }

    .form-section textarea::-webkit-scrollbar {
      display: none;            /* Chrome, Safari, Edge */
    }

    .chatbot-box {
      margin: 0 auto;
      margin-bottom:60px!important;
      /* width: 60vw!important;
      float: right!important;
      margin-bottom: 4rem!important; */
      height: 475px !important;
      width: min(420px, calc(100vw - 32px));
      /* height: min(520px, calc(100vh - 120px)); */
    }

    .chatbot-messages{
      background: url('./Poli-Wallpaper.jpg') center center no-repeat;
      background-size: contain;
    }

    /* iOS Safari & all browsers on iOS fallback */
    @supports (-webkit-touch-callout: none) and (not (overflow: -webkit-paging-interval)) {
      .chatbot-messages {
        background-attachment: scroll, local !important; /* avoids zoom issue */
        background-size: 100% auto; /* zooms out the image */
      }
    }

    .chatbot-button {
      width: 64px;
      height: 64px;
      bottom: 18px;
      right: 18px;
    }

    .dripoli-chat-popup {
      right: 18px;
      bottom: 90px;
      max-width: 100%;
    }

  }

  @media (max-width: 540px) {
    #dripoli-chatbot {
      bottom: 16px;
      padding: 0 10px;
    }

    /* Simple checkbox fix for mobile */
    .message.bot input[type="checkbox"] {
      margin-right: 8px;
    }

    .chatbot-box {
      width: calc(100vw - 20px);
      height: calc(100vh - 96px);
      border-radius: 30px;
      border-width: 2px;
    }

    .chatbot-header {
      padding: 16px 18px;
      border-top-left-radius: 26px;
      border-top-right-radius: 26px;
      min-height: 55px;
      overflow: visible;
    }

    .logo-icon {
      height: 20px;
      min-width: 20px;
      max-width: 28px;
    }

    .logo-text {
      height: 15px;
      min-width: 45px;
      max-width: 65px;
    }

    .chatbot-messages {
      padding: 12px;
      background-size: cover;
    }

    .message {
      max-width: 100%;
      font-size: 13px;
    }

    .chatbot-input {
      padding: 10px 12px;
      gap: 8px;
    }

    .chatbot-input input {
      margin-right: 0;
      min-width: 0;
      border-radius: 25px !important;
    }

    .chatbot-button {
      width: 56px;
      height: 56px;
      bottom: 14px;
      right: 14px;
    }

    .dripoli-chat-popup {
      right: 12px;
      /* left: 12px; */
      bottom: 75px;
      /* max-width: none; */
    }

    /* Meeting form and custom content blocks stay inside the bubble */
    .message.bot .meeting-form,
    .message.bot .calendar-form {
      margin-top: 15px !important;
      padding: 10px !important;
      background: rgba(255, 255, 255, 0.9) !important;
      border-radius: 12px !important;
      width: 100% !important;
      box-sizing: border-box !important;
    }

    .message.bot .portfolio-buttons {
      margin-top: 15px !important;
      display: flex !important;
      flex-direction: row !important;
      gap: 8px !important;
      justify-content: space-between !important;
    }

    .message.bot .portfolio-download-btn {
      flex: 1 !important;
      padding: 8px 12px !important;
      margin: 0 !important;
      font-size: 12px !important;
      text-align: center !important;
      border-radius: 12px !important;
      white-space: nowrap !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
    }

    .message.bot .quick-actions,
    .message.bot .action-buttons {
      margin-top: 15px !important;
      display: flex !important;
      flex-direction: column !important;
      gap: 8px !important;
      width: 100% !important;
    }

    .message.bot .quick-action-btn,
    .message.bot .action-btn,
    .message.bot button[class*="btn"] {
      display: block !important;
      width: 100% !important;
      max-width: 100% !important;
      padding: 10px 12px !important;
      margin: 0 0 6px 0 !important;
      font-size: 13px !important;
      border-radius: 12px !important;
      text-align: center !important;
      box-sizing: border-box !important;
      white-space: normal !important;
      word-wrap: break-word !important;
      line-height: 1.3 !important;
    }

    /* Ensure hidden buttons stay hidden on mobile */
    .message.bot .quick-action-btn[style*="display: none"],
    .message.bot .action-btn[style*="display: none"],
    .message.bot button[style*="display: none"] {
      display: none !important;
    }

    .message.bot ul,
    .message.bot ol {
      margin: 10px 0 !important;
      padding-left: 20px !important;
      word-wrap: break-word !important;
    }

    .message.bot li {
      margin-bottom: 5px !important;
      word-wrap: break-word !important;
      line-height: 1.4 !important;
    }

    .message.bot p,
    .message.bot div {
      word-wrap: break-word !important;
      overflow-wrap: break-word !important;
      max-width: 100% !important;
      white-space: pre-wrap !important;
      line-height: 1.5 !important;
    }

    .message.bot * {
      max-width: 100% !important;
      box-sizing: border-box !important;
    }

    /* Mobile-specific formatting for bot messages */
    @media (max-width: 540px) {
      .message.bot {
        white-space: pre-wrap !important;
        line-height: 1.6 !important;
      }
      
      .message.bot br {
        display: block !important;
        margin: 0.5em 0 !important;
        content: "" !important;
      }
    }
  }

  @media (max-width: 360px) {
    .chatbot-box {
      height: calc(100vh - 72px);
      border-radius: 24px;
    }

    .chatbot-header {
      padding: 12px 16px;
      min-height: 50px;
      overflow: visible;
    }

    .logo-icon {
      height: 18px;
      min-width: 18px;
      max-width: 25px;
    }

    .logo-text {
      height: 13px;
      min-width: 40px;
      max-width: 60px;
    }

    .message {
      font-size: 12px;
      padding: 10px 12px;
    }

    .chatbot-input {
      flex-direction: row;
      align-items: center;
      justify-content: center;
    }

    .chatbot-input input {
      width: 100%;
      margin: 0 0 8px 0;
      border-radius: 25px !important;
    }

    .chatbot-input button {
      width: 20%;
    }

    .message.bot .portfolio-download-btn {
      padding: 6px 10px !important;
      font-size: 11px !important;
    }

    .message.bot .quick-action-btn,
    .message.bot .action-btn,
    .message.bot button[class*="btn"] {
      padding: 8px 10px !important;
      font-size: 12px !important;
    }

    .dripoli-chat-popup {
      /* left: 10px; */
      right: 10px;
      bottom: 75px;
    }
  }

  /* --- Typing bubble base --- */
  .message.bot.typing {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f4f4f4;
    color: #444;
    max-width: 75%;
    /* if RTL page, bubble can flip automatically */
    direction: ltr;
  }

  /* --- Dots container --- */
  .typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
    /* Prevent collapse on small screens */
    min-height: 8px;
  }

  /* --- Each dot --- */
  .typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8D3D96;
    /* Dripoli accent */
    display: inline-block;
    animation: dripoli-typing-bounce 1s infinite;
    -webkit-animation: dripoli-typing-bounce 1s infinite;
    /* iOS */
    will-change: transform, opacity;
  }

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

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

  /* --- Keyframes (with iOS prefix) --- */
  @keyframes dripoli-typing-bounce {

    0%,
    60%,
    100% {
      transform: translateY(0);
      opacity: .5;
    }

    30% {
      transform: translateY(-4px);
      opacity: 1;
    }
  }

  @-webkit-keyframes dripoli-typing-bounce {

    0%,
    60%,
    100% {
      -webkit-transform: translateY(0);
      opacity: .5;
    }

    30% {
      -webkit-transform: translateY(-4px);
      opacity: 1;
    }
  }

  /* --- Make sure no mobile media query hides bot messages --- */
  @media (max-width: 540px) {

    .chatbot-messages .message.bot,
    .chatbot-messages .message.bot.typing {
      display: inline-flex;
      /* force visible on mobile */
    }
  }

  /* --- If your messages scroller clips content, allow the bubble --- */
  .chatbot-messages,
  .chatbot-body {
    overflow-y: auto;
    overflow-x: visible;
    /* prevent dot clipping */
  }
