@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&display=swap");

:root {
  --oa-font-body: "Montserrat", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --oa-primary-700: #4745c7;
  --oa-primary: #5b59d6;
  --oa-primary-400: #817fe7;
  --oa-primary-100: #e1e0ff;
  --oa-lavender: #f3f2ff;
  --oa-yellow: #ffe845;
  --oa-green: #5ee97b;
  --oa-black: #1a1a1a;
  --oa-white: #ffffff;
  --oa-text: #242437;
  --oa-muted: #686779;
  --oa-faint: #a9a9b8;
  --oa-panel-bg: #fdfcff;
  --oa-border: rgba(91, 89, 214, 0.12);
  --oa-card-border: rgba(26, 26, 26, 0.07);
  --oa-shadow: 0 24px 80px rgba(26, 26, 26, 0.22);
  --oa-soft-shadow: 0 12px 28px rgba(26, 26, 26, 0.09);
  --oa-header-gradient: linear-gradient(165deg, #817fe7 0%, #5b59d6 55%, #4745c7 100%);
  --oa-user-gradient: linear-gradient(145deg, #5b59d6, #4745c7);
}

.oa-widget,
.oa-widget * {
  box-sizing: border-box;
  letter-spacing: 0;
}

.oa-widget {
  position: fixed;
  z-index: 2147483000;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  caret-color: transparent;
  font-family: var(--oa-font-body);
  color: var(--oa-text);
}

.oa-widget input,
.oa-widget textarea,
.oa-widget [contenteditable]:not([contenteditable="false"]) {
  caret-color: auto;
}

.oa-widget button,
.oa-widget input,
.oa-widget textarea {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
}

.oa-widget button {
  -webkit-tap-highlight-color: transparent;
}

.oa-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  /* stylelint-disable-next-line property-no-deprecated -- Legacy fallback for older visually-hidden support. */
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.oa-panel {
  position: absolute;
  right: 0;
  bottom: 82px;
  width: min(384px, calc(100vw - 28px));
  height: min(638px, calc(100vh - 112px));
  height: min(638px, calc(100dvh - 112px));
  min-height: min(520px, calc(100vh - 112px));
  min-height: min(520px, calc(100dvh - 112px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  background: var(--oa-panel-bg);
  box-shadow: var(--oa-shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(18px) scale(0.96);
  transform-origin: bottom right;
  transition:
    opacity 180ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    width 320ms cubic-bezier(0.22, 1, 0.36, 1),
    height 320ms cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 260ms ease,
    visibility 0s linear 260ms;
}

.oa-widget[data-open="true"] .oa-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.oa-panel:focus {
  outline: none;
}

.oa-widget[data-screen="article"] .oa-panel {
  width: min(720px, calc(100vw - 28px));
  height: min(760px, calc(100vh - 112px));
}

.oa-body {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--oa-panel-bg);
}

.oa-widget[data-open="true"][data-motion="forward"] .oa-body > section {
  animation: ob-screen-forward 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.oa-widget[data-open="true"][data-motion="backward"] .oa-body > section {
  animation: ob-screen-backward 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.oa-onebot-logo,
.oa-bot-icon {
  display: block;
  object-fit: contain;
}

.oa-launcher {
  position: relative;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 22px;
  color: var(--oa-white);
  background: var(--oa-user-gradient);
  box-shadow: 0 16px 40px rgba(71, 69, 199, 0.4);
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.oa-launcher:not(:hover):not(:active) {
  animation: ob-idle-attention 7s ease-in-out infinite;
}

.oa-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(71, 69, 199, 0.44);
}

.oa-widget[data-open="true"] .oa-launcher {
  animation: none;
}

.oa-launcher svg {
  width: 30px;
  height: 30px;
}

.oa-launcher-mark .oa-bot-icon {
  width: 40px;
  height: 40px;
  filter: brightness(0) invert(1);
}

.oa-launcher-badge {
  position: absolute;
  right: -3px;
  bottom: -2px;
  font-size: 23px;
  line-height: 1;
  transform-origin: 70% 80%;
  animation: ob-wave-hand 2.2s ease-in-out infinite;
}

.oa-widget[data-motion-paused="true"] *,
.oa-widget[data-motion-paused="true"] *::before,
.oa-widget[data-motion-paused="true"] *::after {
  animation-play-state: paused !important;
}

.oa-launcher-badge::after {
  content: none;
}

.oa-launcher:focus-visible,
.oa-close:focus-visible,
.oa-action-card:focus-visible,
.oa-resume-card:focus-visible,
.oa-chat-back:focus-visible,
.oa-chat-close:focus-visible,
.oa-screen-back:focus-visible,
.oa-screen-close:focus-visible,
.oa-send:focus-visible,
.oa-chip:focus-visible,
.oa-help-card:focus-visible,
.oa-help-fallback:focus-visible,
.oa-history-resume:focus-visible,
.oa-history-delete:focus-visible,
.oa-search-submit:focus-visible,
.oa-email-submit:focus-visible,
.oa-article-back:focus-visible,
.oa-article-open:focus-visible,
.oa-article-close:focus-visible,
.oa-resource-card:focus-visible {
  outline: 3px solid rgba(255, 232, 69, 0.95);
  outline-offset: 2px;
}

.oa-chat-feedback button:focus-visible {
  outline: 3px solid rgba(255, 232, 69, 0.95);
  outline-offset: 2px;
}

/* Home */
.oa-home-screen {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow-y: auto;
  background: var(--oa-panel-bg);
}

.oa-home-hero,
.oa-screen-hero,
.oa-chat-header {
  position: relative;
  overflow: hidden;
  color: var(--oa-white);
  background: var(--oa-header-gradient);
}

.oa-home-hero {
  padding: 18px 20px 58px;
  border-bottom: 1px solid rgba(91, 89, 214, 0.08);
  color: var(--oa-text);
  background: linear-gradient(170deg, #ffffff 0%, #e8e6ff 55%, #d6d4ff 100%);
}

.oa-blob {
  position: absolute;
  pointer-events: none;
  content: "";
}

.oa-blob-one {
  top: -50px;
  left: -40px;
  width: 150px;
  height: 150px;
  border-radius: 46% 54% 60% 40% / 50% 44% 56% 50%;
  background: rgba(91, 89, 214, 0.08);
  animation: none;
}

.oa-blob-two {
  right: -30px;
  bottom: -60px;
  width: 130px;
  height: 130px;
  border-radius: 54% 46% 40% 60% / 44% 56% 50% 50%;
  background: rgba(255, 232, 69, 0.35);
  animation: none;
}

.oa-home-topbar,
.oa-screen-topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.oa-home-topbar .oa-onebot-logo {
  width: 112px;
  filter: saturate(1.18) contrast(1.1);
}

.oa-home-topbar .oa-close {
  border: 1.5px solid rgba(91, 89, 214, 0.15);
  color: var(--oa-primary);
  background: var(--oa-white);
  box-shadow: 0 4px 12px rgba(91, 89, 214, 0.12);
}

.oa-home-topbar .oa-close:hover {
  background: var(--oa-white);
  box-shadow: 0 7px 16px rgba(91, 89, 214, 0.16);
}

.oa-close,
.oa-chat-back,
.oa-chat-close,
.oa-screen-back,
.oa-screen-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  color: var(--oa-white);
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition:
    background 150ms ease,
    transform 150ms ease;
}

.oa-close:hover,
.oa-chat-back:hover,
.oa-chat-close:hover,
.oa-screen-back:hover,
.oa-screen-close:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.oa-close svg,
.oa-chat-back svg,
.oa-chat-close svg,
.oa-screen-back svg,
.oa-screen-close svg {
  width: 19px;
  height: 19px;
}

.oa-home-intro {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.oa-mascot-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
}

.oa-mascot {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(145deg, #7471e7, #4d4bc9);
  box-shadow: 0 12px 30px rgba(71, 69, 199, 0.4);
  animation: ob-float 4.5s ease-in-out infinite;
}

.oa-mascot .oa-bot-icon {
  width: 58px;
  height: 58px;
  filter: brightness(0) invert(1);
}

.oa-wave {
  position: absolute;
  right: -3px;
  bottom: 3px;
  font-size: 26px;
  transform-origin: 70% 80%;
  animation: ob-wave-hand 2.2s ease-in-out infinite;
}

.oa-home-intro h2 {
  margin: 0;
  color: var(--oa-text);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.15;
}

.oa-home-intro p {
  margin: 6px 0 0;
  color: var(--oa-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.oa-home-cards {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: start;
  gap: 12px;
  margin-top: -30px;
  padding: 0 16px 18px;
}

.oa-action-card,
.oa-resume-card {
  width: 100%;
  border: 1px solid var(--oa-card-border);
  color: var(--oa-text);
  background: var(--oa-white);
  box-shadow: var(--oa-soft-shadow);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.oa-widget [data-screen-focus]:focus {
  outline: none;
}

.oa-widget [data-screen-focus]:focus-visible {
  text-decoration: underline 2px var(--oa-yellow);
  text-underline-offset: 4px;
}

.oa-widget[data-open="true"] .oa-action-card,
.oa-widget[data-open="true"] .oa-resume-card {
  animation: ob-reveal-up 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.oa-action-card {
  min-height: 80px;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 13px;
  border-radius: 18px;
  padding: 14px;
}

.oa-widget[data-open="true"] .oa-action-card:nth-child(2) {
  animation-delay: 60ms;
}

.oa-widget[data-open="true"] .oa-action-card:nth-child(3) {
  animation-delay: 120ms;
}

.oa-widget[data-open="true"] .oa-action-card:nth-child(4) {
  animation-delay: 180ms;
}

.oa-widget[data-open="true"] .oa-resume-card {
  animation-delay: 240ms;
}

.oa-action-card:hover,
.oa-resume-card:hover {
  transform: translateY(-1px);
  border-color: rgba(91, 89, 214, 0.26);
  box-shadow: 0 16px 34px rgba(26, 26, 26, 0.12);
}

.oa-primary-action {
  border: 2px solid rgba(91, 89, 214, 0.22);
}

.oa-card-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--oa-primary-100);
}

.oa-card-icon-image {
  width: 58px;
  height: 58px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 7px 8px rgba(51, 39, 119, 0.18));
}

.oa-action-card[data-action="help"] .oa-card-icon-image {
  filter: saturate(1.24) contrast(1.1) brightness(0.94)
    drop-shadow(0 7px 8px rgba(51, 39, 119, 0.2));
}

.oa-card-text {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.oa-card-text strong {
  color: var(--oa-text);
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.2;
}

.oa-card-text span {
  color: var(--oa-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.oa-card-arrow {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--oa-primary);
  background: var(--oa-lavender);
  font-size: 18px;
  font-weight: 800;
}

.oa-primary-action .oa-card-arrow {
  color: var(--oa-primary-700);
  background: var(--oa-yellow);
}

.oa-resume-card {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 9px;
  border: 1.5px dashed rgba(91, 89, 214, 0.25);
  border-radius: 14px;
  padding: 11px 14px;
  background: #f8f8fd;
}

.oa-resume-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--oa-primary-100);
}

.oa-resume-icon .oa-bot-icon {
  width: 17px;
  height: 17px;
}

.oa-resume-text {
  min-width: 0;
  overflow: hidden;
  color: var(--oa-muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oa-resume-link {
  color: var(--oa-primary-700);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

/* Chat */
.oa-chat-screen,
.oa-help-screen,
.oa-email-screen {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  overflow: hidden;
}

.oa-chat-screen {
  grid-template-rows: auto 1fr auto;
}

.oa-chat-header {
  min-height: 70px;
  display: grid;
  grid-template-columns: 32px 42px 1fr 32px;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(91, 89, 214, 0.1);
  color: var(--oa-text);
  background: var(--oa-white);
}

.oa-chat-blob {
  display: none;
  top: -42px;
  right: -42px;
  width: 118px;
  height: 118px;
  border-radius: 54% 46% 45% 55% / 44% 58% 42% 56%;
  background: rgba(255, 232, 69, 0.18);
  animation: ob-float 7s ease-in-out infinite;
}

.oa-chat-header .oa-chat-back,
.oa-chat-header .oa-chat-close {
  border: 1.5px solid rgba(91, 89, 214, 0.12);
  color: var(--oa-primary);
  background: var(--oa-lavender);
}

.oa-chat-header .oa-chat-back:hover,
.oa-chat-header .oa-chat-close:hover {
  background: var(--oa-primary-100);
}

.oa-chat-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--oa-white);
  animation: ob-bob 3.2s ease-in-out infinite;
}

.oa-chat-avatar .oa-bot-icon {
  width: 28px;
  height: 28px;
}

.oa-online-dot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 11px;
  height: 11px;
  border: 2.5px solid var(--oa-white);
  border-radius: 999px;
  background: var(--oa-green);
}

.oa-chat-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.oa-chat-title .oa-onebot-logo {
  width: 88px;
}

.oa-chat-title strong {
  color: var(--oa-white);
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.2;
}

.oa-chat-title span {
  color: var(--oa-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.oa-messages {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(225, 224, 255, 0.35), rgba(255, 255, 255, 0) 30%),
    var(--oa-panel-bg);
  scroll-behavior: auto;
}

.oa-chat-history-notice {
  margin: 0 auto 2px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--oa-muted);
  background: rgba(91, 89, 214, 0.08);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.oa-message {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.oa-message-new,
.oa-message-intro,
.oa-consent-message,
.oa-loading-message {
  animation: ob-pop 400ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.oa-message-content {
  position: relative;
  min-width: 0;
}

.oa-sent-plane {
  position: absolute;
  right: 14px;
  bottom: -8px;
  width: 20px;
  height: 20px;
  color: var(--oa-yellow);
  pointer-events: none;
  filter: drop-shadow(0 4px 5px rgba(43, 40, 130, 0.2));
  animation: ob-message-flight 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.oa-sent-plane svg {
  width: 100%;
  height: 100%;
}

.oa-message[data-role="assistant"] .oa-message-content {
  max-width: min(300px, 80%);
}

.oa-message[data-role="user"] {
  justify-content: flex-end;
}

.oa-message[data-role="user"] .oa-message-content {
  max-width: min(300px, 86%);
}

.oa-message-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--oa-primary-100);
}

.oa-message-avatar .oa-bot-icon {
  width: 19px;
  height: 19px;
}

.oa-bubble {
  padding: 11px 14px;
  border-radius: 18px;
  color: var(--oa-text);
  background: var(--oa-white);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.oa-bubble a,
.oa-resources a {
  color: var(--oa-primary-700);
  font-weight: 700;
  text-decoration: none;
}

.oa-bubble a:hover,
.oa-resources a:hover {
  text-decoration: underline;
}

.oa-message[data-role="assistant"] .oa-bubble {
  border: 1.5px solid var(--oa-border);
  border-bottom-left-radius: 6px;
  box-shadow: 0 2px 10px rgba(26, 26, 26, 0.05);
}

.oa-message[data-role="user"] .oa-bubble {
  border-bottom-right-radius: 6px;
  color: var(--oa-white);
  background: var(--oa-user-gradient);
}

.oa-message[data-role="user"] .oa-bubble a {
  color: var(--oa-white);
}

.oa-consent-message {
  margin-left: 36px;
}

.oa-consent-message .oa-message-content {
  max-width: 100%;
}

.oa-message[data-role="assistant"] .oa-legal-bubble {
  border: 0;
  border-radius: 14px;
  color: var(--oa-text);
  background: rgba(26, 26, 26, 0.045);
  box-shadow: none;
  font-size: 10.5px;
  font-style: italic;
  line-height: 1.45;
}

.oa-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 0 36px;
}

.oa-chip {
  border: 1.5px solid rgba(91, 89, 214, 0.25);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--oa-primary-700);
  background: var(--oa-white);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.oa-chip:hover {
  border-color: var(--oa-primary);
  background: var(--oa-primary-100);
  transform: translateY(-1px);
}

.oa-resources {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.oa-resource-card {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1.5px solid rgba(91, 89, 214, 0.18);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--oa-text);
  background: var(--oa-white);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(26, 26, 26, 0.04);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.oa-message-new .oa-resource-card {
  animation: ob-resource-reveal 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.oa-message-new .oa-resource-card:nth-child(2) {
  animation-delay: 90ms;
}

.oa-message-new .oa-resource-card:nth-child(3) {
  animation-delay: 180ms;
}

.oa-resource-card:hover {
  border-color: rgba(91, 89, 214, 0.35);
  transform: translateX(3px);
  box-shadow: 0 8px 20px rgba(26, 26, 26, 0.08);
}

.oa-resource-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--oa-primary-100);
  font-size: 18px;
}

.oa-resource-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.oa-resource-text strong {
  overflow: hidden;
  color: var(--oa-primary-700);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oa-resource-text span {
  color: var(--oa-muted);
  font-size: 10.5px;
  font-weight: 600;
}

.oa-resource-open {
  color: var(--oa-primary);
  font-size: 12px;
  font-weight: 800;
}

.oa-loading-message .oa-message-avatar {
  animation: ob-thinking-avatar 1.4s ease-in-out infinite;
}

.oa-typing {
  width: 54px;
  display: inline-flex;
  justify-content: center;
  gap: 5px;
}

.oa-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--oa-primary-400);
  animation: ob-dots 900ms ease-in-out infinite;
}

.oa-typing span:nth-child(2) {
  animation-delay: 120ms;
}

.oa-typing span:nth-child(3) {
  animation-delay: 240ms;
}

.oa-chat-feedback {
  align-self: center;
  width: min(100%, 300px);
  margin: 4px 0 2px;
  padding: 12px;
  border: 1px solid rgba(91, 89, 214, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 5px 18px rgba(44, 42, 120, 0.07);
  text-align: center;
}

.oa-chat-feedback p {
  margin: 0 0 9px;
  color: var(--oa-text);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
}

.oa-chat-feedback > div {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.oa-chat-feedback button {
  min-width: 72px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgba(91, 89, 214, 0.24);
  border-radius: 999px;
  color: var(--oa-primary);
  background: var(--oa-white);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.oa-chat-feedback button:hover {
  background: rgba(91, 89, 214, 0.08);
}

.oa-chat-feedback button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.oa-chat-feedback-complete button {
  width: 100%;
  color: var(--oa-white);
  background: var(--oa-primary);
}

.oa-chat-feedback-complete button:hover {
  background: var(--oa-primary-700);
}

.oa-widget .oa-composer {
  width: 100%;
  min-width: 0;
  display: block;
  margin: 0;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(26, 26, 26, 0.07);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  background: var(--oa-white);
  box-shadow: none;
}

.oa-widget .oa-composer-field {
  position: relative;
  min-height: 54px;
  overflow: hidden;
  border: 1.5px solid rgba(91, 89, 214, 0.22);
  border-radius: 999px;
  background: var(--oa-white);
  box-shadow: 0 4px 14px rgba(91, 89, 214, 0.08);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.oa-widget .oa-input {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  max-height: 84px;
  display: block;
  margin: 0;
  border: 0;
  border-radius: 0;
  resize: none;
  overflow-y: auto;
  padding: 14px 58px 12px 18px;
  color: var(--oa-text);
  background: transparent;
  box-shadow: none;
  outline: none;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.42;
}

.oa-input::placeholder,
.oa-help-query::placeholder,
.oa-email-form input::placeholder,
.oa-email-form textarea::placeholder {
  color: var(--oa-faint);
}

.oa-widget .oa-composer-field:focus-within {
  border-color: rgba(91, 89, 214, 0.5);
  box-shadow:
    0 4px 14px rgba(91, 89, 214, 0.08),
    0 0 0 3px rgba(91, 89, 214, 0.12);
}

.oa-send,
.oa-search-submit {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: var(--oa-white);
  background: linear-gradient(145deg, var(--oa-primary-400), var(--oa-primary));
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease;
}

.oa-send {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
}

.oa-send:hover,
.oa-search-submit:hover {
  box-shadow: 0 4px 14px rgba(91, 89, 214, 0.3);
}

.oa-send:hover {
  transform: translateY(-50%) scale(1.05);
}

.oa-send:disabled,
.oa-email-submit:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.oa-send svg,
.oa-search-submit svg {
  width: 19px;
  height: 19px;
}

/* Help and email screens */
.oa-help-screen,
.oa-email-screen {
  grid-template-rows: auto 1fr;
  background: var(--oa-panel-bg);
}

.oa-screen-hero {
  padding: 13px 16px 44px;
}

.oa-screen-topbar {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
}

.oa-screen-topbar h2 {
  margin: 0;
  overflow: hidden;
  color: var(--oa-white);
  font-size: 15.5px;
  font-weight: 800;
  line-height: 32px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oa-help-blob {
  left: -44px;
  bottom: -52px;
  width: 126px;
  height: 126px;
  border-radius: 46% 54% 60% 40% / 50% 44% 56% 50%;
  background: rgba(255, 255, 255, 0.12);
  animation: none;
}

.oa-widget .oa-help-search {
  position: relative;
  z-index: 1;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.oa-widget .oa-search-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: auto 1fr 34px;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 8px 7px 18px;
  background: var(--oa-white);
  box-shadow: 0 10px 26px rgba(38, 36, 110, 0.25);
}

.oa-widget .oa-help-query {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--oa-text);
  background: transparent;
  box-shadow: none;
  outline: none;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
}

.oa-search-submit {
  width: 34px;
  height: 34px;
}

.oa-search-progress {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  gap: 3px;
}

.oa-widget[data-help-state="searching"] .oa-search-submit {
  color: var(--oa-primary);
  background: var(--oa-yellow);
  opacity: 1;
}

.oa-guide-label {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  color: var(--oa-white);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.oa-help-content {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  margin-top: -22px;
  padding: 0 14px 18px;
}

.oa-history-empty {
  align-content: center;
}

.oa-help-suggestions {
  display: grid;
  gap: 10px;
}

.oa-help-empty-state {
  min-height: 148px;
  justify-items: center;
  align-content: center;
}

.oa-help-empty-mascot {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--oa-primary-100);
  animation: ob-empty-reaction 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.oa-help-empty-mascot .oa-bot-icon {
  width: 34px;
  height: 34px;
}

.oa-help-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--oa-card-border);
  border-radius: 16px;
  padding: 13px 14px;
  color: var(--oa-text);
  background: var(--oa-white);
  box-shadow: 0 12px 28px rgba(26, 26, 26, 0.08);
  text-decoration: none;
  animation: ob-pop 420ms ease both;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.oa-help-card:nth-child(2) {
  animation-delay: 80ms;
}

.oa-help-card:nth-child(3) {
  animation-delay: 160ms;
}

.oa-help-card:nth-child(4) {
  animation-delay: 240ms;
}

.oa-help-card:nth-child(5) {
  animation-delay: 320ms;
}

.oa-help-card:hover {
  border-color: rgba(91, 89, 214, 0.24);
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(26, 26, 26, 0.12);
}

.oa-help-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--oa-primary-100);
  font-size: 21px;
}

.oa-help-card-text {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.oa-help-card strong {
  overflow: hidden;
  color: var(--oa-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oa-help-card-text > span:last-child {
  display: -webkit-box;
  overflow: hidden;
  color: var(--oa-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.oa-help-arrow {
  color: var(--oa-primary);
  font-size: 18px;
  font-weight: 800;
}

.oa-help-fallback {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 9px;
  border: 1.5px dashed rgba(91, 89, 214, 0.28);
  border-radius: 14px;
  padding: 11px 13px;
  color: var(--oa-primary-700);
  background: var(--oa-lavender);
  cursor: pointer;
  text-align: left;
}

.oa-help-fallback-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--oa-white);
  animation: ob-bob 3s ease-in-out infinite;
}

.oa-history-card {
  display: flex;
  align-items: center;
  gap: 8px;
  transform-origin: top center;
}

.oa-history-card.is-removing {
  overflow: hidden;
  animation: ob-history-remove 220ms ease both;
  pointer-events: none;
}

.oa-history-card.is-resuming {
  animation: ob-history-resume 180ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  pointer-events: none;
}

.oa-history-resume {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.oa-history-delete {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--oa-card-border);
  border-radius: 12px;
  background: var(--oa-white);
  font-size: 16px;
  cursor: pointer;
}

.oa-history-delete:hover {
  border-color: rgba(214, 62, 62, 0.35);
  background: #fff2f2;
}

.oa-help-fallback-icon .oa-bot-icon {
  width: 20px;
  height: 20px;
}

.oa-help-fallback span:not(.oa-help-fallback-icon) {
  min-width: 0;
  color: var(--oa-primary-700);
  font-size: 11.5px;
  font-weight: 700;
}

.oa-help-fallback strong {
  color: var(--oa-primary);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

/* Email */
.oa-email-blob {
  top: -42px;
  right: -42px;
  width: 118px;
  height: 118px;
  border-radius: 54% 46% 45% 55% / 44% 58% 42% 56%;
  background: rgba(255, 232, 69, 0.18);
  animation: none;
}

.oa-email-reassurance {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.oa-email-mascot {
  position: relative;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--oa-white);
  animation: ob-bob 3.2s ease-in-out infinite;
}

.oa-email-mascot .oa-bot-icon {
  width: 34px;
  height: 34px;
}

.oa-email-mascot span {
  position: absolute;
  right: -4px;
  bottom: -2px;
  font-size: 18px;
}

.oa-email-reassurance p {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
}

.oa-widget .oa-email-form {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 13px;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 18px;
  background: transparent;
  box-shadow: none;
}

.oa-widget .oa-email-form label {
  display: grid;
  gap: 7px;
  color: var(--oa-text);
  font-size: 12px;
  font-weight: 800;
}

.oa-widget .oa-email-form input,
.oa-widget .oa-email-form textarea {
  width: 100%;
  margin: 0;
  border: 1.5px solid rgba(26, 26, 26, 0.1);
  border-radius: 14px;
  color: var(--oa-text);
  background: var(--oa-white);
  box-shadow: none;
  outline: none;
  padding: 13px 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.oa-email-form input {
  min-height: 46px;
}

.oa-email-form textarea {
  min-height: 88px;
  resize: vertical;
}

.oa-email-form input:focus,
.oa-email-form textarea:focus {
  border-color: var(--oa-primary);
  box-shadow: 0 0 0 3px rgba(91, 89, 214, 0.12);
}

.oa-email-submit {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  color: var(--oa-white);
  background: linear-gradient(145deg, var(--oa-primary-400), var(--oa-primary));
  box-shadow: 0 10px 26px rgba(91, 89, 214, 0.3);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease;
}

.oa-history-undo {
  position: sticky;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--oa-white);
  background: #2f2e46;
  box-shadow: 0 14px 34px rgba(26, 26, 26, 0.24);
  font-size: 12px;
  font-weight: 700;
  animation: ob-toast-in 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.oa-history-undo button {
  border: 0;
  border-radius: 999px;
  padding: 7px 11px;
  color: #2f2e46;
  background: var(--oa-yellow);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.oa-email-button-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}

.oa-email-button-icon svg {
  width: 20px;
  height: 20px;
  transition: transform 180ms ease;
}

.oa-email-submit:hover:not(:disabled) .oa-email-button-icon svg {
  transform: translate(3px, -2px) rotate(-6deg);
}

.oa-email-submit.is-success {
  background: linear-gradient(145deg, #53d878, #2ca653);
  animation: ob-success-pop 460ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.oa-email-spinner {
  width: 17px;
  height: 17px;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--oa-white);
  border-radius: 999px;
  animation: ob-spin 720ms linear infinite;
}

.oa-email-check {
  font-size: 18px;
  line-height: 1;
}

.oa-email-form-error {
  animation: ob-error-shake 360ms ease both;
}

.oa-email-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(91, 89, 214, 0.34);
}

.oa-email-note {
  margin: 0;
  color: var(--oa-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.oa-status {
  margin: 0;
  border: 1.5px solid rgba(94, 233, 123, 0.5);
  border-radius: 14px;
  padding: 11px 13px;
  color: #1d7a38;
  background: rgba(94, 233, 123, 0.12);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
  animation: ob-status-reveal 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.oa-status[hidden] {
  display: none;
}

.oa-status-error {
  border-color: rgba(235, 69, 32, 0.28);
  color: #a4311b;
  background: rgba(235, 69, 32, 0.08);
}

/* Help search states */
.oa-help-searching {
  min-height: 150px;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(91, 89, 214, 0.12);
  border-radius: 18px;
  padding: 24px;
  background: linear-gradient(145deg, var(--oa-white), var(--oa-lavender));
  box-shadow: var(--oa-soft-shadow);
  animation: ob-pop 320ms ease both;
}

.oa-help-search-mascot {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--oa-primary-100);
  animation: ob-thinking-avatar 1.4s ease-in-out infinite;
}

.oa-help-search-mascot .oa-bot-icon {
  width: 34px;
  height: 34px;
}

.oa-help-searching > span:last-child {
  display: grid;
  gap: 5px;
}

.oa-help-searching strong {
  color: var(--oa-text);
  font-size: 13px;
}

.oa-help-searching small {
  color: var(--oa-muted);
  font-size: 11px;
  line-height: 1.4;
}

.oa-help-results .oa-help-card {
  animation-name: ob-result-reveal;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

.oa-help-empty {
  margin: 0;
  padding: 14px 4px;
  color: var(--oa-muted);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

/* Article screen */
.oa-article-screen {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: var(--oa-white);
}

.oa-article-toolbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(26, 26, 26, 0.07);
  background: var(--oa-white);
}

.oa-article-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #263440;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oa-article-back,
.oa-article-open,
.oa-article-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #2f3a46;
  background: transparent;
  cursor: pointer;
  transition:
    background 150ms ease,
    color 150ms ease;
}

.oa-article-back {
  margin-right: auto;
}

.oa-article-back:hover,
.oa-article-open:hover,
.oa-article-close:hover {
  background: var(--oa-primary-100);
  color: var(--oa-primary);
}

.oa-article-back svg,
.oa-article-open svg,
.oa-article-close svg {
  width: 20px;
  height: 20px;
}

.oa-article-error {
  margin: 0;
  padding: 22px;
  color: var(--oa-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.oa-article-loading {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}

.oa-article-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #fafaff, var(--oa-white));
}

.oa-article-skeleton {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 46px 1fr;
  grid-template-rows: repeat(3, auto) 1fr;
  align-content: start;
  gap: 14px 16px;
  padding: 34px;
  background: linear-gradient(180deg, #fafaff, var(--oa-white));
  transition:
    opacity 240ms ease,
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 280ms;
}

.oa-article-skeleton-brand {
  grid-row: 1 / span 3;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--oa-primary-100);
  animation: ob-thinking-avatar 1.6s ease-in-out infinite;
}

.oa-article-skeleton-brand .oa-bot-icon {
  width: 30px;
  height: 30px;
}

.oa-article-load-error {
  display: grid;
  gap: 6px;
  align-self: center;
}

.oa-article-load-error strong {
  color: var(--oa-text);
  font-size: 15px;
}

.oa-article-load-error small {
  color: var(--oa-muted);
  font-size: 12px;
  line-height: 1.5;
}

.oa-article-stage[data-error="true"] .oa-article-skeleton {
  grid-template-rows: auto;
  align-content: center;
}

.oa-skeleton-line,
.oa-skeleton-card {
  position: relative;
  overflow: hidden;
  display: block;
  border-radius: 999px;
  background: #ecebfa;
}

.oa-skeleton-line::after,
.oa-skeleton-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.9) 48%, transparent 76%);
  transform: translateX(-100%);
  animation: ob-shimmer 1.25s ease-in-out infinite;
}

.oa-skeleton-line {
  height: 12px;
}

.oa-skeleton-line-title {
  width: min(420px, 78%);
  height: 22px;
}

.oa-skeleton-line-short {
  width: 62%;
}

.oa-skeleton-card {
  grid-column: 1 / -1;
  height: 210px;
  margin-top: 18px;
  border-radius: 20px;
}

.oa-article-frame {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: var(--oa-white);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 260ms ease,
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.oa-article-stage[data-loaded="true"] .oa-article-skeleton {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
}

.oa-article-stage[data-loaded="true"] .oa-article-frame {
  opacity: 1;
  transform: translateY(0);
}

@keyframes ob-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

@keyframes ob-wiggle {
  0%,
  100% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

@keyframes ob-float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-9px) rotate(3deg);
  }
}

@keyframes ob-wave-hand {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(18deg);
  }
  50% {
    transform: rotate(-8deg);
  }
  75% {
    transform: rotate(12deg);
  }
}

@keyframes ob-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.oa-send-default,
.oa-send-progress {
  display: grid;
  place-items: center;
}

.oa-send-progress {
  display: none;
  grid-template-columns: repeat(3, 4px);
  gap: 3px;
}

.oa-send-progress > span,
.oa-search-progress > span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentcolor;
  animation: ob-dots 800ms ease-in-out infinite;
}

.oa-send-progress > span:nth-child(2),
.oa-search-progress > span:nth-child(2) {
  animation-delay: 110ms;
}

.oa-send-progress > span:nth-child(3),
.oa-search-progress > span:nth-child(3) {
  animation-delay: 220ms;
}

.oa-send-loading {
  opacity: 1 !important;
  transform: translateY(-50%) scale(0.94);
}

.oa-send-loading .oa-send-default {
  display: none;
}

.oa-send-loading .oa-send-progress {
  display: grid;
}

.oa-card-icon,
.oa-card-arrow {
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.oa-action-card:hover .oa-card-icon,
.oa-action-card:focus-visible .oa-card-icon {
  transform: perspective(240px) translateY(-2px) rotateX(7deg) rotateY(-8deg) scale(1.04);
}

.oa-action-card:hover .oa-card-arrow,
.oa-action-card:focus-visible .oa-card-arrow {
  transform: translateX(4px) rotate(-4deg);
}

@keyframes ob-reveal-up {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ob-screen-forward {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes ob-screen-backward {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes ob-dots {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

@keyframes ob-ping {
  from {
    opacity: 0.7;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(2.1);
  }
}

@keyframes ob-idle-attention {
  0%, 72%, 100% { transform: rotate(0deg) scale(1); }
  76% { transform: rotate(-5deg) scale(1.03); }
  80% { transform: rotate(5deg) scale(1.03); }
  84% { transform: rotate(-3deg) scale(1.02); }
  88% { transform: rotate(2deg) scale(1.01); }
  92% { transform: rotate(0deg) scale(1); }
}

@keyframes ob-idle-wave {
  0%, 72%, 100% { transform: rotate(0deg); }
  77% { transform: rotate(20deg); }
  82% { transform: rotate(-10deg); }
  87% { transform: rotate(14deg); }
  92% { transform: rotate(0deg); }
}

@keyframes ob-message-flight {
  0% { opacity: 0; transform: translate(70px, 88px) rotate(18deg) scale(0.7); }
  55% { opacity: 1; }
  100% { opacity: 0; transform: translate(0, 0) rotate(-8deg) scale(1); }
}

@keyframes ob-resource-reveal {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ob-result-reveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ob-thinking-avatar {
  0%, 100% { transform: translateY(0) rotate(-2deg) scale(1); }
  50% { transform: translateY(-5px) rotate(3deg) scale(1.05); }
}

@keyframes ob-empty-reaction {
  0% { opacity: 0; transform: translateY(8px) rotate(-8deg) scale(0.82); }
  62% { opacity: 1; transform: translateY(-2px) rotate(4deg) scale(1.06); }
  100% { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

@keyframes ob-history-remove {
  from { opacity: 1; max-height: 180px; transform: scale(1); }
  to { opacity: 0; max-height: 0; padding-block: 0; transform: scale(0.96); }
}

@keyframes ob-history-resume {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: translateX(18px) scale(1.02); }
}

@keyframes ob-toast-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ob-status-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ob-success-pop {
  0% { transform: scale(0.96); }
  65% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

@keyframes ob-error-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

@keyframes ob-spin { to { transform: rotate(360deg); } }
@keyframes ob-shimmer { to { transform: translateX(100%); } }

@media (max-width: 540px) {
  .oa-widget {
    inset: auto max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) auto;
  }

  .oa-widget[data-open="true"] {
    inset: 0 auto auto 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
  }

  .oa-widget[data-open="true"] .oa-launcher {
    display: none;
  }

  .oa-panel,
  .oa-widget[data-screen="article"] .oa-panel {
    inset: 0;
    width: auto;
    max-width: none;
    height: auto;
    min-height: 0;
    border: 0;
    border-radius: 0;
    transform: translateY(24px);
    transform-origin: bottom center;
    transition:
      opacity 160ms ease,
      transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 220ms;
  }

  .oa-widget[data-open="true"] .oa-panel,
  .oa-widget[data-open="true"][data-screen="article"] .oa-panel {
    transform: translateY(0);
  }

  .oa-home-hero {
    padding: max(22px, calc(env(safe-area-inset-top) + 14px)) 20px 58px;
  }

  .oa-chat-header {
    padding-top: max(13px, calc(env(safe-area-inset-top) + 8px));
  }

  .oa-screen-hero {
    padding-top: max(13px, calc(env(safe-area-inset-top) + 8px));
  }

  .oa-article-toolbar {
    padding-top: max(10px, calc(env(safe-area-inset-top) + 10px));
  }

  .oa-home-cards {
    padding-inline: 14px;
  }

  .oa-message[data-role="assistant"] .oa-message-content {
    max-width: min(310px, calc(100vw - 82px));
  }

  .oa-message[data-role="user"] .oa-message-content {
    max-width: min(310px, calc(100vw - 56px));
  }

  .oa-article-skeleton {
    padding: 24px 18px;
  }
}

@media (max-width: 360px) {
  .oa-home-intro {
    align-items: flex-start;
  }

  .oa-mascot-wrap,
  .oa-mascot {
    width: 74px;
    height: 74px;
  }

  .oa-mascot .oa-bot-icon {
    width: 50px;
    height: 50px;
  }

  .oa-home-intro h2 {
    font-size: 19px;
  }

  .oa-action-card {
    grid-template-columns: 48px 1fr auto;
    padding: 12px;
  }

  .oa-card-icon {
    width: 48px;
    height: 48px;
  }

  .oa-card-text strong {
    font-size: 13.5px;
  }

  .oa-card-text span {
    font-size: 11.5px;
  }

  .oa-help-card {
    grid-template-columns: 40px 1fr auto;
    padding-inline: 12px;
  }

  .oa-help-icon {
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .oa-widget *,
  .oa-widget *::before,
  .oa-widget *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
