:root {
  --ink: #061827;
  --ink-2: #102c3d;
  --teal: #2fcabd;
  --teal-dark: #159f95;
  --mint: #e3f8f4;
  --paper: #f4f8f7;
  --white: #fff;
  --line: rgba(6,24,39,.12);
  --muted: #60727b;
  --shadow: 0 28px 80px rgba(3,24,38,.15);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: radial-gradient(circle at 8% 18%, rgba(47,202,189,.13), transparent 24%), var(--paper); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, a { font: inherit; }
button { cursor: pointer; }

.demo-header { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(244,248,247,.86); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 20px; font-weight: 800; letter-spacing: -.04em; }
.brand img { border-radius: 12px; box-shadow: 0 8px 24px rgba(4,34,50,.17); }
.brand span span { color: var(--teal-dark); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.privacy-badge { color: var(--muted); font-size: 12px; font-weight: 650; }
.language-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 99px; background: var(--white); }
.language-switch button { width: 38px; height: 30px; border: 0; border-radius: 99px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 850; }
.language-switch button.active { color: var(--white); background: var(--ink); }

.demo-shell { width: min(1500px, calc(100% - 48px)); min-height: calc(100vh - 168px); margin: 24px auto; display: grid; grid-template-columns: minmax(250px,.72fr) minmax(420px,1.16fr) minmax(300px,.83fr); gap: 18px; }
.intro-panel, .patient-panel, .clinic-panel { border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.86); box-shadow: 0 20px 55px rgba(4,26,40,.07); }
.intro-panel { padding: 38px 32px 28px; display: flex; flex-direction: column; }
.eyebrow { margin-bottom: 20px; color: var(--teal-dark); font-size: 11px; font-weight: 850; letter-spacing: .14em; }
h1 { margin: 0 0 18px; font-size: clamp(34px,3.3vw,54px); line-height: 1.01; letter-spacing: -.055em; }
.intro-panel > p { margin: 0 0 28px; color: var(--muted); line-height: 1.6; }
.clinic-chip { display: flex; align-items: center; gap: 13px; padding: 14px; border-radius: 16px; background: var(--mint); }
.clinic-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 13px; color: var(--white); background: linear-gradient(145deg, #071a2a 12%, #153a4d 62%, #18ad9f); box-shadow: 0 8px 18px rgba(6,24,39,.18), inset 0 1px rgba(255,255,255,.12); font-size: 11px; font-weight: 900; letter-spacing: -.03em; }
.clinic-chip div { display: grid; }
.clinic-chip small { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.clinic-chip strong { font-size: 14px; }
.value-list { margin: 30px 0; padding: 0; list-style: none; }
.value-list li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.value-list li > span { color: var(--teal-dark); font-size: 11px; font-weight: 850; }
.value-list div { display: grid; gap: 3px; }
.value-list strong { font-size: 13px; }
.value-list small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.back-link { margin-top: auto; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 700; }

.patient-panel { min-height: 680px; display: flex; flex-direction: column; overflow: hidden; background: var(--white); box-shadow: var(--shadow); }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.agent { display: flex; align-items: center; gap: 11px; }
.agent img { border-radius: 11px; }
.agent div { display: grid; }
.agent strong { font-size: 13px; }
.agent small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.agent small i { width: 7px; height: 7px; border-radius: 50%; background: #2ac889; box-shadow: 0 0 0 4px rgba(42,200,137,.14); }
.human-button { padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--white); font-size: 11px; font-weight: 750; }
.human-button:hover { border-color: var(--teal); }
.progress-track { height: 4px; background: #e8eeee; }
.progress-track span { display: block; width: 8%; height: 100%; background: linear-gradient(90deg,var(--teal-dark),var(--teal)); transition: width .35s ease; }
.conversation { flex: 1; min-height: 370px; padding: 30px 24px 16px; overflow: auto; background: linear-gradient(rgba(245,249,248,.72),rgba(255,255,255,.96)); }
.message { max-width: 79%; margin-bottom: 11px; padding: 12px 14px; border-radius: 16px; font-size: 13px; line-height: 1.45; animation: rise .25s ease both; }
.message.bot { color: var(--ink); background: #edf3f2; border-bottom-left-radius: 5px; }
.message.user { margin-left: auto; color: var(--white); background: var(--ink); border-bottom-right-radius: 5px; }
.message.system { max-width: 100%; padding: 8px 12px; text-align: center; color: var(--teal-dark); background: transparent; font-size: 10px; font-weight: 750; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } }
.options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; padding: 14px 22px 6px; border-top: 1px solid var(--line); }
.options button { min-height: 45px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--white); font-size: 12px; font-weight: 720; text-align: left; }
.options button:hover, .options button:focus-visible { border-color: var(--teal); background: var(--mint); outline: none; }
.options button.primary { grid-column: 1 / -1; color: var(--white); background: var(--ink); text-align: center; }
.demo-note { padding: 11px 22px 17px; color: var(--muted); font-size: 10px; text-align: center; }

.clinic-panel { padding: 26px 24px; background: var(--ink); color: var(--white); }
.lead-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 25px; }
.lead-header small { color: #84a0ae; font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.lead-header h2 { margin: 5px 0 0; font-size: 24px; letter-spacing: -.035em; }
.status { padding: 7px 10px; border-radius: 99px; color: #b4c8cf; background: rgba(255,255,255,.08); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.status.ready { color: #07241f; background: var(--teal); }
.source-row { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-block: 1px solid rgba(255,255,255,.1); font-size: 10px; }
.source-row span { color: #84a0ae; }
.lead-data { margin: 12px 0 22px; }
.lead-data div { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.lead-data dt { color: #84a0ae; font-size: 10px; }
.lead-data dd { margin: 0; font-size: 11px; font-weight: 720; text-align: right; }
.contact-card { display: flex; align-items: center; gap: 12px; padding: 13px; border-radius: 14px; background: rgba(255,255,255,.06); }
.avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--teal); font-size: 11px; font-weight: 900; }
.contact-card > div:last-child { display: grid; }
.contact-card small { color: #84a0ae; font-size: 8px; letter-spacing: .1em; }
.contact-card strong { font-size: 12px; }
.contact-card span { color: #a8bdc5; font-size: 9px; }
.handoff-alert { display: flex; gap: 12px; margin-top: 16px; padding: 14px; border-radius: 14px; background: rgba(47,202,189,.11); opacity: .52; transition: opacity .25s, transform .25s; }
.handoff-alert.active { opacity: 1; transform: translateY(-2px); }
.handoff-alert > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--teal); font-size: 11px; font-weight: 900; }
.handoff-alert div { display: grid; }
.handoff-alert strong { font-size: 11px; }
.handoff-alert small { color: #9eb5bd; font-size: 9px; }
.reset-button { width: 100%; margin-top: 16px; padding: 11px; border: 1px solid rgba(255,255,255,.13); border-radius: 11px; color: #b8c9cf; background: transparent; font-size: 10px; font-weight: 750; }

.demo-footer { min-height: 68px; display: flex; align-items: center; justify-content: center; gap: 45px; padding: 14px 28px; color: var(--white); background: var(--ink); }
.demo-footer > div { display: grid; }
.demo-footer strong { font-size: 13px; }
.demo-footer span { color: #9eb5bd; font-size: 10px; }
.demo-footer a { display: inline-flex; align-items: center; gap: 14px; padding: 11px 16px; border-radius: 10px; color: var(--ink); background: var(--teal); text-decoration: none; font-size: 11px; font-weight: 850; }
.demo-footer a span { color: var(--ink); }

html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] .message.user { margin-left: 0; margin-right: auto; border-bottom-right-radius: 16px; border-bottom-left-radius: 5px; }
html[dir="rtl"] .lead-data dd { text-align: left; }

@media (max-width: 1120px) {
  .demo-shell { grid-template-columns: .72fr 1.28fr; }
  .clinic-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
  .lead-header, .source-row, .lead-data { grid-column: 1; }
  .contact-card, .handoff-alert, .reset-button { grid-column: 2; }
  .contact-card { grid-row: 1; margin-top: 44px; }
}

@media (max-width: 760px) {
  .demo-header { height: auto; padding: 13px 16px; }
  .privacy-badge { display: none; }
  .language-switch { max-width: 152px; flex-wrap: wrap; border-radius: 14px; }
  .demo-shell { width: min(100% - 20px, 620px); grid-template-columns: 1fr; margin: 10px auto; }
  .intro-panel { padding: 28px 22px; }
  .value-list { display: none; }
  .back-link { margin-top: 24px; }
  .patient-panel { min-height: 650px; }
  .clinic-panel { grid-column: auto; display: block; }
  .contact-card { margin-top: 0; }
  .demo-footer { align-items: stretch; flex-direction: column; gap: 12px; }
  .demo-footer a { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
