/* CSS styles for the article */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Roboto+Mono:wght@300;700&display=swap');

body {
  background-color: #ffffff;
  font-family: 'Playfair Display', serif;
  color: #1b1b1b;
  padding: 60px 30px;
}

.toc {
  width: 180px;
  font-family: 'Roboto Mono', monospace;
  position: fixed;
  top: 250px;
  /* Hide TOC by default */
  display: none; 
  /* left: max(30px, calc(25vw - 330px)); */ /* Move left positioning into media query */
  z-index: 1000; /* Add a high z-index to ensure TOC stays on top */
}

/* Media Query: Apply styles only when viewport width is 1300px or wider */
@media (min-width: 1400px) {
  .toc {
    /* Show the TOC */
    display: block; 
    /* Apply the calculated left position */
    left: max(30px, calc(25vw - 330px)); 
  }
}

.toc h3 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  margin-top: 0;
  margin-bottom: 10px;
}

.toc hr {
  border: 0;
  height: 1px;
  background-color: #ccc;
  margin-bottom: 15px;
}

.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc li {
  margin-bottom: 10px;
}

.toc a {
  display: inline-block;
  border-left: 3px solid transparent;
  padding-left: 8px;
  text-decoration: none;
  color: #333;
  font-size: 16px;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.toc a:hover {
  color: #000;
  text-decoration: underline;
}
.toc a.is-active {
  color: #1b1b1b;
  border-left-color: var(--dynamic-accent);
  font-weight: 700;
}

.main-content {
  max-width: 1000px;
  margin: 0 auto;
}

.hero-text {
  font-size: 68px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 0;
  border-left: 7px solid var(--dynamic-accent);
  padding-left: 14px;
}

.sub-hero-text {
  font-size: 36px;
  font-weight: 400;
  margin-bottom: 50px;
  line-height: 1.2;
  border-left: 7px solid var(--dynamic-accent);
  padding-left: 14px;
}

/* New style for authors */
.authors {
  font-family: 'Roboto Mono', monospace; /* Use a monospace font like taglines */
  font-size: 16px; /* Slightly smaller font size */
  color: #333; /* Dark grey color */
  line-height: 1.6; /* Adjust line spacing */
  margin-top: -32.5px; /* Reduce space below subtitle */
  margin-bottom: 20px; /* Add space below authors */
  text-align: left; /* Ensure left alignment */
}
.authors span { /* Style for affiliation/notes */
    display: block; /* Put affiliation/note on new line */
    font-size: 14px;
    color: #555;
    margin-top: 0px;
}
/* Style for the affiliation specifically */
.authors .affiliation {
    /* Change from bold to a higher numeric weight */
    /* font-weight: bold; */ 
    /* Set font-weight to 700 (standard bold) */
    font-weight: 600;  
    font-size: 16px;   
    color: #111;      
}
.authors .author-note {
    font-size: 13px;
    color: #555;
}
.authors .author-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 0;
}
/* Style for links within the authors block */
.authors a {
    color: inherit; /* Inherit the color from the .authors class */
    text-decoration: none; /* Remove default underline */
}
.authors a:hover {
    text-decoration: underline; /* Add underline on hover */
}
/* End new style */

.tagline {
  font-family: 'Roboto Mono', monospace;
  font-size: 24px;
  background: #f1f3f3;
  color: #1b1b1b;
  display: inline-block;
  padding: 8px 16px 8px 12px;
  margin: 40px 0;
  border-left: 6px solid var(--dynamic-accent);
  border-radius: 3px;
}

img {
  width: 100%;
  /* Update border: set width (e.g., 4px), style (solid), color (#000) */
  /* border: 0cm solid #000; */
  border: 1.5px solid #000; 
  /* Add border-radius for rounded corners */
  border-radius: 15px; 
  margin: 0px 20px; /* Keep global rule if needed elsewhere */
  /* Ensure images behave correctly with border-box sizing */
  box-sizing: border-box; 
}

/* Override for images directly within .main-content that need to align */
.main-content > img {
  margin-left: 0;
  margin-right: 0;
}

/* General style for the specific image links */
a#figure-1-img,
a#figure-2-img,
a#figure-3-img {
  display: block; /* Ensures proper layout and application of margins */
  text-decoration: none; /* Removes hyperlink underline */
  cursor: default; /* Makes it not look like a clickable link */
  /* margin-top is already set in their specific ID rules below */
}

/* Ensure images within these links take full width and are block */
a#figure-1-img img,
a#figure-2-img img,
a#figure-3-img img {
  display: block; /* Removes extra space below if image were inline */
  width: 100%;    /* Makes image fill the link's width */
  height: auto;   /* Maintains aspect ratio */
  /* General img border styles will apply unless overridden below */
}

/* Style for Figure 1 (figs/2-min.png) link container */
#figure-1-img {
  margin-top: 20px; /* Consistent top margin */
  margin-left: -25px; /* Override global img margin */
  margin-right: 18px; /* Override global img margin */
}

/* Style for Figure 2 (figs/4.png) link container */
#figure-2-img {
  /* border: none; */ /* Remove border from the link itself */
  border-radius: 0; /* Match the link's border-radius removal */
  margin-left: -25px; /* Override global img margin */
  margin-right: 17.5px; /* Override global img margin */
  margin-top: 20px; /* Consistent top margin */
}

/* Specific border handling for image inside #figure-2-img link */
a#figure-2-img img {
  border: none; /* Ensure the image inside the borderless link is also borderless */
  border-radius: 0; /* Match the link's border-radius removal */
}

/* Style for Figure 3 (figs/3.png) link container */
#figure-3-img {
  padding-left: 15px;
  background-color: #fff;
  margin-top: 20px;
  /* The image inside will get the default border from global img styles */
  border: 1.5px solid #000; /* Add border to the <a> tag */
  border-radius: 15px;    /* Add border-radius to the <a> tag */
  box-sizing: border-box; /* Ensure padding and border are within the element's width */
  overflow: hidden; /* Clip child elements (the img) to the rounded corners */
}

/* Specific style for the image inside #figure-3-img link */
a#figure-3-img img {
  border: none; /* Remove border from the image itself */
  border-radius: 0; /* Remove border-radius from the image */
  margin: 0; /* Override global img margin to prevent interference with padding */
}

/* --- Updated Styles for Video Gallery --- */

/* New outer wrapper for the whole section */
.video-gallery-section {
    margin-bottom: 40px; /* Space below the gallery section */
    /* width: 100%; */ /* Was 100% of parent (.main-content) */
    width: 100vw; /* Make the section span the full viewport width */
    position: relative; /* Establishes a positioning context, good practice with calc for margins */
    margin-left: calc((100% - 100vw) / 2); /* Calculates the negative margin to align left edge with viewport */
    /* 100% here refers to the width of the containing block (.main-content) */
    box-sizing: border-box; /* Ensures padding/border don't add to the 100vw width */
}

/* Container for the scrollable videos - now wider */
.video-gallery-container {
  /* Remove position: relative */
  /* Remove padding: 0 45px */
  box-sizing: border-box;
  /* width: 100%; */ /* Remove this to use max-width */
  max-width: 1150px; /* Set a maximum width for the gallery container */
  margin-left: auto;   /* Center the container */
  margin-right: auto;  /* Center the container */
  overflow-x: auto; /* Enable horizontal scrolling */
  scroll-behavior: smooth; /* Smooth scrolling effect */
   /* Hide scrollbar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
}
.video-gallery-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}


/* The actual scrolling div holding the videos */
.video-gallery {
  display: flex;
  gap: 15px; /* Space between videos */
  /* padding: 0 5vw; */ /* Original padding */
  padding: 0 20px; /* Adjusted to fixed padding, or keep 5vw if preferred */
  padding-bottom: 10px; /* Add some space at the bottom */
  box-sizing: border-box;
  width: max-content; /* Ensure it fits all videos horizontally */
  margin: 0 auto; /* Center the flex container if it's narrower than the container (unlikely with max-content) */
}


.gallery-video {
  flex: 0 0 auto; /* Prevent videos from shrinking/growing in the flex context */
  /* width: 30vw; */ /* Remove fixed/relative width */
  /* max-width: 450px; */ /* Remove max-width as width will be auto */
  height: 220px;  /* Set a fixed height for all videos. Adjust this value as desired. */
  width: auto;    /* Allow width to adjust to maintain original aspect ratio */
  /* max-height: 253.125px; */ /* No longer needed if height is fixed */
  /* object-fit: cover; */ /* Remove object-fit: cover to avoid cropping */
  border-radius: 15px; /* Keep the rounded corners */
  box-sizing: border-box;
  background-color: var(--surface-muted);
  /* Add a box-shadow for the glow/shadow effect */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Styles for the navigation buttons */
.gallery-nav {
  /* ... existing button styles (background, color, border, radius, size, etc.) ... */
  background-color: rgba(40, 40, 40, 0.8);
  color: white;
  border: none;
  border-radius: 50%;
  width: 35px;  /* Slightly smaller buttons */
  height: 35px; /* Slightly smaller buttons */
  font-size: 20px; /* Slightly smaller font */
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  margin: 0 5px; /* Adjust margin between buttons */
  flex-shrink: 0; /* Prevent buttons from shrinking */
}
.gallery-nav:hover {
    background-color: rgba(0, 0, 0, 1);
}

/* Container for the navigation buttons - remove centering margin */
.gallery-nav-controls {
    /* max-width: 960px; */ /* No longer needed */
    /* margin: 15px auto 0 auto; */ /* Remove auto margin */
    display: flex; /* Keep as flex to layout buttons */
    /* justify-content: center; */ /* No longer needed */
    align-items: center;
    margin-right: 15px; /* Add space between buttons and caption text */
}


/* Container to center the gallery caption and buttons */
.gallery-caption-container {
    max-width: 960px; /* Align container with main content */
    margin: 15px auto 0 auto; /* Top margin, centered horizontally */
    padding: 0 20px; /* Match original caption padding */
    box-sizing: border-box;
    display: flex; /* Make it a flex container */
    align-items: flex-start; /* Align items to the top */
    justify-content: center; /* Center content horizontally */
}

/* Specific style adjustments for the gallery caption text */
.figure-caption.gallery-caption {
    margin-bottom: 0;
    margin-top: 0; /* Remove top margin, alignment handled by flex */
    text-align: left; /* Align text to the left within its space */
    flex-grow: 1; /* Allow text to take available space if needed */
    /* Optional: Add a small left margin if needed */
    /* margin-left: 10px; */
}
/* --- End Video Gallery Styles --- */

/* --- Styles for Real-to-Sim Vertical Video Layout --- */
.r2s-vertical-layout {
  display: flex;
  flex-direction: column;
  gap: 10px; /* Space between the top and bottom rows */
  margin-bottom: 5px;
  /* padding: 0px 20px; */ /* REMOVE this horizontal padding */
  box-sizing: border-box;
}

.r2s-video-row {
  display: flex;
  gap: 15px; /* Space between items in a row */
  align-items: center; /* Vertically align items in the row */
  justify-content: center; /* Center the group of items if they don't fill the width */
}

/* Styling for the "slots" - direct children of .r2s-video-row */
/* These are the elements that will grow to fill the row. */
.r2s-video-row > .r2s-video-item, /* Targets <video class="r2s-video-item"> directly in a row */
.r2s-video-row > .stacked-ego-videos { /* Targets <div class="stacked-ego-videos"> directly in a row */
  flex-grow: 1; /* Allow the slot to grow */
  flex-basis: 0;  /* Good practice with flex-grow */
  /* max-height: 240px; */ /* REMOVE max-height from general slot rule */

  /* Make the slot a flex container to center its actual content (the video or the stack) */
  display: flex;
  justify-content: center;
  align-items: center;

  border: 1px solid var(--surface-muted); /* Border for the slot */
  box-sizing: border-box;
  background-color: var(--surface-muted); /* Background for the slot */
}

/* Set max-height for slots in the TOP row */
.r2s-top-row > .r2s-video-item,
.r2s-top-row > .stacked-ego-videos { /* Though top row doesn't have stacked videos, good for consistency */
  max-height: 266px;
}

/* Set max-height for slots in the BOTTOM row */
.r2s-bottom-row > .r2s-video-item,
.r2s-bottom-row > .stacked-ego-videos {
  max-height: 247px;
}

/* General styling for ALL <video> elements with class r2s-video-item */
/* This applies to videos directly in a row AND those inside .stacked-ego-videos */
video.r2s-video-item {
  display: block; /* Behaves well for sizing */
  max-width: 100%;  /* Video won't exceed the width of its parent container (slot or stacked-ego-videos div) */
  max-height: 100%; /* Video won't exceed the height of its parent container */
  width: auto;      /* Maintain aspect ratio */
  height: auto;     /* Maintain aspect ratio */
  object-fit: contain; /* Show entire video, letterbox if needed */
  background-color: var(--surface-muted); /* Background for letterboxing */
  border: none; /* Video itself has no border; the slot has one if applicable */
}

/* Apply a slight scale to SMPL and G1 videos to hide potential 1px edge artifacts */
.r2s-video-smpl,
.r2s-video-g1 {
  transform: scale(1.001);
}

/* Styling for the container of stacked videos */
.stacked-ego-videos {
  /* This element is a flex item within .r2s-video-row (handled by the rule above) */
  /* and also a flex container for its children. */
  display: flex; /* This ensures it behaves as a flex container for its children */
                 /* It might override display:flex from the slot rule if that rule also targeted this class directly,
                    but the current slot rule uses the child selector '>' so it's fine. */
  flex-direction: column;
  gap: 5px;
  
  width: auto; /* Width determined by its 1:1 children */
  height: 100%; /* Take full available height of its slot (which is max 180px) */
  max-width: 100%; /* Ensure it doesn't overflow its slot if children are unexpectedly wide */
  
  /* Remove any slot-like styling if it was applied by a more general class,
     as its appearance is defined by its children and its slot parent. */
  border: none; /* The slot around .stacked-ego-videos has the border */
  background-color: transparent; /* The slot around .stacked-ego-videos has the background */
  /* max-height is effectively controlled by its parent slot */
}

/* Styling for videos INSIDE the .stacked-ego-videos container */
.stacked-ego-videos > video.r2s-video-item {
  /* These videos are already styled by 'video.r2s-video-item' for object-fit, background, etc. */
  /* We just need to enforce their 1:1 aspect ratio and height calculation. */
  aspect-ratio: 1 / 1;
  width: auto; /* Width will be derived from height and 1:1 aspect ratio */
  height: calc(50% - (5px / 2)); /* Each takes half the parent's height, minus half the gap */
  min-height: 0;
  /* max-width and max-height of 100% (from video.r2s-video-item) are fine here,
     as they refer to 100% of this specific video's calculated 1:1 box. */
}
/* --- End Real-to-Sim Vertical Video Layout Styles --- */

/* --- Styles for Real-to-Sim Captions --- */
.r2s-caption-row {
  display: flex;
  gap: 15px; /* Should match the gap in .r2s-video-row */
  justify-content: center; /* Should match justify-content in .r2s-video-row */
  margin-top: -15px; /* Small space between videos and captions */
}

.r2s-caption-item {
  flex-grow: 1; /* Allow caption item to grow, similar to video slots */
  flex-basis: 0;
  text-align: center; /* Center text within its slot */
  font-size: 13px; /* Adjust as needed */
  color: #555; /* Adjust as needed */
  font-family: 'Roboto Mono', monospace;
  /* Optional: to better align with video slots if they have borders/padding */
  /* padding: 0 5px; */
}
/* --- End Styles for Real-to-Sim Captions --- */

.section {
  font-size: 20px;
  line-height: 1.7;
  margin-bottom: 40px;
}

.pull-quote {
  font-size: 32px;
  font-style: italic;
  font-weight: 400;
  margin: 60px 0 20px 0;
  color: #333;
}

.footer {
  font-size: 14px;
  font-family: 'Roboto Mono', monospace;
  color: #666;
  margin-top: 80px;
  border-top: 1px solid #ccc;
  padding-top: 30px;
  text-align: center;
}

/* New style for figure captions */
.figure-caption {
  font-family: 'Roboto Mono', monospace;
  font-size: 14px;
  color: #555;
  text-align: center;
  margin-top: 10px; /* Space above caption */
  margin-bottom: 40px; /* Space below caption, before next element */
  padding: 0 20px; /* Add some horizontal padding */
}

/* Project links */
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
}
.project-links a {
  font-family: 'Roboto Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: var(--dynamic-accent);
  border: 1px solid var(--dynamic-accent);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.project-links a:hover,
.project-links a:focus-visible {
  color: #fff;
  background: #168ee8;
  border-color: #168ee8;
}
.project-links svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
@media (max-width: 640px) {
  .project-links { gap: 8px; }
  .project-links a { padding: 7px 11px; }
}

/* Adding subsection styling in the table of contents */
.toc-subsection {
  margin-left: 20px; /* Indent subsections in TOC */
  font-size: 0.95em; /* Make slightly smaller than main sections */
}

/* Style for section subtitles (subsection headers) */
.section-subtitle {
  font-family: 'Roboto Mono', monospace;
  font-size: 20px;
  color: #1b1b1b;
  display: inline-block;
  padding: 0 0 5px;
  margin: 30px 0;
  border-bottom: 3px solid var(--dynamic-accent);
}

.additional-video-row {
  display: flex;
  gap: 15px;
  justify-content: center;
  align-items: flex-start;
}
.additional-video-item {
  height: 220px;
  width: auto;
  border-radius: 15px;
  background-color: #000;
}
#input-video-cropped {
  width: 350px; /* Controls the visible width */
  object-fit: cover; /* Crops the video to fit the width */
}
#input-video-cropped2 {
  width: 250px; /* Controls the visible width */
  object-fit: cover; /* Crops the video to fit the width */
}
#input-video-cropped3 {
  width: 300px; /* Controls the visible width */
  object-fit: cover; /* Crops the video to fit the width */
}
#input-video-cropped4 {
  width: 250px; /* Controls the visible width */
  object-fit: cover; /* Crops the video to fit the width */
}

/* Styling for individual videos within the gallery */
.video-gallery .gallery-video {
  /* width: auto; */ /* Let height dictate width for consistency */
  height: 224px; /* Fixed height for all gallery videos */
  margin-right: 0px; /* Spacing between videos */
  flex-shrink: 0; /* Prevent videos from shrinking in the flex container */
}

/* Make videos in the Reconstruction Gallery taller */
#reconstructionGallerySection .gallery-video {
  height: 220px; /* Adjust this value as needed for desired taller height */
}

/* Styling for the caption and navigation controls container */
.gallery-caption-container {
  max-width: 960px; /* Align container with main content */
  margin: 15px auto 0 auto; /* Top margin, centered horizontally */
  padding: 0 20px; /* Match original caption padding */
  box-sizing: border-box;
  display: flex; /* Make it a flex container */
  align-items: flex-start; /* Align items to the top */
  justify-content: center; /* Center content horizontally */
}

/* --- Real-World Comparison Grids --- */

/* Accent color for the dynamic (fast-tier) robot. */
:root {
  --dynamic-accent: #38a2fe;
  --dynamic-accent-soft: #e2f2ff;
  --static-accent: #777B7F;
  --surface-muted: #f7f8f8;
  --surface-muted-strong: #eceeee;
}

.dynamic-inline {
  color: var(--dynamic-accent);
  font-weight: 600;
}

.static-inline {
  color: var(--static-accent);
  font-weight: 600;
}

.comparison-section {
  display: flex;
  flex-direction: column;
  gap: 36px;
  margin-bottom: 50px;
}

.comparison-grid-block {
  background: #ffffff;
  border: 1.5px solid #000;
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-sizing: border-box;
}
.comparison-grid-block-ours {
  border-color: var(--dynamic-accent);
  box-shadow: 0 0 0 2px var(--dynamic-accent-soft);
}

.comparison-grid-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  padding-left: 2px;
}

.comparison-grid-title {
  font-family: 'Roboto Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  background: #000;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: -0.2px;
}

.comparison-grid-title-ours {
  font-family: 'Roboto Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  background: var(--dynamic-accent);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: -0.2px;
}

.comparison-grid-sub {
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.robot-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.robot-tile {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  border: 1.5px solid #000;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.robot-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none; /* unclickable individually */
}

.robot-tag {
  position: absolute;
  top: 5px;
  left: 6px;
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.2px;
  pointer-events: none;
}

.robot-tile.dynamic {
  border-color: var(--dynamic-accent);
  box-shadow: 0 0 0 2px var(--dynamic-accent), 0 4px 12px rgba(217, 110, 42, 0.35);
}

.robot-tile.dynamic .robot-tag {
  background: var(--dynamic-accent);
  color: #fff;
}

/* Scrubber row */
.scrubber-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 0 2px;
}

.play-pause-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #000;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s ease, transform 0.05s ease;
}
.play-pause-btn:hover { background: #222; }
.play-pause-btn:active { transform: scale(0.96); }
.play-pause-btn svg {
  width: 14px;
  height: 14px;
  fill: #fff;
}
.play-pause-btn .icon-pause { display: none; }
.play-pause-btn.is-playing .icon-play { display: none; }
.play-pause-btn.is-playing .icon-pause { display: block; }

.comparison-grid-block-ours .play-pause-btn {
  border-color: var(--dynamic-accent);
  background: var(--dynamic-accent);
}
.comparison-grid-block-ours .play-pause-btn:hover { background: #168ee8; }

.time-display {
  flex-shrink: 0;
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
  color: #555;
  min-width: 74px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Custom range slider: keep it sleek. */
.scrubber {
  flex: 1 1 auto;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: transparent;
  cursor: pointer;
  margin: 0;
  padding: 8px 0; /* enlarges hit target */
}
.scrubber::-webkit-slider-runnable-track {
  height: 4px;
  background: #1b1b1b;
  border-radius: 2px;
}
.scrubber::-moz-range-track {
  height: 4px;
  background: #1b1b1b;
  border-radius: 2px;
}
.scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #000;
  margin-top: -5px;
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease;
}
.scrubber::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
}
.scrubber::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #000;
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.scrubber:focus { outline: none; }
.scrubber:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.3);
}
.comparison-grid-block-ours .scrubber::-webkit-slider-runnable-track,
.comparison-grid-block-ours .scrubber::-moz-range-track {
  background: var(--dynamic-accent);
}
.comparison-grid-block-ours .scrubber::-webkit-slider-thumb,
.comparison-grid-block-ours .scrubber::-moz-range-thumb {
  border-color: var(--dynamic-accent);
}

/* One-line caption under each comparison grid */
.grid-caption {
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #555;
  margin: 12px 2px 0;
  padding: 0;
  text-align: left;
}
.grid-caption-ours {
  color: #1b1b1b;
  font-weight: 600;
}

/* Tighter layout on narrow screens */
@media (max-width: 640px) {
  .robot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* Per-robot running completion badge */
.robot-count {
  position: absolute;
  top: 5px;
  right: 6px;
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.2px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  transition: transform 0.18s ease, background-color 0.18s ease;
}
.robot-tile.dynamic .robot-count {
  background: var(--dynamic-accent);
}
.robot-count.pop {
  transform: scale(1.55);
  background: var(--dynamic-accent);
}

/* Throughput race chart */
.throughput-race {
  background: #ffffff;
  border: 1.5px solid #000;
  border-radius: 16px;
  padding: 18px 18px 14px;
  box-sizing: border-box;
  margin-bottom: 50px;
}
.throughput-race-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-left: 2px;
}
.throughput-race-title {
  font-family: 'Roboto Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: #1b1b1b;
  letter-spacing: -0.2px;
}
.throughput-race-legend {
  display: flex;
  gap: 16px;
  margin-left: auto;
  flex-wrap: wrap;
}
.throughput-race-legend span {
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
  color: #555;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.throughput-race-legend span::before {
  content: '';
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--swatch, #000);
}
.throughput-race svg {
  display: block;
  width: 100%;
  height: auto;
}
.throughput-race-caption {
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #555;
  margin: 10px 2px 0;
  text-align: left;
}

/* --- End Real-World Comparison Grids --- */

/* --- Method / Formulation / Scheduling / Metrics --- */

.section.sub-head {
  font-family: 'Roboto Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: #1b1b1b;
  margin-bottom: -8px;
  margin-top: 18px;
  line-height: 1.4;
}

.eqn-block {
  display: block;
  margin: 4px 0 14px;
  padding: 14px 18px;
  background: var(--surface-muted);
  border-left: 3px solid #000;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 16px;
}
.eqn-block.tight {
  margin: 2px 0 8px;
  padding: 8px 14px;
}
.eqn-block .katex-display {
  margin: 0;
}

/* Scheduler comparison cards */
.scheduler-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 18px 0 30px;
}

.scheduler-card {
  background: var(--surface-muted);
  border: 1.5px solid #000;
  border-radius: 12px;
  padding: 16px 20px;
  box-sizing: border-box;
}
.scheduler-card p {
  font-size: 17px;
  line-height: 1.6;
  margin: 6px 0;
}
.scheduler-card-name {
  font-family: 'Roboto Mono', monospace;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.scheduler-card-tag {
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  background: var(--surface-muted-strong);
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.scheduler-card-ours {
  border-color: var(--dynamic-accent);
  box-shadow: 0 0 0 2px var(--dynamic-accent-soft);
}
.scheduler-card-tag-ours {
  color: #fff;
  background: var(--dynamic-accent);
}

/* Metric cards (reuses scheduler-card styling): render side-by-side */
.scheduler-cards.metric-cards {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 720px) {
  .scheduler-cards.metric-cards { grid-template-columns: 1fr; }
}

/* --- Figure containers (wrap imgs so border has padding around content) --- */

/* Generic figure wrapper used for the Method execution-timeline image */
.method-figure {
  display: block;
  margin: 18px auto 0;
  max-width: 720px;             /* slightly smaller than full-width */
  padding: 14px;                /* breathing room between img and border */
  background: #fff;
  border: 1.5px solid #000;
  border-radius: 14px;
  box-sizing: border-box;
}
.method-figure img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

/* Wrapper for the larger result figures */
.result-figure {
  display: block;
  margin: 18px 0 0;
  padding: 14px 16px;
  background: #fff;
  border: 1.5px solid #000;
  border-radius: 14px;
  box-sizing: border-box;
}
.result-figure img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

/* --- Evaluations --- */

.evaluation-tabs {
  margin-top: 30px;
}
.evaluation-tab-list {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #d7d9d9;
}
.evaluation-tab {
  appearance: none;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #555;
  cursor: pointer;
  font-family: 'Roboto Mono', monospace;
  font-size: 15px;
  padding: 8px 10px 7px;
}
.evaluation-tab:hover,
.evaluation-tab:focus-visible {
  color: #1b1b1b;
}
.evaluation-tab:focus-visible {
  outline: 2px solid var(--dynamic-accent);
  outline-offset: 2px;
}
.evaluation-tab.is-active {
  color: #1b1b1b;
  border-bottom-color: var(--dynamic-accent);
  font-weight: 700;
}
.evaluation-tab-panel {
  padding-top: 2px;
}

.fig-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 18px auto 4px;
  max-width: 720px;             /* narrower so plots are smaller */
}
.fig-half {
  margin: 0;
  display: flex;
  flex-direction: column;
}
.fig-half img {
  width: 100%;
  height: auto;
  margin: 0;
  padding: 12px;                /* breathing room between img and border */
  border: 1.5px solid #000;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}
.fig-half figcaption {
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  color: #555;
  text-align: center;
  margin-top: 8px;
  padding: 0 8px;
  line-height: 1.5;
}

/* --- Takeaways --- */

.takeaway-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 10px 0 40px;
}

.takeaway {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: var(--surface-muted);
  border: 1.5px solid #000;
  border-radius: 14px;
  padding: 18px 22px;
}
.takeaway-num {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.takeaway-body { flex: 1; }
.takeaway-title {
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}
.takeaway-body p {
  font-size: 17px;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 640px) {
  .fig-row { grid-template-columns: 1fr; }
  .takeaway { flex-direction: column; gap: 10px; }
}

/* --- BibTeX Styling --- */
.bibtex-code {
  background-color: rgba(80, 80, 80, 0.8); /* Match gallery arrow background */
  color: #f1f1f1; /* Light text color for readability */
  padding: 20px;
  border-radius: 8px;
  margin: 80px auto -40px; /* Spacing and centering, bottom margin reduced to 20px */
  max-width: 1000px;  /* Max width of the BibTeX box */
  box-sizing: border-box;
  font-size: 14px; /* Base font size for BibTeX */
}

.bibtex-title {
  font-family: 'Courier New', Courier, monospace; /* Same font family as code */
  font-weight: bold;
  font-size: 1.15em; /* Slightly larger than the code text */
  margin-bottom: 10px; /* Space between title and pre block */
  color: #f1f1f1; /* Ensure it matches the box text color */
}

.bibtex-code pre {
  white-space: pre-wrap;       /* Allows text to wrap */
  overflow-wrap: break-word;   /* Breaks long words if necessary (updated from word-wrap) */
  margin: 0;                   /* Remove default margin from pre tag */
}

.bibtex-code code {
  font-family: 'Courier New', Courier, monospace; /* Monospace font for code */
  overflow-wrap: break-word; /* Ensure long words break to prevent overflow */
  /* Color will be inherited from .bibtex-code */
}
/* --- End BibTeX Styling --- */
