/* Layout for the existing experiment controls and measured results. */
:root {
  font-size: 100%;
  --lab-rail: clamp(20rem, 26vw, 25.5rem);
  --lab-head: 4rem;
  --lab-pad: clamp(1rem, 1.8vw, 1.6rem);
  --lab-border: #3b4e57;
  --lab-secondary: #bed0d5;
  --lab-value: #e8f9f5;
}

body { line-height: 1.48; }
header {
  min-height: var(--lab-head);
  height: auto;
  padding: .4rem max(1.2rem, env(safe-area-inset-right)) .4rem max(1.2rem, env(safe-area-inset-left));
  gap: clamp(.65rem, 1.6vw, 1.5rem);
}
header h1 { min-width: 0; font-size: clamp(1.1rem, 2vw, 1.8rem); line-height: 1.12; }
.identidad { min-height: 44px; }
header #pantalla, #centrar { min-width: 44px; height: 44px; }
button, summary, select, input, .identidad { -webkit-tap-highlight-color: transparent; }
:where(button, summary, select, input, a, canvas):focus-visible {
  outline: 3px solid #9efff0;
  outline-offset: 3px;
}
main {
  grid-template-columns: minmax(0, 1fr) var(--lab-rail);
  min-height: calc(100svh - var(--lab-head));
}
#escena, aside {
  height: calc(100svh - var(--lab-head));
  min-height: 22rem;
}
aside {
  padding: 0 var(--lab-pad) max(1.25rem, env(safe-area-inset-bottom));
  border-color: var(--lab-border);
  background: #142028;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #657e85 #142028;
  scroll-padding: 1rem;
}
.seccion { padding: 1.05rem 0 1.2rem; }
.seccion label:not(.force-check), .seccion h2 { color: var(--ink); }
.seccion h2 { font-size: 1.15rem; margin-bottom: .7rem; }
#instrumentos > .seccion:first-child > label, .fila-titulo > label,
#mandos-aire > label:first-child { font-size: 1rem; font-weight: 630; }
.fila-titulo { gap: .65rem; }
.modelo-fila { margin-top: .85rem; }
select {
  min-height: 44px;
  font-size: .9375rem;
  margin-top: .45rem;
  color: var(--ink);
  background-color: #0d1921;
  border-color: #50636d;
  font-variant-numeric: tabular-nums;
}
#comparar, header #tour-iniciar, #tour-mandos button,
#reintentar, #power, .camaras button {
  min-height: 44px;
  font-size: .875rem;
}
#comparar { padding: .4rem .7rem; }
#power {
  margin: 1rem 0;
  min-height: 48px;
  font-size: .98rem;
}
button:active:not(:disabled), summary:active { filter: brightness(1.12); }

.densidad { column-gap: .65rem; row-gap: .05rem; }
.densidad label, .opcion, .force-check { font-size: .91rem; line-height: 1.35; }
.densidad output {
  min-width: 4.25em;
  padding: .2rem .52rem;
  text-align: center;
  border: 1px solid #476369;
  border-radius: .3rem;
  background: #12282d;
  color: #c1f7ed;
  font: 600 .875rem/1.35 var(--mono);
  font-variant-numeric: tabular-nums;
}
input[type=range] {
  display: block;
  min-width: 0;
  height: 44px;
  margin: 0;
  accent-color: #81e5d5;
}
#mandos-corte, #mandos-agua .densidad + .densidad { margin-top: .7rem; }
#escala { margin-top: -.22rem; font-size: .75rem; color: var(--lab-secondary); }
#escala i, .escala-corte i { height: 5px; }
.force-check { min-height: 44px; gap: .6rem; }
.force-check input { flex: 0 0 1.12rem; width: 1.12rem; height: 1.12rem; margin: 0; }
#mandos-agua .claves { padding-top: .6rem; border-top: 1px solid var(--lab-border); }
.nota, #nota-comparar, details p { color: var(--lab-secondary); font-size: .8125rem; line-height: 1.55; }
#nota-comparar { padding:.4rem 0 .4rem .7rem; border-left: 2px solid var(--aqua); }
#instrumentos .resultados { padding-top: 1.15rem; }
.resultados h2 { margin-top: 0; }
table { width: 100%; font-size: .875rem; line-height: 1.35; }
th, td { padding: .55rem .25rem; vertical-align: middle; }
th:first-child { padding-left: 0; }
td:last-child, thead th:last-child { padding-right: 0; }
thead th { color: #b1c6ca; font-size: .75rem; letter-spacing: .035em; }
tbody th { color: #d8e3e7; }
td { font-size: .875rem; color: var(--lab-value); }
th em { display: inline-block; color: #abbfc5; font-size: .75rem; font-style: normal; }
th, td, output { font-variant-numeric: tabular-nums; }
.resultados td:nth-child(3) { color: #b8dedc; }
details { font-size: .875rem; }
summary { min-height: 44px; padding: .65rem 0 .5rem; }
details p a { color: #ade9dd; text-underline-offset: .15em; }

.herramientas { left: max(1rem, env(safe-area-inset-left)); bottom: max(1rem, env(safe-area-inset-bottom)); align-items: center; }
.camaras button { min-width: 44px; padding: .45rem .68rem; }
.camaras button[aria-pressed=true] { background: #2c595d; color: white; }
.esquinas span { left: max(1rem, env(safe-area-inset-left)); bottom: 5.05rem; font-size: .8rem; }
#escena:not([data-compare=true]) .esquinas span:first-child { bottom: 5.05rem; }
.piloto { max-width: calc(100% - 2rem); line-height: 1.4; font-size: .72rem; }
@media (max-height: 590px) and (orientation: landscape) {
  :root { --lab-head: 3rem; --lab-rail: clamp(16rem, 32vw, 20.5rem); --lab-pad: .85rem; }
  header { padding-block: .12rem; }
  header h1 { font-size: 1.15rem; }
  #escena, aside { min-height: 12.5rem; }
  aside { padding-right: max(.85rem, env(safe-area-inset-right)); }
  .seccion { padding-block: .75rem; }
  .piloto { top: .6rem; }
  .herramientas { bottom: max(.5rem, env(safe-area-inset-bottom)); }
  #escena .esquinas span { bottom: 4.1rem; }
}

@media (max-width: 760px) and (orientation: portrait), (max-width: 575px) {
  header { gap: .5rem; padding-inline: max(.7rem, env(safe-area-inset-left)) max(.7rem, env(safe-area-inset-right)); }
  .identidad { flex: 0 0 auto; gap: .3rem; padding-right: .55rem; }
  header #tour-iniciar { min-width: 0; padding-inline: .55rem; white-space: normal; line-height: 1.1; }
  header #pantalla { flex: 0 0 44px; }
  header h1 { font-size: 1.1rem; }
  main { display: block; }
  #escena {
    position: relative;
    top: auto;
    height: clamp(17rem, 45svh, 34rem);
    min-height: 0;
    max-height: none;
  }
  aside {
    height: auto;
    min-height: 0;
    overflow: visible;
    scrollbar-gutter: auto;
    padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
    border-left: 0;
    border-top: 1px solid var(--lab-border);
  }
  .herramientas { bottom: max(.65rem, env(safe-area-inset-bottom)); left: max(.65rem, env(safe-area-inset-left)); gap: .35rem; }
  .camaras { padding: 2px; }
  .camaras button { padding-inline: .55rem; }
  .piloto { top: .65rem; left: .65rem; }
  #escena .esquinas span { left: .75rem; font-size: .76rem; }
  #escena:not([data-compare=true]) .esquinas span:first-child { bottom: 4.5rem; }
}
@media (max-width: 760px) and (orientation: portrait) {
  #escena[data-compare=true] .esquinas span:first-child { bottom: calc(50% + .65rem); }
  #escena[data-compare=true] .esquinas span:last-child { left: .75rem; bottom: 4.5rem; }
}
@media (max-width: 575px) and (orientation: landscape) {
  #escena[data-compare=true] .esquinas span:last-child { left: calc(50% + .65rem); }
}
@media (max-width: 360px) {
  .identidad img { width: 33px; }
  header h1 { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  #cortina .espera { animation: none; }
}
@media (forced-colors: active) {
  .camaras button[aria-pressed=true], #comparar[aria-pressed=true], #power[aria-pressed=true] { outline: 2px solid Highlight; outline-offset: -2px; }
  .densidad output { border: 1px solid CanvasText; }
}

/* Guided tour rail and the V32 reference used while the viewer opens. */
#cortina {
  justify-content: flex-end;
  align-items: stretch;
  padding: clamp(.75rem, 3vw, 2rem);
  background: #152329;
}
#cartel-v32 {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cortina-mensaje {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .2rem .7rem;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  border: 1px solid #4c6570;
  border-radius: .6rem;
  padding: .15rem .7rem;
  color: var(--ink);
  background: #0c171eef;
}
.cortina-mensaje .espera { flex: none; width: 1rem; height: 1rem; }
#mensaje-carga { margin: .35rem 0; font-size: .875rem; }
.cortina-guia, .sin-script {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: .35rem;
  color: var(--aqua);
  font-size: .875rem;
  text-underline-offset: .2em;
}
#cortina[data-retain=true] { background: transparent; pointer-events: none; }
#cortina[data-retain=true] #cartel-v32, #cortina[data-retain=true] .cortina-guia { display: none; }
#cortina[data-retain=true] button { pointer-events: auto; }
#escena[data-ready=false] .herramientas { visibility: hidden; }

#tour-panel {
  --tour-active: #a1f1de;
  --tour-line: #4c696d;
  padding: .9rem 0 1.25rem;
  border-color: var(--tour-line);
}
header #tour-iniciar, #tour-mandos button, #tour-acciones button, #tour-salir {
  min-height: 44px;
  min-width: 44px;
  padding: .5rem .65rem;
  border: 1px solid #4d6d70;
  border-radius: .45rem;
  color: var(--ink);
  background: #192a31;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
header #tour-iniciar, #tour-mandos #tour-proximo {
  border-color: #9be8da;
  background: #9be8da;
  color: #092723;
}
#tour-mandos button:not(:disabled):hover, #tour-acciones button:not(:disabled):hover, #tour-salir:hover { border-color: var(--tour-active); }
header #tour-iniciar:hover, #tour-mandos #tour-proximo:not(:disabled):hover { background: #b8f5e9; }
#tour-paso {
  margin: 0 0 .45rem;
  color: var(--tour-active);
  font: 600 .75rem/1.45 var(--mono);
}
#tour-progreso {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .26rem;
  margin: 0 0 1.05rem;
  padding: 0;
  list-style: none;
}
#tour-progreso li { height: 4px; border-radius: .25rem; background: #536870; }
#tour-progreso [aria-current=step] { background: var(--tour-active); }
#tour-progreso li:has(~ [aria-current=step]) { background: #739f99; }
#tour-titulo {
  margin: 0 0 .6rem;
  font-size: clamp(1.45rem, 1.85vw, 2.05rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  text-wrap: balance;
}
#tour-texto {
  margin: 0 0 .85rem;
  color: #e2edf0;
  font-size: .925rem;
  line-height: 1.52;
}
#tour-lectura {
  display: block;
  margin: 0 0 .75rem;
  padding: .6rem .7rem;
  border: 1px solid #4d746e;
  border-left: 3px solid #8adac9;
  border-radius: .35rem;
  background: #12282d;
  color: #d6f7f0;
  font: .8rem/1.55 var(--mono);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
#tour-aviso {
  margin: 0 0 .7rem;
  color: #c4dbdd;
  font-size: .8125rem;
}
#tour-panel[data-phase=error] #tour-aviso { color: #ffd39e; }
#tour-mandos, #tour-acciones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: .4rem;
}
#tour-acciones { margin-bottom: .7rem; }
#tour-acciones > :only-child { grid-column: 1/-1; }
#tour-acciones button[aria-pressed=true], #tour-orbitar[aria-pressed=true] {
  border-color: #8adac9;
  color: var(--tour-active);
  background: #1d4643;
}
#tour-nivel-wrap { margin: .65rem 0 .55rem; }
.tour-opciones { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem .5rem; margin-top: .55rem; }
.tour-opciones .force-check { margin: 0; }
#tour-salir { border-color: transparent; color: #c9ddd9; background: transparent; }
#tour-fuente-voz {
  display: block;
  color: var(--lab-secondary);
  font-size: .75rem;
  line-height: 1.4;
}
#tour-transcripcion { margin: .5rem 0 0; border-top: 1px solid var(--tour-line); }
#tour-transcripcion summary { padding: .6rem 0; color: #d6e9e6; }
#tour-transcripcion p { margin: .25rem 0 0; }

#laboratorio-alternativa {
  padding-bottom: .7rem;
  color: var(--lab-secondary);
  font-size: .875rem;
  scroll-margin-top: .75rem;
}
#laboratorio-alternativa figure { margin: .75rem 0; }
#laboratorio-alternativa figcaption { margin-top: .28rem; color: #c6d7dc; font-size: .75rem; }
#laboratorio-alternativa .guia-vista { position: relative; overflow: hidden; border: 1px solid var(--lab-border); border-radius: .4rem; }
#laboratorio-alternativa img { display: block; width: 100%; height: auto; }
.guia-marca {
  position: absolute;
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 1px solid #c9fef5;
  background: #133c3d;
  color: #e6fff9;
  font: 700 .75rem var(--mono);
  transform: translate(-50%, -50%);
}
.guia-marca.proa { left: 93%; top: 34%; }
.guia-marca.hombros { left: 36%; top: 22%; }
.guia-marca.popa { left: 12%; top: 22%; }
.guia-partes { margin: .6rem 0 1rem; padding-left: 1.4rem; }
.guia-partes li { padding-left: .14rem; margin: .3rem 0; }
.guia-partes li::marker { color: #8fe8d7; font-family: var(--mono); }
#laboratorio-alternativa dt, .guia-partes strong { color: #e5f3f3; font-weight: 650; }
#laboratorio-alternativa dd { margin: .22rem 0 .75rem; }

@media (max-width: 760px) and (orientation: portrait), (max-width: 575px) {
  body:has(#tour-panel:not([hidden])) #escena { position: sticky; top: 0; z-index: 2; }
  #tour-panel, #tour-panel :where(button, input, summary):focus-visible {
    scroll-margin-block-start: calc(clamp(17rem, 45svh, 34rem) + .5rem);
  }
  #tour-titulo { font-size: 1.55rem; }
}
@media (forced-colors: active) {
  #tour-progreso [aria-current=step], #tour-acciones button[aria-pressed=true], #tour-orbitar[aria-pressed=true] {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
}


#tour-lectura[data-scale]::before {
  content: "";
  display: block;
  height: .25rem;
  margin-bottom: .5rem;
  border-radius: 1rem;
  background: linear-gradient(90deg, #173956, #276f92, #35a99a, #a4cb73, #ffe399);
}
