:root {
  color-scheme: light;
  --ink: #111a46;
  --muted: #667097;
  --violet: #6935f2;
  --violet-2: #8c5cff;
  --teal: #00a8a8;
  --blue: #2068f5;
  --line: rgba(93, 79, 190, 0.18);
  --soft: #f7f4ff;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(57, 37, 128, 0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(0, 168, 168, 0.16), transparent 28%),
    radial-gradient(circle at 92% 10%, rgba(105, 53, 242, 0.18), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #fbfaff 45%, #f1edff 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1500px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.workspace {
  position: relative;
  min-height: calc(100vh - 48px);
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.workspace::before {
  position: absolute;
  inset: -30% auto auto 58%;
  width: 620px;
  height: 620px;
  border: 1px solid rgba(105, 53, 242, 0.14);
  border-radius: 50%;
  background: repeating-conic-gradient(from 10deg, rgba(105, 53, 242, 0.08) 0deg 12deg, transparent 12deg 28deg);
  content: "";
  animation: rotateSlow 28s linear infinite;
}

.topbar,
.hero,
.app-grid {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, var(--teal), var(--violet));
  font-weight: 900;
  box-shadow: 0 18px 36px rgba(105, 53, 242, 0.28);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #0c1d5f;
  font-size: clamp(34px, 5vw, 70px);
  line-height: 0.9;
  letter-spacing: 0;
}

h1 span,
.hero h2 span {
  color: var(--violet);
}

.mode-switch {
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(44, 33, 99, 0.08);
}

.mode-button {
  min-width: 92px;
  padding: 10px 14px;
  border: 0;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.mode-button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--blue));
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: center;
  min-height: 270px;
  padding: 30px 0 20px;
}

.hero-copy {
  max-width: 760px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  padding: 9px 13px;
  border: 1px solid rgba(0, 168, 168, 0.24);
  border-radius: 999px;
  color: #087f86;
  background: rgba(232, 255, 255, 0.86);
  font-weight: 800;
}

.status-pill span,
.online-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 8px rgba(0, 168, 168, 0.12);
}

.hero h2 {
  max-width: 920px;
  margin: 0;
  color: #121a50;
  font-size: clamp(35px, 5vw, 76px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero p:last-child {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.pulse-orbit {
  position: relative;
  aspect-ratio: 1;
  min-width: 260px;
}

.orbit-ring {
  position: absolute;
  inset: 12%;
  border: 2px dashed rgba(105, 53, 242, 0.28);
  border-radius: 50%;
  animation: rotateSlow 24s linear infinite reverse;
}

.assistant-core {
  position: absolute;
  inset: 31%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: conic-gradient(from 120deg, var(--teal), var(--blue), var(--violet), var(--teal));
  font-size: 78px;
  font-weight: 300;
  box-shadow: 0 34px 80px rgba(105, 53, 242, 0.3);
  animation: breathe 3.6s ease-in-out infinite;
}

.orbit-card {
  position: absolute;
  padding: 11px 15px;
  border: 1px solid rgba(105, 53, 242, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 32px rgba(60, 42, 128, 0.14);
  color: #2d2479;
  font-size: 13px;
  font-weight: 900;
  animation: float 5s ease-in-out infinite;
}

.card-a {
  top: 9%;
  left: 5%;
}

.card-b {
  top: 43%;
  right: 0;
  animation-delay: -1.5s;
}

.card-c {
  bottom: 10%;
  left: 18%;
  animation-delay: -3s;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(240px, 310px) minmax(360px, 1fr) minmax(260px, 340px);
  gap: 18px;
  align-items: stretch;
}

.panel,
.phone-frame {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 20px 52px rgba(55, 38, 120, 0.12);
  backdrop-filter: blur(18px);
}

.panel {
  padding: 18px;
}

.intake-panel,
.summary-panel {
  position: sticky;
  top: 18px;
  align-self: start;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-title span,
.muted,
.doctor-card span,
.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel-title strong {
  max-width: 180px;
  color: #19205c;
  text-align: right;
  font-size: 15px;
  line-height: 1.25;
}

.scenario-list,
.intake-flow,
.metric-stack,
.priority-list {
  display: grid;
  gap: 10px;
}

.intake-flow {
  counter-reset: flow;
}

.flow-step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(105, 53, 242, 0.13);
  border-radius: 18px;
  background: #fff;
}

.flow-step span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--violet));
  font-weight: 900;
}

.flow-step strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.flow-step small {
  color: var(--muted);
  line-height: 1.35;
}

.scenario-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(105, 53, 242, 0.13);
  border-radius: 18px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  transition: transform 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
}

.scenario-card:hover,
.scenario-card.active {
  border-color: rgba(105, 53, 242, 0.42);
  box-shadow: 0 14px 28px rgba(75, 50, 150, 0.12);
  transform: translateY(-2px);
}

.scenario-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--violet));
  font-weight: 900;
}

.scenario-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.scenario-card small {
  color: var(--muted);
  line-height: 1.35;
}

.metric-stack {
  margin-top: 16px;
}

.metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(105, 53, 242, 0.08), rgba(0, 168, 168, 0.07));
}

.metric strong {
  color: #3321b2;
  white-space: nowrap;
}

.safety-note {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(0, 168, 168, 0.22);
  border-radius: 18px;
  background: rgba(232, 255, 255, 0.72);
  color: #0a6069;
}

.safety-note span {
  color: #43656d;
  font-size: 13px;
  line-height: 1.45;
}

.chat-stage {
  min-width: 0;
}

.phone-frame {
  display: flex;
  flex-direction: column;
  min-height: 650px;
  overflow: hidden;
}

.phone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.phone-header div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.phone-header small {
  color: var(--muted);
  font-weight: 800;
}

.progress-track {
  height: 5px;
  background: rgba(105, 53, 242, 0.1);
}

.progress-track div {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--violet));
  transition: width 0.5s ease;
}

.chat-feed {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.message {
  display: grid;
  gap: 7px;
  max-width: min(78%, 620px);
  animation: bubbleIn 0.45s ease both;
}

.message.ai {
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
}

.bubble {
  padding: 14px 16px;
  border-radius: 20px;
  line-height: 1.45;
  box-shadow: 0 12px 30px rgba(51, 33, 178, 0.1);
}

.ai .bubble {
  border-bottom-left-radius: 7px;
  color: #1c245a;
  background: #fff;
}

.user .bubble {
  border-bottom-right-radius: 7px;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--blue));
}

.message small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.user small {
  text-align: right;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -4px;
}

.quick-replies button {
  padding: 9px 11px;
  border: 1px solid rgba(105, 53, 242, 0.18);
  border-radius: 999px;
  color: #2d2479;
  background: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 800;
}

.typing {
  display: none;
  align-items: center;
  gap: 5px;
  width: fit-content;
  margin: 0 20px 14px;
  padding: 12px 14px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(51, 33, 178, 0.1);
}

.typing.active {
  display: flex;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--violet);
  animation: typing 1s ease-in-out infinite;
}

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

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

.composer {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
}

.composer input {
  min-width: 0;
  padding: 0 15px;
  border: 1px solid rgba(105, 53, 242, 0.18);
  border-radius: 16px;
  outline: none;
  color: var(--ink);
  background: #fff;
}

.composer input:focus {
  border-color: rgba(105, 53, 242, 0.55);
  box-shadow: 0 0 0 4px rgba(105, 53, 242, 0.1);
}

.mic-button,
.send-button,
.reset-button {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(61, 54, 180, 0.18);
}

.mic-button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
}

.mic-button.listening {
  background: linear-gradient(135deg, #00a8a8, #6935f2);
  animation: micPulse 1.2s ease-in-out infinite;
}

.mic-icon {
  position: relative;
  width: 16px;
  height: 24px;
  border: 3px solid #fff;
  border-radius: 11px;
}

.mic-icon::before,
.mic-icon::after {
  position: absolute;
  content: "";
}

.mic-icon::before {
  left: 50%;
  bottom: -9px;
  width: 20px;
  height: 10px;
  border: 3px solid #fff;
  border-top: 0;
  border-radius: 0 0 14px 14px;
  transform: translateX(-50%);
}

.mic-icon::after {
  left: 50%;
  bottom: -15px;
  width: 3px;
  height: 7px;
  border-radius: 4px;
  background: #fff;
  transform: translateX(-50%);
}

.send-button,
.reset-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 16px;
}

.send-button:disabled,
.composer input:disabled {
  cursor: wait;
  opacity: 0.64;
}

.analysis-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(105, 53, 242, 0.08), rgba(0, 168, 168, 0.08));
}

.analysis-card strong {
  display: block;
  margin-top: 6px;
  font-size: 17px;
  line-height: 1.25;
}

.confidence-ring {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 57%, transparent 58%),
    conic-gradient(var(--violet) calc(var(--value) * 1%), rgba(105, 53, 242, 0.12) 0);
  color: #2d2479;
  font-weight: 950;
}

.priority-list {
  margin: 14px 0;
}

.priority {
  padding: 14px;
  border: 1px solid rgba(105, 53, 242, 0.12);
  border-radius: 17px;
  background: #fff;
}

.priority strong {
  display: block;
  margin-bottom: 5px;
  color: #1a2360;
}

.priority span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.priority.ghost {
  height: 58px;
  overflow: hidden;
  border: 0;
  background: linear-gradient(90deg, rgba(105, 53, 242, 0.08), rgba(105, 53, 242, 0.15), rgba(105, 53, 242, 0.08));
  background-size: 220% 100%;
  animation: shimmer 2s linear infinite;
}

.doctor-card {
  padding: 16px;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(145deg, #151b5c, #3422a9 48%, #6935f2);
}

.doctor-card span {
  color: rgba(255, 255, 255, 0.76);
}

.doctor-card strong {
  display: block;
  margin: 7px 0;
  font-size: 22px;
}

.doctor-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.45;
}

.reset-button {
  width: 100%;
  margin-top: 14px;
  background: linear-gradient(135deg, var(--teal), var(--violet));
}

@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes typing {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  50% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

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

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes micPulse {
  50% {
    box-shadow: 0 0 0 10px rgba(105, 53, 242, 0.12);
  }
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .pulse-orbit {
    display: none;
  }

  .app-grid {
    grid-template-columns: 1fr 1.35fr;
  }

  .summary-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .shell {
    padding: 10px;
  }

  .workspace {
    min-height: calc(100vh - 20px);
    padding: 16px;
    border-radius: 24px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-button {
    flex: 1;
  }

  .hero {
    min-height: auto;
    padding: 24px 0 16px;
  }

  .hero p:last-child {
    font-size: 16px;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .phone-frame {
    min-height: 620px;
  }

  .composer {
    grid-template-columns: 46px 1fr;
  }

  .send-button {
    grid-column: 1 / -1;
  }

  .message {
    max-width: 92%;
  }
}
