/* Photo-informed rolling stock, isolated from map geometry and train controls.
   Full-length cars slide past the platform; the editor fits one side elevation. */
.platform-scene .platform-train{left:auto;right:3%;width:max-content;gap:7px}
:is(.platform-scene,.stock-preview) .stock-car{
 --metal:#c1cbcd;--car-length:60;--door-time:.45s;position:relative;
 flex:0 0 calc(var(--car-length) * 3.6px);width:calc(var(--car-length) * 3.6px);
 min-width:0;height:49px;padding:0;border:0;border-top:3px solid #ced8d8;
 border-bottom:2px solid #6b7c85;border-radius:5px 5px 1px 1px;
 background:linear-gradient(100deg,#8399a3 0%,#dfe5e2 16%,#a8b9c0 22%,#d8dfdc 70%,#9cacb3 100%);
 box-shadow:inset 0 1px #eef0e7,0 4px 3px #071018;
}
:is(.platform-scene,.stock-preview) .stock-car:after{height:1px;left:1%;right:1%;bottom:6px;background:#728995;box-shadow:0 2px #d9e3e4;pointer-events:none}
:is(.platform-scene,.stock-preview) .stock-car .car-window{position:absolute;top:calc(var(--window-top) * 1.15);height:calc(var(--window-height) * 1.15);min-width:0;margin:0;flex:none;border:1px solid #586d77;border-radius:2px;background:linear-gradient(122deg,#183341 0 33%,#65808b 34% 38%,#243f4a 39% 68%,#172f3b 69%);box-shadow:0 0 0 1px #d7dfdf,inset 0 1px 1px #0c1b24}
:is(.platform-scene,.stock-preview) .stock-car .car-window em{height:5px;left:18%;width:12%;box-shadow:7px 0 #20303b,13px 0 #1b303d;opacity:.8}
:is(.platform-scene,.stock-preview) .stock-car .car-door{position:absolute;top:4px;bottom:1px;height:auto;min-width:0;flex:none;margin:0;border:1px solid #687b86;border-top:1px solid #b0bfc4;border-radius:2px 2px 0 0;background:#152736;box-shadow:0 0 0 1px #e0e6e4;gap:0;z-index:2}
:is(.platform-scene,.stock-preview) .stock-car .car-door b{flex:0 0 50%;width:50%;height:100%;border:0;border-right:1px solid #647986;background:linear-gradient(93deg,#afbec4,#d7dfdd 52%,#9dafb9);transition:transform var(--door-time) ease-in-out;box-sizing:border-box}
:is(.platform-scene,.stock-preview) .stock-car .car-door b:after{top:4px;left:20%;right:20%;height:14px;border:1px solid #61737d;border-radius:4px;background:linear-gradient(115deg,#263f4c,#63828d 50%,#213846 52%)}
:is(.platform-scene,.stock-preview) .stock-car .car-door u{display:none}
:is(.platform-scene,.stock-preview) .stock-car .car-roof{left:2%;right:2%;top:-6px;height:4px;border-radius:5px 5px 0 0;background:repeating-linear-gradient(0deg,#92a4aa 0 1px,#becbce 1px 2px);border-top:1px solid #dae1dd}
:is(.platform-scene,.stock-preview) .stock-car .car-roof i{height:2px;top:-1px;width:19%;background:#879ba2;border-top:1px solid #b3c4c8}
:is(.platform-scene,.stock-preview) .stock-car .car-cab{right:-2px;top:-3px;bottom:0;width:5%;border:0;border-left:1px solid #748994;border-radius:0 5px 0 0;background:linear-gradient(90deg,#b8c6c9,#e0e7e3);z-index:3}
:is(.platform-scene,.stock-preview) .stock-car:not(.lead-car) .car-cab{display:none}
:is(.platform-scene,.stock-preview) .stock-car .car-cab i{left:19%;right:15%;top:9px;height:16px;border-radius:2px 3px 1px 1px;border:1px solid #526873;background:linear-gradient(125deg,#213b49,#5d808d 48%,#1a3340 50%)}
:is(.platform-scene,.stock-preview) .stock-car .car-lamp{z-index:4;right:-1px;bottom:5px;width:2px;height:2px;border-radius:50%;background:#fff5d1;box-shadow:0 -5px #3b575c,0 0 3px #ffeac4}
:is(.platform-scene,.stock-preview) .stock-car .car-number{top:2px;right:9%;font:4px monospace;line-height:5px;color:#e1e6e4;background:#364952;padding:0 1px;z-index:3}
:is(.platform-scene,.stock-preview) .stock-car .car-side-sign{left:20%;top:2px;width:7%;height:3px;border:1px solid #748891;background:repeating-linear-gradient(90deg,#d6b16e 0 1px,#24343e 1px 2px);z-index:2}
.car-roundel{position:absolute;right:3%;top:28px;width:4px;height:4px;border-radius:50%;background:#3e7599;z-index:3}
.car-flag{position:absolute;left:3%;top:3px;width:6px;height:4px;background:repeating-linear-gradient(#b86667 0 1px,#e4e8de 1px 2px)}
.car-flag:before{content:'';position:absolute;top:0;left:0;width:2px;height:2px;background:#375372}
:is(.platform-scene,.stock-preview) .stock-car .car-underfloor{height:8px;left:34%;width:30%;bottom:-10px;background:repeating-linear-gradient(90deg,#223741 0 8px,#455c65 8px 9px);border-bottom:2px solid #0a1823}
:is(.platform-scene,.stock-preview) .stock-car .car-bogie{width:24px;height:6px;bottom:-8px;border-radius:1px;background:linear-gradient(#526771 0 30%,#1d303b 31%);border:1px solid #697b81;box-shadow:0 2px #0c1a24}
:is(.platform-scene,.stock-preview) .stock-car .car-bogie.left{left:12%}
:is(.platform-scene,.stock-preview) .stock-car .car-bogie.right{right:12%}
:is(.platform-scene,.stock-preview) .stock-car .wheel{width:7px;height:7px;bottom:-11px;background:#152731;border:1px solid #74868a;box-shadow:13px 0 #152731,13px 0 0 1px #74868a}
:is(.platform-scene,.stock-preview) .stock-car .wheel.left{left:calc(12% + 1px)}
:is(.platform-scene,.stock-preview) .stock-car .wheel.right{right:calc(12% + 15px)}
/* The older 75-foot smooth-sided fleet differs from the corrugated R62/R68. */
:is(.platform-scene,.stock-preview) [data-model=R44].stock-car{background:linear-gradient(#b9c4c2 0 64%,#b0bfbe 64% 82%,#91a3a7 82%);border-radius:7px 7px 1px 1px}
:is(.platform-scene,.stock-preview) [data-model=R44] .car-window{border-radius:1px;border-top:3px solid #9badb0}
:is(.platform-scene,.stock-preview) [data-model=R44] .car-side-sign{background:#284457;border:1px solid #d3dfdb}
:is(.platform-scene,.stock-preview) [data-model=R46].stock-car{background:linear-gradient(#c5cec9 0 63%,#a4b5b8 64% 81%,#bac8c9 82%);border-radius:7px 7px 1px 1px}
:is(.platform-scene,.stock-preview) [data-model=R46] .car-window{border-radius:4px}
:is(.platform-scene,.stock-preview) [data-model=R46] .car-side-sign{top:10px;left:67%;width:7%;height:4px;background:repeating-linear-gradient(90deg,#d5c69a 0 1px,#203137 1px 2px)}
:is(.platform-scene,.stock-preview) [data-cab=ribbed].stock-car{background:linear-gradient(#bfc8ca 0 62%,transparent 62%),repeating-linear-gradient(0deg,#9eafb7 0 1px,#cbd5d7 1px 2px);border-radius:6px 6px 1px 1px}
:is(.platform-scene,.stock-preview) [data-cab=ribbed] .car-window{border-radius:4px}
:is(.platform-scene,.stock-preview) [data-cab=ribbed] .car-roof{background:repeating-linear-gradient(0deg,#91a1a7 0 1px,#cad4d4 1px 2px);height:5px}
:is(.platform-scene,.stock-preview) [data-cab=ribbed] .car-roof i{display:none}
:is(.platform-scene,.stock-preview) [data-cab=ribbed] .car-cab{border-radius:0 6px 2px 0;background:linear-gradient(#b8c6c9 0 68%,#7f959f 68% 71%,#c2cbcc 72%)}
:is(.platform-scene,.stock-preview) [data-model=R68] .car-side-sign{left:21%;top:9px;width:7%;height:5px;background:#d5d5c5;border-color:#61777f}
/* IRT New Technology cabs have red lower corner panels, never purple. */
:is(.platform-scene,.stock-preview) [data-cab^=irt] .car-cab{width:6%;border-bottom:0;background:linear-gradient(#152b35 0 64%,#9b4147 64% 88%,#c2ced0 88%)}
:is(.platform-scene,.stock-preview) [data-cab^=irt] .car-cab i{height:15px;top:8px}
:is(.platform-scene,.stock-preview) [data-model=R142] .car-window{border-radius:3px;border-top:3px solid #91a6ad}
:is(.platform-scene,.stock-preview) [data-model=R188] .car-window{border-radius:2px}
:is(.platform-scene,.stock-preview) [data-model=R188] .car-roof i{height:3px;top:-2px}
/* R143 / R160 / R179 share a real family likeness; trim, windows and cab differ. */
:is(.platform-scene,.stock-preview) [data-cab^=ntt] .car-cab{background:linear-gradient(#152832 0 83%,#c0ced0 84%);border-left:2px solid #c3d0d1;width:5%}
:is(.platform-scene,.stock-preview) [data-model=R143] .car-window{border-radius:3px 3px 2px 2px}
:is(.platform-scene,.stock-preview) [data-model=R143] .car-side-sign{background:#dcd6a9}
:is(.platform-scene,.stock-preview) [data-model=R160] .car-door b:after{border-radius:5px}
:is(.platform-scene,.stock-preview) [data-model=R179] .car-window{border-radius:4px;box-shadow:0 0 0 1px #edf0e8}
:is(.platform-scene,.stock-preview) [data-model=R179] .car-cab{border-top:2px solid #d6e0df}
/* The R211 side graphics, narrow windows and 58-inch door pairs are characteristic. */
:is(.platform-scene,.stock-preview) [data-cab=r211].stock-car{border-top:3px solid #adbfc7;background:linear-gradient(100deg,#92acb9,#d7e1e3 36%,#a0b5c3 62%,#becdd4)}
:is(.platform-scene,.stock-preview) [data-cab=r211].stock-car:before{content:'';position:absolute;right:0;top:0;width:21%;height:100%;background:#235f9c;clip-path:polygon(52% 0,100% 0,100% 100%,0 100%);opacity:.9}
:is(.platform-scene,.stock-preview) [data-cab=r211] .car-cab{width:5%;border:0;border-left:1px solid #a4bccb;background:linear-gradient(90deg,#24629b,#17416d);border-radius:0 5px 1px 1px}
:is(.platform-scene,.stock-preview) [data-cab=r211] .car-window{border-radius:3px;box-shadow:0 0 0 1px #dce3e3}
:is(.platform-scene,.stock-preview) [data-cab=r211] .car-door{border-radius:2px 2px 0 0;border-top:1px solid #a6cabc}
:is(.platform-scene,.stock-preview) [data-cab=r211] .car-door b:after{height:18px;top:3px;border-radius:5px;left:23%;right:23%}
:is(.platform-scene,.stock-preview) [data-cab=r211] .car-door u{display:block;left:0;right:0;top:0;height:2px;background:#718b81}
.platform-scene[data-doors=open] [data-cab=r211] .car-door u{background:#87ef9c;box-shadow:0 0 3px #79ff9b}
.platform-scene[data-phase=doors-closing] [data-cab=r211] .car-door u{background:#f0ae54;box-shadow:0 0 3px #f8b66a}
:is(.platform-scene,.stock-preview) [data-cab=r211] .car-lamp{height:6px;transform:rotate(-22deg);box-shadow:0 0 2px #eaf7ef}
:is(.platform-scene,.stock-preview) [data-model=R211T] .car-gangway{width:8px;right:-9px;top:1px;bottom:1px;border:1px solid #607781;background:repeating-linear-gradient(90deg,#172932 0 1px,#667982 1px 2px);border-radius:2px}
:is(.platform-scene,.stock-preview) [data-model=R211S] .car-number{background:#e4e8df;color:#273e4c}
/* JFK Mk II: two door pairs, broad windows, white nose and the blue side wordmark. */
:is(.platform-scene,.stock-preview) [data-model=INNOVIA].stock-car{height:50px;border-radius:6px 12px 4px 3px;background:linear-gradient(#e2e7de 0 67%,#b3c7cf 68% 72%,#d9e1de 73%);border-top-color:#c4d1d0}
:is(.platform-scene,.stock-preview) [data-model=INNOVIA] .car-window{border-radius:3px;background:linear-gradient(105deg,#65858b,#b0bdaf 39%,#527582 41%);border-color:#596f76}
:is(.platform-scene,.stock-preview) [data-model=INNOVIA] .car-door b:after{height:20px;top:2px;left:14%;right:14%;border-radius:3px;background:#6e8f96}
:is(.platform-scene,.stock-preview) [data-model=INNOVIA] .car-cab{width:6%;border:0;border-left:1px solid #b9c9c8;border-radius:0 13px 3px 0;background:#d0dfdc}
:is(.platform-scene,.stock-preview) [data-model=INNOVIA] .car-cab i{height:23px;top:3px;left:8%;right:7%;border-radius:1px 8px 5px 1px}
:is(.platform-scene,.stock-preview) [data-model=INNOVIA] .car-side-sign{left:37%;top:29px;width:26%;height:5px;border:0;background:transparent;color:#326d8b;font:4px Arial;letter-spacing:1px;text-align:center}
:is(.platform-scene,.stock-preview) [data-model=INNOVIA] .car-roundel{display:none}
:is(.platform-scene,.stock-preview) [data-model=INNOVIA] .car-number{top:29px;right:11%;background:transparent;color:#44606b}
/* An explicitly fictional train keeps its own concept styling. */
:is(.platform-scene,.stock-preview) [data-model=R218].stock-car{background:linear-gradient(#426877,#173848);border-top-color:#76d4d0;border-radius:7px 12px 3px 3px}
:is(.platform-scene,.stock-preview) [data-model=R218] .car-window{background:linear-gradient(120deg,#1d4354,#5e9baf);border-color:#5db9c8;box-shadow:none}
:is(.platform-scene,.stock-preview) [data-model=R218] .car-cab{background:#295768;border-radius:0 12px 3px 0;border-color:#7de5d9}
:is(.platform-scene,.stock-preview) [data-model=R218] .car-door b{background:linear-gradient(90deg,#244c60,#3b798b)}
:is(.platform-scene,.stock-preview) [data-model=R218] .car-number{color:#a8f3de;background:#1a3c4b}
/* Responsive overview: detailed cab and a true single-car elevation. */
.stock-preview{height:145px;container-type:inline-size}
.stock-preview .platform-train{left:8px;right:105px;top:36px;width:auto;gap:0}
.stock-preview .stock-car{flex:1 1 auto;width:auto}
.stock-preview .stock-face{width:98px;height:125px;right:4px;top:8px;shape-rendering:geometricPrecision}
.stock-preview .car-gangway{left:-7px;right:auto}
.stock-preview .stock-face .cab-headlight{filter:drop-shadow(0 0 1px #fff8da)}
@container (max-width: 260px){.stock-preview .platform-train{right:82px;top:36px}.stock-preview .stock-face{width:78px;height:110px;top:14px}}
@media(prefers-reduced-motion:reduce){.stock-car,.stock-car *{animation:none!important;transition:none!important}}
/* The status lamp follows the two door leaves in the DOM. Target leaves by type. */
.platform-scene[data-doors=open] .stock-car .car-door b:nth-of-type(1){transform:translateX(-92%)}
.platform-scene[data-doors=open] .stock-car .car-door b:nth-of-type(2){transform:translateX(92%)}
.stock-preview .stock-car{transform:none}


/* Distinct side elevations for the four legacy models; door animation stays shared. */
:is(.platform-scene,.stock-preview) [data-model=R44].stock-car{background:linear-gradient(#d1d6cf 0 63%,#a7b8b7 64% 82%,#c4cfca 83%);border-top:4px solid #b4c0bd;border-radius:3px 3px 0 0}
:is(.platform-scene,.stock-preview) [data-model=R44] .car-cab{border-radius:0 2px 0 0;background:#cbd3c9;border-left:2px solid #8d9f9e}
:is(.platform-scene,.stock-preview) [data-model=R44] .car-door b{background:linear-gradient(90deg,#abb9b6,#dce1d6)}
:is(.platform-scene,.stock-preview) [data-model=R44] .car-door b:after{border-radius:1px;height:18px}
:is(.platform-scene,.stock-preview) [data-model=R46].stock-car{background:linear-gradient(#c8d0cb 0 21%,#8b9fa6 22% 59%,#d3dbd8 60% 78%,#a2b3b8 79%);border-radius:8px 8px 1px 1px}
:is(.platform-scene,.stock-preview) [data-model=R46] .car-window{border:2px solid #d5dddb;border-radius:5px}
:is(.platform-scene,.stock-preview) [data-model=R46] .car-cab{width:5.5%;border-radius:0 8px 1px 0;background:#aebfc3}
:is(.platform-scene,.stock-preview) [data-model=R62A].stock-car{background:linear-gradient(#d2d8d4 0 58%,transparent 59%),repeating-linear-gradient(0deg,#91a3ab 0 1px,#d7ddda 1px 3px);border-top:4px solid #a9b6b8}
:is(.platform-scene,.stock-preview) [data-model=R62A] .car-door b{background:linear-gradient(90deg,#a6aaa0,#dad9c9 55%,#9daaa6)}
:is(.platform-scene,.stock-preview) [data-model=R62A] .car-cab{width:6%;border-radius:0 7px 2px 0}
:is(.platform-scene,.stock-preview) [data-model=R62A] .car-side-sign{top:4px;left:29%;width:8%;height:6px;background:#e1dfc6;border:2px solid #647983}
:is(.platform-scene,.stock-preview) [data-model=R68].stock-car{background:linear-gradient(#acbbc2 0 60%,transparent 61%),repeating-linear-gradient(0deg,#758c99 0 1px,#c5d1d5 1px 2px);border-top:4px solid #8499a4;border-radius:7px 7px 1px 1px}
:is(.platform-scene,.stock-preview) [data-model=R68] .car-window{border:2px solid #e2e6df;border-radius:5px;box-shadow:0 0 0 1px #506875}
:is(.platform-scene,.stock-preview) [data-model=R68] .car-cab{background:linear-gradient(#bac7ce 0 65%,#788e99 66% 70%,#c3ced1 71%);border-left:2px solid #e0e4de}
:is(.platform-scene,.stock-preview) [data-model=R68] .car-roof{height:6px;top:-8px;background:repeating-linear-gradient(0deg,#778d98 0 1px,#b9c9cd 1px 3px)}

/* Put each legacy cab on the moving train too, not only in Train Control. */
.platform-scene .platform-train:has(.car-end-illustration){padding-right:48px}
.platform-scene .car-end-illustration{position:absolute;right:-48px;top:-9px;width:52px;height:65px;z-index:5;pointer-events:none}
.platform-scene .car-end-illustration .stock-face{position:static;display:block;width:52px;height:65px;filter:drop-shadow(1px 3px 2px #05101b)}
.platform-scene .platform-track{height:96px}

#platform-train .stock-car:after{content:"";position:absolute;pointer-events:none;left:3%;right:3%;bottom:15%;height:13%;opacity:var(--train-wear,0);background:linear-gradient(174deg,transparent 44%,#655047 47%,#d0bca2 50%,transparent 52%) 8% 0/23% 85% no-repeat,linear-gradient(177deg,transparent 41%,#915532 46%,transparent 58%) 76% 40%/32% 60% no-repeat}

/* Taller preview bodies without stretching circular wheels or the separate cab. */
.stock-preview .stock-car[data-model]{height:68px}
.stock-preview .stock-car .car-window{top:calc(var(--window-top) * 1.45);height:calc(var(--window-height) * 1.5)}
.stock-preview .stock-car .car-door b:after{height:25px;top:6px}
.stock-preview .stock-car .car-cab i{height:25px;top:12px}
.stock-preview .stock-car .car-roundel{top:41px}
