:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #191b1b;
  background: #fdfdfd;
  --green: #064638;
  --lime: #9afa48;
  --surface: #f5f5f5;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
button, select { font: inherit; }
button, summary, select { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #1867b9; outline-offset: 3px; }
.availability :focus-visible { outline-color: #b6ff87; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.page-width {
  width: min(1600px, 100%);
  margin-inline: auto;
  padding-inline: clamp(24px, calc(7.8125vw - 38px), 80px) clamp(24px, calc(3.125vw - 7.25px), 40px);
}
.page-header { padding-block: 14px 17px; border-bottom: 1px solid #c9c9c9; }
.page-header h1 { font-size: 22px; color: #090a0a; }
.page-attribution { margin-top: 4px; color: #484c4b; font-size: 13px; line-height: 1.4; }
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 20px;
  padding-block: 40px;
}
.seating, .guidance, .availability-controls > div { min-width: 0; }
.icon {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -.18em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.availability {
  padding: 24px 24px 12px;
  border-radius: var(--radius);
  background: var(--green);
  color: white;
}
.availability-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 4.8vw, 74px);
}
.availability h2 { font-size: 26px; }
.availability-heading p { margin-top: 6px; color: #e1eeea; font-size: 15px; font-weight: 600; }
.booking a {
  border-color: var(--lime);
  background: var(--lime);
  color: #12392a;
}
.location select {
  width: 100%;
  min-height: 50px;
  padding: 8px 12px;
  border: 1px solid #cbd1ce;
  border-radius: 9px;
  background: #fff;
  color: #191b1b;
  font-weight: 700;
}
.snapshot-status {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  font-size: 17px;
}
.seat-count { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.count-icon { color: var(--lime); }
.data-message {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff5da;
  color: #543700;
  font-size: 14px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin-block: 24px 12px;
  padding-inline: 12px;
}
.legend h2 { font-size: 16px; }
.legend ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.swatch { width: 24px; height: 24px; border-radius: 3px; flex: none; }
[data-status="available"] { background: #98d9b9; border: 1px solid #34865e; color: #082543; }
[data-status="occupied"] { background: #f2f2f2; border: 1px solid #dedfe0; color: #3e4144; }
[data-status="unknown"] { background: #fff7e8; border: 1px dashed #927645; color: #563d15; }

.map-card { padding: 20px; border-radius: var(--radius); background: var(--surface); }
.map-viewport { position: relative; overflow: hidden; }
.floor-map {
  position: relative;
  width: 100%;
  aspect-ratio: 904 / 869;
  container-type: inline-size;
  background: white url("assets/main-library-3f.png") center / 100% 100% no-repeat;
  transform-origin: top left;
}
.seat-layer { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.seat {
  position: absolute;
  display: grid;
  place-items: center;
  width: calc(34% / 9.04);
  height: calc(34% / 8.69);
  border-radius: .45cqw;
  font-size: clamp(5px, 1.22cqw, 16px);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.map-controls { display: none; }

.guidance { display: grid; align-content: start; gap: 24px; }
.booking, .auto-release { padding: 20px 16px; border-radius: var(--radius); }
.booking {
  position: relative;
  isolation: isolate;
  color: #fff;
  background: #161615;
}
.booking::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 30%;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: linear-gradient(90deg, #161615, transparent 48%),
    url("assets/library-booking.webp") right center / cover no-repeat;
}
.booking h2, .auto-release h2 { font-size: 21px; }
.booking a {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  max-width: 100%;
  min-height: 52px;
  margin-top: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.booking a:hover { background: #b4ff77; }
.auto-release { background: #f3fbed; }
.release-diagram { display: flex; align-items: center; gap: 12px; margin-block: 8px; font-size: 19px; }
.auto-release p, .seat-steps p, .etiquette, .help { color: #333; font-size: 13.5px; line-height: 1.2; }
.accordions { display: grid; gap: 6px; }
.accordions details { background: var(--surface); border-radius: var(--radius); }
.accordions summary {
  display: flex;
  min-height: 56px;
  align-items: center;
  gap: 5px;
  padding: 12px;
  border-radius: var(--radius);
  font-weight: 700;
  list-style: none;
}
.accordions summary::-webkit-details-marker { display: none; }
.accordions summary::after {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  margin-inline-start: auto;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
}
.accordions details[open] summary::after { background-size: 100% 2px, 0 0; }
.seat-steps { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0 12px 16px; }
.seat-steps li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 10px;
  background: #fff;
  color: #333;
}
.step-number { font-size: 40px; font-weight: 700; text-align: center; }
.seat-steps p { margin-top: 4px; }
.etiquette { margin: 0; padding: 0 16px 16px 32px; }
.help { padding: 0 12px 16px; overflow-wrap: anywhere; }
.help a { color: inherit; }

@media (width < 1024px) {
  .page-width { padding-inline: 16px; }
  .page-header { padding-block: 16px; }
  .page-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-block: 16px; }
  .availability { padding: 16px; }
  .availability-controls { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .availability h2 { font-size: 22px; }
  .availability-heading p { font-size: 14px; }
  .snapshot-status { font-size: 16px; }
  .legend { display: block; margin-block: 16px; padding: 0; }
  .legend ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
  .legend li { gap: 8px; }
  .legend .swatch { margin-inline: 4px; }
  .map-card { padding: 10px; }
  .map-viewport { touch-action: pan-y; }
  .map-viewport[data-zoomed="true"] { touch-action: none; cursor: grab; }
  .map-viewport[data-zoomed="true"]:active { cursor: grabbing; }
  .map-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 8px;
    padding: 4px;
    border: 1px solid #c9c9c9;
    border-radius: 10px;
    background: rgb(255 255 255 / 94%);
    box-shadow: 0 1px 5px rgb(0 0 0 / 18%);
  }
  .map-controls button {
    min-width: 44px;
    min-height: 44px;
    padding: 4px 8px;
    border: 1px solid #aeb5b2;
    border-radius: 7px;
    background: #fff;
    color: #191b1b;
    font-weight: 700;
  }
  .map-controls button:disabled { cursor: default; opacity: .5; }
  .map-controls button:focus-visible { outline-color: #1867b9; }
  .map-controls output { min-width: 38px; text-align: center; font-size: 13px; font-weight: 700; }
  .guidance { gap: 16px; }
  .booking { padding-block: 16px; }
  .booking h2, .auto-release h2 { font-size: 17px; }
  .accordions summary, .seat-steps strong { font-size: 14px; }
  .auto-release p, .seat-steps p, .etiquette, .help { font-size: 13px; }
  .step-number { font-size: 32px; }
}
