/* Biz Tycoon — layout + pure-CSS SimCity buildings */
:root {
  --bg: #101826;
  --panel: #182338;
  --panel2: #1f2d47;
  --line: #2c3d5e;
  --text: #e8eefb;
  --muted: #93a4c4;
  --accent: #4cc2ff;
  --good: #4ade80;
  --bad: #f87171;
  --warn: #fbbf24;
  --grass1: #2e7d43;
  --grass2: #2a713d;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex; flex-direction: column;
}
button {
  font: inherit; color: var(--text); background: var(--panel2);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer;
}
button:hover { border-color: var(--accent); }
button:disabled { opacity: .55; cursor: not-allowed; border-color: var(--line); }
button.ghost { background: transparent; }
button.primary { background: var(--accent); color: #06263a; border: none; font-weight: 600; }
button.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
input, select {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px;
}

/* Topbar */
#topbar {
  display: flex; align-items: center; gap: 14px; padding: 10px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap;
}

/* Shown only while "inside" a founded portfolio company — see
   enterPortfolioCompany/exitPortfolioCompany in main.js. */
.portfolio-banner {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 7px 16px; background: linear-gradient(90deg, #4c1d95, #6d28d9);
  color: #f5f3ff; font-size: 13px; font-weight: 600;
}
.portfolio-banner[hidden] { display: none; }
.portfolio-banner button {
  background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #f5f3ff;
  padding: 4px 10px; font-size: 12.5px; font-weight: 600;
}
.portfolio-banner button:hover { background: rgba(255,255,255,.24); }
#topbar .brand { font-size: 16px; }
#topbar .stat { color: var(--muted); }
#topbar .stat b { color: var(--text); }
#topbar .spacer { flex: 1; }
.month-progress {
  min-width: 150px; color: var(--muted); font-size: 12px;
  display: flex; flex-direction: column; gap: 3px;
}
.month-progress i {
  display: block; height: 5px; border-radius: 999px;
  background: #0b1220; overflow: hidden; border: 1px solid var(--line);
}
.month-progress b {
  display: block; height: 100%; border-radius: inherit;
  background: var(--accent); transition: width .2s linear;
}
.speed { display: flex; gap: 8px; }
.lang-picker {
  display: flex; align-items: center; gap: 4px;
  padding: 0 6px; height: 28px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel2); color: var(--text);
  /* Modals (#modal-root) are position:fixed with z-index:50 and cover the
     whole viewport, including the topbar. The language picker must stay
     usable even while a modal is open (e.g. the mandatory picker shown on
     first load, or the modal re-opened after a language switch), so it
     needs its own stacking context above the modal layer. */
  position: relative; z-index: 51;
}
.lang-picker select {
  border: none; background: transparent; color: var(--text);
  padding: 4px 6px; font: inherit; cursor: pointer;
}
.lang-picker select:focus { outline: 1px solid var(--accent); }
.lang-picker .lang-label { opacity: .8; font-size: 13px; }
.speed button.active { background: var(--accent); color: #06263a; font-weight: 700; }

/* Layout */
#layout { flex: 1; display: flex; min-height: 0; }
#city { flex: 1.7; padding: 14px; overflow: auto; display: flex; flex-direction: column; min-width: 0; }
#side {
  width: min(44vw, 520px); min-width: 380px; border-left: 1px solid var(--line);
  background: var(--panel); display: flex; flex-direction: column;
}
.panel-title { margin: 0; font-size: 15px; color: var(--muted); font-weight: 600; }
.city-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}

/* Full-width walk mode (HQ tab): the walkaround scene is the point, so the
   contextual side panel — mostly redundant with what a department door
   already opens — steps aside and the scene takes the whole main column. */
#layout.walk-mode #side { display: none; }
#layout.walk-mode #grid.tab-scene { min-height: calc(100vh - 190px); }

/* City grid */
#grid {
  display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 14px;
  padding: 18px; border-radius: 14px;
  flex: 1;
  min-height: 520px;
  background:
    repeating-linear-gradient(45deg, var(--grass1) 0 14px, var(--grass2) 14px 28px);
  box-shadow: inset 0 0 0 4px #245c34, inset 0 0 40px rgba(0,0,0,.35);
}
#grid.tab-scene {
  display: block;
  padding: 0;
  background: transparent;
  box-shadow: none;
  min-height: min(720px, calc(100vh - 190px));
}
.lot {
  min-height: 170px; border-radius: 10px; position: relative;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 10px 6px 8px;
}
.lot.empty {
  border: 2px dashed rgba(255,255,255,.35); cursor: pointer;
  align-items: center; flex-direction: column; gap: 6px; color: #eafbe7;
  background: rgba(0,0,0,.08); transition: background .15s;
}
.lot.empty:hover { background: rgba(255,255,255,.12); }
.lot.empty .trees { font-size: 22px; opacity: .9; }
.lot.empty .plus { font-size: 13px; font-weight: 600; background: rgba(0,0,0,.35); padding: 3px 10px; border-radius: 999px; }

.building {
  width: 86%; cursor: pointer; position: relative;
  animation: pop .35s ease-out; transition: transform .12s;
}
.building:hover { transform: translateY(-4px); filter: brightness(1.08); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.roof {
  height: 16px; border-radius: 8px 8px 0 0; margin: 0 8px;
  background: rgba(0,0,0,.3);
}
.walls {
  border-radius: 4px 4px 0 0; padding: 8px 8px 6px; min-height: 54px;
  display: flex; flex-direction: column; gap: 5px; justify-content: flex-end;
  box-shadow: inset -10px 0 18px rgba(0,0,0,.28), 0 8px 14px rgba(0,0,0,.4);
}
.win-row { display: flex; gap: 5px; justify-content: center; }
.win {
  width: 12px; height: 12px; border-radius: 2px;
  background: linear-gradient(#ffe9a8, #ffc94d); box-shadow: 0 0 6px rgba(255,220,120,.7);
}
.sign {
  background: rgba(6, 14, 26, .78); border-radius: 6px; text-align: center;
  padding: 3px 4px; font-size: 11.5px; font-weight: 600; margin-top: 6px;
}
.sign .lvl { color: var(--warn); }
.b-operations .walls { background: #b45309; } .b-operations .roof { background: #7c3a06; }
.b-sales .walls      { background: #0e7490; } .b-sales .roof      { background: #0a4f63; }
.b-marketing .walls  { background: #a21caf; } .b-marketing .roof  { background: #6d1275; }
.b-rnd .walls        { background: #4338ca; } .b-rnd .roof        { background: #2b2384; }
.b-hr .walls         { background: #15803d; } .b-hr .roof         { background: #0e5429; }
.b-finance .walls    { background: #b91c1c; } .b-finance .roof    { background: #7c1212; }
.b-support .walls    { background: #c2790a; } .b-support .roof    { background: #855205; }
.b-logistics .walls  { background: #2563eb; } .b-logistics .roof  { background: #1d4ed8; }
.b-it .walls         { background: #0369a1; } .b-it .roof         { background: #075985; }
.b-legal .walls      { background: #4b5563; } .b-legal .roof      { background: #374151; }
.b-facilities .walls { background: #64748b; } .b-facilities .roof { background: #475569; }

/* Tab scene stage */
.scene-stage {
  min-height: 100%; position: relative; overflow: hidden; border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(#17253a, #111827);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03), 0 18px 42px rgba(0,0,0,.28);
}
.scene-sky {
  position: absolute; inset: 0 0 42%;
  background: linear-gradient(#243d63, #627da0 70%, #8aa1b7);
}
.scene-floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 54%;
  background:
    linear-gradient(120deg, rgba(255,255,255,.09) 0 1px, transparent 1px 78px),
    linear-gradient(240deg, rgba(255,255,255,.06) 0 1px, transparent 1px 86px),
    linear-gradient(#2f4057, #1b2636);
}
.scene-label {
  position: absolute; top: 18px; left: 18px; z-index: 3;
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border-radius: 8px;
  background: rgba(8, 14, 26, .78); border: 1px solid rgba(255,255,255,.16);
}
.scene-label b { font-size: 16px; }
.scene-label span { color: var(--muted); font-size: 12px; }
.scene-stats {
  position: absolute; top: 18px; right: 18px; z-index: 3;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, auto)); gap: 8px;
  max-width: min(520px, calc(100% - 220px));
}
.scene-stats span {
  display: flex; flex-direction: column; gap: 1px; align-items: flex-end;
  min-width: 74px; padding: 8px 10px; border-radius: 8px;
  background: rgba(8, 14, 26, .72); border: 1px solid rgba(255,255,255,.14);
}
.scene-stats small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.scene-body { position: absolute; inset: 84px 22px 22px; z-index: 2; }

.scene-products .scene-sky { background: linear-gradient(#607086, #aab3bd); }
.scene-products .scene-floor { background: linear-gradient(#5d6470, #2d343e); }
.product-warehouse { position: absolute; inset: 0; }
.warehouse-rack {
  position: absolute; left: 4%; top: 4%; width: 58%; bottom: 36%;
  display: grid; gap: 8px; align-content: stretch;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  overflow: auto; padding-right: 4px;
}
.product-lane {
  min-width: 0; display: flex; flex-direction: column; gap: 8px;
  padding: 10px; border-radius: 10px; background: rgba(21, 32, 48, .88);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset -12px 0 0 rgba(0,0,0,.16);
}
.product-lane.ok { border-color: rgba(74,222,128,.45); }
.product-lane.low { border-color: rgba(251,191,36,.7); }
.product-lane.stockout { border-color: rgba(248,113,113,.85); box-shadow: inset -12px 0 0 rgba(248,113,113,.12); }
.product-lane.overstock { border-color: rgba(76,194,255,.6); }
.product-lane.empty { align-items: flex-start; justify-content: center; }
.product-lane-head, .product-price-control { display: flex; justify-content: space-between; gap: 10px; min-width: 0; }
.product-lane-head b, .product-lane-head span, .product-price-control span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.product-lane-head span, .product-price-control span { color: var(--muted); font-size: 12px; }
.product-lane-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.product-lane-kpis span {
  min-width: 0; display: flex; flex-direction: column; padding: 6px 8px; border-radius: 7px;
  background: rgba(8, 14, 26, .56); border: 1px solid rgba(255,255,255,.08);
}
.product-lane-kpis small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.product-price-control label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.product-price-control input { width: 82px; padding: 4px 6px; }
.product-bars { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; font-size: 11px; color: var(--muted); }
.product-bars i { height: 6px; border-radius: 999px; background: rgba(8,14,26,.85); overflow: hidden; }
.product-bars b { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.product-bars b.warn { background: var(--warn); }
.product-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.product-actions button { padding: 5px 8px; font-size: 12px; }
.conveyor {
  position: absolute; left: 6%; right: 32%; bottom: 14%; height: 52px; border-radius: 999px;
  background: repeating-linear-gradient(90deg, #202938 0 26px, #121a27 26px 52px);
  border: 1px solid rgba(255,255,255,.18);
}
.product-box {
  position: absolute; top: -14px; left: calc(8% + var(--i) * 13%);
  font-size: 28px; filter: drop-shadow(0 8px 8px rgba(0,0,0,.45));
}
.product-box.incoming { animation: boxmove 3.8s linear infinite; animation-delay: calc(var(--i) * -.45s); }
body.game-paused #grid .product-box.incoming,
body.game-paused #grid .office-worker {
  animation-play-state: paused;
}
@keyframes boxmove { from { transform: translateX(-24px); } to { transform: translateX(150px); } }
.packing-desk {
  position: absolute; right: 5%; bottom: 14%; width: 220px; min-height: 88px;
  display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 8px;
  padding: 12px;
  border-radius: 8px 8px 3px 3px; background: #7c4a2d;
  box-shadow: inset -18px 0 0 rgba(0,0,0,.18), 0 14px 20px rgba(0,0,0,.28);
}
.warehouse-alerts {
  position: absolute; top: 4%; right: 5%; width: 28%; min-width: 190px; max-height: 58%;
  padding: 12px; border-radius: 10px; background: rgba(8, 14, 26, .74);
  border: 1px solid rgba(255,255,255,.14); overflow-y: auto;
}
.warehouse-alerts h3 { margin: 0 0 8px; font-size: 13px; }
.warehouse-alerts ul { margin: 0; padding-left: 18px; color: #fde68a; }
.warehouse-alerts li { margin-bottom: 6px; }
.warehouse-alerts p { margin: 0; color: var(--muted); }

.scene-growth .scene-sky { background: linear-gradient(#312e5f, #6a4f8d); }
.scene-growth .scene-floor { background: linear-gradient(#46365c, #20192e); }
.growth-studio { position: absolute; inset: 0; }
.screen-wall {
  position: absolute; left: 4%; right: 38%; top: 5%; height: 52%;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.growth-screen {
  position: relative; overflow: hidden; border-radius: 8px; padding: 10px;
  background: #07111f; border: 1px solid rgba(76,194,255,.35);
  box-shadow: 0 0 18px rgba(76,194,255,.12);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
  min-width: 0; color: var(--text); text-align: left;
}
.growth-screen:hover:not(:disabled) {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(76,194,255,.22);
}
.growth-screen b { position: relative; z-index: 2; font-size: 11px; color: #dff7ff; }
.growth-screen span, .growth-screen small { position: relative; z-index: 2; color: var(--muted); font-size: 11px; }
.growth-screen small { color: #bae6fd; }
.growth-screen i {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(rgba(76,194,255,.12), rgba(76,194,255,.45));
}
.campaign-wall {
  position: absolute; right: 4%; top: 5%; width: 30%;
  display: grid; gap: 8px;
}
.campaign-board {
  padding: 9px 10px; border-radius: 8px;
  background: rgba(12, 21, 34, .82); border: 1px solid rgba(255,255,255,.14);
  color: var(--text); text-align: left; min-width: 0;
}
.campaign-board:hover:not(:disabled) { border-color: var(--accent); background: rgba(19, 35, 57, .9); }
.campaign-board.active { border-color: rgba(74,222,128,.7); box-shadow: 0 0 18px rgba(74,222,128,.12); }
.campaign-board:disabled, .growth-screen:disabled { opacity: .72; cursor: not-allowed; }
.campaign-board b, .campaign-board span, .campaign-board small {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.campaign-board span { color: var(--muted); font-size: 12px; }
.campaign-board small { color: #bae6fd; font-size: 11px; margin-top: 2px; }
.growth-funnel {
  position: absolute; left: 5%; right: 38%; top: 60%; bottom: 4%;
  padding: 12px; border-radius: 10px; background: rgba(8, 14, 26, .74);
  border: 1px solid rgba(255,255,255,.14); overflow-y: auto;
}
.growth-funnel h3 { margin: 0 0 8px; font-size: 13px; }
.growth-funnel p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.funnel-step {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 8px;
  padding: 6px 0 8px; font-size: 12px; overflow: hidden;
}
.funnel-step span, .funnel-step b { position: relative; z-index: 2; }
.funnel-step span { color: var(--muted); }
.funnel-step i {
  position: absolute; left: 0; right: auto; bottom: 2px; height: 4px;
  border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--good));
}

.scene-headquarters .scene-sky { background: linear-gradient(#4c6583, #8aa0b7); }
.scene-headquarters .scene-floor { background: linear-gradient(#536076, #273244); }
.hq-floorplan {
  position: absolute; left: 2%; top: 4%; width: 58%; bottom: 18%;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(96px, 1fr); gap: 10px;
  transform: perspective(900px) rotateX(4deg);
}
.floor-room {
  display: flex; flex-direction: column; justify-content: space-between;
  min-width: 0; padding: 10px; border-radius: 8px; text-align: left;
  background:
    linear-gradient(90deg, rgba(255,255,255,.08) 0 1px, transparent 1px 24px),
    linear-gradient(#263851, #1b2638);
  border: 1px solid rgba(255,255,255,.16);
  color: var(--text);
}
.floor-room:hover:not(:disabled) { border-color: rgba(76,194,255,.75); filter: brightness(1.08); }
.floor-room.legacy { background: linear-gradient(#30465f, #223047); }
.floor-room.full { border-color: rgba(251,191,36,.72); }
.floor-room.busy { border-color: rgba(76,194,255,.55); }
.floor-room b, .floor-room span, .floor-room small, .floor-room em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.floor-room b { display: flex; gap: 6px; align-items: center; min-width: 0; }
.floor-room span, .floor-room small { color: var(--muted); font-size: 12px; }
.floor-room em { color: var(--warn); font-size: 11px; font-style: normal; }
.staff-dots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.staff-dots i {
  height: 6px; border-radius: 999px; background: rgba(255,255,255,.14);
}
.staff-dots i.filled { background: var(--good); box-shadow: 0 0 7px rgba(74,222,128,.34); }
.hq-command-board {
  position: absolute; right: 3%; top: 4%; width: 34%; max-height: 48%;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px; border-radius: 10px;
  background: rgba(15, 23, 42, .86); border: 1px solid rgba(255,255,255,.16);
  overflow: hidden;
}
.hq-command-board h3 { margin: 0; font-size: 14px; }
.hq-command-board p { margin: 0; color: var(--muted); font-size: 12px; }
.hq-command-kpis {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.hq-command-kpis span {
  min-width: 0; display: flex; flex-direction: column; gap: 1px;
  padding: 7px 8px; border-radius: 8px; background: rgba(255,255,255,.06);
}
.hq-command-kpis b, .hq-command-kpis small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hq-command-kpis small { color: var(--muted); font-size: 10px; }
.hq-payroll-chips {
  min-height: 0; display: grid; gap: 6px; overflow: auto;
}
.hq-payroll-chip {
  min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
  padding: 7px 8px; border-radius: 8px; background: rgba(255,255,255,.06);
}
.hq-payroll-chip b, .hq-payroll-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hq-payroll-chip span { color: var(--warn); font-size: 12px; }
.hq-build-bench {
  position: absolute; left: 2%; right: 3%; bottom: 2%;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px;
}
.hq-build-room {
  min-width: 0; display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 8px; background: rgba(15, 23, 42, .84); border-color: rgba(255,255,255,.15);
}
.hq-build-room b, .hq-build-room small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hq-build-room b { font-size: 12px; }
.hq-build-room small { color: var(--muted); font-size: 11px; }
.hq-walk-viewport {
  position: absolute; inset: 0; overflow: hidden; border-radius: 12px;
  background:
    radial-gradient(circle at 50% 52%, rgba(255,255,255,.07), transparent 22%),
    linear-gradient(#51637a, #39465b 56%, #313b4f);
  border: 1px solid rgba(255,255,255,.10);
}
.hq-office-world {
  --player-x: 520px; --player-y: 780px;
  position: absolute; left: 50%; top: 52%; width: 1800px; height: 1100px;
  transform: translate(calc(-1 * var(--player-x)), calc(-1 * var(--player-y)));
  transition: transform .09s linear;
  will-change: transform;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 72px),
    linear-gradient(135deg, #53677f, #334155 58%, #293447);
}
.office-map-bounds {
  position: absolute; left: 70px; top: 70px; right: 70px; bottom: 70px;
  border-radius: 20px; border: 8px solid rgba(15,23,42,.45);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.08), inset 0 0 70px rgba(0,0,0,.18);
  background:
    linear-gradient(0deg, transparent 0 48%, rgba(15,23,42,.28) 48% 52%, transparent 52%),
    linear-gradient(90deg, transparent 0 31%, rgba(15,23,42,.22) 31% 34%, transparent 34% 64%, rgba(15,23,42,.22) 64% 67%, transparent 67%),
    rgba(255,255,255,.03);
}
.office-scenery {
  position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h);
  transform: translate(-50%, -50%);
  border-radius: 14px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(15,23,42,.22);
  box-shadow: inset -18px 0 0 rgba(0,0,0,.10), 0 12px 24px rgba(0,0,0,.12);
}
.office-scenery.lounge {
  background:
    radial-gradient(circle at 34px 34px, #475569 0 28px, transparent 29px),
    linear-gradient(90deg, #334155 0 42%, #3f4f68 42% 100%);
}
.office-scenery.atrium {
  border-radius: 999px; background: radial-gradient(circle, rgba(125,211,252,.20), rgba(15,23,42,.20) 64%);
}
.office-scenery.server {
  background: repeating-linear-gradient(90deg, #1e293b 0 22px, #475569 22px 31px);
}
.office-scenery.elevators {
  background: linear-gradient(90deg, #1f2937 0 48%, #334155 48% 52%, #1f2937 52%);
}
.walk-dept-door {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  width: 178px; min-height: 64px; pointer-events: auto;
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start; justify-content: center;
  padding: 9px 12px; border-radius: 10px;
  background: rgba(15, 23, 42, .88); border-color: rgba(255,255,255,.18);
  box-shadow: 0 12px 24px rgba(0,0,0,.24);
}
.walk-dept-door.near {
  border-color: var(--warn); box-shadow: 0 0 0 2px rgba(251,191,36,.16), 0 12px 24px rgba(0,0,0,.30);
}
.walk-dept-door b, .walk-dept-door small {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.walk-dept-door b { font-size: 13px; }
.walk-dept-door small { color: var(--muted); font-size: 11px; }
.office-player {
  position: absolute; left: 50%; top: 52%; z-index: 8; width: 28px; height: 38px; pointer-events: none;
  transform: translate(-50%, -82%); transition: left .09s linear, top .09s linear;
  filter: drop-shadow(0 10px 12px rgba(0,0,0,.35));
}
.office-player span { position: absolute; left: 50%; transform: translateX(-50%); display: block; }
.player-shadow {
  bottom: -8px; width: 26px; height: 8px; border-radius: 999px;
  background: rgba(0,0,0,.36);
}
.player-head {
  top: 0; width: 16px; height: 16px; border-radius: 999px;
  background: #f3c8a6; border: 2px solid #273244;
}
.player-body {
  top: 15px; width: 22px; height: 22px; border-radius: 8px 8px 7px 7px;
  background: linear-gradient(#4cc2ff, #2563eb); border: 2px solid #14253b;
}
.office-player[data-facing="left"] .player-body { transform: translateX(-55%) skewY(-4deg); }
.office-player[data-facing="right"] .player-body { transform: translateX(-45%) skewY(4deg); }
.office-player[data-facing="up"] .player-body { background: linear-gradient(#60a5fa, #1d4ed8); }
.office-worker {
  position: absolute; left: var(--x); top: var(--y); width: 12px; height: 16px;
  border-radius: 999px 999px 5px 5px;
  background: linear-gradient(#f9d7b9 0 34%, #94a3b8 35% 100%);
  border: 1px solid rgba(15,23,42,.75);
  transform: translate(-50%, -50%);
  animation: officePace 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -.45s);
  box-shadow: 0 5px 9px rgba(0,0,0,.24);
}
@keyframes officePace {
  0%, 100% { transform: translate(-50%, -50%) translateX(-3px); }
  50% { transform: translate(-50%, -50%) translateX(4px); }
}
.office-walk-panel {
  position: absolute; left: 12px; bottom: 12px; z-index: 9; width: min(400px, calc(100% - 160px));
  display: grid; gap: 5px; pointer-events: auto;
  padding: 9px 10px; border-radius: 10px;
  background: rgba(8, 14, 26, .76); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(5px);
}
.office-walk-panel b {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.office-walk-panel span, .office-walk-panel small { color: var(--muted); font-size: 12px; white-space: normal; }
.walk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.walk-actions button { padding: 5px 9px; font-size: 12px; }

/* Office capacity/payroll modal launcher, always reachable from the walk
   scene now that it's full-width (docs/31-plan-outside-hq-and-sound.md). */
.hq-manage-btn {
  position: absolute; top: 18px; right: 18px; z-index: 9; pointer-events: auto;
  background: rgba(8, 14, 26, .76); border-color: rgba(255,255,255,.18);
  font-size: 12.5px;
}

/* On-screen movement pad — discoverable walking without WASD, and usable
   on touch devices. */
.walk-dpad {
  position: absolute; right: 14px; bottom: 14px; z-index: 9; pointer-events: auto;
  display: grid; grid-template-columns: repeat(3, 38px); grid-template-rows: repeat(3, 38px) auto;
  gap: 4px; align-items: center; justify-items: center;
}
.dpad-btn {
  width: 38px; height: 38px; padding: 0; border-radius: 9px;
  background: rgba(8, 14, 26, .76); border-color: rgba(255,255,255,.18);
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  touch-action: none; user-select: none;
}
.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-act { grid-column: 2; grid-row: 2; background: rgba(76,194,255,.22); border-color: var(--accent); }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 3; }
.dpad-hint {
  grid-column: 1 / span 3; grid-row: 4; justify-self: center; margin-top: 2px;
  color: var(--muted); font-size: 10px; white-space: nowrap;
}

/* Outside-HQ street scene */
.scene-headquarters-outside .scene-sky { background: linear-gradient(#7ec8f2, #cfe9ff 60%, #eef8ff); }
.scene-headquarters-outside .scene-floor { background: linear-gradient(#5b6b73, #33414a); }
.hq-outside-world {
  height: 480px !important;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 90px),
    linear-gradient(#bfe3ff 0%, #bfe3ff 60%, #6b7d86 60%, #46545c 100%);
}
.outside-ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 120px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.10) 0 3px, transparent 3px 96px), #3a474e;
  border-top: 4px solid #59676f;
}
/* The player's own building is a real button (walk-go-inside), styled to
   reset the generic button chrome so it still reads as a building. */
.hq-building {
  position: absolute; left: var(--x); top: var(--y);
  width: var(--w); transform: translate(-50%, -100%);
  padding: 0; margin: 0; border: none; background: none; border-radius: 0;
  display: block; text-align: left; font: inherit; color: inherit;
}
.hq-building:hover .hq-building-body { filter: brightness(1.08); }
.hq-building.near .hq-building-body {
  box-shadow: 0 -20px 44px rgba(0,0,0,.35), 0 0 0 2px rgba(251,191,36,.5);
}
.hq-building.near .hq-building-sign { border-color: var(--warn); }
.hq-building-roof { height: 14px; border-radius: 4px 4px 0 0; background: #1f2937; }
.hq-building-body {
  display: flex; flex-direction: column-reverse; gap: 6px;
  padding: 10px 12px; background: linear-gradient(#26364a, #19222f);
  border: 1px solid rgba(255,255,255,.14); border-bottom: none;
  box-shadow: 0 -20px 44px rgba(0,0,0,.35);
}
.hq-building-floor { display: flex; justify-content: space-between; gap: 8px; }
.hq-window {
  flex: 1; aspect-ratio: 1 / 1; border-radius: 2px;
  background: linear-gradient(#fde68a, #f59e0b);
  box-shadow: 0 0 8px rgba(253, 230, 138, .5);
}
.hq-building-badge {
  position: absolute; left: 50%; top: -30px; transform: translateX(-50%);
  white-space: nowrap; font-size: 11px; font-weight: 700; color: #fde68a;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(8, 14, 26, .82); border: 1px solid rgba(253,230,138,.4);
}
.hq-building-sign {
  position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%);
  white-space: nowrap; font-weight: 700; font-size: 13px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(8, 14, 26, .82); border: 1px solid rgba(255,255,255,.18);
}
.hq-building-sign small { display: block; font-weight: 500; font-size: 10.5px; color: var(--muted); }
.rival-lot {
  position: absolute; bottom: 120px; width: 66px; height: 84px;
  left: calc(760px + var(--i) * 160px);
  background: linear-gradient(#334155, #1f2937);
  border: 1px solid rgba(255,255,255,.10); border-radius: 4px 4px 0 0;
  box-shadow: 0 10px 18px rgba(0,0,0,.25);
  padding: 0; margin: 0; display: block; cursor: pointer;
}
.rival-lot:hover { filter: brightness(1.15); }
.rival-lot::before {
  content: ''; position: absolute; inset: 10px 8px auto 8px; height: 8px;
  background: repeating-linear-gradient(90deg, rgba(251,191,36,.5) 0 6px, transparent 6px 14px);
}
.rival-lot-sign {
  position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%);
  max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: rgba(8, 14, 26, .82); border: 1px solid rgba(255,255,255,.14);
}
.walk-dept-door.door { width: 130px; min-height: 46px; align-items: center; text-align: center; }

.scene-market .scene-sky { background: linear-gradient(#1d4f68, #83c5df); }
.scene-market .scene-floor { background: linear-gradient(#276c55, #163829); }
.market-map { position: absolute; inset: 0; }
.globe {
  position: absolute; left: 7%; top: 13%; width: 190px; height: 190px;
  display: grid; place-items: center; font-size: 84px; border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.35), rgba(255,255,255,.08) 42%, rgba(0,0,0,.22));
  box-shadow: 0 18px 44px rgba(0,0,0,.32);
}
.market-skyline {
  position: absolute; left: 38%; right: 4%; bottom: 18%;
  height: 45%; display: flex; align-items: end; gap: 10px;
}
.market-tower {
  flex: 1; min-width: 0; height: var(--h); border-radius: 8px 8px 0 0;
  background: linear-gradient(#7dd3fc, #2563eb);
  box-shadow: inset -14px 0 0 rgba(0,0,0,.18);
  display: flex; align-items: end; padding: 8px 6px;
}
.market-tower span {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: 11px; overflow: hidden; text-overflow: ellipsis; color: #eaf6ff;
}
.rival-row {
  position: absolute; left: 12%; right: 8%; bottom: 8%;
  display: flex; justify-content: center; gap: 10px;
}
.rival-marker {
  padding: 5px 9px; border-radius: 999px; background: rgba(8,14,26,.75);
  border: 1px solid rgba(255,255,255,.16); color: #fed7aa; font-weight: 700;
}

.scene-managers .scene-sky { background: linear-gradient(#344054, #64748b); }
.scene-managers .scene-floor { background: linear-gradient(#3d4553, #1f2937); }
.manager-office { position: absolute; inset: 0; }
.strategy-board {
  position: absolute; right: 8%; top: 7%; width: 160px; height: 110px;
  display: grid; place-items: center; font-size: 46px;
  border-radius: 8px; background: #101827; border: 1px solid rgba(255,255,255,.16);
}
.desk-grid {
  position: absolute; left: 7%; right: 32%; bottom: 8%; top: 12%;
  display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 12px;
}
.manager-desk {
  min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px;
  padding: 12px; border-radius: 10px; background: #334155; border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset -14px 0 0 rgba(0,0,0,.14);
}
.manager-desk.active { border-color: rgba(74,222,128,.8); box-shadow: inset -14px 0 0 rgba(0,0,0,.14), 0 0 18px rgba(74,222,128,.16); }
.manager-desk b { font-size: 24px; }
.manager-desk span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Side panel */
#tabs { display: flex; gap: 6px; flex-wrap: wrap; }
#tabs button { flex: none; padding: 7px 12px; font-size: 12.5px; color: var(--muted); }
#tabs button.active { background: var(--accent); color: #06263a; font-weight: 700; border-color: var(--accent); }
#panel { padding: 14px; overflow: auto; flex: 1; }
.card {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-bottom: 12px;
}
.card h3 { margin: 0 0 8px; font-size: 14px; }
.card.clickable { cursor: pointer; transition: border-color .15s; }
.card.clickable:hover, .card.clickable:focus-visible { border-color: var(--accent); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--good); } .neg { color: var(--bad); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.bar { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; flex: 1; }
.bar i { display: block; height: 100%; background: var(--accent); }
.spark { display: block; width: 100%; height: 46px; margin-top: 6px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.notice {
  margin: 10px 0; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(0,0,0,.18); color: var(--muted);
}
.notice.warn { border-color: rgba(251,191,36,.55); color: #fde68a; }
.mini-title { margin-top: 12px; }
.payroll-table {
  display: grid; gap: 6px; margin-top: 8px;
}
.payroll-row {
  display: grid; grid-template-columns: minmax(128px, 1.3fr) .8fr .7fr .8fr auto;
  gap: 8px; align-items: center; min-width: 0;
  padding: 7px 8px; border-radius: 8px; background: rgba(0,0,0,.14);
  font-variant-numeric: tabular-nums;
}
.payroll-row.head {
  color: var(--muted); font-size: 11px; background: transparent; padding-top: 0; padding-bottom: 0;
}
.payroll-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payroll-row span:not(:first-child) { text-align: right; }
.payroll-row small {
  display: block; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.payroll-row button { padding: 4px 8px; font-size: 12px; }
.advisor-list { margin: 0; padding-left: 22px; }
.advisor-list li { margin: 0 0 10px; }
.advisor-list li:last-child { margin-bottom: 0; }

/* Log */
#logbar { border-top: 1px solid var(--line); background: var(--panel); }
#log { height: 96px; overflow-y: auto; padding: 8px 16px; font-size: 12.5px; }
#log .l-warn { color: var(--warn); }
#log .l-error { color: var(--bad); }
#log .l-good { color: var(--good); }
#log .t { color: var(--muted); margin-right: 8px; font-variant-numeric: tabular-nums; }

/* Modal */
#modal-root:not(:empty) {
  position: fixed; inset: 0; background: rgba(4, 8, 16, .7); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; width: min(680px, 94vw); max-height: 88vh; overflow: auto;
  box-shadow: 0 30px 60px rgba(0,0,0,.5);
}
.modal h2 { margin: 0 0 6px; }
.modal .sub { color: var(--muted); margin: 0 0 14px; }
.modal.dept-modal {
  width: min(1120px, 96vw); max-height: 90vh; padding: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.dept-modal-head {
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.02);
}
.dept-modal-head .sub { margin-bottom: 0; }
.dept-modal-body {
  min-height: 0; overflow: auto; padding: 16px 20px 20px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.dept-section {
  min-width: 0; padding: 12px; border-radius: 10px;
  background: var(--panel2); border: 1px solid var(--line);
}
.dept-section-wide, .dept-section-notices { grid-column: 1 / -1; }
.dept-section h3 { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.dept-kv { grid-template-columns: minmax(140px, 1fr) minmax(180px, auto); }
.dept-action-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: center;
}
.dept-action-grid label {
  display: grid; grid-template-columns: auto minmax(80px, 1fr); gap: 8px; align-items: center;
  color: var(--muted);
}
.dept-num, .dept-budget-input { width: 100%; min-width: 0; }
.dept-hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.dept-section-notices .notice { margin: 8px 0; }
.dept-section-notices .notice:first-of-type { margin-top: 0; }
.dept-section-notices .notice:last-child { margin-bottom: 0; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preset {
  text-align: left; padding: 12px; border-radius: 10px; background: var(--panel2);
  border: 1px solid var(--line); cursor: pointer;
}
.preset:hover { border-color: var(--accent); }
.preset .p-name { font-weight: 700; }
.preset .p-desc { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.preset .p-diff { margin-top: 6px; font-size: 11px; color: var(--warn); }
.dropzone {
  margin-top: 14px; border: 2px dashed var(--line); border-radius: 10px;
  padding: 16px; text-align: center; color: var(--muted); cursor: pointer;
}
.dropzone.drag { border-color: var(--accent); color: var(--text); }
.form-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; margin: 10px 0; }
.history-scroll { max-height: 55vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.history-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.history-table th, .history-table td { padding: 6px 12px; text-align: right; }
.history-table th:first-child, .history-table td:first-child { text-align: left; }
.history-table thead th {
  position: sticky; top: 0; background: var(--panel2); color: var(--muted);
  font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--line);
}
.history-table tbody tr:nth-child(odd) { background: rgba(255,255,255,.03); }

/* Operating site scenery */
.site-scene {
  position: relative; height: 180px; overflow: hidden; border-radius: 10px;
  border: 1px solid var(--line); margin-bottom: 14px;
  background: #8fc7e8;
}
.site-scene .site-sky {
  position: absolute; inset: 0 0 38%; background: linear-gradient(#a9d8f0, #d8eef8);
}
.site-scene .site-ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 48%;
  background: #43516b;
}
.site-scene .site-object {
  position: absolute; left: 50%; bottom: 38px; transform: translateX(-50%);
  width: 210px; height: 78px; border-radius: 6px 6px 2px 2px;
  background: #59657c; box-shadow: inset -18px 0 0 rgba(0,0,0,.18), 0 10px 24px rgba(0,0,0,.28);
}
.site-scene .site-label {
  position: absolute; left: 14px; right: 14px; top: 12px;
  display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center;
  padding: 8px 10px; border-radius: 8px; background: rgba(8, 14, 26, .72);
  border: 1px solid rgba(255,255,255,.15);
}
.site-label span { grid-row: span 2; font-size: 24px; }
.site-label b, .site-label small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-label small { color: var(--muted); }
.scene-farm .site-ground {
  background:
    repeating-linear-gradient(105deg, rgba(255,255,255,.12) 0 5px, transparent 5px 24px),
    linear-gradient(#4f9a45, #2f6f36);
}
.scene-farm .site-object {
  width: 190px; height: 58px; bottom: 48px; background: #a8482d;
}
.scene-farm .site-object::before {
  content: ""; position: absolute; left: 28px; right: 28px; top: -38px;
  border-left: 67px solid transparent; border-right: 67px solid transparent;
  border-bottom: 42px solid #74331f;
}
.scene-factory .site-ground, .scene-warehouse .site-ground, .scene-lab .site-ground {
  background: linear-gradient(#606b7d, #3c4658);
}
.scene-factory .site-object::before {
  content: ""; position: absolute; right: 18px; top: -46px; width: 22px; height: 48px;
  background: #414b60; border-radius: 4px 4px 0 0;
}
.scene-factory .site-object::after, .scene-warehouse .site-object::after, .scene-lab .site-object::after {
  content: ""; position: absolute; left: 16px; right: 16px; top: 18px; height: 14px;
  background: repeating-linear-gradient(90deg, #ffd977 0 13px, transparent 13px 25px);
}
.scene-port .site-sky { background: linear-gradient(#9bd2ec, #d7eef8); }
.scene-port .site-ground {
  background: linear-gradient(#2b75a2 0 45%, #364158 45% 100%);
}
.scene-port .site-object {
  width: 230px; height: 42px; bottom: 44px; background: #b94343;
}
.scene-port .site-object::before {
  content: ""; position: absolute; left: 24px; right: 24px; top: -36px; height: 28px;
  background: repeating-linear-gradient(90deg, #f2c14e 0 34px, #2874a6 34px 68px);
}
.scene-datacenter .site-ground { background: linear-gradient(#d4dde7, #7b8798); }
.scene-datacenter .site-object {
  width: 230px; height: 92px; background: #e7edf4;
}
.scene-datacenter .site-object::after {
  content: ""; position: absolute; inset: 16px;
  background: repeating-linear-gradient(90deg, #4c6f8f 0 10px, transparent 10px 20px);
}
.scene-office .site-ground { background: linear-gradient(#41556e, #27374f); }
.scene-office .site-object {
  width: 150px; height: 112px; bottom: 30px; background: #315d83;
}
.scene-office .site-object::after {
  content: ""; position: absolute; inset: 14px;
  background: repeating-linear-gradient(0deg, #ffe59b 0 10px, transparent 10px 20px);
}
.scene-studio .site-ground { background: linear-gradient(#4c4269, #2a243f); }
.scene-studio .site-object {
  width: 220px; height: 68px; background: #654f91;
}
.scene-studio .site-object::after {
  content: ""; position: absolute; left: 22px; right: 22px; top: 18px; height: 26px;
  background: repeating-linear-gradient(90deg, #f8d66d 0 18px, #2e2844 18px 30px);
}

/* Toast */
#toast {
  position: fixed; bottom: 116px; left: 50%; transform: translateX(-50%);
  z-index: 60; pointer-events: none;
}
#toast .msg {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 18px; margin-top: 8px; box-shadow: 0 10px 25px rgba(0,0,0,.45);
  animation: fadeup 2.6s forwards;
}
#toast .msg.err { border-color: var(--bad); color: var(--bad); }
@keyframes fadeup { 0% { opacity: 0; transform: translateY(8px); } 10%,80% { opacity: 1; transform: none; } 100% { opacity: 0; } }

@media (max-width: 900px) {
  #layout { flex-direction: column; }
  #city { min-height: 48vh; }
  #side { width: auto; min-width: 0; border-left: none; border-top: 1px solid var(--line); }
  #grid { grid-template-columns: repeat(2, 1fr); }
  #grid.tab-scene { min-height: 440px; }
  .scene-body { inset: 82px 12px 16px; }
  .scene-stats { left: 12px; right: 12px; top: auto; bottom: 12px; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); max-width: none; }
  .scene-stats span { min-width: 0; align-items: flex-start; }
  .scene-products .scene-stats { top: 82px; bottom: auto; }
  .scene-products .scene-body { inset: 168px 12px 16px; }
  .warehouse-rack { left: 4%; right: 4%; top: 4%; width: auto; bottom: 42%; grid-template-columns: 1fr; }
  .warehouse-alerts { left: 4%; right: 4%; top: auto; bottom: 146px; width: auto; min-width: 0; }
  .conveyor { left: 4%; right: 4%; bottom: 82px; }
  .packing-desk { left: 4%; right: 4%; bottom: 8px; width: auto; min-height: 58px; flex-direction: row; }
  .screen-wall { right: 4%; grid-template-columns: repeat(2, 1fr); height: 34%; }
  .campaign-wall { left: 4%; right: 4%; top: 40%; width: auto; grid-template-columns: repeat(2, 1fr); }
  .growth-funnel { left: 4%; right: 4%; top: auto; bottom: 76px; max-height: 132px; overflow-y: auto; }
  .walk-dept-door { width: 142px; min-height: 52px; padding: 7px 9px; }
  .office-walk-panel { left: 6px; right: 6px; bottom: 6px; width: auto; }
  .office-walk-panel small { display: none; }
  .payroll-row { grid-template-columns: minmax(120px, 1.2fr) .8fr .7fr .8fr; }
  .payroll-row button, .payroll-row.head span:last-child { display: none; }
  .modal.dept-modal { width: 96vw; }
  .dept-modal-head { grid-template-columns: 1fr; }
  .dept-modal-body { grid-template-columns: 1fr; padding: 12px; }
  .dept-action-grid { grid-template-columns: 1fr; }
  .globe { width: 130px; height: 130px; font-size: 58px; }
  .market-skyline { left: 32%; }
  .desk-grid { right: 4%; grid-template-columns: 1fr; }
  .strategy-board { display: none; }
}
