/* ==========================================================================
 * XÂY DỰNG giữ nguyên thanh tính năng chính (QUẢN LÝ · XÂY DỰNG · NÂNG CẤP · NHÂN VIÊN · NẤU ĂN) bên dưới,
 * giống các bảng khác: bảng xây dựng nằm ngay trên dock, nút XÂY DỰNG sáng lên, bấm nút khác là chuyển luôn.
 * ========================================================================== */
#build-bar { bottom: calc(var(--dock-h) + 4px); }
body.portrait #build-bar { bottom: var(--dock-h); padding-bottom: 7px; box-shadow: 0 -4px 14px rgba(0, 0, 0, .25); }
body.building #bottom-bar { z-index: 21; }

/* Màn dọc: thu gọn bảng để còn chỗ xem quán — bỏ tiêu đề (dock đã sáng nút XÂY DỰNG), 5 công cụ gọn trên một hàng */
body.portrait #build-bar .bbar-title { display: none; }
body.portrait #build-bar .bbar-tools { flex-wrap: nowrap; gap: 5px; }
body.portrait #build-bar .bbar-tools .btn { flex: 1 1 0; min-width: 0; padding: 5px 2px; font-size: 12.5px; white-space: nowrap; }
body.portrait #build-bar .bbar-tools .btn .pxi { display: none; }
body.portrait #build-bar .bbar-cats { margin: 5px 0 3px; }
body.portrait #build-bar .bbar-hint { font-size: 11.5px; line-height: 1.25; }

/* Công cụ xây dựng: xanh dương, công cụ đang dùng sáng vàng; XONG giữ xanh lá để thoát */
#build-bar .bbar-tools [data-act="b-tool"] { background: linear-gradient(#45a5f5, #1c79cf); --edge: #1664ad; --lip: #115291; }
#build-bar .bbar-tools [data-act="b-tool"].on { background: linear-gradient(#ffe066, #ffbf1a); --edge: #cf9800; --lip: #b07f00; color: var(--ink); text-shadow: none; outline: 0; box-shadow: 0 3px 0 var(--lip), 0 0 0 2px var(--ink); }

/* Đang xem thử sàn: ẩn hàng công cụ (thoát bằng dock hoặc "Chọn mẫu khác") để bảng thấp hơn, thấy nhiều quán hơn */
#build-bar:has(.finish-detail) .bbar-tools { display: none; }

/* ---- Đang cầm một món để đặt: một dòng gọn (ảnh · tên · tác dụng · Đổi món) ---- */
.bbar-sel { display: flex; align-items: center; gap: 9px; margin-top: 6px; padding: 5px 6px 5px 5px; background: #fff3dd; border: 2px solid #e2c895; border-radius: 12px; }
.bbar-sel > img { flex: 0 0 auto; width: 44px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.bbar-sel .bs-ct { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.bbar-sel .bs-ct b { font: 800 14px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bbar-sel .bs-ct small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.bbar-sel .btn { flex: 0 0 auto; white-space: nowrap; }
#build-bar .bbar-hint.sel { margin-top: 4px; color: var(--ink-2); font-weight: 700; }

/* ---- Màn dọc: danh sách món gọn hơn ---- */
body.portrait #build-bar { padding-top: 6px; }
body.portrait #build-bar .bbar-hint.dim { display: none; }          /* câu hướng dẫn mặc định đã có thẻ hướng dẫn */
body.portrait #build-bar .bbar-items { padding: 5px 2px 3px; gap: 6px; }
body.portrait #build-bar .bitem { width: 74px; padding: 3px 3px 4px; gap: 0; font-size: 11px; line-height: 1.15; }
body.portrait #build-bar .bitem > img { height: 36px; }
body.portrait #build-bar .bitem b { font-size: 12.5px; }
body.portrait #build-bar .bitem small { font-size: 9.5px; }
#build-bar .bitem[data-pc-id] small { width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
body.portrait #build-bar .bbar-cats button { padding: 3px 10px; font-size: 12.5px; }
body.portrait #build-bar .bbar-filters { padding: 0 0 3px; }
body.portrait #build-bar .bbar-filters button { padding: 2px 9px; }
body.portrait #build-bar .bitem.finish-card { width: 92px; min-height: 0; gap: 2px; }
body.portrait #build-bar .bitem.finish-card > img { width: 84px; height: 40px; }

/* ---- Thanh "Đang chuẩn bị quán": luôn nằm DƯỚI các bảng/popup (không bao giờ che tiêu đề + nút đóng của bảng) ---- */
#prep-bar { z-index: 24; }                      /* bảng 25 · popup 30 · hộp thoại cao hơn */
/* Màn dọc: dải mỏng một hàng dính ngay dưới HUD; nút nổi đẩy xuống thay vì bị che; bảng bắt đầu ngay dưới dải */
body.portrait.prep { --prep-h: 42px; }
body.portrait.prep #prep-bar { top: var(--top-h); left: 0; right: 0; transform: none; width: auto; max-width: none; height: var(--prep-h); box-sizing: border-box; overflow: hidden; justify-content: space-between; gap: 8px;
  padding: 0 6px 0 12px; border-width: 0 0 2.5px; border-radius: 0 0 14px 14px; box-shadow: 0 3px 0 rgba(42, 28, 28, .35); }
body.portrait.prep #prep-bar .pb-txt { flex: 1; min-width: 0; gap: 7px; }
body.portrait.prep #prep-bar .pb-txt span { min-width: 0; line-height: 1.15; }
body.portrait.prep #prep-bar b { font-size: 13px; white-space: nowrap; }
body.portrait.prep #prep-bar small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.portrait.prep #prep-bar .btn { flex: 0 0 auto; padding: 6px 12px; font-size: 12.5px; }
body.portrait.prep #prep-bar .btn .pxi { height: 13px; }
body.portrait.prep #floor-nav { top: calc(var(--top-h) + var(--prep-h) + 8px); }
body.portrait.prep .events { top: calc(100% + var(--prep-h) + 7px); }
body.portrait.prep #toasts { top: calc(var(--top-h) + var(--prep-h) + 8px); }
body.portrait.prep #panel { height: calc(100vh - var(--top-h) - var(--dock-h) - var(--prep-h) - 6px); }
