/* =========================================================
   WEBSDOCS RTC — LIVE CONVERSATION DEMO
   COMPLETE REPLACEMENT STYLESHEET
   Full-width / 4K-ready / existing JavaScript hooks preserved
========================================================= */

#ai-demo.ai-demo-section {
  --demo-bg: #f3f7fb;
  --demo-panel: #ffffff;
  --demo-soft: #eaf1f8;
  --demo-ink: #07182c;
  --demo-text: #17324d;
  --demo-muted: #61758a;
  --demo-line: #c8d5e2;
  --demo-line-strong: #9db2c7;
  --demo-navy: #071525;
  --demo-navy-2: #0d2943;
  --demo-blue: #2f71d8;
  --demo-cyan: #57c9dc;
  --demo-green: #68d5b2;
  --demo-danger: #cb3157;
  --demo-white: #ffffff;

  position: relative;
  z-index: 1;
  isolation: isolate;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: hidden;
  padding: clamp(78px, 7vw, 142px) 0;
  border-top: 1px solid var(--demo-line);
  border-bottom: 1px solid var(--demo-line);
  color: var(--demo-text);
  background:
    linear-gradient(rgba(7, 24, 44, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 24, 44, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 8% 0%, rgba(47, 113, 216, 0.11), transparent 30%),
    radial-gradient(circle at 92% 8%, rgba(87, 201, 220, 0.12), transparent 28%),
    var(--demo-bg);
  background-size: 72px 72px, 72px 72px, auto, auto, auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#ai-demo,
#ai-demo *,
#ai-demo *::before,
#ai-demo *::after {
  box-sizing: border-box;
}

#ai-demo button,
#ai-demo input {
  font: inherit;
}

#ai-demo .ai-demo-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding-inline: clamp(18px, 4.5vw, 150px);
}

/* =========================================================
   SECTION HEADER
========================================================= */

#ai-demo .ai-demo-section-head {
  width: 100%;
  max-width: 1540px;
  margin: 0 0 clamp(34px, 4vw, 68px);
  text-align: left;
}

#ai-demo .ai-demo-section-kicker,
#ai-demo .ai-demo-launch-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin: 0 0 15px;
  padding: 8px 11px;
  border: 1px solid #b7c9db;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #245a9d;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 8px 22px rgba(7, 24, 44, 0.05);
}

#ai-demo .ai-demo-section-kicker i,
#ai-demo .ai-demo-launch-kicker i {
  color: var(--demo-blue);
  font-size: 0.9rem;
}

#ai-demo .ai-demo-section-title {
  max-width: 1380px;
  margin: 0;
  color: var(--demo-ink);
  font-size: clamp(2.65rem, 5.2vw, 7.2rem);
  font-weight: 720;
  letter-spacing: -0.06em;
  line-height: 0.96;
  text-wrap: balance;
}

#ai-demo .ai-demo-section-intro {
  max-width: 1160px;
  margin: clamp(20px, 2vw, 32px) 0 0;
  color: var(--demo-muted);
  font-size: clamp(1rem, 1.15vw, 1.34rem);
  line-height: 1.72;
}

/* =========================================================
   FULL-WIDTH LAUNCHER
========================================================= */

#ai-demo .ai-demo-launch-card {
  display: grid;
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(620px, 1.16fr) minmax(420px, 0.84fr);
  gap: 1px;
  align-items: stretch;
  margin: 0;
  padding: 1px;
  border: 1px solid var(--demo-line-strong);
  background: var(--demo-line);
  box-shadow: 0 34px 90px rgba(7, 24, 44, 0.12);
}

#ai-demo .ai-demo-launch-window {
  position: relative;
  min-width: 0;
  min-height: clamp(520px, 43vw, 780px);
  overflow: hidden;
  padding: clamp(24px, 2.6vw, 52px);
  color: #fff;
  background:
    radial-gradient(circle at 88% 7%, rgba(87, 201, 220, 0.20), transparent 31%),
    radial-gradient(circle at 5% 88%, rgba(47, 113, 216, 0.24), transparent 34%),
    linear-gradient(140deg, #071525 0%, #0b2742 58%, #0d314e 100%);
}

#ai-demo .ai-demo-launch-window::before,
#ai-demo .ai-demo-launch-window::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

#ai-demo .ai-demo-launch-window::before {
  inset: 0;
  opacity: 0.35;
  background:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

#ai-demo .ai-demo-launch-window::after {
  width: 420px;
  height: 420px;
  right: -180px;
  bottom: -210px;
  border: 1px solid rgba(104, 213, 178, 0.28);
  border-radius: 50%;
  box-shadow:
    0 0 0 50px rgba(104, 213, 178, 0.035),
    0 0 0 110px rgba(87, 201, 220, 0.025);
}

#ai-demo .ai-demo-launch-window > * {
  position: relative;
  z-index: 1;
}

#ai-demo .ai-demo-launch-windowbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  min-height: 52px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

#ai-demo .ai-demo-preview-top,
#ai-demo .ai-demo-windowdots {
  display: inline-flex;
  gap: 7px;
}

#ai-demo .ai-demo-preview-top span,
#ai-demo .ai-demo-windowdots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

#ai-demo .ai-demo-preview-top span:nth-child(1),
#ai-demo .ai-demo-windowdots span:nth-child(1) {
  background: #ff6688;
}

#ai-demo .ai-demo-preview-top span:nth-child(2),
#ai-demo .ai-demo-windowdots span:nth-child(2) {
  background: #ffd267;
}

#ai-demo .ai-demo-preview-top span:nth-child(3),
#ai-demo .ai-demo-windowdots span:nth-child(3) {
  background: var(--demo-green);
}

#ai-demo .ai-demo-launch-windowbar strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: clamp(0.88rem, 0.8vw, 1.06rem);
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ai-demo .ai-demo-launch-windowbar em {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(104, 213, 178, 0.30);
  border-radius: 999px;
  color: #baf4e2;
  background: rgba(104, 213, 178, 0.09);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

#ai-demo .ai-demo-launch-chat {
  display: grid;
  gap: clamp(13px, 1.2vw, 19px);
  align-content: center;
  min-height: calc(100% - 70px);
  padding-top: clamp(24px, 3vw, 54px);
}

#ai-demo .ai-demo-launch-bubble {
  width: fit-content;
  max-width: min(78%, 850px);
  padding: clamp(14px, 1.25vw, 20px) clamp(16px, 1.5vw, 24px);
  border-radius: 20px;
  font-size: clamp(0.86rem, 0.82vw, 1.02rem);
  line-height: 1.62;
}

#ai-demo .ai-demo-launch-bubble-ai {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom-left-radius: 5px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(10px);
}

#ai-demo .ai-demo-launch-bubble-user {
  margin-left: auto;
  border-bottom-right-radius: 5px;
  color: var(--demo-ink);
  background: #fff;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.20);
}

#ai-demo .ai-demo-launch-prompt-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 5px;
}

#ai-demo .ai-demo-launch-prompt-row span {
  display: grid;
  min-height: 68px;
  place-items: center;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.06);
  font-size: clamp(0.68rem, 0.66vw, 0.8rem);
  font-weight: 720;
  line-height: 1.35;
  text-align: center;
}

#ai-demo .ai-demo-launch-prompt-row i {
  color: var(--demo-green);
  font-size: 1rem;
}

#ai-demo .ai-demo-launch-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  margin-top: 4px;
  padding: 6px 6px 6px 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #728399;
  background: #fff;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
}

#ai-demo .ai-demo-launch-input span {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(0.74rem, 0.72vw, 0.88rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ai-demo .ai-demo-launch-input strong {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  color: #071525;
  background: linear-gradient(90deg, var(--demo-cyan), var(--demo-green));
  font-size: 0.76rem;
  font-weight: 850;
}

/* =========================================================
   LAUNCH COPY
========================================================= */

#ai-demo .ai-demo-launch-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 4.2vw, 84px);
  background:
    radial-gradient(circle at 100% 0%, rgba(47, 113, 216, 0.10), transparent 32%),
    #fff;
}

#ai-demo .ai-demo-launch-kicker {
  color: #245a9d;
  background: #f1f6fc;
}

#ai-demo .ai-demo-launch-copy h3 {
  max-width: 13ch;
  margin: 0;
  color: var(--demo-ink);
  font-size: clamp(2.35rem, 4.2vw, 6rem);
  font-weight: 720;
  letter-spacing: -0.06em;
  line-height: 0.96;
  text-wrap: balance;
}

#ai-demo .ai-demo-launch-copy p {
  max-width: 760px;
  margin: clamp(18px, 2vw, 30px) 0 0;
  color: var(--demo-muted);
  font-size: clamp(0.96rem, 1vw, 1.16rem);
  line-height: 1.72;
}

#ai-demo .ai-demo-launch-actions {
  display: grid;
  gap: 22px;
  margin-top: clamp(25px, 3vw, 44px);
}

#ai-demo .ai-demo-open-btn {
  appearance: none;
  display: inline-flex;
  width: fit-content;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 0 24px;
  border: 0;
  border-radius: 11px;
  color: #061522;
  background: linear-gradient(90deg, var(--demo-cyan), var(--demo-green));
  font-size: clamp(0.88rem, 0.88vw, 1.02rem);
  font-weight: 820;
  cursor: pointer;
  box-shadow: 0 18px 34px rgba(47, 113, 216, 0.16);
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

#ai-demo .ai-demo-open-btn:hover {
  transform: translateY(-2px);
  filter: brightness(0.97);
  box-shadow: 0 24px 42px rgba(47, 113, 216, 0.22);
}

#ai-demo .ai-demo-open-btn:focus-visible,
#ai-demo .ai-demo-close-btn:focus-visible,
#ai-demo .ai-demo-toggle:focus-visible,
#ai-demo .ai-demo-chip:focus-visible,
#ai-demo .ai-demo-action:focus-visible,
#ai-demo [data-ai-demo-send]:focus-visible {
  outline: 3px solid rgba(47, 113, 216, 0.30);
  outline-offset: 3px;
}

#ai-demo .ai-demo-launch-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#ai-demo .ai-demo-launch-chips span {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--demo-line);
  border-radius: 999px;
  color: #3f5872;
  background: #f7fafc;
  font-size: 0.74rem;
  font-weight: 730;
}

#ai-demo .ai-demo-launch-chips i {
  color: var(--demo-blue);
}

/* =========================================================
   MODAL AUTHORITY
========================================================= */

#ai-demo .ai-demo-modal[hidden] {
  display: none !important;
}

body.ai-demo-modal-open {
  overflow: hidden;
}

body.ai-demo-modal-open #ai-demo.ai-demo-section,
#ai-demo.ai-demo-section.is-demo-open {
  position: relative;
  z-index: 2147482000;
  overflow: visible;
  isolation: isolate;
}

body.ai-demo-modal-open #ai-demo .ai-demo-wrap,
#ai-demo.ai-demo-section.is-demo-open .ai-demo-wrap {
  z-index: auto;
}

#ai-demo .ai-demo-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  width: 100vw;
  height: 100dvh;
  place-items: center;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  isolation: isolate;
  pointer-events: auto;
}

#ai-demo .ai-demo-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 85% 5%, rgba(47, 113, 216, 0.25), transparent 34%),
    rgba(3, 13, 27, 0.84);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

#ai-demo .ai-demo-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1880px, calc(100vw - clamp(30px, 5vw, 180px)));
  max-height: calc(100dvh - clamp(30px, 5vw, 90px));
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: #fff;
  box-shadow: 0 42px 130px rgba(0, 0, 0, 0.48);
}

#ai-demo .ai-demo-modal-head {
  position: relative;
  z-index: 3;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(20px, 2.2vw, 42px);
  color: #fff;
  background:
    radial-gradient(circle at 100% 0%, rgba(87, 201, 220, 0.20), transparent 31%),
    linear-gradient(115deg, #071525 0%, #0d2b48 100%);
}

#ai-demo .ai-demo-modal-kicker {
  display: block;
  margin-bottom: 5px;
  color: #97c7e8;
  font-size: 0.68rem;
  font-weight: 820;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

#ai-demo .ai-demo-modal-head h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.08rem, 1.3vw, 1.52rem);
  font-weight: 720;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

#ai-demo .ai-demo-close-btn {
  appearance: none;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

#ai-demo .ai-demo-close-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.16);
}

#ai-demo .ai-demo-modal .ai-demo-stage {
  position: relative;
  z-index: 1;
  min-height: 0;
  width: 100%;
  overflow: auto;
  padding: clamp(14px, 1.5vw, 26px);
  background:
    linear-gradient(rgba(7, 24, 44, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 24, 44, 0.035) 1px, transparent 1px),
    #edf3f8;
  background-size: 48px 48px;
  overscroll-behavior: contain;
}

#ai-demo .ai-demo-stage-glow {
  display: none;
}

/* =========================================================
   LIVE DEMO WORKSPACE
========================================================= */

#ai-demo .ai-demo-inner {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 0;
  gap: 18px;
  margin: 0 auto;
  padding: clamp(18px, 2vw, 34px);
  border: 1px solid var(--demo-line);
  background: #fff;
  box-shadow: 0 18px 50px rgba(7, 24, 44, 0.08);
}

#ai-demo .ai-demo-inner > * {
  position: relative;
  z-index: 1;
}

#ai-demo .ai-demo-windowbar {
  display: grid;
  min-height: 48px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--demo-line);
}

#ai-demo .ai-demo-windowtitle {
  min-width: 0;
  overflow: hidden;
  color: var(--demo-ink);
  font-size: 0.84rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ai-demo .ai-demo-windowmeta {
  display: flex;
  justify-content: flex-end;
}

#ai-demo .ai-demo-windowbadge {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  padding: 0 11px;
  border: 1px solid #bbccdc;
  border-radius: 999px;
  color: #245a9d;
  background: #f0f6fc;
  font-size: 0.67rem;
  font-weight: 820;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

#ai-demo .ai-demo-topbar {
  display: grid;
  gap: 12px;
}

#ai-demo .ai-demo-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#ai-demo .ai-demo-status-note {
  max-width: 1180px;
  color: var(--demo-muted);
  font-size: clamp(0.82rem, 0.8vw, 0.95rem);
  line-height: 1.55;
}

#ai-demo [data-ai-demo-status] {
  display: inline-flex;
  width: fit-content;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--demo-line);
  border-radius: 999px;
  color: #2f607c;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

#ai-demo [data-ai-demo-status]::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
}

#ai-demo [data-status="local"]::before {
  background: #1d9a68;
  box-shadow: 0 0 0 5px rgba(29, 154, 104, 0.12);
}

#ai-demo [data-status="openrouter"]::before {
  background: #7967d7;
  box-shadow: 0 0 0 5px rgba(121, 103, 215, 0.12);
}

#ai-demo [data-status="openai"]::before {
  background: var(--demo-blue);
  box-shadow: 0 0 0 5px rgba(47, 113, 216, 0.12);
}

#ai-demo [data-status="error"]::before {
  background: var(--demo-danger);
  box-shadow: 0 0 0 5px rgba(203, 49, 87, 0.12);
}

#ai-demo .ai-demo-tools {
  display: flex;
  justify-content: flex-start;
}

#ai-demo .ai-demo-toggle,
#ai-demo .ai-demo-chip,
#ai-demo .ai-demo-action {
  appearance: none;
  border: 1px solid var(--demo-line);
  border-radius: 999px;
  color: #245a9d;
  background: #fff;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

#ai-demo .ai-demo-toggle {
  min-height: 39px;
  padding: 0 14px;
  font-size: 0.78rem;
  font-weight: 800;
}

#ai-demo .ai-demo-toggle:hover,
#ai-demo .ai-demo-chip:hover,
#ai-demo .ai-demo-action:hover {
  transform: translateY(-1px);
  border-color: #8faccc;
  background: #f1f6fb;
}

#ai-demo [data-ai-demo-chips] {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#ai-demo .ai-demo-chip {
  min-height: 38px;
  padding: 0 13px;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.25;
}

/* =========================================================
   CONVERSATION
========================================================= */

#ai-demo .ai-demo-shell {
  display: grid;
  min-height: 0;
  gap: 14px;
  padding: clamp(14px, 1.4vw, 24px);
  border: 1px solid var(--demo-line);
  background:
    linear-gradient(180deg, #f8fbfd 0%, #fff 42%);
}

#ai-demo [data-ai-demo-messages] {
  display: grid;
  min-height: clamp(340px, 37vh, 560px);
  max-height: clamp(420px, 49vh, 680px);
  align-content: start;
  gap: 13px;
  overflow-y: auto;
  padding: 4px clamp(4px, 0.6vw, 10px) 4px 4px;
  scroll-behavior: smooth;
  scrollbar-color: #a9bed2 transparent;
  scrollbar-width: thin;
}

#ai-demo [data-ai-demo-messages]::-webkit-scrollbar {
  width: 8px;
}

#ai-demo [data-ai-demo-messages]::-webkit-scrollbar-track {
  background: transparent;
}

#ai-demo [data-ai-demo-messages]::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #a9bed2;
}

#ai-demo .ai-demo-message {
  display: flex;
  max-width: min(72%, 1050px);
  flex-direction: column;
  gap: 8px;
}

#ai-demo .ai-demo-message--assistant {
  align-self: flex-start;
}

#ai-demo .ai-demo-message--user {
  align-self: flex-end;
}

#ai-demo .ai-demo-bubble {
  position: relative;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  font-size: clamp(0.86rem, 0.82vw, 0.98rem);
  line-height: 1.62;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

#ai-demo .ai-demo-message--assistant .ai-demo-bubble {
  border-color: var(--demo-line);
  border-top-left-radius: 5px;
  color: #29445e;
  background: #fff;
  box-shadow: 0 10px 24px rgba(7, 24, 44, 0.06);
}

#ai-demo .ai-demo-message--user .ai-demo-bubble {
  border-color: #1f5ba6;
  border-top-right-radius: 5px;
  color: #fff;
  background: linear-gradient(135deg, #2f71d8 0%, #245a9d 100%);
  box-shadow: 0 14px 28px rgba(47, 113, 216, 0.20);
}

#ai-demo .ai-demo-message--typing .ai-demo-bubble {
  color: #6e8092;
  font-style: italic;
}

#ai-demo .ai-demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

#ai-demo .ai-demo-action {
  display: inline-flex;
  min-height: 35px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 0.73rem;
  font-weight: 760;
  line-height: 1.2;
  text-decoration: none;
}

#ai-demo [data-ai-demo-form] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

#ai-demo [data-ai-demo-input] {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 0 17px;
  border: 1px solid #b7c8d8;
  border-radius: 10px;
  color: var(--demo-ink);
  background: #fff;
  font-size: 0.9rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

#ai-demo [data-ai-demo-input]::placeholder {
  color: #8293a6;
}

#ai-demo [data-ai-demo-input]:focus {
  outline: none;
  border-color: var(--demo-blue);
  box-shadow: 0 0 0 4px rgba(47, 113, 216, 0.10);
}

#ai-demo [data-ai-demo-send] {
  appearance: none;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  color: #061522;
  background: linear-gradient(90deg, var(--demo-cyan), var(--demo-green));
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease;
}

#ai-demo [data-ai-demo-send]:hover {
  transform: translateY(-1px);
  filter: brightness(0.97);
}

#ai-demo [data-ai-demo-send]:disabled,
#ai-demo [data-ai-demo-input]:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

#ai-demo .ai-demo-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

#ai-demo .ai-demo-trust-pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--demo-line);
  border-radius: 999px;
  color: #5f7388;
  background: #f7fafc;
  font-size: 0.69rem;
  font-weight: 730;
}

#ai-demo .ai-demo-footnote {
  max-width: 1450px;
  margin: 0;
  color: var(--demo-muted);
  font-size: 0.74rem;
  line-height: 1.62;
}

#ai-demo .ai-demo-footnote a {
  color: var(--demo-blue);
  text-decoration: none;
}

#ai-demo .ai-demo-footnote a:hover {
  text-decoration: underline;
}

#ai-demo .is-hidden {
  display: none !important;
}

/* =========================================================
   TYPING INDICATOR
========================================================= */

#ai-demo .ai-demo-bubble--typing {
  display: inline-flex;
  min-width: 64px;
  align-items: center;
}

#ai-demo .ai-demo-typing {
  display: inline-flex;
  min-height: 16px;
  align-items: center;
  gap: 5px;
}

#ai-demo .ai-demo-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--demo-blue);
  opacity: 0.42;
  animation: rtcDemoTyping 1.1s infinite ease-in-out;
}

#ai-demo .ai-demo-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

#ai-demo .ai-demo-typing span:nth-child(3) {
  animation-delay: 0.30s;
}

@keyframes rtcDemoTyping {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.36;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* =========================================================
   ACCESSIBILITY
========================================================= */

#ai-demo .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1320px) {
  #ai-demo .ai-demo-launch-card {
    grid-template-columns: 1fr;
  }

  #ai-demo .ai-demo-launch-window {
    min-height: 580px;
  }

  #ai-demo .ai-demo-launch-copy h3 {
    max-width: 18ch;
  }
}

@media (max-width: 900px) {
  #ai-demo.ai-demo-section {
    padding: 64px 0;
  }

  #ai-demo .ai-demo-wrap {
    padding-inline: 16px;
  }

  #ai-demo .ai-demo-section-title {
    font-size: clamp(2.3rem, 9vw, 4.6rem);
  }

  #ai-demo .ai-demo-launch-window {
    min-height: auto;
  }

  #ai-demo .ai-demo-launch-prompt-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #ai-demo .ai-demo-modal {
    padding: 0;
  }

  #ai-demo .ai-demo-modal-panel {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    border: 0;
  }

  #ai-demo .ai-demo-modal .ai-demo-stage {
    padding: 10px;
  }

  #ai-demo .ai-demo-windowbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  #ai-demo .ai-demo-windowmeta {
    display: none;
  }

  #ai-demo [data-ai-demo-messages] {
    min-height: 310px;
    max-height: 52vh;
  }

  #ai-demo .ai-demo-message {
    max-width: 86%;
  }
}

@media (max-width: 620px) {
  #ai-demo.ai-demo-section {
    padding: 52px 0;
  }

  #ai-demo .ai-demo-section-title {
    font-size: clamp(2rem, 11vw, 3.3rem);
  }

  #ai-demo .ai-demo-section-intro {
    font-size: 0.92rem;
  }

  #ai-demo .ai-demo-launch-window,
  #ai-demo .ai-demo-launch-copy {
    padding: 20px 16px;
  }

  #ai-demo .ai-demo-launch-windowbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  #ai-demo .ai-demo-launch-windowbar em {
    display: none;
  }

  #ai-demo .ai-demo-launch-bubble {
    max-width: 92%;
  }

  #ai-demo .ai-demo-launch-prompt-row {
    grid-template-columns: 1fr;
  }

  #ai-demo .ai-demo-launch-copy h3 {
    font-size: clamp(2.05rem, 12vw, 3.6rem);
  }

  #ai-demo .ai-demo-open-btn {
    width: 100%;
  }

  #ai-demo .ai-demo-launch-chips span {
    width: 100%;
    justify-content: flex-start;
  }

  #ai-demo .ai-demo-modal-head {
    min-height: 72px;
    align-items: flex-start;
  }

  #ai-demo .ai-demo-modal-head h3 {
    font-size: 1rem;
  }

  #ai-demo .ai-demo-inner {
    gap: 14px;
    padding: 14px;
    border-left: 0;
    border-right: 0;
  }

  #ai-demo .ai-demo-status-row {
    align-items: flex-start;
    flex-direction: column;
  }

  #ai-demo [data-ai-demo-chips] {
    gap: 6px;
  }

  #ai-demo .ai-demo-chip,
  #ai-demo .ai-demo-action,
  #ai-demo .ai-demo-trust-pill {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  #ai-demo [data-ai-demo-messages] {
    min-height: 270px;
    max-height: 46vh;
  }

  #ai-demo .ai-demo-message {
    max-width: 92%;
  }

  #ai-demo [data-ai-demo-form] {
    grid-template-columns: 1fr;
  }

  #ai-demo [data-ai-demo-send] {
    width: 100%;
  }
}

@media (min-width: 2200px) {
  #ai-demo .ai-demo-wrap {
    padding-inline: 150px;
  }

  #ai-demo .ai-demo-launch-card {
    grid-template-columns: minmax(1150px, 1.15fr) minmax(850px, 0.85fr);
  }

  #ai-demo .ai-demo-launch-window {
    min-height: 760px;
  }

  #ai-demo .ai-demo-modal-panel {
    width: min(2200px, calc(100vw - 300px));
  }
}

@media (prefers-reduced-motion: reduce) {
  #ai-demo *,
  #ai-demo *::before,
  #ai-demo *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }

  #ai-demo .ai-demo-modal-backdrop,
  #ai-demo .ai-demo-launch-bubble-ai {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}