/*
チャットボット用CSS
右下にフローティングボタンとチャットウィンドウを表示
*/
#chatbot-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 8px 16px;
  min-height: 44px;
  background: #0078d7;
  color: #fff;
  border: none;
  border-radius: 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  z-index: 9999;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#chatbot-fab.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#chatbot-fab:hover {
  background: #005fa3;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
#chatbot-window {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 360px;
  height: 520px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  overflow: hidden;
  display: none;
  flex-direction: column;
  z-index: 10000;
  max-height: calc(100dvh - 48px);
}
#chatbot-window.active {
  display: flex;
}
#chatbot-header {
  background: #0078d7;
  color: #fff;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#chatbot-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}
#chatbot-iframe {
  flex: 1;
  border: none;
  width: 100%;
  height: 100%;
}
@media (max-width: 480px) {
  #chatbot-fab {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    min-height: 42px;
    padding: 8px 14px;
    font-size: 13px;
  }

  #chatbot-window {
    width: calc(100vw - 12px);
    max-width: 420px;
    height: calc(100dvh - 24px - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
    right: 6px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    border-radius: 12px;
  }
}

@supports not (height: 100dvh) {
  #chatbot-window {
    max-height: calc(100vh - 48px);
  }

  @media (max-width: 480px) {
    #chatbot-window {
      height: calc(100vh - 24px - env(safe-area-inset-bottom));
      max-height: calc(100vh - 24px - env(safe-area-inset-bottom));
    }
  }
}
