:root {
  color-scheme: light;
  --page: #f4f7f5;
  --paper: #fbf7ec;
  --card: #ffffff;
  --text: #12231e;
  --muted: #66736f;
  --line: #dce6e1;
  --primary: #08704f;
  --primary-2: #0c8a63;
  --primary-dark: #064a37;
  --primary-soft: #e5f5ee;
  --lead-bubble: #dff7e6;
  --bot-bubble: #ffffff;
  --shadow: 0 28px 80px rgba(16, 49, 39, 0.2);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(8, 112, 79, 0.09), transparent 34%),
    linear-gradient(315deg, rgba(202, 178, 102, 0.12), transparent 30%),
    var(--page);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.chat-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  width: min(100%, 820px);
  height: min(940px, calc(100vh - 36px));
  min-height: 680px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 17px;
  background:
    linear-gradient(135deg, rgba(6, 74, 55, 0.96), rgba(8, 112, 79, 0.98)),
    radial-gradient(circle at 82% 0, rgba(255, 255, 255, 0.18), transparent 34%);
  color: #fff;
}

.header-icon {
  position: relative;
  display: none;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.header-icon::before {
  position: absolute;
  inset: 10px 8px 10px 12px;
  border-bottom: 3px solid #fff;
  border-left: 3px solid #fff;
  transform: rotate(45deg);
  content: "";
}

.consultant-avatar {
  display: grid;
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.38), transparent 34%),
    linear-gradient(135deg, #0c8a63, #064a37);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  color: #fff;
}

.consultant-avatar span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 900;
}

.consultant-info {
  min-width: 0;
}

.doctor-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.consultant-info h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 850;
  letter-spacing: 0;
}

.verified-mark {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #9be36d;
}

.verified-mark::before {
  position: absolute;
  width: 9px;
  height: 5px;
  left: 5px;
  top: 6px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  transform: rotate(-45deg);
  content: "";
}

.consultant-info p,
.consultant-info small {
  display: block;
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.25;
}

.consultant-info p {
  position: relative;
  padding-left: 16px;
  font-size: 0.98rem;
  font-weight: 650;
}

.consultant-info p::before {
  position: absolute;
  width: 9px;
  height: 9px;
  left: 0;
  top: 0.42em;
  border-radius: 50%;
  background: #9be36d;
  box-shadow: 0 0 0 4px rgba(155, 227, 109, 0.14);
  content: "";
}

.consultant-info small {
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.action-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.action-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.trust-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(211, 202, 181, 0.58);
  background: rgba(251, 247, 236, 0.92);
  scrollbar-width: none;
}

.trust-strip::-webkit-scrollbar {
  display: none;
}

.trust-strip span {
  position: relative;
  flex: 0 0 auto;
  padding: 8px 11px 8px 32px;
  border: 1px solid rgba(8, 112, 79, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 850;
}

.trust-strip span::before {
  position: absolute;
  width: 15px;
  height: 15px;
  left: 10px;
  top: 50%;
  border-radius: 50%;
  background: var(--primary);
  transform: translateY(-50%);
  content: "";
}

.trust-strip span::after {
  position: absolute;
  width: 6px;
  height: 3px;
  left: 14px;
  top: 50%;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  transform: translateY(-65%) rotate(-45deg);
  content: "";
}

.demo-picker {
  display: grid;
  gap: 6px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(211, 202, 181, 0.58);
  background: rgba(255, 255, 255, 0.62);
}

.demo-picker span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
}

.demo-picker select {
  min-height: 38px;
  border: 1px solid rgba(8, 112, 79, .18);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-size: .88rem;
  font-weight: 750;
  outline-color: var(--primary);
}

.chat-window {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 11px;
  overflow-y: auto;
  padding: 18px;
  background:
    linear-gradient(rgba(244, 247, 245, 0.94), rgba(244, 247, 245, 0.94)),
    radial-gradient(circle at 20% 20%, rgba(8, 112, 79, 0.08), transparent 25%);
  scroll-behavior: smooth;
}

.date-separator {
  align-self: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.message-row {
  display: flex;
  animation: rise 220ms ease both;
}

.message-row.bot {
  justify-content: flex-start;
}

.message-row.lead {
  justify-content: flex-end;
}

.message-bubble {
  position: relative;
  max-width: min(78%, 560px);
  padding: 11px 12px 18px;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(16, 49, 39, 0.08);
  line-height: 1.42;
}

.message-bubble p {
  margin: 0;
  white-space: pre-line;
}

.message-row.bot .message-bubble {
  border-top-left-radius: 4px;
  background: var(--bot-bubble);
}

.message-row.lead .message-bubble {
  border-top-right-radius: 4px;
  background: var(--lead-bubble);
}

.message-author {
  display: block;
  margin-bottom: 4px;
  color: var(--primary-dark);
  font-size: 0.73rem;
  font-weight: 850;
}

.message-meta {
  position: absolute;
  right: 10px;
  bottom: 4px;
  color: rgba(67, 82, 76, 0.72);
  font-size: 0.68rem;
  font-weight: 700;
}

.typing .message-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 72px;
  padding: 13px 14px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #82908b;
  animation: typing 1s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 140ms;
}

.typing-dot:nth-child(3) {
  animation-delay: 280ms;
}

.options-wrap {
  display: grid;
  gap: 9px;
  margin: 5px 0 2px auto;
  width: min(100%, 520px);
  animation: rise 220ms ease both;
}

.option-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  width: 100%;
  border: 1px solid rgba(8, 112, 79, 0.16);
  border-radius: 12px;
  background: #fff;
  color: var(--primary-dark);
  padding: 11px 13px;
  font-weight: 850;
  text-align: left;
  box-shadow: 0 8px 20px rgba(16, 49, 39, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.option-button:hover {
  border-color: rgba(8, 112, 79, 0.38);
  background: var(--primary-soft);
}

.option-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: rgba(8, 112, 79, 0.1);
  color: var(--primary);
}

.option-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.info-card {
  display: grid;
  gap: 9px;
  min-width: min(100%, 420px);
}

.info-card strong {
  color: var(--primary-dark);
}

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

.check-list li {
  position: relative;
  padding-left: 26px;
}

.check-list li::before {
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
  content: "✓";
}

.chat-input {
  display: grid;
  gap: 7px;
  padding: 13px 18px 16px;
  border-top: 1px solid rgba(211, 202, 181, 0.58);
  background: rgba(251, 247, 236, 0.96);
}

.chat-input.is-hidden {
  display: none;
}

.chat-input label {
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 850;
}

.input-row {
  display: flex;
  gap: 8px;
}

.input-row input {
  min-width: 0;
  flex: 1;
  border: 1px solid rgba(8, 112, 79, 0.2);
  border-radius: 999px;
  background: #fff;
  padding: 12px 15px;
  outline: none;
}

.input-row input:focus {
  border-color: rgba(8, 112, 79, 0.55);
  box-shadow: 0 0 0 4px rgba(8, 112, 79, 0.1);
}

.input-row button {
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  padding: 0 18px;
  font-weight: 900;
}

.input-error {
  min-height: 18px;
  margin: 0;
  color: #b42318;
  font-size: 0.8rem;
  font-weight: 800;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 720px) {
  .app-shell {
    padding: 0;
  }

  .chat-card {
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .chat-header {
    padding: 13px 12px;
  }

  .header-icon {
    display: block;
  }

  .consultant-avatar {
    width: 52px;
    height: 52px;
  }

  .consultant-avatar span {
    width: 32px;
    height: 32px;
    font-size: 0.72rem;
  }

  .consultant-info h1 {
    font-size: 1.08rem;
  }

  .consultant-info small {
    display: none;
  }

  .header-actions {
    gap: 5px;
  }

  .action-icon {
    width: 31px;
    height: 31px;
  }

  .trust-strip,
  .chat-window,
  .chat-input {
    padding-left: 12px;
    padding-right: 12px;
  }

  .message-bubble {
    max-width: 88%;
  }

  .input-row button {
    padding: 0 14px;
  }
}
