.records { padding-block: clamp(48px, 8vw, 100px) 55px; min-height: 70vh; }
.records h1 { margin: 0; color: var(--blue); font-size: clamp(16px, 2vw, 21px); }
.records-lead { margin: 12px 0 32px; color: var(--navy); font-size: clamp(34px, 7vw, 72px); font-weight: 900; letter-spacing: -.05em; line-height: 1.15; }
.records-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 4vw, 38px); }
.records-grid figure { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.records-grid figcaption { margin-top: 10px; color: var(--muted); }
.records-grid figcaption p { margin: 4px 0; }
.records-grid .photo-thumb { padding: 0; border: 0; border-radius: 12px; width: 100%; overflow: hidden; display: block; cursor: zoom-in; background: var(--cream); }
.photo-thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
#management { margin-bottom: 25px; padding: clamp(14px, 3vw, 25px); background: var(--cream); border-radius: 14px; }
#management h2 { margin-top: 0; }
#management input, .record-editor input, .record-editor textarea { display: block; max-width: 100%; width: 100%; font: inherit; }
.record-editor, .upload-draft { margin-block: 12px; overflow-wrap: anywhere; }
.record-editor label, .upload-draft label { display: block; margin-block: 8px; }
.records button:not(.photo-thumb), #photo-viewer button { border: 1px solid var(--navy); border-radius: 6px; padding: 7px 10px; background: var(--paper); color: var(--navy); font: inherit; cursor: pointer; margin: 3px; }
.records button:disabled { opacity: .5; cursor: default; }
.records-actions { display: flex; justify-content: center; gap: 10px; padding: 12px 16px; position: sticky; bottom: 0; z-index: 2; background: var(--cream); border-top: 1px solid var(--line); }
.records-actions a { width: min(46%, 220px); padding: 12px 4px; text-align: center; border: 1px solid var(--navy); border-radius: 8px; font-weight: 800; color: var(--navy); }
.records-actions a:last-child { background: var(--navy); color: white; }
#photo-viewer { max-width: 94vw; max-height: 94dvh; border: 0; border-radius: 12px; padding: 12px; background: var(--paper); }
#photo-viewer form { text-align: right; }
#photo-viewer img { display: block; max-width: 100%; max-height: 75dvh; object-fit: contain; margin: auto; }
#photo-viewer::backdrop { background: rgb(8 29 54 / .85); }

#training-records > .button { margin-top: 24px; }

.record-video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 12px; background: var(--navy); }

.record-post { min-width: 0; }
.record-post:has(.record-carousel) {
  padding: clamp(8px, 2vw, 16px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.record-carousel { display: flex; align-items: start; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.record-carousel > figure { flex: 0 0 100%; scroll-snap-align: start; }
.record-carousel-controls { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; }
.record-carousel-controls button { min-width: 32px; }

.record-delete-dialog { max-width: min(420px, 90vw); padding: 22px; border: 0; border-radius: 14px; background: var(--paper); color: var(--navy); }
.record-delete-dialog::backdrop { background: rgb(8 29 54 / .75); }
.record-delete-dialog button { padding: 8px 16px; margin-right: 8px; font: inherit; cursor: pointer; }

#home-records-title, .records-lead { color: #000; }

.admin-access { margin-block: 20px; font-size: 1rem; }
.admin-access .admin-auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  min-height: 52px;
  padding: 12px 24px;
  margin: 4px 12px 8px 0;
  border: 2px solid var(--navy);
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
.admin-auth-button:hover { filter: brightness(1.15); }
.admin-auth-button:active { transform: translateY(1px); }
.admin-auth-button:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.admin-access [hidden] { display: none; }

#gallery-pagination:not([hidden]) { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 24px; }
#gallery-pagination button { min-width: 64px; min-height: 44px; margin: 0; }
#gallery-page { font-size: 1rem; }
#gallery { scroll-margin-top: 24px; }

@media (min-width: 901px) {
  .records-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
