/* v022: one readable drawer, spatially separate movement and map controls. */
#buyer{width:420px;max-width:calc(100vw - 40px);top:88px;right:20px;max-height:calc(100dvh - 108px);padding:16px;gap:10px;overflow:hidden;font-size:14px}
#buyer .buyer-tabs{display:none}
#buyer .panel-heading{display:flex;align-items:center;gap:8px;flex:none;margin:0}
#buyer .panel-heading h2{display:block;margin:0;font-size:20px;line-height:1.2;flex:1}
#buyer #close-buyer{position:static;width:44px;height:44px;padding:0;flex:none;font-size:24px}
#buyer .buyer-purpose{display:block;font-size:14px;line-height:1.5;margin:0;color:#e0e8df}
#buyer .buyer-purpose span{font-size:14px;color:#c6d6c9}
#buyer .buyer-content{display:block;flex:1 1 auto;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain;padding:0 6px 0 0;scroll-padding-top:0;scrollbar-gutter:stable}
#buyer .buyer-content>section{display:block!important;margin:0 0 20px;padding:0 0 16px;border-bottom:1px solid #ffffff30}
#buyer .finish-section{display:block;padding:0;margin:0 0 20px}
#buyer .finish-section h3,#buyer #room-lighting h3,#buyer #panel-furniture h3{font-size:16px;line-height:1.3;margin:0 0 5px;color:#fff}
#buyer .finish-section p,#buyer .panel-note,#buyer #room-lighting p,#buyer #furniture-catalog p{font-size:14px;line-height:1.45;margin:5px 0 10px;color:#d3dfd4}
#buyer .finish-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
#buyer .finish-choice{position:relative;display:flex;align-items:center;justify-content:center;min-height:64px;padding:12px 28px 12px 10px;border:2px solid #ffffff70;border-radius:10px;font-size:14px;font-weight:650;line-height:1.3;text-align:center;background-size:cover;gap:0}
#buyer .finish-choice>span:last-child{padding:0}
#buyer .finish-choice.texture-choice>span:last-child{background:#fff;color:#111;border-radius:4px;padding:4px 6px}
#buyer .finish-choice[aria-pressed=true]{border-color:#a5ff76;box-shadow:0 0 0 2px #14251c,0 0 0 4px #a5ff76}
#buyer .finish-check{position:absolute;right:5px;top:5px;bottom:auto;width:21px;height:21px;border-radius:50%;font-size:14px;color:#fff;background:#15361d;border:1px solid #fff;display:none;align-items:center;justify-content:center}
#buyer .finish-choice[aria-pressed=true] .finish-check{display:flex}
#buyer .finish-message[hidden]{display:none}
#buyer button,#buyer select,#buyer summary,#scene-tools button,#scene-tools select{min-height:44px;font-size:14px}
#buyer #room-lighting{padding:0;margin:0;border:0}
#buyer #room-lighting .lighting-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#buyer #room-lighting .lighting-choices button{min-height:48px;font-size:14px;white-space:normal;padding:8px}
#buyer #room-lighting details{font-size:14px}
#buyer #furniture-library{margin:0}
#buyer #furniture-library>summary{display:none}
#buyer #furniture-catalog .catalog-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#buyer #furniture-catalog .catalog-cards button{display:flex;flex-direction:column;align-items:stretch;gap:8px;padding:6px;border-radius:12px;min-width:0;font-size:14px;line-height:1.35;text-align:left;color:#f7f9f3;background:#24352a}
#buyer #furniture-catalog .catalog-cards img{display:block;width:100%;height:112px;object-fit:contain;background:#fff;border-radius:7px}
#buyer #furniture-catalog .catalog-cards button span{display:block;white-space:normal;overflow:visible;padding:0 3px 4px;font-size:14px;line-height:1.35}
#buyer #furniture-catalog>p{display:block;white-space:normal;overflow:visible;font-size:14px;line-height:1.45;margin:10px 0}
#buyer #furniture-catalog>.primary{display:block;width:100%;margin:10px 0;min-height:48px}
#buyer #furniture-library>.import-own{margin:12px 0;font-size:14px}
#buyer .import-own summary{display:flex;align-items:center;cursor:pointer;font-size:14px}
#buyer .import-own small{font-size:14px;line-height:1.4}
#buyer .panel-footer{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding-top:10px;margin:0;flex:none}
#buyer .panel-footer button{font-size:14px;min-width:0;padding:8px;line-height:1.3}
#buyer #resume-walking,#buyer #done-placing{grid-column:1/-1;width:100%;min-height:48px;flex:none}
#buyer .restore-help{position:static;font-size:14px;line-height:1.4;margin:0;color:#c6d6c9}
#buyer .action-help,#buyer #buyer-status{display:block;font-size:14px;line-height:1.4;margin:8px 0;color:#d3dfd4}
#buyer .finish-help{position:static;font-size:14px;min-height:44px;margin:4px 0}
#customize.drawer-handle{position:absolute;z-index:7;right:0;top:44%;border-radius:12px 0 0 12px;background:#d8f285;color:#14251a;padding:15px 14px;font-size:15px;font-weight:650;box-shadow:0 5px 24px #0004;max-width:180px}
#customize.drawer-handle span{padding-left:10px}
body.panel-open #customize.drawer-handle{visibility:hidden;pointer-events:none}
body.panel-open #scene{cursor:grab}
#floor-map{position:absolute;z-index:4;left:16px;right:auto;top:90px;bottom:auto;width:180px;padding:10px;background:#17291ef5;border:1px solid #b8d88f;border-radius:12px;pointer-events:none;color:#fff;box-shadow:0 6px 24px #0004}
#floor-map[hidden]{display:none}
#floor-map svg{display:block;width:100%;height:230px;margin:0 0 6px}
#floor-map strong{display:block;font-size:14px}
#floor-map small{display:block;font-size:14px;line-height:1.3;margin-top:4px}
.map-outline{fill:#e6e8d5;stroke:#8b9a8a;stroke-width:1.5;fill-rule:evenodd}.map-terrace{fill:#b5c7b0;stroke:#a8b7a3;stroke-width:1.1}.map-wall{stroke:#516653;stroke-width:1.1;stroke-linecap:round}.map-cone{fill:#53d87580;stroke:#258f4f}.map-position{fill:#086b35;stroke:#fff;stroke-width:2}
#tutorial{width:min(580px,calc(100vw - 24px));max-height:90dvh;overflow:auto;padding:24px;background:#17291f;color:#fff;border:1px solid #bad695;border-radius:18px;box-shadow:0 16px 65px #0007}
#tutorial::backdrop{background:#07140a80}
#tutorial h2{font-size:24px;line-height:1.2;margin:0 0 20px}
#tutorial .controls-overview{display:grid;grid-template-columns:1fr 1fr;gap:20px}
#tutorial .controls-overview svg{display:block;width:100%;height:100px;color:#d8f285;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
#tutorial h3{font-size:17px;margin:8px 0}
#tutorial p{font-size:16px;line-height:1.5;margin:6px 0}
#tutorial .help-customize{border-top:1px solid #ffffff30;padding-top:16px;margin-top:16px}
#tutorial button{min-height:48px;font-size:16px;margin-top:18px;width:100%}
@media(max-width:899px){
 #buyer{inset:auto 0 0;max-width:none;width:100%;max-height:45dvh;padding:10px 12px max(10px,env(safe-area-inset-bottom));gap:6px;border-radius:18px 18px 0 0}
 #buyer .panel-heading{display:flex!important;min-height:44px}
 #buyer .panel-heading h2{display:block!important;font-size:18px}
 #buyer .buyer-purpose{font-size:14px;line-height:1.35}
 #buyer .buyer-purpose span{display:none}
 #buyer .buyer-content{padding-top:0;min-height:45px}
 #buyer .finish-choices{grid-template-columns:1fr 1fr}
 #buyer .finish-choice{min-height:58px;font-size:14px}
 #buyer .panel-footer{grid-template-columns:.8fr 1.1fr 1.4fr;gap:5px;padding-top:6px}
 #buyer .panel-footer button{font-size:14px;padding:5px}
 #buyer #resume-walking{grid-column:auto;min-height:48px}
 #buyer #done-placing{grid-column:1/-1}
 #buyer .restore-help{display:none}
 #scene-tools .top-tools{flex-wrap:wrap;gap:5px;align-items:center}
 #scene-tools .top-tools button{padding:8px;font-size:14px}
 #scene-tools .top-tools .room-control{min-width:110px;max-width:160px;flex:1}
 #scene-tools .top-tools select{width:100%;font-size:14px;padding:10px 22px 10px 10px}
 .panel-open #scene-tools #pause{display:none}
 #customize.drawer-handle{top:42%;max-width:156px;font-size:14px;padding:12px 10px}
 #floor-map{left:10px;right:auto;top:128px;width:136px;padding:8px}
 #floor-map svg{height:142px}
 #floor-map small{font-size:12px}
 #tutorial{padding:18px}
 #tutorial .controls-overview{gap:12px}
}
@media(max-width:899px) and (max-height:500px){
 #buyer{gap:3px;padding:4px 10px}
 #buyer .buyer-purpose{display:none}
 #buyer .panel-footer{padding-top:2px}
 #floor-map{top:68px;width:126px}
 #floor-map svg{height:92px}
 #floor-map small{display:none}
 #tutorial .controls-overview svg{height:60px}
}
@media(prefers-reduced-motion:reduce){#buyer,#tutorial,#floor-map{scroll-behavior:auto;transition:none;animation:none}}

.panel-open #scene-tools #pause{display:none}
#walk-loading,#walk-loading-copy{color:#f8faf4}#walk-loading #cancel-loading{color:#f8faf4;border-color:#c3d4c5;font-size:14px}
@media(min-width:900px) and (max-height:650px){#floor-map svg{height:clamp(90px,calc(100dvh - 450px),180px)}}
@media(max-width:899px) and (min-height:501px) and (max-height:650px){#floor-map svg{height:110px}}
@media(max-width:899px) and (max-height:500px){#floor-map svg{height:68px}}

/* v023: product actions stay beside each photo; arrangement is one focused job. */
a.primary.inquiry,a.primary.inquiry:visited,a.primary.inquiry:hover,a.primary.inquiry:focus{color:#17251f!important;background:#d8f285}
a.primary.inquiry span{color:inherit}
#buyer #furniture-current{position:static;top:auto;z-index:auto;background:transparent}
#buyer #furniture-catalog .catalog-card{min-width:0;padding:8px;border:1px solid #a4baaa66;border-radius:12px;background:#24352a}
#buyer #furniture-catalog .catalog-card h4{font-size:15px;line-height:1.3;color:#fff;margin:10px 0;min-height:39px;font-weight:600}
#buyer #furniture-catalog .catalog-card img{height:132px}
#buyer #furniture-catalog .catalog-card .catalog-add{display:flex;width:100%;align-items:center;justify-content:center;min-height:46px;padding:10px 5px;border:1px solid #d8f285;border-radius:7px;background:#d8f285;color:#17251f;font-weight:650;text-align:center;font-size:14px}
#buyer #furniture-catalog .catalog-card .catalog-add:disabled{opacity:.6;cursor:wait}
#buyer #furniture-catalog .catalog-card summary{display:flex;align-items:center;font-size:14px;color:#dce9de;cursor:pointer;min-height:44px}
#buyer #furniture-catalog .catalog-card details p{font-size:13px;line-height:1.45;color:#dce9de;overflow-wrap:anywhere}
#buyer #furniture-catalog .catalog-error:empty{display:none}
#buyer #furniture-catalog .catalog-error{font-size:13px;color:#ffe5b5}
#buyer.placing-furniture .buyer-purpose,#buyer.placing-furniture .buyer-content>section#panel-finishes,#buyer.placing-furniture .buyer-content>section#panel-sun,#buyer.placing-furniture #furniture-library,#buyer.placing-furniture #panel-furniture>.panel-note,#buyer.placing-furniture #finish-help,#buyer.placing-furniture #undo-help,#buyer.placing-furniture #resume-walking{display:none!important}
#buyer.placing-furniture #panel-furniture{margin:0;padding:0;border:0}
#buyer.placing-furniture #furniture-current{padding:0 0 7px}
#buyer.placing-furniture #furniture-size-note{display:none}
#buyer.placing-furniture #dimensions{margin:4px 0;font-size:13px}
#buyer.placing-furniture #placement{margin:0}
#buyer.placing-furniture .placement-instruction{font-size:14px;line-height:1.4;margin:8px 0}
#buyer.placing-furniture .panel-footer{grid-template-columns:1fr 1fr}
#buyer.placing-furniture #done-placing{grid-column:1/-1;grid-row:2;font-size:15px}
#buyer.placing-furniture .restore-help{display:none}
@media(max-width:899px){
 #buyer.placing-furniture{max-height:min(66dvh,560px)!important}
 #buyer.placing-furniture .buyer-content{min-height:160px}
 #buyer.placing-furniture .move-heading{display:none}
 #buyer.placing-furniture .furniture-controls{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(2,44px);gap:5px;margin:6px 0;max-width:none}
 #buyer.placing-furniture .furniture-pad,#buyer.placing-furniture .furniture-rotation{display:contents}
 #buyer.placing-furniture .pad-center{display:none}
 #buyer.placing-furniture .move-left{grid-area:1/1}#buyer.placing-furniture .move-farther{grid-area:1/2}#buyer.placing-furniture .move-right{grid-area:1/3}#buyer.placing-furniture .move-closer{grid-area:2/2}
 #buyer.placing-furniture [data-furniture-nudge=counterclockwise]{grid-area:2/1}#buyer.placing-furniture [data-furniture-nudge=clockwise]{grid-area:2/3}
 #buyer.placing-furniture .furniture-pad button{flex-direction:row;gap:5px}
 #buyer.placing-furniture .furniture-rotation button{font-size:14px;min-height:44px}
 #buyer.placing-furniture .panel-footer{grid-template-columns:1fr 1fr 1.3fr}
 #buyer.placing-furniture #done-placing{grid-column:3;grid-row:1}
}
@media(max-width:899px) and (max-height:500px){
 #buyer.placing-furniture{left:auto!important;right:0!important;top:0!important;bottom:0!important;width:min(390px,50vw);height:100dvh;max-height:100dvh!important;border-radius:14px 0 0 14px}
 #buyer.placing-furniture .buyer-content{min-height:0}
}

#buyer #furniture-catalog .catalog-note{display:block;font-size:12px;line-height:1.4;color:#f0e6c5;margin:-3px 0 8px}

/* Approved option A: warm light surfaces, readable dark labels, one green next step. */
#buyer{background:#f8f8f2;color:#192c23;border:1px solid #d4dccf;border-radius:16px;box-shadow:0 12px 45px #14251f30;--muted:#516458}
#buyer .panel-heading h2,#buyer .finish-section h3,#buyer #room-lighting h3,#buyer #panel-furniture h3,#buyer #furniture-catalog .catalog-card h4{color:#192c23}
#buyer .buyer-purpose,#buyer .buyer-purpose span,#buyer .finish-section p,#buyer .panel-note,#buyer #room-lighting p,#buyer #furniture-catalog p,#buyer .restore-help,#buyer .action-help,#buyer #buyer-status,#buyer #furniture-size-note,#buyer #placement-summary,#buyer small,#buyer label,#buyer summary{color:#516458}
#buyer button:not(.finish-choice),#buyer select,#buyer input{background:#fff;color:#192c23;border:1px solid #b2bfb0;border-radius:9px}
#buyer button:not(.finish-choice):hover{border-color:#568936;background:#eff3e8}
#buyer button:focus-visible,#buyer select:focus-visible,#buyer summary:focus-visible{outline:3px solid #459024;outline-offset:2px}
#buyer button.primary,#buyer button.primary:hover,#buyer #furniture-catalog .catalog-card .catalog-add{background:#d8f285;color:#14251a;border-color:#d8f285;font-weight:700}
#buyer button:disabled{opacity:1;color:#657266;background:#e8ece3;border-color:#d3dccd;cursor:not-allowed}
#buyer .buyer-content>section,#buyer .panel-footer{border-color:#d4dccf}
#buyer .panel-footer{border-top:1px solid #d4dccf}
#buyer .buyer-content{scrollbar-color:#9eaf93 #f8f8f2}
#buyer .finish-choice{border-color:#b2bfb0}
#buyer .finish-choice[aria-pressed=true]{border-color:#548f32;box-shadow:0 0 0 2px #f8f8f2,0 0 0 4px #81ba53}
#buyer #room-lighting .lighting-choices [aria-pressed=true]{background:#edf5db;border-color:#548f32;box-shadow:0 0 0 1px #548f32;color:#192c23}
#buyer #furniture-catalog .catalog-card{background:#fff;border-color:#d4dccf}
#buyer #furniture-catalog .catalog-card summary,#buyer #furniture-catalog .catalog-card details p,#buyer #furniture-catalog .catalog-note{color:#516458}
#buyer #furniture-catalog .catalog-error{color:#843218}
#buyer #furniture-current,#buyer .placement-more{background:transparent;color:#192c23}
#buyer .furniture-pad .pad-center{background:#edf3e4;color:#385930}
#buyer #placement-warning{background:#fff1d7;color:#704408;border-color:#d9bd80}
#buyer #remove{color:#843218;background:#fff}
#buyer.placing-furniture #done-placing{box-shadow:0 0 0 3px #c3ed9933}
#buyer.placing-furniture #buyer-status{font-size:13px;margin:5px 0}
#buyer.placing-furniture #panel-furniture>h3{display:none}
@media(max-width:899px){#buyer{border-radius:16px 16px 0 0}}
#tutorial{background:#f8f8f2;color:#192c23;border-color:#d4dccf}
#tutorial .controls-overview svg{color:#548f32}#tutorial .help-customize{border-color:#d4dccf}
.price-card>a.primary.inquiry{display:inline-flex;align-items:center;gap:8px;padding:13px 18px;min-height:48px;margin:12px 0;border-radius:8px;line-height:1.4}
.price-card>a.primary.inquiry span{margin:0}.price-card>small{display:block;margin-top:5px}
#buyer #placement .placement-instruction,#buyer #placement .placement-instruction span,#buyer #placement .move-heading,#buyer #placement label,#buyer #placement output,#buyer #dimensions{color:#516458}
#buyer.placing-furniture #dimensions{display:none}
#buyer .panel-footer #remove{display:none}
#buyer.placing-furniture .panel-footer #remove{display:block;grid-column:2;grid-row:1}
#buyer.placing-furniture .panel-footer #undo{grid-column:1;grid-row:1}
#buyer.placing-furniture .panel-footer #reset-choices{display:none}
#buyer.placing-furniture #done-placing{grid-column:1/-1;grid-row:2}
#buyer .placement-more{border-color:#d4dccf}
@media(max-width:899px){#buyer.placing-furniture .panel-footer{grid-template-columns:1fr 1fr 1.3fr}#buyer.placing-furniture #done-placing{grid-column:3;grid-row:1}}
#buyer .panel-footer #remove{min-height:44px;padding:8px;font-size:14px;margin:0}
#buyer.placing-furniture .placement-more[open] #dimensions,#buyer.placing-furniture .placement-more[open] #furniture-size-note{display:block;color:#516458}
@media(max-width:380px){
 body:has(#buyer.placing-furniture:not([hidden])) #scene-tools #home,
 body:has(#buyer.placing-furniture:not([hidden])) #scene-tools #map-toggle,
 body:has(#buyer.placing-furniture:not([hidden])) #scene-tools #help,
 body:has(#buyer.placing-furniture:not([hidden])) #floor-map{display:none!important}
 body:has(#buyer.placing-furniture:not([hidden])) #scene-tools .top-tools{flex-wrap:nowrap;left:8px;right:8px;top:8px}
 #buyer.placing-furniture{max-height:60dvh!important}
}
