/* Test-tractor-semitrailer-connection explainer: Step 11 to 13 coupling security simulator.
   Top: yard side view (tug against locked trailer brakes, landing gear just off the ground).
   Bottom: close-up under the trailer, dark until the light comes on in Step 13. */
.tc-page{--tc-ok:#31d67b;--tc-warn:#ffb400;--tc-bad:#ef4444;--tc-console:#10161b}
.tc-page .sbp-hero-grid.is-no-film{grid-template-columns:minmax(0,1fr)}
.tc-demo{padding-block:64px 72px;background:var(--paper)}
.tc-demo-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);grid-template-areas:"head head" "stage panel";gap:24px 40px;align-items:start}
.tc-head{grid-area:head}
.tc-stage{grid-area:stage;margin:0;padding:10px;border-radius:16px;background:linear-gradient(170deg,#1d262d,#0b0f12 80%);box-shadow:0 30px 60px -34px rgb(0 0 0/.75),inset 0 1px 0 rgb(255 255 255/.06)}
.tc-svg{display:block;width:100%;height:auto;border-radius:10px;background:#0b0f12}
.tc-panel{grid-area:panel;display:grid;gap:14px}

/* cab badges: light up once the cab is secured in Step 12 */
.tc-hud{display:none;align-items:center;gap:6px;flex-wrap:wrap;padding:0 2px 10px}
.tc-stage.is-js .tc-hud{display:flex}
.tc-lamp{display:inline-flex;align-items:center;gap:7px;margin:0;padding:6px 10px 6px 8px;border-radius:8px;background:#0b0f12;box-shadow:inset 0 0 0 1px rgb(255 255 255/.09);font-size:13px;line-height:1;white-space:nowrap}
.tc-lamp i{flex:none;width:9px;height:9px;border-radius:50%;background:#3a444b;box-shadow:inset 0 0 0 1.5px #56626a}
.tc-lamp span{color:#8c979e;font-weight:700;letter-spacing:.02em;text-transform:uppercase;font-size:12px}
.tc-lamp.is-on i{background:var(--tc-ok);box-shadow:0 0 0 2px rgb(49 214 123/.2),0 0 10px rgb(49 214 123/.8)}
.tc-lamp.is-on span{color:#e9fff2}
.tc-stage.is-live .tc-lamp i,.tc-stage.is-live .tc-lamp span{transition:background .25s,box-shadow .25s,color .25s}
.tc-stage.is-live .tc-lamp:nth-child(2) i{transition-delay:.12s}
.tc-stage.is-live .tc-lamp:nth-child(3) i{transition-delay:.4s}
.tc-stage.is-live .tc-lamp:nth-child(4) i{transition-delay:.6s}

/* yard view */
.tc-wall{fill:#b3b8b4}
.tc-wall-roof{fill:#8f9590}
.tc-wall-ribs{stroke:#a4aaa5;stroke-width:1}
.tc-lot-line{stroke:#d9b84a;stroke-opacity:.55;stroke-width:1.4;stroke-dasharray:14 10}
.tc-shadow{fill:#000;opacity:.32}
.tc-tag{fill:#4b5560;font-size:8.5px;font-weight:800;letter-spacing:.08em}
.tc-tag-under{fill:#6b7883;text-anchor:end}
.tc-box-ribs{stroke:#c9c5bb;stroke-width:1.2}
.tc-box-rail{fill:#b9b5ab}
.tc-tape-w{stroke:#f8fafc;stroke-width:2.4}
.tc-tape-r{stroke:#dc2626;stroke-width:2.4;stroke-dasharray:8 8}
.tc-post{fill:#a9a59b}
.tc-floor{fill:#2a2f33}
.tc-nose-box{fill:#3a4148;stroke:#1f2428;stroke-width:.8}
.tc-gear-brace{stroke:#3a4046;stroke-width:2.4;stroke-linecap:round}
.tc-gear-outer{fill:#4b545b;stroke:#22282d;stroke-width:.8}
.tc-gear-inner{fill:#6c767d;stroke:#22282d;stroke-width:.8}
.tc-gear-pad{fill:#3b4349;stroke:#1d2226;stroke-width:.8}
.tc-gear-crank{fill:none;stroke:#2c3237;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.tc-gear-foot{transform:translateY(0)}
.tc-stage:not([data-phase="start"]) .tc-gear-foot{transform:translateY(-4px)}
.tc-clear{opacity:0}
.tc-stage:not([data-phase="start"]) .tc-clear{opacity:1}
.tc-clear-lead{stroke:#1f2933;stroke-width:1;fill:none}
.tc-clear-t{fill:#1b232b;font-size:8px;font-weight:800;letter-spacing:.03em}
.tc-susp{fill:#2a3035}
.tc-brake-hub{fill:var(--tc-bad);filter:drop-shadow(0 0 2.5px rgb(239 68 68/.9))}
.tc-brk rect{fill:#b91c1c;stroke:#fecaca;stroke-width:.8}
.tc-brk-lock{fill:none;stroke:#fff;stroke-width:1.3;stroke-linejoin:round}
.tc-brk text{fill:#fff;font-size:9px;font-weight:800;letter-spacing:.04em;text-anchor:middle}
.tc-resist{opacity:0}
.tc-stage:not([data-phase="start"]) .tc-resist{opacity:1}
.tc-resist rect{fill:#14532d;stroke:#86efac;stroke-width:.8}
.tc-resist-tick{fill:none;stroke:#86efac;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tc-resist text{fill:#ecfdf3;font-size:9px;font-weight:800;letter-spacing:.04em;text-anchor:middle}

.tc-frame{fill:#1c2024}
.tc-fw-side{fill:#59636c;stroke:#1f252a;stroke-width:.8}
.tc-fw-mount{fill:#2b3237}
.tc-air-blue{fill:none;stroke:#3b82f6;stroke-width:2;stroke-linecap:round}
.tc-air-red{fill:none;stroke:#ef4444;stroke-width:2;stroke-linecap:round}
.tc-cab-shine{stroke:#9cc3e6;stroke-opacity:.6;stroke-width:1.2;stroke-linecap:round}
.tc-door{fill:none;stroke:#10253a;stroke-opacity:.7;stroke-width:1}
.tc-handle-door{fill:#d4dadc}
.tc-mirror{fill:none;stroke:#1d2226;stroke-width:2.4;stroke-linecap:round}
.tc-headlight{fill:#fff4c9}
.tc-tank-band{stroke:#59646a;stroke-width:1.4}
.tc-fender{fill:none;stroke:#1c2024;stroke-width:3;stroke-linecap:round}
.tc-mudflap{fill:#16191c}
.tc-hubs{fill:#39424a}
.tc-puff{fill:#8e979c;opacity:0}
.tc-strain{opacity:0}
.tc-strain path{fill:none;stroke:#ffb400;stroke-width:1.8;stroke-linecap:round}
.tc-pull{opacity:0}
.tc-stage[data-phase="tugged"] .tc-pull,.tc-stage.is-tugging .tc-pull{opacity:1}
.tc-pull-arrow{fill:none;stroke:#0e7ab8;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.tc-pull-t{fill:#0b5c8c;font-size:8.5px;font-weight:800;letter-spacing:.04em;text-anchor:middle}
.tc-zoom{fill:none;stroke:var(--tc-warn);stroke-width:1.6;stroke-dasharray:3 2.5}
.tc-zoom-chev{fill:none;stroke:var(--tc-warn);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.tc-divider{fill:#05070a}

/* the tug: the tractor leans 6px forward against the locked trailer brakes and springs back */
.tc-stage.is-tugging .tc-tractor{animation:tc-tug 1.4s cubic-bezier(.4,0,.3,1)}
.tc-stage.is-tugging .tc-trailer{animation:tc-hold 1.4s ease-in-out}
.tc-stage.is-tugging .tc-strain{animation:tc-strain 1.4s ease-in-out}
@keyframes tc-tug{0%{transform:translateX(0)}30%{transform:translateX(-6px)}45%{transform:translateX(-4.5px)}62%{transform:translateX(-6px)}100%{transform:translateX(0)}}
@keyframes tc-hold{0%,100%{transform:translateX(0)}30%,62%{transform:translateX(-.8px)}}
@keyframes tc-strain{0%,100%{opacity:0}25%,68%{opacity:1}}
/* engine running: exhaust puffs until the engine is shut off in Step 12 */
.tc-stage.is-live[data-phase="start"] .tc-puff,.tc-stage.is-live[data-phase="tugged"] .tc-puff{animation:tc-puff 1.6s ease-out infinite}
.tc-stage.is-live .tc-puff-2{animation-delay:.8s}
.tc-stage.is-tugging .tc-puff{animation-duration:.7s}
@keyframes tc-puff{0%{opacity:.55;transform:translate(0,0) scale(.8)}100%{opacity:0;transform:translate(4px,-10px) scale(1.8)}}
.tc-puff{transform-box:fill-box;transform-origin:center}

/* close-up under the trailer */
.tc-trailer-under{fill:#12171c}
.tc-xmember{fill:#1f262d}
.tc-plate-edge{stroke:#ffffff;stroke-opacity:.5;stroke-width:.8}
.tc-bolts{fill:#6f7a80;stroke:#3b444a;stroke-width:.6}
.tc-plate-t{fill:#1f2a33;font-size:9.5px;font-weight:800;letter-spacing:.04em;text-anchor:middle}
.tc-pin-flange{fill:#8a5a12}
.tc-pin-shank,.tc-pin-head{stroke:#2a1a04;stroke-width:1}
.tc-throat{fill:#05070a}
.tc-bracket{fill:#1b2127;stroke:#2d363e;stroke-width:.8}
.tc-rail{fill:#151b21;stroke:#2a333b;stroke-width:.8}
.tc-lower-plate{stroke:#6b7780;stroke-width:1}
.tc-lower-top{stroke:#a3afb8;stroke-width:1}
.tc-lube{stroke:#ffffff;stroke-opacity:.13;stroke-width:1.6;stroke-linecap:round}
.tc-lower-t{fill:#c7d1d8;font-size:9px;font-weight:800;letter-spacing:.05em;text-anchor:middle}
.tc-jaw rect{stroke:#0f172a;stroke-width:1.2}
.tc-jaw-line{stroke:#3b444b;stroke-width:1.2;stroke-linecap:round}
.tc-rod,.tc-grip{stroke:#0f172a;stroke-width:.9}
.tc-spring{fill:none;stroke:#cbd5e1;stroke-width:.9;stroke-linejoin:round}
.tc-latch-body{fill:#b8c1c7;stroke:#0f172a;stroke-width:1}
.tc-latch-pin{fill:#39424a}
.tc-latch{transform-box:view-box;transform-origin:294px 210px}
.tc-stage[data-scenario="b"] .tc-spring{opacity:0}

/* Scenario B, the false lock: everything lifted, jaws closed under the kingpin head, lever out, latch open */
.tc-upper,.tc-jaw,.tc-lever,.tc-latch{transform:none}
.tc-stage[data-scenario="b"] .tc-upper{transform:translateY(-31px)}
.tc-stage[data-scenario="b"] .tc-jaw-l{transform:translateX(9px)}
.tc-stage[data-scenario="b"] .tc-jaw-r{transform:translateX(-9px)}
.tc-stage[data-scenario="b"] .tc-lever{transform:translateX(18px)}
.tc-stage[data-scenario="b"] .tc-latch{transform:rotate(-100deg)}

/* the dark and the light */
.tc-dark{fill:#010203;opacity:.975}
.tc-dark-hint{opacity:1}
.tc-dark-t{fill:#9aa6af;font-size:12px;font-weight:800;text-anchor:middle}
.tc-dark-s{fill:#6f7b84;font-size:10px;font-weight:700;text-anchor:middle}
.tc-beam{opacity:0;mix-blend-mode:screen;transform-box:view-box;transform-origin:36px 270px;transform:rotate(-34deg)}
.tc-torch-body{fill:#2b3237;stroke:#4a545b;stroke-width:.8}
.tc-torch-grip{stroke:#4a545b;stroke-width:1}
.tc-torch-head{fill:#3a4249;stroke:#59646b;stroke-width:.8}
.tc-torch-lens{fill:#545d63}
.tc-stage[data-phase="lit"] .tc-dark{opacity:.22}
.tc-stage[data-phase="lit"] .tc-dark-hint{opacity:0}
.tc-stage[data-phase="lit"] .tc-beam{opacity:1;transform:rotate(0)}
.tc-stage[data-phase="lit"] .tc-torch-lens{fill:#fff1c7;filter:drop-shadow(0 0 4px #ffd58a)}
.tc-stage[data-phase="secured"] .tc-torch-lens{fill:#8a7a52}

/* what each Step 13 check shows */
.tc-seam,.tc-gapfill{opacity:0}
.tc-seam{fill:none;stroke:var(--tc-ok);stroke-width:2.6;stroke-linecap:round;filter:drop-shadow(0 0 3px rgb(49 214 123/.9))}
.tc-stage[data-scenario="a"][data-check-plates] .tc-seam{opacity:1}
.tc-stage[data-scenario="b"][data-check-plates] .tc-gapfill{opacity:1}
.tc-stage[data-scenario="a"][data-check-jaws] .tc-jaw rect{stroke:var(--tc-ok);stroke-width:2;filter:drop-shadow(0 0 3px rgb(49 214 123/.9))}
.tc-stage[data-scenario="b"][data-check-jaws] .tc-jaw rect,.tc-stage[data-scenario="b"][data-check-jaws] .tc-pin-head{stroke:var(--tc-bad);stroke-width:2;filter:drop-shadow(0 0 3px rgb(239 68 68/.9))}
.tc-stage[data-scenario="a"][data-check-lever] :is(.tc-rod,.tc-grip){stroke:var(--tc-ok);stroke-width:1.6;filter:drop-shadow(0 0 3px rgb(49 214 123/.9))}
.tc-stage[data-scenario="b"][data-check-lever] :is(.tc-rod,.tc-grip){stroke:var(--tc-bad);stroke-width:1.6;filter:drop-shadow(0 0 3px rgb(239 68 68/.9))}
.tc-stage[data-scenario="a"][data-check-latch] .tc-latch-body{stroke:var(--tc-ok);stroke-width:1.8;filter:drop-shadow(0 0 3px rgb(49 214 123/.9))}
.tc-stage[data-scenario="b"][data-check-latch] .tc-latch-body{stroke:var(--tc-bad);stroke-width:1.8;filter:drop-shadow(0 0 3px rgb(239 68 68/.9))}
.tc-warn,.tc-okpill{opacity:0}
.tc-stage[data-caught="true"] .tc-warn{opacity:1}
.tc-stage[data-verified="true"] .tc-okpill{opacity:1}
.tc-warn rect{fill:#991b1b;stroke:#fecaca;stroke-width:1.6;filter:drop-shadow(0 2px 6px rgb(0 0 0/.6))}
.tc-okpill rect{fill:#14532d;stroke:#86efac;stroke-width:1.6;filter:drop-shadow(0 2px 6px rgb(0 0 0/.6))}
.tc-pill-a{fill:#fff;font-size:12px;font-weight:900;letter-spacing:.05em;text-anchor:middle}
.tc-pill-b{font-size:9px;font-weight:700;text-anchor:middle}
.tc-warn .tc-pill-b{fill:#fee2e2}
.tc-okpill .tc-pill-b{fill:#dcfce7}

/* without the script: the lit close-up of a proper lock */
.tc-stage.is-static .tc-dark,.tc-stage.is-static .tc-dark-hint{opacity:0}

/* transitions once the simulator is live */
.tc-stage.is-live :is(.tc-gear-foot,.tc-clear,.tc-resist,.tc-pull){transition:transform .6s cubic-bezier(.3,1.2,.5,1),opacity .4s}
.tc-stage.is-live :is(.tc-upper,.tc-jaw,.tc-lever,.tc-latch){transition:transform .5s cubic-bezier(.3,1.2,.5,1)}
.tc-stage.is-live .tc-dark{transition:opacity .9s ease .15s}
.tc-stage.is-live .tc-dark-hint{transition:opacity .3s}
.tc-stage.is-live .tc-beam{transition:transform .9s cubic-bezier(.25,1.1,.4,1),opacity .5s}
.tc-stage.is-live :is(.tc-seam,.tc-gapfill,.tc-warn,.tc-okpill){transition:opacity .35s}
.tc-stage[data-caught="true"].is-live .tc-warn rect{animation:tc-alarm 1.1s ease-in-out 2}
@keyframes tc-alarm{50%{fill:#dc2626}}

/* controls: one dark console */
.tc-ask{margin:0;color:var(--ink);font-size:20px;line-height:1.25}
.tc-ask b{font-weight:800}
.tc-ask[hidden],.tc-controls[hidden],.tc-checks[hidden]{display:none}
.tc-controls{display:grid;gap:12px;padding:14px;border-radius:16px;background:linear-gradient(180deg,#1c252c,var(--tc-console));box-shadow:0 18px 40px -28px rgb(0 0 0/.8),inset 0 1px 0 rgb(255 255 255/.07);color:#e6edf1}
.tc-scens{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:4px;border-radius:12px;background:#070a0c;box-shadow:inset 0 0 0 1px rgb(255 255 255/.08)}
.tc-scen{min-height:48px;padding:8px 10px;border:0;border-radius:9px;background:transparent;color:#a9b5bd;font-size:14px;font-weight:800;line-height:1.2;cursor:pointer;transition:background .15s,color .15s,box-shadow .15s}
.tc-scen:hover{color:#fff}
.tc-scen[aria-pressed="true"]{background:linear-gradient(180deg,#2e3a43,#1d262d);color:#fff;box-shadow:inset 0 0 0 1.5px var(--sbp-amber,#ffb400),0 2px 6px -2px rgb(0 0 0/.7)}
.tc-steps{display:grid;gap:8px}
.tc-btn{position:relative;display:flex;align-items:center;gap:12px;width:100%;min-height:62px;padding:10px 12px;border:0;border-radius:12px;background:linear-gradient(180deg,#26313a,#182027);box-shadow:inset 0 1px 0 rgb(255 255 255/.09),0 3px 0 #05080a,0 8px 16px -10px rgb(0 0 0/.7);color:#fff;font-size:15.5px;font-weight:700;line-height:1.2;text-align:left;cursor:pointer;transition:transform .08s,box-shadow .12s,background .12s,opacity .15s}
.tc-btn:hover{background:linear-gradient(180deg,#2d3943,#1c252d)}
.tc-btn:active{transform:translateY(2px);box-shadow:inset 0 1px 0 rgb(255 255 255/.06),0 1px 0 #05080a}
.tc-btn[data-state="next"]{box-shadow:inset 0 0 0 2px var(--sbp-amber,#ffb400),0 3px 0 #05080a,0 0 18px -4px rgb(255 180 0/.55)}
.tc-btn[data-state="todo"]{opacity:.72}
.tc-btn[data-state="done"]{background:linear-gradient(180deg,#1b3227,#13221b)}
.tc-name{display:grid;gap:3px;min-width:0;flex:1}
.tc-name small{color:#9fb0ba;font-size:13px;font-weight:600}
.tc-icon{flex:none;width:40px;height:28px}
.tc-icon-truck{fill:#7fb2de}
.tc-icon-wheel{fill:#0b0f12;stroke:#c9d2d8;stroke-width:1.2}
.tc-icon-arrow,.tc-icon-ground{fill:none;stroke:#c9d2d8;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tc-icon-ring{fill:none;stroke:#ffd27a;stroke-width:2.6}
.tc-icon-key{fill:none;stroke:#ffd27a;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.tc-icon-beam{fill:#ffe2a8;opacity:.55}
.tc-icon-torch{fill:#c9d2d8}
.tc-done{flex:none;width:22px;height:22px;border-radius:50%;box-shadow:inset 0 0 0 1.5px #3c4952}
.tc-btn[data-state="done"] .tc-done{background:var(--tc-ok);box-shadow:none}
.tc-btn[data-state="done"] .tc-done::after{content:"";display:block;width:6px;height:11px;margin:3px 0 0 8px;border:solid #06240f;border-width:0 2.5px 2.5px 0;transform:rotate(45deg)}
.tc-checks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:10px;border-radius:12px;background:radial-gradient(120% 90% at 0% 100%,rgb(255 214 140/.16),transparent 70%),#0a0e11;box-shadow:inset 0 0 0 1px rgb(255 214 140/.28)}
.tc-check{display:grid;gap:3px;min-height:56px;padding:9px 11px;border:0;border-radius:10px;background:#1a2229;box-shadow:inset 0 0 0 1px rgb(255 255 255/.1);color:#fff;font-size:15px;font-weight:800;line-height:1.15;text-align:left;cursor:pointer;transition:background .15s,box-shadow .15s}
.tc-check small{color:#a8b5bd;font-size:12.5px;font-weight:700}
.tc-check:hover{background:#212b33}
.tc-check[data-result="ok"]{background:#123222;box-shadow:inset 0 0 0 2px var(--tc-ok)}
.tc-check[data-result="ok"] small{color:#86efac}
.tc-check[data-result="bad"]{background:#3a1212;box-shadow:inset 0 0 0 2px var(--tc-bad)}
.tc-check[data-result="bad"] small{color:#fca5a5}
.tc-reset{justify-self:start;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:8px 14px 8px 12px;border:0;border-radius:999px;background:#070a0c;box-shadow:inset 0 0 0 1px rgb(255 255 255/.14);color:#dbe3e8;font-size:15px;font-weight:700;cursor:pointer}
.tc-reset:hover{box-shadow:inset 0 0 0 1px rgb(255 255 255/.32)}
.tc-reset-icon{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.tc-scen:focus-visible,.tc-btn:focus-visible,.tc-check:focus-visible,.tc-reset:focus-visible{outline:3px solid var(--sbp-amber,#ffb400);outline-offset:3px}
.tc-status{display:block;min-height:7.3em;padding:12px 14px 12px 16px;border-left:5px solid #94a3b8;border-radius:0 10px 10px 0;background:var(--white,#fffffc);color:var(--ink);font-size:16px;font-weight:600;line-height:1.45;transition:border-color .2s,background .2s}
.tc-status[data-tone="ok"]{border-left-color:#1f9d55}
.tc-status[data-tone="refuse"]{border-left-color:#d97706;background:#fff7e6}
.tc-status[data-tone="bad"]{border-left-color:#dc2626;background:#fff1f1}

@media (prefers-reduced-motion:reduce){
  .tc-stage *,.tc-stage *::before,.tc-stage *::after{animation:none!important;transition:none!important}
}
@media (min-width:761px){
  .tc-page .sbp-film-frame.is-wide{aspect-ratio:auto;padding-bottom:58px;background:#0b0d0f}
  .tc-page .sbp-film-frame.is-wide video{aspect-ratio:16/9;width:100%;height:auto}
  .tc-page .sbp-film-frame.is-wide .sbp-play{bottom:58px}
  .tc-page .sbp-film-frame.is-wide .sbp-sound-on{left:12px;right:auto;top:auto;bottom:10px}
  .tc-page .sbp-film-frame.is-wide .sbp-pause{right:12px;top:auto;bottom:10px}
}
@media (max-width:900px){
  .tc-demo-grid{grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "stage" "panel";gap:16px}
}
@media (max-width:760px){
  .tc-demo{padding-block:36px 44px}
  .tc-stage{margin-inline:-8px;padding:8px 6px 6px;border-radius:14px}
  .tc-svg{border-radius:8px}
  .tc-hud{gap:4px;padding:0 0 8px;flex-wrap:nowrap}
  .tc-lamp{padding:5px 6px 5px 5px;gap:4px}
  .tc-lamp span{font-size:9.5px;letter-spacing:0}
  .tc-lamp i{width:8px;height:8px}
  .tc-panel{gap:10px}
  .tc-ask{font-size:18px}
  .tc-scen{font-size:13px;padding:8px 6px}
  .tc-btn{font-size:15px;min-height:58px}
}
