/* ==========================================================================
   La scheda del mecha da stampare (SchedaStampabile). Un foglio di 1000×1000 px che in stampa
   si riduce a stare su un A4 verticale. Tre versioni: a colori (lo stile del gioco), risparmio
   colori (grigi su bianco) e solo nero (inchiostro nero, niente campiture).
   Il modello grafico è lo screenshot di riferimento dell'utente (ottobre 2026): riquadri a spigoli
   smussati con il filo che segue anche lo smusso, sotto-riquadri separati per ogni gruppo di
   valori, intestazioni azzurre col «///», titolo in Bebas Neue, numeri in Rajdhani.
   ========================================================================== */

.stampa-pagina { min-height: 100vh; background: #05080d; color: #e6edf6; font-family: 'Rajdhani', 'Inter', 'Segoe UI', sans-serif; }

.sch-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; padding: 0.7rem 1rem; background: rgba(8, 12, 18, 0.95); border-bottom: 1px solid #1f3247; }
.sch-bar a { color: #9fb0c8; text-decoration: none; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8rem; }
.sch-modes { display: flex; gap: 0.3rem; }
.sch-modes button, .sch-print { padding: 0.45rem 0.9rem; border-radius: 999px; border: 1px solid #2b4560; background: transparent; color: #c4cfe0; font: 700 0.75rem/1 Rajdhani, sans-serif; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
.sch-modes button.on { background: #4fa3ff; border-color: #4fa3ff; color: #05080d; }
.sch-print { background: #f5a623; border-color: #f5a623; color: #05080d; }
.sch-bar small { color: #6f7c90; font-size: 0.75rem; flex: 1 1 260px; }
.sch-missing { padding: 3rem; text-align: center; }

.sch-foglio { display: grid; place-items: start center; padding: 1.2rem; overflow-x: auto; }

/* Su schermi stretti il foglio da 1000 px si riduce per stare intero nella larghezza, invece di
   scorrere di lato: --sch-zoom lo calcola js/language.js dalla larghezza della finestra. Il foglio
   resta quello vero, quindi si può ancora ingrandire col pizzico. */
@media screen and (max-width: 1040px) {
    .sch-foglio { padding: 8px; overflow-x: hidden; }
    .sch { zoom: var(--sch-zoom, 0.35); }
    .sch-bar { gap: 0.5rem; padding: 0.55rem 0.7rem; }
}

/* ---------- il foglio ---------- */
.sch {
    --bg: #08111b; --panel: #0b1622; --panel2: #0e1b29; --line: #17304a; --edge: #1f3d5c; --line2: #2b4f75;
    --text: #e8eef7; --muted: #7f93ad; --label: #6f8db0; --head: #3d8bff; --head-t: #5aa9ff;
    --gold: #f5a623; --en: #4fa3ff;
    --c-Head: #3d8bff; --c-Armament: #ff8a2a; --c-Thrusters: #9d6bff; --c-Locomotion: #22c3a0;
    position: relative; width: 1000px; min-height: 1000px; padding: 20px 22px; box-sizing: border-box;
    background: radial-gradient(ellipse 60% 40% at 50% 32%, rgba(61, 139, 255, 0.07), transparent 70%), var(--bg);
    color: var(--text); border: 1px solid var(--edge); font: 600 13px/1.28 Rajdhani, 'Segoe UI', sans-serif;
}
.sch * { box-sizing: border-box; }
.sch small { color: var(--label); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.sch .gold { color: var(--gold); }
.sch .en { color: var(--en); }
.sch p { margin: 0; }

/* Il riquadro smussato: lo smusso è un clip-path, e il filo lo segue perché è il FONDO dell'elemento
   (colore --edge) e il pieno è uno strato sopra rientrato di un pixel con lo stesso taglio. Con un
   border normale il clip-path tagliava via il filo proprio sulle diagonali. */
.sch-panel, .sch-box, .sch-sub {
    --cut: 12px; --fill: var(--panel); --e: var(--edge);
    position: relative; isolation: isolate; background: var(--e);
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.sch-panel::before, .sch-box::before, .sch-sub::before {
    content: ""; position: absolute; inset: 1px; z-index: -1; background: var(--fill);
    clip-path: polygon(0 0, calc(100% - var(--cut) + 0.6px) 0, 100% calc(var(--cut) - 0.6px), 100% 100%, calc(var(--cut) - 0.6px) 100%, 0 calc(100% - var(--cut) + 0.6px));
}
.sch-sub { --cut: 7px; --fill: var(--panel2); --e: var(--line); }
/* La testata ha lo smusso sugli altri due spigoli, come nel riferimento. */
.sch-box { --cut: 14px; --fill: var(--panel); clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.sch-box::before { clip-path: polygon(calc(var(--cut) - 0.6px) 0, 100% 0, 100% calc(100% - var(--cut) + 0.6px), calc(100% - var(--cut) + 0.6px) 100%, 0 100%, 0 calc(var(--cut) - 0.6px)); }

/* ---------- testata ---------- */
.sch-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: stretch; margin-bottom: 14px; }
.sch-title { min-width: 0; container-type: inline-size; }
.sch-title small { display: block; color: var(--text); letter-spacing: 0.1em; font-size: 11px; }
.sch-title small.acc { color: var(--gold); }
.sch-title h1 { margin: 3px 0 0; font: 400 64px/0.9 'Bebas Neue', 'Rajdhani', sans-serif;
    /* Il nome sta sempre in una riga: 64 px se c'è posto, se no quanto ne dà la colonna. --n è il
       numero di lettere (lo mette la pagina) e una lettera di Bebas Neue è circa 0,39 em. */
    font-size: min(64px, calc(100cqw / (var(--n) * 0.44))); letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-title p { margin-top: 5px; font: 600 20px/1 Rajdhani, sans-serif; letter-spacing: 0.2em; color: #c8d3e2; text-transform: uppercase; }
.sch-title p b { color: var(--gold); }
.sch-title p span { color: var(--head-t); }
.sch-id { display: flex; align-items: center; gap: 0; padding: 0; }
.sch-id-txt { display: grid; gap: 5px; padding: 12px 16px; }
.sch-id b { font: 700 22px/1 Rajdhani, sans-serif; letter-spacing: 0.05em; }
.sch-barcode { display: flex; gap: 2px; height: 18px; margin-top: 3px; }
.sch-barcode i { display: block; background: #4d6582; }
.sch-emblem { display: grid; place-items: center; align-self: stretch; width: 78px; border-left: 1px solid var(--line); color: var(--gold); }
.sch-emblem-mask { width: 54px; height: 54px; background: currentColor; -webkit-mask: var(--emb) center / contain no-repeat; mask: var(--emb) center / contain no-repeat; }
.sch-totals { display: flex; padding: 0; }
.sch-totals > div { position: relative; display: grid; align-content: center; gap: 3px; padding: 12px 14px; }
.sch-totals > div + div { border-left: 1px solid var(--line); }
.sch-totals b { font: 700 28px/1 Rajdhani, sans-serif; white-space: nowrap; }
.sch-totals b.fit1 { font-size: 25px; }
.sch-totals b.fit2 { font-size: 21px; }
.sch-totals em { font-style: normal; color: var(--label); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.sch-tot-en { padding-right: 40px !important; }
.sch-bolt { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--en); font-size: 26px; }

/* ---------- griglia ---------- */
.sch-grid { display: grid; grid-template-columns: 262px minmax(0, 1fr) 352px; gap: 12px; align-items: stretch; }
/* Le tre colonne finiscono alla stessa altezza: l'ultimo riquadro di ognuna si allunga fino in fondo. */
.sch-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sch-col > .sch-panel:last-of-type { flex: 1 1 auto; }
.sch-panel { padding: 10px 12px 12px; }
.sch-panel h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
    font: 500 13.5px/1 Rajdhani, sans-serif; letter-spacing: 0.1em; text-transform: uppercase; color: var(--head-t); }
.sch-panel h2::before { content: "///"; color: var(--head); font-weight: 700; font-style: italic; letter-spacing: -0.08em; }
.sch-panel h2 .sch-cost, .sch-panel h2 .sch-count { margin-left: auto; color: var(--label); font-size: 11px; letter-spacing: 0.04em; white-space: nowrap; }
.sch-cost b { color: var(--head-t); }

/* La filigrana: l'emblema dietro il pilota e dietro il mecha. */
.sch-wm { position: absolute; inset: 10% 8%; z-index: 0; background: var(--head); opacity: 0.09; pointer-events: none;
    -webkit-mask: var(--emb) center / contain no-repeat; mask: var(--emb) center / contain no-repeat; }

/* ---------- pilota ---------- */
.sch-pilot { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; }
.sch-portrait { position: relative; display: grid; place-items: center; height: 150px; overflow: hidden; border: 1px solid var(--line2); border-radius: 6px;
    background: linear-gradient(rgba(61, 139, 255, 0.07) 1px, transparent 1px) 0 0 / 14px 14px, linear-gradient(90deg, rgba(61, 139, 255, 0.07) 1px, transparent 1px) 0 0 / 14px 14px, var(--panel2);
    box-shadow: 0 0 0 1px rgba(61, 139, 255, 0.15), 0 0 12px rgba(61, 139, 255, 0.15); }
.sch-portrait img, .sch-portrait svg { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.sch-pilot dl { margin: 0; display: grid; align-content: start; gap: 0; min-width: 0; }
.sch-pilot dt { color: var(--label); font-size: 10.5px; font-weight: 700; }
.sch-pilot dd { margin: 0 0 4px; font-size: 12.5px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.sch-pilot dl.fit1 dd { font-size: 11.5px; margin-bottom: 3px; }
.sch-pilot dl.fit2 dd { font-size: 10.5px; margin-bottom: 2px; }

/* ---------- panoramica ---------- */
.sch-overview { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; }
.sch-hex { position: relative; display: grid; place-items: center; width: 68px; height: 76px; color: var(--gold); }
.sch-hex svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 3; }
.sch-hex b { position: relative; font: 700 38px/1 Rajdhani, sans-serif; }
/* La lettera della classe riempie l'esagono, al centro: la regola .sch-overview b qui sotto la portava a 16px. */
.sch-overview .sch-hex b { display: grid; place-items: center; width: 100%; height: 100%; font: 700 50px/1 Rajdhani, sans-serif; padding-top: 3px; }
.sch-overview b { display: block; font: 700 16px/1.1 Rajdhani, sans-serif; text-transform: uppercase; overflow-wrap: anywhere; }
.sch-overview b.fit1 { font-size: 14px; }
.sch-overview b.fit2 { font-size: 12.5px; }
.sch-overview p { margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.sch-mini2 { display: grid; grid-template-columns: 1fr 1fr; margin-top: 8px; }
.sch-mini2 > div { display: grid; gap: 3px; padding: 8px 10px; text-align: center; min-width: 0; }
.sch-mini2 > div + div { border-left: 1px solid var(--line); }
.sch-mini2 small { color: var(--head-t); }
.sch-mini2 b { font: 700 19px/1 Rajdhani, sans-serif; white-space: nowrap; }
.sch-mini2 b.fit1 { font-size: 16px; }
.sch-mini2 b.fit2 { font-size: 14px; }
.sch-mini2 em { font-style: normal; color: var(--label); font-size: 10px; }

/* ---------- barre ---------- */
.sch-bars { display: grid; gap: 9px; padding: 12px 12px; }
.sch-barrow { display: grid; grid-template-columns: 78px minmax(0, 1fr) 38px; gap: 8px; align-items: center; font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.sch-barrow > span:first-child { color: var(--label); }
.sch-barrow b { text-align: right; font-size: 13.5px; }
.sch-meter { display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; }
.sch-meter i { height: 10px; background: #18324a; transform: skewX(-22deg); }
.sch-meter i.on { background: var(--c); }
.sch-foot { margin-top: 8px !important; color: var(--muted); font-size: 10px; }
.sch-brand { display: grid; gap: 3px; padding: 6px 6px 0; }
.sch-brand b { font: 700 12px/1 Rajdhani, sans-serif; letter-spacing: 0.14em; }

/* ---------- il mecha ---------- */
.sch-unit-art { --cut: 14px; position: relative; display: grid; place-items: center; height: 430px; overflow: hidden;
    border: 1px solid var(--line);
    clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%, 0 var(--cut));
    background: linear-gradient(rgba(61, 139, 255, 0.08) 1px, transparent 1px) 0 0 / 22px 22px,
                linear-gradient(90deg, rgba(61, 139, 255, 0.08) 1px, transparent 1px) 0 0 / 22px 22px, var(--panel2); }
.sch-unit-art .mvs, .sch-unit-art .silhouette { position: relative; z-index: 1; width: 100%; height: 100%; }
.sch-unit-art .mvs-stack { animation: none !important; }
.sch-corner { position: absolute; z-index: 2; bottom: 8px; color: var(--label); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; }
.sch-corner.l { left: 12px; }
.sch-corner.r { right: 12px; }
.sch-unit-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.sch-unit-stats > div { display: grid; gap: 3px; padding: 7px 8px; min-width: 0; }
.sch-unit-stats small { font-size: 9.5px; line-height: 1.1; min-height: 2.2em; }
.sch-unit-stats b { font: 700 18px/1 Rajdhani, sans-serif; }

/* ---------- valori di un pezzo ---------- */
.sch-cname { font: 500 16px/1.1 Rajdhani, sans-serif; color: var(--text); overflow-wrap: anywhere; }
.sch-cname.fit1 { font-size: 14px; }
.sch-cname.fit2 { font-size: 12.5px; }
.sch-core .sch-cname { margin-bottom: 8px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.sch-vals { display: grid; grid-template-columns: 52px 58px minmax(0, 1fr); gap: 5px; }
.sch-vals > div { display: grid; gap: 4px; padding: 5px 7px 6px; min-width: 0; }
.sch-vals b { font: 700 17px/1 Rajdhani, sans-serif; white-space: nowrap; }
.sch-vals b .isc { color: var(--head-t); }
.sch-armor b { display: flex; gap: 2px 7px; font-size: 14px; }
.sch-armor i { font-style: normal; white-space: nowrap; }
.sch-energy { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 6px; }
.sch-energy > div { display: grid; gap: 4px; padding: 6px 6px; text-align: center; min-width: 0; }
.sch-energy small { font-size: 9px; line-height: 1.1; letter-spacing: 0; white-space: nowrap; }
.sch-energy b { font: 700 15px/1 Rajdhani, sans-serif; white-space: nowrap; }
.sch-energy b .isc { color: var(--en); }

/* ---------- abilità ---------- */
.sch-skill-body { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: start; }
.sch-skill-ic { display: grid; place-items: center; width: 44px; height: 44px; color: var(--gold); font-size: 30px; }
.sch-skill b { color: var(--gold); }
.sch-skill p { margin-top: 4px; color: #9fb4cf; font-size: 12px; }
.sch-skill-body.fit1 p { font-size: 11px; }
.sch-skill-body.fit2 p { font-size: 10px; }
.sch-res { margin-top: 8px !important; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 11.5px; }

/* ---------- componenti ---------- */
.sch-comps { display: grid; align-content: start; gap: 8px; }
.sch-comps h2 { margin-bottom: 2px; }
.sch-comp { --k: var(--c-Head); --cut: 10px; --fill: var(--panel2); --e: var(--line);
    position: relative; isolation: isolate; display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px;
    padding: 7px 9px 8px 7px; background: var(--e);
    clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut)); }
.sch-comp::before { content: ""; position: absolute; inset: 1px; z-index: -1; background: var(--fill);
    clip-path: polygon(calc(var(--cut) - 0.6px) 0, calc(100% - var(--cut) + 0.6px) 0, 100% calc(var(--cut) - 0.6px), 100% 100%, calc(var(--cut) - 0.6px) 100%, 0 calc(100% - var(--cut) + 0.6px), 0 calc(var(--cut) - 0.6px)); }
/* La staffa colorata sull'angolo in alto a sinistra, come nel riferimento. */
/* La staffa colorata in alto a sinistra, come nel riferimento: sale lungo il bordo, segue lo smusso
   dell'angolo e prosegue un poco in orizzontale. È un tratto SVG usato come maschera. */
.sch-comp::after { content: ""; position: absolute; left: 0; top: 0; width: 36px; height: 50px; background: var(--k);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='50'%3E%3Cpath d='M1.5 50V11.5L11.5 1.5H36' fill='none' stroke='%23000' stroke-width='3'/%3E%3C/svg%3E") no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='50'%3E%3Cpath d='M1.5 50V11.5L11.5 1.5H36' fill='none' stroke='%23000' stroke-width='3'/%3E%3C/svg%3E") no-repeat; }
.sch-comp.k-Armament { --k: var(--c-Armament); }
.sch-comp.k-Thrusters { --k: var(--c-Thrusters); }
.sch-comp.k-Locomotion { --k: var(--c-Locomotion); }
/* L'immagine del pezzo: una colonna a tutta altezza, con la barra del colore dello slot a destra. */
.sch-comp-img { position: relative; display: grid; place-items: center; align-self: stretch; min-height: 96px; overflow: hidden;
    background: radial-gradient(circle at 50% 40%, rgba(61, 139, 255, 0.1), transparent 70%), #070d15; border-right: 4px solid var(--k); }
.sch-comp-img img.generic { width: 74%; opacity: 0.75; }
.sch-crop { position: relative; display: block; width: 100%; overflow: hidden; }
/* Nella colonna dei pezzi il ritaglio si ingrandisce un po' oltre i bordi: il pezzo riempie il riquadro come nel riferimento. */
.sch-comp-img .sch-crop { width: 128%; flex: none; }
.sch-crop img { position: absolute; left: var(--l); top: var(--t); width: var(--w); height: var(--h); }
.sch-comp-body { min-width: 0; }
.sch-comp-top { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; margin-bottom: 5px; }
.sch-comp-top > div { min-width: 0; }
.sch-slot { color: var(--k); font: 700 12px/1 Rajdhani, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; }
.sch-comp-top .sch-cost { flex: none; color: var(--label); font-size: 10px; font-weight: 700; text-transform: uppercase; white-space: nowrap; padding-top: 1px; }
.sch-comp .sch-cname { margin-top: 2px; font-size: 14.5px; }
.sch-comp .sch-cname.fit1 { font-size: 13px; }
.sch-comp .sch-cname.fit2 { font-size: 11.5px; }
.sch-comp .sch-vals { grid-template-columns: 46px 52px minmax(0, 1fr); gap: 4px; }
.sch-comp .sch-vals > div { padding: 4px 6px 5px; }
.sch-comp .sch-vals b { font-size: 14px; }
.sch-comp .sch-armor b { font-size: 12.5px; gap: 1px 5px; flex-wrap: nowrap; }
.sch-comp .sch-vals small { white-space: nowrap; font-size: 9.5px; }
.sch-weapons { display: grid; gap: 2px; margin-top: 5px; }
.sch-weapons > div { font-size: 11px; line-height: 1.3; overflow-wrap: anywhere; }
.sch-weapons b { color: var(--k); white-space: nowrap; }
.sch-weapons em { font-style: normal; color: var(--muted); font-size: 10px; }
.sch-wtags { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 7px; }
.sch-wtags i { display: inline-flex; align-items: center; gap: 3px; font-style: normal; white-space: nowrap; }
.sch .sch-wtags .isc { width: 17px; height: 17px; }
.sch .sch-weapons b .isc { width: 15px; height: 15px; vertical-align: -0.25em; }
/* Il cuore dell'HP totale è azzurro come le altre icone (la moneta resta oro, come il suo numero). */
.sch-mini2 b:not(.gold) .isc { color: var(--head-t); }
.sch-row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-top: 5px; padding-top: 4px; border-top: 1px solid var(--line); }
.sch-row b { color: var(--en); font-size: 11.5px; white-space: nowrap; }
.sch-eff { padding: 2px 0 0 8px; font-size: 11px; line-height: 1.25; color: var(--text); overflow-wrap: anywhere; }
.sch-notes p { color: #9fb4cf; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.sch-notes.fit1 p { font-size: 11px; }
.sch-notes.fit2 p { font-size: 10px; }

/* ---------- risparmio colori: grigi su bianco, niente campiture scure ---------- */
.sch.m-risparmio, .sch.m-nero {
    --bg: #fff; --panel: #fff; --panel2: #fff; --line: #9a9a9a; --edge: #777; --line2: #777; --text: #111; --muted: #555; --label: #555;
    --head: #555; --head-t: #333; --gold: #333; --en: #333;
    --c-Head: #777; --c-Armament: #777; --c-Thrusters: #777; --c-Locomotion: #777;
    background: #fff; border-color: #777;
}
.sch.m-risparmio img, .sch.m-risparmio .mvs, .sch.m-risparmio .silhouette { filter: grayscale(1) brightness(1.35) contrast(0.95); }
.sch.m-risparmio .sch-meter i { background: #e2e2e2; }
.sch.m-risparmio .sch-meter i.on { background: #777; }
.sch.m-risparmio .sch-comp-img, .sch.m-risparmio .sch-unit-art, .sch.m-risparmio .sch-portrait { background: #fff; box-shadow: none; }
.sch.m-risparmio .sch-barcode i { background: #777; }
.sch.m-risparmio .sch-title p, .sch.m-nero .sch-title p, .sch.m-risparmio .sch-skill p, .sch.m-nero .sch-skill p,
.sch.m-risparmio .sch-notes p, .sch.m-nero .sch-notes p { color: #333; }

/* ---------- solo nero: inchiostro nero, linee sottili, nessun riempimento ---------- */
.sch.m-nero { --line: #000; --edge: #000; --line2: #000; --muted: #000; --label: #000; --head: #000; --head-t: #000; --gold: #000; --en: #000;
    --c-Head: #000; --c-Armament: #000; --c-Thrusters: #000; --c-Locomotion: #000; }
/* Le immagini schiarite: i contorni restano, le campiture quasi spariscono (inchiostro risparmiato). */
.sch.m-nero img, .sch.m-nero .mvs, .sch.m-nero .silhouette { filter: grayscale(1) brightness(2.1) contrast(1.6); }
/* Il mecha e le sagome sono disegni chiari su fondo scuro: schiariti sparivano nel bianco. Si scuriscono
   invece, quanto basta perché il contorno si legga senza riempire di nero tutto il riquadro. */
.sch.m-nero .sch-unit-art .mvs, .sch.m-nero .silhouette, .sch.m-nero .sch-comp-img img { filter: grayscale(1) brightness(0.75) contrast(1.5); }
.sch.m-nero .sch-meter i { background: #fff; outline: 1px solid #000; outline-offset: -1px; height: 8px; }
.sch.m-nero .sch-meter i.on { background: repeating-linear-gradient(90deg, #000 0 1px, #fff 1px 3px); }
.sch.m-nero .sch-barcode i { background: #000; }
.sch.m-nero .sch-comp-img, .sch.m-nero .sch-unit-art, .sch.m-nero .sch-portrait { background: #fff; box-shadow: none; }
.sch.m-nero small { color: #000; }
.sch.m-risparmio .sch-wm, .sch.m-nero .sch-wm { opacity: 0.06; background: #000; }

/* ---------- stampa: un A4 verticale, senza barra ---------- */
@media print {
    @page { size: A4 portrait; margin: 8mm; }
    html, body { background: #fff !important; }
    body::before, body::after { display: none !important; }
    .sch-bar { display: none !important; }
    .stampa-pagina { background: none; min-height: 0; }
    .sch-foglio { padding: 0; overflow: visible; display: block; }
    .sch { zoom: 0.72; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Le icone della scheda (IconaScheda): maschere che prendono il colore del testo. */
.sch .isc { display: inline-block; width: 1em; height: 1em; vertical-align: -0.12em; background: currentColor;
    -webkit-mask: var(--isc) center / contain no-repeat; mask: var(--isc) center / contain no-repeat; }
.sch .isc.big { width: 46px; height: 46px; }
.sch .isc-txt { font-style: normal; }
.sch small .isc { margin-right: 2px; }
.sch-comp-top .sch-cost .isc { color: var(--head-t); }
.sch-armor .isc { margin-right: 1px; color: var(--head-t); }
.sch-skill-ic .isc { width: 40px; height: 40px; }
.sch-panel.sch-skill, .sch-panel.sch-notes { display: flex; flex-direction: column; }
.sch.m-nero .sch-portrait svg, .sch.m-risparmio .sch-portrait svg { filter: grayscale(1) brightness(0.75) contrast(1.5); }

/* Il codice a barre vero (Code 128) nel riquadro dell'ID: largo, perché in stampa ogni modulo deve
   restare oltre un quarto di millimetro, che è quanto serve alla fotocamera di un telefono. */
.sch-cab { display: block; width: 252px; height: 40px; margin-top: 3px; color: var(--text); background: #fff; padding: 2px 0; border-radius: 2px; }
.sch-cab svg { display: block; width: 100%; height: 100%; fill: #05080d; }
.sch-cab.graffiato { opacity: 0.55; }
.sch-cab.graffiato .cab-graffi line { stroke: #fff; }
.sch-cab-txt { display: block; margin-top: 2px; font: 600 10px/1 'Consolas', monospace !important; letter-spacing: 0.3em !important; text-transform: none !important; }
.sch.m-risparmio .sch-cab, .sch.m-nero .sch-cab { background: #fff; border: 1px solid #ddd; }

/* ---------- il registro di battaglia: la seconda pagina, a penna ---------- */
.sch-log-toggle { padding: 0.45rem 0.9rem; border-radius: 999px; border: 1px solid #2b4560; background: transparent; color: #c4cfe0; font: 700 0.75rem/1 Rajdhani, sans-serif; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
.sch-log-toggle.on { background: #2ec4a6; border-color: #2ec4a6; color: #05080d; }
.sch-log { margin-top: 1.2rem; min-height: 0; }
.sch-log-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--edge); }
.sch-log-head h2 { margin: 2px 0 0; font: 400 40px/0.95 'Bebas Neue', Rajdhani, sans-serif; }
.sch-log-head h2 span { color: var(--muted); font-size: 26px; }
.sch-log-fields { display: grid; gap: 6px; min-width: 300px; }
.sch-log-fields span { display: flex; align-items: flex-end; gap: 8px; color: var(--label); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.sch-log-fields i, .sch-log-lines i, .sch-log-total i { flex: 1; height: 18px; border-bottom: 1px solid var(--line2); }
.sch-log-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sch-log-table th, .sch-log-table td { border: 1px solid var(--line); height: 46px; text-align: center; font-size: 12px; }
.sch-log-table thead th { height: 26px; background: var(--panel2); color: var(--label); font-size: 11px; letter-spacing: 0.06em; }
.sch-log-table thead th:first-child { width: 170px; }
.sch-log-table thead th:nth-child(2) { width: 52px; }
.sch-log-table thead th:last-child { width: 96px; }
.sch-log-table tbody th { display: table-cell; padding: 4px 8px; text-align: left; }
.sch-log-table tbody th b { display: block; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.sch-log-table tbody th small { display: block; text-transform: none; letter-spacing: 0; font-size: 10.5px; }
.sch-log-table td.full { font: 700 17px/1 Rajdhani, sans-serif; background: var(--panel2); }
.sch-log-table tr.k-Head th b { color: var(--c-Head); }
.sch-log-table tr.k-Armament th b { color: var(--c-Armament); }
.sch-log-table tr.k-Thrusters th b { color: var(--c-Thrusters); }
.sch-log-table tr.k-Locomotion th b { color: var(--c-Locomotion); }
.sch-log-table tr.energy th b { color: var(--en); }
.sch-box-check { display: inline-block; width: 14px; height: 14px; border: 1.5px solid var(--line2); border-radius: 2px; vertical-align: -2px; }
.sch-log-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; margin-top: 16px; }
.sch-log-grid section { padding: 10px 12px; border: 1px solid var(--line); }
.sch-log-grid h3 { margin: 0 0 8px; color: var(--head-t); font: 700 13px/1 Rajdhani, sans-serif; letter-spacing: 0.1em; text-transform: uppercase; }
.sch-log-ov { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; border-bottom: 1px dashed var(--line); }
.sch-log-ticks { display: flex; gap: 3px; }
.sch-log-ticks i { width: 12px; height: 12px; border: 1px solid var(--line2); }
.sch-log-note { color: var(--muted); font-size: 11px; margin: 0 0 6px !important; }
.sch-log-lines { display: grid; gap: 6px; }
.sch-log-lines span, .sch-log-total { display: flex; align-items: flex-end; gap: 6px; font-size: 11px; color: var(--label); }
.sch-log-total { margin-top: 8px; font-weight: 700; text-transform: uppercase; }
.sch-log-result { display: grid; gap: 8px; margin-bottom: 10px; font-size: 13px; font-weight: 700; }

@media print {
    /* Il registro va su una pagina sua. */
    .sch-log { break-before: page; page-break-before: always; margin-top: 0; }
}

/* ---------- Le barre: base, overload, vuote ---------- */
.sch-meter { grid-template-columns: repeat(var(--n, 10), 1fr); }
.sch-meter i.ov { background: #ffd166; }
.sch-over { margin-inline-start: 2px; color: #ffd166; font-size: 9px; vertical-align: super; }
/* I totali in testa: il numero occupa sempre la stessa altezza anche quando si rimpicciolisce, così
   «crediti» e «mantenimento/serbatoio» stanno alla stessa riga. */
.sch-totals b { display: flex; align-items: flex-end; height: 28px; }
/* Il ritratto del pilota scende fino in fondo alla sezione. */
.sch-col > .sch-panel:first-child { display: flex; flex-direction: column; }
.sch-col > .sch-panel:first-child .sch-pilot { flex: 1 1 auto; align-items: stretch; }
.sch-pilot .sch-portrait { height: auto; min-height: 150px; }
