/* The selected aurora theme keeps cyan/lilac in the atmosphere, while
   decorative icons stay blue and clinical warning colours stay semantic. */
html :is(.doctorai-homepage, body[data-hub-layout="reference"]) {
  --aurora-base: #f5f8ff;
  --aurora-cyan: #95dffbc4;
  --aurora-lilac: #b9b8f9ad;
  --aurora-blush: #f4c9f1ae;
  --aurora-side: #8dacfac4;
  --aurora-glow: #ad9bf4ae;
  --aurora-edge: #d6e4fa;
  --aurora-accent: #0865df;
  --aurora-glass: #ffffffb8;
  background-color: var(--aurora-base);
  background-image:
    radial-gradient(ellipse at 49% 33%, #ffffffc7, transparent 41%),
    radial-gradient(ellipse 12% 13% at 20% 39%, #ffffffa8, transparent 96%),
    radial-gradient(ellipse 13% 13% at 80% 39%, #ffffffa8, transparent 96%),
    radial-gradient(ellipse 19% 15% at -1% 0%, var(--aurora-lilac), transparent 92%),
    radial-gradient(ellipse 19% 16% at -2% 31%, var(--aurora-side), transparent 88%),
    radial-gradient(ellipse 22% 18% at 27% 23%, var(--aurora-cyan), transparent 90%),
    radial-gradient(ellipse 23% 19% at 103% 31%, var(--aurora-cyan), transparent 90%),
    radial-gradient(ellipse 18% 18% at -3% 49%, var(--aurora-blush), transparent 88%),
    radial-gradient(ellipse 22% 20% at 102% 49%, var(--aurora-glow), transparent 90%),
    radial-gradient(ellipse 20% 18% at 16% 77%, var(--aurora-lilac), transparent 90%),
    radial-gradient(ellipse 24% 19% at 83% 79%, var(--aurora-cyan), transparent 90%),
    radial-gradient(ellipse 35% 27% at 0% 36%, var(--aurora-side), transparent 90%),
    radial-gradient(ellipse 34% 30% at 100% 46%, var(--aurora-glow), transparent 90%),
    radial-gradient(ellipse at 6% 28%, var(--aurora-cyan), transparent 44%),
    radial-gradient(ellipse at 96% 32%, var(--aurora-cyan), transparent 45%),
    radial-gradient(ellipse at 7% 53%, var(--aurora-blush), transparent 40%),
    radial-gradient(ellipse at 88% 55%, var(--aurora-lilac), transparent 44%),
    radial-gradient(ellipse at 48% 84%, var(--aurora-cyan), transparent 47%);
  background-size: 100% 1120px;
  background-repeat: no-repeat;
}
/* Route icons and headings share one restrained blue treatment. Labels and
   distinct shapes identify each destination without relying on colour. */
.doctorai-homepage {
  --home-today-surface: #e8f2ff;
  --home-today-accent: #0759b6;
  --home-health-surface: #e8f2ff;
  --home-health-accent: #0759b6;
  --home-visit-surface: #e8f2ff;
  --home-visit-accent: #0759b6;
  --home-profile-surface: #e8f2ff;
  --home-profile-accent: #0759b6;
}
body[data-hub-layout="reference"][data-active-feature="medications"] { --destination-bg: #e8f2ff; --destination-accent: #0759b6; }
body[data-hub-layout="reference"][data-active-feature="symptoms"] { --destination-bg: #e8f2ff; --destination-accent: #0759b6; }
body[data-hub-layout="reference"][data-active-feature="appointments"] { --destination-bg: #e8f2ff; --destination-accent: #0759b6; }
body[data-hub-layout="reference"][data-active-feature="visit-prep"] { --destination-bg: #e8f2ff; --destination-accent: #0759b6; }

/* Homepage: a centred, spacious first screen, with the existing flows below. */
.doctorai-homepage .home-header { border: 0; padding-block: 16px; z-index: 2; }
.doctorai-homepage .home-brand { gap: 2px; }
.doctorai-homepage .home-brand-symbol { width: 60px; height: 68px; overflow: hidden; }
.doctorai-homepage .home-brand-symbol img { width: 108px; height: 108px; max-width: none; margin: -21px 0 0 -23px; }
.doctorai-homepage .home-brand-wordmark { width: 164px; height: 46px; overflow: hidden; }
.doctorai-homepage .home-brand-wordmark img { width: 220px; height: 147px; max-width: none; margin: -101px 0 0 -28px; }
.doctorai-homepage .home-nav { gap: 32px; }
.doctorai-homepage .home-nav .home-button { padding: 14px 22px; border-radius: 13px; }
.doctorai-homepage .home-nav .home-nav-full { display: inline; }
.home-aurora-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding-block: 0 22px;
  text-align: center;
  isolation: isolate;
}
.home-aurora-hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 290px;
  left: 50%;
  width: calc(100% + var(--home-gutter) + var(--home-gutter));
  height: 580px;
  transform: translateX(-50%);
  border-top: 1px solid #ffffffd9;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(#ffffff61, #ffffff00);
  pointer-events: none;
}
.doctorai-homepage { overflow-x: clip; }
.home-aurora-mark {
  position: relative;
  width: clamp(250px, 32vw, 480px);
  aspect-ratio: 1;
  margin-top: -22px;
  margin-bottom: -87px;
  border: 1px solid #ffffffe6;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #ffffff7a, #ffffff17 65%, #dfddff47);
  box-shadow: inset 0 0 35px #ffffff73, 0 15px 55px #668ed915;
}
.home-aurora-mark .home-logo-tilt { inset: -18px 0 18px; }
.home-aurora-mark .home-hero-logo { object-fit: contain; opacity: .84; }
.home-aurora-hero .home-hero-copy { position: relative; width: 100%; max-width: none; }
.home-aurora-hero h1 {
  max-width: none;
  color: #061639;
  font-size: clamp(46px, 6vw, 86px);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.06em;
}
.home-aurora-hero h1 em { display: inline; font: inherit; color: #0664ed; letter-spacing: inherit; }
.home-aurora-hero .home-lead { max-width: 48ch; margin: 16px auto 0; color: #3e5676; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.32; }
.home-aurora-hero .home-actions { justify-content: center; margin-top: 18px; }
.home-aurora-hero .home-add-actions { width: min(100%, 365px); gap: 6px; }
.home-aurora-hero .home-add-detail { justify-content: center; min-height: 68px; border: 1px solid #ffffff80; border-radius: 50px; background: #0664ed; box-shadow: 0 8px 30px #0877f529; font-size: 22px; }
.home-aurora-hero .home-add-detail:hover { background: #0759b6; }
.home-aurora-hero .home-add-detail > span { width: 32px; height: 32px; flex-basis: 32px; }
.home-aurora-hero .home-scan-link { min-height: 44px; font-size: 17px; color: #0759b6; }
.home-aurora-hero .home-scan-link small { background: #ffffffb3; }
.home-aurora-dock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(100%, 1180px); margin-top: 26px; padding: 18px 26px; border: 2px solid #ffffffd9; border-radius: 64px; background: #ffffff69; box-shadow: 0 8px 32px #718dd50b; backdrop-filter: blur(14px); }
.home-aurora-dock a { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 62px; padding: 0 15px; color: #061639; font-size: 17px; font-weight: 700; line-height: 1.35; text-decoration: none; }
.home-aurora-dock a + a { border-left: 1px solid #b5ccef; }
.home-aurora-dock a:hover { text-decoration: underline; text-underline-offset: 5px; }
.home-aurora-dock .home-dock-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 52px; width: 52px; height: 52px; padding: 10px; border: 1px solid #bed9f1; border-radius: 50%; background: var(--home-topic-surface); color: var(--home-topic-accent); box-shadow: inset 0 1px #fff; }
.home-aurora-dock svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.home-dock-check { display: inline-flex; width: 18px; height: 18px; color: #0069ed; }
.home-aurora-dock a:first-child::after { content: ''; position: absolute; bottom: -7px; height: 3px; left: 18%; right: 18%; border-radius: 4px; background: #0878f5; }
.home-aurora-note { margin: 16px 0 0; color: #465f73; font-size: 15px; }
.home-aurora-meta { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; margin-top: 6px; }
.home-aurora-meta .home-hero-limit { max-width: none; margin: 0; font-size: 12px; color: #465f73; }
.home-aurora-meta .home-motion-control { font-size: 12px; color: #465f73; }
.doctorai-homepage .home-topics { margin-top: 20px; }

/* Health Hub: keep text on readable surfaces; tint the surroundings, not data.
   Orange also covers unassessed/limited checks, not just a known risk. */
body[data-hub-layout="reference"] #hub-shell { background: transparent; }
body[data-hub-layout="reference"] #hub-shell .sidebar {
  background: var(--aurora-glass);
  border-right-color: var(--aurora-edge);
  backdrop-filter: blur(18px);
}
body[data-hub-layout="reference"] #hub-shell #view-today.view { background: #ffffffb8; border-color: var(--aurora-edge); }
body[data-hub-layout="reference"] #hub-shell .view-stack { padding-top: 12px; }
body[data-hub-layout="reference"] #hub-shell .hub-main { border-top: 4px solid var(--aurora-accent); }
body[data-hub-layout="reference"] #hub-shell .hub-topbar { background: var(--aurora-glass); }
body[data-hub-layout="reference"] .mobile-bottom-nav { background: #fffffff2; }
body[data-hub-layout="reference"] :is(.hub-alert-shortcut, .health-alert-card) { background-clip: padding-box; }
/* Alert severity is expressed in alert cards and small status badges only. */

/* Quiet navigation lets the icon and active state carry the route colour. */
body[data-hub-layout="reference"][data-hub-theme] #hub-shell .primary-nav > .nav-item[data-view] {
  min-height: 56px;
  gap: 11px;
  padding-inline: 10px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
}
body[data-hub-layout="reference"][data-hub-theme] #hub-shell .primary-nav > .nav-item[data-view]:is(.active, [aria-current="page"], :hover) {
  border-color: #c9dcef;
  background: var(--hub-category-surface);
  box-shadow: inset 3px 0 var(--hub-category-accent);
}
body[data-hub-layout="reference"][data-hub-theme] #hub-shell .primary-nav > .nav-item[data-view] .nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 7px;
  border: 1px solid #c7dff0;
  border-radius: 11px;
  background: var(--hub-category-surface);
  color: var(--hub-category-accent);
  box-shadow: inset 0 1px #fff;
}
body[data-hub-layout="reference"][data-hub-theme] #hub-shell .primary-nav > .nav-item[data-view] .nav-icon svg { width: 19px; height: 19px; color: inherit; }
body[data-hub-layout="reference"] #hub-shell .doctorai-feature-mark,
.doctorai-homepage :is(.home-orbit-topic, .home-destination, .home-topics, .home-brief-rows) svg.doctorai-feature-mark { stroke-width: 2.2; }

/* Large panels use pale washes; the short category labels retain their
   matching aurora colours. Secondary routes receive real header padding. */
body[data-hub-layout="reference"][data-hub-theme] #hub-shell :is(#view-health, #view-visit-prep, #view-profile) > .page-heading,
body[data-hub-layout="reference"][data-hub-theme] #hub-shell #view-today > .reference-intro {
  border: 1px solid var(--aurora-edge);
  border-left: 3px solid var(--hub-category-accent);
  background: linear-gradient(115deg, #ffffffed, var(--hub-category-surface));
  box-shadow: 0 10px 28px #496eaa0b;
}
body[data-hub-layout="reference"][data-active-feature] #hub-shell :is(#view-add, #view-medications, #view-diary, #view-symptoms, #view-appointments) > .page-heading {
  padding: 20px 24px;
  border: 1px solid var(--aurora-edge);
  border-left: 3px solid var(--destination-accent);
  background: linear-gradient(115deg, #ffffffed, var(--destination-bg));
  box-shadow: 0 10px 28px #496eaa0b;
}
body[data-hub-layout="reference"][data-hub-theme] #hub-shell :is(#view-health, #view-visit-prep, #view-profile) :is(.health-snapshot, .health-reminders-disclosure, .reference-brief-card, .profile-page-hero, .hub-storage-status article, .memory-card) {
  border-color: var(--aurora-edge);
  background: linear-gradient(115deg, #ffffffed, var(--hub-category-surface));
}
body[data-hub-layout="reference"][data-hub-theme] #hub-shell #view-health .care-visit-card,
body[data-hub-layout="reference"][data-hub-theme] #hub-shell #view-today .reference-visit-link {
  border-color: #c9dcef;
  background: linear-gradient(115deg, #ffffffed, var(--hub-visit-surface));
}

/* Feature and utility tiles reuse the same restrained surface language.
   Alert cards, severity badges and clinical status icons are untouched. */
body[data-hub-layout="reference"] #hub-shell :is(.refill-icon, .result-file-icon, .info-icon.coral, .overview-icon.coral, .provider-avatar, .drop-icon) {
  border: 1px solid #c6dcef;
  background: #edf5ff;
  color: #0759b6;
}
body[data-hub-layout="reference"] #hub-shell :is(.info-icon.purple, .overview-icon.purple, .provider-avatar.pale) {
  border: 1px solid #c6dcef;
  background: #edf5ff;
  color: #0759b6;
}
body[data-hub-layout="reference"] :is(.drawer-row-icon, .modal-choice > span, .profile-shortcut-add > span:first-child) {
  border: 1px solid #c6dcef;
  border-radius: 11px;
  background: #edf5ff;
  color: #0759b6;
}
body[data-hub-layout="reference"] #view-profile .profile-shortcut-card { border-color: #d2e2f0; background: #ffffffd9; }
body[data-hub-layout="reference"] #view-profile .profile-shortcut-card:hover { border-color: #89b8e4; background: #f6faff; }
body[data-hub-layout="reference"] #view-profile :is(.memory-large-icon, .memory-disclosure-chevron, .memory-disclosure-status) { color: var(--hub-profile-accent); }

/* The Add Health Detail chooser has six distinct symbols in one blue palette. */
body[data-hub-layout="reference"] #hub-shell #view-add .add-detail-choice {
  --choice-bg: #f8fbff;
  --choice-border: #c6dcef;
  --choice-accent: #0759b6;
  --choice-icon-bg: #e8f2ff;
  --choice-ink: #0759b6;
  box-shadow: inset 3px 0 var(--choice-accent);
}

/* Navigation never repaints a clinical badge blue. */
@media (max-width: 800px) {
  body[data-hub-layout="reference"][data-hub-theme] .mobile-bottom-nav > [data-view] { border: 1px solid transparent; background: transparent; box-shadow: none; }
  body[data-hub-layout="reference"][data-hub-theme] .mobile-bottom-nav > [data-view]:is(.active, [aria-current="page"]) { border-color: #c9dcef; background: var(--hub-category-surface); box-shadow: inset 0 2px var(--hub-category-accent); }
  body[data-hub-layout="reference"][data-hub-theme] .mobile-bottom-nav > .mobile-bottom-nav-item[data-view] { grid-template-rows: 28px auto; height: 62px; }
  body[data-hub-layout="reference"][data-hub-theme] .mobile-bottom-nav > .mobile-bottom-nav-item[data-view] > span:not(.hub-alert-nav-symbol) {
    width: 28px;
    height: 28px;
    padding: 3px;
    border: 1px solid #c7dff0;
    border-radius: 9px;
    background: var(--hub-category-surface);
    color: var(--hub-category-accent);
  }
  body[data-hub-layout="reference"][data-hub-theme] .mobile-bottom-nav > .mobile-bottom-nav-item[data-view] > span:not(.hub-alert-nav-symbol) svg { width: 20px; height: 20px; color: inherit; }
  body[data-hub-layout="reference"][data-active-feature] #hub-shell :is(#view-add, #view-medications, #view-diary, #view-symptoms, #view-appointments) > .page-heading { padding: 18px 16px; }
}

@media (max-width: 1080px) and (min-width: 681px) {
  .doctorai-homepage .home-nav-page { display: inline-flex !important; }
  .doctorai-homepage .home-mobile-menu { display: none; }
}
@media (max-width: 860px) {
  .home-aurora-mark { margin-top: 0; margin-bottom: -26px; }
  .home-aurora-hero h1 { font-size: clamp(42px, 6.3vw, 64px); }
  .home-aurora-hero::before { top: 180px; }
  .home-aurora-dock { padding: 12px; border-radius: 30px; }
  .home-aurora-dock a { gap: 9px; padding-inline: 8px; font-size: 15px; }
  .home-aurora-dock .home-dock-icon { flex-basis: 40px; width: 40px; height: 40px; padding: 9px; }
  .home-dock-check { display: none; }
}
@media (min-width: 1081px) and (max-height: 640px) {
  .home-aurora-mark { width: clamp(210px, 17vw, 250px); margin-top: -18px; margin-bottom: -72px; }
  .home-aurora-hero { padding-bottom: 14px; }
  .home-aurora-hero h1 { font-size: clamp(42px, 4.2vw, 54px); line-height: .95; }
  .home-aurora-hero .home-lead { margin-top: 12px; font-size: 17px; line-height: 1.25; }
  .home-aurora-hero .home-actions { margin-top: 12px; }
  .home-aurora-hero .home-add-actions { gap: 4px; }
  .home-aurora-hero .home-add-detail { min-height: 56px; font-size: 18px; }
  .home-aurora-hero .home-add-detail > span { width: 28px; height: 28px; flex-basis: 28px; }
  .home-aurora-hero .home-scan-link { min-height: 40px; font-size: 16px; }
}
@media (max-width: 680px) {
  .doctorai-homepage { --home-gutter: 20px; background-size: 100% 900px; }
  .doctorai-homepage .home-header { gap: 10px; padding-block: 8px; }
  .doctorai-homepage .home-brand { gap: 0; }
  .doctorai-homepage .home-brand-symbol { width: 39px; height: 48px; }
  .doctorai-homepage .home-brand-symbol img { width: 74px; height: 74px; margin: -13px 0 0 -17px; }
  .doctorai-homepage .home-brand-wordmark { width: 97px; height: 28px; }
  .doctorai-homepage .home-brand-wordmark img { width: 130px; height: 87px; margin: -59px 0 0 -16px; }
  .doctorai-homepage .home-nav { gap: 0; }
  .doctorai-homepage .home-nav .home-button { min-height: 44px; padding: 10px 12px; font-size: 12px; gap: 6px; border-radius: 10px; }
  .doctorai-homepage .home-nav .home-nav-full { display: none; }
  .doctorai-homepage .home-mobile-menu summary { padding-inline: 8px; font-size: 12px; }
  .home-aurora-hero { padding-top: 12px; }
  .home-aurora-mark { width: clamp(215px, 61vw, 290px); margin-top: 4px; margin-bottom: -18px; }
  .home-aurora-mark .home-logo-tilt { inset: -10px 0 10px; }
  .home-aurora-hero h1 { font-size: clamp(36px, 8.4vw, 54px); letter-spacing: -.055em; line-height: 1.05; }
  .home-aurora-hero .home-lead { margin-top: 18px; font-size: 18px; }
  .home-aurora-hero .home-actions { margin-top: 22px; width: 100%; }
  .home-aurora-hero .home-add-actions { width: min(100%, 340px); }
  .home-aurora-hero .home-add-detail { min-height: 60px; padding-inline: 16px; gap: 12px; font-size: 20px; }
  .home-aurora-dock { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 0; margin-top: 20px; padding: 14px 8px; border-radius: 26px; }
  .home-aurora-dock a { min-height: 52px; justify-content: flex-start; padding-inline: 10px; font-size: 14px; gap: 8px; }
  .home-aurora-dock a:nth-child(3) { border-left: 0; }
  .home-aurora-dock a:first-child::after { bottom: -5px; }
  .home-aurora-note { max-width: 31ch; margin-top: 18px; font-size: 14px; }
  .home-aurora-meta { flex-wrap: wrap; justify-content: center; gap: 0; margin-top: 8px; }
  .home-aurora-meta .home-hero-limit { font-size: 12px; }
  .home-aurora-meta .home-motion-control { padding: 12px; }
  body[data-hub-layout="reference"] #hub-shell .view-stack { padding-top: 8px; }
}
@media (max-width: 359px) {
  .doctorai-homepage { --home-gutter: 14px; }
  .doctorai-homepage .home-brand-wordmark { width: 81px; }
  .doctorai-homepage .home-brand-wordmark img { width: 112px; height: 75px; margin: -51px 0 0 -15px; }
  .doctorai-homepage .home-nav .home-button { padding-inline: 9px; }
  .home-aurora-dock a:nth-child(3) { grid-column: 1 / -1; justify-content: center; border-top: 1px solid #b5ccef; }
}
body[data-hub-layout="reference"] #view-timeline .timeline-history-label {
  display: block;
  margin-top: 7px;
  color: #315276;
  font-size: 12px;
  font-weight: 700;
}
body[data-hub-layout="reference"] #view-timeline [data-delete-medication-history] {
  margin-top: 5px;
  margin-left: -10px;
}
body[data-hub-layout="reference"] #view-profile :is(.secondary-button, .text-button) .doctorai-icon-slot[data-doctorai-icon="arrow"] {
  color: #0759b6;
}
@media (prefers-reduced-motion: reduce) {
  .home-aurora-hero .home-hero-logo { animation: none !important; }
  .home-aurora-hero .home-logo-tilt { transform: none !important; transition: none; }
}
@media (forced-colors: active) {
  html :is(.doctorai-homepage, body[data-hub-layout="reference"]) { background: Canvas; }
  .home-aurora-mark { border-color: CanvasText; background: Canvas; box-shadow: none; }
  .home-aurora-hero::before { content: none; }
  .home-aurora-dock { border-color: CanvasText; background: Canvas; }
  .home-aurora-dock a, .home-aurora-hero h1, .home-aurora-hero h1 em { color: CanvasText; }
  .home-aurora-dock a:first-child::after { background: LinkText; }
  .home-aurora-dock .home-dock-icon { border-color: CanvasText; background: Canvas; color: LinkText; }
  body[data-hub-layout="reference"] #hub-shell .primary-nav > .nav-item[data-view] .nav-icon,
  body[data-hub-layout="reference"] .mobile-bottom-nav > .mobile-bottom-nav-item[data-view] > span:not(.hub-alert-nav-symbol) { border-color: CanvasText; background: Canvas; color: LinkText; }
  body[data-hub-layout="reference"] #hub-shell .hub-main { border-color: CanvasText; }
}
@media print {
  html :is(.doctorai-homepage, body[data-hub-layout="reference"]) { background: white; }
  .home-aurora-hero::before, .home-motion-control { display: none; }
}
