@layer ficha {

@scope (.cos-ficha) {

.pg { height: 100%; display: grid; gap: 5mm; }
.ex-cos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3mm; min-height: 0; }
.im { position: relative; min-width: 0; min-height: 0; }
.im > .img, .im > .img-ph { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; }
.frase { background: var(--acento-suau); border: var(--gruix) solid var(--acento); border-radius: var(--radi); display: flex; align-items: center; justify-content: center; gap: 2mm; font-size: var(--t-l); font-weight: 700; height: 14mm; }
.frase .r { width: 1.8em; background: var(--paper); }
.frase .r.caixa { height: 1.5em; }
.capa > .im { position: absolute; inset: 0; }
.fit .r.caixa { height: 100%; min-height: 0; max-height: 100%; box-sizing: border-box; line-height: 1; padding: 0; width: 100%; }
.caixa-g { display: grid; gap: 3mm; padding: 2mm; border: var(--gruix) dashed var(--acento); border-radius: var(--radi); min-height: 0; }
button.marca { box-sizing: border-box; position: relative; padding: 0; border-radius: var(--radi); border-color: transparent; background: none; }
button.marca .im { position: absolute; inset: 0; }
button.creu.on { background: var(--acento-suau); border-color: var(--acento); }
button.creu.on::after { content: "✕"; position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--t-gegant); font-weight: 800; color: var(--acento); }
button.cerc.on { background: var(--acento-suau); border-color: var(--acento); border-style: dashed; }
.arrossega { box-sizing: border-box; }
.zona { box-sizing: border-box; }

.p1 { grid-template-rows: minmax(0, 1.15fr) minmax(0, 1fr); }
.p2 { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
.e1 .ex-cos { grid-template-rows: minmax(0, 1fr) auto; }
.e2 .ex-cos, .e3 .ex-cos, .e4 .ex-cos { grid-template-rows: minmax(0, 1fr); }
.lateral { display: grid; grid-template-columns: minmax(0, 1fr) 38mm; gap: 5mm; min-height: 0; }
.lateral2 { display: grid; grid-template-columns: 38mm minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 3mm 5mm; min-height: 0; }
.lateral2 > .im { grid-row: span 2; }
.lateral2 > .banc { grid-column: 2; }
.cases, .cases2, .sensetet { display: grid; gap: 4mm; min-height: 0; }
.cases { grid-template-columns: repeat(3, 1fr); }
.cases2 { grid-template-columns: repeat(3, 1fr); }
.sensetet { grid-template-columns: repeat(4, 1fr); grid-column: 2; grid-row: 1 / span 2; }
.casa { display: grid; grid-auto-rows: 10mm; gap: 1mm; border: var(--gruix) solid var(--acento); border-radius: 4px; background: var(--acento-suau); padding-bottom: 1.5mm; min-height: 0; align-content: start; }
.casa.gran { grid-auto-rows: minmax(0, 1fr); grid-template-rows: auto repeat(4, minmax(0, 1fr)); }
.cases2 .casa { grid-template-rows: 10mm repeat(4, minmax(0, 1fr)); grid-auto-rows: auto; align-content: stretch; }
.cases2 button.ps { height: auto; min-height: 0; }
.teulat { display: grid; place-items: center; height: 10mm; background: var(--acento); color: var(--paper); border-radius: 3px 3px 0 0; font-size: var(--t-xl); font-weight: 800; }
.teulat b { line-height: 1; }
.teulat.buit { background: var(--paper); border-bottom: var(--gruix) solid var(--acento); }
.teulat.buit .r { width: 2em; height: 8mm; font-size: 18px; background: var(--acento-suau); }
.pis { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1mm; padding: 0 2mm; }
.pis span { font-weight: 800; }
.fin { display: grid; place-items: center; height: 8mm; border: var(--gruix) solid var(--tinta); border-radius: 3px; background: var(--paper); font-size: var(--t-m); font-weight: 800; }
.fin .r { width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; line-height: 1; font-size: var(--t-m); background: var(--acento-suau); }
.fin .zona.fz { width: 100%; height: 100%; min-width: 0; min-height: 0; padding: 0; border: 0; }
.xips { justify-content: space-around; }
.xips .arrossega, .fz .arrossega { font-size: var(--t-m); min-height: 0; height: 6.5mm; padding: 0 .6rem; }
button.ps { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: 0 2mm; height: 9mm; border: var(--gruix) solid var(--linia); background: var(--paper); border-radius: 3px; font-size: var(--t-m); line-height: 1; }
button.ps i { font-style: normal; font-weight: 800; }
button.ps.on { background: var(--acento); color: var(--paper); border-color: var(--acento); }

}
}
