:root {
  --bg: #0f1117;
  --panel: #171b26;
  --panel-2: #202638;
  --panel-3: #101521;
  --line: rgba(255,255,255,.1);
  --text: #f8fafc;
  --muted: #9ca3af;
  --blue: #18a9e5;
  --green: #8bc34a;
  --cyan: #30c6c8;
  --glow: rgba(24,169,229,.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 70% 20%, rgba(24,169,229,.18), transparent 34%),
    radial-gradient(circle at 20% 85%, rgba(139,195,74,.12), transparent 30%),
    var(--bg);
}

button, input { font: inherit; }

.demo-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.stage {
  position: relative;
  width: min(1180px, 100%);
  min-height: 720px;
  overflow: hidden;
  border: 1px solid rgba(24,169,229,.22);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(15,17,23,.96), rgba(11,43,63,.92));
  box-shadow: 0 30px 90px rgba(0,0,0,.38), 0 0 80px rgba(24,169,229,.12);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(24,169,229,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24,169,229,.07) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 58% 46%, #000 0%, transparent 75%);
  opacity: .42;
}

.stage-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 30px 0;
}

.brand-logo {
  width: 168px;
  height: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 252px;
  padding: 10px 16px;
  border: 1px solid rgba(24,169,229,.25);
  border-radius: 999px;
  background: rgba(32,38,56,.74);
  color: #cbd5e1;
  font-size: .88rem;
  font-weight: 700;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(139,195,74,.55);
  animation: pulse 1.6s infinite;
}

.experience {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 42px;
  padding: 36px 56px 22px;
}

.process-panel {
  min-height: 552px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 22px;
  padding: 22px;
  background: rgba(16,21,33,.78);
  backdrop-filter: blur(18px);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.panel-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #fff;
  font-size: .8rem;
  font-weight: 900;
}

.panel-title strong,
.doc-card strong,
.core-label strong {
  display: block;
  color: #fff;
}

.panel-title span,
.doc-card span,
.core-label span {
  display: block;
  color: var(--muted);
  font-size: .82rem;
}

.upload-stack {
  display: grid;
  gap: 12px;
}

.doc-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(32,38,56,.68);
  transform: translateX(-16px);
  opacity: .38;
  transition: opacity .35s, transform .35s, border-color .35s, background .35s;
}

.doc-card.active {
  opacity: 1;
  transform: translateX(0);
  border-color: rgba(24,169,229,.42);
  background: rgba(24,169,229,.1);
}

.doc-card.done {
  opacity: .92;
  transform: translateX(0);
  border-color: rgba(139,195,74,.34);
}

.doc-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #26c6da);
  font-size: .72rem;
  font-weight: 900;
}

.doc-card em {
  color: #94a3b8;
  font-size: .72rem;
  font-style: normal;
  font-weight: 800;
}

.doc-card.active em { color: var(--blue); }
.doc-card.done em { color: var(--green); }

.knowledge-core {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 30px 0;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(24,169,229,.12), rgba(139,195,74,.09));
  border: 1px solid rgba(24,169,229,.18);
}

.core-ring {
  width: 76px;
  height: 76px;
  border-radius: 999px;
  border: 5px solid rgba(24,169,229,.2);
  border-top-color: var(--blue);
  border-right-color: var(--green);
}

.core-ring.processing { animation: spin 1s linear infinite; }
.core-ring.ready { border-color: var(--green); box-shadow: 0 0 28px rgba(139,195,74,.25); }

.timeline {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #7f8ba3;
  font-size: .86rem;
  font-weight: 800;
}

.timeline-item span {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,.18);
  border-radius: 999px;
}

.timeline-item.active { color: #dbeafe; }
.timeline-item.active span {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(24,169,229,.13);
}

.timeline-item.done { color: var(--green); }
.timeline-item.done span {
  border-color: var(--green);
  background: var(--green);
}

.device-area {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 552px;
}

.floating-chip {
  position: absolute;
  z-index: 3;
  padding: 12px 16px;
  border: 1px solid rgba(24,169,229,.32);
  border-radius: 12px;
  background: rgba(32,38,56,.86);
  color: #aab4c5;
  font-size: .86rem;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .42s, transform .42s;
}

.floating-chip.active {
  opacity: 1;
  transform: translateY(0);
}

.chip-pdf { top: 24px; left: 36px; }
.chip-fast { right: 22px; top: 260px; }
.chip-team { left: 0; bottom: 46px; }

.tablet-frame {
  width: min(470px, 100%);
  padding: 18px;
  border: 2px solid rgba(24,169,229,.38);
  border-radius: 28px;
  background: rgba(32,38,56,.84);
  box-shadow: 0 24px 70px rgba(0,0,0,.32), 0 0 55px rgba(24,169,229,.14);
}

.tablet-screen {
  overflow: hidden;
  border-radius: 18px;
  background: #181d2a;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: #22283a;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
}

.chat-header strong {
  display: block;
  font-size: 1rem;
}

.chat-header span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: .85rem;
}

.chat-header i {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--green);
}

.chat-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 382px;
  padding: 18px;
  background:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    #141925;
  background-size: 28px 28px;
}

.empty-state {
  position: absolute;
  inset: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(24,169,229,.18);
  border-radius: 14px;
  color: #7f8ba3;
  font-size: .86rem;
  font-weight: 800;
}

.empty-state.hidden { display: none; }

.scan-line {
  position: absolute;
  inset-inline: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  animation: scan 1.8s ease-in-out infinite;
}

.msg {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 13px;
  color: #d6e1f5;
  line-height: 1.48;
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
  opacity: 0;
  transform: translateY(12px) scale(.98);
  animation: pop .38s forwards;
}

.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #fff;
  border-bottom-right-radius: 5px;
  font-weight: 750;
}

.msg.bot {
  align-self: flex-start;
  background: #232a3d;
  border: 1px solid rgba(255,255,255,.09);
  border-bottom-left-radius: 5px;
}

.msg.bot strong {
  color: #c9d5ea;
}

.typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 999px;
  background: #232a3d;
  border: 1px solid rgba(255,255,255,.08);
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--blue);
  animation: typing 1s infinite;
}

.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }

.process-step-card {
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(24,169,229,.28);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(32,38,56,.94), rgba(18,32,47,.94));
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
  opacity: 0;
  transform: translateY(12px) scale(.98);
  animation: pop .38s forwards;
}

.process-step-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.process-step-top span {
  flex-shrink: 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(24,169,229,.16);
  color: #9bd8ff;
  font-size: .7rem;
  font-weight: 900;
}

.process-step-top strong {
  color: #f8fafc;
  font-size: .9rem;
}

.process-step-list {
  display: grid;
  gap: 8px;
}

.process-step-list div {
  display: grid;
  grid-template-columns: 10px 1fr;
  align-items: start;
  gap: 8px;
  color: #b9c6da;
  font-size: .78rem;
  line-height: 1.35;
}

.process-step-list i {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #18a9e5, #8bc34a);
}

.evidence {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.evidence span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(24,169,229,.12);
  color: #9bd8ff;
  font-size: .74rem;
  font-weight: 800;
}

.chat-composer {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: #22283a;
  border-top: 1px solid rgba(255,255,255,.08);
}

.question-field {
  flex: 1;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  color: #dbeafe;
  background: #161b27;
  white-space: nowrap;
  overflow: hidden;
}

.question-field::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 18px;
  margin-left: 3px;
  vertical-align: -3px;
  background: var(--blue);
  animation: blink .8s infinite;
}

.question-field.done::after { display: none; }

.chat-composer button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 0 0 0 rgba(24,169,229,.5);
  transform: scale(.94);
  transition: transform .2s, box-shadow .2s;
}

.chat-composer button.sending {
  transform: scale(1);
  box-shadow: 0 0 0 10px rgba(24,169,229,.12);
}

.chat-composer svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.controls {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 24px 28px;
}

.control-btn {
  min-width: 104px;
  border: 1px solid rgba(24,169,229,.4);
  border-radius: 999px;
  padding: 10px 18px;
  color: #fff;
  background: linear-gradient(135deg, rgba(24,169,229,.9), rgba(139,195,74,.86));
  font-weight: 900;
  cursor: pointer;
}

.control-btn.secondary {
  background: rgba(32,38,56,.8);
  color: #dbeafe;
}

.speed-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #aab4c5;
  font-size: .84rem;
  font-weight: 800;
}

.speed-control input { accent-color: var(--blue); }

.is-paused * {
  animation-play-state: paused !important;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(139,195,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(139,195,74,0); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes scan {
  0% { top: 0; opacity: 0; }
  12%, 88% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

@keyframes pop {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes typing {
  0%, 80%, 100% { transform: translateY(0); opacity: .5; }
  40% { transform: translateY(-4px); opacity: 1; }
}

@keyframes blink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

@media (max-width: 980px) {
  .demo-shell { padding: 16px; }
  .stage { min-height: auto; }
  .experience {
    grid-template-columns: 1fr;
    padding: 28px 22px 18px;
  }
  .process-panel { min-height: auto; }
  .chip-pdf { left: 8px; }
  .chip-fast { right: 0; }
  .chip-team { left: 8px; bottom: 16px; }
}

@media (max-width: 620px) {
  .stage-header,
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  .status-pill { min-width: 0; }
  .brand-logo { width: 150px; }
  .floating-chip { display: none; }
  .tablet-frame { padding: 12px; }
  .chat-body { min-height: 360px; }
}

.embed-hero body {
  min-height: 100vh;
  overflow: hidden;
  background: transparent;
}

.embed-hero .demo-shell {
  min-height: 100vh;
  padding: 0;
  display: block;
}

.embed-hero .stage {
  width: 100vw;
  height: 100vh;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: linear-gradient(135deg, rgba(18,23,35,.98), rgba(10,38,57,.96));
}

.embed-hero .stage-header,
.embed-hero .process-panel,
.embed-hero .floating-chip,
.embed-hero .controls {
  display: none;
}

.embed-hero .ambient-grid {
  opacity: .24;
  background-size: 28px 28px;
}

.embed-hero .experience {
  height: 100vh;
  display: block;
  padding: 0;
}

.embed-hero .device-area {
  min-height: 100vh;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 0;
}

.embed-hero .tablet-frame {
  width: 100%;
  height: 100%;
  padding: 10px;
  border-radius: 22px;
  border-width: 0;
  background: rgba(32,38,56,.9);
  box-shadow: none;
}

.embed-hero .tablet-screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
}

.embed-hero .chat-header {
  padding: 12px 14px;
  gap: 10px;
  flex-shrink: 0;
}

.embed-hero .chat-avatar {
  width: 36px;
  height: 36px;
}

.embed-hero .chat-header strong {
  font-size: .92rem;
}

.embed-hero .chat-header span {
  font-size: .76rem;
}

.embed-hero .chat-body {
  flex: 1;
  min-height: 0;
  padding: 12px;
  gap: 9px;
  overflow: hidden;
}

.embed-hero .process-step-card {
  padding: 12px;
  border-radius: 14px;
}

.embed-hero .process-step-top {
  margin-bottom: 10px;
}

.embed-hero .process-step-top strong {
  font-size: .82rem;
}

.embed-hero .process-step-list {
  gap: 6px;
}

.embed-hero .process-step-list div {
  font-size: .7rem;
  line-height: 1.3;
}

.embed-hero .empty-state {
  inset: 12px;
  font-size: .78rem;
}

.embed-hero .msg {
  max-width: 88%;
  padding: 9px 11px;
  border-radius: 11px;
  font-size: .74rem;
  line-height: 1.4;
}

.embed-hero .msg.bot {
  max-width: 84%;
}

.embed-hero .typing {
  padding: 9px 13px;
}

.embed-hero .evidence {
  gap: 5px;
  margin-top: 7px;
}

.embed-hero .evidence span {
  padding: 4px 7px;
  font-size: .64rem;
}

.embed-hero .chat-composer {
  padding: 10px;
  gap: 8px;
  flex-shrink: 0;
}

.embed-hero .question-field {
  min-height: 36px;
  padding: 8px 12px;
  font-size: .76rem;
}

.embed-hero .chat-composer button {
  width: 38px;
  height: 38px;
}

.embed-hero .chat-composer svg {
  width: 18px;
  height: 18px;
}
