/* =========================================================
   Patient 360 — Patient OS
   Built to public/reference/brand-guidelines.md. Loaded after /index.css.

   The brief's green (#16C542) is not in our palette. --lime is the fill
   for the active state, the confirmed status and the live path; green
   TEXT is --lime-ink, because --lime on white is 1.28:1. Status never
   rests on colour alone — every state also carries a word (§34, §11).

   THE PRODUCT BOUNDARY IS THE POINT. Patient 360 provides context;
   Communication, Education, Journeys, Ticketing, Workflow Orchestration
   and Intelligence do the rest. So anything belonging to another product
   is drawn at .p3-ui.sm inside a bordered column with its own outbound
   link, never at the scale of the Patient 360 surfaces.

   Every class is prefixed p3- ; the reset weighs nothing (§14).
   ========================================================= */

.p3 {
  --pad: calc(67 * var(--u));
  --text: #2a2a2a;
  --faint: #9a9a9a;
  --soft: #f5f8f1;
  --grey: #f7f7f7;
  --lime-tint: #effcb5;
  --lime-ink: #3f5a00;
  --amber: #fff1d2;
  --amber-ink: #8a5600;
  --r-card: calc(18 * var(--u));
  --r: calc(12 * var(--u));
  --r-sm: calc(9 * var(--u));
  --shadow: 0 1px 2px rgba(17, 19, 24, .03), 0 calc(18 * var(--u)) calc(40 * var(--u)) calc(-28 * var(--u)) rgba(17, 19, 24, .16);
  --ease: cubic-bezier(.2, .8, .2, 1);
  display: block;
  color: var(--ink);
}
.p3 *, .p3 *::before, .p3 *::after { box-sizing: border-box; }
:where(.p3) :where(h1, h2, h3, h4, p, ul, ol, dl, dd, dt, figure, blockquote) { margin: 0; }
:where(.p3) :where(ul, ol) { padding: 0; list-style: none; }
.p3 img { display: block; max-width: 100%; }
.p3 .i { flex: none; width: calc(16 * var(--u)); height: calc(16 * var(--u)); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- type (§3.3) ---------- */
.p3-h1, .p3-h2, .p3-h3 { font-family: var(--font-head); font-weight: 500; letter-spacing: -.03em; color: var(--ink); text-wrap: balance; }
.p3-h1 { font-size: calc(64 * var(--u)); line-height: calc(72 * var(--u)); letter-spacing: -.035em; }
.p3-h2 { font-size: calc(48 * var(--u)); line-height: calc(57 * var(--u)); }
.p3-h3 { font-size: calc(24 * var(--u)); line-height: calc(31 * var(--u)); }
.p3 .dim { color: var(--muted); }
.p3-lede { margin-top: calc(20 * var(--u)); max-width: calc(620 * var(--u)); font-size: calc(21 * var(--u)); line-height: calc(31 * var(--u)); letter-spacing: -.01em; color: var(--muted); text-wrap: pretty; }
.p3-sub { margin-top: calc(18 * var(--u)); max-width: calc(680 * var(--u)); font-size: calc(19 * var(--u)); line-height: calc(29 * var(--u)); letter-spacing: -.01em; color: var(--muted); text-wrap: pretty; }
.p3-sub b { font-weight: 600; color: var(--ink); }
.p3-sub a { color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--lime-ico); }
.p3-sub a:hover { background: var(--lime-soft); }
.p3-k { display: inline-flex; align-items: center; gap: calc(6 * var(--u)); font-size: calc(12 * var(--u)); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.p3-k .i { width: calc(13 * var(--u)); height: calc(13 * var(--u)); }
.p3-k + .p3-h2 { margin-top: calc(14 * var(--u)); }

.p3-eyebrow { display: inline-flex; align-items: center; gap: calc(8 * var(--u)); padding: calc(6 * var(--u)) calc(14 * var(--u)); border-radius: 999px; background: var(--ink); color: var(--lime); font-size: calc(12.5 * var(--u)); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.p3-eyebrow::before { content: ""; width: calc(6 * var(--u)); height: calc(6 * var(--u)); border-radius: 50%; background: var(--lime); }
.p3-eyebrow + .p3-h1 { margin-top: calc(24 * var(--u)); }

.p3-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: calc(14 * var(--u)); margin-top: calc(40 * var(--u)); }
.p3 .btn .i { width: calc(22 * var(--u)); height: calc(22 * var(--u)); transition: transform .2s var(--ease); }
.p3 .btn:hover .i { transform: translateX(calc(3 * var(--u))); }

.p3-link { display: inline-flex; align-items: center; gap: calc(8 * var(--u)); font-size: calc(16 * var(--u)); font-weight: 600; color: var(--lime-ink); }
.p3-link .i { transition: transform .2s var(--ease); }
.p3-link:hover .i { transform: translateX(calc(3 * var(--u))); }
.p3-linkrow { margin-top: calc(22 * var(--u)); }

/* a claim the page makes in its own voice, not inside a box (§7.1) */
.p3-line { margin-top: calc(44 * var(--u)); max-width: calc(760 * var(--u)); font-family: var(--font-head); font-size: calc(26 * var(--u)); line-height: calc(34 * var(--u)); font-weight: 500; letter-spacing: -.025em; color: var(--muted); }
.p3-line b { font-weight: 500; color: var(--ink); }

/* ---------- sections (§5.1) ---------- */
.p3-sec { position: relative; padding: calc(124 * var(--u)) var(--pad); }
.p3-sec + .p3-sec { border-top: 1px solid var(--rule); }
.p3-head { max-width: calc(940 * var(--u)); }
.p3-stage { margin-top: calc(64 * var(--u)); }
.p3-sec.soft { isolation: isolate; }
.p3-sec.soft::before { content: ""; position: absolute; inset: 0 auto 0 50%; width: 100vw; transform: translateX(-50%); background: #fafaf8; z-index: -1; }
.p3-sec.soft::after { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; right: -1px; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); pointer-events: none; }

/* =========================================================
   HERO — 45 / 55, copy then human + product (brief §25)
   ========================================================= */
.p3-hero { position: relative; padding: calc(112 * var(--u)) var(--pad) calc(112 * var(--u)); }
.p3-hero__grid {
  position: absolute; top: 0; left: 0; right: 0; height: calc(600 * var(--u)); pointer-events: none;
  background-image: linear-gradient(to right, var(--grid-line) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: calc(100% / 11) calc(600 * var(--u) / 5); background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(#000 52%, transparent); mask-image: linear-gradient(#000 52%, transparent);
}
.p3-hero__cols { position: relative; display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1fr); column-gap: calc(56 * var(--u)); align-items: center; }
.p3-hero__copy { min-width: 0; }

/* the coordinator is a cut-out on a transparent ground, so she needs no
   frame — only a dissolve at the foot, the same treatment the other
   product heroes use, so she sits in the page rather than on it */
.p3-hero__stage { position: relative; min-height: calc(470 * var(--u)); }
/* she stands to the RIGHT of the card, not behind it: in this photograph
   the subject sits right-of-centre in her own frame, so a card overlapping
   from the left covers her face and leaves only an arm showing */
.p3-person { position: absolute; right: calc(-18 * var(--u)); bottom: calc(-46 * var(--u)); width: calc(344 * var(--u)); }
.p3-person img {
  width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, rgba(0, 0, 0, .8) 82%, rgba(0, 0, 0, 0) 100%);
          mask-image: linear-gradient(to bottom, #000 62%, rgba(0, 0, 0, .8) 82%, rgba(0, 0, 0, 0) 100%);
}
.p3-hero__ui { position: relative; margin-right: calc(168 * var(--u)); }

/* =========================================================
   THE PRODUCT SURFACE — one chrome for every screen on the page
   ========================================================= */
.p3-ui { border: 1px solid var(--rule); border-radius: var(--r-card); background: #fff; overflow: hidden; box-shadow: var(--shadow); }
.p3-ui__top { display: flex; align-items: center; gap: calc(10 * var(--u)); padding: calc(14 * var(--u)) calc(18 * var(--u)); border-bottom: 1px solid var(--rule); background: #fcfcfb; }
.p3-ui__top b { font-size: calc(12.5 * var(--u)); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.p3-ui__top .p3-tag, .p3-ui__top .p3-find { margin-left: auto; }
.p3-ui__body { padding: calc(20 * var(--u)); }
.p3-ui.sm .p3-ui__body { padding: calc(16 * var(--u)); }
.p3-dots { display: inline-flex; gap: calc(5 * var(--u)); }
.p3-dots i { width: calc(8 * var(--u)); height: calc(8 * var(--u)); border-radius: 50%; background: var(--divider); }
.p3-find { display: inline-flex; align-items: center; gap: calc(8 * var(--u)); padding: calc(6 * var(--u)) calc(12 * var(--u)); border: 1px solid var(--rule); border-radius: 999px; font-size: calc(12.5 * var(--u)); color: var(--faint); }

.p3-tag { display: inline-flex; align-items: center; gap: calc(6 * var(--u)); padding: calc(4 * var(--u)) calc(10 * var(--u)); border-radius: 999px; background: var(--grey); color: var(--text); font-size: calc(12 * var(--u)); font-weight: 600; white-space: nowrap; }
.p3-tag.ok { background: var(--lime-tint); color: var(--lime-ink); }
.p3-tag.wait { background: var(--amber); color: var(--amber-ink); }

.p3-av { display: grid; place-items: center; flex: none; width: calc(40 * var(--u)); height: calc(40 * var(--u)); border-radius: 50%; background: var(--lime); font-size: calc(13.5 * var(--u)); font-weight: 700; }
.p3-who { display: flex; align-items: center; gap: calc(13 * var(--u)); }
.p3-who > div > b { display: block; font-size: calc(19 * var(--u)); font-weight: 600; letter-spacing: -.02em; }
/* > div > span, not `span`: a bare descendant selector is (0,1,1) and
   silently beats .p3-av (0,1,0), which turned the avatar back into a
   block and knocked its initials out of the circle */
.p3-who > div > span { display: block; margin-top: calc(2 * var(--u)); font-size: calc(13 * var(--u)); color: var(--muted); font-variant-numeric: tabular-nums; }
.p3-who.lg .p3-av { width: calc(48 * var(--u)); height: calc(48 * var(--u)); font-size: calc(16 * var(--u)); }
.p3-who.lg b { font-size: calc(23 * var(--u)); }

/* current / needs attention / next — the three the product answers */
.p3-triad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: calc(20 * var(--u)); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.p3-triad > li { display: grid; gap: calc(6 * var(--u)); padding: calc(15 * var(--u)) calc(16 * var(--u)); }
.p3-triad > li + li { border-left: 1px solid var(--rule); }
.p3-triad b { font-size: calc(16 * var(--u)); font-weight: 600; letter-spacing: -.01em; }
.p3-triad .warn { background: var(--amber); }
.p3-triad .warn b, .p3-triad .warn .p3-k { color: var(--amber-ink); }
.p3-triad .on { background: var(--lime-soft); }
.p3-triad .on b { color: var(--lime-ink); }

.p3-rows { margin-top: calc(16 * var(--u)); border-top: 1px solid var(--rule); }
.p3-rows > li { display: flex; align-items: center; gap: calc(11 * var(--u)); padding: calc(11 * var(--u)) 0; border-bottom: 1px solid var(--rule); font-size: calc(15 * var(--u)); font-weight: 500; }
.p3-rows > li:last-child { border-bottom: 0; }
.p3-rows .i { color: var(--faint); }

.p3-fields { display: grid; gap: calc(11 * var(--u)); }
.p3-fields > div { display: flex; align-items: baseline; justify-content: space-between; gap: calc(16 * var(--u)); }
.p3-fields dt { font-size: calc(13 * var(--u)); color: var(--muted); }
.p3-fields dd { font-size: calc(15 * var(--u)); font-weight: 600; text-align: right; }
.p3-fields dd.warn { color: var(--amber-ink); }
.p3-fields.two { grid-template-columns: 1fr 1fr; column-gap: calc(28 * var(--u)); }

/* =========================================================
   02 SCATTERED, THEN TOGETHER
   ========================================================= */
.p3-gather { display: grid; justify-items: center; }
.p3-frags { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: calc(12 * var(--u)); width: 100%; }
.p3-frags > li {
  display: grid; justify-items: center; gap: calc(9 * var(--u));
  padding: calc(18 * var(--u)) calc(14 * var(--u));
  border: 1px solid var(--rule); border-radius: var(--r);
  background: #fff;
  font-size: calc(14.5 * var(--u)); font-weight: 600; text-align: center;
  opacity: .45; transform: translateY(calc(-10 * var(--u)));
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.p3-gather.is-in .p3-frags > li { opacity: 1; transform: none; transition-delay: calc(var(--i) * 110ms); }
.p3-frags .i { color: var(--faint); }

/* five legs meeting one stem */
.p3-converge { position: relative; width: 100%; height: calc(46 * var(--u)); }
.p3-converge::before { content: ""; position: absolute; top: calc(22 * var(--u)); left: 10%; right: 10%; height: 2px; background: var(--divider); }
.p3-converge i { position: absolute; top: 0; width: 2px; height: calc(23 * var(--u)); background: var(--divider); }
.p3-converge i:nth-child(1) { left: 10%; }
.p3-converge i:nth-child(2) { left: calc(30% - 1px); }
.p3-converge i:nth-child(3) { left: calc(50% - 1px); }
.p3-converge i:nth-child(4) { left: calc(70% - 1px); }
.p3-converge i:nth-child(5) { right: 10%; }
.p3-converge::after { content: ""; position: absolute; top: calc(22 * var(--u)); left: calc(50% - 1px); bottom: 0; width: 2px; background: var(--lime-ico); }

.p3-node { display: inline-flex; align-items: center; gap: calc(11 * var(--u)); padding: calc(15 * var(--u)) calc(30 * var(--u)); border-radius: 999px; background: var(--lime); font-family: var(--font-head); font-size: calc(24 * var(--u)); font-weight: 500; letter-spacing: -.025em; color: var(--ink); }
.p3-node .i { width: calc(19 * var(--u)); height: calc(19 * var(--u)); }
.p3-stem { width: 2px; height: calc(34 * var(--u)); background: linear-gradient(var(--lime-ico), var(--divider)); }
.p3-out { padding: calc(12 * var(--u)) calc(24 * var(--u)); border: 1px solid var(--rule); border-radius: 999px; background: #fff; font-size: calc(17 * var(--u)); font-weight: 600; }

/* =========================================================
   03 THE BIG SURFACE
   ========================================================= */
.p3-app__grid { display: grid; grid-template-columns: calc(220 * var(--u)) minmax(0, 1fr); }
.p3-side { display: grid; align-content: start; gap: calc(2 * var(--u)); padding: calc(18 * var(--u)); border-right: 1px solid var(--rule); background: #fcfcfb; }
.p3-side__item { position: relative; overflow: hidden; display: flex; align-items: center; gap: calc(11 * var(--u)); padding: calc(10 * var(--u)) calc(13 * var(--u)); border: 0; border-radius: var(--r-sm); background: none; font: inherit; font-size: calc(15 * var(--u)); font-weight: 500; text-align: left; color: var(--muted); cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
.p3-side__item .i { color: var(--faint); }
.p3-side__item:hover { background: var(--grey); color: var(--ink); }
.p3-side__item.is-on, .p3-side__item[aria-selected="true"] { background: var(--lime); color: var(--ink); font-weight: 600; }
.p3-side__item.is-on .i, .p3-side__item[aria-selected="true"] .i { color: var(--lime-ink); }
/* the progress the auto-play owes the reader (§9.6.4): the playing tab
   fills its own underline over exactly the interval */
.p3-side__item .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; transform: scaleX(0); transform-origin: left; background: var(--lime-ink); opacity: .5; }

/* the sections the tabs swap between */
.p3-panel[hidden] { display: none; }
.p3-panel > .p3-triad:first-child { margin-top: calc(20 * var(--u)); }
.p3-panel > .p3-msg:first-child, .p3-panel > .p3-card:first-child, .p3-panel > .p3-list:first-child { margin-top: calc(20 * var(--u)); }
.p3-panel__note { display: flex; flex-wrap: wrap; align-items: center; gap: calc(9 * var(--u)); margin-top: calc(16 * var(--u)); font-size: calc(15 * var(--u)); color: var(--muted); }
.p3-panel__note b { font-weight: 600; color: var(--ink); }
.p3-panel .p3-msg + .p3-list { margin-top: calc(16 * var(--u)); }
.p3-panel .p3-card + .p3-panel__note { margin-top: calc(16 * var(--u)); }

.p3-list { display: grid; }
.p3-list > li { display: grid; grid-template-columns: calc(12 * var(--u)) minmax(0, 1fr) auto; align-items: center; column-gap: calc(14 * var(--u)); padding: calc(13 * var(--u)) 0; border-bottom: 1px solid var(--rule); }
.p3-list > li:last-child { border-bottom: 0; }
.p3-list .d { width: calc(10 * var(--u)); height: calc(10 * var(--u)); border-radius: 50%; border: 2px solid var(--divider); background: #fff; }
.p3-list .warn .d { border-color: var(--amber-ink); background: var(--amber); }
.p3-list .on .d { border-color: var(--lime-ico); background: var(--lime); }
.p3-list b { display: block; font-size: calc(16 * var(--u)); font-weight: 600; letter-spacing: -.015em; }
.p3-list div > span { display: block; margin-top: calc(2 * var(--u)); font-size: calc(14 * var(--u)); color: var(--muted); }
.p3-list time { font-size: calc(13.5 * var(--u)); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.p3-list .warn b { color: var(--amber-ink); }
.p3-list .on b { color: var(--lime-ink); }

.p3-main { padding: calc(24 * var(--u)); min-width: 0; }
.p3-main__head { display: flex; align-items: center; justify-content: space-between; gap: calc(16 * var(--u)); padding-bottom: calc(20 * var(--u)); border-bottom: 1px solid var(--rule); }


.p3-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(14 * var(--u)); margin-top: calc(18 * var(--u)); }
.p3-card { display: grid; align-content: start; gap: calc(9 * var(--u)); padding: calc(18 * var(--u)); border: 1px solid var(--rule); border-radius: var(--r); background: #fff; }
.p3-card.warn { border-color: var(--amber-ink); background: var(--amber); }
.p3-card.warn .p3-k { color: var(--amber-ink); }
.p3-card__big { font-size: calc(19 * var(--u)); font-weight: 600; letter-spacing: -.015em; }
.p3-card__sub { display: flex; flex-wrap: wrap; align-items: center; gap: calc(8 * var(--u)); font-size: calc(14 * var(--u)); color: var(--muted); }
.p3-card.warn .p3-card__sub { color: var(--amber-ink); }
.p3-card .p3-fields { margin-top: calc(2 * var(--u)); }

/* =========================================================
   04 THE TIMELINE
   ========================================================= */
.p3-story__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: calc(18 * var(--u)); padding-bottom: calc(20 * var(--u)); border-bottom: 1px solid var(--rule); }
.p3-flags { display: flex; flex-wrap: wrap; gap: calc(10 * var(--u)); }
.p3-flags > li { display: grid; gap: calc(4 * var(--u)); padding: calc(10 * var(--u)) calc(15 * var(--u)); border-radius: var(--r-sm); background: var(--grey); font-size: calc(15 * var(--u)); font-weight: 600; }
.p3-flags .warn { background: var(--amber); color: var(--amber-ink); }
.p3-flags .warn .p3-k { color: var(--amber-ink); }
.p3-flags .on { background: var(--lime-soft); color: var(--lime-ink); }

/* no column-gap: the columns stay exactly 1/5 each so the rail can run
   from the first marker's centre to the last one's */
.p3-time { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-top: calc(40 * var(--u)); }
.p3-time::before { content: ""; position: absolute; top: calc(6 * var(--u)); left: calc(7 * var(--u)); right: calc(100% / 5 - 7 * var(--u)); height: 2px; background: var(--divider); }
.p3-time::after { content: ""; position: absolute; top: calc(6 * var(--u)); left: calc(7 * var(--u)); width: 0; height: 2px; background: var(--lime-ico); transition: width 1.7s var(--ease); }
.p3-time.is-in::after, .p3-ui.is-in .p3-time::after { width: calc(100% - 100% / 5); }
.p3-time > li { display: grid; justify-items: start; gap: calc(13 * var(--u)); padding-right: calc(20 * var(--u)); opacity: .4; transition: opacity .5s var(--ease); }
.p3-ui.is-in .p3-time > li, .p3-time.is-in > li { opacity: 1; transition-delay: calc(var(--i) * 190ms); }
.p3-time i { width: calc(14 * var(--u)); height: calc(14 * var(--u)); border-radius: 50%; border: 2px solid var(--divider); background: #fff; transition: border-color .5s var(--ease), background .5s var(--ease); }
.p3-ui.is-in .p3-time i, .p3-time.is-in i { border-color: var(--lime-ico); background: var(--lime); transition-delay: calc(var(--i) * 190ms); }
.p3-time .warn i { border-color: var(--amber-ink); background: var(--amber); }
.p3-ui.is-in .p3-time .warn i { border-color: var(--amber-ink); background: var(--amber); }
.p3-time b { font-size: calc(16.5 * var(--u)); font-weight: 600; letter-spacing: -.015em; }
.p3-time time { font-size: calc(13.5 * var(--u)); color: var(--muted); font-variant-numeric: tabular-nums; }
.p3-time .on b { color: var(--lime-ink); }

/* =========================================================
   05 CONTEXT IN ACTION
   ========================================================= */
.p3-moment { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: calc(24 * var(--u)); align-items: start; }
.p3-msg { padding: calc(16 * var(--u)) calc(18 * var(--u)); border: 1px solid var(--rule); border-radius: var(--r); background: var(--grey); font-size: calc(18 * var(--u)); line-height: calc(27 * var(--u)); font-weight: 500; }
.p3-msg .p3-k { display: flex; margin-bottom: calc(8 * var(--u)); }
.p3-ctx { margin-top: calc(16 * var(--u)); padding: calc(18 * var(--u)); border: 1px solid var(--lime-ico); border-radius: var(--r); background: var(--lime-soft); }
.p3-ctx .p3-k { margin-bottom: calc(14 * var(--u)); color: var(--lime-ink); }
.p3-appt__dr { margin-top: calc(12 * var(--u)); font-family: var(--font-head); font-size: calc(26 * var(--u)); line-height: calc(32 * var(--u)); font-weight: 500; letter-spacing: -.03em; }
.p3-appt__when { margin-top: calc(6 * var(--u)); font-size: calc(19 * var(--u)); font-weight: 600; color: var(--lime-ink); font-variant-numeric: tabular-nums; }
.p3-appt__type { margin-top: calc(4 * var(--u)); font-size: calc(15 * var(--u)); color: var(--muted); }
.p3-appt__prev { display: grid; gap: calc(4 * var(--u)); margin-top: calc(18 * var(--u)); padding-top: calc(16 * var(--u)); border-top: 1px solid var(--rule); font-size: calc(15 * var(--u)); font-weight: 600; }

/* =========================================================
   06 THREE OTHER PRODUCTS — deliberately at a smaller scale
   ========================================================= */
.p3-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(24 * var(--u)); }
.p3-three > article { display: grid; align-content: start; gap: calc(12 * var(--u)); padding: calc(26 * var(--u)); border: 1px solid var(--rule); border-radius: var(--r-card); background: #fff; }
.p3-three .p3-h3 { font-size: calc(21 * var(--u)); line-height: calc(28 * var(--u)); }
.p3-three .p3-ui { margin-top: calc(4 * var(--u)); box-shadow: none; }
.p3-note { font-size: calc(15 * var(--u)); line-height: calc(23 * var(--u)); color: var(--muted); }
.p3-three .p3-link { margin-top: calc(2 * var(--u)); }
.p3-edu__t { font-size: calc(16.5 * var(--u)); font-weight: 600; }
.p3-edu { display: grid; gap: calc(8 * var(--u)); margin-top: calc(12 * var(--u)); }
.p3-edu > li { position: relative; padding-left: calc(20 * var(--u)); font-size: calc(15 * var(--u)); color: var(--muted); }
.p3-edu > li::before { content: ""; position: absolute; left: 0; top: calc(8 * var(--u)); width: calc(7 * var(--u)); height: calc(7 * var(--u)); border-radius: 50%; background: var(--lime-ico); }
.p3-three .p3-fields { margin-top: calc(12 * var(--u)); }

/* ---------- mid-page CTA strip ---------- */
.p3-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: calc(28 * var(--u)); margin: 0 var(--pad); padding: calc(36 * var(--u)) calc(40 * var(--u)); border: 1px solid var(--rule); border-radius: var(--r-card); background: var(--soft); }
.p3-strip p { margin-top: calc(6 * var(--u)); font-size: calc(16.5 * var(--u)); color: var(--muted); }
.p3-strip__acts { display: flex; flex-wrap: wrap; gap: calc(12 * var(--u)); }
.p3-sec + .p3-strip { margin-top: calc(96 * var(--u)); }
.p3-strip + .p3-sec { margin-top: calc(96 * var(--u)); border-top: 1px solid var(--rule); }

/* =========================================================
   07 ONE RECORD, FOUR TEAMS
   ========================================================= */
.p3-team { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.15fr) repeat(2, minmax(0, 1fr)); gap: calc(20 * var(--u)); align-items: center; }
.p3-team__hub { grid-column: 3; grid-row: 1 / span 2; align-self: stretch; }
.p3-team__hub .p3-ui__body { display: grid; align-content: center; gap: calc(16 * var(--u)); height: 100%; }
.p3-team__note { font-size: calc(15.5 * var(--u)); line-height: calc(24 * var(--u)); color: var(--muted); }
.p3-seat { display: grid; justify-items: center; gap: calc(12 * var(--u)); text-align: center; }
.p3-seat:nth-of-type(1) { grid-area: 1 / 1 / 2 / 3; }
.p3-seat:nth-of-type(2) { grid-area: 1 / 4 / 2 / 6; }
.p3-seat:nth-of-type(3) { grid-area: 2 / 1 / 3 / 3; }
.p3-seat:nth-of-type(4) { grid-area: 2 / 4 / 3 / 6; }
.p3-seat img { width: calc(84 * var(--u)); height: calc(84 * var(--u)); object-fit: cover; object-position: center 28%; border-radius: 50%; border: calc(3 * var(--u)) solid #fff; box-shadow: 0 0 0 1px var(--rule); }
.p3-seat b { display: block; font-size: calc(17 * var(--u)); font-weight: 600; letter-spacing: -.015em; }
.p3-seat span { display: block; margin-top: calc(3 * var(--u)); font-size: calc(14.5 * var(--u)); color: var(--muted); }

/* =========================================================
   08 THE WORKFLOW CHAIN — green only on the live path
   ========================================================= */
.p3-chain { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.p3-chain::before { content: ""; position: absolute; top: calc(7 * var(--u)); left: calc(8 * var(--u)); right: calc(100% / 5 - 8 * var(--u)); height: 2px; background: var(--divider); }
.p3-chain::after { content: ""; position: absolute; top: calc(7 * var(--u)); left: calc(8 * var(--u)); width: 0; height: 2px; background: var(--lime-ico); transition: width 1.6s var(--ease); }
.p3-chain.is-in::after { width: calc(100% - 100% / 5); }
.p3-chain > li { display: grid; justify-items: start; gap: calc(14 * var(--u)); padding-right: calc(22 * var(--u)); opacity: .4; transition: opacity .5s var(--ease); }
.p3-chain.is-in > li { opacity: 1; transition-delay: calc(var(--i) * 190ms); }
.p3-chain i { width: calc(16 * var(--u)); height: calc(16 * var(--u)); border-radius: 50%; border: 2px solid var(--divider); background: #fff; transition: border-color .5s var(--ease), background .5s var(--ease); }
.p3-chain.is-in .on i { border-color: var(--lime-ico); background: var(--lime); transition-delay: calc(var(--i) * 190ms); }
.p3-chain.is-in .warn i { border-color: var(--amber-ink); background: var(--amber); }
.p3-chain b { font-size: calc(17 * var(--u)); font-weight: 600; letter-spacing: -.015em; }
.p3-chain > li > span { font-size: calc(14 * var(--u)); color: var(--muted); }
.p3-chain .warn b { color: var(--amber-ink); }

/* =========================================================
   09 THE INTELLIGENCE LADDER
   ========================================================= */
.p3-ladder { display: grid; border-top: 1px solid var(--rule); }
.p3-ladder > li { display: grid; grid-template-columns: calc(56 * var(--u)) minmax(0, 1fr) auto; align-items: center; column-gap: calc(28 * var(--u)); padding: calc(26 * var(--u)) 0; border-bottom: 1px solid var(--rule); transition: background .2s var(--ease); }
.p3-ladder > li:hover { background: var(--soft); }
.p3-ladder .n { font-size: calc(13 * var(--u)); font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; }
.p3-ladder b { display: block; font-family: var(--font-head); font-size: calc(24 * var(--u)); line-height: calc(31 * var(--u)); font-weight: 500; letter-spacing: -.028em; }
.p3-ladder div > span { display: block; margin-top: calc(4 * var(--u)); font-size: calc(16 * var(--u)); color: var(--muted); }
.p3-ladder > li:first-child { background: var(--lime-soft); }

/* =========================================================
   10 PATIENT OS — this page is the active step
   ========================================================= */
.p3-os { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: calc(12 * var(--u)); }
.p3-os > li > * { display: grid; align-content: start; gap: calc(8 * var(--u)); height: 100%; padding: calc(22 * var(--u)) calc(20 * var(--u)); border: 1px solid var(--rule); border-radius: var(--r); background: #fff; transition: border-color .2s var(--ease), background .2s var(--ease); }
.p3-os a:hover { border-color: var(--lime-ico); background: var(--lime-soft); }
.p3-os .i { color: var(--faint); }
.p3-os b { font-size: calc(16 * var(--u)); font-weight: 600; letter-spacing: -.015em; }
.p3-os span span, .p3-os a span { font-size: calc(14.5 * var(--u)); line-height: calc(22 * var(--u)); color: var(--muted); }
.p3-os .is-on > span { border-color: var(--lime-ico); background: var(--lime); }
.p3-os .is-on .i, .p3-os .is-on span span { color: var(--lime-ink); }

/* =========================================================
   FAQ — native exclusive accordion, no script
   ========================================================= */
.p3-faq { max-width: calc(920 * var(--u)); margin-top: calc(52 * var(--u)); border-top: 1px solid var(--rule); }
.p3-faq details { border-bottom: 1px solid var(--rule); }
.p3-faq summary { display: flex; align-items: center; gap: calc(18 * var(--u)); padding: calc(24 * var(--u)) 0; cursor: pointer; list-style: none; font-family: var(--font-head); font-size: calc(22 * var(--u)); line-height: calc(29 * var(--u)); font-weight: 500; letter-spacing: -.028em; transition: color .15s ease; }
.p3-faq summary::-webkit-details-marker { display: none; }
.p3-faq summary:hover { color: var(--lime-ink); }
.p3-faq summary::after { content: ""; flex: none; width: calc(11 * var(--u)); height: calc(11 * var(--u)); margin-left: auto; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(calc(-2 * var(--u)), calc(-2 * var(--u))); transition: transform .25s var(--ease); }
.p3-faq details[open] summary::after { transform: rotate(-135deg); }
.p3-faq p { padding: 0 calc(48 * var(--u)) calc(26 * var(--u)) 0; max-width: calc(760 * var(--u)); font-size: calc(17 * var(--u)); line-height: calc(27 * var(--u)); color: var(--prose); }

/* =========================================================
   FINAL CTA
   ========================================================= */
.p3-final { padding: calc(124 * var(--u)) var(--pad); border-top: 1px solid var(--rule); text-align: center; }
.p3-final .p3-h2 { max-width: calc(820 * var(--u)); margin-inline: auto; }
.p3-final .p3-lede { margin-inline: auto; }
.p3-final .p3-ctas { justify-content: center; }
.p3-next { display: grid; justify-items: center; gap: calc(6 * var(--u)); max-width: calc(520 * var(--u)); margin: calc(56 * var(--u)) auto 0; padding: calc(26 * var(--u)); border: 1px solid var(--rule); border-radius: var(--r-card); background: #fff; transition: border-color .2s var(--ease); }
.p3-next:hover { border-color: var(--lime-ico); background: var(--lime-soft); }
.p3-next b { display: inline-flex; align-items: center; gap: calc(9 * var(--u)); font-family: var(--font-head); font-size: calc(24 * var(--u)); font-weight: 500; letter-spacing: -.028em; }
.p3-next b .i { width: calc(18 * var(--u)); height: calc(18 * var(--u)); transition: transform .2s var(--ease); }
.p3-next:hover b .i { transform: translateX(calc(3 * var(--u))); }
.p3-next > span:last-child { font-size: calc(15.5 * var(--u)); color: var(--muted); }

/* =========================================================
   MOTION (§9, brief §24) — subtle, and off under reduced motion
   ========================================================= */
.p3-js .p3-rev { opacity: 0; transform: translateY(calc(12 * var(--u))); }
.p3-js .p3-rev.is-in { opacity: 1; transform: none; transition: opacity .75s ease var(--d, 0ms), transform .75s var(--ease) var(--d, 0ms); }

@media (prefers-reduced-motion: no-preference) {
  /* the hero screen assembles itself rather than appearing whole (§9.6) */
  .p3-js .p3-hero__ui .p3-triad > li,
  .p3-js .p3-hero__ui .p3-rows > li { opacity: 0; transform: translateY(calc(6 * var(--u))); }
  .p3-js .p3-hero__stage.is-in .p3-hero__ui .p3-triad > li,
  .p3-js .p3-hero__stage.is-in .p3-hero__ui .p3-rows > li {
    opacity: 1; transform: none;
    transition: opacity .5s var(--ease), transform .5s var(--ease);
  }
  .p3-js .p3-hero__stage.is-in .p3-hero__ui .p3-triad > li:nth-child(1) { transition-delay: .30s; }
  .p3-js .p3-hero__stage.is-in .p3-hero__ui .p3-triad > li:nth-child(2) { transition-delay: .40s; }
  .p3-js .p3-hero__stage.is-in .p3-hero__ui .p3-triad > li:nth-child(3) { transition-delay: .50s; }
  .p3-js .p3-hero__stage.is-in .p3-hero__ui .p3-rows > li:nth-child(1) { transition-delay: .62s; }
  .p3-js .p3-hero__stage.is-in .p3-hero__ui .p3-rows > li:nth-child(2) { transition-delay: .69s; }
  .p3-js .p3-hero__stage.is-in .p3-hero__ui .p3-rows > li:nth-child(3) { transition-delay: .76s; }
  .p3-js .p3-hero__stage.is-in .p3-hero__ui .p3-rows > li:nth-child(4) { transition-delay: .83s; }
  .p3-js .p3-hero__stage.is-in .p3-hero__ui .p3-rows > li:nth-child(5) { transition-delay: .90s; }

  /* the overview screen plays its own sections (§9.6) */
  .p3-panel:not([hidden]) { animation: p3Settle .45s var(--ease); }
  @keyframes p3Settle { from { opacity: 0; transform: translateY(6px); } }
  .p3-app.is-cycling .p3-side__item[aria-selected="true"] .bar { animation: p3Fill 4600ms linear forwards; }
  @keyframes p3Fill { to { transform: scaleX(1); } }
}
@media (prefers-reduced-motion: reduce) {
  .p3 *, .p3 *::before, .p3 *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; transition-delay: 0ms !important; }
}

/* =========================================================
   Below 1180 --u is 1px. Stack, don't shrink (§10, brief §25).
   ========================================================= */
@media (max-width: 1179px) {
  .p3 { --pad: 22px; }
  .p3 .i { width: 16px; height: 16px; }
  .p3-h1 { font-size: clamp(32px, 7.4vw, 48px); line-height: 1.08; }
  .p3-h2 { font-size: clamp(26px, 5.6vw, 36px); line-height: 1.16; }
  .p3-h3 { font-size: 20px; line-height: 27px; }
  .p3-lede { font-size: 17px; line-height: 26px; max-width: none; }
  .p3-sub { font-size: 16px; line-height: 25px; max-width: none; }
  .p3-line { font-size: 20px; line-height: 28px; max-width: none; margin-top: 30px; }
  .p3-ctas { margin-top: 28px; flex-direction: column; align-items: stretch; }

  /* hero: headline, copy, CTA, then the human, then the product */
  .p3-hero { padding: 44px 22px 52px; }
  .p3-hero__grid { display: none; }
  .p3-hero__cols { display: block; }
  .p3-hero__stage { min-height: 0; margin-top: 32px; display: grid; justify-items: center; }
  .p3-person { position: static; width: min(62%, 240px); }
  .p3-hero__ui { margin-right: 0; margin-top: -18px; width: 100%; }

  .p3-sec { padding: 56px 22px; }
  .p3-stage { margin-top: 32px; }

  /* the fragments stack, and the converge rail becomes one vertical stem */
  .p3-frags { grid-auto-flow: row; grid-auto-columns: auto; gap: 10px; }
  .p3-frags > li { grid-auto-flow: column; justify-items: start; justify-content: start; gap: 12px; padding: 13px 16px; text-align: left; }
  .p3-converge { height: 30px; }
  .p3-converge::before, .p3-converge i { display: none; }
  .p3-node { font-size: 19px; padding: 12px 22px; }
  .p3-out { font-size: 15px; padding: 10px 18px; text-align: center; }

  /* the big surface: nav on top, one column of cards */
  .p3-app__grid { grid-template-columns: minmax(0, 1fr); }
  .p3-side { grid-auto-flow: column; grid-auto-columns: max-content; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--rule); padding: 12px; scrollbar-width: none; }
  .p3-side::-webkit-scrollbar { display: none; }
  .p3-main { padding: 18px; }
  .p3-list > li { grid-template-columns: 12px minmax(0, 1fr); row-gap: 4px; }
  .p3-list time { grid-column: 2; }
  .p3-main__head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .p3-triad { grid-template-columns: minmax(0, 1fr); }
  .p3-triad > li + li { border-left: 0; border-top: 1px solid var(--rule); }
  .p3-cards { grid-template-columns: minmax(0, 1fr); }

  /* the timeline turns vertical */
  .p3-story__head { flex-direction: column; align-items: flex-start; }
  .p3-time { grid-auto-flow: row; grid-auto-columns: auto; padding-left: 7px; margin-top: 26px; }
  .p3-time::before { top: 8px; bottom: 8px; left: 7px; right: auto; width: 2px; height: auto; }
  .p3-time::after { top: 8px; left: 7px; width: 2px; height: 0; transition: height 1.7s var(--ease); }
  .p3-time.is-in::after, .p3-ui.is-in .p3-time::after { width: 2px; height: calc(100% - 100% / 5); }
  .p3-time > li { grid-template-columns: 14px minmax(0, 1fr); grid-auto-flow: column; align-items: center; gap: 16px; padding: 11px 0; }
  .p3-time > li > b { grid-column: 2; }
  .p3-time > li > time { grid-column: 2; }

  .p3-moment { grid-template-columns: minmax(0, 1fr); }
  .p3-fields.two { grid-template-columns: minmax(0, 1fr); row-gap: 11px; }
  .p3-three { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .p3-three > article { padding: 20px; }

  .p3-strip { flex-direction: column; align-items: stretch; margin: 0 22px; padding: 24px 22px; }
  .p3-strip__acts { flex-direction: column; }
  .p3-sec + .p3-strip, .p3-strip + .p3-sec { margin-top: 56px; }

  /* the team becomes a stack: the record first, then who reads it */
  .p3-team { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
  .p3-team__hub { grid-column: 1 / -1; grid-row: 1; }
  .p3-seat:nth-of-type(1) { grid-area: 2 / 1 / 3 / 2; }
  .p3-seat:nth-of-type(2) { grid-area: 2 / 2 / 3 / 3; }
  .p3-seat:nth-of-type(3) { grid-area: 3 / 1 / 4 / 2; }
  .p3-seat:nth-of-type(4) { grid-area: 3 / 2 / 4 / 3; }
  .p3-seat img { width: 68px; height: 68px; }
  .p3-seat b { font-size: 15.5px; }
  .p3-seat span { font-size: 13.5px; }

  /* the chain turns vertical too */
  .p3-chain { grid-auto-flow: row; grid-auto-columns: auto; padding-left: 8px; }
  .p3-chain::before { top: 9px; bottom: 9px; left: 8px; right: auto; width: 2px; height: auto; }
  .p3-chain::after { top: 9px; left: 8px; width: 2px; height: 0; transition: height 1.6s var(--ease); }
  .p3-chain.is-in::after { width: 2px; height: calc(100% - 100% / 5); }
  .p3-chain > li { grid-template-columns: 16px minmax(0, 1fr); grid-auto-flow: column; align-items: center; gap: 16px; padding: 12px 0; }
  .p3-chain > li > b, .p3-chain > li > span { grid-column: 2; }

  .p3-ladder > li { grid-template-columns: 34px minmax(0, 1fr); column-gap: 14px; row-gap: 12px; padding: 20px 0; }
  .p3-ladder > li > :last-child { grid-column: 2; justify-self: start; }
  .p3-ladder b { font-size: 19px; line-height: 26px; }
  .p3-ladder div > span { font-size: 15px; }

  /* Patient OS scrolls sideways (brief §25) */
  .p3-os { grid-auto-columns: 74%; overflow-x: auto; margin: 32px -22px 0; padding: 0 22px 6px; scrollbar-width: none; }
  .p3-os::-webkit-scrollbar { display: none; }

  .p3-faq summary { font-size: 19px; line-height: 26px; padding: 20px 0; gap: 14px; }
  .p3-faq p { font-size: 16px; line-height: 25px; padding: 0 0 22px; }

  .p3-final { padding: 64px 22px; text-align: left; }
  .p3-final .p3-h2, .p3-final .p3-lede { margin-inline: 0; }
  .p3-final .p3-ctas { justify-content: flex-start; }
  .p3-next { max-width: none; margin-top: 36px; padding: 20px; justify-items: start; text-align: left; }
  .p3-next b { font-size: 20px; }
}
