/* Local-download model gallery. */
.template-controls{display:grid;grid-template-columns:minmax(180px,250px) minmax(180px,230px) minmax(0,1fr);align-items:end;gap:15px;padding:20px;border:1px solid var(--line);border-radius:8px;background:#fff;margin:0 0 14px}
.template-controls label{display:grid;gap:8px;min-width:0;font-size:14px;font-weight:600;line-height:1.5}
.template-controls select,.template-controls input{width:100%;min-width:0;min-height:42px;padding:8px 10px;border:1px solid #cbd4da;border-radius:5px;background:#fff;color:var(--ink);font:inherit;font-size:15px}
.template-controls p{margin:0;color:var(--muted);font-size:13px;line-height:1.7}
.template-scope{font-size:14px;font-weight:600;color:var(--ink);line-height:1.7;margin:15px 0 8px}
.template-download-note{max-width:900px;font-size:13px;color:var(--muted);line-height:1.8;margin:0 0 12px}
.templates-status{min-height:24px;font-size:14px;color:var(--coral-dark);line-height:1.6;margin:8px 0 18px}
.templates-status.is-error{color:#9a3029}
.templates-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;margin:0 0 35px}
.template-card{display:flex;flex-direction:column;min-width:0;overflow:hidden;border:1px solid var(--line);border-radius:8px;background:#fff}
.template-preview{position:relative;display:grid;place-items:center;aspect-ratio:1.45;background:#f0f3f5;padding:14px;border-bottom:1px solid var(--line)}
.template-preview img{width:100%;height:100%;object-fit:contain;position:absolute;inset:0;padding:14px}
.template-preview-note{font-size:13px;color:var(--muted);line-height:1.7;text-align:center;margin:15px}
.template-card-body{display:flex;flex-direction:column;flex:1;padding:19px 20px 20px}
.template-period{font-size:12px;font-weight:650;letter-spacing:.025em;color:var(--coral-dark);margin:0 0 9px}
.template-card h3{font-family:var(--serif);font-size:25px;font-weight:400;line-height:1.2;margin:0 0 12px}
.template-card-body>p:not(.template-period){font-size:14px;line-height:1.75;color:var(--muted);margin:0 0 20px}
.template-card-body>p.template-data-note{font-size:12px;color:#79501c;margin-top:-7px}
.template-downloads{display:flex;gap:9px;margin-top:auto}
.template-downloads button{display:flex;justify-content:space-between;align-items:center;gap:22px;flex:1;min-height:42px;padding:10px 13px;border:1px solid #d5c0b7;border-radius:5px;background:#fff8f3;color:var(--coral-dark);font-size:14px;font-weight:650;cursor:pointer}
.template-downloads button:hover{background:#ffede2;border-color:var(--coral-dark)}
.template-downloads button:disabled{cursor:wait;opacity:.55}
.template-downloads button:focus-visible,.template-controls select:focus-visible,.template-controls input:focus-visible{outline:3px solid #126589;outline-offset:3px}
@media(max-width:950px){.templates-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}.template-controls{grid-template-columns:repeat(2,minmax(0,1fr))}.template-controls p{grid-column:1/-1}}
@media(max-width:650px){.template-controls{padding:15px;gap:12px}.template-controls label{font-size:13px}.template-controls input,.template-controls select{font-size:16px}.templates-gallery{grid-template-columns:1fr;gap:16px}.template-card-body{padding:18px}.template-card h3{font-size:25px}.template-period{font-size:12px}.templates-status{margin-bottom:12px}.template-download-note{font-size:13px}}
@media(max-width:370px){.template-controls{grid-template-columns:1fr}.template-controls p{grid-column:auto}}
@media print{.template-controls,.template-downloads,.templates-status{display:none!important}.templates-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.template-card{break-inside:avoid}.template-card-body{padding:12px}.template-card h3{font-size:18px}.template-card-body>p:not(.template-period),.template-download-note,.template-scope{font-size:10px}.template-preview{min-height:120px}}
