/* LiverCare AI shared sizing and responsive refinements.
   Loaded after page styles so repeated portal/auth rules stay centralized. */

:root {
  --lc-space-1: 0.375rem;
  --lc-space-2: 0.625rem;
  --lc-space-3: 0.875rem;
  --lc-space-4: 1.125rem;
  --lc-space-5: 1.5rem;
  --lc-text-xs: 0.8125rem;
  --lc-text-sm: 0.875rem;
  --lc-text-md: 0.9375rem;
  --lc-text-lg: 1.125rem;
  --lc-title: clamp(1.375rem, 1.15rem + 0.65vw, 1.75rem);
}

/* Portal shells and shared navigation */
.pt-body,
.dd-body {
  overflow-x: clip;
  font-size: 15px;
  line-height: 1.5;
}

.pt-body .pt-app { grid-template-columns: minmax(220px, 252px) minmax(0, 1fr); gap: 12px; padding-right: 12px; }
.dd-body .dd-app { grid-template-columns: minmax(220px, 252px) minmax(0, 1fr); }
.pt-body .pt-main, .dd-body .dd-main, .pt-body .pt-content, .dd-body .dd-content { min-width: 0; }

.pt-body .pt-head__title,
.dd-body .dd-head__title { font-size: var(--lc-title); line-height: 1.22; }
.pt-body .pt-head__sub,
.dd-body .dd-head__sub { margin-top: 0.25rem; font-size: var(--lc-text-sm); line-height: 1.4; }
.pt-body .pt-topbar,
.dd-body .dd-topbar { gap: 0.75rem; padding: 0.7rem 0.9rem; border-radius: 14px; }
.pt-body .pt-search,
.dd-body .dd-search { max-width: min(14rem, 28vw); }
.pt-body .pt-nav { margin-top: 1rem; gap: 0.25rem; }
.pt-body .pt-nav__item,
.dd-body .dd-nav__item { min-height: 42px; height: auto; gap: 0.75rem; padding-top: 0.5rem; padding-bottom: 0.5rem; font-size: 0.9rem; }
.pt-body .pt-nav__icon,
.dd-body .dd-nav__icon { width: 22px; height: 22px; }
.pt-body .pt-brand__word,
.dd-body .dd-brand__word { font-size: 1.125rem; }

/* Shared portal type scale */
.pt-body [class*="__title"], .dd-body [class*="__title"] { line-height: 1.28; }
.pt-body :is(h1, h2, h3, h4), .dd-body :is(h1, h2, h3, h4) { text-wrap: balance; }
.pt-body h1[class], .dd-body h1[class] { font-size: var(--lc-title); }
.pt-body h2[class], .dd-body h2[class] { font-size: var(--lc-text-lg); }
.pt-body h3[class], .dd-body h3[class] { font-size: 1rem; }
.pt-body label[class], .dd-body label[class] { font-size: var(--lc-text-sm); }
.pt-body button[class], .dd-body button[class] { font-size: var(--lc-text-md); }
.pt-body :is([class*="__sub"], [class*="__note"], [class*="__desc"]),
.dd-body :is([class*="__sub"], [class*="__note"], [class*="__desc"]) { font-size: var(--lc-text-md); line-height: 1.5; }
.pt-body :is(label, .pt-nav__item, .dd-nav__item),
.dd-body :is(label, .pt-nav__item, .dd-nav__item) { font-size: var(--lc-text-sm); }
.pt-body :is(input, select, textarea, button),
.dd-body :is(input, select, textarea, button) { font-size: var(--lc-text-md); }
.pt-body p, .dd-body p { overflow-wrap: anywhere; }
.pt-body :is(main, section, article, form, li),
.dd-body :is(main, section, article, form, li) { min-width: 0; }

/* Remove fixed card heights and tame oversized internal spacing. */
.pt-body [class*="card"], .dd-body [class*="card"],
.pt-body [class*="panel"], .dd-body [class*="panel"] { min-height: 0; }
.pt-body [class*="-card"], .dd-body [class*="-card"] { max-width: 100%; padding: clamp(0.75rem, 1.25vw, 1rem); }
.pt-body .pd-tile { grid-template-columns: 52px minmax(0, 1fr) 18px; gap: 0.75rem; padding: 0.875rem; }
.pt-body .pd-tile__icon { width: 44px; height: 44px; }
.pt-body .pd-tile__label { font-size: var(--lc-text-sm); }
.pt-body .pd-tile__value { font-size: 1.0625rem; line-height: 1.3; overflow-wrap: anywhere; }
.pt-body .pd-tile__note { font-size: var(--lc-text-xs); }
.pt-body .pd-chart-card, .pt-body .pd-activity-card { padding: 1rem; }
.pt-body .pd-chart__title, .pt-body .pd-activity__title,
.dd-body .dd-panel__title { font-size: var(--lc-text-lg); }
.pt-body .pd-chart { min-height: 170px; }
.pt-body .pd-chart__empty { min-height: 170px; }
.pt-body .pd-activity { gap: 0.5rem; }
.pt-body .pd-act__link, .pt-body .pd-act--empty { grid-template-columns: 44px minmax(0, 1fr) auto 18px; gap: 0.625rem; padding: 0.625rem; }
.pt-body .pd-act__icon { width: 40px; height: 40px; }
.pt-body .pd-act__title { font-size: var(--lc-text-sm); }
.pt-body .pd-act__sub { font-size: var(--lc-text-xs); overflow-wrap: anywhere; }

.dd-body .dd-content { gap: 0.875rem; padding: 1.125rem 1rem 1.5rem; }
.dd-body .dd-hello { gap: 0.75rem; padding: 0 0 0.5rem 0.25rem; }
.dd-body .dd-hello__title { font-size: var(--lc-title); line-height: 1.2; }
.dd-body .dd-hello__sub { margin-top: 0.25rem; font-size: var(--lc-text-sm); }
.dd-body .dd-stats { gap: 0.75rem; margin-top: 0; }
.dd-body .dd-stat { min-height: 88px; gap: 0.75rem; padding: 0.875rem; }
.dd-body .dd-stat__icon { width: 48px; height: 48px; }
.dd-body .dd-stat__icon svg { width: 26px; height: 26px; }
.dd-body .dd-stat__label { font-size: var(--lc-text-sm); }
.dd-body .dd-stat__value { margin-top: 0.2rem; font-size: 1.5rem; line-height: 1.1; overflow-wrap: anywhere; }
.dd-body .dd-stat__meta { margin-top: 0.25rem; font-size: var(--lc-text-xs); }
.dd-body .dd-panels { gap: 0.875rem; }
.dd-body .dd-panel { padding: 1rem; }
.dd-body .dd-panel__head { margin-bottom: 0.75rem; }
.dd-body .dd-slot { min-height: 62px; }

/* Account, login and reset flows share this base and one field scale. */
.dr-page { --au: max(0.82px, min(0.96px, calc((100svh - 60px) / var(--ref-h)))); overflow-x: clip; }
.dr-body { align-items: flex-start; overflow-y: auto; }
.dr-wrap { min-height: 100vh; min-height: 100svh; align-items: center; padding: 1.25rem 1rem; }
.dr-card { width: min(calc(var(--card-w) * var(--au)), 100%); padding: clamp(1.5rem, 3.1vh, 2rem) clamp(1.25rem, 3vw, 2rem); border-radius: 18px; }
.dr-title { font-size: clamp(1.625rem, 1.35rem + 0.5vw, 1.875rem); line-height: 1.2; }
.dr-section { font-size: 1.25rem; line-height: 1.25; }
.dr-subtitle { margin-top: 0.375rem; font-size: var(--lc-text-md); line-height: 1.5; }
.dr-card .dr-label { margin-bottom: 0.375rem; font-size: var(--lc-text-sm); }
.dr-card .dr-field { height: 46px; min-height: 46px; border-radius: 10px; }
.dr-card .dr-field input, .dr-card .dr-field select { min-height: 44px; font-size: var(--lc-text-md); }
.dr-card .dr-btn { min-height: 46px; height: auto; padding-block: 0.625rem; font-size: var(--lc-text-md); border-radius: 10px; }
.dr-wrap :is(.dr-grid-2, .dr-grid-2--keep) { gap: 0.75rem; }
.dr-wrap :is(.dr-in, .dr-group, [class*="-group"]) { min-width: 0; }

/* Standalone patient/doctor account choice screen */
.acc-body { overflow-x: clip; }
.acc-card { max-width: calc(100vw - 2rem); padding: clamp(1.5rem, 5vh, 2.75rem) clamp(1.25rem, 4vw, 3rem); }
.acc-title { font-size: clamp(1.75rem, 1.45rem + 0.8vw, 2.25rem); line-height: 1.15; text-wrap: balance; }
.acc-sub { font-size: 1rem; line-height: 1.5; }
.acc-title { margin-top: 1.25rem; }
.acc-sub { margin-top: 0.5rem; }
.acc-options { gap: 0.75rem; margin-top: 1.25rem; }
.acc-opt { min-width: 0; height: auto; min-height: 96px; padding: 0.75rem 1rem; gap: 0.875rem; }
.acc-opt__avatar { width: 72px; height: 72px; }
.acc-opt__text { margin: 0 auto 0 0; }
.acc-opt__badge { width: 24px; height: 24px; }
.acc-opt__badge svg { width: 15px; height: 15px; }
.acc-opt__go { width: 38px; height: 38px; }
.acc-opt__name { font-size: 1.25rem; line-height: 1.25; }
.acc-opt__desc { font-size: var(--lc-text-sm); line-height: 1.4; overflow-wrap: anywhere; }
.acc-login, .acc-opt { border-radius: 14px; }

/* Landing hero keeps its visual language but uses calmer type and spacing. */
body:not(.pt-body):not(.dd-body):not(.dr-body):not(.acc-body) { overflow-x: clip; }
:root { --u: max(0.6px, min(0.068vw, 0.094vh)); }
.lc-rest .container { width: min(var(--container), 100% - 2rem); }
.lc-rest .section { padding-top: calc(var(--nav-h) + 2rem); padding-bottom: 2rem; }
.lc-rest .section-title { font-size: clamp(2rem, 1.2rem + 2.35vw, 3.35rem); }
.lc-rest .display-title { font-size: clamp(2.15rem, 1.25rem + 2.7vw, 3.8rem); }
.lc-rest .lead { font-size: clamp(0.9375rem, 0.9rem + 0.18vw, 1rem); }
.lc-rest .t-card, .lc-rest .s-card { gap: 0.875rem; padding: 0.875rem 1rem; border-radius: 14px; }
.lc-rest .consult-banner { gap: 1.25rem; padding: clamp(1.25rem, 3vh, 2rem) clamp(1.25rem, 3vw, 2.5rem); border-radius: 16px; }
.lc-rest .footer-grid { padding: 2rem 0 1.5rem; }

@media (max-width: 1100px) {
  .pt-body .pt-app, .dd-body .dd-app { grid-template-columns: 218px minmax(0, 1fr); }
  .pt-body .pd-cards { gap: 0.625rem; }
  .pt-body .pd-tile { grid-template-columns: 42px minmax(0, 1fr) 16px; gap: 0.5rem; padding: 0.75rem; }
  .pt-body .pd-tile__icon { width: 38px; height: 38px; }
  .dd-body .dd-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dd-body .dd-stat { align-items: flex-start; flex-direction: column; min-height: 0; }
}

@media (max-width: 1024px) {
  .pt-body .pt-app, .dd-body .dd-app { grid-template-columns: minmax(0, 1fr); padding: 0.5rem; }
}

@media (max-width: 760px) {
  .pt-body .pt-app, .dd-body .dd-app { grid-template-columns: minmax(0, 1fr); padding: 0.5rem; gap: 0.5rem; }
  .pt-body .pt-sidebar, .dd-body .dd-sidebar { height: 100svh; height: 100dvh; max-height: 100dvh; }
  .pt-body .pd-cards, .pt-body .pd-grid, .dd-body .dd-stats, .dd-body .dd-panels { grid-template-columns: minmax(0, 1fr); }
  .dd-body .dd-stat { flex-direction: row; align-items: center; }
  .pt-body .pt-topbar, .dd-body .dd-topbar { flex-wrap: wrap; }
  .pt-body .pt-search, .dd-body .dd-search { width: min(100%, 15rem); max-width: none; }
  .pt-body .pd-act__link, .pt-body .pd-act--empty { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .pt-body .pd-act__chev { display: none; }
  .lc-rest .container { width: min(var(--container), 100% - 1.5rem); }
  .lc-rest .section { min-height: 0; padding-block: calc(var(--nav-h) + 1.5rem) 2rem; }
  .lc-rest .consult-banner { grid-template-columns: auto minmax(0, 1fr); }
  .dr-wrap { padding: 1rem 0.75rem; }
  .dr-card { padding: 1.25rem 1rem; }
  .panel { padding: 1rem; border-radius: 16px; }
}

@media (max-width: 640px) {
  .lc-rest .consult-banner { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .lc-rest .consult-banner .btn { justify-self: center; }
}

@media (max-width: 480px) {
  .pt-body .pt-head__title, .dd-body .dd-head__title { font-size: 1.25rem; }
  .pt-body .pt-topbar, .dd-body .dd-topbar { padding: 0.625rem; }
  .pt-body .pd-chart-card, .pt-body .pd-activity-card, .dd-body .dd-panel { padding: 0.75rem; }
  .pt-body .pd-chart__head { flex-wrap: wrap; }
  .pt-body .pd-act__link, .pt-body .pd-act--empty { padding: 0.5rem; gap: 0.5rem; }
  .dd-body .dd-hello { flex-direction: column; }
  .acc-card { width: calc(100vw - 1.25rem); padding: 1.25rem 1rem; }
  .lc-rest .consult-banner { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .lc-rest .consult-banner .btn { justify-self: center; }
  .lc-rest .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .lc-rest .footer-grid > * + * { border-left: 0; padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pt-body *, .dd-body *, .dr-body *, .acc-body *, .lc-rest * { scroll-behavior: auto; }
}

/* One transparent brand mark shared by landing, auth, patient and doctor UI. */
.brand-logo-mark {
  display: block;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  background: transparent;
}

.brand-logo-mark--fill {
  width: 100%;
  height: 100%;
}

/* Dashboard refinement: calm clinical surfaces with one focused blue highlight.
   These rules intentionally affect only the two authenticated dashboard routes. */
.pt-body #dashboard,
.dd-body #dashboard { isolation: isolate; }

.pt-body #dashboard .pd-card,
.dd-body #dashboard .dd-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(182, 207, 238, 0.72);
  box-shadow: 0 14px 32px rgba(22, 76, 150, 0.08), 0 2px 5px rgba(22, 76, 150, 0.04);
}

.pt-body #dashboard .pd-card::before,
.dd-body #dashboard .dd-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--pt-blue, #1670f0), rgba(22, 112, 240, 0.18) 58%, transparent);
  opacity: 0.72;
}

.dd-body #dashboard .dd-card::before {
  background: linear-gradient(90deg, var(--dd-blue, #1670f0), rgba(22, 112, 240, 0.18) 58%, transparent);
}

.pt-body #dashboard .pd-tile,
.dd-body #dashboard .dd-stat {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(244, 249, 255, 0.95));
}

.pt-body #dashboard .pd-tile:hover,
.dd-body #dashboard .dd-stat:hover,
.dd-body #dashboard .dd-panel:hover,
.dd-body #dashboard .dd-avail:hover {
  border-color: rgba(104, 166, 240, 0.72);
  box-shadow: 0 18px 38px rgba(22, 76, 150, 0.13), 0 3px 8px rgba(22, 76, 150, 0.05);
}

.pt-body #dashboard .pd-tile__icon,
.dd-body #dashboard .dd-stat__icon {
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 16px rgba(22, 90, 170, 0.09);
}

.pt-body #dashboard .pd-chart-card,
.pt-body #dashboard .pd-activity-card,
.dd-body #dashboard .dd-panel,
.dd-body #dashboard .dd-avail {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.94));
}

.pt-body #dashboard .pd-chart__head,
.pt-body #dashboard .pd-activity__head,
.dd-body #dashboard .dd-panel__head {
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(219, 231, 246, 0.85);
}

.pt-body #dashboard .pd-chart__title,
.pt-body #dashboard .pd-activity__title,
.dd-body #dashboard .dd-panel__title {
  font-weight: 800;
  letter-spacing: -0.025em;
}

.pt-body #dashboard .pd-ranges {
  border: 1px solid rgba(214, 228, 246, 0.92);
  background: rgba(241, 247, 254, 0.88);
}

.pt-body #dashboard .pd-act {
  border: 1px solid rgba(226, 236, 248, 0.92);
  box-shadow: none;
}

.dd-body #dashboard .dd-slots,
.dd-body #dashboard .dd-alerts {
  border-color: rgba(221, 232, 247, 0.9);
  background: rgba(252, 254, 255, 0.72);
}

.dd-body #dashboard .dd-slot { border-color: transparent; }
.dd-body #dashboard .dd-slot + .dd-slot { border-top-color: rgba(225, 235, 248, 0.88); }

@media (max-width: 760px) {
  .pt-body #dashboard .pd-card,
  .dd-body #dashboard .dd-card { border-radius: 14px; }
  .pt-body #dashboard .pd-chart__head,
  .pt-body #dashboard .pd-activity__head,
  .dd-body #dashboard .dd-panel__head { padding-bottom: 0.55rem; }
}
