/* =========================================================
   01. Widget Box Model
========================================================= */

.ask-starweb-button,
.ask-starweb-panel,
.ask-starweb-panel * {
  box-sizing: border-box;
}

/* =========================================================
   02. Floating Launcher Button
========================================================= */

.ask-starweb-button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 209, 102, 0.34);
  border-radius: 999px;
  background: linear-gradient(180deg, #10284b 0%, #07182f 58%, #050b14 100%);
  color: #ffffff;
  padding: 15px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ask-starweb-button img {
  display: block;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.ask-starweb-button span {
  color: #ffffff;
  line-height: 1;
}

.ask-starweb-button:hover {
  border-color: rgba(255, 209, 102, 0.52);
  filter: brightness(1.05);
}

.ask-starweb-button:focus-visible {
  outline: 3px solid rgba(255, 209, 102, 0.42);
  outline-offset: 3px;
}

/* =========================================================
   03. Chat Panel Shell
========================================================= */

.ask-starweb-panel {
  position: fixed;
  right: 22px;
  bottom: 86px;
  width: 360px;
  max-width: calc(100vw - 28px);
  height: 520px;
  max-height: calc(100vh - 115px);
  z-index: 9999;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  display: none;
  flex-direction: column;
  border: 1px solid rgba(7, 24, 47, 0.16);
  transition: width .35s ease;
}

.ask-starweb-panel.open {
  display: flex;
}

.ask-starweb-panel.meeting-open {
  width: 760px;
  max-width: calc(100vw - 28px);
}

/* =========================================================
   04. Panel Header
========================================================= */

.ask-starweb-header {
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.08) 0%, rgba(255, 209, 102, 0) 34%),
    linear-gradient(180deg, #10284b 0%, #07182f 58%, #050b14 100%);
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #ffd166;
}

.ask-starweb-title {
  font-size: 16px;
  font-weight: 800;
}

.ask-starweb-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 3px;
}

.ask-starweb-close {
  background: transparent;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.ask-starweb-close:hover,
.ask-starweb-close:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

/* =========================================================
   05. Layout Columns
========================================================= */

.ask-starweb-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.ask-starweb-chat-column {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* =========================================================
   06. Message Area
========================================================= */

.ask-starweb-messages {
  flex: 1;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  background: #f5f6f8;
}

.ask-starweb-message {
  padding: 11px 13px;
  border-radius: 14px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.45;
  max-width: 88%;
  white-space: pre-wrap;
}

.ask-starweb-message.bot {
  background: #ffffff;
  color: #171717;
  border-top-left-radius: 4px;
}

.ask-starweb-message.user {
  background: #050505;
  color: #ffffff;
  margin-left: auto;
  border-top-right-radius: 4px;
}

.ask-starweb-message a {
  color: #0b2347;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(255, 209, 102, 0.9);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  word-break: break-word;
}

.ask-starweb-message a:hover {
  color: #14325f;
}

/* =========================================================
   07. Source Links
========================================================= */

.ask-starweb-sources {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(7, 24, 47, 0.12);
}

.ask-starweb-sources-title {
  margin-bottom: 7px;
  color: #5b6577;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ask-starweb-sources a {
  display: block;
  margin-top: 6px;
  color: #07182f;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.32;
  text-decoration: none;
}

.ask-starweb-sources a:hover {
  color: #0b4ea2;
  text-decoration: underline;
  text-decoration-color: rgba(255, 209, 102, 0.9);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* =========================================================
   08. Suggested Questions
========================================================= */

.ask-starweb-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.ask-starweb-suggestions button {
  border: 1px solid #d8d8d8;
  background: #ffffff;
  color: #111111;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
}

.ask-starweb-suggestions button:hover {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

/* =========================================================
   09. Input Form
========================================================= */

.ask-starweb-form {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e5e5e5;
  background: #ffffff;
}

.ask-starweb-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #d7d7d7;
  border-radius: 999px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
}

.ask-starweb-input:focus {
  border-color: #050505;
}

.ask-starweb-send {
  flex: 0 0 auto;
  min-height: 44px;
  border: 1px solid rgba(255, 209, 102, 0.34);
  background: linear-gradient(180deg, #10284b 0%, #07182f 58%, #050b14 100%);
  color: #ffffff;
  border-radius: 999px;
  padding: 0 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    0 8px 18px rgba(7, 24, 47, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ask-starweb-send:hover {
  border-color: rgba(255, 209, 102, 0.52);
  filter: brightness(1.05);
}

.ask-starweb-send:focus-visible {
  outline: 3px solid rgba(255, 209, 102, 0.36);
  outline-offset: 2px;
}

/* =========================================================
   10. Typing Indicator
========================================================= */

.ask-starweb-typing {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ask-starweb-typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ask-starweb-typing-dots span {
  width: 6px;
  height: 6px;
  background: #111111;
  border-radius: 50%;
  display: block;
  animation: askStarwebTypingBounce 1s infinite ease-in-out;
}

.ask-starweb-typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.ask-starweb-typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.ask-starweb-typing-text {
  font-size: 12px;
  font-weight: 700;
  color: #444444;
}

@keyframes askStarwebTypingBounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.35;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* =========================================================
   11. Lead Buttons
========================================================= */

.ask-starweb-lead-box {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e6e6e6;
}

.ask-starweb-lead-text {
  font-size: 12px;
  color: #555555;
  font-weight: 700;
  margin-bottom: 8px;
}

.ask-starweb-lead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ask-starweb-lead-button,
.ask-starweb-schedule-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none !important;
}

.ask-starweb-lead-button {
  background: #061a35;
  color: #ffffff !important;
  border: 1px solid #061a35;
}

.ask-starweb-lead-button:hover {
  background: #000000;
  border-color: #000000;
}

.ask-starweb-schedule-button {
  background: #ffffff;
  color: #061a35;
  border: 1px solid #061a35;
}

.ask-starweb-schedule-button:hover {
  background: #061a35;
  color: #ffffff;
}

/* =========================================================
   12. Meeting Panel
========================================================= */

.ask-starweb-meeting-panel {
  flex: 0 0 0;
  width: 0;
  min-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
  border-left: 0;
  display: flex;
  flex-direction: column;
  transition:
    flex-basis .35s ease,
    width .35s ease,
    opacity .25s ease;
}

.ask-starweb-panel.meeting-open .ask-starweb-meeting-panel {
  flex: 0 0 340px;
  width: 340px;
  opacity: 1;
  pointer-events: auto;
  border-left: 1px solid #e5e5e5;
  overflow-y: auto;
}

.ask-starweb-meeting-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ask-starweb-meeting-title {
  font-size: 18px;
  font-weight: 900;
  color: #061a35;
}

.ask-starweb-meeting-subtitle {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

.ask-starweb-meeting-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #d8dee8;
  background: #ffffff;
  color: #061a35;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.ask-starweb-meeting-close:hover {
  background: #061a35;
  color: #ffffff;
}

.ask-starweb-meeting-form {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.ask-starweb-meeting-form input,
.ask-starweb-meeting-form select,
.ask-starweb-meeting-form textarea {
  width: 100%;
  border: 1px solid #d7deea;
  background: #ffffff;
  color: #111827;
  border-radius: 12px;
  padding: 12px 13px;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.ask-starweb-meeting-form input::placeholder,
.ask-starweb-meeting-form textarea::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.ask-starweb-meeting-form input:focus,
.ask-starweb-meeting-form select:focus,
.ask-starweb-meeting-form textarea:focus {
  border-color: #061a35;
  box-shadow: 0 0 0 3px rgba(6, 26, 53, 0.12), 0 8px 22px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.ask-starweb-meeting-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ask-starweb-meeting-form textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.45;
}

.ask-starweb-meeting-submit {
  margin-top: 2px;
  width: 100%;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #061a35, #0b2f63);
  color: #ffffff;
  padding: 13px 16px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(6, 26, 53, 0.24);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.ask-starweb-meeting-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(6, 26, 53, 0.3);
  background: linear-gradient(135deg, #000000, #061a35);
}

.ask-starweb-meeting-result {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  margin-top: 4px;
}

.ask-starweb-meeting-result.success {
  color: #14532d;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 12px;
  padding: 10px 12px;
}

.ask-starweb-meeting-result.error {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 10px 12px;
}

/* =========================================================
   13. Confirmation Message
========================================================= */

.ask-starweb-message.ask-starweb-confirmation {
  max-width: 90%;
  margin: 12px auto 14px !important;
  text-align: center;
  background: #dcfce7 !important;
  border: 1px solid #86efac !important;
  color: #14532d !important;
  font-weight: 800 !important;
  box-shadow: 0 8px 22px rgba(20, 83, 45, 0.12) !important;
}

.ask-starweb-message.ask-starweb-confirmation > div {
  width: 100%;
}

.ask-starweb-message.ask-starweb-confirmation .ask-starweb-lead-box {
  display: none !important;
}

/* =========================================================
   14. Mobile Layout
========================================================= */

@media (max-width: 600px) {
  body.ask-starweb-modal-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
  }

  .ask-starweb-panel,
  .ask-starweb-panel.meeting-open {
    top: var(--ask-starweb-top, 0px);
    left: 0;
    right: 0;
    bottom: auto;
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    height: var(--ask-starweb-height, 100dvh);
    max-height: none;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  .ask-starweb-header {
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
  }

  .ask-starweb-layout {
    flex-direction: column;
  }

  .ask-starweb-chat-column {
    flex: 1 1 auto;
    min-height: 0;
  }

  .ask-starweb-messages {
    padding: 14px;
    overscroll-behavior: contain;
  }

  .ask-starweb-form {
    gap: 7px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .ask-starweb-input {
    min-width: 0;
    padding: 11px 12px;
    font-size: 16px;
  }

  .ask-starweb-send {
    min-width: 62px;
    min-height: 44px;
    padding: 0 14px;
  }

  .ask-starweb-button {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 13px 16px;
  }

  .ask-starweb-panel.meeting-open .ask-starweb-meeting-panel {
    flex: 0 0 auto;
    width: 100%;
    max-height: 46vh;
    border-left: 0;
    border-top: 1px solid #e5e5e5;
  }

  .ask-starweb-meeting-row {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   15. Narrow Phone Adjustments
========================================================= */

@media (max-width: 380px) {
  .ask-starweb-form {
    gap: 6px;
    padding: 9px;
  }

  .ask-starweb-send {
    min-width: 58px;
    padding: 0 12px;
  }
}