/* One visual language: warm paper, sage technical surfaces, quiet yellow actions. */
:root{--scope-sheet:#f5f7f0;--scope-panel:#eef2e7;--scope-ink:#29362a;--scope-line:#d4dccb;--scope-action:#e3d477}
body{background:var(--scope-sheet);background-image:none}
.topbar{background:#fafbf6ed;border-color:var(--scope-line)}
.pipeline-overview--showcase{padding-top:24px;gap:22px;background:var(--scope-sheet)}
.pipeline-showcase__intro{position:relative;z-index:40;align-items:center}
.pipeline-title-row{display:flex!important;align-items:center;gap:14px}
.pipeline-showcase__intro h1{font-size:clamp(27px,2.35vw,38px)!important;line-height:1.2!important;letter-spacing:-.045em;margin:0;font-weight:640}
.pipeline-help{position:relative;align-self:center;display:flex}
.pipeline-help>button{display:grid;place-items:center;width:23px;height:23px;padding:0;border:1px solid #a2ae9570;border-radius:50%;background:#e5ebdf80;color:#87917e;font:500 13px/1 Inter,Arial;cursor:help}
.pipeline-help>p{position:absolute;top:calc(100% + 13px);left:-12px;width:340px;padding:17px 19px;margin:0;border:1px solid #d4dccb;border-radius:12px;background:#fbfcf8f5;backdrop-filter:blur(16px);color:#61705a;font:400 13px/1.7 Inter,Arial;box-shadow:0 14px 35px #263b2018;opacity:0;transform:translateY(-5px);pointer-events:none;transition:opacity .2s,transform .3s var(--scope-ease)}
.pipeline-help:hover>p,.pipeline-help:focus-within>p,.pipeline-help.is-open>p{opacity:1;transform:translateY(0);pointer-events:auto}
.pipeline-showcase__stage{padding:20px 20px 22px;grid-template-rows:30px minmax(140px,1fr) 116px!important}
.chapter-visual{max-height:min(52svh,440px)}
.pipeline-showcase__stage h2{font-weight:620;line-height:1.16}
.pipeline-showcase__stage:hover{box-shadow:0 20px 30px -27px #3c5637}

/* Evidence scenes share the chapter palette without framing every text block. */
.stage1-flow-sticky,.stage2-flow-sticky,.stage3-flow-sticky,.stage5-flow-sticky,.stage4-compose{background:var(--scope-sheet)!important;background-image:none!important}
.stage1-flow-header,.stage2-flow-header,.stage3-flow-header,.stage5-flow-header{background:#f5f7f0ed!important;border-color:var(--scope-line)!important}
.stage1-flow-header h2,.stage2-flow-header h2,.stage3-flow-header h2,.stage5-flow-header h2{color:#62725a}
.stage1-extract-head h3,.stage1-hsv-layout__heading h3,.stage1-completion-header h3,.stage1-perception-state h3,.stage2-page-heading h3,.stage3-page-heading h3,.stage5-page-heading h3,.stage4-compose__header h2{color:var(--scope-ink);font-size:clamp(28px,2.6vw,39px)!important;font-weight:630!important;letter-spacing:-.045em!important;line-height:1.13!important}
.stage1-extract-source,.stage1-extract-result,.stage1-hsv-context--large,.stage1-hsv-inspector--guided,.stage1-temporal-visual,.stage2-verification-candidate,.stage3-video-evidence,.stage3-rule-guide,.stage4-live__media,.s5-anchor-media,.s5-source,.s5-destination,.s5-summary{border-radius:13px!important;border-color:#cbd6c2!important;box-shadow:0 16px 38px -29px #20381d66!important}
.stage1-court-rail{display:none!important}
.stage1-hsv-layout.stage1-hsv-layout--063{grid-template-rows:auto minmax(0,1fr) 54px!important}
.stage1-completion-layout.stage1-completion-layout--063{grid-template-rows:auto minmax(0,1fr) 54px!important}
.stage1-visual-action,.stage2-visual-action,.stage3-visual-action,.s5-primary,.stage4-live__play{border-radius:11px!important;background:#e5d986f5!important;color:#32422c!important;border:1px solid #cabd7180!important;box-shadow:0 9px 22px -16px #25382066!important;backdrop-filter:blur(10px)}
.stage1-visual-action:hover,.stage2-visual-action:hover,.stage3-visual-action:hover,.s5-primary:hover{background:#e0d076!important}
.stage1-visual-action strong,.stage2-visual-action strong,.stage3-visual-action strong{font:600 14px/1.3 Inter,Arial!important}
.stage1-visual-action small,.stage2-visual-action small,.stage3-visual-action small{color:#6b7153!important}
.scene-tools__replay{color:#7e8e74!important}.scene-tools__replay:hover{color:#344b2d!important}
body .scene-next:not([class*=next-stage]){background:#e6ddad!important;border-color:#cfc58a!important;box-shadow:inset 0 1px 0 #ffffffe6!important}
body .scene-next:not([class*=next-stage]):hover{background:#ded08a!important;box-shadow:0 0 0 6px #d9d0a32b!important}
body .scene-next>svg{display:block!important;position:absolute!important;inset:auto!important;left:50%!important;top:50%!important;margin:0!important;transform:translate(-50%,-50%)!important;animation:none!important;flex:none!important}
body .scene-next:not(:disabled)>svg path{animation:next-nudge 4s ease-in-out infinite}
body .scene-next .scene-next__label{background:#f9fbf3f2;border:1px solid #d7dfcd;backdrop-filter:blur(12px);box-shadow:0 8px 22px #20381d0e}
body .scene-next__label small{display:none!important}
body a.chapter-exit{color:#75856a!important}

/* Rule examples: unaltered full-frame video and the shared dotted ball trail. */
.stage3-video-evidence{aspect-ratio:16/9!important;background:#eef2e7!important;border:1px solid #d0d9c6!important}
.stage3-video-evidence>video,.stage3-video-evidence>canvas{inset:0!important;width:100%!important;height:100%!important;object-fit:contain!important;filter:none!important;border-radius:0!important}
.stage3-video-evidence>figcaption,.stage3-process-scan{display:none!important}
.stage3-video-verdict{border-radius:8px!important;background:#f8faf0ed!important;border:1px solid #c7d2bd!important;box-shadow:0 4px 16px #1d341810!important;backdrop-filter:blur(12px);color:#33482e!important;padding:12px 42px 12px 15px!important;left:15px!important;top:15px!important}
.stage3-video-verdict>small{display:none!important}.stage3-video-verdict>strong{font:600 13px/1.3 Inter,Arial!important;color:inherit!important}.stage3-video-verdict>b{font-size:26px!important}
.stage3-video-verdict--invalid{color:#925346!important}.stage3-video-verdict--valid{color:#407652!important}
.stage3-evidence-strip,.stage3-interval-checks{border-color:#d6dfcd!important}
.stage3-evidence-strip>header>strong,.stage3-interval-checks>header>strong{font-size:13px!important}
.stage3-rule-guide{border:1px solid #d4ddcb!important}

/* An enlarged locator, not a measurement box: keep the actual ball unobscured. */
#stage2-area-locator{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}

/* More explanation, only where it helps follow a coordinate transformation. */
.s5-lens-help{color:#6b7c60;font-size:12px;line-height:1.65}
.s5-lens-help summary{cursor:pointer;list-style:none;display:flex;gap:9px;align-items:center}
.s5-lens-help summary::before{content:'?';width:18px;height:18px;display:grid;place-items:center;border:1px solid #bcc9b1;border-radius:50%;font-size:11px}
.s5-lens-help p{max-width:370px;margin:10px 0 0}
.s5-map-layout{grid-template-rows:auto 38px minmax(0,1fr) 66px 68px!important;gap:13px!important;padding-bottom:67px!important}
.s5-reuse{color:#6e805f;border-color:#d4deca!important}
.s5-map-note{display:grid!important;grid-template-columns:1fr!important;align-content:start!important;gap:7px!important;padding:0!important}
.s5-map-note>strong{font-size:13px!important;color:#455e3b}
.s5-map-note>span{display:block!important;font:400 13px/1.5 Inter,Arial!important;color:#75846a!important;max-width:920px}
.s5-map-steps{gap:6px;border:0!important}
.s5-map-steps button{border:1px solid #d5decc!important;border-radius:9px;background:#f6f8f1;padding:10px 13px!important}
.s5-map-steps button.is-active{background:#e8eecf;border-color:#bac791!important;box-shadow:none}
.s5-map-steps button>b{font:500 18px/1 Georgia,serif!important;color:#8a9c7d}
.s5-map-steps button>span{font-size:13px!important}.s5-map-steps small{font-size:11px!important;color:#7d8b72}
#s5-anchor-tooltip{padding:14px 15px}.s5-matrix{border-color:#d5dfca;background:#eef3e6!important;border-radius:10px}
.s5-reconstruction-info>summary{color:#7b8b70;font-size:11px!important}
.s5-map-steps button:disabled{opacity:.45;cursor:not-allowed}
#s5-locate-ball{position:absolute;left:18px;bottom:46px;z-index:3;min-width:175px}
#s5-source-point{pointer-events:none}
#s5-source-coordinate{position:absolute;z-index:2;padding:9px 12px;border:1px solid #f1e6a5;border-radius:8px;background:#f9f8e9f2;color:#35422b;box-shadow:0 4px 16px #16251024;font:600 15px/1.2 Inter,Arial;white-space:nowrap;pointer-events:none}
#s5-source-coordinate:not([hidden]){animation:s5-coordinate-reveal .35s ease-out both}
#s5-source-coordinate[hidden],#s5-locate-ball[hidden],#s5-map-action[hidden]{display:none!important}
.s5-locate-spinner{display:block;width:16px;height:16px;border:2px solid #53654340;border-top-color:#536543;border-radius:50%;animation:s5-locate-spin .7s linear infinite}
@keyframes s5-locate-spin{to{transform:rotate(360deg)}}
@keyframes s5-coordinate-reveal{from{opacity:0;transform:translateX(-6px)}to{opacity:1;transform:translateX(0)}}
@media(prefers-reduced-motion:reduce){#s5-source-coordinate:not([hidden]),.s5-locate-spinner{animation:none}}

/* Practice Demo remains a player, with the same quiet controls and media frame. */
.practice-section{background:var(--scope-sheet)!important;padding-top:48px!important}
.practice-heading{align-items:center;border-color:#d4dfc9!important}
.practice-heading .section-kicker,.practice-heading>p{display:none!important}
.practice-heading h2{font-size:32px!important;font-weight:630!important;letter-spacing:-.045em!important;color:var(--scope-ink)}
.practice-toolbar{border:0!important;background:transparent!important;gap:22px;padding-block:18px!important}
.case-picker>span{font-size:12px!important;font-weight:550!important;letter-spacing:.01em!important;color:#819174}
.practice-menu__trigger{border:1px solid #d0dbc4!important;border-radius:10px!important;background:#fafcf5!important;box-shadow:none!important;font-size:17px!important;color:#34482d!important}
.practice-menu__popover{border-radius:14px!important;border-color:#d2ddc8!important;background:#fafcf6f7!important;backdrop-filter:blur(20px);box-shadow:0 16px 36px #2235191c!important}
.layer-toggle{border:1px solid #d0dbc4!important;border-radius:10px!important;background:#f5f8ed!important}
.layer-toggle.is-active{background:#f0edcf!important;border-color:#cfc692!important}
.layer-toggle__copy>span{font-size:16px!important;font-weight:600!important;color:#34452b}.layer-toggle__copy small{font-size:12px!important;color:#7a886c}
.layer-toggle::after{display:none!important}.layer-toggle__switch{background:#ddd7a7!important;border-color:#c7bd7e!important}.layer-toggle.is-active .layer-toggle__switch{background:#d5bf59!important}
.video-panel{border-radius:15px;box-shadow:0 20px 45px -29px #263b215c;background:#f9fbf4;overflow:hidden;border:1px solid #cdd9c0}
.video-stage{border:0!important;border-radius:0!important;box-shadow:none!important}
.transport{border:0!important;background:#f0f4e9!important;padding:15px 19px!important;gap:16px}
.transport-play,.transport-audio{border-radius:50%;color:#5e7450!important}.timecode{color:#7d8c70!important}
.stage-play{background:#e5d782!important;border-color:#fafcebbb!important;box-shadow:0 0 0 7px #e8dea32e!important;color:#33452a}
@media(min-width:981px) and (max-height:780px){.pipeline-overview--showcase{padding-top:20px;gap:16px}.pipeline-showcase__stage{padding:13px 16px 17px}.chapter-visual{max-height:320px}.s5-map-layout{grid-template-rows:auto 32px minmax(0,1fr) 60px 62px!important;gap:10px!important;padding-bottom:61px!important}.s5-map-note>span{font-size:12px!important;max-width:920px}.s5-map-note>strong{font-size:12px!important}.s5-calibration-controls{gap:12px!important}.practice-section{padding-top:30px!important}}
@media(prefers-reduced-motion:reduce){.pipeline-help>p{transition:none}body .scene-next>svg path{animation:none!important}}

/* Stage 4: only the atomic video + annotation composite is visible. Keep the
   decoder mounted (not display:none) so Safari continues delivering frames. */
#stage4-result-video{opacity:0;pointer-events:none}
#video-stage.is-composited #analysis-video{opacity:0!important}
.stage4-live__media{width:min(100%,calc((100svh - 360px)*1.7778))}
.stage4-transport{width:min(100%,calc((100svh - 360px)*1.7778));margin:7px auto 0;display:flex;align-items:center;gap:10px;height:30px;color:#5e7450}
.stage4-transport button{border:0;border-radius:5px;background:transparent;color:inherit;min-width:30px;height:30px;cursor:pointer;font-family:inherit;font-size:15px;font-weight:600;line-height:1}
.stage4-transport button:hover{background:#e6ebdc}.stage4-transport button:focus-visible,.stage4-transport input:focus-visible{outline:2px solid #8d9758;outline-offset:2px}
.stage4-transport button:disabled{opacity:.4;cursor:default}
#stage4-playback{min-width:53px;font-size:12px;font-weight:650}
#stage4-scrubber{min-width:0;flex:1;accent-color:#82916c;cursor:ew-resize}
#stage4-inspect-frame{min-width:40px;text-align:center;font:11px/1 ui-monospace,SFMono-Regular,monospace;font-variant-numeric:tabular-nums}
