.grid.bookgrid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.bookcard {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.bookcard:hover,
.bookcard:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(8, 41, 68, 0.14);
  outline: 3px solid rgba(11, 126, 232, 0.14);
}

.bookcover {
  position: relative;
  width: 92px;
  height: 132px;
  flex: 0 0 92px;
  border: 0;
  border-radius: 7px;
  overflow: hidden;
  background: #e8f0f7;
}

.bookcover img {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.coverplaceholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
  background: linear-gradient(145deg, #e8edf1, #cfd8df);
}

.bookinfo {
  flex: 1;
  min-width: 0;
}

.bookinfo h3 {
  margin-top: 7px;
}

.bookdialog {
  width: min(900px, calc(100% - 24px));
  max-height: 90vh;
  border: 0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(8, 41, 68, 0.3);
}
.bookdialog::backdrop {
  background: rgba(8, 41, 68, 0.55);
}
.dialogclose {
  float: right;
}
.detailgrid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
}
.detailcover {
  width: 140px;
  height: 200px;
}
.detailmeta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.detailmeta > div {
  padding: 10px;
  background: #f2f6fa;
  border-radius: 7px;
}

@media (max-width: 600px) {
  .grid.bookgrid {
    grid-template-columns: 1fr;
  }
  .detailgrid {
    grid-template-columns: 1fr;
  }
  .detailcover {
    margin: auto;
  }
}
.digitalviewerdialog {
  width: calc(100vw - 16px);
  max-width: calc(100vw - 16px);
  height: calc(100vh - 16px);
  max-height: calc(100vh - 16px);
  margin: 8px;
  padding: 0;
  overflow: hidden;
}
.digitalviewerheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.digitalviewerheader h2 {
  margin: 5px 0 0;
}
.viewonlynotice {
  padding: 9px 20px;
  color: #6b4a00;
  background: #fff5d6;
  border-bottom: 1px solid #eedb9c;
  font-size: 0.88rem;
}
#digitalViewerFrame {
  width: 100%;
  height: calc(100% - 82px);
  border: 0;
  background: #e9edf2;
}

.record-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent, #0b7ee8);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

#rooms,
#equipmentReservationList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 18px;
}

.reservation-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line, #d8e2eb);
  border-top: 4px solid var(--accent);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(8, 41, 68, 0.07);
}
.reservation-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.reservation-card__header h3 {
  margin: 3px 0 0;
}
.eyebrow {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}
.reservation-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.reservation-facts span {
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, #fff);
  color: var(--muted);
  font-size: 0.86rem;
}
.reservation-facts strong {
  color: var(--text);
}
.reservation-description {
  min-height: 42px;
  color: var(--muted);
}
.schedule-list {
  display: grid;
  gap: 7px;
}
.schedule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 7%, #fff);
}
.schedule-item small {
  color: var(--muted);
}
.empty-schedule,
.login-note {
  padding: 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, #fff);
  color: var(--nav);
}
.reservation-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line, #d8e2eb);
}
.reservation-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
}
.reservation-form .full {
  grid-column: 1 / -1;
}

@media (max-width: 600px) {
  #rooms,
  #equipmentReservationList {
    grid-template-columns: 1fr;
  }
  .reservation-form {
    grid-template-columns: 1fr;
  }
}
