/* Domiki v1.12.0.8: mobile garage dialog, unified map actions and honest project context. */

/* Garage header: only its title and a fixed-size close control. Explicit
   dimensions override legacy global secondary-button rules on mobile. */
html body dialog.tractor-dialog.tractor-adventure {
  box-sizing:border-box!important;
  width:min(560px,calc(100vw - 24px))!important;
  max-width:calc(100vw - 24px)!important;
  min-width:0!important;
  max-height:min(92dvh,850px)!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  margin-inline:auto!important;
  padding:clamp(12px,3vw,18px)!important;
  overscroll-behavior:contain;
}
html body dialog.tractor-dialog .tractor-top{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:12px!important;
  margin:0 0 10px!important;
  padding:0!important;
  overflow:visible!important;
}
html body dialog.tractor-dialog .tractor-top strong{
  flex:1 1 auto!important;
  min-width:0!important;
  overflow-wrap:break-word!important;
  font-size:clamp(16px,4.2vw,20px)!important;
  line-height:1.25!important;
}
html body dialog.tractor-dialog .tractor-top #tractorExit.secondary{
  flex:0 0 42px!important;
  box-sizing:border-box!important;
  display:grid!important;
  place-items:center!important;
  width:42px!important;
  height:42px!important;
  min-width:42px!important;
  max-width:42px!important;
  min-height:42px!important;
  max-height:42px!important;
  margin:0!important;
  padding:0!important;
  border:1px solid #cad7c4!important;
  border-radius:12px!important;
  background:#edf0e5!important;
  box-shadow:none!important;
  color:#345748!important;
  position:static!important;
  font-size:22px!important;
  line-height:1!important;
  transform:none!important;
}
.tractor-dialog.tractor-adventure .tractor-visual,
.tractor-dialog.tractor-adventure .tractor-board,
.tractor-dialog.tractor-adventure .tractor-drive-controls,
.tractor-dialog.tractor-adventure .tractor-instructions{
  box-sizing:border-box!important;
  max-width:100%!important;
  min-width:0!important;
}
.tractor-dialog.tractor-adventure .tractor-drive-controls {flex-wrap:wrap!important;}
.tractor-dialog.tractor-adventure .tractor-instructions {flex:1 1 130px!important;}

/* The action dock is outside #mapWorld; it never scales or pans with the map. */
html body .map-world .park .map-actions:empty {display:none!important;}
html body .living-settings{
  box-sizing:border-box!important;
  display:flex!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  gap:8px!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  padding:8px 12px!important;
  margin:0!important;
  background:#fbf8ed;
  border-block:1px solid #e1e6d5;
  position:relative;
  z-index:5;
}
html body .living-settings label{font-size:13px!important;flex:0 0 auto!important;white-space:nowrap!important;}
html body .living-settings #livingQuality{flex:0 0 116px!important;min-width:0!important;width:116px!important;max-width:116px!important;}
html body .living-settings #livingQualityHint[hidden]{display:none!important;}
html body .living-settings .domiki-action-dock{
  display:flex!important;
  flex:1 1 auto!important;
  min-width:0!important;
  max-width:100%!important;
  align-items:center!important;
  gap:7px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  touch-action:pan-x;
  scrollbar-width:thin;
  padding:3px 2px 6px;
}
html body .domiki-action-dock > button{
  position:static!important;
  inset:auto!important;
  transform:none!important;
  float:none!important;
  display:inline-flex!important;
  flex:0 0 auto!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
  gap:5px!important;
  box-sizing:border-box!important;
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  height:40px!important;
  min-height:40px!important;
  max-height:40px!important;
  margin:0!important;
  padding:7px 12px!important;
  border:1px solid #d1b477!important;
  border-radius:11px!important;
  background:#fff3cb!important;
  box-shadow:0 2px 0 #cdb78266!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  color:#315341!important;
  font:800 13px/1.15 system-ui,sans-serif!important;
  letter-spacing:0!important;
  text-align:center!important;
  white-space:nowrap!important;
  cursor:pointer!important;
  touch-action:manipulation!important;
}
html body .domiki-action-dock > button:disabled{opacity:.55!important;cursor:not-allowed!important;}
html body .domiki-action-dock > #tractorShortcut.tractor-away{background:#fff0dc!important;}
html body .domiki-action-dock > #towerEntry small{display:none!important;}
html body .domiki-action-dock > #towerEntry{font-size:13px!important;}
html body .domiki-action-dock > #tractorShortcut .tractor-shortcut-icon{font-size:18px!important;line-height:1!important;}
html body .domiki-action-dock > #tractorShortcut #tractorShortcutText,
html body .domiki-action-dock > #collectAllMapCoins span{display:inline!important;font-size:13px!important;color:inherit!important;line-height:1.1!important;}
html body.mobile-game[data-mobile-tab="city"] .city .map-tools #towerShortcut,
html body .city .map-tools #towerShortcut {display:none!important;}

/* If space is tight, controls get a dedicated horizontal strip without making
   the page or the map scroll sideways. All actions remain reachable. */
@media(max-width:800px){
 html body .living-settings{display:grid!important;grid-template-columns:max-content minmax(0,1fr)!important;gap:6px 10px!important;padding:7px 10px!important;}
 html body .living-settings label{grid-column:1!important;grid-row:1!important;font-size:12px!important;}
 html body .living-settings #livingQuality{grid-column:2!important;grid-row:1!important;width:115px!important;justify-self:start!important;}
 html body .living-settings .domiki-action-dock{grid-column:1/-1!important;grid-row:2!important;width:100%!important;max-width:100%!important;}
 html body .domiki-action-dock > button{height:38px!important;min-height:38px!important;max-height:38px!important;padding:6px 10px!important;font-size:12px!important;}
 html body .domiki-action-dock > #tractorShortcut #tractorShortcutText,
 html body .domiki-action-dock > #collectAllMapCoins span{font-size:12px!important;}
}
@media(max-width:360px){
 html body .living-settings{padding:6px!important;}
 html body .living-settings label{font-size:11px!important;}
 html body dialog.tractor-dialog.tractor-adventure {width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important;}
}

/* Explain which data the recommendation colors actually use. */
#projectDialog .domiki-recommend-context{
 box-sizing:border-box;
 display:flex;
 flex-direction:column;
 gap:3px;
 margin:8px 0 12px;
 padding:10px 12px;
 border-radius:12px;
 background:#e9f1e5;
 border:1px solid #cadac3;
 color:#315846;
}
#projectDialog .domiki-recommend-context strong{font-size:14px;line-height:1.25;}
#projectDialog .domiki-recommend-context span{font-size:12px;line-height:1.35;color:#5b7667;}
#projectDialog .project-choice.need-2{background:linear-gradient(135deg,#dff2e2,#eff5df)!important;border-color:#398d69!important;}
#projectDialog .project-choice.need-1{background:linear-gradient(135deg,#fff0c0,#fff8e6)!important;border-color:#d5ae60!important;}
#projectDialog .project-choice.need-0{background:#f5f4ec!important;border-color:#d7dfcf!important;}
#projectDialog .project-choice:disabled{opacity:.65!important;}
