/* Arrive Ready, Round 3 usability test prototype.
 *
 * The screens as Figma draws them: Your Mayo Clinic (3ruOKSzZ838opK0tGWRtVU), page 🛑 VISUAL DESIGN,
 * section 5717:122663 "Round 3 Testing Screens". Components are the file's own: Frames / Core Screen v2
 * (5480:755), Content Frame/Section, Segmented Control, Progress Indicator / Local, Appointment Card
 * (5531:48511), To-do Card (5588:25431), Prep/Checkbox (5454:827), Reminder (5593:26296), Reminder /
 * Details, Reminder / Step, Ask Mayo / Appointment Link (5104:8221), AR / Journey Phase (3890:4021),
 * Tag (3603:523), Accordion and the CoO buttons.
 * Fonts, the DESIGN.md §2 tokens and the iPhone frame come from ../prototype-v2/css/.
 *
 * Not from DESIGN.md, and flagged (the Figma file wins where they differ):
 *  - Figma's Interactive/Default is #0054e4 (blue/100) and Feedback/success #008748; DESIGN.md says
 *    #0058e2 and #008442. The focus ring stays Border/Focus Outline (#0058e2).
 *  - The cool-gray, blue/40, purple/100 and evergreen/10 values are the Figma file's variables;
 *    DESIGN.md has no neutral or purple ramp yet.
 *  - The header gradient is Core Screen v2's fill (no DESIGN.md token). 🔴 White text on its light
 *    bottom edge is below WCAG AA (§7); the fix belongs in Figma.
 *  - The section shadow is Figma's "Elevation/Shadow Light 16px" (0 0 16px 8px); DESIGN.md §2.5 has
 *    only a 64px blur.
 */

:root {
  /* Figma variables (Your Mayo Clinic), named as in the file. */
  --text-primary: var(--blue-400);          /* text/primary #000529 */
  --text-heading: var(--icon-decorative);   /* section titles: #080808 */
  --text-secondary: var(--ar-neutral-muted); /* text/secondary #5c5f76 */
  --interactive: var(--blue-100);           /* interactive/default #0054e4 */
  --success: #008748;                       /* feedback/success */
  --evergreen-10: #c5ffe4;
  --cool-gray-5: #f7f8fa;
  --cool-gray-10: #eef0f4;
  --cool-gray-20: #dfe3ea;
  --cool-gray-30: #c8ced8;
  --blue-40: #1ac9ff;
  --purple-100: #8d31f7;
  --cool-gray-70: #515a6e;
  --neutral-10: #f5f5f9;
  --neutral-300: #1f2343;                    /* sheet body text */
  --shadow-sheet: 0 -4px 64px 8px rgba(3, 12, 183, 0.12); /* Surface/Sheet */
  --header-top: #0059e5;                     /* Core Screen v2 "Header — Change gradient fill" */
  --header-mid: #008cf2;
  --header-bottom: #00c7f2;
  --header-gradient: linear-gradient(to top, var(--header-bottom) 0%, var(--header-mid) 40%, var(--header-top) 100%);
  --shadow-section: 0 0 16px 8px rgba(3, 12, 183, 0.08);   /* Elevation/Shadow Light 16px */
  --shadow-segment: 0 0 4px rgba(3, 12, 183, 0.16);
  --shadow-medium-16: 0 0 16px 8px rgba(3, 12, 183, 0.16); /* Elevation/Shadow Medium 16px */
  --fs-xs: var(--ar-font-size-xsmall-compact);             /* 14 */
  --target-min: var(--ar-touch);
  --ask-size: 56px;
}
.device { --safe-bottom: 34px; }
@media (max-width: 520px) { .device { --safe-bottom: env(safe-area-inset-bottom, 0px); } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--sds-global-typography-font-family-mayo-clinic-sans); font-size: var(--sds-global-typography-font-size-100); line-height: var(--sds-global-typography-line-height-150); color: var(--text-primary); background: var(--subtle); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; touch-action: manipulation; }
input, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; }
a { color: var(--interactive); }
img { display: block; }
:focus-visible { outline: 2px solid var(--border-focus-outline); outline-offset: 2px; border-radius: var(--r50); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.app { position: absolute; inset: 0; overflow: hidden; }

/* ---------- Screens ---------- */
.screen { position: absolute; inset: 0; background: var(--white-0); display: flex; flex-direction: column; }
.screen > .scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.screen > .scroll::-webkit-scrollbar { display: none; }
.screen--root > .scroll, .screen--appt > .scroll { padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + var(--s300)); }
/* A pushed screen slides in from the right over the one under it. */
.screen--push { box-shadow: var(--shadow-medium); }
@media (prefers-reduced-motion: no-preference) {
  .screen--push.is-entering { animation: push-in var(--md-duration-medium-4) var(--md-easing-emphasized-decelerate) both; }
  .screen--push.is-leaving { animation: push-out var(--md-duration-medium-2) var(--md-easing-standard-accelerate) both; }
  .screen.is-covered { animation: cover var(--md-duration-medium-4) var(--md-easing-emphasized-decelerate) both; }
  .screen.is-uncovered { animation: uncover var(--md-duration-medium-2) var(--md-easing-standard) both; }
}
@keyframes push-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes push-out { from { transform: none; } to { transform: translateX(100%); } }
@keyframes cover { from { transform: none; } to { transform: translateX(-24%); } }
@keyframes uncover { from { transform: translateX(-24%); } to { transform: none; } }
.screen.is-covered { transform: translateX(-24%); }
.device.on-brand .statusbar { color: var(--white-0); }

/* ---------- Frames / Core Screen v2: header ---------- */
.core-header { background: var(--header-gradient); padding-top: var(--status-h); padding-bottom: var(--s400); margin-bottom: calc(var(--s400) * -1); color: var(--white-0); }
.core-header-content { min-height: 108px; padding: var(--s200) var(--s300) calc(var(--s200) + var(--s300)); display: flex; flex-direction: column; gap: var(--s300); }
.core-titles { display: flex; flex-direction: column; gap: var(--s50); }
.core-title { padding-top: var(--s100); font-weight: 700; font-size: var(--sds-global-typography-font-size-250); line-height: var(--sds-global-typography-line-height-275); }
.core-sub { font-size: var(--sds-global-typography-font-size-100); line-height: var(--sds-global-typography-line-height-125); }
.core-tabs { display: flex; align-items: stretch; }
.core-tab { flex: 1 1 0; min-width: 0; min-height: var(--target-min); display: flex; align-items: center; justify-content: center; padding: var(--s100) var(--s200); border-bottom: 1px solid var(--white-0); color: var(--white-0); font-size: var(--sds-global-typography-font-size-100); line-height: var(--sds-global-typography-line-height-125); white-space: nowrap; }
.core-tab[aria-selected="true"] { border-bottom-width: 4px; font-weight: 700; padding-bottom: calc(var(--s100) - 3px); }
.core-tab:focus-visible { outline-color: var(--white-0); outline-offset: -2px; }

/* ---------- Content Frame/Section ---------- */
.sections { position: relative; display: flex; flex-direction: column; gap: var(--s200); }
.section { background: var(--white-0); border-radius: var(--r400); padding: var(--s400) var(--s300); box-shadow: var(--shadow-section); overflow: clip; }
.section:last-child { border-radius: var(--r400) var(--r400) 0 0; flex: 1 0 auto; }
.slot { display: flex; flex-direction: column; gap: 10px; }
.slot--24 { gap: var(--s300); }
.section-title { min-height: 42px; border-bottom: 1px dashed var(--blue-40); font-weight: 700; font-size: var(--sds-global-typography-font-size-150); line-height: var(--sds-global-typography-line-height-200); color: var(--text-heading); }
.h-plain { font-weight: 700; font-size: var(--sds-global-typography-font-size-150); line-height: var(--sds-global-typography-line-height-200); color: var(--text-heading); }

/* ---------- Segmented Control ---------- */
.segmented { display: flex; align-items: center; padding: var(--s50); border-radius: var(--r300); background: var(--cool-gray-5); border: 1px solid var(--cool-gray-20); }
.segment { flex: 1 1 0; min-width: 0; height: 40px; display: flex; align-items: center; justify-content: center; padding: 10px var(--s150); border-radius: var(--r300); font-size: var(--sds-global-typography-font-size-100); line-height: var(--sds-global-typography-line-height-125); color: var(--text-primary); white-space: nowrap; position: relative; }
/* 40px visual height, 44px touch target */
.segment::after { content: ""; position: absolute; left: 0; right: 0; top: -2px; bottom: -2px; }
.segment[aria-selected="true"] { background: var(--white-0); font-weight: 700; filter: drop-shadow(var(--shadow-segment)); }

/* ---------- Your journey card (Progress Indicator / Local) ---------- */
.journey-card { display: flex; flex-direction: column; gap: var(--s150); }
.progress { display: flex; gap: var(--s200); align-items: flex-start; width: 100%; min-height: 56px; text-align: left; border-radius: var(--r100); }
.progress-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s100); }
.progress-items { display: flex; height: 24px; align-items: center; }
.pstep { flex: 1 1 0; min-width: 0; display: flex; align-items: center; height: 24px; }
.pstep:last-child { flex: none; }
.pstep-mark { width: 24px; height: 24px; flex: none; border-radius: var(--r200); display: grid; place-items: center; }
.pstep--done .pstep-mark { background: var(--success); }
.pstep--todo .pstep-mark { border: 1px solid var(--success); }
.pstep-line { flex: 1; height: 1px; background: var(--success); }
.progress-caption { font-size: var(--sds-global-typography-font-size-100); line-height: var(--sds-global-typography-line-height-150); color: var(--text-primary); }
.progress-caret { width: 16px; height: 24px; flex: none; display: grid; place-items: center; }
.journey-summary { margin-top: var(--s100); font-size: var(--sds-global-typography-font-size-100); line-height: var(--sds-global-typography-line-height-150); }

/* ---------- Appointment Card (List item) ---------- */
.appt-item { display: block; width: 100%; text-align: left; border-bottom: 1px dashed var(--blue-40); }
.appt-item.no-divider { border-bottom: 0; }
.appt-top { display: flex; flex-direction: column; gap: 6px; padding: var(--s200) 0; }
.appt-date { font-size: var(--sds-global-typography-font-size-100); line-height: var(--sds-global-typography-line-height-125); color: var(--text-secondary); }
.appt-title-row { display: flex; gap: var(--s100); align-items: flex-start; }
.appt-name { flex: 1; min-width: 0; font-weight: 700; font-size: var(--sds-global-typography-font-size-125); line-height: var(--sds-global-typography-line-height-150); color: var(--text-primary); }
.appt-chev { width: 16px; height: 24px; flex: none; display: grid; place-items: center; }
.appt-line { display: flex; gap: var(--s100); align-items: flex-start; font-size: var(--sds-global-typography-font-size-100); line-height: var(--sds-global-typography-line-height-125); color: var(--text-secondary); }
.appt-line .ic { width: 16px; height: 20px; flex: none; display: grid; place-items: center; }
.appt-line .txt { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; column-gap: var(--s50); }

/* ---------- Ask Mayo / Appointment Link ---------- */
.appt-link { display: flex; align-items: center; justify-content: space-between; gap: var(--s100); width: 100%; min-height: var(--target-min); padding: var(--s100) var(--s150); border: 1px solid var(--cool-gray-20); border-radius: var(--r200); background: var(--white-0); text-align: left; }
.appt-link-main { display: flex; align-items: flex-start; gap: var(--s100); min-width: 0; }
.appt-link-main .ic { height: 16px; flex: none; }
.appt-link-text { font-size: var(--fs-xs); line-height: var(--sds-global-typography-line-height-100); color: var(--text-secondary); }
.appt-link-text b { color: var(--text-primary); }
@media (hover: hover) { .appt-link:hover { border-color: var(--interactive); } }

/* ---------- To-do Card and Reminder (List item) ---------- */
.prep { border-bottom: 1px dashed var(--blue-40); }
.prep.no-divider { border-bottom: 0; }
.prep-content { display: flex; flex-direction: column; gap: var(--s150); padding: var(--s200) 0; }
.prep-meta { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); line-height: var(--sds-global-typography-line-height-100); color: var(--text-secondary); }
.prep-meta .ic { flex: none; }
.prep-meta.is-soon { color: var(--purple-100); font-weight: 700; }
.prep-meta.is-done { color: var(--success); font-weight: 700; }
.prep-title-row { display: flex; gap: var(--s150); align-items: flex-start; }
.prep-toggle { flex: 1; min-width: 0; display: flex; gap: var(--s150); align-items: flex-start; text-align: left; border-radius: var(--r50); position: relative; }
/* The title row is the toggle; stretch its target to 44 tall. */
.prep-toggle::after { content: ""; position: absolute; left: 0; right: 0; top: -10px; bottom: -10px; }
.prep-title { flex: 1; min-width: 0; font-weight: 700; font-size: var(--sds-global-typography-font-size-125); line-height: var(--sds-global-typography-line-height-150); color: var(--text-primary); }
.prep.is-done .prep-title { color: var(--text-secondary); }
.prep-chev { width: 24px; height: 24px; flex: none; display: grid; place-items: center; }
.prep-body { display: flex; flex-direction: column; gap: var(--s150); }
.prep-body[hidden] { display: none; }
.prep-text { font-size: var(--sds-global-typography-font-size-100); line-height: var(--sds-global-typography-line-height-150); color: var(--text-primary); }
.prep-note { color: var(--text-secondary); }
.prep-checkin { font-weight: 700; }

/* Prep/Checkbox: 24 circle on the title's first line, 44x44 tap area. */
.check { position: relative; width: 24px; height: 24px; flex: none; border-radius: 12px; border: 2px solid var(--interactive); display: grid; place-items: center; }
.check::before { content: ""; position: absolute; left: -12px; top: -12px; width: 44px; height: 44px; }
.check.is-checked, .check-static { background: var(--success); border-color: var(--success); }
.check-static { width: 24px; height: 24px; flex: none; border-radius: 12px; display: grid; place-items: center; }
.check:focus-visible { border-radius: 12px; }
@media (prefers-reduced-motion: no-preference) { .check.just-checked { animation: pop var(--md-duration-medium-2) var(--md-easing-emphasized-decelerate); } }
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.12); } 100% { transform: none; } }

/* Reminder / Details */
.steps { display: flex; flex-direction: column; gap: var(--s150); }
.bullets { display: flex; flex-direction: column; gap: var(--s100); list-style: none; }
.step, .bullet { display: flex; gap: 10px; align-items: flex-start; font-size: var(--sds-global-typography-font-size-100); line-height: var(--sds-global-typography-line-height-150); color: var(--text-primary); }
.step .marker, .bullet .marker { width: 16px; height: 24px; flex: none; }
.step-time { width: 104px; flex: none; font-weight: 700; }
.step-text, .bullet-text { flex: 1; min-width: 0; }
.actions { display: flex; flex-direction: column; gap: var(--s100); }

/* CoO buttons: Primary and Secondary, 48 tall, radius 24. */
.btn { display: flex; align-items: center; justify-content: center; gap: var(--s100); width: 100%; min-height: var(--ar-button-height); padding: var(--s150) var(--s300); border-radius: var(--r300); font-size: var(--sds-global-typography-font-size-100); line-height: var(--sds-global-typography-line-height-125); text-align: center; }
.btn--primary { background: var(--interactive); color: var(--text-primary-inverse); }
.btn--secondary { border: 1px solid var(--interactive); color: var(--interactive); background: var(--white-0); }
@media (hover: hover) { .btn--primary:hover { background: var(--interactive-hover); } .btn--secondary:hover { border-color: var(--interactive-hover); color: var(--interactive-hover); } }
.btn--primary:active { background: var(--interactive-pressed); }
.btn--secondary:active { background: var(--blue-10); }

/* ---------- Accordion (group header in Coming up) ---------- */
.group { display: flex; flex-direction: column; }
.acc { display: flex; align-items: center; gap: var(--s150); width: 100%; padding: var(--s300) 0; border-bottom: 1px dashed var(--blue-50); text-align: left; font-weight: 700; font-size: var(--sds-global-typography-font-size-125); line-height: var(--sds-global-typography-line-height-150); color: var(--blue-100); }
.acc .ic { flex: none; }
.group-panel[hidden] { display: none; }
.group-empty { padding: var(--s200) 0; color: var(--text-secondary); border-bottom: 1px dashed var(--blue-40); }

/* ---------- Your journey (AR / Journey Phase) ---------- */
.intro { display: flex; flex-direction: column; gap: var(--s50); }
.intro-sub { color: var(--text-secondary); }
.timeline { display: flex; flex-direction: column; list-style: none; }
.phase { display: flex; gap: var(--s200); align-items: stretch; }
.phase-rail { width: 24px; flex: none; display: flex; flex-direction: column; align-items: center; gap: var(--s50); }
.phase-mark { width: 24px; height: 24px; flex: none; border-radius: var(--r200); display: grid; place-items: center; }
.phase--done .phase-mark { background: var(--success); }
.phase--later .phase-mark { border: 1px solid var(--success); }
.phase-line { width: 2px; flex: 1; background: var(--cool-gray-30); }
.phase--done .phase-line { background: var(--success); }
.phase:last-child .phase-line { display: none; }
.phase-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s150); padding-bottom: var(--s400); }
.phase-title { font-weight: 700; font-size: var(--sds-global-typography-font-size-125); line-height: var(--sds-global-typography-line-height-150); color: var(--text-primary); }
.phase-text { display: flex; flex-direction: column; gap: var(--s150); color: var(--text-primary); }
.tag { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 6px var(--s150) 6px 10px; border-radius: var(--r300); font-size: var(--fs-xs); line-height: var(--sds-global-typography-line-height-100); white-space: nowrap; }
.tag--success { background: var(--evergreen-10); color: var(--text-primary); }
.tag--info { background: var(--blue-10); color: var(--blue-100); }

/* ---------- Itinerary: list (AR / Agenda Day, AR / Agenda Row) and calendar (Calendar Month) ---------- */
.itin-controls { display: flex; gap: var(--s200); align-items: flex-start; }
.itin-count { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s50); }
.itin-count-title { font-weight: 700; font-size: var(--sds-global-typography-font-size-125); line-height: var(--sds-global-typography-line-height-150); color: var(--blue-100); }
.itin-tz { font-size: var(--fs-xs); line-height: var(--sds-global-typography-line-height-100); color: var(--cool-gray-70); }
.view-switch { display: inline-flex; flex: none; padding: var(--s50); border-radius: var(--r300); background: var(--cool-gray-5); border: 1px solid var(--cool-gray-20); }
.view-option { width: 48px; height: 44px; border-radius: var(--r300); display: grid; place-items: center; }
.view-option[aria-checked="true"] { background: var(--white-0); filter: drop-shadow(var(--shadow-segment)); }
.agenda-day { border-radius: var(--r100); overflow: clip; background: var(--white-0); }
.agenda-band { min-height: 40px; padding: var(--s100) var(--s150); background: var(--neutral-10); font-weight: 700; color: var(--text-primary); }
.agenda-rows { display: flex; flex-direction: column; list-style: none; }
.agenda-row { display: flex; align-items: center; gap: var(--s150); width: 100%; min-height: var(--ar-row); padding: var(--s100) var(--s150); text-align: left; border-radius: var(--r100); }
@media (hover: hover) { .agenda-row:hover { background: var(--cool-gray-5); } }
.agenda-row:active { background: var(--cool-gray-10); }
.agenda-time { width: 72px; flex: none; font-weight: 700; color: var(--text-primary); }
.agenda-icon { width: 16px; height: 20px; flex: none; display: grid; place-items: center; }
.agenda-title { flex: 1; min-width: 0; color: var(--text-primary); }
.agenda-row > img:last-child { flex: none; }

.cal { display: flex; flex-direction: column; gap: var(--s50); padding: var(--s150) var(--s100); border: 1px solid var(--cool-gray-20); border-radius: var(--r200); background: var(--white-0); }
.cal-head { display: flex; align-items: center; height: 44px; }
.cal-nav { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; }
.cal-title { flex: 1; text-align: center; font-weight: 700; font-size: var(--sds-global-typography-font-size-125); line-height: var(--sds-global-typography-line-height-150); color: var(--text-primary); }
.cal-grid { display: flex; flex-direction: column; gap: var(--s50); }
.cal-row { display: flex; }
.cal-wd { flex: 1; padding: var(--s50) 0; text-align: center; font-size: var(--fs-xs); line-height: var(--sds-global-typography-line-height-100); color: var(--text-secondary); }
.cal-cell { flex: 1 1 0; min-width: 0; height: 52px; display: flex; flex-direction: column; align-items: center; gap: var(--s25); padding-top: var(--s50); }
.cal-day { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r200); font-weight: 700; font-size: var(--sds-global-typography-font-size-100); line-height: var(--sds-global-typography-line-height-125); color: var(--text-primary); }
button.cal-cell { border-radius: var(--r100); }
.cal-cell.has-appts .cal-day { background: var(--blue-10); color: var(--interactive); }
.cal-cell[aria-selected="true"] .cal-day { background: var(--blue-100); color: var(--white-0); }
.cal-dots { width: 20px; height: 5px; }
.hint { color: var(--text-secondary); }
.day-pick { display: flex; flex-direction: column; gap: var(--s150); }
.day-pick-title { font-weight: 700; font-size: var(--sds-global-typography-font-size-125); line-height: var(--sds-global-typography-line-height-150); color: var(--text-secondary); }
.day-pick-tz { font-size: var(--fs-xs); line-height: var(--sds-global-typography-line-height-100); color: var(--text-secondary); }

/* ---------- Appointment page (Frames/Interior) ---------- */
.screen--appt .scroll { padding-top: var(--status-h); }
.interior-header { min-height: 108px; padding-bottom: var(--s200); }
.interior-bar { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: var(--s100) var(--s200); }
.back { position: relative; width: 36px; height: 36px; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--white-0) 88%, transparent); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); box-shadow: var(--shadow-medium); }
.back::after { content: ""; position: absolute; inset: -4px; } /* 44x44 target */
.back:focus-visible { border-radius: 18px; }
.interior-title { padding: var(--s200); }
.appt-h1 { min-height: 44px; padding-top: var(--s100); font-weight: 700; font-size: var(--sds-global-typography-font-size-200); line-height: var(--sds-global-typography-line-height-225); color: var(--text-heading); }
.appt-h1:focus { outline: none; }
.appt-h1:focus-visible { outline: 2px solid var(--border-focus-outline); }
.appt-body { display: flex; flex-direction: column; gap: var(--s300); padding-bottom: var(--s300); }
.appt-body > .section:last-child { border-radius: var(--r400); }
.list { list-style: none; }

/* AR / Appointment Fact */
.facts { display: flex; flex-direction: column; gap: var(--s300); list-style: none; }
.fact { display: flex; gap: var(--s200); align-items: flex-start; }
.fact-badge { width: 40px; height: 40px; flex: none; border-radius: var(--r300); background: var(--blue-10); display: grid; place-items: center; }
.fact-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s50); }
.fact-main { font-weight: 700; font-size: var(--sds-global-typography-font-size-125); line-height: var(--sds-global-typography-line-height-150); color: var(--text-primary); }
.fact-second { font-size: var(--sds-global-typography-font-size-125); line-height: var(--sds-global-typography-line-height-175); color: var(--text-primary); }
.fact-detail { color: var(--text-secondary); }

/* Sheet-opener rows (full bleed, 16 inset) */
.sheet-rows { list-style: none; }
.sheet-rows li:first-child .sheet-row { border-bottom: 1px dashed var(--blue-40); }
.sheet-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s150); width: 100%; min-height: 56px; padding: var(--s200); text-align: left; font-weight: 700; font-size: var(--sds-global-typography-font-size-125); line-height: var(--sds-global-typography-line-height-150); color: var(--text-primary); }
@media (hover: hover) { .sheet-row:hover { background: var(--cool-gray-5); } }
.sheet-row:active { background: var(--cool-gray-10); }
.sheet-row img { flex: none; }

/* AR / Note Card */
.note-card { display: flex; flex-direction: column; gap: var(--s200); align-items: flex-start; padding: var(--s200); border: 1px solid var(--cool-gray-20); border-radius: var(--r200); background: var(--white-0); }
.note-placeholder, .note-text { color: var(--text-primary); white-space: pre-wrap; }
.note-when { margin-top: calc(var(--s150) * -1); font-size: var(--fs-xs); line-height: var(--sds-global-typography-line-height-100); color: var(--text-secondary); }
.note-input { width: 100%; min-height: 120px; resize: vertical; padding: var(--s150); border: 1px solid var(--text-secondary); border-radius: var(--r100); background: var(--white-0); color: var(--text-primary); font-size: var(--sds-global-typography-font-size-100); line-height: var(--sds-global-typography-line-height-150); }
.note-input::placeholder { color: var(--text-secondary); }
.note-input:focus-visible { outline: 2px solid var(--border-focus-outline); outline-offset: 1px; }
.note-actions { display: flex; gap: var(--s100); flex-wrap: wrap; }
.btn--hug { width: auto; }
.btn--note > span { padding-bottom: var(--s25); }
.hint { color: var(--text-secondary); }

/* ---------- Bottom sheets (Surface/Sheet) ---------- */
.sheet-layer { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; justify-content: flex-end; }
.scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--blue-400) 40%, transparent); }
.sheet { position: relative; margin-top: max(var(--s300), calc(var(--status-h) - 12px)); flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--white-0); border-radius: var(--r400) var(--r400) 0 0; box-shadow: var(--shadow-sheet); overflow: hidden; touch-action: pan-y; }
@media (prefers-reduced-motion: no-preference) {
  .sheet { transition: transform var(--md-duration-medium-2) var(--md-easing-standard); }
  .sheet-layer.is-entering .sheet { animation: sheet-in var(--md-duration-medium-4) var(--md-easing-emphasized-decelerate) both; }
  .sheet-layer.is-entering .scrim { animation: fade-in var(--md-duration-medium-2) linear both; }
  .sheet-layer.is-leaving .sheet { animation: sheet-out var(--md-duration-medium-2) var(--md-easing-standard-accelerate) both; }
  .sheet-layer.is-leaving .scrim { animation: fade-in var(--md-duration-medium-2) linear reverse both; }
}
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { from { transform: none; } to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.grabber { height: 24px; flex: none; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; }
.grabber span { width: 40px; height: 5px; border-radius: var(--r50); background: var(--cool-gray-30); }
.sheet-header { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s100); padding: calc(var(--s100) + var(--s50)) var(--s200); touch-action: none; }
.sheet-title { flex: 1; min-width: 0; font-weight: 700; font-size: var(--sds-global-typography-font-size-200); line-height: var(--sds-global-typography-line-height-225); color: var(--text-heading); }
.sheet-title:focus { outline: none; }
.sheet-close { width: 44px; height: 44px; flex: none; margin: -4px -8px 0 0; border-radius: 50%; display: grid; place-items: center; color: var(--text-primary); }
@media (hover: hover) { .sheet-close:hover { background: var(--cool-gray-10); } }
.sheet-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--s100) var(--s300) calc(var(--s200) + var(--safe-bottom)); display: flex; flex-direction: column; gap: var(--s150); color: var(--neutral-300); font-size: var(--sds-global-typography-font-size-100); line-height: var(--sds-global-typography-line-height-125); }
.sheet-block { display: flex; flex-direction: column; gap: var(--s50); }
.sheet-ul { margin: 0; padding-left: var(--s300); display: flex; flex-direction: column; gap: var(--s50); }
.sheet-h { margin-top: var(--s150); font-weight: 700; font-size: var(--sds-global-typography-font-size-125); line-height: var(--sds-global-typography-line-height-150); }
.sheet-h:first-child { margin-top: 0; }
.sheet-h4 { margin-top: var(--s50); font-weight: 700; font-size: var(--sds-global-typography-font-size-100); line-height: var(--sds-global-typography-line-height-125); }

/* ---------- Bottom navigation (iOS / Bottom navigation) ---------- */
.chrome { position: absolute; inset: auto 0 0 0; z-index: 30; pointer-events: none; }
.chrome > * { pointer-events: auto; }
.bottom-nav { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--s100) var(--s150) var(--safe-bottom); background: var(--white-0); }
.bottom-bar { display: flex; align-items: center; justify-content: space-between; padding: 5px; border: 1px solid var(--cool-gray-20); border-radius: var(--r400); background: var(--white-0); box-shadow: var(--shadow-light); }
.nav-tab { height: 56px; min-width: var(--target-min); padding: 6px var(--s150); border-radius: var(--r300); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s50); font-size: var(--fs-xs); line-height: var(--sds-global-typography-line-height-100); color: var(--interactive); }
.nav-tab.is-active { background: var(--blue-10); }
@media (hover: hover) { .nav-tab:not(.is-active):hover { background: var(--cool-gray-5); } }
.nav-divider { width: 1px; height: 32px; background: var(--cool-gray-20); }
:root { --nav-h: 76px; } /* 8 + bar 68; the 34 safe area is added separately */
/* Ask Mayo Button (3603:688): 56 circle, 16 from the right, 16 above the nav. */
.ask-mayo { position: absolute; right: var(--s200); bottom: calc(var(--safe-bottom) + var(--nav-h) + var(--s200)); width: var(--ask-size); height: var(--ask-size); display: grid; place-items: center; border-radius: 50%; background: var(--blue-100); box-shadow: var(--shadow-medium-16); }
@media (hover: hover) { .ask-mayo:hover { background: var(--interactive-hover); } }
.ask-mayo:active { background: var(--interactive-pressed); }
.ask-mayo:focus-visible { border-radius: 50%; outline-offset: 3px; }
.screen--root > .scroll, .screen--appt > .scroll { padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + var(--ask-size) + var(--s400)); }
.home-indicator { z-index: 70; }

/* ---------- Toast ---------- */
.toast-host { position: absolute; left: var(--s200); right: var(--s200); bottom: calc(var(--safe-bottom) + var(--nav-h) + var(--s200) + var(--ask-size) + var(--s150)); z-index: 80; display: flex; justify-content: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--s150); width: 100%; padding: var(--s100) var(--s100) var(--s100) var(--s200); border-radius: var(--r200); background: var(--blue-400); color: var(--white-0); box-shadow: var(--shadow-medium); font-size: var(--fs-xs); line-height: var(--sds-global-typography-line-height-125); min-height: var(--target-min); }
.toast p { flex: 1; min-width: 0; }
.toast button { min-height: var(--target-min); padding: 0 var(--s150); border-radius: var(--r100); color: var(--white-0); font-weight: 700; text-decoration: underline; }
.toast button:focus-visible { outline-color: var(--white-0); }
@media (prefers-reduced-motion: no-preference) { .toast { animation: toast-in var(--md-duration-medium-2) var(--md-easing-emphasized-decelerate) both; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.device.has-sheet .statusbar { color: var(--white-0); }

/* ---------- My Mayo (Figma 5000:14271): search and Note Cards ---------- */
/* The body is one white sheet on Elevation/Shadow Medium. */
.section--sheet { box-shadow: var(--shadow-medium); }
/* CoO Search, Style = Border. Figma draws the 1px line dashed at rest; it goes solid while you type in it. */
.mm-search { display: flex; align-items: center; gap: var(--s200); height: 64px; padding: 7px; border: 1px dashed var(--interactive); border-radius: var(--r400); background: var(--white-0); }
.mm-search:focus-within { border-style: solid; }
.mm-search-input { flex: 1 0 0; min-width: 1px; height: 48px; padding: var(--s150) var(--s100) var(--s150) var(--s200); border: 0; border-radius: var(--r400); background: none; color: var(--interactive); font-size: var(--sds-global-typography-font-size-125); line-height: var(--sds-global-typography-line-height-150); -webkit-appearance: none; appearance: none; }
.mm-search-input::placeholder { color: var(--interactive); opacity: 1; }
.mm-search-input::-webkit-search-cancel-button, .mm-search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.mm-search-input:focus-visible { outline-offset: 0; }
.mm-search-btn { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--interactive); }
@media (hover: hover) { .mm-search-btn:hover { background: var(--interactive-hover); } }
.mm-search-btn:active { background: var(--interactive-pressed); }
.mm-search-btn:focus-visible { border-radius: 50%; }
.mm-notes { list-style: none; display: flex; flex-direction: column; gap: var(--s300); }
.mm-note { width: 100%; display: flex; flex-direction: column; gap: var(--s100); padding: var(--s200); border: 1px solid var(--cool-gray-20); border-radius: var(--r200); background: var(--white-0); }
@media (hover: hover) { .mm-note:hover { border-color: var(--cool-gray-30); } }
.mm-note:active { background: var(--cool-gray-5); }
.mm-note:focus-visible { border-radius: var(--r200); }
.mm-note-meta { display: flex; align-items: center; gap: var(--s100); width: 100%; font-size: var(--fs-xs); line-height: var(--sds-global-typography-line-height-100); color: var(--text-secondary); }
.mm-note-meta img { flex: none; }
.mm-note-meta span { flex: 1 0 0; min-width: 1px; }
.mm-note-body { display: flex; align-items: center; gap: var(--s150); width: 100%; color: var(--text-primary); }
.mm-note-body span { flex: 1 0 0; min-width: 1px; }
.mm-note-body img { flex: none; }
.mm-empty { color: var(--text-secondary); }
.sheet-content:focus-visible { outline-offset: -4px; }
