:root {
  --wsp-night: #04111f;
  --wsp-deep: #071d32;
  --wsp-blue: #1769aa;
  --wsp-cyan: #49b4e8;
  --wsp-ice: #eef6fc;
  --wsp-muted: #a6b9c9;
  --wsp-line: rgba(160, 196, 220, 0.22);
}

.wsp-chatbot, .wsp-chatbot * { box-sizing: border-box; }

.wsp-chatbot {
  position: fixed;
  z-index: 999999;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--wsp-ice);
}

.wsp-chatbot__toggle {
  min-height: 56px;
  padding: 0 20px 0 14px;
  border: 1px solid rgba(87, 208, 255, 0.45);
  border-radius: 999px;
  background: linear-gradient(135deg, #0d4778, #167fbd);
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-weight: 750;
  letter-spacing: 0.01em;
  box-shadow: 0 16px 45px rgba(0, 95, 160, 0.35), inset 0 1px rgba(255,255,255,.25);
  cursor: pointer;
}

.wsp-chatbot__toggle:hover { filter: brightness(1.08); transform: translateY(-1px); }
.wsp-chatbot__toggle:focus-visible, .wsp-chatbot button:focus-visible, .wsp-chatbot textarea:focus-visible, .wsp-chatbot a:focus-visible { outline: 3px solid #77dcff; outline-offset: 3px; }
.wsp-chatbot__star { color: #ffffff; font-size: 22px; line-height: 1; text-shadow: 0 0 12px rgba(178, 220, 255, .55); }

.wsp-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: min(390px, calc(100vw - 28px));
  height: min(610px, calc(100vh - 110px));
  border: 1px solid var(--wsp-line);
  border-radius: 22px;
  overflow: hidden;
  background: radial-gradient(circle at 80% 0%, rgba(0, 151, 224, .18), transparent 38%), linear-gradient(180deg, var(--wsp-deep), var(--wsp-night));
  box-shadow: 0 30px 80px rgba(0, 12, 27, .48);
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
}

.wsp-chatbot__panel[hidden] { display: none; }
.wsp-chatbot__header { padding: 20px 20px 16px; border-bottom: 1px solid var(--wsp-line); display: flex; align-items: start; justify-content: space-between; }
.wsp-chatbot__eyebrow { color: var(--wsp-cyan); font-size: 10px; font-weight: 800; letter-spacing: .22em; }
.wsp-chatbot__heading { margin: 3px 0 0; color: white; font-size: 21px; line-height: 1.2; }
.wsp-chatbot__status { margin-top: 7px; color: var(--wsp-muted); font-size: 12px; }
.wsp-chatbot__status::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; background: #2ad89f; box-shadow: 0 0 0 4px rgba(42,216,159,.1); }
.wsp-chatbot__close { width: 40px; height: 40px; border: 0; border-radius: 12px; background: rgba(255,255,255,.06); color: white; font-size: 25px; line-height: 1; cursor: pointer; }
.wsp-chatbot__messages { padding: 18px; overflow-y: auto; overscroll-behavior: contain; }
.wsp-chatbot__message { display: flex; margin-bottom: 12px; }
.wsp-chatbot__message--user { justify-content: flex-end; }
.wsp-chatbot__bubble { max-width: 88%; padding: 12px 14px; border: 1px solid var(--wsp-line); border-radius: 16px 16px 16px 5px; background: rgba(255,255,255,.065); color: #e8f7ff; font-size: 14px; line-height: 1.52; white-space: pre-wrap; }
.wsp-chatbot__message--user .wsp-chatbot__bubble { border-color: rgba(73,195,240,.3); border-radius: 16px 16px 5px 16px; background: linear-gradient(135deg, #006aae, #008fbd); color: white; }
.wsp-chatbot__suggestions { padding: 0 18px 10px; display: flex; flex-wrap: wrap; gap: 7px; }
.wsp-chatbot__suggestion { flex: 0 1 auto; max-width: 100%; padding: 8px 11px; border: 1px solid var(--wsp-line); border-radius: 999px; background: transparent; color: #bfeaff; font: inherit; font-size: 12px; cursor: pointer; }
.wsp-chatbot__suggestion:hover { background: rgba(18,201,235,.08); }
.wsp-chatbot__form { padding: 12px 14px; border-top: 1px solid var(--wsp-line); display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: end; background: rgba(1,11,22,.62); }
.wsp-chatbot__input { width: 100%; min-height: 48px; max-height: 110px; resize: none; border: 1px solid rgba(149,207,233,.24); border-radius: 13px; background: rgba(255,255,255,.055); color: white; padding: 12px; font: inherit; font-size: 14px; line-height: 1.35; }
.wsp-chatbot__input::placeholder { color: #819caf; }
.wsp-chatbot__send { min-width: 66px; min-height: 48px; border: 0; border-radius: 13px; background: linear-gradient(135deg, var(--wsp-blue), var(--wsp-cyan)); color: white; font: inherit; font-weight: 800; cursor: pointer; }
.wsp-chatbot__send:disabled { opacity: .55; cursor: wait; }
.wsp-chatbot__footer { padding: 10px 14px 12px; display: flex; justify-content: space-between; gap: 16px; align-items: center; color: var(--wsp-muted); font-size: 10px; }
.wsp-chatbot__footer p { margin: 0; }
.wsp-chatbot__footer a { color: #81ddff; font-weight: 750; text-decoration: none; white-space: nowrap; }
.wsp-chatbot__sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 520px) {
  .wsp-chatbot { right: 14px; bottom: 14px; }
  .wsp-chatbot__panel { position: fixed; inset: 10px 10px 82px; width: auto; height: auto; border-radius: 18px; }
  .wsp-chatbot__toggle-text { display: none; }
  .wsp-chatbot__toggle { width: 58px; padding: 0; justify-content: center; }
  .wsp-chatbot__star { margin-left: -2px; }
}

@media (prefers-reduced-motion: no-preference) {
  .wsp-chatbot__toggle { transition: transform .18s ease, filter .18s ease; }
  .wsp-chatbot__panel { animation: nfc-rise .2s ease-out; transform-origin: bottom right; }
  @keyframes nfc-rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
}
