/* ═══════════════════════════════════════════════════════════
   Booking, manage and operator pages.
   Loaded after css/style.css: reuses its tokens, type and buttons.
   ═══════════════════════════════════════════════════════════ */

.bk-body { background: var(--bg); }
.bk-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── Header ──────────────────────────────────────────────── */
.bk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gutter);
  border-bottom: 1px solid var(--line);
}
.bk-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
}
.bk-brand img { width: 2.4rem; height: auto; }
.bk-header nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.bk-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.bk-header nav a:hover, .bk-header nav a[aria-current="page"] { color: var(--text); }
.bk-header nav a[hidden] { display: none; }

/* ── Page frame ──────────────────────────────────────────── */
.bk-main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 6rem;
}
.bk-main.bk-wide { max-width: 76rem; }
.bk-main .eyebrow { margin-bottom: 1rem; }
.bk-title {
  font-family: var(--font-display);
  font-weight: 480;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.bk-lead {
  color: var(--muted);
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  margin-top: 0.8rem;
  max-width: 56ch;
}
.bk-location { margin-top: 1rem; padding: 0.8rem 1rem; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 0.6rem; }
.bk-location p + p { margin-top: 0.3rem; color: var(--muted); }
.bk-location a, .bk-footer p + p { overflow-wrap: anywhere; }
.bk-footer p + p { margin-top: 0.5rem; }
.bk-lead a, .bk-location a, .bk-contact-line a, .bk-notice a, .bk-hint a, .bk-card a:not(.btn-submit):not(.btn-book) {
  color: var(--text);
}

/* Focus: visible on every interactive element on these pages */
.bk-body a:focus-visible,
.bk-body button:focus-visible,
.bk-body input:focus-visible,
.bk-body textarea:focus-visible,
.bk-body select:focus-visible,
.bk-body summary:focus-visible,
.bk-body [tabindex="-1"]:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}
.bk-body [tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

/* ── Steps ───────────────────────────────────────────────── */
.bk-step {
  margin-top: 2.2rem;
  padding: 1.6rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
}
/* Time step before dog type and service are chosen (hint text explains why) */
.bk-step-inactive { border-style: dashed; }
.bk-step-head { display: flex; align-items: baseline; gap: 0.8rem; margin-bottom: 1.2rem; }
.bk-step-head .index { flex: none; }
.bk-step-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* ── Fields ──────────────────────────────────────────────── */
.bk-field { margin-top: 1.2rem; }
.bk-field:first-child { margin-top: 0; }
.bk-field > label, .bk-legend {
  display: block;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.bk-req { color: var(--muted); font-weight: 380; }
.bk-hint { color: var(--muted); font-size: 0.92rem; margin: -0.1rem 0 0.5rem; }
.bk-field input[type="text"],
.bk-field input[type="email"],
.bk-field input[type="tel"],
.bk-field input[type="number"],
.bk-field input[type="date"],
.bk-field input[type="time"],
.bk-field textarea {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  border: 1px solid #8a8a8a;
  border-radius: 0.6rem;
}
.bk-field textarea { min-height: 6rem; resize: vertical; }
.bk-field input[readonly] { background: var(--bg); color: var(--muted); }
.bk-field input[aria-invalid="true"], .bk-field textarea[aria-invalid="true"] {
  border: 2px solid var(--accent);
}
.bk-field-short input { max-width: 10rem; }
.bk-field-error {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
  color: var(--accent);
  font-weight: 500;
  font-size: 0.95rem;
}
.bk-field-error::before { content: "!"; content: "!" / ""; font-weight: 700; }

fieldset.bk-field { border: 0; padding: 0; min-width: 0; }
.bk-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.6rem; }
/* Two short answers (Dog / Cat) stay side by side, even on a narrow phone */
.bk-choices-inline { grid-template-columns: repeat(auto-fill, minmax(min(9rem, 40%), 1fr)); max-width: 26rem; }
.bk-reload { margin-bottom: 1.5rem; }
.bk-choice { position: relative; }
.bk-choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.bk-choice span {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 2.9rem;
  padding: 0.65rem 0.9rem;
  background: #fff;
  border: 1px solid #8a8a8a;
  border-radius: 0.6rem;
  line-height: 1.3;
}
.bk-choice span::before {
  content: "";
  flex: none;
  width: 1.05rem; height: 1.05rem;
  border: 1.5px solid #575757;
  border-radius: 50%;
}
.bk-choice input[type="checkbox"] + span::before { border-radius: 0.25rem; }
.bk-choice input:checked + span { border: 2px solid var(--text); padding: calc(0.65rem - 1px) calc(0.9rem - 1px); }
.bk-choice input:checked + span::before {
  background: var(--text);
  box-shadow: inset 0 0 0 3px #fff;
  border-color: var(--text);
}
.bk-choice input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 3px; }
.bk-choice input:disabled + span { opacity: 0.5; cursor: not-allowed; }
/* Secondary line inside a choice, e.g. what "Doodle or poodle mix" includes */
.bk-choice span.bk-choice-noted { flex-wrap: wrap; row-gap: 0.15rem; }
.bk-choice small { flex-basis: 100%; padding-left: 1.75rem; font-size: 0.85em; color: var(--muted); line-height: 1.35; }
.bk-check { margin-top: 1.2rem; }
.bk-check .bk-choice span { background: transparent; border-color: transparent; padding-left: 0; }
.bk-check .bk-choice input:checked + span { border-color: transparent; padding: 0.65rem 0.9rem 0.65rem 0; }

/* ── Days and times ──────────────────────────────────────── */
.bk-day-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.8rem; }
.bk-days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; }
.bk-days .bk-choice span { flex-direction: column; align-items: flex-start; gap: 0.1rem; padding: 0.6rem; font-size: 0.92rem; }
.bk-days .bk-choice span::before { display: none; }
.bk-days .bk-choice input:checked + span { padding: calc(0.6rem - 1px); }
.bk-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 0.5rem; margin-top: 1rem; }
.bk-slots .bk-choice span { justify-content: center; font-variant-numeric: tabular-nums; }
.bk-slots .bk-choice span::before { display: none; }
.bk-slot-meta { color: var(--muted); font-size: 0.95rem; margin-top: 1rem; }

/* ── Buttons and links ───────────────────────────────────── */
.bk-btn { min-height: 2.9rem; text-decoration: none; justify-content: center; }
.bk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-top: 1.4rem; }
.bk-link-btn {
  background: none;
  border: 0;
  padding: 0.6rem 0;
  font: inherit;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
  min-height: 2.75rem;
}
.bk-link-btn:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.bk-small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.95rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  border: 1px solid #8a8a8a;
  border-radius: 0.6rem;
  text-decoration: none;
  cursor: pointer;
}
.bk-small-btn:hover { border-color: var(--text); }
.bk-small-btn.bk-danger { color: var(--accent); border-color: var(--accent); }
.bk-small-btn:disabled { opacity: 0.5; cursor: default; }
.bk-countdown { color: var(--muted); font-size: 0.92rem; }
.bk-auth-links { margin-top: 0.8rem; }

/* ── Notices ─────────────────────────────────────────────── */
.bk-notice {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 0.6rem;
  border: 1px solid var(--line);
  background: #fff;
  border-left-width: 4px;
}
.bk-notice p + p { margin-top: 0.4rem; }
.bk-notice-info { border-left-color: #575757; }
.bk-notice-warn { border-left-color: #8a6100; }
.bk-notice-error { border-left-color: var(--accent); }
.bk-notice-success { border-left-color: #2f6b3a; }
.bk-summary {
  margin-top: 1.4rem;
  padding: 1rem 1.1rem;
  border: 2px solid var(--accent);
  border-radius: 0.6rem;
  background: #fff;
}
.bk-summary-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.4rem; }
.bk-summary ul { padding-left: 1.2rem; }
.bk-summary a { color: var(--accent); font-weight: 500; }

/* ── Review / details lists ──────────────────────────────── */
.bk-dl { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr; gap: 0.5rem 1rem; }
.bk-dl dt { color: var(--muted); }
.bk-dl dd { color: var(--text); overflow-wrap: anywhere; }
/* Customer-entered multiline text (care information), shown as typed */
.bk-multiline { white-space: pre-wrap; }

/* ── Cards (manage + operator) ───────────────────────────── */
.bk-list { list-style: none; display: grid; gap: 1rem; margin-top: 1rem; }
.bk-card {
  padding: 1.3rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
}
.bk-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.4rem 1rem; }
.bk-card-title { font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; line-height: 1.25; }
.bk-card-sub { color: var(--muted); margin-top: 0.2rem; }
.bk-card .bk-dl { margin-top: 1rem; }
.bk-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border: 1px solid currentColor;
  border-radius: 2rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.bk-badge-ok { color: #2f6b3a; }
.bk-badge-warn { color: #8a6100; }
.bk-badge-bad { color: var(--accent); }
.bk-badge-muted { color: #575757; }
/* Cat/Dog marker on staff cards: cats are filled so they stand out at a glance */
.op-species { color: var(--text); }
.op-species-cat { background: var(--text); color: var(--bg); border-color: var(--text); }
.bk-panel { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.bk-directions { white-space: pre-wrap; margin-top: 0.5rem; }
.bk-section-title { font-family: var(--font-display); font-weight: 500; font-size: 1.35rem; margin-top: 2.4rem; }

/* ── Operator layout ─────────────────────────────────────── */
.op-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.8rem; margin-top: 1.4rem; }
.op-toolbar .bk-field { margin-top: 0; }
.op-status { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; margin-top: 1rem; }
.op-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2rem; align-items: start; margin-top: 1.4rem; }
.op-block { background: transparent; border-style: dashed; }
.op-contact { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.op-delivery { display: grid; gap: 0.35rem; margin-top: 1rem; font-size: 0.95rem; }
.op-requests { list-style: none; display: grid; gap: 0.6rem; }
.op-request { white-space: pre-wrap; overflow-wrap: anywhere; }
.bk-card.op-linked { border: 2px solid var(--text); }
.op-followups { margin-top: 1rem; }
/* Follow-ups: filter chips, the "when" line and contact prompt */
.fu-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.4rem; }
.fu-chip[aria-pressed="true"] { border: 2px solid var(--text); padding: calc(0.5rem - 1px) calc(0.95rem - 1px); font-weight: 600; }
.fu-count { min-width: 1.6rem; padding: 0 0.4rem; border-radius: 2rem; background: var(--bg); font-variant-numeric: tabular-nums; text-align: center; }
.fu-when { margin-top: 0.6rem; font-weight: 500; }
.fu-also { font-weight: 380; }
.fu-actions { margin-top: 1rem; gap: 0.5rem; }
.fu-nudge { margin-top: 0.6rem; }
.op-account { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; margin-top: 1rem; }
/* Staff authenticator setup: shown once, on a private screen */
.op-secret {
  display: inline-block;
  padding: 0.5rem 0.7rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}
.op-codes {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.4rem 1rem;
  margin: 0.8rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ── Preview bar (non-production only) ───────────────────── */
.bk-preview {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  padding: 0.25rem var(--gutter);
  background: #0b0b0b;
  color: #ebebeb;
  font-size: 0.88rem;
}
.bk-preview-line { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.bk-preview-line p { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-preview-details { padding: 0.4rem 0 0.6rem; display: grid; gap: 0.5rem; }
/* The grid display above would otherwise override the hidden attribute */
.bk-preview-details[hidden] { display: none; }
.bk-preview-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bk-preview-btn {
  min-height: 2.75rem;
  padding: 0.4rem 0.8rem;
  font: inherit;
  color: #ebebeb;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 0.5rem;
  cursor: pointer;
}
.bk-preview-btn:focus-visible { outline: 2px solid #ebebeb; outline-offset: 2px; }
body.has-preview-bar .bk-main { padding-bottom: 5rem; }
body.has-preview-bar .bk-footer { padding-bottom: 4.5rem; }

.bk-dialog {
  width: min(40rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--bg-soft);
  color: var(--text);
}
.bk-dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
.bk-mailbox-list { display: grid; gap: 0.8rem; margin: 1rem 0; }
.bk-mail { padding: 0.8rem; background: #fff; border: 1px solid var(--line); border-radius: 0.6rem; }
.bk-mail-meta { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.bk-mail-subject { font-weight: 600; margin-top: 0.2rem; }
.bk-mail-body { white-space: pre-wrap; font: inherit; font-size: 0.92rem; margin-top: 0.4rem; overflow-wrap: anywhere; }

/* ── Footer ──────────────────────────────────────────────── */
.bk-footer {
  padding: 2rem var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}
.bk-footer a { color: var(--text); }

/* ── Small screens / large text ──────────────────────────── */
@media (max-width: 52em) {
  .op-grid { grid-template-columns: 1fr; }
}
@media (max-width: 36em) {
  .bk-step { padding: 1.1rem; }
  .bk-days { grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); }
  .bk-dl { grid-template-columns: 1fr; gap: 0.1rem; }
  .bk-dl dd { margin-bottom: 0.6rem; }
  .bk-actions > .btn-submit, .bk-actions > .btn-book { width: 100%; }
  .bk-header nav { gap: 0.2rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bk-body * { transition: none !important; animation: none !important; }
}
