@font-face {
  font-family: Plex;
  src: url("assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Plex;
  src: url("assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Plex;
  src: url("assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}
:root {
  --accent-soft: #281d15;
  --control: #191b1e;
  --hover: #292b2e;
  --on-accent: #080808;
}
:root[data-theme="orange"] {
  color-scheme: dark;
}
/* Keep the Marine accent distinct within the shared light/dark preference. */
:root[data-theme="orange"][data-atomsh-tool="subsea-optical-lab"][data-appearance] {
  --appearance-accent:#ad4900; --appearance-on-accent:#fff; --cable-accent:#ff7900;
}
:root[data-theme="orange"][data-atomsh-tool="subsea-optical-lab"][data-appearance="dark"] {
  --appearance-accent:#ff7900; --appearance-on-accent:#080808;
}
:root[data-theme="field"] {
  --bg: #f4f2ec;
  --panel: #fffefa;
  --line: #d4d7cf;
  --muted: #626e70;
  --aqua: #8b502d;
  --white: #263233;
  --gold: #8b502d;
  --accent-soft: #ede3d8;
  --control: #f9f8f3;
  --hover: #e9e9e0;
  --on-accent: #fffefa;
  color-scheme: light;
}
body {
  font-family: Plex, Arial, sans-serif;
  color: var(--white);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button,
select,
input {
  font-family: inherit;
}
button {
  color: var(--white);
  border-color: var(--line);
  background: var(--control);
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover {
  background: var(--hover);
}
button[aria-pressed="true"] {
  background: var(--aqua);
  border-color: var(--aqua);
  color: var(--on-accent);
}
button:focus-visible,
select:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 4px;
}
header {
  max-width: 1600px;
  margin: auto;
  padding: 25px 36px;
  gap: 24px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
main {
  padding-top: 32px;
}
.intro {
  margin-bottom: 30px;
}
h1 {
  font-weight: 500;
  letter-spacing: -1.5px;
}
.eyebrow {
  color: var(--aqua);
}
.intro > div > p:last-child {
  color: var(--muted);
  margin-top: 10px;
}
.intro .quiet {
  font-size: 12px;
}
.workspace-bar {
  padding-bottom: 15px;
}
.workspace-bar select {
  background: var(--control);
  color: var(--white);
  border-color: var(--line);
}
.workspace-bar nav button[aria-pressed="true"] {
  color: var(--aqua);
  box-shadow: inset 0 -2px var(--aqua);
}
.mission {
  border-color: var(--line);
}
.section-tabs button[aria-pressed="true"] {
  color: var(--aqua);
  border-color: var(--aqua);
  background: var(--accent-soft);
}
.section-heading h2 {
  font-weight: 500;
  font-size: 27px;
  letter-spacing: -0.6px;
}
.section-heading > p {
  color: var(--muted);
  max-width: 380px;
  font-size: 12px;
  line-height: 1.6;
}
.technical-stage {
  border-color: #334a58;
  border-radius: 6px;
  background: #10202b;
}
.vector-scene svg {
  font-family: Plex, Arial, sans-serif;
}
.vector-scene svg text {
  letter-spacing: 0.1px;
}
.vector-scene {
  min-width: 0;
}
.vector-scene svg {
  min-width: 0;
}
.technical-stage:has(.vector-scene):after {
  display: none !important;
}
.cable-component {
  cursor: pointer;
  outline: none;
}
.cable-component:hover {
  filter: brightness(1.2);
}
.cable-component:focus-visible {
  filter: brightness(1.5);
}
.cable-component.selected {
  filter: brightness(1.15) drop-shadow(0 0 3px #ffbc7530);
}
.cable-component.selected text {
  fill: #f0ca93;
}
.construction-reference {
  display: flex;
  gap: 18px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 15px 0 22px;
  font-size: 12px;
  color: var(--muted);
}
.construction-reference p {
  margin: 0;
  line-height: 1.6;
}
.construction-reference strong {
  color: var(--white);
  font-weight: 500;
}
.reference-index {
  color: var(--aqua);
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 1px;
}
.construction-reference a {
  white-space: nowrap;
  font-size: 11px;
  margin-left: auto;
}
.cable-layout {
  grid-template-columns: minmax(330px, 0.92fr) 1.08fr;
  padding: 0;
  gap: 28px;
  background: transparent;
  border: 0;
  align-items: start;
}
.cable-layout > div:first-child {
  overflow: hidden;
  border: 1px solid #334a58;
  border-radius: 6px;
  background: #10202b;
  position: static;
}
.cable-layout > div:nth-child(2) {
  padding: 8px 0;
}
.cable-layout svg {
  height: auto;
  max-height: 500px;
}
.cable-types {
  padding: 8px 14px 18px;
  margin: 0;
  gap: 6px;
}
.cable-types button {
  background: #162c38;
  color: #cfdee3;
  border-color: #3a5362;
  font-size: 12px;
}
.cable-types button[aria-pressed="true"] {
  background: #e7ba89;
  color: #10202b;
  border-color: #e7ba89;
}
.cable-profile h3 {
  font-size: 27px;
  font-weight: 500;
  color: var(--white);
}
.cable-profile .eyebrow {
  color: var(--aqua);
}
.cable-layout h3:not(#cable-title) {
  color: var(--aqua);
  font-size: 18px;
}
.cable-layout p {
  font-size: 13px;
  line-height: 1.7;
}
.layer-buttons {
  gap: 6px;
  margin-bottom: 22px;
}
.layer-buttons button {
  font-size: 11px;
  padding: 7px 10px;
}
.long-layer-info {
  display: flex;
  gap: 18px;
  align-items: baseline;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px 24px;
  border-radius: 5px;
  margin-top: 12px;
}
.long-layer-info strong {
  color: var(--aqua);
  font-size: 14px;
  min-width: 180px;
  font-weight: 500;
}
.long-layer-info span {
  color: var(--muted);
  font-size: 13px;
}
.stage-controls {
  color: #cfdee3;
  background: #10202b;
}
.stage-controls output {
  color: #e7ba89;
}
.stage-controls button {
  background: #18303e;
  color: #d5e3e8;
  border-color: #3b5767;
}
.stage-controls button[aria-pressed="true"] {
  background: #e7ba89;
  color: #10202b;
  border-color: #e7ba89;
}
.stage-controls input:disabled {
  opacity: 0.3;
}
.projection-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 14px 0;
}
.projection-controls > span {
  font-size: 11px;
  color: var(--muted);
  margin-right: 12px;
}
.projection-controls button {
  font-size: 11px;
  padding: 7px 11px;
}
.repair-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  border-color: var(--line);
  border-radius: 5px;
}
.story-panel {
  background: var(--panel);
  border-color: var(--line);
  padding: 25px;
}
.story-panel h3 {
  font-size: 25px;
  font-weight: 500;
  line-height: 1.22;
}
.story-panel .eyebrow {
  color: var(--aqua);
  font-size: 12px;
}
.story-panel p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.story-panel .expert-note {
  color: var(--white);
  border-color: var(--aqua);
  font-size: 12px;
}
.story-panel button {
  color: var(--aqua);
}
.story-panel .hint {
  font-size: 11px;
  line-height: 1.6;
}
.repair-insets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid #314a59;
}
.repair-insets > div + div {
  border-left: 1px solid #314a59;
}
.repair-insets .vector-scene {
  min-height: 0;
}
#repair-multiview[data-view="profile"] .repair-insets {
  display: none;
}
#repair-multiview[data-view="plan"] > #repair-visual,
#repair-multiview[data-view="detail"] > #repair-visual {
  display: none;
}
#repair-multiview[data-view="plan"] .repair-insets,
#repair-multiview[data-view="detail"] .repair-insets {
  display: block;
}
#repair-multiview[data-view="plan"] #repair-detail,
#repair-multiview[data-view="detail"] #repair-plan {
  display: none;
}
.technical-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: #b3c6d0;
  font-size: 10px;
  padding: 13px 20px;
  border-top: 1px solid #314a59;
  background: #10202b;
}
.technical-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.technical-legend i {
  display: inline-block;
  width: 19px;
  height: 2px;
}
.technical-legend .existing {
  background: #6cdae1;
}
.technical-legend .spare {
  background: #ecb374;
}
.technical-legend .rigging {
  height: 0;
  border-top: 2px dashed #cfbddb;
}
.playback {
  background: #11232f;
  padding: 15px 18px;
  border-color: #314a59;
}
.playback button {
  color: #cfdee3;
  background: #19313e;
  border-color: #395564;
}
.playback #repair-play {
  color: #f0ca93;
}
.playback #repair-play[aria-pressed="true"] {
  background: #e7ba89;
  color: #10202b;
  border-color: #e7ba89;
}
.playback button:hover {
  background: #2a4554;
}
.evidence-line {
  font-size: 11px;
  color: var(--muted);
  margin-top: 13px;
}
.story-steps {
  gap: 6px;
  margin-top: 18px;
}
.story-steps button {
  border-color: var(--line);
  font-size: 11px;
  min-height: 92px;
  color: var(--muted);
}
.story-steps button[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--aqua);
  color: var(--white);
}
.story-steps button[aria-pressed="true"] span {
  color: var(--aqua);
}
.story-steps span {
  color: var(--muted);
}
.method-note {
  color: var(--muted);
}
.sources-grid a,
.architecture-grid strong {
  color: var(--white);
}
.sources-grid .eyebrow {
  color: var(--aqua);
}
.sources-grid a:hover {
  color: var(--aqua);
}
.evidence-banner {
  background: var(--panel);
  border-color: var(--aqua);
}
#case-feedback {
  color: var(--aqua);
}
/* Scene colours retain their optical/material meaning across both editorial styles. */
.visual {
  color: #f2f6f6;
}
.visual .scene-head,
.visual .chain-head,
.visual .hint {
  color: #b9c8cf;
}
.visual .scene-tools button,
.visual .parts button,
.visual .view-options button {
  background: #1b272e;
  color: #cedade;
  border-color: #44555e;
}
.visual .scene-tools button[aria-pressed="true"] {
  background: var(--aqua);
  color: var(--on-accent);
}
.visual .parts button[aria-pressed="true"] {
  background: #523622;
  color: #f0ca93;
}
.visual .scene-caption {
  border-color: var(--aqua);
}
.visual .pin[aria-pressed="true"] {
  background: var(--aqua);
  border-color: var(--aqua);
  color: var(--on-accent);
}
.visual .view-options button[aria-pressed="true"] {
  background: #3a4a52;
  color: #fff;
}
.visual .pin {
  color: #fff;
}
.visual #chain text {
  fill: #bbcbd3;
}
.steps button[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--aqua);
  color: var(--white);
}
.steps span {
  color: var(--aqua);
}
.meter-layout svg,
#chart {
  background: #10202b;
  border-radius: 4px;
}
.chart-card .legend span {
  color: var(--muted);
}
.chart-card .legend span:first-child {
  color: var(--aqua);
}
@media (min-width: 1550px) {
  .repair-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  .story-panel {
    padding: 30px;
  }
}
@media (max-width: 1100px) {
  .repair-layout {
    grid-template-columns: 1fr 250px;
  }
  .story-panel {
    padding: 20px 16px;
  }
  .story-panel h3 {
    font-size: 22px;
  }
  .construction-reference {
    gap: 12px;
  }
  .cable-layout {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 22px;
  }
}
@media (max-width: 850px) {
  .repair-layout {
    grid-template-columns: 1fr;
  }
  .story-panel {
    padding: 23px;
  }
  .story-panel h3 {
    font-size: 24px;
  }
  .story-panel .expert-note {
    margin-top: 15px;
  }
  .story-steps {
    grid-template-columns: repeat(4, 1fr);
  }
  .cable-layout {
    grid-template-columns: 1fr;
  }
  .cable-layout > div:first-child {
    max-width: 620px;
    width: 100%;
    margin: auto;
  }
  .cable-layout svg {
    max-height: 400px;
  }
  .cable-layout > div:nth-child(2) {
    padding: 6px 0;
  }
  .construction-reference {
    align-items: flex-start;
  }
  .construction-reference a {
    white-space: normal;
    min-width: 70px;
  }
  .long-layer-info {
    display: block;
  }
  .long-layer-info span {
    display: block;
    margin-top: 8px;
  }
}
@media (max-width: 600px) {
  header {
    padding: 18px 16px;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 19px;
  }
  main {
    padding: 25px 16px 0;
  }
  h1 {
    font-size: 32px;
    line-height: 1.13;
  }
  .intro {
    gap: 12px;
  }
  .intro .quiet {
    font-size: 0;
    min-width: 32px;
  }
  .intro .quiet:first-letter {
    font-size: 17px;
  }
  .section-heading h2 {
    font-size: 25px;
  }
  .section-heading > p {
    font-size: 12px;
  }
  .construction-reference {
    flex-wrap: wrap;
    padding: 14px 0;
  }
  .construction-reference .reference-index {
    width: 100%;
    font-size: 9px;
  }
  .construction-reference p {
    flex: 1;
    min-width: 190px;
    font-size: 11px;
  }
  .construction-reference a {
    font-size: 10px;
    min-width: 0;
  }
  .section-tabs {
    gap: 4px;
    margin-top: 15px;
  }
  .section-tabs button {
    font-size: 11px;
    padding: 10px 9px;
  }
  .repair-insets {
    grid-template-columns: 1fr;
  }
  .repair-insets > div + div {
    border-left: 0;
    border-top: 1px solid #314a59;
  }
  .technical-legend {
    padding: 12px;
    gap: 12px;
    font-size: 9px;
  }
  .projection-controls {
    gap: 4px;
  }
  .projection-controls > span {
    display: none;
  }
  .projection-controls button {
    flex: 1;
    padding: 9px 6px;
    font-size: 10px;
  }
  .playback {
    padding: 13px;
    gap: 6px;
  }
  .playback button {
    padding: 8px;
    font-size: 10px;
  }
  .story-panel {
    padding: 20px;
  }
  .story-steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow: visible;
  }
  .story-steps button {
    min-height: 72px;
    font-size: 11px;
  }
  .story-steps span {
    margin-bottom: 4px;
  }
  .layer-buttons button {
    flex: 1 1 44%;
    font-size: 11px;
  }
  .stage-controls label {
    white-space: normal;
  }
  .stage-controls {
    gap: 10px;
    padding: 12px;
  }
  .stage-controls input {
    flex: 1 0 100%;
  }
  .stage-controls select {
    max-width: 100px;
  }
  .long-layer-info {
    padding: 15px;
  }
  .evidence-line {
    font-size: 10px;
    line-height: 1.6;
  }
}
.long-layer-info {
  flex-wrap: wrap;
  gap: 12px 22px;
}
.long-layer-info label {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  width: 100%;
  border-bottom: 1px solid var(--line);
  padding-bottom: 13px;
}
.long-layer-info select {
  font: inherit;
  font-size: 12px;
  color: var(--white);
  background: var(--control);
  border: 1px solid var(--line);
  padding: 8px;
  max-width: 100%;
}
.diagram-toolbar {
  display: none;
  background: #10202b;
  color: #9db6c5;
  padding: 10px 12px;
  border-bottom: 1px solid #314a59;
  font-size: 10px;
}
.diagram-toolbar button {
  background: #19313e;
  color: #d4e4e9;
  border-color: #395564;
  font-size: 11px;
  padding: 7px 10px;
}
.diagram-toolbar span {
  display: none;
}
.diagram-toolbar:has([aria-pressed="true"]) span {
  display: block;
  line-height: 1.5;
  margin-top: 7px;
}
@media (max-width: 850px) {
  .diagram-toolbar {
    display: block;
  }
  .vector-scene.zoomed,
  .zoomed .vector-scene {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .vector-scene.zoomed svg {
    min-width: 950px;
  }
  .zoomed #repair-visual svg {
    min-width: 800px;
  }
  .zoomed #repair-plan svg,
  .zoomed #repair-detail svg {
    min-width: 600px;
  }
}
@media (max-width: 600px) {
  .long-layer-info label {
    display: block;
  }
  .long-layer-info select {
    display: block;
    margin-top: 8px;
    width: 100%;
  }
  .long-layer-info strong {
    display: block;
  }
}
/* V3: scene-first workspace and evidence close to the drawing. */
.lab-toolbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0 22px;
}
.lab-toolbar button {
  font-size: 12px;
  padding: 9px 14px;
}
#notes-toggle {
  display: none;
}
#asset-status {
  padding: 15px;
  border: 1px solid #b15c42;
  color: var(--white);
}
.cable-3d-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 29%;
  background: #0c1822;
}
.cable-3d-layout > svg {
  width: 100%;
  align-self: center;
  border-left: 1px solid #314a59;
}
#cable-3d-scene {
  height: 510px;
  position: relative;
  min-width: 0;
  overflow: hidden;
}
#cable-3d-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.scene-stamp,
.scene-orbit {
  position: absolute;
  pointer-events: none;
  color: #9db6c5;
  font:
    10px Plex,
    monospace;
  letter-spacing: 0.07em;
  left: 24px;
}
.scene-stamp {
  top: 22px;
}
.scene-orbit {
  bottom: 20px;
}
#cable-3d-fallback {
  position: absolute;
  z-index: 2;
  inset: 50px 25px auto;
  background: #152d3c;
  color: #e8f2f4;
  padding: 20px;
}
.cable-3d-controls {
  flex-wrap: wrap;
}
.cable-3d-controls label {
  display: block;
  font-size: 11px;
  flex: 1;
  min-width: 130px;
}
.cable-3d-controls label:first-child {
  min-width: 70px;
  flex: 0;
}
.cable-3d-controls input {
  display: block;
  width: 100%;
  margin-top: 10px;
}
.cable-3d-controls output {
  float: right;
  color: #edbe96;
}
.cable-3d-controls select {
  margin: 0 0 0 10px;
}
.cable-3d-controls button {
  font-size: 11px;
}
.cable-3d-note {
  color: #9db6c5;
  font-size: 11px;
  padding: 0 20px 15px;
  margin: 0;
  background: #10202b;
}
.review-drawer {
  position: fixed;
  z-index: 60;
  inset: 0 0 0 auto;
  width: min(470px, 100%);
  height: 100dvh;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--panel);
  color: var(--white);
  padding: 26px;
  box-shadow: -20px 0 70px #0003;
}
body:has(> atomsh-shell) .review-drawer {
  top:48px; height:calc(100dvh - 48px);
}
.review-heading {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 15px;
}
.review-heading h2 {
  font-size: 24px;
}
.review-heading button {
  margin-left: auto;
  font-size: 24px;
  line-height: 1;
  padding: 8px 12px;
}
.review-drawer article {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.review-drawer h3 {
  font-size: 17px;
  margin: 9px 0;
}
.review-drawer p {
  font-size: 13px;
  line-height: 1.7;
  margin: 8px 0;
}
.review-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--aqua);
}
.review-drawer .review-limit {
  color: var(--muted);
}
.review-drawer a,
.review-drawer small {
  font-size: 11px;
  line-height: 1.7;
}
.review-drawer label {
  font-size: 12px;
  display: block;
  margin-top: 24px;
}
.review-drawer textarea,
.review-drawer input {
  background: var(--control);
  color: var(--white);
  border: 1px solid var(--line);
  font:
    13px Plex,
    sans-serif;
  padding: 12px;
  width: 100%;
  margin: 8px 0;
  resize: vertical;
}
.review-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.review-actions button {
  font-size: 12px;
}
.geometry-ledger {
  font-variant-numeric: tabular-nums;
  padding: 15px;
  background: var(--control);
  border: 1px solid var(--line);
}
.geometry-check {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  font-size: 12px;
}
.geometry-check summary {
  cursor: pointer;
  color: var(--muted);
}
#review-status {
  min-height: 20px;
  color: var(--aqua);
}
body.atelier {
  height: 100dvh;
  overflow: hidden;
}
.atelier > header,
.atelier .intro,
.atelier .level-brief,
.atelier main > footer,
.atelier body > footer {
  display: none;
}
.atelier main {
  max-width: none;
  height: 100dvh;
  margin: 0;
  padding: 12px 20px;
  overflow: auto;
}
.atelier .workspace-bar {
  position: sticky;
  top: 0;
  z-index: 15;
  background: var(--bg);
  margin: 0;
  padding: 0 0 8px;
}
.atelier .lab-toolbar {
  margin: 5px 0 12px;
  z-index: 14;
  background: var(--bg);
  padding: 5px 0;
}
.atelier #notes-toggle {
  display: inline-block;
}
.atelier .workshop {
  padding: 0;
  margin: 0;
}
.atelier .section-heading,
.atelier .construction-reference,
.atelier .cable-references,
.atelier .cable-3d-note {
  display: none;
}
.atelier .section-tabs {
  margin: 0 0 10px;
}
.atelier .repair-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.atelier .story-panel {
  display: none;
}
.atelier.atelier-notes .story-panel {
  display: block;
}
.atelier.atelier-notes .repair-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
}
.atelier #repair-multiview {
  height: calc(100dvh - 330px);
  min-height: 260px;
  display: flex;
  flex-direction: column;
}
.atelier #repair-visual {
  flex: 1;
  min-height: 0;
}
.atelier #repair-visual svg {
  height: 100%;
  width: 100%;
  object-fit: contain;
}
.atelier .repair-insets {
  height: 28%;
  min-height: 0;
}
.atelier .repair-insets svg {
  height: 100%;
  width: 100%;
}
.atelier #repair-multiview[data-view="profile"] .repair-insets {
  display: none;
}
.atelier #repair-multiview[data-view="plan"] #repair-visual,
.atelier #repair-multiview[data-view="detail"] #repair-visual {
  display: none;
}
.atelier #repair-multiview[data-view="plan"] .repair-insets,
.atelier #repair-multiview[data-view="detail"] .repair-insets {
  height: 100%;
}
.atelier .technical-legend {
  padding: 8px 16px;
}
.atelier .playback {
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.atelier #cable-3d-scene {
  height: calc(100dvh - 310px);
  min-height: 300px;
}
.atelier .long-layer-info {
  padding: 10px 14px;
  margin-top: 0;
  font-size: 12px;
}
.atelier .long-layer-info label {
  padding-bottom: 8px;
}
.atelier .long-layer-info > span {
  display: none;
}
.atelier .diagram-toolbar {
  display: none;
}
.atelier .lab {
  margin-top: 0;
}
.atelier #scene {
  height: calc(100dvh - 330px);
  min-height: 300px;
}
@media (max-width: 850px) {
  .cable-3d-layout {
    grid-template-columns: minmax(0, 1fr) 30%;
  }
  #cable-3d-scene {
    height: 380px;
  }
  .cable-3d-controls {
    gap: 14px;
  }
  .atelier.atelier-notes .repair-layout {
    grid-template-columns: 1fr;
  }
  .atelier.atelier-notes .story-panel {
    position: fixed;
    z-index: 30;
    right: 0;
    top: 100px;
    bottom: auto;
    max-height: calc(100dvh - 190px);
    width: min(350px, 90vw);
    overflow: auto;
    box-shadow: -10px 0 50px #0005;
  }



}
@media (max-width: 600px) {
  .lab-toolbar {
    gap: 5px;
    flex-wrap: wrap;
  }
  .lab-toolbar button {
    font-size: 11px;
    padding: 9px;
  }
  .lab-toolbar .theme-control {
    flex: 1 0 100%;
    justify-content: space-between;
    margin: 3px 0 0;
  }
  .lab-toolbar .theme-control select {
    flex: 1;
    max-width: 235px;
    min-height: 36px;
  }
  .cable-3d-layout {
    grid-template-columns: 1fr;
    position: relative;
  }
  .cable-3d-layout > svg {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 110px;
    border: 1px solid #314a59;
    pointer-events: none;
  }
  .scene-orbit {
    font-size: 9px;
    left: 15px;
    bottom: 12px;
    max-width: 50%;
  }
  .scene-stamp {
    left: 15px;
    top: 15px;
    font-size: 9px;
  }
  #cable-3d-scene {
    height: 370px;
  }
  .cable-3d-controls label {
    min-width: 110px;
  }
  .cable-3d-controls label:first-child {
    flex: 0 0 100%;
  }
  .review-drawer {
    padding: 20px;
  }
  .atelier main {
    padding: 8px;
  }
  .atelier .workspace-bar {
    padding-bottom: 4px;
  }
  .atelier #tabs {
    gap: 4px;
  }
  .atelier #tabs button {
    padding: 9px;
    font-size: 11px;
  }
  .atelier .lab-toolbar {
    gap: 4px;
  }
  .atelier .lab-toolbar button {
    padding: 7px;
    font-size: 10px;
  }
  .atelier .section-tabs button {
    font-size: 10px;
    padding: 8px;
  }
  .atelier .projection-controls {
    margin: 6px 0;
  }
  .atelier #repair-multiview {
    height: calc(100dvh - 290px);
    min-height: 240px;
  }
  .atelier .repair-insets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 25%;
  }
  .atelier .technical-legend {
    font-size: 8px;
    gap: 8px;
    padding: 7px;
  }
  .atelier .playback {
    padding: 10px 6px;
  }
  .atelier #cable-3d-scene {
    height: calc(100dvh - 345px);
    min-height: 240px;
  }
  .atelier .cable-3d-controls {
    padding: 9px;
    gap: 8px;
  }
  .atelier .cable-3d-controls label:first-child {
    flex: 0;
    min-width: 70px;
  }
  .atelier .long-layer-info strong {
    font-size: 12px;
  }
}

@media (min-width: 1100px) {
  .cable-3d-controls label:first-child {
    min-width: 140px;
  }
  .cable-3d-controls label:first-child select {
    width: 75px;
  }
}
.atelier #repair-workshop > .method-note,
.atelier #field-cases {
  display: none;
}
.atelier #repair-multiview {
  height: calc(100dvh - 365px);
}



@media (max-width: 600px) {
  .atelier #repair-multiview {
    height: calc(100dvh - 320px);
  }
}
@media (min-width: 601px) {
  .atelier #repair-multiview {
    height: calc(100dvh - 400px);
  }
}
@media (max-width: 600px) {
  .atelier #repair-multiview {
    height: auto;
    min-height: 0;
  }
  .atelier #repair-visual {
    flex: none;
  }
  .atelier #repair-visual svg {
    height: auto;
  }
  .atelier .repair-insets {
    height: auto;
  }
  .atelier .repair-insets svg {
    height: auto;
  }
  .atelier .diagram-toolbar {
    display: block;
  }
  .atelier .diagram-toolbar span {
    display: none;
  }
}
@media (max-width: 600px) {
  .atelier #cable-3d-scene {
    height: min(48dvh, 400px);
  }
  .atelier .cable-3d-controls label:first-child {
    flex: 0 0 100%;
  }
  .atelier .cable-3d-controls label:first-child select {
    width: 80px;
  }
  .atelier .cable-3d-controls label:not(:first-child) {
    flex: 1 1 42%;
    min-width: 125px;
  }
  .atelier .cable-3d-controls input {
    width: 100%;
  }
}

/* V4: one active action, a legible detail, and quiet material surfaces. */
.repair-action {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 2fr);
  gap: 8px 24px;
  align-items: baseline;
  margin: 0 0 18px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.repair-action strong {
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
}
.repair-action span {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.atelier .repair-action {
  margin: 0 0 12px;
  padding: 10px 0;
}
#repair-detail {
  background: #0c1721;
}
@media (max-width: 600px) {
  .repair-action {
    grid-template-columns: 1fr;
    gap: 5px;
    margin-bottom: 10px;
  }
  .repair-action strong {
    font-size: 14px;
  }
  .repair-action span {
    font-size: 11px;
  }
  #repair-detail svg {
    min-width: 0;
  }
  .atelier #repair-multiview[data-view="detail"] {
    height: auto;
  }
  .cable-3d-layout > svg {
    width: 132px;
  }
}

@media (min-width: 1100px) {
  .atelier #repair-workshop > .section-tabs {
    display: inline-flex;
    vertical-align: middle;
    margin: 0 24px 8px 0;
  }
  .atelier #repair-workshop > .projection-controls {
    display: inline-flex;
    vertical-align: middle;
    margin: 0 0 8px;
  }
}

@media (min-width: 1100px) {
  .atelier #repair-multiview[data-mode="joint"] {
    height: calc(100dvh - 310px);
    min-height: 360px;
  }
}

@media (min-width: 601px) {
  .atelier #repair-multiview[data-view="detail"] .repair-insets > div,
  .atelier #repair-multiview[data-view="plan"] .repair-insets > div {
    height: 100%;
    min-height: 0;
  }
  .atelier #repair-multiview[data-view="detail"] .repair-insets svg,
  .atelier #repair-multiview[data-view="plan"] .repair-insets svg {
    height: 100%;
    width: 100%;
  }
}

/* Shared Marine bar (/subsea-optical-lab/shared/marine.css) replaces the former header layout. */
body > header.marine-bar {
  align-items: center;
  max-width: none;
  margin: 0;
  padding: 0 32px;
  justify-content: flex-start;
  gap: 20px;
  border-color: var(--mb-line);
}
@media (max-width: 760px) {
  body > header.marine-bar {
    padding: 8px 18px;
    gap: 2px 14px;
  }
}

/* Language controls remain available in Atelier; no second toolbar. */
.language-picker select{font:inherit;background:var(--panel);color:inherit;border:1px solid var(--line);border-radius:4px;padding:6px}
.language-picker .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.repeater-2d #scene{height:auto;min-height:0;overflow:visible}
.repeater-2d #scene>canvas,.repeater-2d .pins,.repeater-2d .scene-tools,.repeater-2d .view-options{display:none}
.repeater-2d #fallback{position:static;inset:auto;display:block;padding:14px;background:#0e161f;color:#e5edf2;text-align:left}
.repeater-2d #fallback p{font-size:12px;margin:0 0 12px}
.repeater-2d #fallback svg{display:block;width:100%;height:auto;min-width:600px}
.repeater-2d #fallback{overflow-x:auto}
#cable-3d-fallback{font-size:13px;padding:12px;border-left:2px solid var(--aqua)}

.repeater-2d .scene-caption{position:static;max-width:none;padding:14px 23px;text-shadow:none}

.language-picker select:focus-visible{outline:2px solid var(--aqua);outline-offset:4px}

/* Cable explorer: the scene is primary; secondary controls use one disclosure. */
#cable-3d-panel { position:relative; overflow:visible; background:#14191c; border:1px solid #364045; border-radius:6px; color:#e6e9e9; }
#cable-workshop[data-view="3d"] > .section-heading,
#cable-workshop[data-view="3d"] > .construction-reference { display:none; }
.explorer-toolbar { position:relative; display:flex; align-items:center; gap:24px; padding:10px 20px; background:#1b2125; border-bottom:1px solid #364045; border-radius:6px 6px 0 0; }
.explorer-toolbar label { display:flex; align-items:center; gap:12px; font-size:12px; color:#b8c1c5; }
.explorer-toolbar select { font:inherit; font-size:13px; min-height:42px; color:#f0f2f3; background:#1b2125; border:1px solid #505c62; border-radius:3px; padding:7px 10px; }
.explorer-settings { margin:0 0 0 auto; padding:0; border:0; }
.explorer-settings > summary { cursor:pointer; padding:12px 4px; color:#e6e9e9; font-size:13px; }
.explorer-settings-body { position:absolute; z-index:18; right:12px; top:calc(100% + 8px); width:min(360px,calc(100% - 24px)); max-height:65dvh; overflow:auto; padding:20px; background:#20272b; border:1px solid #526068; border-radius:5px; box-shadow:0 16px 40px #0005; }
.explorer-options { display:grid; gap:16px; }
.explorer-options label { justify-content:space-between; }
.explorer-options input { width:18px; height:18px; }
.explorer-tools { margin:18px 0 0; padding:14px 0 0; border-top:1px solid #455057; color:#bdc7cc; font-size:12px; }
.explorer-tools summary { cursor:pointer; min-height:28px; color:#e0e5e7; }
.explorer-tools p { margin:12px 0; line-height:1.6; color:inherit; }
.explorer-view-buttons { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
#cable-3d-panel button, .explorer-toolbar button { border:1px solid #566168; background:#242d32; color:#e9eeee; min-width:44px; min-height:44px; border-radius:3px; }
#cable-3d-panel button:hover, .explorer-toolbar button:hover { background:#354047; }
#cable-3d-panel :is(button,summary,select):focus-visible, .explorer-toolbar :is(button,summary,select):focus-visible { outline:2px solid #eab58e; outline-offset:3px; }
#cable-3d-panel .cable-3d-layout { display:block; position:relative; }
#cable-workshop #cable-3d-scene { height:clamp(340px,58dvh,700px); min-height:0; background:#14191c; border:0; }
#cable-3d-scene .scene-stamp { top:18px; left:20px; color:#9faeb5; font-size:10px; letter-spacing:.04em; }
#cable-3d-home { position:absolute; right:16px; bottom:16px; display:grid; place-items:center; }
.explorer-toolbar #cable-section { display:block; width:100%; height:auto; position:static; border:0; padding:0; background:transparent; }
#cable-3d-panel .cable-3d-controls { display:flex; flex-wrap:wrap; justify-content:center; gap:32px; padding:14px 24px; border-top:1px solid #364045; background:#1b2125; }
#cable-3d-panel .cable-3d-controls label { display:block; flex:1 1 140px; max-width:420px; margin:0; font-size:12px; color:#bdc7cc; }
#cable-3d-panel .cable-3d-controls label[hidden] { display:none; }
#cable-3d-panel .cable-3d-controls output { float:right; color:#e1e7e9; font-size:11px; }
#cable-3d-panel .cable-3d-controls input { display:block; width:100%; min-width:0; margin:8px 0 0; height:22px; accent-color:var(--cable-accent,#c49470); }
#cable-reference-position label { display:block; margin:12px 0; }
#cable-reference-position label[hidden] { display:none; }
#cable-reference-position output { float:right; }
#cable-reference-position input { display:block; width:100%; margin-top:8px; accent-color:var(--cable-accent,#c49470); }
#cable-3d-panel[data-lod="0"] .cable-3d-controls,
#cable-3d-panel[data-inspection="true"]:not([data-cut="transverse"]) .cable-3d-controls { display:none; }
#cable-3d-scene:focus-visible { outline:2px solid #eab58e; outline-offset:-3px; }
#cable-workshop #long-layer-info { display:flex; flex-wrap:wrap; align-items:center; gap:14px; padding:12px 18px; border:0; border-bottom:1px solid var(--line); background:transparent; margin:0; }
#cable-workshop #long-layer-info[hidden] { display:none; }
#long-layer-info > label { display:flex; flex:1 1 270px; align-items:center; gap:12px; padding:0; font-size:12px; }
#long-layer-info select { flex:1; min-width:0; max-width:330px; min-height:44px; font-size:13px; padding:6px 10px; }
#cable-layer-inspector { display:flex; gap:8px; padding:0; border:0; }
#cable-layer-inspector[hidden] { display:none; }
#cable-layer-inspector button { min-height:44px; padding:8px 12px; margin:0; font-size:12px; }
#cable-layer-inspector button[hidden] { display:none; }
.cable-component-details { flex:1 1 100%; padding:0; margin:0; border:0; font-size:12px; }
.cable-component-details > summary { cursor:pointer; color:var(--muted); padding:4px 0; }
.cable-component-details p { max-width:85ch; line-height:1.6; }
.cable-component-details strong { display:block; margin-top:16px; }
#long-layer-info[data-view="long"] :is(#cable-layer-characteristics,#cable-layer-expert) { display:none; }
@media(max-width:700px) {
  .explorer-toolbar { gap:12px; padding:8px 12px; }
  .explorer-toolbar > label { display:block; font-size:10px; }
  .explorer-toolbar > label select { display:block; width:100%; margin-top:4px; font-size:12px; padding:6px; }
  .explorer-settings > summary { font-size:12px; }
  #cable-workshop #cable-3d-scene { height:clamp(280px,44dvh,430px); }
  #cable-workshop #cable-3d-panel:not([data-cut="transverse"]) #cable-3d-scene[data-inspection="false"] { height:clamp(300px,45dvh,470px); }
  #cable-3d-panel .cable-3d-controls { gap:18px; padding:10px 14px; flex-wrap:nowrap; }
  #cable-workshop #long-layer-info { gap:10px; padding:12px 0; }
  #long-layer-info > label { flex:1 1 200px; gap:8px; }
  #long-layer-info select { width:100%; font-size:12px; }
  .cable-component-details > summary { padding:8px 0; }
}

/* One view selector replaces the duplicate cable-view bar. */
#cable-workshop > .explorer-toolbar { border:1px solid #364045; }
#cable-workshop[data-view="3d"] #cable-3d-panel { border-top:0; border-radius:0 0 6px 6px; }
.explorer-toolbar label[hidden], .explorer-settings[hidden], .explorer-tools[hidden] { display:none; }
.cable-types[hidden], #peel-controls label[hidden] { display:none; }
.cable-build-status { position:absolute; inset:0; display:grid; place-items:center; color:#b8c1c5; font-size:13px; pointer-events:none; }
.cable-build-status[hidden] { display:none; }
#cable-layer-inspector { flex-wrap:wrap; }
#cable-inspect[aria-pressed="true"] { background:var(--aqua); color:var(--on-accent); }
@media(max-width:400px) {
  .explorer-toolbar { gap:8px; }
  .explorer-toolbar > label select { max-width:165px; }
  .explorer-settings > summary { font-size:11px; }
  #long-layer-info > label { flex-basis:100%; }
}

/* Whole-lab editing pass: one primary control row, details on demand. */
.atelier .workspace-bar { position: sticky; top: 0; flex-wrap: wrap; }
.atelier:has(> atomsh-shell) main { height: calc(100dvh - 48px); }
.workspace-bar select:focus-visible, .repair-navigation select:focus-visible {
  outline: 2px solid var(--aqua); outline-offset: 3px;
}
.visual .scene-tools { padding: 12px 18px; }
.visual .scene-tools .seg { flex-wrap: wrap; }
.repeater-settings, .repeater-link {
  margin: 0; padding: 0 18px; border-top: 1px solid #394047;
}
.repeater-settings > summary, .repeater-link > summary {
  padding: 12px 0; color: #c5d4dc; min-height: 44px;
}
.repeater-settings .scene-tools, .repeater-settings .parts, .repeater-settings .view-options {
  padding: 0 0 12px; flex-wrap: wrap;
}
.repeater-settings button, .repeater-settings .parts button { min-height: 40px; }
.repeater-settings .parts { gap: 6px; }
.repeater-link .chain-head { padding: 6px 0; border: 0; }
.repeater-link .hint { padding: 0 0 16px; }
.journey { display: block; padding: 18px 0; }
.journey > summary { min-height: 28px; }
.journey-content { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; padding-top: 18px; }
.journey-content .eyebrow { display: none; }
.repair-navigation { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 0 0 12px; }
.repair-navigation label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; min-width: 0; }
.repair-navigation label:last-child { flex: 1; max-width: 460px; }
.repair-navigation select { min-width: 0; width: 100%; min-height: 42px; padding: 8px 32px 8px 12px; color: var(--white); background: var(--panel); border: 1px solid var(--line); font: inherit; font-size: 13px; border-radius: 3px; }
.workshop-status { font-size: 12px; color: var(--muted); margin: 0 0 16px; }
.workshop-notes { margin: 22px 0; padding-top: 16px; }
.workshop-notes > p { margin-top: 12px; max-width: 900px; }
.meter-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; padding: 28px; }
.meter-visual { grid-column: 1; grid-row: 1; align-self: center; min-width: 0; }
.meter-controls { grid-column: 2; grid-row: 1; }
.meter-controls .control:first-child { padding-top: 0; }
.meter-controls #apply-joint { margin-top: 20px; font-size: 12px; }
#bidir-chart { display: block; background: #121c24; border-radius: 3px; }
.bidir-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 14px 5.77% 0 8.85%; }
.bidir-results > div { border-top: 2px solid #65e2d4; padding-top: 8px; }
.bidir-results > div:nth-child(2) { border-color: #e6b474; }
.bidir-results > div:nth-child(3) { border-color: #8bbcff; }
.bidir-results strong { font-variant-numeric: tabular-nums; font-size: clamp(17px, 2vw, 24px); margin: 4px 0; }
#manufacturer-workshop .table-wrap { border: 1px solid var(--line); border-radius: 3px; }
#manufacturer-workshop td { font-family: var(--font-mono, monospace); font-size: 13px; }
#manufacturer-workshop tbody tr:last-child > * { border-bottom: 0; }
#manufacturer-workshop tbody tr:hover { background: var(--panel); }
.sources-grid { grid-template-columns: 1fr; gap: 0; }
.sources-grid .source-entry { margin: 0; padding: 0; border-top: 0; border-bottom: 1px solid var(--line); }
.source-entry > summary { display: grid; grid-template-columns: 240px minmax(0, 1fr) 20px; gap: 20px; align-items: baseline; list-style: none; padding: 18px 0; color: var(--white); font-size: 15px; }
.source-entry > summary::-webkit-details-marker { display: none; }
.source-entry > summary::after { content: "+"; text-align: right; color: var(--aqua); }
.source-entry[open] > summary::after { content: "−"; }
.source-entry .eyebrow { margin: 0; letter-spacing: .7px; }
.source-entry > p, .source-entry > a { display: block; margin: 0 40px 16px 260px; font-size: 13px; max-width: 760px; }
.sources-grid .source-entry > a { text-decoration: underline; text-underline-offset: 3px; color: var(--aqua); }
.evidence-banner { display: block; margin: 0 0 12px; padding: 16px 20px; border-top: 0; }
.evidence-banner > summary { color: var(--white); font-size: 15px; }
.evidence-banner > p { margin-top: 12px; }
@media (max-width: 850px) {
  .meter-layout { grid-template-columns: 1fr; padding: 20px; gap: 24px; }
  .meter-visual, .meter-controls { grid-column: 1; grid-row: auto; }
  .meter-visual { order: -1; }
  .journey-content { grid-template-columns: 1fr; }
  .source-entry > summary { grid-template-columns: minmax(0, 1fr) 20px; gap: 6px 16px; }
  .source-entry .eyebrow { grid-column: 1; }
  .source-entry > summary > span:last-child { grid-row: 2; }
  .source-entry > summary::after { grid-row: 1 / 3; grid-column: 2; }
  .source-entry > p, .source-entry > a { margin-left: 0; margin-right: 28px; }
}
@media (max-width: 650px) {
  .atelier #tabs { flex: 1 0 100%; width: 100%; }
  .atelier #tabs button { min-height: 44px; }
  .atelier #scene { height:clamp(360px,48dvh,460px); min-height:280px; }
  .repair-navigation { gap: 8px; }
  .repair-navigation label:first-child, .repair-navigation label:nth-child(2) { flex: 1; max-width: 130px; }
  .repair-navigation label:last-child { max-width: none; }
  .bidir-results { gap: 8px; }
  .meter-layout { padding: 16px; }
  .visual .scene-head { line-height: 1.6; }
}

body:has([data-tab="repeater"][aria-pressed="false"]) #training { display: none; }
.visual #live-state { color: #e9bd93; }

@media (max-width: 650px) {
  #manufacturer-workshop table { table-layout: fixed; }
  #manufacturer-workshop th { white-space: normal; font-size: 11px; line-height: 1.4; }
  #manufacturer-workshop td { font-size: 11px; }
  #manufacturer-workshop th, #manufacturer-workshop td { padding: 12px 7px; }
}


.atelier .repair-action > strong { display: none; }

/* Shared preferences free the workspace for the model, in every workshop. */
.workspace-bar #tabs { margin-left: 0; flex: 1; align-items: center; }
.lab-signature { flex-shrink: 0; margin-left: auto; padding: 0 4px 0 20px; color: var(--muted); font: 11px/1.5 var(--font-mono, monospace); letter-spacing: .02em; white-space: nowrap; }
.workspace-bar:has(#lab-preferences[open]) { z-index: 30; }
#lab-preferences { position:relative; flex:none; padding:0; margin:0 0 0 auto; border:0; }
#lab-preferences > summary { display:flex; align-items:center; justify-content:center; gap:8px; list-style:none; padding:10px; min-height:44px; min-width:44px; font-size:12px; color:var(--white); cursor:pointer; }
#lab-preferences > summary::-webkit-details-marker { display:none; }
#lab-preferences[open] > summary { background:var(--control); }
#lab-preferences-body > button { min-height:44px; text-align:left; margin:0; font-size:12px; }
#lab-preferences-body .lab-signature { margin:0; padding:10px 0 0; border-top:1px solid var(--line); }
.workspace-bar #tabs { order:0; width:auto; min-width:0; flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; border:0; padding:0; }
.workspace-bar #tabs::-webkit-scrollbar { display:none; }
.workspace-bar, .atelier .workspace-bar { gap:8px; flex-wrap:nowrap; }
#lab-preferences-body { position: absolute; right: 0; top: 100%; width: min(360px, calc(100vw - 32px)); max-height: 65dvh; overflow: auto; display: grid; gap: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--white); box-shadow: 0 14px 36px #0003; }
#lab-preferences-body > label, #lab-preferences-body .marine-bar__select { width: 100%; margin: 0; display: grid; gap: 7px; font-size: 12px; color: var(--muted); }
#lab-preferences-body .language-picker .sr-only, #lab-preferences-body .marine-bar__select > span:first-child { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
#lab-preferences-body select { display: block; width: 100%; max-width: none; min-height: 44px; font-size: 13px; background: var(--control); color: var(--white); border: 1px solid var(--line); padding: 8px; }
#lab-preferences-body #training { margin: 0; min-height: 44px; }
#lab-preferences :is(summary, select):focus-visible { outline: 2px solid var(--aqua); outline-offset: 3px; }
.visual > .scene-tools { background: #1b2125; border-bottom: 1px solid #394047; }
.atelier main { scroll-padding-top: 64px; }
.visual #scene { background: radial-gradient(ellipse at 50% 40%, #242d32, #14191c 75%); }
.visual #scene > canvas:focus-visible { outline: 2px solid #eab58e; outline-offset: -3px; }
.repeater-component { margin: 0; padding: 0 18px; border-top: 1px solid #394047; }
.repeater-component > summary { padding: 12px 0; min-height: 44px; color: #edf1f2; cursor: pointer; }
.repeater-component > p { max-width: 85ch; padding: 0 0 16px; margin: 0; font-size: 13px; line-height: 1.65; color: #bdc7cc; }
.visual #repeater-inspect { margin-left: auto; }
.visual #repeater-inspect:disabled { opacity: .4; }
.visual #repeater-inspect[aria-pressed="true"] { background: var(--cable-accent, #e8b48c); color: #15191c; border-color: var(--cable-accent, #e8b48c); }
.visual .scene-tools > button, .visual .scene-tools .seg button { min-height: 44px; }
@media (max-width: 850px) {
  #repair-multiview.zoomed, .atelier #repair-multiview.zoomed { display: block; height: auto; min-height: 0; max-height: none; overflow: visible; }
  #repair-multiview.zoomed .vector-scene { max-height: 65dvh; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y; }
  #repair-multiview.zoomed .vector-scene:focus-visible { outline: 2px solid #eab58e; outline-offset: -3px; }
  #repair-multiview.zoomed #repair-visual svg { width: 1000px; min-width: 1000px; height: auto; max-height: none; }
  #repair-multiview.zoomed .repair-insets { height: auto; }
  #repair-multiview.zoomed .repair-insets svg { width: 760px; min-width: 760px; height: auto; max-height: none; }
  .atelier .diagram-toolbar:has([aria-pressed="true"]) span { display: block; }
}
@media (max-width: 650px) {
  .atelier .workspace-bar { padding: 8px 0; gap: 0; }
  #lab-preferences > summary > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .atelier .lab-toolbar > button { font-size: 11px; padding: 8px; }
  .visual .scene-tools { padding: 10px 12px; gap: 6px; }
  .visual .scene-tools button { font-size: 11px; padding: 8px; }
  .visual .scene-tools .seg { flex:1; min-width:0; margin:0; }
  .visual .scene-tools .seg button { flex: 1; }
  .visual #repeater-inspect { order:2; margin-left:0; flex:1 0 100%; }
  .visual #home { order:1; min-width:44px; }
  .visual .scene-head { font-size: 9px; }
  .repeater-settings, .repeater-link, .repeater-component { padding-left: 12px; padding-right: 12px; }
}

/* Workshop: one scene, one timeline; secondary camera controls stay folded. */
body:has(> atomsh-shell) { --workshop-header:48px; }
#repair-multiview[data-view="overview"] .repair-insets { display:none; }
#repair-multiview[data-view="overview"],.atelier #repair-multiview[data-view="overview"] { display:block; height:auto; }
#repair-workshop .technical-stage:after { display:none; }
#repair-workshop .technical-stage { border-radius:4px; }
.repair-navigation { align-items:end; gap:8px; flex-wrap:nowrap; }
.repair-navigation label { flex:1; max-width:none!important; }
.repair-navigation #joint-type-controls { flex:0 0 80px; }
.repair-navigation #joint-function-controls { flex:0 0 160px; }
.repair-navigation select { min-height:44px; }
.repair-timeline { padding:8px 12px 3px; border-top:1px solid #34434a; color:#dbe3e3; background:#172229; }
.repair-timeline-heading { display:flex; gap:8px; align-items:center; }
.repair-timeline-heading label { display:flex; align-items:center; gap:8px; flex:1; min-width:0; color:#b4c2c7; font-size:10px; }
.repair-timeline-heading select { width:100%; min-width:0; min-height:44px; font:12px var(--font-sans,sans-serif); padding:8px; color:#e2e8e9; background:#202c33; border:1px solid #41515b; border-radius:3px; }
.repair-timeline button { min-height:44px; font-size:12px; color:#e2e8e9; }
.repair-timeline #repair-play { min-width:58px; }
.repair-track { display:flex; align-items:center; gap:8px; }
.repair-track input { flex:1; min-width:0; margin:0; }
.repair-track button { width:44px; min-height:44px; padding:4px; border:0; background:transparent; color:#dbe3e3; }
#workshop-3d-panel { position:relative; background:#141b20; color:#e3e9e8; }
#workshop-3d-scene { position:relative; height:clamp(360px,60dvh,680px); min-width:0; overflow:hidden; }
#workshop-3d-scene canvas { display:block; width:100%; height:100%; touch-action:none; }
#workshop-3d-scene canvas:focus-visible { outline:2px solid #e3ac79; outline-offset:-3px; }
.workshop-camera { display:flex; align-items:center; gap:6px; position:absolute; right:12px; bottom:12px; z-index:2; }
.workshop-camera button,.workshop-camera summary { min-height:44px; min-width:44px; padding:10px 12px; background:#1b2428ed; border:1px solid #43525b; color:#e0e8e8; font:11px var(--font-sans,sans-serif); border-radius:3px; cursor:pointer; }
.workshop-camera summary { display:flex; align-items:center; list-style:none; }
.workshop-camera summary::-webkit-details-marker { display:none; }
.workshop-camera-menu > div { position:absolute; right:0; bottom:52px; display:grid; grid-template-columns:1fr 1fr; gap:5px; padding:6px; background:#172126; border:1px solid #43525b; border-radius:4px; }
.workshop-camera :focus-visible { outline:2px solid #e3ac79; outline-offset:2px; }
.workshop-selection { margin:0; padding:8px 16px; border-top:1px solid #35434a; font-size:12px; color:#c3d0d5; }
#workshop-3d-panel .scene-stamp { pointer-events:none; }
#workshop-3d-fallback { margin:0 0 10px; }
.workshop-labels { position:absolute; inset:0; pointer-events:none; }
.workshop-labels span { position:absolute; transform:translate(-50%,-100%); font:11px var(--font-mono,monospace); color:#e4eceb; border-left:1px solid #8aa1aa; padding:4px 7px; background:#182126db; }
.workshop-labels [data-tone="fault"] { color:#f1b6a9; border-color:#d78a79; }
.workshop-labels span::after { content:""; position:absolute; left:50%; top:100%; width:var(--leader-length,0); height:1px; background:#8aa1aa99; transform-origin:left center; transform:rotate(var(--leader-angle,0rad)); }
.repair-track input[type="range"] { appearance:none; height:30px; padding:0; background:transparent; accent-color:#e3ac79; }
.repair-track input[type="range"]::-webkit-slider-runnable-track { height:3px; border-radius:2px; background:#50616b; }
.repair-track input[type="range"]::-webkit-slider-thumb { appearance:none; width:16px; height:16px; margin-top:-6.5px; border:2px solid #172229; border-radius:50%; background:#e3ac79; }
.repair-track input[type="range"]::-moz-range-track { height:3px; border:0; border-radius:2px; background:#50616b; }
.repair-track input[type="range"]::-moz-range-progress { height:3px; background:#e3ac79; }
.repair-track input[type="range"]::-moz-range-thumb { width:12px; height:12px; border:2px solid #172229; border-radius:50%; background:#e3ac79; }
.atelier:not(.atelier-notes) #repair-action span { display:none; }
.atelier #repair-action strong { display:block; font-size:12px; font-weight:500; }
#joint-type { padding-inline:8px; }
@media(min-width:900px) {
  .atelier #repair-workshop { display:grid; grid-template-columns:auto 1fr; column-gap:16px; }
  .atelier #repair-workshop[hidden] { display:none; }
  .atelier #repair-workshop > * { grid-column:1/-1; }
  .atelier #repair-workshop > .section-tabs { grid-column:1; grid-row:1; align-self:end; margin-bottom:10px; }
  .atelier #repair-workshop > .repair-navigation { grid-column:2; grid-row:1; margin:0 0 10px; }
  .atelier #workshop-3d-scene { height:clamp(360px,calc(100dvh - 265px - var(--workshop-header,0px)),700px); }
  .atelier #repair-multiview:not(.zoomed) #repair-visual svg,
  .atelier #repair-multiview:not(.zoomed) #repair-plan svg,
  .atelier #repair-multiview:not(.zoomed) #repair-detail svg { width:100%; height:clamp(330px,calc(100dvh - 390px),600px); min-height:0; }
}
@media(max-width:650px) {
  .repair-navigation { gap:6px; margin-bottom:8px; }
  .repair-navigation #joint-type-controls { flex:0 0 60px; }
  .repair-navigation #joint-function-controls { flex:0 0 104px; }
  .repair-navigation select { padding:8px 4px; font-size:12px; }
  .repair-timeline { padding:6px 8px 1px; }
  .repair-timeline-heading { gap:6px; }
  .repair-timeline-heading label { gap:0; font-size:0; }
  .repair-timeline-heading button { font-size:11px; padding:8px; }
  #workshop-3d-scene { height:clamp(300px,calc(100dvh - 285px - var(--workshop-header,0px)),620px); }
  .workshop-selection { padding:8px 12px; font-size:11px; }
  #repair-multiview:not(.zoomed) #repair-visual svg { min-height:300px; object-fit:contain; }
}

.workshop-camera-menu { padding:0; margin:0; border:0; }
.repair-timeline #repair-play { color:#e9f0f1; background:#27343b; border:1px solid #45555e; }
.repair-timeline #repair-play[aria-pressed="true"] { background:#9c5e35; color:#fff; }
@media(max-width:360px) {
  #workshop-3d-scene { height:clamp(300px,calc(100dvh - 285px - var(--workshop-header,0px)),620px); }
}

/* The vessel has one compact navigation row. Joint functions retain their own row. */
@media(max-width:899px) {
  .atelier #repair-workshop:has([data-repair-mode="ship"][aria-pressed="true"]) { display:grid; grid-template-columns:auto minmax(0,1fr); column-gap:12px; }
  .atelier #repair-workshop[hidden] { display:none!important; }
  .atelier #repair-workshop > * { grid-column:1/-1; }
  .atelier #repair-workshop:has([data-repair-mode="ship"][aria-pressed="true"]) > .section-tabs { grid-column:1; grid-row:1; align-self:end; margin:0 0 8px; }
  .atelier #repair-workshop:has([data-repair-mode="ship"][aria-pressed="true"]) > .repair-navigation { grid-column:2; grid-row:1; }
  .atelier #repair-workshop > .section-tabs button { padding:8px 10px; min-height:44px; font-size:12px; }
}

@media(max-width:899px) {
  .atelier #repair-workshop:has([data-repair-mode="joint"][aria-pressed="true"]) #workshop-3d-scene { height:clamp(300px,calc(100dvh - 320px - var(--workshop-header,0px)),620px); }
}
