/* Shared structure for both directions. Each direction sets the --pd-* colour tokens and the layout. */
.pd-root,.pd-root *,.pd-root *::before,.pd-root *::after{box-sizing:border-box}

.pd-root{font:16px/1.5 "BT Grotesk",Arial,sans-serif;color:var(--pd-ink);background:var(--pd-page)}

.pd-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px clamp(14px,3vw,40px)}
.pd-brand{display:flex;flex-direction:column;gap:2px;min-width:0}
.pd-brand b{font:600 14px/1.3 ui-monospace,Consolas,monospace;letter-spacing:.1em;text-transform:uppercase}
.pd-mocktag{font:13px/1.3 ui-monospace,Consolas,monospace;color:var(--pd-accent-text)}
.pd-lang{font:600 13px/1 ui-monospace,Consolas,monospace;letter-spacing:.08em;padding:10px 14px;border:1px solid var(--pd-ink);background:transparent;color:var(--pd-ink);cursor:pointer;min-height:40px}
.pd-stepper{list-style:none;margin:0;padding:0;display:flex;gap:0}
.pd-stepper li{flex:1;min-width:0}
.pd-step{display:flex;align-items:center;gap:8px;width:100%;padding:10px 8px;border:0;background:transparent;color:inherit;font:600 13px/1.2 ui-monospace,Consolas,monospace;letter-spacing:.06em;text-transform:uppercase;text-align:left;cursor:pointer;min-height:44px}
.pd-step b{display:inline-grid;place-items:center;width:24px;height:24px;border:1px solid currentColor;font-size:13px;flex:0 0 auto}
.pd-step span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pd-step:disabled{opacity:.4;cursor:not-allowed}
.pd-main{display:grid;gap:0}
.pd-cvwrap{position:relative;aspect-ratio:1000/640;width:100%}
.pd-cv{display:block;width:100%;height:100%;touch-action:none;cursor:crosshair;outline-offset:-3px}
.pd-tools{display:flex;flex-wrap:wrap;gap:8px;padding:10px}
.pd-panel{display:flex;flex-direction:column;min-width:0}
.pd-body{flex:1;padding:clamp(14px,2vw,24px)}
.pd-body h2{margin:0 0 12px;font:600 14px/1.3 ui-monospace,Consolas,monospace;letter-spacing:.1em;color:var(--pd-accent-text)}
.pd-body h3{margin:18px 0 6px;font:600 16px/1.3 "BT Grotesk",Arial,sans-serif}
.pd-body p{margin:0 0 10px}
.pd-l{display:block;margin:12px 0 4px;font:600 13px/1.3 ui-monospace,Consolas,monospace;letter-spacing:.06em;text-transform:uppercase;padding:0}
.pd-in{width:100%;min-height:44px;padding:8px 10px;font:16px/1.3 "BT Grotesk",Arial,sans-serif;color:var(--pd-ink);background:var(--pd-field);border:1px solid var(--pd-line-ui);border-radius:0}
.pd-row{display:flex;gap:8px;align-items:stretch}
.pd-row .pd-in{flex:1;min-width:0}
.pd-two>div{flex:1;min-width:0}
.pd-btn{font:600 13px/1.2 ui-monospace,Consolas,monospace;letter-spacing:.06em;text-transform:uppercase;padding:10px 14px;min-height:44px;border:1px solid var(--pd-ink);background:transparent;color:var(--pd-ink);cursor:pointer;border-radius:0}
.pd-btn:hover:not(:disabled){background:var(--pd-hover)}
.pd-btn:disabled{opacity:.4;cursor:not-allowed}
.pd-btn.is-on{background:var(--pd-ink);color:var(--pd-page)}
.pd-primary{background:var(--pd-cta);color:var(--pd-cta-ink);border-color:var(--pd-cta)}
.pd-primary:hover:not(:disabled){background:var(--pd-accent-text);border-color:var(--pd-accent-text);color:#fff}
.pd-ghost{border-style:dashed}
.pd-fs{border:0;margin:8px 0;padding:0;display:flex;flex-wrap:wrap;gap:8px;min-width:0}
.pd-fs legend{padding:0}
.pd-chip{position:relative;display:inline-flex}
.pd-chip input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer}
.pd-chip span{display:inline-flex;align-items:center;min-height:44px;padding:8px 14px;border:1px solid var(--pd-line-ui);font:600 13px/1.2 ui-monospace,Consolas,monospace;letter-spacing:.05em;text-transform:uppercase}
.pd-chip input:checked+span{background:var(--pd-ink);color:var(--pd-page);border-color:var(--pd-ink)}
.pd-chip input:focus-visible+span{outline:3px solid var(--pd-accent);outline-offset:2px}
.pd-seg{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}
.pd-note{font:13px/1.4 ui-monospace,Consolas,monospace;color:var(--pd-muted)}
.pd-tip{margin:0 0 10px}.pd-tip>summary{cursor:pointer;min-height:24px;display:flex;align-items:center;gap:10px;font:600 13px/1.4 ui-monospace,Consolas,monospace;color:var(--pd-muted);list-style:none}.pd-tip>summary::-webkit-details-marker{display:none}.pd-tip>summary::after{content:"+";margin-left:auto;font:400 18px/1 ui-monospace,Consolas,monospace;color:var(--pd-accent)}.pd-tip[open]>summary{margin-bottom:6px}.pd-tip[open]>summary::after{content:"\2212"}
.pd-fold{margin:6px 0;border-left:2px solid var(--pd-line-ui);padding-left:10px}.pd-fold>summary{cursor:pointer;min-height:24px;display:flex;align-items:center;gap:10px;font:600 13px/1.4 ui-monospace,Consolas,monospace;color:var(--pd-muted);list-style:none}.pd-fold>summary::-webkit-details-marker{display:none}.pd-fold>summary::after{content:"+";margin-left:auto;font:400 18px/1 ui-monospace,Consolas,monospace;color:var(--pd-accent)}.pd-fold[open]>summary{margin-bottom:6px}.pd-fold[open]>summary::after{content:"\2212"}.pd-fold>div{margin:0 0 4px}.pd-termslink{display:inline-block;margin:-2px 0 10px 12px;font:600 13px/1.4 ui-monospace,Consolas,monospace}.pd-clink{color:var(--pd-accent-text);text-decoration:underline;word-break:keep-all}
.pd-stat{font:600 13px/1.4 ui-monospace,Consolas,monospace;color:var(--pd-accent-text)}
.pd-cal{margin-top:8px;padding-top:8px;border-top:1px dashed var(--pd-line-ui)}
.pd-foot{padding:12px clamp(14px,2vw,24px) 16px;border-top:1px solid var(--pd-line-ui)}
.pd-block{margin:0 0 8px;min-height:1.4em;font:13px/1.4 ui-monospace,Consolas,monospace;color:var(--pd-accent-text)}
.pd-nav{display:flex;justify-content:space-between;gap:8px}
.pd-root :focus-visible{outline:3px solid var(--pd-accent);outline-offset:2px}
a.pd-inline-link{color:inherit;text-decoration:underline;text-underline-offset:2px}
a.pd-inline-link:hover{color:var(--pd-accent-text,#c7713d)}
/* Compact panel styling for drawing mode: fits viewport without scrolling */
.pd-root.is-draw .pd-panel .pd-body{padding:12px 14px}
.pd-root.is-draw .pd-panel h2{margin:0 0 8px;font-size:13px}
.pd-root.is-draw .pd-panel .pd-l{margin:6px 0 2px;font-size:11px}
.pd-root.is-draw .pd-panel .pd-chip span{min-height:30px;padding:4px 6px;font-size:11px;letter-spacing:.02em;justify-content:center;text-align:center}
.pd-root.is-draw .pd-panel .pd-in{min-height:32px;padding:4px 8px;font-size:13px}
.pd-root.is-draw .pd-panel .pd-btn{min-height:32px;padding:5px 10px;font-size:11.5px}
.pd-root.is-draw .pd-panel .pd-fs{margin:4px 0 6px;gap:4px}
.pd-root.is-draw .pd-panel .pd-fs:has(input[name="hm"]){display:grid;grid-template-columns:repeat(3,1fr);width:100%}
.pd-root.is-draw .pd-panel .pd-fs.pd-shape{display:grid;grid-template-columns:repeat(2,1fr);width:100%}
.pd-root.is-draw .pd-panel .pd-fs.pd-shape .pd-chip,.pd-root.is-draw .pd-panel .pd-fs:has(input[name="hm"]) .pd-chip{width:100%;display:flex}
.pd-root.is-draw .pd-panel .pd-fs.pd-shape .pd-chip span,.pd-root.is-draw .pd-panel .pd-fs:has(input[name="hm"]) .pd-chip span{width:100%}
.pd-root.is-draw .pd-panel .pd-tip{margin:4px 0 6px}
.pd-root.is-draw .pd-panel .pd-tip>summary{font-size:11.5px;min-height:20px}
.pd-root.is-draw .pd-panel .pd-row{gap:6px;margin:4px 0}
.pd-root.is-draw .pd-panel .pd-check{margin:4px 0;font-size:11.5px}
.pd-root.is-draw .pd-panel .pd-foot{padding:8px 14px 10px}
.pd-root.is-draw .pd-panel .pd-block{margin:0 0 4px;font-size:11.5px}
.pd-styles{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.pd-style{display:flex;flex-direction:column;gap:6px;padding:6px;border:1px solid var(--pd-line-ui);background:var(--pd-field);color:inherit;cursor:pointer;text-align:left;font:600 13px/1.2 ui-monospace,Consolas,monospace;text-transform:uppercase;min-height:44px}
.pd-style i{display:block;aspect-ratio:4/3;background:#bbb}
.pd-style.is-on{outline:3px solid var(--pd-accent);outline-offset:-1px;background:var(--pd-hover)}
.pd-style.s0 i{background:linear-gradient(135deg,#9d968b,#6f6a62)}.pd-style.s1 i{background:linear-gradient(135deg,#c8955a,#8c5a2b)}.pd-style.s2 i{background:linear-gradient(135deg,#bcd5de,#6f97a8)}.pd-style.s3 i{background:linear-gradient(135deg,#f4f1ea,#d9d3c6)}
.pd-style.s4 i{background:linear-gradient(135deg,#4a3b30,#231b15)}.pd-style.s5 i{background:linear-gradient(135deg,#7b8a60,#4b5a37)}.pd-style.s6 i{background:linear-gradient(135deg,#a8a8a6,#7d7d7b)}.pd-style.s7 i{background:linear-gradient(135deg,#b4593a,#7a3a24)}
.pd-prog{height:10px;border:1px solid var(--pd-ink);margin:10px 0}
.pd-prog i{display:block;height:100%;background:var(--pd-accent)}
.pd-vars{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-top:12px}
.pd-var{margin:0;border:1px solid var(--pd-line-ui);padding:8px;background:var(--pd-field)}
.pd-var figcaption{font:600 13px/1.3 ui-monospace,Consolas,monospace;letter-spacing:.08em;text-transform:uppercase;margin-bottom:6px}
.pd-wmwrap{position:relative;display:grid;grid-template-columns:1fr 1fr;gap:6px}
.pd-plan,.pd-3d{background:var(--pd-sheet);border:1px solid var(--pd-line-ui)}
.pd-plan svg,.pd-3d svg{display:block;width:100%;height:auto}
.pl-o{fill:none;stroke:var(--pd-plan-line);stroke-width:2.4}.pl-w{stroke:var(--pd-plan-line);stroke-width:1.4}.pl-w2{stroke:var(--pd-plan-line);stroke-width:1;stroke-dasharray:3 2}.pl-f{fill:var(--pd-plan-fill)}.pl-t{font:7px ui-monospace,Consolas,monospace;fill:var(--pd-plan-line)}
.v-g{fill:var(--pd-plan-fill);stroke:var(--pd-plan-line);stroke-width:.8}.v-w{fill:#d8d2c5;stroke:var(--pd-plan-line);stroke-width:.8}.v-r{fill:#c7713d;stroke:var(--pd-plan-line);stroke-width:.8}
.v-r.v0{fill:#8d877c}.v-r.v1{fill:#a87445}.v-r.v2{fill:#7ea1b1}.v-r.v3{fill:#e7e2d6}.v-r.v4{fill:#3a2e25}.v-r.v5{fill:#6d8050}.v-r.v6{fill:#8a8a88}.v-r.v7{fill:#9a4a2e}
.pd-wm{position:absolute;inset:0;pointer-events:none;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='90'><text x='90' y='50' text-anchor='middle' transform='rotate(-24 90 45)' font-family='monospace' font-size='12' font-weight='700' fill='%231a1a18' fill-opacity='.16'>RA DESIGN · radesign.cz</text></svg>")}
.pd-routes{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.pd-route{border:1px solid var(--pd-line-ui);padding:14px;background:var(--pd-field);display:flex;flex-direction:column;gap:6px}
.pd-route h3{margin:0}
.pd-route .pd-btn{margin-top:auto;align-self:flex-start}
.pd-toast{position:fixed;left:50%;bottom:18px;transform:translate(-50%,20px);opacity:0;pointer-events:none;background:var(--pd-ink);color:var(--pd-page);padding:12px 16px;font:600 13px/1.3 ui-monospace,Consolas,monospace;max-width:92vw;transition:.2s;z-index:50}
.pd-toast.is-on{opacity:1;transform:translate(-50%,0)}
.pd-root:not(.is-draw) .pd-stage{display:none}
@media (max-width:900px){.pd-styles{grid-template-columns:repeat(2,1fr)}.pd-routes{grid-template-columns:1fr}.pd-vars{grid-template-columns:1fr}}
@media (max-width:520px){.pd-step span{display:none}.pd-step{justify-content:center}.pd-wmwrap{grid-template-columns:1fr}}

/* DIRECTION A - DRAFTING SHEET: the whole tool is one architect's drawing sheet. Frame, title block, sheet numbers. Light paper. */
.pd-root{--pd-page:#f6f6f1;--pd-ink:#1a1a18;--pd-accent-text:#9a5326;--pd-accent:#c7713d;--pd-cta:#1a1a18;--pd-cta-ink:#f6f6f1;--pd-field:#fbfbf7;--pd-line-ui:rgba(26,26,24,.35);--pd-hover:rgba(199,113,61,.12);--pd-muted:#55534f;
--pd-sheet:#fff;--pd-plan-line:#1a1a18;--pd-plan-fill:#f0ede4;
--pd-bg:#f9f9f4;--pd-map:#e6e2d6;--pd-map2:#e3dfd3;--pd-grid:rgba(26,26,24,.10);--pd-text:#1a1a18;--pd-text2:#77756e;--pd-parcel:#1a1a18;--pd-parcel-fill:rgba(26,26,24,.04);--pd-grey:#8a8a86;--pd-grey-fill:rgba(138,138,134,.28);--pd-red:#d2381c;--pd-red-fill:rgba(210,56,28,.16);--pd-guide:#6b7f93}

.pd-root{max-width:1480px;margin:14px auto;background:var(--pd-page);border:2px solid var(--pd-ink);outline:1px solid var(--pd-ink);outline-offset:-9px;display:grid;grid-template-areas:"head" "main" "steps";position:relative}
.pd-root::before,.pd-root::after{content:"+";position:absolute;font:16px/1 ui-monospace,monospace;color:var(--pd-accent);z-index:2}
.pd-root::before{left:14px;top:14px}.pd-root::after{right:14px;top:14px}
.pd-head{grid-area:head;padding:22px clamp(22px,3vw,44px) 12px;border-bottom:1px dashed var(--pd-line-ui)}
.pd-main{grid-area:main;grid-template-columns:minmax(0,1fr) 400px;padding:0 9px}
.pd-stage{border-right:1px solid var(--pd-ink);padding:14px 0 0 14px}
.pd-cvwrap{border:1px solid var(--pd-ink)}
.pd-root:not(.is-draw) .pd-main{grid-template-columns:minmax(0,1fr)}
.pd-root:not(.is-draw) .pd-panel{max-width:1100px;margin:0 auto;width:100%}
.pd-panel{border-left:0}
.pd-stepper{grid-area:steps;margin:0 9px 9px;border:1px solid var(--pd-ink);border-top:2px solid var(--pd-ink);background:var(--pd-page)}
.pd-stepper li+li{border-left:1px solid var(--pd-ink)}
.pd-stepper .pd-step{flex-direction:column;align-items:flex-start;gap:2px;padding:10px 12px}
.pd-stepper .pd-step b{display:block;border:0;width:auto;height:auto;font-size:12px;color:var(--pd-accent-text);white-space:nowrap}
.pd-stepper .pd-step b::before{content:"SHEET "}
.pd-stepper .pd-step b::after{content:" / 6"}
.pd-stepper .pd-step.is-on{background:var(--pd-ink);color:var(--pd-page)}
.pd-stepper .pd-step.is-on b{color:#e9b58a}
.pd-stepper .pd-step.is-done b::after{content:" / 6 \2713"}
.pd-tools{padding:10px 0 12px}
@media (max-width:900px){
  .pd-main{grid-template-columns:minmax(0,1fr)}
  .pd-stage{border-right:0;padding:12px 0 0}
  .pd-root{margin:0;border-width:1px;outline-offset:-6px}
  .pd-stepper .pd-step b::before{content:""}.pd-stepper .pd-step b::after{content:""}.pd-stepper .pd-step.is-done b::after{content:"\2713"}
}
@media (max-width:520px){.pd-stepper .pd-step{align-items:center}.pd-head{padding:16px 16px 10px}}

/* ===== Task 29 additions: dark tokens, scale/zoom UI, tools bar, legend ===== */
.pd-root[data-theme="dark"]{--pd-page:#1a1a18;--pd-ink:#f6ead9;--pd-accent-text:#e39a63;--pd-accent:#c7713d;--pd-cta:#f6ead9;--pd-cta-ink:#1a1a18;--pd-field:#23231f;--pd-line-ui:rgba(246,234,217,.4);--pd-hover:rgba(199,113,61,.22);--pd-muted:#c2b8a8;
--pd-sheet:#22221f;--pd-plan-line:#f6ead9;--pd-plan-fill:#2a2a26;
--pd-bg:#1a1a18;--pd-map:#2b2a26;--pd-map2:#262521;--pd-grid:rgba(246,234,217,.11);--pd-text:#f6ead9;--pd-text2:#b5ab9b;--pd-parcel:#f6ead9;--pd-parcel-fill:rgba(246,234,217,.05);--pd-grey:#a8a8a2;--pd-grey-fill:rgba(168,168,162,.28);--pd-red:#ff7b5c;--pd-red-fill:rgba(255,123,92,.2);--pd-guide:#7e93a8}


.pd-root[data-theme="dark"] .pd-primary:hover:not(:disabled){color:#1a1a18}
.pd-root[data-theme="dark"] .pd-stepper .pd-step.is-on b{color:#c7713d}
.pd-root[data-theme="dark"] .pd-stepper .pd-step.is-on{color:#1a1a18}
.pd-root[data-theme="dark"] .v-w{fill:#3a382f}.pd-root[data-theme="dark"] .v-g{fill:#2a2a26}
.pd-root[data-theme="dark"] .pd-wm{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='90'><text x='90' y='50' text-anchor='middle' transform='rotate(-24 90 45)' font-family='monospace' font-size='12' font-weight='700' fill='%23f6ead9' fill-opacity='.2'>RA DESIGN · radesign.cz</text></svg>")}
.pd-root[data-theme="dark"] .pd-style.is-on{background:rgba(199,113,61,.22)}
.pd-headr{display:flex;align-items:center;gap:8px}
.pd-scale{font:600 13px/1 ui-monospace,Consolas,monospace;color:var(--pd-accent-text);white-space:nowrap}
.pd-theme{font:600 18px/1 ui-monospace,Consolas,monospace;width:44px;height:44px;border:1px solid var(--pd-ink);background:transparent;color:var(--pd-ink);cursor:pointer}
.pd-lang{min-height:44px}
.pd-tb{display:flex;flex-direction:column;justify-content:center;padding:6px 12px;font:600 12px/1.3 ui-monospace,Consolas,monospace;flex:0 0 auto!important;flex-basis:auto;border-left:1px solid var(--pd-ink);color:var(--pd-accent-text)}
.pd-tb b{color:var(--pd-ink);font-size:13px}
.pd-stepper li:not(.pd-tb){flex:1}
.pd-zoom{display:flex;gap:6px;padding:8px 0 0}
.pd-zoom .pd-btn{min-width:44px;padding:8px;background:var(--pd-page)}
.pd-legend{display:flex;flex-wrap:wrap;gap:6px 16px;padding:8px 0 0;font:13px/1.3 ui-monospace,Consolas,monospace;color:var(--pd-text)}
.pd-lg{display:inline-flex;align-items:center;gap:6px}
.pd-lg svg{width:28px;height:10px}
.pd-lg line{stroke-width:3}.lg-parcel{stroke:var(--pd-parcel)}.lg-exist{stroke:var(--pd-grey)}.lg-new{stroke:var(--pd-red)}
.pd-tools{align-items:center}
.pd-btn.is-on{background:var(--pd-ink);color:var(--pd-page)}
.pd-drawhint{margin:8px 0 0}
@media (max-width:900px){
  .pd-tools{position:sticky;bottom:0;z-index:20;background:var(--pd-page);border-top:1px solid var(--pd-ink);padding:8px 10px;margin:0 -0px}
  .pd-tools .pd-btn{flex:1 1 auto;min-width:0;padding:8px 6px;font-size:12px;letter-spacing:.02em}
  .pd-tools{flex-wrap:wrap;gap:6px}
  .pd-stepper{flex-wrap:wrap}
  .pd-tb{display:none}
}

.pd-tools[hidden],.pd-drawhint[hidden],#pd-draw[hidden]{display:none!important}
@media (max-width:520px){.pd-head{flex-wrap:wrap}.pd-headr{width:100%;flex-wrap:wrap;justify-content:space-between;row-gap:8px}.pd-headr>*{flex:0 0 auto}}



/* ===== Task 30 ===== */
.pd-brand{flex-direction:row;align-items:center;gap:12px}
.pd-brandtx{display:flex;flex-direction:column;gap:2px;min-width:0}
.pd-h1{font:600 clamp(16px,2.4vw,22px)/1.2 ui-monospace,Consolas,monospace;letter-spacing:.08em;text-transform:uppercase}
.pd-sub{font:13px/1.3 ui-monospace,Consolas,monospace;color:var(--pd-text)}
.pd-logo{height:52px;width:auto;max-width:96px;flex:0 0 auto;object-fit:contain;background:#1a1a18;display:block}
.pd-strip{display:flex;align-items:flex-end;gap:16px;padding:8px 10px;border:1px solid var(--pd-ink);border-top:0;font:600 13px/1.2 ui-monospace,Consolas,monospace;color:var(--pd-text);min-height:44px}
.pd-strip[hidden]{display:none}
.pd-st{color:var(--pd-accent-text);flex:1;min-width:0}
.pd-sbar{position:relative;display:block;height:10px;border:solid var(--pd-ink);border-width:0 2px 2px;background:repeating-linear-gradient(90deg,var(--pd-ink) 0 1px,transparent 1px var(--u,10px)) bottom/100% 6px no-repeat;flex:0 0 auto;margin-bottom:6px}
.pd-sbl{position:absolute;left:calc(100% + 8px);top:-3px;font-style:normal;white-space:nowrap}
.pd-north{width:22px;height:33px;flex:0 0 auto;color:var(--pd-ink);margin-left:44px}
.pd-cvwrap{border-bottom:0}
.pd-tabs{display:flex;gap:0;margin:10px 0 6px;border-bottom:1px solid var(--pd-ink)}
.pd-tab{font:600 13px/1.2 ui-monospace,Consolas,monospace;letter-spacing:.06em;text-transform:uppercase;padding:10px 14px;min-height:44px;border:1px solid var(--pd-line-ui);border-bottom:0;background:transparent;color:var(--pd-ink);cursor:pointer}
.pd-tab.is-on{background:var(--pd-ink);color:var(--pd-page);border-color:var(--pd-ink)}
.pd-style{padding:0;gap:0}
.pd-style img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover}
.pd-style b{display:block;padding:8px 8px 2px;font:600 13px/1.25 ui-monospace,Consolas,monospace;text-transform:uppercase;letter-spacing:.03em}
.pd-style span{display:block;padding:0 8px 8px;font:13px/1.35 "BT Grotesk",Arial,sans-serif;text-transform:none;color:var(--pd-muted);font-weight:400}
.pd-mats{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.pd-mat{display:flex;flex-direction:column;padding:0;border:1px solid var(--pd-line-ui);background:var(--pd-field);color:inherit;cursor:pointer;text-align:left}
.pd-mat.is-on{outline:3px solid var(--pd-accent);outline-offset:-1px;background:var(--pd-hover)}
.pd-matimg{position:relative;display:block}
.pd-matimg img{display:block;width:100%;aspect-ratio:1/1;object-fit:cover}
.pd-matimg i{position:absolute;left:0;right:0;bottom:0;height:16px;border-top:2px solid var(--pd-page)}
.pd-mat b{padding:8px;font:600 13px/1.25 ui-monospace,Consolas,monospace;text-transform:uppercase}
.pd-pv{display:block;width:100%;height:auto;border:1px solid var(--pd-line-ui);background:#f4f1e8}
.pd-pv.is-cad{background:var(--pd-sheet)}
.pd-protect,.pd-protect *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-user-drag:none}
.pd-protect canvas{pointer-events:auto}
@media print{.pd-protect,.pd-vars,.pd-exc,.pd-ex,.pd-dlg{display:none!important}}
.pd-route h4{margin:10px 0 2px;font:600 13px/1.3 ui-monospace,Consolas,monospace;letter-spacing:.08em;text-transform:uppercase;color:var(--pd-accent-text)}
.pd-ul{margin:0 0 6px;padding-left:18px}.pd-ul li{margin:2px 0}
.pd-meta{font:13px/1.4 ui-monospace,Consolas,monospace;margin:4px 0}
.pd-price{font:600 14px/1.3 ui-monospace,Consolas,monospace;color:var(--pd-accent-text);margin:6px 0}
.pd-lvl{border-top:1px dashed var(--pd-line-ui);padding:8px 0 4px}.pd-lvl.is-on{background:var(--pd-hover)}
.pd-ex{display:flex;align-items:center;gap:10px;min-height:44px;padding:4px;border:1px solid var(--pd-line-ui);background:transparent;color:var(--pd-ink);cursor:pointer;font:600 13px/1.2 ui-monospace,Consolas,monospace;text-transform:uppercase;align-self:flex-start;margin:4px 0}
.pd-exc{width:72px;height:48px;display:block;border:1px solid var(--pd-line-ui)}
.pd-routes{grid-template-columns:repeat(3,minmax(0,1fr))}
.pd-tblwrap{margin:8px 0 12px}
.pd-tbl{width:100%;border-collapse:collapse;font-size:14px}
.pd-tbl th,.pd-tbl td{border:1px solid var(--pd-line-ui);padding:8px 10px;text-align:left;vertical-align:top}
.pd-tbl thead th{background:var(--pd-ink);color:var(--pd-page);font:600 13px/1.3 ui-monospace,Consolas,monospace}
.pd-tbl tbody th{font:600 13px/1.3 ui-monospace,Consolas,monospace;text-transform:uppercase;width:16%}
.pd-cap{position:absolute;left:-9999px}
.pd-map{display:block;width:100%;max-width:520px;height:auto;margin:8px 0}
.mp-root{fill:var(--pd-ink)}.mp-rt{fill:var(--pd-page);font:600 14px ui-monospace,Consolas,monospace;letter-spacing:.1em}
.mp-node{fill:var(--pd-field);stroke:var(--pd-ink);stroke-width:1.5}.mp-ln{stroke:var(--pd-ink);stroke-width:1.5;fill:none}
.mp-l1{fill:var(--pd-ink);font:600 14px "BT Grotesk",Arial,sans-serif}.mp-l2{fill:var(--pd-text);font:12.5px "BT Grotesk",Arial,sans-serif}
.pd-dlg{max-width:min(860px,94vw);width:100%;border:2px solid var(--pd-ink);background:var(--pd-page);color:var(--pd-ink);padding:12px}
.pd-dlg::backdrop{background:rgba(0,0,0,.6)}
.pd-sample{display:block;width:100%;height:auto;border:1px solid var(--pd-line-ui)}
@media (max-width:900px){
  .pd-routes{grid-template-columns:1fr}
  .pd-mats{grid-template-columns:repeat(2,1fr)}
  .pd-logo{height:40px;max-width:72px}
  .pd-tbl thead{position:absolute;left:-9999px}
  .pd-tbl tr{display:block;border:1px solid var(--pd-line-ui);margin-bottom:8px}
  .pd-tbl th,.pd-tbl td{display:block;border:0;width:auto!important}
  .pd-tbl tbody th{background:var(--pd-hover)}
  .pd-tbl td::before{content:attr(data-label);display:block;font:600 12px/1.3 ui-monospace,Consolas,monospace;color:var(--pd-accent-text);text-transform:uppercase}
  .pd-north{margin-left:auto}
}
/* ===== Task 32 ===== */
.lg-set{stroke:var(--pd-accent);stroke-dasharray:3 3}
.pd-warn{margin:8px 0;padding:8px 10px;border:1px solid var(--pd-accent-text);color:var(--pd-accent-text);font:600 13px/1.4 ui-monospace,Consolas,monospace}
.pd-routes{display:flex;flex-direction:column;gap:14px}
.pd-routes2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.pd-feat{border:2px solid var(--pd-ink);padding:clamp(14px,2vw,24px)}
.pd-feat h3{font-size:22px}
.pd-lead{font-size:17px}
.pd-levels{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.pd-levels .pd-lvl{border:1px solid var(--pd-line-ui);border-top:1px solid var(--pd-line-ui);padding:10px;display:flex;flex-direction:column}
.pd-levels .pd-lvl .pd-ex{margin-top:auto}
.pd-pricenote{margin-top:10px}
@media (max-width:900px){.pd-routes2,.pd-levels{grid-template-columns:1fr}}
/* ===== Task 33 ===== */
.pd-key{list-style:none;margin:8px 0 0;padding:8px 10px;background:var(--pd-field);border:1px solid var(--pd-line-ui);display:flex;flex-wrap:wrap;gap:6px 14px;font:500 11px/1.35 ui-monospace,Consolas,monospace;letter-spacing:.03em;color:var(--pd-text)}
.pd-key li{display:inline-flex;align-items:center;gap:6px}.pd-key i{display:inline-block;width:13px;height:13px;border:1px solid var(--pd-ink);flex:0 0 13px}
.pd-consent{display:flex;gap:10px;align-items:flex-start;margin:12px 0 8px;padding:10px;border:1px solid var(--pd-ink);cursor:pointer}
.pd-consent input{width:22px;height:22px;flex:0 0 auto;margin:1px 0 0;accent-color:var(--pd-accent)}
.pd-credit{font-weight:600;margin:8px 0}
.pd-plannote{margin-top:12px}
/* ===== Task 34 ===== */
.pd-map{max-width:none}
.pd-mapl{display:none}
.pd-mapl-root{background:var(--pd-ink);color:var(--pd-page);font:600 14px/1 ui-monospace,Consolas,monospace;letter-spacing:.1em;padding:12px;text-align:center}
.pd-mapl-n{border:1px solid var(--pd-ink);border-top:0;background:var(--pd-field);padding:10px 12px;display:flex;flex-direction:column;gap:2px}
.pd-mapl-n span{color:var(--pd-text);font-size:14px}
@media (max-width:760px){.pd-map-h{display:none}.pd-mapl{display:block}}
.pd-cr{display:block;padding:0 8px 8px;font:11px/1.35 ui-monospace,Consolas,monospace;color:var(--pd-muted);text-transform:none;font-weight:400}
.pd-mat b{padding:8px}
.pd-mat img{aspect-ratio:1/1}
.pd-exview{position:relative;touch-action:pan-y;outline-offset:2px}
.pd-exim{display:block;width:100%;height:auto;border:1px solid var(--pd-line-ui)}
.pd-exnav{display:flex;align-items:center;justify-content:center;gap:16px;margin:8px 0;font:600 13px ui-monospace,Consolas,monospace}
.pd-exnav[hidden]{display:none}
.pd-exnav .pd-btn{min-width:56px;font-size:20px}
.pd-dlg{overflow:auto;max-height:94vh}
.pd-map-h{max-width:820px}

.pd-mat{min-width:0}
.pd-mat img{display:block;width:100%;height:auto;aspect-ratio:1/1;object-fit:cover}

/* ===== Task 35 ===== */
.pd-modes{display:grid;gap:10px;margin-top:8px}
.pd-mode{display:flex;flex-direction:column;gap:4px;text-align:left;padding:14px;border:1px solid var(--pd-ink);background:var(--pd-field);color:var(--pd-ink);cursor:pointer;min-height:44px}
.pd-mode:hover{background:var(--pd-hover)}
.pd-mode b{font:600 15px/1.3 "BT Grotesk",Arial,sans-serif}
.pd-mode span{font:13px/1.4 ui-monospace,Consolas,monospace;color:var(--pd-muted)}
.pd-check{display:flex;align-items:center;gap:10px;min-height:44px;margin:4px 0;font:600 13px/1.3 ui-monospace,Consolas,monospace;text-transform:uppercase;letter-spacing:.05em;cursor:pointer}
.pd-check input{width:22px;height:22px;accent-color:var(--pd-accent)}
.pd-range{width:100%;accent-color:var(--pd-accent);min-height:32px}
.pd-sample[hidden],.pd-exim[hidden]{display:none}

/* Task 37 */
.pd-sugl{list-style:none;margin:4px 0;padding:0;display:flex;flex-direction:column;gap:4px}
.pd-sugl .pd-btn{width:100%;text-align:left;text-transform:none;font-size:14px;letter-spacing:0}

/* Task 38 */
.pd-mapsec{text-align:center}.pd-mapsec h3{text-align:center}.pd-map-h{margin-inline:auto}.pd-mapl{text-align:left}

/* Task 41 */
.pd-full{display:inline-flex;align-items:center;text-decoration:none;margin:6px 0}
.pd-full[hidden]{display:none}

/* Task 40 (concepts) */
.pd-wmwrap{grid-template-columns:1fr!important}

/* Task 40: map loading + areas */
.pd-maploading{position:absolute;left:10px;right:10px;top:10px;padding:8px 10px;background:var(--pd-bg);border:1px dashed var(--pd-accent);display:flex;flex-direction:column;gap:6px;font:600 13px/1.3 ui-monospace,Consolas,monospace;z-index:5}
.pd-maploading[hidden]{display:none}
.pd-maploading[data-mode=sharp]{padding:0;border:0;background:transparent;left:0;right:0;top:0}
.pd-maploading[data-mode=sharp] .pd-ml-t{display:none}
.pd-ml-bar{display:block;height:3px;background:linear-gradient(90deg,transparent,var(--pd-accent),transparent);background-size:40% 100%;background-repeat:no-repeat;animation:pdml 1.1s linear infinite}
.pd-maploading[data-mode=slow] .pd-ml-bar{display:none}
.pd-ml-retry{align-self:flex-start;min-height:36px}
@keyframes pdml{from{background-position:-40% 0}to{background-position:140% 0}}
@media (prefers-reduced-motion:reduce){.pd-ml-bar{animation:none;background:var(--pd-accent);opacity:.5}}
.pd-areas{margin:8px 0;border:1px solid var(--pd-line-ui)}
.pd-arow{display:flex;justify-content:space-between;gap:10px;padding:6px 10px;border-bottom:1px solid var(--pd-line-ui);font:13px/1.35 ui-monospace,Consolas,monospace}
.pd-arow:last-of-type{border-bottom:0}
.pd-arow b{white-space:nowrap}
.pd-arow.is-ref span::after{content:" *";color:var(--pd-accent-text)}
.pd-areas .pd-warn{margin:0;border:0;border-top:1px solid var(--pd-line-ui)}
.pd-stages{margin:18px 0;padding:14px;border:1px solid var(--pd-line-ui);background:var(--pd-field)}
.pd-stages h4{margin:0 0 8px}
.pd-stage-h{display:none}      /* the fixed-height SVG cropped the text of steps 3 and 4: replaced by auto-height boxes */
.pd-stagel{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;list-style:none;margin:0;padding:0;counter-reset:pdst}
.pd-stagel li{display:flex;flex-direction:column;gap:6px;padding:12px 12px 14px;border:1px solid var(--pd-ink);background:var(--pd-field);height:auto;min-width:0;overflow-wrap:break-word;hyphens:manual}
.pd-stagel li b{font-size:1.02em;line-height:1.25}
.pd-stagel li span{line-height:1.45}
.pd-stageline{margin:8px 0 0;font-weight:600}
.mp-num{fill:var(--pd-ink)}.mp-numt{fill:var(--pd-page);font:700 15px ui-monospace,Consolas,monospace}
.mp-arrow{marker-end:none}
@media (max-width:1100px){.pd-stagel{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:560px){.pd-stagel{grid-template-columns:1fr}}
.pd-order{margin-top:18px;padding-top:12px;border-top:1px dashed var(--pd-line-ui)}
.pd-two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:600px){.pd-two{grid-template-columns:1fr}}
.pd-ta{width:100%;box-sizing:border-box;font:inherit;resize:vertical}
.pd-attach{margin:10px 0;padding:8px 10px;border:1px solid var(--pd-line-ui)}
.pd-tbl2 tbody th{width:18%}

.pd-choice{max-width:900px;margin:0 auto;padding:24px 16px 40px}
.pd-ch-h{margin:0 0 8px}
.pd-two-choice{grid-template-columns:1fr 1fr}
.pd-two-choice .pd-mode{min-height:120px}
@media (max-width:640px){.pd-two-choice{grid-template-columns:1fr}}
.pd-oplist{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px}
.pd-oplist .pd-btn{width:100%;text-align:left}
#pd-switch{font-size:12px;padding:6px 10px;min-height:36px}
.pd-int .pd-stepper .pd-step b::after{content:" / 5"}.pd-int .pd-stepper .pd-step.is-done b::after{content:" / 5 \2713"}
@media (max-width:900px){.pd-int .pd-stepper .pd-step b::after{content:""}.pd-int .pd-stepper .pd-step.is-done b::after{content:"\2713"}}

.pd-hp{position:absolute!important;left:-10000px;width:1px;height:1px;overflow:hidden}
.pd-sent{padding:14px;border:1px solid var(--pd-ink);background:var(--pd-field)}
/* BLOCK38: one row of the panel's own buttons under the order number; no new colour, radius or type */
.pd-sent-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:12px}
.pd-embedded .pd-brand,.pd-embedded #pd-lang,.pd-embedded #pd-demo,.pd-embedded .pd-mocktag{display:none!important}
.pd-embedded .pd-head{justify-content:flex-end}

/* S31 technical drawing in the last interior step */
.pd-tech{margin:14px 0}.pd-tech svg{display:block;max-width:100%;height:auto;border:1px solid var(--pd-line,#d8d2c4);background:#fff}

/* S2: address search state */
.pd-searching{display:flex;align-items:center;gap:8px}.pd-spin{width:14px;height:14px;border:2px solid var(--pd-line,#bbb);border-top-color:var(--pd-accent,#c7713d);border-radius:50%;display:inline-block;animation:pd-spin .8s linear infinite}@keyframes pd-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.pd-spin{animation:none}}

/* S2 */
.pd-detect{border:1px solid var(--pd-accent,#c7713d);padding:10px 12px;margin:10px 0}.pd-detect .pd-col{display:flex;flex-direction:column;gap:8px;align-items:flex-start}.pd-detect p{margin:0 0 8px}

/* I: wall elevations under the concepts */
.pd-elevs{position:relative;margin-top:10px;border-top:1px solid var(--pd-line,#d8d2c4);padding-top:6px}.pd-elevs h4{margin:0 0 6px}.pd-elev svg{display:block;width:100%;height:auto;background:#fff;margin-bottom:6px}

/* PATCH-B */
.pd-route-art{float:right;width:min(36%,300px);margin:0 0 10px 24px;color:var(--pd-ink)}.pd-route-art svg{width:100%;height:auto;display:block}.pd-route-art figcaption{font:600 12px/1.3 ui-monospace,Consolas,monospace;letter-spacing:.08em;text-transform:uppercase;text-align:center;margin-top:4px;color:var(--pd-accent-text)}
.pd-routes .pd-route::after{content:"";display:block;clear:both}
@media (max-width:700px){.pd-route-art{float:none;width:min(70%,260px);margin:12px auto 4px}}
.pd-two-choice .pd-mode{min-height:170px;padding:22px 24px}.pd-two-choice .pd-mode b{font-size:clamp(22px,2.2vw,30px);line-height:1.1;margin-bottom:8px;display:block}.pd-two-choice .pd-mode span{font-size:clamp(15px,1.3vw,18px);line-height:1.45}

/* Start now choice (order form) */
.pd-startnow{border:1px solid var(--pd-line,#c9c6bc);margin:14px 0 6px;padding:10px 12px 4px;min-width:0}
.pd-startnow legend{padding:0 6px}
.pd-sn-opt{align-items:flex-start;margin:6px 0}
.pd-sn-opt b{font-weight:600}
.pd-sn-opt span{font-weight:400;font-size:.92em;line-height:1.45}
.pd-sn-opt span b{font-weight:700;font-size:1.05em}

/* drawing aids: typed length + direction buttons */
.pd-dd{margin:10px 0 0}.pd-ddrow{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:6px 0}.pd-ddin{max-width:9rem}.pd-dirs .pd-btn{min-width:2.6rem}.pd-dirs .pd-btn[aria-pressed=true]{background:var(--pd-ink,#1a1a18);color:var(--pd-page,#f6f6f1)}

.pd-alts{margin:12px 0;display:flex;flex-wrap:wrap;gap:8px;align-items:center}.pd-alts .pd-note{flex-basis:100%;margin:0}

/* Start now: payment block inside the 'order received' box */
.pd-pay{margin-top:14px;padding-top:12px;border-top:1px solid var(--pd-line,currentColor)}
.pd-pay h5{margin:0 0 6px;font:600 13px/1.3 var(--pd-mono,ui-monospace,monospace);letter-spacing:.08em;text-transform:uppercase}
.pd-pay-24{margin:0 0 10px}
.pd-pay-row{display:flex;gap:18px;align-items:flex-start;flex-wrap:wrap}
.pd-pay dl{display:grid;grid-template-columns:max-content 1fr;gap:3px 14px;margin:0;flex:1 1 220px;min-width:0}
.pd-pay dt{opacity:.7}.pd-pay dd{margin:0;word-break:break-word;font-weight:600}
.pd-pay .pd-qr{width:176px;height:176px;flex:0 0 auto;background:#fff;border:1px solid #1d1d1b}
.pd-pay-help{margin:8px 0 0;font-size:.875em;opacity:.8}
@media(max-width:520px){.pd-pay .pd-qr{width:min(100%,220px);height:auto;aspect-ratio:1}}

/* N5: 'How the two routes differ' sits NEXT TO the B - Contact card (desktop), below it on a phone; the vertical version of the diagram fits the column */
.pd-routes2 .pd-mapsec{text-align:left;border:1px solid var(--pd-line-ui);background:var(--pd-field);padding:clamp(12px,1.6vw,20px);align-self:stretch;min-width:0}
.pd-routes2 .pd-mapsec h3{text-align:left;margin:0 0 10px;font-size:18px}
.pd-routes2 .pd-map-h{display:none}.pd-routes2 .pd-mapl{display:block}
.pd-routes2:has(> :only-child){grid-template-columns:minmax(0,1fr)}

/* N9: friendly message when the 2 free runs of the day are used */
.pd-limit{font-weight:600}.pd-limit-btn{display:inline-block;margin:6px 0 0 8px;padding:8px 14px;text-decoration:none;min-height:40px}

/* a11y contrast block (4 Oct): every selected / active / primary state reaches 4.5:1 in both themes. Selected = dark fill + light text (light theme), light fill + dark text (dark theme); primary = dark text on the orange (#1a1a18 on #c7713d = 4.9:1). */
html .pd-btn.is-on, html .pd-tab.is-on, html .pd-chip input:checked + span, html .pd-stepper .pd-step.is-on, html .pd-seg .pd-btn.is-on { background: #1a1a18; color: #f6f6f1; border-color: #1a1a18; }
.pd-root[data-theme="dark"] .pd-btn.is-on, .pd-root[data-theme="dark"] .pd-tab.is-on, .pd-root[data-theme="dark"] .pd-chip input:checked + span, .pd-root[data-theme="dark"] .pd-stepper .pd-step.is-on, .pd-root[data-theme="dark"] .pd-seg .pd-btn.is-on { background: #f6ead9; color: #1a1a18; border-color: #f6ead9; }
.pd-root[data-theme="dark"] .pd-stepper .pd-step.is-on b { color: #8a4a1f; }
html .pd-primary, html .pd-btn.pd-primary, html .pd-mode .pd-primary { background: #c7713d; color: #1a1a18; border-color: #c7713d; }
html .pd-primary:hover:not(:disabled), html .pd-btn.pd-primary:hover:not(:disabled) { background: #e39a63; color: #1a1a18; border-color: #e39a63; }
html .pd-mode .pd-primary { display: inline-block; align-self: flex-start; margin-top: 6px; }

/* a11y contrast block 2: the site theme sets button colours with !important in dark mode; the tool's own states win here */
html[data-ra-theme="dark"] body .pd-btn.is-on, html[data-ra-theme="dark"] body .pd-tab.is-on, html[data-ra-theme="dark"] body .pd-chip input:checked + span, html[data-ra-theme="dark"] body .pd-stepper .pd-step.is-on, html[data-ra-theme="dark"] body .pd-seg .pd-btn.is-on, .pd-root[data-theme="dark"] body .pd-btn.is-on, .pd-root[data-theme="dark"] body .pd-tab.is-on, .pd-root[data-theme="dark"] body .pd-chip input:checked + span, .pd-root[data-theme="dark"] body .pd-stepper .pd-step.is-on, .pd-root[data-theme="dark"] body .pd-seg .pd-btn.is-on { background: #f6ead9 !important; color: #1a1a18 !important; border-color: #f6ead9 !important; }
html[data-ra-theme="dark"] body .pd-btn.pd-primary, html[data-ra-theme="dark"] body .pd-primary, html[data-ra-theme="dark"] body .pd-mode .pd-primary, .pd-root[data-theme="dark"] body .pd-btn.pd-primary, .pd-root[data-theme="dark"] body .pd-primary, .pd-root[data-theme="dark"] body .pd-mode .pd-primary { background: #c7713d !important; color: #1a1a18 !important; border-color: #c7713d !important; }
html[data-ra-theme="dark"] body .pd-btn.pd-primary:hover:not(:disabled), html[data-ra-theme="dark"] body .pd-primary:hover:not(:disabled), .pd-root[data-theme="dark"] body .pd-btn.pd-primary:hover:not(:disabled), .pd-root[data-theme="dark"] body .pd-primary:hover:not(:disabled) { background: #e39a63 !important; color: #1a1a18 !important; border-color: #e39a63 !important; }

/* J2d: the site-wide dark rule paints every span #f6f6f1, including the step name inside the selected step, whose tile is a light fill in dark mode (1.10:1). Colour this one span with the tile's own ink. */
html[data-ra-theme="dark"] body .pd-stepper .pd-step.is-on span, .pd-root[data-theme="dark"] .pd-stepper .pd-step.is-on span { color: #1a1a18 !important; }

/* a11y layout block (4 Oct): the tool never grows wider than the screen (phone: the panel was 470 px in a 362 px frame) */
.pd-root .pd-main { grid-template-columns: minmax(0, 1fr); }
.pd-root .pd-main > *, .pd-root .pd-panel, .pd-root .pd-body, .pd-root .pd-panel > * { min-width: 0; max-width: 100%; }
.pd-root .pd-panel input.pd-in, .pd-root .pd-panel select, .pd-root .pd-panel textarea { max-width: 100%; box-sizing: border-box; }
.pd-root .pd-bar, .pd-root .pd-tools, .pd-root .pd-tb { max-width: 100%; overflow-x: auto; flex-wrap: wrap; }
@media (min-width: 900px) { .pd-root .pd-main { grid-template-columns: revert-layer; } }

/* a11y layout block 2: grid items of the sheet may shrink below their content (the main column was as wide as its widest toolbar row) */
.pd-root > *, .pd-root .pd-main, .pd-root .pd-stage { min-width: 0; max-width: 100%; }
.pd-root .pd-main { width: 100%; box-sizing: border-box; }

/* start screen, three methods (S113 #1, owner-approved): Quick Start / Draw / Parcel as one bordered strip; the sketch upload stays as a quiet link below */
.pd-modes3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;border:1px solid var(--pd-ink);margin-top:14px}
.pd-modes3 .pd-mode3{border:0;border-right:1px solid var(--pd-ink);padding:24px 24px 26px;gap:10px;min-height:0;align-items:flex-start}
.pd-modes3 .pd-mode3:nth-child(3){border-right:0}
.pd-mode3 .pd-mode-n{font:11px/1.2 ui-monospace,Consolas,monospace;letter-spacing:.08em;color:var(--pd-muted)}
.pd-mode3 .pd-mode-ic{width:100%;max-width:200px;height:84px;color:var(--pd-ink);margin:8px 0 6px}
.pd-mode3 b{font-size:clamp(24px,2.4vw,34px);font-weight:500;line-height:1.05;margin:6px 0 4px}
.pd-mode3 .pd-mode-d{font:15px/1.45 "BT Grotesk",Arial,sans-serif;color:var(--pd-ink);min-height:2.9em}
.pd-mode3 .pd-mode-go{align-self:stretch;margin-top:10px;padding:12px 14px;border:1px solid var(--pd-ink);font:15px/1.2 "BT Grotesk",Arial,sans-serif;color:var(--pd-ink)}
.pd-mode3:hover .pd-mode-go,.pd-mode3:focus .pd-mode-go,.pd-mode3:focus-visible .pd-mode-go{background:#c7713d!important;border-color:#c7713d!important;color:#1a1a18!important}
.pd-modes3 .pd-modes-foot{grid-column:1/-1;display:flex;justify-content:space-between;gap:12px;padding:12px 24px;border-top:1px solid var(--pd-ink);font:11px/1.3 ui-monospace,Consolas,monospace;letter-spacing:.06em;color:var(--pd-ink)}
.pd-mode-sketch{margin-top:14px;border-style:dashed}
@media (max-width:760px){.pd-modes3{grid-template-columns:1fr}.pd-modes3 .pd-mode3{border-right:0;border-bottom:1px solid var(--pd-ink)}.pd-mode3 .pd-mode-d{min-height:0}.pd-modes3 .pd-modes-foot{flex-direction:column;border-top:0}}

/* study comparison (S113 #2, owner-approved): three bordered level cards; on a phone only the selected level shows until "Compare all" */
.pd-cmp-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:8px 0}
.pd-cmp-toggle{display:none;padding:10px 14px;border:1px solid var(--pd-ink);background:var(--pd-field);color:var(--pd-ink);font:14px/1.2 "BT Grotesk",Arial,sans-serif;cursor:pointer;min-height:44px}
.pd-levels3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;border:1px solid var(--pd-ink)}
.pd-levels3 .pd-lvl3{display:flex;flex-direction:column;gap:6px;padding:22px 22px 24px;border:0;border-right:1px solid var(--pd-ink);background:var(--pd-field)}
.pd-levels3 .pd-lvl3:last-child{border-right:0}
.pd-lvl3 .pd-lvl-n,.pd-lvl3 .pd-lvl-arch{font:11px/1.3 ui-monospace,Consolas,monospace;letter-spacing:.08em;color:var(--pd-muted)}
.pd-lvl3 .pd-chip{align-self:flex-start;margin:4px 0}
.pd-lvl3 .pd-lvl-price{margin:0;font:400 clamp(30px,3vw,44px)/1.1 "BT Grotesk",Arial,sans-serif;color:var(--pd-ink)}
.pd-lvl3 .pd-lvl-int{margin:0 0 6px;font:15px/1.4 "BT Grotesk",Arial,sans-serif;color:var(--pd-ink)}
.pd-lvl3 .pd-lvl-k{margin:8px 0 0;display:flex;flex-direction:column;gap:2px;font:15px/1.4 "BT Grotesk",Arial,sans-serif;color:var(--pd-ink)}
.pd-lvl3 .pd-lvl-k b{font-weight:600}
.pd-lvl3.is-on{outline:2px solid #c7713d;outline-offset:-2px}
@media (max-width:760px){.pd-cmp-toggle{display:inline-block}.pd-levels3{grid-template-columns:1fr}.pd-levels3 .pd-lvl3{border-right:0;border-bottom:1px solid var(--pd-ink)}.pd-levels3 .pd-lvl3:last-child{border-bottom:0}.pd-levels3.is-single .pd-lvl3:not(.is-on){display:none}}

/* floating canvas tools (Hand / Ortho 90 / Fit / Undo) */
.pd-cvwrap{position:relative}

/* interior: confirm / delete buttons beside the selected opening, on the canvas */
.pd-opbar{position:absolute;z-index:5;display:flex;gap:6px;padding:4px;background:var(--pd-field);border:1px solid var(--pd-ink);box-shadow:0 2px 0 rgba(0,0,0,.18)}
.pd-opbar[hidden]{display:none}
.pd-opbar .pd-btn{min-height:44px;padding:8px 14px}

/* shared floating canvas toolbar: architecture + interior (zoom group + tool group moved onto the canvas) */
/* the strip itself must not eat drawing clicks: only its buttons take pointer events */
.pd-float,.pd-opbar{pointer-events:none}
.pd-float .pd-btn,.pd-opbar .pd-btn{pointer-events:auto}
.pd-float{position:absolute;top:10px;left:10px;z-index:4;display:flex;flex-wrap:wrap;gap:6px;max-width:calc(100% - 20px)}
.pd-float[hidden]{display:none}
.pd-float .pd-tools,.pd-float .pd-zoom{position:static;display:contents;border:0;padding:0;margin:0;background:none;overflow:visible}
.pd-float .pd-tools[hidden],.pd-float .pd-zoom[hidden]{display:none}
.pd-float .pd-btn{flex:0 0 auto;min-width:44px;min-height:44px;padding:8px 12px;font-size:13px;background:var(--pd-field);opacity:.95;box-shadow:0 1px 0 rgba(0,0,0,.15)}
.pd-float .pd-btn[aria-pressed="true"],.pd-float .pd-btn.is-on{background:var(--pd-ink);color:var(--pd-field)}
.pd-float .pd-btn:disabled{opacity:.45}
.pd-float .pd-more{display:none}
@media (max-width:560px){.pd-float .pd-btn{padding:8px 9px}.pd-float .pd-more{display:inline-flex;align-items:center}.pd-float .pd-sec{display:none}.pd-float.is-more .pd-sec{display:inline-flex}}
@media (max-width:560px){#pd-app .pd-float .pd-btn[data-s],.pd-root .pd-float .pd-btn[data-s]{font-size:0!important;padding:8px 10px}.pd-float .pd-btn[data-s]::after{content:attr(data-s);font-size:12px;letter-spacing:.02em}}

/* context bar: opening type buttons; add-bar in the floating toolbar */
.pd-opbar{flex-wrap:wrap;max-width:calc(100% - 8px)}
.pd-opbar .pd-kind{min-height:44px;padding:8px 10px;font-size:12px}
.pd-opbar .pd-kind[aria-pressed="true"],.pd-addbar .pd-btn[aria-pressed="true"]{background:var(--pd-ink);color:var(--pd-field)}
.pd-addbar{display:flex;flex:1 0 100%;gap:6px;align-items:center}
.pd-addbar[hidden]{display:none}
.pd-addbar .pd-addl{font-size:12px;letter-spacing:.04em;text-transform:uppercase;background:var(--pd-field);padding:6px 8px;border:1px solid var(--pd-ink)}

/* phones: the tools float on the canvas now, so the drawing gets a taller area; compact context bar */
@media (max-width:560px){
  .pd-root .pd-cvwrap{aspect-ratio:auto;height:min(64vh,520px)}
  .pd-opbar{gap:4px;padding:3px}
  .pd-opbar .pd-btn,.pd-opbar .pd-kind{min-height:44px;padding:6px 8px;font-size:11px;letter-spacing:.02em}
  .pd-addbar{gap:4px}.pd-addbar .pd-btn{padding:8px 8px;font-size:11px}
}

.pd-dimbar .pd-btn[aria-pressed="true"]{background:var(--pd-ink);color:var(--pd-field)}

/* entrance / garden popup on the drawing */
.pd-sidepop{position:absolute;left:10px;right:10px;bottom:10px;z-index:6;padding:10px 12px;background:var(--pd-field);border:1px solid var(--pd-ink);box-shadow:0 2px 0 rgba(0,0,0,.18)}
.pd-sidepop[hidden]{display:none}
.pd-sidepop .pd-sp-t{margin:0 0 8px;font:700 13px/1.3 ui-monospace,Consolas,monospace;text-transform:uppercase;letter-spacing:.04em;color:var(--pd-ink)}
.pd-sidepop .pd-sp-c{display:flex;flex-wrap:wrap;gap:6px}
.pd-sidepop .pd-btn{min-height:44px;padding:8px 12px;font-size:12px}
.pd-sidepop .pd-sug{border-style:dashed}
.pd-locked{margin:8px 0}

.pd-maploading{top:var(--pd-float-h,10px)}

/* 3D view presets */
.pd-camrow{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}
.pd-camrow .pd-btn{min-height:44px}
/* V3 (measured, not cosmetic): the pressed rail button was cream-on-cream in dark - 1.65:1 on all six of them,
   identical on the U2b tree and the V2 tree, so V1/V2 did not cause it; the compaction only made the pressed state
   the selection cue. Cause: assets/foundation/ra-theme.css:180 `html[data-ra-theme="dark"] button:not(.product-key
   *){color:#c2b8a8 !important}` paints every dark-theme button label with the muted token, which is fine on the
   dark page (8.89:1) and unreadable on a --pd-ink fill. Beating an !important needs an !important; the value is the
   sheet's own designed token for ink-on-cream (--pd-cta-ink: #1a1a18 in dark, #f6f6f1 in light, the pair already
   used by .pd-btn.is-on line 34 and .pd-chip line 43). Light keeps the pixels it had (16.08:1 before and after);
   dark goes 1.65 -> ~13.7:1. Same latent defect still lives at pd.css:455 / :464 / :477 (.pd-float, .pd-opbar,
   .pd-dimbar) and at :390 (.pd-btn.is-on in dark) - reported to BO, deliberately not touched by this step. */
.pd-camrow .pd-btn[aria-pressed="true"]{background:var(--pd-ink);color:var(--pd-cta-ink) !important}
.pd-rglbl{flex:0 0 auto;margin:0 6px 0 0;font:600 11px/1.4 ui-monospace,Consolas,monospace;letter-spacing:.1em;text-transform:uppercase;color:var(--pd-muted)}

/* V4 (owner, 5 Nov, picked "one strip, legend above" after rejecting the V1 band twice). DESKTOP ONLY (>=900px):
   the four groups sit side by side, each a mini-stack - the tiny uppercase legend on top (flex:1 0 100% forces it to
   its own line, the chips flow below), a thin --pd-line-ui divider between groups. That is the DOOR SWING shape he
   pointed at, laid out horizontally. Below 900px the legend-above stack costs a line per group and the camera group's
   three chips ("From the entrance" alone is ~130px) no longer fit their half-width cell, so they stacked to 3 lines
   and the band grew to 235px at 390 - WORSE than V1's 199px. So narrow keeps the V1 inline-label band untouched.
   44px touch height and the 12px interactive-text floor are unchanged in both. */
/* V1 band, kept for < 900px: the four option rows share one wrapping band, label inline before its own buttons. */
.pd-rail{display:flex;flex-wrap:wrap;align-items:center;gap:6px 18px;margin:10px 0}
.pd-rail .pd-camrow{margin:0;align-items:center}
.pd-rail .pd-camrow .pd-btn{padding:6px 10px;font-size:12px}
/* >=900px override (must follow the base rules so equal-specificity wins by source order). */
@media (min-width:900px){
  .pd-rail{align-items:flex-start;gap:12px 20px}
  .pd-rail .pd-camrow{flex:0 0 auto;padding-right:20px;border-right:1px solid var(--pd-line-ui)}
  .pd-rail .pd-camrow:last-child{padding-right:0;border-right:0}
  .pd-rail .pd-camrow .pd-rglbl{flex:1 0 100%;margin:0 0 3px}
}
@media (max-width:520px){
  .pd-rail{gap:6px}
  .pd-rail .pd-rglbl{flex:1 0 100%;margin:0}
  .pd-rail .pd-camrow{gap:3px}
  .pd-rail .pd-camrow .pd-btn{padding:6px 4px;letter-spacing:.02em;white-space:nowrap}
}

/* V2 (owner, 4 Nov: "drawing space should be fit in size into the scrren as its too big that you need to scroll up
   or down to see all over it so that needs to be fixed"). Two measured causes: all four boards were on the page at
   once (2.49 - 5.54 viewport-heights of .pd-vars) and pd.css's stale `1fr!important` from Task 40 had reverted the
   plan|3D pair to stacked, so a single board was taller than its own window (771 px in a 844 px viewport, 1410 in
   1024, 1116 in 900). Now the review-sheet index switches the board instead of scrolling between four, and the
   three drawings of the selected board share a row that ends up shorter than the viewport. Nothing here changes
   what is drawn, only which sheet is on screen and how wide its row is. */
.pd-vars{grid-template-columns:1fr}
.pd-var{display:none}
.pd-var.is-sel{display:block}
.pd-var.is-sel .pd-wmwrap{grid-template-columns:1fr 1fr!important}
@media (min-width:901px){
  .pd-var.is-sel{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:10px;align-items:start}
  .pd-var.is-sel figcaption{grid-column:1/-1}
  .pd-var.is-sel .pd-wmwrap{display:contents}
  .pd-var.is-sel .pd-key{grid-column:1/-1}
}

/* J3a: up to three concepts on one screen. Every card canvas is painted at the same 640 px bitmap and the grid
   tracks are equal 1fr, so each plan is shown at the same width - one scale, one orientation. The cards replace
   the board while comparing, they do not add to it. */
.pd-compare{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px;margin-top:12px}
.pd-compare-card{margin:0;display:flex;flex-direction:column;gap:6px;border:1px solid var(--pd-line-ui);padding:8px;background:var(--pd-field)}
.pd-compare-card figcaption{font:600 13px/1.3 ui-monospace,Consolas,monospace;letter-spacing:.08em;text-transform:uppercase}
.pd-compare-card.is-sel{outline:2px solid var(--pd-ink);outline-offset:-2px}
.pd-cmptag{font:600 11px/1 ui-monospace,Consolas,monospace;letter-spacing:.06em;color:var(--pd-accent-text)}
.pd-cmpfact{margin:0;font:13px/1.4 ui-monospace,Consolas,monospace;color:var(--pd-muted)}
.pd-compare-card .pd-btn{margin-top:auto}


/* M8 / R1: the on-demand high-quality still, parked under the row that asks for it. Same frame as a preview canvas. */
.pd-hqwrap{margin:0 0 10px}
.pd-hqwrap .pd-pv{background:#141412}

/* M10: the cross-section is its own row under the plan / 3D pair - .pd-pv already sizes it, so only the gap is new. */
.pd-secwrap{margin:6px 0 0}
.pd-secwrap .pd-pv{aspect-ratio:3/2}

/* W3: the elevations row sits under the section, same frame; 720x360 raster, so 2:1. */
.pd-elevwrap{margin:6px 0 0}
.pd-elevwrap .pd-pv{aspect-ratio:2/1}

/* W4: the locked area-schedule preview the engine inserts from the studio model (RDStudio.scheduleHtmlFor lock:true).
   The studio's own .ra-table rules are scoped to #rd-studio-app, so this sheet re-styles the same markup with the
   frame's --pd-* tokens - it themes correctly light/dark and never depends on the backstage host's cascade. */
.pd-schedwrap{margin:6px 0 0}
.pd-sched{border-top:1px dashed var(--pd-line-ui);padding-top:8px}
.pd-sched-sum{font:12px/1.5 ui-monospace,Consolas,monospace;color:var(--pd-muted);margin:0 0 6px;display:flex;flex-wrap:wrap;gap:6px;align-items:baseline}
.pd-sched-sum b{color:var(--pd-ink);font-weight:700}
.pd-schedwrap .ra-table{width:100%;border-collapse:collapse;font-size:12px}
.pd-schedwrap .ra-table th{text-align:left;padding:5px 8px;background:var(--pd-field);color:var(--pd-muted);font-family:ui-monospace,Consolas,monospace;font-size:11.5px;border-bottom:1px solid var(--pd-line-ui)}
.pd-schedwrap .ra-table td{padding:5px 8px;border-bottom:1px solid var(--pd-line-ui);color:var(--pd-ink)}
.pd-schedwrap .ra-mono{font-family:ui-monospace,Consolas,monospace;font-size:11.5px}
.pd-schedwrap .ra-schedule-level th{border-top:2px solid var(--pd-line-ui);color:var(--pd-ink);background:transparent}
.pd-locktag{display:inline-block;font-size:11px;color:var(--pd-accent-text);border:1px solid var(--pd-accent);border-radius:3px;padding:0 4px;margin-left:4px}
.pd-lockcell{color:var(--pd-muted)}
.pd-schedwrap .pd-note{margin:6px 0 0}

/* #5 result page: review-sheet index, status strip, next-step links */
.pd-sheetidx{margin:0 0 14px}.pd-sk{display:block;margin:0 0 8px;font:600 11px/1.4 ui-monospace,Consolas,monospace;letter-spacing:.1em}
.pd-sheets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.pd-sheet{text-align:left;padding:10px 12px;min-height:56px;border:1px solid currentColor;background:transparent;color:inherit;font:inherit;cursor:pointer}
.pd-sheet .pd-sn{display:block;font:600 10px/1.4 ui-monospace,Consolas,monospace;letter-spacing:.08em;opacity:.8}.pd-sheet .pd-st{display:block;font-size:15px;margin-top:2px}
.pd-sheet[aria-current="true"]{border-width:2px;box-shadow:inset 0 0 0 1px currentColor}.pd-sheet:disabled{opacity:.55;cursor:default;border-style:dashed}.pd-sheet.is-bad{border-color:#b3472a}.pd-sheet:focus-visible{outline:2px solid #c7713d;outline-offset:2px}

/* W4 (owner, 4 Nov: "SHow the hoest refusal with a + saying you can contact RA DESIGN for more and diffrent
   prposal"). A sheet the solver refused draws nothing: it states the reason and offers the studio's own door. The
   panel IS the sheet, so it takes the drawing's space (min-height) and, at the wide layout, spans the row the
   plan/3D pair would have used. Same drafting-sheet language as .pd-warn - accent rule, mono type - and it reads
   only --pd-* tokens, because the frame themes this itself; the backstage studio's --ra-* cascade is not loaded. */
.pd-refuse{margin:6px 0 0;padding:16px 14px;border:1px dashed var(--pd-accent-text);min-height:200px}
.pd-refuse-h{margin:0 0 6px;font:700 15px/1.3 ui-monospace,Consolas,monospace;letter-spacing:.06em;text-transform:uppercase;color:var(--pd-accent-text)}
.pd-refuse-why{margin:0 0 14px;max-width:62ch;font:13px/1.5 ui-monospace,Consolas,monospace;color:var(--pd-ink)}
.pd-refuse-cta{display:inline-block;max-width:100%;line-height:1.35;text-decoration:none}
.pd-refuse-plus{margin-right:6px;font:700 15px/1 ui-monospace,Consolas,monospace;color:var(--pd-accent-text)}
.pd-var.is-sel .pd-refuse{grid-column:1/-1}
.pd-sheet.is-refused{border-style:dashed;color:var(--pd-muted)}
.pd-chip.is-off{opacity:.5}
.pd-chip.is-off input{cursor:not-allowed}
@media (max-width:520px){.pd-refuse{min-height:0;padding:12px 10px}}
.pd-rstrip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-top:1px solid currentColor;margin:10px 0 0}.pd-rstrip div{padding:10px 12px;font-size:15px;border-left:1px solid currentColor}.pd-rstrip div:first-child{border-left:0;padding-left:0}
.pd-rstrip span{display:block;font:600 10px/1.4 ui-monospace,Consolas,monospace;letter-spacing:.1em;text-transform:uppercase;opacity:.75;margin-bottom:2px}
.pd-rlinks{display:flex;gap:22px;flex-wrap:wrap;margin:10px 0 0}.pd-rlinks a{display:inline-block;min-height:44px;padding:11px 0 3px;color:inherit;text-decoration:none;border-bottom:1px solid #c9a96e;font-size:15px}
@media (max-width:640px){.pd-sheets{grid-template-columns:repeat(2,minmax(0,1fr))}.pd-rstrip{grid-template-columns:1fr}.pd-rstrip div{border-left:0;padding-left:0;border-top:1px solid currentColor}.pd-rstrip div:first-child{border-top:0}}

/* #6 interior finishes picker */
.pd-mbread{display:flex;justify-content:space-between;gap:12px;margin:0 0 10px;font:600 11px/1.4 ui-monospace,Consolas,monospace;letter-spacing:.08em}
.pd-mstep{margin:18px 0 8px;font:600 11px/1.4 ui-monospace,Consolas,monospace;letter-spacing:.1em;color:#9a5326}
.pd-mcats{display:flex;gap:6px;flex-wrap:wrap}.pd-mcats .pd-btn[aria-pressed="true"]{background:#262622;color:#fff}
.pd-mscope{border:0;padding:0;margin:0 0 12px}.pd-mscope legend{font-size:14px;margin:0 0 6px;padding:0}
.pd-mscope .pd-radio{display:flex;align-items:center;gap:10px;min-height:44px}.pd-mscope input[type=radio]{width:18px;height:18px;margin:0;accent-color:#262622}
.pd-mapplied{margin:6px 0 0;padding-left:18px;font-size:14px;line-height:1.5}
.pd-matpick .pd-btn[disabled]{opacity:.5;cursor:default}

/* U1 (owner, 4 Nov: "we cant have the 2 plans ideas side by side", "the approch isnt bad, but the result is
   bad"): RDStudio is the MODEL, not a surface. From here the frame shows exactly one drawing sheet - its own -
   at every step, in both languages, at every viewport. M1 and M2 made the studio a second visible sheet:
   is-studio opened the stage, hid the frame's own canvas and the strip, and dressed the studio up as this
   frame. That whole visual contract is deleted here. The is-studio class STAYS on the root - it still marks
   "this brief's model comes from the solver" - and the studio still mounts, into the backstage box below,
   because a display:none host has no layout box and every drawing the frame later captures from it would come
   back blank. position:fixed keeps the box out of the document's scrollable overflow; opacity:0 + clip-path
   keep it unseen without touching the studio's own render path; max-width:none wins over
   `.pd-root > *{max-width:100%}` (:409) so the host rasterises at 1200x800 on a phone as well as on a desktop.
   The M2 token block right below stays ON PURPOSE: it is the ink and paper the captured drawings are painted
   with, not a visible surface. Revert = restore this block from steps/U1/before and move #pd-studio back
   inside .pd-stage (engine-a.js). */
#pd-studio{position:fixed;left:0;top:0;width:1200px;height:800px;max-width:none;opacity:0;pointer-events:none;
clip-path:inset(50%);z-index:-1;overflow:hidden}
#pd-studio #rd-studio-app{height:100%;min-height:0}

/* M2 merge (rail + colour reconciliation, CSS only): the studio has to read as this frame's own drawing
   sheet, not as a second product dropped inside it. Colour, the two rails, and how much of the host the
   drawing gets - no state, no payload, no numbers. Revert = delete this block and the page is M1 again.
   The selectors carry .pd-root.is-studio plus both ids on purpose: calm-shell.css (the deleted product's
   shell, still linked after N1) sets these same tokens through `main.pd-site #rd-studio-app` and is
   loaded AFTER pd.css, so this block has to win the cascade without touching that file. Every value is a
   token the frame itself already defines (:82 light, :115 dark) - the colours the AutoCAD canvas paints
   with, which is the whole point: measured dark ink was --ra-ink #f0efe9 against the frame's #f6ead9. */
.pd-root.is-studio #pd-studio #rd-studio-app{--ra-paper:var(--pd-page);--ra-surface:var(--pd-field);--ra-panel:var(--pd-page);
--ra-ink:var(--pd-ink);--ra-muted:var(--pd-muted);--ra-line:var(--pd-line-ui);--ra-accent:var(--pd-accent);
--ra-accent-text:var(--pd-accent-text);--ra-cad-bg:var(--pd-bg);--ra-cad-wall-stroke:var(--pd-plan-line)}
/* U1: the two rule groups that followed - the inner rail wrapping at 390 and the phone compaction of the
   studio's room legend / status card - existed to give the DRAWING room inside a visible host. The host is
   backstage now and its own media queries answer to the window, not to the box, so those rules could only
   mislead. The colour tokens above are the part of M2 that still does work: they are what a captured
   studio drawing is painted with. */

/* D2 (owner feedback 5 Nov, "suggest size should be 3 columns with the details under each choice"):
   the three suggested house sizes as one bordered strip. Each column is one choice - name, then its facts
   on their own lines, then the action; the strip carries the same frame idiom as .pd-modes3 (:413), so it
   reads as the same sheet, not as a new widget type. Square corners, hairline dividers, no fills, and one
   column below the 900 px the app already breaks at, where three columns would squeeze the facts.
   Revert = delete this block and the .pd-shapes markup returns to the plain stacked list it had. */
.pd-shapes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;border:1px solid var(--pd-ink);margin-top:14px}
.pd-shapes .pd-mode{border:0;border-right:1px solid var(--pd-ink);padding:18px 18px 20px;gap:5px;min-height:0}
.pd-shapes .pd-mode:nth-child(3){border-right:0}
.pd-shapes .pd-mode b{font:500 clamp(19px,1.7vw,24px)/1.15 "BT Grotesk",Arial,sans-serif;margin-bottom:2px}
.pd-shpd{display:block;font:13px/1.45 "BT Grotesk",Arial,sans-serif;color:var(--pd-ink)}
.pd-shapes .pd-mode .pd-btn{align-self:stretch;margin-top:8px;text-align:center}
@media (max-width:900px){
  .pd-shapes{grid-template-columns:minmax(0,1fr)}
  .pd-shapes .pd-mode{border-right:0;border-bottom:1px solid var(--pd-ink)}
  .pd-shapes .pd-mode:nth-child(3){border-bottom:0}
}

/* D3 (owner feedback 5 Nov, "they should be called rooms ... Rooms (bedrooms and living)"): Quick Start's
   two room counts now sit in one labelled group, using the fieldset idiom the same screen already uses for
   FLOORS and THE TARGET IS. The only new rule is the width: .pd-fs is a flex row, so a grid child would
   shrink to its content instead of spanning the group.
   Revert = delete this block and the fieldset wrapper in quickHtml(); the inputs and ids are untouched. */
.pd-fs>.pd-two{flex:1 0 100%}

/* D4 (owner feedback 5 Nov, "the size of the area to draw is still too huge that you need to scroll to see
   things"): the drawing and its questions share the screen again. pd.css:90 always meant this - the 4 Oct
   a11y block at :406 tried to give it back above 900 px with `revert-layer`, which resolves to `none`
   because this file has no @layer, so the sheet and the panel stacked and the questions fell below a
   770 px drawing. Only .is-draw (the land and house steps) is two-column: the board steps keep :93's
   single full-width column. The right column is 700 px at >= 1200 so D2's three suggested-shape columns
   survive beside the drawing; below that the panel is narrower, and three squeezed columns read worse
   than one, so the strip falls back to a stack. Square corners, hairline dividers, nothing recoloured.
   Revert = delete this block. (The 700 px / 44 % rail below is the K3 measurement, not this step's.) */
/* K3 (owner 8 Nov, "the drawing area should have the whole screen ... the controlers should be under or
   taking a compact side not wide one"): the drawing keeps every pixel the compact rail leaves. The rail
   drops from D4's 700 px / 44 % to 360 px, and the sheet stops letterboxing itself - .pd-cvwrap's
   1000/640 aspect ratio made a 900 px viewport show a 322 px canvas, so on a draw screen the height now
   follows the viewport instead. D4's reason for the wide rail (D2's three suggested-shape columns beside
   the drawing) is gone: K2 made Quick Start a single full-width column, so .pd-shapes never shares the
   row again. The rail is a palette, not a page: at 360 px its own content is taller than the screen, so
   it scrolls inside its column (measured: panel 880 px at 360, 755 px at 700) while the drawing keeps the
   rest of the viewport - the alternative is the whole app scrolling, which the D-pass already rejected.
   175 px is the chrome the measurement leaves outside the grid row (root starts 8 px down, 150 px of
   header/stepper/notice, 13 px below the fold). Square corners, nothing recoloured.
   Revert = restore these two @media blocks. */
@media (min-width:900px){
  .pd-root.is-draw{--pd-dd-slot:162px}
  .pd-root.is-draw .pd-main{grid-template-columns:minmax(0,1fr) minmax(0,330px);gap:14px}
  .pd-root.is-draw .pd-stage{display:flex;flex-direction:column;height:calc(100vh - 128px);min-height:520px;max-height:none}
  .pd-root.is-draw .pd-cvwrap{flex:1 1 auto;min-height:0;aspect-ratio:auto;height:auto}
  .pd-root.is-draw .pd-panel{height:calc(100vh - 128px);min-height:520px;max-height:none;overflow-y:auto}
  /* K3c: with the height now driven by the flex column, anything that appears under the canvas takes it
     away. The direct-distance row (.pd-dd, draw-aids.js:52) appears on the first point and disappears when
     the outline closes, so the sheet jumped 635 -> 494 -> 635 px mid-draw and every point already placed
     slid ~70 px off the cursor - the owner's item 4 complaint in a new form. The row's own slot is
     measured (152 px + 10 px margin up to a 733 px canvas, 131 px + 10 px from 827 px up, EN and CS the
     same), so 162 px is reserved whether the row is shown or hidden and the drawing surface never resizes
     during a draw: at 1440x900 the canvas is 843 x 473 px before, during and after the draw (measured at
     1440/1280/1100/980), ~2.5x the area K3 started from. Revert = delete these two rules. */
  .pd-root.is-draw .pd-dd[hidden]{display:block;height:var(--pd-dd-slot);margin:0;visibility:hidden;pointer-events:none;overflow:hidden}
  .pd-root.is-draw .pd-dd{min-height:calc(var(--pd-dd-slot) - 10px)}
}
@media (min-width:1200px){
  .pd-shapes .pd-mode{padding:16px 14px 18px}
  .pd-shapes .pd-mode b{font-size:18px}
  .pd-shpd{font-size:12px}
}
@media (min-width:720px) and (max-width:899px){
  .pd-shapes{grid-template-columns:repeat(3,minmax(0,1fr))}
  .pd-shapes .pd-mode{border-right:1px solid var(--pd-ink);border-bottom:0}
  .pd-shapes .pd-mode:nth-child(3){border-right:0}
}
@media (min-width:900px) and (max-width:1199px){
  .pd-shapes{grid-template-columns:minmax(0,1fr)}
  .pd-shapes .pd-mode{border-right:0;border-bottom:1px solid var(--pd-ink)}
  .pd-shapes .pd-mode:nth-child(3){border-bottom:0}
}
/* V3 (owner, D-pass: "drawing space should be fit in size into the scrren as its too big that you need to
   scroll up or down to see all over it", "organise the concept screens better", "less explanation, better
   orgnizaing"). V2 put one sheet on screen; this makes that sheet short. Measured at 1440x900: the selected
   sheet was 865 px tall on a 900 px viewport because the plan|3D pair, the section, the elevations and the
   room schedule each took a full band, and the schedule alone was 429 px of it. The schedule is a row-count
   table - 9 rooms, level headers, summary - so its height does not depend much on its width, which means the
   way to shorten the sheet is to take it OUT of the stack rather than shrink the drawings. Here it becomes a
   right rail that overlaps the two drawing rows, and the section and elevation share the row under the pair.
   No canvas box changes ratio, so nothing is letterboxed or squeezed: the drawing tracks stay the width the
   current auto-fit already gives them. Only >=1200 px; the 901-1199 and narrow layouts are untouched, and
   deleting this block puts the bands back. (.pd-wmwrap is a grid box again, which is what pairs plan|3D
   inside columns 1-2; the preview watermark on this path is painted into the raster, not this overlay.) */
@media (min-width:1200px){
  .pd-var.is-sel{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(280px,1.1fr);grid-template-rows:auto auto auto auto;gap:10px;align-items:start}
  .pd-var.is-sel figcaption{grid-column:1/-1;grid-row:1}
  .pd-var.is-sel .pd-wmwrap{display:grid;grid-column:1/3;grid-row:2}
  .pd-var.is-sel .pd-secwrap{grid-column:1;grid-row:3}
  .pd-var.is-sel .pd-elevwrap{grid-column:2;grid-row:3}
  .pd-var.is-sel .pd-schedwrap{grid-column:3;grid-row:2 / span 2}
  .pd-var.is-sel .pd-key{grid-column:1/-1;grid-row:4}
  .pd-var.is-sel.is-int .pd-key{grid-column:1/-1;grid-row:auto}
  .pd-var.is-sel .pd-refuse{grid-column:1/-1;grid-row:2 / span 2}
}
/* The state this step deliberately does NOT touch: a brief the solver cannot lay out at all draws one
   outline sheet and nothing else. Its auto-fit track already leaves the right two thirds of the sheet empty,
   before D6 and after - the placements above are inert because there is no section, elevation, schedule or
   key to place. Measured: 263 px tall on q-chain-d5, 278 px on q-chain-d6 - the 15 px is the grid's own row
   model (explicit rows plus a 10 px gap where the flow layout had none), not a change to the drawing box; the
   screenshots are the same picture. Widening that single drawing to the full sheet is a separate, visible
   change to a different screen, so it is not smuggled in here. */
/* D9 (owner feedback 5 Nov, "Comparison moved to info"): the two-route comparison left the order screen and
   sits here now, on the FAQ page. currentColor hairlines are the idiom that page already uses for its
   accordion (.pd-faq details), so the section reads as part of the page in both themes without new tokens -
   the .pd-* variables are declared on .pd-root only, and this section is outside the tool. The measure is the
   .pd-faq measure (1180), the link is the .pd-rlinks link (same 44px target, same #c9a96e rule), and below
   720 px the rows stack with their column as a label, the way the tool's own tables already do. */
.pd-cmpsec{max-width:1180px;padding:34px 0 6px;border-top:1px solid currentColor}
.pd-cmpsec h2{margin:0 0 4px;font-size:clamp(20px,2.6vw,26px);font-weight:600;line-height:1.25;letter-spacing:-.01em}
.pd-cmptwrap{overflow-x:auto;margin-top:14px}
.pd-cmptbl{width:100%;border-collapse:collapse;font-size:16px;line-height:1.5}
.pd-cmptbl caption{position:absolute;left:-9999px}
.pd-cmptbl th,.pd-cmptbl td{padding:11px 12px;text-align:left;vertical-align:top;border-bottom:1px solid currentColor}
.pd-cmptbl thead th{font-size:13px;letter-spacing:.08em;text-transform:uppercase}
.pd-cmptbl thead th:nth-child(2),.pd-cmptbl thead th:nth-child(3){width:39%}
.pd-cmptbl tbody th{width:22%;font-weight:600}
.pd-cmpsec a{display:inline-block;min-height:44px;padding:11px 0 3px;color:inherit;text-decoration:none;border-bottom:1px solid #c9a96e;font-size:15px}
@media (max-width:720px){.pd-cmptbl thead{display:none}
  .pd-cmptbl tbody th,.pd-cmptbl tbody td{display:block;width:auto;border-bottom:0;padding:4px 12px}
  .pd-cmptbl tbody tr{border-bottom:1px solid currentColor;padding:8px 0}
  .pd-cmptbl tbody td::before{content:attr(data-label);display:block;font:600 12px/1.4 ui-monospace,Consolas,monospace;letter-spacing:.08em;text-transform:uppercase}}
.pd-busy-overlay{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:20px;background:rgba(26,26,24,.48);backdrop-filter:blur(2px)}
.pd-busy-box{width:min(420px,100%);padding:24px;background:var(--pd-page,#f3f2ec);color:var(--pd-ink,#23231f);border:1px solid var(--pd-ink,#23231f);text-align:center;display:grid;justify-items:center;gap:12px}
.pd-busy-box h3,.pd-busy-box p{margin:0}.pd-busy-box h3{font:600 15px/1.35 ui-monospace,Consolas,monospace;letter-spacing:.04em}.pd-busy-indicator{display:block;width:34px;height:34px;border:2px solid var(--pd-line-ui,#888);border-top-color:var(--pd-accent,#c7713d);border-radius:50%;animation:pd-busy-spin .85s linear infinite}
@keyframes pd-busy-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.pd-busy-indicator{animation:none;border-color:var(--pd-accent,#c7713d)}}

/* PLAN Z: on short desktop viewports, fit the draw stage to the visible height instead of preserving the tall-screen minimum. */
@media (min-width:900px) and (max-height:699px){
  .pd-root.is-draw{--pd-dd-slot:104px}
  .pd-root.is-draw .pd-stage,.pd-root.is-draw .pd-panel{height:calc(100svh - 150px);min-height:0;max-height:none}
  .pd-root.is-draw .pd-cvwrap{min-height:0}
}
.pd-lvl-compact{min-height:0;padding:12px 14px;gap:8px}
.pd-lvl-compact .pd-lvl-price{margin:0;font-size:clamp(18px,2vw,24px)}
.pd-lvl-compact .pd-chip{margin:0}

/* PLAN Z: remove hidden distance-row reservation and excess page gaps in Personal Design only. */
@media (min-width:900px){.pd-root.is-draw .pd-dd[hidden]{display:none;height:0;min-height:0;margin:0;padding:0}}
main.pd-site:has(> #pd-app){padding-bottom:40px}
#pd-app ~ .pd-faq{margin-top:28px}

/* Q-PD-HANDOFF-11NOV: compact LAND step. Outline, measurements and fit status stay above the fold at desktop and 390 px; long help sits behind one disclosure. */
.pd-step-land{padding:14px clamp(12px,2vw,18px)}
.pd-step-land h2{margin-bottom:8px}
.pd-step-land>p{margin-bottom:8px}
.pd-step-land .pd-parcel-help{margin:0 0 8px}
.pd-step-land .pd-parcel-help>p{margin:4px 0 0}
.pd-step-land .pd-parcel-help>summary{min-height:32px}
.pd-step-land .pd-stat{margin:6px 0}
.pd-step-land .pd-areas{margin:6px 0}
.pd-step-land .pd-arow{padding:4px 8px;font-size:12.5px;line-height:1.3}
.pd-step-land #pd-demo,.pd-step-land #pd-mode-change{flex:1 1 0;min-width:0;padding:9px 10px}
@media (max-width:520px){
  .pd-step-land{padding:12px}
  .pd-step-land .pd-arow{padding:4px 7px;font-size:12px}
  .pd-step-land .pd-parcel-help>p{font-size:12.5px;line-height:1.35}
}

/* Expanded Full-Canvas Drawing Mode */
.pd-root.is-canvas-expanded.is-draw .pd-main {
  grid-template-columns: minmax(0, 1fr) !important;
}
.pd-root.is-canvas-expanded.is-draw .pd-stage {
  height: calc(100vh - 90px) !important;
}
.pd-root.is-canvas-expanded.is-draw .pd-panel {
  position: fixed;
  right: 18px;
  top: 76px;
  width: 320px;
  max-height: calc(100vh - 94px);
  background: var(--pd-paper, #f9f9f5);
  border: 1px solid var(--pd-ink, #1a1a18);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  z-index: 100;
  padding: 16px;
  overflow-y: auto;
}

/* Step 2: Compact House Shape Grid & Full-Width Action */
.pd-fs.pd-shape {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.pd-fs.pd-shape .pd-chip {
  margin: 0;
  width: 100%;
}
.pd-fs.pd-shape .pd-chip span {
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  font-size: 11.5px;
  padding: 8px 4px;
}
#pd-shape-go.pd-btn-block {
  width: 100% !important;
  display: block;
  text-align: center;
  margin-top: 10px;
  box-sizing: border-box;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Step 6: Compact Consent Rows & Legal Info Tooltips */
.pd-consent-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  flex-wrap: wrap;
}
.pd-consent-wrap .pd-consent {
  margin: 0;
  flex: 0 1 auto;
}
.pd-info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--pd-line-ui, #888);
  background: var(--pd-field, #fff);
  color: var(--pd-rust, #9a5326);
  font: 700 11px/1 ui-monospace, Consolas, monospace;
  cursor: help;
  padding: 0;
  flex-shrink: 0;
  position: relative;
}
.pd-info-tip:hover::after, .pd-info-tip:focus::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--pd-ink, #1a1a18);
  color: var(--pd-paper, #f9f9f5);
  padding: 8px 12px;
  font: 400 11.5px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border-radius: 3px;
  white-space: normal;
  width: max-content;
  max-width: 300px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
  z-index: 100;
  pointer-events: none;
}


/* Furniture Schedule Table (Heron CAD styling) */
.pd-sched-wrap {
  margin: 18px 0 24px;
  background: var(--pd-paper, #f9f9f5);
  border: 1px solid var(--pd-line-cad, #1a1a18);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 16px;
  border-radius: 2px;
}
.pd-sched-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.pd-sched-head-left h4 {
  margin: 0 0 4px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pd-rust, #9a5326);
}
.pd-sched-tier-badge {
  display: inline-block;
  padding: 3px 8px;
  background: #eef2eb;
  border-left: 3px solid #5b7055;
  color: #2b3b28;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  margin-top: 4px;
}
.pd-sched-wrap[data-tier="luxury"] .pd-sched-tier-badge {
  background: #fdf6ec;
  border-left-color: var(--pd-rust, #9a5326);
  color: #633315;
}
.pd-sched-wrap[data-tier="mid"] .pd-sched-tier-badge {
  background: #f4f3f0;
  border-left-color: #6c757d;
  color: #333;
}
.pd-sched-scale-tag {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--pd-rust, #9a5326);
  border: 1px solid var(--pd-rust, #9a5326);
  padding: 2px 6px;
  border-radius: 2px;
  white-space: nowrap;
}
.pd-sched-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--pd-line-ui, #ccc);
  background: var(--pd-field, #fff);
}
.pd-sched-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
  min-width: 640px;
}
.pd-sched-table th {
  background: #f0eee6;
  color: var(--pd-ink, #1a1a18);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--pd-line-cad, #1a1a18);
}
.pd-sched-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #ebe7df;
  vertical-align: middle;
}
.pd-sched-table tbody tr:hover {
  background: #faf8f2;
}
.pd-sched-tag {
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 700;
  color: var(--pd-rust, #9a5326);
  white-space: nowrap;
}
.pd-sched-name strong {
  display: block;
  font-size: 12px;
}
.pd-sched-cat {
  font-size: 10px;
  color: #777;
  text-transform: uppercase;
}
.pd-sched-store {
  display: inline-block;
  padding: 1px 5px;
  background: #e8e4da;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  border-radius: 2px;
  margin-right: 4px;
}
.pd-sched-mname {
  font-weight: 600;
}
.pd-sched-dims {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  white-space: nowrap;
}
.pd-sched-mat {
  font-size: 11.5px;
  color: #444;
}
.pd-sched-qty {
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 700;
  text-align: center;
}
.pd-sched-price {
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
}
.pd-sched-total {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  color: var(--pd-rust, #9a5326);
  text-align: right;
  padding: 10px;
}
.pd-locked-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: #f4efe6;
  border: 1px dashed var(--pd-line-ui, #c8c2b4);
  color: var(--pd-rust, #9a5326);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  border-radius: 2px;
  white-space: nowrap;
}
.pd-locked-badge .pd-lock {
  font-style: normal;
  font-size: 10px;
}
.pd-locked-total {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #fbf5ee;
  border: 1px solid var(--pd-rust, #9a5326);
  color: var(--pd-rust, #9a5326);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  border-radius: 2px;
  text-align: left;
  line-height: 1.4;
}
.pd-locked-total .pd-lock {
  font-style: normal;
  font-size: 13px;
  flex-shrink: 0;
}
.pd-sched-foot-meta {
  margin-top: 10px;
}
.pd-sched-ergo {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.pd-ergo-tag {
  display: inline-flex;
  align-items: center;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: #2e5233;
  background: #edf5ed;
  border: 1px solid #c7dec8;
  padding: 2px 8px;
  border-radius: 2px;
}
.pd-sched-footer {
  margin: 10px 0 0;
  font-size: 11px;
  font-style: italic;
  color: #666;
  line-height: 1.4;
}

/* --- Personal Design Interior Engine Overhaul & Compact Rail --- */
.pd-row.pd-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
@media (min-width: 900px) {
  .pd-root.is-draw .pd-main {
    grid-template-columns: minmax(0, 1fr) 320px !important;
    gap: 12px;
  }
}
.pd-var.is-sel .pd-wmwrap {
  display: grid;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px;
}
@media (max-width: 680px) {
  .pd-var.is-sel .pd-wmwrap {
    grid-template-columns: 1fr !important;
  }
}

/* Organized Study Selector: Label on top, 3 balanced cards below */
.pd-study-selector {
  margin: 10px 0 14px;
  width: 100%;
}
.pd-study-label {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pd-ink, #1a1a18);
  margin-bottom: 6px;
  display: block;
}
.pd-study-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}
@media (max-width: 768px) {
  .pd-study-grid {
    grid-template-columns: 1fr;
  }
}
.pd-study-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  background: var(--pd-field, #fbfbf7);
  border: 1px solid var(--pd-line-ui, rgba(26,26,24,0.35));
  cursor: pointer;
  box-sizing: border-box;
  text-align: left;
  transition: border-color 0.15s, background-color 0.15s;
}
.pd-study-tab input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.pd-study-tab:hover {
  background: #f4f1ea;
}
.pd-study-tab.is-selected {
  background: #fff;
  border: 2px solid var(--pd-ink, #1a1a18);
  box-shadow: 0 0 0 1px var(--pd-ink, #1a1a18);
}
.pd-study-tab.is-selected .pd-tab-meta b {
  color: var(--pd-accent-text, #9a5326);
}
.pd-tab-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pd-muted, #666);
  margin-bottom: 3px;
}
.pd-tab-meta b {
  font-weight: 700;
  color: var(--pd-ink, #1a1a18);
}
.pd-tab-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--pd-ink, #1a1a18);
}

/* 4th-Quadrant Composite Wall Elevations Card (All 4 in one image/sheet) */
.pd-elev-summary {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fdfdfc;
  border: 1px solid var(--pd-line-ui, rgba(26,26,24,0.35));
  box-sizing: border-box;
  overflow: hidden;
  min-height: 220px;
}
.pd-elev-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: #f4f1ea;
  border-bottom: 1px solid var(--pd-line-ui, rgba(26,26,24,0.2));
}
.pd-elev-top-title {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pd-ink, #1a1a18);
}
.pd-elev-lock {
  font-size: 10px;
  padding: 2px 5px;
}
.pd-elev-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  flex: 1;
  padding: 6px;
  background: #fff;
  min-height: 0;
  box-sizing: border-box;
}
.pd-elev-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #faf8f5;
  border: 1px solid rgba(26,26,24,0.12);
  padding: 14px 4px 4px 4px;
  overflow: hidden;
  box-sizing: border-box;
}
.pd-elev-tag {
  position: absolute;
  top: 3px;
  left: 5px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 9px;
  font-weight: 600;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
  pointer-events: none;
}
.pd-elev-cell svg {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 105px;
  object-fit: contain;
  margin: auto;
}
.pd-elev-footbar {
  padding: 4px 8px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  color: #777;
  background: #f8f6f0;
  border-top: 1px solid rgba(26,26,24,0.15);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pd-elev-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: #fdfcf9;
}
.pd-elev-empty svg {
  width: 100%;
  height: auto;
  max-height: 140px;
}

/* ==========================================================================
   RA DESIGN — HERON SHEET DARK-MODE PARITY & 4-QUADRANT INTERIOR BOARD FIX
   Ensures >11:1 contrast in dark mode ("The Sheet Survives Dark Mode Rule")
   and full-width 2x2 layout for the 4 interior presentation views.
   ========================================================================== */

/* 1. Full-width 2x2 presentation board for the Interior Track at >=1200px */
@media (min-width: 1200px) {
  .pd-var.is-sel.is-int {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .pd-var.is-sel.is-int .pd-wmwrap,
  .pd-var.is-sel.is-int .pd-key,
  .pd-var.is-sel.is-int .pd-sched-wrap {
    grid-column: 1 / -1;
  }
}

/* Horizontal legend under 4-quadrant images across full width */
.pd-var.is-int .pd-key {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin: 10px 0 16px;
  padding: 8px 14px;
  background: var(--pd-field);
  border: 1px solid var(--pd-line-ui);
}

/* Elevation watermark overlay across 4-wall composite */
.pd-elev-summary {
  position: relative;
  overflow: hidden;
}
.pd-elev-wm-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-elev-wm-overlay svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* 2. Study Selector Tabs: Theme-safe contrast in both Light and Dark modes */
.pd-root[data-theme="dark"] .pd-study-tab,
html[data-ra-theme="dark"] .pd-study-tab {
  background: #23231f;
  border-color: rgba(246, 234, 217, 0.35);
}
.pd-root[data-theme="dark"] .pd-study-tab:hover,
html[data-ra-theme="dark"] .pd-study-tab:hover {
  background: #2c2c27;
}
.pd-root[data-theme="dark"] .pd-study-tab.is-selected,
html[data-ra-theme="dark"] .pd-study-tab.is-selected {
  background: #2a2a25;
  border: 2px solid #c9a96e;
  box-shadow: 0 0 0 1px #c9a96e;
}
.pd-root[data-theme="dark"] .pd-study-tab.is-selected .pd-tab-meta b,
html[data-ra-theme="dark"] .pd-study-tab.is-selected .pd-tab-meta b {
  color: #e39a63 !important;
}
.pd-root[data-theme="dark"] .pd-study-tab .pd-tab-title,
html[data-ra-theme="dark"] .pd-study-tab .pd-tab-title {
  color: #f6ead9 !important;
}

/* 3. Furniture Schedule (Kusovník) & 2x2 Wall Elevations Card:
      Keep them on warm Heron Cream Paper (#f9f9f5) with dark ink (#1a1a18) in Dark Mode
      so they read as physical architectural sheets with >12:1 contrast. */
.pd-sched-wrap,
.pd-elev-summary {
  --pd-ink: #1a1a18;
  --pd-muted: #55534f;
  --pd-rust: #9a5326;
  --pd-field: #ffffff;
  color: #1a1a18;
}
.pd-root[data-theme="dark"] .pd-sched-wrap,
html[data-ra-theme="dark"] .pd-sched-wrap,
.pd-root[data-theme="dark"] .pd-elev-summary,
html[data-ra-theme="dark"] .pd-elev-summary {
  border-color: #c9a96e;
  box-shadow: 0 0 0 1px rgba(201, 169, 110, 0.45), 0 8px 24px rgba(0, 0, 0, 0.35);
}
.pd-root[data-theme="dark"] .pd-sched-wrap *:not(.pd-sched-tier-badge):not(.pd-ergo-tag):not(.pd-sched-tag):not(.pd-sched-scale-tag):not(.pd-locked-badge):not(.pd-locked-total),
html[data-ra-theme="dark"] .pd-sched-wrap *:not(.pd-sched-tier-badge):not(.pd-ergo-tag):not(.pd-sched-tag):not(.pd-sched-scale-tag):not(.pd-locked-badge):not(.pd-locked-total),
.pd-root[data-theme="dark"] .pd-elev-summary .pd-elev-top-title,
html[data-ra-theme="dark"] .pd-elev-summary .pd-elev-top-title {
  color: #1a1a18 !important;
}
.pd-root[data-theme="dark"] .pd-sched-wrap .pd-sched-head-left h4,
html[data-ra-theme="dark"] .pd-sched-wrap .pd-sched-head-left h4,
.pd-root[data-theme="dark"] .pd-sched-wrap .pd-sched-tag,
html[data-ra-theme="dark"] .pd-sched-wrap .pd-sched-tag,
.pd-root[data-theme="dark"] .pd-sched-wrap .pd-sched-total,
html[data-ra-theme="dark"] .pd-sched-wrap .pd-sched-total {
  color: #9a5326 !important;
}

/* Email Gate Overlay (locked/blurred choice screen) */
.pd-choice-stage {
  position: relative;
  min-height: 480px;
  width: 100%;
}
.pd-choice {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  transition: filter .35s ease, opacity .35s ease;
}
.pd-choice.is-locked {
  filter: blur(2px);
  opacity: 0.85;
  pointer-events: none;
  user-select: none;
}
.pd-gate-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  z-index: 20;
  background: rgba(244, 241, 232, 0.25);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: opacity .3s ease, visibility .3s ease;
}
.pd-root[data-theme="dark"] .pd-gate-overlay,
html[data-ra-theme="dark"] .pd-gate-overlay {
  background: rgba(26, 29, 27, 0.35);
}
.pd-gate-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.pd-gate-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(201, 169, 110, 0.45);
  border-radius: 12px;
  padding: 32px 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.05);
}
.pd-root[data-theme="dark"] .pd-gate-card,
html[data-ra-theme="dark"] .pd-gate-card {
  background: rgba(28, 31, 29, 0.88);
  border-color: rgba(201, 169, 110, 0.35);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
}
.pd-gate-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--pd-accent, #c7713d);
  color: #1a1a18;
  font: 700 11px/1 ui-monospace, Consolas, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 999px;
}
.pd-gate-h {
  margin: -4px 0 0;
  font: 700 clamp(17px, 2vw, 21px)/1.3 "BT Grotesk", Arial, sans-serif;
  color: var(--pd-ink);
  letter-spacing: -0.01em;
}
.pd-gate-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pd-gate-lbl {
  font: 600 12px/1.2 ui-monospace, Consolas, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pd-muted, #6e7671);
}
.pd-gate-in {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  font: 15px/1.3 "BT Grotesk", Arial, sans-serif;
  color: var(--pd-ink);
  background: var(--pd-page);
  border: 1.5px solid var(--pd-accent, #c7713d);
  border-radius: 6px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pd-gate-in:focus {
  box-shadow: 0 0 0 3px rgba(199, 113, 61, 0.25);
}
.pd-gate-in[aria-invalid="true"] {
  border-color: #b83a2a;
}
.pd-gate-err {
  margin: 4px 0 0;
  font: 600 12px/1.4 ui-monospace, Consolas, monospace;
  color: #b83a2a;
}
.pd-gate-btn {
  width: 100%;
  min-height: 46px;
  padding: 12px 18px;
  background: var(--pd-accent, #c7713d);
  color: #1a1a18;
  border: 0;
  border-radius: 6px;
  font: 700 14px/1.2 ui-monospace, Consolas, monospace;
  letter-spacing: .04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .15s ease;
}
.pd-gate-btn:hover:not(:disabled) {
  background: #b25f2e;
}
.pd-gate-check {
  font-size: 15px;
  font-weight: 700;
}
.pd-gate-foot {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 2px;
}
.pd-gate-back {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  font: 600 12px/1.4 ui-monospace, Consolas, monospace;
  color: var(--pd-muted, #6e7671);
  cursor: pointer;
  text-decoration: none;
  transition: color .15s ease;
}
.pd-gate-back:hover {
  color: var(--pd-ink);
  text-decoration: underline;
}



