:root {
  --bg: #0b0e14;
  --panel: rgba(16, 20, 30, 0.88);
  --line: rgba(255, 255, 255, 0.12);
  --text: #e8ecf3;
  --muted: #9aa4b5;
  --accent: #ff7a1a;
  --accent2: #3fb6ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#app { position: fixed; inset: 0; }

#topbar { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; background: linear-gradient(to bottom, rgba(0,0,0,.75), transparent); z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; white-space: nowrap; }
.brand span { color: var(--accent); font-weight: 600; }
#units { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; max-width: calc(100vw - 520px); scrollbar-width: thin; padding-bottom: 4px; }
#units button { white-space: nowrap; }
#units button { background: rgba(255,255,255,.06); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
#units button:hover { border-color: var(--accent2); }
#units button.active { background: var(--accent); border-color: var(--accent); color: #111; font-weight: 700; }

#panel { position: fixed; right: 16px; top: 90px; width: 380px; max-height: calc(100% - 140px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; z-index: 5;
  backdrop-filter: blur(8px); }
#unit-label { color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
#step-title { margin: 6px 0 10px; font-size: 20px; }
#step-text { color: #cfd6e2; line-height: 1.55; font-size: 14.5px; }
#step-text b { color: #fff; }
#step-text .formula { font-family: ui-monospace, Menlo, monospace; background: rgba(255,255,255,.07);
  padding: 2px 6px; border-radius: 6px; color: var(--accent2); }
#controls { margin-top: 14px; display: grid; gap: 10px; }
#controls label, #controls .choice-field { font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
#controls label output { color: var(--text); font-weight: 700; }
#controls .choice-field > span:first-child { color: var(--muted); font-size: 13px; }
#controls input[type=range] { width: 100%; accent-color: var(--accent); }
#controls button { background: var(--accent2); color: #061018; border: 0; border-radius: 8px; padding: 8px 10px;
  font-weight: 700; cursor: pointer; }
.nav { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; gap: 8px; }
.nav button { background: rgba(255,255,255,.08); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; cursor: pointer; }
.nav button:hover { border-color: var(--accent); }
#step-count { color: var(--muted); font-size: 13px; }

#hint { position: fixed; left: 16px; bottom: 16px; color: var(--muted); font-size: 12px; z-index: 5;
  background: rgba(0,0,0,.4); padding: 6px 10px; border-radius: 8px; }
#tooltip { position: fixed; pointer-events: none; z-index: 6; background: #111a; border: 1px solid var(--accent2);
  padding: 8px 10px; border-radius: 8px; font-size: 13px; max-width: 280px; display: none; backdrop-filter: blur(6px); }
#tooltip b { color: var(--accent2); display: block; margin-bottom: 2px; }

@media (max-width: 760px) {
  #panel { left: 16px; right: 16px; width: auto; top: auto; bottom: 16px; max-height: 45%; }
  #hint { display: none; }
}

#immersive-btn { margin-left: auto; background: var(--accent2); color: #061018; border: 0; border-radius: 999px;
  padding: 7px 14px; font-weight: 700; cursor: pointer; }
#crosshair { position: fixed; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid #fff;
  border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.5); z-index: 7; display: none; pointer-events: none; }
body.immersive #crosshair { display: block; }
body.immersive #panel, body.immersive #topbar, body.immersive #tooltip { display: none !important; }
body.immersive #hint { display: block; }

#status:not(:empty) { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(63,182,255,.1);
  border: 1px solid rgba(63,182,255,.35); font-size: 13.5px; line-height: 1.5; }
#status .ok { color: #69f0ae; font-weight: 700; } #status .bad { color: #ff8a80; font-weight: 700; }
.choice { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
#controls .choice button { background: rgba(255,255,255,.08); color: var(--text); border: 1px solid var(--line); padding: 5px 9px; font-weight: 600; }
#controls .choice button.on { background: var(--accent); color: #111; border-color: var(--accent); }
#gallery-strip { display: flex; gap: 6px; flex-wrap: wrap; }
#gallery-strip img { width: 104px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; }
#gallery-strip img:hover { border-color: var(--accent); }
@media (max-width: 760px) { #units { max-width: 100%; } }

/* Sistema visual del laboratorio: iconografía vectorial, jerarquía y foco visible. */
:root { --accent: #dba66c; --accent2: #9fc5d5; --panel: rgba(19, 25, 32, .96); }
.icon { display: inline-block; flex: 0 0 auto; vertical-align: middle; pointer-events: none; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent2); outline-offset: 4px; }
#topbar { gap: 14px; padding: 16px 24px 10px; background: rgba(13, 18, 24, .97); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 17px; letter-spacing: -.3px; }
.brand > .icon { color: var(--accent); }
.brand small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: 2px; }
#toolbar-actions { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.quality-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.quality-label small { display: block; min-width: 155px; max-width: 195px; color: #b6c2cc; font-size: 9px; line-height: 1.35; }
select { background: #202a35; border: 1px solid var(--line); border-radius: 6px; color: var(--text); padding: 7px; }
#units { order: 3; flex-basis: 100%; max-width: 100%; gap: 4px; padding-top: 4px; }
#units button { border-radius: 5px; padding: 8px 11px; background: transparent; border-color: transparent; font-size: 12px; }
#units button.active { background: #29323b; color: #f2d0a8; border-color: #5f5141; }
#panel { top: 142px; right: 24px; width: 360px; max-height: calc(100% - 200px); border-radius: 8px; padding: 22px; box-shadow: 0 16px 48px #0004; }
#unit-label { font-size: 10px; letter-spacing: 1.6px; }
#step-title { font-size: 22px; line-height: 1.25; margin-top: 12px; }
#step-text { font-size: 13px; line-height: 1.75; }
#immersive-btn { border-radius: 5px; background: #293743; color: #e4edf2; border: 1px solid #4b606d; font-size: 12px; }
#hint { bottom: 12px; left: 24px; max-width: calc(100% - 210px); font-size: 10px; }
#VRButton { right: 24px !important; left: auto !important; width: 150px !important; bottom: 12px !important; font-size: 10px !important; }
@media (max-width: 760px) {
  #topbar { padding: 10px 12px; gap: 10px; }
  .brand { font-size: 13px; } .brand small { font-size: 8px; letter-spacing: 1px; }
  #toolbar-actions { gap: 6px; } .quality-label { font-size: 0; gap: 0; flex-wrap: wrap; justify-content: flex-end; }
  .quality-label select { font-size: 11px; max-width: 100px; }
  .quality-label small { flex-basis: 100%; min-width: 0; max-width: 125px; text-align: right; font-size: 8px; }
  #immersive-btn { font-size: 0; padding: 8px; } #immersive-btn .icon { width: 20px; }
  #panel { top: auto; bottom: 52px; left: 12px; right: 12px; width: auto; max-height: 40%; padding: 16px; }
  #step-title { font-size: 18px; }
}
#anatomy-practice details { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; font-size: 12px; line-height: 1.6; }
#anatomy-practice summary { color: var(--accent); cursor: pointer; }
#anatomy-practice select { width: 100%; margin: 6px 0 10px; }
#anatomy-practice button { background: #293743; color: var(--text); border: 1px solid #4b606d; padding: 8px 12px; border-radius: 5px; }
.pipeline-preview { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 5px; background: #10151a; }
.journey-assessment { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 8px; font-size: 12px; line-height: 1.6; }
.journey-assessment summary { color: var(--accent); cursor: pointer; }
.journey-assessment label { margin: 10px 0; }
.journey-assessment select { width: 100%; font-size: 12px; }
.journey-assessment button { margin: 8px 0; width: 100%; }
.journey-assessment button:disabled { opacity: .45; cursor: default; }
.journey-assessment [role=status] { color: var(--accent2); }
.optics-practice { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; font-size: 12px; line-height: 1.55; }
.optics-practice summary { color: var(--accent); cursor: pointer; }
.optics-practice select { width: 100%; }
.optics-options { display: grid; gap: 6px; margin: 10px 0; }
.optics-options button { justify-content: flex-start; background: #293743; color: var(--text); border: 1px solid #4b606d; }
.lens-lab { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; font-size: 11px; line-height: 1.5; }
.lens-lab h3 { margin: 0 0 8px; font-size: 14px; color: #edf1f4; }
.lens-lab select { width: 100%; font-size: 11px; }
.lens-detail { min-height: 104px; margin: 9px 0; color: #c6d0d8; }
.lens-detail strong { color: #f2d0a8; }
.lens-steps { padding-left: 19px; margin: 8px 0; color: #c6d0d8; }
.lens-steps li { margin: 4px 0; }
.lens-procedure { margin: 6px 0; }
.lens-procedure summary { cursor: pointer; color: #c6d0d8; }
.lens-action { width: 100%; margin: 4px 0; background: #293743; border: 1px solid #4b606d; color: var(--text); }
.lens-state { color: #d8dfeb; min-height: 32px; }
.lens-scenario { margin: 8px 0; }
.lens-recommendation { border-left: 2px solid var(--accent); padding: 7px 9px; margin: 6px 0 12px; background: rgba(255,255,255,.035); color: #d8e0e7; }
.lens-recommendation strong { color: #f2d0a8; }
.lens-lab h4 { margin: 12px 0 6px; font-size: 12px; color: #edf1f4; }
.lens-mode { display: flex; gap: 6px; margin: 6px 0; }
#controls .lens-mode button { flex: 1; padding: 6px; background: #293743; color: var(--text); border: 1px solid #4b606d; font-size: 10px; }
#controls .lens-mode button.on { background: #d6e3ea; color: #101820; }
.lens-comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.lens-comparison figure { min-width: 0; margin: 0; }
.lens-comparison figcaption { min-height: 28px; overflow-wrap: anywhere; color: #cbd4dc; font-size: 9px; line-height: 1.35; }
.lens-preview { display: block; width: 100%; aspect-ratio: 3/2; border: 1px solid #5a6570; border-radius: 4px; background: #10151b; }
.lens-focal { display: block; margin-top: 6px; color: #cad3da; font-size: 10px !important; }
.lens-focal output { float: right; color: #f2d0a8 !important; }
.lens-focal input { width: 100%; }
.lens-capture-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin: 8px 0; }
#controls .lens-capture-actions button { min-width: 0; padding: 7px 5px; background: #293743; border: 1px solid #4b606d; color: var(--text); font-size: 10px; }
.lens-capture-actions svg { vertical-align: -3px; }
.lens-conclusion { margin: 8px 0; padding: 8px 9px; border-left: 2px solid var(--accent); background: rgba(255,255,255,.04); color: #d8e0e7; }
.lens-conclusion strong { color: #f2d0a8; }
.lens-capture-status { min-height: 28px; color: #aebbc5; font-size: 10px; }
.lens-shot-results { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.lens-shot-results figure { min-width: 0; margin: 0; }
.lens-shot-results img { display: block; width: 100%; aspect-ratio: 3/2; object-fit: contain; border: 1px solid #5a6570; border-radius: 4px; background: #10151b; }
.lens-shot-results figcaption { margin-top: 3px; color: #aebbc5; font-size: 9px; overflow-wrap: anywhere; }
.developed-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin: 8px 0; }
.developed-pair figure { min-width: 0; margin: 0; }
.developed-pair img { display: block; width: 100%; aspect-ratio: 3/2; object-fit: contain; border: 1px solid #5a6570; border-radius: 4px; background: #10151b; }
.developed-pair figcaption { margin-top: 3px; color: #aebbc5; font-size: 10px; }
.learning-path { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.learning-path h3 { margin: 0 0 5px; color: #edf1f4; font-size: 14px; }
.learning-path > p { color: #aebbc5; font-size: 11px; }
.learning-path ol { padding-left: 24px; }
.learning-path li { margin: 8px 0; padding-left: 3px; color: #cbd4dc; font-size: 11px; }
.learning-path li strong { color: #f2d0a8; }
#controls .learning-path-open { margin-top: 4px; padding: 5px 8px; background: #293743; border: 1px solid #4b606d; color: var(--text); font-size: 10px; }
.lens-mode-note { font-size: 9px; line-height: 1.4; color: #9eabb6; }
.lens-play { width: 100%; }
.lens-play:disabled { opacity: .5; cursor: default; }
