.res-view {
  --res-ink: #183f36;
  --res-muted: #52675d;
  --res-green: #235749;
  --res-paper: #fffdf8;
  --res-line: #deded0;
  --res-mint: #e7eee5;
  --res-ochre: #ead784;
  width: min(100%, 920px);
  font-size: 1.125rem;
  margin: 0 auto;
  color: var(--res-ink);
  padding: clamp(24px, 4vw, 52px) 0 46px;
  overflow-wrap: anywhere;
}
.res-view *, .res-view *::before, .res-view *::after { box-sizing: border-box; }
.res-view [hidden] { display: none !important; }
.res-view h1, .res-view h2, .res-view h3, .res-view p { margin: 0; }
.res-view h1, .res-view h2 { font-family: inherit; font-weight: 650; }
.res-view h1 { font-size: clamp(32px, 4.5vw, 46px); line-height: 1.15; letter-spacing: -.025em; }
.res-view h2 { font-size: clamp(22px, 3vw, 28px); line-height: 1.3; letter-spacing: -.015em; }
.res-view h3 { font-size: 1.1rem; line-height: 1.4; font-weight: 650; }
.res-view p { line-height: 1.6; color: var(--res-muted); }
.res-view button, .res-view a, .res-view textarea, .res-view input { font: inherit; }
.res-view button, .res-view a { -webkit-tap-highlight-color: transparent; }
.res-view button { cursor: pointer; color: inherit; }
.res-view :is(button, a, summary, label.res-file):focus-visible, .res-view textarea:focus-visible, .res-view .res-file:focus-within {
  outline: 3px solid #92570d;
  outline-offset: 4px;
}
.res-view button:disabled { opacity: .62; cursor: default; }
.res-view svg { flex: 0 0 auto; width: 21px; height: 21px; }
.res-view .res-heading { margin: 0 0 28px; }
.res-heading p { margin-top: 10px; font-size: 1.08rem; }
.res-action, .res-back {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 46px; padding: 10px 17px; text-decoration: none;
  color: var(--res-ink); background: var(--res-paper); border: 1px solid #bdc9bd;
  border-radius: 11px; font-weight: 600 !important; line-height: 1.35;
}
.res-view .res-action:hover { background-color: #f0f2e8; }
.res-view .res-primary { color: #fff; background-color: var(--res-green); border-color: var(--res-green); }
.res-view .res-primary:hover { background-color: #173f34; }
.res-back { padding-inline: 7px; margin-bottom: 14px; border: 0; background: transparent; }
.res-back:hover span, .res-file:hover { text-decoration: underline; }
.res-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.res-empty, .res-letter, .res-game, .res-compose, .res-reflection {
  border: 1px solid var(--res-line); border-radius: 20px; background: var(--res-paper);
  padding: clamp(20px, 4vw, 42px); max-width: 880px;
}
.res-empty { background: #f4f4e9; }
.res-empty > svg { width: 30px; height: 30px; margin-bottom: 12px; color: var(--res-green); }
.res-empty p, .res-game > p, .res-letter-author p { margin-top: 8px; }
.res-bio { display: flex; padding: 16px 20px; align-items: center; gap: 18px; background: var(--res-mint); border-radius: 14px; margin: 0 0 22px; }
.res-bio h2 { font-size: 23px; margin-bottom: 5px; }
.res-bio .res-profile-photo { width: clamp(60px, 8vw, 90px); aspect-ratio: 1; border-radius: 50%; flex: 0 0 auto; background: #d1ddc5; }
.res-bio .res-initials { font-size: 28px; }
.res-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr)); gap: 18px; }
.res-person-card { appearance: none; display: block; text-align: left; background: var(--res-paper); border: 1px solid var(--res-line); border-radius: 17px; padding: 0; overflow: hidden; }
.res-view button:is(.res-person-card, .res-message-row):hover { border-color: #779383; box-shadow: 0 3px 12px #243e2910; }
.res-portrait { display: grid; place-items: center; position: relative; isolation: isolate; overflow: hidden; background-color: #e6e6cd; color: #476050; }
.res-card-photo { aspect-ratio: 1.52; }
.res-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.res-initials { font-family: Georgia, serif; font-size: clamp(36px, 4.5vw, 62px); }
.res-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 18px; }
.res-card-foot h2 { font-size: 27px; }
.res-card-foot p { margin-top: 4px; }
.res-person-detail { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); border: 1px solid var(--res-line); border-radius: 21px; overflow: hidden; background: var(--res-paper); max-width: 980px; }
.res-large-photo { min-height: 300px; }
.res-person-copy { padding: clamp(22px, 4vw, 58px); align-self: center; }
.res-person-copy .res-relation { margin-top: 8px; font-size: 1.24rem; color: var(--res-green); }
.res-person-copy .res-prose, .res-person-copy .res-action { margin-top: 18px; }
.res-compose:focus { outline: none; }
.res-compose .res-ready-message { color: var(--res-ink); font-size: 1.35em; margin: 20px 0; }
.res-compose > button { margin-top: 20px; }
.res-field { display: grid; gap: 8px; margin-top: 18px; font-weight: 600; }
.res-field textarea { border: 1px solid #96aa99; padding: 13px; border-radius: 10px; line-height: 1.55; background: white; color: var(--res-ink); resize: vertical; }
.res-compose .res-actions { margin-top: 15px; }
.res-compose .res-status { margin: 14px 0 0; }
.res-compose .res-status:empty { display: none; }
.res-record-preview video, .res-player, .res-reflection video { display: block; width: 100%; max-width: 580px; max-height: 410px; border-radius: 12px; margin: 14px 0; }
.res-youtube { aspect-ratio: 16 / 9; border: 0; }
.res-live { transform: scaleX(-1); }
.res-record-preview audio { max-width: 100%; margin: 14px 0; }
.res-record-preview .res-back { margin: 0; }
.res-message-photo,.res-record-preview img{display:block;width:auto;max-width:100%;max-height:56vh;object-fit:contain;border-radius:12px;margin:14px 0}
.res-view .res-inbox{margin-top:12px}
.res-file { position: relative; overflow: hidden; cursor: pointer; font-weight: 600; }
.res-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.res-sent { margin-top: 16px !important; background: var(--res-mint); color: var(--res-ink) !important; padding: 16px; border-radius: 12px; }
.res-list, .res-inbox { display: grid; list-style: none; margin: 0; padding: 0; border: 1px solid var(--res-line); background: var(--res-paper); border-radius: 16px; max-width: 900px; overflow: clip; }
.res-event, .res-message-row { display: flex; align-items: center; gap: clamp(9px, 2vw, 20px); padding: 16px clamp(12px, 2vw, 22px); }
.res-event + .res-event, .res-message-row + .res-message-row { border-top: 1px solid var(--res-line); }
.res-badge, .res-avatar { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 auto; background: var(--res-mint); }
.res-warm { background: #f7edc3; color: #795722; }
.res-avatar { border-radius: 50%; }
.res-avatar .res-initials { font-size: 17px; }
.res-row-copy { flex: 1; min-width: 0; }
.res-time { font-size: .9rem; color: var(--res-muted); flex-shrink: 0; }
.res-message-row { width: 100%; text-align: left; border: 0; background: transparent; }
.res-message-row:hover { background: #f2f4e9; }
.res-message-row:focus-visible { outline-offset: -4px !important; }
.res-truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.res-letter-author { display: flex; gap: 14px; align-items: center; }
.res-letter-author h1 { font-size: clamp(28px, 3.6vw, 42px); }
.res-letter .res-letter-body { margin: 24px 0; color: var(--res-ink); font-size: clamp(21px, 3vw, 28px); white-space: pre-line; }
.res-game-status:not(:empty) { background: var(--res-mint); padding: 12px 15px; border-radius: 10px; color: var(--res-ink); margin: 15px 0; }
.res-game .res-actions { margin-top: 18px; }
.res-board { display: grid; grid-template-columns: repeat(3, 1fr); width: min(100%, 320px); gap: 6px; margin: 20px 0 12px; }
.res-cell { aspect-ratio: 1; font-size: clamp(32px, 6vw, 48px) !important; font-weight: 600 !important; background: #f1f5eb; border: 1px solid #a5b3a4; border-radius: 12px; }
.res-cell:hover, .res-cell[data-mark="O"] { background: #eee6d0; }
.res-cell.res-win { background: #f4e09d; border-color: #bba15b; }
.res-reflection > p { margin-bottom: 16px; }
.res-reflection > .res-action, .res-letter .res-play { margin: 0 10px 10px 0; }
.res-empty p + .res-action { margin-top: 18px; }
.res-disclosure { margin: 18px 0; }
.res-disclosure summary { width: fit-content; max-width: 100%; cursor: pointer; font-weight: 650; color: var(--res-green); padding: 12px 4px; min-height: 48px; }
.res-disclosure[open] summary { margin-bottom: 7px; }
.res-view .res-choice-list { display: grid; max-width: 590px; gap: 12px; }
.res-choice { display: flex; align-items: center; gap: 16px; text-align: left; border: 1px solid #b9c7bc; background: var(--res-paper); color: var(--res-ink); padding: 18px 22px; border-radius: 14px; font-weight: 650 !important; min-height: 58px; text-decoration: none; }
.res-choice:hover { background: var(--res-mint); }
.res-call strong, .res-call small { display: block; }
.res-call small { color: var(--res-muted); margin-top: 3px; font-size: 1rem; font-weight: 500; }
.res-date-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.res-plan-time { flex: 0 0 5.2em; font-weight: 650; color: var(--res-green); }
.res-event .res-row-copy h2 { font-size: 1.12em; }
.res-view .res-plain-note { color: var(--res-ink); }
.res-game-status { width: fit-content; }
.res-game .res-game-status { margin: 15px 0 5px; }
.res-game h1 { font-size: clamp(28px, 4vw, 38px); }
.res-people { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .res-view .res-heading { margin-bottom: 20px; }
  .res-person-detail { grid-template-columns: 1fr; }
  .res-large-photo { min-height: auto; aspect-ratio: 1.5; }
  .res-person-copy { padding: 22px; }
  .res-people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .res-card-foot { padding: 12px; }
  .res-card-foot h2 { font-size: 23px; }
  .res-card-foot > svg { display: none; }
  .res-message-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 18px; gap: 2px 10px; }
  .res-message-row > .res-avatar, .res-message-row > .res-badge, .res-message-row > svg { grid-row: span 2; }
  .res-message-row > .res-time { grid-column: 2; grid-row: 2; }
  .res-message-row > svg { grid-column: 3; grid-row: 1 / span 2; }
  .res-badge, .res-avatar { width: 40px; height: 40px; }
  .res-event { gap: 10px; }
}
@media (max-width: 360px) {
  .res-people { grid-template-columns: 1fr; }
  .res-event { align-items: flex-start; flex-direction: column; }
  .res-plan-time { flex-basis: auto; }
}
@media (forced-colors: active) {
  .res-win { outline: 2px solid Highlight; }
}
