/* Estilos de la HOJA (lo que se imprime). Se usa igual en pantalla, en la impresión, en el PDF y en la imagen. Todo en mm y pt. */
.mh-page, .mh-page * { box-sizing: border-box; margin: 0; padding: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.mh-page { position: relative; overflow: hidden; background: #fff; color: var(--ink); font-family: var(--body); line-height: 1.25; text-align: left; letter-spacing: normal; word-spacing: normal; }
.mh-bg, .mh-pat, .mh-bgimg { position: absolute; inset: 0; pointer-events: none; }
.mh-bgimg { background-size: cover; background-position: center; }
.mh-page b { font-weight: 700; }

/* Encabezado */
.mh-head { position: absolute; display: flex; align-items: center; gap: 4mm; font-family: var(--title); color: var(--ink); overflow: hidden; }
.mh-head .mh-title { font-weight: 800; line-height: 1.04; white-space: nowrap; }
.mh-head .mh-sub { font-family: var(--body); line-height: 1.15; opacity: .85; white-space: nowrap; }
.mh-head .mh-intro { font-family: var(--body); flex: 1; min-width: 0; height: 100%; overflow: hidden; display: flex; align-items: center; }
.mh-head .mh-intro { text-align: left; }
.mh-head .mh-intro > div { width: 100%; max-height: 100%; overflow: hidden; line-height: 1.22; }
.mh-head .mh-tt { display: flex; flex-direction: column; gap: .4mm; min-width: 0; }
.mh-h-linea { justify-content: center; text-align: center; }
.mh-h-linea .mh-tt { align-items: center; }
.mh-h-linea .mh-rule { flex: 1; min-width: 6mm; height: 0; border-top: .5mm solid var(--accent); position: relative; }
.mh-h-linea .mh-rule::after { content: ''; position: absolute; left: 0; right: 0; top: .6mm; border-top: .2mm solid var(--accent); }
.mh-h-linea.mh-hasintro .mh-tt { align-items: flex-start; text-align: left; }
.mh-h-linea.mh-hasintro { border-bottom: .5mm solid var(--accent); }
.mh-h-banda { background: var(--accent); color: var(--on); padding: 0 4mm; border-radius: 1.2mm; justify-content: space-between; }
.mh-h-banda:not(.mh-hasintro) .mh-tt { flex-direction: row; align-items: baseline; gap: 4mm; }
.mh-h-cinta { justify-content: center; }
.mh-h-cinta .mh-tt { background: var(--accent); color: var(--on); padding: 1mm 9mm; clip-path: polygon(0 0, 100% 0, calc(100% - 4mm) 50%, 100% 100%, 0 100%, 4mm 50%); align-items: center; text-align: center; justify-content: center; max-height: 100%; }
.mh-h-izquierda { border-bottom: .4mm solid var(--accent); justify-content: space-between; }
.mh-h-izquierda .mh-title { color: var(--accent); }
.mh-h-izquierda .mh-tt { flex-direction: row; align-items: baseline; gap: 4mm; }
.mh-h-izquierda.mh-hasintro .mh-tt { flex-direction: column; align-items: flex-start; gap: .4mm; }
.mh-h-bloque { background: var(--panel); color: var(--pink); border-radius: 2mm; padding-right: 4mm; }
.mh-h-bloque .mh-blk { align-self: stretch; aspect-ratio: 1; max-width: 22mm; background: var(--accent); color: var(--on); display: flex; align-items: center; justify-content: center; font-weight: 800; border-radius: 2mm 0 0 2mm; }

/* Celdas */
.mh-cell { position: absolute; }
.mh-front { display: flex; flex-direction: column; }
.mh-pic { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; background: color-mix(in srgb, var(--panel) 80%, var(--accent) 6%); }
.mh-pic > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; max-width: none; }
.mh-cap { flex: none; text-align: center; font-family: var(--cap, var(--body)); line-height: 1.12; padding: .7mm 1mm 0; color: var(--ink); }
.mh-cap:empty { display: none; }
.mh-upper { text-transform: uppercase; }
.mh-num { position: absolute; left: 1mm; top: 1mm; z-index: 3; width: 5mm; height: 5mm; border-radius: 50%; background: var(--accent); color: var(--on); font: 700 7.5pt/5mm var(--title); text-align: center; border: .35mm solid #fff; box-sizing: content-box; }

/* Marcos */
.mh-f-recto .mh-pic { border: var(--fw) solid var(--fc); }
.mh-f-redondeado .mh-pic { border: var(--fw) solid var(--fc); border-radius: 3mm; }
.mh-f-foto .mh-pic { border: 1.3mm solid #fff; outline: .2mm solid rgba(15, 23, 42, .22); outline-offset: -.1mm; }
.mh-f-doble .mh-pic { border: calc(var(--fw) + .9mm) double var(--fc); }
.mh-f-marco .mh-pic { border: calc(var(--fw) + .6mm) solid var(--fc); outline: .25mm solid #fff; outline-offset: -1.7mm; }
.mh-f-medallon .mh-pic { border-radius: 50%; border: calc(var(--fw) + .2mm) solid var(--fc); }
.mh-f-corte .mh-pic { clip-path: polygon(3mm 0, 100% 0, 100% calc(100% - 3mm), calc(100% - 3mm) 100%, 0 100%, 0 3mm); }
.mh-f-hoja .mh-pic { border-radius: 8mm 1mm 8mm 1mm; border: var(--fw) solid var(--fc); }
.mh-f-arco .mh-pic { border-radius: 14mm 14mm 1mm 1mm; border: var(--fw) solid var(--fc); }

/* Rótulos */
.mh-c-banda .mh-cap { background: var(--accent); color: var(--on); padding: .9mm 1.2mm; }
.mh-c-banda.mh-f-redondeado .mh-pic { border-radius: 3mm 3mm 0 0; }
.mh-c-banda.mh-f-redondeado .mh-cap { border-radius: 0 0 3mm 3mm; }
.mh-c-arriba { flex-direction: column-reverse; }
.mh-c-arriba .mh-cap { background: var(--accent); color: var(--on); padding: .9mm 1.2mm; }
.mh-c-sobre .mh-cap { position: absolute; left: 0; right: 0; bottom: 0; color: #fff; padding: 5mm 2mm 1.4mm; background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, .45) 55%, transparent); z-index: 2; }
.mh-c-sobre.mh-f-redondeado .mh-cap { border-radius: 0 0 3mm 3mm; }
.mh-c-sobre.mh-f-foto .mh-cap { left: 1.3mm; right: 1.3mm; bottom: 1.3mm; }
.mh-c-etiqueta .mh-cap { align-self: center; max-width: 94%; margin-top: -2.6mm; position: relative; z-index: 2; background: var(--accent); color: var(--on); padding: .7mm 3mm; border-radius: 5mm; border: .35mm solid #fff; }
.mh-c-ninguno .mh-cap { display: none; }

/* Textos (reverso) */
.mh-back { display: flex; flex-direction: column; overflow: hidden; color: var(--ink); }
.mh-tit { flex: none; font-family: var(--cap, var(--body)); font-weight: 700; text-align: center; line-height: 1.12; padding-bottom: .9mm; }
.mh-body { flex: 1 1 0; min-height: 0; overflow: hidden; line-height: 1.24; hyphens: manual; -webkit-hyphens: manual; overflow-wrap: break-word; }
.mh-just { text-align: justify; }
.mh-b-tarjeta { background: var(--panel); color: var(--pink); border-radius: 2.4mm; padding: 1.8mm 2.2mm; }
.mh-b-linea { border: .3mm solid var(--accent); padding: 1.5mm 2mm; }
.mh-b-titulo { background: var(--panel); color: var(--pink); border-radius: 2mm; }
.mh-b-titulo .mh-tit { background: var(--accent); color: var(--on); padding: .9mm 1.5mm; }
.mh-b-titulo .mh-body { margin: 1.2mm 2mm 1.4mm; }
.mh-b-limpio { padding: .3mm .6mm; }
.mh-b-subrayado .mh-tit { text-align: left; border-bottom: .35mm solid var(--accent); color: var(--accent); margin-bottom: .8mm; }
.mh-b-subrayado { padding: .6mm 1mm; }

/* Una cara: imagen + texto juntos */
.mh-one { display: flex; flex-direction: column; overflow: hidden; }
.mh-one.mh-row { flex-direction: row; }
.mh-one .mh-onepic { display: flex; flex-direction: column; position: relative; min-width: 0; min-height: 0; flex: 0 0 var(--share); }
.mh-one .mh-onetxt { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; min-height: 0; padding: 1.2mm 1.6mm 1mm; }
.mh-one.mh-b-tarjeta { padding: 0; }
.mh-one.mh-b-linea { padding: 0; }
.mh-one.mh-b-titulo .mh-tit { margin: -1.2mm -1.6mm 0; }
.mh-one.mh-b-titulo .mh-body { margin: 1mm 0 0; }

/* Pie */
.mh-foot { position: absolute; display: flex; align-items: center; gap: 4mm; font-family: var(--body); color: var(--ink); overflow: hidden; }
.mh-facts { flex: 1; min-width: 0; height: 100%; display: flex; gap: 3mm; align-items: stretch; background: var(--panel); color: var(--pink); border-radius: 1.6mm; padding: .9mm 2.5mm; overflow: hidden; }
.mh-facts > strong { flex: none; align-self: center; font-family: var(--title); font-weight: 800; color: var(--accent); line-height: 1.05; }
.mh-facts > div { flex: 1; min-width: 0; align-self: center; line-height: 1.15; }
.mh-src { font-size: 4.6pt; line-height: 1.15; opacity: .72; min-width: 0; flex: 1; max-height: 100%; overflow: hidden; }
.mh-alumno { flex: 1; display: flex; gap: 2mm; font-size: 7.5pt; align-items: flex-end; min-width: 0; white-space: nowrap; }
.mh-alumno i { flex: 1; border-bottom: .25mm solid currentColor; font-style: normal; opacity: .6; }
.mh-alumno i.s { flex: 0 0 18%; }
.mh-brand { flex: none; display: inline-flex; align-items: center; gap: 1.6mm; max-width: 100%; white-space: nowrap; line-height: 1.1; }
.mh-brand img { max-height: 100%; width: auto; display: block; object-fit: contain; }
.mh-brand span { display: flex; flex-direction: column; }
.mh-brand b { font-family: var(--title); font-weight: 800; }
.mh-brand small { font-size: .72em; opacity: .85; }
.mh-br-placa { background: var(--bc); color: var(--bon); padding: .6mm 3mm; border-radius: 5mm; }
.mh-br-sello { border: .35mm solid var(--bc); color: var(--bc); padding: .5mm 2.4mm; border-radius: 1mm; }
.mh-br-simple { color: var(--bc); }
.mh-wm { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; font-family: var(--title); font-weight: 800; text-align: center; line-height: 1; color: var(--ink); z-index: 1; }
.mh-cut { position: absolute; border: .2mm dashed rgba(0, 0, 0, .55); pointer-events: none; z-index: 4; }
