/* Ask AI — full-page GPT-style chat */

body.ask-ai-page {
  --ask-sidebar: 280px;
  --ask-topbar: 52px;
  --ask-composer: auto;
  --ask-bg: #f7f7f8;
  --ask-surface: #ffffff;
  --ask-border: #e5e7eb;
  --ask-user-bg: #2563eb;
  --ask-assistant-bg: transparent;
  --ask-text: #0f172a;
  --ask-muted: #64748b;
  background: var(--ask-bg);
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

body.ask-ai-page .site-header {
  position: relative;
  z-index: 40;
}

body.ask-ai-page .sh-trust {
  display: none;
}

body.ask-ai-page .sh-bar {
  border-bottom: 1px solid var(--ask-border);
  background: var(--ask-surface);
}

.ask-ai-app {
  display: flex;
  min-height: calc(100vh - 56px);
  min-height: calc(100dvh - 56px);
  max-height: calc(100dvh - 56px);
  overflow: hidden;
}

/* ── Sidebar ── */
.ask-ai-sidebar {
  width: var(--ask-sidebar);
  flex-shrink: 0;
  background: #0f172a;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1e293b;
  transition: transform 0.25s ease;
}

.ask-ai-sidebar__top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
}

.ask-ai-new-chat {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: transparent;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}

.ask-ai-new-chat:hover {
  background: #1e293b;
  border-color: #475569;
}

.ask-ai-sidebar-close {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  align-items: center;
  justify-content: center;
}

.ask-ai-sidebar-close:hover {
  background: #1e293b;
  color: #fff;
}

.ask-ai-sidebar__section {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 12px;
}

.ask-ai-sidebar__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 8px 4px 10px;
  margin: 0;
}

.ask-ai-sidebar__prompts {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ask-ai-sidebar__prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  line-height: 1.35;
  transition: background 0.12s;
  text-decoration: none;
}

.ask-ai-sidebar__prompt:hover {
  background: #1e293b;
  color: #f8fafc;
}

.ask-ai-sidebar__prompt span:first-child {
  font-size: 16px;
  flex-shrink: 0;
}

.ask-ai-sidebar__footer {
  padding: 12px;
  border-top: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ask-ai-sidebar__link {
  font-size: 12px;
  color: #64748b;
  padding: 6px 8px;
  border-radius: 6px;
  transition: color 0.12s, background 0.12s;
}

.ask-ai-sidebar__link:hover {
  color: #e2e8f0;
  background: #1e293b;
}

/* ── Main column ── */
.ask-ai-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--ask-bg);
  position: relative;
}

.ask-ai-topbar {
  height: var(--ask-topbar);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--ask-border);
  background: var(--ask-surface);
}

.ask-ai-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ask-text);
  align-items: center;
  justify-content: center;
}

.ask-ai-menu-btn:hover {
  background: #f1f5f9;
}

.ask-ai-topbar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.ask-ai-topbar__icon {
  font-size: 20px;
  line-height: 1;
}

.ask-ai-topbar__title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ask-ai-topbar__badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6366f1;
  background: #eef2ff;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #c7d2fe;
}

.ask-ai-topbar__search {
  font-size: 13px;
  font-weight: 600;
  color: var(--ask-muted);
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s;
}

.ask-ai-topbar__search:hover {
  background: #f1f5f9;
  color: var(--ask-text);
}

/* ── Messages ── */
.ask-ai-messages-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.ask-ai-messages {
  height: 100%;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 24px 16px 32px;
}

.ask-ai-messages.is-chatting .ask-ai-welcome {
  display: none;
}

/* Welcome */
.ask-ai-welcome {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 16px 24px;
  text-align: center;
}

.ask-ai-welcome__orb {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed, #ec4899);
  box-shadow: 0 12px 40px rgba(37, 99, 235, 0.25);
  animation: ask-ai-pulse 3s ease-in-out infinite;
}

@keyframes ask-ai-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 12px 40px rgba(37, 99, 235, 0.25); }
  50% { transform: scale(1.04); box-shadow: 0 16px 48px rgba(124, 58, 237, 0.3); }
}

.ask-ai-welcome__title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ask-text);
  margin: 0 0 10px;
}

.ask-ai-welcome__sub {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ask-muted);
  max-width: 480px;
  margin: 0 auto 32px;
}

.ask-ai-welcome__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}

.ask-ai-prompt-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--ask-border);
  border-radius: 14px;
  background: var(--ask-surface);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--ask-text);
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  text-decoration: none;
}

.ask-ai-prompt-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.1);
  transform: translateY(-1px);
}

.ask-ai-prompt-card__icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

/* Message rows */
.ask-ai-row {
  max-width: 768px;
  margin: 0 auto 24px;
  display: flex;
  gap: 16px;
  animation: ask-ai-fade-in 0.35s ease;
}

@keyframes ask-ai-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ask-ai-row--user {
  flex-direction: row-reverse;
}

.ask-ai-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
}

.ask-ai-row--user .ask-ai-avatar {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
}

.ask-ai-row--assistant .ask-ai-avatar {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  font-size: 16px;
}

.ask-ai-bubble {
  flex: 1;
  min-width: 0;
  max-width: calc(100% - 48px);
}

.ask-ai-row--user .ask-ai-bubble {
  display: flex;
  justify-content: flex-end;
}

.ask-ai-bubble__text {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.6;
  word-break: break-word;
}

.ask-ai-row--user .ask-ai-bubble__text {
  background: var(--ask-user-bg);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ask-ai-row--assistant .ask-ai-bubble__text {
  background: var(--ask-assistant-bg);
  color: var(--ask-text);
  padding-left: 0;
  padding-top: 4px;
}

.ask-ai-bubble__text strong {
  font-weight: 700;
}

.ask-ai-bubble__extra {
  margin-top: 12px;
}

.ask-ai-bubble__extra .mai-page-links-label,
.ask-ai-bubble__extra .mai-followups-label {
  margin-top: 4px;
}

.ask-ai-bubble__extra .mai-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.ask-ai-bubble__extra .mai-card {
  border-radius: 12px;
}

/* Typing indicator */
.ask-ai-typing {
  max-width: 768px;
  margin: 0 auto 24px;
  display: flex;
  gap: 16px;
  align-items: center;
  padding-left: 48px;
  color: var(--ask-muted);
  font-size: 14px;
}

.ask-ai-typing-dots {
  display: flex;
  gap: 4px;
}

.ask-ai-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: ask-ai-dot 1.2s ease-in-out infinite;
}

.ask-ai-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.ask-ai-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ask-ai-dot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

/* ── Composer ── */
.ask-ai-composer-wrap {
  flex-shrink: 0;
  padding: 12px 16px 20px;
  background: linear-gradient(to top, var(--ask-bg) 70%, transparent);
}

.ask-ai-composer {
  max-width: 768px;
  margin: 0 auto;
}

.ask-ai-input-shell {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 10px 10px 16px;
  background: var(--ask-surface);
  border: 1px solid var(--ask-border);
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ask-ai-input-shell:focus-within {
  border-color: #818cf8;
  box-shadow: 0 4px 28px rgba(99, 102, 241, 0.12);
}

.ask-ai-input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  max-height: 160px;
  padding: 6px 0;
  background: transparent;
  color: var(--ask-text);
}

.ask-ai-input::placeholder {
  color: #94a3b8;
}

.ask-ai-send {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  display: grid;
  place-items: center;
  transition: opacity 0.15s, transform 0.15s;
}

.ask-ai-send:not(:disabled):hover {
  transform: scale(1.05);
}

.ask-ai-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ask-ai-disclaimer {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  margin: 10px 0 0;
  line-height: 1.45;
}

/* Sidebar overlay (mobile) */
.ask-ai-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 56px 0 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 48;
}

.ask-ai-sidebar-backdrop.is-open {
  display: block;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .ask-ai-welcome__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .ask-ai-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .ask-ai-sidebar.is-open {
    transform: translateX(0);
  }

  .ask-ai-sidebar-close {
    display: flex;
  }

  .ask-ai-menu-btn {
    display: flex;
  }

  .ask-ai-topbar__badge {
    display: none;
  }

  .ask-ai-topbar__search {
    font-size: 12px;
    padding: 6px 8px;
  }

  .ask-ai-row {
    gap: 10px;
  }

  .ask-ai-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .ask-ai-bubble__extra .mai-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .ask-ai-messages {
    padding: 16px 12px 24px;
  }

  .ask-ai-welcome {
    padding-top: 24px;
  }

  .ask-ai-composer-wrap {
    padding: 8px 12px 16px;
  }
}

/* SEO — crawlable content blocks */
.ask-ai-noscript {
  max-width: 720px;
  margin: 12px auto;
  padding: 16px 20px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
}

.ask-ai-noscript ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.ask-ai-bubble--ssr .mai-page-block--ssr {
  padding: 0;
}

.ask-ai-bubble--ssr .mai-brand-title {
  font-size: 15px;
}

.mp-ai-seo-faq {
  max-width: 560px;
  margin: 28px auto 0;
  text-align: left;
}

.mp-ai-seo-faq__title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ask-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

.mp-ai-seo-faq__item {
  border: 1px solid var(--ask-border);
  border-radius: 10px;
  background: var(--ask-surface);
  margin-bottom: 8px;
  padding: 0 14px;
}

.mp-ai-seo-faq__item summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 0;
  color: var(--ask-text);
}

.mp-ai-seo-faq__item p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ask-muted);
  margin: 0 0 12px;
}

.mp-ai-seo-examples {
  max-width: 768px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

@media (min-width: 769px) {
  .mp-ai-seo-examples {
    display: none;
  }
}

.mp-ai-seo-examples__title {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--ask-text);
}

.mp-ai-seo-examples__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mp-ai-seo-examples__list a {
  display: block;
  padding: 10px 14px;
  border: 1px solid var(--ask-border);
  border-radius: 10px;
  background: var(--ask-surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--ask-text);
  text-decoration: none;
}

.mp-ai-seo-examples__list a:hover {
  border-color: #c7d2fe;
}

@media (max-width: 640px) {
  .mp-ai-seo-examples__list {
    grid-template-columns: 1fr;
  }
}
