/* /learn-clinic-when-something-goes-wrong: its own sheet, loaded after site.css.
   The page runs from what is common to what is rare, then to what is done
   about it. The register is calm: every drawing is made once and then holds
   still. Script: scripts/learn-clinic-when-something-goes-wrong.js. With that
   script absent every part is visible and every link still jumps. */

html:has(body.sgw) {
  --hc-nav-h: 64px;            /* fallback; the script sets the real header height */
  --hc-bar-h: 52px;
  /* every jump, anchor and Tab stop lands below the header and the bar */
  scroll-padding-top: calc(var(--hc-nav-h) + var(--hc-bar-h) + 12px);
}
.sgw {
  --sgw-ease: cubic-bezier(.16, 1, .3, 1);
  --sgw-gut: clamp(20px, 4vw, 56px);
  --sgw-pad: clamp(56px, 7vw, 104px);
  --sgw-navy-text: #d6e2f0;
  background: #fff;
}

/* ============ GROUND RULES ============ */
.sgw-wrap { max-width: calc(1240px + 2 * var(--sgw-gut)); margin-inline: auto; padding-inline: var(--sgw-gut); }
/* text fills its column; the column sets the measure */
.sgw main p { max-width: none; margin: 0; }
.sgw main a:not(.btn) { border-bottom: 0; }
.sgw main :is(ul, ol) { list-style: none; margin: 0; padding: 0; }
.sgw main h2 {
  font-family: var(--font-display); font-weight: 300; color: var(--ink);
  font-size: clamp(1.8rem, 2.9vw, 2.6rem); line-height: 1.12; letter-spacing: -.01em;
  margin: 0 0 clamp(24px, 3vw, 40px); max-width: none; text-wrap: wrap;
}
.sgw main h3 { font-family: var(--font-display); font-weight: 400; color: var(--ink); font-size: 1.45rem; line-height: 1.2; margin: 0; max-width: none; }
.sgw main section p { font-size: 17px; line-height: 1.7; color: var(--ink-soft); }
.sgw main section p + p { margin-top: 16px; }
.sgw main strong { font-weight: 600; color: var(--ink); }
.sgw main .sgw-lede { font-size: clamp(1.05rem, 1.35vw, 1.2rem); line-height: 1.7; }
.sgw main :is(a, .btn, summary, button, input):focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 3px; border-radius: 4px; }
/* a part that receives focus after a jump is not itself a control */
.sgw main :is(h1, h2, h3, section)[tabindex="-1"]:focus { outline: none; }

/* a link inside a sentence */
.sgw-link { color: var(--accent-blue-hover); text-decoration: underline; text-decoration-color: var(--accent-ice); text-decoration-thickness: 1.5px; text-underline-offset: 4px; transition: color 200ms, text-decoration-color 200ms; }
.sgw-link:hover { color: var(--accent-blue); text-decoration-color: currentColor; }

/* the onward link: the arrow leans the way it points */
.sgw-go { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 16px; font-weight: 600; color: var(--accent-blue-hover); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 5px; transition: color 200ms, text-decoration-color 260ms; }
.sgw-go span { display: inline-block; transition: transform 360ms var(--sgw-ease); }
.sgw-go:hover { color: var(--accent-blue); text-decoration-color: currentColor; }
.sgw-go[href^="#"] span { transform: rotate(90deg); }
.sgw-go[href^="#"]:hover span { transform: translateY(4px) rotate(90deg); }

/* a drawn object in its badge: ink strokes on white, one weight throughout */
.sgw-icon { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
.sgw-icon svg { width: 34px; height: 34px; overflow: visible; }
.sgw-icon :is(path, rect, circle) { fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sgw-icon .sgw-icon__fill { fill: var(--ink); stroke: none; }

/* ============ REVEALS ============
   Hidden only once the script has said it is running (sgw-js on <html>), so
   with no script nothing is ever hidden. Each part comes in its own way. */
@keyframes sgw-up { from { opacity: 0; transform: translateY(20px); } }
@keyframes sgw-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes sgw-pop { from { transform: scale(0); opacity: 0; } 70% { transform: scale(1.18); opacity: 1; } }
@keyframes sgw-fade { from { opacity: 0; } }
@keyframes sgw-drip { 0%, 55% { transform: translateY(0); opacity: 0; } 62% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
@keyframes sgw-grow { from { transform: scaleX(0); } }
@keyframes sgw-unfold { from { opacity: 0; transform: translateY(-8px); } }
@keyframes sgw-fill { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes sgw-rule { from { transform: scaleX(0); } }
@keyframes sgw-set { to { opacity: .28; } }
@keyframes sgw-dawn { from { opacity: 0; transform: translateY(16px); } }
@keyframes sgw-beat { from { stroke-dashoffset: 1; } 60%, to { stroke-dashoffset: 0; } }

.sgw-js [data-r] { transition: opacity 620ms ease, transform 820ms var(--sgw-ease); }
.sgw-js [data-r]:not(.is-in) { opacity: 0; transform: translateY(16px); }
/* these keep their box and animate their own parts instead */
.sgw-js :is([data-r="scale"], [data-r="night"], [data-r="knee"], [data-r="recov"], [data-r="row"]):not(.is-in) { opacity: 1; transform: none; }

/* ============ HERO ============ */
.sgw-hero { padding-block: clamp(36px, 5vw, 72px) clamp(48px, 6vw, 88px); }
.sgw-hero__h1 { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.1rem, 4.1vw, 3.7rem); line-height: 1.06; letter-spacing: -.015em; color: var(--ink); margin: 0 0 clamp(28px, 4vw, 52px); max-width: none; text-wrap: wrap; }
/* a heading that has to wrap breaks where the styling changes */
.sgw-hero__h1 > .h-lead, .sgw-hero__h1 > em { display: inline-block; }
.sgw-hero__h1 > em { color: var(--accent-blue); }
.sgw-hero__row { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 88px); align-items: center; }
.sgw main .sgw-hero__answer { font-family: var(--font-display); font-size: clamp(1.5rem, 2.3vw, 2.05rem); line-height: 1.25; color: var(--ink); }
.sgw main .sgw-hero__answer strong { font-weight: 400; color: var(--accent-blue-hover); }
.sgw main .sgw-hero__more { font-size: clamp(1.05rem, 1.35vw, 1.2rem); line-height: 1.7; margin-block: 18px 14px; }
.sgw-hero__fig { margin: 0; }
.sgw-scene { display: block; width: 100%; height: auto; overflow: visible; }
.sgw-scene :is(path, rect, circle) { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sgw-scene .sgw-d--thin { stroke: var(--border-strong); stroke-width: 1.5; }
.sgw-scene .sgw-scene__ground { stroke: var(--border-strong); }
.sgw-scene .sgw-scene__paper { fill: #fff; }
.sgw-scene .sgw-scene__cross { stroke: var(--accent-blue); stroke-width: 4; }
.sgw-scene .sgw-scene__beat { stroke: var(--accent-blue); }
.sgw-scene .sgw-scene__route { stroke: var(--accent-blue); stroke-width: 2.4; }
.sgw-scene .sgw-scene__node { fill: #fff; stroke: var(--accent-blue); stroke-width: 2.4; transform-box: fill-box; transform-origin: center; }
.sgw-scene .sgw-scene__node--end { fill: var(--accent-blue); }
.sgw-scene .sgw-scene__drop { fill: var(--accent-ice); stroke: none; opacity: 0; }

/* first paint: the building, the chair and its line, the bed a floor up, then the way between them */
.sgw-js .sgw-hero__h1 > * { animation: sgw-up 900ms var(--sgw-ease) both; }
.sgw-js .sgw-hero__h1 > em { animation-delay: 110ms; }
.sgw-js .sgw-hero__text > * { animation: sgw-up 900ms var(--sgw-ease) 240ms both; }
.sgw-js .sgw-hero__text > :nth-child(2) { animation-delay: 330ms; }
.sgw-js .sgw-hero__text > :nth-child(3) { animation-delay: 420ms; }
.sgw-js .sgw-scene :is(.sgw-d, .sgw-scene__route) { stroke-dasharray: 1; animation: sgw-draw 900ms var(--sgw-ease) both; }
.sgw-js .sgw-scene__shell .sgw-d { animation-delay: 150ms; }
.sgw-js .sgw-scene__shell .sgw-d--thin { animation-delay: 550ms; }
.sgw-js .sgw-scene__sign { animation: sgw-fade 600ms ease 900ms both; }
.sgw-js .sgw-scene__suite .sgw-d { animation-delay: 900ms; }
.sgw-js .sgw-scene__icu .sgw-d { animation-delay: 1400ms; }
.sgw-js .sgw-scene .sgw-scene__beat { animation: sgw-beat 1400ms ease-out 2000ms both; }
.sgw-js .sgw-scene .sgw-scene__route { animation-duration: 1300ms; animation-delay: 2300ms; animation-timing-function: cubic-bezier(.6, 0, .3, 1); }
.sgw-js .sgw-scene .sgw-scene__node { animation: sgw-pop 420ms var(--sgw-ease) 2200ms both; }
.sgw-js .sgw-scene .sgw-scene__node--end { animation-delay: 3500ms; }
/* the one thing that keeps moving: the drip, slowly, and only while the drawing is on screen */
.sgw-js .sgw-scene.is-live .sgw-scene__drop { animation: sgw-drip 3400ms ease-in 2600ms infinite; }

/* ============ CONTENTS BAR (follows the reader) ============ */
.sgw .hc-bar {
  /* under the phone menu's sheet (55) and backdrop (50), over the page */
  position: fixed; left: 0; right: 0; top: var(--hc-nav-h); z-index: 49;
  height: var(--hc-bar-h);
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  transform: translateY(-8px); opacity: 0; visibility: hidden;
  transition: opacity 260ms, transform 360ms var(--sgw-ease), visibility 0s 360ms;
}
.sgw .hc-bar.is-on { transform: none; opacity: 1; visibility: visible; transition: opacity 260ms, transform 360ms var(--sgw-ease); }
body.sgw.nav-open .hc-bar { opacity: 0; visibility: hidden; }
.sgw .hc-bar__track {
  max-width: calc(1240px + 2 * var(--sgw-gut)); margin: 0 auto; padding: 0 var(--sgw-gut);
  height: 100%; display: flex; align-items: stretch; gap: clamp(18px, 2.4vw, 32px);
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; scroll-padding-inline: 28px;
}
.sgw .hc-bar__track::-webkit-scrollbar { display: none; }
.sgw .hc-bar__track a {
  position: relative; flex: none; display: flex; align-items: center;
  font-size: 14px; font-weight: 500; color: var(--ink-muted); white-space: nowrap;
  transition: color 200ms;
}
.sgw .hc-bar__track a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--accent-blue); transform: scaleX(0); transform-origin: left;
  transition: transform 360ms var(--sgw-ease);
}
.sgw .hc-bar__track a:hover, .sgw .hc-bar__track a[aria-current] { color: var(--ink); }
.sgw .hc-bar__track a:hover::after { transform: scaleX(.35); }
.sgw .hc-bar__track a[aria-current]::after { transform: scaleX(1); }
.sgw .hc-bar__track a:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: -4px; border-radius: 4px; }
.sgw .hc-bar__progress {
  position: absolute; left: 0; top: 0; height: 2px; width: 100%;
  background: var(--accent-ice); transform-origin: left; transform: scaleX(var(--hc-p, 0));
}

/* ============ BY FREQUENCY ============
   One wedge, thick where a thing is common and thin where it is rare. */
.sgw-freq { padding-block: var(--sgw-pad); border-top: 1px solid var(--border); }
.sgw-scale { position: relative; margin-top: clamp(36px, 4vw, 56px); padding-top: 34px; }
.sgw-scale__wedge { position: absolute; left: 0; right: 0; top: 0; height: 18px; background: linear-gradient(90deg, var(--ink) 0%, var(--accent-blue) 45%, var(--accent-ice) 100%); clip-path: polygon(0 0, 100% 44%, 100% 56%, 0 100%); transform-origin: left; }
.sgw-scale__pts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.sgw-scale__pts a { display: grid; grid-template-rows: auto auto auto 1fr; justify-items: start; height: 100%; padding: 4px 4px 12px 0; color: inherit; border-radius: 8px; }
.sgw-scale__pts .sgw-icon { margin-bottom: 18px; transition: border-color 260ms, transform 420ms var(--sgw-ease); }
.sgw-scale__rate { font-family: var(--font-display); font-weight: 300; font-size: clamp(2rem, 3vw, 2.7rem); line-height: 1; color: var(--ink); letter-spacing: -.01em; }
.sgw-scale__name { margin-top: 12px; font-size: 17px; font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: color 200ms, text-decoration-color 260ms; }
.sgw-scale__sub { margin-top: 6px; font-size: 15.5px; line-height: 1.6; color: var(--ink-soft); }
.sgw-scale__pts a:hover .sgw-icon, .sgw-scale__pts a:focus-visible .sgw-icon { border-color: var(--accent-blue); transform: translateY(-3px); }
.sgw-scale__pts a:hover .sgw-scale__name, .sgw-scale__pts a:focus-visible .sgw-scale__name { color: var(--accent-blue-hover); text-decoration-color: currentColor; }
.sgw-js .sgw-scale:not(.is-in) .sgw-scale__wedge { transform: scaleX(0); }
.sgw-js .sgw-scale.is-in .sgw-scale__wedge { animation: sgw-grow 1300ms cubic-bezier(.6, 0, .2, 1) both; }
.sgw-js .sgw-scale:not(.is-in) li { opacity: 0; }
.sgw-js .sgw-scale.is-in li { animation: sgw-up 760ms var(--sgw-ease) both; }
.sgw-js .sgw-scale.is-in li:nth-child(2) { animation-delay: 260ms; }
.sgw-js .sgw-scale.is-in li:nth-child(3) { animation-delay: 520ms; }
.sgw-js .sgw-scale.is-in li:nth-child(4) { animation-delay: 780ms; }

/* ============ AFTER AN IV ============
   The drawing is the evening: the infusion, a night in bed, a call in the morning. */
.sgw-iv { padding-block: var(--sgw-pad); background: var(--accent-wash); }
.sgw-iv__row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 88px); align-items: center; }
.sgw-night { margin: 0; }
.sgw-night svg { display: block; width: 100%; height: auto; overflow: visible; }
.sgw-night :is(path, rect, circle) { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sgw-night .sgw-night__floor { stroke: var(--border-strong); stroke-width: 1.5; }
.sgw-night .sgw-night__arc { stroke: var(--accent-blue); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 0; }
.sgw-night .sgw-night__moon { fill: #fff; }
.sgw-night .sgw-night__sun { fill: #fff; stroke: var(--accent-blue); }
.sgw-night .sgw-night__rays { stroke: var(--accent-blue); }
.sgw-js .sgw-night:not(.is-in) .sgw-night__arc { stroke-dashoffset: 1; }
.sgw-js .sgw-night:not(.is-in) :is(.sgw-night__bed, .sgw-night__day) { opacity: 0; }
.sgw-js .sgw-night.is-in .sgw-night__arc { animation: sgw-draw 2200ms cubic-bezier(.5, 0, .3, 1) 200ms both; }
.sgw-js .sgw-night.is-in .sgw-night__bed { animation: sgw-fade 700ms ease 900ms both; }
.sgw-js .sgw-night.is-in .sgw-night__day { animation: sgw-dawn 900ms var(--sgw-ease) 2000ms both; }
/* once the sun is up the moon steps back */
.sgw-js .sgw-night.is-in .sgw-night__moon { animation: sgw-set 900ms ease 2300ms both; }

/* ============ AFTER AN INJECTION ============ */
.sgw-sore { padding-block: var(--sgw-pad); }
.sgw-sore__row { display: grid; grid-template-columns: minmax(0, 1fr) clamp(120px, 14vw, 180px); gap: clamp(28px, 4vw, 72px); align-items: center; }
.sgw-knee { margin: 0; }
.sgw-knee svg { display: block; width: 100%; height: auto; overflow: visible; }
.sgw-knee :is(path, rect, ellipse) { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sgw-knee .sgw-knee__site { fill: var(--accent-blue); stroke: none; transform-box: fill-box; transform-origin: center; }
.sgw-knee .sgw-knee__needle { transition: transform 900ms var(--sgw-ease) 700ms, opacity 500ms ease 700ms; }
.sgw-js .sgw-knee .sgw-d { stroke-dasharray: 1; }
.sgw-js .sgw-knee:not(.is-in) .sgw-d { stroke-dashoffset: 1; }
.sgw-js .sgw-knee.is-in .sgw-d { animation: sgw-draw 1000ms var(--sgw-ease) both; }
.sgw-js .sgw-knee:not(.is-in) .sgw-knee__needle { transform: translateX(34px); opacity: 0; }
.sgw-js .sgw-knee:not(.is-in) .sgw-knee__site { opacity: 0; }
.sgw-js .sgw-knee.is-in .sgw-knee__site { animation: sgw-pop 420ms var(--sgw-ease) 1500ms both; }

/* the timeline: eight weeks drawn to scale, so the sore days are as short as they are */
.sgw-recov { margin-top: clamp(36px, 4vw, 56px); padding: clamp(22px, 3vw, 40px); border: 1px solid var(--border); border-radius: 12px; }
.sgw-recov__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.sgw .sgw-recov__head h3 { margin-bottom: 10px; }
.sgw main .sgw-recov__head p { font-size: 16px; }
.sgw main .sgw-recov__readout { flex: none; font-family: var(--font-display); font-size: 1.3rem; line-height: 1; color: var(--ink-muted); white-space: nowrap; }
.sgw-recov__readout b { display: inline-block; min-width: 2ch; margin-left: 6px; font-weight: 300; font-size: 3.2rem; color: var(--ink); font-variant-numeric: tabular-nums lining-nums; text-align: left; }
.sgw-recov__track { position: relative; height: 44px; margin-top: 28px; }
/* inset by half the 28px handle, so the handle's middle sits over the band of its day */
.sgw-recov__bands { position: absolute; inset: 12px 14px; display: flex; border-radius: 6px; overflow: hidden; }
.sgw-recov__bands i { transform-origin: left; }
/* days 0 to 4, 5 to 14, 15 to 42, 43 to 56, on one scale */
.sgw-recov__bands i:nth-child(1) { flex: 4.5; background: var(--ink); }
.sgw-recov__bands i:nth-child(2) { flex: 10; background: var(--accent-blue); }
.sgw-recov__bands i:nth-child(3) { flex: 28; background: var(--accent-ice); }
.sgw-recov__bands i:nth-child(4) { flex: 13.5; background: #c9dcee; }
.sgw-js .sgw-recov:not(.is-in) .sgw-recov__bands i { transform: scaleX(0); }
.sgw-js .sgw-recov.is-in .sgw-recov__bands i { animation: sgw-grow 700ms var(--sgw-ease) both; }
.sgw-js .sgw-recov.is-in .sgw-recov__bands i:nth-child(2) { animation-delay: 220ms; }
.sgw-js .sgw-recov.is-in .sgw-recov__bands i:nth-child(3) { animation-delay: 440ms; }
.sgw-js .sgw-recov.is-in .sgw-recov__bands i:nth-child(4) { animation-delay: 660ms; }
.sgw-recov__pin { display: none; }
.sgw-recov__input { position: absolute; inset: 0; width: 100%; height: 44px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: ew-resize; touch-action: pan-y; }
.sgw-recov__input::-webkit-slider-runnable-track { height: 44px; background: transparent; }
.sgw-recov__input::-moz-range-track { height: 44px; background: transparent; }
.sgw-recov__input::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 44px; border-radius: 8px; border: 2px solid var(--ink); background: #fff; box-shadow: 0 6px 16px -8px rgba(11, 29, 58, .6); transition: transform 260ms var(--sgw-ease), border-color 200ms; }
.sgw-recov__input::-moz-range-thumb { box-sizing: border-box; width: 28px; height: 44px; border-radius: 8px; border: 2px solid var(--ink); background: #fff; box-shadow: 0 6px 16px -8px rgba(11, 29, 58, .6); transition: transform 260ms var(--sgw-ease), border-color 200ms; }
.sgw-recov__input:hover::-webkit-slider-thumb { transform: scale(1.08); border-color: var(--accent-blue); }
.sgw-recov__input:hover::-moz-range-thumb { transform: scale(1.08); border-color: var(--accent-blue); }
.sgw-recov__input:active::-webkit-slider-thumb { transform: scale(.96); border-color: var(--accent-blue); }
.sgw-recov__input:active::-moz-range-thumb { transform: scale(.96); border-color: var(--accent-blue); }
.sgw-recov__axis { position: relative; height: 26px; margin: 6px 14px 0; font-size: 14px; color: var(--ink-muted); }
.sgw-recov__axis span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.sgw-recov__axis span:nth-child(1) { left: 0; transform: none; }
.sgw-recov__axis span:nth-child(2) { left: 8.9%; }
.sgw-recov__axis span:nth-child(3) { left: 25%; }
.sgw-recov__axis span:nth-child(4) { left: 75%; }
.sgw-recov__axis span:nth-child(5) { left: auto; right: 0; transform: none; }
.sgw-recov__rows { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px !important; }
.sgw-recov__rows li { display: grid; gap: 4px; align-content: start; padding: 16px 18px; border-radius: 8px; border: 1px solid transparent; border-top-color: var(--border); transition: border-color 320ms, background-color 320ms, opacity 320ms; }
.sgw-recov__rows b { font-size: 15px; font-weight: 600; color: var(--ink); }
.sgw-recov__rows span { font-size: 15px; color: var(--ink-soft); }
.sgw-recov__rows em { font-family: var(--font-display); font-style: normal; font-size: 1.35rem; line-height: 1.2; color: var(--ink); }
/* the stretch the thumb is in stands forward; the others step back */
.sgw-js .sgw-recov__rows li.is-now { border-color: var(--ink); background: #fff; }
.sgw main .sgw-sore__flag { margin-top: clamp(28px, 3vw, 44px); }

/* ============ RARE EVENTS ============
   A ledger: what can happen on the left, what is done about it on the right. */
.sgw-rare { padding-block: var(--sgw-pad); border-top: 1px solid var(--border); }
.sgw-ledger { margin-top: clamp(28px, 3vw, 44px); }
.sgw-row { position: relative; display: grid; grid-template-columns: 56px minmax(0, 7fr) minmax(0, 5fr); gap: clamp(18px, 2.4vw, 36px); align-items: start; padding-block: 28px; }
.sgw-row::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--border-strong); transform-origin: left; }
.sgw-row h3 { margin-bottom: 6px; }
.sgw main .sgw-row__rate { font-size: 15px; color: var(--ink-muted); margin-bottom: 10px; }
.sgw main .sgw-row__what p + p { margin-top: 0; }
.sgw main .sgw-row__what p:last-child { font-size: 16.5px; }
.sgw main .sgw-row__resp { font-size: 16px; line-height: 1.65; padding-left: 20px; border-left: 3px solid var(--accent-blue); }
.sgw-row__resp > strong { display: block; font-size: 14px; font-weight: 600; color: var(--accent-blue-hover); margin-bottom: 4px; }
.sgw-js .sgw-row:not(.is-in)::before { transform: scaleX(0); }
.sgw-js .sgw-row.is-in::before { animation: sgw-rule 900ms var(--sgw-ease) both; }
.sgw-js .sgw-row:not(.is-in) > * { opacity: 0; transform: translateY(12px); }
.sgw-js .sgw-row > * { transition: opacity 600ms ease 160ms, transform 760ms var(--sgw-ease) 160ms; }
.sgw-js .sgw-row > .sgw-row__resp { transition-delay: 320ms; }

/* ============ SERIOUS ADVERSE EVENTS (navy) ============ */
.sgw-plan { padding-block: var(--sgw-pad); background: var(--ink); }
.sgw-plan__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 88px); align-items: start; }
.sgw-plan__intro { position: sticky; top: calc(var(--hc-nav-h) + var(--hc-bar-h) + 28px); }
.sgw .sgw-plan :is(h2, h3) { color: #fff; }
.sgw-plan__intro > p:first-child { margin-top: 6px; }
.sgw .sgw-plan p { color: var(--sgw-navy-text); }
.sgw .sgw-plan :is(strong, em) { color: #fff; }
.sgw .sgw-plan :is(a, summary, button):focus-visible { outline-color: var(--accent-ice); }
.sgw-walk { margin-top: 28px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .18); }
.sgw-walk h3 { margin-bottom: 8px; }
.sgw main .sgw-walk p { font-size: 16px; }
.sgw-walk__ctrl { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.sgw-walk__play { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 10px; border: 1.5px solid var(--accent-ice); background: transparent; color: #fff; cursor: pointer; transition: background-color 220ms, border-color 220ms, transform 260ms var(--sgw-ease); }
.sgw-walk__play[hidden] { display: none; }
.sgw-walk__play svg { width: 16px; height: 16px; fill: currentColor; }
.sgw-walk__play:hover { background: rgba(124, 169, 209, .2); border-color: #fff; transform: translateY(-2px); }
.sgw-walk__play:active { transform: none; }
.sgw-walk__ico-pause, .sgw-walk__play.is-playing .sgw-walk__ico-play { display: none; }
.sgw-walk__play.is-playing .sgw-walk__ico-pause { display: inline; }
.sgw main .sgw-walk__count { font-size: 15px; color: var(--sgw-navy-text); font-variant-numeric: tabular-nums; }
.sgw-walk__count b { color: #fff; font-weight: 600; }
.sgw-walk__ctrl:not(:has(button:not([hidden]))) .sgw-walk__count { display: none; }

.sgw-step { position: relative; }
.sgw-step summary { display: grid; grid-template-columns: 56px minmax(0, 1fr) 24px; column-gap: 20px; align-items: center; min-height: 56px; padding-block: 14px; cursor: pointer; list-style: none; }
.sgw-step summary::-webkit-details-marker { display: none; }
.sgw-step summary::after { content: ""; grid-column: 3; grid-row: 1 / span 2; justify-self: center; width: 9px; height: 9px; margin-top: -4px; border-right: 2px solid var(--accent-ice); border-bottom: 2px solid var(--accent-ice); transform: rotate(45deg); transition: transform 360ms var(--sgw-ease); }
.sgw-step[open] summary::after { margin-top: 4px; transform: rotate(-135deg); }
.sgw-step summary:hover::after { transform: translateY(3px) rotate(45deg); }
.sgw-step[open] summary:hover::after { transform: translateY(-3px) rotate(-135deg); }
.sgw-step .sgw-icon { grid-row: 1 / span 2; position: relative; z-index: 1; background: var(--ink); border-color: rgba(255, 255, 255, .3); transition: border-color 320ms, background-color 320ms; }
.sgw-step .sgw-icon :is(path, rect, circle) { stroke: var(--accent-ice); transition: stroke 320ms; }
.sgw-step[open] .sgw-icon { border-color: #fff; background: #fff; }
.sgw-step[open] .sgw-icon :is(path, rect, circle) { stroke: var(--ink); }
.sgw-step summary:hover .sgw-icon { border-color: #fff; }
.sgw-step__when { grid-column: 2; font-size: 14.5px; color: var(--accent-ice); }
.sgw-step summary h3 { grid-column: 2; transition: color 200ms; }
.sgw .sgw-step:not([open]) summary h3 { color: var(--sgw-navy-text); }
.sgw .sgw-step summary:hover h3 { color: #fff; }
/* one connector per gap, badge to badge, and nothing after the last */
.sgw-step:not(:last-child)::before, .sgw-step:not(:last-child)::after { content: ""; position: absolute; left: 27px; top: 70px; bottom: -14px; width: 2px; margin-left: -1px; }
.sgw-step:not(:last-child)::before { background: rgba(255, 255, 255, .22); }
.sgw-step:not(:last-child)::after { background: var(--accent-ice); transform-origin: top; transform: scaleY(0); }
.sgw-step.is-timing:not(:last-child)::after { animation: sgw-fill var(--sgw-dwell, 6s) linear both; }
.sgw-step__body { padding: 2px 44px 22px 76px; }
.sgw-step[open] .sgw-step__body { animation: sgw-unfold 420ms var(--sgw-ease); }
.sgw main .sgw-step__body p { font-size: 16.5px; }
.sgw-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 14px !important; }
.sgw-facts li { position: relative; padding-left: 20px; font-size: 14.5px; color: #fff; }
.sgw-facts li::before { content: ""; position: absolute; left: 2px; top: .42em; width: 9px; height: 5px; border-left: 2px solid var(--accent-ice); border-bottom: 2px solid var(--accent-ice); transform: rotate(-45deg); }

/* ============ QUESTIONS TO ASK ============ */
.sgw-ask { padding-block: var(--sgw-pad); }
.sgw-ask__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 88px); align-items: start; }
.sgw-tell { margin: 28px 0 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--accent-blue); transform-origin: left; }
.sgw main .sgw-tell p { font-family: var(--font-body); font-style: normal; }
.sgw main .sgw-tell__lbl { font-size: 15px; font-weight: 600; color: var(--accent-blue-hover); }
.sgw main .sgw-tell .sgw-tell__q { font-family: var(--font-display); font-size: clamp(1.4rem, 2vw, 1.75rem); line-height: 1.3; color: var(--ink); margin-block: 8px 12px; }
.sgw-js .sgw-tell:not(.is-in) { transform: translateX(-24px); }
.sgw-check__head { display: flex; align-items: center; gap: 22px; margin-bottom: 14px; }
.sgw-board { flex: none; width: 64px; height: 80px; overflow: visible; }
.sgw-board :is(rect, path) { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sgw-board .sgw-board__clip { fill: #fff; }
.sgw-board path:not(.sgw-board__tick) { stroke: var(--border-strong); }
.sgw-board .sgw-board__tick { stroke: var(--accent-blue); stroke-width: 2.2; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 420ms var(--sgw-ease); }
.sgw-board g.is-on .sgw-board__tick { stroke-dashoffset: 0; }
.sgw main .sgw-check__count { margin-top: 6px; font-size: 15px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.sgw-check__count b { color: var(--ink); font-weight: 600; }
.sgw-check li { border-top: 1px solid var(--border); }
.sgw-check label { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 16px; padding: 18px 8px 18px 0; cursor: pointer; font-size: 16.5px; line-height: 1.65; color: var(--ink-soft); }
.sgw-check input { position: absolute; opacity: 0; width: 26px; height: 26px; margin: 0; }
.sgw-check__box { display: grid; place-items: center; width: 26px; height: 26px; margin-top: 1px; border-radius: 6px; border: 1.5px solid var(--ink-muted); background: #fff; transition: background-color 220ms, border-color 220ms, transform 260ms var(--sgw-ease); }
.sgw-check__box svg { width: 16px; height: 16px; }
.sgw-check__box path { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 360ms var(--sgw-ease) 60ms; }
.sgw-check label:hover .sgw-check__box { border-color: var(--accent-blue); transform: scale(1.06); }
.sgw-check input:checked + .sgw-check__box { background: var(--accent-blue); border-color: var(--accent-blue); }
.sgw-check input:checked + .sgw-check__box path { stroke-dashoffset: 0; }
.sgw-check input:focus-visible + .sgw-check__box { outline: 2px solid var(--accent-blue); outline-offset: 3px; }
.sgw-check label strong { display: block; }
.sgw-check__copy { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 10px; padding: 0 16px; border-radius: 8px; border: 1.5px solid var(--border-strong); background: #fff; font: inherit; font-size: 15px; font-weight: 600; color: var(--accent-blue-hover); cursor: pointer; transition: border-color 220ms, color 220ms, transform 260ms var(--sgw-ease); }
.sgw-check__copy:hover { border-color: var(--accent-blue); color: var(--accent-blue); transform: translateY(-2px); }
.sgw-check__copy:active { transform: none; }
.sgw-check__copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sgw-check__copy path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 360ms var(--sgw-ease); }
.sgw-check__copy.is-done path { stroke-dashoffset: 0; }

/* ============ THE BOTTOM LINE (navy) ============ */
.sgw-line { padding-block: var(--sgw-pad); background: var(--ink); }
.sgw .sgw-line h2 { color: #fff; font-size: clamp(1.7rem, 2.65vw, 2.4rem); }
.sgw-line h2 > span { display: inline-block; }
.sgw .sgw-line p { color: var(--sgw-navy-text); }
.sgw .sgw-line strong { color: #fff; }
.sgw-line__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: column; grid-template-rows: auto auto; gap: 22px clamp(28px, 4vw, 72px); }
/* said, and written down: an empty speech bubble beside a page with its lines ticked */
.sgw-line__cols svg { width: 88px; height: 66px; overflow: visible; }
.sgw-line__cols svg path { fill: none; stroke: var(--accent-ice); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sgw-said path { stroke-dasharray: 5 6; }
.sgw-written .sgw-written__tick { stroke: #fff; stroke-width: 2.2; stroke-dasharray: 1; stroke-dashoffset: 0; }
.sgw-js .sgw-written:not(.is-in) .sgw-written__tick { stroke-dashoffset: 1; }
.sgw-js .sgw-written.is-in .sgw-written__tick { animation: sgw-draw 420ms var(--sgw-ease) 500ms both; }
.sgw-js .sgw-written.is-in .sgw-written__tick:nth-of-type(5) { animation-delay: 760ms; }
.sgw-js .sgw-written.is-in .sgw-written__tick:nth-of-type(6) { animation-delay: 1020ms; }
.sgw main .sgw-line__cols p + p { margin-top: 0; }
.sgw-js .sgw-line__cols p:nth-child(2) { transition-delay: 140ms; }

/* ============ READ ON ============ */
.sgw-on { padding-block: var(--sgw-pad) clamp(40px, 5vw, 64px); }
.sgw-on__list li { position: relative; }
.sgw-on__list li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--border-strong); transform-origin: left; }
.sgw-on__list a { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr) 48px; gap: clamp(16px, 3vw, 48px); align-items: center; min-height: 44px; padding-block: 18px; color: inherit; }
.sgw-on__t { font-family: var(--font-display); font-size: clamp(1.4rem, 2vw, 1.8rem); line-height: 1.2; color: var(--ink); transition: color 200ms; }
.sgw-on__d { font-size: 16px; line-height: 1.6; color: var(--ink-soft); }
.sgw-on__go { justify-self: end; width: 48px; height: 48px; transition: transform 360ms var(--sgw-ease), border-color 260ms; }
.sgw-on__go svg { width: 22px; height: 22px; }
.sgw-on__list a:hover .sgw-on__go, .sgw-on__list a:focus-visible .sgw-on__go { border-color: var(--accent-blue); }
.sgw-on__list a:hover .sgw-on__t, .sgw-on__list a:focus-visible .sgw-on__t { color: var(--accent-blue-hover); }
.sgw-on__list a:hover .sgw-on__go, .sgw-on__list a:focus-visible .sgw-on__go { transform: translateX(8px); }
.sgw-js .sgw-on__list li:not(.is-in)::before { transform: scaleX(0); }
.sgw-js .sgw-on__list li.is-in::before { animation: sgw-rule 900ms var(--sgw-ease) both; }
.sgw-js .sgw-on__list li:not(.is-in) a { opacity: 0; }
.sgw-js .sgw-on__list li a { transition: opacity 600ms ease 160ms; }
.sgw main .sgw-on__up { display: flex; flex-wrap: wrap; gap: 4px 32px; padding-top: 18px; border-top: 1px solid var(--border-strong); font-size: 16px; }
.sgw-on__up a { display: inline-flex; align-items: center; min-height: 44px; }

/* ============ SELF-ASSESSMENT ============ */
.sgw-end { border-top: 1px solid var(--border); padding-block: clamp(56px, 7vw, 96px); }
.sgw-end .assess-band__inner { max-width: 720px; margin: 0 auto; padding: 0 var(--sgw-gut); display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.sgw .sgw-end .assess-band__title { margin: 0; text-wrap: balance; }
.sgw main .sgw-end .assess-band__lede { font-size: 18px; line-height: 1.6; color: var(--ink-soft); }
.sgw-end .btn { margin-top: 6px; }
.sgw-end .assess-band__note { font-size: 14px; color: var(--ink-muted); }

/* ============ NARROWER ============ */
@media (max-width: 1100px) {
  /* the bar's track can scroll here, so its edges fade */
  .sgw .hc-bar__track { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent); }
}
@media (max-width: 900px) {
  .sgw-hero__row, .sgw-iv__row, .sgw-plan__grid, .sgw-ask__grid, .sgw-line__cols { grid-template-columns: minmax(0, 1fr); }
  .sgw-hero__fig, .sgw-night { max-width: 520px; width: 100%; margin-inline: auto; }
  .sgw-iv__text { order: -1; }
  .sgw-plan__intro { position: static; }
  .sgw-scale__pts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
  .sgw-recov__rows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sgw-row { grid-template-columns: 56px minmax(0, 1fr); }
  .sgw-row__resp { grid-column: 2; }
  .sgw-on__list a { grid-template-columns: minmax(0, 1fr) 48px; row-gap: 6px; }
  .sgw-line__cols { grid-auto-flow: row; grid-template-rows: none; }
  .sgw-on__d { grid-column: 1; grid-row: 2; }
  .sgw-on__go { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 600px) {
  html:has(body.sgw) { --hc-bar-h: 48px; }
  .sgw .hc-bar__track { gap: 22px; }
  /* the wedge turns to run down the side of the list */
  .sgw-scale { padding-top: 0; padding-left: 30px; }
  .sgw-scale__wedge { left: 0; right: auto; top: 0; bottom: 0; width: 14px; height: auto; background: linear-gradient(180deg, var(--ink) 0%, var(--accent-blue) 45%, var(--accent-ice) 100%); clip-path: polygon(0 0, 100% 0, 56% 100%, 44% 100%); transform-origin: top; }
  .sgw-js .sgw-scale:not(.is-in) .sgw-scale__wedge { transform: scaleY(0); }
  .sgw-js .sgw-scale.is-in .sgw-scale__wedge { animation-name: sgw-fill; }
  .sgw-scale__pts { grid-template-columns: minmax(0, 1fr); row-gap: 10px; }
  .sgw-scale__pts a { grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 16px; padding-block: 10px; }
  .sgw-scale__pts .sgw-icon { grid-row: 1 / span 3; margin: 0; }
  .sgw-scale__rate { font-size: 1.9rem; }
  .sgw-scale__name { margin-top: 6px; }
  .sgw-sore__row { grid-template-columns: minmax(0, 1fr); }
  .sgw-knee { width: 120px; order: -1; }
  .sgw-recov__head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .sgw-recov__axis span:is(:nth-child(2), :nth-child(4)) { display: none; }
  .sgw-recov__rows { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .sgw-recov__rows li { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 14px; }
  .sgw-recov__rows span { grid-column: 1; }
  .sgw-recov__rows em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 1.1rem; text-align: right; max-width: 9ch; }
  .sgw-row { grid-template-columns: 48px minmax(0, 1fr); gap: 14px 16px; padding-block: 24px; }
  .sgw-row .sgw-icon { width: 48px; height: 48px; }
  .sgw-row .sgw-icon svg { width: 30px; height: 30px; }
  .sgw-row__resp { grid-column: 1 / -1; }
  .sgw-step summary { grid-template-columns: 56px minmax(0, 1fr) 20px; column-gap: 14px; }
  .sgw-step__body { padding: 2px 0 20px 70px; }
  .sgw main h3 { font-size: 1.3rem; }
  .sgw-end .btn { width: 100%; }
}

/* ============ STILL ============
   Reduced motion: every drawing holds its finished state and nothing moves. */
@media (prefers-reduced-motion: reduce) {
  .sgw main *, .sgw main *::before, .sgw main *::after { animation: none !important; transition: none !important; }
  .sgw-js [data-r]:not(.is-in), .sgw-js [data-r]:not(.is-in) * { opacity: 1 !important; transform: none !important; }
  .sgw-js [data-r]:not(.is-in)::before { transform: none !important; }
  .sgw-js .sgw-scene :is(.sgw-d, .sgw-scene__route), .sgw-js .sgw-knee .sgw-d { stroke-dasharray: none; stroke-dashoffset: 0 !important; }
  .sgw-js .sgw-night .sgw-night__arc { stroke-dashoffset: 0 !important; }
  .sgw-scene .sgw-scene__drop { display: none; }
  .sgw .hc-bar { transition: none !important; }
  .sgw-scale__pts a:hover .sgw-icon, .sgw-walk__play:hover, .sgw-check__copy:hover { transform: none; }
}
@media print {
  .sgw .hc-bar, .sgw-walk__ctrl, .sgw-check__copy, .sgw-recov__input, [data-walk-hint] { display: none !important; }
  .sgw-js [data-r], .sgw-js [data-r] * { opacity: 1 !important; transform: none !important; animation: none !important; }
  .sgw-plan, .sgw-line, .sgw-iv { background: #fff; }
  .sgw .sgw-plan :is(h2, h3, p, strong, em, li), .sgw .sgw-line :is(h2, p, strong) { color: var(--ink) !important; }
  .sgw-plan__intro { position: static; }
}

/* Paper is taken the instant the print dialog opens: nothing may still be fading or sliding in. */
@media print {
  main *, main *::before, main *::after { animation: none !important; transition: none !important; }
}
