/* NoPeBench in two screens (user 11-22: one screen of information at a time, an obvious play button, less motion).
   Screen A (.bench-a): the head, one row of hand-off frames, the three tasks. Screen B (.bench-b): a sub-head, compact
   filters, the rate tiles, two rows of route cards with Prev / Next paging. Each fits in a desktop screen under the
   header (1440 x 900 and 1280 x 800). Loaded after v2.css; overrides its bench rules. */

/* ---------- section rhythm: the same top padding as the other sections */
@media (min-width: 961px) { #bench { padding-top: clamp(48px, 7vh, 88px); } }
#bench .bench-a .head { margin-bottom: clamp(16px, 2.4vh, 26px); }

/* ---------- screen A: one row of hand-off frames; a play button on hover; no zoom */
#bench .marquee { display: grid; gap: 14px; margin: 0 0 clamp(18px, 3vh, 30px); }   /* two rows with air between them (user 11-22) */
#bench .mq-row button { width: clamp(140px, 12.5vw, 196px); border-radius: 10px; }
#bench .mq-row button:hover img { transform: none; filter: brightness(.78); }
#bench .mq-row button::before { content: ""; position: absolute; left: 50%; top: 50%; z-index: 1; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 3v10l8-5z' fill='%23111318'/%3E%3C/svg%3E") 56% 50% / 15px no-repeat;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35); opacity: 0; transition: opacity .15s; pointer-events: none; }
#bench .mq-row button:hover::before { opacity: 1; }

/* the task cards hold still (no tilt); the tags stay the first thing read */
#bench .tasks .task { transform: none !important; }
#bench .tasks .task { padding: 20px 22px 18px; }
#bench .tasks .task h3 { margin-top: 12px; }

/* ---------- screen B */
.bench-b { margin-top: clamp(56px, 11vh, 120px); scroll-margin-top: calc(var(--header-h) + 12px); }
.bench-b .subhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 0 0 14px; }
.bench-b .subhead h3 { position: relative; margin: 0; padding-left: .34em; font-size: clamp(22px, 2.1vw, 30px); font-weight: 760; letter-spacing: -.025em; line-height: 1.1; }
.bench-b .subhead h3::before { content: ""; position: absolute; left: 0; top: .1em; bottom: .06em; width: .1em; border-radius: .03em; background: var(--wall); }
.bench-b .subhead p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }

/* filters: generator and route set as button groups, the rest as selects */
.bfilters { display: grid; gap: 8px; margin: 0 0 12px; }
.bfilters .frow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.bfilters .fgroup, .bfilters .fsel { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.bfilters .fl { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.bfilters .seg { flex-wrap: wrap; }
.bfilters .seg button { padding: 6px 11px; font-size: 13.5px; }
.bfilters .seg .n { font: 500 11px var(--mono); opacity: .6; margin-left: 5px; }
.bfilters select { -webkit-appearance: none; appearance: none; height: 34px; min-width: 0; max-width: 100%; padding: 0 30px 0 13px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23454b58' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") right 12px center / 10px no-repeat;
  font: 500 13.5px Inter, system-ui, sans-serif; color: var(--ink); text-overflow: ellipsis; transition: border-color .2s; }
.bfilters select:hover { border-color: var(--ink-3); }
.bfilters select.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.bfilters .fsel.off { opacity: .4; }
.bfilters select:disabled { cursor: not-allowed; }
/* desktop: the select row never wraps (a wrap would push the cards past the screen); the selects shrink instead */
@media (min-width: 961px) {
  .bfilters .frow + .frow { flex-wrap: nowrap; }
  .bfilters .frow + .frow .fsel { flex: 0 1 auto; }
  .bfilters .frow + .frow select { min-width: 64px; }
}
.bfilters .freset { flex: none; border: 0; background: none; padding: 4px 2px; font-size: 13px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.bfilters .freset:hover { color: var(--ink); }

/* rate tiles, compact; they appear with the filters, without the page's rise-in */
#bench-stats { gap: 8px; margin: 0 0 12px; }
#bench #bench-stats { opacity: 1 !important; transform: none !important; }
#bench-stats .stat { padding: 6px 12px 7px; min-width: 0; border-radius: 12px; }
#bench-stats .stat .v { font-size: 20px; line-height: 1.25; }
#bench-stats .stat .l { font-size: 12px; line-height: 1.35; }
#bench-stats .stat.wide { flex: 1 1 200px; display: flex; align-items: center; }

/* the hint above the cards */
.cards-hint { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; font-weight: 550; line-height: 1.4; color: var(--ink); }
.cards-hint .hplay { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-grid; place-items: center; }
.cards-hint .hplay svg { width: 10px; height: 10px; margin-left: 1px; }

/* route cards: two rows of four; every poster carries a play button */
#bench #cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-content: start; }
#cards.turn > * { animation: benchFade .2s ease-out both; }
@keyframes benchFade { from { opacity: 0; } }
#cards .empty { grid-column: 1 / -1; margin: 0; padding: 28px 0; text-align: center; font-size: 14px; color: var(--ink-3); }
#bench .rcard { border-radius: 14px; transition: border-color .15s, box-shadow .15s; }
#bench .rcard:hover, #bench .rcard:focus-visible { transform: none; border-color: var(--ink); box-shadow: var(--shadow); }
#bench .rcard .pics { grid-template-columns: 1.35fr 1fr; }
.rcard .ph { position: relative; overflow: hidden; min-width: 0; }
#bench .rcard .pics img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; transition: filter .15s; }
#bench .rcard:hover .pics img { filter: brightness(.82); }
/* the mini top view fills its cell and never sets the row's height (the poster does) */
.rcard .tv { position: relative; min-width: 0; background: #fafbfc; border-left: 1px solid var(--line); }
#bench .rcard .tv canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-left: 0; background: transparent; }
.rcard .rplay { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: rgba(255, 255, 255, .95); color: #111318;
  display: grid; place-items: center; box-shadow: 0 2px 12px rgba(0, 0, 0, .4); transition: transform .15s, background .15s, opacity .15s; }
.rcard .rplay svg { width: 15px; height: 15px; margin-left: 2px; }
.rcard:hover .rplay, .rcard:focus-visible .rplay { background: var(--wall); transform: scale(1.1); }
/* the card's own clip (NoPeWorld, collision mode) over the poster, where the device allows autoplay (see bench.js); the play
   button then steps back until the pointer is on the card */
.rcard .ph video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; }
.rcard.live .ph video { opacity: 1; }
.rcard .rtag { position: absolute; left: 5px; top: 5px; display: none; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 999px; background: rgba(12, 13, 16, .62);
  color: #fff; font: 600 10px Inter, system-ui, sans-serif; letter-spacing: .01em; pointer-events: none; }
.rcard .rtag i { width: 6px; height: 6px; border-radius: 50%; background: var(--ours); }
#cards.autoplay .rcard.live .rtag { display: inline-flex; }
#cards.autoplay .rcard.live .rplay { opacity: 0; transform: scale(.85); }
#cards.autoplay .rcard.live:hover .rplay, #cards.autoplay .rcard.live:focus-visible .rplay { opacity: 1; transform: scale(1.1); }
#bench .rcard:hover .ph video { filter: brightness(.82); }
#bench .rcard .body { padding: 8px 10px 10px; gap: 1px; }
#bench .rcard .t { font-size: 13.5px; line-height: 1.35; }
#bench .rcard .s { font-size: 12px; line-height: 1.35; }
#bench .rcard .v { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 8px; margin-top: 6px; }
.rcard .v .who { font: 600 10.5px var(--mono); letter-spacing: .02em; text-transform: uppercase; }
.rcard .v .who.raw { color: var(--raw); } .rcard .v .who.ours { color: var(--ours); }
#bench .rcard .v .chip { display: inline-block; justify-self: start; max-width: 100%; height: 22px; line-height: 20px; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
#bench .rcard .v .chip::before { display: inline-block; vertical-align: 1px; margin-right: 5px; }

/* pager */
.bench-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
.bench-pager .btn { height: 36px; padding: 0 16px; font-size: 14px; }
.bench-pager .btn:hover { transform: none; }
#pg-next:not(:disabled) { background: var(--ink); color: #fff; border-color: var(--ink); }
.bench-pager .btn:disabled { opacity: .4; cursor: default; border-color: var(--line-2); }
.pg-status { min-width: 160px; text-align: center; font: 500 13px var(--mono); color: var(--ink-3); }

/* ---------- viewer: the play / pause state is plain to see */
#v-play { width: 42px; height: 42px; background: var(--ink); border-color: var(--ink); color: #fff; }
#v-play svg { width: 16px; height: 16px; }
.vstate { min-width: 66px; font: 600 12.5px var(--mono); color: var(--ink-2); }
.viewer.paused .vstate { color: var(--ink); }
#v-tiles .tile { cursor: pointer; }
.viewer.paused #v-tiles .tile:not(.missing) .play { display: grid; }

/* ---------- narrower screens */
@media (max-width: 900px) { #bench #cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .bfilters .frow { gap: 8px 14px; }
  .bfilters .fgroup { flex-wrap: wrap; }
  .bfilters .fsel { flex: 1 1 calc(50% - 8px); flex-direction: column; align-items: stretch; gap: 3px; }
  .bfilters select { width: 100%; }
  #bench .rcard .pics { grid-template-columns: minmax(0, 1fr); }
  #bench .rcard .pics .tv { display: none; }
  #bench .rcard .pics img { aspect-ratio: 16 / 9; }
  #bench .rcard .v { grid-template-columns: minmax(0, 1fr); gap: 1px; }
  .rcard .v .who { margin-top: 3px; }
  .bench-pager { gap: 8px; }
  .pg-status { min-width: 0; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { #cards.turn > * { animation: none; } }
@media print { .bfilters, .cards-hint, .bench-pager { display: none; } }

/* narrow and mid widths: the filter rows and the generator buttons wrap instead of widening the page (user 11-22: mobile) */
#bench .frow { flex-wrap: wrap; min-width: 0; }
#bench .frow .seg, #bench #f-gen { flex-wrap: wrap; max-width: 100%; }
#bench .fsel { min-width: 0; max-width: 100%; }
#bench .fsel select { max-width: 100%; }
@media (min-width: 561px) and (max-width: 760px) {
  #bench .frow { flex-direction: column; align-items: stretch; }
  #bench .bfilters .fgroup, #bench .bfilters .fsel { width: 100%; }
  #bench #f-gen { width: 100%; }
}
@media (min-width: 561px) and (max-width: 760px) { #bench .bfilters .fgroup { flex-wrap: wrap; } #bench #f-gen { flex: 1 1 100%; } }
@media (min-width: 561px) and (max-width: 760px) { #bench .bfilters .fsel { flex-wrap: wrap; } #bench .bfilters .fsel select { flex: 1 1 100%; width: 100%; } }

/* ---------- the three task cards open their panel (js/taskpanel.js, user 11-22): the whole card is one button (stretched
   over the card); its metric chips are buttons above it that open the panel at that metric's definition */
#bench .tasks .task { cursor: pointer; transition: border-color .2s, box-shadow .2s; }
#bench .tasks .task:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
#bench .task .task-open { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; text-align: left; cursor: pointer; }
#bench .task .task-open::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
#bench .task .task-open:focus-visible { outline: none; }
#bench .task:has(.task-open:focus-visible) { outline: 2px solid var(--depth); outline-offset: 2px; }
#bench .task .meta { position: relative; z-index: 2; }
#bench .task .tchip { cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
#bench .task .tchip:hover, #bench .task .tchip:focus-visible { border-color: var(--ink); color: var(--ink); background: var(--surface); }
#bench .task .task-go { position: absolute; top: 24px; right: 22px; display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; color: var(--ink-3);
  transition: color .15s, transform .2s var(--ease); pointer-events: none; }
#bench .task .task-go svg { width: 13px; height: 13px; }
#bench .task:hover .task-go { color: var(--ink); transform: translateX(3px); }

/* ---------- the task panel */
dialog.tpanel { --tp-lbg: var(--panel); width: min(1180px, calc(100vw - 24px)); max-width: none; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); margin: auto;
  padding: 0; border: 0; border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(17, 19, 24, .28); overflow: auto; overscroll-behavior: contain; }
dialog.tpanel::backdrop { background: rgba(17, 19, 24, .42); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.tp-head { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 18px; background: rgba(255, 253, 249, .94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.tp-head .tag { flex: none; font: 700 13px var(--mono); letter-spacing: .02em; padding: 5px 10px; border-radius: 8px; background: var(--wall); color: #241c00; }
.tp-head h3 { flex: 1 1 200px; min-width: 0; margin: 0; font-size: clamp(18px, 1.9vw, 24px); font-weight: 760; letter-spacing: -.02em; line-height: 1.2; }
.tp-head h3:focus { outline: none; }
.tp-tabs { display: inline-flex; flex: none; padding: 3px; gap: 2px; border-radius: 999px; background: var(--panel); }
.tp-tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; font: 600 13px var(--mono); color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.tp-tabs button:hover { color: var(--ink); }
.tp-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(17, 19, 24, .14); }
.tp-task { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px 28px; padding: 18px 20px 22px; }
.tp-task[hidden] { display: none; }
.tp-col { display: grid; gap: 20px; align-content: start; min-width: 0; }
#taskpanel section.tp-sec { min-width: 0; margin: 0; padding: 0; }       /* not the page's section rhythm (v2.css pads every section) */
.tp-sec h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.tp-sec h4 .n { flex: none; width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--surface); font: 700 11px var(--mono); letter-spacing: 0; }
.tp-sec p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.tp-sec p + p { margin-top: 8px; }
.tp-sec .tp-scope { font-size: 13.5px; color: var(--ink-3); }
.tp-sec .note { font-size: 12.5px; line-height: 1.5; color: var(--ink-3); margin-top: 8px; }
.tp-case { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; color: var(--ink); }

/* 1. input -> output: three nodes of one height, arrows between */
.tp-strip { --ph: clamp(70px, 7.4vw, 100px); display: grid; grid-template-columns: minmax(0, 1.1fr) 22px minmax(0, .9fr) 22px minmax(0, 1.1fr); align-items: start; gap: 6px; }
.tp-node { margin: 0; min-width: 0; display: grid; gap: 7px; align-content: start; }
.tp-pic { position: relative; height: var(--ph); border-radius: 10px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.tp-pic img, .tp-pic canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tp-pic .tp-key { position: absolute; left: 6px; bottom: 6px; z-index: 1; height: 22px; padding: 0 7px; font-size: 11.5px; font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.tp-model { display: grid; place-items: center; border: 0; background: var(--ink); color: var(--surface); text-align: center; font-size: 13px; font-weight: 650; line-height: 1.25; }
.tp-out { display: grid; align-content: center; justify-items: start; gap: 6px; padding: 8px 10px; background: var(--surface); }
.tp-out .chip { max-width: 100%; height: 24px; }
.tp-out .chip i { font-family: "Times New Roman", serif; font-size: 13px; font-weight: 400; margin-left: 3px; }
.tp-node figcaption { font-size: 12.5px; line-height: 1.4; color: var(--ink-3); }
.tp-node figcaption b { display: block; color: var(--ink); font-size: 13px; font-weight: 650; }
.tp-arrow { height: var(--ph); background: var(--ink-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12'%3E%3Cpath d='M1 6h15M12 1.5 17 6l-5 4.5' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px 12px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12'%3E%3Cpath d='M1 6h15M12 1.5 17 6l-5 4.5' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px 12px no-repeat; }

/* 3. the metrics: name, formula, definition; a chip's jump lands on one and lights it briefly */
.tp-m { margin: 0 -12px; padding: 10px 12px; border-radius: 12px; scroll-margin-top: 90px; }
.tp-m + .tp-m::before { content: ""; display: block; height: 1px; margin: -10px 0 9px; background: var(--line); }
.tp-m:focus { outline: none; }
.tp-m:focus-visible { outline: 2px solid var(--depth); outline-offset: -2px; }
.tp-mn { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 3px; font-size: 15px; font-weight: 700; color: var(--ink); }
.tp-mn .dir { font: 600 13px var(--mono); color: var(--ink-3); }
.tp-mn .tp-where { font: 600 10.5px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 7px; }
.tp-f { margin: 6px 0; padding: 8px 11px; border-radius: 9px; background: var(--panel); font: 15px/1.55 "Times New Roman", "STIX Two Text", serif; color: var(--ink); overflow-wrap: anywhere; }
.tp-f sub, .tp-f sup, .tp-sec sub, .tp-sec sup { font-size: .72em; line-height: 0; }
.tp-m p, .tp-m li { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.tp-m ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.tp-m.tp-label { background: var(--tp-lbg); margin: 0 0 6px; }
.tp-m.tp-label .tp-f { background: var(--surface); }
.tp-m.tp-label + .tp-m::before { display: none; }
.tp-sec .tp-foot { margin-top: 10px; }
.tp-m.flash { animation: tpFlash 2.3s ease-out; }
.tp-m.tp-label.flash { animation-name: tpFlashL; }
@keyframes tpFlash { 0%, 35% { background: var(--wall-soft); box-shadow: inset 0 0 0 2px var(--wall); } 100% { background: transparent; box-shadow: inset 0 0 0 2px transparent; } }
@keyframes tpFlashL { 0%, 35% { background: var(--wall-soft); box-shadow: inset 0 0 0 2px var(--wall); } 100% { background: var(--tp-lbg); box-shadow: inset 0 0 0 2px transparent; } }

/* 4. the cases */
.tp-decs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tp-dec { margin: 0; min-width: 0; display: grid; gap: 8px; align-content: start; }
.tp-map { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--map-paper); border: 1px solid var(--line); }
.tp-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.tp-dec figcaption { display: grid; gap: 5px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.tp-dec figcaption > b { color: var(--ink); font-size: 13.5px; }
.tp-dec .tp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; }
.tp-dec .tp-row b { color: var(--ink); }
.tp-dec .tp-dim { color: var(--ink-3); font-size: 12.5px; }
.tp-dec .chip { height: 22px; font-size: 11.5px; }
.tp-legend i.cand { height: 2px; } .tp-legend i.cand.safe { background: var(--ours); } .tp-legend i.cand.unsafe { background: var(--raw); }
.tp-legend i.pick { height: 4px; background: var(--ink); }
.tp-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tp-tiles .tile { cursor: pointer; }
.tp-tiles .tile .lbl { font-size: 11.5px; padding: 3px 8px; }
.tp-tiles .tile .verdict { right: 8px; }
.tp-tiles .tile .verdict .chip { max-width: 100%; height: 22px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 20px; }
.tp-tiles .tile .verdict .chip::before { display: inline-block; vertical-align: 1px; margin-right: 5px; }
.tp-tiles .tp-first { cursor: default; }
.tp-first .tp-firstsvg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tp-player { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.tp-player .iconbtn { width: 38px; height: 38px; background: var(--ink); border-color: var(--ink); color: var(--surface); }
.tp-player .time { font: 500 12.5px var(--mono); color: var(--ink-3); }
.tp-top { aspect-ratio: 2 / 1; margin-top: 10px; }
@media (max-width: 560px) { .tp-top { aspect-ratio: 4 / 3; } }
.tp-exbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 8px; }
.tp-exbar .tp-case { margin: 0; }

/* phones and narrow windows: one column, in the order 1 2 3 4 */
@media (max-width: 860px) {
  .tp-task { display: flex; flex-direction: column; gap: 22px; padding: 16px 16px 20px; }
  .tp-col { display: contents; }
  .tp-io { order: 1; } .tp-test { order: 2; } .tp-score { order: 3; } .tp-ex { order: 4; }
}
@media (max-width: 560px) {
  dialog.tpanel { width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); border-radius: 18px; }
  .tp-head { padding: 10px 12px; gap: 8px 10px; }
  .tp-head h3 { flex-basis: calc(100% - 140px); font-size: 17px; }
  .tp-head .iconbtn { margin-left: auto; }
  .tp-tabs { order: 5; flex: 1 1 100%; }
  .tp-tabs button { flex: 1; padding: 6px 8px; }
  .tp-task { padding: 14px 12px 18px; }
  .tp-strip { --ph: 84px; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .tp-node { grid-template-columns: minmax(0, 44%) minmax(0, 1fr); align-items: center; gap: 10px; }
  .tp-arrow { height: 18px; width: 44%; transform: rotate(90deg); }
  .tp-decs, .tp-tiles { grid-template-columns: minmax(0, 1fr); }
  .tp-m { margin: 0 -8px; padding: 9px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .tp-m.flash, .tp-m.tp-label.flash { animation: none; background: var(--wall-soft); box-shadow: inset 0 0 0 2px var(--wall); }
}

/* ---------- Night View: the panel is the night's dark brown in gold light; the maps stay paper (mapdraw.js) */
[data-theme="night"] dialog.tpanel { --tp-lbg: rgba(255, 220, 170, .06); background: #1c130c; color: var(--ink);
  box-shadow: 0 0 0 1px rgba(240, 192, 58, .22), 0 0 60px -18px rgba(255, 170, 70, .28), 0 30px 80px rgba(0, 0, 0, .7); }
[data-theme="night"] dialog.tpanel::backdrop { background: rgba(8, 5, 3, .64); }
[data-theme="night"] .tp-head { background: rgba(28, 19, 12, .94); border-bottom-color: rgba(240, 192, 58, .16); }
[data-theme="night"] .tp-head h3 { text-shadow: 0 0 22px rgba(242, 194, 0, .14); }
[data-theme="night"] .tp-tabs { background: rgba(255, 220, 170, .07); }
[data-theme="night"] .tp-tabs button[aria-selected="true"] { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
[data-theme="night"] .tp-sec h4 .n { background: var(--wall); color: #241c00; }
[data-theme="night"] .tp-pic { border-color: var(--line); background: rgba(255, 220, 170, .05); }
[data-theme="night"] .tp-model { background: linear-gradient(180deg, #3a2716, #2a1c10); color: #f3d98f; box-shadow: inset 0 0 0 1px rgba(240, 192, 58, .3); }
[data-theme="night"] .tp-out { background: rgba(255, 220, 170, .04); }
[data-theme="night"] .tp-f { background: rgba(255, 220, 170, .06); }
[data-theme="night"] .tp-m.tp-label .tp-f { background: rgba(255, 220, 170, .07); }
[data-theme="night"] .tp-map, [data-theme="night"] .tp-top { border-color: rgba(240, 192, 58, .18); }
[data-theme="night"] .tp-player .iconbtn { background: var(--wall); border-color: var(--wall); color: #241c00; }
[data-theme="night"] #bench .tasks .task:hover { border-color: rgba(240, 192, 58, .3); }
[data-theme="night"] #bench .task .tchip:hover, [data-theme="night"] #bench .task .tchip:focus-visible { border-color: var(--wall); color: var(--ink); background: rgba(240, 192, 58, .1); }
