/* =========================
   RepliMap brand theme overrides
   Primary teal from product UI: #208093 (adjust when RepliMap UI palette is finalized)
   ========================= */

/* Light mode */
:root {
  --replimap-title-color: #1d9aaa;
  --replimap-teal: #1d9aaa;
  --replimap-teal-dark: #167f8f;
  --replimap-teal-soft: rgba(29, 154, 170, 0.12);

  /* Material primary tokens */
  --md-primary-fg-color: var(--replimap-teal);
  --md-primary-fg-color--dark: var(--replimap-teal-dark);
  --md-accent-fg-color: var(--replimap-teal);

  /* Surface + typography polish */
  --md-default-bg-color: #ffffff;
  --md-default-fg-color: rgba(0, 0, 0, 0.82);
  --md-typeset-a-color: var(--replimap-teal);
  --replimap-table-border: #5c6b7a;
  --replimap-table-max-width: 44rem;
  --replimap-table-field-col: 11rem;
}

[data-md-color-scheme="slate"] {
  --replimap-table-border: #9aa8b8;
}

/* Links hover */
.md-typeset a:hover {
  color: var(--replimap-teal-dark);
}

/* Buttons (Material uses primary tokens; this improves feel) */
.md-button--primary {
  border-radius: 10px;
}

/* Make left nav feel closer to the product (cleaner, lighter) */
.md-sidebar__scrollwrap {
  scrollbar-width: thin;
}

/* Subtle card feel for content blocks */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 12px;
}

/* Tables: prominent outer border + full grid on every cell */
.md-typeset table:not([class]),
.md-typeset .md-typeset__table table:not([class]) {
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  border-radius: 8px;
  overflow: visible;
  border: 2px solid var(--replimap-table-border) !important;
  box-sizing: border-box;
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td,
.md-typeset .md-typeset__table table:not([class]) th,
.md-typeset .md-typeset__table table:not([class]) td {
  border: 2px solid var(--replimap-table-border) !important;
  box-sizing: border-box;
}

.md-typeset table:not([class]) th,
.md-typeset .md-typeset__table table:not([class]) th {
  background: rgba(0, 0, 0, 0.05);
  font-weight: 700;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th,
[data-md-color-scheme="slate"] .md-typeset .md-typeset__table table:not([class]) th {
  background: rgba(255, 255, 255, 0.1);
}

/* Uniform table width (Material inline-block tables otherwise shrink per section) */
.md-typeset .md-typeset__scrollwrap {
  width: 100%;
  max-width: var(--replimap-table-max-width);
}

.md-typeset .md-typeset__table {
  width: 100% !important;
  max-width: var(--replimap-table-max-width) !important;
  display: block !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}

.md-typeset .md-typeset__table table:not([class]) {
  display: table !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  border: 2px solid var(--replimap-table-border) !important;
  box-sizing: border-box;
}

.md-typeset .md-typeset__table table:not([class]) th,
.md-typeset .md-typeset__table table:not([class]) td {
  border: 2px solid var(--replimap-table-border) !important;
}

/* Field | Purpose (exactly two header columns) */
.md-typeset table:not([class]):has(thead tr > th:nth-child(2):last-child) th:nth-child(1),
.md-typeset table:not([class]):has(thead tr > th:nth-child(2):last-child) td:nth-child(1) {
  width: var(--replimap-table-field-col) !important;
  min-width: var(--replimap-table-field-col) !important;
  max-width: var(--replimap-table-field-col) !important;
}

.md-typeset table:not([class]):has(thead tr > th:nth-child(2):last-child) th:nth-child(2),
.md-typeset table:not([class]):has(thead tr > th:nth-child(2):last-child) td:nth-child(2) {
  width: auto !important;
  min-width: 0;
}

/* Create Road — Road Properties: narrow Field column (~22%), wide Purpose column (~78%) */
.replimap-road-properties-tables .md-typeset__scrollwrap,
.replimap-road-properties-tables .md-typeset__table {
  max-width: 100% !important;
}

.replimap-road-properties-tables .md-typeset__table table:not([class]),
.replimap-road-properties-tables table:not([class]) {
  table-layout: fixed !important;
  width: 100% !important;
}

.replimap-road-properties-tables .md-typeset__table table:not([class]) th:first-child,
.replimap-road-properties-tables .md-typeset__table table:not([class]) td:first-child,
.replimap-road-properties-tables table:not([class]) th:first-child,
.replimap-road-properties-tables table:not([class]) td:first-child {
  width: 22% !important;
  max-width: 6.5rem !important;
  min-width: 4.25rem !important;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.replimap-road-properties-tables .md-typeset__table table:not([class]) th:last-child,
.replimap-road-properties-tables .md-typeset__table table:not([class]) td:last-child,
.replimap-road-properties-tables table:not([class]) th:last-child,
.replimap-road-properties-tables table:not([class]) td:last-child {
  width: 78% !important;
}

/*
  Signal Properties page only: full-width tables + Field/Purpose header bar edge-to-edge.
  Do not use display:block on .md-typeset__table — it can shrink-wrap and leave white space on the right.
*/
.md-typeset:has(#replimap-signal-properties) .md-typeset__scrollwrap {
  width: 100%;
  max-width: min(100%, 44rem);
}

.md-typeset:has(#replimap-signal-properties) .md-typeset__table {
  width: 100% !important;
  max-width: min(100%, 44rem) !important;
}

.md-typeset:has(#replimap-signal-properties) table:not([class]) {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 100% !important;
  box-sizing: border-box;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.md-typeset:has(#replimap-signal-properties) table:not([class]) th,
.md-typeset:has(#replimap-signal-properties) table:not([class]) td {
  vertical-align: top;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

.md-typeset:has(#replimap-signal-properties) table:not([class]) tr:first-child th {
  background: rgba(0, 0, 0, 0.03) !important;
}

/* Percent widths sum to 100% so both columns (and header fill) span the full table */
.md-typeset:has(#replimap-signal-properties) table:not([class]) th:nth-child(1),
.md-typeset:has(#replimap-signal-properties) table:not([class]) td:nth-child(1) {
  width: 26% !important;
  min-width: 0;
  max-width: none;
}

.md-typeset:has(#replimap-signal-properties) table:not([class]) th:nth-child(2),
.md-typeset:has(#replimap-signal-properties) table:not([class]) td:nth-child(2) {
  width: 74% !important;
  min-width: 0;
  max-width: none;
}

/*
  Signal Properties page: prominent table borders (Material’s default borders are very faint).
 */
.md-content__inner.md-typeset:has(#replimap-signal-properties) {
  --replimap-signal-table-border: #4a5568;
}

[data-md-color-scheme="slate"] .md-content__inner.md-typeset:has(#replimap-signal-properties) {
  --replimap-signal-table-border: #b0bcc9;
}

.md-content__inner.md-typeset:has(#replimap-signal-properties) .md-typeset__scrollwrap,
.md-content__inner.md-typeset:has(#replimap-signal-properties) .md-typeset__table {
  overflow: visible;
}

.md-content__inner.md-typeset:has(#replimap-signal-properties) .md-typeset__table table:not([class]),
.md-content__inner.md-typeset:has(#replimap-signal-properties) table:not([class]) {
  border: 2px solid var(--replimap-signal-table-border) !important;
  overflow: visible !important;
}

.md-content__inner.md-typeset:has(#replimap-signal-properties) .md-typeset__table table:not([class]) th,
.md-content__inner.md-typeset:has(#replimap-signal-properties) .md-typeset__table table:not([class]) td,
.md-content__inner.md-typeset:has(#replimap-signal-properties) table:not([class]) th,
.md-content__inner.md-typeset:has(#replimap-signal-properties) table:not([class]) td {
  vertical-align: top;
  overflow-wrap: anywhere;
  box-sizing: border-box;
  border: 2px solid var(--replimap-signal-table-border) !important;
}

.md-content__inner.md-typeset:has(#replimap-signal-properties) .md-typeset__table table:not([class]) thead th,
.md-content__inner.md-typeset:has(#replimap-signal-properties) table:not([class]) thead th {
  background: rgba(0, 0, 0, 0.06) !important;
  font-weight: 700;
}

[data-md-color-scheme="slate"] .md-content__inner.md-typeset:has(#replimap-signal-properties) .md-typeset__table table:not([class]) thead th,
[data-md-color-scheme="slate"] .md-content__inner.md-typeset:has(#replimap-signal-properties) table:not([class]) thead th {
  background: rgba(255, 255, 255, 0.1) !important;
}

/* Signal Properties panel screenshot: narrower and shorter on the page */
.md-content__inner.md-typeset:has(#replimap-signal-properties) img[src*="signal-properties-panel"] {
  width: auto !important;
  max-width: 420px !important;
  max-height: none !important;
  height: auto !important;
  object-fit: initial !important;
  object-position: initial;
  display: block;
  margin: 1.5em auto !important;
}

.md-content__inner.md-typeset:has(#replimap-object-properties) img[src*="object-properties-panel"] {
  width: auto !important;
  max-width: 420px !important;
  max-height: none !important;
  height: auto !important;
  object-fit: initial !important;
  object-position: initial;
  display: block;
  margin: 1.5em 0 !important;
}

.md-content__inner.md-typeset:has(#replimap-road-properties) img[src*="road-properties-panel"] {
  width: auto !important;
  max-width: 420px !important;
  max-height: none !important;
  height: auto !important;
  object-fit: initial !important;
  object-position: initial;
  display: block;
  margin: 1.5em 0 !important;
}

/* Road Properties page: make expandable note width match screenshot width */
.md-content__inner.md-typeset:has(#replimap-road-properties) details {
  width: fit-content;
  max-width: 100%;
}

/* Lane Offset page: smaller typography for the Rules callout text */
.md-content__inner.md-typeset:has(#replimap-lane-offset) .replimap-lane-offset-rules {
  font-size: 0.86rem;
}

/* Screenshot notes: expanded panel width follows image width */
.md-typeset details:has(img) {
  width: fit-content;
  max-width: 100%;
}

/* Optional: slightly soften header separation */
.md-header {
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

/* Header: logo only — hide site name next to logo (site_name still used for <title>, etc.) */
.md-header__topic {
  display: none;
}

/* Mobile drawer: hide site name next to logo (sibling after logo link) */
.md-nav__title .md-logo ~ * {
  display: none;
}

/* Search row — unchanged size */
.md-search__input {
  font-size: 0.9rem;
}

/* Header section tabs only (Home, Getting Started, …) — smaller; does not affect search/logo row */
.md-tabs__link {
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

/* Current section tab in header: bold */
.md-tabs__link--active,
.md-tabs__item--active .md-tabs__link {
  font-weight: 700;
}

/* Right-side Table of Contents: add arrow markers for readability */
.md-sidebar--secondary .md-nav__link {
  position: relative;
  padding-left: 1rem;
}

.md-sidebar--secondary .md-nav__link::before {
  content: "\25B8";
  position: absolute;
  left: 0;
  color: var(--replimap-title-color);
  font-size: 0.72rem;
  line-height: 1.4;
}

/* Hide grey back-label inside expanded section drawers (keep Overview / Release notes visible) */
.md-sidebar--primary .md-nav[data-md-level="1"] > .md-nav__title {
  display: none;
}

/* Left navigation sidebar: add same arrow markers */
.md-sidebar--primary .md-nav__link {
  position: relative;
  padding-left: 1rem;
}

.md-sidebar--primary .md-nav__link::before {
  content: "\25B8";
  position: absolute;
  left: 0;
  color: var(--replimap-title-color);
  font-size: 0.72rem;
  line-height: 1.4;
}

/* Better typography + readability */
.md-typeset {
  line-height: 1.65;
}

/* First paragraph after the page title: match normal body text (not a large “lead”) */
.md-typeset > h1 + p {
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: normal;
  color: var(--md-default-fg-color);
}

.md-typeset > h1 + p strong {
  font-weight: 700;
}

/* Intro wrongly parsed as h2 when --- follows a paragraph with no blank line (setext) */
.md-typeset > h1:first-of-type + h2 {
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: normal;
  color: var(--md-default-fg-color);
  margin-top: 0;
  margin-bottom: 0.9em;
}

.md-typeset > h1:first-of-type + h2 strong {
  font-weight: 700;
}

/* Headings: Word-style outline hierarchy (title → section → subsection) */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6,
.md-typeset .admonition-title,
.md-typeset summary {
  color: var(--replimap-title-color);
  text-decoration: none;
}

.md-typeset h2::before,
.md-typeset h3::before,
.md-typeset h4::before,
.md-typeset h5::before,
.md-typeset h6::before {
  color: var(--replimap-title-color);
}

/* H1 — document title (title bar) */
.md-typeset h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 0;
  margin-bottom: 1.1em;
  padding-bottom: 0.45em;
  border-bottom: 3px solid var(--replimap-teal);
}

[data-md-color-scheme="slate"] .md-typeset h1 {
  border-bottom-color: var(--replimap-teal);
}

/* H2 — major section */
.md-typeset h2 {
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 2.25em;
  margin-bottom: 0.85em;
  padding: 0;
  background: transparent;
}

.md-typeset h2::before {
  content: "▸\00a0";
  font-weight: 700;
}

[data-md-color-scheme="slate"] .md-typeset h2 {
  background: transparent;
}

/* H3 — subsection (indented sub-arrow) */
.md-typeset h3 {
  font-weight: 600;
  margin-top: 1.75em;
  margin-bottom: 0.65em;
  padding-left: 1rem;
}

.md-typeset h3::before {
  content: "▹\00a0";
  font-weight: 700;
}

/* H4–H6 — nested detail levels */
.md-typeset h4 {
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.55em;
  padding-left: 2rem;
  font-size: 0.78rem;
}

.md-typeset h4::before {
  content: "›\00a0";
}

.md-typeset h5,
.md-typeset h6 {
  font-weight: 600;
  margin-top: 1.35em;
  margin-bottom: 0.5em;
  padding-left: 2.75rem;
  font-size: 0.72rem;
}

.md-typeset h5::before,
.md-typeset h6::before {
  content: "·\00a0";
  font-weight: 700;
}

/* Parsed-as-h2 intro paragraph: keep body style, no outline chrome */
.md-typeset > h1:first-of-type + h2::before {
  content: none;
}

.md-typeset > h1:first-of-type + h2 {
  padding: 0;
  background: transparent;
  color: var(--md-default-fg-color);
}

/* Tighten when a heading immediately follows another heading */
.md-typeset h1 + h2:not(:first-of-type) {
  margin-top: 1.5em;
}

.md-typeset h2 + h3,
.md-typeset h3 + h4,
.md-typeset h4 + h5,
.md-typeset h5 + h6 {
  margin-top: 1.1em;
}

/* Make the main content feel like a product doc */
.md-main__inner {
  padding-top: 1rem;
}

/* Smoother code blocks */
.md-typeset pre > code {
  border-radius: 12px;
}

.md-typeset img {
  /* Size Control */
  max-width: 80%;            /* Reduces size so it doesn't hit the edges */
  height: auto;              /* Maintains aspect ratio */
  display: block;            /* Centers the image with margin: auto */
  margin: 1.5em auto;        /* Adds space above/below and centers horizontally */

  /* Border & Polish */
  border: 1px solid #e2e8f0; /* Very light slate border */
  border-radius: 8px;        /* Matches your UI's rounded feel */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); /* Soft depth */
}

/* Prose + screenshot: text column + compact image on the right (stacks on narrow viewports) */
.replimap-doc-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, min(38%, 380px));
  gap: 1.25rem 1.5rem;
  align-items: start;
  margin: 1rem 0 1.75rem;
}

.replimap-doc-media > div:first-child > :first-child {
  margin-top: 0;
}

.replimap-doc-media .replimap-doc-media__img {
  margin: 0;
}

.replimap-doc-media .replimap-doc-media__img img {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
}

/* Single Object — Repeat List panel screenshot: smaller width and height */
.md-typeset img[src*="repeat-properties-panel"] {
  width: 420px !important;
  max-width: 420px !important;
  max-height: 20rem !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: top left;
  display: block;
  margin: 1.25em auto !important;
}

/* Lane Validity: heading above; description left, Edit Lane dialog right (shorter than text) */
.replimap-doc-media--compact {
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem 1.25rem;
  align-items: start;
  margin-top: 0.35rem;
}

.replimap-doc-media--compact .replimap-doc-media__text > :first-child {
  margin-top: 0;
}

.replimap-doc-media--compact .replimap-doc-media__img {
  margin: 0 !important;
  padding: 0;
  align-self: start;
}

.replimap-doc-media--compact .replimap-doc-media__img > p {
  margin: 0 !important;
  padding: 0;
  line-height: 0;
}

.replimap-doc-media--compact .replimap-doc-media__img img {
  width: 360px !important;
  max-width: 360px !important;
  max-height: 9.5rem !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: top left;
  margin: 0 !important;
  vertical-align: top;
  display: block;
}

/* List sets height; image fills that height exactly (Objects panel beside categories) */
.replimap-doc-media--pane {
  display: block;
  margin: 1rem 0 1.75rem;
}

.replimap-doc-media--pane .replimap-doc-media__inner {
  position: relative;
  padding-right: min(36%, 280px);
}

.replimap-doc-media--pane .replimap-doc-media__text {
  margin: 0;
}

.replimap-doc-media--pane .replimap-doc-media__text > :first-child {
  margin-top: 0;
}

.replimap-doc-media--pane .replimap-doc-media__text ul {
  margin: 0;
}

/* top + bottom pin box height to the list; overflow clips the tall panel screenshot */
.replimap-doc-media--pane .replimap-doc-media__img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(36%, 280px);
  height: auto;
  margin: 0;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  box-sizing: border-box;
}

.replimap-doc-media--pane .replimap-doc-media__img > p {
  margin: 0;
  padding: 0;
  min-height: 0;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
}

/* Height matches the category list; width scales proportionally */
.md-typeset .replimap-doc-media--pane .replimap-doc-media__img img {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  margin: 0;
  object-fit: contain;
  object-position: top left;
  box-sizing: border-box;
}

@media screen and (max-width: 52em) {
  .replimap-doc-media {
    grid-template-columns: 1fr;
  }

  .replimap-doc-media .replimap-doc-media__img {
    max-width: min(100%, 420px);
    margin-left: auto;
    margin-right: auto;
  }

  .replimap-doc-media--pane .replimap-doc-media__inner {
    padding-right: 0;
  }

  .replimap-doc-media--pane .replimap-doc-media__img {
    position: static;
    width: 100%;
    height: auto;
    max-width: min(100%, 640px);
    margin: 1rem auto 0;
  }

  .replimap-doc-media--pane .replimap-doc-media__img img {
    width: 100%;
    height: auto;
    object-fit: initial;
    object-position: initial;
  }

}

/* Panel notes | main canvas | panel screenshot (lanes page; stacks on narrow viewports) */
.replimap-doc-media--triple {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1.45fr) minmax(200px, min(32%, 360px));
  gap: 1rem 1.25rem;
  align-items: start;
  margin: 1rem 0 1.75rem;
}

.replimap-doc-media--triple > div:first-child > :first-child {
  margin-top: 0;
}

.replimap-doc-media--triple .replimap-doc-media__canvas,
.replimap-doc-media--triple .replimap-doc-media__img {
  margin: 0;
}

.replimap-doc-media--triple .replimap-doc-media__canvas img,
.replimap-doc-media--triple .replimap-doc-media__img img {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
}

@media screen and (max-width: 64em) {
  .replimap-doc-media--triple {
    grid-template-columns: 1fr;
  }

  .replimap-doc-media--triple .replimap-doc-media__canvas,
  .replimap-doc-media--triple .replimap-doc-media__img {
    max-width: min(100%, 560px);
    margin-left: auto;
    margin-right: auto;
  }
}

/* Keep all top nav tabs visible on wide screens (e.g., German labels) */
@media screen and (min-width: 76.25em) {
  .md-tabs__list {
    display: flex;
    flex-wrap: wrap;
    row-gap: 0.15rem;
  }

  .md-tabs__item {
    padding-right: 0.05rem;
  }

  .md-tabs__link {
    margin-top: 0.35rem;
  }
}

/* Validator page — bordered bundle cards */
.replimap-validator-bundle {
  background: var(--md-default-bg-color);
  border: 2px solid var(--replimap-table-border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem 1.35rem;
  margin: 1.5rem 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.replimap-validator-bundle > h3 {
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--replimap-teal);
  color: var(--replimap-teal);
  font-size: 1.2rem;
}

.replimap-validator-bundle h4 {
  margin: 1rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--md-default-fg-color);
  opacity: 0.85;
}

.replimap-validator-bundle h4:first-of-type {
  margin-top: 0;
}

.replimap-validator-bundle ul {
  margin: 0.25rem 0 0;
}

.replimap-validator-bundle li {
  margin-bottom: 0.35rem;
}

.replimap-validator-pass {
  color: #1a7f4c;
  font-weight: 700;
}

.replimap-validator-fail {
  color: #b42318;
  font-weight: 700;
}

[data-md-color-scheme="slate"] .replimap-validator-pass {
  color: #3ecf8e;
}

[data-md-color-scheme="slate"] .replimap-validator-fail {
  color: #f97066;
}

.replimap-validator-summary {
  background: var(--md-default-bg-color);
  border: 2px solid var(--replimap-table-border);
  border-left: 5px solid var(--replimap-teal);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.replimap-validator-summary > h2 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
}

/* Validator — How to Use table (same borders as standard doc tables) */
.md-typeset .replimap-validator-howto-wrap {
  width: 100%;
  max-width: var(--replimap-table-max-width);
}

.md-typeset table.replimap-validator-howto {
  width: 100% !important;
  max-width: 100% !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  border-radius: 8px;
  border: 2px solid var(--replimap-table-border) !important;
  box-sizing: border-box;
  table-layout: fixed;
}

.md-typeset table.replimap-validator-howto th,
.md-typeset table.replimap-validator-howto td {
  border: 2px solid var(--replimap-table-border) !important;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  vertical-align: top;
}

.md-typeset table.replimap-validator-howto th {
  background: rgba(0, 0, 0, 0.05);
  font-weight: 700;
  color: var(--md-default-fg-color);
}

[data-md-color-scheme="slate"] .md-typeset table.replimap-validator-howto th {
  background: rgba(255, 255, 255, 0.1);
}

.md-typeset table.replimap-validator-howto th:first-child,
.md-typeset table.replimap-validator-howto td:first-child:not([colspan]) {
  width: var(--replimap-table-field-col) !important;
  min-width: var(--replimap-table-field-col) !important;
  max-width: var(--replimap-table-field-col) !important;
}

.md-typeset table.replimap-validator-howto td ol {
  margin: 0;
  padding-left: 1.25rem;
}

.md-typeset table.replimap-validator-howto tr.replimap-validator-howto__screenshot td {
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.02);
}

[data-md-color-scheme="slate"] .md-typeset table.replimap-validator-howto tr.replimap-validator-howto__screenshot td {
  background: rgba(255, 255, 255, 0.03);
}

.md-typeset table.replimap-validator-howto tr.replimap-validator-howto__screenshot details.note {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  box-sizing: border-box;
  overflow: hidden;
}

/* Fill entire bar with note blue — summary margin was leaving white gaps at the ends */
.md-typeset table.replimap-validator-howto tr.replimap-validator-howto__screenshot details.note:not([open]) {
  background-color: rgba(68, 138, 255, 0.1);
}

.md-typeset table.replimap-validator-howto tr.replimap-validator-howto__screenshot details.note > summary {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 0.6rem 2.6rem 0.6rem 2.6rem;
  border-radius: 0;
  background-color: transparent;
}

.md-typeset table.replimap-validator-howto tr.replimap-validator-howto__screenshot details.note[open] > summary {
  background-color: rgba(68, 138, 255, 0.1);
}

[data-md-color-scheme="slate"] .md-typeset table.replimap-validator-howto tr.replimap-validator-howto__screenshot details.note:not([open]),
[data-md-color-scheme="slate"] .md-typeset table.replimap-validator-howto tr.replimap-validator-howto__screenshot details.note[open] > summary {
  background-color: rgba(68, 138, 255, 0.15);
}

.md-typeset table.replimap-validator-howto tr.replimap-validator-howto__screenshot details.note > summary::after {
  right: 0.75rem;
}

.md-typeset table.replimap-validator-howto tr.replimap-validator-howto__screenshot details.note > p {
  margin: 0.5rem 0 0;
  padding: 0 0.75rem 0.75rem;
  text-align: center;
  box-sizing: border-box;
}

.md-typeset table.replimap-validator-howto tr.replimap-validator-howto__screenshot details.note img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

/* Step | Action tables — narrow Step column (override global Field column width) */
.md-typeset .replimap-controllers-step-table .md-typeset__table table:not([class]) th:first-child,
.md-typeset .replimap-controllers-step-table .md-typeset__table table:not([class]) td:first-child,
.md-typeset .replimap-controllers-step-table table:not([class]):has(thead tr > th:nth-child(2):last-child) th:nth-child(1),
.md-typeset .replimap-controllers-step-table table:not([class]):has(thead tr > th:nth-child(2):last-child) td:nth-child(1),
.md-typeset .replimap-controllers-step-table table:not([class]) th:first-child,
.md-typeset .replimap-controllers-step-table table:not([class]) td:first-child {
  width: 4.5rem !important;
  min-width: 4.5rem !important;
  max-width: 4.5rem !important;
  text-align: center;
  white-space: nowrap;
}

/* Spacing between step lists and following notes */
.md-typeset ol + .admonition,
.md-typeset ul + .admonition {
  margin-top: 1.25rem;
}

.md-typeset .replimap-controllers-panel-shot + .admonition {
  margin-top: 1.25rem;
}

/* Controllers — section wrapper so table and collapsible share the same width */
.replimap-controllers-table-section {
  width: 100%;
  max-width: var(--replimap-table-max-width);
}

.replimap-controllers-table-section .md-typeset__scrollwrap,
.replimap-controllers-table-section .md-typeset__table {
  width: 100% !important;
  max-width: 100% !important;
}

.replimap-controllers-table-section .replimap-controllers-panel-shot {
  width: 100%;
  max-width: 100%;
  margin-top: 0.75rem;
}

.replimap-controllers-table-section .admonition {
  width: 100%;
  max-width: 100%;
  margin-top: 0.75rem;
  box-sizing: border-box;
}

.replimap-controllers-table-section .replimap-controllers-panel-shot.replimap-controllers-link-demo {
  max-width: 100%;
}

/* Notes directly after table wrappers — match table width */
.md-typeset .replimap-controllers-step-table + .admonition,
.md-typeset .replimap-stop-line-visualization-table + .admonition {
  width: 100%;
  max-width: var(--replimap-table-max-width);
  box-sizing: border-box;
  margin-top: 0.75rem;
}

.md-typeset .replimap-controllers-step-table + .admonition + .replimap-controllers-panel-shot,
.md-typeset .replimap-controllers-step-table + .replimap-controllers-panel-shot {
  max-width: var(--replimap-table-max-width);
  width: 100%;
}

/* Controllers — full-width Controllers panel collapsible (match Manage table bars) */
.replimap-controllers-panel-shot {
  width: 100%;
  max-width: var(--replimap-table-max-width);
}

.md-typeset .replimap-controllers-panel-shot details.note {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0;
  border-radius: 8px;
  box-sizing: border-box;
  overflow: hidden;
}

.md-typeset .replimap-controllers-panel-shot details.note:not([open]) {
  background-color: rgba(68, 138, 255, 0.1);
}

.md-typeset .replimap-controllers-panel-shot details.note > summary {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 0.6rem 2.6rem 0.6rem 2.6rem;
  border-radius: 0;
  background-color: transparent;
}

.md-typeset .replimap-controllers-panel-shot details.note[open] > summary {
  background-color: rgba(68, 138, 255, 0.1);
}

[data-md-color-scheme="slate"] .md-typeset .replimap-controllers-panel-shot details.note:not([open]),
[data-md-color-scheme="slate"] .md-typeset .replimap-controllers-panel-shot details.note[open] > summary {
  background-color: rgba(68, 138, 255, 0.15);
}

.md-typeset .replimap-controllers-panel-shot details.note > summary::after {
  right: 0.75rem;
}

.md-typeset .replimap-controllers-panel-shot details.note > p {
  margin: 0.5rem 0 0;
  padding: 0 0.75rem 0.75rem;
  text-align: center;
  box-sizing: border-box;
}

.md-typeset .replimap-controllers-panel-shot details.note > .replimap-expandable-media {
  margin: 0.5rem 0.75rem 0.75rem;
  box-sizing: border-box;
}

.md-typeset .replimap-controllers-panel-shot details.note img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

/* Controllers — wider collapsible for link-signals demo GIF */
.replimap-controllers-link-demo {
  width: 100%;
  max-width: 52rem;
}

/* Controllers — Manage Controllers table */
.md-typeset table.replimap-controllers-manage-table {
  width: 100% !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  border-radius: 8px;
  border: 2px solid var(--replimap-table-border) !important;
  box-sizing: border-box;
  table-layout: fixed;
}

.md-typeset table.replimap-controllers-manage-table th,
.md-typeset table.replimap-controllers-manage-table td {
  border: 2px solid var(--replimap-table-border) !important;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  vertical-align: top;
}

.md-typeset table.replimap-controllers-manage-table th {
  background: rgba(0, 0, 0, 0.05);
  font-weight: 700;
}

[data-md-color-scheme="slate"] .md-typeset table.replimap-controllers-manage-table th {
  background: rgba(255, 255, 255, 0.1);
}

.md-typeset table.replimap-controllers-manage-table th:first-child,
.md-typeset table.replimap-controllers-manage-table td:first-child:not([colspan]) {
  width: 6.5rem !important;
  min-width: 6.5rem !important;
  max-width: 6.5rem !important;
}

.md-typeset table.replimap-controllers-manage-table td ol {
  margin: 0;
  padding-left: 1.25rem;
}

.md-typeset table.replimap-controllers-manage-table tr.replimap-controllers-manage-table__screenshot td {
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.02);
}

[data-md-color-scheme="slate"] .md-typeset table.replimap-controllers-manage-table tr.replimap-controllers-manage-table__screenshot td {
  background: rgba(255, 255, 255, 0.03);
}

.md-typeset table.replimap-controllers-manage-table tr.replimap-controllers-manage-table__screenshot details.note {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0;
  border-radius: 8px;
  box-sizing: border-box;
  overflow: hidden;
}

.md-typeset table.replimap-controllers-manage-table tr.replimap-controllers-manage-table__screenshot details.note:not([open]) {
  background-color: rgba(68, 138, 255, 0.1);
}

.md-typeset table.replimap-controllers-manage-table tr.replimap-controllers-manage-table__screenshot details.note > summary {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 0.6rem 2.6rem 0.6rem 2.6rem;
  border-radius: 0;
  background-color: transparent;
}

.md-typeset table.replimap-controllers-manage-table tr.replimap-controllers-manage-table__screenshot details.note[open] > summary {
  background-color: rgba(68, 138, 255, 0.1);
}

[data-md-color-scheme="slate"] .md-typeset table.replimap-controllers-manage-table tr.replimap-controllers-manage-table__screenshot details.note:not([open]),
[data-md-color-scheme="slate"] .md-typeset table.replimap-controllers-manage-table tr.replimap-controllers-manage-table__screenshot details.note[open] > summary {
  background-color: rgba(68, 138, 255, 0.15);
}

.md-typeset table.replimap-controllers-manage-table tr.replimap-controllers-manage-table__screenshot details.note > summary::after {
  right: 0.75rem;
}

.md-typeset table.replimap-controllers-manage-table tr.replimap-controllers-manage-table__screenshot details.note > p {
  margin: 0.5rem 0 0;
  padding: 0 0.75rem 0.75rem;
  text-align: center;
  box-sizing: border-box;
}

.md-typeset table.replimap-controllers-manage-table tr.replimap-controllers-manage-table__screenshot details.note img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

/* Controllers — centered table inside Save Validation warning */
.replimap-controllers-save-validation .replimap-controllers-panel-shot {
  width: 100%;
  max-width: 100%;
  margin-top: 0.75rem;
}

.replimap-controllers-save-validation__table-wrap {
  text-align: center;
  width: 100%;
  margin-top: 0.5rem;
}

.replimap-controllers-save-validation__table-wrap .md-typeset__scrollwrap,
.replimap-controllers-save-validation__table-wrap .md-typeset__table {
  display: inline-block !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  text-align: left;
  vertical-align: top;
}

.replimap-controllers-save-validation__table-wrap .md-typeset__table table:not([class]) {
  display: table !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: min(100%, var(--replimap-table-max-width)) !important;
  table-layout: auto !important;
  margin: 0 auto;
}

/* Expandable demo video / GIF — inline player + lightbox fullscreen */
.replimap-expandable-media {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.replimap-expandable-media__video,
.replimap-expandable-media__image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  background: #000;
}

.replimap-expandable-media__fullscreen {
  position: absolute;
  right: 0.65rem;
  bottom: 2.85rem;
  z-index: 2;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.72);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H5a2 2 0 0 0-2 2v3'/%3E%3Cpath d='M21 8V5a2 2 0 0 0-2-2h-3'/%3E%3Cpath d='M3 16v3a2 2 0 0 0 2 2h3'/%3E%3Cpath d='M16 21h3a2 2 0 0 0 2-2v-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1.15rem;
  cursor: pointer;
  opacity: 0.92;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.replimap-expandable-media__fullscreen:hover,
.replimap-expandable-media__fullscreen:focus-visible {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.88);
  outline: none;
}

body.replimap-media-lightbox-open {
  overflow: hidden;
}

.replimap-media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 250;
}

.replimap-media-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.replimap-media-lightbox__content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 3rem 1rem 1rem;
  box-sizing: border-box;
}

.replimap-media-lightbox__media {
  display: block;
  width: auto;
  max-width: min(96vw, 1440px);
  max-height: 88vh;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.replimap-media-lightbox__close,
.replimap-media-lightbox__fs {
  position: absolute;
  top: 0.85rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.replimap-media-lightbox__close:hover,
.replimap-media-lightbox__close:focus-visible,
.replimap-media-lightbox__fs:hover,
.replimap-media-lightbox__fs:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  outline: none;
}

.replimap-media-lightbox__close {
  right: 0.85rem;
  font-size: 1.65rem;
  line-height: 1;
}

.replimap-media-lightbox__fs {
  right: 3.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H5a2 2 0 0 0-2 2v3'/%3E%3Cpath d='M21 8V5a2 2 0 0 0-2-2h-3'/%3E%3Cpath d='M3 16v3a2 2 0 0 0 2 2h3'/%3E%3Cpath d='M16 21h3a2 2 0 0 0 2-2v-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1.2rem;
}

/* Single-column compact tables (e.g. Lane IDs list) */
.replimap-compact-lane-table {
  width: fit-content;
  max-width: 100%;
  margin: 0.5rem 0 1rem;
}

.replimap-compact-lane-table .md-typeset__scrollwrap,
.replimap-compact-lane-table .md-typeset__table {
  display: inline-block !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.replimap-compact-lane-table table:not([class]) {
  display: table !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: auto !important;
}

.replimap-compact-lane-table table:not([class]) th,
.replimap-compact-lane-table table:not([class]) td {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0.45rem 1.5rem !important;
  text-align: center;
  white-space: nowrap;
}

/* Stop Line — visualization example table column widths */
.replimap-stop-line-visualization-table .md-typeset__table table:not([class]),
.replimap-stop-line-visualization-table table:not([class]) {
  table-layout: fixed !important;
  width: 100% !important;
}

.replimap-stop-line-visualization-table .md-typeset__table table:not([class]) th:nth-child(1),
.replimap-stop-line-visualization-table .md-typeset__table table:not([class]) td:nth-child(1),
.replimap-stop-line-visualization-table table:not([class]) th:nth-child(1),
.replimap-stop-line-visualization-table table:not([class]) td:nth-child(1) {
  width: 8.5rem !important;
  min-width: 8.5rem !important;
  max-width: 8.5rem !important;
  white-space: nowrap;
}

.replimap-stop-line-visualization-table .md-typeset__table table:not([class]) th:nth-child(2),
.replimap-stop-line-visualization-table .md-typeset__table table:not([class]) td:nth-child(2),
.replimap-stop-line-visualization-table table:not([class]) th:nth-child(2),
.replimap-stop-line-visualization-table table:not([class]) td:nth-child(2) {
  width: 11rem !important;
  min-width: 11rem !important;
  max-width: 11rem !important;
}

.replimap-stop-line-visualization-table .md-typeset__table table:not([class]) th:nth-child(3),
.replimap-stop-line-visualization-table .md-typeset__table table:not([class]) td:nth-child(3),
.replimap-stop-line-visualization-table table:not([class]) th:nth-child(3),
.replimap-stop-line-visualization-table table:not([class]) td:nth-child(3) {
  width: auto !important;
  min-width: 0 !important;
}
