.pe-template-dialog {
  box-sizing:border-box; width:min(960px,calc(100vw - 32px)); max-width:none;
  height:min(840px,calc(100dvh - 36px)); max-height:calc(100dvh - 36px); padding:0; margin:auto; overflow:clip;
  color:#203029; border:1px solid #cbd6cd; border-radius:18px;
  background:#f8faf7; box-shadow:0 30px 110px #14291e40;
  font:400 14px/1.4 "Instrument Sans","Segoe UI",Arial,sans-serif;
}
.pe-template-dialog[open] {display:grid; grid-template-rows:auto minmax(0,1fr) auto}
.pe-template-dialog::backdrop {background:#17251dd1}
.pe-template-dialog *, .pe-template-dialog *::before, .pe-template-dialog *::after {box-sizing:border-box}
.pe-template-head {flex:none; padding:23px 26px 18px; background:#fff; border-bottom:1px solid #dce2db}
.pe-template-head h2 {margin:0; color:#203029; font:700 clamp(23px,3.3vw,33px)/1.13 "Instrument Sans","Segoe UI",sans-serif; letter-spacing:-.045em}
.pe-template-head p {margin:7px 0 0; color:#526258; font-size:14px}
.pe-template-scroll {min-width:0; min-height:0; overflow:auto; overscroll-behavior:contain; contain:paint}
.pe-template-grid {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; align-content:start; min-inline-size:0; margin:0; padding:20px 24px 24px}
.pe-template-card {display:flex; flex-direction:column; position:relative; gap:0; margin:0; min-width:0; background:white; color:#203029; border:1px solid #cad4cb; border-radius:11px; cursor:pointer}
.pe-template-card:hover {border-color:#819789}
.pe-template-card:has(input:checked) {border-color:#336d47; box-shadow:0 0 0 2px #336d47}
.pe-template-card:has(input:focus-visible) {outline:2px solid #276c84; outline-offset:4px}
.pe-template-card .pe-template-radio {position:absolute; z-index:1; top:9px; right:9px; margin:0; width:19px; height:19px; accent-color:#326846; cursor:pointer}
.pe-template-frame {position:relative; width:100%; aspect-ratio:1.68; overflow:hidden; background:#e8ede5; border-radius:10px 10px 0 0; border-bottom:1px solid #d8ded6; pointer-events:none; user-select:none}
.pe-template-mini {position:absolute; top:0; left:0; width:880px; transform-origin:top left; pointer-events:none}
.pe-template-caption {display:flex; align-content:start; flex-wrap:wrap; gap:4px 8px; padding:12px 13px 14px; line-height:1.35}
.pe-template-caption strong {font-size:16px; font-weight:700; letter-spacing:-.02em}
.pe-template-caption .pe-template-current {align-self:center; color:#326145; font-size:12px; font-weight:650}
.pe-template-caption small {flex-basis:100%; color:#526258; font-size:12px}
.pe-template-actions {position:relative; z-index:1; display:flex; justify-content:flex-end; gap:9px; background:#fff; border-top:1px solid #dce2db; padding:14px 24px}
.pe-template-actions button {width:auto; min-height:39px; margin:0; padding:8px 15px; border:1px solid #cbd5cb; border-radius:8px; color:#24352b; background:#fff; font-family:inherit; font-size:14px; font-weight:650; line-height:1.3; cursor:pointer}
.pe-template-actions button.pe-template-apply {background:#315f43; border-color:#315f43; color:#fff}
.pe-template-actions button:disabled {opacity:.45; cursor:default}
.pe-template-actions button.pe-template-reset {margin-inline-end:auto;color:#315f43}
.pe-template-dialog.pe-restore-dialog {width:min(550px,calc(100vw - 24px));height:auto}
.pe-restore-form {margin:0;min-height:0;padding:18px 25px;overflow:auto;overscroll-behavior:contain}
.pe-restore-profession {display:grid;gap:5px;margin-bottom:14px;font-weight:650}
.pe-restore-profession select {min-height:38px;max-width:100%;padding:6px 8px;border:1px solid #aab9ad;border-radius:6px;background:white;color:#25372a;font:inherit}
.pe-restore-source {margin:0 0 13px;color:#42604a;font-size:13px;font-weight:650}
.pe-restore-options {display:grid;gap:8px;padding:0;margin:0;border:0}
.pe-restore-options legend {margin:0 0 7px;padding:0;font-size:14px;font-weight:650}
.pe-restore-option {display:flex;align-items:flex-start;gap:10px;padding:13px;border:1px solid #cbd6cd;border-radius:8px;background:white;cursor:pointer}
.pe-restore-option:has(input:checked) {border-color:#377349;background:#f0f6f0}
.pe-restore-option input {width:17px;height:17px;flex:0 0 17px;margin:1px 0 0;accent-color:#326846}
.pe-restore-option strong,.pe-restore-option small {display:block}
.pe-restore-option small {margin-top:3px;font-size:13px;color:#536357;line-height:1.4}
.pe-restore-note {margin:13px 0 0;font-size:13px;color:#526258}
@media(max-width:740px) {
  .pe-template-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:520px) {
  .pe-template-dialog {width:calc(100vw - 16px); height:min(840px,calc(100dvh - 16px)); max-height:calc(100dvh - 16px); border-radius:12px}
  .pe-template-head {padding:18px 15px 14px}
  .pe-template-head p {font-size:13px}
  .pe-template-grid {gap:10px; padding:14px}
  .pe-template-caption {padding:8px; gap:3px 5px}
  .pe-template-caption strong {font-size:14px}
  .pe-template-caption small {font-size:11px}
  .pe-template-actions {padding:10px 14px}
  .pe-template-actions:has(.pe-template-reset) {flex-wrap:wrap;gap:6px}
  .pe-template-actions button.pe-template-reset {flex-basis:100%}
  .pe-restore-form {padding:14px}
}
@media(max-width:330px) {
  .pe-template-grid {grid-template-columns:minmax(0,1fr)}
}
