@layer ficha {

@scope (.cos-ficha) {
:scope { --realce: var(--il-verd-fosc); --realce-clar: var(--il-herba); }
.pg { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 5mm; }
.pg-a { grid-template-rows: minmax(0, 1fr) minmax(0, 1.05fr); }
.pg-b { grid-template-rows: minmax(0, 1.05fr) minmax(0, 1.2fr) minmax(0, .85fr); }
.pg .ex { height: 100%; }
.pg .ex-cos { display: grid; min-height: 0; }


.prestatges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 4mm 5mm; min-height: 0; }
.prestatge { display: grid; grid-template-columns: 1fr 1.3fr 1fr; align-items: end; gap: 2mm; padding: 0 2mm; border-bottom: 5px solid var(--il-marro); background: var(--il-sorra); border-radius: 4px 4px 0 0; }
.llibre { display: grid; place-items: center; height: 82%; font-size: var(--t-xl); font-weight: 800; line-height: 1; background: var(--realce-clar); border: 2px solid var(--tinta); border-radius: 3px 3px 0 0; }
.llibre.alt { height: 94%; }
.prestatge .r.caixa { align-self: center; width: 100%; height: 12mm; padding: 0; line-height: 1; font-size: var(--t-xl); border-color: var(--realce); }


.escales { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6mm; min-height: 0; padding: 0 4mm; }
.escala {
  position: relative; display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); align-items: center; justify-items: stretch; padding: 0 4.5mm; min-height: 0;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 8mm, var(--il-marro) 8mm, var(--il-marro) 9.6mm); background-clip: content-box;
}
.muntant { position: absolute; top: 0; bottom: 0; width: 3mm; background: var(--il-vermell); border: 2px solid var(--tinta); border-radius: 2px; }
.muntant.esq { left: 0; }
.muntant.dre { right: 0; }
.graons { position: relative; z-index: 1; display: grid; place-items: center; width: 100%; height: 13mm; font-size: var(--t-xl); line-height: 1; background: var(--paper); border: 2px solid var(--tinta); border-radius: 4px; }
.graons .r.caixa { width: 100%; height: 100%; padding: 0; border: 0; line-height: 1; font-size: var(--t-xl); background: transparent; }
.graons.g2 { display: block; border-color: var(--realce); border-style: dashed; }


.caixes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 3mm; min-height: 0; }
.caixa-n { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: repeat(2, auto); align-content: center; align-items: center; gap: 1.5mm 4mm; padding: 2mm 4mm; background: var(--realce-clar); border: 2px solid var(--realce); border-radius: var(--radi); }
.gran-n { grid-row: 1 / 3; font-size: var(--t-xxl); font-weight: 800; line-height: 1; }


.carrers { display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 4mm; min-height: 0; }
.carrer { display: grid; grid-template-columns: 28mm minmax(0, 1fr); gap: 3mm; align-items: stretch; min-height: 0; border-bottom: 4px solid var(--tinta-suau); }
.rotul-parada { align-self: center; display: grid; place-items: center; text-align: center; padding: 2mm; line-height: 1.1; background: var(--il-groc); border: 2px solid var(--tinta); border-radius: 50% / 40%; font-weight: 700; }
.rotul-parada b { font-size: var(--t-xl); }
.cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4mm; align-items: end; min-height: 0; }
.casa { display: grid; grid-template-rows: 5mm minmax(0, 1fr) auto; justify-items: center; align-items: center; gap: 1mm; height: 100%; min-height: 0; }
.teulada { width: 100%; height: 100%; background: var(--il-vermell); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.paret { display: grid; place-items: center; width: 88%; height: 100%; font-size: var(--t-xl); font-weight: 800; line-height: 1; background: var(--il-sorra); border: 2px solid var(--tinta); }
.casa .tria { padding-bottom: 1mm; }


.files { display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 3mm; min-height: 0; }
.fila-entre { display: grid; grid-template-columns: 34mm minmax(0, 1fr); gap: 3mm; align-items: stretch; min-height: 0; }
.parell { align-self: center; display: flex; align-items: center; justify-content: center; gap: 2mm; padding: 2mm; font-size: var(--t-l); font-weight: 800; line-height: 1.1; background: var(--realce-clar); border: 2px solid var(--realce); border-radius: var(--radi); }
.parell i { font-style: normal; font-weight: 600; font-size: var(--t-s); }
.fila-entre .espai-obert { height: 100%; }

}
}
