/* Shared game window (Patrician III-style): parchment body, wood-and-brass title bar. */
.pwin{background:#f4ead0;color:#302719;border:3px solid #6b4f2a;outline:1px solid #c9a35f;outline-offset:-5px;box-shadow:0 14px 44px #000a,inset 0 0 60px #d8c39a55;border-radius:2px}
.pwin-handle{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 14px;color:#f5e3b3;background:linear-gradient(#6d543a,#4a3722 55%,#3d2d1b);border-bottom:2px solid #c9a35f;cursor:move;touch-action:none;position:sticky;top:0;z-index:1}
.pwin-title{font:22px Georgia,"Times New Roman",serif;letter-spacing:.5px;text-shadow:0 1px 0 #0009}
.pwin-close{background:linear-gradient(#8a6a3f,#5e4526);color:#ffe9bb;border:1px solid #c9a35f;border-radius:3px;padding:4px 10px;font:13px Georgia,serif;cursor:pointer;min-height:32px}
.pwin-close:hover{filter:brightness(1.15)}
.pwin-close:focus-visible{outline:3px solid #ffd876;outline-offset:-2px}
.pwin-body{padding:12px}
.needs-scroll{overflow-x:auto;max-width:100%}.needs-table{border-collapse:collapse;min-width:650px;width:100%;font-size:.88rem}.needs-table th,.needs-table td{padding:.4rem .5rem;border-bottom:1px solid #b7aa8d;text-align:right;vertical-align:top}.needs-table th:first-child,.needs-table td:last-child{text-align:left}.needs-ledger summary{cursor:pointer;font-weight:bold;margin:.7rem 0}.needs-ledger p{line-height:1.45}

.needs-table td:last-child{max-width:230px;white-space:normal}.needs-table thead th:last-child{text-align:left}.needs-scroll{border-right:2px solid #b7aa8d}.needs-ledger small{line-height:1.3}

.needs-scroll-hint{display:none;font-size:.85rem;font-style:italic}@media(max-width:650px){.needs-scroll-hint{display:block}}
/* Give trade decisions the available screen instead of a narrow decorative overlay. */
body.in-city-3d .city-window[data-city-panel="market"]{top:38px;right:238px;width:min(1000px,calc(100vw - 24px));max-height:calc(100dvh - var(--game-header-height,96px) - 92px);box-sizing:border-box}
/* 900-1180px viewports: keep the window fully on screen beside the right rail (was off-screen left, names cut) */
@media(min-width:900px){body.in-city-3d .city-window[data-city-panel="market"]{width:min(1000px,calc(100vw - 254px))}}
@media(max-width:600px){body.in-city-3d .city-window[data-city-panel="market"]{right:6px;width:calc(100vw - 12px);max-height:calc(100dvh - var(--game-header-height,120px) - 220px)}}
/* P3 building summary card (owned-building window): icon + name + state + scannable stat cells */
.bwcard{display:flex;gap:10px;align-items:center;background:#fff8e6;border:2px solid #b98d4f;border-radius:8px;padding:6px 8px;margin:6px 0}
.bwcard .bwc-icon{flex:none}
.bwcard .bwc-name{font-size:15px}
.bwcard .bwc-name small{color:#7a6845;font-weight:400}
.bwcard .bwc-state{font-size:12px;color:#5a4a33;margin-top:1px}
.bwcard .bwc-stats{display:flex;gap:12px;margin-top:4px;flex-wrap:wrap}
.bwcard .bwc-stat{display:inline-flex;flex-direction:column;align-items:center;gap:1px;font-size:13px}
.bwcard .bwc-stat .bwc-val{display:inline-flex;align-items:center;gap:4px}
.bwcard .bwc-stat .bwc-lab{font-size:10px;line-height:1.2;color:#7a6845;font-weight:400}
.bwcard .bwc-stat svg{width:16px;height:16px}
.bwcard .bwc-bad{color:#a11}
/* P3 owned-building chips in the Construir tab: icon + name + state at a glance */
.bldchips{display:flex;flex-wrap:wrap;gap:6px}
.bldchip{display:inline-flex;align-items:center;gap:5px}
.bldchip svg{width:20px;height:20px;flex:none}
.bldchip-name{font-weight:700}
.bldchip-state{font-size:11px;color:#d8c9a8}
.bldchip-bad .bldchip-state{color:#ff9d8a;font-weight:700}
/* P3 build-offer cards on an owned empty plot: drawing + investment + running costs + production, grouped menu */
.bldoffer-group{margin:8px 0 2px;font-size:12px;color:#5a4a33}
.bldoffers{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:6px;margin:2px 0 8px}
.bldoffer-btn{padding:0;background:#fff8e6;border:2px solid #b98d4f;border-radius:8px;cursor:pointer;color:#493c25;text-align:center}
.bldoffer-btn:hover:not(:disabled){border-color:#8a6a1f}
.bldoffer-btn:disabled{opacity:.55;cursor:default}
.bldoffer{display:flex;flex-direction:column;align-items:center;gap:3px;padding:7px 6px;font-size:11px;line-height:1.3}
.bldoffer .gi{margin-right:0;vertical-align:-2px}
.bldoffer-name{font-size:13px}
.bldoffer-block{display:flex;flex-wrap:wrap;justify-content:center;gap:2px 6px;align-items:center}
.bldoffer-cost{display:inline-flex;align-items:center;gap:3px}
.bldoffer-mat{display:inline-flex;align-items:center;gap:1px}
.bldoffer-fee{color:#7a6845;width:100%}
.bldoffer-ops{color:#7a6845}
.bldoffer-prod{color:#5a4a33}
.bldoffer-out,.bldoffer-in{display:inline-flex;align-items:center;gap:2px}
.bldoffer-note{font-style:italic;color:#7a6845}

/* Build-offer card: the city's isometric model as the drawing (kept inside the card grid cell). */
.bldoffer-art{display:block;width:64px;height:64px;object-fit:contain;margin:0 auto}
/* Locked offer card: visible but truly disabled, the reason it cannot be built yet. The
   generic disabled fade would wash the reason out, so only the drawing fades; the words stay readable. */
.bldoffer-locked:disabled{opacity:1;border-style:dashed;cursor:default}
.bldoffer-locked .bldoffer-art{opacity:.55;filter:grayscale(.35)}
.bldoffer-locked .bldoffer-name{color:#6e5a3a}
.bldoffer-why{color:#5a4a33;font-style:italic}
