/* foundry-booking-kit panel. Theme it by setting these on :root or .fb-panel:
 *   --fb-bg --fb-ink --fb-muted --fb-line --fb-accent --fb-accent-ink
 *   --fb-font-body --fb-font-display --fb-radius --fb-panel-width
 * Defaults are deliberately neutral.
 */
.fb-panel {
  --_bg: var(--fb-bg, #ffffff);
  --_ink: var(--fb-ink, #1b1b1b);
  --_muted: var(--fb-muted, #5f5f5f);
  --_line: var(--fb-line, #d9d9d9);
  --_accent: var(--fb-accent, #1b1b1b);
  --_accent-ink: var(--fb-accent-ink, #ffffff);
  --_body: var(--fb-font-body, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  --_display: var(--fb-font-display, var(--fb-font-body, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif));
  --_radius: var(--fb-radius, 6px);
  --_width: var(--fb-panel-width, 440px);
}

html.fb-open { overflow: hidden; }

.fb-root[hidden] { display: none !important; }
.fb-root { position: fixed; inset: 0; z-index: 2147483000; }

.fb-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0; transition: opacity 0.25s ease;
}
.fb-is-open .fb-backdrop { opacity: 1; }

.fb-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(var(--_width), 100vw);
  display: flex; flex-direction: column;
  background: var(--_bg); color: var(--_ink);
  font-family: var(--_body); font-size: 16px; line-height: 1.5;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
  overflow-y: auto; overscroll-behavior: contain;
  outline: none;
  box-sizing: border-box;
}
.fb-panel *, .fb-panel *::before, .fb-panel *::after { box-sizing: border-box; }
.fb-is-open .fb-panel { transform: translateX(0); }

@media (max-width: 639.98px) {
  .fb-panel { width: 100vw; left: 0; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fb-panel, .fb-backdrop, .fb-progress-bar { transition: none !important; }
}

.fb-head {
  position: sticky; top: 0; z-index: 1;
  display: grid; grid-template-columns: 5rem 1fr 5rem; align-items: center;
  padding: 0.75rem 1rem; background: var(--_bg); border-bottom: 1px solid var(--_line);
}
.fb-title {
  grid-column: 2; margin: 0; text-align: center;
  font-family: var(--_display); font-size: 1.25rem; font-weight: 500; line-height: 1.2;
}
.fb-back, .fb-close {
  appearance: none; border: 0; background: none; color: var(--_ink); font: inherit; cursor: pointer;
  min-height: 44px; min-width: 44px; padding: 0 0.25rem; border-radius: var(--_radius);
}
.fb-back { grid-column: 1; justify-self: start; text-decoration: underline; text-underline-offset: 3px; }
.fb-back::before { content: "\2039\00a0"; }
.fb-back[hidden] { visibility: hidden; display: block; }
.fb-close { grid-column: 3; justify-self: end; font-size: 1.75rem; line-height: 1; }

.fb-progress { height: 3px; background: var(--_line); }
.fb-progress-bar { height: 100%; width: 0; background: var(--_accent); transition: width 0.3s ease; }
.fb-step-label { margin: 0.75rem 1.25rem 0; font-size: 0.8125rem; color: var(--_muted); letter-spacing: 0.02em; }
.fb-step-label:empty { display: none; }

.fb-alert {
  margin: 0.75rem 1.25rem 0; padding: 0.75rem 1rem;
  border: 1px solid currentColor; border-left-width: 4px; border-radius: var(--_radius);
  font-weight: 500;
}
.fb-alert::before { content: "! "; font-weight: 700; }
.fb-alert[hidden], .fb-alert:empty { display: none; }

.fb-body { padding: 1rem 1.25rem 2rem; flex: 1; }

.fb-sr, .fb-hp {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.fb-note { margin: 0 0 1rem; color: var(--_muted); }
.fb-note a { color: var(--_ink); font-weight: 600; }
.fb-fineprint { margin: 1rem 0 0; font-size: 0.8125rem; color: var(--_muted); }
.fb-loading { color: var(--_muted); }

.fb-group + .fb-group { margin-top: 1.5rem; }
.fb-group-title {
  margin: 0 0 0.5rem; font-family: var(--_display); font-weight: 500; font-size: 1.0625rem;
}
.fb-list, .fb-times { list-style: none; margin: 0; padding: 0; }
.fb-list { display: grid; gap: 0.5rem; }

.fb-option {
  appearance: none; display: flex; flex-direction: column; gap: 0.125rem; width: 100%;
  padding: 0.875rem 1rem; text-align: left; cursor: pointer;
  background: var(--_bg); color: var(--_ink); font: inherit;
  border: 1px solid var(--_line); border-radius: var(--_radius);
}
.fb-option:hover { border-color: var(--_ink); }
.fb-option[aria-pressed="true"] { border: 2px solid var(--_accent); padding: calc(0.875rem - 1px) calc(1rem - 1px); }
.fb-option[aria-pressed="true"] .fb-option-name::after { content: "  \2713"; }
.fb-option-name { font-weight: 600; }
.fb-option-meta { font-size: 0.875rem; }
.fb-option-desc, .fb-option-tag { font-size: 0.875rem; color: var(--_muted); }
.fb-option-tag { font-style: italic; }

.fb-staff { flex-direction: row; align-items: center; gap: 0.875rem; }
.fb-option-text { display: flex; flex-direction: column; gap: 0.125rem; }
.fb-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
.fb-avatar-blank {
  display: grid; place-items: center; background: var(--_line); color: var(--_ink);
  font-family: var(--_display); font-size: 1.25rem;
}

.fb-week-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; }
.fb-week-range { font-weight: 600; font-size: 0.9375rem; }
.fb-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.25rem; margin-bottom: 1.25rem; }
.fb-day {
  appearance: none; display: flex; flex-direction: column; align-items: center; gap: 0.125rem;
  min-height: 72px; padding: 0.5rem 0.125rem; cursor: pointer; font: inherit;
  background: var(--_bg); color: var(--_ink);
  border: 1px solid var(--_line); border-radius: var(--_radius);
}
.fb-day:hover:not([disabled]) { border-color: var(--_ink); }
.fb-day[disabled] { cursor: not-allowed; color: var(--_muted); opacity: 0.55; border-style: dashed; }
.fb-day[disabled] .fb-day-num { text-decoration: line-through; }
.fb-day[aria-pressed="true"] { background: var(--_accent); color: var(--_accent-ink); border-color: var(--_accent); }
.fb-day-name { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.fb-day-num { font-size: 1.125rem; font-weight: 600; }
.fb-day-state { font-size: 0.625rem; }

.fb-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: 0.5rem; }
.fb-time {
  appearance: none; width: 100%; min-height: 44px; cursor: pointer; font: inherit; font-variant-numeric: tabular-nums;
  background: var(--_bg); color: var(--_ink); border: 1px solid var(--_line); border-radius: var(--_radius);
}
.fb-time:hover { border-color: var(--_ink); }

.fb-summary {
  display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; margin: 0 0 1.25rem;
  padding: 0.875rem 1rem; border: 1px solid var(--_line); border-radius: var(--_radius); font-size: 0.9375rem;
}
.fb-summary dt { color: var(--_muted); }
.fb-summary dd { margin: 0; font-weight: 500; }

.fb-form { display: grid; gap: 1rem; }
.fb-form .fb-summary { margin: 0; }
.fb-field { display: grid; gap: 0.375rem; }
.fb-label { font-weight: 600; font-size: 0.9375rem; }
.fb-optional { font-weight: 400; color: var(--_muted); }
.fb-input {
  width: 100%; min-height: 44px; padding: 0.625rem 0.75rem; font: inherit; color: var(--_ink);
  background: var(--_bg); border: 1px solid var(--_line); border-radius: var(--_radius);
}
textarea.fb-input { resize: vertical; }
.fb-input:focus { border-color: var(--_ink); }
.fb-input[aria-invalid="true"] { border: 2px solid currentColor; }

.fb-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.25rem; cursor: pointer; font: inherit; font-weight: 600;
  border-radius: var(--_radius); border: 1px solid var(--_accent); text-decoration: none;
}
.fb-btn[disabled] { cursor: not-allowed; opacity: 0.5; }
.fb-btn-primary { width: 100%; background: var(--_accent); color: var(--_accent-ink); margin-top: 0.5rem; }
.fb-btn-secondary { width: 100%; background: transparent; color: var(--_ink); margin-top: 0.5rem; }
.fb-btn-quiet { min-height: 44px; padding: 0 0.5rem; border-color: transparent; background: none; color: var(--_ink); font-weight: 500; }
.fb-btn-quiet:not([disabled]):hover { text-decoration: underline; }
.fb-btn-primary[aria-busy="true"]::after { content: "\2026"; }

.fb-done-title { margin: 0.5rem 0 1rem; font-family: var(--_display); font-size: 1.75rem; font-weight: 500; outline: none; }

.fb-panel :focus-visible { outline: 2px solid var(--_accent); outline-offset: 2px; }
.fb-day[aria-pressed="true"]:focus-visible { outline-color: var(--_ink); }
