/* ── Booking Sheet Component ──────────────────────
   Bottom sheet dialog positioning + all booking form styles.
   ──────────────────────────────────────────────────── */

/* Dialog-based bottom sheet — only style when [open] to not override UA display:none */
dialog.booking-sheet[open] {
  position: fixed;
  inset: auto 0 0 0;
  margin: 0;
  height: min(88dvh, 680px);
  max-height: calc(100dvh - max(env(safe-area-inset-top, 0px), 8px));
  width: 100%;
  max-width: 100%;
  border: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 0;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
}
dialog.booking-sheet::backdrop {
  background: rgba(0,0,0,0.3);
}

/* Legacy #booking-sheet styles — display:flex only when open to not override UA display:none */
#booking-sheet[open] {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  padding: 14px 18px 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  height: min(88vh, 680px);
  height: min(88dvh, 680px);
  max-height: calc(100dvh - max(env(safe-area-inset-top, 0px), 8px));
  display: flex;
  flex-direction: column;
  animation: plusSlideUp var(--duration-normal) var(--easing-standard);
  box-sizing: border-box;
}
.bs-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
/* .scroll-region-flex applied in HTML — iOS Safari touch scroll safe */
.bs-body {
  flex: 1;
  min-height: 0;
  padding-bottom: 4px;
}
.bs-title { font-size: 17px; font-weight: 700; line-height: 1.3; flex: 1; text-align: center; }
.bs-header-btn {
  width: 44px; height: 44px; background: none; border: none;
  cursor: pointer; color: var(--color-text-secondary);
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  margin: -8px;
}
.bs-header-btn:active {
  background: var(--color-surface-hover);
  color: var(--color-brand);
}
.bs-identity {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}
.bs-fields {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 24px;
  margin-bottom: 10px;
}
.bs-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bs-field-full { grid-column: 1 / -1; }
.bs-field-label {
  font-size: 12px; line-height: 1.2; color: var(--color-text-secondary);
  letter-spacing: 0;
}
.bs-input {
  font-size: 16px; line-height: 22px; font-weight: 600; width: 100%;
  min-width: 0;
  border: none; border-bottom: 1.5px solid var(--color-border);
  background: none; outline: none; padding: 4px 0 7px;
  font-family: inherit; color: var(--color-text-primary);
}
.bs-input:focus { border-bottom-color: var(--color-brand); }
select.bs-input { appearance: none; }
.bs-price-input {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  border-bottom: 1.5px solid var(--color-border);
}
.bs-price-input:focus-within { border-bottom-color: var(--color-brand); }
.bs-price-input .bs-input {
  border-bottom: none;
  padding-bottom: 7px;
}
.bs-unit {
  flex-shrink: 0;
  padding-bottom: 8px;
  font-size: 15px;
  line-height: 20px;
  color: var(--color-text-secondary);
}
.bs-customer {
  margin-top: 10px; padding: 10px 12px;
  font-size: 13px;
  background: var(--color-bg, #f5f5f0);
  border-radius: var(--radius-md, 8px);
}
.bs-customer:empty { display: none; }
.bs-customer-match { color: var(--status-confirmed, #10b981); font-weight: 500; }
.bs-candidate {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
  padding: 10px 0; cursor: pointer;
  border-bottom: 0.5px solid var(--color-border);
}
.bs-candidate-name { font-weight: 600; }
.bs-candidate-meta {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--color-text-secondary);
}
.bs-muted { color: var(--color-text-secondary); }
.bs-candidate:last-child { border-bottom: none; }
.bs-candidate:active { opacity: 0.7; }
.bs-new-customer {
  background: var(--color-bg, #f5f5f0);
  border-radius: var(--radius-md, 8px);
  padding: var(--space-3);
  display: flex; flex-direction: column; gap: 8px;
}
.bs-unlink {
  border: none; background: none; font-size: 12px;
  color: var(--color-text-tertiary); cursor: pointer;
  text-decoration: underline; margin-left: 8px;
}
.bs-confirm {
  width: 100%; min-height: 48px; margin-top: 10px; padding: 11px;
  flex-shrink: 0;
  background: var(--color-brand); color: #fff;
  border: none; border-radius: var(--radius-lg);
  font-size: 16px; font-weight: 700; cursor: pointer;
}
.bs-confirm:active { opacity: 0.85; }
.bs-confirm:disabled { opacity: 0.4; cursor: not-allowed; }
