

    /* Overlay blur */
    .overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.4);
      backdrop-filter: blur(6px);
      z-index: 90;
      transition: opacity 0.3s ease;
    }
    .overlay.hidden {
      opacity: 0;
      pointer-events: none;
    }

    /* Animasi chatbox */
    .chatbox {
      transition: opacity 0.4s ease, transform 0.4s ease;
    }
    .chatbox.hide {
      opacity: 0;
      transform: translateY(20px);
      pointer-events: none;
    }
    .chatbox.show {
      opacity: 1;
      transform: translateY(1);
      pointer-events: auto;
    }

    /* chatbox */
    .chatbox {
      position: fixed;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%);
      width: 90%;
      max-width: 400px;
      background: #d96f32;
      border-radius: 20px;
      overflow: hidden;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
      height: 40px;
      transition: height 0.4s ease;
      z-index: 9999;
    }

    .chatbox.open {
      height: 84vh;
    }

    /* HEADER */
    .chat-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 16px;
      font-weight: 500;
      font-size: 0.9rem;
      color: white;
      cursor: pointer;
    }

    .chat-toggle {
      background: none;
      border: 2px solid white;
      border-radius: 50%;
      color: white;
      font-size: 1.2rem;
      width: 28px;
      height: 28px;
      cursor: pointer;
      transition: transform 0.3s ease;
    }

    .chat-clear {
      background: #fff;
      border: 2px solid #d96f32;
      border-radius: 50%;
      color: #d96f32;
      font-size: 1.2rem;
      width: 28px;
      height: 28px;
      cursor: pointer;
      transition: background 0.3s, color 0.3s, border-color 0.3s;
    }

    .chat-clear:hover {
      background: #d96f32;
      color: #fff;
      border-color: #fff;
    }

    .chatbox.open .chat-toggle {
      transform: rotate(45deg);
    }

    /* BODY */
    .chat-body {
      height: calc(100% - 60px); /* sisakan space untuk header */
      overflow: hidden;
      background: #fff;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      max-height: 0;
    }

    .chatbox.open .chat-body {
      max-height: 100%;
      transition: height 0.4s ease;
    }

    .chat-content {
      max-height: 67vh;
      overflow-y: auto;
      padding: 10px;
    }

    /* INPUT AREA */
    .chat-input {
      display: flex;
      padding: 10px;
      gap: 10px;
      border-top: 1px solid #ddd;
      background: #fff;
    }

    .chat-input input {
      flex: 1;
      padding: 8px 10px;
      border: 1px solid #ccc;
      border-radius: 8px;
      font-size: 14px;
    }

    .chat-input button {
      background: #d96f32;
      border: none;
      padding: 8px 12px;
      border-radius: 8px;
      color: white;
      cursor: pointer;
      font-size: 14px;
    }

    /* Bubble Chat */
    .chat-message {
      display: flex;
      margin: 6px 0;
      padding: 0 10px;
    }

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

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

    .chat-message .bubble {
      max-width: 80%;
      padding: 10px 14px;
      border-radius: 16px;
      font-size: 0.9rem;
      line-height: 1.4;
      word-wrap: break-word;
      white-space: pre-wrap;
      position: relative;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .chat-message.user .bubble {
      background-color: #d96f32;
      color: white;
      border-bottom-right-radius: 4px;
    }

    .chat-message.bot .bubble {
      background-color: #f1f1f1;
      color: #333;
      border-bottom-left-radius: 4px;
    }


    /* ============== RESPONSIVE BREAKPOINTS ============== */
    @media (max-width: 768px) {
      .chatbox {
        width: 87%;
        border-radius: 20px;
      }
      .chat-header {
        padding: 10px 12px;
        font-size: 0.85rem;
      }

      .chat-toggle {
        width: 24px;
        height: 24px;
        font-size: 1rem;
      }

      .chat-input input {
        font-size: 13px;
      }

      .chat-input button {
        font-size: 13px;
        padding: 6px 10px;
      }
      .chat-content {
          max-height: 40vh;
          overflow-y: auto;
          padding: 10px;
        }
    }

    @media (max-width: 480px) {
      .chatbox {
        width: 80%;
        bottom: 25px;
        border-radius: 10px;
      }

      .chatbox.open {
        height: 89vh;
      }

      .chat-header {
        font-size: 0.8rem;
        padding: 8px 10px;
      }

    .chat-content {
      max-height: 40vh;
      overflow-y: auto;
      padding: 10px;
    }

      .chat-input {
        padding: 8px;
        gap: 8px;
      }

      .chat-input input {
        font-size: 12px;
        padding: 6px 8px;
      }

      .chat-input button {
        font-size: 12px;
        padding: 6px 8px;
      }
    }

    .chat-message {
      display: flex;
      align-items: flex-end;
      margin: 6px 0;
      padding: 0 10px;
    }

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

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

    .chat-message .avatar {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background-color: #ccc;
      color: #fff;
      font-weight: bold;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.8rem;
      margin: 0 6px;
      flex-shrink: 0;
    }

    .chat-message.user .avatar {
      background-color: #d96f32;
    }

    .chat-message.bot .avatar {
      background-color: #6b7280;
    }

    .chat-message .bubble {
      max-width: 75%;
      padding: 10px 14px;
      border-radius: 16px;
      font-size: 0.9rem;
      line-height: 1.4;
      word-wrap: break-word;
      white-space: pre-wrap;
      position: relative;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .chat-message.user .bubble {
      background-color: #d96f32;
      color: white;
      border-bottom-right-radius: 4px;
    }

    .chat-message.bot .bubble {
      background-color: #f1f1f1;
      color: #333;
      border-bottom-left-radius: 4px;
    }

    .timestamp {
      font-size: 0.7rem;
      color: #000000;
      margin-top: 4px;
      text-align: right;
    }

    /* Animasi masuk untuk chat bubble */
    .chat-message {
      opacity: 0;
      transform: translateY(10px);
      animation: fadeInUp 0.3s ease forwards;
    }

    @keyframes fadeInUp {
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .chat-loader {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: rgba(255, 255, 255, 0.9);
      padding: 20px;
      border-radius: 12px;
      text-align: center;
      z-index: 10;
      display: none;
      flex-direction: column;
      align-items: center;
      animation: fadeIn 0.3s ease;
    }

    .chat-loader .spinner {
      border: 4px solid #f3f3f3;
      border-top: 4px solid #d96f32;
      border-radius: 50%;
      width: 36px;
      height: 36px;
      animation: spin 1s linear infinite;
      margin-bottom: 10px;
    }

    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: scale(0.8); }
      to { opacity: 1; transform: scale(1); }
    }

    /* Animasi ikon chat saat membuka chatbox */
    #chatIconButton {
      transition: transform 0.5s ease, scale 0.5s ease;
      position: relative;
      z-index: 10000;
    }

    /* Saat chatbox terbuka, animasikan ikon */
    .chatbox.open #chatIconButton {
      animation: chatIconExpandUp 0.5s ease forwards;
    }

    @keyframes chatIconExpandUp {
      0% {
        transform: scaleX(1) translateY(0);
      }
      50% {
        transform: scaleX(1.4) translateY(-4px);
      }
      100% {
        transform: scaleX(1) translateY(-40px);
      }
    }