html.mobile-mode {
  height: 100%;
}

body.mobile-mode {
  min-height: 100dvh;
}

body.mobile-mode.mobile-drawer-open {
  overflow: hidden !important;
}

body.mobile-mode .mobile-header-btn,
body.mobile-mode .mobile-chat-backdrop {
  display: none;
}

body.page-login.mobile-mode {
  align-items: flex-start !important;
  justify-content: flex-start !important;
  min-height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background-attachment: scroll;
}

body.page-login.mobile-mode .login-card {
  max-width: 100%;
  border-radius: 20px;
  margin: auto 0;
}

body.page-login.mobile-mode .login-card header,
body.page-login.mobile-mode .login-card main {
  padding-left: 18px;
  padding-right: 18px;
}

body.page-login.mobile-mode input {
  font-size: 16px !important;
}

body.page-main.mobile-mode {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: 84px;
  overflow-x: hidden;
}

body.page-main.mobile-mode .container {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

body.page-main.mobile-mode .nav-island {
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  transform: none;
  width: auto;
  max-width: none;
  justify-content: flex-start;
  overflow-x: auto;
  gap: 4px;
  padding: 5px;
  border-radius: 18px;
}

body.page-main.mobile-mode .nav-btn {
  padding: 8px 12px;
  font-size: 12px;
  flex: 1 0 auto;
  justify-content: center;
}

body.page-main.mobile-mode header .container {
  gap: 10px;
  align-items: flex-start;
}

body.page-main.mobile-mode header .container > div:last-child {
  width: 100%;
  justify-content: space-between;
}

body.page-main.mobile-mode header .container > div:last-child button {
  white-space: nowrap;
}

body.page-main.mobile-mode #philosophy,
body.page-main.mobile-mode #features,
body.page-main.mobile-mode #users,
body.page-main.mobile-mode #cta-footer {
  padding-top: 72px !important;
  padding-bottom: 72px !important;
}

body.page-main.mobile-mode #philosophy .absolute.top-1\/2.left-1\/2 {
  display: none;
}

body.page-main.mobile-mode #philosophy h1 {
  font-size: 2rem !important;
  line-height: 1.28 !important;
}

body.page-main.mobile-mode #philosophy p,
body.page-main.mobile-mode #features p,
body.page-main.mobile-mode #users p,
body.page-main.mobile-mode #cta-footer p {
  font-size: 15px;
  line-height: 1.75;
}

body.page-main.mobile-mode #philosophy .flex,
body.page-main.mobile-mode #cta-footer .flex {
  width: 100%;
}

body.page-main.mobile-mode #philosophy .flex > *,
body.page-main.mobile-mode #cta-footer .flex > * {
  width: 100%;
  text-align: center;
}

body.page-main.mobile-mode .feature-card,
body.page-main.mobile-mode #users .bg-white {
  padding: 24px;
}

body.page-main.mobile-mode footer .container {
  gap: 10px;
  text-align: center;
}

body.page-main.mobile-mode #auth-modal .modal-content {
  padding: 24px 18px;
}

body.page-prescription.mobile-mode {
  position: static;
  min-height: 100dvh;
  overflow-y: auto;
  background: #eef2f6;
}

body.page-prescription.mobile-mode .no-print {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
}

body.page-prescription.mobile-mode .no-print .max-w-5xl {
  max-width: none;
  padding: 10px 12px;
  flex-direction: column;
  align-items: stretch;
}

body.page-prescription.mobile-mode .no-print .max-w-5xl > div:last-child {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}

body.page-prescription.mobile-mode .no-print .max-w-5xl > div:last-child button {
  white-space: nowrap;
}

body.page-prescription.mobile-mode #prescription-root {
  padding: 12px 10px calc(24px + env(safe-area-inset-bottom, 0px));
}

body.page-prescription.mobile-mode .prescription-page {
  width: 100%;
  max-width: none;
  min-height: auto;
  margin: 0;
  padding: 18px 14px;
  border-radius: 18px;
}

body.page-prescription.mobile-mode section .grid.grid-cols-2 {
  grid-template-columns: 1fr;
  gap: 10px;
}

body.page-prescription.mobile-mode .markdown-content {
  font-size: 13px;
}

body.page-prescription.mobile-mode header[style*="text-align: center"] div[style*="font-size: 24px"] {
  font-size: 20px !important;
}

body.page-prescription.mobile-mode .text-\[12px\] {
  font-size: 13px !important;
}

body.page-chat.mobile-mode {
  display: block !important;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);
}

body.page-chat.mobile-mode > main {
  width: 100%;
  height: 100dvh;
  min-width: 0;
}

body.page-chat.mobile-mode > aside {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(86vw, 320px) !important;
  min-width: min(86vw, 320px) !important;
  max-width: min(86vw, 320px) !important;
  z-index: 80;
  transform: translateX(-100%);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  box-shadow: 14px 0 36px rgba(15, 23, 42, 0.2);
}

body.page-chat.mobile-mode.mobile-left-sidebar-open > aside {
  transform: translateX(0);
}

body.page-chat.mobile-mode .mobile-chat-summary,
body.page-chat.mobile-mode .mobile-drawer-close {
  display: none;
}

body.page-chat.mobile-mode > main > .fixed-height-container,
body.page-chat.mobile-mode > main > div.fixed-height-container {
  width: 100%;
  height: 100dvh;
  min-height: 0;
}

body.page-chat.mobile-mode .mobile-chat-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s ease, visibility 0.24s ease;
  z-index: 70;
}

body.page-chat.mobile-mode.mobile-left-sidebar-open .mobile-chat-backdrop,
body.page-chat.mobile-mode.mobile-right-sidebar-open .mobile-chat-backdrop {
  opacity: 1;
  visibility: visible;
}

body.page-chat.mobile-mode .mobile-header-btn {
  display: inline-flex;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 2;
}

body.page-chat.mobile-mode .mobile-header-btn.hidden {
  display: none !important;
}

body.page-chat.mobile-mode .mobile-chat-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(230, 234, 234, 0.95);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.page-chat.mobile-mode .mobile-chat-summary.hidden {
  display: none !important;
}

body.page-chat.mobile-mode .mobile-chat-summary-main {
  min-width: 0;
}

body.page-chat.mobile-mode .mobile-chat-summary-mode {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--msd-primary);
}

body.page-chat.mobile-mode .mobile-chat-summary-title {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.page-chat.mobile-mode .mobile-chat-summary-subtitle {
  margin-top: 1px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.page-chat.mobile-mode .mobile-chat-summary-badge {
  flex-shrink: 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--msd-bg-tint);
  color: var(--msd-primary);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

body.page-chat.mobile-mode .mobile-drawer-close {
  display: inline-flex;
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: 10px;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  color: #fff;
  background: rgba(0, 95, 96, 0.92);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  z-index: 4;
}

body.page-chat.mobile-mode #mobile-sidebar-open-btn {
  left: 10px;
}

body.page-chat.mobile-mode #mobile-right-panel-open-btn {
  right: 10px;
}

body.page-chat.mobile-mode > main > .fixed-height-container > header,
body.page-chat.mobile-mode > main > div.fixed-height-container > header {
  padding-left: 56px !important;
  padding-right: 56px !important;
  padding-top: max(0px, env(safe-area-inset-top, 0px));
}

body.page-chat.mobile-mode > main > .fixed-height-container > header > div:first-child,
body.page-chat.mobile-mode > main > div.fixed-height-container > header > div:first-child {
  min-width: 0;
}

body.page-chat.mobile-mode > main > .fixed-height-container > header > div:first-child > div:first-child,
body.page-chat.mobile-mode > main > div.fixed-height-container > header > div:first-child > div:first-child {
  width: 34px !important;
  height: 34px !important;
  flex-shrink: 0;
}

body.page-chat.mobile-mode > main > .fixed-height-container > header .font-semibold.text-white,
body.page-chat.mobile-mode > main > div.fixed-height-container > header .font-semibold.text-white {
  font-size: 14px !important;
  line-height: 1.35;
}

body.page-chat.mobile-mode #header-user {
  display: none !important;
}

body.page-chat.mobile-mode #header-brand {
  display: inline-block;
  max-width: 108px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.page-chat.mobile-mode > main > .fixed-height-container > header > div:last-child,
body.page-chat.mobile-mode > main > div.fixed-height-container > header > div:last-child {
  padding: 5px 8px !important;
  font-size: 10px !important;
  max-width: 96px;
  overflow: hidden;
}

body.page-chat.mobile-mode #patient-info-bar {
  padding: 10px 12px !important;
  max-height: 180px;
}

body.page-chat.mobile-mode #patient-info-bar .mobile-patient-info-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid rgba(0, 95, 96, 0.22);
  border-radius: 6px;
  background: #ffffff;
  color: var(--msd-primary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

body.page-chat.mobile-mode.mobile-patient-info-collapsed #patient-info-bar {
  min-height: 42px !important;
  max-height: 46px !important;
  padding: 6px 10px !important;
  overflow: hidden !important;
}

body.page-chat.mobile-mode.mobile-patient-info-collapsed #patient-info-bar > div {
  min-height: 30px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px !important;
}

body.page-chat.mobile-mode.mobile-patient-info-collapsed #patient-info-bar .flex.items-start.gap-8 {
  display: none !important;
}

body.page-chat.mobile-mode.mobile-patient-info-collapsed #patient-info-bar .flex.items-center.gap-2.pl-4.border-l.border-slate-200.ml-4 {
  width: auto;
  margin-left: auto !important;
  padding-left: 0 !important;
  border-left: none !important;
  justify-content: flex-end;
  gap: 6px !important;
}

body.page-chat.mobile-mode.mobile-keyboard-open.mobile-patient-info-collapsed #btn-start-followup,
body.page-chat.mobile-mode.mobile-keyboard-open.mobile-patient-info-collapsed #btn-show-prescription {
  display: none !important;
}

body.page-chat.mobile-mode #patient-info-bar > div {
  flex-direction: column;
  align-items: stretch;
  gap: 10px !important;
}

body.page-chat.mobile-mode #patient-info-bar .flex.items-start.gap-8 {
  flex-direction: column;
  gap: 10px !important;
}

body.page-chat.mobile-mode #patient-info-bar .flex.items-center.gap-2.pl-4.border-l.border-slate-200.ml-4 {
  width: 100%;
  justify-content: flex-start;
  flex-wrap: wrap;
  padding-left: 0 !important;
  margin-left: 0 !important;
  border-left: none !important;
}

body.page-chat.mobile-mode #patient-info-symptom {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

body.page-chat.mobile-mode #followup-symptom-section,
body.page-chat.mobile-mode #clinic-form-section {
  padding-left: 12px !important;
  padding-right: 12px !important;
}

body.page-chat.mobile-mode #followup-symptom-section .max-w-3xl,
body.page-chat.mobile-mode #clinic-form-section .max-w-3xl {
  max-width: none;
}

body.page-chat.mobile-mode #clinic-form-section .grid.grid-cols-1.sm\:grid-cols-3,
body.page-chat.mobile-mode #clinic-form-section .grid.grid-cols-1.sm\:grid-cols-2 {
  grid-template-columns: 1fr;
}

body.page-chat.mobile-mode #followup-symptom-section .flex.justify-between.items-center {
  align-items: flex-start;
  gap: 10px;
}

body.page-chat.mobile-mode #clinic-form-section > div > div:last-child {
  align-items: flex-start;
  gap: 10px;
}

body.page-chat.mobile-mode #clinic-form-section > div > div:last-child > div:last-child {
  width: 100%;
  flex-direction: column;
  align-items: stretch;
}

body.page-chat.mobile-mode #clinic-form-section > div > div:last-child > div:last-child > button {
  width: 100%;
  justify-content: center;
}

body.page-chat.mobile-mode #chat-container {
  padding: 14px 12px !important;
  flex: 1 1 auto;
  min-height: 0 !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

body.page-chat.mobile-mode #chat-container > .flex > div {
  max-width: 92% !important;
}

body.page-chat.mobile-mode #chat-container .px-3\.5.py-2\.5.text-\[13px\].leading-6.shadow-md.rounded-2xl {
  padding: 12px 13px !important;
  border-radius: 18px;
}

body.page-chat.mobile-mode #chat-container .markdown-content p,
body.page-chat.mobile-mode #chat-container .markdown-content li {
  font-size: 15px !important;
  line-height: 1.72 !important;
}

body.page-chat.mobile-mode #chat-container .interactive-questions {
  max-height: min(42dvh, 340px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 2px 4px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

body.page-chat.mobile-mode #chat-container .interactive-question-summary {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: -2px -2px 6px;
  padding: 6px 8px;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(248, 250, 252, 0.96);
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 600;
}

body.page-chat.mobile-mode #chat-container .interactive-question-card {
  padding: 8px 9px !important;
  border-radius: 8px !important;
}

body.page-chat.mobile-mode #chat-container .interactive-question-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 12px !important;
  line-height: 1.55 !important;
}

body.page-chat.mobile-mode #chat-container .interactive-option-list {
  max-height: 148px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  gap: 6px !important;
}

body.page-chat.mobile-mode #chat-container .interactive-option-btn {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px !important;
  text-align: left;
  white-space: normal;
  line-height: 1.4;
  font-size: 12px !important;
}

@media (max-height: 700px) {
  body.page-chat.mobile-mode #chat-container .interactive-questions {
    max-height: 34dvh;
  }

  body.page-chat.mobile-mode #chat-container .interactive-option-list {
    max-height: 112px;
  }
}

body.page-chat.mobile-mode .fixed-input-section {
  padding: 10px 12px !important;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.08);
}

body.page-chat.mobile-mode .fixed-input-section > .mb-2.flex.items-center.justify-between {
  margin-bottom: 8px !important;
}

body.page-chat.mobile-mode .fixed-input-section > .mb-2.flex.items-center.justify-between > span:last-child {
  display: none !important;
}

body.page-chat.mobile-mode #btn-generate-treatment,
body.page-chat.mobile-mode #btn-online-search-toggle {
  min-width: 0;
  flex: 1 1 auto;
}

body.page-chat.mobile-mode #btn-generate-treatment span,
body.page-chat.mobile-mode #btn-online-search-toggle span {
  font-size: 11px;
}

body.page-chat.mobile-mode #chat-input {
  font-size: 16px !important;
}

body.page-chat.mobile-mode #patient-timeline-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(88vw, 360px) !important;
  min-width: min(88vw, 320px) !important;
  max-width: 360px;
  height: 100dvh;
  max-height: 100dvh;
  z-index: 85;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  box-shadow: -14px 0 36px rgba(15, 23, 42, 0.2);
  opacity: 1;
  pointer-events: auto;
}

body.page-chat.mobile-mode #patient-timeline-sidebar.collapsed {
  width: min(88vw, 360px) !important;
  min-width: min(88vw, 320px) !important;
  border-left: 1px solid var(--border-light);
  opacity: 1;
  pointer-events: auto;
}

body.page-chat.mobile-mode.mobile-right-sidebar-open #patient-timeline-sidebar:not(.hidden) {
  transform: translateX(0);
}

body.page-chat.mobile-mode #patient-timeline-sidebar.hidden {
  display: none !important;
}

body.page-chat.mobile-mode .sidebar-toggle-btn {
  display: none !important;
}

body.page-chat.mobile-mode #patient-timeline-sidebar .tl-header,
body.page-chat.mobile-mode #patient-timeline-sidebar .px-4.py-3.bg-slate-50.cursor-pointer {
  position: sticky;
  top: 0;
  z-index: 2;
}

body.page-chat.mobile-mode #patient-timeline-sidebar-content,
body.page-chat.mobile-mode #sidebar-references-content {
  padding: 16px 14px !important;
}

body.page-chat.mobile-mode #clinic-list [data-patient-row] {
  gap: 10px !important;
  padding: 12px 12px 11px !important;
}

body.page-chat.mobile-mode #clinic-list [data-patient-id] {
  display: none;
}

body.page-chat.mobile-mode #clinic-list [data-patient-avatar] {
  width: 36px !important;
  height: 36px !important;
}

body.page-chat.mobile-mode #clinic-list [data-patient-name] {
  font-size: 14px !important;
}

body.page-chat.mobile-mode #clinic-list [data-patient-timeline-meta] {
  gap: 6px !important;
}

body.page-chat.mobile-mode #clinic-list [data-patient-timeline-meta] > span:nth-child(4),
body.page-chat.mobile-mode #clinic-list [data-patient-timeline-meta] > span:nth-child(5),
body.page-chat.mobile-mode #clinic-list [data-patient-divider="secondary"],
body.page-chat.mobile-mode #clinic-list [data-patient-first-visit] {
  display: none;
}

body.page-chat.mobile-mode #clinic-list [data-patient-summary] {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal !important;
  overflow: hidden;
  line-height: 1.45 !important;
}

body.page-chat.mobile-mode #connection-note {
  line-height: 1.45;
}
