:root {
  --fondo: #1f2326;
  --barra: #15181a;
  --texto: #e8eaeb;
  --tenue: #9aa3a8;
  --acento: #6f8f88;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fondo); color: var(--texto); font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; }
.barra { position: fixed; top: 0; left: 0; right: 0; height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px; background: var(--barra); z-index: 5; }
.titulo { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--tenue); }
.titulo span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.controles { display: flex; align-items: center; gap: 6px; }
.acciones { flex: 1 1 0; display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.barra button, .barra a { background: none; border: 1px solid transparent; color: var(--texto); font-size: 20px; line-height: 1; min-width: 36px; height: 36px; border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.barra a { font-size: 12px; font-weight: 600; letter-spacing: .04em; border-color: #3a4044; padding: 0 10px; }
.barra button:hover, .barra a:hover { background: #2a2f33; }
.barra button:disabled { opacity: .3; cursor: default; background: none; }
#contador { min-width: 84px; text-align: center; font-variant-numeric: tabular-nums; color: var(--tenue); }
#escenario { position: fixed; top: 48px; left: 0; right: 0; bottom: 28px; overflow: hidden; outline: none; }
#escenario.zoom { overflow: auto; cursor: grab; }
#vista { position: absolute; display: flex; box-shadow: 0 4px 24px rgba(0,0,0,.45); transform-origin: 0 0; }
.hoja { position: relative; overflow: hidden; background: #fff; flex: none; }
.hoja + .hoja { margin-left: -1px; }
.hoja iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: #fff; }
.hoja.cargando::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #eee 0, #f7f7f7 50%, #eee 100%); }
.lado { position: absolute; top: 0; bottom: 0; width: 7%; min-width: 40px; background: none; border: 0; cursor: pointer; z-index: 2; }
.lado.izq { left: 0; } .lado.der { right: 0; }
.lado:hover { background: rgba(255,255,255,.04); }
#escenario.zoom .lado { display: none; }
#barraPag { position: fixed; left: 12px; right: 12px; bottom: 6px; width: calc(100% - 24px); margin: 0; accent-color: var(--acento); }
/* Panel de índice y miniaturas */
#panel { position: fixed; top: 48px; left: 0; bottom: 0; width: 320px; max-width: 100%; background: var(--barra); z-index: 6; display: flex; flex-direction: column; box-shadow: 4px 0 20px rgba(0,0,0,.4); }
#panel[hidden] { display: none; }
.pestanas { display: flex; align-items: center; border-bottom: 1px solid #2c3236; padding: 0 6px; }
.pestanas button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--tenue); font: inherit; font-weight: 600; padding: 12px 10px; cursor: pointer; }
.pestanas button[aria-selected="true"] { color: var(--texto); border-bottom-color: var(--acento); }
#cerrarPanel { margin-left: auto; font-size: 22px; font-weight: 400; padding: 6px 10px; }
.contenido { flex: 1; overflow-y: auto; padding: 8px 0 24px; }
#listaIndice[hidden], #listaPaginas[hidden] { display: none; }
#listaIndice a { display: flex; justify-content: space-between; gap: 12px; padding: 7px 18px; color: var(--texto); text-decoration: none; }
#listaIndice a:hover, #listaIndice a.activo { background: #252b2f; }
#listaIndice a span:last-child { color: var(--tenue); font-variant-numeric: tabular-nums; }
#listaIndice .seccion { font-weight: 700; margin-top: 8px; text-transform: uppercase; letter-spacing: .05em; font-size: 12px; }
#listaIndice .producto { padding-left: 30px; font-size: 13px; }
#listaPaginas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 10px; padding: 12px 14px 24px; align-content: start; }
#listaPaginas a { display: block; text-align: center; color: var(--tenue); text-decoration: none; font-size: 12px; }
#listaPaginas img { display: block; width: 100%; height: auto; background: #fff; border: 2px solid transparent; border-radius: 2px; }
#listaPaginas a.activo img { border-color: var(--acento); }
#listaPaginas a:hover img { border-color: #4a5257; }
@media (max-width: 700px) {
  .titulo span { display: none; }
  #panel { width: 100%; }
  #listaPaginas { grid-template-columns: repeat(3, 1fr); }
  .controles { flex: 1; }
  .lado { display: none; }
}
