#main-game-app { display: block; }
.office-active #main-game-app #page-content {
  max-width: none;
  height: auto;
  min-height: 100dvh;
  padding: 0;
  background: #eae2d6;
  overflow: visible;
}

.office-room {
  --paper: #fff9ee;
  --wood: #35261d;
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 100dvh;
  padding: 12px;
  color: var(--wood);
}
.office-toolbar, .office-stage, .office-scene-caption {
  width: min(100%, 1600px, calc((100dvh - 126px) * 1.777));
}
.office-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.office-clock, .office-toolbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.office-clock time { font: 600 clamp(15px, 1.75vw, 23px)/1.1 ui-monospace, monospace; }
.office-clock time b { color: #734b32; }
.office-clock span { color: #533e30; font-size: 13px; }
.office-toolbar-actions .btn { background: var(--paper); border-color: #b8a595; color: var(--wood); }
.office-toolbar-actions .btn:hover { background: #eedbc4; }
.office-stage { position: relative; }
.office-scene { position: relative; aspect-ratio: 1672 / 941; overflow: hidden; background: #d6c8b7; }
.office-background { display: block; width: 100%; height: 100%; }
.office-window {
  position: absolute;
  top: 12.65%;
  left: 22.48%;
  width: 31.35%;
  height: 33.78%;
  overflow: hidden;
  background: #a9cee6;
  box-shadow: inset 0 0 16px #523b2c44;
}
.office-window img { display: block; width: 100%; height: 100%; object-fit: cover; }
.office-hotspots { position: absolute; inset: 0; }
.office-hotspot {
  position: absolute;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 5px;
  border: 2px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
}
.office-hotspot:hover, .office-hotspot:focus-visible {
  border-color: #fff3dc;
  background: #fff4d92b;
  outline: 2px solid #724832;
  outline-offset: 0;
}
.office-hotspot span {
  display: inline-block;
  padding: 4px 7px;
  background: #342419ef;
  border: 1px solid #f9e4c898;
  border-radius: 4px;
  font-size: clamp(11px, 1.1vw, 15px);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.office-hotspot.is-current span { background: #f9e9cb; color: #372518; border-color: #865e40; }
.office-hotspot b { color: #f9ce89; }
.office-hotspot.has-warning {
  border-color: #a33c2b;
  background: #a33c2b26;
  box-shadow: 0 0 0 1px #fff2da inset;
}
.office-hotspot .office-warning-count {
  display: inline-block;
  margin-inline-start: 3px;
  padding: 2px 4px;
  border-radius: 3px;
  background: #8d2923;
  color: #fff;
  font-size: 0.86em;
}
.office-metric-alert { margin: 4px 0 0; color: #8d2923; font-size: 13px; font-weight: 650; }
.office-hotspot--inventory { inset: 8% 80% 53% 2.7%; }
.office-hotspot--archives { inset: 50% 85% 21% 2%; }
.office-hotspot--briefing { inset: 10% 44.6% 51% 20.6%; }
.office-hotspot--metrics { inset: 18% 27.5% 58% 57%; }
.office-hotspot--history { inset: 18% 19.5% 61% 73.8%; }
.office-hotspot--field { inset: 8% 0.6% 38% 82%; }
.office-hotspot--action { inset: 57% 68.8% 26% 18%; }
.office-hotspot--inbox { inset: 63% 54.8% 22% 32.2%; }
.office-hotspot--decision { inset: 61% 39.2% 22% 46.8%; }
.office-hotspot--letters { inset: 63.5% 28% 25.3% 63.7%; }
.office-hotspot--map { inset: 62.4% 12% 21.5% 72%; }
.office-scene-caption { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 8px; font-size: 13px; }
.office-scene-caption span { margin-inline-start: auto; color: #665447; }
.office-save-status { min-height: 1.4em; margin-top: 3px; color: #665447; font-size: 12px; }

.office-panel-shade {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #291e166e;
}
.office-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, 100%);
  max-height: min(92dvh, 940px);
  min-height: 220px;
  min-width: 0;
  border: 1px solid #a88b6e;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 18px 60px #1e120e60;
  overflow: hidden;
}
.office-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #d9cbbb;
  background: #f5eee2;
}
.office-panel-header h2 { font-size: clamp(18px, 2vw, 24px); }
.office-panel-header .btn { white-space: nowrap; }
.office-panel-body { min-width: 0; overflow: auto; overscroll-behavior: contain; padding: clamp(14px, 2vw, 26px); }
.office-panel-body > * + * { margin-top: 14px; }
.office-panel-body .briefing-scroll { max-height: none; overflow: visible; }
.office-panel-body .archive-index { position: static; }
.office-panel-tabs { display: flex; flex-wrap: wrap; gap: 8px; }

.game-over-active #main-game-app #page-content {
  max-width: none;
  min-height: 100dvh;
  padding: 0;
  background: #eee8df;
}
.ending-report-active #toast-container,
.ending-report-active #mcjfCookiePill { display: none !important; }
.ending-page {
  width: min(100% - 28px, 850px);
  margin: auto;
  padding: clamp(28px, 7vh, 72px) 0 44px;
  color: #392b22;
}
.ending-heading { border-bottom: 1px solid #ac9580; padding-bottom: 22px; }
.ending-heading h1 { margin: 6px 0 12px; font-size: clamp(27px, 5vw, 46px); line-height: 1.15; }
.ending-heading .tag { margin-top: 12px; }
.ending-heading h1:focus, .ending-subpage-header h1:focus { outline: none; }
.ending-section { margin-top: 20px; padding: clamp(16px, 3vw, 28px); background: #fffdf8; border: 1px solid #d5c8b9; }
.ending-section h2 { margin: 0 0 8px; }
.ending-section .reading-text + h2 { margin-top: 20px; }
.ending-actions { margin-top: 24px; }
.ending-subpage-header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 18px; }

@media (max-width: 760px) {
  .office-room { align-content: start; }
  .office-toolbar, .office-stage, .office-scene-caption { width: 100%; }
  .office-hotspots {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
  }
  .office-hotspot {
    position: static;
    min-height: 44px;
    align-items: center;
    background: #fff9ef;
    color: #38251a;
    border: 1px solid #b7a28e;
  }
  .office-hotspot span { padding: 0; border: 0; background: transparent; font-size: 13px; }
  .office-hotspot.is-current { border-color: #845937; background: #f0dec1; }
  .office-hotspot.is-current span { background: transparent; }
  .office-hotspot b { color: #6d3d24; }
  .office-panel-shade { padding: 8px; }
  .office-panel { max-height: calc(100dvh - 16px); }
  .office-panel-body .action-grid, .office-panel-body .map-page, .office-panel-body .archive-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
