.quick-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:5px}
.template-trigger{padding:6px 10px;border:0;border-radius:9px;background:#edf5f8;color:var(--brand2);font-size:.76rem;font-weight:700}
.template-trigger:active{background:#deedf2}
.templates-dialog{width:min(420px,calc(100% - 28px));height:min(560px,85vh);height:min(560px,85dvh);max-height:85vh;max-height:85dvh;overflow:hidden}
.templates-modal{display:flex;flex-direction:column;height:100%;min-height:0}
.templates-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;flex-shrink:0}
.templates-head h2{margin:0}
.template-close{display:grid;place-items:center;flex-shrink:0;width:34px;height:34px;padding:0;border:0;border-radius:50%;background:#f0f5f7;color:var(--muted);line-height:1}
.template-close svg{display:block;width:18px;height:18px;pointer-events:none}
.templates-hint{font-size:.76rem;margin:0 0 16px;flex-shrink:0}
.template-list{display:grid;flex:1;align-content:start;gap:10px;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding:3px 7px 3px 3px;scrollbar-width:thin;scrollbar-color:#bdcdd4 transparent}
.template-list::-webkit-scrollbar,.template-editor-body::-webkit-scrollbar{width:5px}
.template-list::-webkit-scrollbar-thumb,.template-editor-body::-webkit-scrollbar-thumb{background:#bdcdd4;border-radius:8px}
.template-list::-webkit-scrollbar-track,.template-editor-body::-webkit-scrollbar-track{background:transparent}
.template-list::-webkit-scrollbar-button,.template-editor-body::-webkit-scrollbar-button{display:none}
.template-item{display:flex;gap:8px;align-items:center;border:0;border-radius:14px;padding:12px;background:#edf3f6}
.template-use{flex:1;display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;width:100%;text-align:left;padding:0;border:0;background:transparent;color:var(--ink);border-radius:10px}
.template-use:active{opacity:.65}
.template-use:focus-visible{outline:2px solid var(--brand2);outline-offset:3px}
.template-copy{min-width:0}
.template-name{display:block;font-size:.94rem;font-weight:750;overflow-wrap:anywhere;line-height:1.35}
.template-booked{color:var(--good);background:#e7f5ef;padding:3px 6px;border-radius:6px;font-size:.62rem;font-weight:600}
.template-meta{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin-top:3px;font-size:.72rem;color:var(--muted)}
.template-meta .tag{margin:0}
.template-price{display:flex;align-items:center;gap:6px;flex:0 0 auto;font-size:.94rem;font-weight:760;color:var(--ink);font-variant-numeric:tabular-nums}
.template-price svg{width:14px;height:14px;stroke:var(--muted);stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round}
.template-item-actions{display:flex;align-items:center;gap:2px;flex-shrink:0}
.template-item-actions button{display:inline-flex;align-items:center;justify-content:center;border:0;background:transparent;color:var(--muted);border-radius:7px;padding:5px 8px;font-size:.7rem;min-width:32px;min-height:34px}
.template-item-actions button:active{background:#e8f1f4}
.template-item-actions button[data-template-action="edit"]{color:var(--brand2);font-size:.85rem;font-weight:700;padding:8px 4px}
.template-item-actions button[data-template-action="delete"]{font-size:.8rem;padding:8px 4px}
.template-item-actions .template-drag{padding:8px 5px;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
.template-drag:active{cursor:grabbing}
.template-item.dragging{opacity:.65;background:#e4eff3;box-shadow:0 3px 12px rgba(22,78,99,.12)}
.template-item-actions svg{display:block;width:18px;height:18px;stroke:currentColor;stroke-width:1.8;fill:none;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.template-item-actions button:disabled{opacity:.25;cursor:default}
.template-item-actions .template-delete{color:var(--danger);background:transparent;box-shadow:none}
.template-item-actions .template-delete:active{background:#fff0ee}
.template-empty{text-align:center;padding:26px 8px;color:var(--muted);line-height:1.8}
.template-empty small{font-size:.75rem}
.template-editor{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.template-editor-body{display:flex;flex-direction:column;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#bdcdd4 transparent}
.template-editor-fields{flex-shrink:0;margin:0;padding:8px 2px 16px}
.template-editor .modal-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0;padding-top:16px;flex-shrink:0}
.template-editor .modal-actions button{min-height:46px;padding:10px;box-shadow:none}
.template-editor-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.template-error{color:var(--danger);font-size:.76rem;min-height:1em;margin-bottom:0}
.template-from-entry{display:block;width:max-content;margin:13px 0 0 auto}
.template-add{display:flex;align-items:center;justify-content:center;gap:4px;width:100%;margin-top:14px;min-height:42px;padding:9px;border:0;border-radius:12px;background:var(--brand);color:#fff;font-size:.82rem;font-weight:700;flex-shrink:0}
.template-add svg{display:block;width:20px;height:20px;flex-shrink:0;stroke:currentColor;stroke-width:1.8;fill:none;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.template-add:active{background:#123f51}
.template-add[hidden]{display:none}
.template-list[hidden],.template-editor[hidden]{display:none}
@media(max-width:620px){.templates-modal{padding:20px}.template-editor-row{gap:10px}}
