/* The digital twin story on every industry page (2026-10-27), built by industry_kit.twin_story() from
   lab/pages/usecases/story/<slug>.json; player ind-twin.js. Approved by Saife at /industries/healthcare-story-refined/
   (uc-story-r.css, the test copy of this file, whose header holds the full design notes and references).
   Same architecture as the v2 test (uc-story.css): Temporal's player (stops, Pause / Start over, a progress line) over two
   panes, the twin on the left (three records, one per system, matched into one page, which links out to four records)
   and the timeline on the right (bars that grow against the clock). Saife: "the idea is clear now but the design looks
   like AI slop". The finish is rebuilt under the impeccable polish pass and craft-floor, with the values measured today
   in Projects/Marrinn/research/motion-references-2026-10/usecase-story/premium/:
   - one sans (Inter) at four sizes, weights 400/500/600; actor and verb differ by colour, not size (Linear agent feed);
     no monospace; numbers tabular;
   - one elevation device: the player's 1px hairline. Panes are columns split by a rule, records are tone-only fills at
     12px radius, no inner borders, no glow (Linear, Ramp);
   - status is a coloured word with a 14px icon, never a pill (Ramp, Linear);
   - lines are solid, low-contrast, round-capped curves drawn by stroke-dashoffset, 800ms, cubic-bezier(.4,0,.2,1),
     staggered (Amie); the one bright object is the patient's page (Amie's centre tile);
   - focus by opacity: when a Squid reads records, the rest drop to 40% (Linear's carousel);
   - one hue per meaning: violet = an agent, amber = a person (the confirm and the approve), green = done. The only solid
     button on the stage is Approve (Ramp).
   Default markup is the FINAL state; uc-story-r.js resets and plays it. */
.ucr { --v: #9a6bff; --a: #e88122; --g: #4ade80; --ink: #f4f3ef; --soft: #c9c3da; --dim: #8f88a6; --faint: #5f5975;
  --fill: rgb(255 255 255 / .035); --rule: rgb(255 255 255 / .08); --out: cubic-bezier(.215, .61, .355, 1);
  --draw: cubic-bezier(.4, 0, .2, 1); }
.ucr .erp-h { max-width: 22ch; }
.ucr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ucr ::selection { background: rgb(154 107 255 / .4); color: #fff; }
.ucr svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.ucr-player { margin-top: clamp(36px, 5vh, 56px); border: 1px solid rgb(255 255 255 / .1); border-radius: 14px;
  background: rgb(10 8 20 / .88); overflow: hidden; font-family: var(--sc-font-text); font-variant-numeric: tabular-nums; }

/* ---- header: five stops joined by thin rules, two controls */
.ucr-head { display: flex; align-items: center; gap: 24px; padding: 18px 22px 16px; }
.ucr-steps { display: flex; align-items: center; flex: 1; margin: 0; padding: 0; list-style: none; }
.ucr-steps li { display: flex; align-items: center; gap: 9px; color: var(--faint); font: 500 14px/1 var(--sc-font-text);
  letter-spacing: -.01em; white-space: nowrap; transition: color .4s var(--out); }
.ucr-steps li + li::before { content: ""; width: clamp(14px, 2vw, 34px); height: 1px; margin: 0 14px; background: var(--rule); }
.ucr-steps .d { width: 6px; height: 6px; border-radius: 50%; background: rgb(255 255 255 / .18); flex: none; transition: background .4s var(--out); }
.ucr-steps li.is-past { color: var(--dim); }
.ucr-steps li.is-past .d { background: rgb(154 107 255 / .6); }
.ucr-steps li.is-on { color: var(--ink); }
.ucr-steps li.is-on .d { background: var(--v); }
.ucr-steps li[data-s="4"].is-on .d { background: var(--g); }

.ucr-ctl { display: flex; gap: 6px; flex: none; }
.ucr-ctl button { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: 999px;
  border: 1px solid transparent; background: transparent; color: var(--dim); font: 500 13px/1 var(--sc-font-text);
  cursor: pointer; white-space: nowrap; transition: color .2s var(--out), background .2s var(--out), border-color .2s var(--out); }
.ucr-ctl button:hover { color: var(--ink); background: rgb(255 255 255 / .05); }
.ucr-ctl button:active { transform: translateY(1px); }
.ucr-ctl button:focus-visible { outline: 2px solid var(--v); outline-offset: 2px; }
.ucr-ctl .ucr-pp { color: var(--ink); border-color: rgb(255 255 255 / .16); }
.ucr-ctl .ucr-pp:hover { border-color: rgb(255 255 255 / .3); }
.ucr-ctl svg { width: 12px; height: 12px; }
.ucr-pp svg { fill: currentColor; stroke: none; }
.ucr-pp .i-play { display: none; }
.ucr-player.is-paused .ucr-pp .i-play, .ucr-player.is-end .ucr-pp .i-play { display: block; }
.ucr-player.is-paused .ucr-pp .i-pause, .ucr-player.is-end .ucr-pp .i-pause { display: none; }

.ucr-prog { position: relative; height: 1px; background: var(--rule); }
.ucr-prog i { position: absolute; left: 0; top: 0; height: 1px; width: calc(var(--p, 1) * 100%); background: var(--v); }
.ucr-player.is-done .ucr-prog i { background: rgb(255 255 255 / .35); transition: background .6s var(--out); }

/* ---- the two panes: columns split by one rule, no boxes */
.ucr-body { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); }
.ucr-pane { min-width: 0; padding: 20px 24px 24px; }
.ucr-pane--tl { border-left: 1px solid var(--rule); }
.ucr-pane__t { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 20px;
  color: var(--dim); font: 500 13px/1.2 var(--sc-font-text); }
.ucr-pane__t span:first-child { color: var(--soft); }
.ucr-clock { color: var(--ink); font-weight: 500; transition: color .3s; }
.ucr-player.is-pre .ucr-clock { color: var(--faint); }

/* ---- the twin */
.ucr-tw { position: relative; }
.ucr-tw svg.ucr-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ucr-wires path { fill: none; stroke: rgb(255 255 255 / .16); stroke-width: 1.5; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .8s var(--draw), stroke .35s var(--out), opacity .35s var(--out); }
.ucr-wires path.is-half { stroke-dashoffset: .55; }
.ucr-wires path.is-on { stroke-dashoffset: 0; }
.ucr-wires path.is-hot { stroke: var(--v); stroke-width: 1.8; }
.ucr-tw.has-hot .ucr-wires path:not(.is-hot) { opacity: .35; }

.ucr-recs { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ucr-rec { display: grid; align-content: start; padding: 12px 13px 13px; border-radius: 12px; background: var(--fill);
  transition: opacity .4s var(--out), background .35s var(--out), box-shadow .35s var(--out); }
.ucr-rec p { margin: 0; }
.ucr-rec__h { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 0; }
.ucr-rec__h b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ucr-rec__h b { color: var(--ink); font: 600 13px/1 var(--sc-font-text); }
.ucr-rec__h small { flex-basis: 100%; margin-top: 3px; color: var(--faint); font: 400 11.5px/1.2 var(--sc-font-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ucr-rec__id { margin-top: 12px !important; color: var(--dim); font: 400 12px/1.2 var(--sc-font-text); }
.ucr-rec__nm { margin-top: 3px !important; color: var(--ink); font: 500 13.5px/1.25 var(--sc-font-text); letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ucr-st { margin-top: 12px !important; min-height: 16px; display: flex; align-items: center; color: var(--faint);
  font: 500 11.5px/1.2 var(--sc-font-text); white-space: nowrap; }
.ucr-st > span { display: none; align-items: center; gap: 5px; }
.ucr-st svg { width: 13px; height: 13px; flex: none; stroke-width: 2; }
.ucr-st .s-wait { display: inline-flex; }
.ucr-rec.is-ok .s-wait, .ucr-rec.is-sc .s-wait, .ucr-rec.is-cf .s-wait { display: none; }
.ucr-rec.is-ok:not(.is-un) .s-ok { display: inline-flex; color: var(--g); }
.ucr-rec.is-sc:not(.is-cf) .s-sc { display: inline-flex; color: var(--soft); }
.ucr-rec.is-cf .s-cf { display: inline-flex; color: var(--a); }
.ucr-rec.is-un .s-un { display: inline-flex; color: var(--g); }
.ucr-meter { position: relative; display: inline-block; width: 26px; height: 3px; border-radius: 2px; background: rgb(255 255 255 / .12); overflow: hidden; }
.ucr-meter i { position: absolute; inset: 0 auto 0 0; width: 84%; border-radius: 2px; background: var(--soft); }
.ucr-rec.is-ev { background: rgb(255 255 255 / .07); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .28); }
.ucr-rec.is-hot { background: rgb(154 107 255 / .1); box-shadow: inset 0 0 0 1px rgb(154 107 255 / .55); }
.ucr-player.tw-5 .ucr-rec:not(.is-hot):not(.is-ev) { opacity: .72; }
.ucr-tw.has-hot .ucr-rec:not(.is-hot), .ucr-tw.has-hot .ucr-ln:not(.is-hot) { opacity: .4; }

/* logo tiles: white, so every vendor mark reads as its own brand */
.ucr-lg { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: #fff; }
.ucr-lg img { display: block; width: 74%; height: 74%; object-fit: contain; }
.ucr-lg--s { width: 16px; height: 16px; border-radius: 4px; margin-right: 7px; }

/* the one page: the single bright object on the stage (Amie's centre tile), with the next patients as slivers behind */
.ucr-one { position: relative; isolation: isolate; display: grid; place-items: center; margin: 44px auto 40px; width: 216px; }
.ucr-page { position: relative; z-index: 2; display: grid; justify-items: center; gap: 5px; width: 100%; padding: 16px 16px 15px;
  border-radius: 12px; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14); text-align: center;
  transition: background .6s var(--out), box-shadow .6s var(--out), transform .6s var(--out); }
.ucr-one::before, .ucr-one::after { content: ""; z-index: 0; position: absolute; left: 10px; right: 10px; top: 0; bottom: -7px;
  border-radius: 12px; background: #d9d3ee; opacity: 0; transform: translateY(-7px); transition: opacity .5s var(--out) .25s, transform .5s var(--out) .25s; }
.ucr-one::after { z-index: -1; left: 22px; right: 22px; bottom: -14px; background: #a9a1c4; transform: translateY(-14px); transition-delay: .35s; }
.ucr-page__ph { grid-area: 1 / 1 / 4 / 2; align-self: center; color: var(--faint); font: 500 12.5px/1 var(--sc-font-text); transition: opacity .3s; }
.ucr-page__k, .ucr-page b, .ucr-page__m { grid-column: 1; opacity: 0; transform: translateY(4px); transition: opacity .5s var(--out) .1s, transform .5s var(--out) .1s; }
.ucr-page__k { grid-row: 1; color: #6a5aa0; font: 500 11.5px/1 var(--sc-font-text); }
.ucr-page b { grid-row: 2; color: #120d22; font: 600 18px/1.15 var(--sc-font-display); letter-spacing: -.02em; }
.ucr-page__m { grid-row: 3; color: #5d567a; font: 400 12px/1 var(--sc-font-text); }
.ucr-player.tw-5 .ucr-page { background: #f4f1fb; box-shadow: 0 18px 40px -14px rgb(0 0 0 / .75); }
.ucr-player.tw-5 .ucr-page__ph { opacity: 0; }
.ucr-player.tw-5 .ucr-page__k, .ucr-player.tw-5 .ucr-page b, .ucr-player.tw-5 .ucr-page__m { opacity: 1; transform: none; }
.ucr-player.tw-5 .ucr-one::before { opacity: .5; transform: none; }
.ucr-player.tw-5 .ucr-one::after { opacity: .25; transform: none; }
.ucr-more { position: absolute; left: calc(100% + 16px); top: 50%; transform: translateY(-50%); width: max-content;
  color: var(--dim); font: 400 12px/1.35 var(--sc-font-text); opacity: 0; transition: opacity .5s var(--out) .45s; }
.ucr-player.tw-5 .ucr-more { opacity: 1; }

/* what her page links to: each a record a Squid reads later */
.ucr-links { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ucr-ln { display: grid; gap: 7px; align-content: start; padding: 11px 12px 12px; border-radius: 12px; background: var(--fill);
  opacity: 0; transform: translateY(6px); transition: opacity .45s var(--out), transform .45s var(--out), background .35s var(--out), box-shadow .35s var(--out); }
.ucr-ln small { color: var(--faint); font: 400 11.5px/1.15 var(--sc-font-text); }
.ucr-ln b { display: grid; color: var(--ink); font: 500 13px/1.25 var(--sc-font-text); letter-spacing: -.01em; }
.ucr-ln b > span { grid-area: 1 / 1; display: flex; align-items: center; transition: opacity .35s var(--out), color .35s var(--out); }
.ucr-ln .v1 { opacity: 0; }
.ucr-ln.is-on { opacity: 1; transform: none; }
.ucr-ln.is-hot { background: rgb(154 107 255 / .1); box-shadow: inset 0 0 0 1px rgb(154 107 255 / .55); }
.ucr-ln.is-x .v0 { color: var(--faint); text-decoration: line-through; text-decoration-color: rgb(255 255 255 / .4); }
.ucr-ln.is-held .v0 { opacity: 0; }
.ucr-ln.is-held .v1 { opacity: 1; color: var(--soft); }
.ucr-ln.is-booked .v1 { color: var(--ink); }

/* ---- the timeline: a label line over a 4px track per actor, four time marks, a playhead */
.ucr-tl { --span: 16; container-type: inline-size; }
.ucr-grid { position: relative; display: grid; gap: 16px; padding: 2px 0 10px; }
.ucr-vl { position: absolute; top: -4px; bottom: 0; left: calc(var(--m) / var(--span) * 100%); width: 1px; background: rgb(255 255 255 / .045); }
.ucr-now { position: absolute; top: -4px; bottom: 0; left: calc(var(--now, 15) / var(--span) * 100%); width: 1px;
  background: rgb(154 107 255 / .7); opacity: 0; transition: opacity .3s; }
.ucr-player:not(.is-pre):not(.is-done) .ucr-now { opacity: 1; }
.ucr-row { position: relative; display: grid; gap: 7px; opacity: 0; transform: translateY(4px); transition: opacity .4s var(--out), transform .4s var(--out); }
.ucr-row.is-on { opacity: 1; transform: none; }
.ucr-lb { display: flex; align-items: center; gap: 7px; margin: 0 0 0 calc(var(--s) / var(--span) * 100cqw);
  width: max-content; max-width: calc(100cqw - var(--s) / var(--span) * 100cqw); color: var(--dim); font: 400 13px/18px var(--sc-font-text); white-space: nowrap; }
.ucr-lb b { color: var(--ink); font-weight: 500; }
.ucr-lb .t-done { display: none; }
.ucr-row.is-fin .t-run { display: none; }
.ucr-row.is-fin .t-done { display: inline-flex; align-items: center; }
.ucr-av { width: 20px; height: 20px; flex: none; border-radius: 50%; object-fit: cover; background: rgb(154 107 255 / .2); }
.ucr-lb .ucr-lg { width: 20px; height: 20px; }
.ucr-lb .ucr-lg--src { width: 16px; height: 16px; border-radius: 4px; margin-left: 2px; opacity: .9; }
.ucr-lb svg { width: 16px; height: 16px; flex: none; }
.ucr-track { position: relative; height: 4px; margin-left: calc(var(--s) / var(--span) * 100%);
  width: calc((var(--e) - var(--s)) / var(--span) * 100%); min-width: 4px; }
.ucr-track i { position: absolute; inset: 0 auto 0 0; width: calc(var(--w, 1) * 100%); min-width: 4px; border-radius: 2px; background: var(--v); }
.ucr-row--pt .ucr-track { width: 6px; height: 6px; margin-top: -1px; }
.ucr-row--pt .ucr-track i { width: 6px; border-radius: 50%; background: var(--soft); }
.ucr-row--end .ucr-lb { margin-left: auto; margin-right: calc((var(--span) - var(--e)) / var(--span) * 100cqw); max-width: none; }
.ucr-row--end.ucr-row--pt .ucr-track { margin-left: calc(var(--e) / var(--span) * 100% - 6px); }
.ucr-row--end.ucr-row--pt .ucr-track i { background: var(--v); }

/* the run on top: violet while it runs, green once she is rebooked */
.ucr-row--run .ucr-lb { color: var(--soft); }
.ucr-row--run .i-run { color: var(--v); }
.ucr-row--run .i-done { display: none; color: var(--g); stroke-width: 2.2; }
.ucr-row--run .ucr-track i { background: rgb(154 107 255 / .5); transition: background .6s var(--out); }
.ucr-row--run.is-fin .i-run { display: none; }
.ucr-row--run.is-fin .i-done { display: block; }
.ucr-row--run.is-fin .ucr-track i { background: var(--g); }
.ucr-row--run { padding-bottom: 14px; border-bottom: 1px solid var(--rule); margin-bottom: 2px; }

/* the approval: the person, in amber, and the only solid button on the stage (Ramp) */
.ucr-row--ok .ucr-track i { background: rgb(232 129 34 / .45); }
.ucr-row--ok.is-wait .ucr-track i { animation: ucr-wait 1.6s ease-in-out infinite; }
.ucr-row--ok.is-fin .ucr-track i { background: var(--a); }
@keyframes ucr-wait { 50% { opacity: .55; } }
.ucr-ini { display: grid; place-items: center; width: 20px; height: 20px; flex: none; border-radius: 50%; background: var(--a); color: #1a0f04;
  font: 700 9px/1 var(--sc-font-text); letter-spacing: .02em; }
.ucr-btn { display: inline-grid; place-items: center; height: 24px; margin-left: 10px; padding: 0 11px; border-radius: 7px;
  background: var(--a); color: #1a0f04; font: 600 12px/1 var(--sc-font-text); transition: transform .15s var(--out), filter .2s; }
.ucr-row--ok.is-press .ucr-btn { transform: scale(.94); filter: brightness(1.12); }
.ucr-okd { display: inline-flex; align-items: center; gap: 5px; color: var(--g); font-weight: 500; }
.ucr-okd svg { width: 14px; height: 14px; stroke-width: 2.2; }

.ucr-ruler { position: relative; height: 18px; margin-top: 4px; }
.ucr-ruler span { position: absolute; top: 4px; left: calc(var(--m) / var(--span) * 100%); transform: translateX(-50%);
  color: var(--faint); font: 400 11.5px/1 var(--sc-font-text); }
.ucr-ruler span:first-child { transform: none; }

/* ---- the foot: what stays, and the link to /digital-twin/ */
.ucr-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; margin: 20px 2px 0;
  color: var(--dim); font: 400 14px/1.5 var(--sc-font-text); }
.ucr-foot b { color: var(--ink); font-weight: 500; }

@media (max-width: 1100px) {
  .ucr-body { grid-template-columns: 1fr; }
  .ucr-pane--tl { border-left: 0; border-top: 1px solid var(--rule); }
}
@media (max-width: 860px) {
  .ucr-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .ucr-steps { flex-wrap: wrap; row-gap: 10px; }
}
@media (max-width: 700px) {
  .ucr-head { padding: 16px; }
  .ucr-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
  .ucr-steps li { font-size: 13.5px; white-space: normal; line-height: 1.2; }
  .ucr-steps li + li::before { display: none; }
  .ucr-pane { padding: 18px 16px 20px; }
  .ucr-wires { display: none; }
  .ucr-recs { grid-template-columns: 1fr; gap: 6px; }
  .ucr-rec { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 11px 12px; }
  .ucr-rec__h { grid-column: 1 / -1; }
  .ucr-rec__h small { flex-basis: auto; margin: 0 0 0 4px; }
  .ucr-rec__id { grid-column: 2; grid-row: 2; margin-top: 10px !important; align-self: baseline; }
  .ucr-rec__nm { grid-column: 1; grid-row: 2; margin-top: 10px !important; }
  .ucr-st { grid-column: 1 / -1; margin-top: 8px !important; }
  .ucr-one { margin: 26px auto 26px 0; width: 190px; }
  .ucr-links { grid-template-columns: 1fr 1fr; }
  .ucr-lb { margin-left: 0 !important; margin-right: 0 !important; max-width: 100%; white-space: normal; flex-wrap: wrap; row-gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .ucr-row--ok.is-wait .ucr-track i { animation: none; }
  .ucr *, .ucr *::before, .ucr *::after { transition-duration: .01ms !important; }
}
