:root {
  --yaarn-blue: #2c68b1;
  --yaarn-blue-soft: rgba(44, 104, 177, 0.74);
  --yaarn-blue-dark: rgba(34, 86, 143, 0.84);
  --yaarn-orange: #f26522;
  --yaarn-text: #525255;
  --panel-radius: 18px;
  --panel-radius-lg: 52px;
  --panel-radius-sm: 5px;
  --bg-start: #8eb8ec;
  --bg-end: #d8e9ff;
}

.ai-search-panel * {
  box-sizing: border-box;
}

.ai-search-panel .ea-app {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  border-radius: 18px;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  color: var(--yaarn-text);
  background: linear-gradient(92.5deg,
      rgba(44, 104, 177, 0.24) 0%,
      rgba(44, 104, 177, 0.24) 50%,
      rgba(87, 128, 178, 0.16) 100%);
}

.ea-app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 14px;
}

.ea-shell {
  --ea-shell-pad-x: 18px;
  --ea-shell-pad-y: 18px;
  --ea-header-height: 45px;
  --ea-main-top-gap: 22px;
  --ea-composer-space: 188px;
  position: relative;
  width: min(780px, 100%);
  height: min(940px, calc(100vh - 28px));
  padding: var(--ea-shell-pad-y) var(--ea-shell-pad-x);
  box-sizing: border-box;
  border-top-left-radius: var(--panel-radius-lg);
  border-top-right-radius: var(--panel-radius-sm);
  border-bottom-left-radius: var(--panel-radius-sm);
  border-bottom-right-radius: var(--panel-radius-sm);
  background: linear-gradient(92.5deg,
      rgba(44, 104, 177, 0.65) 0%,
      rgba(44, 104, 177, 0.65) 50%,
      rgba(87, 128, 178, 0.35) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}

.ea-header {
  position: absolute;
  top: var(--ea-shell-pad-y);
  left: var(--ea-shell-pad-x);
  right: var(--ea-shell-pad-x);
  min-height: var(--ea-header-height);
  border-radius: 24px;
  background: linear-gradient(to right, rgba(44, 104, 177, 0.2), rgba(44, 104, 177, 0.05));
  border: 0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: nowrap;
  box-sizing: border-box;
  padding: 4px 16px 5px 16px;
}

.ea-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 2px 0;
}

.ea-header-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.ea-header-title {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  color: #ffffff;
  white-space: nowrap;
  text-shadow: none;
}

.ea-new-chat-btn {
  border: 0;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ea-new-chat-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0.85;
}

.ea-new-chat-btn:hover img,
.ea-new-chat-btn:focus-visible img {
  opacity: 1;
}

.ea-main {
  position: absolute;
  top: calc(var(--ea-shell-pad-y) + var(--ea-header-height) + var(--ea-main-top-gap));
  left: var(--ea-shell-pad-x);
  right: var(--ea-shell-pad-x);
  bottom: calc(var(--ea-shell-pad-y) + var(--ea-composer-space));
}

.ea-initial-prompt {
  position: absolute;
  inset: 22.5% 36px auto;
  text-align: center;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: clamp(21px, 2.6vw, 26px);
  font-weight: 300;
  line-height: 1.22;
  letter-spacing: 0.1px;
}

.ea-chat-pane {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: transparent;
}

.ea-chat-list {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 2px 0 8px;
}

.ea-chat-row {
  display: flex;
  margin: 10px 0;
}

.ea-chat-row.assistant {
  justify-content: flex-start;
}

.ea-chat-row.user {
  justify-content: flex-end;
}

.ea-chat-bubble {
  max-width: 80%;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 17px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.ea-chat-row.assistant .ea-chat-bubble {
  background: rgba(255, 255, 255, 0.92);
  color: #2b4866;
}

.ea-chat-row.user .ea-chat-bubble {
  background: var(--yaarn-orange);
  color: #fff;
}

.ea-chat-bubble a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.ea-chat-row-typing {
  opacity: 0.98;
}

.ea-typing-bubble {
  min-width: 58px;
  height: calc(1.35em + 20px);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
}

.ea-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ea-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #8ea0b3;
  opacity: 0.35;
  animation: ea-typing-dot-bounce 1.15s ease-in-out infinite;
}

.ea-typing-dots span:nth-child(2) {
  animation-delay: 0.14s;
}

.ea-typing-dots span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes ea-typing-dot-bounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}


.ea-composer-wrap {
  position: absolute;
  left: var(--ea-shell-pad-x);
  right: var(--ea-shell-pad-x);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.ea-input-shell {
  background: rgba(250, 251, 252, 0.96);
  border-radius: 22px;
  border: 2px solid rgba(44, 104, 177, 0.62);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 16px;
}

.ea-input-shell.focused {
  border-color: var(--yaarn-orange);
  box-shadow: 0 0 0 2px rgba(242, 101, 34, 0.16);
}

#inputText {
  flex: 1;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--yaarn-text);
  min-height: 38px;
  max-height: 120px;
  font-size: 17px;
  line-height: 1.3;
  font-family: inherit;
  padding: 7px 0;
}

#inputText::placeholder {
  color: #b1b2b8;
}

.ea-send-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: var(--yaarn-orange);
  color: #fff;
  cursor: pointer;
}

.ea-send-btn:disabled {
  background: #d8d8dd;
  cursor: default;
}

.ea-send-arrow {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}


.ea-example-queries-btn {
  margin: 11px auto 0;
  display: block;
  border: 0;
  background: transparent;
  color: #d2d6dc;
  font-size: 17px;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.ea-example-queries-btn[hidden] {
  display: none !important;
}

.ea-quick-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ea-quick-actions[hidden] {
  display: none !important;
}


.ea-quick-chip {
  border: 1px solid #d8dde4;
  background: #ffffff;
  color: #9aa3af;
  border-radius: 999px;
  min-height: 42px;
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 300;
  text-align: center;
  cursor: pointer;
}

.ea-quick-chip:hover {
  background: #f2f4f7;
}

.ea-hidden {
  display: none !important;
}

.ea-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
}

.mode-initial .ea-main {
  top: calc(var(--ea-shell-pad-y) + var(--ea-header-height) + var(--ea-main-top-gap));
  left: var(--ea-shell-pad-x);
  right: var(--ea-shell-pad-x);
  bottom: var(--ea-shell-pad-y);
}

.mode-initial .ea-chat-pane,
.mode-initial #newChatButton {
  display: none;
}

.mode-initial .ea-composer-wrap {
  top: 42%;
  transform: translateY(-2%);
}

.mode-chat .ea-initial-prompt {
  display: none;
}

.mode-chat .ea-composer-wrap {
  bottom: max(var(--ea-shell-pad-y), env(safe-area-inset-bottom));
  transform: none;
}

.ai-search-panel.keyboard-open .ea-main {
  bottom: calc(max(var(--ea-shell-pad-y), env(safe-area-inset-bottom)) + 100px);
}

.ai-search-panel.keyboard-open .ea-composer-wrap {
  top: auto;
  bottom: 4px;
  transform: none;
}

.ai-search-panel.keyboard-open .mode-initial .ea-composer-wrap {
  top: auto;
  bottom: 4px;
  transform: none;
}

.ai-search-panel.keyboard-open .ea-initial-prompt {
  display: none;
}

.ai-search-panel.keyboard-open .mode-initial .ea-main {
  bottom: calc(max(var(--ea-shell-pad-y), env(safe-area-inset-bottom)) + 98px);
}

.ai-search-panel.keyboard-open .ea-example-queries-btn,
.ai-search-panel.keyboard-open .ea-quick-actions {
  display: none !important;
}

@media (max-width: 1024px) {
  .ai-search-panel.open:focus-within .ea-composer-wrap {
    top: auto !important;
    bottom: 4px !important;
    transform: none !important;
    transition: none !important;
  }

  .ai-search-panel.open:focus-within .ea-main {
    bottom: calc(max(var(--ea-shell-pad-y), env(safe-area-inset-bottom)) + 100px) !important;
  }

  .ai-search-panel.open:focus-within .ea-initial-prompt {
    display: none !important;
  }

  .ai-search-panel.open:focus-within .ea-example-queries-btn,
  .ai-search-panel.open:focus-within .ea-quick-actions {
    display: none !important;
  }

  .ai-search-panel.input-focus .ea-composer-wrap,
  .ea-app.input-focus .ea-composer-wrap {
    top: auto !important;
    bottom: 4px !important;
    transform: none !important;
  }

  .ai-search-panel.input-focus .ea-main,
  .ea-app.input-focus .ea-main {
    bottom: calc(max(var(--ea-shell-pad-y), env(safe-area-inset-bottom)) + 100px) !important;
  }

  .ai-search-panel.input-focus .ea-initial-prompt,
  .ea-app.input-focus .ea-initial-prompt {
    display: none !important;
  }

  .ai-search-panel.input-focus .ea-example-queries-btn,
  .ai-search-panel.input-focus .ea-quick-actions,
  .ea-app.input-focus .ea-example-queries-btn,
  .ea-app.input-focus .ea-quick-actions {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  .ea-shell {
    --ea-shell-pad-x: 16px;
    --ea-shell-pad-y: 16px;
    --ea-main-top-gap: 16px;
    --ea-composer-space: 176px;
  }

  .ea-initial-prompt {
    inset: 20% 28px auto;
    font-size: clamp(20px, 4.5vw, 24px);
  }
}

@media (max-width: 700px) {
  .ea-app {
    padding: 0;
  }

  .ai-search-panel .ea-app {
    border-radius: 14px;
  }

  .ea-shell {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    --ea-shell-pad-x: 14px;
    --ea-shell-pad-y: 14px;
    --ea-main-top-gap: 14px;
    --ea-composer-space: 164px;
    padding: var(--ea-shell-pad-y) var(--ea-shell-pad-x);
  }

  .ea-initial-prompt {
    inset: 18% 20px auto;
    font-size: clamp(19px, 5.2vw, 23px);
  }
}

@media (max-width: 640px) {
  .ea-shell {
    --ea-shell-pad-x: 13px;
    --ea-shell-pad-y: 13px;
    --ea-composer-space: 156px;
  }

  .ea-header {
    border-radius: 20px;
    padding: 4px 13px 5px 13px;
    min-height: var(--ea-header-height);
  }

  .ea-header-icon-img {
    width: 19px;
    height: 19px;
  }

  .ea-header-title {
    font-size: 17px;
  }
}

@media (max-width: 420px) {
  .ea-shell {
    --ea-shell-pad-x: 12px;
    --ea-shell-pad-y: 12px;
    --ea-composer-space: 148px;
  }

  .ea-header {
    border-radius: 19px;
    padding: 4px 11px 5px 11px;
    min-height: 39px;
  }

  .ea-header-icon-img {
    width: 17px;
    height: 17px;
  }

  .ea-header-title {
    font-size: 16px;
  }
}
