/* The learning dialog owns only its layout; the original scene stays intact. */
.safety-lab {
  --lab-yellow: #f4c742;
  --lab-bg: #131718;
  --lab-panel: #1b2021;
  --lab-line: #353d3d;
  --lab-muted: #a4aeac;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--lab-bg);
  color: #f3f3f1;
  font-family: Manrope, "Segoe UI", sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color-scheme: dark;
}
.safety-lab:not([open]) { display: none; }
.safety-lab[open] { display: flex; flex-direction: column; }
.safety-lab::backdrop { background: #0b0e0ff5; }
.safety-lab *, .safety-lab *::before, .safety-lab *::after { box-sizing: border-box; }
.safety-lab [hidden] { display: none !important; }
.safety-lab button { font: inherit; cursor: pointer; }
.safety-lab button:focus-visible, .safety-lab summary:focus-visible { outline: 2px solid var(--lab-yellow); outline-offset: 5px; }
.safety-lab-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  padding: 28px clamp(24px, 3.2vw, 56px) 25px;
  border-bottom: 1px solid var(--lab-line);
  flex: 0 0 auto;
}
.safety-lab-eyebrow { display: flex; align-items: center; gap: 9px; color: var(--lab-muted); font-family: "Courier New", monospace; font-size: 10px; line-height: 1.5; letter-spacing: .09em; }
.safety-lab-eyebrow > span { width: 5px; height: 5px; background: var(--lab-yellow); }
.safety-lab-heading h2 { margin: 13px 0 10px; font-size: clamp(26px, 2.7vw, 42px); font-weight: 500; letter-spacing: -.045em; line-height: 1.14; }
.safety-lab-heading > p:last-child { color: var(--lab-muted); font-size: 12px; line-height: 1.8; max-width: 700px; }
.safety-lab-close { display: flex; align-items: center; justify-content: center; gap: 15px; padding: 9px 0 9px 17px; color: #d6ddda; background: transparent; min-height: 44px; flex-shrink: 0; font-size: 12px !important; }
.safety-lab-close > span:last-child { font-size: 33px; font-weight: 300; line-height: .8; color: var(--lab-yellow); }
.safety-lab-close:hover { color: var(--lab-yellow); }
.safety-lab-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); gap: clamp(22px, 3vw, 48px); padding: 26px clamp(24px, 3.2vw, 56px) 32px; flex: 1 0 auto; align-items: start; }
.safety-lab-viewer { min-width: 0; padding: 0; margin: 0; }
.safety-lab-viewer-label { display: flex; justify-content: space-between; align-items: center; gap: 15px; color: #99a6a4; font-family: "Courier New", monospace; font-size: 11px; line-height: 1.6; letter-spacing: .07em; margin-bottom: 13px; }
.safety-lab-motion-state { color: var(--lab-yellow); }
.safety-lab-stage-slot { position: relative; height: clamp(390px, 62vh, 850px); height: clamp(390px, 62dvh, 850px); min-width: 0; overflow: hidden; border: 1px solid #303a3b; background: radial-gradient(ellipse at 50% 53%, #2a3539 0, #1b2327 46%, #151b1e 77%); }
.safety-lab .scene-stage { width: 100%; height: 100%; margin: 0; max-height: none; min-height: 0; flex: none; }
.safety-lab .scene-stage canvas { width: 100%; height: 100%; }
.safety-lab .scene-stage .scene-hotspot { min-width: 40px; min-height: 40px; font-size: 12px; }
.safety-lab .scene-fallback-note { position: absolute; z-index: 4; left: 18px; right: 18px; bottom: 12px; font-size: 10px; line-height: 1.6; color: #d4ddd4; }
.safety-lab-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 15px; }
.safety-lab-control { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 44px; padding: 10px 16px; background: transparent; color: #d7dfdb; border: 1px solid #465150; font-size: 11px !important; line-height: 1.5; transition: background .15s, border-color .15s; }
.safety-lab-control > span:first-child { font-size: 17px; line-height: 1; color: var(--lab-yellow); }
.safety-lab-control:hover { border-color: var(--lab-yellow); background: #f4c7420a; }
.safety-lab-pause { min-width: 130px; }
.safety-lab-reset { margin-left: auto; }
.safety-lab-viewer-help { margin-top: 13px; color: var(--lab-muted); font-size: 10px; line-height: 1.8; }
.safety-lab-panel { position: relative; min-width: 0; padding: 23px 24px 21px; background: var(--lab-panel); border: 1px solid var(--lab-line); }
.safety-lab-score-row { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.safety-lab-score-row > span { font-size: 13px; font-weight: 500; }
.safety-lab-count { font-size: 38px; font-weight: 500; letter-spacing: -.06em; line-height: 1; color: var(--lab-yellow); }
.safety-lab-count > span { font-size: 18px; color: #6d7a77; letter-spacing: -.025em; margin-left: 4px; }
.safety-lab-score-detail { font-size: 10px; color: var(--lab-muted); line-height: 1.8; margin: 10px 0 0; }
.safety-lab-progress { display: block; width: 100%; height: 3px; margin: 16px 0 26px; border: 0; border-radius: 0; appearance: none; -webkit-appearance: none; background: #39413e; accent-color: var(--lab-yellow); }
.safety-lab-progress::-webkit-progress-bar { background: #39413e; }
.safety-lab-progress::-webkit-progress-value { background: var(--lab-yellow); }
.safety-lab-progress::-moz-progress-bar { background: var(--lab-yellow); }
.safety-lab-empty { padding: 5px 0 17px; }
.safety-lab-empty-symbol { display: grid; place-items: center; width: 39px; height: 39px; margin-bottom: 18px; border: 1px solid #5b6046; color: var(--lab-yellow); font-size: 24px; font-weight: 400; }
.safety-lab-empty h3, .safety-lab-explanation h3 { font-size: 22px; font-weight: 500; letter-spacing: -.04em; line-height: 1.3; margin: 0; }
.safety-lab-empty > p { color: var(--lab-muted); font-size: 11px; line-height: 1.95; margin-top: 13px; }
.safety-lab-selection-status { font-family: "Courier New", monospace; font-size: 11px; letter-spacing: .05em; color: var(--lab-yellow); margin-bottom: 12px; }
.safety-lab-selection-status.is-hinted { color: #b5c7ce; }
.safety-lab-explanation-list { margin: 20px 0 22px; }
.safety-lab-explanation-list > div { border-top: 1px solid var(--lab-line); padding: 13px 0; }
.safety-lab-explanation-list > div:last-child { padding-bottom: 0; }
.safety-lab-explanation-list dt { font-size: 10px; font-weight: 600; color: #e3e8df; margin-bottom: 6px; }
.safety-lab-explanation-list dd { margin: 0; color: var(--lab-muted); font-size: 11px; line-height: 1.9; }
.safety-lab-complete { padding: 13px 14px; margin: 0 0 20px; border-left: 2px solid var(--lab-yellow); background: #f4c74208; font-size: 11px; line-height: 1.8; color: #d0d8c9; }
.safety-lab-hint { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 15px; min-height: 45px; width: 100%; color: #171c1c; background: var(--lab-yellow); font-size: 11px !important; font-weight: 700 !important; line-height: 1.5; margin-top: 2px; }
.safety-lab-hint > span:last-child { font-size: 21px; font-weight: 400; line-height: 1; }
.safety-lab-hint:hover { background: #ffda68; }
.safety-lab-hint[aria-disabled="true"] { background: #333c35; color: #b9c7b7; cursor: default; }
.safety-lab-zones { border-top: 1px solid var(--lab-line); margin-top: 21px; padding-top: 3px; }
.safety-lab-zones > summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 0; list-style: none; cursor: pointer; font-size: 11px; line-height: 1.6; }
.safety-lab-zones > summary::-webkit-details-marker { display: none; }
.safety-lab-zones > summary > span { color: var(--lab-yellow); font-size: 21px; font-weight: 300; line-height: 1; }
.safety-lab-zones[open] > summary > span { transform: rotate(45deg); }
.safety-lab-zones > p { font-size: 10px; color: var(--lab-muted); line-height: 1.8; margin: 0 0 10px; }
.safety-lab-zone-list { list-style: none; padding: 0; margin: 0; }
.safety-lab-zone-list > li + li { margin-top: 6px; }
.safety-lab-zone { display: grid; grid-template-columns: 20px 1fr; align-items: start; gap: 2px 8px; min-height: 53px; width: 100%; text-align: left; padding: 10px; background: #161c1c; border: 1px solid #343f3b; color: #d6dfd6; }
.safety-lab-zone-number { font-family: "Courier New", monospace; font-size: 11px; color: #89978c; line-height: 1.8; grid-row: 1 / 3; }
.safety-lab-zone-label { font-size: 11px; line-height: 1.7; }
.safety-lab-zone-state { font-size: 11px; color: #8a9c92; line-height: 1.7; }
.safety-lab-zone:hover, .safety-lab-zone.is-selected { border-color: #8a8150; }
.safety-lab-zone.is-found .safety-lab-zone-state { color: var(--lab-yellow); }
.safety-lab-note { border-top: 1px solid var(--lab-line); margin-top: 15px; padding-top: 13px; font-size: 11px; line-height: 1.9; color: #8d9a93; }
.safety-lab-announcement { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (min-width: 900px) {
  .safety-lab { overflow: hidden; overflow: clip; overflow-anchor: none; }
  .safety-lab-layout { flex: 1 1 auto; min-height: 0; overflow: hidden; overflow: clip; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  .safety-lab-viewer { display: flex; flex-direction: column; min-height: 0; }
  .safety-lab-viewer-label, .safety-lab-controls, .safety-lab-viewer-help { flex: 0 0 auto; }
  .safety-lab .safety-lab-stage-slot { flex: 1 1 auto; height: auto; min-height: 280px; }
  .safety-lab-panel { min-height: 0; max-height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; scrollbar-gutter: stable; }
}
@media (min-width: 1700px) {
  .safety-lab-layout { grid-template-columns: minmax(0, 1fr) 420px; }
  .safety-lab-panel { padding: 28px; }
  .safety-lab-explanation-list dd { font-size: 12px; }
}
@media (max-width: 1000px) {
  .safety-lab-layout { grid-template-columns: minmax(0, 1fr) 315px; gap: 20px; padding-left: 23px; padding-right: 23px; }
  .safety-lab-header { padding-left: 23px; padding-right: 23px; }
  .safety-lab-panel { padding: 20px; }
  .safety-lab-stage-slot { height: 58vh; height: 58dvh; min-height: 420px; }
  .safety-lab-reset { margin-left: 0; }
  .safety-lab-control { padding: 10px 13px; }
  .safety-lab-viewer-label { font-size: 10px; }
}
@media (max-width: 760px) {
  .safety-lab-header { padding: 22px 20px 21px; gap: 15px; }
  .safety-lab-eyebrow { font-size: 10px; letter-spacing: .07em; }
  .safety-lab-heading h2 { font-size: clamp(25px, 4.5vw, 34px); max-width: 440px; margin-top: 12px; }
  .safety-lab-heading > p:last-child { font-size: 11px; max-width: 460px; }
  .safety-lab-close { padding: 5px 0 5px 10px; }
  .safety-lab-close > span:first-child { display: none; }
  .safety-lab-close > span:last-child { font-size: 35px; }
  .safety-lab-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 20px 20px 30px; }
  .safety-lab-stage-slot { height: clamp(370px, 62vh, 610px); height: clamp(370px, 62dvh, 610px); min-height: 0; }
  .safety-lab-panel { padding: 24px; }
  .safety-lab-viewer-label { font-size: 10px; }
  .safety-lab-controls { gap: 8px; }
  .safety-lab-control { flex: 1 1 auto; }
  .safety-lab-reset { flex-grow: 0; margin-left: auto; }
  .safety-lab-explanation h3, .safety-lab-empty h3 { font-size: 24px; }
  .safety-lab-explanation-list dd { font-size: 12px; }
  .safety-lab-empty > p { font-size: 12px; }
  .safety-lab-zone-label { font-size: 12px; }
  .safety-lab-note { font-size: 10px; }
}
@media (max-width: 420px) {
  .safety-lab-header { padding: 19px 16px; }
  .safety-lab-heading h2 { font-size: 27px; }
  .safety-lab-layout { padding: 18px 14px 25px; gap: 21px; }
  .safety-lab-stage-slot { height: 380px; }
  .safety-lab-panel { padding: 20px; }
  .safety-lab-controls { gap: 7px; }
  .safety-lab-pause { min-width: 0; }
  .safety-lab-control { padding: 11px 12px; }
  .safety-lab-reset { flex-basis: 100%; }
  .safety-lab-viewer-help { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .safety-lab *, .safety-lab *::before, .safety-lab *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
