/* ===============================================================
   SELENE-7 · RETO 3 · HOJAS DEL TELETIPO
   Papel pijama de impresora de 1970: bandas verdes, agujeros de
   arrastre a los lados, letra de máquina de escribir (Courier Prime,
   en css/fuentes.css), el número de página abajo a la izquierda y la
   esquina de arriba arrancada. Lo usan el juego (index.html) y la
   hoja imprimible (props/procedimiento-filtro.html).
   Cada hoja mide 840 × 592 px (proporción A5 apaisado); el juego la
   escala para que quepa y la versión impresa usa zoom.
   =============================================================== */
.hoja {
  --papel: #f1eee1;
  --tinta: #25292f;
  --agujero: #0b1017;
  position: relative; width: 840px; height: 592px; padding: 20px 54px 16px; overflow: hidden;
  font: 400 14px/1.42 "Courier Prime", "Courier New", Courier, "JetBrains Mono", monospace; color: var(--tinta); letter-spacing: .01em;
  text-shadow: 0 0 .7px rgba(20, 22, 26, .55);
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='r'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .3  0 0 0 0 .2  0 0 0 .5 -.22'/></filter><rect width='100%' height='100%' filter='url(%23r)'/></svg>"),
    linear-gradient(100deg, rgba(0, 0, 0, .03), transparent 25%, transparent 75%, rgba(0, 0, 0, .05)),
    repeating-linear-gradient(to bottom, rgba(120, 175, 128, .16) 0 27px, transparent 27px 54px) 0 12px,
    var(--papel);
  /* Esquina del número de página, arrancada */
  clip-path: polygon(0 0, 712px 0, 722px 6px, 716px 14px, 730px 22px, 726px 32px, 742px 38px, 738px 48px, 756px 52px, 760px 62px, 778px 64px, 790px 74px, 806px 76px, 818px 86px, 840px 88px, 840px 592px, 0 592px);
}
.hoja b { font-weight: 700; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
/* Agujeros de arrastre y línea de trepado */
.h-perfo { position: absolute; top: 0; bottom: 0; width: 34px; background: radial-gradient(circle, var(--agujero) 0 5.2px, rgba(0, 0, 0, .25) 5.8px, transparent 6.6px) 50% 6px / 34px 26px repeat-y; }
.h-perfo-i { left: 0; border-right: 1px dashed rgba(40, 44, 50, .28); }
.h-perfo-d { right: 0; border-left: 1px dashed rgba(40, 44, 50, .28); }
/* Borde fibroso del roto y lo que queda del número de página */
.h-rota { position: absolute; inset: 0; pointer-events: none; }
.h-rota::before {
  content: ""; position: absolute; inset: 0; background: rgba(150, 125, 80, .38);
  clip-path: polygon(712px 0, 722px 6px, 716px 14px, 730px 22px, 726px 32px, 742px 38px, 738px 48px, 756px 52px, 760px 62px, 778px 64px, 790px 74px, 806px 76px, 818px 86px, 840px 88px, 840px 94px, 814px 92px, 801px 82px, 786px 80px, 773px 70px, 755px 68px, 751px 58px, 733px 54px, 737px 44px, 721px 38px, 725px 28px, 711px 20px, 716px 12px, 706px 5px, 706px 0);
}
.h-rota span { position: absolute; top: 16px; left: 640px; font-weight: 700; letter-spacing: .12em; }

.h-cab { padding-bottom: 7px; border-bottom: 2px solid var(--tinta); }
.h-cab-1 { display: flex; justify-content: space-between; padding-right: 150px; font-size: 12.5px; letter-spacing: .06em; }
.h-cab-2 { font-size: 12px; letter-spacing: .04em; opacity: .85; }
.h-titulo { margin-top: 5px; font-size: 17px; font-weight: 700; letter-spacing: .07em; }

.h-cuerpo { display: grid; grid-template-columns: 132px 1fr 1fr; gap: 16px; margin-top: 12px; height: 388px; }
.h-empieza { display: flex; flex-direction: column; gap: 6px; }
.h-empieza > span, .h-sigue > span { font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.h-caja { display: grid; place-items: center; padding: 6px; border: 2px dashed var(--tinta); background: rgba(255, 255, 255, .35); }
.h-empieza .h-caja { height: 112px; }
.h-caja .dib { width: 100%; height: 100%; }
.h-paso { display: flex; flex-direction: column; min-width: 0; }
.h-dib { height: 232px; padding: 4px; overflow: hidden; border: 1px solid rgba(37, 41, 47, .35); background: rgba(255, 255, 255, .3); }
.h-dib .dib { display: block; width: 100%; height: 100%; }
.h-paso p { margin: 10px 0 0; font-size: 16px; line-height: 1.4; }
/* Hoja corta (EXPLORADOR): cabecera de dos líneas, así que hay más sitio para el dibujo y la letra */
.hoja.corta .h-cuerpo { height: 406px; }
.hoja.corta .h-dib { height: 246px; }
.hoja.corta .h-paso p { font-size: 17px; }
.h-vineta { margin-right: 8px; font-weight: 700; }

.h-pie { position: absolute; left: 54px; right: 54px; bottom: 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
/* Número de página, abajo a la izquierda, como en los procedimientos mecanografiados */
.h-pag { flex: none; font-size: 13px; font-weight: 700; letter-spacing: .1em; white-space: nowrap; }
.h-linea { align-self: center; flex: 1; overflow: hidden; white-space: nowrap; opacity: .45; }
.h-sigue { display: flex; align-items: center; gap: 10px; }
.h-sigue .h-caja { width: 118px; height: 84px; }
.h-fin { max-width: 600px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-align: right; }

/* ---------- Dibujos en tinta ---------- */
.hoja .dib { color: var(--tinta); overflow: visible; }
.hoja .dib .d-l { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.hoja .dib .d-fino { stroke-width: 1.3; }
.hoja .dib .d-grueso { stroke-width: 5; }
.hoja .dib .d-tenue { opacity: .5; }
.hoja .dib .d-f { fill: rgba(40, 44, 50, .06); stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.hoja .dib .d-txt { fill: currentColor; font-family: "Courier Prime", "Courier New", Courier, "JetBrains Mono", monospace; font-weight: 700; stroke: none; }
.hoja .dib .d-txt-grande { font-size: 26px; }
.hoja .dib .d-carton { fill: rgba(150, 118, 64, .2); stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.hoja .dib .d-carton-pliegue { fill: rgba(0, 0, 0, .18); stroke: currentColor; stroke-width: 1.4; }
.hoja .dib .d-calcetin { fill: rgba(0, 0, 0, .07); stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.hoja .dib .d-calcetin-r { fill: none; stroke: currentColor; stroke-width: 1.1; opacity: .5; }
.hoja .dib .d-calcetin-puno { fill: rgba(0, 0, 0, .22); stroke: currentColor; stroke-width: 1.4; }
.hoja .dib .d-papel { fill: #fff; stroke: currentColor; stroke-width: 2; }
.hoja .dib .d-bolsa { fill: rgba(0, 0, 0, .03); stroke: currentColor; stroke-width: 2; stroke-dasharray: 8 4; stroke-linejoin: round; }
.hoja .dib .d-bolsa-arruga { fill: none; stroke: currentColor; stroke-width: 1.2; opacity: .45; }
.hoja .dib .d-bolsa-boca { fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linejoin: round; }
.hoja .dib .d-cinta { fill: rgba(0, 0, 0, .34); stroke: currentColor; stroke-width: 1.3; }
.hoja .dib .d-cinta-trazo { stroke: rgba(0, 0, 0, .6); stroke-width: 6; }
.hoja .dib .d-cinta-negra { fill: #1c1f24; stroke: #1c1f24; }
.hoja .dib .d-hueco { fill: var(--papel); stroke: currentColor; stroke-width: 1.6; }
.hoja .dib .d-manguera { fill: none; stroke: currentColor; stroke-width: 9; stroke-linecap: round; }
.hoja .dib .d-manguera-r { fill: none; stroke: var(--papel); stroke-width: 6; stroke-dasharray: 2.2 1.5; }
.hoja .dib .d-manguera-g { stroke-width: 22; }
.hoja .dib .d-manguera-r.d-manguera-g { stroke-width: 16; stroke-dasharray: 5 3; }
.hoja .dib .d-manguera-dentro { stroke: currentColor; stroke-width: 14; stroke-linecap: round; opacity: .2; }
.hoja .dib .d-marca { stroke: currentColor; stroke-width: 2; }
.hoja .dib .d-marca-sel { stroke: currentColor; stroke-width: 6; }
.hoja .dib .d-cara { fill: var(--papel); stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; }
.hoja .dib .d-cara-t { fill: rgba(0, 0, 0, .025); }
.hoja .dib .d-cara-l { fill: rgba(0, 0, 0, .06); }
.hoja .dib .d-cara-r { fill: rgba(0, 0, 0, .11); }
.hoja .dib .d-flecha-v { fill: rgba(0, 0, 0, .1); stroke: currentColor; stroke-width: 2.2; }
.hoja .dib .d-flecha-r { fill: currentColor; stroke: currentColor; stroke-width: 1; }
.hoja .dib .d-rejilla { fill: currentColor; opacity: .6; }
.hoja .dib .d-metal { fill: rgba(0, 0, 0, .08); stroke: currentColor; stroke-width: 2; }
.hoja .dib .d-pelo { fill: none; stroke: currentColor; stroke-width: 1.3; }
.hoja .dib .d-corte { fill: currentColor; }
.hoja .dib .d-corte-linea { fill: none; stroke: currentColor; stroke-width: 3; stroke-dasharray: 12 7; }
.hoja .dib .d-cota { fill: none; stroke: currentColor; stroke-width: 1.6; }
.hoja .dib .d-flujo { fill: none; stroke: currentColor; stroke-width: 3; stroke-dasharray: 3 10; stroke-linecap: round; }
.hoja .dib .d-leader { fill: none; stroke: currentColor; stroke-width: 1.8; }
.hoja .dib .d-punta { fill: currentColor; }
.hoja .dib .d-nota { fill: currentColor; font: 700 21px "Courier Prime", "Courier New", Courier, "JetBrains Mono", monospace; letter-spacing: .02em; }
.hoja .dib .d-dato { text-decoration: underline; }
.hoja .dib .d-no { opacity: .8; font-size: 18px; }
.hoja .dib .d-resalte { fill: rgba(0, 0, 0, .3); }
.hoja .dib .d-marcador { fill: none; stroke: currentColor; stroke-width: 4; }
