body.overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17.8rem;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

.stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7rem minmax(14.3rem, 17.5rem);
  grid-template-rows: minmax(0, 1fr) minmax(5.2rem, 21.2vh);
  column-gap: 0.7rem;
  row-gap: 0.7rem;
  padding: 0.7rem;
}

.faces {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  height: 0;
  min-height: 100%;
  display: grid;
  grid-template-rows: repeat(8, minmax(0, 1fr));
  align-content: stretch;
  width: auto;
  gap: 0.28rem;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.3rem 0.35rem;
}

.person {
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
  text-align: center;
  box-sizing: border-box;
  background: #121a17;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  padding: 0.16rem 0.28rem 0.22rem;
}

.person > div { width: 100%; min-width: 0; }
.person .face {
  width: 2.15rem;
  height: 2.15rem;
  display: block;
  margin: 0 auto 0.08rem;
}

.person p { margin: 0; }
.person .name { font-size: 0.68rem; font-weight: 650; line-height: 1.1; }
.person .meter {
  display: grid;
  grid-template-columns: 0.72rem minmax(0, 1fr);
  align-items: center;
  column-gap: 0.18rem;
  margin: 0.12rem 0 0;
}
.meter .icon { display: flex; color: var(--ok); }
.meter.energy .icon { color: var(--warn); }
.meter .mark { width: 0.72rem; height: 0.72rem; display: block; }
.meter .track {
  height: 0.38rem;
  border-radius: 999px;
  background: #31423b;
  overflow: hidden;
}
.meter .track span {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.meter.energy .track span { background: var(--warn); }
.meter.health .track span { background: var(--ok); }

.person.empty {
  background: transparent;
  border-color: transparent;
}
.person.empty .face,
.person.empty .name,
.person.empty .meter { visibility: hidden; }

.situation {
  grid-column: 3;
  grid-row: 1;
  height: 0;
  min-height: 100%;
  min-width: 0;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.55rem 0.8rem 0.7rem;
}

.situation h2 {
  margin: 0 0 0.28rem;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.situation ul {
  margin: 0;
  padding-left: 1.1rem;
}

.situation li {
  margin: 0 0 0.4rem;
}

.inventory {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 0;
  align-content: start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.45rem 0.75rem 0.6rem;
}

.inventory > div {
  min-width: 0;
  padding: 0 0.9rem;
}
.inventory > div + div {
  border-left: 1px dotted var(--muted);
}
.inventory h2 {
  margin: 0 0 0.2rem;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.inventory ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: minmax(7.5rem, 1fr);
  column-gap: 0.8rem;
  row-gap: 0.2rem;
}

.inventory li {
  break-inside: avoid;
  margin: 0 0 0.35rem;
  font-size: 0.86rem;
}

.inventory li span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.map-wrap {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: stretch;
  width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: 1536 / 1024;
  background: #0c1411;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  overflow: hidden;
}

.map-wrap img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

.map-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-title,
.map-north,
.map-credit,
.map-label {
  position: absolute;
  margin: 0;
  color: #f4efe4;
  text-shadow: 0 1px 2px #1c241c;
}

.map-title { top: 0.45rem; left: 0.6rem; font-size: 1rem; }
.map-north { top: 0.45rem; right: 0.7rem; font-size: 0.95rem; }
.map-credit { left: 0.5rem; bottom: 0.35rem; font-size: 0.65rem; }
.map-label {
  transform: translate(-50%, -120%);
  font-size: 0.72rem;
  white-space: nowrap;
}
.map-dot {
  position: absolute;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid #1c241c;
}
.map-dot.group { background: #f2d27a; }
.map-dot.zombie { background: #c4493a; }

.road-card {
  height: 100%;
  margin: 0;
  padding: 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, rgba(12, 20, 17, 0.2), rgba(8, 12, 10, 0.92)),
    #243028;
}

.road-card[hidden] { display: none; }

.road-card .tone {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #e2b65a;
  font-size: 0.85rem;
}

.road-card h2 {
  margin: 0.25rem 0 0.4rem;
  font-size: 1.8rem;
}

.road-card p {
  margin: 0;
  max-width: 40rem;
}

.incoming {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: #0e1613;
  padding: 0.6rem 0.7rem 0.8rem;
}

.incoming .spacer { flex: 1 0 0; }

.incoming article {
  margin: 0 0 0.55rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.65rem;
  background: var(--other);
}

.incoming .who-line, .incoming .text, .incoming .labels, .incoming .time { margin: 0.1rem 0; }
.incoming .who-line { font-weight: 650; font-size: 0.82rem; }
.incoming .text { white-space: pre-wrap; word-break: break-word; }
.incoming .labels, .incoming .time { color: var(--muted); font-size: 0.75rem; }
.incoming .bad { color: var(--bad); }
.incoming .held { color: var(--held); }

body.overview.tv {
  height: 100vh;
  height: 100dvh;
  grid-template-columns: minmax(0, 4.4fr) minmax(8.9rem, 1fr);
}

body.overview.tv .stage {
  grid-template-columns: minmax(0, 1fr) 7rem minmax(12.6rem, 15.8rem);
  grid-template-rows: minmax(0, 1fr) 17.8vh;
}

body.overview.tv .faces { overflow: hidden; }

body.overview.tv .map-wrap {
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
}

body.overview.tv .map-wrap img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

@media (max-height: 820px) and (min-width: 981px) {
  body.overview {
    grid-template-columns: minmax(0, 4.4fr) minmax(8.9rem, 1fr);
  }

  .stage {
    grid-template-columns: minmax(0, 1fr) 7rem minmax(12.6rem, 15.8rem);
    grid-template-rows: minmax(0, 1fr) minmax(4.9rem, 17.8vh);
  }

  .faces { overflow: hidden; }

  .map-wrap {
    align-self: center;
    justify-self: stretch;
    width: 100%;
    height: auto;
    max-height: 100%;
  }

  .map-wrap img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
  }
}

@media (max-width: 980px) {
  body.overview {
    display: block;
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }

  .stage {
    display: flex;
    flex-direction: column;
    height: auto;
    gap: 0.7rem;
    padding: 0.7rem;
    padding-bottom: max(0.7rem, env(safe-area-inset-bottom));
  }

  .map-wrap,
  .faces,
  .situation,
  .inventory {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .map-wrap { order: 1; }
  .situation { order: 2; }
  .inventory { order: 3; }

  .faces {
    order: 4;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: auto auto;
    align-content: start;
    gap: 0.45rem;
  }

  .person {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    height: auto;
    min-height: 0;
    padding: 0.35rem 0.15rem 0.4rem;
  }

  .person .name { font-size: 0.68rem; }
  .person .meter {
    width: 100%;
    grid-template-columns: 0.7rem minmax(0, 1fr);
  }

  .inventory { grid-template-columns: 1fr; }
  .inventory > div { padding: 0.45rem 0; }
  .inventory > div + div {
    border-left: none;
    border-top: 1px dotted var(--muted);
  }
  .inventory ul {
    grid-template-rows: none;
    grid-auto-flow: row;
    grid-template-columns: 1fr;
  }

  .incoming { display: none; }
}
