.prison-popup .pr-head-actions > [data-pr-mail] {
  min-height: 44px;
  color: var(--room-gold);
  border-color: var(--room-rule);
}

.pm-dialog {
  width: min(34rem, calc(100% - 1.25rem));
  max-height: calc(100dvh - 1.25rem);
  padding: 0;
  overflow: auto;
  color: #ededdf;
  background: #192321;
  border: 1px solid #55645a;
  border-radius: 14px;
  box-shadow: 0 14px 45px #070e0caa;
}

.pm-dialog::backdrop { background: #070d0bd1; }
.pm-head, .pm-nav, .pm-content { padding-inline: clamp(.8rem, 4vw, 1.35rem); }
.pm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-block: .85rem .55rem;
}
.pm-head h3 { margin: 0; font-size: 1.15rem; }
.pm-head .pm-close { min-width: 42px; min-height: 42px; }
.pm-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .35rem;
}
.pm-nav button {
  min-height: 44px;
  padding: .4rem .2rem;
  color: #d0d8cd;
  background: transparent;
  border: 1px solid #55645a;
  border-radius: 8px;
  font: inherit;
  font-size: .86rem;
  cursor: pointer;
}
.pm-nav button[aria-pressed="true"] {
  color: #fcf0d6;
  background: #3c4030;
  border-color: #b7a271;
  font-weight: 700;
}
.pm-dialog :is(button, input, select, textarea):focus-visible {
  outline: 2px solid #e8c882;
  outline-offset: 2px;
}
.pm-dialog button:disabled { cursor: default; }
.pm-content { padding-block: .8rem 1rem; }
.pm-status {
  margin: 0 .9rem .9rem;
  padding: .65rem .8rem;
  color: #f4e7cc;
  background: #333a2c;
  border-radius: 7px;
  font-size: .86rem;
}
.pm-empty { margin: .7rem 0 1rem; padding: 1.05rem; text-align: center; color: #c4cdc1; }
.pm-list-tools { display: flex; justify-content: end; margin-block-end: .4rem; }
.pm-list-tools button, .pm-detail-actions button { min-height: 40px; }
.pm-list { list-style: none; padding: 0; margin: 0; }
.pm-list li + li { margin-block-start: .3rem; }
.pm-list button {
  width: 100%;
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .7rem;
  text-align: start;
  color: #e7ebdf;
  background: #252f2a;
  border: 1px solid #46564e;
  border-radius: 7px;
  padding: .6rem .75rem;
  font: inherit;
  cursor: pointer;
}
.pm-list button:hover { background: #344139; }
.pm-list strong, .pm-list small { display: block; overflow-wrap: anywhere; }
.pm-list small { margin-top: .14rem; }
.pm-list time, .pm-list small { color: #c1cdc2; font-size: .8rem; }
.pm-list time, .pm-unread { flex: none; }
.pm-unread { color: #f1d28f; font-size: .72rem; margin-inline-start: auto; }
.pm-actions { display: flex; flex-wrap: wrap; justify-content: end; align-items: center; gap: .6rem; }
.pm-form .pm-actions { margin-block-start: .75rem; }
.pm-form .pm-actions span { font-size: .8rem; color: #d2dacc; }
.pm-form .pm-actions button { min-height: 44px; }
.pm-detail-actions { justify-content: space-between; margin-block-end: .65rem; }

.pm-paper {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: clamp(1.3rem, 5vw, 2.1rem) clamp(1.35rem, 6vw, 2.6rem);
  color: #272b20;
  background: #f4ead4 url('/img/city/prison-letter-paper.webp') center / 100% 100% no-repeat;
  border-radius: 3px;
}
.pm-paper .pm-letterhead {
  margin: 0 0 .9rem;
  padding-block-end: .75rem;
  border-bottom: 1px solid #525c464d;
  text-align: center;
  white-space: pre-wrap;
  color: #253522;
  font: 800 clamp(1.12rem, 4.4vw, 1.58rem)/1.4 'Nanum Myeongjo', 'Batang', serif;
}
.pm-parties { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; margin: 0 0 1rem; font-size: .8rem; }
.pm-parties div { display: flex; gap: .35rem; min-width: 0; }
.pm-parties dt { flex: none; color: #495043; }
.pm-parties dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.pm-subject { margin: 0 0 .4rem; color: #272b20; font-size: 1.02rem; overflow-wrap: anywhere; }
.pm-paper .pm-message {
  color: #272b20;
  min-height: 3.4rem;
  margin: 0;
  font-size: .94rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.pm-approval {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  margin-block-start: .9rem;
  color: #555245;
  font-size: .76rem;
}
.pm-stamp {
  display: inline-block;
  margin-inline-start: auto;
  padding: .3rem .45rem .23rem;
  border: 3px double currentColor;
  border-radius: 3px;
  color: #8d3029;
  font: 800 .82rem/1.1 'Nanum Myeongjo', 'Batang', serif;
  white-space: nowrap;
  transform: rotate(-5deg);
}
.pm-form label, .pm-fixed-recipient {
  display: block;
  margin: .6rem 0 0;
  color: #373d2d;
  font-size: .86rem;
  font-weight: 650;
}
.pm-fixed-recipient strong { margin-inline-start: .35rem; color: #212719; overflow-wrap: anywhere; }
.pm-form :is(input, select, textarea) {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  margin-block-start: .27rem;
  padding: .44rem .55rem;
  color: #222a1d;
  background: #fffdf3e5;
  border: 1px solid #777c63;
  border-radius: 5px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
}
.pm-form textarea { resize: vertical; }
.pm-form :is(input, select, textarea):focus-visible { outline-color: #476642; }

.pm-dialog.pm-arrival {
  position: fixed;
  inset: 0;
  width: min(27rem, calc(100% - 1.25rem));
  margin: auto;
  overscroll-behavior: contain;
}
.pm-arrival .pm-head { padding-block: 1.15rem 0; }
.pm-arrival .pm-content { padding-block: .85rem 1.15rem; }
.pm-arrival-details {
  display: grid;
  gap: .45rem;
  margin: 0;
  padding: .8rem .9rem;
  background: #252f2a;
  border: 1px solid #46564e;
  border-radius: 8px;
}
.pm-arrival-details div { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: .45rem; }
.pm-arrival-details dt { color: #c1cdc2; font-size: .85rem; }
.pm-arrival-details dd { margin: 0; color: #f3eddb; font-size: .95rem; font-weight: 650; overflow-wrap: anywhere; }
.pm-arrival-actions { margin-block-start: .85rem; }
.pm-arrival-actions .btn { min-height: 44px; }
.pm-arrival-error { margin: .7rem 0 0; color: #ffcfb8; font-size: .85rem; }
