/* Retargeting beside the human demo, trajectory and grasp-proposal blocks (static/js/retarget-pane.js). Scene colours: hand #72A3FE, object 1 #FE4BA5, hand-object
   contact ramp #FEBAB4-#8A0013. Plot colours for the cost bars: ours #332288, others cyan #88CCEE, coverage rose #CC6677. */
.pv-segment { display:inline-flex; border:1px solid #c8d9f7; border-radius:8px; overflow:hidden; }
.pv-segment button { font:inherit; font-size:.9rem; border:0; background:white; color:#283c5b; padding:.5rem .95rem; cursor:pointer; min-height:40px; }
.pv-segment button+button { border-left:1px solid #c8d9f7; }
.pv-segment button[aria-pressed=true] { background:#edf3ff; font-weight:600; box-shadow:inset 0 -3px 0 #72A3FE; }
.pv-head,.pv-proposal { display:grid; grid-template-columns:76px 1fr 44px 120px 40px; gap:.6rem; align-items:center; }
.pv-head { align-items:end; font-size:.95rem; font-weight:600; color:var(--text-primary, #363636); padding:0 .6rem .45rem; line-height:1.3; }
.pv-head span:nth-child(2) { grid-column:2 / span 2; } .pv-head span:nth-child(3) { grid-column:4 / span 2; }
.pv-proposals { display:flex; flex-direction:column; gap:2px; }
.pv-proposal { font:inherit; font-size:.85rem; text-align:left; border:1px solid transparent; background:#f6f7fb; color:#242334; padding:.45rem .6rem; border-radius:6px; cursor:pointer; min-height:36px; }
.pv-proposal:hover { border-color:#c8d9f7; }
.pv-proposal[aria-pressed=true] { border-color:#72A3FE; background:#edf3ff; }
.pv-rank { font-weight:600; color:#535465; } .pv-proposal.is-chosen .pv-rank { color:#332288; }
.pv-num { font-variant-numeric:tabular-nums; text-align:right; color:#535465; }
.pv-bar,.pv-cover { height:12px; background:#e7e9f0; border-radius:3px; overflow:hidden; }
.pv-bar i,.pv-cover i { display:block; height:100%; width:var(--value); }
.pv-bar i { background:#88CCEE; } .pv-proposal.is-chosen .pv-bar i { background:#332288; }
.pv-cover i { background:#CC6677; }
.pane-label { position:absolute; left:.75rem; top:.6rem; font-size:.85rem; font-weight:600; color:#283c5b; background:rgba(255,255,255,.82); padding:.15rem .55rem; border-radius:6px; pointer-events:none; }
.robot-canvas { display:block; width:100%; height:100%; cursor:grab; }
.robot-canvas:active { cursor:grabbing; }
@media(max-width:600px) { .pv-head,.pv-proposal { grid-template-columns:62px 1fr 38px 1fr 36px; gap:.4rem; } }

.rt-head { display:flex; flex-wrap:wrap; align-items:center; gap:.6rem 1rem; padding:.85rem 1rem; }
.rt-head h3 { margin:0 auto 0 0; font-size:1.1rem; font-weight:700; color:#242334; }
.rt-trajectory.has-robot .demo-pair,.grasp-panel .demo-pair { display:grid; grid-template-columns:1fr 1fr; gap:2px; background:#d8e2f2; }
.rt-trajectory:not(.has-robot) .pane-label { display:none; }
.grasp-human-canvas { display:block; width:100%; height:100%; cursor:grab; }
.grasp-panel .pv-table { padding:0 1rem 1rem; }
.grasp-panel { margin-top:2rem; }
.grasp-panel .demo-toolbar .demo-select { margin-right:auto; }
@media(max-width:760px) { .rt-trajectory.has-robot .demo-pair,.grasp-panel .demo-pair { grid-template-columns:1fr; } }
.rt-head:has(> .pv-segment[hidden]) { display:none; }
/* The paper look (the supplementary video's renders): white stages; the canvas clears to white itself. */
.grasp-panel[data-look=paper] .demo-stage { background:#fff; }
.grasp-panel[data-look=paper] .demo-pair { background:#e3e8ef; }
/* Pressure-guided sampling: the source key and the replan / iteration strip (stacked share of each source). */
.sampling-panel .sampling-key { padding:0 1rem; }
.sampling-panel .sampling-key .k-dot { background:var(--c); box-shadow:none; }
.sampling-bar { display:flex; align-items:center; gap:.75rem; padding:.75rem 1rem 0; }
.sampling-play { flex:none; min-width:4.5rem; padding:.35rem .8rem; border:1px solid #c8d9f7; border-radius:8px; background:white; font:inherit; font-size:.85rem; font-weight:600; color:#283c5b; cursor:pointer; }
.sampling-play[aria-pressed=false] { background:#edf3ff; box-shadow:inset 0 -3px 0 #72A3FE; }
.sampling-caption { margin:0; font-size:.9rem; line-height:1.4; color:#283c5b; }
.sampling-caption b { font-weight:600; color:var(--c); }
.sampling-steps { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:.6rem; padding:.6rem 1rem 1rem; }
.sampling-group { display:flex; flex-direction:column; gap:.3rem; }
.sampling-group-label { font-size:.78rem; font-weight:600; color:var(--text-secondary,#5a6b85); }
.sampling-group-steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.3rem; }
.sampling-step { display:flex; flex-direction:column; gap:.3rem; padding:.35rem .4rem; border:1px solid #d8e2f2; border-radius:8px; background:white; font:inherit; font-size:.78rem; color:#283c5b; cursor:pointer; }
.sampling-step[aria-pressed=true] { border-color:#72A3FE; box-shadow:inset 0 -3px 0 #72A3FE; font-weight:600; }
.sampling-step .ss-bar { display:flex; height:10px; border-radius:3px; overflow:hidden; background:#eef1f5; }
.sampling-step .ss-bar i { display:block; width:var(--w); background:var(--c); }
.sampling-cloud-canvas { display:block; width:100%; height:100%; cursor:grab; }
.sampling-cloud-canvas:active { cursor:grabbing; }
.grasp-panel .demo-pair>.demo-stage { min-width:0; }
.sampling-caption .sampling-mode { color:var(--text-secondary,#5a6b85); }
.sampling-caption .sampling-note { display:block; margin-top:.2rem; color:var(--text-secondary,#5a6b85); font-style:italic; }
/* The MPC timeline in the sampling panel (as the MPPI video's): demo time left to right. */
.sampling-timeline { padding:.75rem 1rem 0; }
.st-track { position:relative; height:30px; border-radius:6px; background:#f1f4f8; overflow:hidden; }
.st-track>* { position:absolute; }
.st-window { top:0; bottom:0; background:#B4CFFE; }
.st-tick { top:0; bottom:0; width:1px; background:rgba(108,114,120,.45); }
.st-plan { top:9px; height:12px; background:rgba(114,163,254,.9); border-radius:2px; }
.st-exec { top:9px; height:12px; background:#1B4290; border-radius:2px 0 0 2px; }
.st-now { top:50%; width:11px; height:11px; margin:-5.5px 0 0 -5.5px; border-radius:50%; background:#1B4290; box-shadow:0 0 0 2px white; }
.st-replan { top:0; bottom:0; width:14px; margin-left:-7px; padding:0; border:0; background:transparent; cursor:pointer; }
.st-replan::after { content:""; position:absolute; left:6px; top:2px; bottom:2px; width:2px; background:#283c5b; border-radius:1px; opacity:.55; }
.st-replan[aria-pressed=true]::after { opacity:1; }
.st-close { top:0; bottom:0; width:2px; margin-left:-1px; background:#CC272E; }
.st-axis { position:relative; height:1.1rem; font-size:.72rem; color:var(--text-secondary,#5a6b85); }
.st-axis span { position:absolute; transform:translateX(-50%); top:2px; white-space:nowrap; }
.st-axis span:first-child { transform:none; }
.st-axis span.is-end { transform:translateX(-100%); }
.st-key { margin-top:.35rem !important; }
/* Wide screens: the panels use the width to stay within one window's height. Grasp panel: the two views, then the
   proposals as a column beside them. Sampling panel: the two views with the timeline under them, and the caption,
   key and rounds in a column beside them. */
@media(min-width:1100px) {
  .grasp-panel { display:grid; grid-template-columns:minmax(0,1fr) 330px; }
  .grasp-panel>.demo-toolbar { grid-column:1 / -1; }
  .grasp-panel>.demo-pair { align-self:stretch; }
  .grasp-panel .demo-stage { height:auto; min-height:clamp(360px,calc(100vh - 330px),470px); }
  .grasp-panel .pv-proposals { gap:3px; }
  .grasp-panel .pv-proposal { min-height:0; }
  .grasp-panel:not(.sampling-panel)>.demo-pair { grid-column:1; grid-row:2; }
  .grasp-panel:not(.sampling-panel)>.pv-table { grid-column:2; grid-row:2; padding:.75rem .9rem; border-left:1px solid #e3e8ef; overflow:auto; }
  .grasp-panel .pv-head { display:flex; flex-direction:column; gap:.25rem; padding:0 0 .6rem; font-size:.8rem; }
  .grasp-panel .pv-head span:first-child { display:none; }
  .grasp-panel .pv-head span::before { content:""; display:inline-block; width:18px; height:8px; margin-right:.45rem; border-radius:2px; vertical-align:middle; }
  .grasp-panel .pv-head span:nth-child(2)::before { background:#88CCEE; }
  .grasp-panel .pv-head span:nth-child(3)::before { background:#CC6677; }
  .grasp-panel .pv-proposal { grid-template-columns:58px minmax(0,1fr) 38px; grid-template-rows:auto auto; row-gap:3px; padding:.3rem .55rem; line-height:1.15; font-size:.8rem; }
  .grasp-panel .pv-proposal .pv-rank { grid-row:1 / span 2; }
  .grasp-panel .pv-proposal .pv-bar,.grasp-panel .pv-proposal .pv-cover { height:9px; }
  .grasp-panel .pv-proposal .pv-cover { grid-column:2; grid-row:2; }
  .grasp-panel .pv-proposal .pv-num:last-child { grid-column:3; grid-row:2; }

  .sampling-panel { grid-template-rows:auto auto auto minmax(0,1fr) auto; }
  .sampling-panel>.demo-pair { grid-column:1; grid-row:2 / span 3; }
  .sampling-panel>.sampling-bar { grid-column:2; grid-row:2; flex-direction:column; align-items:stretch; gap:.5rem; padding:.8rem .9rem 0; border-left:1px solid #e3e8ef; }
  .sampling-panel>.sampling-bar .sampling-play { align-self:flex-start; }
  .sampling-panel .sampling-caption { min-height:5.6em; font-size:.85rem; }
  .sampling-panel>.sampling-key { grid-column:2; grid-row:3; margin:0; padding:.6rem .9rem 0; border-left:1px solid #e3e8ef; display:grid; grid-template-columns:1fr 1fr; gap:.35rem .75rem; font-size:.8rem; }
  .sampling-panel>.sampling-steps { grid-column:2; grid-row:4; align-content:start; grid-template-columns:minmax(0,1fr); gap:.5rem; padding:.7rem .9rem .9rem; border-left:1px solid #e3e8ef; overflow:auto; }
  .sampling-panel>.sampling-timeline { grid-column:1 / -1; grid-row:5; padding:.6rem 1rem .8rem; border-top:1px solid #e3e8ef; }
}
