/* Stone Surgeons CRM — the booking sidebar (book-panel.js, Nov 24 2026). Slides in from the right edge: about 17% of the
   screen on a computer (never under 360 px), the whole screen on a phone. Flat look; the theme tokens (glass.css,
   glass-dark.css) carry dark mode. */
.bp { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1400; width: max(360px, 17vw); max-width: 100vw;
  display: flex; flex-direction: column; background: var(--surface, #fff); color: var(--text, #141a21);
  border-left: 1px solid var(--border, #e2e6eb); box-shadow: var(--shadow-2, 0 8px 24px rgba(7, 26, 46, .14));
  transform: translateX(100%); transition: transform .22s ease; }
.bp.on { transform: none; }
.bp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 12px 16px;
  border-bottom: 1px solid var(--border, #e2e6eb); }
.bp-head h3 { margin: 0; font-size: 1.05rem; }
.bp-x { width: 36px; height: 36px; border: 1px solid var(--border, #e2e6eb); border-radius: 8px; background: var(--surface-2, #f1f3f6);
  color: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.bp-form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bp-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 18px; display: grid; gap: 14px; align-content: start; }
.bp-who { margin: 0; font-size: .95rem; color: var(--text-2, #4a5562); overflow-wrap: anywhere; }
.bp-who strong { color: var(--text, #141a21); }
.bp-sec { display: grid; gap: 6px; min-width: 0; }
.bp-sec[hidden] { display: none; }
.bp-lab { margin: 0; font-size: .78rem; font-weight: 700; color: var(--text-2, #4a5562); }
.bp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bp-two { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.bp-acts { display: flex; justify-content: flex-end; gap: 6px; }
.bp .in { padding: 9px 10px; }
.bp textarea.in { min-height: 64px; }

/* the month */
.bp-cal { border: 1px solid var(--border, #e2e6eb); border-radius: 10px; padding: 8px; }
.bp-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.bp-cal-t { font-size: .92rem; }
.bp-nav { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 1.25rem; cursor: pointer; }
.bp-nav:hover { background: var(--surface-2, #f1f3f6); }
.bp-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.bp-dow { font-size: .7rem; font-weight: 700; color: var(--text-3, #6b7683); padding: 2px 0 4px; }
.bp-day { aspect-ratio: 1; min-height: 32px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: inherit;
  font: inherit; font-size: .88rem; cursor: pointer; }
.bp-day:hover:not([disabled]) { background: var(--surface-2, #f1f3f6); }
.bp-day.today { border-color: var(--border-strong, #c9d0d8); font-weight: 700; }
.bp-day.on, .bp-day.on:hover:not([disabled]) { background: var(--primary, #0b2a4a); border-color: var(--primary, #0b2a4a); color: var(--primary-contrast, #fff); font-weight: 700; }
.bp-day[disabled] { color: var(--text-3, #6b7683); opacity: .45; cursor: default; }

/* the times: every 15 minutes */
.bp-times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 232px; overflow-y: auto; padding: 1px; }
.bp-time { display: grid; padding: 8px 4px; border: 1px solid var(--border, #e2e6eb); border-radius: 8px; background: var(--surface, #fff);
  color: inherit; font: inherit; font-size: .85rem; cursor: pointer; }
.bp-time:hover:not([disabled]) { border-color: var(--border-strong, #c9d0d8); }
.bp-time.on { background: var(--primary, #0b2a4a); border-color: var(--primary, #0b2a4a); color: var(--primary-contrast, #fff); font-weight: 700; }
.bp-time.busy:not(.on) { border-color: var(--warning-line, #e8c98a); background: var(--warning-bg, #fdf6e7); }
.bp-time small { font-size: .68rem; font-weight: 700; }
.bp-time[disabled] { opacity: .4; cursor: default; }

/* people + e-mails */
.bp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bp-chips:empty { display: none; }
.bp-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 4px 3px 10px; border: 1px solid var(--border, #e2e6eb);
  border-radius: 999px; background: var(--surface-2, #f1f3f6); font-size: .82rem; overflow-wrap: anywhere; }
.bp-chip button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1rem; line-height: 1; cursor: pointer; }
.bp-chip button:hover { background: var(--border, #e2e6eb); }
.bp-check { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.bp-check input { width: 18px; height: 18px; }

/* presets (owners) */
.bp-presets-edit { display: grid; gap: 10px; margin-top: 6px; padding: 10px; border: 1px dashed var(--border-strong, #c9d0d8); border-radius: 10px; }
.bp-preset-row { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--border, #e2e6eb); }

.bp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border, #e2e6eb); background: var(--surface, #fff); }
.bp-msg { flex: 1 1 100%; margin: 0; }
.bp-msg:empty { display: none; }

@media (max-width: 700px) {
  .bp { width: 100vw; border-left: 0; box-shadow: none; }
  .bp-times { grid-template-columns: repeat(4, 1fr); max-height: 260px; }
  .bp-foot .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .bp { transition: none; } }
@media print { .bp { display: none; } }
