/* EPCC project page. Light only: the paper figures are drawn on white. */
:root {
  color-scheme: light;
  --ink: #1b1b1b;
  --text: #333333;
  --muted: #6b6b6b;
  --faint: #9c9c9c;
  --rule: #e6e6e6;
  --panel: #fafafa;
  --panel-2: #f2f2f2;
  --epcc: #0072B2;         /* paper's EPCC blue: data marks and swatches only */
  --epcc-ink: #00588a;     /* links, labels, highlights */
  --epcc-tint: #eaf2fb;    /* paper's table tint */
  --base: #8c8c8c;         /* baselines */
  --ok: #1a7f37;
  --bad: #b23f37;
  --measure: 46rem;        /* running text */
  --wide: 62rem;           /* figures */
  --full: 72rem;           /* interactive */
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: #ffffff; color: var(--text); }
body { font-family: var(--sans); font-size: 17px; line-height: 1.65; font-feature-settings: 'cv11', 'ss01'; }
a { color: var(--epcc-ink); text-decoration: none; border-bottom: 1px solid rgba(0, 88, 138, .3); }
a:hover { border-bottom-color: var(--epcc-ink); }
h1, h2, h3, h4 { color: var(--ink); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin: 0; }
p { margin: 0 0 1rem; }
code, .mono { font-family: var(--mono); font-size: .9em; }
img, video, svg { max-width: 100%; height: auto; }
mjx-container[display="true"] { margin: .6rem 0 !important; overflow-x: auto; overflow-y: hidden; }

.measure { max-width: var(--measure); margin-left: auto; margin-right: auto; padding: 0 16px; }
.wide { max-width: var(--wide); margin-left: auto; margin-right: auto; padding: 0 16px; }
.full { max-width: var(--full); margin-left: auto; margin-right: auto; padding: 0 16px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
          border-bottom: 1px solid var(--rule); }
.topbar .full { display: flex; align-items: center; justify-content: space-between; height: 48px; gap: 1rem; }
.topbar .brand { font-weight: 600; color: var(--ink); border: 0; white-space: nowrap; display: flex; align-items: center; gap: .5rem; }
.topbar .brand img { width: 20px; height: 20px; }
.topbar nav { display: flex; gap: 1.25rem; overflow-x: auto; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a { font-size: .86rem; color: var(--muted); border: 0; white-space: nowrap; }
.topbar nav a:hover { color: var(--ink); }

/* Header */
.hero { text-align: center; padding: 3.5rem 0 1.5rem; }
.hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); max-width: 52rem; margin: 0 auto .9rem; }
.hero h1 .sub { display: block; font-weight: 500; color: var(--muted); font-size: .62em; margin-top: .5rem; letter-spacing: 0; }
.hero .byline { color: var(--muted); font-size: 1rem; }
.hero .byline span + span::before { content: '·'; margin: 0 .55rem; color: var(--faint); }
.hero .actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem; border-radius: 999px; font-size: .9rem;
       font-weight: 500; border: 1px solid var(--rule); color: var(--ink); background: #fff; cursor: pointer; font-family: inherit; }
.btn:hover { border-color: #bdbdbd; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.btn[aria-disabled="true"] { color: var(--faint); cursor: default; }
.btn[aria-disabled="true"]:hover { border-color: var(--rule); }
.btn svg { vertical-align: -3px; }

/* Figures */
figure { margin: 1.5rem auto; }
figure img, figure video { display: block; margin: 0 auto; }
figcaption { font-size: .9rem; line-height: 1.55; color: var(--muted); margin-top: .7rem; max-width: var(--measure);
             margin-left: auto; margin-right: auto; }
figcaption b { color: var(--text); font-weight: 600; }
.teaser { padding-top: 1rem; }
.teaser img { width: 100%; }

/* Abstract */
details.abstract { margin: 1.4rem auto 0; }
details.abstract summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .6rem; font-size: .8rem;
                           text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
details.abstract summary::-webkit-details-marker { display: none; }
details.abstract summary .chev { width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
                                 transform: rotate(45deg); transition: transform .2s; margin-top: -3px; }
details.abstract[open] summary .chev { transform: rotate(-135deg); margin-top: 3px; }
details.abstract p { font-size: 1rem; color: var(--text); margin-top: .8rem; }

/* Sections */
section.part { padding: 3.5rem 0 1rem; border-top: 1px solid var(--rule); margin-top: 3rem; }
.kicker { font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.kicker b { color: var(--epcc-ink); font-weight: 600; }
section.part h2, section.hero-ex h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); margin-bottom: 1rem; }
section.part h3 { font-size: 1.15rem; margin: 2.2rem 0 .6rem; }
.lead { font-size: 1.08rem; }

.tldr { display: grid; grid-template-columns: auto 1fr; gap: .8rem; align-items: baseline; margin: 1.2rem 0 1.6rem; padding: .9rem 1.1rem;
        background: var(--epcc-tint); border-left: 3px solid var(--epcc); border-radius: 0 8px 8px 0; color: var(--ink); }
.tldr .tag { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--epcc-ink); font-weight: 600; }
.tldr p { margin: 0; font-size: 1.02rem; }

/* Deep dive */
details.deep { margin: 1.4rem 0; border: 1px solid var(--rule); border-radius: 10px; background: #fff; }
details.deep summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .7rem; padding: .85rem 1.1rem; color: var(--ink); font-weight: 500; }
details.deep summary::-webkit-details-marker { display: none; }
details.deep summary .pill { font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
                             border: 1px solid var(--rule); border-radius: 999px; padding: .15rem .55rem; background: var(--panel); flex: none; }
details.deep summary .chev { margin-left: auto; width: 10px; height: 10px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
                             transform: rotate(45deg); transition: transform .2s; flex: none; }
details.deep[open] summary .chev { transform: rotate(-135deg); }
details.deep[open] summary { border-bottom: 1px solid var(--rule); }
details.deep .body { padding: 1rem 1.1rem .4rem; font-size: .97rem; }
details.deep .body figure { margin: 1rem auto; }
details.deep .body p:last-child { margin-bottom: .6rem; }
details.deep .body ul { padding-left: 1.2rem; margin: 0 0 1rem; }
details.deep .body li { margin-bottom: .3rem; }

/* Method steps */
.steps { counter-reset: step; margin-top: 1.5rem; }
.step { display: grid; grid-template-columns: 2.2rem 1fr; gap: .8rem; padding: 1.2rem 0; border-top: 1px solid var(--rule); }
.step::before { counter-increment: step; content: counter(step); width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 1px solid var(--ink);
                color: var(--ink); font-size: .8rem; font-weight: 600; display: grid; place-items: center; margin-top: .15rem; }
.step h3 { margin: 0 0 .25rem !important; }
.step .one { color: var(--epcc-ink); font-weight: 500; margin-bottom: .6rem; }
.step p:last-child { margin-bottom: 0; }
.eq { overflow-x: auto; padding: .2rem 0; }

/* Tables */
table.data { border-collapse: collapse; margin: 1rem auto; font-size: .93rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: .45rem .9rem; text-align: center; border-bottom: 1px solid var(--rule); }
table.data th { font-weight: 600; color: var(--ink); border-bottom: 1px solid #cfcfcf; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data tr.ours td { color: var(--ink); font-weight: 600; background: var(--epcc-tint); }
table.data td b { color: var(--ink); }
table.data small { font-size: .72em; color: var(--muted); font-weight: 400; }
table.data .tp { background: #f5f9fd; }
table.data tr.ours td.tp { background: #dbe9f6; }
table.data.full-t { font-size: .86rem; }
table.data.full-t th, table.data.full-t td { padding: .38rem .5rem; }
table.data.full-t .sep { border-left: 1px solid var(--rule); }
table.data.full-t tr.group th { border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: .78rem; font-weight: 600; }
.table-scroll { overflow-x: auto; }
.tcap { font-size: .86rem; color: var(--muted); text-align: center; max-width: var(--measure); margin: .2rem auto 1.4rem; line-height: 1.5; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.pair figure { margin: .8rem 0; }

/* What's next */
.next { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .8rem; }
.next li { padding: 1rem 1.1rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel); }
.next li b { display: block; color: var(--ink); margin-bottom: .2rem; }

/* BibTeX + footer */
pre { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 1rem 1.1rem; overflow-x: auto;
      font-family: var(--mono); font-size: .85rem; line-height: 1.5; color: var(--ink); }
footer { border-top: 1px solid var(--rule); margin-top: 3rem; padding: 2rem 16px 3rem; text-align: center; color: var(--muted); font-size: .88rem; }

/* ---------- TL;DR card ---------- */
.summary { margin-top: 1.6rem; padding: 1.2rem 1.3rem 1.3rem; border: 1px solid var(--rule); border-left: 3px solid var(--epcc);
           border-radius: 0 12px 12px 0; background: var(--epcc-tint); }
.summary-stack { display: flex; flex-direction: column; gap: .2rem; }
.summary .tag { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--epcc-ink); font-weight: 600; }
.summary p { margin: .4rem 0 .9rem; font-size: 1.02rem; color: var(--ink); }
.summary a:not(.btn) { border-bottom: 1px solid rgba(0, 88, 138, .45); }
.summary .btn { align-self: center; margin-top: 1.1rem; }
.summary .mini { display: block; overflow-x: auto; }
.summary table.data tr.ours td { background: var(--ink); color: #fff; font-weight: 600; }
.summary table.data { margin: 0 auto; background: #fff; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.summary table.data th, .summary table.data td { padding: .38rem .9rem; }
.summary table.data th:first-child { font-weight: 500; color: var(--muted); font-size: .8rem; }
.summary table.data td b { font-weight: 700; }
.summary .mini-cap { font-size: .78rem; color: var(--muted); margin-top: .45rem; line-height: 1.4; text-align: center; }

/* ---------- Real-robot video ---------- */
section.hero-ex { padding-top: 3rem; }
.uth video { width: 100%; border-radius: 8px; background: #111; aspect-ratio: 1152 / 526; }

/* Real robot: task box + rollout box side by side. Column widths follow the videos' aspect ratios
   (448/448 and 904/448), corrected for each box's padding and border, so both videos have the same height. */
.robot-row { --p: .6rem; display: grid; gap: 1rem; margin-top: 1rem; align-items: stretch;
             grid-template-columns: calc((100% - 1rem - 4 * var(--p) - 4px) * .3314 + 2 * var(--p) + 2px)
                                    calc((100% - 1rem - 4 * var(--p) - 4px) * .6686 + 2 * var(--p) + 2px); }
.rbox { margin: 0; padding: var(--p); border: 1px solid var(--rule); border-radius: 12px; background: #fff; min-width: 0; }
.rbox-h { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
          font-weight: 600; margin: .05rem .1rem .45rem; }
.rbox video { display: block; width: 100%; border-radius: 8px; background: var(--panel-2); }
.rbox:first-child video { aspect-ratio: 1 / 1; }
.rbox:last-child video { aspect-ratio: 904 / 448; }
.rbox figcaption { margin: .5rem .1rem 0; font-size: .86rem; max-width: none; }
.robot-row + details.deep { margin-top: 1.2rem; }

/* ---------- Play + Expert = ? ---------- */
.explorer { position: relative; border: 1px solid var(--rule); border-radius: 14px; background: #fff; padding: 1rem 1.1rem 1rem; margin-top: 1.2rem; }
.ex-bar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; padding: 3px; background: var(--panel); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; font: inherit; font-family: var(--mono); font-size: .84rem; color: var(--muted);
              padding: .35rem .95rem; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.seg button.on { background: var(--ink); color: #fff; }
.info { position: relative; margin-left: auto; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 1px solid var(--rule); color: var(--muted);
        display: grid; place-items: center; font-size: .8rem; font-weight: 600; cursor: help; user-select: none; }
.info .tip { display: none; position: absolute; right: 0; top: 2rem; width: 24rem; padding: .7rem .85rem; background: #fff; border: 1px solid #d9d9d9;
             border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.12); font-size: .82rem; font-weight: 400; color: var(--text); line-height: 1.5; z-index: 6; cursor: auto; }
.info:hover .tip, .info:focus .tip, .info:focus-within .tip { display: block; }
.info .tip b { color: var(--ink); }

.pe { display: grid; grid-template-columns: minmax(0, 1.25fr) auto minmax(0, .8fr) auto minmax(0, 1.55fr); align-items: start; column-gap: .9rem; }
.pe-op { font-family: var(--mono); font-size: 2rem; color: var(--faint); align-self: start; line-height: 1; padding-top: 7.5rem; }
.pe-h { font-family: var(--mono); font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600;
        height: 1.7rem; display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.pe-h .sw { width: 9px; height: 9px; border-radius: 50%; background: var(--epcc); display: inline-block; }
.pe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.pe-card { position: relative; display: flex; flex-direction: column; gap: .25rem; padding: .35rem; border: 1px solid var(--rule); border-radius: 10px;
           background: #fff; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.pe-card:hover { border-color: #bdbdbd; }
.pe-card.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.pe-card.off video { opacity: .28; filter: grayscale(1); }
.pe-card video { width: 100%; aspect-ratio: 1 / 1; border-radius: 6px; background: var(--panel-2); display: block; }
.pe-card .lab { display: flex; justify-content: space-between; align-items: baseline; gap: .3rem; font-size: .8rem; }
.pe-card .lab b { font-family: var(--mono); color: var(--ink); font-weight: 600; font-size: .86rem; white-space: nowrap; }
.pe-card .lab span { color: var(--muted); font-size: .74rem; }
.pe-none { margin-top: .55rem; width: 100%; border: 1px dashed #cfcfcf; border-radius: 10px; background: var(--panel); font: inherit; font-size: .8rem;
           color: var(--muted); padding: .4rem .6rem; cursor: pointer; }
.pe-none.on { border: 1px solid var(--ink); color: var(--ink); background: #fff; box-shadow: 0 0 0 1px var(--ink) inset; }
.switch { display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; color: var(--muted); margin-top: .1rem; }
.switch i { width: 30px; height: 17px; border-radius: 999px; background: #cfcfcf; position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: left .15s; }
.pe-card.on .switch i { background: var(--ink); }
.pe-card.on .switch i::after { left: 15px; }
.pe-result { border: 1px solid var(--rule); border-radius: 12px; background: var(--panel); padding: .6rem; }
.pe-result video { width: 100%; aspect-ratio: 1 / 1; border-radius: 8px; background: #fff; display: block; border: 1px solid var(--rule); }
.pe-what { font-size: .9rem; color: var(--ink); font-weight: 600; margin: 0 0 .45rem; line-height: 1.35; }
.pe-what span { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.pe-empty { aspect-ratio: 1 / 1; border: 1px dashed #cfcfcf; border-radius: 8px; display: grid; place-items: center; color: var(--muted); font-size: .86rem;
            text-align: center; padding: 1rem; background: #fff; }
.pe-empty.small { font-size: .72rem; padding: .4rem; line-height: 1.35; }
.pe-starts { display: flex; align-items: center; gap: .4rem; margin: .55rem 0 .2rem; flex-wrap: wrap; }
.pe-starts .l { font-size: .74rem; color: var(--muted); margin-right: .1rem; }
.pe-starts button { border: 1px solid var(--rule); background: #fff; border-radius: 8px; padding: 2px; cursor: pointer; line-height: 0; }
.pe-starts button img { width: 40px; height: 40px; border-radius: 6px; }
.pe-starts button.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.pe-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: .45rem; }
.pe-stats div { background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: .3rem .45rem; }
.pe-stats b { display: block; font-family: var(--mono); font-size: 1.02rem; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pe-stats span { font-size: .7rem; color: var(--muted); }
.pe-note { font-size: .74rem; color: var(--muted); margin-top: .4rem; line-height: 1.4; }
.chip { display: inline-block; font-size: .72rem; font-weight: 600; line-height: 1.4; padding: 0 .5rem; border-radius: 999px; border: 1.5px solid; margin-left: .3rem; }
.chip.ok { color: var(--ok); border-color: var(--ok); }
.chip.bad { color: var(--bad); border-color: var(--bad); }
.ex-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1.5rem; margin-top: .9rem; padding-top: .7rem; border-top: 1px solid var(--rule);
           font-size: .8rem; color: var(--muted); line-height: 1.45; }

/* Coasting sweep */
.pe-slider { margin-top: .6rem; }
.pe-slider input[type=range] { width: 100%; accent-color: var(--ink); margin: 0; }
.pe-ticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .64rem; color: var(--faint); margin-top: .1rem; }
.pe-ticks span.on { color: var(--ink); font-weight: 600; }
.pe-tau { font-family: var(--mono); font-size: .86rem; color: var(--ink); font-weight: 600; margin-top: .45rem; }
.pe-tau span { font-family: var(--sans); font-weight: 400; color: var(--muted); font-size: .76rem; margin-left: .3rem; }
.pe-card.fixed { cursor: default; }
.pe-card.fixed:hover { border-color: var(--ink); }
table.pe-mt { width: 100%; border-collapse: collapse; margin-top: .45rem; font-size: .8rem; font-variant-numeric: tabular-nums; background: #fff;
              border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
table.pe-mt th, table.pe-mt td { padding: .28rem .5rem; text-align: right; border-bottom: 1px solid var(--rule); }
table.pe-mt th { font-weight: 600; color: var(--muted); font-size: .72rem; }
table.pe-mt th:first-child, table.pe-mt td:first-child { text-align: left; }
table.pe-mt tr.ours td { background: var(--epcc-tint); color: var(--ink); font-weight: 600; }
table.pe-mt td b { font-family: var(--mono); font-weight: 600; }
.pe-compare { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin-top: .5rem; }
.pe-compare:empty { display: none; }
.pe-compare figure { margin: 0; }
.pe-compare video { width: 100%; aspect-ratio: 1 / 1; border-radius: 6px; border: 1px solid var(--rule); background: #fff; display: block; }
.pe-compare figcaption { font-size: .74rem; margin-top: .2rem; color: var(--muted); display: flex; justify-content: space-between; align-items: center; max-width: none; }
.pe-compare figcaption b { color: var(--ink); font-weight: 600; }

/* References */
.refs { padding-left: 1.6rem; font-size: .92rem; color: var(--text); }
.refs li { margin-bottom: .5rem; }
.refs li:target { background: var(--epcc-tint); }
a.cite { font-size: .78em; vertical-align: super; line-height: 0; border: 0; margin-left: .1em; }

@media (max-width: 960px) {
  .pe { grid-template-columns: 1fr; row-gap: .6rem; }
  .pe-op { padding: 0; text-align: center; font-size: 1.6rem; }
  .pe-grid { grid-template-columns: repeat(4, 1fr); }
  .pe-expert .pe-card { max-width: 12rem; }
  .pe-result { max-width: 30rem; }
  .pair { grid-template-columns: 1fr; }
  .robot-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .pe-grid { grid-template-columns: repeat(2, 1fr); }
  .tldr { grid-template-columns: 1fr; gap: .3rem; }
  .step { grid-template-columns: 1fr; }
  .step::before { margin-bottom: .2rem; }
  .topbar nav { display: none; }
  .info .tip { width: 16rem; }
  .summary { padding: 1rem .8rem 1.1rem; }
  .summary table.data th, .summary table.data td { padding: .3rem .4rem; font-size: .82rem; }
}

/* coasting-sweep result: metric table spans the stats row; compact comparison tiles */
#pe-stats > table.pe-mt { grid-column: 1 / -1; }
table.pe-mt td, table.pe-mt th { white-space: nowrap; }
.pe-compare { max-width: 22rem; }

/* dynamics-awareness column of the main benchmark */
table.data .dyn { font-family: var(--mono); font-size: .76rem; color: var(--muted); text-align: left; white-space: nowrap; }
table.data tr.ours td.dyn { color: var(--epcc-ink); font-weight: 600; }

/* numbered sub-questions inside an experiments section */
section.part h3 .qn { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; margin-right: .55rem;
                      border-radius: 50%; border: 1px solid var(--ink); font-size: .74rem; font-weight: 600; vertical-align: .12em; }
.fig-mid figure { max-width: 38rem; margin: .6rem auto 1.2rem; }

/* ---------- Explorer v2: three equal boxes + comparison chart ---------- */
.pe4 { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) minmax(0, 1.15fr);
       column-gap: .7rem; align-items: stretch; }
.pe4 .pe-op { align-self: center; padding: 0; font-size: 1.7rem; }
.pbox { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: 12px; padding: .55rem; background: #fff; min-width: 0; }
.pbox.result { background: var(--panel); }
.pbox .pe-h { height: 1.5rem; }
.pstage { position: relative; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: #fff; border: 1px solid var(--rule); }
.pstage video, .pstage img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pstage .pe-empty { position: absolute; inset: 0; aspect-ratio: auto; border: 0; border-radius: 0; }
.pstage.off video { opacity: .25; filter: grayscale(1); }
.pctl { min-height: 4.1rem; margin-top: .5rem; display: flex; flex-direction: column; justify-content: center; gap: .3rem; }
.pctl .lab { display: flex; justify-content: space-between; align-items: baseline; font-size: .8rem; }
.pctl .lab b { font-family: var(--mono); color: var(--ink); font-weight: 600; font-size: .86rem; white-space: nowrap; }
.pctl .lab span { color: var(--muted); font-size: .74rem; }
.pctl input[type=range] { width: 100%; accent-color: var(--ink); margin: 0; }
.pticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .64rem; color: var(--faint); }
.pticks span { cursor: pointer; }
.pticks span.on { color: var(--ink); font-weight: 600; }
.pctl .switch { cursor: pointer; background: none; border: 0; padding: 0; font: inherit; font-size: .78rem; color: var(--muted); }
.pctl .switch.on i { background: var(--ink); }
.pctl .switch.on i::after { left: 15px; }
.pe-stats.pctl { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; align-content: center; }
.pchart { min-width: 0; padding-left: .3rem; }
.pchart svg { display: block; width: 100%; height: auto; }
.pchart svg text { font-family: var(--mono); }
.chart-legend { display: flex; flex-wrap: wrap; gap: .2rem .8rem; font-family: var(--mono); font-size: .7rem; color: var(--muted); margin-top: .3rem; }
.chart-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: .3rem; }
.ics { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.ics .l { font-size: .74rem; color: var(--muted); margin-right: .15rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.ics button { position: relative; border: 1px solid var(--rule); background: #fff; border-radius: 8px; padding: 2px; cursor: pointer; line-height: 0; }
.ics button img { width: 38px; height: 38px; border-radius: 6px; }
.ics button.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.ics button .rec { position: absolute; top: -7px; right: -7px; width: 17px; height: 17px; border-radius: 50%; background: var(--ink);
                   color: #fff; font-size: .62rem; line-height: 17px; text-align: center; }
.ex-title { font-family: var(--mono); font-size: .84rem; font-weight: 600; color: var(--ink); }
.sw-base { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; min-height: 4.1rem; }
.sw-base figure { margin: 0; display: grid; grid-template-columns: 2.6rem 1fr; gap: .3rem; align-items: center; }
.sw-base figure video, .sw-base figure .mini { width: 2.6rem; height: 2.6rem; border-radius: 5px; border: 1px solid var(--rule); object-fit: cover; }
.sw-base figure .mini { display: grid; place-items: center; font-size: .56rem; color: var(--faint); background: #fff; text-align: center; line-height: 1.1; }
.sw-base figcaption { margin: 0; font-size: .72rem; color: var(--muted); max-width: none; line-height: 1.3; }
.sw-base figcaption b { color: var(--text); font-family: var(--mono); }
details.sweep-box { margin-top: 1.4rem; }
details.sweep-box .body > p { max-width: var(--measure); }
@media (max-width: 960px) {
  .pe4 { grid-template-columns: 1fr; row-gap: .6rem; }
  .pe4 .pe-op { text-align: center; }
  .pbox { max-width: 24rem; width: 100%; margin: 0 auto; }
  .pchart { max-width: 26rem; width: 100%; margin: 0 auto; padding: 0; }
}

.pe-stats.pctl div { min-width: 0; }
.pe-stats.pctl b { white-space: nowrap; font-size: .92rem; }
