/* ── Floating Button ── */
  #wa-widget {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    font-family: 'Poppins', sans-serif;
  }

  #wa-toggle {
    width: 58px;
    height: 58px;
    background: #25D366;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37,211,102,0.45);
    transition: transform .25s ease, box-shadow .25s ease;
    position: relative;
  }

  #wa-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(37,211,102,0.55);
  }

  #wa-toggle svg { transition: transform .3s ease, opacity .3s ease; }
  #wa-toggle .icon-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg) scale(.6);
  }
  #wa-widget.open #wa-toggle .icon-wa {
    opacity: 0;
    transform: rotate(90deg) scale(.6);
  }
  #wa-widget.open #wa-toggle .icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }

  /* Pulse ring */
  #wa-toggle::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(37,211,102,.5);
    animation: wa-pulse 2s ease-out infinite;
  }
  @keyframes wa-pulse {
    0%   { transform: scale(1);   opacity: .7; }
    70%  { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
  }

  /* Notif badge */
  #wa-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4d4d;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
  }

  /* ── Panel ── */
  #wa-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.15);
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(.85) translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: transform .28s cubic-bezier(.34,1.56,.64,1), opacity .22s ease;
  }

  #wa-widget.open #wa-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  /* Panel header */
  .wa-header {
    background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .wa-header-avatar {
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .wa-header-info h4 {
    margin: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
  }

  .wa-header-info p {
    margin: 2px 0 0;
    color: rgba(255,255,255,.75);
    font-size: 11px;
  }

  .wa-online-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    animation: blink 1.5s ease-in-out infinite;
  }
  @keyframes blink {
    0%,100% { opacity: 1; } 50% { opacity: .4; }
  }

  /* Panel body */
  .wa-body {
    padding: 16px 18px 18px;
  }

  /* Chat bubble preview */
  .wa-bubble {
    background: #f0f4f3;
    border-radius: 0 12px 12px 12px;
    padding: 10px 13px;
    font-size: 12.5px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 14px;
    position: relative;
  }

  .wa-bubble::before {
    content: '';
    position: absolute;
    top: 0; left: -7px;
    border-width: 0 8px 8px 0;
    border-style: solid;
    border-color: transparent #f0f4f3 transparent transparent;
  }

  /* Select balai */
  .wa-label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .5px;
  }

  #wa-select-balai {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 9px;
    font-family: 'Poppins', sans-serif;
    font-size: 12.5px;
    color: #333;
    background: #fafafa;
    outline: none;
    cursor: pointer;
    transition: border-color .2s;
    margin-bottom: 12px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
  }

  #wa-select-balai:focus { border-color: #25D366; }

  /* Pesan input */
  #wa-message {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 9px;
    font-family: 'Poppins', sans-serif;
    font-size: 12.5px;
    color: #333;
    background: #fafafa;
    outline: none;
    resize: none;
    transition: border-color .2s;
    margin-bottom: 12px;
    box-sizing: border-box;
  }

  #wa-message:focus { border-color: #25D366; }

  /* Tombol kirim */
  #wa-send {
    width: 100%;
    padding: 11px;
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .2s, transform .15s;
  }

  #wa-send:hover { background: #1ebe5a; transform: translateY(-1px); }
  #wa-send:active { transform: translateY(0); }

  .wa-footer-note {
    text-align: center;
    font-size: 10px;
    color: #aaa;
    margin-top: 10px;
  }