/* Persistent resources, a production workbench, and a smaller progress rail. */
:root {
  --sidebar-width: 188px;
  --topbar-height: 80px;
  --green: #2c5543;
  --secondary: #6b786d;
  --muted: #738074;
  --border: #dfe5db;
  --radius: 10px;
  background: #f3f5ef;
  color: #293c30;
}
body { background: #f3f5ef; }
#app { padding-top: 0; }
html { scroll-padding-top: calc(var(--topbar-height) + 18px); }
.sidebar {
  width: var(--sidebar-width); inset: 0 auto 0 0; padding: 23px 12px 16px;
  background: #f9faf5; border-right: 1px solid var(--border); overflow-y: auto;
}
.nav-group-label { color: #899384; font-size: 10px; letter-spacing: 1px; padding: 0 12px; }
.nav-group-label { display: block; margin: 19px 0 9px; }
.nav-item { font-size: 12px; padding: 10px 12px; min-height: 42px; gap: 10px; margin-bottom: 3px; border-radius: 6px; color: #68776a; }
.nav-full { display: inline; }

.nav-item.active { background: #e7edde; color: #315a3c; }
.nav-item.active::before { left: -12px; top: 12px; bottom: 12px; width: 3px; }
.sidebar-bottom { padding-top: 24px; }

.workspace { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); padding-top: var(--topbar-height); padding-bottom: 0; }
.topbar {
  inset: 0 0 auto var(--sidebar-width); height: var(--topbar-height); padding: 0 28px;
  grid-template-columns: minmax(0,1fr) auto; grid-template-rows: auto; gap: 20px;
  background: #fcfdf8; border-bottom: 1px solid #dce3d5; box-shadow: 0 3px 12px #263b3004;
}
.resource-bar { gap: 22px; }
.header-resource { padding: 0 14px 0 0; border-right: 1px solid #e4e9de; }
.header-resource:last-child { border: 0; }
.resource-label { font-size: 11px; color: #728069; gap: 6px; margin-bottom: 5px; }
.resource-value { font-size: 22px; font-weight: 650; }
.resource-amount small { font-size: 10px; color: #7a8871; }
.header-tools { gap: 0; }
.header-tools .breadcrumb { display: none; }
.header-tools .header-actions { gap: 2px; }
.header-tools .icon-button { min-width: 32px; min-height: 36px; }
.header-divider { display: none; }
#main { max-width: 1580px; padding: 26px 28px 24px; }
.sparkline { display: none; }
.increment-overview,.production-workbench { display: grid; grid-template-columns: minmax(0,1fr) 300px; align-items: start; gap: 24px; }
.production-note { margin: 13px 0 20px; font-size: 10px; line-height: 1.9; color: #7a8772; }
.section-heading h2 { font-size: 15px; }
.section-heading p { font-size: 11px; }
.management-grid { gap: 16px; }
.role-card,.research-card { padding: 21px; }
.role-card h2,.research-card h2 { font-size: 16px; }
.footer { padding: 5px 28px 23px; color: #85907d; font-size: 10px; }

@media (min-width: 1400px) {
  .increment-overview,.production-workbench { grid-template-columns: minmax(0,1fr) 320px; gap: 28px; }
}
@media (min-width: 701px) and (max-height: 800px) {
  .sidebar { padding-top: 18px; padding-bottom: 12px; }
  .nav-item { min-height: 36px; padding: 8px 11px; margin-bottom: 1px; font-size: 11px; }
  .nav-group-label { margin-top: 12px; margin-bottom: 7px; }
  .sidebar-bottom { padding-top: 12px; }
}
@media (max-width: 1200px) {
  :root { --sidebar-width: 176px; --topbar-height: 101px; }
  .topbar { grid-template-columns: 1fr; grid-template-rows: 56px 29px; gap: 0; padding: 7px 22px 9px; }
  .header-tools { justify-content: space-between; border-top: 1px solid #e5eadd; padding-top: 3px; }
  .header-tools .breadcrumb { display: flex; font-size: 10px; }
  .header-tools .breadcrumb>span,.header-tools .breadcrumb>.icon { display: none; }
  .header-tools .icon-button{ min-height: 29px; }
  #main { padding: 23px 22px; }
  .increment-overview,.production-workbench { grid-template-columns: minmax(0,1fr) 270px; gap: 18px; }
}
@media (max-width: 1050px) {
  .increment-overview,.production-workbench { grid-template-columns: 1fr; gap: 24px; }
  .resource-value { font-size: 20px; }
  .resource-bar { gap: 14px; }
  .resource-label { font-size: 10px; }
}
@media (max-width: 700px) {
  :root { --sidebar-width: 0px; --topbar-height: calc(94px + env(safe-area-inset-top,0px)); }
  html { scroll-padding-top: calc(var(--topbar-height) + 12px); scroll-padding-bottom: calc(var(--mobile-nav-height,66px) + 12px); }
  #app { display: block; padding: 0; }
  .workspace { width: 100%; margin: 0; padding-top: var(--topbar-height); padding-bottom: calc(var(--mobile-nav-height,66px) + 10px); }
  .sidebar {
    position: fixed; inset: auto 0 0; width: 100%; height: auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom,0px));
    background: #fcfdf8; border: 0; border-top: 1px solid #d7e1ce; z-index: 35; overflow: visible; box-shadow: 0 -4px 15px #263b3008;
  }
  .sidebar .nav-group-label,.sidebar .sidebar-bottom { display: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(var(--nav-columns,3),minmax(0,1fr)); gap: 3px; overflow: visible; width: 100%; }
  .sidebar nav .nav-item { min-width: 0; min-height: 42px; margin: 0; padding: 7px 4px; flex-direction: row; justify-content: center; font-size: 11px; gap: 6px; border-radius: 6px; }
  .sidebar nav .nav-item>.icon { width: 15px; height: 15px; }
  .sidebar nav .nav-item.active::before { display: none; }
  .sidebar .nav-full { display: none; }
  .topbar { padding: calc(5px + env(safe-area-inset-top,0px)) 15px 4px; grid-template-rows: 49px 33px; gap: 0; }
  .resource-bar { gap: 8px; }
  .header-resource { padding-right: 5px; }
  .resource-label { font-size: 10px; gap: 3px; margin-bottom: 5px; }
  .resource-label .icon { display: none; }
  .resource-value { font-size: 18px; letter-spacing: -.5px; }
  .resource-amount { gap: 3px; }
  .resource-amount small { font-size: 9px; }
  .resource-income .resource-amount small,.resource-research .resource-amount small { display: none; }
  .resource-income .resource-label::after { content: '/秒'; font-size: 8px; }
  .resource-research .resource-label::after { content: 'RP'; font-size: 8px; }
  .header-tools { justify-content: space-between; padding-top: 2px; }
  .header-tools .breadcrumb { display: flex; font-size: 10px; }
  .header-tools .icon-button { min-width: 34px; min-height: 32px; }
  #main { padding: 20px 15px; }
  .footer { padding: 0 15px 15px; font-size: 9px; gap: 12px; }
  .toast-region { bottom: calc(var(--mobile-nav-height,66px) + 12px); }
}
@media (max-width: 370px) {
  .topbar { padding-left: 12px; padding-right: 12px; }
  .resource-bar { gap: 6px; }
  .resource-label { font-size: 9px; gap: 2px; }
  .resource-value { font-size: 16px; }
  #main { padding-left: 12px; padding-right: 12px; }
  .sidebar nav .nav-item { font-size: 10px; padding: 6px 2px; gap: 4px; }
  .sidebar nav .nav-item>.icon { width: 13px; height: 13px; }
}
