/* Diplomacy enters from the left beside navigation; News from the right.
   The full panel moves horizontally, while its content scrolls vertically. */
#diplomacyPanel.side-drawer {
  padding: 0;
  display: block;
}
#diplomacyPanel.side-drawer[hidden] { display: none; }
#diplomacyPanel .overlay-backdrop {
  opacity: 0;
  transition: opacity 200ms ease;
}
#diplomacyPanel .overlay-card {
  position: absolute;
  top: calc(var(--chrome-top) + 6px + env(safe-area-inset-top, 0px));
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  left: calc(var(--inset-left) + env(safe-area-inset-left, 0px));
  width: min(720px, calc(100vw - var(--inset-left) - 12px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  transform: translateX(calc(-100% - var(--inset-left) - 16px));
  transition: transform 200ms ease;
}
#diplomacyPanel.is-open .overlay-card { transform: translateX(0); }
#diplomacyPanel.is-open .overlay-backdrop { opacity: 1; }
#rightColumn.column-right {
  top: calc(var(--chrome-top) + 6px + env(safe-area-inset-top, 0px));
  /* Follow the drawn selection cards, including the switch above them. */
  bottom: max(calc(8px + env(safe-area-inset-bottom, 0px)), var(--news-bottom, 8px));
  right: calc(8px + env(safe-area-inset-right, 0px));
  transform: translateX(calc(100% + 16px + env(safe-area-inset-right, 0px)));
  visibility: hidden;
  transition: transform 200ms ease, visibility 0s linear 200ms;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 55;
}
body.chronicle-open #rightColumn {
  /* The opened drawer is the foreground task, above battle (60) and
     decision (61) cards. Those keep updating and are exposed on close. */
  z-index: 62;
  transform: translateX(0);
  visibility: visible;
  transition-delay: 0s;
}
/* The drawer clears the controls vertically; the old side-by-side constraint
   squeezed the phone's selection strip into a few pixels. */
body.chronicle-open #commandBar { max-width: none; }
@media (prefers-reduced-motion: reduce) {
  #diplomacyPanel .overlay-card, #diplomacyPanel .overlay-backdrop,
  #rightColumn.column-right { transition: none; }
}
