/**
 * 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;
}

.tba-close {
  flex: 0 0 auto;
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full, 9999px);
  cursor: pointer;
  color: var(--text-secondary, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.tba-close:hover {
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-primary, #1e293b);
}

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.dark-mode .tba-close:hover {
  background: var(--slate-700, #334155);
  color: var(--slate-100, #f1f5f9);
}

/* ---------- 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 ---------- */

.tba-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tba-btn--primary {
  background: var(--primary-500, #14b8a6);
  color: #fff;
}
.tba-btn--primary:hover:not(:disabled) { background: var(--primary-600, #0d9488); }
.tba-btn--primary:disabled { opacity: 0.55; cursor: not-allowed; }

.tba-btn--ghost {
  background: transparent;
  border-color: var(--border-color, #e2e8f0);
  color: var(--text-primary, #1e293b);
}
.tba-btn--ghost:hover { background: rgba(148, 163, 184, 0.12); }

.tba-btn--danger {
  background: transparent;
  color: var(--danger-fg, #b91c1c);
  border-color: var(--danger-border, #fecaca);
}
.tba-btn--danger:hover { background: var(--danger-bg, #fef2f2); }

body.dark-mode .tba-btn--ghost {
  border-color: var(--slate-600, #475569);
  color: var(--slate-100, #f1f5f9);
}
body.dark-mode .tba-btn--danger {
  color: #fca5a5;
  border-color: #7f1d1d;
}
body.dark-mode .tba-btn--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);
}

.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;
}
.tba-card-actions .tba-btn { padding: 6px 10px; font-size: 0.72rem; }

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; }

.tba-members {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 190px;
  overflow-y: auto;
  padding: 2px;
}

.tba-member {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-full, 9999px);
  background: var(--bg-primary, #fff);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}
.tba-member:hover { border-color: var(--primary-500, #14b8a6); }

.tba-member-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-secondary, #64748b);
  transition: all 0.15s ease;
}

.tba-member-check {
  font-size: 0.65rem;
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: all 0.15s ease;
  color: var(--primary-600, #0d9488);
}

.tba-member.is-on {
  border-color: var(--primary-500, #14b8a6);
  background: var(--primary-50, rgba(20, 184, 166, 0.1));
  color: var(--text-primary, #1e293b);
  font-weight: 600;
}
.tba-member.is-on .tba-member-avatar {
  background: var(--primary-500, #14b8a6);
  color: #fff;
}
.tba-member.is-on .tba-member-check { opacity: 1; width: 12px; }

body.dark-mode .tba-member {
  background: var(--slate-800, #1e293b);
  border-color: var(--slate-600, #475569);
  color: var(--slate-300, #cbd5e1);
}
body.dark-mode .tba-member.is-on {
  background: rgba(20, 184, 166, 0.18);
  color: var(--slate-100, #f1f5f9);
}
body.dark-mode .tba-member-avatar {
  background: var(--slate-700, #334155);
  color: var(--slate-300, #cbd5e1);
}
body.dark-mode .tba-member.is-on .tba-member-avatar {
  background: var(--primary-500, #14b8a6);
  color: #04211d;
}

/* Strategy cards */

.tba-strategies {
  display: grid;
  grid-template-columns: repeat(3, 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 ----------
   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: 32px !important;
  min-width: 0 !important;
  box-sizing: border-box;
}
.tba-member,
.tba-url-copy,
.tba-linklike,
.tba-back,
.tba-btn {
  min-height: auto !important;
  min-width: 0 !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-btn:focus-visible,
.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;
}

/* ---------- Pool coverage strip ----------
   The group read for "who takes bookings": 24 hourly cells showing how many
   SELECTED members are inside their working hours. Cell fills are set inline
   from EventStatusUtils.STATUS_PRESENTATION (JS owns the hue so this strip
   cannot drift from the board palette); everything here is geometry + chrome. */

.tba-coverage {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  background: var(--surface-secondary, #f8fafc);
}

.tba-cov-strip {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 1px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--border-color, #e2e8f0);
}

/* EVERY CELL IS LABELLED with its hour (product norm — mirrors the compact
   timeline cell). The label sits INSIDE the cell rather than on a separate
   axis row, so an hour and its coverage can never drift apart when the strip
   is scrolled, clipped, or read at a glance. */
.tba-cov-cell {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* background-color is set inline (canonical palette, JS-resolved) */
}

.tba-cov-hour {
  font-size: 0.56rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  /* Ink is chosen PER BAND and MEASURED in Chrome, not eyeballed (2026-09-01).
     Fills are the board's own day-cycle hues (owner ruling after a
     medal-tinted detour: "that's not my colour system" — medals are the
     VOTING vocabulary, not day-strip paint):
       flex   #fbbf24 + slate 76%      = 6.22  AA pass
       green  #16a34a + slate 76%      = 3.85  FAIL
       green  #16a34a + WHITE          = 3.30  WORSE — that mid green is the
                                               problem, white is not the fix
       green  #16a34a + slate 100%     = 5.42  AA pass  <- chosen
       purple #7c3aed + white 92%      = 5.70  AA pass
     The lever is the INK, never the fill: the fills come from
     STATUS_PRESENTATION and recolouring them here would fork the palette. */
  color: rgba(15, 23, 42, 0.76);
}

/* Green (2+ covered): same slate, full opacity — 3.85 -> 5.42. */
.tba-cov-cell[data-cov="working"] .tba-cov-hour { color: #0f172a; }

/* Purple (gap) is dark enough that slate ink disappears; light ink there. */
.tba-cov-cell[data-cov="sleep"] .tba-cov-hour { color: rgba(255, 255, 255, 0.92); }

/* Every third hour (00/03/06…) reads stronger, matching the timeline's
   minor-hour convention. */
.tba-cov-cell.minor-hour .tba-cov-hour { opacity: 0.62; font-weight: 600; }

/* Nobody available reads as a GAP, not just a colour: the stripe survives
   greyscale, colour-blind vision, and a low-contrast display. Same stripe
   idiom the scanner uses for its severity states. */
.tba-cov-cell[data-cov="sleep"] {
  background-image: repeating-linear-gradient(
    -45deg, transparent, transparent 3px,
    rgba(255, 255, 255, 0.45) 3px, rgba(255, 255, 255, 0.45) 6px);
}

.tba-cov-read {
  margin: 7px 0 0;
  font-size: 0.75rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.45;
}

.tba-cov-note {
  margin: 3px 0 0;
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
}

.tba-coverage-hint { margin-top: 12px; }

body.dark-mode .tba-coverage {
  background: var(--surface-secondary, #1e293b);
  border-color: var(--border-color, #334155);
}
body.dark-mode .tba-cov-strip { background: var(--border-color, #334155); }

/* ---------- 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 .tba-btn { align-self: flex-start; }
  .tba-card-actions { justify-content: flex-start; }
  /* 24 two-digit labels stop fitting below ~600px. Keep every cell (the
     coverage shape is the point) and keep all 24 hours reachable via the
     tooltip + aria-label, but show the numeral only every third hour so the
     row stays legible instead of turning into a smear. */
  .tba-cov-cell { height: 20px; }
  .tba-cov-cell.minor-hour .tba-cov-hour { display: none; }
}

/* ── 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; }
