.mwd-aw-floating-launcher{position:fixed;right:16px;bottom:16px;z-index:9998}
.mwd-aw-floating-launcher .mwd-aw-open-btn{background:#1e73be;color:#fff;border:none;border-radius:24px;padding:12px 16px;cursor:pointer;box-shadow:0 4px 12px rgba(0,0,0,.2)}

.mwd-aw-overlay{position:fixed;inset:0;z-index:9999;display:none}
.mwd-aw-overlay.open{display:block}
.mwd-aw-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.5)}
.mwd-aw-dialog{position:absolute;inset:0;background:#fff;border-radius:0;box-shadow:none;padding:0;max-height:100%;overflow:auto;display:flex;flex-direction:column}
.mwd-aw-close{display:none}
/* Header bar */
.mwd-aw-header{flex:0 0 auto;border-bottom:1px solid #eee}
.mwd-aw-header .header-inner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 16px}
.mwd-aw-header .left{display:flex;align-items:center;gap:10px;min-width:0}
.mwd-aw-header .left .logo{height:36px;width:auto;display:block}
.mwd-aw-header .left .left-text{font-weight:600;color:#222;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mwd-aw-header .right{font-size:14px}
.mwd-aw-header .right a{color:#1e73be;text-decoration:none}
.mwd-aw-header .right a:hover{text-decoration:underline}
.mwd-aw-body{display:flex;gap:16px;flex:1 1 auto;min-height:0;padding:16px}
.mwd-aw-body .left{flex:2;min-width:0;display:flex;flex-direction:column}
.mwd-aw-body .right{flex:0 0 380px;min-width:360px;border-left:1px solid #eee;padding-left:12px;display:flex;flex-direction:column;min-height:0}
.controls{display:flex;flex-wrap:nowrap;gap:16px;align-items:flex-start;border-bottom:1px solid #eee;padding-bottom:10px;margin-bottom:10px;position:sticky;top:0;background:#fff;z-index:2}
.controls .group{margin:0}
.controls .group:nth-child(1){flex:0 0 30%}
.controls .group:nth-child(2){flex:0 0 40%}
.controls .group:nth-child(3){flex:0 0 30%}
/* keep in one row; remove stacking on small screens */
.controls .label{font-weight:700;margin-bottom:6px}
.controls .options{display:grid;gap:8px}
#mwd-aw-profiles{grid-template-columns: repeat(var(--cols, var(--count, 1)), 1fr)}
#mwd-aw-colors{grid-template-columns: repeat(var(--count, 1), 1fr)}
#mwd-aw-shapes{grid-template-columns: repeat(var(--cols, 2), 1fr)}
.controls .btn{border:1px solid #ddd;background:#fafafa;border-radius:8px;padding:8px;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0}
.controls .btn .thumb{width:100%;aspect-ratio:1/1;background:#fff;border-radius:6px;overflow:hidden;display:flex;align-items:center;justify-content:center}
/* erlauben px-basierte Spaltenbreiten (JS setzt grid-template-columns) */
#mwd-aw-profiles,#mwd-aw-shapes{justify-items:stretch}
.controls .btn .thumb img{width:100%;height:100%;object-fit:cover}
.controls .btn .caption{font-size:12px;line-height:1.2;color:#333;text-align:center}
.controls .btn.active{border-color:#1e73be;box-shadow:0 0 0 2px rgba(30,115,190,.2);background:#f5faff}
/* Rotieren-Button halb so hoch wie die anderen Kacheln */
.controls .btn.rotate{width:56px;height:56px;padding:6px;display:inline-flex;flex-direction:column;align-items:center;justify-content:center}
.controls .btn.rotate .thumb{width:100%;height:100%;aspect-ratio:1/1}
.controls .btn.rotate .caption{display:none}
.controls .btn.rotate svg{width:70%;height:70%}
.controls .dims{flex-basis:100%}
.controls .dims .inputs label{margin-right:8px}
.preview{position:relative;border:1px solid #eee;border-radius:8px;padding:8px;background:#fff;display:flex;flex-direction:column;flex:1 1 auto;min-height:0}
.preview .badge{position:absolute;top:8px;left:8px;background:#c00;color:#fff;padding:4px 8px;border-radius:4px;display:none}
.preview .badge.show{display:inline-block}
/* Rotate button in top-right of preview */
.preview .rotate-btn{position:absolute;top:8px;right:8px;z-index:12;border:1px solid #ddd;background:#fff;border-radius:20px;width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 2px 6px rgba(0,0,0,.08);color:#444;padding: 0}
.preview .rotate-btn:hover{border-color:#bbb;background:#fafafa}
.preview .rotate-btn svg{width:20px;height:20px;display:block;stroke:currentColor}
.mwd-aw-canvas-wrap{width:100%;height:auto;overflow:hidden;border:1px dashed #ddd;border-radius:6px;background:#f9f9f9;position:relative;flex:1 1 auto;min-height:220px}
.mwd-aw-stage{position:absolute;left:0;top:0;transform-origin:0 0}
.mwd-aw-dim-overlay{position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;z-index:10}
.mwd-aw-dim-overlay .dim-wrap{position:absolute;display:flex;align-items:center;gap:6px;background:rgba(255,255,255,.92);border:1px solid #ccc;border-radius:16px;padding:4px 8px;box-shadow:0 2px 6px rgba(0,0,0,.08)}
.mwd-aw-dim-overlay .dim-label{font-size:12px;font-weight:600;color:#333}
.mwd-aw-dim-overlay .dim-input{width:80px;pointer-events:auto;background:transparent;border:none;outline:none;font-size:12px;text-align:center}
.mwd-aw-dim-overlay .uom{font-size:12px;color:#666}
.summary .row{margin-bottom:6px}
.summary .card{background:#fff;border:1px solid #eee;border-radius:8px;padding:8px}
/* Right column header same style as controls */
.mwd-aw-body .right .label{font-weight:700;margin:6px 0}
/* Summary area should take available height */
.mwd-aw-body .right .summary{flex:1 1 auto;overflow:auto}
/* Sticky footer with price and actions */
.mwd-aw-body .right .right-footer{position:sticky;bottom:0;background:#fff;border-top:1px solid #eee;padding-top:8px}
.mwd-aw-body .right .right-footer .price{margin:6px 0}
.mwd-aw-body .right .right-footer .price .strike{text-decoration:line-through;color:#999}
.mwd-aw-body .right .right-footer .price .final{font-size:20px;font-weight:700}
.mwd-aw-body .right .right-footer .price .vat{font-size:12px;color:#555;margin-top:4px}
.mwd-aw-body .right .right-footer .actions{display:flex;gap:8px;justify-content:flex-end;align-items:center;padding-top:8px}
.summary-table{width:100%;border-collapse:collapse}
.summary-table th,.summary-table td{padding:6px 8px;border-bottom:1px solid #eee}
.summary-table th{font-weight:600;text-align:left;white-space:nowrap;vertical-align:top;font-size:13px}
.summary-table td{font-size:13px}
.summary-table tr.sep th{padding-top:12px;border-top:2px solid #ddd;border-bottom:none}
.summary-table tbody tr:last-child th,.summary-table tbody tr:last-child td{border-bottom:none}
/* Warning alert */
.summary .alert.warn{display:flex;align-items:flex-start;gap:8px;background:#fff4f4;border:1px solid #f3c2c2;color:#8a1111;border-radius:6px;padding:8px 10px;margin-top:10px}
.summary .alert.warn .ico{margin-top:2px;color:#c00}
.summary .alert.warn .msg{font-weight:600}
.actions{margin-top:16px;display:flex;gap:8px;align-items:center}
.actions .primary{background:#28a745;color:#fff;border:none;border-radius:6px;padding:10px 14px;cursor:pointer}
.actions .secondary{background:#f0f0f0;border:1px solid #ddd;border-radius:6px;padding:10px 14px;cursor:pointer}
.save-link{display:none}
.save-link.show{display:block}

.mwd-aw-dim-overlay .dim-b-wrap{flex-direction:column;align-items:center;text-align:center;max-width:110px}
.mwd-aw-dim-overlay .dim-b-wrap .dim-label,.mwd-aw-dim-overlay .dim-b-wrap .uom{align-self:center}
.mwd-aw-dim-overlay .dim-b-wrap .dim-input{width:68px}

/* Edge badges an den Seiten (nur Rechteck) */
.edge-badge{position:absolute;display:none;align-items:center;gap:6px;background:rgba(255,255,255,.95);border:1px solid #ccc;border-radius:20px;padding:6px 10px;box-shadow:0 2px 6px rgba(0,0,0,.1);pointer-events:auto;z-index:11;font-weight:600;color:#222;cursor:pointer}
.edge-badge:hover{border-color:#999}
.edge-badge.editing{cursor:default}
.edge-badge .pen{opacity:.7;display:inline-flex;align-items:center;justify-content:center}
.edge-badge .uom{font-size:11px;color:#666}
.edge-badge.editing .uom{display:none}
.edge-badge.edge-left,.edge-badge.edge-right{writing-mode:vertical-rl;transform-origin:center;}
.edge-badge.editing.edge-left,.edge-badge.editing.edge-right{writing-mode:initial}
.edge-badge.editing{padding:4px 8px}
.edge-badge .edge-input{width:64px;border:1px solid #bbb;border-radius:12px;padding:2px 6px;font-size:12px;text-align:center}
.edge-badge .edge-ok{margin-left:6px;border:1px solid #bbb;background:#f5f5f5;border-radius:12px;padding:2px 6px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.edge-badge .edge-ok:hover{background:#eee}

/* L-Form Badges analog zu Edge-Badges */
.l-badge{position:absolute;display:none;align-items:center;gap:6px;background:rgba(255,255,255,.95);border:1px solid #ccc;border-radius:20px;padding:6px 10px;box-shadow:0 2px 6px rgba(0,0,0,.1);pointer-events:auto;z-index:11;font-weight:600;color:#222;cursor:pointer}
.l-badge:hover{border-color:#999}
.l-badge.editing{cursor:default}
.l-badge .pen{opacity:.7;display:inline-flex;align-items:center;justify-content:center}
.l-badge .uom{font-size:11px;color:#666}
.l-badge.editing .uom{display:none}
.l-badge.l-vert{writing-mode:vertical-rl;transform-origin:center}
.l-badge.editing.l-vert{writing-mode:initial}
.l-badge .edge-input{width:64px;border:1px solid #bbb;border-radius:12px;padding:2px 6px;font-size:12px;text-align:center}
.l-badge .edge-ok{margin-left:6px;border:1px solid #bbb;background:#f5f5f5;border-radius:12px;padding:2px 6px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.l-badge .edge-ok:hover{background:#eee}

/* Copy modal */
.mwd-aw-copy-modal{position:fixed;inset:0;z-index:10000;display:none}
.mwd-aw-copy-modal.show{display:block}
.mwd-aw-copy-modal .modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.4)}
.mwd-aw-copy-modal .modal-content{position:absolute;left:50%;top:30%;transform:translate(-50%,-30%);background:#fff;border-radius:8px;box-shadow:0 10px 30px rgba(0,0,0,.2);width:min(520px,90vw);overflow:hidden}
.mwd-aw-copy-modal .modal-header{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px solid #eee}
.mwd-aw-copy-modal .modal-header .title{font-weight:700}
.mwd-aw-copy-modal .modal-header .close{border:none;background:transparent;font-size:20px;cursor:pointer}
.mwd-aw-copy-modal .modal-body{display:flex;gap:8px;align-items:center;padding:12px}
.mwd-aw-copy-modal .modal-body input{flex:1 1 auto;border:1px solid #ddd;border-radius:6px;padding:8px 10px;font-size:14px;background:#fafafa}
.mwd-aw-copy-modal .modal-body .copy{border:1px solid #1e73be;background:#1e73be;color:#fff;border-radius:6px;padding:8px 12px;cursor:pointer}

/* Toast */
.mwd-aw-toast{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);background:rgba(0,0,0,.8);color:#fff;padding:10px 14px;border-radius:20px;opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:10001;font-size:14px}
.mwd-aw-toast.show{opacity:1}

/* Warenkorb-Formatierung für unsere Konfigurator-Positionen */
.woocommerce-cart .shop_table tr.mwd-aw-cart-item .variation dt,
.woocommerce-checkout-review-order-table tr.mwd-aw-cart-item .variation dt{font-weight:700;font-size:12px;color:#222}
.woocommerce-cart .shop_table tr.mwd-aw-cart-item .variation dd,
.woocommerce-checkout-review-order-table tr.mwd-aw-cart-item .variation dd{font-size:12px;color:#333}
.woocommerce-cart .shop_table tr.mwd-aw-cart-item .variation dd p,
.woocommerce-checkout-review-order-table tr.mwd-aw-cart-item .variation dd p{margin:0}
.woocommerce-cart .shop_table tr.mwd-aw-cart-item .variation,
.woocommerce-checkout-review-order-table tr.mwd-aw-cart-item .variation{margin:6px 0}

.mwd-aw-floating-launcher{position:fixed;right:16px;bottom:16px;z-index:9998}
.mwd-aw-floating-launcher .mwd-aw-open-btn{background:#1e73be;color:#fff;border:none;border-radius:24px;padding:12px 16px;cursor:pointer;box-shadow:0 4px 12px rgba(0,0,0,.2)}

.mwd-aw-overlay{position:fixed;inset:0;z-index:9999;display:none}
.mwd-aw-overlay.open{display:block}
.mwd-aw-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.5)}
.mwd-aw-dialog{position:absolute;inset:0;background:#fff;border-radius:0;box-shadow:none;padding:0;max-height:100%;overflow:auto;display:flex;flex-direction:column}
.mwd-aw-close{display:none}
/* Header bar */
.mwd-aw-header{flex:0 0 auto;border-bottom:1px solid #eee}
.mwd-aw-header .header-inner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 16px}
.mwd-aw-header .left{display:flex;align-items:center;gap:10px;min-width:0}
.mwd-aw-header .left .logo{height:36px;width:auto;display:block}
.mwd-aw-header .left .left-text{font-weight:600;color:#222;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mwd-aw-header .right{font-size:14px}
.mwd-aw-header .right a{color:#1e73be;text-decoration:none}
.mwd-aw-header .right a:hover{text-decoration:underline}
.mwd-aw-body{display:flex;gap:16px;flex:1 1 auto;min-height:0;padding:16px}
.mwd-aw-body .left{flex:2;min-width:0;display:flex;flex-direction:column}
.mwd-aw-body .right{flex:0 0 380px;min-width:360px;border-left:1px solid #eee;padding-left:12px;display:flex;flex-direction:column;min-height:0}
.controls{display:flex;flex-wrap:nowrap;gap:16px;align-items:flex-start;border-bottom:1px solid #eee;padding-bottom:10px;margin-bottom:10px;position:sticky;top:0;background:#fff;z-index:2}
.controls .group{margin:0}
.controls .group:nth-child(1){flex:0 0 30%}
.controls .group:nth-child(2){flex:0 0 40%}
.controls .group:nth-child(3){flex:0 0 30%}
/* keep in one row; remove stacking on small screens */
.controls .label{font-weight:700;margin-bottom:6px}
.controls .options{display:grid;gap:8px}
#mwd-aw-profiles{grid-template-columns: repeat(var(--cols, var(--count, 1)), 1fr)}
#mwd-aw-colors{grid-template-columns: repeat(var(--count, 1), 1fr)}
#mwd-aw-shapes{grid-template-columns: repeat(var(--cols, 2), 1fr)}
.controls .btn{border:1px solid #ddd;background:#fafafa;border-radius:8px;padding:8px;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0}
.controls .btn .thumb{width:100%;aspect-ratio:1/1;background:#fff;border-radius:6px;overflow:hidden;display:flex;align-items:center;justify-content:center}
/* erlauben px-basierte Spaltenbreiten (JS setzt grid-template-columns) */
#mwd-aw-profiles,#mwd-aw-shapes{justify-items:stretch}
.controls .btn .thumb img{width:100%;height:100%;object-fit:cover}
.controls .btn .caption{font-size:12px;line-height:1.2;color:#333;text-align:center}
.controls .btn.active{border-color:#1e73be;box-shadow:0 0 0 2px rgba(30,115,190,.2);background:#f5faff}
/* Rotieren-Button halb so hoch wie die anderen Kacheln */
.controls .btn.rotate{width:56px;height:56px;padding:6px;display:inline-flex;flex-direction:column;align-items:center;justify-content:center}
.controls .btn.rotate .thumb{width:100%;height:100%;aspect-ratio:1/1}
.controls .btn.rotate .caption{display:none}
.controls .btn.rotate svg{width:70%;height:70%}
.controls .dims{flex-basis:100%}
.controls .dims .inputs label{margin-right:8px}
.preview{position:relative;border:1px solid #eee;border-radius:8px;padding:8px;background:#fff;display:flex;flex-direction:column;flex:1 1 auto;min-height:0}
.preview .badge{position:absolute;top:8px;left:8px;background:#c00;color:#fff;padding:4px 8px;border-radius:4px;display:none}
.preview .badge.show{display:inline-block}
/* Rotate button in top-right of preview */
.preview .rotate-btn{position:absolute;top:8px;right:8px;z-index:12;border:1px solid #ddd;background:#fff;border-radius:20px;width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 2px 6px rgba(0,0,0,.08);color:#444;padding: 0}
.preview .rotate-btn:hover{border-color:#bbb;background:#fafafa}
.preview .rotate-btn svg{width:20px;height:20px;display:block;stroke:currentColor}
.mwd-aw-canvas-wrap{width:100%;height:auto;overflow:hidden;border:1px dashed #ddd;border-radius:6px;background:#f9f9f9;position:relative;flex:1 1 auto;min-height:220px}
.mwd-aw-stage{position:absolute;left:0;top:0;transform-origin:0 0}
.mwd-aw-dim-overlay{position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;z-index:10}
.mwd-aw-dim-overlay .dim-wrap{position:absolute;display:flex;align-items:center;gap:6px;background:rgba(255,255,255,.92);border:1px solid #ccc;border-radius:16px;padding:4px 8px;box-shadow:0 2px 6px rgba(0,0,0,.08)}
.mwd-aw-dim-overlay .dim-label{font-size:12px;font-weight:600;color:#333}
.mwd-aw-dim-overlay .dim-input{width:80px;pointer-events:auto;background:transparent;border:none;outline:none;font-size:12px;text-align:center}
.mwd-aw-dim-overlay .uom{font-size:12px;color:#666}
.summary .row{margin-bottom:6px}
.summary .card{background:#fff;border:1px solid #eee;border-radius:8px;padding:8px}
/* Right column header same style as controls */
.mwd-aw-body .right .label{font-weight:700;margin:6px 0}
/* Summary area should take available height */
.mwd-aw-body .right .summary{flex:1 1 auto;overflow:auto}
/* Sticky footer with price and actions */
.mwd-aw-body .right .right-footer{position:sticky;bottom:0;background:#fff;border-top:1px solid #eee;padding-top:8px}
.mwd-aw-body .right .right-footer .price{margin:6px 0}
.mwd-aw-body .right .right-footer .price .strike{text-decoration:line-through;color:#999}
.mwd-aw-body .right .right-footer .price .final{font-size:20px;font-weight:700}
.mwd-aw-body .right .right-footer .price .vat{font-size:12px;color:#555;margin-top:4px}
.mwd-aw-body .right .right-footer .actions{display:flex;gap:8px;justify-content:flex-end;align-items:center;padding-top:8px}
.summary-table{width:100%;border-collapse:collapse}
.summary-table th,.summary-table td{padding:6px 8px;border-bottom:1px solid #eee}
.summary-table th{font-weight:600;text-align:left;white-space:nowrap;vertical-align:top;font-size:13px}
.summary-table td{font-size:13px}
.summary-table tr.sep th{padding-top:12px;border-top:2px solid #ddd;border-bottom:none}
.summary-table tbody tr:last-child th,.summary-table tbody tr:last-child td{border-bottom:none}
/* Warning alert */
.summary .alert.warn{display:flex;align-items:flex-start;gap:8px;background:#fff4f4;border:1px solid #f3c2c2;color:#8a1111;border-radius:6px;padding:8px 10px;margin-top:10px}
.summary .alert.warn .ico{margin-top:2px;color:#c00}
.summary .alert.warn .msg{font-weight:600}
.actions{margin-top:16px;display:flex;gap:8px;align-items:center}
.actions .primary{background:#28a745;color:#fff;border:none;border-radius:6px;padding:10px 14px;cursor:pointer}
.actions .secondary{background:#f0f0f0;border:1px solid #ddd;border-radius:6px;padding:10px 14px;cursor:pointer}
.save-link{display:none}
.save-link.show{display:block}

.mwd-aw-dim-overlay .dim-b-wrap{flex-direction:column;align-items:center;text-align:center;max-width:110px}
.mwd-aw-dim-overlay .dim-b-wrap .dim-label,.mwd-aw-dim-overlay .dim-b-wrap .uom{align-self:center}
.mwd-aw-dim-overlay .dim-b-wrap .dim-input{width:68px}

/* Edge badges an den Seiten (nur Rechteck) */
.edge-badge{position:absolute;display:none;align-items:center;gap:6px;background:rgba(255,255,255,.95);border:1px solid #ccc;border-radius:20px;padding:6px 10px;box-shadow:0 2px 6px rgba(0,0,0,.1);pointer-events:auto;z-index:11;font-weight:600;color:#222;cursor:pointer}
.edge-badge:hover{border-color:#999}
.edge-badge.editing{cursor:default}
.edge-badge .pen{opacity:.7;display:inline-flex;align-items:center;justify-content:center}
.edge-badge .uom{font-size:11px;color:#666}
.edge-badge.editing .uom{display:none}
.edge-badge.edge-left,.edge-badge.edge-right{writing-mode:vertical-rl;transform-origin:center;}
.edge-badge.editing.edge-left,.edge-badge.editing.edge-right{writing-mode:initial}
.edge-badge.editing{padding:4px 8px}
.edge-badge .edge-input{width:64px;border:1px solid #bbb;border-radius:12px;padding:2px 6px;font-size:12px;text-align:center}
.edge-badge .edge-ok{margin-left:6px;border:1px solid #bbb;background:#f5f5f5;border-radius:12px;padding:2px 6px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.edge-badge .edge-ok:hover{background:#eee}

/* L-Form Badges analog zu Edge-Badges */
.l-badge{position:absolute;display:none;align-items:center;gap:6px;background:rgba(255,255,255,.95);border:1px solid #ccc;border-radius:20px;padding:6px 10px;box-shadow:0 2px 6px rgba(0,0,0,.1);pointer-events:auto;z-index:11;font-weight:600;color:#222;cursor:pointer}
.l-badge:hover{border-color:#999}
.l-badge.editing{cursor:default}
.l-badge .pen{opacity:.7;display:inline-flex;align-items:center;justify-content:center}
.l-badge .uom{font-size:11px;color:#666}
.l-badge.editing .uom{display:none}
.l-badge.l-vert{writing-mode:vertical-rl;transform-origin:center}
.l-badge.editing.l-vert{writing-mode:initial}
.l-badge .edge-input{width:64px;border:1px solid #bbb;border-radius:12px;padding:2px 6px;font-size:12px;text-align:center}
.l-badge .edge-ok{margin-left:6px;border:1px solid #bbb;background:#f5f5f5;border-radius:12px;padding:2px 6px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.l-badge .edge-ok:hover{background:#eee}

/* Copy modal */
.mwd-aw-copy-modal{position:fixed;inset:0;z-index:10000;display:none}
.mwd-aw-copy-modal.show{display:block}
.mwd-aw-copy-modal .modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.4)}
.mwd-aw-copy-modal .modal-content{position:absolute;left:50%;top:30%;transform:translate(-50%,-30%);background:#fff;border-radius:8px;box-shadow:0 10px 30px rgba(0,0,0,.2);width:min(520px,90vw);overflow:hidden}
.mwd-aw-copy-modal .modal-header{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px solid #eee}
.mwd-aw-copy-modal .modal-header .title{font-weight:700}
.mwd-aw-copy-modal .modal-header .close{border:none;background:transparent;font-size:20px;cursor:pointer}
.mwd-aw-copy-modal .modal-body{display:flex;gap:8px;align-items:center;padding:12px}
.mwd-aw-copy-modal .modal-body input{flex:1 1 auto;border:1px solid #ddd;border-radius:6px;padding:8px 10px;font-size:14px;background:#fafafa}
.mwd-aw-copy-modal .modal-body .copy{border:1px solid #1e73be;background:#1e73be;color:#fff;border-radius:6px;padding:8px 12px;cursor:pointer}

/* Toast */
.mwd-aw-toast{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);background:rgba(0,0,0,.8);color:#fff;padding:10px 14px;border-radius:20px;opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:10001;font-size:14px}
.mwd-aw-toast.show{opacity:1}

/* Warenkorb-Formatierung für unsere Konfigurator-Positionen */
.woocommerce-cart .shop_table tr.mwd-aw-cart-item .variation dt,
.woocommerce-checkout-review-order-table tr.mwd-aw-cart-item .variation dt{font-weight:700;font-size:12px;color:#222}
.woocommerce-cart .shop_table tr.mwd-aw-cart-item .variation dd,
.woocommerce-checkout-review-order-table tr.mwd-aw-cart-item .variation dd{font-size:12px;color:#333}
.woocommerce-cart .shop_table tr.mwd-aw-cart-item .variation dd p,
.woocommerce-checkout-review-order-table tr.mwd-aw-cart-item .variation dd p{margin:0}
.woocommerce-cart .shop_table tr.mwd-aw-cart-item .variation,
.woocommerce-checkout-review-order-table tr.mwd-aw-cart-item .variation{margin:6px 0}

/* Edge slider (drag to change length) */
.mwd-aw-edge-slider{position:absolute;pointer-events:auto;z-index:12}
.mwd-aw-edge-slider .track{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(255,255,255,.9);border:1px solid #bbb;border-radius:12px;box-shadow:0 2px 6px rgba(0,0,0,.08)}
.mwd-aw-edge-slider .handle{position:absolute;width:18px;height:18px;background:#1e73be;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.2);cursor:grab}
.mwd-aw-edge-slider.h{height:24px}
.mwd-aw-edge-slider.h .handle{top:50%;transform:translate(-50%,-50%)}
.mwd-aw-edge-slider.v{width:24px}
.mwd-aw-edge-slider.v .handle{left:50%;transform:translate(-50%,-50%)}

/* Responsive enhancements for tablet and mobile */
@media (max-width: 1200px){
  .mwd-aw-body{gap:12px}
  .mwd-aw-body .right{flex:0 0 340px;min-width:320px}
}
@media (max-width: 1024px){
  .mwd-aw-body .right{flex:0 0 320px;min-width:300px}
  .controls{gap:12px}
}
@media (max-width: 768px){
  .mwd-aw-header .left .logo{height:30px}
  .mwd-aw-body{flex-direction:column;padding:12px}
  .mwd-aw-body .right{flex:1 1 auto;min-width:0;border-left:none;border-top:1px solid #eee;padding-left:0;padding-top:12px}
  .controls{position:static;top:auto;border-bottom:1px solid #eee;margin-bottom:8px;padding-bottom:8px;flex-wrap:wrap}
  .controls .group{flex:1 1 100%}
  .controls .group:nth-child(1),
  .controls .group:nth-child(2),
  .controls .group:nth-child(3){flex:1 1 100%}
  /* Three equal columns on mobile (≤768px) for all option groups */
  #mwd-aw-profiles,#mwd-aw-colors,#mwd-aw-shapes{grid-template-columns: repeat(3, 1fr)}
  /* Ensure buttons fill their grid cell and allow text to wrap */
  .controls .btn{padding:10px; width:100%; max-width:100%}
  .controls .btn .caption{white-space:normal; overflow-wrap:anywhere}
  .preview{padding:8px}
  .mwd-aw-canvas-wrap{min-height:200px}
  .mwd-aw-body .right .right-footer .actions{justify-content:stretch;flex-wrap:wrap}
  .mwd-aw-body .right .right-footer .actions .primary,
  .mwd-aw-body .right .right-footer .actions .secondary{flex:1 1 48%; min-width:140px}
  .summary-table th,.summary-table td{padding:6px}
}
@media (max-width: 400px){
  #mwd-aw-profiles,#mwd-aw-colors,#mwd-aw-shapes{grid-template-columns: repeat(auto-fit, minmax(84px, 1fr))}
  .edge-badge,.l-badge{padding:4px 8px}
  .edge-badge .edge-input,.l-badge .edge-input{width:56px}
  .preview .rotate-btn{width:34px;height:34px}
}
/* Additional responsive/mobile footer and tiles uniformity (0.1.70) */
.mwd-aw-edge-slider{touch-action:none}
.mwd-aw-mobile-footer{display:none}
@media (max-width: 768px){
  /* Enforce three columns on mobile/tablet (≤768px) for all option groups */
  #mwd-aw-colors{grid-template-columns: repeat(3, 1fr) !important}
  #mwd-aw-profiles, #mwd-aw-shapes{grid-template-columns: repeat(3, 1fr) !important; justify-content: start; justify-items: stretch}
  .mwd-aw-body{padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));}
  .mwd-aw-mobile-footer{position:fixed;left:0;right:0;bottom:0;z-index:10000;background:#fff;border-top:1px solid #eee;box-shadow:0 -6px 12px rgba(0,0,0,.08);padding:8px 12px;padding-bottom:calc(8px + env(safe-area-inset-bottom, 0px));display:block}
  .mwd-aw-mobile-footer .price .strike{text-decoration:line-through;color:#999}
  .mwd-aw-mobile-footer .price .final{font-size:18px;font-weight:700}
  .mwd-aw-mobile-footer .price .vat{font-size:12px;color:#555;margin-top:4px}
  .mwd-aw-mobile-footer .actions{display:flex;gap:8px;justify-content:space-between;margin-top:6px}
  .mwd-aw-mobile-footer .actions .primary,.mwd-aw-mobile-footer .actions .secondary{flex:1 1 0}
  /* Summary visibility on mobile: let content flow, no forced scroll area */
  .mwd-aw-body .right .summary{flex:0 0 auto; overflow:visible}
}


/* 0.1.73: Over-max legacy badge in preview hidden to avoid confusing red block */
.preview .badge{display:none !important}


/* 0.1.75: Mobile actions buttons half-width with wrapping */
.actions .primary, .actions .secondary{white-space:normal;word-break:break-word;text-align:center}
@media (max-width: 768px){
  .mwd-aw-body .right .right-footer .actions{flex-wrap:wrap;justify-content:space-between}
  .mwd-aw-body .right .right-footer .actions .primary,
  .mwd-aw-body .right .right-footer .actions .secondary{flex:0 0 50%;max-width:50%}
  .mwd-aw-mobile-footer .actions .primary,
  .mwd-aw-mobile-footer .actions .secondary{flex:0 0 50%;max-width:50%}
}

/* 0.1.76: Action buttons (Add to cart / Save) without rounded corners, no spacing, equal heights on all breakpoints */
/* Remove spacing and enforce equal height in right sidebar footer and mobile footer */
.mwd-aw-body .right .right-footer .actions,
.mwd-aw-mobile-footer .actions{gap:0;align-items:stretch}
/* Remove rounded corners and let buttons fill same height */
.mwd-aw-body .right .right-footer .actions .primary,
.mwd-aw-body .right .right-footer .actions .secondary,
.mwd-aw-mobile-footer .actions .primary,
.mwd-aw-mobile-footer .actions .secondary{border-radius:0 !important;display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:56px}
/* On very small screens increase minimum height slightly for better tap targets */
@media (max-width: 768px){
  .mwd-aw-body .right .right-footer .actions .primary,
  .mwd-aw-body .right .right-footer .actions .secondary,
  .mwd-aw-mobile-footer .actions .primary,
  .mwd-aw-mobile-footer .actions .secondary{min-height:60px}
}
/* Cart icon for primary action using CSS pseudo-element (no markup change). Uses currentColor. */
.mwd-aw-body .right .right-footer .actions .primary::before,
.mwd-aw-mobile-footer .actions .primary::before{content:"";display:inline-block;width:18px;height:18px;margin-right:8px;background-color:currentColor;mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/></svg>') no-repeat center / contain}
/* Ensure text wraps nicely after the icon */
.mwd-aw-body .right .right-footer .actions .primary,
.mwd-aw-mobile-footer .actions .primary{white-space:normal;word-break:break-word;text-align:center}

/* Existing styles above ... */
.mwd-aw-floating-launcher{position:fixed;right:16px;bottom:16px;z-index:9998}
.mwd-aw-floating-launcher .mwd-aw-open-btn{background:#1e73be;color:#fff;border:none;border-radius:24px;padding:12px 16px;cursor:pointer;box-shadow:0 4px 12px rgba(0,0,0,.2)}

.mwd-aw-overlay{position:fixed;inset:0;z-index:9999;display:none}
.mwd-aw-overlay.open{display:block}
.mwd-aw-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.5)}
.mwd-aw-dialog{position:absolute;inset:0;background:#fff;border-radius:0;box-shadow:none;padding:0;max-height:100%;overflow:auto;display:flex;flex-direction:column}
.mwd-aw-close{display:none}
/* Header bar */
.mwd-aw-header{flex:0 0 auto;border-bottom:1px solid #eee}
.mwd-aw-header .header-inner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 16px}
.mwd-aw-header .left{display:flex;align-items:center;gap:10px;min-width:0}
.mwd-aw-header .left .logo{height:36px;width:auto;display:block}
.mwd-aw-header .left .left-text{font-weight:600;color:#222;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mwd-aw-header .right{font-size:14px}
.mwd-aw-header .right a{color:#1e73be;text-decoration:none}
.mwd-aw-header .right a:hover{text-decoration:underline}
.mwd-aw-body{display:flex;gap:16px;flex:1 1 auto;min-height:0;padding:16px}
.mwd-aw-body .left{flex:2;min-width:0;display:flex;flex-direction:column}
.mwd-aw-body .right{flex:0 0 380px;min-width:360px;border-left:1px solid #eee;padding-left:12px;display:flex;flex-direction:column;min-height:0}
.controls{display:flex;flex-wrap:nowrap;gap:16px;align-items:flex-start;border-bottom:1px solid #eee;padding-bottom:10px;margin-bottom:10px;position:sticky;top:0;background:#fff;z-index:2}
.controls .group{margin:0}
.controls .group:nth-child(1){flex:0 0 30%}
.controls .group:nth-child(2){flex:0 0 40%}
.controls .group:nth-child(3){flex:0 0 30%}
/* keep in one row; remove stacking on small screens */
.controls .label{font-weight:700;margin-bottom:6px}
.controls .options{display:grid;gap:8px}
#mwd-aw-profiles{grid-template-columns: repeat(var(--cols, var(--count, 1)), 1fr)}
#mwd-aw-colors{grid-template-columns: repeat(var(--count, 1), 1fr)}
#mwd-aw-shapes{grid-template-columns: repeat(var(--cols, 2), 1fr)}
.controls .btn{border:1px solid #ddd;background:#fafafa;border-radius:8px;padding:8px;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0}
.controls .btn .thumb{width:100%;aspect-ratio:1/1;background:#fff;border-radius:6px;overflow:hidden;display:flex;align-items:center;justify-content:center}
/* erlauben px-basierte Spaltenbreiten (JS setzt grid-template-columns) */
#mwd-aw-profiles,#mwd-aw-shapes{justify-items:stretch}
.controls .btn .thumb img{width:100%;height:100%;object-fit:cover}
.controls .btn .caption{font-size:12px;line-height:1.2;color:#333;text-align:center}
.controls .btn.active{border-color:#1e73be;box-shadow:0 0 0 2px rgba(30,115,190,.2);background:#f5faff}
/* Rotieren-Button halb so hoch wie die anderen Kacheln */
.controls .btn.rotate{width:56px;height:56px;padding:6px;display:inline-flex;flex-direction:column;align-items:center;justify-content:center}
.controls .btn.rotate .thumb{width:100%;height:100%;aspect-ratio:1/1}
.controls .btn.rotate .caption{display:none}
.controls .btn.rotate svg{width:70%;height:70%}
.controls .dims{flex-basis:100%}
.controls .dims .inputs label{margin-right:8px}
.preview{position:relative;border:1px solid #eee;border-radius:8px;padding:8px;background:#fff;display:flex;flex-direction:column;flex:1 1 auto;min-height:0}
.preview .badge{position:absolute;top:8px;left:8px;background:#c00;color:#fff;padding:4px 8px;border-radius:4px;display:none}
.preview .badge.show{display:inline-block}
/* Rotate button in top-right of preview */
.preview .rotate-btn{position:absolute;top:8px;right:8px;z-index:12;border:1px solid #ddd;background:#fff;border-radius:20px;width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 2px 6px rgba(0,0,0,.08);color:#444;padding: 0}
.preview .rotate-btn:hover{border-color:#bbb;background:#fafafa}
.preview .rotate-btn svg{width:20px;height:20px;display:block;stroke:currentColor}
.mwd-aw-canvas-wrap{width:100%;height:auto;overflow:hidden;border:1px dashed #ddd;border-radius:6px;background:#f9f9f9;position:relative;flex:1 1 auto;min-height:220px}
.mwd-aw-stage{position:absolute;left:0;top:0;transform-origin:0 0}
.mwd-aw-dim-overlay{position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;z-index:10}
.mwd-aw-dim-overlay .dim-wrap{position:absolute;display:flex;align-items:center;gap:6px;background:rgba(255,255,255,.92);border:1px solid #ccc;border-radius:16px;padding:4px 8px;box-shadow:0 2px 6px rgba(0,0,0,.08)}
.mwd-aw-dim-overlay .dim-label{font-size:12px;font-weight:600;color:#333}
.mwd-aw-dim-overlay .dim-input{width:80px;pointer-events:auto;background:transparent;border:none;outline:none;font-size:12px;text-align:center}
.mwd-aw-dim-overlay .uom{font-size:12px;color:#666}
.summary .row{margin-bottom:6px}
.summary .card{background:#fff;border:1px solid #eee;border-radius:8px;padding:8px}
/* Right column header same style as controls */
.mwd-aw-body .right .label{font-weight:700;margin:6px 0}
/* Summary area should take available height */
.mwd-aw-body .right .summary{flex:1 1 auto;overflow:auto}
/* Sticky footer with price and actions */
.mwd-aw-body .right .right-footer{position:sticky;bottom:0;background:#fff;border-top:1px solid #eee;padding-top:8px}
.mwd-aw-body .right .right-footer .price{margin:6px 0}
.mwd-aw-body .right .right-footer .price .strike{text-decoration:line-through;color:#999}
.mwd-aw-body .right .right-footer .price .final{font-size:20px;font-weight:700}
.mwd-aw-body .right .right-footer .price .vat{font-size:12px;color:#555;margin-top:4px}
.mwd-aw-body .right .right-footer .actions{display:flex;gap:8px;justify-content:flex-end;align-items:center;padding-top:8px}
.summary-table{width:100%;border-collapse:collapse}
.summary-table th,.summary-table td{padding:6px 8px;border-bottom:1px solid #eee}
.summary-table th{font-weight:600;text-align:left;white-space:nowrap;vertical-align:top;font-size:13px}
.summary-table td{font-size:13px}
.summary-table tr.sep th{padding-top:12px;border-top:2px solid #ddd;border-bottom:none}
.summary-table tbody tr:last-child th,.summary-table tbody tr:last-child td{border-bottom:none}
/* Warning alert */
.summary .alert.warn{display:flex;align-items:flex-start;gap:8px;background:#fff4f4;border:1px solid #f3c2c2;color:#8a1111;border-radius:6px;padding:8px 10px;margin-top:10px}
.summary .alert.warn .ico{margin-top:2px;color:#c00}
.summary .alert.warn .msg{font-weight:600}
.actions{margin-top:16px;display:flex;gap:8px;align-items:center}
.actions .primary{background:#28a745;color:#fff;border:none;border-radius:6px;padding:10px 14px;cursor:pointer}
.actions .secondary{background:#f0f0f0;border:1px solid #ddd;border-radius:6px;padding:10px 14px;cursor:pointer}
.save-link{display:none}
.save-link.show{display:block}

.mwd-aw-dim-overlay .dim-b-wrap{flex-direction:column;align-items:center;text-align:center;max-width:110px}
.mwd-aw-dim-overlay .dim-b-wrap .dim-label,.mwd-aw-dim-overlay .dim-b-wrap .uom{align-self:center}
.mwd-aw-dim-overlay .dim-b-wrap .dim-input{width:68px}

/* Edge badges an den Seiten (nur Rechteck) */
.edge-badge{position:absolute;display:none;align-items:center;gap:6px;background:rgba(255,255,255,.95);border:1px solid #ccc;border-radius:20px;padding:6px 10px;box-shadow:0 2px 6px rgba(0,0,0,.1);pointer-events:auto;z-index:11;font-weight:600;color:#222;cursor:pointer}
.edge-badge:hover{border-color:#999}
.edge-badge.editing{cursor:default}
.edge-badge .pen{opacity:.7;display:inline-flex;align-items:center;justify-content:center}
.edge-badge .uom{font-size:11px;color:#666}
.edge-badge.editing .uom{display:none}
.edge-badge.edge-left,.edge-badge.edge-right{writing-mode:vertical-rl;transform-origin:center;}
.edge-badge.editing.edge-left,.edge-badge.editing.edge-right{writing-mode:initial}
.edge-badge.editing{padding:4px 8px}
.edge-badge .edge-input{width:64px;border:1px solid #bbb;border-radius:12px;padding:2px 6px;font-size:12px;text-align:center}
.edge-badge .edge-ok{margin-left:6px;border:1px solid #bbb;background:#f5f5f5;border-radius:12px;padding:2px 6px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.edge-badge .edge-ok:hover{background:#eee}

/* L-Form Badges analog zu Edge-Badges */
.l-badge{position:absolute;display:none;align-items:center;gap:6px;background:rgba(255,255,255,.95);border:1px solid #ccc;border-radius:20px;padding:6px 10px;box-shadow:0 2px 6px rgba(0,0,0,.1);pointer-events:auto;z-index:11;font-weight:600;color:#222;cursor:pointer}
.l-badge:hover{border-color:#999}
.l-badge.editing{cursor:default}
.l-badge .pen{opacity:.7;display:inline-flex;align-items:center;justify-content:center}
.l-badge .uom{font-size:11px;color:#666}
.l-badge.editing .uom{display:none}
.l-badge.l-vert{writing-mode:vertical-rl;transform-origin:center}
.l-badge.editing.l-vert{writing-mode:initial}
.l-badge .edge-input{width:64px;border:1px solid #bbb;border-radius:12px;padding:2px 6px;font-size:12px;text-align:center}
.l-badge .edge-ok{margin-left:6px;border:1px solid #bbb;background:#f5f5f5;border-radius:12px;padding:2px 6px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.l-badge .edge-ok:hover{background:#eee}

/* Copy modal */
.mwd-aw-copy-modal{position:fixed;inset:0;z-index:10000;display:none}
.mwd-aw-copy-modal.show{display:block}
.mwd-aw-copy-modal .modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.4)}
.mwd-aw-copy-modal .modal-content{position:absolute;left:50%;top:30%;transform:translate(-50%,-30%);background:#fff;border-radius:8px;box-shadow:0 10px 30px rgba(0,0,0,.2);width:min(520px,90vw);overflow:hidden}
.mwd-aw-copy-modal .modal-header{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px solid #eee}
.mwd-aw-copy-modal .modal-header .title{font-weight:700}
.mwd-aw-copy-modal .modal-header .close{border:none;background:transparent;font-size:20px;cursor:pointer}
.mwd-aw-copy-modal .modal-body{display:flex;gap:8px;align-items:center;padding:12px}
.mwd-aw-copy-modal .modal-body input{flex:1 1 auto;border:1px solid #ddd;border-radius:6px;padding:8px 10px;font-size:14px;background:#fafafa}
.mwd-aw-copy-modal .modal-body .copy{border:1px solid #1e73be;background:#1e73be;color:#fff;border-radius:6px;padding:8px 12px;cursor:pointer}

/* Toast */
.mwd-aw-toast{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);background:rgba(0,0,0,.8);color:#fff;padding:10px 14px;border-radius:20px;opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:10001;font-size:14px}
.mwd-aw-toast.show{opacity:1}

/* Warenkorb-Formatierung für unsere Konfigurator-Positionen */
.woocommerce-cart .shop_table tr.mwd-aw-cart-item .variation dt,
.woocommerce-checkout-review-order-table tr.mwd-aw-cart-item .variation dt{font-weight:700;font-size:12px;color:#222}
.woocommerce-cart .shop_table tr.mwd-aw-cart-item .variation dd,
.woocommerce-checkout-review-order-table tr.mwd-aw-cart-item .variation dd{font-size:12px;color:#333}
.woocommerce-cart .shop_table tr.mwd-aw-cart-item .variation dd p,
.woocommerce-checkout-review-order-table tr.mwd-aw-cart-item .variation dd p{margin:0}
.woocommerce-cart .shop_table tr.mwd-aw-cart-item .variation,
.woocommerce-checkout-review-order-table tr.mwd-aw-cart-item .variation{margin:6px 0}

.mwd-aw-floating-launcher{position:fixed;right:16px;bottom:16px;z-index:9998}
.mwd-aw-floating-launcher .mwd-aw-open-btn{background:#1e73be;color:#fff;border:none;border-radius:24px;padding:12px 16px;cursor:pointer;box-shadow:0 4px 12px rgba(0,0,0,.2)}

.mwd-aw-overlay{position:fixed;inset:0;z-index:9999;display:none}
.mwd-aw-overlay.open{display:block}
.mwd-aw-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.5)}
.mwd-aw-dialog{position:absolute;inset:0;background:#fff;border-radius:0;box-shadow:none;padding:0;max-height:100%;overflow:auto;display:flex;flex-direction:column}
.mwd-aw-close{display:none}
/* Header bar */
.mwd-aw-header{flex:0 0 auto;border-bottom:1px solid #eee}
.mwd-aw-header .header-inner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 16px}
.mwd-aw-header .left{display:flex;align-items:center;gap:10px;min-width:0}
.mwd-aw-header .left .logo{height:36px;width:auto;display:block}
.mwd-aw-header .left .left-text{font-weight:600;color:#222;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mwd-aw-header .right{font-size:14px}
.mwd-aw-header .right a{color:#1e73be;text-decoration:none}
.mwd-aw-header .right a:hover{text-decoration:underline}
.mwd-aw-body{display:flex;gap:16px;flex:1 1 auto;min-height:0;padding:16px}
.mwd-aw-body .left{flex:2;min-width:0;display:flex;flex-direction:column}
.mwd-aw-body .right{flex:0 0 380px;min-width:360px;border-left:1px solid #eee;padding-left:12px;display:flex;flex-direction:column;min-height:0}
.controls{display:flex;flex-wrap:nowrap;gap:16px;align-items:flex-start;border-bottom:1px solid #eee;padding-bottom:10px;margin-bottom:10px;position:sticky;top:0;background:#fff;z-index:2}
.controls .group{margin:0}
.controls .group:nth-child(1){flex:0 0 30%}
.controls .group:nth-child(2){flex:0 0 40%}
.controls .group:nth-child(3){flex:0 0 30%}
/* keep in one row; remove stacking on small screens */
.controls .label{font-weight:700;margin-bottom:6px}
.controls .options{display:grid;gap:8px}
#mwd-aw-profiles{grid-template-columns: repeat(var(--cols, var(--count, 1)), 1fr)}
#mwd-aw-colors{grid-template-columns: repeat(var(--count, 1), 1fr)}
#mwd-aw-shapes{grid-template-columns: repeat(var(--cols, 2), 1fr)}
.controls .btn{border:1px solid #ddd;background:#fafafa;border-radius:8px;padding:8px;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0}
.controls .btn .thumb{width:100%;aspect-ratio:1/1;background:#fff;border-radius:6px;overflow:hidden;display:flex;align-items:center;justify-content:center}
/* erlauben px-basierte Spaltenbreiten (JS setzt grid-template-columns) */
#mwd-aw-profiles,#mwd-aw-shapes{justify-items:stretch}
.controls .btn .thumb img{width:100%;height:100%;object-fit:cover}
.controls .btn .caption{font-size:12px;line-height:1.2;color:#333;text-align:center}
.controls .btn.active{border-color:#1e73be;box-shadow:0 0 0 2px rgba(30,115,190,.2);background:#f5faff}
/* Rotieren-Button halb so hoch wie die anderen Kacheln */
.controls .btn.rotate{width:56px;height:56px;padding:6px;display:inline-flex;flex-direction:column;align-items:center;justify-content:center}
.controls .btn.rotate .thumb{width:100%;height:100%;aspect-ratio:1/1}
.controls .btn.rotate .caption{display:none}
.controls .btn.rotate svg{width:70%;height:70%}
.controls .dims{flex-basis:100%}
.controls .dims .inputs label{margin-right:8px}
.preview{position:relative;border:1px solid #eee;border-radius:8px;padding:8px;background:#fff;display:flex;flex-direction:column;flex:1 1 auto;min-height:0}
.preview .badge{position:absolute;top:8px;left:8px;background:#c00;color:#fff;padding:4px 8px;border-radius:4px;display:none}
.preview .badge.show{display:inline-block}
/* Rotate button in top-right of preview */
.preview .rotate-btn{position:absolute;top:8px;right:8px;z-index:12;border:1px solid #ddd;background:#fff;border-radius:20px;width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 2px 6px rgba(0,0,0,.08);color:#444;padding: 0}
.preview .rotate-btn:hover{border-color:#bbb;background:#fafafa}
.preview .rotate-btn svg{width:20px;height:20px;display:block;stroke:currentColor}
.mwd-aw-canvas-wrap{width:100%;height:auto;overflow:hidden;border:1px dashed #ddd;border-radius:6px;background:#f9f9f9;position:relative;flex:1 1 auto;min-height:220px}
.mwd-aw-stage{position:absolute;left:0;top:0;transform-origin:0 0}
.mwd-aw-dim-overlay{position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;z-index:10}
.mwd-aw-dim-overlay .dim-wrap{position:absolute;display:flex;align-items:center;gap:6px;background:rgba(255,255,255,.92);border:1px solid #ccc;border-radius:16px;padding:4px 8px;box-shadow:0 2px 6px rgba(0,0,0,.08)}
.mwd-aw-dim-overlay .dim-label{font-size:12px;font-weight:600;color:#333}
.mwd-aw-dim-overlay .dim-input{width:80px;pointer-events:auto;background:transparent;border:none;outline:none;font-size:12px;text-align:center}
.mwd-aw-dim-overlay .uom{font-size:12px;color:#666}
.summary .row{margin-bottom:6px}
.summary .card{background:#fff;border:1px solid #eee;border-radius:8px;padding:8px}
/* Right column header same style as controls */
.mwd-aw-body .right .label{font-weight:700;margin:6px 0}
/* Summary area should take available height */
.mwd-aw-body .right .summary{flex:1 1 auto;overflow:auto}
/* Sticky footer with price and actions */
.mwd-aw-body .right .right-footer{position:sticky;bottom:0;background:#fff;border-top:1px solid #eee;padding-top:8px}
.mwd-aw-body .right .right-footer .price{margin:6px 0}
.mwd-aw-body .right .right-footer .price .strike{text-decoration:line-through;color:#999}
.mwd-aw-body .right .right-footer .price .final{font-size:20px;font-weight:700}
.mwd-aw-body .right .right-footer .price .vat{font-size:12px;color:#555;margin-top:4px}
.mwd-aw-body .right .right-footer .actions{display:flex;gap:8px;justify-content:flex-end;align-items:center;padding-top:8px}
.summary-table{width:100%;border-collapse:collapse}
.summary-table th,.summary-table td{padding:6px 8px;border-bottom:1px solid #eee}
.summary-table th{font-weight:600;text-align:left;white-space:nowrap;vertical-align:top;font-size:13px}
.summary-table td{font-size:13px}
.summary-table tr.sep th{padding-top:12px;border-top:2px solid #ddd;border-bottom:none}
.summary-table tbody tr:last-child th,.summary-table tbody tr:last-child td{border-bottom:none}
/* Warning alert */
.summary .alert.warn{display:flex;align-items:flex-start;gap:8px;background:#fff4f4;border:1px solid #f3c2c2;color:#8a1111;border-radius:6px;padding:8px 10px;margin-top:10px}
.summary .alert.warn .ico{margin-top:2px;color:#c00}
.summary .alert.warn .msg{font-weight:600}
.actions{margin-top:16px;display:flex;gap:8px;align-items:center}
.actions .primary{background:#28a745;color:#fff;border:none;border-radius:6px;padding:10px 14px;cursor:pointer}
.actions .secondary{background:#f0f0f0;border:1px solid #ddd;border-radius:6px;padding:10px 14px;cursor:pointer}
.save-link{display:none}
.save-link.show{display:block}

/* Edge slider (drag to change length) */
.mwd-aw-edge-slider{position:absolute;pointer-events:auto;z-index:12}
.mwd-aw-edge-slider .track{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(255,255,255,.9);border:1px solid #bbb;border-radius:12px;box-shadow:0 2px 6px rgba(0,0,0,.08)}
.mwd-aw-edge-slider .handle{position:absolute;width:18px;height:18px;background:#1e73be;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.2);cursor:grab}
.mwd-aw-edge-slider.h{height:24px}
.mwd-aw-edge-slider.h .handle{top:50%;transform:translate(-50%,-50%)}
.mwd-aw-edge-slider.v{width:24px}
.mwd-aw-edge-slider.v .handle{left:50%;transform:translate(-50%,-50%)}

/* Responsive enhancements for tablet and mobile */
@media (max-width: 1200px){
  .mwd-aw-body{gap:12px}
  .mwd-aw-body .right{flex:0 0 340px;min-width:320px}
}
@media (max-width: 1024px){
  .mwd-aw-body .right{flex:0 0 320px;min-width:300px}
  .controls{gap:12px}
}
@media (max-width: 768px){
  .mwd-aw-header .left .logo{height:30px}
  .mwd-aw-body{flex-direction:column;padding:12px}
  .mwd-aw-body .right{flex:1 1 auto;min-width:0;border-left:none;border-top:1px solid #eee;padding-left:0;padding-top:12px}
  .controls{position:static;top:auto;border-bottom:1px solid #eee;margin-bottom:8px;padding-bottom:8px;flex-wrap:wrap}
  .controls .group{flex:1 1 100%}
  .controls .group:nth-child(1),
  .controls .group:nth-child(2),
  .controls .group:nth-child(3){flex:1 1 100%}
  /* Three equal columns on mobile (≤768px) for all option groups */
  #mwd-aw-profiles,#mwd-aw-colors,#mwd-aw-shapes{grid-template-columns: repeat(3, 1fr)}
  /* Ensure buttons fill their grid cell and allow text to wrap */
  .controls .btn{padding:10px; width:100%; max-width:100%}
  .controls .btn .caption{white-space:normal; overflow-wrap:anywhere}
  .preview{padding:8px}
  .mwd-aw-canvas-wrap{min-height:200px}
  .mwd-aw-body .right .right-footer .actions{justify-content:stretch;flex-wrap:wrap}
  .mwd-aw-body .right .right-footer .actions .primary,
  .mwd-aw-body .right .right-footer .actions .secondary{flex:1 1 48%; min-width:140px}
  .summary-table th,.summary-table td{padding:6px}
}
@media (max-width: 400px){
  #mwd-aw-profiles,#mwd-aw-colors,#mwd-aw-shapes{grid-template-columns: repeat(auto-fit, minmax(84px, 1fr))}
  .edge-badge,.l-badge{padding:4px 8px}
  .edge-badge .edge-input,.l-badge .edge-input{width:56px}
  .preview .rotate-btn{width:34px;height:34px}
}
/* Additional responsive/mobile footer and tiles uniformity (0.1.70) */
.mwd-aw-edge-slider{touch-action:none}
.mwd-aw-mobile-footer{display:none}
@media (max-width: 768px){
  /* Enforce three columns on mobile/tablet (≤768px) for all option groups */
  #mwd-aw-colors{grid-template-columns: repeat(3, 1fr) !important}
  #mwd-aw-profiles, #mwd-aw-shapes{grid-template-columns: repeat(3, 1fr) !important; justify-content: start; justify-items: stretch}
  .mwd-aw-body{padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));}
  .mwd-aw-mobile-footer{position:fixed;left:0;right:0;bottom:0;z-index:10000;background:#fff;border-top:1px solid #eee;box-shadow:0 -6px 12px rgba(0,0,0,.08);padding:8px 12px;padding-bottom:calc(8px + env(safe-area-inset-bottom, 0px));display:block}
  .mwd-aw-mobile-footer .price .strike{text-decoration:line-through;color:#999}
  .mwd-aw-mobile-footer .price .final{font-size:18px;font-weight:700}
  .mwd-aw-mobile-footer .price .vat{font-size:12px;color:#555;margin-top:4px}
  .mwd-aw-mobile-footer .actions{display:flex;gap:8px;justify-content:space-between;margin-top:6px}
  .mwd-aw-mobile-footer .actions .primary,.mwd-aw-mobile-footer .actions .secondary{flex:1 1 0}
  /* Summary visibility on mobile: let content flow, no forced scroll area */
  .mwd-aw-body .right .summary{flex:0 0 auto; overflow:visible}
}


/* 0.1.73: Over-max legacy badge in preview hidden to avoid confusing red block */
.preview .badge{display:none !important}


/* 0.1.75: Mobile actions buttons half-width with wrapping */
.actions .primary, .actions .secondary{white-space:normal;word-break:break-word;text-align:center}
@media (max-width: 768px){
  .mwd-aw-body .right .right-footer .actions{flex-wrap:wrap;justify-content:space-between}
  .mwd-aw-body .right .right-footer .actions .primary,
  .mwd-aw-body .right .right-footer .actions .secondary{flex:0 0 50%;max-width:50%}
  .mwd-aw-mobile-footer .actions .primary,
  .mwd-aw-mobile-footer .actions .secondary{flex:0 0 50%;max-width:50%}
}

/* 0.1.76: Action buttons (Add to cart / Save) without rounded corners, no spacing, equal heights on all breakpoints */
/* Remove spacing and enforce equal height in right sidebar footer and mobile footer */
.mwd-aw-body .right .right-footer .actions,
.mwd-aw-mobile-footer .actions{gap:0;align-items:stretch}
/* Remove rounded corners and let buttons fill same height */
.mwd-aw-body .right .right-footer .actions .primary,
.mwd-aw-body .right .right-footer .actions .secondary,
.mwd-aw-mobile-footer .actions .primary,
.mwd-aw-mobile-footer .actions .secondary{border-radius:0 !important;display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:56px}
/* On very small screens increase minimum height slightly for better tap targets */
@media (max-width: 768px){
  .mwd-aw-body .right .right-footer .actions .primary,
  .mwd-aw-body .right .right-footer .actions .secondary,
  .mwd-aw-mobile-footer .actions .primary,
  .mwd-aw-mobile-footer .actions .secondary{min-height:60px}
}
/* Cart icon for primary action using CSS pseudo-element (no markup change). Uses currentColor. */
.mwd-aw-body .right .right-footer .actions .primary::before,
.mwd-aw-mobile-footer .actions .primary::before{content:"";display:inline-block;width:18px;height:18px;margin-right:8px;background-color:currentColor;mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/></svg>') no-repeat center / contain}
/* Ensure text wraps nicely after the icon */
.mwd-aw-body .right .right-footer .actions .primary,
.mwd-aw-mobile-footer .actions .primary{white-space:normal;word-break:break-word;text-align:center}

/* 0.1.80: Harden summary table against theme overrides (bg/hover) and keep Bootstrap-like compact look */
.summary-table{border-collapse:collapse;color:#212529;vertical-align:top;border-color:#dee2e6;background:#fff}
.summary-table th,.summary-table td{padding:.3rem .5rem;border-top:1px solid #dee2e6;border-bottom:0;background:#fff}
.summary-table thead th{border-bottom:2px solid #dee2e6}
.summary-table tbody tr:first-child th,.summary-table tbody tr:first-child td{border-top:0}
.summary-table th{font-weight:600}
/* Neutralize theme :hover or zebra backgrounds inside overlay */
.mwd-aw-overlay .summary-table tr:hover > th,
.mwd-aw-overlay .summary-table tr:hover > td{background:#fff !important}
.mwd-aw-overlay .summary-table tr > th,
.mwd-aw-overlay .summary-table tr > td{background:#fff}
.summary-table tr.sep th{padding-top:.75rem;border-top:2px solid #dee2e6;border-bottom:0}
@media (max-width: 768px){
  .summary-table th,.summary-table td{padding:.3rem .5rem}
}


/* 0.1.83: Slider should not overlap input badges; ensure lower stacking context */
.mwd-aw-edge-slider{z-index:10}

/* 0.1.87: Mobile fixes – prevent iOS zoom on inputs; ensure slider fits with higher min height */
.mwd-aw-overlay{ -webkit-text-size-adjust: 100%; }
/* Avoid iOS Safari auto-zoom when focusing small inputs by enforcing >=16px font size */
.mwd-aw-dim-overlay .dim-input,
.edge-badge .edge-input,
.l-badge .edge-input{ font-size:16px; line-height:1.3; }
@media (max-width: 768px){
  .mwd-aw-canvas-wrap{ min-height:320px !important; }
}
