html[data-ui="apple"] {
  --apple-page: #edf1f7;
  --apple-text: #182235;
  --apple-secondary: #526177;
  --apple-card: #fbfcff;
  --apple-well: #eef2f8;
  --apple-chrome: #f1f5fae8;
  --apple-glass: #f7faff;
  --apple-glass-deep: #e4ebf7;
  --apple-glass-rim: #98aac550;
  --apple-shine: #ffffffd9;
  --apple-card-rim: #9caec540;
  --apple-card-shadow: #25375712;
  --apple-pill: #ffffffd9;
  --apple-focus: #1262d7;
  --apple-blue: #1460df;
  --apple-blue-top: #2469e6;
  --apple-tint: #235baf;
  --apple-ease: cubic-bezier(.2,.75,.25,1);
  color-scheme: light;
}
html[data-ui="apple"].dark, html[data-ui="apple"].apple-account {
  --apple-page: #15181f;
  --apple-text: #f0f3fa;
  --apple-secondary: #aeb9cd;
  --apple-card: #20242d;
  --apple-well: #181b23;
  --apple-chrome: #191d27e8;
  --apple-glass: #373e4a;
  --apple-glass-deep: #20242c;
  --apple-glass-rim: #bdcceb2e;
  --apple-shine: #e6efff36;
  --apple-card-rim: #aab9d320;
  --apple-card-shadow: #080b1166;
  --apple-pill: #616b805e;
  --apple-focus: #82b7ff;
  --apple-blue: #1855c8;
  --apple-blue-top: #286ce5;
  --apple-tint: #9dc5ff;
  color-scheme: dark;
}
html[data-ui="apple"] body {
  background: radial-gradient(ellipse 66rem 36rem at 62% -3rem, var(--apple-card-rim), transparent 72%), var(--apple-page);
  color: var(--apple-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: none;
}
html[data-ui="apple"] body > header {
  background: var(--apple-chrome);
  border-color: var(--apple-card-rim);
  backdrop-filter: saturate(125%) blur(12px);
  -webkit-backdrop-filter: saturate(125%) blur(12px);
}
html[data-ui="apple"] .web-account-bar {
  position: relative;
  background: var(--apple-page);
  border-color: var(--apple-card-rim);
  color: var(--apple-secondary);
}
html[data-ui="apple"] :is(.spatial-card, .spatial-card:hover) {
  background: var(--apple-card);
  border: 1px solid var(--apple-card-rim);
  border-radius: 25px;
  box-shadow: 0 7px 23px -14px var(--apple-card-shadow), inset 0 1px 0 color-mix(in srgb, var(--apple-shine) 42%, transparent);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: none;
  transition: none;
}
html[data-ui="apple"] .recessed-well {
  background: var(--apple-well);
  border-color: var(--apple-card-rim);
}
html[data-ui="apple"] :is(.spatial-dock, .ios-switch) {
  background: linear-gradient(162deg, var(--apple-glass), var(--apple-glass-deep) 78%);
  border: 1px solid var(--apple-glass-rim);
  box-shadow: inset 0 1px 0 var(--apple-shine), inset 0 -1px 0 color-mix(in srgb, var(--apple-tint) 19%, transparent),
    0 5px 14px -7px var(--apple-card-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html[data-ui="apple"] .health-actions > .spatial-dock:first-child,
html[data-ui="apple"] .health-navigation {
  position: relative;
  isolation: isolate;
}
html[data-ui="apple"] .health-actions > .spatial-dock:first-child::after,
html[data-ui="apple"] .health-navigation::after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset-inline: 19%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #8d7bdf66, #77b5ff91 62%, transparent);
}
html[data-ui="apple"] .health-brand h1 {
  color: var(--apple-text);
  letter-spacing: -.045em;
}
html[data-ui="apple"] .health-brand #currentDate { color: var(--apple-secondary); letter-spacing: .105em; }
html[data-ui="apple"] .health-actions > .spatial-dock:first-child button {
  min-width: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
}
html[data-ui="apple"] .health-actions > .spatial-dock:first-child svg { width: 17px; height: 17px; }
html[data-ui="apple"] .health-navigation > button,
html[data-ui="apple"] .weight-navigation > button:not(.weight-link) {
  color: var(--apple-secondary);
  min-height: 34px;
  white-space: nowrap;
}
html[data-ui="apple"] .glass-segment {
  position: relative;
  isolation: isolate;
}
html[data-ui="apple"] .glass-segment::before {
  content: "";
  position: absolute;
  pointer-events: none;
  left: 0;
  top: 0;
  width: var(--glass-segment-width, 0px);
  height: var(--glass-segment-height, 0px);
  transform: translate(var(--glass-segment-x, 0px), var(--glass-segment-y, 0px));
  background: var(--apple-pill);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 var(--apple-shine), 0 3px 7px -4px var(--apple-card-shadow);
  z-index: -1;
}
html[data-ui="apple"] .glass-segment[data-motion-ready]::before {
  transition: transform .23s var(--apple-ease), width .23s var(--apple-ease), height .23s var(--apple-ease);
}
html[data-ui="apple"] .glass-segment > .dock-pill-active {
  background: transparent;
  box-shadow: none;
  color: var(--apple-text) !important;
}
html[data-ui="apple"] .glass-segment > .dock-pill-active svg { color: var(--apple-tint); }
html[data-ui="apple"] .btn-ios-blue,
html[data-ui="apple"].apple-account .primary {
  background: linear-gradient(165deg, var(--apple-blue-top), var(--apple-blue));
  color: #fff;
  border: 1px solid #78a6ff66;
  box-shadow: inset 0 1px 0 #d1e4ff3d, 0 5px 15px -7px #0457e6d9;
  transition: transform .14s var(--apple-ease), filter .14s var(--apple-ease);
}
html[data-ui="apple"] .btn-ios-blue:hover { filter: brightness(1.08); transform: none; }
html[data-ui="apple"] :is(button.btn-ios-blue, button.spatial-dock, .health-actions button, .glass-segment > button):active:not(:disabled) {
  transform: scale(.965);
}
html[data-ui="apple"] :is(.ios-switch, .health-actions button, .glass-segment > button, button.spatial-dock) {
  transition: transform .14s var(--apple-ease);
}
html[data-ui="apple"].dark .ios-switch {
  background: linear-gradient(160deg, #29d276, #0ba65a);
  border-color: #95ffb86b;
  box-shadow: inset 0 1px 2px #c6ffde60, 0 3px 12px -5px #38dc6a75;
}
html[data-ui="apple"] .ios-switch-thumb {
  transition: transform .22s var(--apple-ease);
  box-shadow: 0 2px 5px #121c3859, inset 0 1px 0 #fff;
}
html[data-ui="apple"] :is(.modal-backdrop, #macNotificationsBackdrop, #globalDropOverlay, .ios-notification) {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html[data-ui="apple"] dialog::backdrop { backdrop-filter: none; }
html[data-ui="apple"] .modal-backdrop:not(.hidden) > .spatial-card,
html[data-ui="apple"] dialog[open] {
  animation: apple-sheet-in .19s var(--apple-ease) both;
  box-shadow: inset 0 1px 0 var(--apple-shine), 0 22px 64px -20px var(--apple-card-shadow);
}
html[data-ui="apple"] .ios-notification {
  background: var(--apple-card);
  border-color: var(--apple-glass-rim);
  box-shadow: inset 0 1px 0 var(--apple-shine), 0 12px 24px -14px var(--apple-card-shadow);
}
html[data-ui="apple"] :is(button, a, input, select, textarea, summary, [role="button"]):focus-visible {
  outline: 2px solid var(--apple-focus);
  outline-offset: 3px;
}
html[data-ui="apple"] .weight-metrics strong { letter-spacing: -.04em; }
html[data-ui="apple"] .weight-range [aria-pressed="true"] { box-shadow: inset 0 1px 0 var(--apple-shine); }
html[data-ui="apple"] .apple-short-label { display: none; }
@keyframes apple-sheet-in {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

html[data-ui="apple"].apple-account body { background-color: var(--apple-page); }
html[data-ui="apple"].apple-account .card {
  background: var(--apple-card);
  border-color: var(--apple-glass-rim);
  box-shadow: inset 0 1px 0 var(--apple-shine), 0 18px 32px -24px var(--apple-card-shadow);
}
html[data-ui="apple"].apple-account .brand { color: var(--apple-tint); }
html[data-ui="apple"].apple-account .secondary {
  background: linear-gradient(165deg, var(--apple-glass), var(--apple-glass-deep));
  box-shadow: inset 0 1px 0 var(--apple-shine);
  color: var(--apple-text);
}
html[data-ui="apple"].apple-account :is(.primary, .secondary) { border-radius: 999px; }
html[data-ui="apple"].apple-account .primary:active { transform: scale(.98); }

@media (761px <= width <= 1340px) {
  html[data-ui="apple"] #patientAgeDisplay { max-inline-size: 9ch; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 760px) {
  html[data-ui="apple"] body > header {
    background: var(--apple-page);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  html[data-ui="apple"] .health-header {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "brand profile" "actions actions";
    padding-block: 10px;
  }
  html[data-ui="apple"] .health-profile { justify-self: end; }
  html[data-ui="apple"] .health-navigation {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    margin-inline: auto;
    width: min(calc(100% - max(12px, env(safe-area-inset-left)) - max(12px, env(safe-area-inset-right))), 510px);
    padding: 5px;
    justify-content: space-between;
    background: color-mix(in srgb, var(--apple-glass) 93%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 var(--apple-shine), 0 6px 22px var(--apple-card-shadow);
  }
  html[data-ui="apple"] .health-navigation > button {
    flex: 1;
    min-width: 0;
    padding: 5px 4px;
    min-height: 47px;
    gap: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
  }
  html[data-ui="apple"] .health-navigation > button svg { display: block; width: 17px; height: 17px; }
  html[data-ui="apple"] .health-navigation .apple-long-label { display: none; }
  html[data-ui="apple"] .health-navigation .apple-short-label { display: inline; }
  html[data-ui="apple"] body:not(.apple-login) > main { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  html[data-ui="apple"] .health-actions > .spatial-dock:first-child button { min-width: 30px; min-height: 32px; padding: 6px; }
  html[data-ui="apple"] .web-account-bar { padding: 7px 12px; gap: 4px 10px; font-size: 11px; }
}
@media (max-width: 500px) {
  html[data-ui="apple"] .weight-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[data-ui="apple"] .weight-metrics > div:first-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-transparency: reduce) {
  html[data-ui="apple"] body > header,
  html[data-ui="apple"] .health-navigation { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--apple-glass-deep); }
}
@media (prefers-reduced-motion: reduce) {
  html[data-ui="apple"] *, html[data-ui="apple"] *::before, html[data-ui="apple"] *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
  }
  html[data-ui="apple"] :is(button.btn-ios-blue, button.spatial-dock, .health-actions button, .glass-segment > button):active {
    transform: none;
  }
}
@media print {
  html[data-ui="apple"] .health-navigation,
  html[data-ui="apple"] .web-account-bar { display: none !important; }
}
