.tpsd{--ink:#14213d;--mut:#566078;--line:#d5dbe7;--card:#fff;--soft:#eef1f6;--pri:#1a4fa0;--pri-ink:#fff;--acc:#f2b01e;--acc-d:#8a6410;--bad:#b3261e;--ok:#146c2e;--lane:#5a6270;
max-width:1240px;width:100%;margin:0 auto 28px;color:var(--ink);font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;font-size:16px;line-height:1.5;box-sizing:border-box;-webkit-text-size-adjust:100%}
.tpsd--dark{--ink:#e8edf5;--mut:#aab4c8;--line:#2f3a52;--card:#161e30;--soft:#222c44;--pri:#6ea2ff;--pri-ink:#0b1426;--acc:#f2b01e;--acc-d:#a07914;--bad:#ff8a80;--ok:#7fdc9b;background:#0f1626;padding:14px;border-radius:18px}
.tpsd *{box-sizing:border-box}
.tpsd [hidden]{display:none!important}
.tpsd p{margin:0}
.tpsd .tpsd-lead{margin:0 0 14px;color:var(--mut)}

/* scene */
.tpsd .tpsd-stage{position:relative;background:#fff;border:1px solid var(--line);border-radius:16px;overflow:hidden;aspect-ratio:1000/508}
.tpsd .tpsd-stage img{position:absolute;left:0;top:0;width:100%;height:100%;max-width:none;margin:0;object-fit:contain;display:block}
.tpsd .tpsd-zone{opacity:0;transition:opacity 1s ease}
.tpsd .tpsd-zone.on{opacity:1}
.tpsd .tpsd-badge{position:absolute;left:10px;top:10px;z-index:2;background:#14213d;color:#fff;font-weight:700;font-size:14px;padding:5px 12px;border-radius:999px}
.tpsd .tpsd-total{position:absolute;right:10px;top:10px;z-index:2;background:#fff;color:#14213d;border:2px solid #14213d;font-weight:800;font-size:15px;padding:4px 12px;border-radius:999px}

/* buttons shared reset (themes love to restyle <button>) */
.tpsd button{appearance:none;-webkit-appearance:none;font-family:inherit;text-transform:none;letter-spacing:0;box-shadow:none;text-shadow:none;margin:0;-webkit-tap-highlight-color:transparent}
.tpsd button:focus-visible,.tpsd input:focus-visible,.tpsd summary:focus-visible{outline:3px solid var(--acc);outline-offset:2px}
.tpsd button:disabled{opacity:.55;cursor:default}

.tpsd .tpsd-chips{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:14px 0}
.tpsd .tpsd-chip{border:2px solid var(--line);background:var(--card);color:var(--ink);border-radius:14px;padding:10px 4px;font-weight:600;font-size:15px;line-height:1.3;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:2px;position:relative;min-height:74px;transition:transform .12s ease,background .15s}
.tpsd .tpsd-chip:active{transform:scale(.97)}
.tpsd .tpsd-chip span{font-size:26px;line-height:1.1}
.tpsd .tpsd-chip[aria-pressed="true"]{background:var(--pri);border-color:var(--pri);color:var(--pri-ink)}
.tpsd .tpsd-chip[aria-pressed="true"]::after{content:"\2713";position:absolute;right:8px;top:4px;font-size:14px;font-weight:800}

.tpsd .tpsd-row{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;font-weight:700}
.tpsd .tpsd-row output{font-size:28px;color:var(--pri);font-variant-numeric:tabular-nums}
.tpsd input[type=range]{width:100%;height:36px;margin:4px 0 10px;accent-color:var(--pri);background:transparent}

.tpsd .tpsd-seg{display:inline-flex;border:2px solid var(--line);border-radius:12px;overflow:hidden;max-width:100%}
.tpsd .tpsd-seg button{border:0;background:var(--card);color:var(--ink);font-weight:700;font-size:14px;padding:7px 12px;cursor:pointer;border-radius:0;line-height:1.3}
.tpsd .tpsd-seg button+button{border-left:2px solid var(--line)}
.tpsd .tpsd-seg button[aria-pressed="true"],.tpsd .tpsd-seg button[aria-selected="true"]{background:var(--pri);color:var(--pri-ink)}
.tpsd .tpsd-seg button:focus-visible{outline-offset:-3px}
.tpsd .tpsd-seg.full{display:flex;width:100%}
.tpsd .tpsd-seg.full button{flex:1}
.tpsd .tpsd-field{margin:12px 0 0}
.tpsd .tpsd-field>b{display:block;font-size:14px;margin-bottom:6px}
.tpsd .tpsd-hint{font-size:13px;color:var(--mut);margin-top:6px}

/* cards */
.tpsd .tpsd-card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:16px;margin-top:14px}
.tpsd .tpsd-card h3{margin:0 0 8px;font-size:17px;line-height:1.3;color:inherit;font-weight:800;text-transform:none;letter-spacing:0}
.tpsd .tpsd-sum{margin:0 0 12px;font-size:17px}
.tpsd .tpsd-bar{display:grid;grid-template-columns:78px 1fr 56px;gap:10px;align-items:center;margin:8px 0;font-size:15px}
.tpsd .tpsd-bar em{font-style:normal;font-weight:700;text-align:end;font-variant-numeric:tabular-nums}
.tpsd .tpsd-track{height:22px;background:var(--soft);border-radius:6px;overflow:hidden;display:flex}
.tpsd .tpsd-fill{display:block;height:100%;width:0;transition:width .5s ease;min-width:3px}
/* colour-blind safe: every series has its own PATTERN, not just a colour */
.tpsd .tpsd-fill.t,.tpsd .sw.t{background:repeating-linear-gradient(135deg,#f2b01e 0 6px,#8a6410 6px 12px)}
.tpsd .tpsd-fill.b,.tpsd .sw.b{background:radial-gradient(circle at 3px 3px,rgba(255,255,255,.55) 1.3px,transparent 1.6px) 0 0/7px 7px,var(--pri)}
.tpsd .tpsd-fill.x{background:repeating-linear-gradient(45deg,#c4202f 0 3px,#fff 3px 6px);border-left:2px solid var(--ink)}
.tpsd .tpsd-legend{display:flex;flex-direction:column;gap:4px;margin:12px 0 0;font-size:14px;color:var(--mut)}
.tpsd .sw{display:inline-block;width:18px;height:12px;border-radius:3px;margin-right:8px;vertical-align:-1px}
.tpsd .sw.x{background:repeating-linear-gradient(45deg,#c4202f 0 3px,#fff 3px 6px);border:1px solid var(--ink)}
.tpsd .tpsd-note{margin:12px 0 0;font-size:14px;color:var(--mut)}

.tpsd .tpsd-cmp{margin-top:14px;border-top:1px solid var(--soft);padding-top:10px}
.tpsd .tpsd-cmp .tpsd-bar{grid-template-columns:122px 1fr 56px;margin:6px 0;font-size:14px}
.tpsd .tpsd-cmp .tpsd-bar b{white-space:nowrap}
.tpsd .tpsd-cmp .tpsd-bar.cur b{color:var(--pri)}
.tpsd .tpsd-cmp .tpsd-bar.cur .tpsd-track{outline:2px solid var(--pri)}

/* simulator */
.tpsd .tpsd-simhead{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px;flex-wrap:wrap}
.tpsd .tpsd-simhead h3{margin:0}
.tpsd .tpsd-spd{font-weight:800;font-size:20px;color:var(--pri);font-variant-numeric:tabular-nums}
.tpsd .tpsd-lane{border-radius:12px;overflow:hidden;background:var(--lane);height:auto;position:relative}
.tpsd .tpsd-cv{display:block;width:100%;height:176px;max-width:none;margin:0}
.tpsd .tpsd-state{margin:10px 0 0;font-size:14px;color:var(--mut);min-height:42px}
.tpsd .tpsd-verdict{margin:10px 0 0;padding:10px 12px;border-radius:12px;font-weight:700;font-size:15px;border:2px solid var(--line);background:var(--soft)}
.tpsd .tpsd-verdict.ok{border-color:var(--ok);color:var(--ok)}
.tpsd .tpsd-verdict.hit{border-color:var(--bad);color:var(--bad)}
.tpsd .tpsd-verdict::before{display:inline-block;margin-right:8px;font-weight:800}
.tpsd .tpsd-verdict.ok::before{content:"\2714"}
.tpsd .tpsd-verdict.hit::before{content:"\26A0"}
.tpsd .tpsd-btns{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.tpsd .tpsd-btn{display:block;width:100%;padding:12px;border-radius:12px;border:2px solid var(--pri);background:var(--card);color:var(--pri);font-weight:700;font-size:16px;cursor:pointer;line-height:1.3}
.tpsd .tpsd-btn.solid{background:var(--pri);color:var(--pri-ink)}
.tpsd .tpsd-btn.ghost{border-color:var(--line);color:var(--ink)}
.tpsd .tpsd-btn[aria-pressed="true"]{background:var(--soft)}
.tpsd .tpsd-btn.wide{grid-column:1/-1}

/* table */
.tpsd details.tpsd-tbl{margin-top:14px;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:0 16px}
.tpsd details.tpsd-tbl summary{cursor:pointer;font-weight:800;padding:14px 0;list-style:none}
.tpsd details.tpsd-tbl summary::-webkit-details-marker{display:none}
.tpsd details.tpsd-tbl summary::after{content:"\25BE";float:right;transition:transform .15s}
.tpsd details.tpsd-tbl[open] summary::after{transform:rotate(180deg)}
.tpsd .tpsd-tw{overflow-x:auto;padding-bottom:14px}
.tpsd table{width:100%;border-collapse:collapse;font-size:15px;font-variant-numeric:tabular-nums;margin:0;border:0}
.tpsd th,.tpsd td{padding:8px 6px;text-align:end;border:0;border-top:1px solid var(--soft);background:transparent;color:inherit}
.tpsd th:first-child,.tpsd td:first-child{text-align:start}
.tpsd thead th{border-top:0;font-size:13px;color:var(--mut)}
.tpsd tr.on th,.tpsd tr.on td{background:var(--soft);font-weight:800}
.tpsd tr.on th::before{content:"\25B6\00a0";font-size:11px}
.tpsd caption{text-align:start;font-size:13px;color:var(--mut);padding:0 0 6px;caption-side:bottom}

/* quiz */
.tpsd .tpsd-qhead{display:flex;justify-content:space-between;align-items:baseline;gap:10px;flex-wrap:wrap}
.tpsd .tpsd-qstat{font-size:14px;color:var(--mut);font-weight:600}
.tpsd .tpsd-q{font-size:17px;margin:6px 0 12px}
.tpsd .tpsd-opts{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.tpsd .tpsd-opt{border:2px solid var(--line);background:var(--card);color:var(--ink);border-radius:12px;padding:14px 4px;font-weight:800;font-size:18px;cursor:pointer;font-variant-numeric:tabular-nums;line-height:1.2}
.tpsd .tpsd-opt.right{border-color:var(--ok);color:var(--ok)}
.tpsd .tpsd-opt.right::after{content:" \2714"}
.tpsd .tpsd-opt.wrong{border-color:var(--bad);color:var(--bad);text-decoration:line-through}
.tpsd .tpsd-opt.wrong::after{content:" \2716";display:inline-block;text-decoration:none}
.tpsd .tpsd-qres{margin-top:12px;font-size:15px}
.tpsd .tpsd-qres .tpsd-btns{margin-top:10px}

/* badges */
.tpsd .tpsd-bl{list-style:none;margin:8px 0 0;padding:0}
.tpsd .tpsd-bl li{padding:6px 0;font-size:15px;border-top:1px solid var(--soft);margin:0}
.tpsd .tpsd-bl li.on b{color:var(--pri)}
.tpsd .tpsd-bl small{color:var(--mut);font-size:13px;margin-left:4px}
.tpsd .tpsd-prog{float:right;font-size:14px;color:var(--mut);font-weight:700}
.tpsd .tpsd-toast{margin:8px 0 0;font-weight:700;color:var(--pri);min-height:22px}

.tpsd .tpsd-src{margin-top:14px;font-size:12px;color:var(--mut);text-align:center}

@media (max-width:420px){
 .tpsd .tpsd-bar{grid-template-columns:66px 1fr 50px;gap:8px}
 .tpsd .tpsd-cmp .tpsd-bar{grid-template-columns:112px 1fr 50px;gap:6px}
 .tpsd .tpsd-seg button{padding:7px 8px;font-size:13px}
 .tpsd .tpsd-opt{font-size:16px}
}
@media (prefers-reduced-motion:reduce){.tpsd .tpsd-zone,.tpsd .tpsd-fill,.tpsd .tpsd-chip,.tpsd details.tpsd-tbl summary::after{transition:none}}
@media print{.tpsd .tpsd-btns,.tpsd .tpsd-chips,.tpsd input[type=range]{display:none}}
.tpsd .tpsd-opt:disabled{opacity:1;cursor:default}
.tpsd .tpsd-opt:disabled:not(.right):not(.wrong){opacity:.5}

/* ---------- v2.1 visual polish ---------- */
.tpsd{--shadow:0 1px 2px rgba(20,33,61,.06),0 10px 28px -14px rgba(20,33,61,.28);--grad:linear-gradient(135deg,#1a4fa0,#2f6fd6)}
.tpsd--dark{--shadow:0 1px 2px rgba(0,0,0,.4),0 10px 28px -14px rgba(0,0,0,.7);--grad:linear-gradient(135deg,#4d86e6,#6ea2ff)}
.tpsd .tpsd-stage{box-shadow:var(--shadow);border:0}
.tpsd .tpsd-badge{background:rgba(20,33,61,.88);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);box-shadow:0 2px 8px rgba(0,0,0,.2)}
.tpsd .tpsd-total{border:0;box-shadow:0 2px 10px rgba(0,0,0,.22);font-variant-numeric:tabular-nums;animation:tpsd-pop .35s ease both}
@keyframes tpsd-pop{from{transform:scale(.9);opacity:.4}to{transform:none;opacity:1}}

.tpsd .tpsd-card,.tpsd details.tpsd-tbl{border:0;box-shadow:var(--shadow);border-radius:20px;padding:18px}
.tpsd details.tpsd-tbl{padding:0 18px}
.tpsd .tpsd-card h3{display:flex;align-items:center;gap:8px}
.tpsd .tpsd-card h3::before{content:"";width:5px;height:18px;border-radius:3px;background:var(--grad);flex:none}

.tpsd .tpsd-chip{border-radius:16px;box-shadow:0 1px 2px rgba(20,33,61,.06);transition:transform .15s ease,box-shadow .2s,background .2s,border-color .2s}
.tpsd .tpsd-chip:hover{border-color:var(--pri);box-shadow:0 6px 16px -8px rgba(26,79,160,.5);transform:translateY(-1px)}
.tpsd .tpsd-chip[aria-pressed="true"]{background:var(--grad);box-shadow:0 8px 18px -8px rgba(26,79,160,.65)}
.tpsd .tpsd-chip[aria-pressed="true"] span{animation:tpsd-bob .5s ease}
@keyframes tpsd-bob{40%{transform:translateY(-4px) scale(1.12)}}

.tpsd .tpsd-seg{border-radius:14px;background:var(--card);box-shadow:0 1px 2px rgba(20,33,61,.06)}
.tpsd .tpsd-seg button{transition:background .15s,color .15s}
.tpsd .tpsd-seg button:hover:not([aria-pressed="true"]){background:var(--soft)}
.tpsd .tpsd-seg button[aria-pressed="true"]{background:var(--grad)}

.tpsd .tpsd-btn{border-radius:14px;transition:transform .12s ease,box-shadow .2s,background .2s}
.tpsd .tpsd-btn:hover{transform:translateY(-1px);box-shadow:0 8px 18px -10px rgba(26,79,160,.6)}
.tpsd .tpsd-btn:active{transform:scale(.98)}
.tpsd .tpsd-btn.solid{background:var(--grad);border-color:transparent}

/* custom slider with filled track */
.tpsd input[type=range]{-webkit-appearance:none;appearance:none;height:34px;cursor:pointer;--p:50%}
.tpsd input[type=range]::-webkit-slider-runnable-track{height:10px;border-radius:999px;background:linear-gradient(90deg,var(--pri) var(--p),var(--soft) var(--p))}
.tpsd input[type=range]::-moz-range-track{height:10px;border-radius:999px;background:var(--soft)}
.tpsd input[type=range]::-moz-range-progress{height:10px;border-radius:999px;background:var(--pri)}
.tpsd input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:28px;height:28px;margin-top:-9px;border-radius:50%;background:#fff;border:4px solid var(--pri);box-shadow:0 3px 10px rgba(20,33,61,.3);transition:transform .12s}
.tpsd input[type=range]::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:#fff;border:4px solid var(--pri);box-shadow:0 3px 10px rgba(20,33,61,.3)}
.tpsd input[type=range]:active::-webkit-slider-thumb{transform:scale(1.12)}

.tpsd .tpsd-lane{border-radius:16px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.08),0 6px 16px -10px rgba(0,0,0,.5)}
.tpsd .tpsd-track{border-radius:999px;height:20px}
.tpsd .tpsd-fill{border-radius:0 999px 999px 0}
.tpsd .tpsd-track>.tpsd-fill:first-child{border-radius:999px 0 0 999px}
.tpsd .tpsd-track>.tpsd-fill:only-child{border-radius:999px}
.tpsd .tpsd-opt{border-radius:14px;transition:transform .12s,border-color .15s,box-shadow .2s;box-shadow:0 1px 2px rgba(20,33,61,.06)}
.tpsd .tpsd-opt:hover:not(:disabled){border-color:var(--pri);transform:translateY(-2px);box-shadow:0 8px 16px -10px rgba(26,79,160,.6)}
.tpsd .tpsd-verdict{border-radius:14px;animation:tpsd-pop .3s ease both}
.tpsd .tpsd-bl li.on{animation:tpsd-pop .4s ease both}
.tpsd .tpsd-toast:not(:empty){background:var(--soft);padding:8px 12px;border-radius:12px;animation:tpsd-pop .35s ease both}
.tpsd .tpsd-card,.tpsd details.tpsd-tbl{animation:tpsd-rise .5s ease both}
@keyframes tpsd-rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.tpsd *{animation:none!important;transition:none!important}}
.tpsd .tpsd-presets{margin-top:2px}
.tpsd .tpsd-presets button{display:flex;flex-direction:column;align-items:center;gap:0;padding:6px 4px}
.tpsd .tpsd-presets b{font-size:16px;line-height:1.2}
.tpsd .tpsd-presets small{font-size:11px;font-weight:600;opacity:.85;line-height:1.2}
.tpsd .tpsd-zone20{margin:8px 0 0}

/* ---------- v2.2 brake lamps on rear-view scenes ---------- */
.tpsd .tpsd-lamp{position:absolute;z-index:1;aspect-ratio:1;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;opacity:0;transition:opacity .12s;background:radial-gradient(circle,rgba(255,92,92,.95) 0,rgba(255,50,50,.55) 28%,rgba(255,40,40,0) 68%);mix-blend-mode:screen}
.tpsd .tpsd-stage.tpsd-brk .tpsd-lamp{opacity:1;animation:tpsd-flare .5s ease-out both}
@keyframes tpsd-flare{from{transform:translate(-50%,-50%) scale(.6)}to{transform:translate(-50%,-50%) scale(1)}}
.tpsd .tpsd-modes button{font-size:13px;padding:7px 6px}

/* ---------- v2.4 full-width, layout driven by the widget's own width ---------- */
.tpsd{max-width:none;box-sizing:border-box;padding:0 clamp(12px,2.5vw,44px)}
.tpsd[data-width="content"]{max-width:1240px;padding:0}
.tpsd .tpsd-app{max-width:1600px;margin:0 auto}
.tpsd .tpsd-layout{display:flex;flex-direction:column;gap:14px}
.tpsd .tpsd-colA,.tpsd .tpsd-colB,.tpsd .tpsd-colC,.tpsd .tpsd-colD{display:contents}
.tpsd .tpsd-layout .tpsd-card,.tpsd .tpsd-layout details.tpsd-tbl{margin-top:0}
.tpsd .tpsd-lanebox{order:1}.tpsd .tpsd-ctrl{order:2}.tpsd .tpsd-stage{order:3}.tpsd .tpsd-simctl{order:4}
.tpsd .tpsd-main{order:5}.tpsd .tpsd-tbl{order:6}.tpsd .tpsd-quiz{order:7}.tpsd .tpsd-badges{order:8}
.tpsd .tpsd-ctrl .tpsd-chips{margin-top:0}
.tpsd .tpsd-lanebox .tpsd-simhead{margin-bottom:8px}
.tpsd .tpsd-simctl .tpsd-state{margin-top:0}
.tpsd .tpsd-simctl .tpsd-modes{margin-bottom:2px}
.tpsd .tpsd-tabs{display:flex;gap:6px;padding:5px;margin:0 0 12px;background:var(--card);border-radius:16px;box-shadow:var(--shadow);min-height:48px;box-sizing:border-box}
.tpsd .tpsd-tabs button{flex:1;border:0;background:transparent;color:var(--ink);font-weight:800;font-size:15px;padding:10px 6px;border-radius:12px;cursor:pointer;line-height:1.2;transition:background .15s,color .15s}
.tpsd .tpsd-tabs button[aria-selected="true"]{background:var(--grad);color:var(--pri-ink)}

/* narrow: one panel at a time, simulator pinned on top */
.tpsd[data-layout="narrow"] .tpsd-lead{display:none}
.tpsd[data-layout="narrow"] .tpsd-tabs{position:sticky;top:var(--tpsd-top,0px);z-index:30;margin-bottom:0;border-radius:0 0 16px 16px}
.tpsd[data-layout="narrow"] .tpsd-layout{padding-top:12px}
.tpsd[data-layout="narrow"] .tpsd-lanebox{position:sticky;top:calc(var(--tpsd-top,0px) + 48px);z-index:20;padding:10px 10px 8px;border-radius:0 0 18px 18px;box-shadow:0 12px 18px -12px rgba(20,33,61,.5)}
.tpsd[data-layout="narrow"] .tpsd-lanebox h3{font-size:15px}
.tpsd[data-layout="narrow"] .tpsd-lanebox .tpsd-spd{font-size:17px}
.tpsd[data-layout="narrow"]:not([data-tab="explore"]) [data-p="explore"],
.tpsd[data-layout="narrow"]:not([data-tab="results"]) [data-p="results"],
.tpsd[data-layout="narrow"]:not([data-tab="learn"]) [data-p="learn"]{display:none}
.tpsd[data-layout="narrow"] .tpsd-card{padding:14px}

/* wide: one big dashboard */
.tpsd[data-layout="wide"] .tpsd-tabs{display:none}
.tpsd[data-layout="wide"]{font-size:17px}
.tpsd[data-layout="wide"] .tpsd-layout{display:grid;grid-template-columns:minmax(420px,36%) minmax(0,1fr);gap:20px 24px;align-items:start}
.tpsd[data-layout="wide"] .tpsd-colA,.tpsd[data-layout="wide"] .tpsd-colB{display:flex;flex-direction:column;gap:18px;min-width:0}
.tpsd[data-layout="wide"] .tpsd-colC{display:block;grid-column:1/-1}
.tpsd[data-layout="wide"] .tpsd-colD{display:grid;grid-column:1/-1;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:20px;align-items:start}
.tpsd[data-layout="wide"] .tpsd-lanebox,.tpsd[data-layout="wide"] .tpsd-stage,.tpsd[data-layout="wide"] .tpsd-ctrl,.tpsd[data-layout="wide"] .tpsd-simctl,.tpsd[data-layout="wide"] .tpsd-main,.tpsd[data-layout="wide"] .tpsd-tbl,.tpsd[data-layout="wide"] .tpsd-quiz,.tpsd[data-layout="wide"] .tpsd-badges{order:0}
.tpsd[data-layout="wide"] .tpsd-lead{font-size:18px;max-width:900px;margin-bottom:18px}
.tpsd[data-layout="wide"] .tpsd-card{padding:22px}
.tpsd[data-layout="wide"] details.tpsd-tbl{padding:0 22px}
.tpsd[data-layout="wide"] .tpsd-lanebox h3{font-size:20px}
.tpsd[data-layout="wide"] .tpsd-lanebox .tpsd-spd{font-size:26px}
.tpsd[data-layout="wide"] .tpsd-chip{min-height:86px;font-size:16px}
.tpsd[data-layout="wide"] .tpsd-main{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);column-gap:48px;align-items:start}
.tpsd[data-layout="wide"] .tpsd-main>*{grid-column:1}
.tpsd[data-layout="wide"] .tpsd-main>.tpsd-cmp{grid-column:2;grid-row:1/span 8;margin-top:0;border-top:0;padding-top:0}
.tpsd[data-layout="wide"] .tpsd-main .tpsd-sum{font-size:21px}
.tpsd[data-layout="wide"] .tpsd-quiz .tpsd-opts{gap:14px}
.tpsd[data-size="xl"]{font-size:18px}
.tpsd[data-size="xl"] .tpsd-layout{grid-template-columns:minmax(460px,34%) minmax(0,1fr)}

.tpsd .sw.c{background:repeating-linear-gradient(0deg,#1f8a8a 0 3px,rgba(255,255,255,.6) 3px 5px);border:1px solid var(--ink)}

/* ---------- v2.6 speed readout under the lane ---------- */
.tpsd .tpsd-simhead{display:flex;align-items:center}
.tpsd .tpsd-speedbar{margin-top:12px}
.tpsd .tpsd-sb-top{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.tpsd .tpsd-sb-lbl{font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--mut)}
.tpsd .tpsd-sb-top .tpsd-spd{font-size:34px;font-weight:900;line-height:1;color:var(--ink);font-variant-numeric:tabular-nums;min-width:4.6ch}
.tpsd .tpsd-phase{margin-left:auto;font-size:13px;font-weight:800;padding:4px 12px 4px 30px;border-radius:999px;border:2px solid var(--line);position:relative;min-height:28px;line-height:1.4;background:var(--card);color:var(--ink)}
.tpsd .tpsd-phase:empty{visibility:hidden}
.tpsd .tpsd-phase::before{content:"";position:absolute;left:8px;top:50%;width:16px;height:10px;margin-top:-5px;border-radius:3px;border:1px solid var(--ink)}
.tpsd .tpsd-phase[data-ph="c"]::before{background:repeating-linear-gradient(0deg,#1f8a8a 0 3px,rgba(255,255,255,.7) 3px 5px)}
.tpsd .tpsd-phase[data-ph="t"]::before{background:repeating-linear-gradient(135deg,#f2b01e 0 4px,#8a6410 4px 8px)}
.tpsd .tpsd-phase[data-ph="b"]::before{background:radial-gradient(circle at 3px 3px,rgba(255,255,255,.7) 1.1px,transparent 1.4px) 0 0/5px 5px,#1a4fa0}
.tpsd .tpsd-phase[data-ph="s"]::before{background:var(--ink)}
.tpsd .tpsd-gauge{position:relative;height:16px;margin-top:10px;border-radius:999px;background:var(--soft);box-shadow:inset 0 0 0 1px var(--line);overflow:hidden}
.tpsd .tpsd-gfill{display:block;height:100%;width:0;border-radius:999px;background:linear-gradient(90deg,#ffb347,#ff7a00);box-shadow:0 0 12px rgba(255,122,0,.45)}
.tpsd .tpsd-gauge::after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(90deg,transparent 0 calc(25% - 1px),rgba(20,33,61,.28) calc(25% - 1px) 25%);pointer-events:none}
.tpsd[data-layout="wide"] .tpsd-sb-top .tpsd-spd{font-size:46px}
.tpsd[data-layout="wide"] .tpsd-gauge{height:20px}
.tpsd[data-layout="narrow"] .tpsd-simhead{display:none}
.tpsd[data-layout="narrow"] .tpsd-speedbar{margin-top:8px}
.tpsd[data-layout="narrow"] .tpsd-sb-top .tpsd-spd{font-size:26px}
.tpsd[data-layout="narrow"] .tpsd-sb-lbl{display:none}
.tpsd[data-layout="narrow"] .tpsd-gauge{height:12px;margin-top:6px}

/* ---------- v2.7 guided steps + highlighted speed control ---------- */
.tpsd .tpsd-step{display:flex;align-items:center;gap:8px;margin:0 0 10px;font-weight:800;font-size:15px;line-height:1.3;color:var(--ink)}
.tpsd .tpsd-step i{flex:none;width:24px;height:24px;border-radius:50%;background:var(--grad);color:var(--pri-ink);display:grid;place-items:center;font-style:normal;font-size:13px;font-weight:800}
.tpsd .tpsd-field .tpsd-step{margin-bottom:8px}
.tpsd .tpsd-speedctl{margin:18px 0;padding:14px 16px 12px;border-radius:18px;border:2px solid #ff9a1f;background:linear-gradient(180deg,#fff6e6,#ffe9c7);box-shadow:0 12px 26px -16px rgba(255,122,0,.8);color:#14213d}
.tpsd .tpsd-speedctl .tpsd-step{color:#14213d;font-size:16px;margin-bottom:2px}
.tpsd .tpsd-speedctl .tpsd-step i{background:linear-gradient(135deg,#ff9a1f,#ff7a00);color:#1b1200}
.tpsd .tpsd-sc-sub{font-size:13px;color:#5d4a2a;margin:0 0 6px 32px}
.tpsd .tpsd-speedctl .tpsd-row{font-weight:800;color:#14213d}
.tpsd .tpsd-speedctl .tpsd-row output{color:#b34700;font-size:34px;font-weight:900}
.tpsd .tpsd-speedctl .tpsd-hint{color:#5d4a2a}
.tpsd .tpsd-speedctl .tpsd-seg{background:#fff;border-color:#f1c27f}
.tpsd .tpsd-speedctl .tpsd-seg button{background:#fff;color:#14213d}
.tpsd .tpsd-speedctl .tpsd-seg button+button{border-left-color:#f1c27f}
.tpsd .tpsd-speedctl .tpsd-seg button[aria-pressed="true"]{background:linear-gradient(135deg,#ffa938,#ff7a00);color:#1b1200}
.tpsd .tpsd-speedctl input[type=range]::-webkit-slider-runnable-track{height:12px;background:linear-gradient(90deg,#ff7a00 var(--p),rgba(20,33,61,.14) var(--p))}
.tpsd .tpsd-speedctl input[type=range]::-moz-range-track{height:12px;background:rgba(20,33,61,.14)}
.tpsd .tpsd-speedctl input[type=range]::-moz-range-progress{height:12px;background:#ff7a00}
.tpsd .tpsd-speedctl input[type=range]::-webkit-slider-thumb{width:36px;height:36px;margin-top:-12px;border:5px solid #ff7a00;box-shadow:0 4px 12px rgba(120,60,0,.4)}
.tpsd .tpsd-speedctl input[type=range]::-moz-range-thumb{width:26px;height:26px;border:5px solid #ff7a00;box-shadow:0 4px 12px rgba(120,60,0,.4)}
.tpsd .tpsd-speedctl input[type=range]{height:40px}
.tpsd .tpsd-speedctl:not(.touched) input[type=range]::-webkit-slider-thumb{animation:tpsd-ring 1.7s ease-out infinite}
.tpsd .tpsd-speedctl:not(.touched) input[type=range]::-moz-range-thumb{animation:tpsd-ring 1.7s ease-out infinite}
@keyframes tpsd-ring{0%{box-shadow:0 0 0 0 rgba(255,122,0,.65)}80%,100%{box-shadow:0 0 0 16px rgba(255,122,0,0)}}
.tpsd .tpsd-speedctl input[type=range]:focus-visible{outline:none}
.tpsd .tpsd-speedctl input[type=range]:focus-visible::-webkit-slider-thumb{outline:3px solid #14213d;outline-offset:2px}
@media (prefers-reduced-motion:reduce){.tpsd .tpsd-speedctl input[type=range]::-webkit-slider-thumb,.tpsd .tpsd-speedctl input[type=range]::-moz-range-thumb{animation:none!important}}

/* ---------- v2.8 classic speedometer dials ---------- */
.tpsd .tpsd-dial{display:block;line-height:0}
.tpsd .tpsd-dial svg{display:block;width:100%;height:auto;filter:drop-shadow(0 8px 14px rgba(13,22,48,.35))}
.tpsd .tpsd-dial .dl{fill:#fff;font:800 13px system-ui,sans-serif}
.tpsd .tpsd-dial .dv{fill:#fff;font:900 34px system-ui,sans-serif;font-variant-numeric:tabular-nums}
.tpsd .tpsd-dial .du{fill:#ffb347;font:800 13px system-ui,sans-serif;letter-spacing:.06em;text-transform:uppercase}
.tpsd .tpsd-dial .dn{transition:transform .45s cubic-bezier(.2,.9,.25,1.15)}
.tpsd .tpsd-dial .dring{opacity:0}
.tpsd .tpsd-speedctl:not(.touched) .tpsd-dial-c .dring{animation:tpsd-blink 1.05s ease-in-out infinite}
@keyframes tpsd-blink{0%,100%{opacity:.15;stroke-width:2}50%{opacity:1;stroke-width:5}}
.tpsd .tpsd-dial-c{width:min(250px,86%);margin:8px auto 4px}
.tpsd .tpsd-speedctl .tpsd-row output{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.tpsd .tpsd-speedctl .tpsd-row{justify-content:space-between}
.tpsd .tpsd-sb-main{display:flex;align-items:center;gap:16px}
.tpsd .tpsd-dial-l{flex:none;width:132px}
.tpsd .tpsd-dial-l .dn{transition:transform .09s linear}
.tpsd .tpsd-dial-l .dv{font-size:30px}
.tpsd .tpsd-sb-side{flex:1;min-width:0}
.tpsd[data-layout="wide"] .tpsd-dial-l{width:168px}
.tpsd[data-layout="narrow"] .tpsd-dial-l{display:none}
@media (prefers-reduced-motion:reduce){.tpsd .tpsd-dial .dn{transition:none}.tpsd .tpsd-speedctl:not(.touched) .tpsd-dial-c .dring{animation:none;opacity:.8}}
.tpsd[data-layout="narrow"] .tpsd-dial-c{width:min(190px,62%);margin:4px auto 0}

/* ---------- v2.9 reaction test ---------- */
.tpsd .tpsd-rtdots{display:flex;gap:8px;margin:2px 0 12px}
.tpsd .tpsd-rtdots i{flex:1;height:8px;border-radius:999px;background:var(--soft);box-shadow:inset 0 0 0 1px var(--line)}
.tpsd .tpsd-rtdots i.on{background:linear-gradient(90deg,#ffb347,#ff7a00);box-shadow:none}
.tpsd .tpsd-pad{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:100%;min-height:170px;border-radius:20px;border:3px solid var(--line);background:var(--soft);color:var(--ink);cursor:pointer;touch-action:manipulation;user-select:none;-webkit-user-select:none;padding:14px;transition:background .12s,border-color .12s,transform .08s}
.tpsd .tpsd-pad:active{transform:scale(.99)}
.tpsd .tpsd-pad-ico{font-size:34px;line-height:1}
.tpsd .tpsd-pad-t{font-size:30px;font-weight:900;line-height:1.15;font-variant-numeric:tabular-nums}
.tpsd .tpsd-pad-s{font-size:14px;font-weight:700;color:inherit;opacity:.8}
.tpsd .tpsd-pad[data-s="idle"],.tpsd .tpsd-pad[data-s="fin"]{border-style:dashed;border-color:var(--pri)}
.tpsd .tpsd-pad[data-s="wait"]{background:#14213d;border-color:#14213d;color:#fff}
.tpsd .tpsd-pad[data-s="go"]{background:linear-gradient(135deg,#ffb347,#ff7a00);border-color:#b34700;color:#1b1200;animation:tpsd-go .35s ease-out both}
@keyframes tpsd-go{from{transform:scale(.96)}to{transform:scale(1)}}
.tpsd .tpsd-pad[data-s="go"] .tpsd-pad-t{font-size:44px}
.tpsd .tpsd-pad[data-s="early"]{background:repeating-linear-gradient(45deg,#fff 0 12px,#f3c9c4 12px 24px);border-color:#b3261e;color:#7a120c}
.tpsd .tpsd-pad[data-s="done"]{border-color:var(--ok);color:var(--ink)}
.tpsd .tpsd-pad:focus-visible{outline:3px solid var(--acc);outline-offset:3px}
.tpsd .tpsd-rtlist{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;min-height:0}
.tpsd .tpsd-rtlist span{font-size:13px;font-weight:700;padding:3px 10px;border-radius:999px;background:var(--soft);font-variant-numeric:tabular-nums}
.tpsd .tpsd-rtres{margin-top:12px;font-size:15px}
.tpsd .tpsd-rtres p{margin:0 0 8px}
.tpsd .tpsd-rtscore{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:17px}
.tpsd .tpsd-rtr{display:inline-flex;align-items:center;gap:6px;font-weight:800;padding:4px 12px;border-radius:999px;border:2px solid var(--ink)}
.tpsd .tpsd-rtr i{font-style:normal}
.tpsd .tpsd-rtres .tpsd-bar{grid-template-columns:104px 1fr 54px}
.tpsd .tpsd-rtres .tpsd-btns{grid-template-columns:1fr;margin-top:10px}
@media (prefers-reduced-motion:reduce){.tpsd .tpsd-pad[data-s="go"]{animation:none}}

/* ---------- v2.10 learn-the-facts topics ---------- */
.tpsd .tpsd-order-fix{order:6}
.tpsd .tpsd-acc{order:6}
.tpsd[data-layout="wide"] .tpsd-acc{grid-column:1/-1;order:0}
.tpsd .tpsd-topics{display:flex;flex-direction:column;gap:8px}
.tpsd .tpsd-topic{border:2px solid var(--line);border-radius:16px;background:var(--card);overflow:hidden;transition:border-color .15s,box-shadow .2s}
.tpsd .tpsd-topic.open{border-color:var(--pri);box-shadow:0 10px 22px -16px rgba(26,79,160,.7)}
.tpsd .tpsd-th{display:flex;align-items:center;gap:12px;width:100%;padding:13px 14px;border:0;background:transparent;color:var(--ink);font-weight:800;font-size:16px;line-height:1.3;text-align:start;cursor:pointer}
.tpsd .tpsd-th:hover{background:var(--soft)}
.tpsd .tpsd-tn{flex:none;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font-size:13px;font-weight:800;background:var(--soft);color:var(--ink)}
.tpsd .tpsd-topic.open .tpsd-tn{background:var(--grad);color:var(--pri-ink)}
.tpsd .tpsd-tt{flex:1}
.tpsd .tpsd-th i{flex:none;width:10px;height:10px;border-right:3px solid currentColor;border-bottom:3px solid currentColor;transform:rotate(45deg);margin:-4px 4px 0 0;transition:transform .2s}
.tpsd .tpsd-th[aria-expanded="true"] i{transform:rotate(-135deg);margin-top:4px}
.tpsd .tpsd-tp{padding:2px 16px 16px 54px;font-size:15px;line-height:1.6;color:var(--ink)}
.tpsd .tpsd-tp p{margin:0 0 10px}
.tpsd .tpsd-tp .tpsd-hint{color:var(--mut);font-size:14px}
.tpsd .tpsd-tp:not([hidden]){animation:tpsd-rise .3s ease both}
.tpsd .tpsd-tp .tpsd-tw{padding-bottom:4px}
@media (max-width:520px){.tpsd .tpsd-tp{padding-left:16px}}

/* ---------- v2.11 calmer phone layout ---------- */
.tpsd[data-layout="narrow"] .tpsd-tabs{position:static;border-radius:16px;margin-bottom:10px}
.tpsd[data-layout="narrow"] .tpsd-layout{padding-top:0}
.tpsd[data-layout="narrow"] .tpsd-lanebox{top:calc(var(--tpsd-top,0px) + 6px);border-radius:18px;padding:8px 8px 6px;box-shadow:0 14px 20px -14px rgba(20,33,61,.55)}
.tpsd[data-layout="narrow"] .tpsd-dial-c{display:none}
.tpsd[data-layout="narrow"] .tpsd-speedctl .tpsd-row output{position:static;width:auto;height:auto;clip:auto;overflow:visible;white-space:normal;font-size:34px}
.tpsd[data-layout="narrow"] .tpsd-sb-top .tpsd-spd{font-size:20px;min-width:0}
.tpsd[data-layout="narrow"] .tpsd-phase{font-size:12px;padding:2px 10px 2px 28px;min-height:24px}
.tpsd[data-layout="narrow"] .tpsd-gauge{height:8px;margin-top:5px}
.tpsd[data-layout="narrow"] .tpsd-speedbar{margin-top:6px}
.tpsd[data-layout="narrow"] .tpsd-lanebox .tpsd-state{margin:4px 0 0;min-height:0;font-size:13px;line-height:1.3}
.tpsd[data-layout="narrow"] .tpsd-stage{order:0}
.tpsd[data-layout="narrow"] .tpsd-ctrl{padding:12px}
.tpsd[data-layout="narrow"] .tpsd-speedctl{margin:12px 0;padding:12px}
.tpsd[data-layout="narrow"] .tpsd-simctl .tpsd-btns{grid-template-columns:repeat(3,1fr);gap:8px}
.tpsd[data-layout="narrow"] .tpsd-simctl .tpsd-btn{padding:10px 4px;font-size:14px;border-radius:12px}
.tpsd[data-layout="narrow"] .tpsd-simctl .tpsd-replay{grid-column:1/-1;font-size:16px;padding:12px}
.tpsd[data-layout="narrow"] .tpsd-simctl .tpsd-btn.wide{grid-column:auto}

/* ---------- v2.12 full-screen simulator ---------- */
.tpsd .tpsd-fsb{position:absolute;right:8px;top:8px;z-index:3;width:38px;height:38px;border:0;border-radius:12px;background:rgba(13,22,48,.72);color:#fff;font-size:20px;line-height:1;cursor:pointer;display:grid;place-items:center;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}
.tpsd .tpsd-fsb:hover{background:rgba(13,22,48,.9)}
.tpsd .tpsd-fsbar{display:none}
html.tpsd-noscroll{overflow:hidden}
.tpsd .tpsd-lanebox.tpsd-fsmode{position:fixed!important;inset:0;top:0!important;z-index:2147483000;margin:0;border-radius:0;padding:12px max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left));display:flex;flex-direction:column;justify-content:center;overflow:auto;background:var(--card);animation:none}
.tpsd .tpsd-lanebox.tpsd-fsmode .tpsd-fsbar{display:flex;justify-content:space-between;gap:10px;margin-bottom:10px}
.tpsd .tpsd-lanebox.tpsd-fsmode .tpsd-fsbar .tpsd-btn{padding:9px 16px;font-size:15px}
.tpsd .tpsd-lanebox.tpsd-fsmode .tpsd-simhead,.tpsd .tpsd-lanebox.tpsd-fsmode .tpsd-fsb{display:none}
.tpsd .tpsd-lanebox.tpsd-fsmode .tpsd-sb-top .tpsd-spd{font-size:30px}
.tpsd .tpsd-lanebox.tpsd-fsmode .tpsd-state{font-size:15px;min-height:20px}

/* RTL: keep slider direction natural so the filled track matches the thumb */
.tpsd input[type=range]{direction:ltr}
