@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, 1fr) minmax(0, 1fr); }
.p2 { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
.e1 .ex-cos, .e4 .ex-cos { grid-template-rows: minmax(0, 1fr) auto; }
.e2 .ex-cos, .e3 .ex-cos { grid-template-rows: minmax(0, 1fr); }
.xecs { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5mm; }
.xec { display: grid; gap: .5mm; padding: 1.5mm 3mm; border: var(--gruix) solid var(--tinta); border-radius: 6px; background: var(--paper); font-size: var(--t-xs); line-height: 1.2; }
.xec em { font-size: var(--t-m); font-weight: 800; font-style: normal; text-decoration: underline dotted; }
.imp { display: flex; align-items: center; justify-content: flex-end; gap: 1.5mm; font-size: var(--t-m); font-weight: 800; }
.imp .r { width: 2.2em; background: var(--acento-suau); }
.imp .r.caixa { height: 1.4em; }
.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); gap: 5mm; min-height: 0; }
.rebuts { display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 2.5mm; min-height: 0; }
.rebut { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 2mm; padding: 1mm 3mm; border: 2px dashed var(--tinta); border-radius: 4px; background: var(--paper); font-size: var(--t-s); font-weight: 700; min-height: 0; }
.rebut b { font-size: var(--t-l); }
.rebut .r { width: 100%; font-size: var(--t-s); background: var(--acento-suau); }
.rebut .r.caixa { height: 1.5em; }
.imports { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 3mm; min-height: 0; }
.import { display: grid; grid-template-rows: auto 1fr; justify-items: center; align-content: center; gap: 1mm; padding: 2mm; border: var(--gruix) solid var(--acento); border-radius: var(--radi); background: var(--acento-suau); min-height: 0; }
.visor { display: flex; gap: 3mm; padding: 1.5mm 3mm; background: var(--tinta); border-radius: 6px; }
.dig { position: relative; display: block; width: 7mm; height: 12mm; }
.sg { position: absolute; display: block; background: var(--il-gris); opacity: .1; }
.sg.on { background: var(--paper); opacity: 1; }
.sg.a { left: 12%; right: 12%; top: 0; height: 11%; }
.sg.d { left: 12%; right: 12%; bottom: 0; height: 11%; }
.sg.g { left: 12%; right: 12%; top: 44.5%; height: 11%; }
.sg.f { left: 0; top: 6%; bottom: 53%; width: 22%; }
.sg.b { right: 0; top: 6%; bottom: 53%; width: 22%; }
.sg.e { left: 0; top: 53%; bottom: 6%; width: 22%; }
.sg.c { right: 0; top: 53%; bottom: 6%; width: 22%; }
.opcs { display: grid; gap: 0; font-size: var(--t-xs); font-weight: 700; line-height: 1.2; }
.cartells { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 17mm; gap: 3mm; }
button.cr { display: grid; align-content: center; justify-items: center; gap: 0; border: var(--gruix) solid var(--linia); background: var(--paper); border-radius: 8px; line-height: 1.1; padding: 1mm; }
button.cr b { font-size: var(--t-l); }
button.cr span { font-size: var(--t-s); font-weight: 700; }
button.cr.on { background: var(--acento); color: var(--paper); border-color: var(--acento); }

}
}
