/* v5: the office is the main scene; decisions stay around its edge. */
.field-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 5px;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  background: #e9efec;
  color: #345348;
  vertical-align: middle;
  margin-right: 5px;
}
.field-badge > b {
  font-size: 15px;
  line-height: 1;
}
.field-program {
  background: #e5eef8;
  color: #265e8a;
}
.field-design {
  background: #f5e7e8;
  color: #8e506c;
}
.field-paper {
  background: #e7eee0;
  color: #4f6c31;
}
.field-sales {
  background: #f5ecce;
  color: #7f5f28;
}
.field-review {
  background: #eae5f4;
  color: #6d5685;
}
.compact-title h3 .field-badge {
  font-size: 9px;
}
.mode-selector {
  display: flex;
  gap: 12px;
  margin: 20px 0;
}
.mode-card {
  flex: 1;
  text-align: left;
  padding: 15px 18px;
  border: 1px solid #cbd8d1;
  border-radius: 12px;
  background: #fffdf7;
  color: #29433e;
}
.mode-card small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
}
.mode-card[aria-pressed='true'] {
  border: 2px solid #39786a;
  background: #e6f0e7;
}
.item-art {
  object-fit: contain;
  display: block;
  background: transparent;
  flex-shrink: 0;
}
.illustrated-shop {
  display: flex;
  gap: 10px;
  align-items: center;
}
.shop-copy {
  min-width: 0;
  flex: 1;
}
.illustrated-shop h3 {
  font-size: 13px;
}
.skill-buttons .field-badge {
  font-size: 9px;
  margin: 0;
  padding: 1px 2px;
}
.skill-buttons small {
  font-size: 10px;
}
.office-assets {
  position: absolute;
  left: 12px;
  bottom: 20px;
  display: flex;
  gap: 5px;
  max-width: 95%;
  flex-wrap: wrap;
  z-index: 2;
}
.owned-asset {
  background: #ffffffe0;
  border: 1px solid #d5dccc;
  border-radius: 8px;
  padding: 2px 4px;
  width: 59px;
  cursor: pointer;
}
.owned-asset .item-art {
  width: 46px;
  height: 43px;
}
.owned-asset small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 8px;
  color: #496159;
}
.start-screen .scenario-card {
  min-height: 210px;
}
.compact-list {
  display: grid;
  gap: 6px;
}
.compact-list .compact-job {
  margin: 0;
}
.compact-shop h3 > .field-badge {
  display: block;
  width: max-content;
  margin-bottom: 4px;
}
.compact-title h3 {
  min-width: 0;
}
.compact-job .compact-title {
  align-items: flex-start;
}
.compact-job .compact-title h3 .field-badge {
  display: inline-flex;
}
.compact-title h3 {
  line-height: 1.4;
}
.desk-body .empty {
  padding: 20px;
}
@media (min-width: 1100px) and (min-height: 720px) {
  .app-shell {
    max-width: 1900px;
    grid-template-rows: 40px 64px minmax(0, 1fr) 15px;
    gap: 7px;
    padding: 8px 16px 5px;
  }
  .game-layout {
    grid-template-columns: minmax(0, 1.7fr) minmax(390px, 1fr);
    grid-template-rows: minmax(0, 1.6fr) minmax(250px, 1fr);
    gap: 10px;
  }
  .office-column {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 48px 46px;
    gap: 3px;
    position: relative;
  }
  .office-card {
    grid-row: 1;
    grid-column: 1;
  }
  .office-stage {
    flex: 1;
  }
  .card-topline {
    padding: 8px 14px;
  }
  .card-topline h2 {
    font-size: 14px;
  }
  .office-column > #office-readout {
    grid-row: 2;
    grid-column: 1;
    border: 0;
    background: transparent;
    padding: 0;
    display: flex;
    gap: 7px;
    align-items: start;
    overflow: auto;
  }
  .office-people {
    display: flex;
    flex-direction: row;
    gap: 4px;
    flex: 1;
  }
  .actor-button {
    flex: 1;
    min-width: 70px;
    max-width: 150px;
    padding: 5px;
  }
  .actor-button strong {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .actor-button span {
    font-size: 9px;
  }
  .office-queue {
    display: none;
  }
  .issue-button {
    max-width: 110px;
    flex-shrink: 0;
    font-size: 9px;
    margin: 0;
  }
  .compact-goal {
    grid-row: 3;
    grid-column: 1;
    padding: 0 6px;
    font-size: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .compact-goal strong {
    font-size: 10px;
  }
  .compact-goal #goal-body {
    margin-left: 7px;
  }
  .compact-goal #guide-message {
    white-space: normal;
    font-size: 10px;
    margin-top: 2px;
  }
  .calendar-card {
    padding: 8px 12px;
  }
  .calendar-card h2 small {
    display: none;
  }
  .calendar-card .chart-legend {
    font-size: 9px;
    gap: 6px;
    line-height: 1.3;
  }
  .calendar-card .fine-print {
    font-size: 9px;
    line-height: 1.3;
  }
  .cash-warning {
    font-size: 10px;
    margin: 3px 0;
  }
  .desk-header {
    padding: 7px 10px;
  }
  .desk-header h2 {
    font-size: 13px;
  }
  .desk-header #phase-caption {
    font-size: 9px;
  }
  .desk-tabs button {
    padding: 8px;
  }
  .desk-body {
    overflow: auto;
    scrollbar-width: thin;
    overscroll-behavior: contain;
    padding: 7px 9px;
    flex: 1;
    min-height: 0;
  }
  .desk-body#panel-jobs {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .sales-strip {
    flex-shrink: 0;
    margin-bottom: 5px;
  }
  .sales-strip > div > b {
    font-size: 11px;
  }
  .sales-strip select {
    font-size: 11px;
    padding: 3px;
  }
  .sales-strip small {
    font-size: 9px;
  }
  .compact-tabs {
    flex-shrink: 0;
    margin: 3px 0 6px;
  }
  .compact-tabs button {
    padding: 6px;
    font-size: 11px;
  }
  .compact-job {
    padding: 6px 8px;
    border-radius: 7px;
  }
  .compact-title h3 {
    font-size: 12px;
  }
  .compact-title > b,
  .compact-title > span {
    font-size: 11px;
  }
  .metric-row {
    margin: 4px 0 2px;
    gap: 3px;
  }
  .metric {
    padding: 2px 3px;
  }
  .metric small {
    font-size: 8px;
  }
  .metric b {
    font-size: 10px;
  }
  .metric i {
    font-size: 11px;
  }
  .compact-bottom {
    margin-top: 3px;
    font-size: 9px;
  }
  .compact-bottom .primary-button,
  .compact-bottom .secondary-button {
    font-size: 11px;
    padding: 3px 10px;
    min-height: 25px;
  }
  .compact-job .text-button {
    font-size: 10px;
  }
  .day-bar {
    padding: 8px 10px;
    flex-shrink: 0;
  }
  .day-feedback {
    padding: 3px 10px;
    flex-shrink: 0;
  }
  .desk-footer {
    flex-shrink: 0;
  }
  .compact-shop .fine-print {
    font-size: 11px;
    line-height: 1.45;
  }
  .compact-shop {
    margin-bottom: 8px;
  }
  .skill-buttons {
    grid-template-columns: repeat(4, 1fr);
  }
  .skill-buttons button {
    padding: 5px 2px;
  }
  .shop-copy > .compact-bottom {
    flex-wrap: wrap;
  }
  .item-art {
    width: 70px;
    height: 70px;
  }
  .compact-shop .compact-title {
    gap: 5px;
  }
  .day-bar strong {
    font-size: 11px;
  }
  .day-bar small {
    font-size: 9px;
  }
  .office-stage .scene-caption {
    font-size: 9px;
    bottom: 3px;
  }
  .compact-list {
    flex-shrink: 0;
  }
}
@media (min-width: 1550px) and (min-height: 800px) {
  .game-layout {
    grid-template-columns: minmax(0, 1.9fr) minmax(450px, 1fr);
  }
  .compact-title h3 {
    font-size: 14px;
  }
  .metric small {
    font-size: 9px;
  }
  .metric b {
    font-size: 12px;
  }
  .compact-job {
    padding: 8px 10px;
  }
  .compact-bottom {
    font-size: 11px;
  }
  .compact-list {
    gap: 8px;
  }
}
@media (max-width: 1099px), (max-height: 719px) {
  .office-assets {
    position: static;
    margin: 8px;
    max-width: 100%;
  }
  .office-stage {
    min-height: 320px;
    height: 360px;
  }
  .mode-selector {
    flex-wrap: wrap;
  }
  .mode-card {
    min-width: 170px;
  }
  .office-column {
    display: block;
  }
  .office-people {
    display: flex;
    flex-wrap: wrap;
  }
  .compact-goal {
    margin: 8px;
  }
  .item-art {
    width: 65px;
    height: 65px;
  }
  .compact-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}
.settlement-note {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 3px 12px;
  padding: 5px 0;
  font-size: 12px;
  border-bottom: 1px solid #d8d5c5;
}
#guide-message {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  line-height: 1.5;
}
/* Readable decision controls and an actual-size cash plot. */
.calendar-card { display: flex; flex-direction: column; }
#forecast-summary { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#cash-plot { position: relative; height: 250px; min-height: 150px; flex: 0 0 250px; }
#cash-plot > .cash-chart { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; margin: 0; }
.sales-strip { padding: 13px; border: 1px solid #bdd1c6; background: #edf4ed; margin-bottom: 10px; flex-shrink: 0; }
.sales-strip.sales-unassigned { border-color: #c9a04e; background: #fff5de; }
.sales-strip .sales-heading { justify-content: space-between; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.sales-strip .sales-heading > b { font-size: 15px; }
.sales-heading > span { font-size: 11px; color: #52695c; }
.sales-strip > label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.sales-strip .sales-controls { gap: 8px; }
.sales-strip select { min-height: 42px; font-size: 14px; padding: 8px; flex: 1; min-width: 0; }
.sales-controls > button { min-height: 42px; font-size: 12px; padding: 6px 10px; white-space: nowrap; }
.sales-message { font-size: 12px; font-weight: 600; line-height: 1.6; margin: 9px 0 4px; }
.sales-strip .sales-message small { display: block; font-size: 11px; font-weight: 400; }
.sales-strip .sales-links { justify-content: space-between; flex-wrap: wrap; gap: 4px; }
.sales-links .text-button { font-size: 11px; padding: 3px 0; }
.workload-panel { border: 1px solid #ccd7cf; background: #f8faf5; border-radius: 9px; padding: 12px; margin-bottom: 12px; }
.workload-panel h3 { margin: 0 0 7px; font-size: 15px; }
.load-key { display: flex; flex-wrap: wrap; gap: 5px 9px; font-size: 10px; margin: 0 0 12px; }
.human-key { color: #315d73; }
.ai-key { color: #237b64; }
.load-groups { display: grid; grid-template-columns: 3fr 2fr; gap: 12px; }
.load-groups > div { min-width: 0; }
.load-groups > div + div { border-left: 1px solid #d8dfd7; padding-left: 10px; }
.load-groups h4 { margin: 0 0 8px; font-size: 10px; color: #576d64; font-weight: 500; }
.load-bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.load-bars.contacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.load-column { text-align: center; min-width: 0; font-size: 10px; }
.load-column > strong { display: block; font-size: 10px; min-height: 30px; line-height: 1.3; overflow-wrap: anywhere; }
.load-track { display: block; height: 88px; width: 100%; max-width: 46px; margin: 0 auto 6px; border-bottom: 1px solid #8c9e94; }
.load-outline { fill: none; stroke: #758879; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.load-human { fill: #517b91; }
.load-ai { fill: #64ac8b; }
.load-column > b { display: block; font-size: 10px; white-space: nowrap; }
.load-column small { font-size: 9px; margin-left: 2px; }
.load-column > span { display: block; color: #567367; font-size: 9px; margin-top: 3px; }
.load-column > .load-short { color: #a6532f; }
.load-caption, .load-equipment { font-size: 10px; line-height: 1.6; margin: 9px 0 0; color: #536960; }
.load-equipment { background: #e9f2e7; padding: 6px; border-radius: 4px; }
.workload-explain { margin-top: 9px; border-top: 1px solid #d8dfd7; padding-top: 8px; font-size: 11px; line-height: 1.65; }
.workload-explain summary { cursor: pointer; color: #285d51; font-weight: 600; }
.workload-explain ul { padding-left: 18px; }
.workload-explain li { margin-bottom: 6px; }
.workload-ended { font-size: 12px; background: #edf3ed; padding: 10px; border-radius: 6px; }
#detail-dialog .load-track { height: 150px; max-width: 65px; }
#detail-dialog .load-column > strong, #detail-dialog .load-column > b { font-size: 12px; }
#detail-dialog .load-column > span { font-size: 11px; }
@media (min-width: 1100px) and (min-height: 720px) {
  #cash-plot { height: auto; flex: 1 1 0; }
}
@media (max-width: 380px) {
  .load-groups { gap: 7px; }
  .load-bars { gap: 3px; }
  .workload-panel { padding: 8px; }
  .sales-strip .sales-heading > b { font-size: 14px; }
}
