.architect{width:min(1100px,96vw);max-height:94dvh;box-sizing:border-box;overflow:auto;padding:22px;border:4px solid #9f8046;border-radius:16px;background:linear-gradient(#f9f1d4,#e4d6ad);color:#342b1b;font:17px Georgia,serif;box-shadow:0 15px 70px #0008}.architect::backdrop{background:#172a2580}.architect header{display:flex;justify-content:space-between;align-items:center;gap:16px}.architect h2{margin:0}.architect button{font:inherit;min-height:42px;padding:9px 12px;border:2px solid #294a40;border-radius:8px;background:#365b4d;color:#fff8df;cursor:pointer}.architect button:disabled{opacity:.45;cursor:default}.architect button[aria-pressed=true]{background:#e4c67a;color:#342b1b;border-color:#98752d}.architect button:focus-visible,.architect svg:focus-visible,.architect input:focus-visible{outline:3px solid #c88b1f;outline-offset:3px}.architect-layout{display:grid;grid-template-columns:230px minmax(0,1fr);gap:20px}.architect aside{background:#fff8df;border:2px solid #b49a60;border-radius:10px;padding:12px}.architect .panes button{width:100%;display:flex;align-items:center;gap:10px;text-align:left}.architect .panes img{width:55px;height:65px}.architect .tools,.architect .adjustments{display:flex;gap:9px;flex-wrap:wrap;margin:10px 0}.architect svg{display:block;width:100%;background:#efe3bd;border:2px solid #b49a60;touch-action:none}.architect .angle{display:block;width:100px;font:inherit;padding:8px;box-sizing:border-box}.architect .status{background:#fff8df;border-left:4px solid #98752d;padding:12px;line-height:1.4}.architect .close{position:sticky;top:0}.architect aside p{font-size:15px;line-height:1.4}@media(max-width:700px){.architect-layout{grid-template-columns:1fr}.architect{padding:14px;font-size:15px}.architect aside{padding:8px}.architect aside h3,.architect aside p{margin:6px 0}.architect .panes button{max-width:320px}.architect h2{font-size:23px}}
.architect{position:fixed;inset:3dvh 0 auto;margin:0 auto}.architect svg{max-height:48dvh}.architect header{position:sticky;top:-22px;background:#f9f1d4;padding:8px 0;z-index:1}
.triangle-template textarea,.architect .fragment-notes textarea{display:block;box-sizing:border-box;width:100%;min-height:70px;font:inherit;padding:8px;border:2px solid #b49a60;background:#fffdf0;border-radius:6px}.template-slots{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.template-slot{display:block;padding:16px;background:#fff8df;border:2px dashed #9f8046;border-radius:10px}.template-slot select{display:block;margin-top:10px;width:100%;font:inherit;padding:9px}.fragment-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px}.fragment-card{padding:12px;background:#fff8df;border:2px solid #b49a60;border-radius:10px}.fragment-card img{width:60px;height:60px;float:left;margin-right:12px}.fragment-card label{display:block;clear:both;padding-top:10px}.template-preview svg{height:190px;width:100%}.triangle-template .measurement-notebook{background:#fff8df;padding:10px;border-radius:8px}.architect .fragment-notes{margin-top:16px}.architect .fragment-notes label{display:block}@media(max-width:700px){.template-slots{grid-template-columns:1fr}}
.architect .panes{max-height:220px;overflow:auto;padding:4px}.architect .panes button{margin-bottom:6px;min-height:54px;font-size:15px}.architect .panes img{width:36px;height:40px}.fragment-badge{display:block;font-size:24px;text-align:center;padding:12px;background:#e5d29a;color:#365b4d;border-radius:8px;margin-top:12px}.triangle-template .fragment-cards{max-height:300px;overflow:auto;padding:4px}

.architect .measure-target{cursor:crosshair}.architect .measure-target:hover,.architect .measure-target:focus{stroke:#c79428;stroke-opacity:.8;outline:none}.fragment-preview{display:flex;align-items:center;justify-content:center;gap:24px;background:#fff8df;border:2px solid #ad914d;border-radius:10px;padding:16px;margin:12px 0}.fragment-preview img{width:90px;height:90px;object-fit:contain}.fragment-preview svg{width:280px;max-width:65%;height:160px;font:20px Georgia;fill:#403019}

.architect .ready-panes{max-height:200px}.architect .reusable-fragments{margin-top:16px;padding-top:12px;border-top:2px solid #b49a60}.architect .reusable-fragments summary{cursor:pointer;font-weight:bold;color:#4b3925;line-height:1.4}.architect .ready-panes button{border:3px solid #ad914d}.architect .fragment-panes{max-height:160px}

/* Fixed dialog shell: only named reference/inventory panes scroll. */
.architect{height:94dvh;max-height:94dvh;overflow:hidden;display:none;padding:16px;gap:10px;flex-direction:column}
.architect[open]{display:flex}.architect header{position:static;flex:0 0 auto;padding:0}.architect>p{margin:0;flex:0 0 auto}.architect .close{position:static}.architect h3{margin:0 0 10px}.architect-layout,.template-layout{flex:1;min-height:0;min-width:0}
.architect-layout{grid-template-columns:260px minmax(0,1fr);gap:14px}.architect-layout>aside,.template-reference{min-height:0;min-width:0;display:flex;flex-direction:column;overflow:hidden}
.architect .scroll-guide{font-size:13px;line-height:1.3;margin:0 0 10px;color:#6e5325;background:#f0e1b5;padding:7px;border-radius:5px;flex:0 0 auto}
.architect-inventory-scroll,.reference-scroll{overflow-y:scroll;overflow-x:hidden;scrollbar-gutter:stable;min-height:0;flex:1;overscroll-behavior:contain;padding-right:8px;scrollbar-color:#98752d #eadab0;scrollbar-width:auto;border-right:2px solid #c4ab72}
.architect-inventory-scroll::-webkit-scrollbar,.reference-scroll::-webkit-scrollbar{width:12px}.architect-inventory-scroll::-webkit-scrollbar-track,.reference-scroll::-webkit-scrollbar-track{background:#eadab0;border-radius:8px}.architect-inventory-scroll::-webkit-scrollbar-thumb,.reference-scroll::-webkit-scrollbar-thumb{background:#98752d;border-radius:8px;border:2px solid #eadab0}
.architect .panes,.architect .ready-panes,.architect .fragment-panes,.triangle-template .fragment-cards{max-height:none;overflow:visible}
.architect-workspace{display:flex;flex-direction:column;min-height:0;min-width:0;gap:8px}.architect-workspace>svg{min-height:0;flex:1;width:100%;max-height:none}.architect .tools,.architect .adjustments{margin:0;gap:7px;flex:0 0 auto}.architect .adjustments{align-items:end}.architect .adjustments button{font-size:14px;min-height:36px;padding:7px}.architect .status{margin:0;padding:9px;font-size:15px;line-height:1.3;flex:0 0 auto}.architect>.status{max-height:4.2em;overflow:auto}.architect .angle{padding:5px;width:90px}
.template-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(270px,34%);gap:14px}.template-workspace{min-height:0;min-width:0;display:flex;flex-direction:column;gap:10px}.template-slots{gap:8px;flex:0 0 auto}.template-slot{padding:10px;min-width:0}.template-slot select{font-size:14px;padding:6px;width:100%;min-width:0}.fragment-badge{font-size:18px;padding:6px;margin-top:6px}.template-workspace>.status{font-size:14px}.template-preview{flex:1;min-height:0;display:flex;flex-direction:column}.template-preview svg{flex:1;min-height:0;height:auto;max-height:none;box-sizing:border-box}.template-preview p{margin:4px 0;font-size:14px}.triangle-template .fragment-cards{grid-template-columns:1fr;padding:0;gap:10px}.triangle-template .fragment-card{font-size:15px}.triangle-template .fragment-card textarea{min-height:60px;height:60px;resize:vertical}.triangle-template .measurement-notebook{font-size:14px;margin-bottom:14px}.measurement-notebook p{margin:0 0 8px}
@media(max-width:700px){.architect{font-size:14px;padding:10px;gap:7px}.architect h2{font-size:21px}.architect-layout{grid-template-columns:minmax(140px,35%) minmax(0,1fr);gap:8px}.architect aside{padding:8px}.architect button{min-height:34px;padding:6px 8px}.architect .tools button,.architect .adjustments button{font-size:12px}.template-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,60%) minmax(0,40%);gap:7px}.template-slots{grid-template-columns:repeat(3,minmax(0,1fr))}.template-slot{padding:5px}.template-slot select{font-size:12px;padding:4px}.fragment-badge{font-size:13px}.template-workspace{gap:6px}.template-workspace>.status{font-size:12px}.template-reference>h3{display:none}.architect .scroll-guide{font-size:11px;margin-bottom:5px;padding:5px}.triangle-template .fragment-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.architect .status{font-size:12px}}
