.status-emoji-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.status-emoji {
  min-height: 64px;
  padding: 6px 3px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text);
}

.status-emoji--selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.status-emoji__icon {
  font-size: 22px;
}

.status-emoji__label {
  font-size: 11px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.status-row__emoji {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 21px;
}

.status-row__main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.status-row__main strong {
  font-size: 14px;
}

.status-row__main span {
  color: var(--muted);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.status-row time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.her-letter {
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  text-align: left;
  background: transparent;
}

.her-letter__unread {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.message-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.message-item--him {
  margin-left: 18px;
  background: color-mix(in srgb, var(--accent-2) 10%, var(--card));
}

.message-item p {
  margin: 0 0 7px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  font-size: 14px;
}

.message-item time {
  color: var(--muted);
  font-size: 11px;
}

.letter-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  padding: 18px;
  border: 0;
  background: rgba(20, 14, 18, 0.42);
  overflow-y: auto;
}

.letter-dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.letter-dialog .letter-card {
  width: min(460px, 100%);
  margin: auto;
}

.dialog-close {
  position: absolute;
  top: 24px;
  right: 26px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  font-size: 25px;
  line-height: 1;
}

.letter-detail {
  position: relative;
  min-height: 100%;
}

.envelope-stage {
  position: relative;
  min-height: 300px;
  padding: 34px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px 8px 28px 8px;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.08), transparent 22%),
    linear-gradient(145deg, #242737, #11131b 76%);
  color: #f9f0df;
  overflow: hidden;
}

.envelope-stage::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid currentColor;
  opacity: 0.12;
  pointer-events: none;
}

.envelope-seal {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.75;
  font-size: 25px;
}

.envelope-title {
  margin: 20px 0 12px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 24px;
  line-height: 1.35;
}

.envelope-text {
  margin: 0 0 24px;
  max-width: 280px;
  color: rgba(249, 240, 223, 0.72);
  font-size: 14px;
  line-height: 1.7;
}

.letter-detail.is-revealing {
  animation: whiteFlash 0.55s ease both;
}

@keyframes whiteFlash {
  0% { opacity: 1; }
  48% { opacity: 0; transform: scale(0.985); }
  100% { opacity: 1; transform: scale(1); }
}
