﻿/**
 * Ask MedAudPro â€” immersive studio + contextual dock.
 * Navy/cream brand atmosphere. Soft blur, shimmer, conversational motion.
 */

/* ---------- Studio shell ---------- */
.mp-ask-page .site-main.mp-ask-studio,
body.mp-ask-page #inner-wrap {
  background: transparent;
}

.mp-ask-studio {
  position: relative;
  min-height: calc(100vh - var(--mp-header-height, 72px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(47, 120, 189, 0.16), transparent 55%),
    radial-gradient(900px 500px at 88% 0%, rgba(23, 37, 79, 0.12), transparent 50%),
    linear-gradient(180deg, #fbfaf6 0%, #f3f6fa 48%, #eef2f7 100%);
}

.mp-ask-studio__atmosphere {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.mp-ask-studio__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: mpAskOrb 14s ease-in-out infinite alternate;
}

.mp-ask-studio__orb--a {
  width: 42vw;
  height: 42vw;
  max-width: 520px;
  max-height: 520px;
  left: -8%;
  top: 8%;
  background: rgba(47, 120, 189, 0.28);
}

.mp-ask-studio__orb--b {
  width: 36vw;
  height: 36vw;
  max-width: 440px;
  max-height: 440px;
  right: -6%;
  bottom: 12%;
  background: rgba(23, 37, 79, 0.18);
  animation-delay: -4s;
}

.mp-ask-studio__grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes mpAskOrb {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(3%, 4%, 0) scale(1.08); }
}

.mp-ask-studio__shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
  min-height: calc(100vh - var(--mp-header-height, 72px));
  padding: 20px 0 28px;
}

.mp-ask-studio__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.mp-ask-studio__identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mp-ask-studio__pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mp-blue);
  box-shadow: 0 0 0 0 rgba(47, 120, 189, 0.45);
  animation: mpAskPulse 2.4s ease-out infinite;
}

@keyframes mpAskPulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 120, 189, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(47, 120, 189, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 120, 189, 0); }
}

.mp-ask-studio__brand {
  margin: 0;
  color: var(--mp-navy);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mp-ask-studio__usage {
  margin: 2px 0 0;
  color: var(--mp-muted);
  font-size: 12px;
}

.mp-ask-studio__mode-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(23, 37, 79, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.mp-ask-studio__mode-switch button {
  border: 0;
  background: transparent;
  color: var(--mp-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.mp-ask-studio__mode-switch button.is-active {
  background: var(--mp-navy);
  color: #fff;
}

.mp-ask-studio__banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(23, 37, 79, 0.08);
  color: var(--mp-muted);
  font-size: 13px;
  backdrop-filter: blur(12px);
}

.mp-ask-studio__thread {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 8px 2px 24px;
  mask-image: linear-gradient(180deg, transparent 0, #000 16px, #000 calc(100% - 8px), transparent 100%);
}

.mp-ask-studio__welcome {
  padding: 48px 8px 28px;
  text-align: center;
  animation: mpAskFadeUp 520ms ease both;
}

.mp-ask-studio__welcome h1 {
  margin: 0 0 12px;
  color: var(--mp-navy);
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.05em;
  font-weight: 600;
}

.mp-ask-studio__welcome > p {
  margin: 0 auto 28px;
  max-width: 34em;
  color: var(--mp-muted);
  font-size: 16px;
  line-height: 1.55;
}

@keyframes mpAskFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.mp-ask-studio__prompts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.mp-ask-studio__chip {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(23, 37, 79, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--mp-navy);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.mp-ask-studio__chip:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 120, 189, 0.35);
  background: rgba(255, 255, 255, 0.88);
}

.mp-ask-studio__chip-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.55) 45%, transparent 70%);
  transform: translateX(-120%);
  animation: mpAskShimmer 3.6s ease-in-out infinite;
}

.mp-ask-studio__chip--compact {
  padding: 8px 12px;
  font-size: 12px;
}

@keyframes mpAskShimmer {
  0%, 55% { transform: translateX(-120%); }
  75%, 100% { transform: translateX(120%); }
}

/* Messages */
.mp-ask-msg {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
  animation: mpAskFadeUp 380ms ease both;
}

.mp-ask-msg--user {
  justify-items: end;
}

.mp-ask-msg__bubble {
  max-width: min(92%, 640px);
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.mp-ask-msg--user .mp-ask-msg__bubble {
  background: var(--mp-navy);
  color: #fff;
  border-bottom-right-radius: 8px;
}

.mp-ask-msg--assistant .mp-ask-msg__bubble {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(23, 37, 79, 0.08);
  color: var(--mp-navy);
  border-bottom-left-radius: 8px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(7, 31, 70, 0.06);
}

.mp-ask-msg__meta {
  color: var(--mp-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Thinking train */
.mp-ask-thinking {
  display: grid;
  gap: 8px;
  max-width: min(92%, 420px);
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(23, 37, 79, 0.08);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.mp-ask-thinking__label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mp-navy);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mp-ask-thinking__dots span {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 3px;
  border-radius: 50%;
  background: var(--mp-blue);
  animation: mpAskDot 1.1s ease-in-out infinite;
}

.mp-ask-thinking__dots span:nth-child(2) { animation-delay: 0.15s; }
.mp-ask-thinking__dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes mpAskDot {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.mp-ask-thinking__steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.mp-ask-thinking__steps li {
  position: relative;
  padding-left: 14px;
  color: var(--mp-muted);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.35;
  transition: opacity 220ms ease, color 220ms ease;
}

.mp-ask-thinking__steps li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(23, 37, 79, 0.2);
}

.mp-ask-thinking__steps li.is-active {
  opacity: 1;
  color: var(--mp-navy);
}

.mp-ask-thinking__steps li.is-active::before {
  background: var(--mp-blue);
  box-shadow: 0 0 0 3px rgba(47, 120, 189, 0.18);
}

.mp-ask-thinking__steps li.is-done {
  opacity: 0.7;
}

.mp-ask-msg__citations {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(92%, 640px);
}

.mp-ask-msg__citations a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(23, 37, 79, 0.1);
  background: rgba(255, 255, 255, 0.7);
  color: var(--mp-navy);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(10px);
  transition: border-color 160ms ease, background 160ms ease;
}

.mp-ask-msg__citations a:hover {
  border-color: rgba(47, 120, 189, 0.35);
  background: #fff;
}

/* Composer */
.mp-ask-studio__composer {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding-top: 8px;
}

.mp-ask-studio__composer-glass {
  padding: 14px 14px 12px;
  border-radius: 22px;
  border: 1px solid rgba(23, 37, 79, 0.1);
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 18px 50px rgba(7, 31, 70, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}

.mp-ask-studio__composer textarea {
  width: 100%;
  border: 0;
  resize: none;
  background: transparent;
  color: var(--mp-navy);
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  outline: none;
  max-height: 180px;
}

.mp-ask-studio__composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.mp-ask-studio__hint {
  margin: 0;
  color: var(--mp-muted);
  font-size: 12px;
}

.mp-ask-studio__send {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--mp-navy);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.mp-ask-studio__send:hover {
  background: var(--mp-deep);
  transform: translateY(-1px);
}

.mp-ask-studio__send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.mp-ask-studio__disclaimer {
  margin: 10px 0 0;
  text-align: center;
  color: var(--mp-muted);
  font-size: 11px;
}

/* Gate */
.mp-ask-studio__gate {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 1;
  padding: 48px 20px;
}

.mp-ask-studio__gate-card {
  width: min(520px, 100%);
  padding: 36px 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(23, 37, 79, 0.08);
  box-shadow: 0 20px 60px rgba(7, 31, 70, 0.1);
  backdrop-filter: blur(20px);
  text-align: center;
  animation: mpAskFadeUp 520ms ease both;
}

.mp-ask-studio__gate-card h1 {
  margin: 8px 0 12px;
  color: var(--mp-navy);
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -0.045em;
}

.mp-ask-studio__gate-card > p {
  margin: 0 0 22px;
  color: var(--mp-muted);
}

.mp-ask-studio__gate-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Contextual side agent (opt-in, under header) ---------- */
:root {
  --mp-ask-header-offset: 0px;
  --mp-ask-agent-width: 380px;
}

.mp-ask-agent__launch {
  position: fixed;
  z-index: 140;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px 11px 12px;
  border: 1px solid rgba(23, 37, 79, 0.14);
  border-radius: 999px;
  background: #fff !important;
  color: var(--mp-navy) !important;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(23, 37, 79, 0.12);
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mp-ask-agent__launch-label {
  color: var(--mp-navy) !important;
}

.mp-ask-agent__launch:hover {
  background: var(--mp-cream) !important;
  color: var(--mp-navy) !important;
  box-shadow: 0 14px 32px rgba(23, 37, 79, 0.14);
  transform: translateY(-1px);
}

.mp-ask-agent.is-open .mp-ask-agent__launch {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
}

.mp-ask-agent__launch-mark {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mp-blue);
}

.mp-ask-agent__panel {
  position: fixed;
  z-index: 120;
  top: var(--mp-ask-header-offset, 0px);
  right: 0;
  bottom: 0;
  width: min(var(--mp-ask-agent-width), 100vw);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid rgba(23, 37, 79, 0.1);
  box-shadow: -12px 0 40px rgba(23, 37, 79, 0.08);
  transform: translateX(105%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 240ms;
}

.mp-ask-agent.is-open .mp-ask-agent__panel {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}

@media (min-width: 1100px) {
  body.mp-ask-agent-open .site-main.mp-page,
  body.mp-ask-agent-open .site-main {
    padding-right: min(var(--mp-ask-agent-width), 100vw);
    transition: padding-right 240ms cubic-bezier(0.22, 1, 0.36, 1);
  }
}

.mp-ask-agent__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(23, 37, 79, 0.08);
  background: #fff;
}

.mp-ask-agent__brand {
  margin: 0;
  color: var(--mp-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mp-ask-agent__context {
  margin: 6px 0 0;
  color: var(--mp-navy);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.mp-ask-agent__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(23, 37, 79, 0.12);
  border-radius: 50%;
  background: #fff;
  color: var(--mp-navy);
  line-height: 0;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.mp-ask-agent__close svg {
  display: block;
  pointer-events: none;
}

.mp-ask-agent__close:hover {
  background: var(--mp-cream);
  border-color: rgba(23, 37, 79, 0.22);
}

.mp-ask-agent__thread {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 16px 16px 8px;
  background: #fff;
}

.mp-ask-agent__welcome > p {
  margin: 0 0 14px;
  color: var(--mp-muted);
  font-size: 13px;
  line-height: 1.5;
}

.mp-ask-agent__prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mp-ask-agent__chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(23, 37, 79, 0.12);
  border-radius: 999px;
  background: var(--mp-cream);
  color: var(--mp-navy) !important;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.mp-ask-agent__chip:hover {
  background: var(--mp-navy);
  border-color: var(--mp-navy);
  color: #fff !important;
}

.mp-ask-agent__composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  flex-shrink: 0;
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(23, 37, 79, 0.08);
  background: var(--mp-cream);
}

.mp-ask-agent__composer textarea {
  width: 100%;
  border: 1px solid rgba(23, 37, 79, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  resize: none;
  background: #fff;
  color: var(--mp-navy);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.mp-ask-agent__composer textarea:focus {
  border-color: rgba(47, 120, 189, 0.55);
}

.mp-ask-agent__send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--mp-navy);
  color: #fff;
  line-height: 0;
  cursor: pointer;
  transition: background 140ms ease;
}

.mp-ask-agent__send svg {
  display: block;
  pointer-events: none;
}

.mp-ask-agent__send:hover {
  background: var(--mp-blue);
  color: #fff;
}

.mp-ask-agent__gate {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 22px;
  text-align: center;
}

.mp-ask-agent__gate p {
  margin: 0 0 18px;
  color: var(--mp-muted);
  font-size: 14px;
  line-height: 1.5;
}

.mp-ask-agent__gate-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1099px) {
  .mp-ask-studio__shell {
    width: min(100%, calc(100% - 20px));
    padding-top: 12px;
  }

  .mp-ask-studio__welcome {
    padding-top: 28px;
  }

  .mp-ask-agent__panel {
    width: min(100vw, 420px);
    z-index: 200;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mp-ask-studio__orb,
  .mp-ask-studio__pulse,
  .mp-ask-studio__chip-shimmer,
  .mp-ask-msg,
  .mp-ask-studio__welcome,
  .mp-ask-agent__panel,
  body.mp-ask-agent-open .site-main {
    animation: none !important;
    transition: none;
  }

  .mp-ask-studio__thread,
  .mp-ask-agent__thread {
    scroll-behavior: auto;
  }
}

/* Keep briefings styles from prior ask.css */
.mp-briefings__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.mp-briefings__card {
  display: block;
  padding: 18px 18px 20px;
  border: 1px solid var(--mp-border-light);
  border-radius: var(--mp-radius);
  background: var(--mp-cream);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--mp-shadow-soft);
}

.mp-briefings__card:hover {
  background: var(--mp-white);
  border-color: rgba(47, 120, 189, 0.35);
}

.mp-briefings__date {
  display: block;
  margin-bottom: 6px;
  color: var(--mp-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mp-briefings__title {
  margin: 0;
  color: var(--mp-navy);
  font-size: 20px;
  letter-spacing: -0.03em;
}

.mp-briefings__excerpt {
  margin: 8px 0 0;
  color: var(--mp-muted);
  line-height: 1.45;
}

.mp-briefings__content {
  max-width: 720px;
  padding-bottom: 48px;
}

.mp-partner-byline {
  margin: 0 0 12px;
  color: var(--mp-muted);
  font-size: 13px;
}

.mp-partner-byline__name {
  color: var(--mp-navy);
  font-weight: 600;
}

