/* ─── Calendar Book button ─── */
#book-btn {
  padding: 6px 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(44, 78, 138, .25);
  color: var(--text);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

#book-btn:hover {
  background: rgba(44, 78, 138, .45);
}

#book-count {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 18px;
  text-align: center;
  margin-left: 2px;
}

/* ─── Calendar Book overlay / panel ─── */
#book-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 15, 35, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2050;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}

#book-overlay.open {
  opacity: 1;
  pointer-events: all;
}

#book-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(94vw, 860px);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  overflow: hidden;
}

#book-panel-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

#book-panel-hdr h2 {
  font-size: .95rem;
  font-weight: 700;
  flex: 1;
}

#book-panel-meta {
  font-size: .7rem;
  color: var(--text-dim);
}

#book-panel-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color .15s;
}

#book-panel-close:hover {
  color: var(--text);
}

#book-download-btn {
  padding: 6px 12px;
  background: rgba(255, 95, 5, .15);
  border: 1px solid rgba(255, 95, 5, .4);
  color: var(--accent);
  border-radius: 6px;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 600;
  transition: all .15s;
}

#book-download-btn:hover {
  background: rgba(255, 95, 5, .25);
  border-color: rgba(255, 95, 5, .6);
}

#book-day-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
}

#book-day-tabs::-webkit-scrollbar {
  display: none;
}

#book-schedule {
  overflow-y: auto;
  flex: 1;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#book-schedule::-webkit-scrollbar {
  width: 4px;
}

#book-schedule::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.book-clear-btn {
  padding: 5px 13px;
  border-radius: 8px;
  border: 1px solid rgba(255, 95, 5, .4);
  background: rgba(255, 95, 5, .08);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.book-clear-btn:hover {
  background: rgba(255, 95, 5, .18);
}

/* Shift sidebar & zoom controls up when sim bar is visible */
body.sim-active #sidebar {
  transform: translateY(calc(-50% - 44px));
  transition: transform .35s ease;
}

body.sim-active #zoom-controls {
  bottom: 78px;
  transition: bottom .35s ease;
}

#sidebar {
  transition: transform .35s ease;
}

#zoom-controls {
  transition: bottom .35s ease;
}
