/* A workshop's operation catalogue and the ordered route are separate decisions. */
dialog:has(#template-form){max-width:760px}
#template-form{min-width:0;overflow-wrap:anywhere}
#template-form [hidden]{display:none!important}
#template-form #template-custom-product{min-width:0}
.template-product-picker{position:relative;min-width:0}
.template-product-input{display:grid;grid-template-columns:minmax(0,1fr) 48px;min-width:0;border:1px solid var(--line,#dce4f0);border-radius:8px;background:var(--paper,#fff)}
#template-form .template-product-input input{width:100%;min-width:0;border:0;box-shadow:none;border-radius:8px 0 0 8px;padding:12px}
#template-form #template-product-toggle{display:flex;align-items:center;justify-content:center;min-width:44px;min-height:48px;margin:0;padding:0;border:0;border-left:1px solid var(--line,#dce4f0);border-radius:0 8px 8px 0;background:transparent;color:var(--ink,#142b52);font-size:28px}
.template-product-input:focus-within{outline:2px solid var(--teal,#155eef);outline-offset:2px}
#template-product-popup{position:absolute;left:0;right:0;top:100%;z-index:6;max-height:42vh;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;border:1px solid var(--line,#dce4f0);border-radius:8px;background:var(--paper,#fff);box-shadow:0 8px 24px #142b5226}
#template-form #template-product-options>button{display:block;width:100%;min-width:0;min-height:48px;margin:0;padding:10px 12px;border:0;border-bottom:1px solid var(--line,#dce4f0);border-radius:0;text-align:left;white-space:normal;overflow-wrap:anywhere;background:transparent;color:var(--ink,#142b52)}
#template-form #template-product-options>button.is-active,#template-form #template-product-options>button[aria-selected=true]{background:var(--pale,#edf3ff)}
#template-product-options small{display:block;font-size:14px;line-height:1.5;color:var(--muted,#63738a)}
#template-product-popup .field-hint,.template-product-empty{margin:0;padding:10px 12px;font-size:15px;line-height:1.6}
#template-product-list-hint:empty,#template-product-help:empty{display:none}
.template-builder-intro{font-size:17px;line-height:1.65;margin-bottom:16px;padding:12px 16px;background:var(--pale,#edf3ff);border-radius:8px}
.template-builder-section,.template-builder-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:20px 0 12px}
.template-builder-section h3,.template-builder-heading h3{font-size:21px;line-height:1.5;margin:0}
#template-form .field-label{font-size:17px;line-height:1.5}
#template-form input:not([type=checkbox]),#template-form select{min-height:48px;font-size:17px;min-width:0}
#template-form button{min-height:44px;font-size:16px;line-height:1.5;white-space:nowrap;word-break:keep-all}
.template-builder-picker{padding:16px;border:1px solid var(--line,#dce4f0);border-radius:8px;margin:20px 0;background:var(--paper,#fff)}
.template-builder-picker>.template-builder-heading{margin:0 0 8px}
.template-builder-picker p{font-size:16px;line-height:1.6;margin:8px 0;color:var(--muted,#63738a)}
.template-builder-picker .template-builder-center{font-size:18px;font-weight:600;color:var(--ink,#142b52)}
.template-builder-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}
.template-builder-choice{display:flex;align-items:center;gap:8px;min-width:0}
.template-builder-choice>label{flex:1;min-width:0}
.template-builder-choice>label>span,.template-builder-review li>span{min-width:0;overflow-wrap:anywhere}
#template-form .template-repeat-step{flex:0 0 auto;margin:0;padding:8px 10px;font-size:15px}
.template-builder-choices label{display:flex;align-items:center;gap:10px;padding:10px 12px;min-height:52px;border:1px solid var(--line,#dce4f0);border-radius:8px;cursor:pointer;font-size:18px;line-height:1.5;min-width:0}
.template-builder-choices label:has(input:checked){background:var(--pale,#edf3ff);border-color:var(--teal,#155eef)}
.template-builder-choices input{width:24px;height:24px;min-height:24px;flex:0 0 24px;margin:0;accent-color:var(--teal,#155eef)}
.template-builder-choices small{display:block;font-size:14px;color:var(--muted,#63738a)}
.template-builder-choices label:focus-within{outline:3px solid var(--teal,#155eef);outline-offset:2px}
.template-builder-empty{padding:8px 0}
.template-new-operation{margin-top:16px;padding-top:16px;border-top:1px solid var(--line,#dce4f0)}
.template-new-operation h4{font-size:19px;line-height:1.5;margin:0 0 12px}
.template-new-operation-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.template-builder-picker .template-builder-message{color:var(--ink,#142b52)}
#template-form .route-editor-step{display:block;min-width:0;padding:12px;background:var(--paper,#fff);border-color:var(--line,#dce4f0)}
#template-form .route-editor-label{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:12px}
#template-form .route-editor-label>strong{font-size:20px;font-weight:700;font-family:inherit;line-height:1.5}
.template-product-label{font-size:16px;line-height:1.5;margin:8px 0;color:var(--ink,#142b52)}
#template-form .route-editor-label>div{display:flex;flex-direction:row;flex-wrap:wrap;gap:8px;margin:0}
#template-form .route-editor-label button{padding:8px 12px;min-width:48px;background:var(--pale,#edf3ff)}
#template-form .route-editor-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
#template-form .route-editor-fields label{min-width:0}
.template-builder-review{margin:20px 0;padding:16px;border:1px solid var(--line,#dce4f0);border-radius:8px;background:var(--cream,#f3f6fb)}
.template-builder-review h3{font-size:21px;line-height:1.5;margin:0 0 8px}
.template-builder-review p{font-size:16px;line-height:1.6;margin:8px 0;color:var(--muted,#63738a)}
.template-builder-review ol{list-style:none;padding:0;margin:12px 0}
.template-builder-review li{display:flex;align-items:flex-start;gap:12px;padding:10px 0;border-bottom:1px solid var(--line,#dce4f0);font-size:18px;line-height:1.5}
.template-builder-review li>b{min-width:24px;color:var(--teal,#155eef)}
.template-builder-review small{display:block;font-size:15px;line-height:1.6;color:var(--muted,#63738a)}
.template-builder-warning{padding:12px;border:2px solid #a55f00;border-radius:8px;background:#fff8e8;margin:12px 0;font-size:17px;line-height:1.6}
.template-builder-warning strong{color:#714000}
.template-builder-warning label{display:flex;align-items:flex-start;gap:10px;cursor:pointer}
.template-builder-warning input{width:24px;height:24px;min-height:24px;flex:0 0 24px;accent-color:var(--teal,#155eef);margin-top:3px}
.product-template-heading{align-items:flex-start;gap:12px;flex-wrap:wrap}
.product-template-heading>div{flex:1 1 220px;min-width:0}
.product-template-heading>#new-template{flex:0 0 auto;min-height:44px;white-space:nowrap;word-break:keep-all}
.template-card-compact .template-product-label{margin:6px 0;font-size:15px;line-height:1.5}
.template-card-compact .card-topline h3{min-width:0;overflow-wrap:anywhere}
#template-form .policy-consent{font-size:16px;line-height:1.6}
#template-form .policy-consent input{width:24px;height:24px;min-height:24px}
@media(max-width:600px){.template-builder-picker,.template-builder-review{padding:12px}.template-builder-choices,#template-form .route-editor-fields{grid-template-columns:minmax(0,1fr)}#template-form .quality-grid{grid-template-columns:minmax(0,1fr)}#template-form .modal-actions{flex-wrap:wrap}#template-form .modal-actions>button{flex:1 1 auto}.template-builder-heading>.outline-button{margin:0}}
