/* R81T: native flat-grid fallback and readiness marker, before the moving layout. */
#mainContent .checkin-section .checkin-grid { --ths-checkin81t-ready: 1; }
#mainContent .checkin-section .checkin-grid:not(.ths-r80k-gallery) {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
  width: 100%; max-width: 100%; min-width: 0;
}
#mainContent .checkin-section .checkin-grid:not(.ths-r80k-gallery) .checkin-photo {
  display: block; width: 100%; min-width: 0; aspect-ratio: 4 / 3;
}
@media (max-width: 760px) {
  #mainContent .checkin-section .checkin-grid:not(.ths-r80k-gallery) {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  }
}
/* THERASPA R80K: only native check-in Gallery. Existing palette and frontend styles remain unchanged. */
#mainContent .checkin-section .checkin-grid.ths-r80k-gallery {
  --ths-r80k-gap: 16px;
  --ths-r80k-photo-width: clamp(220px, 24vw, 310px);
  display: flex;
  flex-direction: column;
  gap: var(--ths-r80k-gap);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.ths-r80k-gallery .ths-r80k-photo-lane { width: 100%; min-width: 0; overflow: hidden; }
.ths-r80k-gallery .ths-r80k-photo-track { display: flex; width: max-content; }
.ths-r80k-gallery .ths-r80k-photo-group {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 auto;
  gap: var(--ths-r80k-gap);
  padding-inline-end: var(--ths-r80k-gap);
}
#mainContent .checkin-section .ths-r80k-gallery .checkin-photo {
  box-sizing: border-box;
  flex: 0 0 var(--ths-r80k-photo-width);
  width: var(--ths-r80k-photo-width);
  min-width: 0;
  height: auto;
  aspect-ratio: 4 / 3;
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
}
#mainContent .checkin-section .ths-r80k-gallery .checkin-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ths-r80k-gallery .ths-r80k-photo-track[data-r80k-direction="right"] { animation: ths-r80k-right 42s linear infinite; }
.ths-r80k-gallery .ths-r80k-photo-track[data-r80k-direction="left"] { animation: ths-r80k-left 42s linear infinite; }
@keyframes ths-r80k-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@keyframes ths-r80k-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ths-r80k-gallery[data-r80k-paused="true"] .ths-r80k-photo-track { animation-play-state: paused; }
@media (hover: hover) {
  .ths-r80k-gallery:hover .ths-r80k-photo-track { animation-play-state: paused; }
}
.ths-r80k-gallery-controls { display: flex; justify-content: center; }
.ths-r80k-gallery .ths-r80k-motion { min-height: 44px; cursor: pointer; }
.ths-r80k-gallery .ths-r80k-motion[hidden] { display: none; }
/* Keyboard users get four stable originals, without offscreen duplicate tab stops. */
.ths-r80k-gallery[data-r80k-focus="true"] .ths-r80k-photo-lane + .ths-r80k-photo-lane,
.ths-r80k-gallery[data-r80k-focus="true"] .ths-r80k-photo-group[aria-hidden="true"] { display: none; }
.ths-r80k-gallery[data-r80k-focus="true"] .ths-r80k-photo-track { width: 100%; animation: none; transform: none; }
.ths-r80k-gallery[data-r80k-focus="true"] .ths-r80k-photo-group {
  width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0;
}
#mainContent .checkin-section .ths-r80k-gallery[data-r80k-focus="true"] .checkin-photo { width: 100%; }
@media (prefers-reduced-motion: reduce) {
  .ths-r80k-gallery .ths-r80k-photo-lane + .ths-r80k-photo-lane,
  .ths-r80k-gallery .ths-r80k-photo-group[aria-hidden="true"] { display: none; }
  .ths-r80k-gallery .ths-r80k-photo-track { width: 100%; animation: none; transform: none; }
  .ths-r80k-gallery .ths-r80k-photo-group {
    width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0;
  }
  #mainContent .checkin-section .ths-r80k-gallery .checkin-photo { width: 100%; }
}

/* R80K FIX1: readable motion controls in normal, paused, hover and keyboard states. */
#mainContent .checkin-section .ths-r80k-gallery .ths-r80k-motion {
  color: #fff !important;
  background: #18334c !important;
  background-image: none !important;
  border-color: #18334c !important;
}
#mainContent .checkin-section .ths-r80k-gallery .ths-r80k-motion[aria-pressed="true"] {
  color: #18334c !important;
  background: #fffaf2 !important;
  background-image: none !important;
}
#mainContent .checkin-section .ths-r80k-gallery .ths-r80k-motion:hover {
  color: #fff !important;
  background: #25465d !important;
  background-image: none !important;
}
#mainContent .checkin-section .ths-r80k-gallery .ths-r80k-motion:focus-visible {
  outline: 3px solid #9c7a36;
  outline-offset: 3px;
}
