/* =========================================================================
   Application shells: public header, patient app, clinical console
   ========================================================================= */

/* ---------- Public header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(234,228,229,.9);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5);
  height: var(--header-h); max-width: var(--content-max); margin-inline: auto; padding-inline: var(--sp-5);
}
/* Match the supplied image background, then reflect light across the entire surface. */
.brand {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; flex-shrink: 0; max-width: 100%;
  padding: 4px 8px; border: 1px solid rgba(255,255,255,.82); border-radius: 15px;
  background: #fdfdfd;
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  backdrop-filter: blur(16px) saturate(145%);
  box-shadow: 0 7px 20px -9px rgba(81,15,31,.30), inset 0 2px 1px #fff,
              inset 0 -2px 3px rgba(115,39,58,.15);
  transition: box-shadow .22s ease;
}
.brand::before {
  content: ""; position: absolute; z-index: 2; pointer-events: none;
  inset: 1px; border-radius: 13px;
  background: linear-gradient(180deg, rgba(255,255,255,.68), rgba(255,255,255,.05) 42%,
              rgba(152,110,124,.09) 56%, rgba(255,255,255,.38));
}
.brand::after {
  content: ""; position: absolute; z-index: 2; pointer-events: none;
  inset: 0; border-radius: inherit;
  background: linear-gradient(115deg, transparent 12%, rgba(255,255,255,.12) 22%,
              rgba(255,255,255,.55) 28%, rgba(255,255,255,.08) 37%, transparent 48%);
  box-shadow: inset 1px 0 0 rgba(255,255,255,.65), inset -1px 0 0 rgba(255,255,255,.28);
}
.brand:hover {
  box-shadow: 0 7px 20px -9px rgba(81,15,31,.30), inset 0 1px 0 #fff,
              inset 0 -1px 1px rgba(115,39,58,.12);
}
.brand--compact { padding: 4px; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .brand { transition: none; } }
@supports not (backdrop-filter: blur(1px)) { .brand { background-color: #fdfdfd; } }
.brand__wordmark { display: block; width: 188px; height: auto; border-radius: 4px; }
.brand__mark { display: none; width: 32px; height: 32px; }
.brand-symbol { display: inline-block; width: 32px; height: 32px; max-width: 100%; object-fit: contain; vertical-align: middle; border-radius: 4px; }
.app-sidebar .brand__wordmark { width: 144px; }
.provider-console[data-role="doctor"] .app-sidebar .brand__wordmark,
.provider-console[data-role="practice_owner"] .app-sidebar .brand__wordmark { width: 164px; }
.brand--compact .brand__mark { display: block; }
@media (max-width: 480px) {
  .brand__wordmark { width: 164px; }
}

.site-nav { display: flex; align-items: center; gap: var(--sp-2); }
.site-nav a {
  padding: 9px 14px; border-radius: var(--r-pill); color: var(--ink-2);
  font-weight: 620; font-size: var(--step--1);
  transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.site-nav a:hover { background: var(--line-2); color: var(--ink); }
.site-nav a.is-active { color: var(--red-700); background: var(--red-050); }

.nav-toggle { display: none; background: transparent; border: 0; padding: 8px; border-radius: var(--r-md); color: var(--ink); cursor: pointer; }
.nav-toggle:hover { background: var(--line-2); }

.mobile-menu {
  position: fixed; inset: var(--header-h) 0 0; background: #fff; z-index: 99;
  padding: var(--sp-6) var(--sp-5); overflow-y: auto;
  animation: fade-in .18s var(--ease);
}
.mobile-menu a { display: block; padding: 16px 4px; font-family: var(--font-display); font-size: var(--step-2); font-weight: 650; color: var(--ink); border-bottom: 1px solid var(--line-2); letter-spacing: -0.02em; }
.mobile-menu .btn { margin-top: var(--sp-6); }

@media (max-width: 900px) {
  .site-nav { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  background: #120508;
  color: rgba(255,255,255,.62);
  padding-block: clamp(56px, 7vw, 96px) var(--sp-6);
  margin-top: clamp(56px, 7vw, 104px);
  overflow: hidden;
}
.site-footer::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 120% at 12% -10%, rgba(225,38,47,.20), transparent 62%),
    radial-gradient(50% 90% at 92% 0%, rgba(176,131,39,.12), transparent 60%);
}
.site-footer > * { position: relative; z-index: 1; }
.site-footer a { color: rgba(255,255,255,.66); display: block; padding: 15px 11px; font-size: var(--step--1); }
.site-footer a:hover { color: #fff; }
.site-footer .brand, .site-footer .brand:hover { color: #fff; display: inline-flex; padding: 4px 8px; }

/* The close: statement + the action it earns. The measure lives on the text
   element itself so `em` resolves against the display size, not the footer's
   inherited 15px — which is what collapsed it into a word-column. */
.foot-top {
  display: grid; gap: clamp(28px, 4vw, 64px); align-items: end;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  padding-bottom: clamp(36px, 4vw, 56px);
  margin-bottom: clamp(32px, 4vw, 48px);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
@media (max-width: 800px) { .foot-top { grid-template-columns: 1fr; align-items: start; } }

.foot-statement {
  margin: 0; max-width: 17em;
  font-family: "Fraunces", "Plus Jakarta Sans", Georgia, serif;
  font-size: clamp(1.6rem, .9rem + 2.4vw, 2.7rem);
  line-height: 1.08; letter-spacing: -.03em; color: #fff; font-weight: 600;
  text-wrap: balance;
}
.foot-statement em {
  font-style: italic; font-variation-settings: "SOFT" 60, "WONK" 1;
  background: linear-gradient(96deg, #f49abb 12%, #8fd3a6 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.foot-cta {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-xl); padding: var(--sp-5);
}
.foot-cta__k {
  margin: 0 0 4px; font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.55);
}
.foot-cta__v { margin: 0 0 var(--sp-4); font-size: var(--step--1); color: rgba(255,255,255,.78); }
.foot-cta__alt {
  display: block !important; text-align: center; margin-top: 10px;
  font-size: var(--step--1); color: rgba(255,255,255,.6) !important;
}
.foot-cta__alt:hover { color: #fff !important; }

/* Compact notice below the footer navigation. */
.foot-alarm {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px; margin: 24px 0 0;
  border-radius: 8px;
  background: rgba(225,38,47,.11);
  border: 1px solid rgba(225,38,47,.34);
}
.foot-alarm__icon { color: #FF8A90; flex: none; margin-top: 1px; }
.foot-alarm p { margin: 0; font-size: 12px; line-height: 1.5; color: rgba(255,255,255,.82); }
.foot-alarm strong { color: #fff; }
.foot-alarm a { display: inline; padding: 0; color: #FFC9CD; text-decoration: underline; font-weight: 640; }

.foot-grid { display: grid; gap: clamp(26px, 3vw, 44px); grid-template-columns: 1fr; }
@media (min-width: 620px)  { .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) {
  .foot-grid { grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr)); }
}
.foot-col h4 {
  color: rgba(255,255,255,.5); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; margin-bottom: var(--sp-3); font-weight: 700;
  font-family: var(--font-mono);
}
.foot-col--brand { max-width: 26rem; }
.foot-note { font-size: var(--step--1); line-height: 1.65; margin: var(--sp-4) 0 var(--sp-5); color: rgba(255,255,255,.6); }
.foot-spacer { height: var(--sp-5); }

.foot-address { margin: 0 0 var(--sp-3); font-size: var(--step--1); line-height: 1.6; color: rgba(255,255,255,.6); }
.foot-address strong { display: block; color: #fff; font-weight: 620; margin-bottom: 4px; }
.foot-address span { display: block; }
.foot-strong {
  display: inline-flex !important; align-items: center; gap: 7px;
  color: #fff !important; font-weight: 640; font-size: var(--step-0) !important;
  padding: 4px 0 !important;
}
.foot-hours {
  margin: var(--sp-3) 0 0; font-size: var(--step--1); line-height: 1.7;
  color: rgba(255,255,255,.72);
}

.foot-hours .luv-icon { vertical-align: -2px; margin-right: 5px; }

.foot-rail {
  margin-top: 12px; padding-top: var(--sp-5);
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6);
  justify-content: space-between; align-items: center;
  font-size: .74rem; color: rgba(255,255,255,.55);
}
.foot-rail__mid { flex: 1; min-width: 240px; text-align: center; }
@media (max-width: 760px) { .foot-rail__mid { text-align: left; } }

/* ---------- App shell (patient + console) ----------
   The frame should recede. A warm ground, a hairline rather than a rule, and
   an active state that reads instantly without shouting.
   ---------------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; background: var(--canvas); }
:is(.provider-console, .patient-portal) {
  --sidebar-w: 236px;
  --clinical-nav-background:
    radial-gradient(ellipse 170px 240px at 120% 8%,
      transparent calc(100% - 2px), rgba(255,255,255,.65) calc(100% - 1px) 100%, transparent calc(100% + 1px)),
    radial-gradient(ellipse 260px 290px at -75% 65%,
      transparent calc(100% - 2px), rgba(104,139,119,.16) calc(100% - 1px) 100%, transparent calc(100% + 1px)),
    radial-gradient(ellipse 230px 160px at 115% 110%,
      transparent calc(100% - 2px), rgba(255,255,255,.62) calc(100% - 1px) 100%, transparent calc(100% + 1px)),
    linear-gradient(145deg, #f2dce3 0%, #f8e9e8 43%, #f5eddf 66%, #dce9de 100%);
}
:is(.provider-console, .patient-portal) .app-sidebar {
  padding-inline: 10px;
  background: var(--clinical-nav-background);
  border-right-color: #dfcfd4;
}
:is(.provider-console, .patient-portal) .provider-mobile-nav { background: var(--clinical-nav-background); }
.provider-console .app-sidebar__head { gap: 4px; margin-left: 0; }
.provider-console .app-sidebar__head .brand { flex: 1 1 auto; }
.provider-console .app-sidebar__head .brand__wordmark { max-width: 100%; }
.provider-console .side-toggle { width: 30px; }
.provider-console .app-sidebar .side-link { padding-inline: 8px; gap: 8px; }

.patient-portal { --sidebar-w:200px; }
.provider-console { --sidebar-w:208px; }
@media (min-width:901px) {
  html:not(.sidebar-collapsed) .provider-console .app-sidebar { padding-inline:8px; }
  html:not(.sidebar-collapsed) .provider-console .app-sidebar .brand__wordmark { width:136px; }
  html:not(.sidebar-collapsed) .provider-console .side-toggle { width:28px; }
  html:not(.sidebar-collapsed) .provider-console .app-sidebar .side-link { padding-inline:7px; gap:6px; }
  html:not(.sidebar-collapsed) .provider-console .provider-nav-group__links .side-link { font-size:.82rem; }
  html:not(.sidebar-collapsed) .provider-console .side-user { padding:12px 8px; gap:8px; }
  html:not(.sidebar-collapsed) .patient-portal .app-sidebar { padding-inline:8px; }
  html:not(.sidebar-collapsed) .patient-portal .app-sidebar__head { gap:4px; margin-left:0; }
  html:not(.sidebar-collapsed) .patient-portal .app-sidebar__head .brand { flex:1 1 auto; }
  html:not(.sidebar-collapsed) .patient-portal .app-sidebar .brand__wordmark { width:128px; max-width:100%; }
  html:not(.sidebar-collapsed) .patient-portal .side-toggle { width:28px; }
  html:not(.sidebar-collapsed) .patient-portal .side-link { padding-inline:8px; gap:7px; font-size:.84rem; }
  html:not(.sidebar-collapsed) .patient-portal .side-user { padding:12px 8px; gap:8px; }
}

.app-sidebar {
  position: sticky; top: 0; align-self: flex-start; flex: none;
  width: var(--sidebar-w); height: 100vh; background: var(--surface);
  border-right: 1px solid var(--line); padding: var(--sp-5) var(--sp-4);
  display: flex; flex-direction: column; gap: 2px; overflow-x: hidden; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: transparent transparent;
  transition: width var(--dur-2) var(--ease-out), padding var(--dur-2) var(--ease-out);
}
/* The scrollbar only shows while the pointer is over the sidebar. */
.app-sidebar:hover { scrollbar-color: var(--line) transparent; }
.app-sidebar .brand { margin: var(--sp-2) var(--sp-2) var(--sp-6); }

/* Brand row, with the button that folds the sidebar into an icon rail */
.app-sidebar__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  margin: var(--sp-2) 0 var(--sp-6) var(--sp-2);
}
.app-sidebar__head .brand { margin: 0; min-width: 0; white-space: nowrap; }
.side-toggle {
  display: none; place-items: center; flex: none;
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--ink-4); cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.has-sidebar-toggle .side-toggle { display: inline-grid; }
.side-toggle:hover { background: var(--line-2); color: var(--ink); }
.side-toggle:focus-visible { outline: 2px solid var(--red-500); outline-offset: 2px; }
.side-toggle__close, .side-toggle__open { display: grid; }
.side-toggle__open { display: none; }

.side-link {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r-md); color: var(--ink-2);
  font-family: var(--font-display); font-weight: 620; font-size: .92rem;
  letter-spacing: -0.012em;
  transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.side-link .luv-icon { color: var(--ink-4); flex: none; transition: color var(--dur-1) var(--ease-out); }
.side-link:hover { background: var(--line-2); color: var(--ink); }
.side-link:hover .luv-icon { color: var(--ink-3); }
.side-link.is-active {
  background: var(--red-050); color: var(--red-700); font-weight: 700;
}
.side-link.is-active .luv-icon { color: var(--red-500); }
/* A short brand marker on the active row — cheaper to read than a full fill */
.side-link.is-active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--red-500);
}
.side-link__count {
  margin-left: auto; background: var(--red-500); color: #fff; font-size: .66rem;
  font-weight: 750; border-radius: var(--r-pill); padding: 2px 7px; min-width: 20px;
  text-align: center; line-height: 1.5; flex: none; white-space: nowrap;
}
.side-group {
  margin-top: var(--sp-5); padding: 0 12px 6px; font-size: .64rem;
  letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-4);
  font-weight: 750;
}
/* Provider navigation keeps daily work visible and secondary tools in native,
   keyboard-operable disclosures. Active destinations are expanded by the template. */
.provider-nav-group { flex: none; margin-top: var(--sp-3); }
.provider-nav-group + .provider-nav-group { margin-top: 2px; }
.provider-nav-group__toggle {
  cursor: pointer; list-style: none; gap: 8px; font-size: .76rem;
  font-weight: 650; color: var(--ink-3);
}
.provider-nav-group__toggle::-webkit-details-marker { display: none; }
.provider-nav-group__toggle::marker { content: ""; }
.provider-nav-group__toggle:focus-visible { outline: 2px solid var(--red-500); outline-offset: -2px; }
.provider-nav-group__chevron { display: flex; margin-left: auto; }
.provider-nav-group[open] > summary .provider-nav-group__chevron { transform: rotate(180deg); }
.provider-nav-group__links { padding: 3px 0 6px; }
.provider-nav-group__links .side-link { font-size: .86rem; }
.provider-mobile-nav { display: none; }
.app-sidebar__foot { margin-top: auto; padding-top: var(--sp-4); border-top: 1px solid var(--line-2); }
.side-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 14px 12px;
  margin-bottom: 8px;
  border: 1px solid #ead1d8;
  border-radius: 17px;
  background: radial-gradient(ellipse at 100% 100%, rgba(218, 231, 219, .45), transparent 65%),
              linear-gradient(125deg, #f9e5eb, #fff7f8);
  box-shadow: 0 5px 16px rgba(107, 39, 61, .08), inset 0 1px 0 rgba(255, 255, 255, .85);
}
.side-user__avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 13px;
  background: linear-gradient(145deg, #b95f79, #7f304a);
  box-shadow: 0 4px 9px rgba(111, 38, 64, .2);
  color: #fff;
  font-size: .86rem;
  font-weight: 750;
}
.side-user__copy { min-width: 0; flex: 1; }
.side-user__name {
  color: #542b38;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.side-user__role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  margin-top: 6px;
  padding: 3px 7px;
  border: 1px solid rgba(127, 48, 74, .11);
  border-radius: 7px;
  background: rgba(255, 255, 255, .72);
  color: #754655;
  font-size: .64rem;
  font-weight: 600;
  line-height: 1.35;
}
.side-user__role .luv-icon { flex: none; }

/* Collapsed: an icon rail. Labels stay in the page for screen readers, and the
   script gives each link a tooltip. */
@media (min-width: 901px) {
  .sidebar-collapsed .app-sidebar { width: 76px; padding-inline: 10px; }
  .sidebar-collapsed .app-body { margin-inline: auto; }
  .sidebar-collapsed .app-sidebar__head {
    flex-direction: column; justify-content: flex-start; gap: var(--sp-3);
    margin: var(--sp-2) 0 var(--sp-5);
  }
  .sidebar-collapsed .app-sidebar__head .brand > :not(.brand__mark) { display: none; }
  .sidebar-collapsed .app-sidebar__head .brand__mark { display: block; }
  .sidebar-collapsed .app-sidebar__head .brand { padding: 4px; border-radius: 12px; }
  .sidebar-collapsed .side-toggle__close { display: none; }
  .sidebar-collapsed .side-toggle__open { display: grid; }
  .sidebar-collapsed .side-link { justify-content: center; gap: 0; padding: 11px 0; font-size: 0; }
  .sidebar-collapsed .provider-nav-group__links .side-link { font-size: 0; }
  .sidebar-collapsed .provider-nav-group__chevron { display: none; }
  .sidebar-collapsed .side-link__count {
    position: absolute; top: 4px; right: 8px; margin: 0;
    min-width: 17px; padding: 1px 5px; font-size: .6rem;
    box-shadow: 0 0 0 2px var(--surface);
  }
  .sidebar-collapsed .side-group {
    height: 1px; margin: var(--sp-4) 12px var(--sp-3); padding: 0;
    font-size: 0; background: var(--line);
  }
  .sidebar-collapsed .side-user { justify-content: center; padding: 8px 4px; border-radius: 15px; }
  .sidebar-collapsed .side-user > :not(.avatar) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .app-sidebar { transition: none; }
}

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: var(--sp-3);
  height: var(--header-h); padding-inline: var(--sp-5);
  background: rgba(250,248,248,.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.app-topbar__title {
  font-family: var(--font-display); font-weight: 700; font-size: var(--step-0);
  letter-spacing: -0.015em; margin: 0; color: var(--ink-2);
}
/* Keep the colour and contour detail inside the clinical title bar.
   Ask Luv Health AI retains its continuous page background. */
:is(.provider-console, .patient-portal):not(.provider-ai-page):not(.patient-ai-page) .app-topbar {
  background:
    radial-gradient(ellipse 230px 145px at 73% -80px,
      transparent 78%, rgba(255,255,255,.6) 78.5% 79.2%, transparent 79.7%),
    radial-gradient(ellipse 290px 170px at 98% 150px,
      transparent 71%, rgba(104,139,119,.16) 71.5% 72%, transparent 72.5%),
    linear-gradient(112deg, transparent 42%, rgba(255,255,255,.4) 52%, transparent 63%),
    linear-gradient(105deg, #f2dce3 0%, #f8e9e8 43%, #f5eddf 65%, #dce9de 100%);
  border-bottom-color: #dfcfd4;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
:is(.provider-console, .patient-portal) .app-topbar__title {
  color: #4c2330;
  font-weight: 800;
}
:is(.provider-console, .patient-portal) .app-topbar > .icon-btn {
  color: #5f3443;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 13px;
  box-shadow: 0 3px 8px rgba(78,61,67,.07), inset 0 1px 0 #fff;
}
:is(.provider-console, .patient-portal) .app-topbar > .icon-btn:hover {
  color: #5f0b17;
  background: #fff;
}
:is(.provider-console, .patient-portal) .app-topbar > .icon-btn:focus-visible {
  outline: 2px solid #5f0b17;
  outline-offset: 3px;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: var(--r-md); border: 0; background: transparent; color: var(--ink-3);
  cursor: pointer; position: relative;
  transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn__dot {
  position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red-500); border: 2px solid var(--canvas);
}

.app-body { flex: 1; padding: var(--sp-7) var(--sp-6) calc(var(--mobile-nav-h) + var(--sp-8)); max-width: 1120px; width: 100%; }
.app-body--wide { max-width: 1400px; }
.app-body--flush { padding-inline: 0; }

/* An in-app page title is a label, not a billboard. */
.page-head { margin-bottom: var(--sp-6); }
.page-head h1 {
  margin-bottom: 5px; font-size: var(--step-app-title);
  letter-spacing: var(--track-tight); line-height: 1.12;
}
.page-head p { color: var(--ink-3); margin: 0; font-size: var(--step--1); line-height: 1.6; max-width: 68ch; }

/* Mobile bottom navigation */
.mobile-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  display: none; align-items: stretch;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 9px 2px; height: var(--mobile-nav-h);
  color: var(--ink-4); font-size: .66rem; font-weight: 650; font-family: var(--font-display);
}
.mobile-nav a.is-active { color: var(--red-600); }
.mobile-nav__fab {
  flex: none; width: 62px; display: grid; place-items: center;
}
.mobile-nav__fab span {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--red-500), var(--red-700)); color: #fff;
  box-shadow: var(--sh-red); margin-top: -22px; border: 4px solid var(--canvas);
}

@media (max-width: 900px) {
  .app-sidebar { display: none; }
  .provider-console .app { flex-direction: column; }
  .provider-mobile-nav {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: var(--sp-3); padding: var(--sp-4); border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  .provider-mobile-nav .brand__wordmark { width: 164px; }
  .provider-mobile-nav__menu { display: contents; }
  .provider-mobile-nav__menu > summary {
    display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
    min-height: 44px; color: var(--ink-2); font-size: .78rem; font-weight: 650;
  }
  .provider-mobile-nav__menu > summary::-webkit-details-marker { display: none; }
  .provider-mobile-nav__menu > summary::marker { content: ""; }
  .provider-mobile-nav__menu > summary:focus-visible { outline: 2px solid var(--red-500); outline-offset: 3px; }
  .provider-mobile-nav__menu[open] > summary > .luv-icon:last-child { transform: rotate(180deg); }
  .provider-mobile-nav__links { flex-basis: 100%; }
  .provider-mobile-nav__menu:not([open]) .provider-mobile-nav__links { display: none; }
  .mobile-nav { display: flex; }
  .app-body { padding: var(--sp-5) var(--sp-4) calc(var(--mobile-nav-h) + var(--sp-8)); }
}
@media (min-width: 901px) {
  .app-body { padding-bottom: var(--sp-9); }
}

/* Sticky mobile action bar */
.sticky-actions {
  position: sticky; bottom: 0; z-index: 50;
  background: linear-gradient(to top, var(--canvas) 62%, rgba(250,248,248,0));
  padding: var(--sp-5) 0 var(--sp-4); margin-top: var(--sp-6);
}
@media (max-width: 900px) {
  .sticky-actions { position: fixed; left: 0; right: 0; bottom: var(--mobile-nav-h); padding: var(--sp-4); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(12px); margin: 0; }
  .has-sticky-actions .app-body { padding-bottom: calc(var(--mobile-nav-h) + 100px); }
}

/* Split view — inbox / conversation */
.split { display: grid; grid-template-columns: 380px 1fr; gap: 0; min-height: calc(100vh - var(--header-h)); }
.split__list { border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; max-height: calc(100vh - var(--header-h)); }
.split__detail { min-width: 0; display: flex; flex-direction: column; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } .split__list { border-right: 0; max-height: none; } }

.list-item {
  display: flex; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line-2); color: inherit;
  transition: background-color var(--dur-1) var(--ease-out);
}
.list-item:hover { background: var(--line-3); color: inherit; }
.list-item.is-active { background: var(--red-050); box-shadow: inset 3px 0 0 var(--red-500); }
.list-item.is-unread .list-item__title { font-weight: 720; }
.list-item__title { font-family: var(--font-display); font-weight: 620; font-size: var(--step-0); letter-spacing: -0.015em; }

.composer {
  position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line);
  padding: var(--sp-4) var(--sp-5); display: flex; gap: var(--sp-3); align-items: flex-end;
}
.composer textarea { min-height: 52px; max-height: 180px; border-radius: var(--r-lg); }

/* Clinical patient chart sidebar */
.chart-rail { width: 320px; flex: none; border-left: 1px solid var(--line); background: var(--surface); padding: var(--sp-5); overflow-y: auto; }
@media (max-width: 1200px) { .chart-rail { display: none; } }
.rail-block + .rail-block { margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--line-2); }
.rail-block h4 { font-size: .66rem; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-4); margin-bottom: var(--sp-3); font-weight: 750; }
.rail-fact { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: var(--step--1); padding: 4px 0; }
.rail-fact dt { color: var(--ink-3); }
.rail-fact dd { margin: 0; font-weight: 620; text-align: right; }
.self-reported { font-size: .68rem; color: var(--amber-500); background: var(--amber-050); padding: 2px 7px; border-radius: var(--r-pill); font-weight: 650; }

/* A form button that looks like a sidebar link (the front desk's Guided tour). */
.side-link--button { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; }
.side-link--button:focus-visible { outline: 2px solid var(--red-500); outline-offset: -2px; }

/* Patient filters share the clinical portal's raised pill treatment. */
.patient-portal :is(.msgs-tab, .meds-filter, .patient-filter-tabs > a, .rec-more > summary, .tabs > a) {
  border: 1px solid #e6d4dc; border-radius: 999px; background: #fffafa;
  padding: 9px 16px; color: #70304c; font-weight: 700;
  box-shadow: 0 3px 7px #592a3c0c;
  transition: transform .2s ease, box-shadow .2s ease;
}
.patient-portal :is(.msgs-tab, .meds-filter, .patient-filter-tabs > a, .rec-more > summary, .tabs > a).is-active,
.patient-portal .patient-filter-tabs a[aria-current="page"] { background: #70304c; color: white; }
@media (hover: hover) {
 .patient-portal :is(.msgs-tab, .meds-filter, .patient-filter-tabs > a, .rec-more > summary, .tabs > a):hover { transform: translateY(-4px); box-shadow: 0 10px 20px #592a3c26; }
}
@media (prefers-reduced-motion: reduce) {
 .patient-portal :is(.msgs-tab, .meds-filter, .patient-filter-tabs > a, .rec-more > summary, .tabs > a) { transition: none; transform: none; }
}

.patient-portal :is(.patient-page-head,.msgs-head,.visits-head,.meds-head,.hp-head) {
 padding:22px; border:1px solid #e6d4dc; border-radius:24px;
 background:linear-gradient(120deg,#f9e9ed,#fff9f7 65%,#edf3ed);
 box-shadow:0 8px 22px #592a3c0d;
}
.patient-portal :is(.msgs-tabs,.meds-filters,.patient-filter-tabs) { padding-block:6px 12px; }
.patient-portal :is(.msgs-tab,.meds-filter,.patient-filter-tabs > a,.rec-more > summary):focus-visible { outline:3px solid #c28da6; outline-offset:3px; }

/* Patient page headings and controls share a single Home-style surface. */
.patient-portal .patient-overview {
  position:relative; min-width:0; display:grid; gap:18px; padding:24px;
  border:1px solid #e6d4dc; border-radius:24px;
  background:linear-gradient(120deg,#f9e9ed,#fff9f7 65%,#edf3ed);
  box-shadow:0 8px 22px #592a3c0d;
}
.patient-portal .patient-overview::before {
  content:""; position:absolute; inset:22px auto 22px 0; width:4px;
  border-radius:0 4px 4px 0; background:linear-gradient(#c9455c,#70304c);
}
.patient-portal .patient-overview :is(.msgs-head,.patient-page-head,.meds-head) {
  padding:0; margin:0; border:0; border-radius:0; background:transparent; box-shadow:none;
}
.patient-portal .patient-overview .msgs-tools { margin:0; min-width:0; gap:12px 18px; }
.patient-portal .patient-overview .msgs-tabs { padding:6px 3px 10px; background:transparent; }
.patient-portal .patient-overview .msgs-search { min-width:0; flex:1 1 260px; }
.patient-portal .patient-overview .msgs-search input { min-width:0; width:100%; }
.patient-portal .patient-overview :is(.meds-filters,.patient-filter-tabs) { margin:0; flex-wrap:wrap; overflow:visible; }
.patient-portal .patient-overview .rec-folder { background:#ffffffbf; box-shadow:0 3px 7px #592a3c0c; }
.patient-portal :is(.hp-filter,.rec-folder,.rec-more__panel a) {
  transition:transform .2s ease,box-shadow .2s ease;
}
.patient-portal .hp-filter { border-color:#e6d4dc; color:#70304c; background:#fffafa; box-shadow:0 3px 7px #592a3c0c; }
.patient-portal .hp-filter.is-active { color:white; background:#70304c; }
@media(hover:hover) and (pointer:fine) {
 .patient-portal :is(.hp-filter,.patient-overview .rec-folder,.rec-more__panel a):hover { transform:translateY(-4px); box-shadow:0 10px 20px #592a3c26; }
}
@media(max-width:640px) {
 .patient-portal .patient-overview { padding:20px; }
 .patient-portal .patient-overview .msgs-tabs { flex-wrap:wrap; overflow:visible; }
 .patient-portal .patient-overview .msgs-search { flex-basis:100%; flex-wrap:wrap; }
 .patient-portal .patient-overview .msgs-search input { flex:1 1 160px; }
}
@media(prefers-reduced-motion:reduce) {
 .patient-portal :is(.hp-filter,.rec-folder,.rec-more__panel a) { transition:none; }
 .patient-portal :is(.hp-filter,.rec-folder,.rec-more__panel a):hover { transform:none; }
}
.patient-portal .patient-overview .patient-page-head::before { display:none; }
.patient-portal .patient-overview :is(.patient-page-head,.msgs-head,.meds-head) h1 { font-size:var(--step-app-title); line-height:1.12; }
