/* Critical boot/mobile rules. Loaded before the JS runtime so the old desktop dashboard
   never flashes and late service-worker patching cannot resize the whole page sideways. */
html.hh-booting body{background:#f2e7cf!important;overflow:hidden!important}
html.hh-booting .app-shell{opacity:0!important;visibility:hidden!important}
html.hh-booting body:before{content:'🍄  Hoard & Hustle';position:fixed;inset:0;z-index:99999;display:grid;place-items:center;background:#f2e7cf;color:#171a16;font:800 27px Baskerville,"Iowan Old Style",Georgia,serif;letter-spacing:-.4px}
.app-shell{transition:opacity .12s ease}

.hh-accepted-plan-note-v2{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 9px;margin-bottom:7px;background:#e8f3ea;border:1px solid #bdd8c4;border-radius:7px;font-size:10px}
.hh-accepted-plan-note-v2>div{display:grid;gap:2px;min-width:0}.hh-accepted-plan-note-v2 span{color:#587061;overflow-wrap:anywhere}
.hh-plan-settled-v2 .panel-help,.hh-plan-settled-v2 .loot-controls,.hh-plan-settled-v2 .loot-summary,.hh-plan-settled-v2 .loot-lines,.hh-plan-settled-v2 .loot-forecast,.hh-plan-settled-v2 .loot-actions{display:none!important}
.hh-plan-settled-v2.hh-plan-expanded-v2 .panel-help{display:block!important}
.hh-plan-settled-v2.hh-plan-expanded-v2 .loot-controls,.hh-plan-settled-v2.hh-plan-expanded-v2 .loot-summary,.hh-plan-settled-v2.hh-plan-expanded-v2 .loot-lines,.hh-plan-settled-v2.hh-plan-expanded-v2 .loot-forecast{display:grid!important}
.hh-plan-settled-v2.hh-plan-expanded-v2 .loot-actions{display:flex!important}
.hh-plan-settled-v2.hh-plan-expanded-v2 #acceptLootPlanBtn{display:none!important}
.hh-plan-settled-v2{border-color:#b8cbbd!important;background:linear-gradient(150deg,#f8fbf5,#edf3e7 92%)!important}

@media(max-width:820px){
  html,body{width:100%!important;max-width:100%!important;overflow-x:hidden!important;overscroll-behavior-x:none!important}
  body{position:relative!important;background:var(--paper,#f2e7cf)!important}
  .app-shell{display:block!important;width:100vw!important;max-width:100vw!important;min-width:0!important;height:auto!important;min-height:100dvh!important;margin:0!important;border:0!important;outline:0!important;border-radius:0!important;overflow-x:hidden!important}
  .main{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;overflow-x:hidden!important;padding:9px 8px calc(76px + env(safe-area-inset-bottom))!important}
  .hh-dashboard-board,.hh-layout-panel,.hh-panel-body,.panel,.panel-head,.topbar,.top-actions,#summaryGrid{width:100%!important;max-width:100%!important;min-width:0!important}
  .hh-dashboard-board{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;overflow:visible!important}
  .hh-layout-panel{grid-column:1/-1!important;margin:0!important;overflow:hidden!important}
  .hh-panel-body{overflow:hidden!important}

  /* The layout-controls runtime sets .sidebar to position:relative after base CSS.
     Force the mobile nav back to a real bottom bar and keep only the five useful destinations. */
  .sidebar{position:fixed!important;left:0!important;right:0!important;top:auto!important;bottom:0!important;z-index:100!important;width:100vw!important;max-width:100vw!important;height:calc(58px + env(safe-area-inset-bottom))!important;min-width:0!important;display:flex!important;flex-direction:row!important;align-items:flex-start!important;justify-content:stretch!important;gap:2px!important;padding:5px 6px calc(5px + env(safe-area-inset-bottom))!important;border:0!important;border-top:2px solid #5e4b35!important;overflow:hidden!important;background:#102018!important;box-shadow:0 -7px 20px rgba(0,0,0,.22)!important}
  .sidebar .brand-mini,.sidebar .sidebar-spacer,.sidebar .fact-card,.sidebar .side-action,.sidebar .hh-sidebar-chrome,.sidebar .nav-item[data-scroll="debts"],.sidebar .nav-item[data-scroll="simulator"],.sidebar .nav-item[data-scroll="reports"],.sidebar .nav-item[data-scroll="goals"],.sidebar .nav-item[data-scroll="settings"]{display:none!important}
  .sidebar .nav-item{display:grid!important;place-items:center!important;flex:1 1 20%!important;min-width:0!important;height:44px!important;padding:5px 2px!important;border-radius:8px!important;gap:0!important}
  .sidebar .nav-item span{width:auto!important;font-size:20px!important}.sidebar .nav-item b{display:none!important}

  .topbar{display:grid!important;grid-template-columns:minmax(0,1fr)!important;align-items:start!important;gap:8px!important}
  .brand-row{min-width:0!important}.brand-row h1{font-size:31px!important;line-height:.98!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}.mushroom{font-size:31px!important;flex:0 0 auto!important}.topbar p{margin-left:38px!important;font-size:12px!important}
  .top-actions{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:6px!important}
  .search{grid-column:1/-1!important;width:100%!important;max-width:100%!important;min-width:0!important;padding:7px 9px!important}.search input{width:100%!important;min-width:0!important}
  #hhCustomizeDashboard{display:none!important}#hhMoreDashboard{min-width:0!important}#hhGlobalSyncBadge{max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}

  #summaryGrid{grid-template-columns:1fr!important}.summary-card{width:100%!important;min-width:0!important}.summary-value{font-size:20px!important;white-space:normal!important;overflow-wrap:anywhere!important}
  .panel-head{flex-wrap:wrap!important;align-items:flex-start!important}.hh-panel-head-right{max-width:100%!important;min-width:0!important;padding-right:0!important}
  .inline-controls{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important}.inline-controls>*{width:100%!important;max-width:100%!important;min-width:0!important}.small-input,select{width:100%!important;min-width:0!important}

  /* Only a table may pan sideways. The page itself cannot. */
  .table-wrap{display:block!important;width:100%!important;max-width:100%!important;overflow-x:auto!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior-x:contain!important}
  .table-wrap table{width:max-content!important;min-width:680px!important;max-width:none!important}#actionPlan .table-wrap table{min-width:610px!important}
  .action-input{max-width:74px!important}

  .loot-summary{grid-template-columns:1fr!important}.loot-line{grid-template-columns:minmax(0,1fr) auto!important;gap:5px!important}.loot-phase{grid-column:1/-1!important}.loot-amount{font-size:13px!important}.loot-actions{flex-direction:column!important}
  .hh-accepted-plan-note-v2{align-items:flex-start!important}.hh-accepted-plan-note-v2 button{flex:0 0 auto!important}
  .list-row{grid-template-columns:auto minmax(0,1fr)!important}.list-row .right{grid-column:2!important;text-align:left!important}.list-row p,.list-row h3{overflow-wrap:anywhere!important}
  .dialog{width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important;margin:auto!important}.form-grid,.goal-grid,.settings-grid{grid-template-columns:1fr!important}
  button,input,select,textarea{max-width:100%!important}
}
@media(max-width:430px){
  .main{padding-left:7px!important;padding-right:7px!important}.panel{padding:8px!important}.panel-head h2{font-size:19px!important}
  .top-actions{grid-template-columns:minmax(0,1fr)!important}#hhMoreDashboard,#resetTodayBtn{grid-column:1!important;width:100%!important}
  .hh-accepted-plan-note-v2{display:grid!important;grid-template-columns:1fr!important}.hh-accepted-plan-note-v2 button{width:100%!important}
}
