.template-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin:25px 0 20px}.template-heading h2{font-size:22px;letter-spacing:-.4px}.template-heading p{color:var(--muted);margin-top:7px;font-size:13px}.template-heading [role=status]{color:var(--muted);font-size:12px;white-space:nowrap}.template-notice{padding:12px 16px;margin:12px 0;border-radius:6px}.template-notice button{margin-left:8px}.template-toolbar{display:flex;align-items:end;gap:14px;flex-wrap:wrap;margin-bottom:18px}.template-toolbar .email-search{flex:1;min-width:230px}.template-source{display:grid;gap:5px;font-size:11px;color:var(--muted);min-width:230px;max-width:340px}.template-source select{color:var(--ink);max-width:100%}.template-shortlist-filter{display:flex;gap:8px;align-items:center;white-space:nowrap;font-size:12px;min-height:37px}.template-shortlist-filter input{width:auto}.template-browser{display:grid;grid-template-columns:minmax(270px,36%) minmax(0,1fr);overflow:hidden;min-height:620px}.template-list{border-right:1px solid var(--line);max-height:890px;overflow:auto}.template-row{display:flex;gap:12px;padding:18px 16px;border-bottom:1px solid var(--line);align-items:flex-start;background:var(--surface)}.template-row.is-active{background:var(--selection-bg);box-shadow:inset 3px 0 var(--primary)}.template-row>input{margin:3px 0 0;width:16px;height:16px;flex:none;accent-color:var(--primary)}.template-row button{min-width:0;text-align:left;padding:0;border:0;background:none;box-shadow:none;flex:1;color:var(--ink);border-radius:0}.template-row strong{display:block;font-size:13px;font-weight:600;line-height:1.5;overflow-wrap:anywhere}.template-row small{display:block;line-height:1.55;margin:7px 0}.template-row span{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:12px;color:var(--muted);line-height:1.65}.template-row em{display:block;font-size:11px;font-style:normal;color:var(--warning-ink);margin-top:7px}.template-detail{min-width:0;padding:24px}.template-detail header{padding-bottom:18px;border-bottom:1px solid var(--line)}.template-detail h3{font-size:18px;line-height:1.45;overflow-wrap:anywhere}.template-detail header p{font-size:12px;color:var(--muted);margin:8px 0 4px}.template-detail header .review-warning{padding:10px;color:var(--warning-ink);background:var(--warning-bg);margin-top:14px}.template-preview-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:18px 0}.template-preview-tools .tabs{margin:0}.template-preview-tools button{font-size:12px}.template-preview-tools [aria-pressed=true]{background:var(--selection-bg);color:var(--link);border-color:var(--selection-border)}.template-frame{display:block;width:100%;height:590px;border:1px solid var(--line);border-radius:4px;background:#fff}.template-preview-note{font-size:11px;line-height:1.6;color:var(--muted);margin:12px 0}.template-plain{white-space:pre-wrap;font-size:13px;line-height:1.8;padding:22px;background:var(--table-head);border-radius:4px;max-height:640px;overflow:auto;overflow-wrap:anywhere}.template-empty{padding:38px 24px;color:var(--muted);font-size:13px;line-height:1.7}.template-empty strong{color:var(--ink);font-weight:500}.template-empty p{margin-top:9px}.template-list>.template-empty{text-align:center}.template-detail>[data-template-action=update-reference]{margin-top:12px}.template-heading button:disabled{opacity:.5;cursor:default}@media(max-width:1000px){.template-browser{grid-template-columns:310px minmax(0,1fr)}.template-detail{padding:18px}.template-source{max-width:270px}.template-preview-tools{flex-wrap:wrap}}@media(max-width:760px){.template-heading{flex-wrap:wrap}.template-heading>.actions{width:100%;justify-content:space-between}.template-toolbar .email-search,.template-source{min-width:0;max-width:none;width:100%;flex-basis:100%}.template-browser{grid-template-columns:1fr}.template-list{max-height:350px;border-right:0;border-bottom:1px solid var(--line)}.template-detail{padding:18px}.template-frame{height:520px}.template-preview-tools>.tabs{display:flex;flex-wrap:wrap}.template-heading h2{font-size:21px}}

.template-subject{display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:12px}
.template-subject h3{flex:1 1 180px}.template-subject button{flex:none}
.template-full-dialog[open]{display:flex;flex-direction:column;margin:auto;width:min(1000px,calc(100% - 32px));height:min(94dvh,1100px);max-width:100%;max-height:100dvh;overflow:hidden}
.template-full-dialog .dialog-head{position:static;gap:12px;padding:14px 20px;flex:none}
.template-full-dialog .dialog-head h2{overflow-wrap:anywhere;line-height:1.3;max-height:18dvh;overflow:auto}
.template-full-dialog .dialog-head button{flex:none;border:1px solid var(--control-border);font-size:14px}
.template-full-dialog .dialog-body,.template-full-content,.template-full-viewer{display:flex;flex-direction:column;flex:1;min-height:0}
.template-full-dialog .dialog-body{padding:0;overflow:auto}
.template-full-location{padding:10px 20px 0;color:var(--muted);font-size:12px;overflow-wrap:anywhere}
.template-full-viewer .template-preview-tools{margin:8px 20px;flex-wrap:wrap}
.template-full-viewer .tabs{padding:0;gap:16px}
.template-full-viewer .template-preview-note{order:-1;margin:4px 20px 0}
.template-full-viewer .template-frame,.template-full-viewer .template-plain{flex:1;min-height:100px;max-height:none;height:auto;border:0;border-top:1px solid var(--line);border-radius:0}
.template-full-viewer .template-frame:focus-visible,.template-full-viewer .template-plain:focus-visible{outline:2px solid var(--focus);outline-offset:-2px}
@media(max-width:620px){
 .template-full-dialog[open]{width:100%;height:100dvh;max-width:100vw;border:0;border-radius:0}
 .template-full-dialog .dialog-head{padding:12px 14px}
 .template-full-location{padding:8px 14px 0}
 .template-full-viewer .template-preview-tools,.template-full-viewer .template-preview-note{margin-inline:14px}
 .template-full-viewer .tabs button{padding:8px 0}
}
