/* REST API map page, Help Center host of media/rest-map.js (TW-4307).
   rest-map.css is themed with --vscode-* variables; here they are defined for
   the Help Center: light on :root, dark under html.theme--dark (the page adds
   theme--<name> to <html>). Only variables are defined at :root; every rule
   below is scoped to .rest-map-page so the Help Center chrome is untouched. */
:root {
  --vscode-font-family: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --vscode-editor-font-family: ui-monospace, Consolas, "Liberation Mono", monospace;
  --vscode-editor-background: #ffffff;
  --vscode-editor-foreground: #1f2328;
  --vscode-editorWidget-background: #ffffff;
  --vscode-editorWidget-border: #d0d7de;
  --vscode-sideBar-background: #f6f8fa;
  --vscode-panel-border: #d0d7de;
  --vscode-focusBorder: #0b63c5;
  --vscode-descriptionForeground: #59636e;
  --vscode-textLink-foreground: #0b63c5;
  --vscode-list-hoverBackground: #eaeef2;
  --vscode-charts-purple: #8250df;
  --vscode-toolbar-hoverBackground: rgba(128, 128, 128, .18);
  --vscode-editor-findMatchHighlightBackground: rgba(255, 190, 60, .45);
  --vscode-editorIndentGuide-background: rgba(128, 128, 128, .18);
  --vscode-editorIndentGuide-background1: rgba(128, 128, 128, .18);
  --vscode-input-background: #ffffff;
  --vscode-input-foreground: #1f2328;
  --vscode-input-border: #b6bec7;
  --vscode-button-secondaryBackground: #eaeef2;
  --vscode-button-secondaryForeground: #1f2328;
  --vscode-button-secondaryHoverBackground: #d8dee4;
  --vscode-widget-shadow: rgba(31, 35, 40, .18);
}

html.theme--dark {
  --vscode-editor-background: #1e1e1e;
  --vscode-editor-foreground: #d4d4d4;
  --vscode-editorWidget-background: #252526;
  --vscode-editorWidget-border: #454545;
  --vscode-sideBar-background: #252526;
  --vscode-panel-border: #454545;
  --vscode-focusBorder: #4da3ff;
  --vscode-descriptionForeground: #9d9d9d;
  --vscode-textLink-foreground: #4da3ff;
  --vscode-list-hoverBackground: #2a2d2e;
  --vscode-charts-purple: #b180d7;
  --vscode-toolbar-hoverBackground: rgba(255, 255, 255, .12);
  --vscode-editor-findMatchHighlightBackground: rgba(234, 160, 40, .35);
  --vscode-editorIndentGuide-background: rgba(255, 255, 255, .10);
  --vscode-editorIndentGuide-background1: rgba(255, 255, 255, .10);
  --vscode-input-background: #3c3c3c;
  --vscode-input-foreground: #cccccc;
  --vscode-input-border: #5a5a5a;
  --vscode-button-secondaryBackground: #3a3d41;
  --vscode-button-secondaryForeground: #ffffff;
  --vscode-button-secondaryHoverBackground: #45494e;
  --vscode-widget-shadow: rgba(0, 0, 0, .5);
}

/* The map fills the content area below the Help Center header. */
.rest-map-page {
  position: relative;
  height: calc(100vh - 140px);
  min-height: 480px;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--vscode-editorWidget-border);
  border-radius: 4px;
}

.rest-map-page.rest-map-failed {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--vscode-descriptionForeground);
  font: 14px/1.4 var(--vscode-font-family);
}

/* ---- Map mode on a Redocly reference page (TW-4427, rest-map-page.js
   startMapMode; DESIGN_GUIDELINES §6.6). The script sets the layer's
   left/top/right and the --rm-* offsets from the measured content column. */
:root {
  --rm-hc-font: "Guardian Sans LC", Helvetica, Arial, sans-serif;
  --rm-hc-bg: #ffffff;
  --rm-hc-fg: #232323;
  --rm-hc-btn: #eaeef2;
}
html.theme--dark {
  --rm-hc-bg: #232323;
  --rm-hc-fg: #f0f0f0;
  --rm-hc-btn: #323f4b;
}

html.rm-map-on,
html.rm-map-on body { overflow: hidden; }
html.rm-map-on .api-content { display: none !important; }
/* A Description page with a classic scrollbar keeps its gutter in Map mode, so
   nothing shifts sideways when the scrollbar goes (rest-map-page.js setMode). */
html.rm-map-on.rm-gutter { scrollbar-gutter: stable; }

.rm-mode-layer {
  position: fixed;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: var(--rm-h1-top, 20px) calc(var(--rm-right, 0px) + 24px) calc(var(--rm-bottom, 0px) + 16px) 40px;
  background: var(--rm-hc-bg);
  color: var(--rm-hc-fg);
}
.rm-mode-layer[hidden] { display: none; }
.rm-mode-head {
  flex: 0 0 auto;
  height: var(--rm-h1-height, 36px);
  margin: 0 0 16px; /* MAP_HEAD_GAP in rest-map-page.js */
}
.rm-mode-title {
  margin: 0;
  font: 400 28px/36px var(--rm-hc-font);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rm-mode-layer .rest-map-page {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

/* One segmented [Description | Map] switch: 6 px track in the Redocly button
   fill, 2 px padding, active option green with a 4 px radius, 14px/600. */
.rm-switch {
  position: fixed;
  z-index: 21;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 6px;
  background: var(--rm-hc-btn);
  transition: box-shadow .12s;
}
.rm-seg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 4px 14px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--rm-hc-fg);
  opacity: .72;
  font: 600 14px/22px var(--rm-hc-font);
  cursor: pointer;
  transition: background-color .12s, opacity .12s;
}
.rm-seg svg { flex: 0 0 auto; }
.rm-seg:hover { opacity: 1; }
/* ONE button on every layout (TW-4466, §6.6 2026-11-26): the current mode's button is hidden,
   the other one shows. No selected state, no green tint. */
.rm-switch .rm-seg[hidden] { display: none; }
.rm-seg:focus-visible { outline: 2px solid var(--vscode-focusBorder); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .rm-seg { transition: none; } }

/* The switch in Redocly's right button column (owner, 2026-11-23): one icon
   button directly under Redocly's buttons, with their size, fill and radius
   (rest-map-page.js copies them into --rm-sw-*). */
.rm-switch.rm-switch-col {
  flex-direction: column;
  gap: var(--rm-sw-gap, 10px);
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.rm-switch-col .rm-seg {
  justify-content: center;
  width: var(--rm-sw-size, 40px);
  height: var(--rm-sw-size, 40px);
  padding: 0;
  border-radius: var(--rm-sw-radius, 6px);
  background: var(--rm-sw-bg, #e5e8eb);
  color: var(--rm-sw-icon, #9aa6b1);
  opacity: 1;
}
.rm-switch-col .rm-seg svg { width: 18px; height: 18px; }
/* The strip (no Redocly column, owner 2026-11-24): 32 px buttons fit Redocly's
   40 px section padding with 4 px each side (STRIP_BTN in rest-map-page.js). */
.rm-switch.rm-switch-strip { gap: 8px; }
.rm-switch-strip .rm-seg { width: 32px; height: 32px; }
.rm-switch-strip .rm-seg svg { width: 16px; height: 16px; }
.rm-switch-col .rm-seg span {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.rm-switch-col .rm-seg:hover { filter: brightness(.95); }
/* Phones (owner, 2026-11-24): where Redocly shows its round floating TOC button,
   the switch is a round button beside it. rest-map-page.js copies the TOC
   button's size, fill, shadow and icon colour into --rm-fab-*. */
.rm-switch.rm-switch-fab {
  z-index: 100; /* level with Redocly's TOC button and the Help Center buttons */
  padding: 0;
  border-radius: 50%;
  background: none;
  box-shadow: none;
}
.rm-switch-fab .rm-seg,
.rm-switch-fab .rm-seg:hover {
  justify-content: center;
  width: var(--rm-fab-size, 60px);
  height: var(--rm-fab-size, 60px);
  padding: 0;
  border-radius: 50%;
  background: var(--rm-fab-bg, #f2f2f2);
  box-shadow: var(--rm-fab-shadow, 0 0 20px rgba(0, 0, 0, .3));
  color: var(--rm-fab-icon, #00b336);
  opacity: 1;
}
.rm-switch-fab .rm-seg svg { width: 24px; height: 24px; }
.rm-switch-fab .rm-seg span {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
/* The map on a phone: no minimap (it would cover a third of the stage). */
html.rm-fab .rm-mode-layer .rm-mm { display: none !important; }

/* Redocly's layout controls do nothing for the map: hidden in Map mode, still
   laid out so the switch under them keeps its place. */
html.rm-map-on [data-rm-ctl] { visibility: hidden; }

/* The tooltip copies Redocly's own ("Change layout", measured on the VB365
   preview 2026-11-23): slate fill, 13/24 text, 10x20 padding, an arrow
   pointing at the button across a 10px gap. */
.rm-sw-tip {
  position: fixed;
  z-index: 60;
  padding: 10px 20px;
  border-radius: 6px;
  background: #52606d;
  color: #f5f7fa;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
  font: 13px/24px var(--rm-hc-font);
  white-space: nowrap;
  pointer-events: none;
}
.rm-sw-tip::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -6px;
  margin-top: -5px;
  border-style: solid;
  border-width: 5px 0 5px 6px;
  border-color: transparent transparent transparent #52606d;
}
.rm-sw-tip[hidden] { display: none; }

/* First use: the Map button pulses and a callout names it (rest-map-page.js startIntro). */
.rm-seg.rm-pulse { animation: rm-pulse 1.6s ease-out 3; }
@keyframes rm-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 209, 95, .65); }
  100% { box-shadow: 0 0 0 12px rgba(0, 209, 95, 0); }
}
.rm-intro {
  position: fixed;
  z-index: 61;
  display: grid;
  gap: 2px;
  width: 260px;
  padding: 10px 30px 10px 12px;
  border: 1px solid var(--vscode-editorWidget-border);
  border-left: 3px solid #00d15f;
  border-radius: 6px;
  background: var(--vscode-sideBar-background);
  color: var(--vscode-editor-foreground);
  box-shadow: 0 4px 16px var(--vscode-widget-shadow);
  font: 13px/1.4 var(--rm-hc-font);
}
.rm-intro b { font-weight: 600; }
.rm-intro span { color: var(--vscode-descriptionForeground); }
.rm-intro-x {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px;
  background: none; color: var(--vscode-descriptionForeground);
  font: 16px/1 var(--rm-hc-font); cursor: pointer;
}
.rm-intro-x:hover { color: var(--vscode-editor-foreground); background: var(--vscode-toolbar-hoverBackground); }
.rm-intro-x:focus-visible { outline: 2px solid var(--vscode-focusBorder); }
@media (prefers-reduced-motion: reduce) { .rm-seg.rm-pulse { animation: none; box-shadow: 0 0 0 3px rgba(0, 209, 95, .55); } }

/* --- Reference TOC: category rows (TW-4428) and width (TW-4429) -------------
   The rows' rules, the category colours and the TOC width rule are inline in each page's
   <head> (<style data-rm-critical>, src/rest/map/restMapCritical.ts, TW-4480) so the TOC is right
   on first paint; this file loads after it and only holds the handle below. */
/* --- Reference TOC: resize handle (TW-4429) -------------------------------- */
.rm-toc-handle {
  position: fixed; z-index: 22; width: 6px; cursor: col-resize; touch-action: none; /* above the Map mode layer (20) and switch (21) */
  background: transparent; transition: background-color .12s;
}
.rm-toc-handle[hidden] { display: none; }
/* No edge line on hover, focus or drag (owner, 2026-11-27): like the guide splitter, the grip and the col-resize
   cursor are the only cues. */
.rm-toc-handle:focus-visible { outline: none; }
/* The Help Center guide splitter's grip (helpcenter.css .split__dots, same SVG): three #898989 dots, centred on the
   visible part of the edge (the handle is clamped to the viewport, so 50% is the visible middle). */
.rm-toc-handle::before {
  content: ''; position: absolute; top: 50%; left: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 4px;
  background: no-repeat center url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 7C13.1046 7 14 6.10457 14 5C14 3.89543 13.1046 3 12 3C10.8954 3 10 3.89543 10 5C10 6.10457 10.8954 7 12 7Z' fill='%23898989'/%3E%3Cpath d='M12 14C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14Z' fill='%23898989'/%3E%3Cpath d='M12 21C13.1046 21 14 20.1046 14 19C14 17.8954 13.1046 17 12 17C10.8954 17 10 17.8954 10 19C10 20.1046 10.8954 21 12 21Z' fill='%23898989'/%3E%3C/svg%3E");
}
/* Keyboard focus: the same dotted ring as Redocly's TOC rows, around the grip. */
.rm-toc-handle:focus-visible::before { outline: 1px dotted currentColor; outline-offset: 1px; }
html.rm-toc-resizing, html.rm-toc-resizing * { cursor: col-resize !important; user-select: none !important; }
