/* Scoped additions preserve the paper website's typography and orange accent. */
.interactive-figure { margin: 0; }
/* Not clipped, so outlines of regions at the image edge stay fully visible. */
.figure-canvas { position: relative; }
.figure-canvas > img { display: block; margin-bottom: 0; }
.figure-canvas.has-chart > .chart-fallback { display: none; }

/* Hotspots: the active region gets an orange border; the rest of the image is left as is. */
.hotspot-layer { position: absolute; inset: 0; pointer-events: none; }
.hotspot-region {
  position: absolute;
  display: block;
  padding: 0;
  margin: 0;
  border: 1.5px dashed transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  transition: border-color 0.18s ease;
}
.figure-canvas:hover .hotspot-region { border-color: rgba(196, 91, 40, 0.45); }
.figure-canvas.is-spotlit .hotspot-region { border-color: transparent; }
.figure-canvas.is-spotlit .hotspot-region.is-active {
  z-index: 1;
  border: 3px solid var(--i3l-orange, #c45b28);
  box-shadow: 0 0 0 1px #fff, 0 2px 10px rgba(0, 0, 0, 0.25);
}
.hotspot-region:focus-visible { outline: 3px solid #176b9d; outline-offset: 1px; }

/* Followed task: highlighted everywhere it appears on the page. */
.hotspot-region.is-task-selected,
.figure-canvas.is-spotlit .hotspot-region.is-task-selected {
  z-index: 1;
  border: 3px solid var(--i3l-orange, #c45b28);
  box-shadow: 0 0 0 1px #fff;
}
.rollout-tile.is-task-selected .rollout-frame { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--i3l-orange, #c45b28); }
.rollout-tile.is-task-selected .rollout-task { color: #843911; }
.results-table tr.is-task-selected { outline: 2px solid var(--i3l-orange, #c45b28); outline-offset: -2px; }
.results-table tr.is-task-selected td:first-child { font-weight: 600; }
.viz-stacked.has-task-match .viz-stack-row:not(.is-task-selected) { opacity: 0.3; }
.viz-stack-row.is-task-selected .viz-stack-label { color: #843911; font-weight: 700; }
.viz-stack-row { transition: opacity 0.15s ease; }
.task-follow {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  max-width: calc(100vw - 2rem);
  padding: 0.4rem 0.45rem 0.4rem 0.95rem;
  border-radius: 999px;
  background: #241a14;
  color: #f1e6dd;
  box-shadow: 0 4px 18px #0005;
  font-size: 0.85rem;
  transform: translateX(-50%);
}
.task-follow[hidden] { display: none; }
.task-follow-name { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-follow-clear {
  margin-left: 0.4rem;
  padding: 0.25rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: var(--i3l-orange, #c45b28);
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.task-follow-clear:focus-visible { outline: 3px solid #8cc7ef; outline-offset: 2px; }
.figure-hint-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 4px #0002;
  color: #843911;
  font-size: 0.72rem;
  font-weight: 600;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.figure-canvas:hover .figure-hint-badge, .figure-canvas.was-explored .figure-hint-badge,
.figure-canvas:focus-within .figure-hint-badge { opacity: 0; }

/* Shared tooltip */
.viz-tip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  max-width: min(300px, calc(100vw - 16px));
  padding: 0.5rem 0.7rem;
  border-radius: 7px;
  background: #241a14;
  color: #fff;
  box-shadow: 0 4px 16px #0004;
  font-size: 0.8rem;
  line-height: 1.4;
  pointer-events: none;
}
.viz-tip[hidden] { display: none; }
.viz-tip-title { display: block; color: #fff; font-weight: 600; }
.viz-tip-body { display: block; color: #f1e6dd; font-variant-numeric: tabular-nums; }

/* Charts drawn from data */
.viz { margin-top: 0.25rem; }
.viz-panels { display: grid; gap: 0.5rem 1rem; }
.viz-trends .viz-panels { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.viz-lines .viz-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.viz-panel { margin: 0; min-width: 0; }
.viz-panel-title { font-size: 0.9rem; font-weight: 600; color: #363636; }
.viz-panel-axis { font-size: 0.72rem; color: #6a6a6a; margin-bottom: 0.15rem; }
.viz-svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz-grid line { stroke: #e3ddd7; stroke-width: 1; }
.viz-grid .viz-axis { stroke: #555; stroke-width: 1.2; }
.viz-tick { font-size: 10.5px; fill: #555; font-family: inherit; }
.viz-note { font-size: 9.5px; fill: #555; }
.viz-dot, .viz-mean-dot, .viz-bar, .viz-baseline, .viz-segment, .viz-line, .viz-mean-line, .viz-task-line {
  transition: opacity 0.15s ease;
}
.viz-dot { opacity: 0.7; stroke: transparent; stroke-width: 9; cursor: pointer; }
.viz-dot.is-solid { opacity: 1; }
.viz-mean-dot { stroke: #fff; stroke-width: 1.5; cursor: pointer; }
.viz-mean-line, .viz-line, .viz-task-line { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.viz-mean-line { stroke-width: 3; }
.viz-line { stroke-width: 2.2; }
.viz-task-line { stroke-width: 2; opacity: 0; pointer-events: none; }
.viz-task-line.is-focus { opacity: 1; }
.viz-dot.is-focus { opacity: 1; stroke: #fff; stroke-width: 1.2; }
.viz-bar { fill: #69979a; cursor: pointer; }
.viz-bar.is-final { fill: #b85c00; }
.viz-final-band { fill: #f1f0ee; }
.viz-baseline line { stroke: #777; stroke-width: 1.4; stroke-dasharray: 4 3; }
.viz-baseline .viz-hit { stroke: transparent; stroke-width: 10; stroke-dasharray: none; cursor: pointer; }
.viz .is-dim { opacity: 0.15; }
.viz .viz-task-line.is-dim { opacity: 0; }
.viz .viz-segment.is-dim { opacity: 0.3; }
.viz .viz-legend-item.is-dim { opacity: 0.45; }
.viz .viz-bar.is-dim, .viz .viz-baseline.is-dim { opacity: 0.3; }
.viz-dot:focus, .viz-mean-dot:focus, .viz-bar:focus, .viz-baseline:focus { outline: none; }
.viz-dot:focus-visible, .viz-mean-dot:focus-visible, .viz-bar:focus-visible { stroke: #176b9d; stroke-width: 3; }
.viz-baseline:focus-visible line:first-child { stroke: #176b9d; }

.viz-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 0.4rem; margin-top: 0.6rem; }
.viz-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 30px;
  padding: 0.15rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: #363636;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.viz-legend-item:hover, .viz-legend-item[aria-pressed="true"] { border-color: #d6cec8; background: #fff; }
.viz-legend-item:focus-visible { outline: 3px solid #176b9d; outline-offset: 1px; }
.viz-swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--series-color); flex: none; }
.viz-swatch.is-line { width: 16px; height: 3px; border-radius: 2px; }

.viz-stack-rows { display: grid; gap: 0.55rem; margin-top: 0.6rem; }
.viz-stack-row { display: grid; grid-template-columns: minmax(6.5rem, 34%) minmax(0, 1fr); gap: 0.75rem; align-items: center; }
.viz-stack-label { font-size: 0.8rem; line-height: 1.25; text-align: right; color: #363636; }
.viz-stack-bar { display: flex; height: 34px; gap: 2px; }
.viz-segment {
  flex: none;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: var(--series-color);
  cursor: pointer;
}
.viz-segment:focus-visible { outline: 3px solid #176b9d; outline-offset: 1px; }
.viz-segment.is-focus { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--series-color); }
.viz-stack-axis { position: relative; height: 1.1rem; margin-left: calc(max(6.5rem, 34%) + 0.75rem); border-top: 1.2px solid #555; }
.viz-stack-axis span { position: absolute; top: 0.15rem; transform: translateX(-50%); font-size: 0.7rem; color: #555; }
.viz-axis-title { margin-top: 0.4rem; text-align: center; font-size: 0.75rem; color: #6a6a6a; }

.results-table-wrapper.is-charted { display: none; }

/* Published tables as vertical grouped bars, sharing the legend, grid, and tooltip of the figures. */
.viz-columns { --plot-h: 180px; --axis-w: 1.9rem; margin: 1rem 0 1.25rem; }
.viz-columns > .viz-legend { margin: 0 0 0.35rem; }
.viz-columns .viz-panel-axis { margin-bottom: 0.45rem; }
.viz-col-frame { display: flex; gap: 0.75rem; padding-left: var(--axis-w); }
.viz-col-frame.is-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1.75rem; padding-left: 0; }
.viz-col-section { flex: var(--columns) 1 0; min-width: 0; transition: opacity 0.15s ease; }
.is-panels .viz-col-section { padding-left: var(--axis-w); }
.viz-col-groups { position: relative; display: flex; height: var(--plot-h); border-bottom: 1.2px solid #555; }
.viz-col-grid { position: absolute; inset: 0; pointer-events: none; }
.viz-col-tick {
  position: absolute;
  left: calc(-1 * var(--axis-w));
  right: 0;
  display: grid;
  grid-template-columns: calc(var(--axis-w) - 0.35rem) 0.35rem 1fr;
  align-items: center;
  height: 1em;
  transform: translateY(50%);
  color: #555;
  font-size: 0.66rem;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.viz-col-tick::after { content: ""; grid-column: 3; border-top: 1px solid #e3ddd7; }
.viz-col-frame:not(.is-panels) .viz-col-section + .viz-col-section .viz-col-tick { color: transparent; }
.viz-col-group {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding: 0 6px;
  transition: opacity 0.15s ease;
}
.viz-col-group.is-apart { margin-right: 0.5rem; background: #f1f0ee; }
.viz-col-label.is-apart { margin-right: 0.5rem; }
.viz-col-bar {
  flex: 1 1 0;
  min-width: 3px;
  max-width: 22px;
  padding: 0;
  border: 0;
  border-radius: 2px 2px 0 0;
  background: var(--series-color);
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.viz-col-bar.is-selected { box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px var(--series-color); }
.viz .viz-col-bar.is-dim { opacity: 0.3; }
.viz-col-bar:focus { outline: none; }
.viz-col-bar:focus-visible { outline: 3px solid #176b9d; outline-offset: 1px; }
.viz-col-labels { display: flex; }
.viz-col-label { flex: 1 1 0; min-width: 0; padding: 0.3rem 1px 0; color: #363636; font-size: 0.72rem; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.viz-col-name, .viz-col-count { display: block; }
.viz-col-count { color: #6a6a6a; font-size: 0.66rem; font-variant-numeric: tabular-nums; }
/* Bracket under each setting; panels title their own plot instead. */
.viz-col-heading { position: relative; margin-top: 0.45rem; padding-top: 0.25rem; border-top: 1px solid #b9b0a8; color: #555; font-size: 0.75rem; font-weight: 600; text-align: center; }
.viz-col-heading::before, .viz-col-heading::after { content: ""; position: absolute; top: -5px; height: 5px; border-left: 1px solid #b9b0a8; }
.viz-col-heading::before { left: 0; }
.viz-col-heading::after { right: 0; }
.is-panels .viz-col-heading { margin: 0 0 0.4rem; padding: 0; border: 0; color: #363636; font-size: 0.9rem; text-align: left; }
.is-panels .viz-col-heading::before, .is-panels .viz-col-heading::after { content: none; }
/* Followed task: other settings fade, and within a setting the other tasks fade. */
.viz-columns.has-task-match .viz-col-section:not(:has(.is-task-selected)) { opacity: 0.35; }
.viz-col-section:has(.viz-col-group.is-task-selected) .viz-col-group:not(.is-task-selected) { opacity: 0.3; }
.viz-col-label.is-task-selected, .viz-col-heading.is-task-selected { color: #843911; font-weight: 700; }
@media (max-width: 768px) {
  .viz-trends .viz-panels, .viz-lines .viz-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rows > .container { padding-inline: 1rem; }
}
@media (max-width: 600px) {
  /* Settings wrap (Simulation + Franka, then R1 Pro), so each labels its own axis. */
  .viz-columns { --plot-h: 140px; }
  .viz-col-frame { flex-wrap: wrap; row-gap: 1rem; padding-left: 0; }
  .viz-col-section { flex-basis: 40%; padding-left: var(--axis-w); }
  .viz-col-frame:not(.is-panels) .viz-col-section + .viz-col-section .viz-col-tick { color: #555; }
  .viz-col-frame.is-panels { grid-template-columns: 1fr; }
  .viz-col-label { font-size: 0.66rem; }
}
@media (max-width: 480px) {
  .viz-lines .viz-panels { grid-template-columns: 1fr; }
}
@media print {
  .hotspot-layer, .figure-hint-badge, .viz, .viz-tip, .task-follow { display: none !important; }
  .figure-canvas.has-chart > .chart-fallback { display: block !important; }
  .results-table-wrapper.is-charted { display: block !important; }
}
