/* Nia — Swerve website assistant. Scoped styles only; does not alter the existing site layout. */
.nia-root,
.nia-root * {
  box-sizing: border-box;
}

.nia-root {
  --nia-ink: #171717;
  --nia-muted: #6c6872;
  --nia-paper: #fffdf8;
  --nia-panel: #ffffff;
  --nia-border: rgba(23, 23, 23, 0.12);
  --nia-shadow: 0 22px 70px rgba(24, 18, 35, 0.18);
  --nia-violet: #7857ff;
  --nia-cyan: #42d7e8;
  --nia-lime: #c8ff55;
  --nia-pink: #ff74bd;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  font-family: 'Manrope', 'Arial Narrow', Arial, sans-serif;
  color: var(--nia-ink);
  line-height: 1.45;
}

.nia-launcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 7px 14px 7px 7px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 999px;
  background: rgba(20, 20, 22, .96);
  color: #fff;
  box-shadow: 0 12px 34px rgba(0,0,0,.20);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s ease, box-shadow .2s ease;
}

.nia-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0,0,0,.24);
}

.nia-launcher:focus-visible,
.nia-close:focus-visible,
.nia-send:focus-visible,
.nia-quick:focus-visible,
.nia-input:focus-visible {
  outline: 3px solid rgba(120, 87, 255, .32);
  outline-offset: 2px;
}

.nia-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  color: #111;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--nia-lime), var(--nia-cyan) 38%, var(--nia-violet) 72%, var(--nia-pink));
  border: 2px solid rgba(255,255,255,.8);
}

.nia-launcher-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.nia-launcher-label strong {
  font-size: 13px;
  font-weight: 750;
}

.nia-launcher-label span {
  margin-top: 3px;
  font-size: 10px;
  color: rgba(255,255,255,.72);
}

.nia-notice-dot {
  position: absolute;
  top: 1px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--nia-lime);
  border: 2px solid #171717;
  opacity: 0;
  transform: scale(.4);
}

.nia-root.nia-has-notice .nia-notice-dot {
  opacity: 1;
  transform: scale(1);
}

.nia-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(390px, calc(100vw - 28px));
  height: min(590px, calc(100vh - 110px));
  min-height: 430px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--nia-border);
  border-radius: 24px;
  background: var(--nia-panel);
  box-shadow: var(--nia-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.985);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}

.nia-root.nia-open .nia-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.nia-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 16px;
  color: #fff;
  background:
    radial-gradient(circle at 18% 0%, rgba(200,255,85,.35), transparent 35%),
    radial-gradient(circle at 92% 18%, rgba(255,116,189,.30), transparent 38%),
    linear-gradient(135deg, #171717 15%, #332657 100%);
}

.nia-head .nia-avatar {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}

.nia-head-copy {
  min-width: 0;
  flex: 1;
}

.nia-head-copy strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.nia-head-copy span {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: rgba(255,255,255,.72);
  font-size: 11px;
}

.nia-online {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nia-lime);
  box-shadow: 0 0 0 3px rgba(200,255,85,.12);
}

.nia-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.10);
  color: #fff;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.nia-close:hover {
  background: rgba(255,255,255,.17);
}

.nia-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 17px 15px 12px;
  background:
    linear-gradient(rgba(255,253,248,.96), rgba(255,253,248,.96)),
    radial-gradient(circle at 0 0, rgba(120,87,255,.11), transparent 28%);
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.nia-message {
  display: flex;
  margin: 0 0 11px;
}

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

.nia-bubble {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 15px;
  font-size: 13px;
  line-height: 1.48;
  box-shadow: 0 4px 15px rgba(30,25,40,.05);
}

.nia-assistant .nia-bubble {
  background: #fff;
  border: 1px solid rgba(23,23,23,.08);
  border-bottom-left-radius: 5px;
}

.nia-user .nia-bubble {
  background: #1c1c1f;
  color: #fff;
  border-bottom-right-radius: 5px;
}

.nia-bubble p {
  margin: 0;
}

.nia-bubble p + p {
  margin-top: 8px;
}

.nia-bubble strong {
  font-weight: 800;
}

.nia-bubble a {
  color: #5d42dc;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nia-user .nia-bubble a {
  color: #fff;
}

.nia-quick-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 15px 12px;
  background: var(--nia-paper);
}

.nia-quick {
  border: 1px solid rgba(23,23,23,.14);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
  color: #2a272e;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.nia-quick:hover {
  transform: translateY(-1px);
  border-color: rgba(120,87,255,.42);
  background: #fbfaff;
}

.nia-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 11px 12px 12px;
  border-top: 1px solid rgba(23,23,23,.08);
  background: #fff;
}

.nia-input {
  width: 100%;
  min-height: 44px;
  max-height: 104px;
  resize: none;
  border: 1px solid rgba(23,23,23,.14);
  border-radius: 14px;
  padding: 11px 12px;
  background: #fff;
  color: var(--nia-ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
}

.nia-input::placeholder {
  color: #938d9b;
}

.nia-send {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: #171717;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  transition: transform .18s ease, opacity .18s ease;
}

.nia-send:hover {
  transform: translateY(-1px);
}

.nia-send:disabled {
  opacity: .45;
  cursor: default;
  transform: none;
}

.nia-disclaimer {
  margin: -3px 12px 10px;
  text-align: center;
  color: #97919e;
  font-size: 9px;
  line-height: 1.3;
}

.nia-root.nia-prompting .nia-launcher {
  animation: niaPrompt 1.2s ease 1;
}

@keyframes niaPrompt {
  0%, 100% { transform: translateY(0); }
  28% { transform: translateY(-5px); }
  52% { transform: translateY(0); }
  72% { transform: translateY(-2px); }
}

@media (max-width: 640px) {
  .nia-root {
    right: 12px;
    bottom: 12px;
  }

  .nia-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 76px;
    width: auto;
    height: min(575px, calc(100dvh - 94px));
    min-height: 380px;
    border-radius: 20px;
  }

  .nia-launcher {
    min-height: 50px;
    padding-right: 12px;
  }

  .nia-launcher .nia-avatar {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .nia-launcher-label span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nia-panel,
  .nia-launcher,
  .nia-quick,
  .nia-send,
  .nia-notice-dot,
  .nia-messages {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
