/* KeyWorks 1.0: independent touch-ready montage view */
.kw-montage-heading,.kw-montage-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between}.kw-montage-heading p{margin:5px 0}.kw-montage-map{border:1px solid #dfe3e6;background:#f7f8f9;padding:12px 16px;border-radius:8px;margin:14px 0}.kw-montage-map p{margin:0 0 10px}.kw-montage-map .kw-montage-actions{justify-content:flex-start}.kw-montage-toolbar{justify-content:flex-start;margin:14px 0}.kw-montage-toolbar button{width:auto}.kw-montage-report-select{max-width:480px}.kw-montage-tip{font-size:13px;color:#59636b}.kw-montage-pages{display:grid;justify-items:center;gap:24px}.kw-montage-page{position:relative;width:min(100%,778px);aspect-ratio:778/1100;background:white;box-shadow:0 2px 12px #0002;overflow:hidden}.kw-montage-page>img{display:block;width:100%;height:100%;pointer-events:none;user-select:none}.kw-montage-cell{position:absolute;display:flex;align-items:center;text-align:left;border:1px solid transparent;border-radius:0;background:transparent;color:#14377b;padding:1px 3px;min-width:0;min-height:0;font:clamp(7px,1.3vw,12px) Arial,sans-serif;overflow:hidden;cursor:pointer;line-height:1.15}.kw-montage-cell:hover,.kw-montage-cell:focus-visible{background:#fffae5dd;outline:1px solid #bd7f00}.kw-montage-cell-value{display:block;overflow:hidden;overflow-wrap:anywhere;white-space:pre-wrap;max-height:100%}.kw-montage-cell img{max-height:100%;max-width:100%;object-fit:contain}.kw-montage-page[data-page="3"] .kw-montage-cell{align-items:flex-start;font-size:clamp(8px,1.5vw,13px)}#kw-montage-dialog{width:min(92vw,650px);max-height:90vh;border:1px solid #aeb8bf;border-radius:10px;padding:24px;box-shadow:0 10px 40px #0005}#kw-montage-dialog::backdrop{background:#19232c99}#kw-montage-dialog h3{margin-top:0}#kw-montage-dialog input,#kw-montage-dialog textarea{display:block;width:100%;margin:12px 0;background:white}#kw-montage-dialog textarea{font:inherit;border:1px solid #b8bec3;border-radius:6px;padding:10px}#kw-montage-dialog .kw-montage-signature{width:100%;height:auto;touch-action:none;border:1px solid #bbb;background:white}.kw-montage-dialog-buttons{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}.kw-montage-dialog-buttons button{width:auto;flex:1}.kw-montage-field-list{display:grid;gap:4px;max-height:48vh;overflow-y:auto}.kw-montage-field-list button{width:100%;text-align:left;background:#f0f3f5;color:#26313a}.kw-montage-field-list button:hover{background:#e2e8eb}.kw-montage-picker{display:grid;gap:10px}.kw-montage-picker a{padding:10px;border:1px solid #ddd;border-radius:5px;text-decoration:none;color:#27323b}
@media (max-width:900px){body.kw-montage-mode .shell{grid-template-columns:1fr}body.kw-montage-mode .shell>aside{display:none}body.kw-montage-mode .content{padding:10px;max-width:none}body.kw-montage-mode .content section{padding:8px;margin-top:10px}body.kw-montage-mode .kw-page-header{height:auto;min-height:0;padding:5px 0}body.kw-montage-mode .kw-page-header h1{font-size:20px}body.kw-montage-mode .kw-montage-cell{font-size:clamp(6px,1.5vw,11px)} }
@media (max-width:580px){body.kw-montage-mode .kw-montage-page{display:none}body.kw-montage-mode .kw-montage-tip{font-size:14px}body.kw-montage-mode .kw-montage-toolbar button{flex:1 1 43%;}body.kw-montage-mode .kw-montage-map .btn{flex:1;text-align:center}body.kw-montage-mode .kw-montage-pages::after{content:'Auf dem Smartphone „Felder bearbeiten“ verwenden. Für die vollständige Formularansicht ein iPad oder einen größeren Bildschirm nutzen.';font-size:14px;padding:15px;text-align:center;color:#59636b}}
@page{size:A4 portrait;margin:0}
@media print{body.kw-montage-mode{background:white!important}body.kw-montage-mode .shell{display:block!important}body.kw-montage-mode .shell>aside,body.kw-montage-mode .kw-page-header,body.kw-montage-mode .kw-montage-heading,body.kw-montage-mode .kw-montage-map,body.kw-montage-mode .kw-montage-toolbar,body.kw-montage-mode .kw-montage-tip,body.kw-montage-mode .kw-montage-report-select,body.kw-montage-mode #kw-montage-status{display:none!important}body.kw-montage-mode .content,body.kw-montage-mode .content section{padding:0!important;margin:0!important;max-width:none!important;box-shadow:none!important}body.kw-montage-mode .kw-montage-pages{display:block!important}body.kw-montage-mode .kw-montage-page{display:block!important;width:210mm!important;height:297mm!important;box-shadow:none!important;break-after:page;page-break-after:always}body.kw-montage-mode .kw-montage-cell{font-size:9pt!important;border:0!important;background:transparent!important;color:#163275!important}body.kw-montage-mode .kw-montage-page[data-page="3"] .kw-montage-cell{font-size:10pt!important}body.kw-montage-mode .kw-montage-page>img{print-color-adjust:exact;-webkit-print-color-adjust:exact}}

#kw-montage-navigator{display:none;width:auto;background:#535f68}
@media (max-width:900px){#kw-montage-navigator{display:inline-block}body.kw-montage-mode.kw-montage-nav-open .shell>aside{display:flex;position:relative;height:auto}body.kw-montage-mode.kw-montage-nav-open .shell{grid-template-columns:1fr}}
@media print{#kw-montage-navigator{display:none!important}}

.kw-contact-row{border:1px solid #ddd;border-radius:6px;padding:12px;margin:12px 0}.kw-contact-row button{width:auto;margin-left:8px}#kw-contact-add{width:auto;margin-bottom:12px}#kw-customer-table tr[hidden]{display:none!important}

.kw-montage-page button.kw-montage-cell{background:transparent;color:#14377b;padding:0 2px;border:0;box-shadow:none;opacity:1}.kw-montage-page button.kw-montage-cell:hover,.kw-montage-page button.kw-montage-cell:focus-visible{background:#fffae566;outline:1px solid #bd7f00;outline-offset:-1px}.kw-montage-cell:disabled{cursor:default}.kw-sign-cell .kw-montage-cell-value{width:100%;height:100%;display:flex;align-items:flex-end;justify-content:center}.kw-sign-cell img{display:block;width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;mix-blend-mode:multiply}.edit-form a.btn{color:white}.kw-montage-customer-menu{flex:1 1 100%;margin:0}.kw-montage-customer-menu summary{cursor:pointer}.kw-montage-customer-menu .kw-montage-picker{margin-top:10px}.kw-montage-cell[data-kind=fixed]{font-size:clamp(6px,1vw,10px)}
@media print{body.kw-montage-mode .kw-montage-cell:hover{background:transparent!important;outline:0!important}}

.kw-montage-customer-menu{flex:0 1 auto;min-width:0;max-width:100%}.kw-montage-menu-row{align-items:flex-start}.kw-montage-cell[data-kind=fixed]{font-size:clamp(7px,1.2vw,11px);white-space:normal}.kw-montage-cell[data-kind=check]{justify-content:center}.kw-montage-page button.kw-montage-cell[data-kind=fixed]:hover{background:transparent;outline:0}.kw-montage-root .ok{display:block}@media print{body.kw-montage-mode .kw-montage-root>.ok{display:none!important}.kw-montage-page button.kw-montage-cell[data-kind=fixed]{font-size:8pt!important}}

/* Native date/time/decimal inputs: the printed value stays separate from the control. */
.kw-native-cell{padding:0 2px;border:0;overflow:hidden;background:transparent}.kw-native-cell .kw-montage-cell-value{pointer-events:none}.kw-native-cell>input.kw-montage-native{position:absolute;inset:0;width:100%;height:100%;min-width:0;min-height:0;margin:0;padding:0 2px;border:0;border-radius:0;background:transparent;opacity:0;font-size:16px;cursor:pointer;box-sizing:border-box}.kw-native-cell:focus-within{outline:1px solid #bd7f00;outline-offset:-1px}.kw-native-cell>input[type=number]:focus{opacity:1;background:white;color:#14377b;outline:none}.kw-native-cell:has(input[type=number]:focus)>.kw-montage-cell-value{visibility:hidden}.kw-native-cell input::-webkit-calendar-picker-indicator{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;cursor:pointer}.kw-montage-native-row{display:grid;grid-template-columns:1fr minmax(110px,45%);align-items:center;gap:8px;margin:0;padding:5px 0}.kw-montage-native-row input{min-width:0;font-size:16px}#kw-montage-dialog .kw-montage-native-row input{margin:0}#kw-montage-dialog.kw-field-picker #kw-montage-clear,#kw-montage-dialog.kw-field-picker #kw-montage-accept{display:none}@media print{.kw-native-cell>input{display:none!important}.kw-native-cell .kw-montage-cell-value{visibility:visible!important}.kw-native-cell{outline:none!important}}
#kw-montage-mail-dialog{width:min(92vw,560px);max-width:calc(100vw - 20px);max-height:90vh;border:1px solid #aeb8bf;border-radius:10px;padding:20px;overflow:auto}#kw-montage-mail-dialog::backdrop{background:#19232c99}#kw-montage-mail-dialog button{width:100%;margin:5px 0}#kw-montage-mail-dialog .check input{width:auto}#kw-montage-mail-dialog .check{overflow-wrap:anywhere}
@media screen and (max-width:650px){body.kw-montage-mode #kw-montage-navigator{display:none}body.kw-montage-mode .shell.kw-mobile-open>aside{display:flex}body.kw-montage-mode .kw-montage-toolbar button{width:100%;min-height:44px}body.kw-montage-mode .kw-montage-heading{justify-content:stretch}}
@media print{body.kw-montage-mode .kw-montage-page{width:209mm!important;height:295mm!important;break-inside:avoid;page-break-inside:avoid;margin:0!important}body.kw-montage-mode .kw-montage-page:last-child{break-after:auto;page-break-after:auto}body.kw-montage-mode .kw-montage-root>*:not(#kw-montage-form){display:none!important}}

.kw-native-cell>input[inputmode=decimal]:focus{opacity:1;background:white;color:#14377b;outline:none}.kw-native-cell:has(input[inputmode=decimal]:focus)>.kw-montage-cell-value{visibility:hidden}.kw-native-cell>input.kw-montage-native{z-index:2;pointer-events:auto;}

@media screen{.kw-montage-page .kw-native-cell>input[inputmode=decimal]{opacity:1;background:transparent;color:#14377b;font:inherit;pointer-events:auto;-webkit-appearance:none;appearance:none}.kw-montage-page .kw-native-cell:has(>input[inputmode=decimal])>.kw-montage-cell-value{visibility:hidden}.kw-montage-page .kw-native-cell>input[inputmode=decimal]:focus{background:#fffae5;font-size:16px;}}
