/**
 * Group Booking Links admin (Stage D5)
 * See js/ui/team-booking-admin.js
 *
 * Scoped under .tba-* / .team-booking-modal so it doesn't leak into the app.
 * The overlay/scrim, fade animation and scroll-lock come from the canonical
 * `.modal` / `.modal-content` chrome (style.css) via Modal.open(); this file
 * only styles the panel's insides. Dark mode follows the app's explicit
 * `body.dark-mode` toggle, never the OS media query.
 */

.tba-modal-content {
  max-width: 680px;
  width: 100%;
}

/* ---------- Header ---------- */

.tba-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.tba-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tba-header-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--primary-600, #0d9488);
  background: var(--primary-50, rgba(20, 184, 166, 0.1));
}

.tba-header-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tba-header-text h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  line-height: 1.25;
}

.tba-header-sub {
  font-size: 0.75rem;
  color: var(--text-secondary, #64748b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The X is the shared .icon-button (2026-10-02, owner: group flows must
   close like every other modal). Only its place in the header row is set. */
.tba-close {
  flex: 0 0 auto;
}
/* The shared .icon-button rises 2px on hover; on the X that moved the target
   out from under a pointer resting on its lower edge, so the press began on
   the button and ended beside it - no click (2026-10-02). It stays put. */
.tba-close:hover,
.tba-close:active {
  transform: none;
}

body.dark-mode .tba-header { border-bottom-color: var(--slate-700, #334155); }
body.dark-mode .tba-header-text h2 { color: var(--slate-100, #f1f5f9); }
body.dark-mode .tba-header-icon {
  background: rgba(20, 184, 166, 0.16);
  color: var(--primary-400, #2dd4bf);
}

/* ---------- Body shell ---------- */

.tba-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 20px;
}

.tba-empty {
  padding: 32px 0;
  color: var(--text-secondary, #64748b);
  font-size: 0.875rem;
  text-align: center;
}

.tba-error {
  background: var(--danger-bg, #fef2f2);
  color: var(--danger-fg, #b91c1c);
  border: 1px solid var(--danger-border, #fecaca);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.tba-error-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

body.dark-mode .tba-error {
  background: rgba(153, 27, 27, 0.18);
  color: #fecaca;
  border-color: #7f1d1d;
}

/* ---------- Buttons ---------- */

/* 2026-09-23: buttons are the app's own (btn + btn-sm + btn-primary /
   btn-secondary / btn-ghost). This screen had a private .tba-btn family, one of
   three button styles across the booking tools. Only the red-text Delete
   modifier is local: the app's btn-danger is a solid red fill, too loud for one
   action among five on a card. */
.btn.tba-danger { color: var(--danger-fg, #b91c1c); }
.btn.tba-danger:hover { background: var(--danger-bg, #fef2f2); }
body.dark-mode .btn.tba-danger { color: #fca5a5; }
body.dark-mode .btn.tba-danger:hover { background: rgba(153, 27, 27, 0.25); }

/* Link-styled inline action (Everyone / No one). */
.tba-linklike {
  background: none;
  border: none;
  padding: 2px 4px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-600, #0d9488);
  cursor: pointer;
  border-radius: 4px;
}
.tba-linklike:hover { text-decoration: underline; }
body.dark-mode .tba-linklike { color: var(--primary-400, #2dd4bf); }

/* ---------- List view ---------- */

.tba-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.tba-intro {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary, #64748b);
  max-width: 40ch;
}

.tba-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tba-card {
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  background: var(--bg-primary, #fff);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tba-card:hover {
  border-color: var(--slate-300, #cbd5e1);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.tba-card--paused { opacity: 0.72; }

.tba-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tba-status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--slate-300, #cbd5e1);
}
.tba-status-dot.is-active {
  background: var(--primary-500, #14b8a6);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.tba-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary, #1e293b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tba-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.tba-chip--muted {
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-secondary, #64748b);
}
/* A request the host still has to answer (2026-10-02): outlined, so it is
   not read as a confirmed booking. */
.tba-chip--pending {
  border: 1px solid currentColor;
  color: var(--text-primary, inherit);
}

.tba-card-url {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tba-card-url code {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.75rem;
  color: var(--text-secondary, #475569);
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  padding: 5px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tba-url-copy {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tba-url-copy:hover { background: rgba(148, 163, 184, 0.12); }
.tba-url-copy.is-copied {
  color: var(--primary-600, #0d9488);
  border-color: var(--primary-500, #14b8a6);
}

.tba-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tba-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary, #475569);
  background: var(--bg-secondary, #f1f5f9);
}
.tba-meta-chip i { font-size: 0.65rem; opacity: 0.8; }
.tba-meta-chip--quiet {
  background: transparent;
  border: 1px dashed var(--border-color, #e2e8f0);
}

.tba-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 2px;
}

body.dark-mode .tba-card {
  background: var(--slate-800, #1e293b);
  border-color: var(--slate-600, #475569);
}
body.dark-mode .tba-card:hover { border-color: var(--slate-500, #64748b); }
body.dark-mode .tba-card-title { color: var(--slate-100, #f1f5f9); }
body.dark-mode .tba-card-url code {
  background: var(--slate-900, #0f172a);
  border-color: var(--slate-600, #475569);
  color: var(--slate-300, #cbd5e1);
}
body.dark-mode .tba-url-copy {
  border-color: var(--slate-600, #475569);
  color: var(--slate-100, #f1f5f9);
}
body.dark-mode .tba-url-copy.is-copied { color: var(--primary-400, #2dd4bf); }
body.dark-mode .tba-meta-chip {
  background: var(--slate-700, #334155);
  color: var(--slate-300, #cbd5e1);
}
body.dark-mode .tba-meta-chip--quiet {
  background: transparent;
  border-color: var(--slate-600, #475569);
}

/* Bookings expand (per card) */

.tba-card-bookings {
  border-top: 1px dashed var(--border-color, #e2e8f0);
  padding-top: 10px;
}

.tba-bookings {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.tba-booking {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-secondary, #475569);
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--bg-secondary, #f8fafc);
}

.tba-booking.is-cancelled { opacity: 0.6; }
.tba-booking.is-cancelled .tba-booking-when { text-decoration: line-through; }

.tba-booking-when {
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}

.tba-booking-tz {
  font-weight: 400;
  color: var(--text-muted, #94a3b8);
}

.tba-booking-who { display: inline-flex; align-items: center; gap: 6px; }
.tba-booking-who i { font-size: 0.6rem; opacity: 0.6; }

.tba-bookings-empty {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
}

body.dark-mode .tba-card-bookings { border-top-color: var(--slate-600, #475569); }
body.dark-mode .tba-booking {
  background: var(--slate-900, #0f172a);
  color: var(--slate-400, #94a3b8);
}
body.dark-mode .tba-booking-when { color: var(--slate-100, #f1f5f9); }

/* Availability expand (per card) — mirrors the public page's aggregate strip
   (public/board.html .availstrip): weekday + day number + a bar whose opacity
   ramps with the band. Teal here (the admin surface's accent); the public
   page uses the board's own accent. */

.tba-card-avail {
  border-top: 1px dashed var(--border-color, #e2e8f0);
  padding-top: 10px;
}

.tba-avail-caption {
  margin: 0 0 8px;
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
}

.tba-avail-strip {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tba-avail-day {
  flex: 0 0 auto;
  min-width: 40px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 5px 4px 4px;
  background: var(--bg-primary, #fff);
  text-align: center;
}

.tba-avail-dow {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, #64748b);
}

.tba-avail-num {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}

.tba-avail-bar {
  display: block;
  height: 4px;
  border-radius: 2px;
  margin-top: 4px;
  background: var(--border-color, #e2e8f0);
}

.tba-avail-day--good .tba-avail-bar { background: var(--primary-500, #14b8a6); }
.tba-avail-day--fair .tba-avail-bar { background: var(--primary-500, #14b8a6); opacity: 0.55; }
.tba-avail-day--limited .tba-avail-bar { background: var(--primary-500, #14b8a6); opacity: 0.3; }

body.dark-mode .tba-card-avail { border-top-color: var(--slate-600, #475569); }
body.dark-mode .tba-avail-day {
  background: var(--slate-900, #0f172a);
  border-color: var(--slate-600, #475569);
}
body.dark-mode .tba-avail-dow { color: var(--slate-400, #94a3b8); }
body.dark-mode .tba-avail-num { color: var(--slate-100, #f1f5f9); }
body.dark-mode .tba-avail-bar { background: var(--slate-700, #334155); }
body.dark-mode .tba-avail-day--good .tba-avail-bar,
body.dark-mode .tba-avail-day--fair .tba-avail-bar,
body.dark-mode .tba-avail-day--limited .tba-avail-bar {
  background: var(--primary-500, #14b8a6);
}

/* Blank state */

.tba-blank {
  text-align: center;
  padding: 28px 20px 20px;
  border: 1px dashed var(--border-color, #e2e8f0);
  border-radius: 12px;
}

.tba-blank-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--primary-600, #0d9488);
  background: var(--primary-50, rgba(20, 184, 166, 0.1));
}

.tba-blank h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}

.tba-blank p {
  margin: 0 auto 16px;
  font-size: 0.8rem;
  color: var(--text-secondary, #64748b);
  max-width: 46ch;
}

body.dark-mode .tba-blank { border-color: var(--slate-600, #475569); }
body.dark-mode .tba-blank h3 { color: var(--slate-100, #f1f5f9); }
body.dark-mode .tba-blank-icon {
  background: rgba(20, 184, 166, 0.16);
  color: var(--primary-400, #2dd4bf);
}

/* ---------- Form view ---------- */

.tba-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  padding: 4px 6px 4px 0;
  margin-bottom: 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  border-radius: 6px;
}
.tba-back:hover { color: var(--text-primary, #1e293b); }
body.dark-mode .tba-back:hover { color: var(--slate-100, #f1f5f9); }

.tba-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.tba-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tba-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #64748b);
}
.tba-section-label i { font-size: 0.75rem; opacity: 0.7; }
body.dark-mode .tba-section-label { color: var(--slate-400, #94a3b8); }

.tba-field {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
}

.tba-field-label { display: block; margin-bottom: 6px; }

.tba-optional {
  font-weight: 400;
  color: var(--text-muted, #94a3b8);
}

.tba-field input[type="text"],
.tba-field input[type="number"],
.tba-field textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 400;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #1e293b);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
}

.tba-field input:focus,
.tba-field textarea:focus {
  /* Border + glow as secondary cues; :focus-visible below carries the real
     ring so keyboard focus is never colour-only (WCAG 1.4.11). */
  border-color: var(--primary-500, #14b8a6);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.tba-field input[readonly] {
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-secondary, #64748b);
  cursor: default;
}

body.dark-mode .tba-field input[type="text"],
body.dark-mode .tba-field input[type="number"],
body.dark-mode .tba-field textarea {
  background: var(--slate-900, #0f172a);
  border-color: var(--slate-600, #475569);
  color: var(--slate-100, #f1f5f9);
}
body.dark-mode .tba-field input[readonly] {
  background: var(--slate-800, #1e293b);
  color: var(--slate-400, #94a3b8);
}

.tba-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tba-hint {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted, #94a3b8);
}

/* URL preview */

.tba-url-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  font-size: 0.75rem;
  color: var(--text-secondary, #475569);
  overflow-x: auto;
}
.tba-url-preview i { color: var(--primary-500, #14b8a6); flex: 0 0 auto; }
.tba-url-preview code { white-space: nowrap; }
.tba-url-preview strong { color: var(--text-primary, #1e293b); }

body.dark-mode .tba-url-preview {
  background: var(--slate-900, #0f172a);
  border-color: var(--slate-600, #475569);
  color: var(--slate-400, #94a3b8);
}
body.dark-mode .tba-url-preview strong { color: var(--slate-100, #f1f5f9); }

/* Duration chips */

.tba-duration-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  /* Without this, flex default align-items:stretch inflates EVERY chip to the
     tallest sibling — the Custom chip's inline input — which read as oversized
     pills (measured 59px against the 32px reference). */
  align-items: center;
}

/* Sized to the app's COMPACT duration-chip reference (#view-mode-modal
   .duration-chip / Propose): 32px, 6x12, 12px/500, 1.5px border. Rounded-RECT
   via --radius-xl, NOT a full pill — the pill shape is deliberately reserved
   for date-range chips (.within-chip) so length and range never read as the
   same control (column-settings.css ~6154). */
.tba-duration {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 6px 12px;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-xl, 20px);
  background: var(--bg-primary, #fff);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  transition: all 0.15s ease;
}
.tba-duration:hover { border-color: var(--primary-500, #14b8a6); }
.tba-duration.is-on {
  border-color: var(--primary-500, #14b8a6);
  background: var(--primary-50, rgba(20, 184, 166, 0.1));
  color: var(--primary-700, #0f766e);
  font-weight: 600;
}

/* Selector carries .tba-field so it OUTRANKS the generic
   `.tba-field input[type="number"]` field styling ((0,2,1) vs (0,1,1)) —
   that rule's 9px padding + 5px margin-top was what fattened this inline
   input and, via flex stretch, the whole chip row. */
.tba-field .tba-duration--custom input,
.tba-duration--custom input {
  width: 48px;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 0;
  border-bottom: 1px dashed var(--border-color, #cbd5e1);
}
.tba-duration--custom input:focus { outline: none; border-bottom-color: var(--primary-500, #14b8a6); }

body.dark-mode .tba-duration {
  background: var(--slate-800, #1e293b);
  border-color: var(--slate-600, #475569);
  color: var(--slate-100, #f1f5f9);
}
body.dark-mode .tba-duration.is-on {
  background: rgba(20, 184, 166, 0.2);
  border-color: var(--primary-500, #14b8a6);
  color: var(--primary-300, #5eead4);
}

/* Member pool */

.tba-pool-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tba-pool-count {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary, #64748b);
}

.tba-pool-links { display: inline-flex; gap: 8px; }

/* The pool is a CHECKBOX LIST (owner 2026-10-02, "Yes all"): the row look is
   .pick-list / .pick-row (css/attendee-picker.css). .tba-member is only the
   readers' hook (.tba-member.is-on = in the pool), so it draws nothing here. */
.tba-members { max-height: 264px; }
.tba-member .tba-member-pending,
.tba-member .tba-member-declined { flex: 0 0 auto; }

/* Strategy cards */

.tba-strategies {
  display: grid;
  /* Four ways to route (2026-09-29, "Everyone attends"): two by two. */
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.tba-strategy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  background: var(--bg-primary, #fff);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tba-strategy:hover { border-color: var(--primary-500, #14b8a6); }
.tba-strategy i { color: var(--primary-500, #14b8a6); font-size: 0.85rem; }

.tba-strategy-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}

.tba-strategy-desc {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-secondary, #64748b);
  line-height: 1.35;
}

.tba-strategy.is-on {
  border-color: var(--primary-500, #14b8a6);
  background: var(--primary-50, rgba(20, 184, 166, 0.08));
  box-shadow: 0 0 0 1px var(--primary-500, #14b8a6) inset;
}

body.dark-mode .tba-strategy {
  background: var(--slate-800, #1e293b);
  border-color: var(--slate-600, #475569);
}
body.dark-mode .tba-strategy.is-on { background: rgba(20, 184, 166, 0.15); }
body.dark-mode .tba-strategy-label { color: var(--slate-100, #f1f5f9); }
body.dark-mode .tba-strategy-desc { color: var(--slate-400, #94a3b8); }

/* Rules grid */

.tba-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.tba-num {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  background: var(--bg-primary, #fff);
}

.tba-num-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
}

.tba-num-input {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.tba-num-input input {
  width: 62px;
  padding: 4px 6px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-primary, #1e293b);
}
.tba-num-input input:focus {
  border-color: var(--primary-500, #14b8a6);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.15);
}

.tba-num-unit {
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
}

body.dark-mode .tba-num {
  background: var(--slate-800, #1e293b);
  border-color: var(--slate-600, #475569);
}
body.dark-mode .tba-num-label { color: var(--slate-400, #94a3b8); }
body.dark-mode .tba-num-input input {
  background: var(--slate-900, #0f172a);
  border-color: var(--slate-600, #475569);
  color: var(--slate-100, #f1f5f9);
}

/* Privacy switches */

.tba-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  background: var(--bg-primary, #fff);
  cursor: pointer;
}

.tba-switch-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tba-switch-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}

.tba-switch-desc {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-secondary, #64748b);
  line-height: 1.35;
}

.tba-switch {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
}

.tba-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.tba-switch-track {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full, 9999px);
  background: var(--slate-300, #cbd5e1);
  transition: background 0.15s ease;
  pointer-events: none;
}
.tba-switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
}
.tba-switch input:checked + .tba-switch-track { background: var(--primary-500, #14b8a6); }
.tba-switch input:checked + .tba-switch-track::after { transform: translateX(16px); }

body.dark-mode .tba-switch-row {
  background: var(--slate-800, #1e293b);
  border-color: var(--slate-600, #475569);
}
body.dark-mode .tba-switch-label { color: var(--slate-100, #f1f5f9); }
body.dark-mode .tba-switch-desc { color: var(--slate-400, #94a3b8); }
body.dark-mode .tba-switch-track { background: var(--slate-600, #475569); }

/* Form footer */

.tba-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border-color, #e2e8f0);
  padding-top: 14px;
}
body.dark-mode .tba-form-actions { border-top-color: var(--slate-700, #334155); }

/* ---------- Coarse-pointer floor exemption (SUPERSEDED 2026-09-30) ----------
   Launch fix F16: the owner's norm is a 44px target on every control, so
   these are now 44px FLOORS on every pointer rather than exemptions from the
   coarse-pointer floor. The history below is why they carry !important. */
/* (was:)
   style.css @media (pointer: coarse) floors every <button> and checkbox to a
   44px box (:1398). `pointer: coarse` is the INPUT DEVICE, not the screen, so
   it also fires on touchscreen desktops, where it would inflate these compact
   chips. Same escape the app's other compact chips use (#vm-bt-*
   .duration-chip, .status-indicator exemption): plain-specificity rules lose
   min-height to the floor, so !important. The 32px chip matches the compact
   duration-chip reference; the rest keep their natural padding-derived size.
   (The oversized chips reported on 2026-08-31 had a DIFFERENT cause — flex
   stretch against the Custom chip's over-styled inline input, fixed at
   .tba-duration-row — but the floor reproduces the same look on any
   touchscreen device, so both defences stay.) */
.tba-duration {
  min-height: 44px !important;
  min-width: 0 !important;
  box-sizing: border-box;
}
.tba-member,
.tba-url-copy,
.tba-linklike,
.tba-back {
  min-height: 44px !important;
  min-width: 44px !important;
  box-sizing: border-box;
}
/* The switch's invisible checkbox must stay an EXACT overlay of the 38x22
   track — the coarse floor would stretch it into a 44px hit zone that
   overlaps the row text. */
.tba-switch input {
  min-width: 0 !important;
  min-height: 0 !important;
}

/* ---------- Focus (keyboard) ---------- */
/* Every interactive element gets a visible ring of its own; colour shifts
   alone fail WCAG 1.4.11 against the resting border. */

.tba-close:focus-visible,
.tba-back:focus-visible,
.tba-linklike:focus-visible,
.tba-url-copy:focus-visible,
.tba-duration:focus-visible,
.tba-member:focus-visible,
.tba-strategy:focus-visible,
.tba-form input:focus-visible,
.tba-form textarea:focus-visible,
.tba-switch input:focus-visible + .tba-switch-track {
  outline: var(--focus-ring-width, 2px) solid var(--focus-ring, var(--primary-500, #14b8a6));
  outline-offset: 2px;
}

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
  .tba-field-row { grid-template-columns: 1fr; }
  .tba-strategies { grid-template-columns: 1fr; }
  .tba-list-head { flex-direction: column; align-items: stretch; }
  .tba-list-head .btn { align-self: flex-start; }
  .tba-card-actions { justify-content: flex-start; }
}

/* ── Pool invitation state (consent, 2026-09-02) ───────────────────────────
   A member added to a pool is "Invited" until they accept; the router does
   not offer or route them before that. */
.tba-member-pending { margin-left: 6px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 999px; background: var(--warning-100, #fef3c7); color: var(--warning-700, #b45309); }
body.dark-mode .tba-member-pending { background: #3a2c10; color: #e0a54a; }

/* DECLINED (2026-09-23): the member said no, which is an answer, not an error,
   so it reads quiet slate rather than red. The "Ask again" row sits under the
   chips because a chip is itself a toggle button. */
.tba-member-declined { margin-left: 6px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 999px; background: var(--surface-muted, #f1f5f9); color: var(--text-secondary, #475569); }
body.dark-mode .tba-member-declined { background: #1e293b; color: #cbd5e1; }
.tba-declined { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tba-declined-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 6px 10px; border: 1px solid var(--border-color, #e2e8f0); border-radius: 8px; }
.tba-declined-text { font-size: 0.8rem; color: var(--text-secondary, #475569); min-width: 0; }
body.dark-mode .tba-declined-row { border-color: #334155; }
body.dark-mode .tba-declined-text { color: #cbd5e1; }

/* WHERE YOU'LL MEET (2026-09-23). The joinUrl box sat in a .tba-num card with
   only an inline width, so it rendered as a bare browser input beside the
   styled number fields. One rule for every free-text control in a .tba-num
   card: the video link, the location type, and the number/address. */
.tba-num input[type="url"],
.tba-num input[type="text"],
.tba-num select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  font: inherit;
  font-size: 0.85rem;
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-primary, #1e293b);
}
.tba-num input[type="url"]:focus,
.tba-num input[type="text"]:focus,
.tba-num select:focus {
  border-color: var(--primary-500, #14b8a6);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.15);
}
body.dark-mode .tba-num input[type="url"],
body.dark-mode .tba-num input[type="text"],
body.dark-mode .tba-num select {
  background: var(--slate-900, #0f172a);
  border-color: var(--slate-600, #475569);
  color: var(--slate-100, #f1f5f9);
}
/* Type + detail side by side; the detail takes the room. Stacks on phones. */
.tba-where-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 2fr;
  gap: 10px;
  margin-top: 10px;
}
@media (max-width: 520px) {
  .tba-where-row { grid-template-columns: 1fr; }
}

/* Change history in the link editor (2026-09-24, precautions item 8). */
.tba-history { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tba-history-row { font-size: 13px; line-height: 1.4; color: var(--text-primary, #0f172a); }
.tba-history-when { color: var(--text-secondary, #64748b); margin-left: 4px; }
body.dark-mode .tba-history-row { color: var(--slate-100, #f1f5f9); }
body.dark-mode .tba-history-when { color: var(--slate-400, #94a3b8); }

/* "Also offer" meeting lengths (2026-09-29): a wrap of plain checkboxes. */
.bb-also, .tba-also { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.bb-also-opt, .tba-also-opt { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: .9rem; cursor: pointer; }

/* ── 44px TOUCH TARGETS (launch fix F16, 2026-09-30) ─────────────────────
   Measured at 412 in the launch audit: New link / card actions 32 tall,
   Copy 64x24, All links 71x27, Everyone / No one 22, number fields 30,
   checkboxes 18, the custom length box 19. */
#team-booking-admin-modal .btn,
#team-booking-admin-modal .btn-sm { min-height: 44px; }
.tba-close { width: 44px; height: 44px; }
.tba-linklike { display: inline-flex; align-items: center; justify-content: center; padding: 2px 8px; }
.tba-url-copy { justify-content: center; }
.tba-num-input { align-items: center; }
.tba-num-input input { min-height: 44px; box-sizing: border-box; }
.tba-field input[type="text"], .tba-field input[type="number"], .tba-field textarea,
.tba-num input[type="url"], .tba-num input[type="text"], .tba-num input[type="date"], .tba-num select { min-height: 44px; box-sizing: border-box; }
.tba-field .tba-duration--custom input, .tba-duration--custom input { min-height: 32px; width: 56px; }
.tba-also-opt input { width: var(--checkbox-size, 18px); height: var(--checkbox-size, 18px); }
/* The plan gate (F7) and the collective "waiting" note (F1). */
.tba-gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.tba-card-waiting { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; font-size: 0.8rem; line-height: 1.4;
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
body.dark-mode .tba-card-waiting { background: rgba(180, 83, 9, 0.18); border-color: #92400e; color: #fcd34d; }

/* ── Three steps (2026-10-07, approved round 7): How, People, Details ──── */
.tba-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; list-style: none; margin: 4px 0 14px; padding: 0; }
.tba-step-tab { display: block; width: 100%; padding: 0 0 6px; border: 0; background: none; font: inherit; font-size: 0.72rem; font-weight: 700; color: var(--text-muted, #94a3b8); text-align: left; cursor: pointer; }
.tba-step-tab i { display: block; height: 4px; border-radius: 2px; background: var(--border-color, #e2e8f0); margin-bottom: 6px; }
.tba-step-tab.is-done, .tba-step-tab.is-now { color: var(--primary-700, #0f766e); }
.tba-step-tab.is-done i { background: #99f6e4; }
.tba-step-tab.is-now i { background: var(--primary-500, #14b8a6); }
.tba-step[hidden], .tba-form-actions [hidden] { display: none; }

/* Sharing choices, one per row, each with a small board picture: three
   people's rows, teal blocks where bookings land (never amber: amber is the
   guest's pick on the booking page). */
.tba-strategies--pics { grid-template-columns: 1fr; }
.tba-strategy .tba-pic { position: relative; display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 8px; margin-bottom: 4px; border-radius: 8px; background: var(--surface-secondary, #f8fafc); box-sizing: border-box; }
.tba-strategy .tba-pic-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); height: 12px; border-radius: 3px; overflow: hidden; background: #e2e8f0; }
.tba-strategy .tba-pic i { display: block; font-size: 8px; font-style: normal; font-weight: 800; line-height: 12px; text-align: center; color: #fff; border-right: 1px solid rgba(255, 255, 255, 0.7); }
.tba-strategy .tba-pic i.on { background: var(--primary-600, #0d9488); }
.tba-strategy .tba-pic--all::after { content: ''; position: absolute; top: 5px; bottom: 5px; left: calc(8px + (100% - 16px) * 7 / 12 - 2px); width: calc((100% - 16px) / 12 + 4px); border: 2px solid var(--primary-700, #0f766e); border-radius: 5px; }
body.dark-mode .tba-strategy .tba-pic { background: var(--slate-900, #0f172a); }
body.dark-mode .tba-strategy .tba-pic-row { background: var(--slate-700, #334155); }

/* Each person's open hours (People step) and the warning when someone
   picked has none. */
.tba-member-hours { margin-left: 6px; font-size: 11px; font-weight: 600; }
.tba-member-hours--ok { color: var(--primary-700, #0f766e); }
.tba-member-hours--none { color: var(--text-secondary, #64748b); }
.tba-hours-warn { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 0.78rem; }
.tba-hours-warn[hidden] { display: none; }
body.dark-mode .tba-hours-warn { background: rgba(180, 83, 9, 0.18); border-color: #92400e; color: #fcd34d; }
body.dark-mode .tba-member-hours--ok { color: #5eead4; }
