:root{color-scheme:light;--ink:#35312e;--muted:#756d67;--plum:#694258;--paper:#fffdf8;--line:#ddd5c9;--gold:#ad8b50;--serif:Georgia,'Times New Roman',serif;font-family:'Segoe UI',Arial,sans-serif;font-size:15px;color:var(--ink);background:#ebe7df}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,select,input{border:1px solid #cfc5b9;border-radius:6px;background:#fffdf8;color:var(--ink)}button{padding:.64rem .85rem;cursor:pointer;transition:background .15s,border-color .15s}button:hover{background:#eee7e1;border-color:#a38c9a}button:disabled{opacity:.4;cursor:not-allowed}button:focus-visible,input:focus-visible,select:focus-visible,svg:focus-visible{outline:3px solid #a6789a;outline-offset:2px}.primary{background:var(--plum);color:#fff;border-color:var(--plum)}.primary:hover{background:#513247}.wide{width:100%}input,select{padding:.52rem .6rem;min-width:0}label{display:flex;flex-direction:column;gap:.35rem;color:#5a524b;font-size:.88rem}h1,h2,h3,p{margin:0}h1,h2,h3{font-family:var(--serif);font-weight:normal}h1{font-size:1.9rem}h2{font-size:1.5rem}h3{font-size:1.2rem}p{line-height:1.55}.eyebrow{font-size:.68rem;letter-spacing:.14em;font-weight:600;color:var(--muted);margin-bottom:.25rem}.masthead{padding:1.1rem 1.6rem;display:flex;gap:1rem;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);background:#f7f3eb}.brand{display:flex;gap:.85rem;align-items:center;flex-shrink:0}.monogram{font-family:var(--serif);font-style:italic;font-size:2.9rem;color:var(--plum);width:3.4rem;height:3.4rem;display:grid;place-items:center;border:1px solid #c8af8b;border-radius:50%}.project-actions{display:flex;gap:.45rem;flex-wrap:wrap;justify-content:flex-end}.project-actions button,.project-actions select{font-size:.86rem}#saved-projects{max-width:175px}.project-strip{display:flex;align-items:end;gap:1.4rem;padding:.7rem 1.6rem;background:#fffdf8;border-bottom:1px solid var(--line)}.project-strip label{display:flex;flex-direction:row;align-items:center;gap:.6rem}.project-title{flex:1}.project-title input{width:min(100%,340px);font-weight:600}.project-strip select{padding:.4rem}.project-strip #save-status{font-size:.8rem;color:var(--muted);margin-left:auto;align-self:center}.workspace{display:grid;grid-template-columns:82px minmax(0,1fr) 310px;min-height:620px;height:calc(100dvh - 151px);gap:0}.tools{background:#f7f3eb;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:.5rem;gap:.3rem;overflow:auto}.tools button{border-color:transparent;background:transparent;display:flex;flex-direction:column;align-items:center;gap:.25rem;font-size:.72rem;padding:.55rem .2rem}.tools button span{font-size:1.6rem;height:1.7rem;line-height:1.7rem}.tools button[aria-pressed=true]{background:#694258;color:white}.tools button:hover{border-color:#bca9b5}.tools hr{width:100%;border:0;border-top:1px solid var(--line);margin:.3rem 0}.drawing-area{min-width:0;display:flex;flex-direction:column;overflow:hidden}.canvas-bar{min-height:74px;padding:.65rem 1rem;display:flex;align-items:center;gap:.5rem;justify-content:space-between;background:#f4f0e7;border-bottom:1px solid var(--line)}.canvas-bar strong{font-size:.92rem}.canvas-bar #tool-hint{display:block;font-size:.78rem;color:var(--muted);margin-top:.15rem}.view-actions{display:flex;align-items:center;gap:.35rem;flex-wrap:wrap;justify-content:flex-end}.view-actions button{padding:.35rem .55rem;font-size:.85rem}.view-actions label{flex-direction:row;align-items:center;font-size:.8rem}.view-actions select{font-size:.8rem;padding:.35rem}.view-actions input{accent-color:var(--plum)}#zoom-label{font-size:.75rem;min-width:40px;text-align:center}#canvas-container{position:relative;flex:1;min-height:420px;background:#fffdf7;overflow:hidden}#canvas{width:100%;height:100%;display:block;touch-action:none;user-select:none}#canvas [data-kind]{cursor:move}#canvas-background,#grid-background{pointer-events:none}.canvas-stamp{position:absolute;bottom:20px;left:24px;pointer-events:none;font:italic 1.2rem var(--serif);color:#b9ac95}.canvas-stamp span{font:.55rem 'Segoe UI',sans-serif;letter-spacing:.2em;display:block;margin-top:2px}.canvas-footer{padding:.5rem 1rem;display:flex;justify-content:space-between;gap:1rem;background:#f7f3eb;font-size:.72rem;color:var(--muted);border-top:1px solid var(--line)}.sidebar{background:#f9f5ed;border-left:1px solid var(--line);overflow-y:auto;display:flex;flex-direction:column}.side-tabs{display:flex;padding:.65rem .7rem .1rem;gap:.4rem}.side-tabs button{flex:1;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent}.side-tabs button[aria-pressed=true]{color:var(--plum);border-bottom-color:var(--plum);font-weight:600}#properties-panel,#library-panel{padding:1.1rem}.panel-heading{margin-bottom:1rem}.panel-heading p{color:var(--muted);font-size:.84rem;margin-top:.4rem}.inspector-form{display:grid;gap:.85rem}.two-fields{display:grid;grid-template-columns:1fr 1fr;gap:.7rem}.three-fields{display:grid;grid-template-columns:repeat(3,1fr);gap:.65rem}.inspector-form input{width:100%}.button-row{display:flex;gap:.4rem;flex-wrap:wrap}.button-row button{font-size:.85rem;flex:1}.form-note{font-size:.82rem;color:var(--muted);line-height:1.5}.form-error{color:#a1322c;font-size:.86rem;min-height:1.2em}.form-error:empty{display:none}.issue{background:#fff0e7;color:#94372e;border-left:3px solid #b55b43;padding:.65rem;font-size:.85rem;margin-top:.7rem}.all-clear{background:#e8eee3;color:#44543c;border-left:3px solid #7a916d;padding:.65rem;font-size:.85rem;margin-top:.7rem}.detail-tag{font-size:.7rem;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);margin-bottom:.3rem}.library-card{display:grid;grid-template-columns:68px 1fr;gap:.7rem;text-align:left;width:100%;margin-top:.65rem;padding:.65rem;background:#fffdf8}.library-card svg{width:68px;height:58px}.library-card strong{font-size:.87rem;display:block}.library-card small{display:block;font-size:.76rem;color:var(--muted);margin-top:.2rem}.leyla-note{margin:auto 1rem 1rem;border-top:1px solid var(--line);padding-top:1rem;display:flex;gap:.7rem;align-items:start}.leyla-note img{width:58px;height:72px;object-fit:cover;object-position:50% 25%;border-radius:35px 35px 5px 5px}.leyla-note strong{font:italic 1rem var(--serif);color:var(--plum)}.leyla-note p{font-size:.8rem;color:var(--muted);margin-top:.3rem}.instructions{display:grid;gap:.8rem;margin:1rem 0}.instructions p{font-size:.9rem}.instructions strong{color:var(--plum)}dialog{border:1px solid #bbaaa0;border-radius:13px;background:#fffcf5;color:var(--ink);padding:1.6rem;width:min(560px,calc(100vw - 24px));max-height:90dvh;box-shadow:0 20px 90px #30242740}dialog::backdrop{background:#342d2955;backdrop-filter:blur(3px)}dialog form{display:grid;gap:.95rem}.dialog-heading{display:flex;align-items:start;justify-content:space-between;gap:1rem;margin-bottom:.2rem}.dialog-heading button{padding:.1rem .55rem;font-size:1.4rem}.check{flex-direction:row;align-items:center}.export-buttons{display:flex;gap:.4rem;flex-wrap:wrap}.export-info{background:#efeadf;padding:.8rem;border-radius:5px;font-size:.88rem}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#47313f;color:white;border-radius:8px;box-shadow:0 5px 30px #30222744;padding:1rem 1.4rem;max-width:min(90vw,650px);z-index:20}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}[hidden]{display:none!important}button.danger{color:#9b3f35}input[type=color]{width:100%;height:39px;padding:3px}.subtle{color:var(--muted);font-size:.83rem}
@media(min-width:1600px){.workspace{grid-template-columns:90px minmax(0,1fr) 340px}}@media(max-width:1150px){.masthead{padding:1rem}.brand h1{font-size:1.5rem}.monogram{display:none}.project-strip{padding:.65rem 1rem;gap:.7rem}.project-strip #save-status{display:none}.workspace{grid-template-columns:72px minmax(0,1fr) 270px}.canvas-bar{flex-wrap:wrap}.canvas-footer span:last-child{display:none}.view-actions{justify-content:start}}@media(max-width:780px){.masthead{display:block}.brand{margin-bottom:.8rem}.project-actions{justify-content:start;gap:.35rem}.project-actions button,.project-actions select{font-size:.8rem;padding:.45rem}.project-strip{flex-wrap:wrap}.project-title{flex-basis:100%}.workspace{height:auto;min-height:0;grid-template-columns:1fr}.tools{flex-direction:row;overflow-x:auto;padding:.35rem;border-bottom:1px solid var(--line);border-right:0;position:sticky;top:0;z-index:4}.tools button{min-width:64px}.tools hr{height:40px;width:1px;flex-shrink:0;border-top:0;border-left:1px solid var(--line)}.drawing-area{min-height:530px}.canvas-bar{min-height:95px;padding:.6rem}.canvas-footer{font-size:.68rem;padding:.45rem}.sidebar{border-left:0;border-top:1px solid var(--line)}.leyla-note{margin-top:1rem}#canvas-container{height:420px;flex:auto}.side-tabs{position:sticky;top:64px;background:#f9f5ed;z-index:3}.library-card{grid-template-columns:80px 1fr}#library-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}.library-card{margin:0;grid-template-columns:1fr}.library-card svg{width:100%}#add-custom{margin-bottom:1rem}}@media print{body>*{display:none}body:after{content:'Bitte „Plan exportieren“ und „Druck-PDF öffnen“ verwenden. Dort bleiben die Maße erhalten.';display:block;padding:2cm}}
#canvas [data-action="rotate"]{cursor:grab;outline:none}#canvas [data-action="rotate"]:hover .rotation-knob,#canvas [data-action="rotate"]:focus-visible .rotation-knob{fill:#936180;stroke:#e5c06d}#canvas.rotating,#canvas.rotating *{cursor:grabbing!important}
.library-search{font-size:.94rem;margin-bottom:.85rem}.library-search input{width:100%;font-size:1rem;padding:.65rem}.library-categories{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:.8rem}.library-categories button{display:flex;align-items:center;gap:.45rem;padding:.45rem .6rem;font-size:.88rem;border-radius:20px}.library-categories small{display:inline-grid;place-items:center;min-width:1.35rem;min-height:1.35rem;background:#eee6dc;border-radius:50%;font-size:.76rem}.library-categories button[aria-pressed=true]{background:var(--plum);border-color:var(--plum);color:white}.library-categories button[aria-pressed=true] small{background:#ffffff22;color:white}.library-note{font-size:.86rem;color:var(--muted);margin-bottom:.85rem}.library-count{font-size:.9rem;color:var(--muted);margin:1rem 0 .3rem}.library-group{margin:1.3rem 0}.library-group h3{font-size:1.15rem;color:var(--plum);border-bottom:1px solid var(--line);padding-bottom:.45rem}.library-cards{display:grid;gap:.6rem;margin-top:.65rem}.library-card{margin:0;grid-template-columns:78px minmax(0,1fr);align-items:center;min-height:100px;padding:.6rem;box-shadow:0 2px 6px #40352706}.library-card svg{width:78px;height:80px;background:#f2ede4;border-radius:6px;padding:6px}.library-card strong{font-size:.95rem;line-height:1.3}.library-card small{font-size:.82rem;line-height:1.4}.library-card .furniture-size{color:#4c443e;font-weight:600;margin-top:.35rem}.library-card[aria-pressed=true]{border-color:var(--plum);box-shadow:0 0 0 1px var(--plum);background:#f1e6ed}.library-empty{padding:1.2rem 0;font-size:.94rem;color:var(--muted)}.library-empty button{margin-top:1rem}#library-list{display:block}@media(max-width:780px){.library-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.library-card{grid-template-columns:78px minmax(0,1fr)}.library-card svg{width:78px}.library-group{margin-top:1rem}}@media(max-width:480px){.library-card{grid-template-columns:1fr;align-content:start}.library-card svg{width:100%;height:86px}.library-categories button{font-size:.9rem}.library-card strong{font-size:1rem}}

.room-notch{display:grid;gap:.75rem;border-left:3px solid #c3ae85;padding:.65rem .75rem;background:#f1ebdf}.attach-intro{margin-top:1.5rem;border-top:1px solid var(--line);padding-top:1rem}.attach-intro p{font-size:.85rem;margin:.55rem 0 .8rem;color:var(--muted)}#attach-preview{background:#f2ece1;border:1px solid var(--line);border-radius:8px;padding:.5rem}#attach-preview svg{display:block;width:100%;height:190px}.attach-unit{display:inline;color:var(--muted)}

/* Dialog grids may shrink on small phones without forcing fields offscreen. */
dialog form{grid-template-columns:minmax(0,1fr);min-width:0}dialog label,dialog .two-fields,dialog .three-fields{min-width:0}dialog input:not([type=checkbox]),dialog select{width:100%;min-width:0}dialog .two-fields{grid-template-columns:repeat(2,minmax(0,1fr))}dialog .three-fields{grid-template-columns:repeat(3,minmax(0,1fr))}
#toast.leyla-speech{left:24px;right:auto;bottom:24px;transform:none;display:flex;align-items:end;gap:12px;width:min(560px,calc(100vw - 32px));max-width:none;padding:0;background:transparent;box-shadow:none;color:#fffdf8;border-radius:0;z-index:20;pointer-events:none}
.leyla-speech>img{width:70px;height:88px;flex:none;object-fit:cover;object-position:50% 24%;border-radius:40px 40px 12px 12px;border:2px solid #b99c6f;background:#f1e7d3;box-shadow:0 5px 16px #30242733}
.leyla-speech-bubble{position:relative;flex:1;min-width:0;background:#47313f;border:1px solid #745468;border-radius:18px 18px 18px 4px;box-shadow:0 8px 30px #30242733;padding:.9rem 2.2rem 1rem 1.05rem;pointer-events:auto}
.leyla-speech-bubble:before{content:'';position:absolute;left:-8px;bottom:24px;width:14px;height:14px;background:#47313f;border-left:1px solid #745468;border-bottom:1px solid #745468;transform:rotate(45deg)}
.leyla-speech-bubble strong{display:block;color:#efc9dc;font:italic 1.13rem var(--serif);margin-bottom:.3rem}.leyla-speech-bubble p{font-size:.94rem;line-height:1.5;overflow-wrap:anywhere}.leyla-speech-bubble button{position:absolute;right:5px;top:5px;border:0;background:transparent;color:#ddc5d5;padding:.12rem .45rem;font-size:1.25rem;line-height:1.3}.leyla-speech-bubble button:hover{background:#ffffff16;color:white}
@media(max-width:500px){dialog{padding:1rem}dialog .three-fields{grid-template-columns:1fr}#toast.leyla-speech{left:12px;right:auto;bottom:12px;width:calc(100vw - 24px);gap:10px}.leyla-speech>img{width:52px;height:68px}.leyla-speech-bubble{padding:.8rem 1.9rem .85rem .85rem}.leyla-speech-bubble p{font-size:.89rem}}

.room-quad{display:grid;gap:.75rem;border-left:3px solid #9c7690;padding:.7rem;background:#eee4e9}.quad-guide{display:block;width:100%;max-height:140px}.room-box-size[hidden],.room-quad[hidden],.room-notch[hidden],.stair-count[hidden],.wall-side[hidden]{display:none!important}.obstacle-elevation summary{cursor:pointer;color:var(--plum);padding:.5rem 0}.obstacle-elevation label{margin:.5rem 0}.height-toggle{display:flex;align-items:center;gap:.35rem;white-space:nowrap}.side-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}.side-tabs button{padding:.65rem .35rem}.canvas-footer{flex-wrap:wrap;gap:.4rem}.inspector-form .two-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.inspector-form input,.inspector-form select{min-width:0;width:100%}.inspector-form .check input{width:auto}.inspector-form label{min-width:0}

#building-panel{padding:1.2rem}.height-toggle{flex-direction:row}.height-toggle input{margin:0}.placed-obstacles{margin-top:1.4rem;border-top:1px solid var(--line);padding-top:1rem;display:grid;gap:.6rem}.placed-obstacles button{text-align:left;display:grid;gap:.25rem}.placed-obstacles small{color:var(--muted)}

.project-strip{flex-wrap:wrap}.level-controls{display:flex;align-items:end;gap:.35rem}.level-controls label{flex-direction:row;align-items:center}.level-controls button{padding:.5rem .65rem}.niche-guide{display:block;width:100%;max-height:145px}.ceiling-fields{display:grid;gap:.7rem;background:#eee5ee;border-left:3px solid #94728e;padding:.7rem}.ceiling-fields[hidden],.solid-height[hidden],.stair-target[hidden],.obstacle-elevation[hidden]{display:none!important}.stair-target{display:grid;gap:.6rem}.project-strip .level-controls select{max-width:180px}@media(max-width:780px){.level-controls{flex-basis:100%}.level-controls label{flex:1}.level-controls select{flex:1;max-width:none!important}.canvas-footer #level-elevation{display:inline}}
@media(min-width:781px){.tools{padding-inline:.25rem;scrollbar-width:thin;overflow-x:hidden}.tools button{min-width:0}}
