/* Local proposal only. The published palette and material styles remain unchanged. */
.template-workspace {margin-top:24px}
.template-workspace :is(h2,h3,strong,.template-used,.template-help,li){overflow-wrap:anywhere}
.template-workspace #tpHeading {scroll-margin-top:16px}
.template-field>div {min-width:0;max-width:100%}
.template-intro {max-width:690px}
.template-catalog {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:24px 0}
.template-card {display:flex;flex-direction:column;gap:14px;padding:20px;border:1px solid var(--line);border-radius:14px;background:var(--card);box-shadow:0 3px 7px #201c2212}
.template-card h3 {font-size:19px;margin:0}.template-card p {margin:0}.template-card .actions {margin-top:auto}
.template-used {font-size:13px;color:var(--muted);line-height:1.6}
.template-heading {display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:16px;margin-bottom:20px}
.template-heading h2 {margin-bottom:6px}.template-heading p {margin:0}
.template-columns {display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:24px;align-items:start}
.template-editor {min-width:0}.template-preview {min-width:0;padding:20px;border:1px solid var(--line);border-radius:14px;background:var(--bg)}
.template-preview h3 {font-size:18px}.template-preview .grid {grid-template-columns:1fr;gap:20px}
.template-preview .notice {margin-top:0}.template-preview label {font-size:13px}
.template-preview .template-phone {padding:20px;background:var(--card);border:1px solid var(--line);border-radius:14px;box-shadow:0 3px 7px #201c2212}
.template-preview .template-phone>p {font-size:12px;color:var(--muted)}
.template-fields {display:grid;gap:12px;margin:20px 0}
.template-field {position:relative;display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:12px;padding:16px;border:1px solid var(--line);border-radius:10px;background:var(--card)}
.template-field strong {display:block}.template-field p {margin:3px 0 0;font-size:13px;color:var(--muted)}
.template-field .actions {flex-wrap:nowrap;gap:8px}.template-field button {padding-inline:14px}
.template-field button:is(.template-drag,.template-order){width:48px;min-width:48px;height:48px;padding:0!important;display:grid;place-items:center}
.template-drag{cursor:grab;touch-action:none;user-select:none;color:var(--muted)}.template-drag:active{cursor:grabbing}
.template-drag-source{opacity:.4}.template-drag-ghost{position:fixed!important;z-index:60;pointer-events:none;opacity:.96;box-shadow:0 12px 28px #201c2233!important;max-width:calc(100vw - 24px)}
.template-drop-before::before,.template-drop-after::after{content:"";position:absolute;left:0;right:0;height:3px;border-radius:2px;background:var(--red);pointer-events:none}
.template-drop-before::before{top:-8px}.template-drop-after::after{bottom:-8px}
.template-form {display:grid;gap:20px}.template-form .actions {margin-top:4px}
.template-options {display:grid;gap:12px;margin-top:12px}
.template-option {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end}
.template-option button {min-width:48px;padding-inline:12px}.template-option label {min-width:0}
.template-form fieldset {min-width:0;margin:0;padding:0;border:0}.template-form legend {font-size:14px;font-weight:600;margin-bottom:6px}
.template-help {font-size:13px;color:var(--muted);margin:0;line-height:1.5}
.template-feedback:not([hidden]) {margin:0 0 20px}.template-invalid {border-color:var(--red)!important}
.template-workspace details {margin-block:20px!important}.template-workspace details .grid {margin-top:16px}
.template-preview-toggle {display:none}.template-changes {padding-left:20px;margin-block:20px}.template-changes li {margin:10px 0}
.template-state {font-size:13px;color:var(--muted)}.template-bottom {display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
@media(max-width:1000px){.template-columns{grid-template-columns:minmax(0,1fr) 330px}}
@media(max-width:850px){
 .template-columns{grid-template-columns:1fr}.template-preview-toggle{display:flex;margin-bottom:20px;gap:12px}
 .template-workspace:not([data-preview-only="true"]) .template-preview{display:none}
 .template-workspace[data-preview-only="true"] .template-editor{display:none}
 .template-workspace[data-preview-only="true"] .template-preview{max-width:390px;width:100%;margin:auto}
 .template-preview-toggle button[aria-pressed="true"]{background:var(--dark)!important;color:white!important;border-color:var(--dark)!important}
}
@media(max-width:600px){
 .template-catalog{grid-template-columns:1fr}.template-card{padding:18px}
 .template-heading>.actions,.template-bottom>.actions,.template-form>.actions,.template-catalog .actions {display:grid;grid-template-columns:1fr;width:100%}
 .template-field{grid-template-columns:48px minmax(0,1fr);align-items:start;gap:12px}.template-field>.actions{grid-column:2/-1;width:auto;max-width:100%}.template-field>.actions button{flex:initial}
 .template-preview{padding:12px}.template-preview .template-phone{padding:16px}
 .template-preview-toggle{display:grid;grid-template-columns:1fr 1fr}.template-option{gap:10px}
}
