/* The shared reader supplies the window, close control and return-to-map footer. */
#reader:has(.heybox-page) {
  width: min(1250px, calc(100% - 44px));
  max-width: none;
  max-height: calc(100dvh - 38px);
}
#reader:has(.heybox-page) #dialog-content { padding: 0 }
#reader:has(.heybox-page) .dialog-top { padding: 7px clamp(17px, 3vw, 38px); font: bold 18px/1.4 'Songti SC', SimSun, serif }
.heybox-page {
  --rule: #d4c5aa;
  padding: 0 clamp(20px, 3vw, 46px) 30px;
  background: linear-gradient(115deg,#fffcf6,#faf6ec 65%,#f4edde);
  color: #232c31;
  font-family: 'Songti SC', SimSun, serif;
}
.heybox-identity { display: flex; align-items: center; gap: 23px; padding: 24px 0; border-bottom: 1px solid var(--rule) }
.heybox-avatar {
  width: 92px; height: 92px; flex: none;
  background: url('assets/traveler-camp-scene.webp') 51% 34% / 198% no-repeat;
  border: 3px solid #faf6ec; outline: 1px solid #bd9558; box-shadow: 3px 3px #c6ac7f;
}
.heybox-name { color: #66543e; font: 600 15px var(--font-ui); letter-spacing: .08em }
#dialog-content .heybox-page h2 { font-size: clamp(30px,3.3vw,47px); line-height: 1.28; margin: 0 }
.heybox-home { margin-left: auto; padding: 12px 20px; color: #f4dfb6; background: #192a3b; border: 1px solid #bd9558; outline: 1px solid #192a3b; outline-offset: 2px }
.heybox-page a { font-size: 17px; font-weight: bold; text-decoration: none }
.heybox-page a:hover { text-decoration: underline; text-underline-offset: 4px }
.heybox-page :is(a,button):focus-visible { outline: 3px solid #946721; outline-offset: 2px }
#dialog-content .heybox-heading { display: flex; align-items: center; gap: 12px; margin: 23px 0 17px; font-size: 26px; line-height: 1.2 }
.heybox-heading::before { content: ''; width: 4px; height: 23px; background: #bd9558 }
.heybox-columns { display: grid; grid-template-columns: minmax(0,1.22fr) minmax(0,1fr); gap: 30px }
.heybox-feature { border-right: 1px solid var(--rule); padding-right: 30px }
.heybox-feature img { display: block; width: 100%; height: auto; border: 1px solid #d5cbb9; box-shadow: 0 3px 10px #45382415 }
.heybox-feature h4 { margin: 16px 0 12px; font-size: clamp(23px,2.05vw,31px); line-height: 1.4 }
.heybox-feature a { color: #79501e; border-bottom: 1px solid #ba9863; padding-bottom: 3px }
.heybox-story { display: grid; grid-template-columns: 38% 1fr; gap: 16px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--rule) }
.heybox-story:first-child { padding-top: 0 }
.heybox-story img { display: block; width: 100%; aspect-ratio: 1.9; object-fit: cover }
.heybox-story h4 { font-size: clamp(18px,1.45vw,22px); line-height: 1.52; margin: 0 }
.heybox-story h4 a { color: inherit; font: inherit }
.heybox-shot-heading { display: flex; justify-content: space-between; align-items: center; margin: 19px 0 13px }
#dialog-content .heybox-shot-heading h3 { margin: 0 }
.heybox-shot-heading button { color: #71552d; font-size: 14px; padding: 8px 4px }
.heybox-shot { display: block; width: 100%; height: clamp(185px,18vw,253px); padding: 0; border: 1px solid #c9bda9; cursor: zoom-in; background: white }
.heybox-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top }
dialog.heybox-viewer { width: min(1080px,94vw); max-width: 94vw; max-height: 92dvh; padding: 0; border: 1px solid #bd9558; background: white; overflow: auto; overscroll-behavior: contain }
.heybox-viewer::backdrop { background: #0e192ad9 }
.heybox-viewer img { display: block; width: 100%; height: auto }
.heybox-viewer form { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 4px 18px; color: #fff2d9; background: #192a3b }
.heybox-viewer button { min-width: 44px; min-height: 40px; font-size: 24px }
@media (max-width: 760px) {
  #reader:has(.heybox-page) { width: calc(100% - 20px); max-height: calc(100dvh - 20px) }
  .heybox-page { padding: 0 17px 24px }
  .heybox-identity { flex-wrap: wrap; gap: 13px; padding: 17px 0 }
  .heybox-avatar { width: 68px; height: 68px }
  .heybox-page .heybox-home { padding: 8px 11px; font-size: 14px }
  .heybox-columns { display: block }
  .heybox-feature { border: 0; border-bottom: 1px solid var(--rule); padding: 0 0 19px; margin-bottom: 17px }
  #dialog-content .heybox-heading { font-size: 22px }
  .heybox-story h4 { font-size: 17px }
  .heybox-shot, .heybox-shot img { height: auto }
}
@media (max-width: 460px) {
  .heybox-home { margin-left: 81px }
}
