:root {
  --ink: #17313a;
  --muted: #5b7078;
  --soft: #eef7f5;
  --soft-blue: #eaf4fb;
  --surface: #ffffff;
  --line: #d8e6e7;
  --blue: #0b6b7f;
  --blue-strong: #084f63;
  --green: #16866f;
  --green-dark: #0d614f;
  --amber: #f2a94b;
  --rose: #c95656;
  --shadow: 0 16px 42px rgba(23, 49, 58, 0.12);
  --shadow-soft: 0 10px 28px rgba(23, 49, 58, 0.08);
  --radius: 8px;
  --nav-height: 78px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(234, 244, 251, 0.84), rgba(238, 247, 245, 0.7) 38%, #f9fcfb 100%);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.app {
  min-height: 100vh;
}

.shell {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 0 0 1px rgba(216, 230, 231, 0.72);
}

.screen {
  min-height: 100vh;
  padding: 18px 16px 28px;
}

.screen.with-nav {
  padding-bottom: calc(var(--nav-height) + 24px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 0;
  background: rgba(250, 253, 252, 0.92);
  backdrop-filter: blur(12px);
}

.topbar h1 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.22;
}

.topbar p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.topbar-spacer {
  flex: 1;
}

.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: var(--shadow-soft);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  color: var(--green-dark);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.hero {
  display: grid;
  min-height: 100vh;
  padding: 20px 16px 26px;
  align-content: space-between;
}

.hero-center {
  display: grid;
  gap: 18px;
  align-content: center;
  min-height: 62vh;
}

.hero-panel {
  padding: 22px;
  border: 1px solid rgba(216, 230, 231, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.hero h1,
.welcome-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 10vw, 3.8rem);
  line-height: 1;
}

.hero p,
.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.55;
}

.hero-actions,
.actions {
  display: grid;
  gap: 12px;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  font-size: 0.83rem;
  font-weight: 750;
}

.badge svg {
  width: 16px;
  height: 16px;
  color: var(--green);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn svg {
  width: 20px;
  height: 20px;
}

.btn-primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 12px 26px rgba(11, 107, 127, 0.22);
}

.btn-primary:hover {
  background: var(--blue-strong);
}

.btn-secondary {
  color: var(--blue-strong);
  border-color: rgba(11, 107, 127, 0.24);
  background: var(--soft-blue);
}

.btn-ghost {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.btn-success {
  color: #fff;
  background: var(--green);
  box-shadow: 0 12px 26px rgba(22, 134, 111, 0.2);
}

.btn-danger {
  color: #fff;
  background: var(--rose);
}

.icon-btn {
  display: inline-grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
}

.icon-btn svg {
  width: 21px;
  height: 21px;
}

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid rgba(201, 86, 86, 0.22);
  border-radius: var(--radius);
  color: #733333;
  background: #fff5f4;
  line-height: 1.42;
}

.notice svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: var(--rose);
}

.section {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.section-title h2 {
  margin: 0;
  font-size: 1.05rem;
}

.section-title span,
.helper {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.callout {
  padding: 18px;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.callout h2,
.callout p {
  color: #fff;
}

.callout .btn {
  margin-top: 16px;
  color: var(--blue-strong);
  background: #fff;
}

.card-body {
  padding: 16px;
}

.card h2,
.card h3,
.form-card h2,
.form-card h3 {
  margin: 0 0 8px;
  line-height: 1.2;
}

.card p,
.form-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.feature-card,
.option-card,
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.feature-card svg,
.option-card svg,
.list-row svg {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  color: var(--blue);
}

.feature-card strong,
.option-card strong,
.list-row strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.22;
}

.feature-card span,
.option-card span,
.list-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.3;
}

.form-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.check-row {
  color: var(--ink);
  font-weight: 750;
  font-size: 0.92rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fbfdfd;
  outline: none;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(11, 107, 127, 0.55);
  box-shadow: 0 0 0 3px rgba(11, 107, 127, 0.11);
}

.check-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  line-height: 1.35;
}

.check-row input {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--green);
}

.progress-wrap {
  display: grid;
  gap: 10px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.progress-track {
  overflow: hidden;
  height: 11px;
  border-radius: 999px;
  background: #dcecec;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transition: width 300ms ease;
}

.stepper {
  display: flex;
  gap: 6px;
}

.step-dot {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: #d7e8e9;
}

.step-dot.active {
  background: var(--blue);
}

.summary-list {
  display: grid;
  gap: 10px;
}

.summary-row {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfd;
}

.summary-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-row strong {
  text-align: right;
  overflow-wrap: anywhere;
}

.waiting-hero {
  display: grid;
  gap: 18px;
  min-height: 58vh;
  align-content: center;
}

.pulse {
  display: grid;
  width: 92px;
  height: 92px;
  margin: 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  box-shadow: 0 0 0 16px rgba(22, 134, 111, 0.12);
  animation: pulse 1.7s ease-in-out infinite;
}

.pulse svg {
  width: 42px;
  height: 42px;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.04);
  }
}

.doctor-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.avatar {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #0b6b7f, #16866f);
  font-weight: 900;
}

.chat {
  display: grid;
  gap: 10px;
  padding: 12px 0;
}

.bubble {
  max-width: 86%;
  padding: 11px 12px;
  border-radius: 8px;
  line-height: 1.42;
  box-shadow: var(--shadow-soft);
}

.bubble.doctor {
  justify-self: start;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.bubble.patient {
  justify-self: end;
  color: #fff;
  background: var(--blue);
}

.composer {
  position: sticky;
  bottom: calc(var(--nav-height) + 10px);
  display: grid;
  grid-template-columns: 44px 1fr 44px 44px;
  gap: 8px;
  padding: 10px 0 0;
  background: rgba(250, 253, 252, 0.92);
  backdrop-filter: blur(12px);
}

.composer input {
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.video-screen {
  display: grid;
  min-height: calc(100vh - 120px);
  padding: 20px 0;
  align-content: center;
  gap: 22px;
  text-align: center;
}

.video-card {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 24px;
  border-radius: var(--radius);
  color: #fff;
  background:
    linear-gradient(180deg, rgba(8, 79, 99, 0.92), rgba(13, 97, 79, 0.94)),
    #084f63;
  box-shadow: var(--shadow);
}

.video-avatar {
  display: grid;
  width: 142px;
  height: 142px;
  place-items: center;
  border: 4px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  font-size: 2.6rem;
  font-weight: 900;
}

.call-controls {
  display: grid;
  grid-template-columns: repeat(3, 58px);
  justify-content: center;
  gap: 12px;
}

.call-controls button {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: #fff;
}

.call-controls button.end {
  color: #fff;
  background: var(--rose);
}

.rx-paper {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid #cadcdd;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.rx-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.rx-head h2 {
  margin: 0;
}

.qr {
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  border: 6px solid #fff;
  outline: 1px solid var(--line);
  background:
    conic-gradient(from 90deg, #17313a 0 25%, transparent 0 50%, #17313a 0 75%, transparent 0) 0 0 / 24px 24px,
    #fff;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--green-dark);
  background: var(--soft);
  font-weight: 800;
  font-size: 0.84rem;
}

.empty-state {
  display: grid;
  gap: 10px;
  place-items: center;
  min-height: 190px;
  padding: 24px;
  text-align: center;
}

.empty-state svg {
  width: 42px;
  height: 42px;
  color: var(--blue);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(100%, 560px);
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.nav-btn {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 800;
}

.nav-btn svg {
  width: 21px;
  height: 21px;
}

.nav-btn.active {
  color: var(--blue-strong);
  background: var(--soft-blue);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + 20px);
  z-index: 50;
  width: min(calc(100% - 32px), 420px);
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.desktop-hint {
  display: none;
}

@media (min-width: 760px) {
  body {
    padding: 24px 0;
  }

  .app {
    min-height: calc(100vh - 48px);
  }

  .shell {
    min-height: calc(100vh - 48px);
    border-radius: 8px;
    overflow: hidden;
  }

  .screen,
  .hero {
    min-height: calc(100vh - 48px);
    padding-inline: 24px;
  }

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

  .desktop-hint {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
  }
}

@media (max-width: 390px) {
  .feature-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .summary-row {
    grid-template-columns: 1fr;
  }

  .summary-row strong {
    text-align: left;
  }

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

  .composer .video-compose {
    display: none;
  }
}
