.info-panel .panel-body.info-body { padding: 10px; overflow: hidden; }

.info-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.info-tab { border: 1px solid #344139; background: #111713; color: #8f9d94; border-radius: 8px; padding: 7px 4px; font-size: 11px; cursor: pointer; }
.info-tab:hover { background: #18201b; color: #dce4de; }
.info-tab.active { background: #203027; border-color: #587062; color: #edf3ef; }
.info-panel-stack { min-height: 0; flex: 1; overflow: hidden; }
.info-panel-page { height: 100%; min-height: 0; overflow-y: auto; padding-right: 3px; }
.info-panel-page[hidden] { display: none !important; }
.info-panel-page .side-section { padding-bottom: 10px; }
.info-panel-page .side-section + .side-section { padding-top: 10px; }

.status-grid { display: grid !important; grid-template-columns: 1fr !important; gap: 7px !important; }
.stat { border: 0 !important; background: transparent !important; padding: 0 !important; border-radius: 0 !important; }
.compact-stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.compact-stat-label { color: #91a096; font-size: 11px; }
.compact-stat-value { color: #edf2ee; font-size: 13px !important; display: flex !important; align-items: baseline; gap: 5px; }
.compact-stat-value small { font-size: 10px; color: #9caaa1; font-weight: 500; }
.compact-stat-track { height: 7px; background: #202823; border: 1px solid #2d3931; border-radius: 999px; overflow: hidden; }
.compact-stat-fill { display: block; height: 100%; border-radius: inherit; background: #7d9385; transition: width .2s ease; }
.stat[data-kind="health"] .compact-stat-fill { background: #879c8e; }
.stat[data-kind="stamina"] .compact-stat-fill { background: #81948d; }
.stat[data-kind="hunger"] .compact-stat-fill { background: #9a8f70; }
.stat[data-kind="infection"] .compact-stat-fill { background: #8f6f70; }
.stat.warning .compact-stat-label, .stat.warning .compact-stat-value { color: #c4b987; }
.stat.danger .compact-stat-label, .stat.danger .compact-stat-value { color: #d4a2a2; }

.resource-section h3, .status-section h3 { margin-bottom: 7px; }
.resource-grid { display: flex !important; flex-wrap: wrap; gap: 6px !important; }
.resource-stat, .resource-stat.currency { grid-column: auto !important; flex: 1 1 78px; min-width: 0; border: 1px solid #344139 !important; background: #111713 !important; border-radius: 8px !important; padding: 6px 8px !important; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.resource-stat span { margin: 0 !important; font-size: 10px !important; }
.resource-stat strong { font-size: 14px !important; }

.inventory-filter-bar { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 7px; margin-bottom: 3px; scrollbar-width: thin; }
.inventory-filter { flex: 0 0 auto; border: 1px solid #344139; background: #111713; color: #819087; border-radius: 999px; padding: 4px 8px; font-size: 10px; cursor: pointer; }
.inventory-filter:hover { color: #dce4de; }
.inventory-filter.active { color: #eef3f0; background: #203027; border-color: #587062; }
.inventory-list { gap: 3px !important; }
.inventory-row { min-height: 32px; padding: 5px 7px !important; border-radius: 7px !important; }
.inventory-row[hidden] { display: none !important; }
.inventory-row-name { font-size: 12px !important; }
.inventory-row-name small { font-size: 9px !important; line-height: 1.3; white-space: normal; margin-top: 2px; }
.inventory-row-count { font-size: 10px !important; }

.craft-detail { border: 1px solid #344139; background: #101612; border-radius: 8px; padding: 8px 9px; margin-bottom: 7px; min-height: 86px; }
.craft-detail-empty { color: #69776f; font-size: 10px; line-height: 1.55; }
.craft-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.craft-detail-head strong { color: #e4ebe6; font-size: 12px; }
.craft-detail-head span { color: #819087; font-size: 9px; }
.craft-detail-ingredients { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 7px; }
.craft-detail-ingredients li { display: flex; justify-content: space-between; gap: 6px; color: #8f9d94; font-size: 9px; }
.craft-detail-ingredients strong { color: #bdc8c0; font-weight: 600; }
.craft-detail p { color: #76847b; margin: 6px 0 0; font-size: 9px; line-height: 1.45; }
.recipe-compact-row { display: grid; grid-template-columns: minmax(0, 1fr) 28px; gap: 3px; align-items: stretch; }
.recipe-compact-row.selected > .inventory-row { border-color: #4c6155; background: #151e18; }
.recipe-info-button { border: 1px solid #344139; background: #111713; color: #8e9b93; border-radius: 7px; cursor: pointer; font: 600 11px/1 Georgia, serif; }
.recipe-info-button:hover { color: #edf3ef; border-color: #587062; background: #1d2921; }

.base-content { display: grid; gap: 8px; }
.base-console-card, .base-facility-card, .base-build-section { border: 1px solid #344139; background: #101612; border-radius: 9px; padding: 9px; }
.base-console-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.base-console-head strong { color: #e2e9e4; font-size: 12px; }
.base-console-head span { color: #829087; font-size: 9px; }
.base-console-card p, .base-facility-card p { margin: 7px 0; color: #7f8c84; font-size: 10px; line-height: 1.55; }
.base-summary, .base-energy-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.base-summary > div, .base-energy-summary > div { border: 1px solid #344139; background: #101612; border-radius: 8px; padding: 7px; }
.base-summary span, .base-energy-summary span { display: block; color: #748279; font-size: 9px; margin-bottom: 2px; }
.base-summary strong, .base-energy-summary strong { color: #e0e7e2; font-size: 11px; }
.base-energy-summary > div:first-child { grid-column: span 1; }
.base-energy-summary { margin-top: -2px; }
.base-energy-summary strong { font-size: 10px; }
.base-clock { color: #65736b; font-size: 9px; padding: 0 2px; }
.base-facility-list { display: grid; gap: 6px; }
.base-job-note { color: #78867d; font-size: 9px; line-height: 1.5; margin: 6px 0; }
.base-job-status { display: flex; justify-content: space-between; gap: 6px; color: #87968d; font-size: 9px; margin-top: 6px; }
.base-job-status strong { color: #c8d2cb; font-weight: 600; }
.base-job-status.complete span, .base-job-status.complete strong { color: #a9c0ae; }
.base-progress { height: 6px; border: 1px solid #344139; background: #1a211d; border-radius: 999px; overflow: hidden; margin: 6px 0; }
.base-progress span { display: block; height: 100%; background: #708878; }
.base-power-note { color: #8f9e95; font-size: 8px; margin: 5px 0; }
.base-energy-running { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding: 6px 7px; border: 1px solid #4d6355; background: #152019; border-radius: 7px; font-size: 9px; }
.base-energy-running strong { color: #b8cbbd; }
.base-energy-running span { color: #89978e; text-align: right; }
.powered-facility { border-color: #3a4940; }
.base-action, .base-mini-action { border: 1px solid #46584d; background: #19231c; color: #dfe8e2; border-radius: 7px; cursor: pointer; }
.base-action { width: 100%; padding: 7px 8px; font-size: 10px; }
.base-action.primary { background: #203027; border-color: #587062; }
.base-action.danger-soft { background: #261c1c; border-color: #624848; color: #dcc8c8; }
.base-mini-action { padding: 5px 7px; font-size: 9px; flex: 0 0 auto; }
.base-action:hover, .base-mini-action:hover { background: #243129; }
.base-action:disabled, .base-mini-action:disabled { opacity: .4; cursor: not-allowed; }
.base-build-section h4 { margin: 0 0 7px; color: #aab7af; font-size: 10px; }
.base-build-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid #28322c; }
.base-build-row:first-of-type { border-top: 0; }
.base-build-row strong { display: block; color: #d3dcd6; font-size: 10px; }
.base-build-row small { display: block; color: #6f7d74; font-size: 8px; margin-top: 2px; }

.item-safety-panel { margin: 9px 0 4px; padding: 8px 9px; border-radius: 8px; border: 1px solid #35433a; background: #111713; display: grid; gap: 3px; }
.item-safety-panel strong { color: #d7e0da; font-size: 11px; }
.item-safety-panel span, .item-safety-panel small { color: #839087; font-size: 9px; line-height: 1.45; }
.item-safety-panel.unknown { border-style: dashed; }

.compact-placeholder { border: 1px dashed #344139; border-radius: 9px; padding: 12px; color: #7e8b83; font-size: 11px; line-height: 1.65; }

@media (min-width: 1121px) {
  .game-layout { grid-template-columns: minmax(220px, 270px) minmax(560px, 1fr) minmax(250px, 300px) !important; }
  .game-layout.history-collapsed { grid-template-columns: 54px minmax(560px, 1fr) minmax(250px, 300px) !important; }
  .game-layout.info-collapsed { grid-template-columns: minmax(220px, 270px) minmax(560px, 1fr) 54px !important; }
  .game-layout.history-collapsed.info-collapsed { grid-template-columns: 54px minmax(560px, 1fr) 54px !important; }
}
@media (max-width: 760px) {
  /* Mobile uses the document itself as the scroll container. Nested fixed-height
     panel scrolling is difficult to discover and used to clip long base,
     inventory and crafting content. */
  .info-panel {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .info-panel .panel-body.info-body {
    overflow: visible !important;
    display: block;
    min-height: 0;
  }
  .info-panel-stack {
    min-height: 0;
    flex: none;
    overflow: visible !important;
  }
  .info-panel-page {
    height: auto !important;
    min-height: 0;
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0;
  }
  .inventory-section {
    min-height: 0;
    overflow: visible;
    padding-right: 0;
    margin-right: 0;
  }

  .info-tabs { position: sticky; top: 0; z-index: 2; background: rgba(15,20,17,.98); padding-bottom: 7px; }
  .info-tab { font-size: 12px; padding: 9px 5px; }
  .craft-detail-ingredients { grid-template-columns: 1fr; }
  .base-summary, .base-energy-summary { grid-template-columns: 1fr 1fr; }
  .base-summary > div:first-child, .base-energy-summary > div:first-child { grid-column: 1 / -1; }
}
