/* codex-shopui: shared geometry; individual windows keep their hand-made skins.
 * compact 440 / standard 780 / wide 1100 / full 1440; 92vw (full 96vw), max 88vh.
 * Root panels additionally respect PlazaWin's topbar/HUD band. */
[data-window-surface] { box-sizing: border-box; min-width: 0; overscroll-behavior: contain; }
[data-window-frame="popover"] { max-width: min(440px,92vw); max-height: 70vh; overscroll-behavior: contain; }
[data-window-frame="nested"]>:is(.plz-ph-sheetbox,.plz-so-sheetbox) { max-width: min(440px,100%); margin-inline: auto; max-height: 100%; overflow: auto; overscroll-behavior: contain; }
.plz-root .plz-soc-asks { width: min(440px,92%); max-height: 88dvh; overflow: auto; overscroll-behavior: contain; }
.plz-root [data-window-frame="stack-card"],.plz-root [data-window-frame="float"] { max-width: min(440px,100%); }
.plz-root #plzParty.is-squeezed[data-window-size] { max-height: max(170px,calc(var(--window-height) - var(--window-ask-height,180px))) !important; }
[data-window-frame="overlay"]>[data-window-surface] {
    width: var(--window-width) !important; max-width: 100% !important;
    max-height: var(--window-height) !important;
}
.plz-root [data-window-frame="panel"] {
    left: 50% !important; right: auto !important; top: var(--window-top) !important; bottom: auto !important;
    width: var(--window-width) !important; max-width: calc(100% - 12px) !important;
    max-height: var(--window-height) !important; transform: translateX(-50%) !important;
}
/* Fixed hub overlays remain viewport covers, including those with role=dialog on the cover itself. */
.hub-modal[data-window-frame="panel"] { width: auto !important; max-width: none !important; }
[data-window-frame="overlay"] { padding: 4vh 4vw; align-items: center; }
/* codex-shopui: the world map's own grid must centre the shared surface, including its sheet. */
.plz-wmap[data-window-frame="overlay"] { place-items: center; }
.plz-root :is(#plzInv,#plzQuestLog,#plzPhone,#plzTrade)[data-window-size] { height: min(760px,var(--window-height)) !important; }
.plz-root .plz-gfx[data-window-size] { height: var(--window-height) !important; }
/* A furniture picker is a dock beside the live room: placement must stay usable. */
.plz-root .plz-home-tray[data-window-frame="dock"] { width: min(440px,42%) !important; top: calc(var(--window-top) + 48px) !important; height: calc(var(--window-height) - 48px); max-height: calc(var(--window-height) - 48px); bottom: auto !important; overflow: hidden; }
.plz-root :is(#plzTodayWin,#plzJobs,#plzStreetWin,#plzSkate)[data-window-size] { display: flex; flex-direction: column; overflow: hidden; }
.plz-root [data-window-size] :is(.plz-win-head,.plz-hk-head,.plz-set-head) { flex-shrink: 0; }
.plz-root [data-window-size] :is(.plz-hk-body,.plz-jobs-body,.plz-street-body,.plz-sk-body) { min-height: 0; overflow: auto; overscroll-behavior: contain; }
/* Today: a featured banner, then a real notice board, never a stretched list. */
.plz-root #plzTodayWin .plz-hk-body { display: grid; grid-template-columns: repeat(auto-fit,minmax(290px,1fr)); gap: 12px; padding: 14px; align-items: stretch; }
.plz-root #plzTodayWin .plz-hk-sec { display: grid; grid-template-columns: 40px minmax(0,1fr); grid-template-rows: auto 1fr auto; gap: 8px 10px; padding: 14px; align-content: start; }
.plz-root #plzTodayWin .plz-hk-sec>.plz-hk-tx { grid-column: 2; grid-row: 1 / 3; }
.plz-root #plzTodayWin .plz-hk-way { grid-column: 2; justify-self: start; align-self: end; }
.plz-root #plzTodayWin :is(.plz-hk-feat,.plz-hk-level,.plz-hk-friends,.plz-hk-how) { grid-column: 1 / -1; }
.plz-root #plzTodayWin .plz-hk-feat { grid-template-columns: 56px minmax(0,1fr) auto; grid-template-rows: auto; align-items: center; padding: 18px; }
.plz-root #plzTodayWin .plz-hk-feat>.plz-hk-tx { grid-row: auto; }
.plz-root #plzTodayWin .plz-hk-feat>.plz-hk-way { grid-column: 3; align-self: center; }
.plz-root #plzTodayWin .plz-hk-feat .plz-hk-ic { width: 50px; height: 50px; }
.plz-root #plzTodayWin .plz-hk-feat b { font-size: 1.2rem; }
.plz-root #plzTodayWin :is(.plz-hk-level,.plz-hk-friends) { display: block; }
.plz-root [data-window-size] .plz-hk-way { min-height: 36px; padding: 6px 12px; font-size: .8rem; white-space: normal; }
/* Lists already have distinct list/detail panes: keep that hierarchy and let the list breathe. */
@media (min-width: 600px) {
    #hubSettings .hub-drawer { grid-template-columns: repeat(2,minmax(0,1fr)); height: auto; }
    #hubSettings .hub-drawer>:is(.hub-dialog-head,.hub-drawer-foot) { grid-column: 1 / -1; }
    .plz-root .plz-mm-help-box { width: min(1100px,92%); }
    .plz-root .plz-mm-help .plz-keys { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .plz-root #plzInv .plz-inv-main { grid-template-columns: 160px minmax(0,1fr) 290px; }
    .plz-root #plzQuestLog .plz-ql-main { grid-template-columns: minmax(250px, .85fr) minmax(0,1.3fr); }
    .plz-root .plz-set-box .plz-set-checks { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
    .plz-root .plz-set-box .plz-set-body { min-height: 0; }
    .plz-root #plzPhone .plz-ph-home { grid-template-columns: repeat(auto-fit,minmax(110px,1fr)); align-content: start; }
    .plz-root #plzPhone .plz-ph-grid { grid-template-columns: repeat(auto-fit,minmax(100px,1fr)); }
    .plz-root #plzPhone .plz-hk-phone { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; gap: 10px; }
    .plz-root #plzPhone .plz-hk-phone>:is(.plz-hk-feat,.plz-hk-level,.plz-hk-friends,.plz-hk-how) { grid-column: 1 / -1; }
    .plz-root #plzParty[data-window-size] { display: grid; grid-template-columns: 1fr 1fr; overflow: auto; }
    .plz-root #plzParty .plz-pty-top { display: contents; }
    .plz-root #plzParty :is(.plz-pty-head,.plz-pty-foot) { grid-column: 1 / -1; }
    .plz-root #plzParty:has(.plz-pty-chatbox[hidden]) .plz-pty-body { grid-column: 1 / -1; }
    .plz-root #plzParty .plz-pty-chatbox { border-top: 0; border-left: 2px dashed #d9c49c; }
    .plz-root #plzParty .plz-pty-chat { height: 190px; }
    [data-window-size] .plz-home-lane { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; }
    [data-window-size] .plz-home-lane>:is(h3,p,form) { grid-column: 1 / -1; }
    [data-window-size] .plz-home-book { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; }
    [data-window-size] .plz-home-book>:is(h3,p,form) { grid-column: 1 / -1; }
    .plz-root #plzJobs .plz-jobs-offers { display: grid; grid-template-columns: repeat(auto-fit,minmax(270px,1fr)); gap: 12px; }
    .plz-root #plzStreetWin .plz-street-body:has(>.plz-street-event) { display: grid; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); gap: 12px; }
    .plz-root #plzStreetWin .plz-street-body>.plz-street-note { grid-column: 1 / -1; }
}
/* Every tab row scrolls horizontally; labels and selection hooks stay intact. */
[data-window-size] :is([role="tablist"]:not(.plz-inv-tabs),.plz-shop-tabs,.plz-home-tabs,.plz-street-tabs,.plz-set-tabs) { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; flex-shrink: 0; }
[data-window-size] :is([role="tablist"]:not(.plz-inv-tabs),.plz-shop-tabs,.plz-home-tabs,.plz-street-tabs,.plz-set-tabs)>button { flex-shrink: 0; }
@media (min-width: 800px) {
    .plz-root #plzSkate[data-tab="boards"] .plz-sk-body { display: grid; grid-template-columns: minmax(190px,.35fr) minmax(0,1fr); gap: 10px 22px; align-content: start; }
    .plz-root #plzSkate[data-tab="boards"] .plz-sk-body>* { grid-column: 2; min-width: 0; }
    .plz-root #plzSkate[data-tab="boards"] .plz-sk-body>.plz-sk-preview { grid-column: 1; grid-row: 1 / span 10; position: sticky; top: 0; align-self: start; flex-wrap: wrap; }
}
@media (min-width: 800px) and (max-width: 999px) {
    .plz-root #plzSkate[data-tab="boards"] .plz-sk-preview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; padding: 8px; }
    .plz-root #plzSkate .plz-sk-preview figure { margin: 0; }
    .plz-root #plzSkate .plz-sk-preview figure>svg { height: 110px; width: 65px; }
    .plz-root #plzSkate .plz-sk-avatar { grid-column: 1 / -1; justify-self: center; height: 130px; width: 104px; }
    .plz-root #plzSkate .plz-sk-avatar>svg { height: 120px; width: 104px; }
    .plz-root #plzSkate .plz-sk-preview-board { width: 70px; left: 16px; }
}
@media (max-width: 599px) {
    .plz-root:has(>[data-window-frame="panel"]:not([hidden])),.plz-root:has(>.plz-set:not([hidden])) { z-index: 201; }
    .plz-root:has(>.plz-soc-asks:not(:empty)) { z-index: 201; }
    .plz-root .plz-soc-asks:not(:empty) { position: fixed; left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100vw !important; max-width: 100vw; transform: none; }
    .plz-root:has(>.plz-soc-asks:not(:empty)) #plzParty[data-window-size] { bottom: var(--window-ask-height,180px) !important; max-height: calc(88dvh - var(--window-ask-height,180px)) !important; }
    [data-window-frame="overlay"] { padding: 0 !important; align-items: end !important; place-items: end center; }
    .plz-wmap[data-window-frame="overlay"] { place-items: end center; }
    [data-window-frame="overlay"]>[data-window-surface] { width: 100vw !important; max-width: 100vw !important; border-radius: 18px 18px 0 0 !important; margin: 0 !important; }
    .plz-root [data-window-frame="overlay"]>[data-window-surface] { width: 100% !important; max-width: 100% !important; }
    .plz-root .plz-set[data-window-frame] { padding: 0 !important; }
    .plz-root [data-window-frame="panel"] { position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: 100vw !important; max-width: 100vw !important; max-height: 88dvh !important; transform: none !important; border-radius: 18px 18px 0 0 !important; }
    .plz-root :is(#plzInv,#plzQuestLog,#plzPhone,#plzTrade,.plz-gfx)[data-window-size] { height: 88dvh !important; }
    .plz-root>.plz-set[data-window-frame="overlay"] { position: fixed; inset: 0; }
    .plz-root>.plz-set[data-window-frame="overlay"]>[data-window-surface] { width: 100vw !important; max-width: 100vw !important; max-height: 88dvh !important; }
    #dzActsSheet>[data-window-surface] { left: 0; right: 0; bottom: 0; }
    .hub-filters-open [data-window-frame="rail"] { max-height: 88dvh; width: 100vw; }
    .plz-root #plzTodayWin .plz-hk-body { grid-template-columns: minmax(0,1fr); padding: 10px; gap: 8px; }
    .plz-root #plzTodayWin .plz-hk-feat { grid-template-columns: 40px minmax(0,1fr); padding: 12px; }
    .plz-root #plzTodayWin .plz-hk-feat>.plz-hk-way { grid-column: 2; }
    .plz-root [data-window-size] .plz-hk-way { min-height: 44px; }
    .plz-root #plzPhone { height: var(--window-height) !important; }
    [data-window-frame="popover"] { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: 100% !important; max-width: 100% !important; border-radius: 18px 18px 0 0; }
    .plz-root .plz-home-tray[data-window-frame="dock"] { top: auto !important; bottom: 0 !important; left: 0; right: 0; width: 100% !important; height: 46%; max-height: 46%; }
    .plz-root .plz-home-tray[data-window-frame="dock"] .plz-home-filters { grid-template-columns: repeat(4,minmax(0,1fr)); }
    .plz-root .plz-home-tray[data-window-frame="dock"] .plz-home-filters .plz-home-search { grid-column: 1 / -1; }
    .plz-root [data-window-frame="float"] { left: 0; right: 0; bottom: 0; width: 100%; max-width: 100%; transform: none; border-radius: 18px 18px 0 0; }
}
/* codex-plazaui: a canvas workspace uses the sizing registry's viewport measurements. */
.plz-root [data-window-frame="workspace"][data-window-size] {
    position:fixed !important; inset:auto !important; left:50% !important; top:var(--window-top) !important;
    width:var(--window-width) !important; height:var(--window-height) !important; max-height:var(--window-height) !important;
    transform:translateX(-50%) !important; box-sizing:border-box;
}
.plz-root:has(>[data-window-frame="workspace"]:not(.is-out)) { z-index:201; }
/* codex-plazaui: end */
