body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: #f7f7f7;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

#flipbook {
  background: #fff;
  padding: 24px 16px 12px 16px;
  border-radius: 18px;
  box-shadow: 0 4px 18px 0 #0001;
  max-width: 950px;
  margin: 36px auto 24px auto;
  border: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  align-items: center;
}

label[for="pdf-chooser"] {
  font-weight: 600;
  margin-right: 8px;
  font-size: 1.1em;
}

#pdf-chooser {
  font-size: 1em;
  padding: 0.3em 0.7em;
  margin: 0 0 0.4em 0;
  border-radius: 7px;
  border: 1px solid #ccc;
}

.links-bar {
  margin: 0.5em 0 0.8em 0;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.links-bar a {
  background: #f2f2ff;
  border: 1px solid #d4d2ed;
  border-radius: 7px;
  padding: 0.38em 1.1em;
  font-size: 0.99em;
  text-decoration: none;
  color: #38417c;
  transition: background 0.18s, box-shadow 0.14s;
}

.links-bar a:hover {
  background: #e8e6fd;
  box-shadow: 0 2px 8px #d4d2ed44;
}

.directions {
  font-size: 1.08em;
  color: #2c2c40;
  margin: 0.4em 0 1em 0;
}

#spread {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
  min-height: 540px;
  min-width: 350px;
}

.page-canvas {
  width: 420px;
  max-width: 48vw;
  min-width: 180px;
  height: auto;
  background: #fff;
  box-shadow: 0 2px 8px #ccc;
  border-radius: 9px;
  display: block;
}

.controls {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 4px;
  margin-bottom: 2px;
}

.controls button {
  font-size: 1.13em;
  padding: 0.35em 1.3em;
  background: #f1f2fc;
  border: 1px solid #bbb;
  border-radius: 7px;
  color: #2b2b4a;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s;
}

.controls button:hover {
  background: #e8eafd;
  border-color: #7a6fe6;
}

.controls span {
  font-size: 1em;
  color: #222;
}

#page-label-mobile {
  display: none;
}

#lightbox-modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(32, 30, 60, 0.87);
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

#lightbox-backdrop {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  background: transparent;
  z-index: 0;
}

#lightbox-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  gap: 14px;
  margin-bottom: 12px;
}

#lightbox-controls button {
  font-size: 1.09em;
  background: #f2f2ff;
  border: 1px solid #d4d2ed;
  border-radius: 7px;
  padding: 0.28em 0.8em;
  color: #444;
  cursor: pointer;
  margin: 0 2px;
}

#lightbox-controls button:hover {
  background: #e8e6fd;
}

#lightbox-label {
  font-size: 1.03em;
  color: #fff;
  margin: 0 12px;
}

#lightbox-canvas {
  border-radius: 8px;
  background: #fff;
  max-width: 95vw;
  max-height: 85vh;
  box-shadow: 0 6px 32px #0002;
  z-index: 2;
  display: block;
}

#bulletin-viewer-credit {
  font-size: 12px;
  color: #888;
  text-align: center;
  margin-top: 16px;
  font-family: inherit;
}

#bulletin-viewer-credit a {
  color: #666;
  text-decoration: underline;
}

@media (max-width: 1040px) {
  #flipbook {
    max-width: 99vw;
    margin: 22px auto 18px auto;
    padding: 14px 2vw 10px 2vw;
  }
  #spread {
    min-width: 0;
    gap: 4vw;
  }
  .page-canvas {
    max-width: 47vw;
    width: 47vw;
  }
}

@media (max-width: 700px) {
  body {
    background: #fff !important;
  }
  #flipbook {
    max-width: 99vw;
    margin: 8px auto 8px auto;
    padding: 4vw 2vw 2vw 2vw;
    border-radius: 10px;
    min-width: 0;
  }
  .links-bar {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    width: 100%;
  }
  .directions {
    font-size: 1em;
  }
  #spread {
    justify-content: center !important;
    gap: 0 !important;
    margin-bottom: 12px;
    min-width: 0 !important;
    min-height: 0 !important;
  }
  #left-page {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  #right-page {
    display: block !important;
    width: 98vw !important;
    max-width: 98vw !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    box-shadow: 0 2px 8px #ccc !important;
    border-radius: 8px !important;
  }
  .page-canvas {
    width: 98vw !important;
    max-width: 98vw !important;
    min-width: 0 !important;
    display: block !important;
    margin: 0 auto !important;
    border-radius: 8px !important;
  }
  .controls {
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 2px;
  }
  .controls button {
    width: 100%;
    font-size: 1.15em;
    padding: 0.8em 0.6em;
  }
  #page-label-desktop {
    display: none !important;
  }
  #page-label-mobile {
    display: block !important;
    text-align: center;
    margin: 0.8em 0 0.2em 0;
    font-size: 1.09em;
    color: #2c2c40;
    width: 100%;
    font-weight: 500;
  }
}
@media (min-width: 701px) {
  #page-label-mobile {
    display: none !important;
  }
  #page-label-desktop {
    display: inline;
  }
}
@media (max-width: 430px) {
  #flipbook {
    padding: 0.5vw 1vw 2vw 1vw;
    border-radius: 6px;
  }
  #lightbox-canvas {
    max-width: 99vw;
    max-height: 76vh;
  }
  .page-canvas {
    width: 98vw !important;
    max-width: 98vw !important;
    min-width: 0 !important;
  }
}
