/* source-glossary-map3d.css - the 3D mode of the Map tab of the Sources workspace (web/modules/source-glossary-map3d.js).
   Theme tokens only. The scene itself is the engine's (graph3d.js, the .graph3d block of command-center.css). This sheet
   lays out ONE row of controls above the scene; the scene, its height taken in script from what is left of the window
   (--sg-m3-scene-h, never under 420 pixels, never viewport math here), with a one-line key under it and the whole legend
   in a fold over it; and beside the scene one column: the grid of categories and its sentence, the chosen cell, the
   notices, the panel of an act (the workspace's, mounted in the host the map gives it), the inspector with its acts
   first, the find box and the list. Colour keeps to the evidence state: the grid's heat is ink, its stated and suggested
   parts the flat map's colours with a solid and a dashed figure, so neither rests on colour alone. */

.sg-m3 { display: grid; gap: var(--space-2); min-width: 0; }

/* The same camera and labels serve the study overview and each database. */
.sg-spatial { position: relative; isolation: isolate; overflow: hidden; min-width: 0; min-height: 320px;
  background-color: var(--surface-inverse);
  background-image: radial-gradient(ellipse at 45% 37%, color-mix(in srgb, var(--surface-inverse) 75%, var(--map-rule)), transparent 80%); }
.sg-spatial-ground, .sg-spatial-viewport, .sg-spatial-labels { position: absolute; inset: 0; }
.sg-spatial-ground { width: 100%; height: 100%; pointer-events: none; }
.sg-spatial-viewport canvas { display: block; touch-action: none; }
.sg-spatial-labels { pointer-events: none; overflow: hidden; }
.sg-spatial-label { pointer-events: auto; position: absolute; inset: 0 auto auto 0; max-width: min(190px, 48%); text-align: left;
  border: 1px solid var(--map-rule); border-radius: var(--radius-sm); padding: 3px 7px; font: inherit;
  font-size: var(--fs-small); line-height: 1.25; background: var(--surface-inverse); color: var(--map-ink); cursor: pointer; }
.sg-spatial-label strong, .sg-spatial-label small { display: block; white-space: normal; overflow-wrap: anywhere; }
.sg-spatial-label small { margin-top: 2px; font-variant-numeric: tabular-nums; color: var(--map-next); font-size: var(--fs-label); }
.sg-spatial-label[data-spatial-kind="cluster"] { border-top-width: 2px; }
.sg-spatial-label[data-spatial-kind="member"] { max-width: min(185px, 46%); font-size: var(--fs-caption); padding: 2px 5px; background: color-mix(in srgb, var(--surface-inverse) 91%, transparent); }
.sg-spatial-label[data-spatial-kind="member"] strong { font-weight: 500; }
.sg-spatial-label.is-current { outline: 2px solid var(--map-ink); z-index: 1; }
.sg-spatial-label.is-current strong { font-weight: 700; }
.sg-spatial-edge { border-radius: var(--radius-pill); font-size: var(--fs-label); color: var(--map-next); }
.sg-spatial-label[hidden] { display: none; }
.sg-spatial-label:focus-visible, .sg-spatial-label:hover { border-color: var(--sidebar-accent); outline: 1px solid var(--sidebar-accent); }
.sg-spatial-tools { position: absolute; z-index: 2; right: 10px; top: 10px; display: flex; gap: 3px; }
.sg-spatial-tools .btn { min-width: 32px; min-height: 32px; border-color: var(--map-rule); color: var(--map-ink); background: var(--surface-inverse); }
.sg-spatial-tools .btn:hover { color: var(--map-ink); background: var(--map-rule); }
.sg-spatial-hint { position: absolute; left: 10px; bottom: 8px; pointer-events: none; color: var(--chrome-text);
  background: var(--surface-inverse); border-radius: var(--radius-sm); padding: 2px 6px; font-size: var(--fs-label); }
@media (max-width: 650px) {
  .sg-spatial-label { max-width: min(142px, 40%); }
  .sg-spatial-hint { font-size: var(--fs-label); left: 6px; }
}
@media (pointer: coarse) {
  .sg-spatial-tools .btn { min-width: 40px; min-height: 40px; }
}

/* The controls: one row above the scene. */
.sg-m3-head { min-width: 0; }
.sg-m3-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px var(--space-3); }
.sg-m3-control { display: grid; gap: 1px; min-width: 0; font-size: var(--fs-label); font-weight: 600; color: var(--text-secondary); }
.sg-m3-control select {
  min-height: 27px; font: inherit; font-size: var(--fs-caption); font-weight: 500; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 2px 6px;
}
.sg-m3-control.is-system select { width: 236px; max-width: 100%; }
.sg-m3-control.is-level select { width: 212px; max-width: 100%; }
.sg-m3-control.is-group select { width: 150px; max-width: 100%; }
.sg-m3-control select:disabled { color: var(--text-faint); }
.sg-m3-links { position: relative; min-width: 0; font-size: var(--fs-caption); font-weight: 500; }
.sg-m3-links > summary { cursor: pointer; min-height: 27px; max-width: 220px; display: flex; align-items: center; padding: 2px 8px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-m3-links > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sg-m3-links-panel { position: absolute; z-index: 8; left: 0; top: calc(100% + 4px); width: 250px; margin: 0; display: grid; gap: 4px; padding: 8px 10px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); }
.sg-m3-links-panel legend { font-size: var(--fs-label); font-weight: 600; color: var(--text-secondary); padding: 0 2px; }
.sg-m3-links-panel label { display: flex; gap: 6px; align-items: center; color: var(--text-body); }
.sg-m3-arcs { flex: none; }
.sg-m3-arcs[aria-pressed="true"] { background: var(--surface-sunken); border-color: var(--border-strong); font-weight: 650; }

/* The stage: the scene and the column beside it, as tall as the scene; the key line under both, the whole width. The
   column is 344 pixels unless the grid needs more: the script then widens it (--sg-m3-side-w, at most the 402 pixels it
   takes while an act's panel is open) and the scene gives up that width. */
.sg-m3-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, var(--sg-m3-side-w, 344px)); grid-template-areas: "scene side" "key key"; gap: 6px var(--space-3); align-items: start; }
.sg-m3-scene-wrap { grid-area: scene; position: relative; min-width: 0; }
.sg-m3-scene.graph3d.graph3d-decks { height: var(--sg-m3-scene-h, 560px); min-height: 420px; }
.sg-m3-overlay:empty { display: none; }
.sg-m3-overlay { position: absolute; z-index: 5; left: 10px; top: 10px; }
.sg-m3-reading { margin: 0; padding: 3px 10px; font-size: var(--fs-caption); color: var(--text-secondary); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-pill); }
.sg-m3-stage.is-state .sg-m3-overlay { inset: 0; display: grid; align-content: center; justify-items: center; padding: var(--space-5);
  background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: auto; }
.sg-m3-stage.is-state .sg-m3-overlay .state-block { max-width: 64ch; }
.sg-m3-stage.is-state .sg-m3-side { visibility: hidden; }
.sg-m3-state-acts { margin: var(--space-2) 0 0; text-align: center; }

/* The key line under the scene: the Legend button, then one line of signs in words. */
.sg-m3-keyline { grid-area: key; display: flex; align-items: center; gap: var(--space-2); min-height: 30px; min-width: 0; font-size: var(--fs-label); color: var(--text-secondary); }
.sg-m3-keyline:empty { visibility: hidden; }
.sg-m3-legend-toggle { flex: none; }
.sg-m3-legend-toggle[aria-expanded="true"] { background: var(--surface-sunken); border-color: var(--border-strong); }
.sg-m3-key-items { display: flex; align-items: center; gap: 2px var(--space-3); min-width: 0; overflow: hidden; white-space: nowrap; }
.sg-m3-key-item { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.sg-m3-key-item .sg-m3-swatch { width: 24px; height: 13px; }
.sg-m3-key-item[hidden] { display: none; }
.sg-m3-key-more { flex: none; color: var(--text-dim); font-style: italic; padding-right: 3px; }
/* The whole legend, over the scene's lower left corner, above the key line. */
.sg-m3-legend-panel { position: absolute; z-index: 6; left: 10px; bottom: 10px; width: min(470px, calc(100% - 20px)); max-height: calc(100% - 20px);
  overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-pop); }
.sg-m3-legend-panel[hidden] { display: none; }
.sg-m3-legend-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: 6px; font-size: var(--fs-small); color: var(--text); }

/* The legend's rows. */
.sg-m3-legend { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: var(--fs-label); color: var(--text-secondary); }
.sg-m3-legend-item { display: flex; gap: 6px; align-items: center; min-width: 0; line-height: 1.25; }
.sg-m3-legend-item > span[aria-hidden="true"] { min-width: 0; }
.sg-m3-swatch { flex: none; }
.sg-m3-legend-more { margin-top: 4px; font-size: var(--fs-label); color: var(--text-dim); }
.sg-m3-legend-more > summary { cursor: pointer; width: max-content; }
.sg-m3-swatch .sg-m3-sw-block { fill: var(--unknown); stroke: var(--text-dim); stroke-width: 0.75; }
.sg-m3-swatch .sg-m3-sw-block.is-dashed { fill: var(--surface-muted); stroke-dasharray: 2 1.5; }
.sg-m3-swatch .sg-m3-sw-plate { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1; }
.sg-m3-swatch .sg-m3-sw-line { fill: none; stroke: var(--text-dim); stroke-width: 1.25; }
.sg-m3-swatch .sg-m3-sw-fill { fill: var(--text-dim); stroke: none; }
.sg-m3-swatch .sg-m3-sw-open { fill: var(--surface); stroke: var(--text-dim); stroke-width: 1.25; }
.sg-m3-swatch .sg-m3-sw-pale { fill: var(--surface-muted); stroke: var(--text-dim); stroke-width: 0.75; }
.sg-m3-swatch .sg-m3-sw-pale.is-dotted { stroke-dasharray: 1 1.5; }
.sg-m3-swatch .sg-m3-sw-bundle { fill: none; stroke: var(--info); stroke-width: 3; }
.sg-m3-swatch .sg-m3-sw-pill { fill: var(--surface); stroke: var(--info); stroke-width: 1; }
/* Deprecated: a flat tile with an inset rim; proposed: hollow at full height; waiting: a dashed tile. */
.sg-m3-swatch .sg-m3-sw-tile { fill: var(--surface); stroke: var(--text-dim); stroke-width: 1.25; }
.sg-m3-swatch .sg-m3-sw-inset { fill: none; stroke: var(--text-dim); stroke-width: 1; }
.sg-m3-swatch .sg-m3-sw-hollow { fill: var(--surface); stroke: var(--text-dim); stroke-width: 1.25; }
.sg-m3-swatch .sg-m3-sw-ghost { fill: none; stroke: var(--text-dim); stroke-width: 1.25; stroke-dasharray: 3 2; }

/* The column beside the scene: as tall as the scene and its key line, scrolled inside. */
.sg-m3-side { grid-area: side; display: grid; gap: var(--space-2); align-content: start; min-width: 0; max-height: var(--sg-m3-side-h, 560px); overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.sg-m3-status:empty, .sg-m3-pairbox:empty { display: none; }
.sg-m3-status-list { margin: 0; padding: var(--space-2) var(--space-3); list-style: none; display: grid; gap: 4px; font-size: var(--fs-caption);
  color: var(--text-body); background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-md); }

/* The grid of categories: compact, a row 16 pixels tall, so ten categories stay under 200 and fit the column. */
.sg-m3-matrix { min-width: 0; }
.sg-m3-mx-grid { min-width: 0; overflow-x: auto; }
/* One pixel between cells: a system of thousands of tables (four-digit cells) still fits the column. */
.sg-m3-mx { border-collapse: separate; border-spacing: 1px; font-size: var(--fs-label); color: var(--text-body); }
.sg-m3-mx-caption { caption-side: top; text-align: left; font-size: var(--fs-label); font-weight: 650; color: var(--text); padding: 0 0 1px; white-space: nowrap; }
.sg-m3-mx-col { font-size: 10px; font-weight: 650; color: var(--text-secondary); text-align: center; padding: 0; min-width: 19px; line-height: 1.2; }
.sg-m3-mx-col abbr { text-decoration: none; cursor: help; }
.sg-m3-mx-row { text-align: right; font-weight: 600; color: var(--text); white-space: nowrap; padding: 0 3px 0 0; font-size: var(--fs-label); line-height: 1.2; }
.sg-m3-mx-count { font-weight: 500; color: var(--text-faint); font-size: 10px; }
.sg-m3-mx-cell { width: 19px; height: 16px; padding: 0; text-align: center; vertical-align: middle; border-radius: 3px;
  background: color-mix(in srgb, var(--text) calc(var(--heat, 0) * 0.17%), var(--surface)); border: 1px solid var(--border-subtle); }
.sg-m3-mx-cell.is-upper { background: transparent; border-color: transparent; }
.sg-m3-mx-cell.is-empty { background: var(--surface-subtle); }
.sg-m3-mx-cell.is-diagonal { border-color: var(--border-strong); }
/* Not counted: hatched, said in words in the cell's name and under the grid; never a 0. */
.sg-m3-mx-cell.is-unknown { border: 1px dashed var(--border-strong);
  background: repeating-linear-gradient(135deg, var(--surface-muted) 0 3px, var(--surface) 3px 6px); }
.sg-m3-mx-cell.is-selected { outline: 2px solid var(--brand); outline-offset: 0; }
.sg-m3-mx-btn { display: grid; gap: 0; align-content: center; width: 100%; height: 100%; min-height: 15px; padding: 0 1px; border: 0; background: none;
  font: inherit; font-size: 10px; font-weight: 700; line-height: 1.05; color: var(--text); cursor: pointer; border-radius: 3px; }
.sg-m3-mx-btn:hover { box-shadow: inset 0 0 0 1px var(--brand); }
.sg-m3-mx-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
/* The compact grid (twelve plates or more: our own semantic layer fills all 14 categories): two-letter codes with no
   letter spacing and narrower cells, so every column stands in the column beside the scene; the script widens that
   column when even this is wider, and past its widest the grid scrolls under a fading edge and the cue under it says so. */
.sg-m3-mx.is-compact .sg-m3-mx-col { min-width: 16px; letter-spacing: 0; }
.sg-m3-mx.is-compact .sg-m3-mx-cell { width: 16px; }
.sg-m3-mx.is-compact .sg-m3-mx-btn { padding: 0; }
.sg-m3-mx-grid[data-overflow] { scrollbar-width: thin; mask-image: linear-gradient(to right, var(--text) calc(100% - 24px), transparent); }
.sg-m3-mx-cue { margin: 2px 0 0; font-size: var(--fs-label); color: var(--text-secondary); }
.sg-m3-mx-cue[hidden] { display: none; }
.sg-m3-mx-split { display: flex; gap: 1px; height: 2px; width: 100%; }
.sg-m3-mx-split .is-stated { background: var(--info); }
.sg-m3-mx-split .is-suggested { background: repeating-linear-gradient(90deg, var(--warn) 0 3px, transparent 3px 5px); }
.sg-m3-mx-text { margin-top: 3px; }
.sg-m3-mx-sentence { margin: 0; font-size: var(--fs-label); line-height: 1.35; color: var(--text-secondary); }
.sg-m3-mx-detail { margin: 0; font-size: var(--fs-label); line-height: 1.35; color: var(--text-body); }
.sg-m3-mx-detail .btn { margin-left: var(--space-1); }

/* The panel of an act: the workspace mounts it in the host under its heading, beside the scene. While it is open the
   column widens so the host is at least 360 pixels wide (the workspace's panel lists dependents and a reason there);
   the scene gives up that width and the engine fits its floor to the size it measures. */
.sg-m3-stage.has-act { grid-template-columns: minmax(0, 1fr) minmax(382px, 402px); }
.sg-m3-act { display: grid; gap: 6px; padding: var(--space-2) 8px 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); background: var(--surface); }
.sg-m3-act-host { min-width: 0; }
/* Once the workspace's panel stands in the host it names the act and closes itself: the section's own head (the act and
   Close, for the moment before the panel and for a panel that never came) steps aside, so nothing is said twice. */
.sg-m3-act:has(> .sg-m3-act-host:not(:empty)) > .sg-m3-act-head { display: none; }
.sg-m3-act[hidden] { display: none; }
.sg-m3-act-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.sg-m3-act-title { margin: 0; font-size: var(--fs-small); color: var(--text); overflow-wrap: anywhere; }
.sg-m3-act-host:empty { display: none; }
.sg-m3-act-said:empty { display: none; }
.sg-m3-act-said { margin: 0; font-size: var(--fs-caption); color: var(--text-body); }
.sg-m3-act-fallback { margin: 0 0 6px; font-size: var(--fs-caption); color: var(--text-secondary); }

/* The inspector: the engine's, docked in this column; its acts right under its name, so they are in view. */
.sg-m3-side.has-table-selection .sg-m3-act { order: -3; }
.sg-m3-side.has-table-selection .sg-m3-inspector { order: -2; }
.sg-m3-side.has-table-selection .sg-m3-listbox { order: -1; }
.sg-m3-inspector:empty { display: none; }
.sg-m3-inspector .graph3d-inspector.is-docked { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px 12px; }
.sg-m3-inspector .graph3d-insp-head { order: -3; }
.sg-m3-inspector .graph3d-insp-sub, .sg-m3-inspector .graph3d-insp-badges { order: -2; }
.sg-m3-inspector .graph3d-insp-actions { order: -1; margin-top: 0; }

.sg-m3-find { display: flex; gap: 6px; align-items: center; }
.sg-m3-find input[type="search"] { flex: 1; min-width: 0; min-height: 28px; font: inherit; font-size: var(--fs-caption); color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 2px 8px; }
.sg-m3-find-results:empty { display: none; }
.sg-m3-find-results { margin-top: 4px; }
.sg-m3-find-results .sg-map-find-list { padding-left: 18px; }
.sg-m3-listbox { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); padding: var(--space-2) var(--space-3); min-width: 0; }
.sg-m3-listbox:empty { display: none; }
.sg-m3-list .sg-map-list-head:first-child, .sg-m3-list > .sg-map-list-note:first-child + .sg-map-list-head { margin-top: 0; }
.sg-m3-list-items li.is-hover { background: var(--surface-subtle); }
.sg-m3-list-items li.is-selected > .sg-map-list-open { font-weight: 700; }
.sg-m3-list-items li.is-selected { box-shadow: inset 3px 0 0 var(--brand); padding-left: 4px; }
.sg-m3-list-items li[data-lifecycle="deprecated"] > .sg-map-list-open { text-decoration: line-through; text-decoration-thickness: 1px; }
.sg-m3-list-items li[data-lifecycle="proposed"] > .sg-map-list-open { text-decoration: underline dashed; text-underline-offset: 3px; }
.sg-m3-list-ghost { color: var(--text-secondary); font-style: italic; }

/* The study map makes its table and field directory the primary, keyboard-accessible view. */
.sg-m3-data-mode .sg-m3-side { align-content: start; }
.sg-m3-data-mode .sg-m3-side:not(.shows-link) .sg-m3-inspector { display: none; }
.sg-m3-data-mode .sg-m3-side.shows-link .sg-m3-inspector, .sg-m3-data-mode .sg-m3-act:not([hidden]) { order: -5; }
.sg-m3-data-mode .sg-m3-side .sg-m3-listbox { order: -3; padding: 0; overflow-wrap: anywhere; }
.sg-m3-data-mode .sg-m3-side .sg-m3-pairbox:not(:empty) { order: -4; }
.sg-m3-data-mode .sg-m3-listbox > .sg-m3-list, .sg-m3-data-mode [data-m3-table-profile] { padding: var(--space-3); }
.sg-m3-data-mode .sg-m3-list-items, .sg-m3-peers { list-style: none; margin: 0; padding: 0; }
.sg-m3-data-mode .sg-m3-list-items > li { padding: 6px 0; border-top: 1px solid var(--border-subtle); }
.sg-m3-data-mode .sg-m3-list-items .sg-map-list-meta, .sg-m3-peers li > span { display: block; color: var(--text-secondary); font-size: var(--fs-caption); }
.sg-m3-data-heading { margin-bottom: var(--space-2); }
.sg-m3-data-heading small { color: var(--text-secondary); }
.sg-m3-data-heading h3 { margin: 4px 0; color: var(--text); font-size: var(--fs-h3); line-height: 1.2; overflow-wrap: anywhere; }
.sg-m3-data-heading p, .sg-m3-table-meta { margin: 0; color: var(--text-secondary); font-size: var(--fs-caption); }
.sg-m3-table-meta { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; justify-content: space-between; }
.sg-m3-back { margin-bottom: 4px; }
.sg-m3-data-mode [data-m3-table-profile] > section, .sg-m3-data-options { border-top: 1px solid var(--border); margin-top: var(--space-2); padding-top: 5px; }
.sg-m3-data-mode [data-m3-table-profile] h4 { margin: 2px 0 5px; font-size: var(--fs-body); }
.sg-m3-data-mode [data-m3-table-profile] h5 { margin: 8px 0 3px; font-size: var(--fs-caption); color: var(--text-secondary); }
.sg-m3-fields { border-collapse: collapse; table-layout: fixed; width: 100%; margin-bottom: 6px; }
.sg-m3-fields-head { display: flex; gap: var(--space-2); align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.sg-m3-fields th, .sg-m3-fields td { padding: 2px; text-align: left; border-bottom: 1px solid var(--border-subtle); overflow-wrap: anywhere; }
.sg-m3-fields th:first-child { width: 66%; }
.sg-m3-fields thead th { color: var(--text-secondary); font-size: var(--fs-caption); }
.sg-m3-fields button[data-column], .sg-m3-peers button[data-node] { border: 0; border-radius: var(--radius-sm); background: transparent; padding: 3px 0; text-align: left; color: var(--brand); cursor: pointer; font: inherit; font-weight: 600; overflow-wrap: anywhere; }
.sg-m3-fields button[data-column]:hover, .sg-m3-peers button[data-node]:hover { text-decoration: underline; }
.sg-m3-fields button[data-column]:focus-visible, .sg-m3-peers button[data-node]:focus-visible { box-shadow: var(--focus-ring); }
.sg-m3-fields small { display: inline-block; margin-left: 5px; color: var(--text-secondary); font-weight: 400; font-size: var(--fs-label); }
.sg-m3-fields td { color: var(--text-secondary); font-size: var(--fs-caption); }
.sg-m3-row-meaning p { margin: 2px 0 4px; line-height: 1.4; }
.sg-m3-row-meaning small { color: var(--text-secondary); }
.sg-m3-peers li { display: flow-root; padding: 3px 0; border-bottom: 1px solid var(--border-subtle); }
.sg-m3-peers li > button, .sg-m3-peers li > b { float: left; max-width: 65%; }
.sg-m3-peers summary { width: max-content; max-width: 34%; margin-left: auto; padding: 4px 0; font-size: var(--fs-caption); cursor: pointer; color: var(--text-secondary); }
.sg-m3-peers details > div { clear: both; padding: 3px 0 5px; color: var(--text-secondary); font-size: var(--fs-caption); }
.sg-m3-peers details .sg-map-list-acts { display: block; }
.sg-m3-data-options > summary, .sg-m3-matrix-fold > summary { cursor: pointer; color: var(--text-secondary); font-weight: 600; font-size: var(--fs-small); }
.sg-m3-data-options > div { display: flex; gap: 5px; flex-wrap: wrap; margin: 6px 0; }
.sg-m3-matrix-fold { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-2); }

.sg-m3-about { font-size: var(--fs-small); color: var(--text-dim); }
.sg-m3-about > summary { cursor: pointer; width: max-content; }
.sg-m3-notices { margin: var(--space-2) 0 0; padding-left: 18px; display: grid; gap: 3px; }

/* Narrow: the key line, then the column, under the scene. */
@media (max-width: 980px) {
  .sg-m3-stage, .sg-m3-stage.has-act { grid-template-columns: minmax(0, 1fr); grid-template-areas: "scene" "key" "side"; }
  .sg-m3-side { max-height: none; }
}
@media (prefers-reduced-motion: reduce) { .sg-m3 * { transition: none; } }
