/* An occupied trading pit. Architecture is decorative; people carry live offers. */
#pit .open-pit .floor-main { grid-template-columns:minmax(0,1.65fr) minmax(320px,1fr); gap:24px; }
#pit .open-pit .floor-scene { min-height:550px; margin-top:4px; padding:0; border:0; overflow:visible; }
#pit .open-pit-geometry { position:absolute; inset:0; width:100%; height:100%; color:var(--hsc-grey-light); opacity:.48; stroke-width:1; pointer-events:none; }
#pit .open-pit .visible-brokers { display:block; position:absolute; inset:0; min-height:0; pointer-events:none; }
#pit .open-pit .floor-offer { position:absolute; width:184px; height:190px; min-height:0; padding:0 2px; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:0; pointer-events:auto; }
#pit .open-pit .pit-seat-0 { left:2%; top:0; }
#pit .open-pit .pit-seat-1 { right:1%; top:6%; }
#pit .open-pit .pit-seat-2 { left:6%; bottom:0; }
#pit .open-pit .pit-seat-3 { right:4%; bottom:0; }
#pit .open-pit .floor-broker-art { width:80px; height:96px; }
#pit .open-pit .floor-broker-art .babur-portrait { width:100%; height:100%; }
#pit .open-pit .floor-quote { width:auto; min-width:155px; max-width:100%; padding:7px 8px; border:0; border-top:1px solid var(--hsc-grey-light); border-radius:0; background:var(--hsc-paper); box-shadow:none; }
#pit .open-pit .floor-quote::before { content:''; position:absolute; top:-7px; left:50%; width:1px; height:7px; background:var(--hsc-grey-light); }
#pit .open-pit .floor-offer .broker-offer { grid-template-columns:auto auto; align-items:center; justify-content:center; gap:4px 7px; }
#pit .open-pit .floor-offer .broker-offer .offer-piece { grid-column:1; grid-row:1; justify-self:center; --m:8px; }
#pit .open-pit .floor-offer .broker-quantity { grid-column:2; grid-row:1; font:700 17px/1.2 var(--hsc-sans); white-space:nowrap; }
#pit .open-pit .floor-offer .broker-price { grid-column:1/-1; text-align:center; font:400 23px/1.2 var(--hsc-term); white-space:nowrap; }
#pit .open-pit .floor-offer .broker-state { grid-column:1/-1; text-align:center; font:12px/1.3 var(--hsc-sans); }
#pit .open-pit .floor-offer:is(:hover,:focus-visible) .floor-quote { background:var(--hsc-note); }
#pit .open-pit .floor-offer:focus-visible, #pit .open-pit .floor-funding-person:focus-visible { outline:3px solid var(--hsc-ink); outline-offset:4px; }
#pit .open-pit .floor-empty { position:absolute; top:40%; left:8%; right:8%; padding:18px 12px; background:var(--hsc-paper); }
#pit .open-pit .floor-funding-person { position:absolute; top:34%; left:50%; transform:translateX(-50%); display:flex; flex-direction:column; align-items:center; width:196px; min-height:44px; margin:0; padding:4px 6px 8px; border:0; background:var(--hsc-paper); color:var(--hsc-ink); cursor:pointer; }
#pit .funding-person-art { display:block; width:60px; height:72px; }
#pit .funding-person-art .fig { display:block; width:100%; height:100%; }
#pit .funding-invitation { font:600 18px/1.3 var(--hsc-serif); border-bottom:1px solid var(--hsc-grey-light); }
#pit .funding-person-name { font:12px/1.4 var(--hsc-sans); margin-top:3px; }
#pit .funding-person-terms { display:flex; flex-wrap:wrap; justify-content:center; gap:3px 6px; font:14px/1.4 var(--hsc-sans); }
#pit .funding-person-deadline { display:flex; align-items:baseline; gap:4px; font:12px/1.4 var(--hsc-sans); }
#pit .funding-person-deadline .pit-fuse { display:inline; border:0; background:none; margin:0; padding:0; width:auto; }
#pit .funding-person-deadline .pit-fuse::after { display:none; }
#pit .open-pit .floor-secondary { margin-top:6px; gap:8px; }
@media (min-width:769px) {
 #pit .open-pit .floor-main { overflow:auto; }
 #pit .open-pit .trading-room { grid-template-rows:max-content minmax(660px,1fr) max-content; }
}
@media (min-width:769px) and (max-width:1100px) {
 #pit .open-pit .floor-main { grid-template-columns:minmax(0,1.4fr) minmax(300px,1fr); gap:18px; }
 #pit .open-pit .floor-offer { width:160px; }
 #pit .open-pit .floor-quote { min-width:148px; }
 #pit .open-pit .floor-funding-person { width:184px; }
}
@media (max-width:768px) {
 #pit .open-pit .floor-main { display:flex; gap:16px; }
 #pit .open-pit .trading-room { display:grid; grid-template-rows:auto auto auto; }
 #pit .open-pit .floor-scene { height:530px; min-height:530px; }
 #pit .open-pit .floor-offer { width:180px; }
 #pit .open-pit .pit-seat-0 { left:7%; }
 #pit .open-pit .pit-seat-1 { right:7%; }
 #pit .open-pit .pit-seat-2 { left:9%; }
 #pit .open-pit .pit-seat-3 { right:9%; }
}
@media (max-width:600px) {
 #pit .open-pit .floor-main { gap:14px; }
 #pit .open-pit .floor-heading { flex-wrap:wrap; gap:4px 8px; }
 #pit .open-pit .floor-scene { height:360px; min-height:360px; }
 #pit .open-pit-geometry { opacity:.42; }
 #pit .open-pit .floor-offer { width:148px; height:160px; }
 #pit .open-pit .pit-seat-0 { top:5px; left:1%; }
 #pit .open-pit .pit-seat-1 { top:52px; right:1%; }
 #pit .open-pit .floor-broker-art { width:64px; height:77px; }
 #pit .open-pit .floor-quote { min-width:130px; padding:6px 4px; }
 #pit .open-pit .floor-offer .broker-quantity { font-size:16px; }
 #pit .open-pit .floor-offer .broker-price { font-size:21px; }
 #pit .open-pit .floor-offer .broker-offer .offer-piece { --m:7px; }
 #pit .open-pit .floor-funding-person { top:auto; bottom:0; left:8%; transform:none; width:184px; padding:4px 0; }
 #pit .funding-person-art { width:44px; height:53px; }
 #pit .funding-invitation { font-size:17px; }
 #pit .funding-person-name { font-size:11px; }
 #pit .funding-person-terms { font-size:13px; }
 #pit .funding-person-deadline { font-size:11px; }
 #pit .open-pit .floor-empty { top:10%; left:4%; right:4%; font-size:14px; }
}
@media (max-width:350px) {
 #pit .open-pit .floor-offer { width:138px; }
 #pit .open-pit .pit-seat-0 { left:0; }
 #pit .open-pit .pit-seat-1 { right:0; }
}

#pit .open-pit .floor-heading { flex-wrap:wrap; align-content:start; gap:0 8px; }
#pit .open-pit .floor-supply-note { flex:0 0 100%; height:20px; margin:0; padding:3px 0 0; font:12px/1.3 var(--hsc-sans); color:var(--hsc-grey); }
#pit .open-pit .floor-pagination > span { min-width:92px; }
#pit .open-pit .floor-retired { pointer-events:none; opacity:.45; }
#pit .open-pit .retired-offer-status { margin-top:4px; padding:4px 6px; background:var(--hsc-paper); font:13px/1.3 var(--hsc-sans); }
@media (max-width:600px) { #pit .open-pit .floor-pagination > span { min-width:78px; font-size:11px; } }

/* Pass 12: task first, with stable, non-overlapping offer and funding positions. */
#pit .open-pit .floor-main { grid-template-columns:minmax(0,1.25fr) minmax(340px,1fr); }
#pit .open-pit .current-task { border-top:3px solid var(--hsc-ink); }
#pit .open-pit .floor-scene { min-height:660px; }
#pit .open-pit .floor-funding-person { top:225px; bottom:auto; left:50%; transform:translateX(-50%); max-width:calc(100% - 24px); }
#pit .open-pit .floor-offer { height:auto; min-height:190px; }
#pit .open-pit .pit-seat-0 { top:0; left:1%; }
#pit .open-pit .pit-seat-1 { top:0; right:1%; }
#pit .open-pit .pit-seat-2 { top:460px; bottom:auto; left:1%; }
#pit .open-pit .pit-seat-3 { top:460px; bottom:auto; right:1%; }
#pit .open-pit .floor-quote { overflow-wrap:anywhere; }
#pit .open-pit .floor-offer .broker-price { font-size:clamp(15px,1.8vw,23px); }
#pit .current-task .fc-foot .task-find { white-space:normal; }
#pit .build-receipt-details { margin-top:18px; border-top:1px solid var(--hsc-grey-light); padding-top:12px; }
#pit .build-receipt-details summary { cursor:pointer; font:14px var(--hsc-sans); }
#pit .bm-next { margin:14px 0; font:17px/1.4 var(--hsc-sans); }
#pit .extension-progress { margin:22px 0; border-block:1px solid var(--hsc-grey-light); padding:14px 0; }
#pit .extension-progress li { margin:8px 0; }
#pit .training-placement-help { font:14px/1.4 var(--hsc-sans); padding:8px 12px; margin:0; background:var(--hsc-note); }
@media (min-width:769px) and (max-width:1100px) {
 #pit .open-pit .floor-main { grid-template-columns:minmax(0,1fr) minmax(300px,1fr); gap:16px; }
 #pit .open-pit .floor-offer { width:145px; }
 #pit .open-pit .floor-quote { min-width:130px; }
}
@media (max-width:768px) {
 #pit .open-pit .current-task-panel { order:-1; }
 #pit .open-pit .floor-scene { height:620px; min-height:620px; }
 #pit .open-pit .floor-funding-person { top:210px; bottom:auto; left:50%; transform:translateX(-50%); }
 #pit .open-pit .pit-seat-2, #pit .open-pit .pit-seat-3 { top:430px; }
 #pit .open-pit .task-navigation { margin-bottom:6px; }
 #pit .open-pit .current-task-content { padding:10px 12px; }
 #pit .open-pit .current-task .fc-name { font-size:24px; margin-bottom:5px; }
 #pit .open-pit .current-task :is(.fc-reward,.task-capital) { margin-bottom:5px; }
 #pit .open-pit .current-task .fc-slots { margin:6px 0; }
 #pit .open-pit .task-end-round { align-self:flex-end; }
 #pit .open-pit .floor-offer .broker-price { font-size:20px; }
}
@media (max-width:600px) {
 #pit .open-pit .floor-scene { height:410px; min-height:410px; }
 #pit .open-pit .floor-offer { min-height:170px; width:calc(50% - 6px); max-width:180px; }
 #pit .open-pit .floor-quote { width:100%; min-width:0; }
 #pit .open-pit .floor-funding-person { top:205px; width:210px; }
 #pit .open-pit .floor-offer .broker-price { font-size:18px; }
 #pit .open-pit .current-task .fc-name { font-size:22px; }
}
#pit .open-pit .single-task-company { align-content:start; grid-template-rows:auto auto auto auto; }
#pit .open-pit .single-task-company .current-task { flex:none; grid-template-rows:auto auto; }
#pit .open-pit .current-task-content { overflow:visible; }
/* Training instructions are an auto-height row above the playable board. */
#pit .tt.is-training:not(.arc-kernel) { grid-template-rows:auto auto minmax(0,1fr) auto; }
#pit .tt.is-training:not(.arc-kernel).is-done { grid-template-rows:auto minmax(0,1fr) auto; }

/* Pass 13: expose early demand and four stable offers per page on phones. */
#pit .floor-demand { flex:0 0 100%; display:flex; gap:8px; margin:4px 0 8px; }
#pit .floor-demand-button { flex:1 1 0; min-width:0; min-height:48px; padding:7px 9px; border:1px solid var(--hsc-grey-light); background:var(--hsc-paper); color:var(--hsc-ink); text-align:left; }
#pit .floor-demand-button b, #pit .floor-demand-button span { display:block; font:13px/1.35 var(--hsc-sans); }
#pit .floor-demand-button b { font-weight:600; }
#pit .floor-demand-button.has-stock { background:var(--hsc-note); }
#pit .floor-live-button { min-height:44px; padding:6px 10px; }
#pit .focus-training-skip, #pit .guide-training-skip { min-height:44px; padding:8px 12px; border:1px solid var(--hsc-grey-light); background:var(--hsc-paper); color:var(--hsc-ink); font:14px/1.3 var(--hsc-sans); cursor:pointer; }
#pit .focus-training-skip { margin-left:auto; flex-shrink:0; }
#pit .guide-training-skip { margin-top:16px; }
#pit .focus-training-skip:focus-visible, #pit .guide-training-skip:focus-visible, #pit .floor-demand-button:focus-visible { outline:3px solid var(--hsc-ink); outline-offset:2px; }
@media (max-width:600px) {
 #pit .floor-demand { gap:5px; }
 #pit .floor-demand-button { padding:6px; }
 #pit .floor-demand-button :is(b,span) { font-size:11px; }
 #pit .open-pit .floor-scene { height:390px; min-height:390px; }
 #pit .open-pit .floor-scene.has-floor-funding { height:565px; min-height:565px; }
 #pit .open-pit .pit-seat-0, #pit .open-pit .pit-seat-1 { top:0; }
 #pit .open-pit .pit-seat-2, #pit .open-pit .pit-seat-3 { top:195px; }
 #pit .open-pit .pit-seat-0, #pit .open-pit .pit-seat-2 { left:0; }
 #pit .open-pit .pit-seat-1, #pit .open-pit .pit-seat-3 { right:0; }
 #pit .open-pit .floor-funding-person { top:395px; }
 #pit .is-paper .pit-focus-heading { gap:8px; padding-inline:12px; }
 #pit .focus-training-skip { padding:8px; font-size:13px; }
}
